@webqit/oohtml 4.4.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +2 -2
- package/dist/context-api.js +1 -1
- package/dist/context-api.js.map +2 -2
- package/dist/data-binding.js +5 -5
- package/dist/data-binding.js.map +2 -2
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +15 -15
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +10 -10
- package/dist/main.lite.js.map +2 -2
- package/dist/namespaced-html.js +1 -1
- package/dist/namespaced-html.js.map +2 -2
- package/dist/scoped-css.js +1 -1
- package/dist/scoped-css.js.map +2 -2
- package/package.json +2 -2
- package/src/bindings-api/index.js +1 -1
- package/src/context-api/DOMContexts.js +1 -1
- package/src/data-binding/index.js +13 -13
- package/src/html-imports/HTMLImportsContext.js +1 -1
package/dist/data-binding.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../node_modules/@webqit/quantum-js/src/params.js", "../node_modules/@webqit/realdom/src/realtime/Util.js", "../node_modules/@webqit/util/js/isObject.js", "../node_modules/@webqit/util/js/isArray.js", "../node_modules/@webqit/util/js/isTypeFunction.js", "../node_modules/@webqit/util/js/isNull.js", "../node_modules/@webqit/util/js/isUndefined.js", "../node_modules/@webqit/util/js/isTypeObject.js", "../node_modules/@webqit/util/js/isEmpty.js", "../node_modules/@webqit/util/js/isFunction.js", "../node_modules/@webqit/util/js/isNumber.js", "../node_modules/@webqit/util/js/isNumeric.js", "../node_modules/@webqit/util/js/isString.js", "../node_modules/@webqit/util/js/isTypeArray.js", "../node_modules/@webqit/util/arr/pushUnique.js", "../node_modules/@webqit/util/obj/getPrototypeChain.js", "../node_modules/@webqit/util/obj/getAllPropertyNames.js", "../node_modules/@webqit/util/obj/mergeCallback.js", "../node_modules/@webqit/util/obj/merge.js", "../node_modules/@webqit/util/js/wq.js", "../node_modules/@webqit/util/arr/from.js", "../node_modules/@webqit/util/obj/get.js", "../node_modules/@webqit/util/obj/set.js", "../node_modules/@webqit/realdom/src/Scheduler.js", "../node_modules/@webqit/realdom/src/realtime/DOMSpec.js", "../node_modules/@webqit/realdom/src/realtime/Realtime.js", "../node_modules/@webqit/realdom/src/realtime/AttrRealtime.js", "../node_modules/@webqit/realdom/src/realtime/DOMRealtime.js", "../node_modules/@webqit/realdom/src/polyfills.js", "../node_modules/@webqit/realdom/src/index.js", "../node_modules/@webqit/util/str/toTitle.js", "../src/util.js", "../src/data-binding/index.js", "../src/data-binding/targets.browser.js"],
|
|
4
|
-
"sourcesContent": ["\n/**\n * @exports\n */\nexport function resolveParams( ...extensions ) {\n let extension, params = { runtimeParams, compilerParams, parserParams };\n while( extension = extensions.shift() ) {\n const {\n runtimeParams: _runtimeParams = {},\n compilerParams: { globalsNoObserve: _globalsNoObserve = [], globalsOnlyPathsExcept: _globalsOnlyPathsExcept = [], ..._compilerParams } = {},\n parserParams: _parserParams = {},\n } = extension;\n params = {\n runtimeParams: { ...params.runtimeParams, ..._runtimeParams },\n compilerParams: { ...params.compilerParams, globalsNoObserve: [ ...params.compilerParams.globalsNoObserve, ..._globalsNoObserve ], globalsOnlyPathsExcept: [ ...params.compilerParams.globalsOnlyPathsExcept, ..._globalsOnlyPathsExcept ], ..._compilerParams },\n parserParams: { ...params.parserParams, ..._parserParams },\n };\n if ( extensions.devMode ) { /* shortcut for devMode configs */ }\n }\n return params;\n}\nexport const parserParams = {\n ecmaVersion: 'latest',\n allowReturnOutsideFunction: true,\n allowAwaitOutsideFunction: false,\n allowSuperOutsideMethod: false,\n preserveParens: false,\n locations: true,\n};\nexport const compilerParams = {\n globalsNoObserve: [ 'arguments', 'debugger', ],\n globalsOnlyPathsExcept: [],\n originalSource: true,\n locations: true,\n compact: 2,\n};\nexport const runtimeParams = {\n apiVersion: 3,\n};\n", "\n\nexport function isXpath( expr ) { return ( expr = expr.trim() ) && expr.startsWith( '(' ) && expr.endsWith( ')' ) }\n\nexport function xpathQuery( window, context, expr, subtree = true ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', subtree ? '(.//' : '(./' ) ).join( '|' );\n let nodes = [], node;\n try {\n // Throws in firefox and safari where context is a text node\n const result = window.document.evaluate( expr, context, null, window.XPathResult.ANY_TYPE );\n while ( node = result.iterateNext() ) nodes.push( node );\n } catch( e ) {}\n return nodes;\n}\n\nexport function xpathMatch( window, node, expr ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', '(self::' ) ).join( '|' );\n try {\n // Throws in firefox and safari where context is a text node and query isn't\n return window.document.evaluate( `${ expr }`, node, null, window.XPathResult.BOOLEAN_TYPE ).booleanValue;\n } catch( e ) {}\n}\n\nexport function containsNode( window, a, b, crossRoots = false, testCache = null ) {\n const prevTest = testCache?.get( a )?.get( b );\n if ( typeof prevTest !== 'undefined' ) return prevTest;\n const response = val => {\n if ( !testCache?.has( a ) ) testCache?.set( a, new WeakMap );\n testCache?.get( a )?.set( b, val );\n return val;\n };\n const rootNodeA = a.getRootNode();\n const rootNodeB = b.getRootNode();\n if ( rootNodeA === rootNodeB ) return response( a.contains( b ) );\n if ( crossRoots && rootNodeB instanceof window.ShadowRoot ) return response( containsNode( window, a, rootNodeB.host, crossRoots, testCache ) );\n return response( false );\n}\n\nexport function splitOuter( str, delim = '|' ) {\n return [ ...str ].reduce( ( [ quote, depth, splits, skip ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}", "\n/**\n * Tells if val is pure object.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\n};\n", "\n/**\n * Tells if val is of type \"array\".\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val);\n};\n", "\n/**\n * Tells if val is of type \"function\".\n * This holds true for both regular functions and classes.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn typeof val === 'function';\n};\n", "\n/**\n * Tells if val is undefined or is null.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val === null || val === '';\n};\n", "\n/**\n * Tells if val is undefined or is of type \"undefined\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"object\".\n * This holds true for anything object, including built-ins.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\n};\n", "\n/**\n * @imports\n */\nimport _isNull from './isNull.js';\nimport _isUndefined from './isUndefined.js';\nimport _isTypeObject from './isTypeObject.js';\n\n/**\n * Tells if val is empty in its own type.\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\n * objects without keys, empty arrays.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"function\".\n *\n * @param object \t\tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\n};\n", "\n/**\n * Tells if val is of type \"number\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof Number || (typeof val === 'number');\n};\n", "\n/**\n * @imports\n */\nimport _isNumber from './isNumber.js';\n/**\n * Tells if val is of type \"string\" or a numeric string.\n * This holds true for both numbers and numeric strings.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\n};\n", "\n/**\n * Tells if val is of type \"string\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\n};\n", "\n/**\n * @imports\n */\nimport _isString from './isString.js';\nimport _isUndefined from './isUndefined.js';\n\n/**\n * Tells if val is \"array-like\".\n * This holds true for anything that has a length property.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !_isString(val) && !_isUndefined(val.length);\n};\n", "\n/**\n * Adds an item if not already exist.\n *\n * @param array \tarr\n * @param array\t \t...itms\n *\n * @return array\n */\nexport default function(arr, ...items) {\n\titems.forEach(itm => {\n\t\tif (arr.indexOf(itm) < 0) {\n\t\t\tarr.push(itm);\n\t\t}\n\t});\n\treturn arr;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\n\n/**\n * Returns the prototype chain.\n *\n * @param object \t\tobj\n * @param object\t \tuntil\n *\n * @return bool\n */\nexport default function(obj, until) {\n\tuntil = until || Object.prototype;\n\tuntil = until && !_isArray(until) ? [until] : until;\n\t// We get the chain of inheritance\n\tvar prototypalChain = [];\n\tvar obj = obj;\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\n\t\tprototypalChain.push(obj);\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\n\t}\n\treturn prototypalChain;\n};\n", "\n/**\n * @imports\n */\nimport _pushUnique from '../arr/pushUnique.js';\nimport _getPrototypeChain from './getPrototypeChain.js';\n\n/**\n * Eagerly retrieves object members all down the prototype chain.\n *\n * @param object\t \tobj\n * @param object\t \tuntil\n *\n * @return array\n */\nexport default function(obj, until) {\n\tvar keysAll = [];\n\t_getPrototypeChain(obj, until).forEach(obj => {\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\n\t});\n\treturn keysAll;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isObject from '../js/isObject.js';\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _getAllPropertyNames from './getAllPropertyNames.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\n\tvar depth = 0;\n\tvar obj1 = objs.shift();\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\n\t\tdepth = obj1;\n\t\tobj1 = objs.shift();\n\t}\n\tif (!objs.length) {\n\t\tthrow new Error('_merge() requires two or more array/objects.');\n\t}\n\tobjs.forEach((obj2, i) => {\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\n\t\t\treturn;\n\t\t}\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\n\t\t\tif (!callback(key, obj1, obj2, i)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valAtObj1 = obj1[key];\n\t\t\tvar valAtObj2 = obj2[key];\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \n\t\t\t&& (depth === true || depth > 0)) {\n\t\t\t\t// RECURSE...\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\n\t\t\t} else {\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\n\t\t\t\t\tif (isReplace) {\n\t\t\t\t\t\tobj1[key] = valAtObj2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj1.push(valAtObj2);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// In case we're setting a read-only property\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (withSymbols) {\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\treturn obj1;\n};\n", "\n/**\n * @imports\n */\nimport _mergeCallback from './mergeCallback.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function(...objs) {\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\n\t\treturn true;\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\n};\n", "export default function wq(obj, ...namespaces) {\n if (!obj || !['object', 'function'].includes(typeof obj)) {\n throw new Error(`Argument #1 must be of type object`);\n }\n let wq = obj[Symbol.for('wq')];\n if (!wq) {\n wq = new WQInternals;\n Object.defineProperty(obj, Symbol.for('wq'), {\n value: wq,\n // Defaults, but to be explicit...\n enumerable: false,\n configurable: false,\n writable: false\n });\n }\n if (!namespaces.length) {\n return wq;\n }\n let _ns, _wq;\n while ((_ns = namespaces.shift())) {\n if ((_wq = wq) && !(wq = wq.get(_ns))) {\n wq = new WQInternals;\n _wq.set(_ns, wq);\n }\n }\n return wq;\n}\n\nclass WQInternals extends Map {}", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isTypeArray from '../js/isTypeArray.js';\nimport _isEmpty from '../js/isEmpty.js';\nimport _isObject from '../js/isObject.js';\n\n/**\n * Casts an array-like object to an array.\n *\n * @param mixed \tval\n * @param bool\t \tcastObject\n *\n * @return array\n */\nexport default function(val, castObject = true) {\n\tif (_isArray(val)) {\n\t\treturn val;\n\t};\n\tif (!castObject && _isObject(val)) {\n\t\treturn [val];\n\t};\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\n\t\treturn [];\n\t};\n\tif (_isTypeArray(val)) {\n\t\treturn Array.prototype.slice.call(val);\n\t};\n\tif (_isObject(val)) {\n\t\treturn Object.values(val);\n\t};\n\treturn [val];\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isUndefined from '../js/isUndefined.js';\nimport _isNull from '../js/isNull.js';\nimport _arrFrom from '../arr/from.js';\n\n/**\n * Retrieves the value at the given path.\n *\n * A return value of undefined is ambiguous, and can mean either that the\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\n * know whether the path actually exists, pass an object as a third argument.\n * This object will have an \"exists\" key set to true/false.\n *\n * @param object \t\t\t\tctxt\n * @param array \t\t\t\tpath\n * @param object \t\t\t\ttrap\n * @param object \t\t\t\treciever\n *\n * @return mixed\n */\nexport default function(ctxt, path, trap = {}, reciever = {}) {\n\tpath = _arrFrom(path).slice();\n\tvar _ctxt = ctxt;\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\n\t\tvar _key = path.shift();\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\n\t\t\treciever.exists = false;\n\t\t\treturn;\n\t\t}\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\n\t}\n\treciever.exists = true;\n\treturn _ctxt;\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _isArray from '../js/isArray.js';\nimport _arrFrom from '../arr/from.js';\nimport _get from './get.js';\n\n/**\n * Sets a value to the given path.\n *\n * @param object \t\t\t\tobj\n * @param array \t\t\t\tpath\n * @param mixed \t\t\t\tval\n * @param object|function \t\tbuildTree\n * @param object \t\t\t\ttrap\n *\n * @return bool\n */\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\n\tconst _set = (target, key, val) => {\n\t\tif (trap.set) {\n\t\t\treturn trap.set(target, key, val);\n\t\t} else {\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\n\t\t\t\ttarget.push(val);\n\t\t\t} else {\n\t\t\t\ttarget[key] = val;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t};\n\tpath = _arrFrom(path);\n\tvar target = obj;\n\tfor(var i = 0; i < path.length; i ++) {\n\t\tif (i < path.length - 1) {\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar branch = _get(target, path[i], trap);\n\t\t\tif (!_isTypeObject(branch)) {\n\t\t\t\tif (trap.buildTree === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\n\t\t\t\tif (!branchSuccess) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttarget = branch;\n\t\t} else {\n\t\t\treturn _set(target, path[i], val);\n\t\t}\n\t}\n};\n", "\n/**\n * ---------------------------\n * Binds callbacks to requestAnimationFrame()\n * to create a central \"read/write\" phases for Ctxt access.\n * ---------------------------\n */\n\t\t\t\nexport default class Scheduler {\n\n\t/**\n\t * Starts the loop.\n\t *\n\t * @return this\n\t */\n\tconstructor( window, synthesis = false ) {\n\t\tObject.defineProperty( this, 'window', { value: window } );\n\t\tObject.defineProperty( this, 'readCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, 'writeCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, '_synthesis', { value: 0, writable: true } );\n\t\tif ( !synthesis && this.window.requestAnimationFrame ) {\n\t\t\tthis._loop();\n\t\t} else { this._synthesis ++; }\n\t}\n\n\tget synthesis() { return this._synthesis; }\n\n\tasync synthesizeWhile( callback ) {\n\t\tthis._synthesis ++;\n\t\tthis._fulfill();\n\t\tconst returnValue = await callback();\n\t\tthis._synthesis --;\n\t\treturn returnValue;\n\t}\n\n\t_fulfill() {\n\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.readCallbacks.delete( callback );\n\t\t}\n\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.writeCallbacks.delete( callback );\n\t\t}\n\t}\n\n\t_loop() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tthis._fulfill();\n\t\t\tthis._loop();\n\t\t} );\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"read\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonread( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.readCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.readCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"write\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonwrite( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.writeCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.writeCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * A special construct for Ctxt manipulations that span\n\t * one or more read/write cycles.\n\t *\n\t * @param function \tread\n\t * @param function \twrite\n\t * @param mixed\t\tprevTransaction\n\t *\n\t * @return void|mixed\n\t */\n\tcycle( onread, onwrite, prevTransaction ) {\n\t\tthis.onread( () => {\n\t\t\t// Record initial values\n\t\t\tconst readReturn = onread( prevTransaction );\n\t\t\t// Call erite, the transation\n\t\t\tconst callWrite = ( readReturn ) => {\n\t\t\t\tif ( readReturn === undefined ) return;\n\t\t\t\tthis.onwrite( () => {\n\t\t\t\t\tconst writeReturn = onwrite( readReturn, prevTransaction );\n\t\t\t\t\t// Repeat transaction\n\t\t\t\t\tconst repeatTransaction = ( writeReturn ) => {\n\t\t\t\t\t\tif ( writeReturn === undefined ) return;\n\t\t\t\t\t\tthis.cycle( onread, onwrite, writeReturn );\n\t\t\t\t\t};\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\t// If \"write\" returns a promise, we wait until it is resolved\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\tif ( writeReturn instanceof Promise ) {\n\t\t\t\t\t\twriteReturn.then( repeatTransaction );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trepeatTransaction( writeReturn );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t\t// ---------------------------------------\n\t\t\t// If \"read\" returns a promise, we wait until it is resolved\n\t\t\t// ---------------------------------------\n\t\t\tif ( readReturn instanceof Promise ) {\n\t\t\t\treadReturn.then( callWrite );\n\t\t\t} else {\n\t\t\t\tcallWrite( readReturn );\n\t\t\t}\n\t\t} );\n\t}\n\n}", "\n/**\n * @imports\n */\nimport * as Util from './Util.js';\n\nexport default class DOMSpec {\n constructor( content ) {\n this.content = content;\n this.type = typeof content === 'string' ? 'selector' : 'instance';\n this.kind = this.type === 'instance' ? null : Util.isXpath( content ) ? 'xpath' : 'css';\n if ( this.kind === 'xpath' ) {\n this.isXpathAttr = Util.splitOuter( content.trim().slice( 1, -1 ), '@' ).length > 1;\n }\n }\n toString() { return this.content; }\n}", "\n/**\n * @imports\n */\nimport { _isFunction, _isObject, _wq } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport DOMSpec from './DOMSpec.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class Realtime\n */\nexport default class Realtime {\n\n\t/**\n\t * @constructor\n\t *\n\t * @param document|Element\tcontext\n\t */\n\tconstructor( context, namespace, window ) {\n\t\tthis.context = context;\n\t\tthis.namespace = namespace;\n\t\tthis.window = context.defaultView || context.ownerDocument?.defaultView || window;\n\t\tthis.document = this.window.document;\n\t\tthis.webqit = this.window.webqit;\n\t\tObject.defineProperty( this, '#', { value: {} } );\n\t}\n\t\n\t/**\n\t * Resolves arguments\n\t * \n\t * @param Array \t\t\targs \n\t * \n\t * @returns Array\n\t */\n\tresolveArgs( args ) {\n\t\tif ( _isFunction( args[ 0 ] ) ) { args = [ [], ...args ]; }\n\t\telse if ( _isObject( args[ 0 ] ) && !( args[ 0 ] instanceof DOMSpec ) && args.length === 1 ) {\n\t\t\targs = [ [], undefined, args[ 0 ] ];\n\t\t} else if ( _isObject( args[ 1 ] ) && args.length === 2 ) {\n\t\t\targs = [ _arrFrom( args[ 0 ], false/*castObject*/ ), undefined, args[ 1 ] ];\n\t\t} else { args[ 0 ] = _arrFrom( args[ 0 ], false/*castObject*/ ); }\n\t\tif ( args[ 0 ].filter( x => typeof x !== 'string' && !( x instanceof DOMSpec ) && !( x instanceof this.window.Node ) ).length ) {\n\t\t\tthrow new Error( `Argument #2 must be either a string or a Node object, or a list of those.` );\n\t\t}\n\t\targs[ 0 ] = args[ 0 ].map( s => s instanceof DOMSpec ? s : new DOMSpec( s ) );\n\t\treturn args;\n\t}\n\n\t/**\n\t * @registry\n\t *\n\t * @param Array\t\t\t\t...args\n\t * \n\t * @returns Map\n\t */\n\tregistry( ...args ) {\n\t\treturn _wq( this.window, 'realdom', this.namespace, ...args );\n\t}\n\t\t\n\t/**\n\t * @createSignalGenerator\n\t * \n\t * @param Object \t\t\tmo \n\t * \n\t * @returns Object\n\t */\n\tcreateSignalGenerator() {\n\t\treturn {\n\t\t\tgenerate() {\n\t\t\t\t// Abort previous\n\t\t\t\tthis.lastController?.abort();\n\t\t\t\tthis.lastController = new AbortController;\n\t\t\t\tconst flags = { signal: this.lastController.signal };\n\t\t\t\treturn flags;\n\t\t\t},\n\t\t\tdisconnect() { this.lastController?.abort(); }\n\t\t}\n\t}\n\t\t\n\t/**\n\t * Loops through registration objects whose contexts match the event context.\n\t * \n\t * @param String \t\tinterceptionTiming\n\t * @param Object|Array \trecord_s\n\t * @param Function \t\tcallback \n\t * \n\t * @returns void\n\t */\n\tforEachMatchingContext( interceptionTiming, record_s, callback ) {\n\t\tconst { window } = this, deferreds = new Set, testCache = new WeakMap;\n\t\tfor ( const [ registration, deferred ] of this.registry( interceptionTiming ) ) {\n\t\t\tlet $records = [].concat( record_s ).filter( record => Util.containsNode( window, registration.context, record.target, registration.params.subtree === 'cross-roots', testCache ) );\n\t\t\tif ( !$records.length ) continue;\n\t\t\tconst args = [ registration, Array.isArray( record_s ) ? $records : $records[ 0 ] ];\n\t\t\tif ( deferred ) deferreds.add( args ); else callback.call( window, ...args );\n\t\t}\n\t\tfor ( const args of deferreds ) callback.call( window, ...args );\n\t\tdeferreds.clear();\n\t}\n\n\t/**\n\t * @disconnectables\n\t * \n\t * @param AbortSignal \t\tsignal\n\t * @param Array \t\t\t...objects \n\t * \n\t * @returns Object\n\t */\n\tdisconnectables( signal, ...objects ) {\n\t\tconst disconnectable = { disconnect() {\n\t\t\tobjects.forEach( d => (\n\t\t\t\td && _isFunction( d.disconnect ) && d.disconnect() \n\t\t\t\t|| _isFunction( d ) && d() \n\t\t\t\t|| _isObject( d ) && ( d.disconnected = true )\n\t\t\t) );\n\t\t} };\n\t\tif ( signal ) signal.addEventListener( 'abort', () => disconnectable.disconnect() );\n\t\treturn disconnectable;\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _wq } from '@webqit/util/js/index.js';\nimport Realtime from './Realtime.js';\nimport DOMSpec from './DOMSpec.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\n\n\ttype = 'attr';\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'attr', ...args );\n\t}\n\t\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tget( spec, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, spec );\n\t\tif ( !callback ) return records;\n\t\tconst signalGenerator = params.lifecycleSignals && this.createSignalGenerator();\n\t\tif ( !originalFilterIsString ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( records, flags, context );\n\t\t} else {\n\t\t\tfor ( const record of records ) {\n\t\t\t\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\t\t\t\tcallback( record, flags, context );\n\t\t\t}\n\t\t}\n\t\t// -------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( originalFilterIsString ? spec[ 0 ] : spec, callback, { newValue: true, ...params } );\n\t\t\treturn this.disconnectables( params.signal, disconnectable_live );\n\t\t}\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? spec[ 0 ] : spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails && !webqit.realdom.attrInterceptionHooks?.intercepting ) {\n\t\t\tattrInterception.call( window, 'intercept', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => {\n\t\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\t\tdispatch.call( window, registration, records, context );\n\t\t} );\n\t\t// ------------------\n\t\tconst $params = { attributes: true, attributeOldValue: params.oldValue, subtree: params.subtree && true };\n\t\tif ( spec.length ) { $params.attributeFilter = spec.map( a => a + '' ); }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tattrInterception.call( window, interceptionTiming, records => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, records, dispatch );\n\t\t\t} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() { registry.delete( registration ); } };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n}\n\n/**\n * Deduplicates records.\n * \n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction dedupAndIgnoreInternals( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === rcd.attributeName ) return rcds;\n\t\tif ( _wq( rcd.target, 'realdom', 'internalAttrInteractions' ).get( rcd.attributeName ) ) return rcds;\n\t\treturn rcds.concat( rcd );\n\t}, [] );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration\n * @param Array \t\t\trecords\n * \n * @returns Void\n */\nfunction dispatch( registration, records ) {\n\tconst { context, spec, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif (!params.subtree) {\n\t\trecords = records.filter((r) => {\n\t\t\treturn r.target === context;\n\t\t}); \n\t}\n\tif ( !records.length ) return;\n\tconst $spec = spec.map( a => a + '' );\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, spec, records );\n\t} else if ( params.timing !== 'async' && spec.length ) {\n\t\trecords = records.filter( r => $spec.includes( r.name ) );\n\t}\n\tif ( !records.length ) return;\n\t// Should we care about old / new values being present?\n\tif ( !( params.newValue === null && params.oldValue === null && params.eventDetails ) ) {\n\t\trecords = records.map( rcd => {\n\t\t\tlet exclusion;\n\t\t\tif ( !params.eventDetails ) {\n\t\t\t\t( { event: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.oldValue && ( 'oldValue' in rcd ) ) {\n\t\t\t\t( { oldValue: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.newValue && ( 'value' in rcd ) ) {\n\t\t\t\t( { value: exclusion, ...rcd } = rcd );\n\t\t\t} else if ( params.newValue && typeof rcd.value === 'undefined' ) {\n\t\t\t\trcd = { ...rcd, value: internalAttrInteraction( rcd.target, rcd.name, () => rcd.target.getAttribute( rcd.name ) ) };\n\t\t\t}\n\t\t\treturn rcd;\n\t\t} );\n\t}\n\tif ( params.atomic ) {\n\t\trecords.forEach( record => atomics.set( record.name, record ) );\n\t\trecords = Array.from( atomics.entries() ).map( ( [ , value ] ) => value );\n\t}\n\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n */\nfunction internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tspec\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, spec, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( spec.length ) {\n\t\treturn spec.map( attrName => {\n\t\t\tattrName = attrName + '';\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: internalAttrInteraction( context, attrName, () => context.getAttribute( attrName ) ), ..._type };\n\t\t} );\n\t}\n\tconst attrs = Array.from( context.attributes );\n\treturn attrs.map( attr => {\n\t\treturn records.find( r => r.name === attr.nodeName ) || { target: context, name: attr.nodeName, value: internalAttrInteraction( context, attr.nodeName, () => attr.nodeValue ), ..._type };\n\t} );\n}\n\n/**\n * Determines the event for an attr mutation record.\n * \n * @param MutationRecord \t{ target, attributeName }\n * \n * @returns Object\n */\nfunction withAttrEventDetails( { target, attributeName, value, oldValue } ) {\n\tconst window = this, registry = window.webqit.realdom.attrInterceptionRecords?.get( target ) || {};\n\tconst event = registry[ attributeName ]?.[ 0 ] || 'mutation';\n\tconst record = { target, name: attributeName, value, oldValue, type: 'observation', event };\n\treturn record;\n}\n\n/**\n * Attributes intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction attrInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Element } = window;\n\tif ( !webqit.realdom.attrInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'attrInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.attrInterceptionHooks.has( timing ) ) { webqit.realdom.attrInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.attrInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.attrInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.attrInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `Attr mutation APIs are now being intercepted.` );\n\twebqit.realdom.attrInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'attrInterceptionRecords', { value: new Map } );\n\n\t// Interception hooks\n\tconst attrIntercept = ( record, defaultAction ) => {\n\t\tif ( !webqit.realdom.attrInterceptionRecords.has( record.target ) ) { webqit.realdom.attrInterceptionRecords.set( record.target, {} ); }\n\t\tconst registry = webqit.realdom.attrInterceptionRecords.get( record.target );\n\t\t// ------------------\n\t\tregistry[ record.name ] = registry[ record.name ] || [];\n\t\tregistry[ record.name ].unshift( record.event );\n\t\tif ( _wq( record.target, 'realdom', 'internalAttrInteractions' ).get( record.name ) ) return defaultAction();\n\t\t// ------------------\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( [ record ] ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( [ record ] ) );\n\t\treturn returnValue;\n\t};\n\n\t// Interception observer WILL need to know non-API-based mutations\n\tconst mo = new window.MutationObserver( records => {\n\t\trecords = records.filter( rcd => {\n\t\t\tconst registry = window.webqit.realdom.attrInterceptionRecords?.get( rcd.target ) || {};\n\t\t\treturn !registry[ rcd.attributeName ]?.shift();\n\t\t} );\n\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\tif ( !records.length ) return;\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( records ) );\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( records ) );\n\t} );\n\tmo.observe( document, { attributes: true, subtree: true, attributeOldValue: true } );\n\n\t// Intercept DOM attr mutation methods\n\tconst originalApis = Object.create( null );\n\t[ 'setAttribute', 'removeAttribute', 'toggleAttribute', ].forEach( apiName => {\n\t\toriginalApis[ apiName ] = Element.prototype[ apiName ];\n\t\tElement.prototype[ apiName ] = function( ...args ) {\n\t\t\tlet value, oldValue = internalAttrInteraction( this, args[ 0 ], () => this.getAttribute( args[ 0 ] ) );\n\t\t\tif ( [ 'setAttribute', 'toggleAttribute' ].includes( apiName ) ) { value = args[ 1 ]; }\n\t\t\tif ( apiName === 'toggleAttribute' && value === undefined ) {\n\t\t\t\tvalue = oldValue === null ? true : false;\n\t\t\t}\n\t\t\tconst record = { target: this, name: args[ 0 ], value, oldValue, type: 'interception', event: [ this, apiName ] };\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\treturn attrIntercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\n/**\n * @imports\n */\nimport { _isObject } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport AttrRealtime from './AttrRealtime.js';\nimport Realtime from './Realtime.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class DOMRealtime\n */\nexport default class DOMRealtime extends Realtime {\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'tree', ...args );\n\t}\n\n\t/**\n\t * Alias for ( new AttrRealtime() ).all( ... )\n\t */\n\tattr( filter, callback = undefined, params = {} ) {\n\t\tconst { context, window } = this;\n\t\treturn ( new AttrRealtime( context, window ) ).get( ...arguments );\n\t}\n\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tquery( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// ------------------\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'query', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ------------------\n\t\tif ( !params.generation || params.generation === 'entrants' ) {\n\t\t\tif ( !spec.length ) {\n\t\t\t\t//if ( params.subtree ) throw new Error( `The subtree option requires a selector to work.` );\n\t\t\t\t[ ...context.children ].forEach( node => getRecord( context ).entrants.push( node ) );\n\t\t\t} else if ( spec.every( s => s.type === 'selector' ) ) {\n\t\t\t\tconst [ cssSelectors, xpathQueries ] = spec.reduce( ( [ css, xpath ], s ) => {\n\t\t\t\t\treturn s.kind === 'xpath' ? [ css, xpath.concat( s ) ] : [ css.concat( s ), xpath ];\n\t\t\t\t}, [ [], [] ] );\n\t\t\t\tconst matches = [];\n\t\t\t\tif ( params.subtree ) {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...context.querySelectorAll( cssSelectors.join( ',' ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries ) ); }\n\t\t\t\t} else {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...[ ...context.children ].filter( node => node.matches( cssSelectors ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries, false ) ); }\n\t\t\t\t}\n\t\t\t\tmatches.forEach( node => getRecord( node.parentNode || context ).entrants.push( node ) );\n\t\t\t}\n\t\t}\n\t\t// ------------------\n\t\tif ( !callback ) return records;\n\t\tconst disconnectable = { disconnected: false };\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tif ( disconnectable.disconnected ) break;\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t\t// ------------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( spec, callback, params );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, disconnectable_live );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: false } )\n\t */\n\tchildren( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit, document } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails ) { webqit.realdom.domInterceptionRecordsAlwaysOn = true; }\n\t\tif ( ( document.readyState === 'loading' || webqit.realdom.domInterceptionRecordsAlwaysOn ) && !webqit.realdom.domInterceptionHooks?.intercepting ) {\n\t\t\tdomInterception.call( window, 'sync', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tdispatch.call( window, registration, withEventDetails.call( window, record ), context );\n\t\t} ) );\n\t\tdisconnectable.observe( context, { childList: true, subtree: params.subtree && true, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\t\t\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tdomInterception.call( window, interceptionTiming, record => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, record, dispatch );\n\t\t\t} );\n\t\t}\n\t\tconst mo = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tif ( Array.isArray( ( record = withEventDetails.call( window, record ) ).event ) ) return;\n\t\t\tdispatch.call( window, registration, record, context );\n\t\t} ) );\n\t\tmo.observe( context, { childList: true, subtree: params.subtree && true } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tregistry.delete( registration );\n\t\t\tmo.disconnect();\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Tracks the connectedness of element references.\n\t *\n\t * @param array|Element\t\t\t\telements\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable\n\t */\n\ttrack( elements, callback, params = {} ) {\n\t\tparams = { subtree: true, ...params };\n\t\treturn this.observe( elements, record => {\n\t\t\tif ( record.entrants.length ) callback( true, Array.isArray( elements ) ? record.entrants : record.entrants[ 0 ] );\n\t\t\tif ( record.exits.length ) callback( false, Array.isArray( elements ) ? record.exits : record.exits[ 0 ] );\n\t\t}, params );\n\t}\n}\n\n/**\n * Sensitivty for attribute changes for attribute spec.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, spec, callback, params, signalGenerator } = registration;\n\tconst cssSelectors = spec.filter( s => s.kind === 'css' );\n\tconst parseDot = selector => selector.match( /\\.([\\w-]+)/g )?.length ? [ 'class' ] : [];\n\tconst parseHash = selector => selector.match( /#([\\w-]+)/g )?.length ? [ 'id' ] : [];\n\tconst parse = selector => [ ...selector.matchAll( /\\[([^\\=\\]]+)(\\=[^\\]]+)?\\]/g ) ].map( x => x[ 1 ] ).concat( parseDot( selector ) ).concat( parseHash( selector ) );\n\tif ( !( registration.$attrs = Array.from( new Set( cssSelectors.filter( s => ( s + '' ).includes( '[' ) ).reduce( ( attrs, selector ) => attrs.concat( parse( selector + '' ) ), [] ) ) ) ).length ) return;\n\t// ---------\n\tconst entrants = new Set, exits = new Set;\n\tentrants.push = val => ( exits.delete( val ), entrants.add( val ) );\n\texits.push = val => ( entrants.delete( val ), exits.add( val ) );\n\tregistration.$deliveryCache = { entrants, exits };\n\t// ---------\n\treturn ( new AttrRealtime( context, window ) ).observe( registration.$attrs, _records => {\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'static', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ---------\n\t\tconst matchesCache = new WeakMap;\n\t\tconst matches = node => {\n\t\t\tif ( !matchesCache.has( node ) ) { matchesCache.set( node, cssSelectors.some( s => node.matches( s + '' ) ) ); }\n\t\t\treturn matchesCache.get( node );\n\t\t};\n\t\t// ---------\n\t\tfor ( const _record of _records ) {\n\t\t\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\t\t\tif ( params.generation && generation !== params.generation ) return;\n\t\t\t\tif ( registration.$deliveryCache[ generation ].has( _record.target ) || ( generation === 'entrants' ? !matches( _record.target ) : matches( _record.target ) ) ) return;\n\t\t\t\tregistration.$deliveryCache[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target )[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target ).event = _record.event;\n\t\t\t} );\n\t\t}\n\t\t// ---------\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t}, { subtree: params.subtree, timing: params.timing, eventDetails: params.eventDetails } );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration \n * @param Object \t\t\trecord \n * \n * @returns Void\n */\nfunction dispatch( registration, _record ) {\n\tconst { context, spec, callback, params, signalGenerator, $deliveryCache } = registration;\n\t// ---------\n\tconst record = { ..._record, entrants: [], exits: [] };\n\tif ( !params.eventDetails ) { delete record.event; }\n\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\tif ( params.generation && generation !== params.generation ) return;\n\t\tif ( spec.length ) {\n\t\t\trecord[ generation ] = nodesIntersection.call( this, spec, params.subtree === 'cross-roots', _record[ generation ], _record.event !== 'parse' );\n\t\t} else {\n\t\t\trecord[ generation ] = [ ..._record[ generation ] ];\n\t\t}\n\t\tif ( !$deliveryCache ) return;\n\t\tfor ( const node of record[ generation ] ) {\n\t\t\t$deliveryCache[ generation ].push( node );\n\t\t}\n\t} );\n\t// ---------\n\tif ( !record.entrants.length && !record.exits.length ) return;\n\tconst flags = signalGenerator?.generate() || {};\n\tcallback( record, flags, context );\n}\n\n/**\n * Aggregates instances of els in sources\n * \n * @param Array \t\t\tspec \n * @param Bool \t\t\t\tcrossRoots \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( spec, crossRoots, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, s ) => {\n\t\t// Filter out text nodes\n\t\tif ( s.type === 'selector' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = s.isXpathAttr ? [] : sources.filter( source => s.kind === 'xpath' ? Util.xpathMatch( this, source, s + '' ) : source.matches && source.matches( s + '' ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect || s.isXpathAttr ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\tif ( s.kind === 'xpath' ) { return [ ...collection, ...Util.xpathQuery( this, source, s, deepIntersect ) ]; }\n\t\t\t\t\treturn source.querySelectorAll ? [ ...collection, ...source.querySelectorAll( s + '' ) ] : collection;\n\t\t\t\t}, matches );\n\t\t\t}\n\t\t\tif ( matches.length ) return matches;\n\t\t} else {\n\t\t\t// Is directly mutated...\n\t\t\tif ( sources.includes( s.content ) || (\n\t\t\t\tdeepIntersect && sources.some( source => Util.containsNode( this/* window */, source, s.content, crossRoots ) )\n\t\t\t) ) { return [ s.content ]; }\n\t\t}\n\t};\n\t// Search can be expensive...\n\t// Multiple listeners searching the same thing in the same list?\n\tif ( !sources.$$searchCache ) { sources.$$searchCache = new Map; }\n\treturn spec.reduce( ( matches, s ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( s.content ) ) {\n\t\t\t_matches = sources.$$searchCache.get( s.content );\n\t\t} else {\n\t\t\t_matches = match( sources, s ) || [];\n\t\t\tif ( s.type === 'instance' ) {\n\t\t\t\tsources.$$searchCache.set( s.content, _matches );\n\t\t\t}\n\t\t}\n\t\treturn matches.concat( _matches );\n\t}, [] );\n}\n\n/**\n * Determines the event for a mutation record\n * \n * @param MutationRecord \t{ target, entrants, exits }\n * \n * @returns Object\n */\nfunction withEventDetails( { target, addedNodes, removedNodes } ) {\n\tlet window = this, event;\n\tevent = _arrFrom( addedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), null );\n\tevent = _arrFrom( removedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), event );\n\tevent = event || window.document.readyState === 'loading' && 'parse' || 'mutation';\n\treturn { target, entrants: addedNodes, exits: removedNodes, type: 'observation', event };\n}\n\n/**\n * DOM intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction domInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Node, CharacterData, Element, HTMLElement, HTMLTemplateElement, DocumentFragment } = window;\n\tif ( !webqit.realdom.domInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'domInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionNoRecurse ) { Object.defineProperty( webqit.realdom, 'domInterceptionNoRecurse', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionHooks.has( timing ) ) { webqit.realdom.domInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.domInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.domInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.domInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `DOM mutation APIs are now being intercepted.` );\n\twebqit.realdom.domInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'domInterceptionRecords', { value: new Map } );\n\n\t// No recursion helper\n\tconst noRecurse = ( node, method, callback ) => {\n\t\twebqit.realdom.domInterceptionNoRecurse.set( node, method );\n\t\tconst returnValue = callback();\n\t\twebqit.realdom.domInterceptionNoRecurse.delete( node );\n\t\treturn returnValue;\n\t};\n\n\t// Interception hooks\n\tconst intercept = ( record, defaultAction ) => {\n\t\trecord.entrants.concat( record.exits ).forEach( node => {\n\t\t\tclearTimeout( webqit.realdom.domInterceptionRecords.get( node )?.timeout ); // Clear any previous that's still active\n\t\t\twebqit.realdom.domInterceptionRecords.set( node, record.event ); // Main: set event details... and next to timeout details\n\t\t\tconst timeout = setTimeout( () => { webqit.realdom.domInterceptionRecords.delete( node ); }, 0 );\n\t\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\n\t\t} );\n\t\twebqit.realdom.domInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( record ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.domInterceptionHooks.get( 'sync' )?.forEach( callback => callback( record ) );\n\t\treturn returnValue;\n\t};\n\n\t// Intercept DOM mutation methods\n\tconst _apiNames = {\n\t\t// Note the order\n\t\tShadowRoot: [ 'innerHTML', 'setHTMLUnsafe' ],\n\t\tDocumentFragment: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tDocument: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tHTMLElement: [ 'outerText', 'innerText' ],\n\t\tElement: [ 'append', 'prepend', 'before', 'after', 'insertAdjacentElement', 'insertAdjacentHTML', 'remove', 'replaceChildren', 'replaceWith', 'setHTMLUnsafe', 'innerHTML', 'outerHTML' ],\n\t\tCharacterData: [ 'before', 'after', 'remove', 'replaceWith' ],\n\t\tNode: [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild', 'textContent', 'nodeValue' ],\n\t};\n\tconst _apiOriginals = {\n\t\t// Note the order\n\t\tShadowRoot: Object.create( null ), // extends DocumentFragment\n\t\tDocumentFragment: Object.create( null ), // extends Node\n\t\tDocument: Object.create( null ), // extends Node\n\t\tHTMLElement: Object.create( null ), // extends Element,\n\t\tElement: Object.create( null ), // extends Node\n\t\tCharacterData: Object.create( null ), // extends Node\n\t\tNode: Object.create( null ),\n\t};\n\n\tconst _apiNamesUnique = new Set( Object.values( _apiNames ).reduce( ( all, apis ) => all.concat( apis ), [] ) );\n\t_apiNamesUnique.forEach( apiName => {\n\t\t\n\t\tObject.keys( _apiNames ).forEach( DOMClassName => {\n\t\t\tif ( !_apiNames[ DOMClassName ].includes( apiName ) ) return;\n\t\t\tconst _apiOriginal = Object.getOwnPropertyDescriptor( window[ DOMClassName ].prototype, apiName );\n\t\t\tif ( !_apiOriginal ) return; // Typically: Element:setHTMLUnsafe\n\t\t\tObject.defineProperty( window[ DOMClassName ].prototype, apiName, 'value' in _apiOriginal ? { ..._apiOriginal, value: method } : { ..._apiOriginal, set: setter } );\n\t\t\t_apiOriginals[ DOMClassName ][ apiName ] = _apiOriginal;\n\t\t} );\n\n\t\tfunction method( ...args ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\tif ( webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'insertBefore' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'insertAdjacentElement', 'insertAdjacentHTML' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 1 ] ];\n\t\t\t\tif ( [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t} else if ( [ 'setHTMLUnsafe', 'replaceChildren' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\tentrants = apiName === 'replaceChildren' ? [ ...args ] : [ args[ 0 ] ];\n\t\t\t} else if ( [ 'replaceWith', 'remove' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\tentrants = apiName === 'replaceWith' ? [ ...args ] : [];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else if ( [ 'replaceChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ args[ 1 ] ];\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'removeChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...args ];\n\t\t\t} else {\n\t\t\t\t// 'before', 'after', 'append', 'prepend', 'appendChild'\n\t\t\t\tentrants = [ ...args ];\n\t\t\t\tif ( [ 'before', 'after' ].includes( apiName ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to entrants\n\t\t\tlet apiNameFinal = apiName;\n\t\t\tif ( [ 'insertAdjacentHTML', 'setHTMLUnsafe' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'insertAdjacentHTML' && [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\t$apiOriginals.setHTMLUnsafe.value.call( temp, entrants[ 0 ], apiName === 'setHTMLUnsafe' ? args[ 1 ] : {} );\n\t\t\t\tentrants = [ ...temp.childNodes ];\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'insertAdjacentHTML' ) {\n\t\t\t\t\tapiNameFinal = 'insertAdjacentElement';\n\t\t\t\t\targs[ 1 ] = new DocumentFragment;\n\t\t\t\t\tnoRecurse( args[ 1 ], 'append', () => args[ 1 ].append( ...temp.childNodes ) );\n\t\t\t\t} else {\n\t\t\t\t\tapiNameFinal = 'replaceChildren';\n\t\t\t\t\targs = [ ...temp.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn $apiOriginals[ apiNameFinal ].value.call( this, ...args );\n\t\t\t} );\n\t\t}\n\n\t\tfunction setter( value ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].set.call( this, value );\n\t\t\tif ( this instanceof HTMLScriptElement || webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'outerHTML', 'outerText' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else {\n\t\t\t\t// 'innerHTML', 'innerText', 'textContent', 'nodeValue'\n\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\ttarget = this.content;\n\t\t\t\t\texits = [ ...this.content.childNodes ];\n\t\t\t\t} else {\n\t\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to nodes\n\t\t\tif ( [ 'outerHTML', 'innerHTML' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return exec();\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\tnoRecurse( temp, apiName, () => temp[ apiName ] = value );\n\t\t\t\tentrants = this instanceof HTMLTemplateElement ? [ ...temp.content.childNodes ] : [ ...temp.childNodes ];\n\t\t\t\tif ( ( this instanceof HTMLTemplateElement && this.hasAttribute( 'src' ) ) || this instanceof ShadowRoot ) {\n\t\t\t\t\tconst getScripts = nodes => nodes.reduce( ( scripts, el ) => {\n\t\t\t\t\t\tif ( el instanceof HTMLScriptElement ) return scripts.concat( el );\n\t\t\t\t\t\tif ( el instanceof HTMLTemplateElement ) return scripts.concat( getScripts( [ el.content ] ) );\n\t\t\t\t\t\tscripts = scripts.concat( getScripts( [ ...( el.querySelectorAll?.( 'template' ) || [] ) ].map( t => t.content ) ) );\n\t\t\t\t\t\treturn scripts.concat( ...( el.querySelectorAll?.( 'script' ) || [] ) );\n\t\t\t\t\t}, [] );\n\t\t\t\t\tfor ( const script of getScripts( entrants ) ) {\n\t\t\t\t\t\tif (this instanceof ShadowRoot) {\n\t\t\t\t\t\t\tscript.setAttribute('data-handling', 'manual');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst $script = document.createElement( 'script' );\n\t\t\t\t\t\t[ ...script.attributes ].forEach( attr => $script.setAttribute( attr.name, attr.value ) );\n\t\t\t\t\t\t$script.textContent = script.textContent;\n\t\t\t\t\t\tnoRecurse( script, 'replaceWith', () => script.replaceWith( $script ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\tvalue = new DocumentFragment;\n\t\t\t\t\tnoRecurse( value, 'append', () => value.append( ...entrants ) );\n\t\t\t\t\texec = () => noRecurse( this, 'replaceWith', () => Element.prototype.replaceWith.call( this, value ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\t\texec = () => noRecurse( this.content, 'replaceChildren', () => this.content.replaceChildren( ...entrants ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => noRecurse( this, 'replaceChildren', () => Element.prototype.replaceChildren.call( this, ...entrants ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\r\n/**\r\n * Applies all supported polyfills\r\n */\r\nexport default function() {\r\n CSS_escape.call( this );\r\n Node_isConnected.call( this );\r\n Element_matches.call( this );\r\n}\r\n\r\n/**\r\n * Polyfills the window.CSS object.\r\n * \r\n * @return void\r\n */\r\nexport function CSS_escape() {\r\n const window = this;\r\n if ( !window.CSS ) { window.CSS = {} }\r\n if ( !window.CSS.escape ) {\r\n /**\r\n * Polyfills the window.CSS.escape() function.\r\n * \r\n * @param string str \r\n * \r\n * @return string\r\n */\r\n window.CSS.escape = str => str.replace( /([\\:@\\~\\$\\&])/g, '\\\\$1' );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Node.prototype.isConnected property\r\n * \r\n * @see MDN\r\n * \r\n * @return bool\r\n*/\r\nexport function Node_isConnected() {\r\n const window = this;\r\n if ( !( 'isConnected' in window.Node.prototype ) ) {\r\n Object.defineProperty( window.Node.prototype, 'isConnected', { get: function() {\r\n return !this.ownerDocument || !(\r\n this.ownerDocument.compareDocumentPosition( this )\r\n & this.DOCUMENT_POSITION_DISCONNECTED);\r\n } } );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Element.prototype.matches() method\r\n * \r\n * @see MDN\r\n * \r\n * @return void\r\n*/\r\nexport function Element_matches() {\r\n const window = this;\r\n if ( !window.Element.prototype.matches ) {\r\n window.Element.prototype.matches = \r\n window.Element.prototype.matchesSelector || \r\n window.Element.prototype.mozMatchesSelector ||\r\n window.Element.prototype.msMatchesSelector || \r\n window.Element.prototype.oMatchesSelector || \r\n window.Element.prototype.webkitMatchesSelector ||\r\n function( s ) {\r\n var matches = ( this.document || this.ownerDocument ).querySelectorAll( s ),\r\n i = matches.length;\r\n while ( --i >= 0 && matches.item( i ) !== this ) {}\r\n return i > -1; \r\n }\r\n }\r\n}", "\r\n/**\r\n * @imports\r\n */\r\nimport { _isNumeric, _isString, _isFunction } from '@webqit/util/js/index.js';\r\nimport { _set } from '@webqit/util/obj/index.js';\r\nimport Scheduler from './Scheduler.js';\r\nimport DOMRealtime from './realtime/DOMRealtime.js';\r\nimport AttrRealtime from './realtime/AttrRealtime.js';\r\nimport polyfill from './polyfills.js';\r\n\r\nexport default function() {\r\n const window = this;\r\n if ( !window.webqit ) window.webqit = {};\r\n if ( window.webqit.realdom ) return window.webqit.realdom;\r\n window.webqit.realdom = {};\r\n polyfill.call( window );\r\n // ------\r\n window.webqit.realdom.meta = ( ...args ) => meta.call( window, ...args );\r\n window.webqit.realdom.ready = ( ...args ) => ready.call( window, ...args );\r\n // ------\r\n window.webqit.realdom.realtime = ( context, namespace = 'dom' ) => {\r\n if ( namespace === 'dom' ) return new DOMRealtime( context, window );\r\n if ( namespace === 'attr' ) return new AttrRealtime( context, window );\r\n };\r\n // ------\r\n const scheduler = new Scheduler( window );\r\n window.webqit.realdom.schedule = ( type, ...args ) => {\r\n return scheduler[ `on${ type }` ]( ...args );\r\n };\r\n window.webqit.realdom.synthesizeWhile = ( ...args ) => {\r\n return scheduler.synthesizeWhile( ...args );\r\n };\r\n // ------\r\n return window.webqit.realdom;\r\n}\r\n\r\n\r\n/**\r\n * DOM-ready listeners.\r\n * \r\n * @param Function\t \t\tcallback\r\n * \r\n * @return void\r\n */\r\nfunction ready( ...args ) {\r\n let timing = 'interactive', callback;\r\n if ( _isString( args[ 0 ] ) ) {\r\n timing = args[ 0 ];\r\n if ( _isFunction( args[ 1 ] ) ) { callback = args[ 1 ]; }\r\n } else if ( _isFunction( args[ 0 ] ) ) { callback = args[ 0 ]; }\r\n // --------------\r\n const timings = { interactive: [ 'interactive', 'complete' ], complete: [ 'complete' ], };\r\n if ( !timings[ timing ] ) throw new Error( `Invalid ready-state timing: ${ timing }.` );\r\n\tconst window = this;\r\n // --------------\r\n if ( !callback ) {\r\n if ( !window.webqit.realdom.readyStatePromises ) {\r\n window.webqit.realdom.readyStatePromises = {\r\n interactive: new Promise( res => ready.call( this, 'interactive', res ) ),\r\n complete: new Promise( res => ready.call( this, 'complete', res ) ),\r\n };\r\n }\r\n return window.webqit.realdom.readyStatePromises[ timing ];\r\n }\r\n // --------------\r\n\tif ( timings[ timing ].includes( window.document.readyState ) ) return callback( window );\r\n if ( !window.webqit.realdom.readyStateCallbacks ) {\r\n window.webqit.realdom.readyStateCallbacks = { interactive: [], complete: [] };\r\n window.document.addEventListener( 'readystatechange', () => {\r\n const state = window.document.readyState;\r\n for ( const callback of window.webqit.realdom.readyStateCallbacks[ state ].splice( 0 ) ) {\r\n callback( window );\r\n }\r\n }, false );\r\n }\r\n window.webqit.realdom.readyStateCallbacks[ timing ].push( callback );\r\n}\r\n\r\n/**\r\n * A webqit's meta tag props reader.\r\n * \r\n * @param String name\r\n * \r\n * @return Object\r\n */\r\nfunction meta( name ) {\r\n const window = this;\r\n let _content = {}, _el;\r\n if ( _el = window.document.querySelector( `meta[name=\"${ name }\"]` ) ) {\r\n _content = ( _el.content || '' ).split( ';' ).filter( v => v ).reduce( ( _metaVars, directive ) => {\r\n const directiveSplit = directive.split( '=' ).map( d => d.trim() );\r\n _set( _metaVars, directiveSplit[ 0 ].split( '.' ), directiveSplit[ 1 ] === 'true' ? true : (directiveSplit[ 1 ] === 'false' ? false : (\r\n _isNumeric( directiveSplit[ 1 ] ) ? parseInt( directiveSplit[ 1 ] ) : directiveSplit[ 1 ]\r\n ) )\r\n );\r\n return _metaVars;\r\n }, {} );\r\n }\r\n return { get name() { return name; }, get content() { return _el.content; }, json() {\r\n\t\treturn JSON.parse( JSON.stringify( _content ) );\r\n } };\r\n}", "\n/**\n * Converts a string to title case.\n *\n * @param string \tstr\n * @param bool \t\tstrict\n *\n * @return string\n */\nexport default function(str, strict) {\n\tif (typeof str !== 'string') {\n\t\treturn str;\n\t}\n\treturn str.replace(/\\w\\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + ((typeof strict !== undefined && strict) ? txt.substr(1).toLowerCase() : txt.substr(1)); })\n};\n", "\n/**\n * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _wq as __wq } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\nimport { _toTitle } from '@webqit/util/str/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'oohtml', ...args );\n\nexport const env = {};\n\nexport function _init( name, $config, $defaults ) {\n const window = this, realdom = realdomInit.call( window );\n env.window = window;\n if ( !window.webqitConfig ) {\n window.webqitConfig = realdom.meta( 'webqit' ).json();\n }\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n // ---------------------\n const configKey = name.toUpperCase().replace( '-', '_' );\n if ( !window.webqit.oohtml.configs[ configKey ] ) {\n window.webqit.oohtml.configs[ configKey ] = {};\n const config = window.webqit.oohtml.configs[ configKey ];\n _merge( 2, config, $defaults, $config, realdom.meta( name ).json() );\n if ( window.webqitConfig.prefix ) {\n Object.keys( config ).forEach( main => {\n Object.keys( config[ main ] ).forEach( key => {\n if ( main === 'api' && typeof config[ main ][ key ] === 'string' ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }${ _toTitle( config[ main ][ key ] ) }`\n } else if ( [ 'attr', 'elements' ].includes( main ) && config[ main ][ key ]?.startsWith( 'data-' ) === false ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }-${ config[ main ][ key ] }`\n }\n } );\n } );\n }\n }\n // ---------------------\n return { config: window.webqit.oohtml.configs[ configKey ], realdom, window };\n}\n\nexport function getInternalAttrInteraction( node, attrName ) {\n\treturn _wq( node, 'internalAttrInteractions' ).get( attrName );\n}\nexport function internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\nexport function _compare( a, b, depth = 1, objectSizing = false ) {\n if ( depth && typeof a === 'object' && a && typeof b === 'object' && b && ( !objectSizing || Object.keys( a ).length === Object.keys( b ).length ) ) {\n for ( let key in a ) {\n if ( !_compare( a[ key ], b[ key ], depth - 1, objectSizing ) ) return false;\n }\n return true;\n }\n if ( Array.isArray( a ) && Array.isArray( b ) && a.length === b.length ) {\n return ( b = b.slice( 0 ).sort() ) && a.slice( 0 ).sort().every( ( valueA, i ) => valueA === b[ i ] );\n }\n return a === b;\n}\n\nexport function _splitOuter( str, delim ) {\n return [ ...str ].reduce( ( [ quote, depth, splits ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}\n\n// Unique ID generator\nexport const _uniqId = () => ( 0 | Math.random() * 9e6 ).toString( 36 );\n\n// Hash of anything generator\nconst hashTable = new Map;\nexport function _toHash( val ) {\n let hash;\n if ( !( hash = hashTable.get( val ) ) ) {\n hash = _uniqId();\n hashTable.set( val, hash );\n }\n return hash;\n}\n\n// Value of any hash\nexport function _fromHash( hash ) {\n let val;\n hashTable.forEach( ( _hash, _val ) => {\n if ( _hash === hash ) val = _val;\n } );\n return val;\n}", "import { resolveParams } from '@webqit/quantum-js/params';\nimport { xpathQuery } from '@webqit/realdom/src/realtime/Util.js';\nimport { _wq, _init, _splitOuter } from '../util.js';\n\n/**\n * Initializes DOM Parts.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'data-binding', $config, {\n attr: { render: 'render', itemIndex: 'data-key' },\n tokens: { nodeType: 'processing-instruction', tagStart: '?{', tagEnd: '}?', stateStart: '; [=', stateEnd: ']' },\n advanced: resolveParams({ runtimeParams: { spec: { handler: e => {} } } }),\n } );\n ( { CONTEXT_API: config.CONTEXT_API, BINDINGS_API: config.BINDINGS_API, HTML_IMPORTS: config.HTML_IMPORTS } = window.webqit.oohtml.configs );\n config.attrSelector = `[${ window.CSS.escape( config.attr.render ) }]`;\n const discreteBindingsMatch = ( start, end ) => {\n const starting = `starts-with(., \"${ start }\")`;\n const ending = `substring(., string-length(.) - string-length(\"${ end }\") + 1) = \"${ end }\"`;\n return `${ starting } and ${ ending }`;\n }\n config.discreteBindingsSelector = `comment()[${ discreteBindingsMatch( config.tokens.tagStart, config.tokens.tagEnd ) }]`;\n realtime.call( window, config );\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { realdom } } = window;\n\t// ----------------\n /**\n * For an element, render should happen first\n <div render=\"\">\n <?{ content }?>\n </div>\n */\n realdom.realtime( window.document ).query( config.attrSelector, record => {\n cleanup.call( this, ...record.exits );\n setTimeout(() => {\n mountInlineBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:attr', live: true, subtree: 'cross-roots', timing: 'sync', eventDetails: true, staticSensitivity: true } );\n realdom.realtime( window.document ).query( `(${ config.discreteBindingsSelector })`, record => {\n setTimeout(() => {\n cleanup.call( this, ...record.exits );\n mountDiscreteBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:descrete', live: true, subtree: 'cross-roots', timing: 'sync' } );\n}\n\nfunction createDynamicScope( config, root ) {\n const { webqit: { realdom, Observer, DOMBindingsContext } } = this;\n if ( _wq( root ).has( 'data-binding' ) ) return _wq( root ).get( 'data-binding' );\n const scope = Object.create( null ), abortController = new AbortController;\n scope[ '$exec__' ] = ( target, prop, ...args ) => {\n const exec = () => {\n try { target[ prop ]( ...args ); }\n catch( e ) { throw new Error( `Error executing \"${ prop }()\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n scope[ '$assign__' ] = ( target, prop, val ) => {\n const exec = () => {\n try { target[ prop ] = val; }\n catch( e ) { throw new Error( `Error executing \"${ prop } = ${ val }\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n Observer.intercept( scope, {\n get: ( e, recieved, next ) => {\n if ( !( e.key in scope ) ) {\n const request = { ...DOMBindingsContext.createRequest( e.key ), live: true, signal: abortController.signal };\n root[ config.CONTEXT_API.api.contexts ].request( request, value => {\n Observer.set( scope, e.key, value );\n } );\n }\n return next( scope[ e.key ] ?? ( e.key in globalThis ? globalThis[ e.key ] : undefined ) );\n },\n has: ( e, recieved, next ) => { return next( true ); }\n } );\n const instance = { scope, abortController, bindings: new Map };\n _wq( root ).set( 'data-binding', instance );\n return instance;\n}\n\nfunction cleanup( ...entries ) {\n for ( const node of entries ) {\n const root = node.nodeName === '#text' ? node.parentNode : node;\n const { bindings, abortController } = _wq( root ).get( 'data-binding' ) || {};\n if ( !bindings?.has( node ) ) return;\n bindings.get( node ).state.dispose();\n bindings.get( node ).signals?.forEach( s => s.abort() );\n bindings.delete( node );\n if ( !bindings.size ) {\n abortController.abort();\n _wq( root ).delete( 'data-binding' );\n }\n }\n}\n\nfunction patternMatch( config, str ) {\n const tagStart = config.tokens.tagStart.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const tagEnd = config.tokens.tagEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const stateStart = config.tokens.stateStart.split( '' ).map( x => x === ' ' ? `(?:\\\\s+)?` : `\\\\${ x }` ).join( '' );\n const stateEnd = config.tokens.stateEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const pattern = `^${ tagStart }(.*?)(?:${ stateStart }(\\\\d+)${ stateEnd }(?:\\\\s+)?)?${ tagEnd }$`;\n const [ /*raw*/, expr, span ] = str.match( new RegExp( pattern ) );\n return { raw: str, expr, span: parseInt( span ?? 0 ) };\n}\n\nasync function mountDiscreteBindings( config, ...entries ) {\n const window = this;\n const instances = entries.reduce( ( instances, node ) => {\n if ( node.isBound ) return instances;\n const template = patternMatch( config, node.nodeValue );\n let textNode = node;\n if ( template.span ) {\n textNode = node.nextSibling;\n if ( textNode?.nodeName !== '#text' || textNode.nodeValue.length < template.span ) return instances;\n if ( textNode.nodeValue.length > template.span ) { textNode.splitText( template.span ); }\n } else {\n textNode = node.ownerDocument.createTextNode( '' );\n node.after( textNode );\n }\n textNode.isBound = true;\n let anchorNode = node;\n if ( window.webqit.env !== 'server' ) {\n anchorNode.remove();\n anchorNode = null;\n }\n return instances.concat( { textNode, template, anchorNode } );\n }, [] );\n\n for ( const { textNode, template, anchorNode } of instances ) {\n const compiled = compileDiscreteBindings.call( window, config, template.expr );\n const { scope, bindings } = createDynamicScope.call( this, config, textNode.parentNode );\n Object.defineProperty( textNode, '$oohtml_internal_databinding_anchorNode', { value: anchorNode, configurable: true } );\n try {\n bindings.set( textNode, { state: await ( await compiled.bind( textNode, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst discreteParseCache = new Map;\nfunction compileDiscreteBindings( config, str ) {\n if ( discreteParseCache.has( str ) ) return discreteParseCache.get( str );\n let source = `let content = ((${ str }) ?? '') + '';`;\n source += `$assign__wq(this, 'nodeValue', content);`;\n source += `if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__wq(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', \"${ config.tokens.tagStart }${ escDouble( str ) }${ config.tokens.stateStart }\" + content.length + \"${ config.tokens.stateEnd } ${ config.tokens.tagEnd }\"); }`;\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n discreteParseCache.set( str, compiled );\n return compiled;\n}\n\nasync function mountInlineBindings( config, ...entries ) {\n for ( const node of entries ) {\n const compiled = compileInlineBindings.call( this, config, node.getAttribute( config.attr.render ) );\n const { scope, bindings } = createDynamicScope.call( this, config, node );\n const signals = [];\n Object.defineProperty( node, '$oohtml_internal_databinding_signals', { value: signals, configurable: true } );\n try {\n bindings.set( node, { signals, state: await ( await compiled.bind( node, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst inlineParseCache = new Map;\nfunction compileInlineBindings( config, str ) {\n if ( inlineParseCache.has( str ) ) return inlineParseCache.get( str );\n const validation = {};\n let $event_i = -1;\n const source = _splitOuter( str, ';' ).map( str => {\n const [ left, right ] = _splitOuter( str, ':' ).map( x => x.trim() );\n const directive = left[ 0 ], param = left.slice( 1 ).trim();\n const arg = `(${ right })`, $arg = `(${ arg } ?? '')`;\n // CSS\n if ( directive === '&' ) {\n if ( param.startsWith( '--' ) ) return `$exec__wq(this.style, 'setProperty', \"${ escDouble( param ) }\", ${ $arg });`;\n return `$assign__wq(this.style, \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Class list\n if ( directive === '%' ) return `$exec__wq(this.classList, 'toggle', \"${ escDouble( param ) }\", !!${ arg });`;\n // Attribute\n if ( directive === '~' ) {\n if ( param.startsWith( '?' ) ) return `$exec__wq(this, 'toggleAttribute', \"${ escDouble( param.substring( 1 ).trim() ) }\", !!${ arg });`;\n return `$exec__wq(this, 'setAttribute', \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Structure\n if ( directive === '#' ) {\n if ( validation[ param ] ) throw new Error( `Duplicate binding: ${ left }.` );\n validation[ param ] = true;\n if ( param === 'text' ) return `$assign__wq(this, 'textContent', ${ $arg });`;\n if ( param === 'html' ) return `$assign__wq(this, 'innerHTML', ${ $arg });`;\n if ( param === 'items' ) {\n const [ iterationSpec, importSpec ] = _splitOuter( right, '/' );\n if ( !importSpec ) throw new Error( `Invalid ${ directive }items spec: ${ str }; no import specifier.` );\n let [ raw, production, kind, iteratee ] = iterationSpec.trim().match( /(.*?[\\)\\s+])(of|in)([\\(\\{\\[\\s+].*)/i ) || [];\n if ( !raw ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n if ( production.startsWith( '(' ) ) {\n production = production.trim().slice( 1, -1 ).split( ',' ).map( x => x.trim() );\n } else { production = [ production ]; }\n if ( production.length > ( kind === 'in' ? 3 : 2 ) ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n const indices = kind === 'in' ? production[ 2 ] : ( production[ 1 ] || '$index__' );\n return `\n let $iteratee__ = ${ iteratee };\n let $import__ = this.${ config.HTML_IMPORTS.api.import }( ${ importSpec.trim() }, true );\n this.$oohtml_internal_databinding_signals?.push( $import__ );\n\n if ( $import__.value && $iteratee__ ) {\n let $existing__ = new Map;\n [ ...this.children ].filter( el => el.matches( '[${ config.attr.itemIndex }]' ) ).forEach( x => {\n $existing__.set( x.getAttribute( '${ config.attr.itemIndex }' ), x );\n } );\n ${ indices ? `let ${ indices } = -1;` : '' }\n for ( let ${ production[ 0 ] } ${ kind } $iteratee__ ) {\n ${ indices ? `${ indices } ++;` : '' }\n ${ kind === 'in' && production[ 1 ] ? `let ${ production[ 1 ] } = $iteratee__[ ${ production[ 0 ] } ];` : '' }\n const $itemBinding__ = { ${ production.join( ', ' ) } };\n \n const $key___ = ( ${ kind === 'in' ? production[ 0 ] : indices } ) + '';\n let $itemNode__ = $existing__.get( $key___ );\n if ( $itemNode__ ) {\n $existing__.delete( $key___ );\n $exec__wq($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n } else {\n $itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value instanceof window.HTMLTemplateElement ? $import__.value.content.firstElementChild : $import__.value ) ).cloneNode( true );\n $itemNode__.setAttribute( \"${ config.attr.itemIndex }\", $key___ );\n $exec__wq($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n $exec__wq(this, 'appendChild', $itemNode__ );\n }\n\n if ( ${ kind === 'in' ? `!( ${ production[ 0 ] } in $iteratee__ )` : `typeof ${ production[ 0 ] } === 'undefined'` } ) { $itemNode__.remove(); }\n }\n $existing__.forEach( x => x.remove() );\n $existing__.clear();\n }`;\n }\n }\n // Events\n if ( directive === '@' ) {\n $event_i++;\n return `\n const handler${ $event_i } = event => ${ right.startsWith('{') ? right : arg };\n this.addEventListener( '${ param }', handler${ $event_i } );\n const abort${ $event_i } = () => this.removeEventListener( '${ param }', handler${ $event_i } );\n this.$oohtml_internal_databinding_signals?.push( { abort: abort${ $event_i } } );\n `;\n }\n // Functions\n if ( directive === '$' ) {\n return `$exec__wq(this, '${ param }', ${ arg });`;\n }\n if ( str.trim() ) throw new Error( `Invalid binding: ${ str }.` );\n } ).join( `\\n` );\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n inlineParseCache.set( str, compiled );\n return compiled;\n}\n\nconst escDouble = str => str.replace(/\"/g, '\\\\\"');\n\nexport function idleCompiler( node ) {\n const window = this, { webqit: { oohtml: { configs: { DATA_BINDING: config } } } } = window;\n // Attr selector must also come first, as in above\n ( node?.matches( config.attrSelector ) ? [ node ] : [] ).concat([ ...( node?.querySelectorAll( config.attrSelector ) || [] ) ]).forEach( node => {\n compileInlineBindings.call( window, config, node.getAttribute( config.attr.render ) );\n } );\n xpathQuery( window, node, `(${ config.discreteBindingsSelector })` ).forEach( node => {\n const template = patternMatch( config, node.nodeValue );\n compileDiscreteBindings.call( window, config, template.expr );\n } );\n}", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @init\n */\ninit.call( window );"],
|
|
5
|
-
"mappings": "MAIO,eAA2B,EA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AA,+BACa,gBAAyB,EAAM,WAAW,GAAG,EAAI,EAAQ;AAAA,0CAC9C,cAAoB;AAAA,6BACjC,wCAAiD,cAAoB;AAAA,iFACjB;AAAA,cAI1E,GAAK,IAAc,IACf,MAAO,oBAAqB,OAAa,MAE7C,GAAK,EAAI,KAAK,EAAI,KAAM,IAAI,OAAO,oBAAqB,IAAQ,CACpE,CAAE,EAAE,KAAM;AAAA,CAAK,EACT,CAAE,OAAQ,CAAE,kBAAoB,KAChC,CAAE,eAAc,iBAAgB,iBAAkB,EAAO,SACzD,EAAW,GAAI,GAAe,EAAQ,CAAE,eAAc,iBAAgB,eAAc,CAAE,EAC5F,UAAiB,IAAK,EAAK,CAAS,EAC7B,CACX,CAEA,GAAM,GAAY,GAAO,EAAI,QAAQ,KAAM,KAAK,EC1QhD,GAAK,KAAM,MAAO",
|
|
4
|
+
"sourcesContent": ["\n/**\n * @exports\n */\nexport function resolveParams( ...extensions ) {\n let extension, params = { runtimeParams, compilerParams, parserParams };\n while( extension = extensions.shift() ) {\n const {\n runtimeParams: _runtimeParams = {},\n compilerParams: { globalsNoObserve: _globalsNoObserve = [], globalsOnlyPathsExcept: _globalsOnlyPathsExcept = [], ..._compilerParams } = {},\n parserParams: _parserParams = {},\n } = extension;\n params = {\n runtimeParams: { ...params.runtimeParams, ..._runtimeParams },\n compilerParams: { ...params.compilerParams, globalsNoObserve: [ ...params.compilerParams.globalsNoObserve, ..._globalsNoObserve ], globalsOnlyPathsExcept: [ ...params.compilerParams.globalsOnlyPathsExcept, ..._globalsOnlyPathsExcept ], ..._compilerParams },\n parserParams: { ...params.parserParams, ..._parserParams },\n };\n if ( extensions.devMode ) { /* shortcut for devMode configs */ }\n }\n return params;\n}\nexport const parserParams = {\n ecmaVersion: 'latest',\n allowReturnOutsideFunction: true,\n allowAwaitOutsideFunction: false,\n allowSuperOutsideMethod: false,\n preserveParens: false,\n locations: true,\n};\nexport const compilerParams = {\n globalsNoObserve: [ 'arguments', 'debugger', ],\n globalsOnlyPathsExcept: [],\n originalSource: true,\n locations: true,\n compact: 2,\n};\nexport const runtimeParams = {\n apiVersion: 3,\n};\n", "\n\nexport function isXpath( expr ) { return ( expr = expr.trim() ) && expr.startsWith( '(' ) && expr.endsWith( ')' ) }\n\nexport function xpathQuery( window, context, expr, subtree = true ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', subtree ? '(.//' : '(./' ) ).join( '|' );\n let nodes = [], node;\n try {\n // Throws in firefox and safari where context is a text node\n const result = window.document.evaluate( expr, context, null, window.XPathResult.ANY_TYPE );\n while ( node = result.iterateNext() ) nodes.push( node );\n } catch( e ) {}\n return nodes;\n}\n\nexport function xpathMatch( window, node, expr ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', '(self::' ) ).join( '|' );\n try {\n // Throws in firefox and safari where context is a text node and query isn't\n return window.document.evaluate( `${ expr }`, node, null, window.XPathResult.BOOLEAN_TYPE ).booleanValue;\n } catch( e ) {}\n}\n\nexport function containsNode( window, a, b, crossRoots = false, testCache = null ) {\n const prevTest = testCache?.get( a )?.get( b );\n if ( typeof prevTest !== 'undefined' ) return prevTest;\n const response = val => {\n if ( !testCache?.has( a ) ) testCache?.set( a, new WeakMap );\n testCache?.get( a )?.set( b, val );\n return val;\n };\n const rootNodeA = a.getRootNode();\n const rootNodeB = b.getRootNode();\n if ( rootNodeA === rootNodeB ) return response( a.contains( b ) );\n if ( crossRoots && rootNodeB instanceof window.ShadowRoot ) return response( containsNode( window, a, rootNodeB.host, crossRoots, testCache ) );\n return response( false );\n}\n\nexport function splitOuter( str, delim = '|' ) {\n return [ ...str ].reduce( ( [ quote, depth, splits, skip ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}", "\n/**\n * Tells if val is pure object.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\n};\n", "\n/**\n * Tells if val is of type \"array\".\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val);\n};\n", "\n/**\n * Tells if val is of type \"function\".\n * This holds true for both regular functions and classes.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn typeof val === 'function';\n};\n", "\n/**\n * Tells if val is undefined or is null.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val === null || val === '';\n};\n", "\n/**\n * Tells if val is undefined or is of type \"undefined\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"object\".\n * This holds true for anything object, including built-ins.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\n};\n", "\n/**\n * @imports\n */\nimport _isNull from './isNull.js';\nimport _isUndefined from './isUndefined.js';\nimport _isTypeObject from './isTypeObject.js';\n\n/**\n * Tells if val is empty in its own type.\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\n * objects without keys, empty arrays.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"function\".\n *\n * @param object \t\tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\n};\n", "\n/**\n * Tells if val is of type \"number\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof Number || (typeof val === 'number');\n};\n", "\n/**\n * @imports\n */\nimport _isNumber from './isNumber.js';\n/**\n * Tells if val is of type \"string\" or a numeric string.\n * This holds true for both numbers and numeric strings.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\n};\n", "\n/**\n * Tells if val is of type \"string\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\n};\n", "\n/**\n * @imports\n */\nimport _isString from './isString.js';\nimport _isUndefined from './isUndefined.js';\n\n/**\n * Tells if val is \"array-like\".\n * This holds true for anything that has a length property.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !_isString(val) && !_isUndefined(val.length);\n};\n", "\n/**\n * Adds an item if not already exist.\n *\n * @param array \tarr\n * @param array\t \t...itms\n *\n * @return array\n */\nexport default function(arr, ...items) {\n\titems.forEach(itm => {\n\t\tif (arr.indexOf(itm) < 0) {\n\t\t\tarr.push(itm);\n\t\t}\n\t});\n\treturn arr;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\n\n/**\n * Returns the prototype chain.\n *\n * @param object \t\tobj\n * @param object\t \tuntil\n *\n * @return bool\n */\nexport default function(obj, until) {\n\tuntil = until || Object.prototype;\n\tuntil = until && !_isArray(until) ? [until] : until;\n\t// We get the chain of inheritance\n\tvar prototypalChain = [];\n\tvar obj = obj;\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\n\t\tprototypalChain.push(obj);\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\n\t}\n\treturn prototypalChain;\n};\n", "\n/**\n * @imports\n */\nimport _pushUnique from '../arr/pushUnique.js';\nimport _getPrototypeChain from './getPrototypeChain.js';\n\n/**\n * Eagerly retrieves object members all down the prototype chain.\n *\n * @param object\t \tobj\n * @param object\t \tuntil\n *\n * @return array\n */\nexport default function(obj, until) {\n\tvar keysAll = [];\n\t_getPrototypeChain(obj, until).forEach(obj => {\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\n\t});\n\treturn keysAll;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isObject from '../js/isObject.js';\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _getAllPropertyNames from './getAllPropertyNames.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\n\tvar depth = 0;\n\tvar obj1 = objs.shift();\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\n\t\tdepth = obj1;\n\t\tobj1 = objs.shift();\n\t}\n\tif (!objs.length) {\n\t\tthrow new Error('_merge() requires two or more array/objects.');\n\t}\n\tobjs.forEach((obj2, i) => {\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\n\t\t\treturn;\n\t\t}\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\n\t\t\tif (!callback(key, obj1, obj2, i)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valAtObj1 = obj1[key];\n\t\t\tvar valAtObj2 = obj2[key];\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \n\t\t\t&& (depth === true || depth > 0)) {\n\t\t\t\t// RECURSE...\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\n\t\t\t} else {\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\n\t\t\t\t\tif (isReplace) {\n\t\t\t\t\t\tobj1[key] = valAtObj2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj1.push(valAtObj2);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// In case we're setting a read-only property\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (withSymbols) {\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\treturn obj1;\n};\n", "\n/**\n * @imports\n */\nimport _mergeCallback from './mergeCallback.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function(...objs) {\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\n\t\treturn true;\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\n};\n", "export default function wq(obj, ...namespaces) {\n if (!obj || !['object', 'function'].includes(typeof obj)) {\n throw new Error(`Argument #1 must be of type object`);\n }\n let wq = obj[Symbol.for('wq')];\n if (!wq) {\n wq = new WQInternals;\n Object.defineProperty(obj, Symbol.for('wq'), {\n value: wq,\n // Defaults, but to be explicit...\n enumerable: false,\n configurable: false,\n writable: false\n });\n }\n if (!namespaces.length) {\n return wq;\n }\n let _ns, _wq;\n while ((_ns = namespaces.shift())) {\n if ((_wq = wq) && !(wq = wq.get(_ns))) {\n wq = new WQInternals;\n _wq.set(_ns, wq);\n }\n }\n return wq;\n}\n\nclass WQInternals extends Map {}", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isTypeArray from '../js/isTypeArray.js';\nimport _isEmpty from '../js/isEmpty.js';\nimport _isObject from '../js/isObject.js';\n\n/**\n * Casts an array-like object to an array.\n *\n * @param mixed \tval\n * @param bool\t \tcastObject\n *\n * @return array\n */\nexport default function(val, castObject = true) {\n\tif (_isArray(val)) {\n\t\treturn val;\n\t};\n\tif (!castObject && _isObject(val)) {\n\t\treturn [val];\n\t};\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\n\t\treturn [];\n\t};\n\tif (_isTypeArray(val)) {\n\t\treturn Array.prototype.slice.call(val);\n\t};\n\tif (_isObject(val)) {\n\t\treturn Object.values(val);\n\t};\n\treturn [val];\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isUndefined from '../js/isUndefined.js';\nimport _isNull from '../js/isNull.js';\nimport _arrFrom from '../arr/from.js';\n\n/**\n * Retrieves the value at the given path.\n *\n * A return value of undefined is ambiguous, and can mean either that the\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\n * know whether the path actually exists, pass an object as a third argument.\n * This object will have an \"exists\" key set to true/false.\n *\n * @param object \t\t\t\tctxt\n * @param array \t\t\t\tpath\n * @param object \t\t\t\ttrap\n * @param object \t\t\t\treciever\n *\n * @return mixed\n */\nexport default function(ctxt, path, trap = {}, reciever = {}) {\n\tpath = _arrFrom(path).slice();\n\tvar _ctxt = ctxt;\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\n\t\tvar _key = path.shift();\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\n\t\t\treciever.exists = false;\n\t\t\treturn;\n\t\t}\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\n\t}\n\treciever.exists = true;\n\treturn _ctxt;\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _isArray from '../js/isArray.js';\nimport _arrFrom from '../arr/from.js';\nimport _get from './get.js';\n\n/**\n * Sets a value to the given path.\n *\n * @param object \t\t\t\tobj\n * @param array \t\t\t\tpath\n * @param mixed \t\t\t\tval\n * @param object|function \t\tbuildTree\n * @param object \t\t\t\ttrap\n *\n * @return bool\n */\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\n\tconst _set = (target, key, val) => {\n\t\tif (trap.set) {\n\t\t\treturn trap.set(target, key, val);\n\t\t} else {\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\n\t\t\t\ttarget.push(val);\n\t\t\t} else {\n\t\t\t\ttarget[key] = val;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t};\n\tpath = _arrFrom(path);\n\tvar target = obj;\n\tfor(var i = 0; i < path.length; i ++) {\n\t\tif (i < path.length - 1) {\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar branch = _get(target, path[i], trap);\n\t\t\tif (!_isTypeObject(branch)) {\n\t\t\t\tif (trap.buildTree === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\n\t\t\t\tif (!branchSuccess) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttarget = branch;\n\t\t} else {\n\t\t\treturn _set(target, path[i], val);\n\t\t}\n\t}\n};\n", "\n/**\n * ---------------------------\n * Binds callbacks to requestAnimationFrame()\n * to create a central \"read/write\" phases for Ctxt access.\n * ---------------------------\n */\n\t\t\t\nexport default class Scheduler {\n\n\t/**\n\t * Starts the loop.\n\t *\n\t * @return this\n\t */\n\tconstructor( window, synthesis = false ) {\n\t\tObject.defineProperty( this, 'window', { value: window } );\n\t\tObject.defineProperty( this, 'readCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, 'writeCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, '_synthesis', { value: 0, writable: true } );\n\t\tif ( !synthesis && this.window.requestAnimationFrame ) {\n\t\t\tthis._loop();\n\t\t} else { this._synthesis ++; }\n\t}\n\n\tget synthesis() { return this._synthesis; }\n\n\tasync synthesizeWhile( callback ) {\n\t\tthis._synthesis ++;\n\t\tthis._fulfill();\n\t\tconst returnValue = await callback();\n\t\tthis._synthesis --;\n\t\treturn returnValue;\n\t}\n\n\t_fulfill() {\n\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.readCallbacks.delete( callback );\n\t\t}\n\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.writeCallbacks.delete( callback );\n\t\t}\n\t}\n\n\t_loop() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tthis._fulfill();\n\t\t\tthis._loop();\n\t\t} );\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"read\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonread( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.readCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.readCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"write\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonwrite( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.writeCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.writeCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * A special construct for Ctxt manipulations that span\n\t * one or more read/write cycles.\n\t *\n\t * @param function \tread\n\t * @param function \twrite\n\t * @param mixed\t\tprevTransaction\n\t *\n\t * @return void|mixed\n\t */\n\tcycle( onread, onwrite, prevTransaction ) {\n\t\tthis.onread( () => {\n\t\t\t// Record initial values\n\t\t\tconst readReturn = onread( prevTransaction );\n\t\t\t// Call erite, the transation\n\t\t\tconst callWrite = ( readReturn ) => {\n\t\t\t\tif ( readReturn === undefined ) return;\n\t\t\t\tthis.onwrite( () => {\n\t\t\t\t\tconst writeReturn = onwrite( readReturn, prevTransaction );\n\t\t\t\t\t// Repeat transaction\n\t\t\t\t\tconst repeatTransaction = ( writeReturn ) => {\n\t\t\t\t\t\tif ( writeReturn === undefined ) return;\n\t\t\t\t\t\tthis.cycle( onread, onwrite, writeReturn );\n\t\t\t\t\t};\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\t// If \"write\" returns a promise, we wait until it is resolved\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\tif ( writeReturn instanceof Promise ) {\n\t\t\t\t\t\twriteReturn.then( repeatTransaction );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trepeatTransaction( writeReturn );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t\t// ---------------------------------------\n\t\t\t// If \"read\" returns a promise, we wait until it is resolved\n\t\t\t// ---------------------------------------\n\t\t\tif ( readReturn instanceof Promise ) {\n\t\t\t\treadReturn.then( callWrite );\n\t\t\t} else {\n\t\t\t\tcallWrite( readReturn );\n\t\t\t}\n\t\t} );\n\t}\n\n}", "\n/**\n * @imports\n */\nimport * as Util from './Util.js';\n\nexport default class DOMSpec {\n constructor( content ) {\n this.content = content;\n this.type = typeof content === 'string' ? 'selector' : 'instance';\n this.kind = this.type === 'instance' ? null : Util.isXpath( content ) ? 'xpath' : 'css';\n if ( this.kind === 'xpath' ) {\n this.isXpathAttr = Util.splitOuter( content.trim().slice( 1, -1 ), '@' ).length > 1;\n }\n }\n toString() { return this.content; }\n}", "\n/**\n * @imports\n */\nimport { _isFunction, _isObject, _wq } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport DOMSpec from './DOMSpec.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class Realtime\n */\nexport default class Realtime {\n\n\t/**\n\t * @constructor\n\t *\n\t * @param document|Element\tcontext\n\t */\n\tconstructor( context, namespace, window ) {\n\t\tthis.context = context;\n\t\tthis.namespace = namespace;\n\t\tthis.window = context.defaultView || context.ownerDocument?.defaultView || window;\n\t\tthis.document = this.window.document;\n\t\tthis.webqit = this.window.webqit;\n\t\tObject.defineProperty( this, '#', { value: {} } );\n\t}\n\t\n\t/**\n\t * Resolves arguments\n\t * \n\t * @param Array \t\t\targs \n\t * \n\t * @returns Array\n\t */\n\tresolveArgs( args ) {\n\t\tif ( _isFunction( args[ 0 ] ) ) { args = [ [], ...args ]; }\n\t\telse if ( _isObject( args[ 0 ] ) && !( args[ 0 ] instanceof DOMSpec ) && args.length === 1 ) {\n\t\t\targs = [ [], undefined, args[ 0 ] ];\n\t\t} else if ( _isObject( args[ 1 ] ) && args.length === 2 ) {\n\t\t\targs = [ _arrFrom( args[ 0 ], false/*castObject*/ ), undefined, args[ 1 ] ];\n\t\t} else { args[ 0 ] = _arrFrom( args[ 0 ], false/*castObject*/ ); }\n\t\tif ( args[ 0 ].filter( x => typeof x !== 'string' && !( x instanceof DOMSpec ) && !( x instanceof this.window.Node ) ).length ) {\n\t\t\tthrow new Error( `Argument #2 must be either a string or a Node object, or a list of those.` );\n\t\t}\n\t\targs[ 0 ] = args[ 0 ].map( s => s instanceof DOMSpec ? s : new DOMSpec( s ) );\n\t\treturn args;\n\t}\n\n\t/**\n\t * @registry\n\t *\n\t * @param Array\t\t\t\t...args\n\t * \n\t * @returns Map\n\t */\n\tregistry( ...args ) {\n\t\treturn _wq( this.window, 'realdom', this.namespace, ...args );\n\t}\n\t\t\n\t/**\n\t * @createSignalGenerator\n\t * \n\t * @param Object \t\t\tmo \n\t * \n\t * @returns Object\n\t */\n\tcreateSignalGenerator() {\n\t\treturn {\n\t\t\tgenerate() {\n\t\t\t\t// Abort previous\n\t\t\t\tthis.lastController?.abort();\n\t\t\t\tthis.lastController = new AbortController;\n\t\t\t\tconst flags = { signal: this.lastController.signal };\n\t\t\t\treturn flags;\n\t\t\t},\n\t\t\tdisconnect() { this.lastController?.abort(); }\n\t\t}\n\t}\n\t\t\n\t/**\n\t * Loops through registration objects whose contexts match the event context.\n\t * \n\t * @param String \t\tinterceptionTiming\n\t * @param Object|Array \trecord_s\n\t * @param Function \t\tcallback \n\t * \n\t * @returns void\n\t */\n\tforEachMatchingContext( interceptionTiming, record_s, callback ) {\n\t\tconst { window } = this, deferreds = new Set, testCache = new WeakMap;\n\t\tfor ( const [ registration, deferred ] of this.registry( interceptionTiming ) ) {\n\t\t\tlet $records = [].concat( record_s ).filter( record => Util.containsNode( window, registration.context, record.target, registration.params.subtree === 'cross-roots', testCache ) );\n\t\t\tif ( !$records.length ) continue;\n\t\t\tconst args = [ registration, Array.isArray( record_s ) ? $records : $records[ 0 ] ];\n\t\t\tif ( deferred ) deferreds.add( args ); else callback.call( window, ...args );\n\t\t}\n\t\tfor ( const args of deferreds ) callback.call( window, ...args );\n\t\tdeferreds.clear();\n\t}\n\n\t/**\n\t * @disconnectables\n\t * \n\t * @param AbortSignal \t\tsignal\n\t * @param Array \t\t\t...objects \n\t * \n\t * @returns Object\n\t */\n\tdisconnectables( signal, ...objects ) {\n\t\tconst disconnectable = { disconnect() {\n\t\t\tobjects.forEach( d => (\n\t\t\t\td && _isFunction( d.disconnect ) && d.disconnect() \n\t\t\t\t|| _isFunction( d ) && d() \n\t\t\t\t|| _isObject( d ) && ( d.disconnected = true )\n\t\t\t) );\n\t\t} };\n\t\tif ( signal ) signal.addEventListener( 'abort', () => disconnectable.disconnect() );\n\t\treturn disconnectable;\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _wq } from '@webqit/util/js/index.js';\nimport Realtime from './Realtime.js';\nimport DOMSpec from './DOMSpec.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\n\n\ttype = 'attr';\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'attr', ...args );\n\t}\n\t\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tget( spec, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, spec );\n\t\tif ( !callback ) return records;\n\t\tconst signalGenerator = params.lifecycleSignals && this.createSignalGenerator();\n\t\tif ( !originalFilterIsString ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( records, flags, context );\n\t\t} else {\n\t\t\tfor ( const record of records ) {\n\t\t\t\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\t\t\t\tcallback( record, flags, context );\n\t\t\t}\n\t\t}\n\t\t// -------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( originalFilterIsString ? spec[ 0 ] : spec, callback, { newValue: true, ...params } );\n\t\t\treturn this.disconnectables( params.signal, disconnectable_live );\n\t\t}\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? spec[ 0 ] : spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails && !webqit.realdom.attrInterceptionHooks?.intercepting ) {\n\t\t\tattrInterception.call( window, 'intercept', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => {\n\t\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\t\tdispatch.call( window, registration, records, context );\n\t\t} );\n\t\t// ------------------\n\t\tconst $params = { attributes: true, attributeOldValue: params.oldValue, subtree: params.subtree && true };\n\t\tif ( spec.length ) { $params.attributeFilter = spec.map( a => a + '' ); }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tattrInterception.call( window, interceptionTiming, records => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, records, dispatch );\n\t\t\t} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() { registry.delete( registration ); } };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n}\n\n/**\n * Deduplicates records.\n * \n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction dedupAndIgnoreInternals( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === rcd.attributeName ) return rcds;\n\t\tif ( _wq( rcd.target, 'realdom', 'internalAttrInteractions' ).get( rcd.attributeName ) ) return rcds;\n\t\treturn rcds.concat( rcd );\n\t}, [] );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration\n * @param Array \t\t\trecords\n * \n * @returns Void\n */\nfunction dispatch( registration, records ) {\n\tconst { context, spec, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif (!params.subtree) {\n\t\trecords = records.filter((r) => {\n\t\t\treturn r.target === context;\n\t\t}); \n\t}\n\tif ( !records.length ) return;\n\tconst $spec = spec.map( a => a + '' );\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, spec, records );\n\t} else if ( params.timing !== 'async' && spec.length ) {\n\t\trecords = records.filter( r => $spec.includes( r.name ) );\n\t}\n\tif ( !records.length ) return;\n\t// Should we care about old / new values being present?\n\tif ( !( params.newValue === null && params.oldValue === null && params.eventDetails ) ) {\n\t\trecords = records.map( rcd => {\n\t\t\tlet exclusion;\n\t\t\tif ( !params.eventDetails ) {\n\t\t\t\t( { event: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.oldValue && ( 'oldValue' in rcd ) ) {\n\t\t\t\t( { oldValue: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.newValue && ( 'value' in rcd ) ) {\n\t\t\t\t( { value: exclusion, ...rcd } = rcd );\n\t\t\t} else if ( params.newValue && typeof rcd.value === 'undefined' ) {\n\t\t\t\trcd = { ...rcd, value: internalAttrInteraction( rcd.target, rcd.name, () => rcd.target.getAttribute( rcd.name ) ) };\n\t\t\t}\n\t\t\treturn rcd;\n\t\t} );\n\t}\n\tif ( params.atomic ) {\n\t\trecords.forEach( record => atomics.set( record.name, record ) );\n\t\trecords = Array.from( atomics.entries() ).map( ( [ , value ] ) => value );\n\t}\n\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n */\nfunction internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tspec\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, spec, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( spec.length ) {\n\t\treturn spec.map( attrName => {\n\t\t\tattrName = attrName + '';\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: internalAttrInteraction( context, attrName, () => context.getAttribute( attrName ) ), ..._type };\n\t\t} );\n\t}\n\tconst attrs = Array.from( context.attributes );\n\treturn attrs.map( attr => {\n\t\treturn records.find( r => r.name === attr.nodeName ) || { target: context, name: attr.nodeName, value: internalAttrInteraction( context, attr.nodeName, () => attr.nodeValue ), ..._type };\n\t} );\n}\n\n/**\n * Determines the event for an attr mutation record.\n * \n * @param MutationRecord \t{ target, attributeName }\n * \n * @returns Object\n */\nfunction withAttrEventDetails( { target, attributeName, value, oldValue } ) {\n\tconst window = this, registry = window.webqit.realdom.attrInterceptionRecords?.get( target ) || {};\n\tconst event = registry[ attributeName ]?.[ 0 ] || 'mutation';\n\tconst record = { target, name: attributeName, value, oldValue, type: 'observation', event };\n\treturn record;\n}\n\n/**\n * Attributes intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction attrInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Element } = window;\n\tif ( !webqit.realdom.attrInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'attrInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.attrInterceptionHooks.has( timing ) ) { webqit.realdom.attrInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.attrInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.attrInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.attrInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `Attr mutation APIs are now being intercepted.` );\n\twebqit.realdom.attrInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'attrInterceptionRecords', { value: new Map } );\n\n\t// Interception hooks\n\tconst attrIntercept = ( record, defaultAction ) => {\n\t\tif ( !webqit.realdom.attrInterceptionRecords.has( record.target ) ) { webqit.realdom.attrInterceptionRecords.set( record.target, {} ); }\n\t\tconst registry = webqit.realdom.attrInterceptionRecords.get( record.target );\n\t\t// ------------------\n\t\tregistry[ record.name ] = registry[ record.name ] || [];\n\t\tregistry[ record.name ].unshift( record.event );\n\t\tif ( _wq( record.target, 'realdom', 'internalAttrInteractions' ).get( record.name ) ) return defaultAction();\n\t\t// ------------------\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( [ record ] ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( [ record ] ) );\n\t\treturn returnValue;\n\t};\n\n\t// Interception observer WILL need to know non-API-based mutations\n\tconst mo = new window.MutationObserver( records => {\n\t\trecords = records.filter( rcd => {\n\t\t\tconst registry = window.webqit.realdom.attrInterceptionRecords?.get( rcd.target ) || {};\n\t\t\treturn !registry[ rcd.attributeName ]?.shift();\n\t\t} );\n\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\tif ( !records.length ) return;\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( records ) );\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( records ) );\n\t} );\n\tmo.observe( document, { attributes: true, subtree: true, attributeOldValue: true } );\n\n\t// Intercept DOM attr mutation methods\n\tconst originalApis = Object.create( null );\n\t[ 'setAttribute', 'removeAttribute', 'toggleAttribute', ].forEach( apiName => {\n\t\toriginalApis[ apiName ] = Element.prototype[ apiName ];\n\t\tElement.prototype[ apiName ] = function( ...args ) {\n\t\t\tlet value, oldValue = internalAttrInteraction( this, args[ 0 ], () => this.getAttribute( args[ 0 ] ) );\n\t\t\tif ( [ 'setAttribute', 'toggleAttribute' ].includes( apiName ) ) { value = args[ 1 ]; }\n\t\t\tif ( apiName === 'toggleAttribute' && value === undefined ) {\n\t\t\t\tvalue = oldValue === null ? true : false;\n\t\t\t}\n\t\t\tconst record = { target: this, name: args[ 0 ], value, oldValue, type: 'interception', event: [ this, apiName ] };\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\treturn attrIntercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\n/**\n * @imports\n */\nimport { _isObject } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport AttrRealtime from './AttrRealtime.js';\nimport Realtime from './Realtime.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class DOMRealtime\n */\nexport default class DOMRealtime extends Realtime {\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'tree', ...args );\n\t}\n\n\t/**\n\t * Alias for ( new AttrRealtime() ).all( ... )\n\t */\n\tattr( filter, callback = undefined, params = {} ) {\n\t\tconst { context, window } = this;\n\t\treturn ( new AttrRealtime( context, window ) ).get( ...arguments );\n\t}\n\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tquery( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// ------------------\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'query', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ------------------\n\t\tif ( !params.generation || params.generation === 'entrants' ) {\n\t\t\tif ( !spec.length ) {\n\t\t\t\t//if ( params.subtree ) throw new Error( `The subtree option requires a selector to work.` );\n\t\t\t\t[ ...context.children ].forEach( node => getRecord( context ).entrants.push( node ) );\n\t\t\t} else if ( spec.every( s => s.type === 'selector' ) ) {\n\t\t\t\tconst [ cssSelectors, xpathQueries ] = spec.reduce( ( [ css, xpath ], s ) => {\n\t\t\t\t\treturn s.kind === 'xpath' ? [ css, xpath.concat( s ) ] : [ css.concat( s ), xpath ];\n\t\t\t\t}, [ [], [] ] );\n\t\t\t\tconst matches = [];\n\t\t\t\tif ( params.subtree ) {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...context.querySelectorAll( cssSelectors.join( ',' ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries ) ); }\n\t\t\t\t} else {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...[ ...context.children ].filter( node => node.matches( cssSelectors ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries, false ) ); }\n\t\t\t\t}\n\t\t\t\tmatches.forEach( node => getRecord( node.parentNode || context ).entrants.push( node ) );\n\t\t\t}\n\t\t}\n\t\t// ------------------\n\t\tif ( !callback ) return records;\n\t\tconst disconnectable = { disconnected: false };\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tif ( disconnectable.disconnected ) break;\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t\t// ------------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( spec, callback, params );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, disconnectable_live );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: false } )\n\t */\n\tchildren( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit, document } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails ) { webqit.realdom.domInterceptionRecordsAlwaysOn = true; }\n\t\tif ( ( document.readyState === 'loading' || webqit.realdom.domInterceptionRecordsAlwaysOn ) && !webqit.realdom.domInterceptionHooks?.intercepting ) {\n\t\t\tdomInterception.call( window, 'sync', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tdispatch.call( window, registration, withEventDetails.call( window, record ), context );\n\t\t} ) );\n\t\tdisconnectable.observe( context, { childList: true, subtree: params.subtree && true, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\t\t\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tdomInterception.call( window, interceptionTiming, record => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, record, dispatch );\n\t\t\t} );\n\t\t}\n\t\tconst mo = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tif ( Array.isArray( ( record = withEventDetails.call( window, record ) ).event ) ) return;\n\t\t\tdispatch.call( window, registration, record, context );\n\t\t} ) );\n\t\tmo.observe( context, { childList: true, subtree: params.subtree && true } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tregistry.delete( registration );\n\t\t\tmo.disconnect();\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Tracks the connectedness of element references.\n\t *\n\t * @param array|Element\t\t\t\telements\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable\n\t */\n\ttrack( elements, callback, params = {} ) {\n\t\tparams = { subtree: true, ...params };\n\t\treturn this.observe( elements, record => {\n\t\t\tif ( record.entrants.length ) callback( true, Array.isArray( elements ) ? record.entrants : record.entrants[ 0 ] );\n\t\t\tif ( record.exits.length ) callback( false, Array.isArray( elements ) ? record.exits : record.exits[ 0 ] );\n\t\t}, params );\n\t}\n}\n\n/**\n * Sensitivty for attribute changes for attribute spec.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, spec, callback, params, signalGenerator } = registration;\n\tconst cssSelectors = spec.filter( s => s.kind === 'css' );\n\tconst parseDot = selector => selector.match( /\\.([\\w-]+)/g )?.length ? [ 'class' ] : [];\n\tconst parseHash = selector => selector.match( /#([\\w-]+)/g )?.length ? [ 'id' ] : [];\n\tconst parse = selector => [ ...selector.matchAll( /\\[([^\\=\\]]+)(\\=[^\\]]+)?\\]/g ) ].map( x => x[ 1 ] ).concat( parseDot( selector ) ).concat( parseHash( selector ) );\n\tif ( !( registration.$attrs = Array.from( new Set( cssSelectors.filter( s => ( s + '' ).includes( '[' ) ).reduce( ( attrs, selector ) => attrs.concat( parse( selector + '' ) ), [] ) ) ) ).length ) return;\n\t// ---------\n\tconst entrants = new Set, exits = new Set;\n\tentrants.push = val => ( exits.delete( val ), entrants.add( val ) );\n\texits.push = val => ( entrants.delete( val ), exits.add( val ) );\n\tregistration.$deliveryCache = { entrants, exits };\n\t// ---------\n\treturn ( new AttrRealtime( context, window ) ).observe( registration.$attrs, _records => {\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'static', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ---------\n\t\tconst matchesCache = new WeakMap;\n\t\tconst matches = node => {\n\t\t\tif ( !matchesCache.has( node ) ) { matchesCache.set( node, cssSelectors.some( s => node.matches( s + '' ) ) ); }\n\t\t\treturn matchesCache.get( node );\n\t\t};\n\t\t// ---------\n\t\tfor ( const _record of _records ) {\n\t\t\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\t\t\tif ( params.generation && generation !== params.generation ) return;\n\t\t\t\tif ( registration.$deliveryCache[ generation ].has( _record.target ) || ( generation === 'entrants' ? !matches( _record.target ) : matches( _record.target ) ) ) return;\n\t\t\t\tregistration.$deliveryCache[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target )[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target ).event = _record.event;\n\t\t\t} );\n\t\t}\n\t\t// ---------\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t}, { subtree: params.subtree, timing: params.timing, eventDetails: params.eventDetails } );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration \n * @param Object \t\t\trecord \n * \n * @returns Void\n */\nfunction dispatch( registration, _record ) {\n\tconst { context, spec, callback, params, signalGenerator, $deliveryCache } = registration;\n\t// ---------\n\tconst record = { ..._record, entrants: [], exits: [] };\n\tif ( !params.eventDetails ) { delete record.event; }\n\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\tif ( params.generation && generation !== params.generation ) return;\n\t\tif ( spec.length ) {\n\t\t\trecord[ generation ] = nodesIntersection.call( this, spec, params.subtree === 'cross-roots', _record[ generation ], _record.event !== 'parse' );\n\t\t} else {\n\t\t\trecord[ generation ] = [ ..._record[ generation ] ];\n\t\t}\n\t\tif ( !$deliveryCache ) return;\n\t\tfor ( const node of record[ generation ] ) {\n\t\t\t$deliveryCache[ generation ].push( node );\n\t\t}\n\t} );\n\t// ---------\n\tif ( !record.entrants.length && !record.exits.length ) return;\n\tconst flags = signalGenerator?.generate() || {};\n\tcallback( record, flags, context );\n}\n\n/**\n * Aggregates instances of els in sources\n * \n * @param Array \t\t\tspec \n * @param Bool \t\t\t\tcrossRoots \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( spec, crossRoots, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, s ) => {\n\t\t// Filter out text nodes\n\t\tif ( s.type === 'selector' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = s.isXpathAttr ? [] : sources.filter( source => s.kind === 'xpath' ? Util.xpathMatch( this, source, s + '' ) : source.matches && source.matches( s + '' ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect || s.isXpathAttr ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\tif ( s.kind === 'xpath' ) { return [ ...collection, ...Util.xpathQuery( this, source, s, deepIntersect ) ]; }\n\t\t\t\t\treturn source.querySelectorAll ? [ ...collection, ...source.querySelectorAll( s + '' ) ] : collection;\n\t\t\t\t}, matches );\n\t\t\t}\n\t\t\tif ( matches.length ) return matches;\n\t\t} else {\n\t\t\t// Is directly mutated...\n\t\t\tif ( sources.includes( s.content ) || (\n\t\t\t\tdeepIntersect && sources.some( source => Util.containsNode( this/* window */, source, s.content, crossRoots ) )\n\t\t\t) ) { return [ s.content ]; }\n\t\t}\n\t};\n\t// Search can be expensive...\n\t// Multiple listeners searching the same thing in the same list?\n\tif ( !sources.$$searchCache ) { sources.$$searchCache = new Map; }\n\treturn spec.reduce( ( matches, s ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( s.content ) ) {\n\t\t\t_matches = sources.$$searchCache.get( s.content );\n\t\t} else {\n\t\t\t_matches = match( sources, s ) || [];\n\t\t\tif ( s.type === 'instance' ) {\n\t\t\t\tsources.$$searchCache.set( s.content, _matches );\n\t\t\t}\n\t\t}\n\t\treturn matches.concat( _matches );\n\t}, [] );\n}\n\n/**\n * Determines the event for a mutation record\n * \n * @param MutationRecord \t{ target, entrants, exits }\n * \n * @returns Object\n */\nfunction withEventDetails( { target, addedNodes, removedNodes } ) {\n\tlet window = this, event;\n\tevent = _arrFrom( addedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), null );\n\tevent = _arrFrom( removedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), event );\n\tevent = event || window.document.readyState === 'loading' && 'parse' || 'mutation';\n\treturn { target, entrants: addedNodes, exits: removedNodes, type: 'observation', event };\n}\n\n/**\n * DOM intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction domInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Node, CharacterData, Element, HTMLElement, HTMLTemplateElement, DocumentFragment } = window;\n\tif ( !webqit.realdom.domInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'domInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionNoRecurse ) { Object.defineProperty( webqit.realdom, 'domInterceptionNoRecurse', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionHooks.has( timing ) ) { webqit.realdom.domInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.domInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.domInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.domInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `DOM mutation APIs are now being intercepted.` );\n\twebqit.realdom.domInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'domInterceptionRecords', { value: new Map } );\n\n\t// No recursion helper\n\tconst noRecurse = ( node, method, callback ) => {\n\t\twebqit.realdom.domInterceptionNoRecurse.set( node, method );\n\t\tconst returnValue = callback();\n\t\twebqit.realdom.domInterceptionNoRecurse.delete( node );\n\t\treturn returnValue;\n\t};\n\n\t// Interception hooks\n\tconst intercept = ( record, defaultAction ) => {\n\t\trecord.entrants.concat( record.exits ).forEach( node => {\n\t\t\tclearTimeout( webqit.realdom.domInterceptionRecords.get( node )?.timeout ); // Clear any previous that's still active\n\t\t\twebqit.realdom.domInterceptionRecords.set( node, record.event ); // Main: set event details... and next to timeout details\n\t\t\tconst timeout = setTimeout( () => { webqit.realdom.domInterceptionRecords.delete( node ); }, 0 );\n\t\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\n\t\t} );\n\t\twebqit.realdom.domInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( record ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.domInterceptionHooks.get( 'sync' )?.forEach( callback => callback( record ) );\n\t\treturn returnValue;\n\t};\n\n\t// Intercept DOM mutation methods\n\tconst _apiNames = {\n\t\t// Note the order\n\t\tShadowRoot: [ 'innerHTML', 'setHTMLUnsafe' ],\n\t\tDocumentFragment: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tDocument: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tHTMLElement: [ 'outerText', 'innerText' ],\n\t\tElement: [ 'append', 'prepend', 'before', 'after', 'insertAdjacentElement', 'insertAdjacentHTML', 'remove', 'replaceChildren', 'replaceWith', 'setHTMLUnsafe', 'innerHTML', 'outerHTML' ],\n\t\tCharacterData: [ 'before', 'after', 'remove', 'replaceWith' ],\n\t\tNode: [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild', 'textContent', 'nodeValue' ],\n\t};\n\tconst _apiOriginals = {\n\t\t// Note the order\n\t\tShadowRoot: Object.create( null ), // extends DocumentFragment\n\t\tDocumentFragment: Object.create( null ), // extends Node\n\t\tDocument: Object.create( null ), // extends Node\n\t\tHTMLElement: Object.create( null ), // extends Element,\n\t\tElement: Object.create( null ), // extends Node\n\t\tCharacterData: Object.create( null ), // extends Node\n\t\tNode: Object.create( null ),\n\t};\n\n\tconst _apiNamesUnique = new Set( Object.values( _apiNames ).reduce( ( all, apis ) => all.concat( apis ), [] ) );\n\t_apiNamesUnique.forEach( apiName => {\n\t\t\n\t\tObject.keys( _apiNames ).forEach( DOMClassName => {\n\t\t\tif ( !_apiNames[ DOMClassName ].includes( apiName ) ) return;\n\t\t\tconst _apiOriginal = Object.getOwnPropertyDescriptor( window[ DOMClassName ].prototype, apiName );\n\t\t\tif ( !_apiOriginal ) return; // Typically: Element:setHTMLUnsafe\n\t\t\tObject.defineProperty( window[ DOMClassName ].prototype, apiName, 'value' in _apiOriginal ? { ..._apiOriginal, value: method } : { ..._apiOriginal, set: setter } );\n\t\t\t_apiOriginals[ DOMClassName ][ apiName ] = _apiOriginal;\n\t\t} );\n\n\t\tfunction method( ...args ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\tif ( webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'insertBefore' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'insertAdjacentElement', 'insertAdjacentHTML' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 1 ] ];\n\t\t\t\tif ( [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t} else if ( [ 'setHTMLUnsafe', 'replaceChildren' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\tentrants = apiName === 'replaceChildren' ? [ ...args ] : [ args[ 0 ] ];\n\t\t\t} else if ( [ 'replaceWith', 'remove' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\tentrants = apiName === 'replaceWith' ? [ ...args ] : [];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else if ( [ 'replaceChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ args[ 1 ] ];\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'removeChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...args ];\n\t\t\t} else {\n\t\t\t\t// 'before', 'after', 'append', 'prepend', 'appendChild'\n\t\t\t\tentrants = [ ...args ];\n\t\t\t\tif ( [ 'before', 'after' ].includes( apiName ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to entrants\n\t\t\tlet apiNameFinal = apiName;\n\t\t\tif ( [ 'insertAdjacentHTML', 'setHTMLUnsafe' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'insertAdjacentHTML' && [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\t$apiOriginals.setHTMLUnsafe.value.call( temp, entrants[ 0 ], apiName === 'setHTMLUnsafe' ? args[ 1 ] : {} );\n\t\t\t\tentrants = [ ...temp.childNodes ];\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'insertAdjacentHTML' ) {\n\t\t\t\t\tapiNameFinal = 'insertAdjacentElement';\n\t\t\t\t\targs[ 1 ] = new DocumentFragment;\n\t\t\t\t\tnoRecurse( args[ 1 ], 'append', () => args[ 1 ].append( ...temp.childNodes ) );\n\t\t\t\t} else {\n\t\t\t\t\tapiNameFinal = 'replaceChildren';\n\t\t\t\t\targs = [ ...temp.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn $apiOriginals[ apiNameFinal ].value.call( this, ...args );\n\t\t\t} );\n\t\t}\n\n\t\tfunction setter( value ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].set.call( this, value );\n\t\t\tif ( this instanceof HTMLScriptElement || webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'outerHTML', 'outerText' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else {\n\t\t\t\t// 'innerHTML', 'innerText', 'textContent', 'nodeValue'\n\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\ttarget = this.content;\n\t\t\t\t\texits = [ ...this.content.childNodes ];\n\t\t\t\t} else {\n\t\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to nodes\n\t\t\tif ( [ 'outerHTML', 'innerHTML' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return exec();\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\tnoRecurse( temp, apiName, () => temp[ apiName ] = value );\n\t\t\t\tentrants = this instanceof HTMLTemplateElement ? [ ...temp.content.childNodes ] : [ ...temp.childNodes ];\n\t\t\t\tif ( ( this instanceof HTMLTemplateElement && this.hasAttribute( 'src' ) ) || this instanceof ShadowRoot ) {\n\t\t\t\t\tconst getScripts = nodes => nodes.reduce( ( scripts, el ) => {\n\t\t\t\t\t\tif ( el instanceof HTMLScriptElement ) return scripts.concat( el );\n\t\t\t\t\t\tif ( el instanceof HTMLTemplateElement ) return scripts.concat( getScripts( [ el.content ] ) );\n\t\t\t\t\t\tscripts = scripts.concat( getScripts( [ ...( el.querySelectorAll?.( 'template' ) || [] ) ].map( t => t.content ) ) );\n\t\t\t\t\t\treturn scripts.concat( ...( el.querySelectorAll?.( 'script' ) || [] ) );\n\t\t\t\t\t}, [] );\n\t\t\t\t\tfor ( const script of getScripts( entrants ) ) {\n\t\t\t\t\t\tif (this instanceof ShadowRoot) {\n\t\t\t\t\t\t\tscript.setAttribute('data-handling', 'manual');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst $script = document.createElement( 'script' );\n\t\t\t\t\t\t[ ...script.attributes ].forEach( attr => $script.setAttribute( attr.name, attr.value ) );\n\t\t\t\t\t\t$script.textContent = script.textContent;\n\t\t\t\t\t\tnoRecurse( script, 'replaceWith', () => script.replaceWith( $script ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\tvalue = new DocumentFragment;\n\t\t\t\t\tnoRecurse( value, 'append', () => value.append( ...entrants ) );\n\t\t\t\t\texec = () => noRecurse( this, 'replaceWith', () => Element.prototype.replaceWith.call( this, value ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\t\texec = () => noRecurse( this.content, 'replaceChildren', () => this.content.replaceChildren( ...entrants ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => noRecurse( this, 'replaceChildren', () => Element.prototype.replaceChildren.call( this, ...entrants ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\r\n/**\r\n * Applies all supported polyfills\r\n */\r\nexport default function() {\r\n CSS_escape.call( this );\r\n Node_isConnected.call( this );\r\n Element_matches.call( this );\r\n}\r\n\r\n/**\r\n * Polyfills the window.CSS object.\r\n * \r\n * @return void\r\n */\r\nexport function CSS_escape() {\r\n const window = this;\r\n if ( !window.CSS ) { window.CSS = {} }\r\n if ( !window.CSS.escape ) {\r\n /**\r\n * Polyfills the window.CSS.escape() function.\r\n * \r\n * @param string str \r\n * \r\n * @return string\r\n */\r\n window.CSS.escape = str => str.replace( /([\\:@\\~\\$\\&])/g, '\\\\$1' );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Node.prototype.isConnected property\r\n * \r\n * @see MDN\r\n * \r\n * @return bool\r\n*/\r\nexport function Node_isConnected() {\r\n const window = this;\r\n if ( !( 'isConnected' in window.Node.prototype ) ) {\r\n Object.defineProperty( window.Node.prototype, 'isConnected', { get: function() {\r\n return !this.ownerDocument || !(\r\n this.ownerDocument.compareDocumentPosition( this )\r\n & this.DOCUMENT_POSITION_DISCONNECTED);\r\n } } );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Element.prototype.matches() method\r\n * \r\n * @see MDN\r\n * \r\n * @return void\r\n*/\r\nexport function Element_matches() {\r\n const window = this;\r\n if ( !window.Element.prototype.matches ) {\r\n window.Element.prototype.matches = \r\n window.Element.prototype.matchesSelector || \r\n window.Element.prototype.mozMatchesSelector ||\r\n window.Element.prototype.msMatchesSelector || \r\n window.Element.prototype.oMatchesSelector || \r\n window.Element.prototype.webkitMatchesSelector ||\r\n function( s ) {\r\n var matches = ( this.document || this.ownerDocument ).querySelectorAll( s ),\r\n i = matches.length;\r\n while ( --i >= 0 && matches.item( i ) !== this ) {}\r\n return i > -1; \r\n }\r\n }\r\n}", "\r\n/**\r\n * @imports\r\n */\r\nimport { _isNumeric, _isString, _isFunction } from '@webqit/util/js/index.js';\r\nimport { _set } from '@webqit/util/obj/index.js';\r\nimport Scheduler from './Scheduler.js';\r\nimport DOMRealtime from './realtime/DOMRealtime.js';\r\nimport AttrRealtime from './realtime/AttrRealtime.js';\r\nimport polyfill from './polyfills.js';\r\n\r\nexport default function() {\r\n const window = this;\r\n if ( !window.webqit ) window.webqit = {};\r\n if ( window.webqit.realdom ) return window.webqit.realdom;\r\n window.webqit.realdom = {};\r\n polyfill.call( window );\r\n // ------\r\n window.webqit.realdom.meta = ( ...args ) => meta.call( window, ...args );\r\n window.webqit.realdom.ready = ( ...args ) => ready.call( window, ...args );\r\n // ------\r\n window.webqit.realdom.realtime = ( context, namespace = 'dom' ) => {\r\n if ( namespace === 'dom' ) return new DOMRealtime( context, window );\r\n if ( namespace === 'attr' ) return new AttrRealtime( context, window );\r\n };\r\n // ------\r\n const scheduler = new Scheduler( window );\r\n window.webqit.realdom.schedule = ( type, ...args ) => {\r\n return scheduler[ `on${ type }` ]( ...args );\r\n };\r\n window.webqit.realdom.synthesizeWhile = ( ...args ) => {\r\n return scheduler.synthesizeWhile( ...args );\r\n };\r\n // ------\r\n return window.webqit.realdom;\r\n}\r\n\r\n\r\n/**\r\n * DOM-ready listeners.\r\n * \r\n * @param Function\t \t\tcallback\r\n * \r\n * @return void\r\n */\r\nfunction ready( ...args ) {\r\n let timing = 'interactive', callback;\r\n if ( _isString( args[ 0 ] ) ) {\r\n timing = args[ 0 ];\r\n if ( _isFunction( args[ 1 ] ) ) { callback = args[ 1 ]; }\r\n } else if ( _isFunction( args[ 0 ] ) ) { callback = args[ 0 ]; }\r\n // --------------\r\n const timings = { interactive: [ 'interactive', 'complete' ], complete: [ 'complete' ], };\r\n if ( !timings[ timing ] ) throw new Error( `Invalid ready-state timing: ${ timing }.` );\r\n\tconst window = this;\r\n // --------------\r\n if ( !callback ) {\r\n if ( !window.webqit.realdom.readyStatePromises ) {\r\n window.webqit.realdom.readyStatePromises = {\r\n interactive: new Promise( res => ready.call( this, 'interactive', res ) ),\r\n complete: new Promise( res => ready.call( this, 'complete', res ) ),\r\n };\r\n }\r\n return window.webqit.realdom.readyStatePromises[ timing ];\r\n }\r\n // --------------\r\n\tif ( timings[ timing ].includes( window.document.readyState ) ) return callback( window );\r\n if ( !window.webqit.realdom.readyStateCallbacks ) {\r\n window.webqit.realdom.readyStateCallbacks = { interactive: [], complete: [] };\r\n window.document.addEventListener( 'readystatechange', () => {\r\n const state = window.document.readyState;\r\n for ( const callback of window.webqit.realdom.readyStateCallbacks[ state ].splice( 0 ) ) {\r\n callback( window );\r\n }\r\n }, false );\r\n }\r\n window.webqit.realdom.readyStateCallbacks[ timing ].push( callback );\r\n}\r\n\r\n/**\r\n * A webqit's meta tag props reader.\r\n * \r\n * @param String name\r\n * \r\n * @return Object\r\n */\r\nfunction meta( name ) {\r\n const window = this;\r\n let _content = {}, _el;\r\n if ( _el = window.document.querySelector( `meta[name=\"${ name }\"]` ) ) {\r\n _content = ( _el.content || '' ).split( ';' ).filter( v => v ).reduce( ( _metaVars, directive ) => {\r\n const directiveSplit = directive.split( '=' ).map( d => d.trim() );\r\n _set( _metaVars, directiveSplit[ 0 ].split( '.' ), directiveSplit[ 1 ] === 'true' ? true : (directiveSplit[ 1 ] === 'false' ? false : (\r\n _isNumeric( directiveSplit[ 1 ] ) ? parseInt( directiveSplit[ 1 ] ) : directiveSplit[ 1 ]\r\n ) )\r\n );\r\n return _metaVars;\r\n }, {} );\r\n }\r\n return { get name() { return name; }, get content() { return _el.content; }, json() {\r\n\t\treturn JSON.parse( JSON.stringify( _content ) );\r\n } };\r\n}", "\n/**\n * Converts a string to title case.\n *\n * @param string \tstr\n * @param bool \t\tstrict\n *\n * @return string\n */\nexport default function(str, strict) {\n\tif (typeof str !== 'string') {\n\t\treturn str;\n\t}\n\treturn str.replace(/\\w\\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + ((typeof strict !== undefined && strict) ? txt.substr(1).toLowerCase() : txt.substr(1)); })\n};\n", "\n/**\n * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _wq as __wq } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\nimport { _toTitle } from '@webqit/util/str/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'oohtml', ...args );\n\nexport const env = {};\n\nexport function _init( name, $config, $defaults ) {\n const window = this, realdom = realdomInit.call( window );\n env.window = window;\n if ( !window.webqitConfig ) {\n window.webqitConfig = realdom.meta( 'webqit' ).json();\n }\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n // ---------------------\n const configKey = name.toUpperCase().replace( '-', '_' );\n if ( !window.webqit.oohtml.configs[ configKey ] ) {\n window.webqit.oohtml.configs[ configKey ] = {};\n const config = window.webqit.oohtml.configs[ configKey ];\n _merge( 2, config, $defaults, $config, realdom.meta( name ).json() );\n if ( window.webqitConfig.prefix ) {\n Object.keys( config ).forEach( main => {\n Object.keys( config[ main ] ).forEach( key => {\n if ( main === 'api' && typeof config[ main ][ key ] === 'string' ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }${ _toTitle( config[ main ][ key ] ) }`\n } else if ( [ 'attr', 'elements' ].includes( main ) && config[ main ][ key ]?.startsWith( 'data-' ) === false ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }-${ config[ main ][ key ] }`\n }\n } );\n } );\n }\n }\n // ---------------------\n return { config: window.webqit.oohtml.configs[ configKey ], realdom, window };\n}\n\nexport function getInternalAttrInteraction( node, attrName ) {\n\treturn _wq( node, 'internalAttrInteractions' ).get( attrName );\n}\nexport function internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\nexport function _compare( a, b, depth = 1, objectSizing = false ) {\n if ( depth && typeof a === 'object' && a && typeof b === 'object' && b && ( !objectSizing || Object.keys( a ).length === Object.keys( b ).length ) ) {\n for ( let key in a ) {\n if ( !_compare( a[ key ], b[ key ], depth - 1, objectSizing ) ) return false;\n }\n return true;\n }\n if ( Array.isArray( a ) && Array.isArray( b ) && a.length === b.length ) {\n return ( b = b.slice( 0 ).sort() ) && a.slice( 0 ).sort().every( ( valueA, i ) => valueA === b[ i ] );\n }\n return a === b;\n}\n\nexport function _splitOuter( str, delim ) {\n return [ ...str ].reduce( ( [ quote, depth, splits ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}\n\n// Unique ID generator\nexport const _uniqId = () => ( 0 | Math.random() * 9e6 ).toString( 36 );\n\n// Hash of anything generator\nconst hashTable = new Map;\nexport function _toHash( val ) {\n let hash;\n if ( !( hash = hashTable.get( val ) ) ) {\n hash = _uniqId();\n hashTable.set( val, hash );\n }\n return hash;\n}\n\n// Value of any hash\nexport function _fromHash( hash ) {\n let val;\n hashTable.forEach( ( _hash, _val ) => {\n if ( _hash === hash ) val = _val;\n } );\n return val;\n}", "import { resolveParams } from '@webqit/quantum-js/params';\nimport { xpathQuery } from '@webqit/realdom/src/realtime/Util.js';\nimport { _wq, _init, _splitOuter } from '../util.js';\n\n/**\n * Initializes DOM Parts.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'data-binding', $config, {\n attr: { render: 'render', itemIndex: 'data-key' },\n tokens: { nodeType: 'processing-instruction', tagStart: '?{', tagEnd: '}?', stateStart: '; [=', stateEnd: ']' },\n advanced: resolveParams({ runtimeParams: { spec: { handler: e => {} } } }),\n } );\n ( { CONTEXT_API: config.CONTEXT_API, BINDINGS_API: config.BINDINGS_API, HTML_IMPORTS: config.HTML_IMPORTS } = window.webqit.oohtml.configs );\n config.attrSelector = `[${ window.CSS.escape( config.attr.render ) }]`;\n const discreteBindingsMatch = ( start, end ) => {\n const starting = `starts-with(., \"${ start }\")`;\n const ending = `substring(., string-length(.) - string-length(\"${ end }\") + 1) = \"${ end }\"`;\n return `${ starting } and ${ ending }`;\n }\n config.discreteBindingsSelector = `comment()[${ discreteBindingsMatch( config.tokens.tagStart, config.tokens.tagEnd ) }]`;\n realtime.call( window, config );\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { realdom } } = window;\n\t// ----------------\n /**\n * For an element, render should happen first\n <div render=\"\">\n <?{ content }?>\n </div>\n */\n realdom.realtime( window.document ).query( config.attrSelector, record => {\n cleanup.call( this, ...record.exits );\n setTimeout(() => {\n mountInlineBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:attr', live: true, subtree: 'cross-roots', timing: 'sync', eventDetails: true, staticSensitivity: true } );\n realdom.realtime( window.document ).query( `(${ config.discreteBindingsSelector })`, record => {\n setTimeout(() => {\n cleanup.call( this, ...record.exits );\n mountDiscreteBindings.call( window, config, ...record.entrants );\n }, 0);\n }, { id: 'data-binding:descrete', live: true, subtree: 'cross-roots', timing: 'sync' } );\n}\n\nfunction createDynamicScope( config, root ) {\n const { webqit: { realdom, Observer, DOMBindingsContext } } = this;\n if ( _wq( root ).has( 'data-binding' ) ) return _wq( root ).get( 'data-binding' );\n const scope = Object.create( null ), abortController = new AbortController;\n scope[ '$exec__' ] = ( target, prop, ...args ) => {\n const exec = () => {\n try { target[ prop ]( ...args ); }\n catch( e ) { throw new Error( `Error executing \"${ prop }()\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n scope[ '$assign__' ] = ( target, prop, val ) => {\n const exec = () => {\n try { target[ prop ] = val; }\n catch( e ) { throw new Error( `Error executing \"${ prop } = ${ val }\": ${ e.message } at ${ e.cause }` ); }\n };\n exec();\n };\n Observer.intercept( scope, {\n get: ( e, recieved, next ) => {\n if ( !( e.key in scope ) ) {\n const request = { ...DOMBindingsContext.createRequest( e.key ), live: true, signal: abortController.signal };\n root[ config.CONTEXT_API.api.contexts ].request( request, value => {\n Observer.set( scope, e.key, value );\n } );\n }\n return next( scope[ e.key ] ?? ( e.key in globalThis ? globalThis[ e.key ] : undefined ) );\n },\n has: ( e, recieved, next ) => { return next( true ); }\n } );\n const instance = { scope, abortController, bindings: new Map };\n _wq( root ).set( 'data-binding', instance );\n return instance;\n}\n\nfunction cleanup( ...entries ) {\n for ( const node of entries ) {\n const root = node.nodeName === '#text' ? node.parentNode : node;\n const { bindings, abortController } = _wq( root ).get( 'data-binding' ) || {};\n if ( !bindings?.has( node ) ) return;\n bindings.get( node ).state.dispose();\n bindings.get( node ).signals?.forEach( s => s.abort() );\n bindings.delete( node );\n if ( !bindings.size ) {\n abortController.abort();\n _wq( root ).delete( 'data-binding' );\n }\n }\n}\n\nfunction patternMatch( config, str ) {\n const tagStart = config.tokens.tagStart.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const tagEnd = config.tokens.tagEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const stateStart = config.tokens.stateStart.split( '' ).map( x => x === ' ' ? `(?:\\\\s+)?` : `\\\\${ x }` ).join( '' );\n const stateEnd = config.tokens.stateEnd.split( '' ).map( x => `\\\\${ x }` ).join( '' );\n const pattern = `^${ tagStart }(.*?)(?:${ stateStart }(\\\\d+)${ stateEnd }(?:\\\\s+)?)?${ tagEnd }$`;\n const [ /*raw*/, expr, span ] = str.match( new RegExp( pattern ) );\n return { raw: str, expr, span: parseInt( span ?? 0 ) };\n}\n\nasync function mountDiscreteBindings( config, ...entries ) {\n const window = this;\n const instances = entries.reduce( ( instances, node ) => {\n if ( node.isBound ) return instances;\n const template = patternMatch( config, node.nodeValue );\n let textNode = node;\n if ( template.span ) {\n textNode = node.nextSibling;\n if ( textNode?.nodeName !== '#text' || textNode.nodeValue.length < template.span ) return instances;\n if ( textNode.nodeValue.length > template.span ) { textNode.splitText( template.span ); }\n } else {\n textNode = node.ownerDocument.createTextNode( '' );\n node.after( textNode );\n }\n textNode.isBound = true;\n let anchorNode = node;\n if ( window.webqit.env !== 'server' ) {\n anchorNode.remove();\n anchorNode = null;\n }\n return instances.concat( { textNode, template, anchorNode } );\n }, [] );\n\n for ( const { textNode, template, anchorNode } of instances ) {\n const compiled = compileDiscreteBindings.call( window, config, template.expr );\n const { scope, bindings } = createDynamicScope.call( this, config, textNode.parentNode );\n Object.defineProperty( textNode, '$oohtml_internal_databinding_anchorNode', { value: anchorNode, configurable: true } );\n try {\n bindings.set( textNode, { state: await ( await compiled.bind( textNode, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst discreteParseCache = new Map;\nfunction compileDiscreteBindings( config, str ) {\n if ( discreteParseCache.has( str ) ) return discreteParseCache.get( str );\n let source = `let content = ((${ str }) ?? '') + '';`;\n source += `$assign__(this, 'nodeValue', content);`;\n source += `if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', \"${ config.tokens.tagStart }${ escDouble( str ) }${ config.tokens.stateStart }\" + content.length + \"${ config.tokens.stateEnd } ${ config.tokens.tagEnd }\"); }`;\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n discreteParseCache.set( str, compiled );\n return compiled;\n}\n\nasync function mountInlineBindings( config, ...entries ) {\n for ( const node of entries ) {\n const compiled = compileInlineBindings.call( this, config, node.getAttribute( config.attr.render ) );\n const { scope, bindings } = createDynamicScope.call( this, config, node );\n const signals = [];\n Object.defineProperty( node, '$oohtml_internal_databinding_signals', { value: signals, configurable: true } );\n try {\n bindings.set( node, { signals, state: await ( await compiled.bind( node, scope ) ).execute(), } );\n } catch( e ) {\n console.log(e);\n }\n }\n}\n\nconst inlineParseCache = new Map;\nfunction compileInlineBindings( config, str ) {\n if ( inlineParseCache.has( str ) ) return inlineParseCache.get( str );\n const validation = {};\n let $event_i = -1;\n const source = _splitOuter( str, ';' ).map( str => {\n const [ left, right ] = _splitOuter( str, ':' ).map( x => x.trim() );\n const directive = left[ 0 ], param = left.slice( 1 ).trim();\n const arg = `(${ right })`, $arg = `(${ arg } ?? '')`;\n // CSS\n if ( directive === '&' ) {\n if ( param.startsWith( '--' ) ) return `$exec__(this.style, 'setProperty', \"${ escDouble( param ) }\", ${ $arg });`;\n return `$assign__(this.style, \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Class list\n if ( directive === '%' ) return `$exec__(this.classList, 'toggle', \"${ escDouble( param ) }\", !!${ arg });`;\n // Attribute\n if ( directive === '~' ) {\n if ( param.startsWith( '?' ) ) return `$exec__(this, 'toggleAttribute', \"${ escDouble( param.substring( 1 ).trim() ) }\", !!${ arg });`;\n return `$exec__(this, 'setAttribute', \"${ escDouble( param ) }\", ${ $arg });`;\n }\n // Structure\n if ( directive === '#' ) {\n if ( validation[ param ] ) throw new Error( `Duplicate binding: ${ left }.` );\n validation[ param ] = true;\n if ( param === 'text' ) return `$assign__(this, 'textContent', ${ $arg });`;\n if ( param === 'html' ) return `$assign__(this, 'innerHTML', ${ $arg });`;\n if ( param === 'items' ) {\n const [ iterationSpec, importSpec ] = _splitOuter( right, '/' );\n if ( !importSpec ) throw new Error( `Invalid ${ directive }items spec: ${ str }; no import specifier.` );\n let [ raw, production, kind, iteratee ] = iterationSpec.trim().match( /(.*?[\\)\\s+])(of|in)([\\(\\{\\[\\s+].*)/i ) || [];\n if ( !raw ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n if ( production.startsWith( '(' ) ) {\n production = production.trim().slice( 1, -1 ).split( ',' ).map( x => x.trim() );\n } else { production = [ production ]; }\n if ( production.length > ( kind === 'in' ? 3 : 2 ) ) throw new Error( `Invalid ${ directive }items spec: ${ str }.` );\n const indices = kind === 'in' ? production[ 2 ] : ( production[ 1 ] || '$index__' );\n return `\n let $iteratee__ = ${ iteratee };\n let $import__ = this.${ config.HTML_IMPORTS.api.import }( ${ importSpec.trim() }, true );\n this.$oohtml_internal_databinding_signals?.push( $import__ );\n\n if ( $import__.value && $iteratee__ ) {\n let $existing__ = new Map;\n [ ...this.children ].filter( el => el.matches( '[${ config.attr.itemIndex }]' ) ).forEach( x => {\n $existing__.set( x.getAttribute( '${ config.attr.itemIndex }' ), x );\n } );\n ${ indices ? `let ${ indices } = -1;` : '' }\n for ( let ${ production[ 0 ] } ${ kind } $iteratee__ ) {\n ${ indices ? `${ indices } ++;` : '' }\n ${ kind === 'in' && production[ 1 ] ? `let ${ production[ 1 ] } = $iteratee__[ ${ production[ 0 ] } ];` : '' }\n const $itemBinding__ = { ${ production.join( ', ' ) } };\n \n const $key___ = ( ${ kind === 'in' ? production[ 0 ] : indices } ) + '';\n let $itemNode__ = $existing__.get( $key___ );\n if ( $itemNode__ ) {\n $existing__.delete( $key___ );\n $exec__($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n } else {\n $itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value instanceof window.HTMLTemplateElement ? $import__.value.content.firstElementChild : $import__.value ) ).cloneNode( true );\n $itemNode__.setAttribute( \"${ config.attr.itemIndex }\", $key___ );\n $exec__($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );\n $exec__(this, 'appendChild', $itemNode__ );\n }\n\n if ( ${ kind === 'in' ? `!( ${ production[ 0 ] } in $iteratee__ )` : `typeof ${ production[ 0 ] } === 'undefined'` } ) { $itemNode__.remove(); }\n }\n $existing__.forEach( x => x.remove() );\n $existing__.clear();\n }`;\n }\n }\n // Events\n if ( directive === '@' ) {\n $event_i++;\n return `\n const handler${ $event_i } = event => ${ right.startsWith('{') ? right : arg };\n this.addEventListener( '${ param }', handler${ $event_i } );\n const abort${ $event_i } = () => this.removeEventListener( '${ param }', handler${ $event_i } );\n this.$oohtml_internal_databinding_signals?.push( { abort: abort${ $event_i } } );\n `;\n }\n // Functions\n if ( directive === '$' ) {\n return `$exec__(this, '${ param }', ${ arg });`;\n }\n if ( str.trim() ) throw new Error( `Invalid binding: ${ str }.` );\n } ).join( `\\n` );\n const { webqit: { QuantumModule } } = this;\n const { parserParams, compilerParams, runtimeParams } = config.advanced;\n const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );\n inlineParseCache.set( str, compiled );\n return compiled;\n}\n\nconst escDouble = str => str.replace(/\"/g, '\\\\\"');\n\nexport function idleCompiler( node ) {\n const window = this, { webqit: { oohtml: { configs: { DATA_BINDING: config } } } } = window;\n // Attr selector must also come first, as in above\n ( node?.matches( config.attrSelector ) ? [ node ] : [] ).concat([ ...( node?.querySelectorAll( config.attrSelector ) || [] ) ]).forEach( node => {\n compileInlineBindings.call( window, config, node.getAttribute( config.attr.render ) );\n } );\n xpathQuery( window, node, `(${ config.discreteBindingsSelector })` ).forEach( node => {\n const template = patternMatch( config, node.nodeValue );\n compileDiscreteBindings.call( window, config, template.expr );\n } );\n}", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @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