@webqit/oohtml 2.1.26 → 2.1.28
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/README.md +22 -363
- package/dist/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +3 -3
- package/dist/context-api.js +1 -1
- package/dist/context-api.js.map +3 -3
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +3 -3
- package/dist/html-modules.js +1 -1
- package/dist/html-modules.js.map +3 -3
- package/dist/main.js +11 -11
- package/dist/main.js.map +3 -3
- package/dist/namespace-api.js +1 -1
- package/dist/namespace-api.js.map +3 -3
- package/dist/scoped-js.js +8 -8
- package/dist/scoped-js.js.map +3 -3
- package/package.json +4 -4
- package/src/html-imports/_HTMLImportElement.js +3 -3
- package/src/html-imports/index.js +4 -4
- package/src/html-modules/HTMLExportsManager.js +3 -3
- package/src/html-modules/_HTMLImportsContext.js +2 -2
- package/src/html-modules/index.js +2 -2
- package/src/namespace-api/index.js +3 -3
- package/src/scoped-js/index.js +4 -4
- package/src/targets.browser.js +1 -1
- package/src/util.js +4 -4
package/README.md
CHANGED
|
@@ -9,386 +9,45 @@
|
|
|
9
9
|
|
|
10
10
|
OOHTML offers a set of five features that make common UI development paradigms possible as native web platform features. These features may be used individually or together for some great UI-authoring capabilites. Here is an overview:
|
|
11
11
|
|
|
12
|
-
> **Note
|
|
13
|
-
>
|
|
12
|
+
> **Note**<br>
|
|
13
|
+
> Major updates coming in this branch! > `@webqit/oohtml@next`
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
+ [HTML Imports](#html-imports)
|
|
17
|
-
+ [Namespaced HTML](#namespaced-html)
|
|
18
|
-
+ [The State API](#the-state-api)
|
|
19
|
-
+ [Subscript](#subscript)
|
|
15
|
+
## Overview
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
+ HTML Modules
|
|
18
|
+
+ HTML Imports
|
|
19
|
+
+ Namespace API
|
|
20
|
+
+ Context API <sup>new</sup>
|
|
21
|
+
+ <ins>Bindings API</ins><del>The State API</del>
|
|
22
|
+
+ <ins>Scoped JS</ins><del>Subscript</del>
|
|
23
|
+
+ Scoped CSS<sup>planned</sup>
|
|
22
24
|
|
|
23
|
-
*HTML Modules* are a templating feature that lets us write reusable HTML markup using the *module*, *export* and *import* paradigm. This feature establishes the standard `<template>` element as the foundation of a module infrastructure for HTML and introduces new attributes, properties and events that together closes the loop.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
## Download Options
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
<head>
|
|
29
|
-
|
|
30
|
-
<template name="module1">
|
|
31
|
-
|
|
32
|
-
<label for="age">How old are you?</div>
|
|
33
|
-
<input id="age" />
|
|
34
|
-
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
</head>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Exports may be more properly wrapped within an `<export>` element of a designated name.
|
|
41
|
-
|
|
42
|
-
```html
|
|
43
|
-
<head>
|
|
44
|
-
|
|
45
|
-
<template name="module1">
|
|
46
|
-
|
|
47
|
-
<export name="question">
|
|
48
|
-
<label for="age">How old are you?</label>
|
|
49
|
-
<input id="age" />
|
|
50
|
-
</export>
|
|
51
|
-
|
|
52
|
-
<div>This is another export</div>
|
|
53
|
-
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
</head>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Or they may be individually *tagged* to an export identifier using the `exportgroup` attribute.
|
|
60
|
-
|
|
61
|
-
```html
|
|
62
|
-
<head>
|
|
63
|
-
|
|
64
|
-
<template name="module1">
|
|
65
|
-
|
|
66
|
-
<label exportgroup="question" for="age">How old are you?</label>
|
|
67
|
-
<input exportgroup="question" name="age" />
|
|
68
|
-
|
|
69
|
-
<div>This is another export</div>
|
|
70
|
-
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
</head>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Either way, they are accessed the same way using the *Modules API*.
|
|
77
|
-
|
|
78
|
-
```js
|
|
79
|
-
// Access module1 from document.templates
|
|
80
|
-
let module1 = document.templates.module1;
|
|
81
|
-
|
|
82
|
-
// Import module1's exports
|
|
83
|
-
let questionExport = module1.exports.question; // Array
|
|
84
|
-
|
|
85
|
-
// Clone the elements in the export
|
|
86
|
-
let questionExportClone = questionExport.map(el => el.cloneNode(true));
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Taking things further, template elements may reference remote content using the `src` attribute.
|
|
90
|
-
|
|
91
|
-
```html
|
|
92
|
-
<head>
|
|
93
|
-
|
|
94
|
-
<template name="module-remote" src="/bundle.html"></template>
|
|
95
|
-
|
|
96
|
-
</head>
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
The contents of the remote file automatically become the template's content on load.
|
|
100
|
-
|
|
101
|
-
**Details are in the [HTML Modules](https://webqit.io/tooling/oohtml/docs/spec/html-modules) specification. Learn more about the convention, API, events, and the polyfill support.**
|
|
102
|
-
|
|
103
|
-
## HTML Imports
|
|
104
|
-
|
|
105
|
-
*HTML Imports* are a declarative way to use the *exports* of an *HTML Module* from anywhere in the main document.
|
|
106
|
-
|
|
107
|
-
> Note that this is different from the HTML Imports that was spec'd with an early version of Web Components.
|
|
108
|
-
|
|
109
|
-
Here, an `<import>` element in the `<body>` area is used to *place* a corresponing *export* of an HTML module.
|
|
110
|
-
|
|
111
|
-
```html
|
|
112
|
-
<body>
|
|
113
|
-
|
|
114
|
-
<!-- Import question here from module1 -->
|
|
115
|
-
<import name="question" template="module1"></import>
|
|
116
|
-
|
|
117
|
-
</body>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Resolution takes place and the `<import>` element is replaced by all of the imported contents.
|
|
121
|
-
|
|
122
|
-
```html
|
|
123
|
-
<body>
|
|
124
|
-
|
|
125
|
-
<!-- import element replaced -->
|
|
126
|
-
<label for="age">How old are you?</label>
|
|
127
|
-
<input id="age" />
|
|
128
|
-
|
|
129
|
-
</body>
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Also, multiple `<import>` elements within a block can be scoped to just one *module ID* declaration.
|
|
133
|
-
|
|
134
|
-
```html
|
|
135
|
-
<body>
|
|
136
|
-
|
|
137
|
-
<!-- Point to a module; one module ID for all imports within -->
|
|
138
|
-
<div template="module1">
|
|
139
|
-
|
|
140
|
-
<!-- Import question here from module1 -->
|
|
141
|
-
<import name="question"></import>
|
|
142
|
-
|
|
143
|
-
<div>
|
|
144
|
-
<!-- Import another export here from module1 -->
|
|
145
|
-
<import name="export-2"></import>
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
</div>
|
|
149
|
-
|
|
150
|
-
</body>
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
On resolution, an `<import>` element will stand by somewhere with a view to returning to its slot on any event that gets the slot empty. In fact, `<import>` elements maintain a *live* relationship with the modules they point to and with the contents that go into their slot.
|
|
154
|
-
|
|
155
|
-
So, if we dynamically changed the module ID declaration above to point to another module, *imports* will be resolved again, this time, from the new module.
|
|
156
|
-
|
|
157
|
-
```js
|
|
158
|
-
// Changing the module ID on the DIV container above will see all associated imports resolved again
|
|
159
|
-
document.querySelector('div[template="module1"]').setAttribute('template', 'module2');
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
This opens up new simple ways to create very dynamic applications.
|
|
163
|
-
|
|
164
|
-
**Details are in the [HTML Imports](https://webqit.io/tooling/oohtml/docs/spec/html-imports) specification. Learn more about the convention, dynamicity, Slot Inheritance, isomorphic rendering, and the polyfill support.**
|
|
165
|
-
|
|
166
|
-
## Namespaced HTML
|
|
167
|
-
|
|
168
|
-
Namespacing provides a way to let an element establish its own naming context for descendant elements. This makes it possible to keep IDs scoped to a context other than the document's global scope; thus the ability to write collision-free IDs across a page.
|
|
169
|
-
|
|
170
|
-
The following modular markup implements its IDs in namespaces:
|
|
171
|
-
|
|
172
|
-
```html
|
|
173
|
-
<article id="continents" namespace>
|
|
174
|
-
<section id="europe" namespace>
|
|
175
|
-
<div id="about">About Europe</b></div>
|
|
176
|
-
<div id="countries">Countries in Europe</div>
|
|
177
|
-
</section>
|
|
178
|
-
<section id="asia" namespace>
|
|
179
|
-
<div id="about">About Asia</b></div>
|
|
180
|
-
<div id="countries">Countries in Asia</div>
|
|
181
|
-
</section>
|
|
182
|
-
</article>
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
The above gives us a conceptual model of repeating objects, each encapsulating its IDs:
|
|
186
|
-
|
|
187
|
-
```html
|
|
188
|
-
continents
|
|
189
|
-
├⏤europe
|
|
190
|
-
│ ├⏤about
|
|
191
|
-
│ ├⏤countries
|
|
192
|
-
├⏤asia
|
|
193
|
-
├⏤about
|
|
194
|
-
├⏤countries
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
And beyond the point of giving us collision-free IDs, *Namespaced HTML* features an API that translates namespace models into real object trees:
|
|
198
|
-
|
|
199
|
-
```js
|
|
200
|
-
// Get the "continents" article
|
|
201
|
-
let continents = document.namespace.continents;
|
|
202
|
-
|
|
203
|
-
// Access scoped IDs with the new "namespace" DOM property
|
|
204
|
-
let europe = continents.namespace.europe;
|
|
205
|
-
let asia = continents.namespace.asia;
|
|
206
|
-
|
|
207
|
-
// And for deeply-nested IDs...
|
|
208
|
-
let aboutAsia = continents.namespace.asia.namespace.about;
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
We get a document structure that translates to a bankable API for building great functionalities.
|
|
212
|
-
|
|
213
|
-
> Much of our code in the examples below will now use the `namespace` attribute in markup and the `.namespace` property in JavaScript.
|
|
214
|
-
|
|
215
|
-
**Details are in the [Namespaced HTML](https://webqit.io/tooling/oohtml/docs/spec/namespaced-html) specification. Learn more about the convention, Namespaced Selectors, API, observability, and the polyfill support.**
|
|
216
|
-
|
|
217
|
-
## The State API
|
|
218
|
-
|
|
219
|
-
The State API is a DOM API that lets us maintain application state at the document level and at individual element levels. It brings application state closer to the UI and makes it easy to keep the UI in sync with all the changes taking place.
|
|
220
|
-
|
|
221
|
-
This API exposes a document-level *state object* on a `document.state` property, and an element-level *state object* on an `element.state` property. Arbitrary values can be set and retrieved on *state objects* the same way we would with regular objects.
|
|
28
|
+
**_Use as an npm package:_**
|
|
222
29
|
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
document.state.pageTitle = 'Hello World!';
|
|
226
|
-
console.log(document.state.pageTitle); // Hello World!
|
|
227
|
-
|
|
228
|
-
// At the element level
|
|
229
|
-
element.state.collapsed = true;
|
|
230
|
-
console.log(element.state.collapsed); // true
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
But state objects are unique in that they support *observability*. They are *live objects* that can be observed for changes using the [Observer API](https://webqit.io/tooling/observer/docs/spec/the-observer-api).
|
|
234
|
-
|
|
235
|
-
```js
|
|
236
|
-
Observer.observe(document.state, 'pageTitle', e => {
|
|
237
|
-
console.log('New Page Title: ' + e.value);
|
|
238
|
-
// Or we could reflect this state on the document title element
|
|
239
|
-
document.querySelector('title').innerHTML = e.value;
|
|
240
|
-
});
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
This lets us build very reactive applications natively.
|
|
244
|
-
|
|
245
|
-
Using an element's state API, here's how we could make a *collapsible* component.
|
|
246
|
-
|
|
247
|
-
```html
|
|
248
|
-
<my-collapsible namespace>
|
|
249
|
-
<div id="control">Toggle Me</div>
|
|
250
|
-
<div id="content" style="height: 0px">
|
|
251
|
-
Some content
|
|
252
|
-
</div>
|
|
253
|
-
</my-collapsible>
|
|
30
|
+
```bash
|
|
31
|
+
npm i @webqit/oohtml@next
|
|
254
32
|
```
|
|
255
33
|
|
|
256
34
|
```js
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Creates the Shadow DOM
|
|
261
|
-
*/
|
|
262
|
-
constructor() {
|
|
263
|
-
super();
|
|
264
|
-
// Observe state and get the UI synced
|
|
265
|
-
Observer.observe(this.state, 'collapsed', e => {
|
|
266
|
-
this.namespace.content.style.height = e.value ? '0px' : 'auto';
|
|
267
|
-
this.setAttribute('data-collapsed', e.value ? 'true' : 'false');
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
// Implement the logic for toggling collapsion
|
|
271
|
-
this.namespace.control.addEventListener('click', function() {
|
|
272
|
-
this.state.collapsed = !this.state.collapsed;
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
});
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
Other parts of the application are also able to access the state of this element.
|
|
280
|
-
|
|
281
|
-
```js
|
|
282
|
-
let collapsible = document.querySelector('my-collapsible');
|
|
283
|
-
Observer.observe(collapsible.state, 'collapsed', e => {
|
|
284
|
-
console.log(e.value ? 'element collapsed' : 'element expanded');
|
|
285
|
-
});
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
**Details are in the [State API](https://webqit.io/tooling/oohtml/docs/spec/the-state-api) specification. Learn more about the API, deep observability, and the polyfill support.**
|
|
289
|
-
|
|
290
|
-
## Subscript
|
|
291
|
-
|
|
292
|
-
Subscript is a type of JavaScript runtime that lets us create scoped, *reactive* `<script>` elements across an HTML document. That gives us a UI binding language and the ability to write UI logic without involving actual JavaScript classes or files.
|
|
293
|
-
|
|
294
|
-
Subscript lets us write `<script>` elements that are scoped to their host elements instead of the global browser scope. Below is such a `<script>` element, being scoped to the `#alert` element - its host element:
|
|
295
|
-
|
|
296
|
-
```html
|
|
297
|
-
<div id="alert">
|
|
298
|
-
<script type="subscript">
|
|
299
|
-
console.log(this.id); // alert
|
|
300
|
-
</script>
|
|
301
|
-
</div>
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
The `this` variable within Subscript is a reference to the script's host element. In addition, variables declared within the script are available only within the script, and global variables are always available across all scripts.
|
|
305
|
-
|
|
306
|
-
```html
|
|
307
|
-
<div id="alert" namespace>
|
|
308
|
-
|
|
309
|
-
<div id="message"></div>
|
|
310
|
-
<div id="exit" title="Close this message.">X</div>
|
|
311
|
-
|
|
312
|
-
<script type="subscript">
|
|
313
|
-
this.namespace.exit.addEventListener('click', () => {
|
|
314
|
-
this.remove();
|
|
315
|
-
});
|
|
316
|
-
</script>
|
|
317
|
-
|
|
318
|
-
</div>
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
Below is how we could render something - a message - from the element's state object - `.state.message`.
|
|
322
|
-
|
|
323
|
-
```html
|
|
324
|
-
<body>
|
|
35
|
+
// Import
|
|
36
|
+
import init from '@webqit/oohtml';
|
|
325
37
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
<div id="message"></div>
|
|
329
|
-
<div id="exit" title="Close this message.">X</div>
|
|
330
|
-
|
|
331
|
-
<script type="subscript">
|
|
332
|
-
// Render the "message" property from the element's state object
|
|
333
|
-
|
|
334
|
-
this.namespace.message.innerHTML = this.state.message;
|
|
335
|
-
this.namespace.exit.addEventListener('click', () => {
|
|
336
|
-
this.remove();
|
|
337
|
-
});
|
|
338
|
-
</script>
|
|
339
|
-
|
|
340
|
-
</div>
|
|
341
|
-
|
|
342
|
-
<body>
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
But the best part yet is Subscript's reactivity! While Subscript works like regular JavaScript, it is also able to observe changes in its scope and respond to them. And it does this at the granular statement level such that a given statement is evaluated again (independently of other statements in the script) whenever any of the observable references used in the statement experiences a change.
|
|
346
|
-
|
|
347
|
-
Below, changing the observable reference`.state.message` will trigger that particular statement in the script above to run again.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
```js
|
|
352
|
-
let alertElement = document.querySelector('#alert');
|
|
353
|
-
alertElement.state.message = 'Task started!';
|
|
354
|
-
setTimeout(() => {
|
|
355
|
-
alertElement.state.message = 'Task complete!';
|
|
356
|
-
}, 1000);
|
|
38
|
+
// Initialize the lib
|
|
39
|
+
init.call( window[, options = {} ]);
|
|
357
40
|
```
|
|
358
41
|
|
|
359
|
-
|
|
42
|
+
**_Use as a script:_**
|
|
360
43
|
|
|
361
44
|
```html
|
|
362
|
-
<
|
|
363
|
-
|
|
364
|
-
<div id="control">Toggle Me</div>
|
|
365
|
-
<div id="content" style="height: 0px">
|
|
366
|
-
Some content
|
|
367
|
-
</div>
|
|
368
|
-
|
|
369
|
-
<script type="subscript">
|
|
370
|
-
// Observe state and get the UI synced, without requiring Observer.observe() here...
|
|
371
|
-
|
|
372
|
-
this.setAttribute('data-collapsed', this.state.collapsed ? 'true' : 'false');
|
|
373
|
-
this.namespace.content.style.height = this.state.collapsed ? '0px' : 'auto';
|
|
374
|
-
this.namespace.control.addEventListener('click', () => {
|
|
375
|
-
// Toggle collapsion state
|
|
376
|
-
this.state.collapsed = !this.state.collapsed;
|
|
377
|
-
});
|
|
378
|
-
</script>
|
|
379
|
-
|
|
380
|
-
</div>
|
|
45
|
+
<script src="https://unpkg.com/@webqit/oohtml@next/dist/main.js"></script>
|
|
381
46
|
```
|
|
382
47
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
## Getting Started
|
|
386
|
-
|
|
387
|
-
[Go to project homepage](https://webqit.io/tooling/oohtml).
|
|
388
|
-
|
|
389
|
-
You definitely want to visit the documentation for each of OOHTML's features and try everything out by pasting the code examples and running them right in your browser. Simply include the [OOHTML polyfill](https://webqit.io/tooling/oohtml/docs/getting-started/polyfill) on your page and get away with writing modular, reusable, reactive HTML without a tool!
|
|
48
|
+
## Documentaion
|
|
390
49
|
|
|
391
|
-
|
|
50
|
+
> *Full documentaion underway*
|
|
392
51
|
|
|
393
52
|
## Issues
|
|
394
53
|
|
package/dist/bindings-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var Gt=Object.defineProperty;var at=(t,e)=>{for(var n in e)Gt(t,n,{get:e[n],enumerable:!0})};var Ze={};at(Ze,{apply:()=>Qe,batch:()=>dr,construct:()=>Je,deep:()=>lr,defineProperties:()=>hr,defineProperty:()=>Ge,deleteProperty:()=>We,get:()=>X,getOwnPropertyDescriptor:()=>ke,getOwnPropertyDescriptors:()=>pr,getPrototypeOf:()=>Ue,has:()=>ve,intercept:()=>ar,isExtensible:()=>ze,observe:()=>mr,ownKeys:()=>be,preventExtensions:()=>Ye,set:()=>re,setPrototypeOf:()=>Xe});function E(t){return!Array.isArray(t)&&typeof t=="object"&&t}function te(t){return typeof t}function q(t){return Array.isArray(t)}function Me(t,e,n=null){return q(e)?t.filter(r=>n?e.filter(o=>n(r,o)).length:e.indexOf(r)!==-1):[]}function xe(t,...e){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new se}),!arguments.length)return globalThis.webqit.refs;let n=globalThis.webqit.refs.get(t);n||(n=new se,globalThis.webqit.refs.set(t,n));let r,o;for(;r=e.shift();)(o=n)&&!(n=n.get(r))&&(n=new se,o.set(r,n));return n}var se=class extends Map{constructor(...e){super(...e),this.observers=new Set}set(e,n){let r=super.set(e,n);return this.fire("set",e,n,e),r}delete(e){let n=super.delete(e);return this.fire("delete",e),n}has(e){return this.fire("has",e),super.has(e)}get(e){return this.fire("get",e),super.get(e)}keyNames(){return Array.from(super.keys())}observe(e,n,r){let o={type:e,key:n,callback:r};return this.observers.add(o),()=>this.observers.delete(o)}unobserve(e,n,r){if(Array.isArray(e)||Array.isArray(n))throw new Error('The "type" and "key" arguments can only be strings.');for(let o of this.observers)!(ye([e,"*"],o.type)&&ye([n,"*"],o.key)&&o.callback===r)||this.observers.delete(o)}fire(e,n,...r){for(let o of this.observers)!(ye([e,"*"],o.type)&&ye([n,"*"],o.key))||o.callback(...r)}},ye=(t,e)=>Array.isArray(e)?Me(t,e).length:t.includes(e);function G(t){return typeof t=="function"}function je(t){return G(t)&&/^class\s?/.test(Function.prototype.toString.call(t))}function Le(t){return t===null||t===""}function W(t){return arguments.length&&(t===void 0||typeof t>"u")}function F(t){return Array.isArray(t)||typeof t=="object"&&t||G(t)}function He(t){return Le(t)||W(t)||t===!1||t===0||F(t)&&!Object.keys(t).length}function N(t){return G(t)||t&&{}.toString.call(t)==="[object function]"}function we(t){return t instanceof String||typeof t=="string"&&t!==null}function De(t){return!we(t)&&!W(t.length)}function U(t,e=!0){return q(t)?t:!e&&E(t)?[t]:t!==!1&&t!==0&&He(t)?[]:De(t)?Array.prototype.slice.call(t):E(t)?Object.values(t):[t]}var J=class{constructor(e,n){this.registry=e,Object.assign(this,{...n,target:e.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var ue=class extends J{constructor(){super(...arguments),Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal})}remove(){this.abortController.abort(),super.remove()}fire(e){let n=e,r=this.filter;if(r!==1/0&&(r=U(r))&&(n=e.filter(o=>r.includes(o.key))),this.params.diff&&(n=n.filter(o=>o.type!=="set"||o.value!==o.oldValue)),n.length)return this.filter===1/0||Array.isArray(this.filter)?this.handler(n,this):this.handler(n[0],this)}};var A=(...t)=>xe("observer-api",...t);var Q=class{constructor(e){this.target=e,this.entries=[]}addRegistration(e){return this.entries.push(e),e}removeRegistration(e){this.entries=this.entries.filter(n=>n!==e)}static _getInstance(e,n,r=!0,o=this.__namespace){if(!F(n))throw new Error(`Subject must be of type object; "${te(n)}" given!`);let i=this;return o&&A("namespaces").has(e+"-"+o)&&(i=A("namespaces").get(e+"-"+o),e+="-"+o),!A(n,"registry").has(e)&&r&&A(n,"registry").set(e,new i(n)),A(n,"registry").get(e)}static _namespace(e,n,r=null){if(e+="-"+n,arguments.length===2)return A("namespaces").get(e);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${n} must be a subclass of ${this.name}.`);A("namespaces").set(e,r),r.__namespace=n}};var z=class extends Q{static getInstance(e,n=!0,r=null){return super._getInstance("listeners",...arguments)}static namespace(e,n=null){return super._namespace("listeners",...arguments)}constructor(e){super(e),this.batches=[]}addRegistration(e,n,r){return super.addRegistration(new ue(this,{filter:e,handler:n,params:r}))}emit(e){if(this.batches.length){this.batches[0].events.push(...e);return}this.entries.forEach(n=>n.fire(e))}batch(e){this.batches.unshift({entries:[...this.entries],events:[]});let n=e(),r=this.batches.shift();return r.events.length&&r.entries.forEach(o=>o.fire(r.events)),n}};var ce=class extends J{exec(e,n,r){return this.running||!this.traps[e.type]?n(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[e.type](e,r,(...o)=>(this.running=!1,n(...o))))}};var R=class extends Q{static getInstance(e,n=!0,r=null){return super._getInstance("traps",...arguments)}static namespace(e,n=null){return super._namespace("traps",...arguments)}addRegistration(e){return super.addRegistration(new ce(this,e))}emit(e,n=null){let r=this;return function o(i,...f){let l=r.entries[i];return l?l.exec(e,(...s)=>o(i+1,...s),...f):n?n(e,...f):f[0]}(0)}};var M=class{constructor(e,n){if(this.target=e,!n.type)throw new Error("Descriptor type must be given in definition!");Object.assign(this,n)}};var Ve={};at(Ve,{accessorize:()=>sr,proxy:()=>cr,unaccessorize:()=>ur,unproxy:()=>Oe});function sr(t,e,n={}){t=$e(t);let r=A(t,"accessorizedProps");function o(s){let c,u=t;for(;!c&&(u=Object.getPrototypeOf(u));)c=Object.getOwnPropertyDescriptor(u,s);return c?{proto:u,descriptor:c}:{descriptor:{value:void 0}}}function i(s){if(r.has(s))return!0;let c=o(s);c.getValue=function(){return"get"in this.descriptor?this.descriptor.get():this.descriptor.value},c.setValue=function(g){return"set"in this.descriptor?this.descriptor.set(g):this.descriptor.value=g},c.intact=function(){let g=Object.getOwnPropertyDescriptor(t,s);return g.get===h.get&&g.set===h.set&&r.get(s)===this},c.restore=function(){return this.intact()?(this.proto!==t?delete t[s]:Object.defineProperty(t,s,this.descriptor),r.delete(s),!0):!1},r.set(s,c);let{enumerable:u=!0,configurable:m=!0}=c.descriptor,h={enumerable:u,configurable:m};["value","set"].some(g=>g in c.descriptor)&&(h.set=function(g){return re(this,s,g,n)}),["value","get"].some(g=>g in c.descriptor)&&(h.get=function(){return X(this,s,n)});try{return Object.defineProperty(t,s,h),!0}catch{return r.delete(s),!1}}let l=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(i);return e===void 0||Array.isArray(e)?l:l[0]}function ur(t,e,n={}){t=$e(t);let r=A(t,"accessorizedProps");function o(l){return r.has(l)?r.get(l).restore():!0}let f=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(o);return e===void 0||Array.isArray(e)?f:f[0]}function cr(t,e={}){t=$e(t);let n=new Proxy(t,{apply:(r,o,i)=>Qe(r,o,i,e),construct:(r,o,i=null)=>Je(r,o,i,e),defineProperty:(r,o,i)=>Ge(r,o,i,e),deleteProperty:(r,o)=>We(r,o,e),get:(r,o,i=null)=>{let f=X(r,o,{...e,receiver:i});return e.proxyAutoBinding!==!1&&N(f)&&!je(f)?f.bind(n):f},getOwnPropertyDescriptor:(r,o)=>ke(r,o,e),getPrototypeOf:r=>Ue(r,e),has:(r,o)=>ve(r,o,e),isExtensible:r=>ze(r,e),ownKeys:r=>be(r,e),preventExtensions:r=>Ye(r,e),set:(r,o,i,f=null)=>re(r,o,i,{...e,receiver:f}),setPrototypeOf:(r,o)=>Xe(r,o,e)});return A(n).set(n,t),n}function Oe(t){return A(t).get(t)||t}function $e(t){if(!t||!F(t))throw new Error("Target must be of type object!");return Oe(t)}function lr(t,e,n,r=i=>i,o={}){return function i(f,l,s){let c=l[s.level];return s.level<l.length-1?s={...s,preflight:!0}:s={...s,preflight:o.preflight},n(f,c,(u,...m)=>{let h=(d={})=>({...s,...d,level:s.level+1}),g=d=>{d instanceof M&&(d.path=[d.key],f instanceof M&&(d.path=f.path.concat(d.key),d.context=f))};if(Ae(c)&&Array.isArray(u))return u.forEach(g),s.level===l.length-1||!u.length&&s.midwayResults?r(u,...m):u.map(d=>i(d,l,h(...m)));g(u);let a=F(Y(u,!1));return s.level===l.length-1||!a&&s.midwayResults?r(u,...m):a&&i(u,l,h(...m))},s)}(t,e.slice(0),{...o,level:0})}function mr(t,e,n,r={}){if(t=Y(t),N(arguments[1])&&([,n,r={}]=arguments,e=1/0),!N(n))throw new Error(`Handler must be a function; "${te(n)}" given!`);let o=yt(t,e,n,r);return r.preflight?(r={...r,descripted:!0},delete r.live,X(t,e,o,r)):o()}function ar(t,e,n={}){return t=Y(t),E(e)||([,,,n={}]=arguments,e={[arguments[1]]:arguments[2]}),R.getInstance(t,!0,n.namespace).addRegistration({traps:e,params:n})}function ke(t,e,n=o=>o,r={}){return L(t,"getOwnPropertyDescriptor",{key:e},n,r)}function pr(t,e,n=o=>o,r={}){return L(t,"getOwnPropertyDescriptors",{key:e},n,r)}function Ue(t,e=r=>r,n={}){return L(t,"getPrototypeOf",{},e,n)}function ze(t,e=r=>r,n={}){return L(t,"isExtensible",{},e,n)}function be(t,e=r=>r,n={}){return L(t,"ownKeys",{},e,n)}function ve(t,e,n=o=>o,r={}){return L(t,"has",{key:e},n,r)}function X(t,e,n=o=>o,r={}){let o;return t=Y(t),E(n)?[r,n]=[n,i=>i]:r.live&&(o=!0),gr(t,e,i=>{let f=[...i];return function l(s,c,u){if(!c.length)return u(s);let m=c.shift();function h(d,p=void 0){let _=T=>(d.value=T,l(s.concat(r.live||r.descripted?d:T),c,u));if(arguments.length>1)return _(p);let x=A(t,"accessorizedProps",!1),O=x&&x.get(d.key);return O&&O.intact()?_(O.getValue()):_(Reflect.get(t,d.key,...r.receiver?[r.receiver]:[]))}let g=new M(t,{type:"get",key:m,value:void 0,related:f}),a=R.getInstance(t,!1,r.namespace);return a?a.emit(g,h):h(g)}([],i.slice(0),l=>{let s=Ae(e)?l:l[0];return o?yt(t,e,n,r)(s):n(s)})})}function dr(t,e,n={}){return z.getInstance(t,!0,n.namespace).batch(e)}function re(t,e,n,r=f=>f,o={},i=!1){t=Y(t);let f=[[e,n]];E(e)&&([,,r=s=>s,o={},i=!1]=arguments,f=Object.entries(e)),E(r)&&([i,o,r]=[typeof o=="boolean"?o:!1,r,s=>s]);let l=f.map(([s])=>s);return function s(c,u,m){if(!u.length)return m(c);let[h,g]=u.shift();function a(p,_=void 0){let x=ee=>(p.status=ee,s(c.concat(p),u,m));if(arguments.length>1)return x(p,_);let O=A(t,"accessorizedProps",!1),T=O&&O.get(p.key);return p.type==="defineProperty"?(T&&!T.restore()&&x(!1),Object.defineProperty(t,p.key,p.value),x(!0)):T&&T.intact()?x(T.setValue(p.value)):x(Reflect.set(t,p.key,p.value))}function d(p,_){if(o.diff&&g===_)return s(c,u,m);let x=new M(t,{type:i?"defineProperty":"set",key:h,value:g,isUpdate:p,oldValue:_,related:[...l],detail:o.detail}),O=R.getInstance(t,!1,o.namespace);return O?O.emit(x,a):a(x)}return ve(t,h,p=>p?X(t,h,_=>d(p,_),o):d(p),o)}([],f.slice(0),s=>{let c=z.getInstance(t,!1,o.namespace);return c&&c.emit(s),r(Ae(e)?s.map(u=>u.status):s[0]?.status)})}function Ge(t,e,n,r=i=>i,o={}){return re(t,e,n,r,o,!0)}function hr(t,e,n=o=>o,r={}){return re(t,e,n,r,!0)}function We(t,e,n=o=>o,r={}){t=Y(t),E(n)&&([r,n]=[n,f=>f]);let o=U(e),i=[...o];return function f(l,s,c){if(!s.length)return c(l);let u=s.shift();function m(g,a=void 0){let d=x=>(g.status=x,f(l.concat(g),s,c));if(arguments.length>1)return d(g,a);let p=A(t,"accessorizedProps",!1),_=p&&p.get(g.key);return _&&!_.restore()&&d(!1),d(Reflect.deleteProperty(t,g.key))}function h(g){let a=new M(t,{type:"deleteProperty",key:u,oldValue:g,related:[...i],detail:r.detail}),d=R.getInstance(t,!1,r.namespace);return d?d.emit(a,m):m(a)}return X(t,u,h,r)}([],o.slice(0),f=>{let l=z.getInstance(t,!1,r.namespace);return l&&l.emit(f),n(Ae(e)?f.map(s=>s.status):f[0].status)})}function Je(t,e,n=null,r=i=>i,o={}){return L(t,"construct",arguments.length>2?{argumentsList:e,newTarget:n}:{argumentsList:e},r,o)}function Qe(t,e,n,r=i=>i,o={}){return L(t,"apply",{thisArgument:e,argumentsList:n},r,o)}function Xe(t,e,n=o=>o,r={}){return L(t,"setPrototypeOf",{proto:e},n,r)}function Ye(t,e=r=>r,n={}){return L(t,"preventExtensions",{},e,n)}function yt(t,e,n,r={}){let o;r.signal||(o=new AbortController,r={...r,signal:o.signal});let i=z.getInstance(t,!0,r.namespace);return function f(l,s=null){s?.remove();let u={signal:i.addRegistration(e,f,r).signal};return arguments.length&&n(l,u),o}}function L(t,e,n={},r=i=>i,o={}){t=Y(t),E(r)&&([o,r]=[r,s=>s]);function i(s,c){return arguments.length>1?r(c):r(Reflect[e](t,...Object.values(n)))}let f=new M(t,{type:e,...n}),l=R.getInstance(t,!1,o.namespace);return l?l.emit(f,i):i(f)}function Ae(t){return t===1/0||Array.isArray(t)}function Y(t,e=!0){if((!t||!F(t))&&e)throw new Error(`Object must be of type object or array! "${te(t)}" given.`);return t instanceof M&&(t=t.value),t&&Oe(t)}function gr(t,e,n){return e===1/0?be(t,n):n(U(e))}var _r={...Ze,...Ve},B=_r;function b(t){return!Array.isArray(t)&&typeof t=="object"&&t}function w(t){return Array.isArray(t)}function Ke(t,e,n=null){return w(e)?t.filter(r=>n?e.filter(o=>n(r,o)).length:e.indexOf(r)!==-1):[]}function Ee(t,...e){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new le}),!arguments.length)return globalThis.webqit.refs;let n=globalThis.webqit.refs.get(t);n||(n=new le,globalThis.webqit.refs.set(t,n));let r,o;for(;r=e.shift();)(o=n)&&!(n=n.get(r))&&(n=new le,o.set(r,n));return n}var le=class extends Map{constructor(...e){super(...e),this.observers=new Set}set(e,n){let r=super.set(e,n);return this.fire("set",e,n,e),r}delete(e){let n=super.delete(e);return this.fire("delete",e),n}has(e){return this.fire("has",e),super.has(e)}get(e){return this.fire("get",e),super.get(e)}keyNames(){return Array.from(super.keys())}observe(e,n,r){let o={type:e,key:n,callback:r};return this.observers.add(o),()=>this.observers.delete(o)}unobserve(e,n,r){if(Array.isArray(e)||Array.isArray(n))throw new Error('The "type" and "key" arguments can only be strings.');for(let o of this.observers)!(Te([e,"*"],o.type)&&Te([n,"*"],o.key)&&o.callback===r)||this.observers.delete(o)}fire(e,n,...r){for(let o of this.observers)!(Te([e,"*"],o.type)&&Te([n,"*"],o.key))||o.callback(...r)}},Te=(t,e)=>Array.isArray(e)?Ke(t,e).length:t.includes(e);function ne(t){return typeof t=="function"}function me(t){return t===null||t===""}function $(t){return arguments.length&&(t===void 0||typeof t>"u")}function C(t){return Array.isArray(t)||typeof t=="object"&&t||ne(t)}function et(t){return me(t)||$(t)||t===!1||t===0||C(t)&&!Object.keys(t).length}function v(t){return ne(t)||t&&{}.toString.call(t)==="[object function]"}function ae(t){return t instanceof Number||typeof t=="number"}function H(t){return ae(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function Pe(t){return t instanceof String||typeof t=="string"&&t!==null}function tt(t){return!Pe(t)&&!$(t.length)}function P(t,e=!0){return w(t)?t:!e&&b(t)?[t]:t!==!1&&t!==0&&et(t)?[]:tt(t)?Array.prototype.slice.call(t):b(t)?Object.values(t):[t]}function pe(t,e,n={},r={}){e=P(e).slice();for(var o=t;!$(o)&&!me(o)&&e.length;){var i=e.shift();if(!(n.get?n.get(o,i):C(o)?i in o:o[i])){r.exists=!1;return}o=n.get?n.get(o,i):o[i]}return r.exists=!0,o}function nt(t,e,n,r={},o={}){let i=(u,m,h)=>o.set?o.set(u,m,h):(H(e[l])&&w(u)?u.push(h):u[m]=h,!0);e=P(e);for(var f=t,l=0;l<e.length;l++)if(l<e.length-1){if(!f||!C(f)&&!v(f))return!1;var s=pe(f,e[l],o);if(!C(s)){if(o.buildTree===!1)return!1;s=v(o.buildTree)?o.buildTree(l):H(e[l+1])?[]:{};var c=i(f,e[l],s);if(!c)return!1}f=s}else return i(f,e[l],n)}var Tt=t=>class{constructor(n=!0){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),this.async=n,this.window.requestAnimationFrame?this._run():this.async=!1}_run(){this.window.requestAnimationFrame(()=>{this.readCallbacks.forEach(n=>{n()||this.readCallbacks.delete(n)}),this.writeCallbacks.forEach(n=>{n()||this.writeCallbacks.delete(n)}),this._run()})}onread(n,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?n(o,i):this.readCallbacks.add(()=>{n(o,i)})});this.async===!1?n():this.readCallbacks.add(n)}onwrite(n,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?n(o,i):this.writeCallbacks.add(()=>{n(o,i)})});this.async===!1?n():this.writeCallbacks.add(n)}cycle(n,r,o){this.onread(()=>{let i=n(o),f=l=>{l!==void 0&&this.onwrite(()=>{let s=r(l,o),c=u=>{u!==void 0&&this.cycle(n,r,u)};s instanceof Promise?s.then(c):c(s)})};i instanceof Promise?i.then(f):f(i)})}};var Z=class{constructor(e,n,r){this.context=e,this.namespace=n,this.window=e.defaultView||e.ownerDocument?.defaultView||r,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(e){return v(e[0])?e=[[],...e]:b(e[0])&&e.length===1?e=[[],void 0,e[0]]:b(e[1])&&e.length===2?e=[P(e[0],!1),void 0,e[1]]:e[0]=P(e[0],!1),e}registry(...e){return Ee("dom.realtime",this.window,this.namespace,...e)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(e,n,r){let{window:o}=this,i=Array.isArray(n)?n:[n],f=new Set;for(let[l,s]of this.registry(e))for(let[c,u]of s){let m=i.filter(h=>c.contains(h.target)?l==="subtree"||h.target===c:!1);if(!!m.length){Array.isArray(n)||(m=m[0]);for(let h of u)f.add([h,m,c])}}for(let[l,s,c]of f)r.call(this,l,s,c)}disconnectables(e,...n){let r={disconnect(){n.forEach(o=>o&&v(o.disconnect)&&o.disconnect()||v(o)&&o()||b(o)&&(o.disconnected=!0))}};return e&&e.addEventListener("abort",()=>r.disconnect()),r}};var V=class extends Z{constructor(e,...n){super(e,"attr",...n)}get(e,n=void 0,r={}){let o=typeof e=="string";[e=[],n=void 0,r={}]=this.resolveArgs(arguments);let{context:i}=this,f=qt(i,e),l=o?f[0]:f;if(!n)return l;let s=n&&r.lifecycleSignals&&this.createSignalGenerator(),c=s?.generate()||{};if(n(l,c,i),r.live){s&&(r={...r,signalGenerator:s});let u=this.observe(o?e[0]:e,n,{newValue:!0,...r});return this.disconnectables(r.signal,u)}}observe(e,n,r={}){let o=typeof e=="string";if([e=[],n,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(o?e[0]:e,n,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:i,window:f,webqit:l}=this;r.eventDetails&&!l.dom.attrInterceptionHooks?.intercepting&&St.call(f,"intercept",()=>{});let s=new f.MutationObserver(h=>{h=It(h).map(g=>Ft.call(f,g)),Ct.call(f,m,h,i)}),c={attributes:!0,attributeOldValue:r.oldValue,subtree:r.subtree};e.length&&(c.attributeFilter=e),s.observe(i,c);let u=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),m={context:i,filter:e,callback:n,params:r,atomics:new Map,originalFilterIsString:o,signalGenerator:u,disconnectable:s};return this.disconnectables(r.signal,s,u)}observeSync(e,n,r={}){let o=typeof e=="string";[e,n,r={}]=this.resolveArgs(arguments);let{context:i,window:f}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let l=r.timing==="intercept"?"intercept":"sync",s=r.subtree?"subtree":"children";this.registry(l).size||St.call(f,l,a=>{this.forEachMatchingContext(l,a,Ct)});let c={disconnect(){g.delete(m),g.size||h.delete(i)}},u=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),m={context:i,filter:e,callback:n,params:r,atomics:new Map,originalFilterIsString:o,signalGenerator:u,disconnectable:c},h=this.registry(l,s);h.has(i)||h.set(i,new Set);let g=h.get(i);return g.add(m),this.disconnectables(r.signal,c,u)}};function It(t){return t.reduce((e,n,r)=>e[r-1]?.attributeName===n.attributeName?e:e.concat(n),[])}function Ct(t,e){let{context:n,filter:r,callback:o,params:i,atomics:f,originalFilterIsString:l,signalGenerator:s}=t;i.atomic&&!f.size&&(e=qt(n,r,e)),i.newValue===null&&i.oldValue===null||(e=e.map(m=>{let h;return!i.oldValue&&"oldValue"in m&&({oldValue:h,...m}=m),!i.newValue&&"value"in m?{value:h,...m}=m:i.newValue&&typeof m.value>"u"&&(m={...m,value:m.target.getAttribute(m.name)}),m})),i.atomic&&(e.forEach(m=>f.set(m.name,m)),e=Array.from(f.entries()).map(([,m])=>m));let c=l?e[0]:e,u=s?.generate()||{};o(c,u,n)}function qt(t,e,n=[]){let r={event:null,type:"attribute"};return e.length?e.map(i=>n.find(f=>f.name===i)||{target:t,name:i,value:t.getAttribute(i),...r}):Array.from(t.attributes).map(i=>n.find(f=>f.name===i.nodeName)||{target:t,name:i.nodeName,value:i.nodeValue,...r})}function Ft({target:t,attributeName:e,value:n,oldValue:r}){let f=(this.webqit.dom.attrInterceptionRecords?.get(t)||{})[e]||"mutation";return{target:t,name:e,value:n,oldValue:r,type:"observation",event:f}}function St(t,e){let n=this,{webqit:r,document:o,Element:i}=n;r.dom.attrInterceptionHooks||Object.defineProperty(r.dom,"attrInterceptionHooks",{value:new Map}),r.dom.attrInterceptionHooks.has(t)||r.dom.attrInterceptionHooks.set(t,new Set),r.dom.attrInterceptionHooks.get(t).add(e);let f=()=>r.dom.attrInterceptionHooks.get(t).delete(e);if(r.dom.attrInterceptionHooks?.intercepting)return f;console.warn("Attr mutation APIs are now being intercepted."),r.dom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(r.dom,"attrInterceptionRecords",{value:new Map});let l=(u,m)=>{r.dom.attrInterceptionRecords.has(u.target)||r.dom.attrInterceptionRecords.set(u.target,{});let h=r.dom.attrInterceptionRecords.get(u.target);clearTimeout(h[u.name]?.timeout),h[u.name]=u.event;let g=setTimeout(()=>{delete h[u.name]},0);Object.defineProperty(u.event,"timeout",{value:g,configurable:!0}),r.dom.attrInterceptionHooks.get("intercept")?.forEach(d=>d([u]));let a=m();return r.dom.attrInterceptionHooks.get("sync")?.forEach(d=>d([u])),a};new n.MutationObserver(u=>{u=It(u).map(m=>Ft.call(n,m)).filter((m,h)=>!Array.isArray(m.event)),u.length&&(r.dom.attrInterceptionHooks.get("intercept")?.forEach(m=>m(u)),r.dom.attrInterceptionHooks.get("sync")?.forEach(m=>m(u)))}).observe(o,{attributes:!0,subtree:!0,attributeOldValue:!0});let c=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(u=>{c[u]=i.prototype[u],i.prototype[u]=function(...m){let h,g=this.getAttribute(m[0]);["setAttribute","toggleAttribute"].includes(u)&&(h=m[1]),u==="toggleAttribute"&&h===void 0&&(h=g===null);let a={target:this,name:m[0],value:h,oldValue:g,type:"interception",event:[this,u]};return l(a,()=>c[u].call(this,...m))}}),f}var ie=class extends Z{constructor(e,...n){super(e,"tree",...n)}attr(e,n=void 0,r={}){let{context:o,window:i}=this;return new V(o,i).get(...arguments)}query(e,n=void 0,r={}){[e,n=void 0,r={}]=this.resolveArgs(arguments);let{context:o}=this,i=new Map,f=c=>(i.has(c)||i.set(c,{target:c,entrants:[],exits:[],type:"query",event:null}),i.get(c));if((!r.generation||r.generation==="entrants")&&(e.length?e.every(c=>typeof c=="string")&&(e=e.join(","))&&(r.subtree?o.querySelectorAll(e):[...o.children].filter(u=>u.matches(e))).forEach(u=>f(u.parentNode||o).entrants.push(u)):[...o.children].forEach(c=>f(o).entrants.push(c))),!n)return i;let l={disconnected:!1},s=n&&r.lifecycleSignals&&this.createSignalGenerator();for(let[,c]of i){if(l.disconnected)break;let u=s?.generate()||{};n(c,u,o)}if(r.live){s&&(r={...r,signalGenerator:s});let c=this.observe(e,n,r);return this.disconnectables(r.signal,l,c)}return this.disconnectables(r.signal,l,s)}children(e,n=void 0,r={}){return[e,n=void 0,r={}]=this.resolveArgs(arguments),this.query(e,n,{...r,subtree:!1})}subtree(e,n=void 0,r={}){return[e,n=void 0,r={}]=this.resolveArgs(arguments),this.query(e,n,{...r,subtree:!0})}observe(e,n,r={}){if([e,n,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(e,n,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:o,window:i,webqit:f,document:l}=this;r.eventDetails&&(f.dom.domInterceptionRecordsAlwaysOn=!0),(l.readyState==="loading"||f.dom.domInterceptionRecordsAlwaysOn)&&!f.dom.domInterceptionHooks?.intercepting&&jt.call(i,"sync",()=>{});let s=new i.MutationObserver(m=>m.forEach(h=>{Mt.call(i,u,Lt.call(i,h),o)}));s.observe(o,{childList:!0,subtree:r.subtree});let c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),u={context:o,selectors:e,callback:n,params:r,signalGenerator:c,disconnectable:s};if(r.staticSensitivity){let m=Nt.call(i,u);return this.disconnectables(r.signal,s,c,m)}return this.disconnectables(r.signal,s,c)}observeSync(e,n,r={}){[e,n,r={}]=this.resolveArgs(arguments);let{context:o,window:i}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let f=r.timing==="intercept"?"intercept":"sync",l=r.subtree?"subtree":"children";this.registry(f).size||jt.call(i,f,g=>{this.forEachMatchingContext(f,g,Mt)});let s={disconnect(){h.delete(u),h.size||m.delete(o)}},c=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),u={context:o,selectors:e,callback:n,params:r,signalGenerator:c,disconnectable:s},m=this.registry(f,l);m.has(o)||m.set(o,new Set);let h=m.get(o);if(h.add(u),r.staticSensitivity){let g=Nt.call(i,u);return this.disconnectables(r.signal,s,c,g)}return this.disconnectables(r.signal,s,c)}};function Nt(t){let e=this,{context:n,selectors:r,callback:o,params:i,signalGenerator:f}=t,l=u=>[...u.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(m=>m[1]);if(!(t.$attrs=r.filter(u=>typeof u=="string"&&u.includes("[")).reduce((u,m)=>u.concat(l(m)),[])).length)return;let s=new Set,c=new Set;return s.push=u=>(c.delete(u),s.add(u)),c.push=u=>(s.delete(u),c.add(u)),t.$deliveryCache={entrants:s,exits:c},new V(n,e).observe(t.$attrs,u=>{let m=new Map,h=d=>(m.has(d)||m.set(d,{target:d,entrants:[],exits:[],type:"static",event:null}),m.get(d)),g=new WeakMap,a=d=>(g.has(d)||g.set(d,r.some(p=>d.matches(p))),g.get(d));for(let d of u)["entrants","exits"].forEach(p=>{i.generation&&p!==i.generation||t.$deliveryCache[p].has(d.target)||(p==="entrants"?!a(d.target):a(d.target))||(t.$deliveryCache[p].push(d.target),h(d.target)[p].push(d.target),h(d.target).event=d.event)});for(let[,d]of m){let p=f?.generate()||{};o(d,p,n)}},{subtree:i.subtree,timing:i.timing,eventDetails:i.eventDetails})}function Mt(t,e){let{context:n,selectors:r,callback:o,params:i,signalGenerator:f,$deliveryCache:l}=t,s={...e,entrants:[],exits:[]};if(["entrants","exits"].forEach(u=>{if(!(i.generation&&u!==i.generation)&&(r.length?s[u]=Mr(r,e[u],e.event!=="parse"):s[u]=[...e[u]],!!l))for(let m of s[u])l[u].push(m)}),!s.entrants.length&&!s.exits.length)return;let c=f?.generate()||{};o(s,c,n)}function Mr(t,e,n){e=Array.isArray(e)?e:[...e];let r=(o,i)=>{if(o=o.filter(f=>f.matches),typeof i=="string"){let f=o.filter(l=>l.matches(i));if(n&&(f=o.reduce((l,s)=>[...l,...s.querySelectorAll(i)],f)),f.length)return f}else if(o.includes(i)||n&&o.some(f=>f.contains(i)))return[i]};return e.$$searchCache||(e.$$searchCache=new Map),t.reduce((o,i)=>{let f;return e.$$searchCache.has(i)?f=e.$$searchCache.get(i):(f=r(e,i)||[],b(i)&&e.$$searchCache.set(i,f)),o.concat(f)},[])}function Lt({target:t,addedNodes:e,removedNodes:n}){let r=this,o;return o=P(e).reduce((i,f)=>i||r.webqit.dom.domInterceptionRecords?.get(f),null),o=P(n).reduce((i,f)=>i||r.webqit.dom.domInterceptionRecords?.get(f),o),o=o||r.document.readyState==="loading"&&"parse"||"mutation",{target:t,entrants:e,exits:n,type:"observation",event:o}}function jt(t,e){let n=this,{webqit:r,document:o,Node:i,Element:f,HTMLElement:l,HTMLTemplateElement:s,DocumentFragment:c}=n;r.dom.domInterceptionHooks||Object.defineProperty(r.dom,"domInterceptionHooks",{value:new Map}),r.dom.domInterceptionHooks.has(t)||r.dom.domInterceptionHooks.set(t,new Set),r.dom.domInterceptionHooks.get(t).add(e);let u=()=>r.dom.domInterceptionHooks.get(t).delete(e);if(r.dom.domInterceptionHooks?.intercepting)return u;console.warn("DOM mutation APIs are now being intercepted."),r.dom.domInterceptionHooks.intercepting=!0,Object.defineProperty(r.dom,"domInterceptionRecords",{value:new Map});let m=()=>!0,h=(a,d)=>{m()?a.entrants.concat(a.exits).forEach(_=>{clearTimeout(r.dom.domInterceptionRecords.get(_)?.timeout),r.dom.domInterceptionRecords.set(_,a.event);let x=setTimeout(()=>{r.dom.domInterceptionRecords.delete(_)},0);Object.defineProperty(a.event,"timeout",{value:x,configurable:!0})}):r.dom.domInterceptionRecords.clear(),r.dom.domInterceptionHooks.get("intercept")?.forEach(_=>_(a));let p=d();return r.dom.domInterceptionHooks.get("sync")?.forEach(_=>_(a)),p};if(m()){let a=new n.MutationObserver(d=>d.forEach(p=>{Array.isArray((p=Lt.call(n,p)).event)||(r.dom.domInterceptionHooks.get("intercept")?.forEach(_=>_(p)),r.dom.domInterceptionHooks.get("sync")?.forEach(_=>_(p)))}));a.observe(o,{childList:!0,subtree:!0}),o.addEventListener("readystatechange",()=>!m()&&a.disconnect())}let g=Object.create(null);return["insertBefore","insertAdjacentElement","insertAdjacentHTML","setHTML","replaceChildren","replaceWith","remove","replaceChild","removeChild","before","after","append","prepend","appendChild"].forEach(a=>{let d=["insertBefore","replaceChild","removeChild","appendChild"].includes(a)?i:f;g[a]=d.prototype[a],g[a]&&(d.prototype[a]=function(...p){let _=()=>g[a].call(this,...p);if(!(this instanceof f||this instanceof c))return _();let x=[],O=[],T=this;["insertBefore"].includes(a)?O=[p[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(a)?(O=[p[1]],["beforebegin","afterend"].includes(p[0])&&(T=this.parentNode)):["setHTML","replaceChildren"].includes(a)?(x=[...this.childNodes],O=a==="replaceChildren"?[...p]:[p[0]]):["replaceWith","remove"].includes(a)?(x=[this],O=a==="replaceWith"?[...p]:[],T=this.parentNode):["replaceChild"].includes(a)?(x=[p[1]],O=[p[0]]):["removeChild"].includes(a)?x=[...p]:(O=[...p],["before","after"].includes(a)&&(T=this.parentNode));let ee=a;if(["insertAdjacentHTML","setHTML"].includes(a)){let k=this.nodeName;if(a==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(p[0])){if(!this.parentNode)return g[a].call(this,...p);k=this.parentNode.nodeName}let _e=o.createElement(k);g.setHTML.call(_e,O[0],a==="setHTML"?p[1]:{}),O=[..._e.childNodes],a==="insertAdjacentHTML"?(ee="insertAdjacentElement",p[1]=new c,p[1].______isTemp=!0,p[1].append(..._e.childNodes)):(ee="replaceChildren",p=[..._e.childNodes])}return h({target:T,entrants:O,exits:x,type:"interception",event:[this,a]},()=>g[ee].call(this,...p))})}),["outerHTML","outerText","innerHTML","innerText","textContent","nodeValue"].forEach(a=>{let d=["textContent","nodeValue"].includes(a)?i:["outerText","innerText"].includes(a)?l:f;g[a]=Object.getOwnPropertyDescriptor(d.prototype,a),Object.defineProperty(d.prototype,a,{...g[a],set:function(p){let _=()=>g[a].set.call(this,p);if(!(this instanceof f))return _();let x=[],O=[],T=this;if(["outerHTML","outerText"].includes(a)?(x=[this],T=this.parentNode):x=[...this.childNodes],["outerHTML","innerHTML"].includes(a)){let ge=this.nodeName;if(a==="outerHTML"){if(!this.parentNode)return _();ge=this.parentNode.nodeName}let k=o.createElement(ge==="TEMPLATE"?"div":ge);g[a].set.call(k,p),O=this instanceof s?[]:[...k.childNodes],a==="outerHTML"?(p=new c,p.______isTemp=!0,p.append(...k.childNodes),_=()=>g.replaceWith.call(this,p)):this instanceof s?_=()=>this.content.replaceChildren(...k.childNodes):_=()=>g.replaceChildren.call(this,...k.childNodes)}return h({target:T,entrants:O,exits:x,type:"interception",event:[this,a]},_)}})}),["append","prepend","replaceChildren"].forEach(a=>{[o,c.prototype].forEach(d=>{let p=d[a];d[a]=function(..._){if(this.______isTemp)return p.call(this,..._);let x=a==="replaceChildren"?[...this.childNodes]:[];return h({target:this,entrants:_,exits:x,type:"interception",event:[this,a]},()=>p.call(this,..._))}})}),u}function Ht(){jr.call(this),Lr.call(this),Hr.call(this)}function jr(){let t=this;t.CSS||(t.CSS={}),t.CSS.escape||(t.CSS.escape=e=>e.replace(/([\:@\~\$\&])/g,"\\$1"))}function Lr(){let t=this;"isConnected"in t.Node.prototype||Object.defineProperty(t.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function Hr(){let t=this;t.Element.prototype.matches||(t.Element.prototype.matches=t.Element.prototype.matchesSelector||t.Element.prototype.mozMatchesSelector||t.Element.prototype.msMatchesSelector||t.Element.prototype.oMatchesSelector||t.Element.prototype.webkitMatchesSelector||function(e){for(var n=(this.document||this.ownerDocument).querySelectorAll(e),r=n.length;--r>=0&&n.item(r)!==this;);return r>-1})}function Dt(){let t=this;if(t.webqit||(t.webqit={}),t.webqit.dom)return t.webqit.dom;t.webqit.dom={},Ht.call(t);let e=Tt(t);return t.webqit.dom.Reflow=new e,t.webqit.dom.DOMRealtime=ie,t.webqit.dom.AttrRealtime=V,t.webqit.dom.realtime=(n,r="tree")=>{if(r==="tree")return new ie(n,t);if(r==="attr")return new V(n,t)},t.webqit.dom.ready=Dr.bind(t),t.webqit.dom.meta=Rr.bind(t),t.webqit.dom}function Dr(t,e="interactive"){let n={interactive:["interactive","complete"],complete:["complete"]};if(!n[e])return;let r=this;if(n[e].includes(r.document.readyState))return t(r);r.webqit.dom.readyStateCallbacks||(r.webqit.dom.readyStateCallbacks={interactive:[],complete:[]},r.document.addEventListener("readystatechange",()=>{let o=r.document.readyState;for(let i of r.webqit.dom.readyStateCallbacks[o].splice(0))i(r)},!1)),r.webqit.dom.readyStateCallbacks[e].push(t)}function Rr(t){let e=this,n={},r;return(r=e.document.querySelector(`meta[name="${t}"]`))&&(n=(r.content||"").split(";").filter(o=>o).reduce((o,i)=>{let f=i.split("=").map(l=>l.trim());return nt(o,f[0].split("."),f[1]==="true"?!0:f[1]==="false"?!1:H(f[1])?parseInt(f[1]):f[1]),o},{})),{get name(){return t},get content(){return r.content},json(){return JSON.parse(JSON.stringify(n))}}}function S(t){return!Array.isArray(t)&&typeof t=="object"&&t}function y(t){return Array.isArray(t)}function Bt(t,e,n=null){return y(e)?t.filter(r=>n?e.filter(o=>n(r,o)).length:e.indexOf(r)!==-1):[]}function Ie(t,...e){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new de}),!arguments.length)return globalThis.webqit.refs;let n=globalThis.webqit.refs.get(t);n||(n=new de,globalThis.webqit.refs.set(t,n));let r,o;for(;r=e.shift();)(o=n)&&!(n=n.get(r))&&(n=new de,o.set(r,n));return n}var de=class extends Map{constructor(...e){super(...e),this.observers=new Set}set(e,n){let r=super.set(e,n);return this.fire("set",e,n,e),r}delete(e){let n=super.delete(e);return this.fire("delete",e),n}has(e){return this.fire("has",e),super.has(e)}get(e){return this.fire("get",e),super.get(e)}keyNames(){return Array.from(super.keys())}observe(e,n,r){let o={type:e,key:n,callback:r};return this.observers.add(o),()=>this.observers.delete(o)}unobserve(e,n,r){if(Array.isArray(e)||Array.isArray(n))throw new Error('The "type" and "key" arguments can only be strings.');for(let o of this.observers)!(Se([e,"*"],o.type)&&Se([n,"*"],o.key)&&o.callback===r)||this.observers.delete(o)}fire(e,n,...r){for(let o of this.observers)!(Se([e,"*"],o.type)&&Se([n,"*"],o.key))||o.callback(...r)}},Se=(t,e)=>Array.isArray(e)?Bt(t,e).length:t.includes(e);function fe(t){return typeof t=="function"}function j(t){return Array.isArray(t)||typeof t=="object"&&t||fe(t)}function I(t){return fe(t)||t&&{}.toString.call(t)==="[object function]"}function qe(t){return t instanceof Number||typeof t=="number"}function K(t){return qe(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function Vt(t,...e){return e.forEach(n=>{t.indexOf(n)<0&&t.push(n)}),t}function ft(r,e){e=e||Object.prototype,e=e&&!y(e)?[e]:e;for(var n=[],r=r;r&&(!e||e.indexOf(r)<0)&&r.name!=="default";)n.push(r),r=r?Object.getPrototypeOf(r):null;return n}function st(t,e){var n=[];return ft(t,e).forEach(r=>{Vt(n,...Object.getOwnPropertyNames(r))}),n}function D(t,e,n=!1,r=!1,o=!1){var i=0,f=t.shift();if((K(f)||f===!0||f===!1)&&(i=f,f=t.shift()),!t.length)throw new Error("_merge() requires two or more array/objects.");return t.forEach((l,s)=>{!j(l)&&!I(l)||(n?st(l):Object.keys(l)).forEach(c=>{if(!!e(c,f,l,s)){var u=f[c],m=l[c];if((y(u)&&y(m)||S(u)&&S(m))&&(i===!0||i>0))f[c]=y(u)&&y(m)?[]:{},D([K(i)?i-1:i,f[c],u,m],e,n,r,o);else if(y(f)&&y(l))r?f[c]=m:f.push(m);else try{o?Object.defineProperty(f,c,Object.getOwnPropertyDescriptor(l,c)):f[c]=l[c]}catch{}}})}),f}function he(...t){return D(t,(e,n,r)=>!0,!1,!1,!1)}var Ne=(...t)=>Ie("oohtml",...t);function Ut(t,e,n){let r=t.toUpperCase().replace("-","_"),o=this,i=Dt.call(o);return o.webqit||(o.webqit={}),o.webqit.oohtml||(o.webqit.oohtml={}),o.webqit.oohtml.configs||(o.webqit.oohtml.configs={}),o.webqit.oohtml.configs[r]||(o.webqit.oohtml.configs[r]={}),he(2,o.webqit.oohtml.configs[r],n,e,i.meta(t).json()),{config:o.webqit.oohtml.configs[r],dom:i,window:o}}function mt(t={}){let{config:e,window:n}=Ut.call(this,"bindings-api",t,{api:{bind:"bind",bindings:"bindings"}});n.webqit.Observer=B,Xr.call(n,e)}function lt(t){if(!Ne(t).has("bindings")){let e=Object.create(null);Ne(t).set("bindings",e)}return Ne(t).get("bindings")}function Xr(t){let e=this;if(t.api.bind in e.document)throw new Error(`document already has a "${t.api.bind}" property!`);if(t.api.bindings in e.document)throw new Error(`document already has a "${t.api.bindings}" property!`);if(t.api.bind in e.Element.prototype)throw new Error(`The "Element" class already has a "${t.api.bind}" property!`);if(t.api.bindings in e.Element.prototype)throw new Error(`The "Element" class already has a "${t.api.bindings}" property!`);Object.defineProperty(e.document,t.api.bind,{value:function(n,r={}){return zt(e.document,n,r)}}),Object.defineProperty(e.document,t.api.bindings,{get:function(){return B.proxy(lt(e.document))}}),Object.defineProperty(e.Element.prototype,t.api.bind,{value:function(n,r={}){return zt(this,n,r)}}),Object.defineProperty(e.Element.prototype,t.api.bindings,{get:function(){return B.proxy(lt(this))}})}function zt(t,e,{merge:n,diff:r,namespace:o}={}){let i=lt(t),f={diff:r,namespace:o};if(n)return B.set(i,e,f);let l=B.ownKeys(i,f).filter(s=>!(s in e));return B.batch(i,()=>(l.length&&B.deleteProperty(i,l,f),B.set(i,e,f)),f)}mt.call(window);})();
|
|
1
|
+
(()=>{var Tt=Object.defineProperty;var et=(t,e)=>{for(var n in e)Tt(t,n,{get:e[n],enumerable:!0})};var Be={};et(Be,{apply:()=>Re,batch:()=>Jt,construct:()=>De,deep:()=>zt,defineProperties:()=>Qt,defineProperty:()=>Le,deleteProperty:()=>Ne,get:()=>U,getOwnPropertyDescriptor:()=>Me,getOwnPropertyDescriptors:()=>Wt,getPrototypeOf:()=>Fe,has:()=>_e,intercept:()=>Ut,isExtensible:()=>He,observe:()=>Gt,ownKeys:()=>ye,preventExtensions:()=>ke,set:()=>Y,setPrototypeOf:()=>$e});function E(t){return!Array.isArray(t)&&typeof t=="object"&&t}function X(t){return typeof t}function S(t){return Array.isArray(t)}function Ae(t,e,n=null){return S(e)?t.filter(r=>n?e.filter(o=>n(r,o)).length:e.indexOf(r)!==-1):[]}function de(t,...e){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new te}),!arguments.length)return globalThis.webqit.refs;let n=globalThis.webqit.refs.get(t);n||(n=new te,globalThis.webqit.refs.set(t,n));let r,o;for(;r=e.shift();)(o=n)&&!(n=n.get(r))&&(n=new te,o.set(r,n));return n}var te=class extends Map{constructor(...e){super(...e),this.observers=new Set}set(e,n){let r=super.set(e,n);return this.fire("set",e,n,e),r}delete(e){let n=super.delete(e);return this.fire("delete",e),n}has(e){return this.fire("has",e),super.has(e)}get(e){return this.fire("get",e),super.get(e)}keyNames(){return Array.from(super.keys())}observe(e,n,r){let o={type:e,key:n,callback:r};return this.observers.add(o),()=>this.observers.delete(o)}unobserve(e,n,r){if(Array.isArray(e)||Array.isArray(n))throw new Error('The "type" and "key" arguments can only be strings.');for(let o of this.observers)!(pe([e,"*"],o.type)&&pe([n,"*"],o.key)&&o.callback===r)||this.observers.delete(o)}fire(e,n,...r){for(let o of this.observers)!(pe([e,"*"],o.type)&&pe([n,"*"],o.key))||o.callback(...r)}},pe=(t,e)=>Array.isArray(e)?Ae(t,e).length:t.includes(e);function B(t){return typeof t=="function"}function Ee(t){return B(t)&&/^class\s?/.test(Function.prototype.toString.call(t))}function Te(t){return t===null||t===""}function V(t){return arguments.length&&(t===void 0||typeof t>"u")}function C(t){return Array.isArray(t)||typeof t=="object"&&t||B(t)}function Pe(t){return Te(t)||V(t)||t===!1||t===0||C(t)&&!Object.keys(t).length}function q(t){return B(t)||t&&{}.toString.call(t)==="[object function]"}function he(t){return t instanceof String||typeof t=="string"&&t!==null}function Se(t){return!he(t)&&!V(t.length)}function R(t,e=!0){return S(t)?t:!e&&E(t)?[t]:t!==!1&&t!==0&&Pe(t)?[]:Se(t)?Array.prototype.slice.call(t):E(t)?Object.values(t):[t]}var z=class{constructor(e,n){this.registry=e,Object.assign(this,{...n,target:e.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var re=class extends z{constructor(){super(...arguments),Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal})}remove(){this.abortController.abort(),super.remove()}fire(e){let n=e,r=this.filter;if(r!==1/0&&(r=R(r))&&(n=e.filter(o=>r.includes(o.key))),this.params.diff&&(n=n.filter(o=>o.type!=="set"||o.value!==o.oldValue)),n.length)return this.filter===1/0||Array.isArray(this.filter)?this.handler(n,this):this.handler(n[0],this)}};var O=(...t)=>de("observer-api",...t);var G=class{constructor(e){this.target=e,this.entries=[]}addRegistration(e){return this.entries.push(e),e}removeRegistration(e){this.entries=this.entries.filter(n=>n!==e)}static _getInstance(e,n,r=!0,o=this.__namespace){if(!C(n))throw new Error(`Subject must be of type object; "${X(n)}" given!`);let i=this;return o&&O("namespaces").has(e+"-"+o)&&(i=O("namespaces").get(e+"-"+o),e+="-"+o),!O(n,"registry").has(e)&&r&&O(n,"registry").set(e,new i(n)),O(n,"registry").get(e)}static _namespace(e,n,r=null){if(e+="-"+n,arguments.length===2)return O("namespaces").get(e);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${n} must be a subclass of ${this.name}.`);O("namespaces").set(e,r),r.__namespace=n}};var $=class extends G{static getInstance(e,n=!0,r=null){return super._getInstance("listeners",...arguments)}static namespace(e,n=null){return super._namespace("listeners",...arguments)}constructor(e){super(e),this.batches=[]}addRegistration(e,n,r){return super.addRegistration(new re(this,{filter:e,handler:n,params:r}))}emit(e){if(this.batches.length){this.batches[0].events.push(...e);return}this.entries.forEach(n=>n.fire(e))}batch(e){this.batches.unshift({entries:[...this.entries],events:[]});let n=e(),r=this.batches.shift();return r.events.length&&r.entries.forEach(o=>o.fire(r.events)),n}};var ne=class extends z{exec(e,n,r){return this.running||!this.traps[e.type]?n(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[e.type](e,r,(...o)=>(this.running=!1,n(...o))))}};var H=class extends G{static getInstance(e,n=!0,r=null){return super._getInstance("traps",...arguments)}static namespace(e,n=null){return super._namespace("traps",...arguments)}addRegistration(e){return super.addRegistration(new ne(this,e))}emit(e,n=null){let r=this;return function o(i,...s){let c=r.entries[i];return c?c.exec(e,(...f)=>o(i+1,...f),...s):n?n(e,...s):s[0]}(0)}};var j=class{constructor(e,n){if(this.target=e,!n.type)throw new Error("Descriptor type must be given in definition!");Object.assign(this,n)}};var je={};et(je,{accessorize:()=>kt,proxy:()=>Vt,unaccessorize:()=>Bt,unproxy:()=>ge});function kt(t,e,n={}){t=qe(t);let r=O(t,"accessorizedProps");function o(f){let l,u=t;for(;!l&&(u=Object.getPrototypeOf(u));)l=Object.getOwnPropertyDescriptor(u,f);return l?{proto:u,descriptor:l}:{descriptor:{value:void 0}}}function i(f){if(r.has(f))return!0;let l=o(f);l.getValue=function(){return"get"in this.descriptor?this.descriptor.get():this.descriptor.value},l.setValue=function(g){return"set"in this.descriptor?this.descriptor.set(g):this.descriptor.value=g},l.intact=function(){let g=Object.getOwnPropertyDescriptor(t,f);return g.get===h.get&&g.set===h.set&&r.get(f)===this},l.restore=function(){return this.intact()?(this.proto!==t?delete t[f]:Object.defineProperty(t,f,this.descriptor),r.delete(f),!0):!1},r.set(f,l);let{enumerable:u=!0,configurable:m=!0}=l.descriptor,h={enumerable:u,configurable:m};["value","set"].some(g=>g in l.descriptor)&&(h.set=function(g){return Y(this,f,g,n)}),["value","get"].some(g=>g in l.descriptor)&&(h.get=function(){return U(this,f,n)});try{return Object.defineProperty(t,f,h),!0}catch{return r.delete(f),!1}}let c=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(i);return e===void 0||Array.isArray(e)?c:c[0]}function Bt(t,e,n={}){t=qe(t);let r=O(t,"accessorizedProps");function o(c){return r.has(c)?r.get(c).restore():!0}let s=(Array.isArray(e)?e:e===void 0?Object.keys(t):[e]).map(o);return e===void 0||Array.isArray(e)?s:s[0]}function Vt(t,e={}){t=qe(t);let n=new Proxy(t,{apply:(r,o,i)=>Re(r,o,i,e),construct:(r,o,i=null)=>De(r,o,i,e),defineProperty:(r,o,i)=>Le(r,o,i,e),deleteProperty:(r,o)=>Ne(r,o,e),get:(r,o,i=null)=>{let s=U(r,o,{...e,receiver:i});return e.proxyAutoBinding!==!1&&q(s)&&!Ee(s)?s.bind(n):s},getOwnPropertyDescriptor:(r,o)=>Me(r,o,e),getPrototypeOf:r=>Fe(r,e),has:(r,o)=>_e(r,o,e),isExtensible:r=>He(r,e),ownKeys:r=>ye(r,e),preventExtensions:r=>ke(r,e),set:(r,o,i,s=null)=>Y(r,o,i,{...e,receiver:s}),setPrototypeOf:(r,o)=>$e(r,o,e)});return O(n).set(n,t),n}function ge(t){return O(t).get(t)||t}function qe(t){if(!t||!C(t))throw new Error("Target must be of type object!");return ge(t)}function zt(t,e,n,r=i=>i,o={}){return function i(s,c,f){let l=c[f.level];return f.level<c.length-1?f={...f,preflight:!0}:f={...f,preflight:o.preflight},n(s,l,(u,...m)=>{let h=(d={})=>({...f,...d,level:f.level+1}),g=d=>{d instanceof j&&(d.path=[d.key],s instanceof j&&(d.path=s.path.concat(d.key),d.context=s))};if(xe(l)&&Array.isArray(u))return u.forEach(g),f.level===c.length-1||!u.length&&f.midwayResults?r(u,...m):u.map(d=>i(d,c,h(...m)));g(u);let a=C(W(u,!1));return f.level===c.length-1||!a&&f.midwayResults?r(u,...m):a&&i(u,c,h(...m))},f)}(t,e.slice(0),{...o,level:0})}function Gt(t,e,n,r={}){if(t=W(t),q(arguments[1])&&([,n,r={}]=arguments,e=1/0),!q(n))throw new Error(`Handler must be a function; "${X(n)}" given!`);let o=st(t,e,n,r);return r.preflight?(r={...r,descripted:!0},delete r.live,U(t,e,o,r)):o()}function Ut(t,e,n={}){return t=W(t),E(e)||([,,,n={}]=arguments,e={[arguments[1]]:arguments[2]}),H.getInstance(t,!0,n.namespace).addRegistration({traps:e,params:n})}function Me(t,e,n=o=>o,r={}){return M(t,"getOwnPropertyDescriptor",{key:e},n,r)}function Wt(t,e,n=o=>o,r={}){return M(t,"getOwnPropertyDescriptors",{key:e},n,r)}function Fe(t,e=r=>r,n={}){return M(t,"getPrototypeOf",{},e,n)}function He(t,e=r=>r,n={}){return M(t,"isExtensible",{},e,n)}function ye(t,e=r=>r,n={}){return M(t,"ownKeys",{},e,n)}function _e(t,e,n=o=>o,r={}){return M(t,"has",{key:e},n,r)}function U(t,e,n=o=>o,r={}){let o;return t=W(t),E(n)?[r,n]=[n,i=>i]:r.live&&(o=!0),Xt(t,e,i=>{let s=[...i];return function c(f,l,u){if(!l.length)return u(f);let m=l.shift();function h(d,p=void 0){let y=A=>(d.value=A,c(f.concat(r.live||r.descripted?d:A),l,u));if(arguments.length>1)return y(p);let x=O(t,"accessorizedProps",!1),b=x&&x.get(d.key);return b&&b.intact()?y(b.getValue()):y(Reflect.get(t,d.key,...r.receiver?[r.receiver]:[]))}let g=new j(t,{type:"get",key:m,value:void 0,related:s}),a=H.getInstance(t,!1,r.namespace);return a?a.emit(g,h):h(g)}([],i.slice(0),c=>{let f=xe(e)?c:c[0];return o?st(t,e,n,r)(f):n(f)})})}function Jt(t,e,n={}){return $.getInstance(t,!0,n.namespace).batch(e)}function Y(t,e,n,r=s=>s,o={},i=!1){t=W(t);let s=[[e,n]];E(e)&&([,,r=f=>f,o={},i=!1]=arguments,s=Object.entries(e)),E(r)&&([i,o,r]=[typeof o=="boolean"?o:!1,r,f=>f]);let c=s.map(([f])=>f);return function f(l,u,m){if(!u.length)return m(l);let[h,g]=u.shift();function a(p,y=void 0){let x=Q=>(p.status=Q,f(l.concat(p),u,m));if(arguments.length>1)return x(p,y);let b=O(t,"accessorizedProps",!1),A=b&&b.get(p.key);return p.type==="defineProperty"?(A&&!A.restore()&&x(!1),Object.defineProperty(t,p.key,p.value),x(!0)):A&&A.intact()?x(A.setValue(p.value)):x(Reflect.set(t,p.key,p.value))}function d(p,y){if(o.diff&&g===y)return f(l,u,m);let x=new j(t,{type:i?"defineProperty":"set",key:h,value:g,isUpdate:p,oldValue:y,related:[...c],detail:o.detail}),b=H.getInstance(t,!1,o.namespace);return b?b.emit(x,a):a(x)}return _e(t,h,p=>p?U(t,h,y=>d(p,y),o):d(p),o)}([],s.slice(0),f=>{let l=$.getInstance(t,!1,o.namespace);return l&&l.emit(f),r(xe(e)?f.map(u=>u.status):f[0]?.status)})}function Le(t,e,n,r=i=>i,o={}){return Y(t,e,n,r,o,!0)}function Qt(t,e,n=o=>o,r={}){return Y(t,e,n,r,!0)}function Ne(t,e,n=o=>o,r={}){t=W(t),E(n)&&([r,n]=[n,s=>s]);let o=R(e),i=[...o];return function s(c,f,l){if(!f.length)return l(c);let u=f.shift();function m(g,a=void 0){let d=x=>(g.status=x,s(c.concat(g),f,l));if(arguments.length>1)return d(g,a);let p=O(t,"accessorizedProps",!1),y=p&&p.get(g.key);return y&&!y.restore()&&d(!1),d(Reflect.deleteProperty(t,g.key))}function h(g){let a=new j(t,{type:"deleteProperty",key:u,oldValue:g,related:[...i],detail:r.detail}),d=H.getInstance(t,!1,r.namespace);return d?d.emit(a,m):m(a)}return U(t,u,h,r)}([],o.slice(0),s=>{let c=$.getInstance(t,!1,r.namespace);return c&&c.emit(s),n(xe(e)?s.map(f=>f.status):s[0].status)})}function De(t,e,n=null,r=i=>i,o={}){return M(t,"construct",arguments.length>2?{argumentsList:e,newTarget:n}:{argumentsList:e},r,o)}function Re(t,e,n,r=i=>i,o={}){return M(t,"apply",{thisArgument:e,argumentsList:n},r,o)}function $e(t,e,n=o=>o,r={}){return M(t,"setPrototypeOf",{proto:e},n,r)}function ke(t,e=r=>r,n={}){return M(t,"preventExtensions",{},e,n)}function st(t,e,n,r={}){let o;r.signal||(o=new AbortController,r={...r,signal:o.signal});let i=$.getInstance(t,!0,r.namespace);return function s(c,f=null){f?.remove();let u={signal:i.addRegistration(e,s,r).signal};return arguments.length&&n(c,u),o}}function M(t,e,n={},r=i=>i,o={}){t=W(t),E(r)&&([o,r]=[r,f=>f]);function i(f,l){return arguments.length>1?r(l):r(Reflect[e](t,...Object.values(n)))}let s=new j(t,{type:e,...n}),c=H.getInstance(t,!1,o.namespace);return c?c.emit(s,i):i(s)}function xe(t){return t===1/0||Array.isArray(t)}function W(t,e=!0){if((!t||!C(t))&&e)throw new Error(`Object must be of type object or array! "${X(t)}" given.`);return t instanceof j&&(t=t.value),t&&ge(t)}function Xt(t,e,n){return e===1/0?ye(t,n):n(R(e))}var Yt={...Be,...je},L=Yt;function v(t){return!Array.isArray(t)&&typeof t=="object"&&t}function _(t){return Array.isArray(t)}function Ve(t,e,n=null){return _(e)?t.filter(r=>n?e.filter(o=>n(r,o)).length:e.indexOf(r)!==-1):[]}function Z(t,...e){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new oe}),!arguments.length)return globalThis.webqit.refs;let n=globalThis.webqit.refs.get(t);n||(n=new oe,globalThis.webqit.refs.set(t,n));let r,o;for(;r=e.shift();)(o=n)&&!(n=n.get(r))&&(n=new oe,o.set(r,n));return n}var oe=class extends Map{constructor(...e){super(...e),this.observers=new Set}set(e,n){let r=super.set(e,n);return this.fire("set",e,n,e),r}delete(e){let n=super.delete(e);return this.fire("delete",e),n}has(e){return this.fire("has",e),super.has(e)}get(e){return this.fire("get",e),super.get(e)}keyNames(){return Array.from(super.keys())}observe(e,n,r){let o={type:e,key:n,callback:r};return this.observers.add(o),()=>this.observers.delete(o)}unobserve(e,n,r){if(Array.isArray(e)||Array.isArray(n))throw new Error('The "type" and "key" arguments can only be strings.');for(let o of this.observers)!(we([e,"*"],o.type)&&we([n,"*"],o.key)&&o.callback===r)||this.observers.delete(o)}fire(e,n,...r){for(let o of this.observers)!(we([e,"*"],o.type)&&we([n,"*"],o.key))||o.callback(...r)}},we=(t,e)=>Array.isArray(e)?Ve(t,e).length:t.includes(e);function K(t){return typeof t=="function"}function ie(t){return t===null||t===""}function N(t){return arguments.length&&(t===void 0||typeof t>"u")}function T(t){return Array.isArray(t)||typeof t=="object"&&t||K(t)}function ze(t){return ie(t)||N(t)||t===!1||t===0||T(t)&&!Object.keys(t).length}function w(t){return K(t)||t&&{}.toString.call(t)==="[object function]"}function se(t){return t instanceof Number||typeof t=="number"}function I(t){return se(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function ee(t){return t instanceof String||typeof t=="string"&&t!==null}function Ge(t){return!ee(t)&&!N(t.length)}function be(t,...e){return e.forEach(n=>{t.indexOf(n)<0&&t.push(n)}),t}function Ue(r,e){e=e||Object.prototype,e=e&&!_(e)?[e]:e;for(var n=[],r=r;r&&(!e||e.indexOf(r)<0)&&r.name!=="default";)n.push(r),r=r?Object.getPrototypeOf(r):null;return n}function We(t,e){var n=[];return Ue(t,e).forEach(r=>{be(n,...Object.getOwnPropertyNames(r))}),n}function F(t,e,n=!1,r=!1,o=!1){var i=0,s=t.shift();if((I(s)||s===!0||s===!1)&&(i=s,s=t.shift()),!t.length)throw new Error("_merge() requires two or more array/objects.");return t.forEach((c,f)=>{!T(c)&&!w(c)||(n?We(c):Object.keys(c)).forEach(l=>{if(!!e(l,s,c,f)){var u=s[l],m=c[l];if((_(u)&&_(m)||v(u)&&v(m))&&(i===!0||i>0))s[l]=_(u)&&_(m)?[]:{},F([I(i)?i-1:i,s[l],u,m],e,n,r,o);else if(_(s)&&_(c))r?s[l]=m:s.push(m);else try{o?Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(c,l)):s[l]=c[l]}catch{}}})}),s}function fe(...t){return F(t,(e,n,r)=>!0,!1,!1,!1)}function P(t,e=!0){return _(t)?t:!e&&v(t)?[t]:t!==!1&&t!==0&&ze(t)?[]:Ge(t)?Array.prototype.slice.call(t):v(t)?Object.values(t):[t]}function ue(t,e,n={},r={}){e=P(e).slice();for(var o=t;!N(o)&&!ie(o)&&e.length;){var i=e.shift();if(!(n.get?n.get(o,i):T(o)?i in o:o[i])){r.exists=!1;return}o=n.get?n.get(o,i):o[i]}return r.exists=!0,o}function Qe(t,e,n,r={},o={}){let i=(u,m,h)=>o.set?o.set(u,m,h):(I(e[c])&&_(u)?u.push(h):u[m]=h,!0);e=P(e);for(var s=t,c=0;c<e.length;c++)if(c<e.length-1){if(!s||!T(s)&&!w(s))return!1;var f=ue(s,e[c],o);if(!T(f)){if(o.buildTree===!1)return!1;f=w(o.buildTree)?o.buildTree(c):I(e[c+1])?[]:{};var l=i(s,e[c],f);if(!l)return!1}s=f}else return i(s,e[c],n)}var le=class{constructor(e,n=!0){Object.defineProperty(this,"window",{value:e}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),this.async=n,this.window.requestAnimationFrame?this.run():this.async=!1}#e(){this.window.requestAnimationFrame(()=>{for(let e of this.readCallbacks)e(),this.readCallbacks.delete(e);for(let e of this.writeCallbacks)e(),this.writeCallbacks.delete(e);this.run()})}onread(e,n=!1){if(n)return new Promise(r=>{this.async===!1?r(e()):this.readCallbacks.add(()=>{r(e())})});this.async===!1?e():this.readCallbacks.add(e)}onwrite(e,n=!1){if(n)return new Promise(r=>{this.async===!1?r(e()):this.writeCallbacks.add(()=>{r(e())})});this.async===!1?e():this.writeCallbacks.add(e)}cycle(e,n,r){this.onread(()=>{let o=e(r),i=s=>{s!==void 0&&this.onwrite(()=>{let c=n(s,r),f=l=>{l!==void 0&&this.cycle(e,n,l)};c instanceof Promise?c.then(f):f(c)})};o instanceof Promise?o.then(i):i(o)})}};var J=class{constructor(e,n,r){this.context=e,this.namespace=n,this.window=e.defaultView||e.ownerDocument?.defaultView||r,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(e){return w(e[0])?e=[[],...e]:v(e[0])&&e.length===1?e=[[],void 0,e[0]]:v(e[1])&&e.length===2?e=[P(e[0],!1),void 0,e[1]]:e[0]=P(e[0],!1),e}registry(...e){return Z("realdom.realtime",this.window,this.namespace,...e)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(e,n,r){let{window:o}=this,i=Array.isArray(n)?n:[n],s=new Set;for(let[c,f]of this.registry(e))for(let[l,u]of f){let m=i.filter(h=>l.contains(h.target)?c==="subtree"||h.target===l:!1);if(!!m.length){Array.isArray(n)||(m=m[0]);for(let h of u)s.add([h,m,l])}}for(let[c,f,l]of s)r.call(this,c,f,l)}disconnectables(e,...n){let r={disconnect(){n.forEach(o=>o&&w(o.disconnect)&&o.disconnect()||w(o)&&o()||v(o)&&(o.disconnected=!0))}};return e&&e.addEventListener("abort",()=>r.disconnect()),r}};var k=class extends J{constructor(e,...n){super(e,"attr",...n)}get(e,n=void 0,r={}){let o=typeof e=="string";[e=[],n=void 0,r={}]=this.resolveArgs(arguments);let{context:i}=this,s=gt(i,e),c=o?s[0]:s;if(!n)return c;let f=n&&r.lifecycleSignals&&this.createSignalGenerator(),l=f?.generate()||{};if(n(c,l,i),r.live){f&&(r={...r,signalGenerator:f});let u=this.observe(o?e[0]:e,n,{newValue:!0,...r});return this.disconnectables(r.signal,u)}}observe(e,n,r={}){let o=typeof e=="string";if([e=[],n,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(o?e[0]:e,n,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:i,window:s,webqit:c}=this;r.eventDetails&&!c.realdom.attrInterceptionHooks?.intercepting&&dt.call(s,"intercept",()=>{});let f=new s.MutationObserver(h=>{h=ht(h).map(g=>yt.call(s,g)),pt.call(s,m,h,i)}),l={attributes:!0,attributeOldValue:r.oldValue,subtree:r.subtree};e.length&&(l.attributeFilter=e),f.observe(i,l);let u=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),m={context:i,filter:e,callback:n,params:r,atomics:new Map,originalFilterIsString:o,signalGenerator:u,disconnectable:f};return this.disconnectables(r.signal,f,u)}observeSync(e,n,r={}){let o=typeof e=="string";[e,n,r={}]=this.resolveArgs(arguments);let{context:i,window:s}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let c=r.timing==="intercept"?"intercept":"sync",f=r.subtree?"subtree":"children";this.registry(c).size||dt.call(s,c,a=>{this.forEachMatchingContext(c,a,pt)});let l={disconnect(){g.delete(m),g.size||h.delete(i)}},u=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),m={context:i,filter:e,callback:n,params:r,atomics:new Map,originalFilterIsString:o,signalGenerator:u,disconnectable:l},h=this.registry(c,f);h.has(i)||h.set(i,new Set);let g=h.get(i);return g.add(m),this.disconnectables(r.signal,l,u)}};function ht(t){return t.reduce((e,n,r)=>e[r-1]?.attributeName===n.attributeName?e:e.concat(n),[])}function pt(t,e){let{context:n,filter:r,callback:o,params:i,atomics:s,originalFilterIsString:c,signalGenerator:f}=t;i.atomic&&!s.size&&(e=gt(n,r,e)),i.newValue===null&&i.oldValue===null&&i.eventDetails||(e=e.map(m=>{i.eventDetails||({event:h,...m}=m);let h;return!i.oldValue&&"oldValue"in m&&({oldValue:h,...m}=m),!i.newValue&&"value"in m?{value:h,...m}=m:i.newValue&&typeof m.value>"u"&&(m={...m,value:m.target.getAttribute(m.name)}),m})),i.atomic&&(e.forEach(m=>s.set(m.name,m)),e=Array.from(s.entries()).map(([,m])=>m));let l=c?e[0]:e,u=f?.generate()||{};o(l,u,n)}function gt(t,e,n=[]){let r={event:null,type:"attribute"};return e.length?e.map(i=>n.find(s=>s.name===i)||{target:t,name:i,value:t.getAttribute(i),...r}):Array.from(t.attributes).map(i=>n.find(s=>s.name===i.nodeName)||{target:t,name:i.nodeName,value:i.nodeValue,...r})}function yt({target:t,attributeName:e,value:n,oldValue:r}){let s=(this.webqit.realdom.attrInterceptionRecords?.get(t)||{})[e]||"mutation";return{target:t,name:e,value:n,oldValue:r,type:"observation",event:s}}function dt(t,e){let n=this,{webqit:r,document:o,Element:i}=n;r.realdom.attrInterceptionHooks||Object.defineProperty(r.realdom,"attrInterceptionHooks",{value:new Map}),r.realdom.attrInterceptionHooks.has(t)||r.realdom.attrInterceptionHooks.set(t,new Set),r.realdom.attrInterceptionHooks.get(t).add(e);let s=()=>r.realdom.attrInterceptionHooks.get(t).delete(e);if(r.realdom.attrInterceptionHooks?.intercepting)return s;console.warn("Attr mutation APIs are now being intercepted."),r.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"attrInterceptionRecords",{value:new Map});let c=(u,m)=>{r.realdom.attrInterceptionRecords.has(u.target)||r.realdom.attrInterceptionRecords.set(u.target,{});let h=r.realdom.attrInterceptionRecords.get(u.target);clearTimeout(h[u.name]?.timeout),h[u.name]=u.event;let g=setTimeout(()=>{delete h[u.name]},0);Object.defineProperty(u.event,"timeout",{value:g,configurable:!0}),r.realdom.attrInterceptionHooks.get("intercept")?.forEach(d=>d([u]));let a=m();return r.realdom.attrInterceptionHooks.get("sync")?.forEach(d=>d([u])),a};new n.MutationObserver(u=>{u=ht(u).map(m=>yt.call(n,m)).filter((m,h)=>!Array.isArray(m.event)),u.length&&(r.realdom.attrInterceptionHooks.get("intercept")?.forEach(m=>m(u)),r.realdom.attrInterceptionHooks.get("sync")?.forEach(m=>m(u)))}).observe(o,{attributes:!0,subtree:!0,attributeOldValue:!0});let l=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(u=>{l[u]=i.prototype[u],i.prototype[u]=function(...m){let h,g=this.getAttribute(m[0]);["setAttribute","toggleAttribute"].includes(u)&&(h=m[1]),u==="toggleAttribute"&&h===void 0&&(h=g===null);let a={target:this,name:m[0],value:h,oldValue:g,type:"interception",event:[this,u]};return c(a,()=>l[u].call(this,...m))}}),s}var ce=class extends J{constructor(e,...n){super(e,"tree",...n)}attr(e,n=void 0,r={}){let{context:o,window:i}=this;return new k(o,i).get(...arguments)}query(e,n=void 0,r={}){[e,n=void 0,r={}]=this.resolveArgs(arguments);let{context:o}=this,i=new Map,s=l=>(i.has(l)||i.set(l,{target:l,entrants:[],exits:[],type:"query",event:null}),i.get(l));if((!r.generation||r.generation==="entrants")&&(e.length?e.every(l=>typeof l=="string")&&(e=e.join(","))&&(r.subtree?o.querySelectorAll(e):[...o.children].filter(u=>u.matches(e))).forEach(u=>s(u.parentNode||o).entrants.push(u)):[...o.children].forEach(l=>s(o).entrants.push(l))),!n)return i;let c={disconnected:!1},f=n&&r.lifecycleSignals&&this.createSignalGenerator();for(let[,l]of i){if(c.disconnected)break;let u=f?.generate()||{};n(l,u,o)}if(r.live){f&&(r={...r,signalGenerator:f});let l=this.observe(e,n,r);return this.disconnectables(r.signal,c,l)}return this.disconnectables(r.signal,c,f)}children(e,n=void 0,r={}){return[e,n=void 0,r={}]=this.resolveArgs(arguments),this.query(e,n,{...r,subtree:!1})}subtree(e,n=void 0,r={}){return[e,n=void 0,r={}]=this.resolveArgs(arguments),this.query(e,n,{...r,subtree:!0})}observe(e,n,r={}){if([e,n,r={}]=this.resolveArgs(arguments),["sync","intercept"].includes(r.timing))return this.observeSync(e,n,r);if(r.timing&&r.timing!=="async")throw new Error(`Timing option "${r.timing}" invalid.`);let{context:o,window:i,webqit:s,document:c}=this;r.eventDetails&&(s.realdom.domInterceptionRecordsAlwaysOn=!0),(c.readyState==="loading"||s.realdom.domInterceptionRecordsAlwaysOn)&&!s.realdom.domInterceptionHooks?.intercepting&&wt.call(i,"sync",()=>{});let f=new i.MutationObserver(m=>m.forEach(h=>{xt.call(i,u,bt.call(i,h),o)}));f.observe(o,{childList:!0,subtree:r.subtree});let l=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),u={context:o,selectors:e,callback:n,params:r,signalGenerator:l,disconnectable:f};if(r.staticSensitivity){let m=_t.call(i,u);return this.disconnectables(r.signal,f,l,m)}return this.disconnectables(r.signal,f,l)}observeSync(e,n,r={}){[e,n,r={}]=this.resolveArgs(arguments);let{context:o,window:i}=this;if(r.timing&&!["sync","intercept"].includes(r.timing))throw new Error(`Timing option "${r.timing}" invalid.`);let s=r.timing==="intercept"?"intercept":"sync",c=r.subtree?"subtree":"children";this.registry(s).size||wt.call(i,s,g=>{this.forEachMatchingContext(s,g,xt)});let f={disconnect(){h.delete(u),h.size||m.delete(o)}},l=r.signalGenerator||r.lifecycleSignals&&this.createSignalGenerator(),u={context:o,selectors:e,callback:n,params:r,signalGenerator:l,disconnectable:f},m=this.registry(s,c);m.has(o)||m.set(o,new Set);let h=m.get(o);if(h.add(u),r.staticSensitivity){let g=_t.call(i,u);return this.disconnectables(r.signal,f,l,g)}return this.disconnectables(r.signal,f,l)}};function _t(t){let e=this,{context:n,selectors:r,callback:o,params:i,signalGenerator:s}=t,c=u=>[...u.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(m=>m[1]);if(!(t.$attrs=r.filter(u=>typeof u=="string"&&u.includes("[")).reduce((u,m)=>u.concat(c(m)),[])).length)return;let f=new Set,l=new Set;return f.push=u=>(l.delete(u),f.add(u)),l.push=u=>(f.delete(u),l.add(u)),t.$deliveryCache={entrants:f,exits:l},new k(n,e).observe(t.$attrs,u=>{let m=new Map,h=d=>(m.has(d)||m.set(d,{target:d,entrants:[],exits:[],type:"static",event:null}),m.get(d)),g=new WeakMap,a=d=>(g.has(d)||g.set(d,r.some(p=>d.matches(p))),g.get(d));for(let d of u)["entrants","exits"].forEach(p=>{i.generation&&p!==i.generation||t.$deliveryCache[p].has(d.target)||(p==="entrants"?!a(d.target):a(d.target))||(t.$deliveryCache[p].push(d.target),h(d.target)[p].push(d.target),h(d.target).event=d.event)});for(let[,d]of m){let p=s?.generate()||{};o(d,p,n)}},{subtree:i.subtree,timing:i.timing,eventDetails:i.eventDetails})}function xt(t,e){let{context:n,selectors:r,callback:o,params:i,signalGenerator:s,$deliveryCache:c}=t,f={...e,entrants:[],exits:[]};if(i.eventDetails||delete f.event,["entrants","exits"].forEach(u=>{if(!(i.generation&&u!==i.generation)&&(r.length?f[u]=ar(r,e[u],e.event!=="parse"):f[u]=[...e[u]],!!c))for(let m of f[u])c[u].push(m)}),!f.entrants.length&&!f.exits.length)return;let l=s?.generate()||{};o(f,l,n)}function ar(t,e,n){e=Array.isArray(e)?e:[...e];let r=(o,i)=>{if(o=o.filter(s=>s.matches),typeof i=="string"){let s=o.filter(c=>c.matches(i));if(n&&(s=o.reduce((c,f)=>[...c,...f.querySelectorAll(i)],s)),s.length)return s}else if(o.includes(i)||n&&o.some(s=>s.contains(i)))return[i]};return e.$$searchCache||(e.$$searchCache=new Map),t.reduce((o,i)=>{let s;return e.$$searchCache.has(i)?s=e.$$searchCache.get(i):(s=r(e,i)||[],v(i)&&e.$$searchCache.set(i,s)),o.concat(s)},[])}function bt({target:t,addedNodes:e,removedNodes:n}){let r=this,o;return o=P(e).reduce((i,s)=>i||r.webqit.realdom.domInterceptionRecords?.get(s),null),o=P(n).reduce((i,s)=>i||r.webqit.realdom.domInterceptionRecords?.get(s),o),o=o||r.document.readyState==="loading"&&"parse"||"mutation",{target:t,entrants:e,exits:n,type:"observation",event:o}}function wt(t,e){let n=this,{webqit:r,document:o,Node:i,Element:s,HTMLElement:c,HTMLTemplateElement:f,DocumentFragment:l}=n;r.realdom.domInterceptionHooks||Object.defineProperty(r.realdom,"domInterceptionHooks",{value:new Map}),r.realdom.domInterceptionHooks.has(t)||r.realdom.domInterceptionHooks.set(t,new Set),r.realdom.domInterceptionHooks.get(t).add(e);let u=()=>r.realdom.domInterceptionHooks.get(t).delete(e);if(r.realdom.domInterceptionHooks?.intercepting)return u;console.warn("DOM mutation APIs are now being intercepted."),r.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(r.realdom,"domInterceptionRecords",{value:new Map});let m=()=>!0,h=(a,d)=>{m()?a.entrants.concat(a.exits).forEach(y=>{clearTimeout(r.realdom.domInterceptionRecords.get(y)?.timeout),r.realdom.domInterceptionRecords.set(y,a.event);let x=setTimeout(()=>{r.realdom.domInterceptionRecords.delete(y)},0);Object.defineProperty(a.event,"timeout",{value:x,configurable:!0})}):r.realdom.domInterceptionRecords.clear(),r.realdom.domInterceptionHooks.get("intercept")?.forEach(y=>y(a));let p=d();return r.realdom.domInterceptionHooks.get("sync")?.forEach(y=>y(a)),p};if(m()){let a=new n.MutationObserver(d=>d.forEach(p=>{Array.isArray((p=bt.call(n,p)).event)||(r.realdom.domInterceptionHooks.get("intercept")?.forEach(y=>y(p)),r.realdom.domInterceptionHooks.get("sync")?.forEach(y=>y(p)))}));a.observe(o,{childList:!0,subtree:!0}),o.addEventListener("readystatechange",()=>!m()&&a.disconnect())}let g=Object.create(null);return["insertBefore","insertAdjacentElement","insertAdjacentHTML","setHTML","replaceChildren","replaceWith","remove","replaceChild","removeChild","before","after","append","prepend","appendChild"].forEach(a=>{let d=["insertBefore","replaceChild","removeChild","appendChild"].includes(a)?i:s;g[a]=d.prototype[a],g[a]&&(d.prototype[a]=function(...p){let y=()=>g[a].call(this,...p);if(!(this instanceof s||this instanceof l))return y();let x=[],b=[],A=this;["insertBefore"].includes(a)?b=[p[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(a)?(b=[p[1]],["beforebegin","afterend"].includes(p[0])&&(A=this.parentNode)):["setHTML","replaceChildren"].includes(a)?(x=[...this.childNodes],b=a==="replaceChildren"?[...p]:[p[0]]):["replaceWith","remove"].includes(a)?(x=[this],b=a==="replaceWith"?[...p]:[],A=this.parentNode):["replaceChild"].includes(a)?(x=[p[1]],b=[p[0]]):["removeChild"].includes(a)?x=[...p]:(b=[...p],["before","after"].includes(a)&&(A=this.parentNode));let Q=a;if(["insertAdjacentHTML","setHTML"].includes(a)){let D=this.nodeName;if(a==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(p[0])){if(!this.parentNode)return g[a].call(this,...p);D=this.parentNode.nodeName}let ae=o.createElement(D);g.setHTML.call(ae,b[0],a==="setHTML"?p[1]:{}),b=[...ae.childNodes],a==="insertAdjacentHTML"?(Q="insertAdjacentElement",p[1]=new l,p[1].______isTemp=!0,p[1].append(...ae.childNodes)):(Q="replaceChildren",p=[...ae.childNodes])}return h({target:A,entrants:b,exits:x,type:"interception",event:[this,a]},()=>g[Q].call(this,...p))})}),["outerHTML","outerText","innerHTML","innerText","textContent","nodeValue"].forEach(a=>{let d=["textContent","nodeValue"].includes(a)?i:["outerText","innerText"].includes(a)?c:s;g[a]=Object.getOwnPropertyDescriptor(d.prototype,a),Object.defineProperty(d.prototype,a,{...g[a],set:function(p){let y=()=>g[a].set.call(this,p);if(!(this instanceof s))return y();let x=[],b=[],A=this;if(["outerHTML","outerText"].includes(a)?(x=[this],A=this.parentNode):x=[...this.childNodes],["outerHTML","innerHTML"].includes(a)){let me=this.nodeName;if(a==="outerHTML"){if(!this.parentNode)return y();me=this.parentNode.nodeName}let D=o.createElement(me==="TEMPLATE"?"div":me);g[a].set.call(D,p),b=this instanceof f?[]:[...D.childNodes],a==="outerHTML"?(p=new l,p.______isTemp=!0,p.append(...D.childNodes),y=()=>g.replaceWith.call(this,p)):this instanceof f?y=()=>this.content.replaceChildren(...D.childNodes):y=()=>g.replaceChildren.call(this,...D.childNodes)}return h({target:A,entrants:b,exits:x,type:"interception",event:[this,a]},y)}})}),["append","prepend","replaceChildren"].forEach(a=>{[o,l.prototype].forEach(d=>{let p=d[a];d[a]=function(...y){if(this.______isTemp)return p.call(this,...y);let x=a==="replaceChildren"?[...this.childNodes]:[];return h({target:this,entrants:y,exits:x,type:"interception",event:[this,a]},()=>p.call(this,...y))}})}),u}function vt(){pr.call(this),dr.call(this),hr.call(this)}function pr(){let t=this;t.CSS||(t.CSS={}),t.CSS.escape||(t.CSS.escape=e=>e.replace(/([\:@\~\$\&])/g,"\\$1"))}function dr(){let t=this;"isConnected"in t.Node.prototype||Object.defineProperty(t.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function hr(){let t=this;t.Element.prototype.matches||(t.Element.prototype.matches=t.Element.prototype.matchesSelector||t.Element.prototype.mozMatchesSelector||t.Element.prototype.msMatchesSelector||t.Element.prototype.oMatchesSelector||t.Element.prototype.webkitMatchesSelector||function(e){for(var n=(this.document||this.ownerDocument).querySelectorAll(e),r=n.length;--r>=0&&n.item(r)!==this;);return r>-1})}function Ot(){let t=this;if(t.webqit||(t.webqit={}),t.webqit.realdom)return t.webqit.realdom;t.webqit.realdom={},vt.call(t),t.webqit.realdom.meta=(...n)=>gr.call(t,...n),t.webqit.realdom.ready=(...n)=>Ye.call(t,...n),t.webqit.realdom.realtime=(n,r="dom")=>{if(r==="dom")return new ce(n,t);if(r==="attr")return new k(n,t)};let e=new le(t);return t.webqit.realdom.schedule=(n,...r)=>e[`on${n}`](...r),t.webqit.realdom}function Ye(...t){let e="interactive",n;ee(t[0])?(e=t[0],w(t[1])&&(n=t[1])):w(t[0])&&(n=t[0]);let r={interactive:["interactive","complete"],complete:["complete"]};if(!r[e])throw new Error(`Invalid ready-state timing: ${e}.`);let o=this;if(!n)return o.webqit.realdom.readyStatePromises||(o.webqit.realdom.readyStatePromises={interactive:new Promise(i=>Ye.call(this,"interactive",i)),complete:new Promise(i=>Ye.call(this,"complete",i))}),o.webqit.realdom.readyStatePromises[e];if(r[e].includes(o.document.readyState))return n(o);o.webqit.realdom.readyStateCallbacks||(o.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},o.document.addEventListener("readystatechange",()=>{let i=o.document.readyState;for(let s of o.webqit.realdom.readyStateCallbacks[i].splice(0))s(o)},!1)),o.webqit.realdom.readyStateCallbacks[e].push(n)}function gr(t){let e=this,n={},r;return(r=e.document.querySelector(`meta[name="${t}"]`))&&(n=(r.content||"").split(";").filter(o=>o).reduce((o,i)=>{let s=i.split("=").map(c=>c.trim());return Qe(o,s[0].split("."),s[1]==="true"?!0:s[1]==="false"?!1:I(s[1])?parseInt(s[1]):s[1]),o},{})),{get name(){return t},get content(){return r.content},json(){return JSON.parse(JSON.stringify(n))}}}var Oe=(...t)=>Z("oohtml",...t);function At(t,e,n){let r=t.toUpperCase().replace("-","_"),o=this,i=Ot.call(o);return o.webqit||(o.webqit={}),o.webqit.oohtml||(o.webqit.oohtml={}),o.webqit.oohtml.configs||(o.webqit.oohtml.configs={}),o.webqit.oohtml.configs[r]||(o.webqit.oohtml.configs[r]={}),fe(2,o.webqit.oohtml.configs[r],n,e,i.meta(t).json()),{config:o.webqit.oohtml.configs[r],realdom:i,window:o}}function Ke(t={}){let{config:e,window:n}=At.call(this,"bindings-api",t,{api:{bind:"bind",bindings:"bindings"}});n.webqit.Observer=L,yr.call(n,e)}function Ze(t){if(!Oe(t).has("bindings")){let e=Object.create(null);Oe(t).set("bindings",e)}return Oe(t).get("bindings")}function yr(t){let e=this;if(t.api.bind in e.document)throw new Error(`document already has a "${t.api.bind}" property!`);if(t.api.bindings in e.document)throw new Error(`document already has a "${t.api.bindings}" property!`);if(t.api.bind in e.Element.prototype)throw new Error(`The "Element" class already has a "${t.api.bind}" property!`);if(t.api.bindings in e.Element.prototype)throw new Error(`The "Element" class already has a "${t.api.bindings}" property!`);Object.defineProperty(e.document,t.api.bind,{value:function(n,r={}){return Et(e.document,n,r)}}),Object.defineProperty(e.document,t.api.bindings,{get:function(){return L.proxy(Ze(e.document))}}),Object.defineProperty(e.Element.prototype,t.api.bind,{value:function(n,r={}){return Et(this,n,r)}}),Object.defineProperty(e.Element.prototype,t.api.bindings,{get:function(){return L.proxy(Ze(this))}})}function Et(t,e,{merge:n,diff:r,namespace:o}={}){let i=Ze(t),s={diff:r,namespace:o};if(n)return L.set(i,e,s);let c=L.ownKeys(i,s).filter(f=>!(f in e));return L.batch(i,()=>(c.length&&L.deleteProperty(i,c,s),L.set(i,e,s)),s)}Ke.call(window);})();
|
|
2
2
|
//# sourceMappingURL=bindings-api.js.map
|