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A,CAAc,IAAI,YAAY,wBACrC,GACF,EAEA,EAAI,IAAA,CAAK,OAAQ,GACjB,EAAI,gBAAA,CAAiB,mBAAoB,kBACzC,EAAI,gBAAA,CAAiB,aAAc,OAAO,MAAA,CAAO,QAAA,CAAS,QAA1D,EACA,EAAI,gBAAA,CAAiB,cAAe,GAAU,cACxC,EACJ,IAAK,IAAI,KAAK,EACZ,QAAQ,GAAA,CAAI,wBAAyB,EAAG,KAAM,CAAO,CAAC,EAAE,EACxD,EAAI,gBAAA,CAAiB,EAAG,CAAO,CAAC,EAAE,EAGtC,OAAO,aAAA,CAAc,IAAI,YAAY,yBACrC,EAAI,IAAA,CAAK,EACX,EAEA,mBAAmB;AAEnB,OAAO,gBAAA,CAAiB,WAAY,SAAS,CAAK,EAC5C,EAAM,KAAA,EAAS,AAA6B,KAAA,IAA7B,EAAM,KAAA,CAAM,YAAA,EAC7B,QAAQ,GAAA,CAAI,4BACZ,EAAY,EAAO,EAAM,KAAA,CAAM,YAA/B,GAEA,OAAO,QAAA,CAAW,SAAS,IAD7B,AAGF,GAEA,IAAM,GAAY,IAAI,MAAM,sBAEf,GAAc,WACzB,SAAS,aAAA,CAAc,GACzB,EAIa,GAAQ,SAAS,CAAE,CAAE,CAAA,QAAC,EAAQ,CAAA,CAAA,CAAM,CAAC,CAAC,CAAC,EAC9C,AAAuB,WAAvB,SAAS,UAAA,CACX,IACS,SAAS,gBAAA,CAClB,SAAS,gBAAA,CAAiB,mBAAoB,GAE9C,SAAS,WAAA,CAAY,qBAAsB,WACd,WAAvB,SAAS,UAAA,EACX,GACJ,GAEE,GAAS,SAAS,gBAAA,CAAiB,qBAAsB,EAC/D,C,C,G,qC","sources":["<anon>","hypergen.js","node_modules/morphdom/dist/morphdom-esm.js","websocket.js","node_modules/sockette/dist/sockette.mjs"],"sourcesContent":["(() => {\nfunction $parcel$export(e, n, v, s) {\n  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $5d2e5e1479d27cab$exports = {};\n\n$parcel$export($5d2e5e1479d27cab$exports, \"morph\", () => $5d2e5e1479d27cab$export$2e5e8c41f5d4e7c7);\n$parcel$export($5d2e5e1479d27cab$exports, \"remove\", () => $5d2e5e1479d27cab$export$cd7f480d6b8286c3);\n$parcel$export($5d2e5e1479d27cab$exports, \"hide\", () => $5d2e5e1479d27cab$export$fe8985bb6374093c);\n$parcel$export($5d2e5e1479d27cab$exports, \"display\", () => $5d2e5e1479d27cab$export$79693fdaa4661ff2);\n$parcel$export($5d2e5e1479d27cab$exports, \"visible\", () => $5d2e5e1479d27cab$export$664c6d24e3175067);\n$parcel$export($5d2e5e1479d27cab$exports, \"hidden\", () => $5d2e5e1479d27cab$export$73920f18ca706874);\n$parcel$export($5d2e5e1479d27cab$exports, \"redirect\", () => $5d2e5e1479d27cab$export$89e12c5b50f7529d);\n$parcel$export($5d2e5e1479d27cab$exports, \"append\", () => $5d2e5e1479d27cab$export$10d8903dec122b9d);\n$parcel$export($5d2e5e1479d27cab$exports, \"prepend\", () => $5d2e5e1479d27cab$export$68159836694e22c1);\n$parcel$export($5d2e5e1479d27cab$exports, \"setClientState\", () => $5d2e5e1479d27cab$export$117c6580f10117fb);\n$parcel$export($5d2e5e1479d27cab$exports, \"intervalSet\", () => $5d2e5e1479d27cab$export$dd6ad98138aae6a3);\n$parcel$export($5d2e5e1479d27cab$exports, \"applyCommands\", () => $5d2e5e1479d27cab$export$41528721a63e1cee);\n$parcel$export($5d2e5e1479d27cab$exports, \"intervalClear\", () => $5d2e5e1479d27cab$export$fb5deb78d2f5421);\n$parcel$export($5d2e5e1479d27cab$exports, \"addEventListener\", () => $5d2e5e1479d27cab$export$3f65cefe8380dbea);\n$parcel$export($5d2e5e1479d27cab$exports, \"callback\", () => $5d2e5e1479d27cab$export$eb872837e3137261);\n$parcel$export($5d2e5e1479d27cab$exports, \"keypressToCallback\", () => $5d2e5e1479d27cab$export$aebc7529e8ab5fd3);\n$parcel$export($5d2e5e1479d27cab$exports, \"keypressToCallbackRemove\", () => $5d2e5e1479d27cab$export$4bf93dbed412fb4d);\n$parcel$export($5d2e5e1479d27cab$exports, \"throttle\", () => $5d2e5e1479d27cab$export$de363e709c412c8a);\n$parcel$export($5d2e5e1479d27cab$exports, \"partialLoad\", () => $5d2e5e1479d27cab$export$73395861aa8174cf);\n$parcel$export($5d2e5e1479d27cab$exports, \"onpushstate\", () => $5d2e5e1479d27cab$export$cfdba980e7d40be8);\n$parcel$export($5d2e5e1479d27cab$exports, \"cancelThrottle\", () => $5d2e5e1479d27cab$export$2ab6c72538d2a4d7);\n$parcel$export($5d2e5e1479d27cab$exports, \"event\", () => $5d2e5e1479d27cab$export$6cd530ed55e06764);\n$parcel$export($5d2e5e1479d27cab$exports, \"coerce\", () => $5d2e5e1479d27cab$export$8c14e57e778d3873);\n$parcel$export($5d2e5e1479d27cab$exports, \"read\", () => $5d2e5e1479d27cab$export$aafa59e2e03f2942);\n$parcel$export($5d2e5e1479d27cab$exports, \"when\", () => $5d2e5e1479d27cab$export$a55877ca9db47377);\n$parcel$export($5d2e5e1479d27cab$exports, \"element\", () => $5d2e5e1479d27cab$export$8454457683f90105);\n$parcel$export($5d2e5e1479d27cab$exports, \"reviver\", () => $5d2e5e1479d27cab$export$63698c10df99509c);\n$parcel$export($5d2e5e1479d27cab$exports, \"ready\", () => $5d2e5e1479d27cab$export$28ee1007e174a2a6);\nvar $d6aa37e28bb14658$var$DOCUMENT_FRAGMENT_NODE = 11;\nfunction $d6aa37e28bb14658$var$morphAttrs(fromNode, toNode) {\n    var toNodeAttrs = toNode.attributes;\n    var attr;\n    var attrName;\n    var attrNamespaceURI;\n    var attrValue;\n    var fromValue;\n    // document-fragments dont have attributes so lets not do anything\n    if (toNode.nodeType === $d6aa37e28bb14658$var$DOCUMENT_FRAGMENT_NODE || fromNode.nodeType === $d6aa37e28bb14658$var$DOCUMENT_FRAGMENT_NODE) return;\n    // update attributes on original DOM element\n    for(var i = toNodeAttrs.length - 1; i >= 0; i--){\n        attr = toNodeAttrs[i];\n        attrName = attr.name;\n        attrNamespaceURI = attr.namespaceURI;\n        attrValue = attr.value;\n        if (attrNamespaceURI) {\n            attrName = attr.localName || attrName;\n            fromValue = fromNode.getAttributeNS(attrNamespaceURI, attrName);\n            if (fromValue !== attrValue) {\n                if (attr.prefix === \"xmlns\") attrName = attr.name; // It's not allowed to set an attribute with the XMLNS namespace without specifying the `xmlns` prefix\n                fromNode.setAttributeNS(attrNamespaceURI, attrName, attrValue);\n            }\n        } else {\n            fromValue = fromNode.getAttribute(attrName);\n            if (fromValue !== attrValue) fromNode.setAttribute(attrName, attrValue);\n        }\n    }\n    // Remove any extra attributes found on the original DOM element that\n    // weren't found on the target element.\n    var fromNodeAttrs = fromNode.attributes;\n    for(var d = fromNodeAttrs.length - 1; d >= 0; d--){\n        attr = fromNodeAttrs[d];\n        attrName = attr.name;\n        attrNamespaceURI = attr.namespaceURI;\n        if (attrNamespaceURI) {\n            attrName = attr.localName || attrName;\n            if (!toNode.hasAttributeNS(attrNamespaceURI, attrName)) fromNode.removeAttributeNS(attrNamespaceURI, attrName);\n        } else if (!toNode.hasAttribute(attrName)) fromNode.removeAttribute(attrName);\n    }\n}\nvar $d6aa37e28bb14658$var$range; // Create a range object for efficently rendering strings to elements.\nvar $d6aa37e28bb14658$var$NS_XHTML = \"http://www.w3.org/1999/xhtml\";\nvar $d6aa37e28bb14658$var$doc = typeof document === \"undefined\" ? undefined : document;\nvar $d6aa37e28bb14658$var$HAS_TEMPLATE_SUPPORT = !!$d6aa37e28bb14658$var$doc && \"content\" in $d6aa37e28bb14658$var$doc.createElement(\"template\");\nvar $d6aa37e28bb14658$var$HAS_RANGE_SUPPORT = !!$d6aa37e28bb14658$var$doc && $d6aa37e28bb14658$var$doc.createRange && \"createContextualFragment\" in $d6aa37e28bb14658$var$doc.createRange();\nfunction $d6aa37e28bb14658$var$createFragmentFromTemplate(str) {\n    var template = $d6aa37e28bb14658$var$doc.createElement(\"template\");\n    template.innerHTML = str;\n    return template.content.childNodes[0];\n}\nfunction $d6aa37e28bb14658$var$createFragmentFromRange(str) {\n    if (!$d6aa37e28bb14658$var$range) {\n        $d6aa37e28bb14658$var$range = $d6aa37e28bb14658$var$doc.createRange();\n        $d6aa37e28bb14658$var$range.selectNode($d6aa37e28bb14658$var$doc.body);\n    }\n    var fragment = $d6aa37e28bb14658$var$range.createContextualFragment(str);\n    return fragment.childNodes[0];\n}\nfunction $d6aa37e28bb14658$var$createFragmentFromWrap(str) {\n    var fragment = $d6aa37e28bb14658$var$doc.createElement(\"body\");\n    fragment.innerHTML = str;\n    return fragment.childNodes[0];\n}\n/**\n * This is about the same\n * var html = new DOMParser().parseFromString(str, 'text/html');\n * return html.body.firstChild;\n *\n * @method toElement\n * @param {String} str\n */ function $d6aa37e28bb14658$var$toElement(str) {\n    str = str.trim();\n    if ($d6aa37e28bb14658$var$HAS_TEMPLATE_SUPPORT) // avoid restrictions on content for things like `<tr><th>Hi</th></tr>` which\n    // createContextualFragment doesn't support\n    // <template> support not available in IE\n    return $d6aa37e28bb14658$var$createFragmentFromTemplate(str);\n    else if ($d6aa37e28bb14658$var$HAS_RANGE_SUPPORT) return $d6aa37e28bb14658$var$createFragmentFromRange(str);\n    return $d6aa37e28bb14658$var$createFragmentFromWrap(str);\n}\n/**\n * Returns true if two node's names are the same.\n *\n * NOTE: We don't bother checking `namespaceURI` because you will never find two HTML elements with the same\n *       nodeName and different namespace URIs.\n *\n * @param {Element} a\n * @param {Element} b The target element\n * @return {boolean}\n */ function $d6aa37e28bb14658$var$compareNodeNames(fromEl, toEl) {\n    var fromNodeName = fromEl.nodeName;\n    var toNodeName = toEl.nodeName;\n    var fromCodeStart, toCodeStart;\n    if (fromNodeName === toNodeName) return true;\n    fromCodeStart = fromNodeName.charCodeAt(0);\n    toCodeStart = toNodeName.charCodeAt(0);\n    // If the target element is a virtual DOM node or SVG node then we may\n    // need to normalize the tag name before comparing. Normal HTML elements that are\n    // in the \"http://www.w3.org/1999/xhtml\"\n    // are converted to upper case\n    if (fromCodeStart <= 90 && toCodeStart >= 97) return fromNodeName === toNodeName.toUpperCase();\n    else if (toCodeStart <= 90 && fromCodeStart >= 97) return toNodeName === fromNodeName.toUpperCase();\n    else return false;\n}\n/**\n * Create an element, optionally with a known namespace URI.\n *\n * @param {string} name the element name, e.g. 'div' or 'svg'\n * @param {string} [namespaceURI] the element's namespace URI, i.e. the value of\n * its `xmlns` attribute or its inferred namespace.\n *\n * @return {Element}\n */ function $d6aa37e28bb14658$var$createElementNS(name, namespaceURI) {\n    return !namespaceURI || namespaceURI === $d6aa37e28bb14658$var$NS_XHTML ? $d6aa37e28bb14658$var$doc.createElement(name) : $d6aa37e28bb14658$var$doc.createElementNS(namespaceURI, name);\n}\n/**\n * Copies the children of one DOM element to another DOM element\n */ function $d6aa37e28bb14658$var$moveChildren(fromEl, toEl) {\n    var curChild = fromEl.firstChild;\n    while(curChild){\n        var nextChild = curChild.nextSibling;\n        toEl.appendChild(curChild);\n        curChild = nextChild;\n    }\n    return toEl;\n}\nfunction $d6aa37e28bb14658$var$syncBooleanAttrProp(fromEl, toEl, name) {\n    if (fromEl[name] !== toEl[name]) {\n        fromEl[name] = toEl[name];\n        if (fromEl[name]) fromEl.setAttribute(name, \"\");\n        else fromEl.removeAttribute(name);\n    }\n}\nvar $d6aa37e28bb14658$var$specialElHandlers = {\n    OPTION: function(fromEl, toEl) {\n        var parentNode = fromEl.parentNode;\n        if (parentNode) {\n            var parentName = parentNode.nodeName.toUpperCase();\n            if (parentName === \"OPTGROUP\") {\n                parentNode = parentNode.parentNode;\n                parentName = parentNode && parentNode.nodeName.toUpperCase();\n            }\n            if (parentName === \"SELECT\" && !parentNode.hasAttribute(\"multiple\")) {\n                if (fromEl.hasAttribute(\"selected\") && !toEl.selected) {\n                    // Workaround for MS Edge bug where the 'selected' attribute can only be\n                    // removed if set to a non-empty value:\n                    // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12087679/\n                    fromEl.setAttribute(\"selected\", \"selected\");\n                    fromEl.removeAttribute(\"selected\");\n                }\n                // We have to reset select element's selectedIndex to -1, otherwise setting\n                // fromEl.selected using the syncBooleanAttrProp below has no effect.\n                // The correct selectedIndex will be set in the SELECT special handler below.\n                parentNode.selectedIndex = -1;\n            }\n        }\n        $d6aa37e28bb14658$var$syncBooleanAttrProp(fromEl, toEl, \"selected\");\n    },\n    /**\n     * The \"value\" attribute is special for the <input> element since it sets\n     * the initial value. Changing the \"value\" attribute without changing the\n     * \"value\" property will have no effect since it is only used to the set the\n     * initial value.  Similar for the \"checked\" attribute, and \"disabled\".\n     */ INPUT: function(fromEl, toEl) {\n        $d6aa37e28bb14658$var$syncBooleanAttrProp(fromEl, toEl, \"checked\");\n        $d6aa37e28bb14658$var$syncBooleanAttrProp(fromEl, toEl, \"disabled\");\n        if (fromEl.value !== toEl.value) fromEl.value = toEl.value;\n        if (!toEl.hasAttribute(\"value\")) fromEl.removeAttribute(\"value\");\n    },\n    TEXTAREA: function(fromEl, toEl) {\n        var newValue = toEl.value;\n        if (fromEl.value !== newValue) fromEl.value = newValue;\n        var firstChild = fromEl.firstChild;\n        if (firstChild) {\n            // Needed for IE. Apparently IE sets the placeholder as the\n            // node value and vise versa. This ignores an empty update.\n            var oldValue = firstChild.nodeValue;\n            if (oldValue == newValue || !newValue && oldValue == fromEl.placeholder) return;\n            firstChild.nodeValue = newValue;\n        }\n    },\n    SELECT: function(fromEl, toEl) {\n        if (!toEl.hasAttribute(\"multiple\")) {\n            var selectedIndex = -1;\n            var i = 0;\n            // We have to loop through children of fromEl, not toEl since nodes can be moved\n            // from toEl to fromEl directly when morphing.\n            // At the time this special handler is invoked, all children have already been morphed\n            // and appended to / removed from fromEl, so using fromEl here is safe and correct.\n            var curChild = fromEl.firstChild;\n            var optgroup;\n            var nodeName;\n            while(curChild){\n                nodeName = curChild.nodeName && curChild.nodeName.toUpperCase();\n                if (nodeName === \"OPTGROUP\") {\n                    optgroup = curChild;\n                    curChild = optgroup.firstChild;\n                } else {\n                    if (nodeName === \"OPTION\") {\n                        if (curChild.hasAttribute(\"selected\")) {\n                            selectedIndex = i;\n                            break;\n                        }\n                        i++;\n                    }\n                    curChild = curChild.nextSibling;\n                    if (!curChild && optgroup) {\n                        curChild = optgroup.nextSibling;\n                        optgroup = null;\n                    }\n                }\n            }\n            fromEl.selectedIndex = selectedIndex;\n        }\n    }\n};\nvar $d6aa37e28bb14658$var$ELEMENT_NODE = 1;\nvar $d6aa37e28bb14658$var$DOCUMENT_FRAGMENT_NODE$1 = 11;\nvar $d6aa37e28bb14658$var$TEXT_NODE = 3;\nvar $d6aa37e28bb14658$var$COMMENT_NODE = 8;\nfunction $d6aa37e28bb14658$var$noop() {}\nfunction $d6aa37e28bb14658$var$defaultGetNodeKey(node) {\n    if (node) return node.getAttribute && node.getAttribute(\"id\") || node.id;\n}\nfunction $d6aa37e28bb14658$var$morphdomFactory(morphAttrs) {\n    return function morphdom(fromNode, toNode, options) {\n        if (!options) options = {};\n        if (typeof toNode === \"string\") {\n            if (fromNode.nodeName === \"#document\" || fromNode.nodeName === \"HTML\" || fromNode.nodeName === \"BODY\") {\n                var toNodeHtml = toNode;\n                toNode = $d6aa37e28bb14658$var$doc.createElement(\"html\");\n                toNode.innerHTML = toNodeHtml;\n            } else toNode = $d6aa37e28bb14658$var$toElement(toNode);\n        }\n        var getNodeKey = options.getNodeKey || $d6aa37e28bb14658$var$defaultGetNodeKey;\n        var onBeforeNodeAdded = options.onBeforeNodeAdded || $d6aa37e28bb14658$var$noop;\n        var onNodeAdded = options.onNodeAdded || $d6aa37e28bb14658$var$noop;\n        var onBeforeElUpdated = options.onBeforeElUpdated || $d6aa37e28bb14658$var$noop;\n        var onElUpdated = options.onElUpdated || $d6aa37e28bb14658$var$noop;\n        var onBeforeNodeDiscarded = options.onBeforeNodeDiscarded || $d6aa37e28bb14658$var$noop;\n        var onNodeDiscarded = options.onNodeDiscarded || $d6aa37e28bb14658$var$noop;\n        var onBeforeElChildrenUpdated = options.onBeforeElChildrenUpdated || $d6aa37e28bb14658$var$noop;\n        var childrenOnly = options.childrenOnly === true;\n        // This object is used as a lookup to quickly find all keyed elements in the original DOM tree.\n        var fromNodesLookup = Object.create(null);\n        var keyedRemovalList = [];\n        function addKeyedRemoval(key) {\n            keyedRemovalList.push(key);\n        }\n        function walkDiscardedChildNodes(node, skipKeyedNodes) {\n            if (node.nodeType === $d6aa37e28bb14658$var$ELEMENT_NODE) {\n                var curChild = node.firstChild;\n                while(curChild){\n                    var key = undefined;\n                    if (skipKeyedNodes && (key = getNodeKey(curChild))) // If we are skipping keyed nodes then we add the key\n                    // to a list so that it can be handled at the very end.\n                    addKeyedRemoval(key);\n                    else {\n                        // Only report the node as discarded if it is not keyed. We do this because\n                        // at the end we loop through all keyed elements that were unmatched\n                        // and then discard them in one final pass.\n                        onNodeDiscarded(curChild);\n                        if (curChild.firstChild) walkDiscardedChildNodes(curChild, skipKeyedNodes);\n                    }\n                    curChild = curChild.nextSibling;\n                }\n            }\n        }\n        /**\n         * Removes a DOM node out of the original DOM\n         *\n         * @param  {Node} node The node to remove\n         * @param  {Node} parentNode The nodes parent\n         * @param  {Boolean} skipKeyedNodes If true then elements with keys will be skipped and not discarded.\n         * @return {undefined}\n         */ function removeNode(node, parentNode, skipKeyedNodes) {\n            if (onBeforeNodeDiscarded(node) === false) return;\n            if (parentNode) parentNode.removeChild(node);\n            onNodeDiscarded(node);\n            walkDiscardedChildNodes(node, skipKeyedNodes);\n        }\n        // // TreeWalker implementation is no faster, but keeping this around in case this changes in the future\n        // function indexTree(root) {\n        //     var treeWalker = document.createTreeWalker(\n        //         root,\n        //         NodeFilter.SHOW_ELEMENT);\n        //\n        //     var el;\n        //     while((el = treeWalker.nextNode())) {\n        //         var key = getNodeKey(el);\n        //         if (key) {\n        //             fromNodesLookup[key] = el;\n        //         }\n        //     }\n        // }\n        // // NodeIterator implementation is no faster, but keeping this around in case this changes in the future\n        //\n        // function indexTree(node) {\n        //     var nodeIterator = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT);\n        //     var el;\n        //     while((el = nodeIterator.nextNode())) {\n        //         var key = getNodeKey(el);\n        //         if (key) {\n        //             fromNodesLookup[key] = el;\n        //         }\n        //     }\n        // }\n        function indexTree(node) {\n            if (node.nodeType === $d6aa37e28bb14658$var$ELEMENT_NODE || node.nodeType === $d6aa37e28bb14658$var$DOCUMENT_FRAGMENT_NODE$1) {\n                var curChild = node.firstChild;\n                while(curChild){\n                    var key = getNodeKey(curChild);\n                    if (key) fromNodesLookup[key] = curChild;\n                    // Walk recursively\n                    indexTree(curChild);\n                    curChild = curChild.nextSibling;\n                }\n            }\n        }\n        indexTree(fromNode);\n        function handleNodeAdded(el) {\n            onNodeAdded(el);\n            var curChild = el.firstChild;\n            while(curChild){\n                var nextSibling = curChild.nextSibling;\n                var key = getNodeKey(curChild);\n                if (key) {\n                    var unmatchedFromEl = fromNodesLookup[key];\n                    // if we find a duplicate #id node in cache, replace `el` with cache value\n                    // and morph it to the child node.\n                    if (unmatchedFromEl && $d6aa37e28bb14658$var$compareNodeNames(curChild, unmatchedFromEl)) {\n                        curChild.parentNode.replaceChild(unmatchedFromEl, curChild);\n                        morphEl(unmatchedFromEl, curChild);\n                    } else handleNodeAdded(curChild);\n                } else // recursively call for curChild and it's children to see if we find something in\n                // fromNodesLookup\n                handleNodeAdded(curChild);\n                curChild = nextSibling;\n            }\n        }\n        function cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey) {\n            // We have processed all of the \"to nodes\". If curFromNodeChild is\n            // non-null then we still have some from nodes left over that need\n            // to be removed\n            while(curFromNodeChild){\n                var fromNextSibling = curFromNodeChild.nextSibling;\n                if (curFromNodeKey = getNodeKey(curFromNodeChild)) // Since the node is keyed it might be matched up later so we defer\n                // the actual removal to later\n                addKeyedRemoval(curFromNodeKey);\n                else // NOTE: we skip nested keyed nodes from being removed since there is\n                //       still a chance they will be matched up later\n                removeNode(curFromNodeChild, fromEl, true);\n                curFromNodeChild = fromNextSibling;\n            }\n        }\n        function morphEl(fromEl, toEl, childrenOnly) {\n            var toElKey = getNodeKey(toEl);\n            if (toElKey) // If an element with an ID is being morphed then it will be in the final\n            // DOM so clear it out of the saved elements collection\n            delete fromNodesLookup[toElKey];\n            if (!childrenOnly) {\n                // optional\n                if (onBeforeElUpdated(fromEl, toEl) === false) return;\n                // update attributes on original DOM element first\n                morphAttrs(fromEl, toEl);\n                // optional\n                onElUpdated(fromEl);\n                if (onBeforeElChildrenUpdated(fromEl, toEl) === false) return;\n            }\n            if (fromEl.nodeName !== \"TEXTAREA\") morphChildren(fromEl, toEl);\n            else $d6aa37e28bb14658$var$specialElHandlers.TEXTAREA(fromEl, toEl);\n        }\n        function morphChildren(fromEl, toEl) {\n            var curToNodeChild = toEl.firstChild;\n            var curFromNodeChild = fromEl.firstChild;\n            var curToNodeKey;\n            var curFromNodeKey;\n            var fromNextSibling;\n            var toNextSibling;\n            var matchingFromEl;\n            // walk the children\n            outer: while(curToNodeChild){\n                toNextSibling = curToNodeChild.nextSibling;\n                curToNodeKey = getNodeKey(curToNodeChild);\n                // walk the fromNode children all the way through\n                while(curFromNodeChild){\n                    fromNextSibling = curFromNodeChild.nextSibling;\n                    if (curToNodeChild.isSameNode && curToNodeChild.isSameNode(curFromNodeChild)) {\n                        curToNodeChild = toNextSibling;\n                        curFromNodeChild = fromNextSibling;\n                        continue outer;\n                    }\n                    curFromNodeKey = getNodeKey(curFromNodeChild);\n                    var curFromNodeType = curFromNodeChild.nodeType;\n                    // this means if the curFromNodeChild doesnt have a match with the curToNodeChild\n                    var isCompatible = undefined;\n                    if (curFromNodeType === curToNodeChild.nodeType) {\n                        if (curFromNodeType === $d6aa37e28bb14658$var$ELEMENT_NODE) {\n                            // Both nodes being compared are Element nodes\n                            if (curToNodeKey) // The target node has a key so we want to match it up with the correct element\n                            // in the original DOM tree\n                            {\n                                if (curToNodeKey !== curFromNodeKey) {\n                                    // The current element in the original DOM tree does not have a matching key so\n                                    // let's check our lookup to see if there is a matching element in the original\n                                    // DOM tree\n                                    if (matchingFromEl = fromNodesLookup[curToNodeKey]) {\n                                        if (fromNextSibling === matchingFromEl) // Special case for single element removals. To avoid removing the original\n                                        // DOM node out of the tree (since that can break CSS transitions, etc.),\n                                        // we will instead discard the current node and wait until the next\n                                        // iteration to properly match up the keyed target element with its matching\n                                        // element in the original tree\n                                        isCompatible = false;\n                                        else {\n                                            // We found a matching keyed element somewhere in the original DOM tree.\n                                            // Let's move the original DOM node into the current position and morph\n                                            // it.\n                                            // NOTE: We use insertBefore instead of replaceChild because we want to go through\n                                            // the `removeNode()` function for the node that is being discarded so that\n                                            // all lifecycle hooks are correctly invoked\n                                            fromEl.insertBefore(matchingFromEl, curFromNodeChild);\n                                            // fromNextSibling = curFromNodeChild.nextSibling;\n                                            if (curFromNodeKey) // Since the node is keyed it might be matched up later so we defer\n                                            // the actual removal to later\n                                            addKeyedRemoval(curFromNodeKey);\n                                            else // NOTE: we skip nested keyed nodes from being removed since there is\n                                            //       still a chance they will be matched up later\n                                            removeNode(curFromNodeChild, fromEl, true);\n                                            curFromNodeChild = matchingFromEl;\n                                        }\n                                    } else // The nodes are not compatible since the \"to\" node has a key and there\n                                    // is no matching keyed node in the source tree\n                                    isCompatible = false;\n                                }\n                            } else if (curFromNodeKey) // The original has a key\n                            isCompatible = false;\n                            isCompatible = isCompatible !== false && $d6aa37e28bb14658$var$compareNodeNames(curFromNodeChild, curToNodeChild);\n                            if (isCompatible) // We found compatible DOM elements so transform\n                            // the current \"from\" node to match the current\n                            // target DOM node.\n                            // MORPH\n                            morphEl(curFromNodeChild, curToNodeChild);\n                        } else if (curFromNodeType === $d6aa37e28bb14658$var$TEXT_NODE || curFromNodeType == $d6aa37e28bb14658$var$COMMENT_NODE) {\n                            // Both nodes being compared are Text or Comment nodes\n                            isCompatible = true;\n                            // Simply update nodeValue on the original node to\n                            // change the text value\n                            if (curFromNodeChild.nodeValue !== curToNodeChild.nodeValue) curFromNodeChild.nodeValue = curToNodeChild.nodeValue;\n                        }\n                    }\n                    if (isCompatible) {\n                        // Advance both the \"to\" child and the \"from\" child since we found a match\n                        // Nothing else to do as we already recursively called morphChildren above\n                        curToNodeChild = toNextSibling;\n                        curFromNodeChild = fromNextSibling;\n                        continue outer;\n                    }\n                    // No compatible match so remove the old node from the DOM and continue trying to find a\n                    // match in the original DOM. However, we only do this if the from node is not keyed\n                    // since it is possible that a keyed node might match up with a node somewhere else in the\n                    // target tree and we don't want to discard it just yet since it still might find a\n                    // home in the final DOM tree. After everything is done we will remove any keyed nodes\n                    // that didn't find a home\n                    if (curFromNodeKey) // Since the node is keyed it might be matched up later so we defer\n                    // the actual removal to later\n                    addKeyedRemoval(curFromNodeKey);\n                    else // NOTE: we skip nested keyed nodes from being removed since there is\n                    //       still a chance they will be matched up later\n                    removeNode(curFromNodeChild, fromEl, true);\n                    curFromNodeChild = fromNextSibling;\n                } // END: while(curFromNodeChild) {}\n                // If we got this far then we did not find a candidate match for\n                // our \"to node\" and we exhausted all of the children \"from\"\n                // nodes. Therefore, we will just append the current \"to\" node\n                // to the end\n                if (curToNodeKey && (matchingFromEl = fromNodesLookup[curToNodeKey]) && $d6aa37e28bb14658$var$compareNodeNames(matchingFromEl, curToNodeChild)) {\n                    fromEl.appendChild(matchingFromEl);\n                    // MORPH\n                    morphEl(matchingFromEl, curToNodeChild);\n                } else {\n                    var onBeforeNodeAddedResult = onBeforeNodeAdded(curToNodeChild);\n                    if (onBeforeNodeAddedResult !== false) {\n                        if (onBeforeNodeAddedResult) curToNodeChild = onBeforeNodeAddedResult;\n                        if (curToNodeChild.actualize) curToNodeChild = curToNodeChild.actualize(fromEl.ownerDocument || $d6aa37e28bb14658$var$doc);\n                        fromEl.appendChild(curToNodeChild);\n                        handleNodeAdded(curToNodeChild);\n                    }\n                }\n                curToNodeChild = toNextSibling;\n                curFromNodeChild = fromNextSibling;\n            }\n            cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey);\n            var specialElHandler = $d6aa37e28bb14658$var$specialElHandlers[fromEl.nodeName];\n            if (specialElHandler) specialElHandler(fromEl, toEl);\n        } // END: morphChildren(...)\n        var morphedNode = fromNode;\n        var morphedNodeType = morphedNode.nodeType;\n        var toNodeType = toNode.nodeType;\n        if (!childrenOnly) {\n            // Handle the case where we are given two DOM nodes that are not\n            // compatible (e.g. <div> --> <span> or <div> --> TEXT)\n            if (morphedNodeType === $d6aa37e28bb14658$var$ELEMENT_NODE) {\n                if (toNodeType === $d6aa37e28bb14658$var$ELEMENT_NODE) {\n                    if (!$d6aa37e28bb14658$var$compareNodeNames(fromNode, toNode)) {\n                        onNodeDiscarded(fromNode);\n                        morphedNode = $d6aa37e28bb14658$var$moveChildren(fromNode, $d6aa37e28bb14658$var$createElementNS(toNode.nodeName, toNode.namespaceURI));\n                    }\n                } else // Going from an element node to a text node\n                morphedNode = toNode;\n            } else if (morphedNodeType === $d6aa37e28bb14658$var$TEXT_NODE || morphedNodeType === $d6aa37e28bb14658$var$COMMENT_NODE) {\n                if (toNodeType === morphedNodeType) {\n                    if (morphedNode.nodeValue !== toNode.nodeValue) morphedNode.nodeValue = toNode.nodeValue;\n                    return morphedNode;\n                } else // Text node to something else\n                morphedNode = toNode;\n            }\n        }\n        if (morphedNode === toNode) // The \"to node\" was not compatible with the \"from node\" so we had to\n        // toss out the \"from node\" and use the \"to node\"\n        onNodeDiscarded(fromNode);\n        else {\n            if (toNode.isSameNode && toNode.isSameNode(morphedNode)) return;\n            morphEl(morphedNode, toNode, childrenOnly);\n            // We now need to loop over any keyed nodes that might need to be\n            // removed. We only do the removal if we know that the keyed node\n            // never found a match. When a keyed node is matched up we remove\n            // it out of fromNodesLookup and we use fromNodesLookup to determine\n            // if a keyed node has been matched up or not\n            if (keyedRemovalList) for(var i = 0, len = keyedRemovalList.length; i < len; i++){\n                var elToRemove = fromNodesLookup[keyedRemovalList[i]];\n                if (elToRemove) removeNode(elToRemove, elToRemove.parentNode, false);\n            }\n        }\n        if (!childrenOnly && morphedNode !== fromNode && fromNode.parentNode) {\n            if (morphedNode.actualize) morphedNode = morphedNode.actualize(fromNode.ownerDocument || $d6aa37e28bb14658$var$doc);\n            // If we had to swap out the from node with a new node because the old\n            // node was not compatible with the target node then we need to\n            // replace the old DOM node in the original DOM tree. This is only\n            // possible if the original DOM node was part of a DOM tree which\n            // we know is the case if it has a parent node.\n            fromNode.parentNode.replaceChild(morphedNode, fromNode);\n        }\n        return morphedNode;\n    };\n}\nvar $d6aa37e28bb14658$var$morphdom = $d6aa37e28bb14658$var$morphdomFactory($d6aa37e28bb14658$var$morphAttrs);\nvar $d6aa37e28bb14658$export$2e2bcd8739ae039 = $d6aa37e28bb14658$var$morphdom;\n\n\n\nvar $064669c0b5fd3d60$exports = {};\n\n$parcel$export($064669c0b5fd3d60$exports, \"WEBSOCKETS\", () => $064669c0b5fd3d60$export$d0711f5bc279c186);\n$parcel$export($064669c0b5fd3d60$exports, \"open\", () => $064669c0b5fd3d60$export$3ce6949f20cea765);\n$parcel$export($064669c0b5fd3d60$exports, \"close\", () => $064669c0b5fd3d60$export$8360e631d277ea4d);\nfunction $677e5af0d8815dd0$var$noop() {}\nfunction $677e5af0d8815dd0$export$2e2bcd8739ae039(url, opts) {\n    opts = opts || {};\n    var ws, num = 0, timer = 1, $ = {};\n    var max = opts.maxAttempts || Infinity;\n    $.open = function() {\n        ws = new WebSocket(url, opts.protocols || []);\n        ws.onmessage = opts.onmessage || $677e5af0d8815dd0$var$noop;\n        ws.onopen = function(e) {\n            (opts.onopen || $677e5af0d8815dd0$var$noop)(e);\n            num = 0;\n        };\n        ws.onclose = function(e) {\n            e.code === 1e3 || e.code === 1001 || e.code === 1005 || $.reconnect(e);\n            (opts.onclose || $677e5af0d8815dd0$var$noop)(e);\n        };\n        ws.onerror = function(e) {\n            e && e.code === \"ECONNREFUSED\" ? $.reconnect(e) : (opts.onerror || $677e5af0d8815dd0$var$noop)(e);\n        };\n    };\n    $.reconnect = function(e) {\n        if (timer && num++ < max) timer = setTimeout(function() {\n            (opts.onreconnect || $677e5af0d8815dd0$var$noop)(e);\n            $.open();\n        }, opts.timeout || 1e3);\n        else (opts.onmaximum || $677e5af0d8815dd0$var$noop)(e);\n    };\n    $.json = function(x) {\n        ws.send(JSON.stringify(x));\n    };\n    $.send = function(x) {\n        ws.send(x);\n    };\n    $.close = function(x, y) {\n        timer = clearTimeout(timer);\n        ws.close(x || 1e3, y);\n    };\n    $.open(); // init\n    return $;\n}\n\n\nconst $064669c0b5fd3d60$export$d0711f5bc279c186 = {};\nconst $064669c0b5fd3d60$var$log = function(e, action, url, options) {\n    console.log(\"Websocket \" + action + \" to url\", url, \"with options\", options, \"and event\", e);\n};\nconst $064669c0b5fd3d60$export$3ce6949f20cea765 = function(url, options) {\n    if (!options) options = {};\n    if (!!$064669c0b5fd3d60$export$d0711f5bc279c186[url]) {\n        $064669c0b5fd3d60$var$log(null, \"ALREADY_OPENED_BYE\", url, options);\n        return;\n    }\n    $064669c0b5fd3d60$export$d0711f5bc279c186[url] = new (0, $677e5af0d8815dd0$export$2e2bcd8739ae039)(url, Object.assign({\n        timeout: 1e3,\n        maxAttempts: Number.MAX_SAFE_INTEGER,\n        onopen: (e)=>$064669c0b5fd3d60$var$log(e, \"OPENED\", url, options),\n        onmessage: (e)=>{\n            hypergen.applyCommands(JSON.parse(e.data));\n        },\n        onreconnect: (e)=>$064669c0b5fd3d60$var$log(e, \"RECONNECTING\", url, options),\n        onmaximum: (e)=>$064669c0b5fd3d60$var$log(e, \"MAX_RECONNECTS_BYE\", url, options),\n        onclose: (e)=>{\n            $064669c0b5fd3d60$var$log(e, \"CLOSED\", url, options);\n        },\n        onerror: (e)=>console.log(\"Error:\", e)\n    }, options));\n};\nconst $064669c0b5fd3d60$export$8360e631d277ea4d = function(url) {\n    if (!$064669c0b5fd3d60$export$d0711f5bc279c186[url]) {\n        $064669c0b5fd3d60$var$log(null, \"ALREADY_CLOSED_BYE\", url, null);\n        return;\n    }\n    $064669c0b5fd3d60$export$d0711f5bc279c186[url].close();\n    delete $064669c0b5fd3d60$export$d0711f5bc279c186[url];\n    $064669c0b5fd3d60$var$log(null, \"CLOSED_AND_DELETED\", url, null);\n};\n\n\n// Make all exported vars availabe inside window.hypergen.\nwindow.hypergen = $5d2e5e1479d27cab$exports;\nwindow.hypergen.websocket = $064669c0b5fd3d60$exports;\n// Shims\nif (typeof Array.isArray === \"undefined\") Array.isArray = function(obj) {\n    return Object.prototype.toString.call(obj) === \"[object Array]\";\n};\nconst $5d2e5e1479d27cab$export$2e5e8c41f5d4e7c7 = function(id, html) {\n    const element = document.getElementById(id);\n    if (!element) {\n        console.error(\"Trying to morph into an element with id='\" + id + \"' that does not exist. Please check your target_id.\");\n        return;\n    }\n    (0, $d6aa37e28bb14658$export$2e2bcd8739ae039)(element, \"<div>\" + html + \"</div>\", {\n        childrenOnly: true,\n        onBeforeElUpdated: function(fromEl, toEl) {\n            let focused = document.activeElement;\n            if ((fromEl.nodeName == \"INPUT\" || fromEl.nodeName == \"TEXTAREA\") && fromEl === focused) {\n                let types = [\n                    \"checkbox\",\n                    \"radio\"\n                ];\n                if (fromEl.nodeName === \"INPUT\" && types.indexOf(fromEl.type) !== -1) return true;\n                $5d2e5e1479d27cab$var$mergeAttrs(fromEl, toEl);\n                return false;\n            } else if (fromEl.nodeName == \"INPUT\" && fromEl.type === \"file\" && fromEl.files.length > 0) {\n                $5d2e5e1479d27cab$var$mergeAttrs(fromEl, toEl);\n                return false;\n            } else if (fromEl.nodeName === \"SCRIPT\" && toEl.nodeName === \"SCRIPT\") {\n                var script = document.createElement(\"script\");\n                //copy over the attributes\n                [\n                    ...toEl.attributes\n                ].forEach((attr)=>{\n                    script.setAttribute(attr.nodeName, attr.nodeValue);\n                });\n                // CSP nonces are document-scoped: the browser only trusts the nonce\n                // from the original page-load response. Each XHR/partial-load gets a\n                // fresh server-side nonce that won't match. Stamp the document's own\n                // nonce on the cloned script so CSP accepts it.\n                var docNonceEl = document.querySelector(\"script[nonce]\");\n                var docNonce = docNonceEl && docNonceEl.nonce;\n                if (docNonce) script.nonce = docNonce;\n                else if (toEl.nonce) script.nonce = toEl.nonce;\n                script.innerHTML = toEl.innerHTML;\n                fromEl.replaceWith(script);\n                return false;\n            } else return true;\n        },\n        onNodeAdded: function(node) {\n            if (node.nodeName === \"SCRIPT\") {\n                var script = document.createElement(\"script\");\n                //copy over the attributes\n                [\n                    ...node.attributes\n                ].forEach((attr)=>{\n                    script.setAttribute(attr.nodeName, attr.nodeValue);\n                });\n                var docNonceEl = document.querySelector(\"script[nonce]\");\n                var docNonce = docNonceEl && docNonceEl.nonce;\n                if (docNonce) script.nonce = docNonce;\n                else if (node.nonce) script.nonce = node.nonce;\n                script.innerHTML = node.innerHTML;\n                node.replaceWith(script);\n            }\n        }\n    });\n    const autofocus = document.querySelectorAll(\"[autofocus]\")[0];\n    if (autofocus !== undefined) autofocus.focus();\n};\nconst $5d2e5e1479d27cab$export$cd7f480d6b8286c3 = function(id) {\n    let el = document.getElementById(id);\n    if (!!el) el.parentNode.removeChild(el);\n};\nconst $5d2e5e1479d27cab$export$fe8985bb6374093c = function(id) {\n    let el = document.getElementById(id);\n    el.style.display = \"none\";\n};\nconst $5d2e5e1479d27cab$export$79693fdaa4661ff2 = function(id, value) {\n    let el = document.getElementById(id);\n    el.style.display = value || \"block\";\n};\nconst $5d2e5e1479d27cab$export$664c6d24e3175067 = function(id, value) {\n    let el = document.getElementById(id);\n    el.style.visibility = \"visible\";\n};\nconst $5d2e5e1479d27cab$export$73920f18ca706874 = function(id, value) {\n    let el = document.getElementById(id);\n    el.style.visibility = \"hidden\";\n};\nconst $5d2e5e1479d27cab$export$89e12c5b50f7529d = function(url) {\n    /*\n  One would expect to simply do a window.location = url but that does not work in an ajax request on safari, because\n  (i think) the ajax request is async and the redirect is thus triggered directly during a user event.\n  This is a workaround, but might stop working some day.\n  */ const link = document.createElement(\"a\");\n    link.href = url;\n    link.style.display = \"none\";\n    document.body.appendChild(link);\n    link.click();\n    document.body.removeChild(link);\n};\nconst $5d2e5e1479d27cab$export$10d8903dec122b9d = function(id, html) {\n    const el = document.getElementById(id);\n    if (!el) console.error(\"Cannot append to missing element\", id);\n    el.innerHTML += html;\n};\nconst $5d2e5e1479d27cab$export$68159836694e22c1 = function(id, html) {\n    const el = document.getElementById(id);\n    if (!el) console.error(\"Cannot prepend to missing element\", id);\n    el.innerHTML = html + el.innerHTML;\n};\n$5d2e5e1479d27cab$exports.clientState = {};\nconst $5d2e5e1479d27cab$export$117c6580f10117fb = function(at, value) {\n    let clientState = $5d2e5e1479d27cab$exports.clientState;\n    for (const path of at.split(\".\")){\n        if (clientState[path] === undefined) clientState[path] = {};\n        clientState = clientState[path];\n    }\n    Object.assign(clientState, value);\n    console.log(\"Setting new state for hypergen.clientState\", at, \"with value\", value, \"giving\", $5d2e5e1479d27cab$exports.clientState);\n};\n/* WARNING NOT STABLE */ var $5d2e5e1479d27cab$var$INTERVALS = {};\nconst $5d2e5e1479d27cab$export$dd6ad98138aae6a3 = function(commands, interval, name) {\n    const i = setInterval(()=>$5d2e5e1479d27cab$export$41528721a63e1cee(commands), interval);\n    if (!!name) $5d2e5e1479d27cab$var$INTERVALS[name] = i;\n};\nconst $5d2e5e1479d27cab$export$fb5deb78d2f5421 = function(name) {\n    if ($5d2e5e1479d27cab$var$INTERVALS[name]) {\n        console.log(\"Clearing\", $5d2e5e1479d27cab$var$INTERVALS[name]);\n        clearInterval($5d2e5e1479d27cab$var$INTERVALS[name]);\n    }\n};\nconst $5d2e5e1479d27cab$export$3f65cefe8380dbea = function(querySelectorString, type, commands, options) {\n    document.querySelector(querySelectorString).addEventListener(type, (event)=>$5d2e5e1479d27cab$export$41528721a63e1cee(commands), options || {});\n};\nlet $5d2e5e1479d27cab$var$_TTT = {};\nconst $5d2e5e1479d27cab$var$keypressToCallbackFunc = function(e) {\n    const [url, args, options] = $5d2e5e1479d27cab$var$_TTT;\n    $5d2e5e1479d27cab$export$eb872837e3137261(url, [\n        e.key,\n        ...args || []\n    ], options || {});\n};\nconst $5d2e5e1479d27cab$export$aebc7529e8ab5fd3 = function(url, args, options) {\n    $5d2e5e1479d27cab$var$_TTT = [\n        url,\n        args,\n        options\n    ];\n    window.addEventListener(\"keydown\", $5d2e5e1479d27cab$var$keypressToCallbackFunc);\n};\nconst $5d2e5e1479d27cab$export$4bf93dbed412fb4d = function(url, args, options) {\n    window.removeEventListener(\"keydown\", $5d2e5e1479d27cab$var$keypressToCallbackFunc);\n};\n/* END WARNING STABLE AGAIN */ // Callback\nvar $5d2e5e1479d27cab$var$i = 0;\nvar $5d2e5e1479d27cab$var$isBlocked = false;\nvar $5d2e5e1479d27cab$var$urlBlocks = {};\nconst $5d2e5e1479d27cab$export$eb872837e3137261 = function(url, args, { debounce: debounce = 0, confirm_: confirm_ = false, blocks: blocks = false, blocksEachUrl: blocksEachUrl = true, uploadFiles: uploadFiles = false, params: params = {}, meta: meta = {}, clear: clear = false, elementId: elementId = null, debug: debug = false, event: event = null, headers: headers = {}, onSucces: onSucces = null, timeout: timeout = 20000 } = {}) {\n    const isWebsocket = url.startsWith(\"ws://\") || url.startsWith(\"wss://\");\n    if (!!event) {\n        event.preventDefault();\n        event.stopPropagation();\n    }\n    let postIt = function() {\n        let json;\n        console.log(\"REQUEST\", url, args, debounce);\n        $5d2e5e1479d27cab$var$i++;\n        // The element function must have access to the FormData.\n        $5d2e5e1479d27cab$exports.hypergenGlobalFormdata = new FormData();\n        $5d2e5e1479d27cab$exports.hypergenUploadFiles = uploadFiles;\n        try {\n            json = JSON.stringify({\n                args: args,\n                meta: meta\n            });\n        } catch (error) {\n            if (error === $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION) {\n                console.warn(\"An element is missing. This can happen if a dom element has multiple event handlers.\", url);\n                return;\n            } else throw error;\n        }\n        let formData = $5d2e5e1479d27cab$exports.hypergenGlobalFormdata;\n        $5d2e5e1479d27cab$exports.hypergenGlobalFormdata = null;\n        $5d2e5e1479d27cab$exports.hypergenUploadFiles = null;\n        formData.append(\"hypergen_data\", json);\n        if (blocks === true) {\n            if ($5d2e5e1479d27cab$var$isBlocked === true) {\n                console.error(\"Callback was blocked\");\n                return;\n            } else $5d2e5e1479d27cab$var$isBlocked = true;\n        }\n        if (blocksEachUrl === true && !isWebsocket) {\n            if (!!$5d2e5e1479d27cab$var$urlBlocks[url]) {\n                console.error(\"Callback to \" + url + \" was blocked\");\n                return;\n            }\n            $5d2e5e1479d27cab$var$urlBlocks[url] = true;\n        }\n        $5d2e5e1479d27cab$var$post(url, formData, (data)=>{\n            if (data !== null) $5d2e5e1479d27cab$export$41528721a63e1cee(data);\n            $5d2e5e1479d27cab$var$isBlocked = false;\n            if (blocksEachUrl === true && !isWebsocket) delete $5d2e5e1479d27cab$var$urlBlocks[url];\n            if (clear === true) document.getElementById(elementId).value = \"\";\n            if (!!onSucces) onSucces();\n        }, (data, jsonOk, xhr)=>{\n            console.log(\"xhr:\", xhr);\n            $5d2e5e1479d27cab$var$isBlocked = false;\n            if (blocksEachUrl === true && !isWebsocket) delete $5d2e5e1479d27cab$var$urlBlocks[url];\n            console.error(\"Hypergen post error occured\", data);\n            if (debug !== true) {\n                if (xhr.getResponseHeader(\"Content-Type\") === \"text/plain\") data = \"<pre><code>\" + data + \"</pre></code>\";\n                document.getElementsByTagName(\"html\")[0].innerHTML = data;\n            }\n        }, params, headers, {\n            timeout: timeout\n        });\n    };\n    const postItWebsocket = function() {\n        console.log(\"WEBSOCKET\", url, args, debounce);\n        let json;\n        try {\n            json = JSON.stringify({\n                args: args,\n                meta: meta\n            });\n        } catch (error) {\n            if (error === $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION) {\n                console.warn(\"An element is missing. This can happen if a dom element has multiple event handlers.\", url);\n                return;\n            } else throw error;\n        }\n        if (!$5d2e5e1479d27cab$exports.websocket.WEBSOCKETS[url]) {\n            console.error(\"Cannot send WS to non existing connection:\", url);\n            return;\n        }\n        $5d2e5e1479d27cab$exports.websocket.WEBSOCKETS[url].send(json);\n        if (clear === true) document.getElementById(elementId).value = \"\";\n    };\n    const func = isWebsocket ? postItWebsocket : postIt;\n    if (debounce === 0) {\n        if (confirm_ === false) func();\n        else if (confirm(confirm_)) func();\n    } else $5d2e5e1479d27cab$export$de363e709c412c8a(func, {\n        delay: debounce,\n        group: url,\n        confirm_: confirm_\n    });\n};\nconst $5d2e5e1479d27cab$export$73395861aa8174cf = function(event, url, pushState) {\n    console.log(\"partialLoad to\", url, pushState);\n    window.dispatchEvent(new CustomEvent(\"hypergen.partialLoad.before\", {\n        detail: {\n            event: event,\n            url: url,\n            pushState: pushState\n        }\n    }));\n    $5d2e5e1479d27cab$export$eb872837e3137261(url, [], {\n        \"event\": event,\n        \"headers\": {\n            \"X-Hypergen-Partial\": \"1\"\n        },\n        onSucces: function() {\n            if (!!pushState) {\n                console.log(\"pushing state!\");\n                history.pushState({\n                    callback_url: url\n                }, \"\", url);\n                $5d2e5e1479d27cab$export$cfdba980e7d40be8();\n                history.forward();\n                window.dispatchEvent(new CustomEvent(\"hypergen.partialLoad.after\", {\n                    detail: {\n                        event: event,\n                        url: url,\n                        pushState: pushState\n                    }\n                }));\n            }\n        }\n    });\n};\n// Timing\nvar $5d2e5e1479d27cab$var$_THROTTLE_GROUPS = {};\nlet $5d2e5e1479d27cab$export$de363e709c412c8a = function(func, { delay: delay = 0, group: group = \"global\", confirm_: confirm_ = false } = {}) {\n    if ($5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group]) {\n        clearTimeout($5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group]);\n        $5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group] = null;\n    }\n    $5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group] = setTimeout(function() {\n        if (confirm_ === false) func();\n        else {\n            const confirmed = confirm(confirm_);\n            if (confirmed === true) func();\n        }\n        $5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group] = null;\n    }, delay);\n};\nlet $5d2e5e1479d27cab$export$2ab6c72538d2a4d7 = function(group) {\n    if ($5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group]) {\n        clearTimeout($5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group]);\n        $5d2e5e1479d27cab$var$_THROTTLE_GROUPS[group] = null;\n    }\n};\n// Internal\nconst $5d2e5e1479d27cab$var$require_ = function(module) {\n    try {\n        return require(module);\n    } catch (e) {\n        return false;\n    }\n};\nconst $5d2e5e1479d27cab$var$resolvePath = function(path) {\n    const parts = path.split(\".\");\n    let i = -1, obj = null;\n    for (let part of parts){\n        i++;\n        if (i === 0) {\n            if (window[part] !== undefined) obj = window[part];\n            else if (obj = $5d2e5e1479d27cab$var$require_(part)) ;\n            else if (obj = $5d2e5e1479d27cab$var$require_(\"./\" + part)) ;\n            else throw \"Could not resolve path: \" + path;\n        } else {\n            if (obj[part] !== undefined) try {\n                obj = obj[part].bind(obj);\n            } catch (e) {\n                obj = obj[part];\n            }\n            else throw \"Could not resolve path: \" + path;\n        }\n    }\n    return obj;\n};\nconst $5d2e5e1479d27cab$var$applyCommand = function(path, ...args) {\n    console.log(\"apply command\", path, args);\n    let rpath = $5d2e5e1479d27cab$var$resolvePath(path);\n    const result = rpath(...args);\n    const event = new CustomEvent(\"hypergen.applyCommand.after\", {\n        detail: {\n            path: path,\n            args: args\n        }\n    });\n    document.dispatchEvent(event);\n    return result;\n};\nconst $5d2e5e1479d27cab$export$6cd530ed55e06764 = function(event, callbackKey, when) {\n    event.preventDefault();\n    event.stopPropagation();\n    if (!!when && !$5d2e5e1479d27cab$var$applyCommand(...when, event)) return;\n    $5d2e5e1479d27cab$var$applyCommand(...$5d2e5e1479d27cab$exports.clientState.hypergen.eventHandlerCallbacks[callbackKey]);\n};\nconst $5d2e5e1479d27cab$export$41528721a63e1cee = function(commands) {\n    if (!!commands._ && commands._.length === 2 && commands._[0] === \"deque\") commands = commands._[1];\n    for (let [path, ...args] of commands)$5d2e5e1479d27cab$var$applyCommand(path, ...args);\n};\nconst $5d2e5e1479d27cab$var$mergeAttrs = function(target, source) {\n    source.getAttributeNames().forEach((name)=>{\n        let value = source.getAttribute(name);\n        target.setAttribute(name, value);\n    });\n};\nconst $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION = \"MISSING_ELEMENT_EXCEPTION\";\nconst $5d2e5e1479d27cab$export$8c14e57e778d3873 = {};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.no = function(value) {\n    if (value === \"\") return null;\n    return value;\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.str = function(value) {\n    if (value === \"\") return null;\n    return value === null ? null : \"\" + value;\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.int = function(value) {\n    if (value === \"\") return null;\n    value = parseInt(value);\n    if (isNaN(value)) return null;\n    else return value;\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.intlist = function(value) {\n    return value.map((x)=>parseInt(x));\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.float = function(value) {\n    if (value === \"\") return null;\n    value = parseFloat(value);\n    if (isNaN(value)) return null;\n    else return {\n        _: [\n            \"float\",\n            value\n        ]\n    };\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.date = function(value) {\n    if (value === \"\") return null;\n    else return {\n        _: [\n            \"date\",\n            value\n        ]\n    };\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.datetime = function(value) {\n    if (value === \"\") return null;\n    else return {\n        _: [\n            \"datetime\",\n            value\n        ]\n    };\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.time = function(value) {\n    if (value === \"\") return null;\n    else return {\n        _: [\n            \"time\",\n            value\n        ]\n    };\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.month = function(value) {\n    if (value === \"\") return null;\n    const parts = value.split(\"-\");\n    return {\n        year: parseInt(parts[0]),\n        month: parseInt(parts[1])\n    };\n};\n$5d2e5e1479d27cab$export$8c14e57e778d3873.week = function(value) {\n    if (value === \"\") return null;\n    const parts = value.split(\"-\");\n    return {\n        year: parseInt(parts[0]),\n        week: parseInt(parts[1].replace(\"W\", \"\"))\n    };\n};\nconst $5d2e5e1479d27cab$export$aafa59e2e03f2942 = {};\n$5d2e5e1479d27cab$export$aafa59e2e03f2942.value = function(id) {\n    const el = document.getElementById(id);\n    if (el === null) throw $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION;\n    return el.value.trim();\n};\n$5d2e5e1479d27cab$export$aafa59e2e03f2942.checked = function(id) {\n    const el = document.getElementById(id);\n    if (el === null) throw $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION;\n    return el.checked;\n};\n$5d2e5e1479d27cab$export$aafa59e2e03f2942.radio = function(id) {\n    const el = document.getElementById(id);\n    if (el === null) throw $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION;\n    const checked = document.querySelector(\"input[type=radio][name=\" + el.name + \"]:checked\");\n    return checked === null ? null : checked.value;\n};\n$5d2e5e1479d27cab$export$aafa59e2e03f2942.checkboxes = function(id) {\n    const el = document.getElementById(id);\n    if (el === null) throw $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION;\n    const checked = document.querySelectorAll(\"input[type=checkbox][name=\" + el.name + \"]:checked\");\n    return Array.from(checked).map((cb)=>cb.value);\n};\n$5d2e5e1479d27cab$export$aafa59e2e03f2942.contenteditable = function(id) {\n    const el = document.getElementById(id);\n    if (el === null) throw $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION;\n    return el.innerHTML;\n};\n$5d2e5e1479d27cab$export$aafa59e2e03f2942.selectMultiple = function(id) {\n    const el = document.getElementById(id);\n    if (el === null) throw $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION;\n    return Array.from(el.selectedOptions).map((option)=>option.value);\n};\n$5d2e5e1479d27cab$export$aafa59e2e03f2942.file = function(id, formData) {\n    const el = document.getElementById(id);\n    if (el === null) throw $5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION;\n    if (el.files.length !== 1) return null;\n    if ($5d2e5e1479d27cab$exports.hypergenUploadFiles === true) formData.append(id, el.files[0]);\n    return el.files[0].name;\n};\nconst $5d2e5e1479d27cab$export$a55877ca9db47377 = {};\n$5d2e5e1479d27cab$export$a55877ca9db47377.keycode = function(keycode, event) {\n    return event.code == keycode;\n};\nconst $5d2e5e1479d27cab$export$8454457683f90105 = function(valueFunc, coerceFunc, id) {\n    this.toJSON = function() {\n        const value = $5d2e5e1479d27cab$var$resolvePath(valueFunc)(id, $5d2e5e1479d27cab$exports.hypergenGlobalFormdata);\n        if (!!coerceFunc) return $5d2e5e1479d27cab$var$resolvePath(coerceFunc)(value);\n        else return $5d2e5e1479d27cab$export$8c14e57e778d3873.no(value);\n    };\n    return this;\n};\nconst $5d2e5e1479d27cab$export$63698c10df99509c = function(k, v) {\n    if (Array.isArray(v)) {\n        if (v.length === 3 && v[0] === \"_\") {\n            if (v[1] === \"element_value\") return new $5d2e5e1479d27cab$export$8454457683f90105(...v[2]);\n        }\n    }\n    return v;\n};\nconst $5d2e5e1479d27cab$var$getCookie = function(name) {\n    let cookieValue = null;\n    if (document.cookie && document.cookie !== \"\") {\n        const cookies = document.cookie.split(\";\");\n        for(let i = 0; i < cookies.length; i++){\n            const cookie = cookies[i].trim();\n            // Does this cookie string begin with the name we want?\n            if (cookie.substring(0, name.length + 1) === name + \"=\") {\n                cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n                break;\n            }\n        }\n    }\n    return cookieValue;\n};\nfunction $5d2e5e1479d27cab$var$addParams(url, params) {\n    const ret = [];\n    for(let d in params)ret.push(encodeURIComponent(d) + \"=\" + encodeURIComponent(params[d]));\n    if (ret.length === 0) return url;\n    else return url + \"?\" + ret.join(\"&\");\n}\nconst $5d2e5e1479d27cab$var$post = function(url, formData, onSuccess, onError, params, headers, { timeout: timeout = 20000 } = {}) {\n    url = $5d2e5e1479d27cab$var$addParams(url, params);\n    const xhr = new XMLHttpRequest();\n    xhr.timeout = timeout;\n    const progressBar = document.getElementById(\"hypergen-upload-progress-bar\");\n    if (progressBar !== null) {\n        xhr.upload.onload = ()=>{\n            progressBar.style.visibility = \"hidden\";\n            console.log(`The upload is completed: ${xhr.status} ${xhr.response}`);\n        };\n        xhr.upload.onerror = ()=>{\n            progressBar.style.visibility = \"hidden\";\n            console.error(\"Upload failed.\");\n        };\n        xhr.upload.onabort = ()=>{\n            progressBar.style.visibility = \"hidden\";\n            console.error(\"Upload cancelled.\");\n        };\n        xhr.upload.onprogress = (event)=>{\n            progressBar.style.visibility = \"visible\";\n            progressBar.value = event.loaded / event.total;\n            console.log(`Uploaded ${event.loaded} of ${event.total} bytes`);\n        };\n    }\n    xhr.onload = ()=>{\n        var jsonOk = false, data = null;\n        try {\n            data = JSON.parse(xhr.responseText, $5d2e5e1479d27cab$export$63698c10df99509c);\n            jsonOk = true;\n        } catch (e) {\n            data = xhr.responseText;\n            jsonOk = false;\n        }\n        if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 302)) {\n            window.dispatchEvent(new CustomEvent(\"hypergen.post.after\"));\n            onSuccess(data, xhr);\n        } else {\n            window.dispatchEvent(new CustomEvent(\"hypergen.post.after\"));\n            onError(data, jsonOk, xhr);\n        }\n    };\n    xhr.onerror = ()=>{\n        console.error(\"xhr onerror\");\n        window.dispatchEvent(new CustomEvent(\"hypergen.post.after\"));\n        onError();\n    };\n    xhr.onabort = ()=>{\n        console.error(\"xhr onabort\");\n        window.dispatchEvent(new CustomEvent(\"hypergen.post.after\"));\n        onError();\n    };\n    xhr.ontimeout = ()=>{\n        console.error(\"xhr ontimeout\");\n        window.dispatchEvent(new CustomEvent(\"hypergen.post.after\"));\n        onError();\n    };\n    xhr.open(\"POST\", url);\n    xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n    xhr.setRequestHeader(\"X-Pathname\", parent.window.location.pathname);\n    xhr.setRequestHeader(\"X-CSRFToken\", $5d2e5e1479d27cab$var$getCookie(\"csrftoken\"));\n    if (!!headers) for(let k in headers){\n        console.log(\"Setting custom header\", k, \"to\", headers[k]);\n        xhr.setRequestHeader(k, headers[k]);\n    }\n    window.dispatchEvent(new CustomEvent(\"hypergen.post.before\"));\n    xhr.send(formData);\n};\n// history support.\nwindow.addEventListener(\"popstate\", function(event) {\n    if (event.state && event.state.callback_url !== undefined) {\n        console.log(\"popstate to partial load\");\n        $5d2e5e1479d27cab$export$73395861aa8174cf(event, event.state.callback_url);\n    } else window.location = location.href;\n});\nconst $5d2e5e1479d27cab$var$pushstate = new Event(\"hypergen.pushstate\");\nconst $5d2e5e1479d27cab$export$cfdba980e7d40be8 = function() {\n    document.dispatchEvent($5d2e5e1479d27cab$var$pushstate);\n};\nconst $5d2e5e1479d27cab$export$28ee1007e174a2a6 = function(fn, { partial: partial = false } = {}) {\n    if (document.readyState != \"loading\") fn();\n    else if (document.addEventListener) document.addEventListener(\"DOMContentLoaded\", fn);\n    else document.attachEvent(\"onreadystatechange\", function() {\n        if (document.readyState != \"loading\") fn();\n    });\n    if (partial) document.addEventListener(\"hypergen.pushstate\", fn);\n};\n\n})();\n//# sourceMappingURL=hypergen.js.map\n","import morphdom from 'morphdom'\nimport './hypergen'\nimport * as hypergen from './hypergen'\nimport * as websocket from './websocket';\n\n// Make all exported vars availabe inside window.hypergen.\nwindow.hypergen = hypergen\nwindow.hypergen.websocket = websocket\n\n// Shims\nif (typeof Array.isArray === 'undefined') {\n  Array.isArray = function(obj) {\n    return Object.prototype.toString.call(obj) === '[object Array]';\n  }\n}\n\n// Commands that can be called from the backend.\nexport const morph = function(id, html) {\n  const element = document.getElementById(id)\n  if (!element) {\n    console.error(\"Trying to morph into an element with id='\" + id + \"' that does not exist. Please check your target_id.\")\n    return\n  }\n  morphdom(\n    element,\n    \"<div>\" + html + \"</div>\",\n    {\n      childrenOnly: true,\n      onBeforeElUpdated: function(fromEl, toEl) {\n        let focused = document.activeElement\n        if((fromEl.nodeName == \"INPUT\" || fromEl.nodeName == \"TEXTAREA\") && fromEl === focused) {\n          let types = [\"checkbox\", \"radio\"]\n          if (fromEl.nodeName === \"INPUT\" && types.indexOf(fromEl.type) !== -1) {\n            return true\n          }\n          mergeAttrs(fromEl, toEl)\n          return false\n        } else if (fromEl.nodeName == \"INPUT\" && fromEl.type === \"file\" && fromEl.files.length > 0) {\n          mergeAttrs(fromEl, toEl)\n          return false\n        } else if (fromEl.nodeName === \"SCRIPT\" && toEl.nodeName === \"SCRIPT\") {\n            var script = document.createElement('script');\n            //copy over the attributes\n            [...toEl.attributes].forEach( attr => { script.setAttribute(attr.nodeName ,attr.nodeValue) })\n            // CSP nonces are document-scoped: the browser only trusts the nonce\n            // from the original page-load response. Each XHR/partial-load gets a\n            // fresh server-side nonce that won't match. Stamp the document's own\n            // nonce on the cloned script so CSP accepts it.\n            var docNonceEl = document.querySelector('script[nonce]');\n            var docNonce = docNonceEl && docNonceEl.nonce;\n            if (docNonce) script.nonce = docNonce;\n            else if (toEl.nonce) script.nonce = toEl.nonce;\n            script.innerHTML = toEl.innerHTML;\n            fromEl.replaceWith(script)\n            return false;\n        } else {\n          return true\n        }\n      },\n      onNodeAdded: function (node) {\n        if (node.nodeName === 'SCRIPT') {\n          var script = document.createElement('script');\n          //copy over the attributes\n          [...node.attributes].forEach( attr => { script.setAttribute(attr.nodeName ,attr.nodeValue) })\n          var docNonceEl = document.querySelector('script[nonce]');\n          var docNonce = docNonceEl && docNonceEl.nonce;\n          if (docNonce) script.nonce = docNonce;\n          else if (node.nonce) script.nonce = node.nonce;\n          script.innerHTML = node.innerHTML;\n          node.replaceWith(script)\n        }\n      },\n    }\n  )\n\n  const autofocus = document.querySelectorAll('[autofocus]')[0]\n  if (autofocus !== undefined) autofocus.focus()\n}\n\nexport const remove = function(id) {\n  let el = document.getElementById(id);\n  if (!!el) el.parentNode.removeChild(el)\n}\n\nexport const hide = function(id) {\n  let el = document.getElementById(id)\n  el.style.display = \"none\"\n}\n\nexport const display = function(id, value) {\n  let el = document.getElementById(id)\n  el.style.display = value || \"block\"\n}\n\nexport const visible = function(id, value) {\n  let el = document.getElementById(id)\n  el.style.visibility = \"visible\"\n}\n\nexport const hidden = function(id, value) {\n  let el = document.getElementById(id)\n  el.style.visibility = \"hidden\"\n}\n\nexport const redirect = function(url) {\n  /*\n  One would expect to simply do a window.location = url but that does not work in an ajax request on safari, because\n  (i think) the ajax request is async and the redirect is thus triggered directly during a user event.\n  This is a workaround, but might stop working some day.\n  */\n  const link = document.createElement('a')\n  link.href = url\n  link.style.display = 'none'\n  document.body.appendChild(link)\n  link.click()\n  document.body.removeChild(link)\n}\n\nexport const append = function(id, html) {\n  const el = document.getElementById(id)\n  if (!el) console.error(\"Cannot append to missing element\", id)\n  el.innerHTML += html\n}\n\nexport const prepend = function(id, html) {\n  const el = document.getElementById(id)\n  if (!el) console.error(\"Cannot prepend to missing element\", id)\n  el.innerHTML = html + el.innerHTML\n}\n\nhypergen.clientState = {}\n\nexport const setClientState = function(at, value) {\n  let clientState = hypergen.clientState\n  for (const path of at.split(\".\")) {\n    if (clientState[path] === undefined) clientState[path] = {}\n    clientState = clientState[path]\n  }\n  Object.assign(clientState, value)\n  console.log(\"Setting new state for hypergen.clientState\", at, \"with value\", value, \"giving\",\n              hypergen.clientState)\n}\n\n/* WARNING NOT STABLE */\nvar INTERVALS = {}\n\nexport const intervalSet = function(commands, interval, name) {\n  const i = setInterval(() => applyCommands(commands), interval)\n  if (!!name) INTERVALS[name] = i\n}\n\nexport const intervalClear = function(name) {\n  if (INTERVALS[name]) {\n    console.log(\"Clearing\", INTERVALS[name])\n    clearInterval(INTERVALS[name])\n  }\n}\n\nexport const addEventListener = function(querySelectorString, type, commands, options) {\n  document.querySelector(querySelectorString).addEventListener(\n    type, (event) => applyCommands(commands), options || {})\n}\n\nlet _TTT = {}\n\nconst keypressToCallbackFunc = function(e) {\n  const [url, args, options] = _TTT\n  callback(url, [e.key, ...(args || [])], options || {})\n}\nexport const keypressToCallback = function(url, args, options) {\n  _TTT = [url, args, options]\n  window.addEventListener(\"keydown\", keypressToCallbackFunc)\n}\nexport const keypressToCallbackRemove = function(url, args, options) {\n  window.removeEventListener(\"keydown\", keypressToCallbackFunc)\n}\n/* END WARNING STABLE AGAIN */\n\n// Callback\nvar i = 0\nvar isBlocked = false\nvar urlBlocks = {}\nexport const callback = function(url, args, {debounce=0, confirm_=false, blocks=false, blocksEachUrl=true, uploadFiles=false,\n                                             params={}, meta={}, clear=false, elementId=null, debug=false,\n                                             event=null, headers={}, onSucces=null, timeout=20000}={}, ) {\n\n  const isWebsocket = (url.startsWith(\"ws://\") || url.startsWith(\"wss://\"))\n  \n  if (!!event) {\n    event.preventDefault()\n    event.stopPropagation()\n  }\n  \n  let postIt = function() {\n    let json\n    console.log(\"REQUEST\", url, args, debounce)\n    i++\n\n    // The element function must have access to the FormData.\n    hypergen.hypergenGlobalFormdata = new FormData()\n    hypergen.hypergenUploadFiles = uploadFiles\n    try {\n      json = JSON.stringify({\n        args: args,\n        meta: meta,\n      })\n    } catch(error) {\n      if (error === MISSING_ELEMENT_EXCEPTION) {\n        console.warn(\"An element is missing. This can happen if a dom element has multiple event handlers.\", url)\n        return\n      } else {\n        throw(error)\n      }\n    }\n\n    \n    let formData = hypergen.hypergenGlobalFormdata\n    hypergen.hypergenGlobalFormdata = null\n    hypergen.hypergenUploadFiles = null\n    formData.append(\"hypergen_data\", json)\n\n    if (blocks === true) {\n      if (isBlocked === true) {\n        console.error(\"Callback was blocked\")\n        return\n      } else {\n        isBlocked = true\n      }\n    }\n    \n    if (blocksEachUrl === true && !isWebsocket) {\n      if (!!urlBlocks[url]) {\n        console.error(\"Callback to \" + url + \" was blocked\")\n        return\n      }\n\n      urlBlocks[url] = true\n    }\n    \n    post(url, formData, (data) => {\n      if (data !== null) applyCommands(data)\n      isBlocked = false\n      if (blocksEachUrl === true && !isWebsocket) {\n        delete urlBlocks[url]\n      }\n      if (clear === true) document.getElementById(elementId).value = \"\"\n      if (!!onSucces) onSucces()\n    }, (data, jsonOk, xhr) => {\n      console.log(\"xhr:\", xhr)\n      isBlocked = false\n      if (blocksEachUrl === true && !isWebsocket) {\n        delete urlBlocks[url]\n      }\n      console.error(\"Hypergen post error occured\", data)\n      if (debug !== true) {\n        if (xhr.getResponseHeader(\"Content-Type\") === \"text/plain\") {\n          data = \"<pre><code>\" + data + \"</pre></code>\"\n        }\n        document.getElementsByTagName(\"html\")[0].innerHTML = data\n      }\n    }, params, headers, {timeout})\n  }\n  const postItWebsocket = function() {\n    console.log(\"WEBSOCKET\", url, args, debounce)\n    let json\n    try {\n      json = JSON.stringify({\n        args: args,\n        meta: meta,\n      })\n    } catch(error) {\n      if (error === MISSING_ELEMENT_EXCEPTION) {\n        console.warn(\"An element is missing. This can happen if a dom element has multiple event handlers.\", url)\n        return\n      } else {\n        throw(error)\n      }\n    }\n    if (!hypergen.websocket.WEBSOCKETS[url]) {\n      console.error(\"Cannot send WS to non existing connection:\", url)\n      return\n    }\n    hypergen.websocket.WEBSOCKETS[url].send(json)\n    if (clear === true) document.getElementById(elementId).value = \"\"\n    \n  }\n\n  const func = isWebsocket ? postItWebsocket : postIt\n  \n  if (debounce === 0) {\n    if (confirm_ === false) func()\n    else if (confirm(confirm_)) func()\n  }\n  else throttle(func, {delay: debounce, group: url, confirm_}) \n}\n\nexport const partialLoad = function(event, url, pushState) {\n  console.log(\"partialLoad to\", url, pushState)\n  window.dispatchEvent(new CustomEvent('hypergen.partialLoad.before', {detail: {event, url, pushState}}))\n  callback(url, [], {'event': event, 'headers': {'X-Hypergen-Partial': '1'}, onSucces: function() {\n    if (!!pushState) {\n      console.log(\"pushing state!\")\n      history.pushState({callback_url: url}, \"\", url)\n      onpushstate()\n      history.forward()\n      window.dispatchEvent(new CustomEvent('hypergen.partialLoad.after', {detail: {event, url, pushState}}))\n    }\n  }})\n}\n\n// Timing\nvar _THROTTLE_GROUPS = {}\nexport let throttle = function (func, {delay=0, group='global', confirm_=false}={}) {\n  if (_THROTTLE_GROUPS[group]) {\n    clearTimeout(_THROTTLE_GROUPS[group])\n    _THROTTLE_GROUPS[group] = null\n  }\n\n  _THROTTLE_GROUPS[group] = setTimeout(function () {\n      if (confirm_ === false) {\n        func()\n      } else {\n        const confirmed = confirm(confirm_)\n        if (confirmed === true) {\n          func()\n        }\n      }\n      _THROTTLE_GROUPS[group] = null\n    }, delay)\n}\n\nexport let cancelThrottle = function(group) {\n  if (_THROTTLE_GROUPS[group]) {\n    clearTimeout(_THROTTLE_GROUPS[group])\n    _THROTTLE_GROUPS[group] = null\n  }\n}\n\n// Internal\n\nconst require_ = function(module) {\n  try {\n    return require(module)\n  } catch(e) {\n    return false\n  }\n}\n\nconst resolvePath = function(path) {\n  const parts = path.split(\".\")\n  let i = -1, obj = null\n  for (let part of parts) {\n    i++\n    if (i === 0) {\n      if (window[part] !== undefined) obj = window[part]\n      else if (obj = require_(part)) null\n      else if (obj = require_(\"./\" + part)) null\n      else throw \"Could not resolve path: \" + path\n    } else {\n      if (obj[part] !== undefined) {\n        try {\n          obj = obj[part].bind(obj)\n        } catch(e) {\n          obj = obj[part]\n        }\n      }\n      else throw \"Could not resolve path: \" + path\n    }\n  }\n  return obj\n}\n\nconst applyCommand = function(path, ...args) {\n  console.log(\"apply command\", path, args)\n  let rpath = resolvePath(path)\n  const result = rpath(...args)\n  const event = new CustomEvent('hypergen.applyCommand.after', {detail: {path, args}})\n  document.dispatchEvent(event)\n  return result\n}\n\nexport const event = function(event, callbackKey, when) {\n  event.preventDefault()\n  event.stopPropagation()\n  if (!!when && !applyCommand(...when, event)) return\n  applyCommand(...hypergen.clientState.hypergen.eventHandlerCallbacks[callbackKey])\n}\n\nexport const applyCommands = function(commands) {\n  if (!!commands._ && commands._.length === 2 && commands._[0] === \"deque\") {\n    commands = commands._[1]\n  }\n  for (let [path, ...args] of commands) {\n    applyCommand(path, ...args)\n  }\n}\n\nconst mergeAttrs = function(target, source){\n  source.getAttributeNames().forEach(name => {\n    let value = source.getAttribute(name)\n    target.setAttribute(name, value)\n  })\n}\n\nconst MISSING_ELEMENT_EXCEPTION = \"MISSING_ELEMENT_EXCEPTION\" \n\n// coerce functions\nexport const coerce = {}\ncoerce.no = function(value) {\n  if (value === \"\") return null\n  return value\n}\ncoerce.str = function(value) {\n  if (value === \"\") return null\n  return value === null ? null : \"\" + value\n}\ncoerce.int = function(value) {\n  if (value === \"\") return null\n  value = parseInt(value)\n  if (isNaN(value)) return null\n  else return value\n}\ncoerce.intlist = function(value) {\n  return value.map(x => parseInt(x))\n}\ncoerce.float = function(value) {\n  if (value === \"\") return null\n  value = parseFloat(value)\n  if (isNaN(value)) return null\n  else return {_: [\"float\", value]}\n}\ncoerce.date = function(value) {\n  if (value === \"\") return null\n  else return {_: [\"date\", value]}\n}\ncoerce.datetime = function(value) {\n  if (value === \"\") return null\n  else return {_: [\"datetime\", value]}\n}\ncoerce.time = function(value) {\n  if (value === \"\") return null\n  else return {_: [\"time\", value]}\n}\ncoerce.month = function(value) {\n  if (value === \"\") return null\n  const parts = value.split(\"-\")\n  return {year: parseInt(parts[0]), month: parseInt(parts[1])}\n}\ncoerce.week = function(value) {\n  if (value === \"\") return null\n  const parts = value.split(\"-\")\n  return {year: parseInt(parts[0]), week: parseInt(parts[1].replace(\"W\", \"\"))}\n}\n\n\n// DOM element value readers\nexport const read = {}\nread.value = function(id) { // value attribute\n  const el = document.getElementById(id)\n  if (el === null) {\n    throw MISSING_ELEMENT_EXCEPTION\n  }\n  return el.value.trim()\n}\nread.checked = function(id) { // checkbox\n  const el = document.getElementById(id)\n  if (el === null) {\n    throw MISSING_ELEMENT_EXCEPTION\n  }\n  return el.checked\n}\nread.radio = function(id) { // radio button. Uses name attribute for value.\n  const el = document.getElementById(id)\n  if (el === null) {\n    throw MISSING_ELEMENT_EXCEPTION\n  }\n  const checked = document.querySelector(\"input[type=radio][name=\" + el.name + \"]:checked\")\n  return checked === null ? null : checked.value\n}\nread.checkboxes = function(id) { // checkboxes. Uses name attribute for value.\n  const el = document.getElementById(id)\n  if (el === null) {\n    throw MISSING_ELEMENT_EXCEPTION\n  }\n  const checked = document.querySelectorAll(\"input[type=checkbox][name=\" + el.name + \"]:checked\")\n  return Array.from(checked).map(cb => cb.value)\n}\nread.contenteditable = function(id) { // contenteditable attribute enabled\n  const el = document.getElementById(id)\n  if (el === null) {\n    throw MISSING_ELEMENT_EXCEPTION\n  }\n  return el.innerHTML\n}\nread.selectMultiple = function(id) { // select, multiple support\n  const el = document.getElementById(id)\n  if (el === null) {\n    throw MISSING_ELEMENT_EXCEPTION\n  }\n  return Array.from(el.selectedOptions).map(option => option.value)\n}\nread.file = function(id, formData) { // file upload\n  const el = document.getElementById(id)\n  if (el === null) {\n    throw MISSING_ELEMENT_EXCEPTION\n  }\n  if (el.files.length !== 1) return null\n  if (hypergen.hypergenUploadFiles === true) formData.append(id, el.files[0])\n  return el.files[0].name\n}\n\n// When functions\nexport const when = {}\nwhen.keycode = function(keycode, event) {\n  return event.code == keycode\n}\n\nexport const element = function(valueFunc, coerceFunc, id) {\n  this.toJSON = function() {\n    const value = resolvePath(valueFunc)(id, hypergen.hypergenGlobalFormdata)\n    if (!!coerceFunc) return resolvePath(coerceFunc)(value)\n    else return coerce.no(value)\n  }\n  return this\n}\n\nexport const reviver = function(k, v) {\n  if (Array.isArray(v)) {\n    if (v.length === 3 && v[0] === \"_\") {\n      if(v[1] === \"element_value\") {\n        return new element(...v[2])\n      }\n    }\n  }\n  return v\n}\n\nconst getCookie = function(name) {\n    let cookieValue = null;\n    if (document.cookie && document.cookie !== '') {\n        const cookies = document.cookie.split(';');\n        for (let i = 0; i < cookies.length; i++) {\n            const cookie = cookies[i].trim();\n            // Does this cookie string begin with the name we want?\n            if (cookie.substring(0, name.length + 1) === (name + '=')) {\n                cookieValue = decodeURIComponent(cookie.substring(name.length + 1));\n                break;\n            }\n        }\n    }\n    return cookieValue;\n}\n\nfunction addParams(url, params) {\n  const ret = []\n  for (let d in params)\n    ret.push(encodeURIComponent(d) + '=' + encodeURIComponent(params[d]))\n  if (ret.length === 0) return url\n  else return url + \"?\" + ret.join('&')\n}\n\nconst post = function(url, formData, onSuccess, onError, params, headers, {timeout=20000}={}) {\n  url = addParams(url, params)\n  \n  const xhr = new XMLHttpRequest()\n  xhr.timeout = timeout\n\n  const progressBar = document.getElementById(\"hypergen-upload-progress-bar\")\n\n  if (progressBar !== null) {\n    xhr.upload.onload = () => {\n      progressBar.style.visibility = \"hidden\"\n      console.log(`The upload is completed: ${xhr.status} ${xhr.response}`)\n    }\n\n    xhr.upload.onerror = () => {\n      progressBar.style.visibility = \"hidden\"\n      console.error('Upload failed.')\n\n    }\n\n    xhr.upload.onabort = () => {\n      progressBar.style.visibility = \"hidden\"\n      console.error('Upload cancelled.')\n    }\n\n    xhr.upload.onprogress = (event) => {\n      progressBar.style.visibility = \"visible\"\n      progressBar.value = event.loaded / event.total\n      console.log(`Uploaded ${event.loaded} of ${event.total} bytes`)\n    }\n  }\n\n  xhr.onload = () => {\n    var jsonOk = false,\n        data = null\n    try {\n      data = JSON.parse(xhr.responseText, reviver)\n      jsonOk = true\n    } catch(e) {\n      data = xhr.responseText\n      jsonOk = false\n    }\n    if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 302)) {\n      window.dispatchEvent(new CustomEvent('hypergen.post.after'))\n      onSuccess(data, xhr)\n    } else {\n      window.dispatchEvent(new CustomEvent('hypergen.post.after'))\n      onError(data, jsonOk, xhr);\n    }\n  }\n\n  xhr.onerror = () => {\n    console.error('xhr onerror')\n    window.dispatchEvent(new CustomEvent('hypergen.post.after'))\n    onError()\n  }\n\n  xhr.onabort = () => {\n    console.error('xhr onabort')\n    window.dispatchEvent(new CustomEvent('hypergen.post.after'))\n    onError()\n  }\n\n  xhr.ontimeout = () => {\n    console.error('xhr ontimeout')\n    window.dispatchEvent(new CustomEvent('hypergen.post.after'))\n    onError()\n  }\n\n  xhr.open('POST', url)\n  xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n  xhr.setRequestHeader('X-Pathname', parent.window.location.pathname);\n  xhr.setRequestHeader('X-CSRFToken', getCookie('csrftoken'));\n  if (!!headers) {\n    for (let k in headers) {\n      console.log(\"Setting custom header\", k, \"to\", headers[k])\n      xhr.setRequestHeader(k, headers[k]);\n    }\n  }\n  window.dispatchEvent(new CustomEvent('hypergen.post.before'))\n  xhr.send(formData)\n}\n\n// history support.\n\nwindow.addEventListener(\"popstate\", function(event) {\n  if (event.state && event.state.callback_url !== undefined) {\n    console.log(\"popstate to partial load\")\n    partialLoad(event, event.state.callback_url)\n  } else {\n    window.location = location.href\n  }\n})\n\nconst pushstate = new Event('hypergen.pushstate')\n\nexport const onpushstate = function() {\n  document.dispatchEvent(pushstate)\n}\n\n// On ready\n\nexport const ready = function(fn, {partial=false}={}) {\n  if (document.readyState != 'loading') {\n    fn();\n  } else if (document.addEventListener) {\n    document.addEventListener('DOMContentLoaded', fn);\n  } else {\n    document.attachEvent('onreadystatechange', function() {\n      if (document.readyState != 'loading')\n        fn();\n    });\n  }\n  if (partial) document.addEventListener(\"hypergen.pushstate\", fn)\n}\n","var DOCUMENT_FRAGMENT_NODE = 11;\n\nfunction morphAttrs(fromNode, toNode) {\n    var toNodeAttrs = toNode.attributes;\n    var attr;\n    var attrName;\n    var attrNamespaceURI;\n    var attrValue;\n    var fromValue;\n\n    // document-fragments dont have attributes so lets not do anything\n    if (toNode.nodeType === DOCUMENT_FRAGMENT_NODE || fromNode.nodeType === DOCUMENT_FRAGMENT_NODE) {\n      return;\n    }\n\n    // update attributes on original DOM element\n    for (var i = toNodeAttrs.length - 1; i >= 0; i--) {\n        attr = toNodeAttrs[i];\n        attrName = attr.name;\n        attrNamespaceURI = attr.namespaceURI;\n        attrValue = attr.value;\n\n        if (attrNamespaceURI) {\n            attrName = attr.localName || attrName;\n            fromValue = fromNode.getAttributeNS(attrNamespaceURI, attrName);\n\n            if (fromValue !== attrValue) {\n                if (attr.prefix === 'xmlns'){\n                    attrName = attr.name; // It's not allowed to set an attribute with the XMLNS namespace without specifying the `xmlns` prefix\n                }\n                fromNode.setAttributeNS(attrNamespaceURI, attrName, attrValue);\n            }\n        } else {\n            fromValue = fromNode.getAttribute(attrName);\n\n            if (fromValue !== attrValue) {\n                fromNode.setAttribute(attrName, attrValue);\n            }\n        }\n    }\n\n    // Remove any extra attributes found on the original DOM element that\n    // weren't found on the target element.\n    var fromNodeAttrs = fromNode.attributes;\n\n    for (var d = fromNodeAttrs.length - 1; d >= 0; d--) {\n        attr = fromNodeAttrs[d];\n        attrName = attr.name;\n        attrNamespaceURI = attr.namespaceURI;\n\n        if (attrNamespaceURI) {\n            attrName = attr.localName || attrName;\n\n            if (!toNode.hasAttributeNS(attrNamespaceURI, attrName)) {\n                fromNode.removeAttributeNS(attrNamespaceURI, attrName);\n            }\n        } else {\n            if (!toNode.hasAttribute(attrName)) {\n                fromNode.removeAttribute(attrName);\n            }\n        }\n    }\n}\n\nvar range; // Create a range object for efficently rendering strings to elements.\nvar NS_XHTML = 'http://www.w3.org/1999/xhtml';\n\nvar doc = typeof document === 'undefined' ? undefined : document;\nvar HAS_TEMPLATE_SUPPORT = !!doc && 'content' in doc.createElement('template');\nvar HAS_RANGE_SUPPORT = !!doc && doc.createRange && 'createContextualFragment' in doc.createRange();\n\nfunction createFragmentFromTemplate(str) {\n    var template = doc.createElement('template');\n    template.innerHTML = str;\n    return template.content.childNodes[0];\n}\n\nfunction createFragmentFromRange(str) {\n    if (!range) {\n        range = doc.createRange();\n        range.selectNode(doc.body);\n    }\n\n    var fragment = range.createContextualFragment(str);\n    return fragment.childNodes[0];\n}\n\nfunction createFragmentFromWrap(str) {\n    var fragment = doc.createElement('body');\n    fragment.innerHTML = str;\n    return fragment.childNodes[0];\n}\n\n/**\n * This is about the same\n * var html = new DOMParser().parseFromString(str, 'text/html');\n * return html.body.firstChild;\n *\n * @method toElement\n * @param {String} str\n */\nfunction toElement(str) {\n    str = str.trim();\n    if (HAS_TEMPLATE_SUPPORT) {\n      // avoid restrictions on content for things like `<tr><th>Hi</th></tr>` which\n      // createContextualFragment doesn't support\n      // <template> support not available in IE\n      return createFragmentFromTemplate(str);\n    } else if (HAS_RANGE_SUPPORT) {\n      return createFragmentFromRange(str);\n    }\n\n    return createFragmentFromWrap(str);\n}\n\n/**\n * Returns true if two node's names are the same.\n *\n * NOTE: We don't bother checking `namespaceURI` because you will never find two HTML elements with the same\n *       nodeName and different namespace URIs.\n *\n * @param {Element} a\n * @param {Element} b The target element\n * @return {boolean}\n */\nfunction compareNodeNames(fromEl, toEl) {\n    var fromNodeName = fromEl.nodeName;\n    var toNodeName = toEl.nodeName;\n    var fromCodeStart, toCodeStart;\n\n    if (fromNodeName === toNodeName) {\n        return true;\n    }\n\n    fromCodeStart = fromNodeName.charCodeAt(0);\n    toCodeStart = toNodeName.charCodeAt(0);\n\n    // If the target element is a virtual DOM node or SVG node then we may\n    // need to normalize the tag name before comparing. Normal HTML elements that are\n    // in the \"http://www.w3.org/1999/xhtml\"\n    // are converted to upper case\n    if (fromCodeStart <= 90 && toCodeStart >= 97) { // from is upper and to is lower\n        return fromNodeName === toNodeName.toUpperCase();\n    } else if (toCodeStart <= 90 && fromCodeStart >= 97) { // to is upper and from is lower\n        return toNodeName === fromNodeName.toUpperCase();\n    } else {\n        return false;\n    }\n}\n\n/**\n * Create an element, optionally with a known namespace URI.\n *\n * @param {string} name the element name, e.g. 'div' or 'svg'\n * @param {string} [namespaceURI] the element's namespace URI, i.e. the value of\n * its `xmlns` attribute or its inferred namespace.\n *\n * @return {Element}\n */\nfunction createElementNS(name, namespaceURI) {\n    return !namespaceURI || namespaceURI === NS_XHTML ?\n        doc.createElement(name) :\n        doc.createElementNS(namespaceURI, name);\n}\n\n/**\n * Copies the children of one DOM element to another DOM element\n */\nfunction moveChildren(fromEl, toEl) {\n    var curChild = fromEl.firstChild;\n    while (curChild) {\n        var nextChild = curChild.nextSibling;\n        toEl.appendChild(curChild);\n        curChild = nextChild;\n    }\n    return toEl;\n}\n\nfunction syncBooleanAttrProp(fromEl, toEl, name) {\n    if (fromEl[name] !== toEl[name]) {\n        fromEl[name] = toEl[name];\n        if (fromEl[name]) {\n            fromEl.setAttribute(name, '');\n        } else {\n            fromEl.removeAttribute(name);\n        }\n    }\n}\n\nvar specialElHandlers = {\n    OPTION: function(fromEl, toEl) {\n        var parentNode = fromEl.parentNode;\n        if (parentNode) {\n            var parentName = parentNode.nodeName.toUpperCase();\n            if (parentName === 'OPTGROUP') {\n                parentNode = parentNode.parentNode;\n                parentName = parentNode && parentNode.nodeName.toUpperCase();\n            }\n            if (parentName === 'SELECT' && !parentNode.hasAttribute('multiple')) {\n                if (fromEl.hasAttribute('selected') && !toEl.selected) {\n                    // Workaround for MS Edge bug where the 'selected' attribute can only be\n                    // removed if set to a non-empty value:\n                    // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12087679/\n                    fromEl.setAttribute('selected', 'selected');\n                    fromEl.removeAttribute('selected');\n                }\n                // We have to reset select element's selectedIndex to -1, otherwise setting\n                // fromEl.selected using the syncBooleanAttrProp below has no effect.\n                // The correct selectedIndex will be set in the SELECT special handler below.\n                parentNode.selectedIndex = -1;\n            }\n        }\n        syncBooleanAttrProp(fromEl, toEl, 'selected');\n    },\n    /**\n     * The \"value\" attribute is special for the <input> element since it sets\n     * the initial value. Changing the \"value\" attribute without changing the\n     * \"value\" property will have no effect since it is only used to the set the\n     * initial value.  Similar for the \"checked\" attribute, and \"disabled\".\n     */\n    INPUT: function(fromEl, toEl) {\n        syncBooleanAttrProp(fromEl, toEl, 'checked');\n        syncBooleanAttrProp(fromEl, toEl, 'disabled');\n\n        if (fromEl.value !== toEl.value) {\n            fromEl.value = toEl.value;\n        }\n\n        if (!toEl.hasAttribute('value')) {\n            fromEl.removeAttribute('value');\n        }\n    },\n\n    TEXTAREA: function(fromEl, toEl) {\n        var newValue = toEl.value;\n        if (fromEl.value !== newValue) {\n            fromEl.value = newValue;\n        }\n\n        var firstChild = fromEl.firstChild;\n        if (firstChild) {\n            // Needed for IE. Apparently IE sets the placeholder as the\n            // node value and vise versa. This ignores an empty update.\n            var oldValue = firstChild.nodeValue;\n\n            if (oldValue == newValue || (!newValue && oldValue == fromEl.placeholder)) {\n                return;\n            }\n\n            firstChild.nodeValue = newValue;\n        }\n    },\n    SELECT: function(fromEl, toEl) {\n        if (!toEl.hasAttribute('multiple')) {\n            var selectedIndex = -1;\n            var i = 0;\n            // We have to loop through children of fromEl, not toEl since nodes can be moved\n            // from toEl to fromEl directly when morphing.\n            // At the time this special handler is invoked, all children have already been morphed\n            // and appended to / removed from fromEl, so using fromEl here is safe and correct.\n            var curChild = fromEl.firstChild;\n            var optgroup;\n            var nodeName;\n            while(curChild) {\n                nodeName = curChild.nodeName && curChild.nodeName.toUpperCase();\n                if (nodeName === 'OPTGROUP') {\n                    optgroup = curChild;\n                    curChild = optgroup.firstChild;\n                } else {\n                    if (nodeName === 'OPTION') {\n                        if (curChild.hasAttribute('selected')) {\n                            selectedIndex = i;\n                            break;\n                        }\n                        i++;\n                    }\n                    curChild = curChild.nextSibling;\n                    if (!curChild && optgroup) {\n                        curChild = optgroup.nextSibling;\n                        optgroup = null;\n                    }\n                }\n            }\n\n            fromEl.selectedIndex = selectedIndex;\n        }\n    }\n};\n\nvar ELEMENT_NODE = 1;\nvar DOCUMENT_FRAGMENT_NODE$1 = 11;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\n\nfunction noop() {}\n\nfunction defaultGetNodeKey(node) {\n  if (node) {\n      return (node.getAttribute && node.getAttribute('id')) || node.id;\n  }\n}\n\nfunction morphdomFactory(morphAttrs) {\n\n    return function morphdom(fromNode, toNode, options) {\n        if (!options) {\n            options = {};\n        }\n\n        if (typeof toNode === 'string') {\n            if (fromNode.nodeName === '#document' || fromNode.nodeName === 'HTML' || fromNode.nodeName === 'BODY') {\n                var toNodeHtml = toNode;\n                toNode = doc.createElement('html');\n                toNode.innerHTML = toNodeHtml;\n            } else {\n                toNode = toElement(toNode);\n            }\n        }\n\n        var getNodeKey = options.getNodeKey || defaultGetNodeKey;\n        var onBeforeNodeAdded = options.onBeforeNodeAdded || noop;\n        var onNodeAdded = options.onNodeAdded || noop;\n        var onBeforeElUpdated = options.onBeforeElUpdated || noop;\n        var onElUpdated = options.onElUpdated || noop;\n        var onBeforeNodeDiscarded = options.onBeforeNodeDiscarded || noop;\n        var onNodeDiscarded = options.onNodeDiscarded || noop;\n        var onBeforeElChildrenUpdated = options.onBeforeElChildrenUpdated || noop;\n        var childrenOnly = options.childrenOnly === true;\n\n        // This object is used as a lookup to quickly find all keyed elements in the original DOM tree.\n        var fromNodesLookup = Object.create(null);\n        var keyedRemovalList = [];\n\n        function addKeyedRemoval(key) {\n            keyedRemovalList.push(key);\n        }\n\n        function walkDiscardedChildNodes(node, skipKeyedNodes) {\n            if (node.nodeType === ELEMENT_NODE) {\n                var curChild = node.firstChild;\n                while (curChild) {\n\n                    var key = undefined;\n\n                    if (skipKeyedNodes && (key = getNodeKey(curChild))) {\n                        // If we are skipping keyed nodes then we add the key\n                        // to a list so that it can be handled at the very end.\n                        addKeyedRemoval(key);\n                    } else {\n                        // Only report the node as discarded if it is not keyed. We do this because\n                        // at the end we loop through all keyed elements that were unmatched\n                        // and then discard them in one final pass.\n                        onNodeDiscarded(curChild);\n                        if (curChild.firstChild) {\n                            walkDiscardedChildNodes(curChild, skipKeyedNodes);\n                        }\n                    }\n\n                    curChild = curChild.nextSibling;\n                }\n            }\n        }\n\n        /**\n         * Removes a DOM node out of the original DOM\n         *\n         * @param  {Node} node The node to remove\n         * @param  {Node} parentNode The nodes parent\n         * @param  {Boolean} skipKeyedNodes If true then elements with keys will be skipped and not discarded.\n         * @return {undefined}\n         */\n        function removeNode(node, parentNode, skipKeyedNodes) {\n            if (onBeforeNodeDiscarded(node) === false) {\n                return;\n            }\n\n            if (parentNode) {\n                parentNode.removeChild(node);\n            }\n\n            onNodeDiscarded(node);\n            walkDiscardedChildNodes(node, skipKeyedNodes);\n        }\n\n        // // TreeWalker implementation is no faster, but keeping this around in case this changes in the future\n        // function indexTree(root) {\n        //     var treeWalker = document.createTreeWalker(\n        //         root,\n        //         NodeFilter.SHOW_ELEMENT);\n        //\n        //     var el;\n        //     while((el = treeWalker.nextNode())) {\n        //         var key = getNodeKey(el);\n        //         if (key) {\n        //             fromNodesLookup[key] = el;\n        //         }\n        //     }\n        // }\n\n        // // NodeIterator implementation is no faster, but keeping this around in case this changes in the future\n        //\n        // function indexTree(node) {\n        //     var nodeIterator = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT);\n        //     var el;\n        //     while((el = nodeIterator.nextNode())) {\n        //         var key = getNodeKey(el);\n        //         if (key) {\n        //             fromNodesLookup[key] = el;\n        //         }\n        //     }\n        // }\n\n        function indexTree(node) {\n            if (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE$1) {\n                var curChild = node.firstChild;\n                while (curChild) {\n                    var key = getNodeKey(curChild);\n                    if (key) {\n                        fromNodesLookup[key] = curChild;\n                    }\n\n                    // Walk recursively\n                    indexTree(curChild);\n\n                    curChild = curChild.nextSibling;\n                }\n            }\n        }\n\n        indexTree(fromNode);\n\n        function handleNodeAdded(el) {\n            onNodeAdded(el);\n\n            var curChild = el.firstChild;\n            while (curChild) {\n                var nextSibling = curChild.nextSibling;\n\n                var key = getNodeKey(curChild);\n                if (key) {\n                    var unmatchedFromEl = fromNodesLookup[key];\n                    // if we find a duplicate #id node in cache, replace `el` with cache value\n                    // and morph it to the child node.\n                    if (unmatchedFromEl && compareNodeNames(curChild, unmatchedFromEl)) {\n                        curChild.parentNode.replaceChild(unmatchedFromEl, curChild);\n                        morphEl(unmatchedFromEl, curChild);\n                    } else {\n                      handleNodeAdded(curChild);\n                    }\n                } else {\n                  // recursively call for curChild and it's children to see if we find something in\n                  // fromNodesLookup\n                  handleNodeAdded(curChild);\n                }\n\n                curChild = nextSibling;\n            }\n        }\n\n        function cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey) {\n            // We have processed all of the \"to nodes\". If curFromNodeChild is\n            // non-null then we still have some from nodes left over that need\n            // to be removed\n            while (curFromNodeChild) {\n                var fromNextSibling = curFromNodeChild.nextSibling;\n                if ((curFromNodeKey = getNodeKey(curFromNodeChild))) {\n                    // Since the node is keyed it might be matched up later so we defer\n                    // the actual removal to later\n                    addKeyedRemoval(curFromNodeKey);\n                } else {\n                    // NOTE: we skip nested keyed nodes from being removed since there is\n                    //       still a chance they will be matched up later\n                    removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n                }\n                curFromNodeChild = fromNextSibling;\n            }\n        }\n\n        function morphEl(fromEl, toEl, childrenOnly) {\n            var toElKey = getNodeKey(toEl);\n\n            if (toElKey) {\n                // If an element with an ID is being morphed then it will be in the final\n                // DOM so clear it out of the saved elements collection\n                delete fromNodesLookup[toElKey];\n            }\n\n            if (!childrenOnly) {\n                // optional\n                if (onBeforeElUpdated(fromEl, toEl) === false) {\n                    return;\n                }\n\n                // update attributes on original DOM element first\n                morphAttrs(fromEl, toEl);\n                // optional\n                onElUpdated(fromEl);\n\n                if (onBeforeElChildrenUpdated(fromEl, toEl) === false) {\n                    return;\n                }\n            }\n\n            if (fromEl.nodeName !== 'TEXTAREA') {\n              morphChildren(fromEl, toEl);\n            } else {\n              specialElHandlers.TEXTAREA(fromEl, toEl);\n            }\n        }\n\n        function morphChildren(fromEl, toEl) {\n            var curToNodeChild = toEl.firstChild;\n            var curFromNodeChild = fromEl.firstChild;\n            var curToNodeKey;\n            var curFromNodeKey;\n\n            var fromNextSibling;\n            var toNextSibling;\n            var matchingFromEl;\n\n            // walk the children\n            outer: while (curToNodeChild) {\n                toNextSibling = curToNodeChild.nextSibling;\n                curToNodeKey = getNodeKey(curToNodeChild);\n\n                // walk the fromNode children all the way through\n                while (curFromNodeChild) {\n                    fromNextSibling = curFromNodeChild.nextSibling;\n\n                    if (curToNodeChild.isSameNode && curToNodeChild.isSameNode(curFromNodeChild)) {\n                        curToNodeChild = toNextSibling;\n                        curFromNodeChild = fromNextSibling;\n                        continue outer;\n                    }\n\n                    curFromNodeKey = getNodeKey(curFromNodeChild);\n\n                    var curFromNodeType = curFromNodeChild.nodeType;\n\n                    // this means if the curFromNodeChild doesnt have a match with the curToNodeChild\n                    var isCompatible = undefined;\n\n                    if (curFromNodeType === curToNodeChild.nodeType) {\n                        if (curFromNodeType === ELEMENT_NODE) {\n                            // Both nodes being compared are Element nodes\n\n                            if (curToNodeKey) {\n                                // The target node has a key so we want to match it up with the correct element\n                                // in the original DOM tree\n                                if (curToNodeKey !== curFromNodeKey) {\n                                    // The current element in the original DOM tree does not have a matching key so\n                                    // let's check our lookup to see if there is a matching element in the original\n                                    // DOM tree\n                                    if ((matchingFromEl = fromNodesLookup[curToNodeKey])) {\n                                        if (fromNextSibling === matchingFromEl) {\n                                            // Special case for single element removals. To avoid removing the original\n                                            // DOM node out of the tree (since that can break CSS transitions, etc.),\n                                            // we will instead discard the current node and wait until the next\n                                            // iteration to properly match up the keyed target element with its matching\n                                            // element in the original tree\n                                            isCompatible = false;\n                                        } else {\n                                            // We found a matching keyed element somewhere in the original DOM tree.\n                                            // Let's move the original DOM node into the current position and morph\n                                            // it.\n\n                                            // NOTE: We use insertBefore instead of replaceChild because we want to go through\n                                            // the `removeNode()` function for the node that is being discarded so that\n                                            // all lifecycle hooks are correctly invoked\n                                            fromEl.insertBefore(matchingFromEl, curFromNodeChild);\n\n                                            // fromNextSibling = curFromNodeChild.nextSibling;\n\n                                            if (curFromNodeKey) {\n                                                // Since the node is keyed it might be matched up later so we defer\n                                                // the actual removal to later\n                                                addKeyedRemoval(curFromNodeKey);\n                                            } else {\n                                                // NOTE: we skip nested keyed nodes from being removed since there is\n                                                //       still a chance they will be matched up later\n                                                removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n                                            }\n\n                                            curFromNodeChild = matchingFromEl;\n                                        }\n                                    } else {\n                                        // The nodes are not compatible since the \"to\" node has a key and there\n                                        // is no matching keyed node in the source tree\n                                        isCompatible = false;\n                                    }\n                                }\n                            } else if (curFromNodeKey) {\n                                // The original has a key\n                                isCompatible = false;\n                            }\n\n                            isCompatible = isCompatible !== false && compareNodeNames(curFromNodeChild, curToNodeChild);\n                            if (isCompatible) {\n                                // We found compatible DOM elements so transform\n                                // the current \"from\" node to match the current\n                                // target DOM node.\n                                // MORPH\n                                morphEl(curFromNodeChild, curToNodeChild);\n                            }\n\n                        } else if (curFromNodeType === TEXT_NODE || curFromNodeType == COMMENT_NODE) {\n                            // Both nodes being compared are Text or Comment nodes\n                            isCompatible = true;\n                            // Simply update nodeValue on the original node to\n                            // change the text value\n                            if (curFromNodeChild.nodeValue !== curToNodeChild.nodeValue) {\n                                curFromNodeChild.nodeValue = curToNodeChild.nodeValue;\n                            }\n\n                        }\n                    }\n\n                    if (isCompatible) {\n                        // Advance both the \"to\" child and the \"from\" child since we found a match\n                        // Nothing else to do as we already recursively called morphChildren above\n                        curToNodeChild = toNextSibling;\n                        curFromNodeChild = fromNextSibling;\n                        continue outer;\n                    }\n\n                    // No compatible match so remove the old node from the DOM and continue trying to find a\n                    // match in the original DOM. However, we only do this if the from node is not keyed\n                    // since it is possible that a keyed node might match up with a node somewhere else in the\n                    // target tree and we don't want to discard it just yet since it still might find a\n                    // home in the final DOM tree. After everything is done we will remove any keyed nodes\n                    // that didn't find a home\n                    if (curFromNodeKey) {\n                        // Since the node is keyed it might be matched up later so we defer\n                        // the actual removal to later\n                        addKeyedRemoval(curFromNodeKey);\n                    } else {\n                        // NOTE: we skip nested keyed nodes from being removed since there is\n                        //       still a chance they will be matched up later\n                        removeNode(curFromNodeChild, fromEl, true /* skip keyed nodes */);\n                    }\n\n                    curFromNodeChild = fromNextSibling;\n                } // END: while(curFromNodeChild) {}\n\n                // If we got this far then we did not find a candidate match for\n                // our \"to node\" and we exhausted all of the children \"from\"\n                // nodes. Therefore, we will just append the current \"to\" node\n                // to the end\n                if (curToNodeKey && (matchingFromEl = fromNodesLookup[curToNodeKey]) && compareNodeNames(matchingFromEl, curToNodeChild)) {\n                    fromEl.appendChild(matchingFromEl);\n                    // MORPH\n                    morphEl(matchingFromEl, curToNodeChild);\n                } else {\n                    var onBeforeNodeAddedResult = onBeforeNodeAdded(curToNodeChild);\n                    if (onBeforeNodeAddedResult !== false) {\n                        if (onBeforeNodeAddedResult) {\n                            curToNodeChild = onBeforeNodeAddedResult;\n                        }\n\n                        if (curToNodeChild.actualize) {\n                            curToNodeChild = curToNodeChild.actualize(fromEl.ownerDocument || doc);\n                        }\n                        fromEl.appendChild(curToNodeChild);\n                        handleNodeAdded(curToNodeChild);\n                    }\n                }\n\n                curToNodeChild = toNextSibling;\n                curFromNodeChild = fromNextSibling;\n            }\n\n            cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey);\n\n            var specialElHandler = specialElHandlers[fromEl.nodeName];\n            if (specialElHandler) {\n                specialElHandler(fromEl, toEl);\n            }\n        } // END: morphChildren(...)\n\n        var morphedNode = fromNode;\n        var morphedNodeType = morphedNode.nodeType;\n        var toNodeType = toNode.nodeType;\n\n        if (!childrenOnly) {\n            // Handle the case where we are given two DOM nodes that are not\n            // compatible (e.g. <div> --> <span> or <div> --> TEXT)\n            if (morphedNodeType === ELEMENT_NODE) {\n                if (toNodeType === ELEMENT_NODE) {\n                    if (!compareNodeNames(fromNode, toNode)) {\n                        onNodeDiscarded(fromNode);\n                        morphedNode = moveChildren(fromNode, createElementNS(toNode.nodeName, toNode.namespaceURI));\n                    }\n                } else {\n                    // Going from an element node to a text node\n                    morphedNode = toNode;\n                }\n            } else if (morphedNodeType === TEXT_NODE || morphedNodeType === COMMENT_NODE) { // Text or comment node\n                if (toNodeType === morphedNodeType) {\n                    if (morphedNode.nodeValue !== toNode.nodeValue) {\n                        morphedNode.nodeValue = toNode.nodeValue;\n                    }\n\n                    return morphedNode;\n                } else {\n                    // Text node to something else\n                    morphedNode = toNode;\n                }\n            }\n        }\n\n        if (morphedNode === toNode) {\n            // The \"to node\" was not compatible with the \"from node\" so we had to\n            // toss out the \"from node\" and use the \"to node\"\n            onNodeDiscarded(fromNode);\n        } else {\n            if (toNode.isSameNode && toNode.isSameNode(morphedNode)) {\n                return;\n            }\n\n            morphEl(morphedNode, toNode, childrenOnly);\n\n            // We now need to loop over any keyed nodes that might need to be\n            // removed. We only do the removal if we know that the keyed node\n            // never found a match. When a keyed node is matched up we remove\n            // it out of fromNodesLookup and we use fromNodesLookup to determine\n            // if a keyed node has been matched up or not\n            if (keyedRemovalList) {\n                for (var i=0, len=keyedRemovalList.length; i<len; i++) {\n                    var elToRemove = fromNodesLookup[keyedRemovalList[i]];\n                    if (elToRemove) {\n                        removeNode(elToRemove, elToRemove.parentNode, false);\n                    }\n                }\n            }\n        }\n\n        if (!childrenOnly && morphedNode !== fromNode && fromNode.parentNode) {\n            if (morphedNode.actualize) {\n                morphedNode = morphedNode.actualize(fromNode.ownerDocument || doc);\n            }\n            // If we had to swap out the from node with a new node because the old\n            // node was not compatible with the target node then we need to\n            // replace the old DOM node in the original DOM tree. This is only\n            // possible if the original DOM node was part of a DOM tree which\n            // we know is the case if it has a parent node.\n            fromNode.parentNode.replaceChild(morphedNode, fromNode);\n        }\n\n        return morphedNode;\n    };\n}\n\nvar morphdom = morphdomFactory(morphAttrs);\n\nexport default morphdom;\n","import Sockette from 'sockette'\n\nexport const WEBSOCKETS = {}\n\nconst log = function(e, action, url, options) {\n  console.log('Websocket ' + action + \" to url\", url, \"with options\", options, \"and event\", e)\n}\n\nexport const open = function(url, options) {\n  if (!options) options = {}\n  if (!!WEBSOCKETS[url]) {\n    log(null, \"ALREADY_OPENED_BYE\", url, options)\n    return\n  }\n  \n  WEBSOCKETS[url] = new Sockette(url, Object.assign({\n    timeout: 1e3,\n    maxAttempts: Number.MAX_SAFE_INTEGER,\n    onopen: e => log(e, \"OPENED\", url, options),\n    onmessage: e => {\n      hypergen.applyCommands(JSON.parse(e.data))\n    },\n    onreconnect: e => log(e, \"RECONNECTING\", url, options),\n    onmaximum: e => log(e, \"MAX_RECONNECTS_BYE\", url, options),\n    onclose: e => {\n      log(e, \"CLOSED\", url, options)\n    },\n    onerror: e => console.log('Error:', e),\n  }, options))\n}\n\nexport const close = function(url) {\n  if (!WEBSOCKETS[url]) {\n    log(null, \"ALREADY_CLOSED_BYE\", url, null)\n    return\n  }\n  WEBSOCKETS[url].close()\n  delete WEBSOCKETS[url]\n  log(null, \"CLOSED_AND_DELETED\", url, null)\n}\n","function noop() {}\n\nexport default function (url, opts) {\n\topts = opts || {};\n\n\tvar ws, num=0, timer=1, $={};\n\tvar max = opts.maxAttempts || Infinity;\n\n\t$.open = function () {\n\t\tws = new WebSocket(url, opts.protocols || []);\n\n\t\tws.onmessage = opts.onmessage || noop;\n\n\t\tws.onopen = function (e) {\n\t\t\t(opts.onopen || noop)(e);\n\t\t\tnum = 0;\n\t\t};\n\n\t\tws.onclose = function (e) {\n\t\t\te.code === 1e3 || e.code === 1001 || e.code === 1005 || $.reconnect(e);\n\t\t\t(opts.onclose || noop)(e);\n\t\t};\n\n\t\tws.onerror = function (e) {\n\t\t\t(e && e.code==='ECONNREFUSED') ? $.reconnect(e) : (opts.onerror || noop)(e);\n\t\t};\n\t};\n\n\t$.reconnect = function (e) {\n\t\tif (timer && num++ < max) {\n\t\t\ttimer = setTimeout(function () {\n\t\t\t\t(opts.onreconnect || noop)(e);\n\t\t\t\t$.open();\n\t\t\t}, opts.timeout || 1e3);\n\t\t} else {\n\t\t\t(opts.onmaximum || noop)(e);\n\t\t}\n\t};\n\n\t$.json = function (x) {\n\t\tws.send(JSON.stringify(x));\n\t};\n\n\t$.send = function (x) {\n\t\tws.send(x);\n\t};\n\n\t$.close = function (x, y) {\n\t\ttimer = clearTimeout(timer);\n\t\tws.close(x || 1e3, y);\n\t};\n\n\t$.open(); // init\n\n\treturn $;\n}\n"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","morphAttrs","$d6aa37e28bb14658$var$range","$5d2e5e1479d27cab$exports","$5d2e5e1479d27cab$export$2e5e8c41f5d4e7c7","$5d2e5e1479d27cab$export$cd7f480d6b8286c3","$5d2e5e1479d27cab$export$fe8985bb6374093c","$5d2e5e1479d27cab$export$79693fdaa4661ff2","$5d2e5e1479d27cab$export$664c6d24e3175067","$5d2e5e1479d27cab$export$73920f18ca706874","$5d2e5e1479d27cab$export$89e12c5b50f7529d","$5d2e5e1479d27cab$export$10d8903dec122b9d","$5d2e5e1479d27cab$export$68159836694e22c1","$5d2e5e1479d27cab$export$117c6580f10117fb","$5d2e5e1479d27cab$export$dd6ad98138aae6a3","$5d2e5e1479d27cab$export$41528721a63e1cee","$5d2e5e1479d27cab$export$fb5deb78d2f5421","$5d2e5e1479d27cab$export$3f65cefe8380dbea","$5d2e5e1479d27cab$export$eb872837e3137261","$5d2e5e1479d27cab$export$aebc7529e8ab5fd3","$5d2e5e1479d27cab$export$4bf93dbed412fb4d","$5d2e5e1479d27cab$export$de363e709c412c8a","$5d2e5e1479d27cab$export$73395861aa8174cf","$5d2e5e1479d27cab$export$cfdba980e7d40be8","$5d2e5e1479d27cab$export$2ab6c72538d2a4d7","$5d2e5e1479d27cab$export$6cd530ed55e06764","$5d2e5e1479d27cab$export$8c14e57e778d3873","$5d2e5e1479d27cab$export$aafa59e2e03f2942","$5d2e5e1479d27cab$export$a55877ca9db47377","$5d2e5e1479d27cab$export$8454457683f90105","$5d2e5e1479d27cab$export$63698c10df99509c","$5d2e5e1479d27cab$export$28ee1007e174a2a6","$d6aa37e28bb14658$var$doc","document","undefined","$d6aa37e28bb14658$var$HAS_TEMPLATE_SUPPORT","createElement","$d6aa37e28bb14658$var$HAS_RANGE_SUPPORT","createRange","$d6aa37e28bb14658$var$compareNodeNames","fromEl","toEl","fromCodeStart","toCodeStart","fromNodeName","nodeName","toNodeName","charCodeAt","toUpperCase","$d6aa37e28bb14658$var$syncBooleanAttrProp","name","setAttribute","removeAttribute","$d6aa37e28bb14658$var$specialElHandlers","OPTION","parentNode","parentName","hasAttribute","selected","selectedIndex","INPUT","value","TEXTAREA","newValue","firstChild","oldValue","nodeValue","placeholder","SELECT","optgroup","i","curChild","nextSibling","$d6aa37e28bb14658$var$noop","$d6aa37e28bb14658$var$defaultGetNodeKey","node","getAttribute","id","$d6aa37e28bb14658$var$morphdom","fromNode","toNode","attr","attrName","attrNamespaceURI","attrValue","toNodeAttrs","attributes","nodeType","length","namespaceURI","localName","getAttributeNS","prefix","setAttributeNS","fromNodeAttrs","d","hasAttributeNS","removeAttributeNS","options","str","template","fragment","toNodeHtml","innerHTML","trim","content","childNodes","selectNode","body","createContextualFragment","getNodeKey","onBeforeNodeAdded","onNodeAdded","onBeforeElUpdated","onElUpdated","onBeforeNodeDiscarded","onNodeDiscarded","onBeforeElChildrenUpdated","childrenOnly","fromNodesLookup","create","keyedRemovalList","addKeyedRemoval","key","push","removeNode","skipKeyedNodes","removeChild","walkDiscardedChildNodes","indexTree","morphedNode","morphedNodeType","toNodeType","$d6aa37e28bb14658$var$moveChildren","nextChild","appendChild","createElementNS","isSameNode","morphEl","toElKey","morphChildren","curToNodeKey","curFromNodeKey","fromNextSibling","toNextSibling","matchingFromEl","curToNodeChild","curFromNodeChild","outer","curFromNodeType","isCompatible","insertBefore","onBeforeNodeAddedResult","actualize","ownerDocument","handleNodeAdded","el","unmatchedFromEl","replaceChild","cleanupFromEl","specialElHandler","len","elToRemove","$064669c0b5fd3d60$exports","$677e5af0d8815dd0$var$noop","$677e5af0d8815dd0$export$2e2bcd8739ae039","url","opts","ws","num","timer","$","max","maxAttempts","Infinity","open","WebSocket","protocols","onmessage","onopen","onclose","code","reconnect","onerror","setTimeout","onreconnect","timeout","onmaximum","json","x","send","JSON","stringify","close","y","clearTimeout","$064669c0b5fd3d60$export$d0711f5bc279c186","$064669c0b5fd3d60$export$3ce6949f20cea765","$064669c0b5fd3d60$export$8360e631d277ea4d","$064669c0b5fd3d60$var$log","action","console","log","assign","Number","MAX_SAFE_INTEGER","hypergen","applyCommands","parse","data","window","websocket","Array","isArray","obj","prototype","toString","call","html","element","getElementById","error","focused","activeElement","types","indexOf","type","$5d2e5e1479d27cab$var$mergeAttrs","files","script","forEach","docNonceEl","querySelector","docNonce","nonce","replaceWith","autofocus","querySelectorAll","focus","style","display","visibility","link","href","click","clientState","at","path","split","$5d2e5e1479d27cab$var$INTERVALS","commands","interval","setInterval","clearInterval","querySelectorString","addEventListener","event","$5d2e5e1479d27cab$var$_TTT","$5d2e5e1479d27cab$var$keypressToCallbackFunc","args","removeEventListener","$5d2e5e1479d27cab$var$i","$5d2e5e1479d27cab$var$isBlocked","$5d2e5e1479d27cab$var$urlBlocks","debounce","confirm_","blocks","blocksEachUrl","uploadFiles","params","meta","clear","elementId","debug","headers","onSucces","isWebsocket","startsWith","preventDefault","stopPropagation","func","$5d2e5e1479d27cab$var$MISSING_ELEMENT_EXCEPTION","warn","WEBSOCKETS","hypergenGlobalFormdata","FormData","hypergenUploadFiles","formData","append","$5d2e5e1479d27cab$var$post","jsonOk","xhr","getResponseHeader","getElementsByTagName","confirm","delay","group","pushState","dispatchEvent","CustomEvent","detail","history","callback_url","forward","$5d2e5e1479d27cab$var$_THROTTLE_GROUPS","confirmed","$5d2e5e1479d27cab$var$require_","module","require","$5d2e5e1479d27cab$var$resolvePath","parts","part","bind","$5d2e5e1479d27cab$var$applyCommand","rpath","result","callbackKey","when","eventHandlerCallbacks","_","target","source","getAttributeNames","no","int","isNaN","parseInt","intlist","map","float","parseFloat","date","datetime","time","month","year","week","replace","checked","radio","checkboxes","from","cb","contenteditable","selectMultiple","selectedOptions","option","file","keycode","valueFunc","coerceFunc","toJSON","k","$5d2e5e1479d27cab$var$getCookie","cookieValue","cookie","cookies","substring","decodeURIComponent","onSuccess","onError","$5d2e5e1479d27cab$var$addParams","ret","encodeURIComponent","join","XMLHttpRequest","progressBar","upload","onload","status","response","onabort","onprogress","loaded","total","responseText","readyState","ontimeout","setRequestHeader","parent","location","pathname","state","$5d2e5e1479d27cab$var$pushstate","Event","fn","partial","attachEvent"],"version":3,"file":"hypergen.js.map"}