very-happy-dom 0.1.12 → 0.2.0
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/CHANGELOG.md +11 -0
- package/README.md +35 -0
- package/dist/browser/Locator.d.ts +39 -9
- package/dist/browser/waiting.d.ts +57 -0
- package/dist/{chunk-w6j0tk1h.js → chunk-182syxjh.js} +1 -1
- package/dist/chunk-3d9kwyx0.js +3 -0
- package/dist/{chunk-05tk4kc8.js → chunk-76fz7rx8.js} +2 -2
- package/dist/chunk-7c8vh5me.js +11 -0
- package/dist/{chunk-mxd0f9ns.js → chunk-7yd4gnqy.js} +2 -2
- package/dist/chunk-a7z9k802.js +2 -0
- package/dist/{chunk-va7sjb9f.js → chunk-c195vfyf.js} +2 -2
- package/dist/chunk-ew1knb9c.js +2 -0
- package/dist/chunk-gkeyaw9g.js +2 -0
- package/dist/{chunk-bjywbrzy.js → chunk-h2qtm7yn.js} +2 -2
- package/dist/{chunk-3xyq2k38.js → chunk-httdr8re.js} +2 -2
- package/dist/{chunk-6ew7x7cd.js → chunk-j2wys65b.js} +1 -1
- package/dist/{chunk-c27wqw25.js → chunk-jk62hdff.js} +2 -2
- package/dist/chunk-ptess7d1.js +3 -0
- package/dist/chunk-qkxcr7jt.js +2 -0
- package/dist/chunk-rr2grqs5.js +2 -0
- package/dist/chunk-t7xttfys.js +2 -0
- package/dist/chunk-vxcq2fte.js +10 -0
- package/dist/chunk-wktrnbx6.js +2 -0
- package/dist/chunk-yqxxa2ez.js +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +11 -11
- package/dist/jsdom/index.js +1 -1
- package/dist/matchers.d.ts +147 -0
- package/dist/matchers.js +3 -0
- package/dist/register.js +1 -1
- package/package.json +5 -1
- package/dist/chunk-009ay7s2.js +0 -10
- package/dist/chunk-411ksr8b.js +0 -2
- package/dist/chunk-485xwyn7.js +0 -2
- package/dist/chunk-esay4gc4.js +0 -2
- package/dist/chunk-gcrktrh7.js +0 -2
- package/dist/chunk-hqg9qrbb.js +0 -3
- package/dist/chunk-nxkaxqh8.js +0 -2
- package/dist/chunk-qvrtvjqf.js +0 -2
- package/dist/chunk-rxn6yzkp.js +0 -11
- package/dist/chunk-v51n1pby.js +0 -2
- package/dist/chunk-z0dfz7ny.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
[Compare changes](https://github.com/stacksjs/very-happy-dom/compare/v0.1.12...HEAD)
|
|
2
|
+
|
|
3
|
+
## 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **matchers**: add web-first assertions through expect.extend ([1f34e25](https://github.com/stacksjs/very-happy-dom/commit/1f34e25)) _(by glennmichael123 <gtorregosa@gmail.com>)_ ([#1603](https://github.com/stacksjs/very-happy-dom/issues/1603))
|
|
6
|
+
- **locator**: auto-wait for actionability, and add locator.waitFor() ([ac1eba9](https://github.com/stacksjs/very-happy-dom/commit/ac1eba9)) _(by glennmichael123 <gtorregosa@gmail.com>)_ ([#1604](https://github.com/stacksjs/very-happy-dom/issues/1604), [#1605](https://github.com/stacksjs/very-happy-dom/issues/1605))
|
|
7
|
+
|
|
8
|
+
## Contributors
|
|
9
|
+
|
|
10
|
+
- _glennmichael123 <gtorregosa@gmail.com>_
|
|
11
|
+
|
|
1
12
|
[Compare changes](https://github.com/stacksjs/very-happy-dom/compare/v0.1.11...HEAD)
|
|
2
13
|
|
|
3
14
|
## 🐛 Bug Fixes
|
package/README.md
CHANGED
|
@@ -123,6 +123,41 @@ GlobalRegistrator.register()
|
|
|
123
123
|
|
|
124
124
|
## Advanced Usage
|
|
125
125
|
|
|
126
|
+
### Web-First Assertions
|
|
127
|
+
|
|
128
|
+
Importing `very-happy-dom/matchers` registers Playwright-style matchers into
|
|
129
|
+
`bun:test`. They retry until the expectation holds or the timeout expires, which
|
|
130
|
+
is the difference that matters:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import { expect, test } from 'bun:test'
|
|
134
|
+
import { Browser } from 'very-happy-dom'
|
|
135
|
+
import 'very-happy-dom/matchers'
|
|
136
|
+
|
|
137
|
+
test('the alert reports the save', async () => {
|
|
138
|
+
const page = new Browser().newPage()
|
|
139
|
+
|
|
140
|
+
await expect(page.getByRole('alert')).toContainText('Saved')
|
|
141
|
+
})
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The one-shot rewrite — `expect(await page.getByRole('alert').textContent()).toContain('Saved')`
|
|
145
|
+
— samples once, so anything that appears after a `fetch` settles or a microtask
|
|
146
|
+
drains is a race. `.not` waits for the opposite to become true rather than
|
|
147
|
+
inverting a single sample.
|
|
148
|
+
|
|
149
|
+
Locators: `toBeAttached`, `toBeVisible`, `toBeHidden`, `toHaveCount`,
|
|
150
|
+
`toHaveText`, `toContainText`, `toHaveValue`, `toHaveAttribute`, `toHaveClass`,
|
|
151
|
+
`toBeEnabled`, `toBeDisabled`, `toBeChecked`, `toBeEditable`, `toBeFocused`,
|
|
152
|
+
`toBeEmpty`. Pages: `toHaveURL`, `toHaveTitle`. Each takes an optional
|
|
153
|
+
`{ timeout }`, defaulting to `page.setDefaultTimeout()`.
|
|
154
|
+
|
|
155
|
+
Locator actions auto-wait on the same terms — present, rendered and not
|
|
156
|
+
disabled — and `locator.waitFor({ state })` covers `attached`, `detached`,
|
|
157
|
+
`visible` and `hidden`. Two conditions Playwright checks are not checked here:
|
|
158
|
+
stable (not mid-animation) and receives-events (not covered by another element).
|
|
159
|
+
Both need a layout pass.
|
|
160
|
+
|
|
126
161
|
### Browser Context
|
|
127
162
|
|
|
128
163
|
```typescript
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { accessibleName } from '../aria/roles';
|
|
2
|
+
/** @internal Collapse whitespace, the way Playwright compares rendered text. */
|
|
3
|
+
export declare function normalize(value: string | null | undefined): string;
|
|
4
|
+
/**
|
|
5
|
+
* Compare a candidate against a matcher.
|
|
6
|
+
*
|
|
7
|
+
* A string is a substring match after whitespace normalisation unless `exact`,
|
|
8
|
+
* which is Playwright's behaviour and what makes `getByText('Save')` find
|
|
9
|
+
* "Save changes". A RegExp is always used as written.
|
|
10
|
+
*
|
|
11
|
+
* @internal Shared with the web-first matchers, so `toContainText` and
|
|
12
|
+
* `getByText` cannot disagree about what "contains" means.
|
|
13
|
+
*/
|
|
14
|
+
export declare function matchesText(candidate: string, expected: string | RegExp, exact?: boolean): boolean;
|
|
2
15
|
/** Elements under `root` carrying `role`, narrowed by the options given. */
|
|
3
16
|
export declare function byRole(root: any, role: string, options?: GetByRoleOptions): any[];
|
|
4
17
|
/**
|
|
@@ -31,12 +44,29 @@ export declare interface FilterOptions {
|
|
|
31
44
|
hasText?: string | RegExp
|
|
32
45
|
hasNotText?: string | RegExp
|
|
33
46
|
}
|
|
47
|
+
export declare interface WaitForOptions {
|
|
48
|
+
state?: WaitForState
|
|
49
|
+
timeout?: number
|
|
50
|
+
}
|
|
51
|
+
/** Every action takes a timeout, falling back to the page's default. */
|
|
52
|
+
export declare interface ActionOptions {
|
|
53
|
+
timeout?: number
|
|
54
|
+
}
|
|
34
55
|
/** Returns the current matches, re-evaluated on each call. */
|
|
35
56
|
declare type Resolver = () => any[];
|
|
57
|
+
/**
|
|
58
|
+
* What a wait is waiting for.
|
|
59
|
+
*
|
|
60
|
+
* `attached` and `visible` are about one element arriving; `detached` and
|
|
61
|
+
* `hidden` are about it going away, which is the state a closing modal or a
|
|
62
|
+
* finished spinner passes through.
|
|
63
|
+
*/
|
|
64
|
+
export type WaitForState = 'attached' | 'detached' | 'visible' | 'hidden';
|
|
36
65
|
export declare class Locator {
|
|
37
66
|
constructor(_page: any, _resolver: Resolver, _description: string);
|
|
38
67
|
toString(): string;
|
|
39
|
-
|
|
68
|
+
waitFor(options?: WaitForOptions): Promise<void>;
|
|
69
|
+
elementHandle(options?: ActionOptions): Promise<any>;
|
|
40
70
|
elementHandles(): Promise<any[]>;
|
|
41
71
|
locator(selector: string): Locator;
|
|
42
72
|
filter(options: FilterOptions): Locator;
|
|
@@ -65,12 +95,12 @@ export declare class Locator {
|
|
|
65
95
|
isEnabled(): Promise<boolean>;
|
|
66
96
|
isDisabled(): Promise<boolean>;
|
|
67
97
|
isEditable(): Promise<boolean>;
|
|
68
|
-
click(): Promise<void>;
|
|
69
|
-
focus(): Promise<void>;
|
|
70
|
-
blur(): Promise<void>;
|
|
71
|
-
hover(): Promise<void>;
|
|
72
|
-
fill(value: string): Promise<void>;
|
|
73
|
-
type(text: string, options?: { delay?: number }): Promise<void>;
|
|
74
|
-
check(): Promise<void>;
|
|
75
|
-
uncheck(): Promise<void>;
|
|
98
|
+
click(options?: ActionOptions): Promise<void>;
|
|
99
|
+
focus(options?: ActionOptions): Promise<void>;
|
|
100
|
+
blur(options?: ActionOptions): Promise<void>;
|
|
101
|
+
hover(options?: ActionOptions): Promise<void>;
|
|
102
|
+
fill(value: string, options?: ActionOptions): Promise<void>;
|
|
103
|
+
type(text: string, options?: { delay?: number, timeout?: number }): Promise<void>;
|
|
104
|
+
check(options?: ActionOptions): Promise<void>;
|
|
105
|
+
uncheck(options?: ActionOptions): Promise<void>;
|
|
76
106
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Poll `check` until it is satisfied, then return its value; throw once
|
|
3
|
+
* `timeout` has elapsed.
|
|
4
|
+
*
|
|
5
|
+
* `reason` is the last thing actually observed, and it goes into the timeout
|
|
6
|
+
* message because "it was never there" and "it was there but hidden" are
|
|
7
|
+
* different bugs that a bare "timed out" cannot tell apart.
|
|
8
|
+
*
|
|
9
|
+
* The first check runs before any sleep, so the ordinary case — the condition
|
|
10
|
+
* already holds — costs nothing. A `timeout` of 0 therefore means exactly one
|
|
11
|
+
* check.
|
|
12
|
+
*
|
|
13
|
+
* A `check` that throws is not retried. Some failures are not states the DOM
|
|
14
|
+
* will grow out of, and retrying them would turn a clear error into a timeout.
|
|
15
|
+
*/
|
|
16
|
+
export declare function waitUntil<T>(check: () => Settled<T> | Pending, options: { timeout: number, describe: (reason: string) => string }): Promise<T>;
|
|
17
|
+
/**
|
|
18
|
+
* How often a wait re-checks.
|
|
19
|
+
*
|
|
20
|
+
* There is no rendering loop here, so what a wait is really waiting for is the
|
|
21
|
+
* task queue to turn over: a timer firing, a `fetch` settling, a microtask
|
|
22
|
+
* draining, a custom element upgrading. 20ms is short enough that a passing
|
|
23
|
+
* test does not feel it, and long enough that a failing one does not re-walk
|
|
24
|
+
* the DOM thousands of times on its way to the timeout.
|
|
25
|
+
*
|
|
26
|
+
* Exported so the web-first matchers re-check on the same cadence. Two waits
|
|
27
|
+
* polling at different rates would be a needless second thing to reason about.
|
|
28
|
+
*/
|
|
29
|
+
export declare const POLL_INTERVAL_MS: 20;
|
|
30
|
+
/** Satisfied, carrying the value the caller wanted. */
|
|
31
|
+
declare interface Settled<T> {
|
|
32
|
+
done: true
|
|
33
|
+
value: T
|
|
34
|
+
}
|
|
35
|
+
/** Not satisfied yet, carrying what was actually seen. */
|
|
36
|
+
declare interface Pending {
|
|
37
|
+
done: false
|
|
38
|
+
reason: string
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* One definition of "wait until this holds", and one error for when it does not.
|
|
42
|
+
*
|
|
43
|
+
* `waitForSelector` and `waitForFunction` each grew their own loop and then
|
|
44
|
+
* disagreed about what a timeout is: one returns `null`, the other throws
|
|
45
|
+
* (#1605). A third copy for locators would have made three copies and three
|
|
46
|
+
* opinions, so this is the one locators use and the one those two should move
|
|
47
|
+
* onto.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Thrown when a wait gives up.
|
|
51
|
+
*
|
|
52
|
+
* A distinct type so a caller can catch a timeout without matching on the
|
|
53
|
+
* message, which is the only thing available today.
|
|
54
|
+
*/
|
|
55
|
+
export declare class TimeoutError extends Error {
|
|
56
|
+
readonly name: string;
|
|
57
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r,
|
|
2
|
+
import{r,E}from"./chunk-3d9kwyx0.js";import{L,b}from"./chunk-7c8vh5me.js";function m(e,t){let[o,...s]=e.split(";").map((p)=>p.trim()),n=o.indexOf("="),i=n===-1?o:o.slice(0,n),l=n===-1?"":o.slice(n+1),c={key:i,value:l,originURL:t};for(let p of s){let[d,u=""]=p.split("=").map((a)=>a.trim());switch(d.toLowerCase()){case"domain":c.domain=u.replace(/^\./,"").toLowerCase();break;case"path":c.path=u;break;case"expires":{let a=new Date(u);if(!Number.isNaN(a.getTime()))c.expires=a;break}case"max-age":{let a=Number(u);if(Number.isFinite(a))c.expires=new Date(Date.now()+a*1000);break}case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break;case"samesite":{let a=u.toLowerCase();if(a==="strict"||a==="lax"||a==="none")c.sameSite=a.charAt(0).toUpperCase()+a.slice(1);break}}}return c}function k(e){return e.map((t)=>`${t.key}=${t.value??""}`).join("; ")}class Q{_container;constructor(e){this._container=e??new L}_getContainer(){return this._container}setCookie(e,t,o,s){let n=typeof o==="function"?o:s;try{let i=m(e,t);if(this._container.addCookies([i]),n)return n(null,i);return Promise.resolve(i)}catch(i){if(n)return n(i);return Promise.reject(i)}}getCookies(e,t,o){let s=typeof t==="object"&&t!==null?t:{},n=typeof t==="function"?t:o;try{let i=this._container.getCookies(e,s.http===!0);if(n)return n(null,i);return Promise.resolve(i)}catch(i){if(n)return n(i);return Promise.reject(i)}}getCookieString(e,t){try{let o=k(this._container.getCookies(e));if(t)return t(null,o);return Promise.resolve(o)}catch(o){if(t)return t(o);return Promise.reject(o)}}}import{Buffer as f}from"buffer";class Ye{_strictSSL;_proxy;_userAgent;constructor(e={}){this._strictSSL=e.strictSSL??!0,this._proxy=e.proxy,this._userAgent=e.userAgent??"Mozilla/5.0 (VeryHappyDOM)"}get userAgent(){return this._userAgent}fetch(e,t={}){return globalThis.fetch(e,{headers:{"User-Agent":this._userAgent,...t.accept?{Accept:t.accept}:{},...t.referrer?{Referer:t.referrer}:{}}}).then((o)=>o.arrayBuffer()).then((o)=>f.from(o))}}var w=["log","info","warn","error","debug","dir","dirxml","trace","table","group","groupCollapsed","groupEnd","time","timeEnd","timeLog","count","countReset","assert","clear"];class Z{_listeners=new Map;_sinks=[];on(e,t){let o=this._listeners.get(e);if(!o)o=new Set,this._listeners.set(e,o);return o.add(t),this}off(e,t){return this._listeners.get(e)?.delete(t),this}removeAllListeners(e){if(e)this._listeners.delete(e);else this._listeners.clear();return this}listeners(e){return Array.from(this._listeners.get(e)??[])}emit(e,...t){let o=this._listeners.get(e),s=!1;if(o&&o.size>0){s=!0;for(let n of o)try{n(...t)}catch{}}for(let n of this._sinks){if(e==="jsdomError"&&n.options.omitJSDOMErrors)continue;let i=n.target[e];if(typeof i==="function")i.apply(n.target,t)}return s}sendTo(e,t={}){return this._sinks.push({target:e,options:t}),this}_asConsole(){let e=this,t={};for(let o of w)t[o]=(...s)=>{e.emit(o,...s)};return t}}class F{window;virtualConsole;cookieJar;constructor(e="",t={}){let{url:o="about:blank",referrer:s,contentType:n="text/html",virtualConsole:i=new Z,cookieJar:l=new Q,beforeParse:c,pretendToBeVisual:p=!1,runScripts:d}=t;this.virtualConsole=i,this.cookieJar=l;let u={url:o,console:i._asConsole()};this.window=new b(u);let C=this.window;if(C._cookieJar=l,s)this.window.document.referrer=s;if(n)this.window.document.contentType=n;if(this.window.addEventListener("error",(a)=>{let g=a?.error??a;this.virtualConsole.emit("jsdomError",g)}),d==="outside-only"||d==="dangerously"){let a=this.window;a.eval=globalThis.eval.bind(globalThis),a.Function=globalThis.Function}if(c?.(this.window),this.window.document.readyState="loading",e)this._parse(e,n);if(d==="dangerously")this._executeScripts();queueMicrotask(()=>{this.window.document.readyState="interactive",this.window.document.dispatchEvent(new r("DOMContentLoaded",{bubbles:!0,cancelable:!1})),this.window.document.readyState="complete",this.window.dispatchEvent(new r("load"))})}_executeScripts(){let t=this.window.document.querySelectorAll("script");for(let o of t){if(o.getAttribute("src"))continue;let n=o.getAttribute("type");if(n&&n!=="text/javascript"&&n!=="application/javascript"&&n!=="module")continue;let i=o.textContent??"";if(!i.trim())continue;try{Function("window","document",`with (window) { ${i} }`)(this.window,this.window.document)}catch(l){this.virtualConsole.emit("jsdomError",l)}}}serialize(){let e=this.window.document,t=e.documentElement;if(!t)return"";let o=e.doctype===null?"<!DOCTYPE html>":"",s=t.outerHTML??"";return`${o}${s}`}reconfigure(e){if(e.url!==void 0){let t=this.window;t.location=e.url}}nodeLocation(e){return null}toString(){return this.serialize()}static fragment(e=""){let o=new F().window.document.createElement("template");return o.innerHTML=e,o.content}static async fromURL(e,t={}){let o=await globalThis.fetch(e),s=await o.text(),n=o.headers.get("content-type")??t.contentType;return new F(s,{...t,url:e,contentType:n??void 0})}static async fromFile(e,t={}){let s=await Bun.file(e).text(),n=t.url??`file://${e.startsWith("/")?e:`${process.cwd()}/${e}`}`;return new F(s,{...t,url:n})}_parse(e,t){let o=this.window.document,n=new this.window.DOMParser().parseFromString(e,t);if(n.documentElement)o.documentElement=n.documentElement,o.childNodes=n.childNodes,o.head=n.head,o.body=n.body,E(o.documentElement,o);o.contentType=t}}export{Q,Ye,Z,F};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function g(e,n,a){try{e[n]=a;return}catch{}try{Object.defineProperty(e,n,{configurable:!0,enumerable:n!=="_path",writable:!0,value:a})}catch{}}function m(e,n){return Boolean(e?.[n])}function se(e){return Boolean(e&&typeof e==="object")}function k(e){return se(e)?e.parentNode??null:null}function F(e){return e?.nodeType===11&&e?.nodeName==="#shadow-root"&&e?.host}function de(e,n){let a=[],u=e;while(u){if(a.push(u),F(u)&&n?.composed!==!0)break;u=u._getEventParent?.()??null}return a}function ue(e){let n=e;while(n){if(F(n))return n;n=k(n)}return null}function ce(e,n){let a=e;while(a){if(a===n)return!0;a=k(a)}return!1}function U(e,n){let a=ue(e);if(!a)return e;if(n===a||ce(n,a))return e;return a.host??e}class f{_eventListeners=new Map;addEventListener(e,n,a={}){if(!n)return;let u=a!==void 0&&a!==!1&&a!==!0&&typeof a==="object",N=u?a.capture??!1:a===!0,p=u?a.once??!1:!1,T=u?a.passive??!1:!1,h=u?a.signal:void 0;if(h?.aborted)return;let y=this._eventListeners.get(e);if(y){for(let _=0;_<y.length;_++)if(y[_].listener===n&&y[_].options.capture===N)return;y.push({listener:n,options:{capture:N,once:p,passive:T},signal:h})}else this._eventListeners.set(e,[{listener:n,options:{capture:N,once:p,passive:T},signal:h}]);if(h)h.addEventListener("abort",()=>{this.removeEventListener(e,n,{capture:N})},{once:!0})}removeEventListener(e,n,a={}){if(!n)return;let u=this._eventListeners.get(e);if(!u)return;let N=typeof a==="boolean"?{capture:a}:{capture:a.capture??!1},p=u.findIndex((T)=>T.listener===n&&T.options.capture===N.capture);if(p!==-1)u.splice(p,1);if(u.length===0)this._eventListeners.delete(e)}dispatchEvent(e){if(!e||typeof e.type!=="string"||!e.type)throw Error("Failed to execute dispatchEvent: event.type must be a non-empty string");let n=de(this,e);if(n.length===1){if(g(e,"target",this),g(e,"eventPhase",2),g(e,"currentTarget",this),typeof e.composedPath!=="function")g(e,"composedPath",()=>[this]);g(e,"_path",[this]);let h=()=>!1;return this._invokeEventListeners(e,!0,h),this._invokeEventListeners(e,!1,h),g(e,"eventPhase",0),g(e,"currentTarget",null),!e.defaultPrevented}let a=this,u=e?.relatedTarget??null,N=(h,y)=>{if(g(e,"eventPhase",y),g(e,"currentTarget",h),h){if(g(e,"target",U(a,h)),u)g(e,"relatedTarget",U(u,h))}};if(g(e,"target",a),g(e,"_path",[...n]),typeof e.composedPath!=="function")g(e,"composedPath",()=>[...n]);let p=()=>m(e,"_propagationStopped")||m(e,"propagationStopped"),T=()=>m(e,"_immediatePropagationStopped")||m(e,"immediatePropagationStopped");for(let h=n.length-1;h>=1;h--){if(p())break;N(n[h],1),n[h]._invokeEventListeners(e,!0,T)}if(!p()){if(N(this,2),this._invokeEventListeners(e,!0,T),!T())this._invokeEventListeners(e,!1,T)}if(e.bubbles===!0&&!p())for(let h=1;h<n.length;h++){if(p())break;N(n[h],3),n[h]._invokeEventListeners(e,!1,T)}if(g(e,"eventPhase",0),g(e,"currentTarget",null),g(e,"target",a),u)g(e,"relatedTarget",u);return!Boolean(e.defaultPrevented)}_getEventParent(){return null}_invokeEventListeners(e,n,a){let u=this._eventListeners.get(e.type);if(!u||u.length===0)return;let N=u.length===1?u:[...u];for(let p of N){if((p.options.capture??!1)!==n)continue;if(a())break;if(p.options.passive){let T=e.preventDefault;e.preventDefault=()=>{};try{p.listener.call(this,e)}catch(h){console.error("Error in event listener:",h)}e.preventDefault=T}else try{p.listener.call(this,e)}catch(T){console.error("Error in event listener:",T)}if(p.options.once)this.removeEventListener(e.type,p.listener,{capture:n})}}}var t=1,G=2,i=3,z=4,Y=5,q=6,W=7,c=8,o=9,K=10,C=11,X=12,x=1,v=2,J=4,M=8,Te=16,w=32;function Ii(e){return e?.nodeType===t}function j(e,n){let a=e.nodeType===o?e:e.ownerDocument,u=a?.createTextNode?.(`${n}`);if(u)return u;let{VirtualTextNode:N}=import.meta.require("./chunk-qkxcr7jt.js"),p=new N(`${n}`);return p.ownerDocument=a??null,p}function O(e){let n=e.nodeType===o?e:e.ownerDocument,a=n?.createDocumentFragment?.();if(a)return a;let{VirtualDocumentFragment:u}=import.meta.require("./chunk-yqxxa2ez.js"),N=new u;return N.ownerDocument=n??null,N}function b(e,n){return n.map((a)=>typeof a==="string"?j(e,a):a)}function Q(e,n){if(e===n)return!0;if(!e||!n)return!1;if(e.nodeType!==n.nodeType||e.nodeName!==n.nodeName||e.nodeValue!==n.nodeValue)return!1;if(e.attributes.size!==n.attributes.size)return!1;for(let[a,u]of e.attributes)if(n.attributes.get(a)!==u)return!1;if(e.childNodes.length!==n.childNodes.length)return!1;for(let a=0;a<e.childNodes.length;a++)if(!Q(e.childNodes[a],n.childNodes[a]))return!1;return!0}class d extends f{static ELEMENT_NODE=t;static ATTRIBUTE_NODE=G;static TEXT_NODE=i;static CDATA_SECTION_NODE=z;static ENTITY_REFERENCE_NODE=Y;static ENTITY_NODE=q;static PROCESSING_INSTRUCTION_NODE=W;static COMMENT_NODE=c;static DOCUMENT_NODE=o;static DOCUMENT_TYPE_NODE=K;static DOCUMENT_FRAGMENT_NODE=C;static NOTATION_NODE=X;static DOCUMENT_POSITION_DISCONNECTED=x;static DOCUMENT_POSITION_PRECEDING=v;static DOCUMENT_POSITION_FOLLOWING=J;static DOCUMENT_POSITION_CONTAINS=M;static DOCUMENT_POSITION_CONTAINED_BY=Te;static DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=w;ELEMENT_NODE=t;ATTRIBUTE_NODE=G;TEXT_NODE=i;CDATA_SECTION_NODE=z;ENTITY_REFERENCE_NODE=Y;ENTITY_NODE=q;PROCESSING_INSTRUCTION_NODE=W;COMMENT_NODE=c;DOCUMENT_NODE=o;DOCUMENT_TYPE_NODE=K;DOCUMENT_FRAGMENT_NODE=C;NOTATION_NODE=X;DOCUMENT_POSITION_DISCONNECTED=x;DOCUMENT_POSITION_PRECEDING=v;DOCUMENT_POSITION_FOLLOWING=J;DOCUMENT_POSITION_CONTAINS=M;DOCUMENT_POSITION_CONTAINED_BY=Te;DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=w;nodeValue=null;attributes=new Map;childNodes=[];parentNode=null;ownerDocument=null;get children(){let e=this.childNodes,n=[];for(let a=0;a<e.length;a++)if(e[a].nodeType===t)n.push(e[a]);return n}get firstElementChild(){return this.childNodes.find((e)=>e.nodeType===t)??null}get lastElementChild(){for(let e=this.childNodes.length-1;e>=0;e--)if(this.childNodes[e].nodeType===t)return this.childNodes[e];return null}get childElementCount(){let e=0;for(let n of this.childNodes)if(n.nodeType===t)e++;return e}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}get previousSibling(){if(!this.parentNode)return null;let e=this.parentNode.childNodes;for(let n=0;n<e.length;n++)if(e[n]===this)return n>0?e[n-1]:null;return null}get nextSibling(){if(!this.parentNode)return null;let e=this.parentNode.childNodes;for(let n=0;n<e.length;n++)if(e[n]===this)return n<e.length-1?e[n+1]:null;return null}get parentElement(){return Ii(this.parentNode)?this.parentNode:null}get isConnected(){let e=this;while(e){if(e.nodeType===o)return!0;e=e.parentNode}return!1}hasChildNodes(){return this.childNodes.length>0}get baseURI(){return this.ownerDocument?.baseURI||""}append(...e){let n=this;if(typeof n.appendChild!=="function")throw Error("This node type does not support append()");let a=b(this,e);if(a.length===0)return;if(a.length===1){n.appendChild(a[0]);return}let u=O(this);for(let N of a)u.appendChild(N);n.appendChild(u)}prepend(...e){let n=this;if(typeof n.insertBefore!=="function")throw Error("This node type does not support prepend()");let a=b(this,e);if(a.length===0)return;if(a.length===1){n.insertBefore(a[0],this.firstChild??null);return}let u=O(this);for(let N of a)u.appendChild(N);n.insertBefore(u,this.firstChild??null)}before(...e){if(!this.parentNode)return;let n=this.parentNode,a=b(this.parentNode,e);if(a.length===0)return;if(a.length===1){n.insertBefore(a[0],this);return}let u=O(this.parentNode);for(let N of a)u.appendChild(N);n.insertBefore(u,this)}after(...e){if(!this.parentNode)return;let n=this.parentNode,a=this.nextSibling,u=b(this.parentNode,e);if(u.length===0)return;if(u.length===1){n.insertBefore(u[0],a??null);return}let N=O(this.parentNode);for(let p of u)N.appendChild(p);n.insertBefore(N,a??null)}replaceWith(...e){if(!this.parentNode)return;let n=this.parentNode,a=b(this.parentNode,e);if(a.length===0){n.removeChild(this);return}if(a.length===1){n.replaceChild(a[0],this);return}let u=O(this.parentNode);for(let N of a)u.appendChild(N);n.replaceChild(u,this)}remove(){if(this.parentNode)this.parentNode.removeChild(this)}replaceChildren(...e){let n=this;if(typeof n.removeChild!=="function"||typeof n.appendChild!=="function")throw Error("This node type does not support replaceChildren()");while(this.childNodes.length>0)n.removeChild(this.childNodes[this.childNodes.length-1]);for(let a of e)if(typeof a==="string")n.appendChild(j(this,a));else n.appendChild(a)}isSameNode(e){return this===e}isEqualNode(e){return Q(this,e)}getRootNode(e={}){let n=this,a=this;while(n.parentNode){let u=n.parentNode;if(a=u,u.nodeType===C&&u.host&&e.composed!==!0)return u;n=u}return a}contains(e){if(!e)return!1;let n=e;while(n){if(n===this)return!0;n=n.parentNode}return!1}normalize(){let e=0;while(e<this.childNodes.length){let n=this.childNodes[e];if(n.nodeType===i){let a=n.nodeValue||"",u=e+1;while(u<this.childNodes.length&&this.childNodes[u].nodeType===i)a+=this.childNodes[u].nodeValue||"",this.childNodes.splice(u,1);if(a===""){this.childNodes.splice(e,1),n.parentNode=null;continue}n.nodeValue=a}else if(typeof n.normalize==="function")n.normalize();e++}}compareDocumentPosition(e){if(e===this)return 0;let n=this._virtualRootNode(this),a=this._virtualRootNode(e);if(n!==a)return x|w;if(this!==e&&this.contains(e))return M|v;if(e!==this&&this._virtualNodeContains(e,this))return Te|J;let u=this._virtualDocumentOrder(n);return u.indexOf(this)<u.indexOf(e)?J:v}_getEventParent(){if(this.parentNode)return this.parentNode;if(this.nodeType===o)return this.defaultView??null;return null}_virtualRootNode(e){let n=e;while(n.parentNode)n=n.parentNode;return n}_virtualNodeContains(e,n){return e!==n&&typeof e.contains==="function"?e.contains(n):!1}_virtualDocumentOrder(e){let n=[],a=(u)=>{n.push(u);for(let N of u.childNodes)a(N)};return a(e),n}}function Ne(e){let n=e?.constructor;if(!n||!Array.isArray(n.observedAttributes))return[];return n.observedAttributes.map((a)=>`${a}`.toLowerCase())}function Z(e){return e._getInternalShadowRoot?.()??null}function ee(e){return e.tagName==="TEMPLATE"?e.content??null:null}function D(e,n){if(e.nodeType===t)n(e);let a=Z(e);if(a)D(a,n);if(ee(e))return;for(let u of e.childNodes)D(u,n)}function V(e,n){if(e.nodeType===t)n(e);let a=Z(e);if(a)V(a,n);let u=ee(e);if(u){V(u,n);return}for(let N of e.childNodes)V(N,n)}function Ee(e){D(e,(n)=>{if(typeof n.connectedCallback==="function"&&n.isConnected)n.connectedCallback()})}function I(e){D(e,(n)=>{if(typeof n.disconnectedCallback==="function")n.disconnectedCallback()})}function te(e,n,a){if(!n||!a||n===a)return;V(e,(u)=>{if(typeof u.adoptedCallback==="function")u.adoptedCallback()})}function ve(e,n,a,u){if(typeof e?.attributeChangedCallback!=="function")return;if(a===u)return;if(!Ne(e).includes(n.toLowerCase()))return;e.attributeChangedCallback(n,a,u)}class r{static NONE=0;static CAPTURING_PHASE=1;static AT_TARGET=2;static BUBBLING_PHASE=3;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;type;target=null;currentTarget=null;bubbles;cancelable;composed;defaultPrevented=!1;propagationStopped=!1;immediatePropagationStopped=!1;eventPhase=0;timeStamp;isTrusted=!1;_path=[];_propagationStopped=!1;_immediatePropagationStopped=!1;constructor(e,n={}){this.type=e,this.bubbles=n.bubbles??!1,this.cancelable=n.cancelable??!1,this.composed=n.composed??!1,this.timeStamp=Date.now()}initEvent(e,n=!1,a=!1){this.type=e,this.bubbles=n,this.cancelable=a,this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this._propagationStopped=!1,this._immediatePropagationStopped=!1}preventDefault(){if(this.cancelable)this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0,this._propagationStopped=!0}stopImmediatePropagation(){this.immediatePropagationStopped=!0,this.propagationStopped=!0,this._immediatePropagationStopped=!0,this._propagationStopped=!0}composedPath(){return[...this._path]}get cancelBubble(){return this.propagationStopped}set cancelBubble(e){if(e)this.stopPropagation()}get returnValue(){return!this.defaultPrevented}set returnValue(e){if(!e)this.preventDefault()}get srcElement(){return this.target}}var ne=new WeakMap,R=new WeakSet;function oe(e){return e?.nodeType===11&&e?.nodeName==="#shadow-root"&&Boolean(e.host)}function re(e){let n=e;while(n){if(oe(n))return n;n=n.parentNode}return null}function ie(e){return e?._getInternalShadowRoot?.()?.querySelectorAll?.("slot")??[]}function pe(e,n){return e.length===n.length&&e.every((a,u)=>a===n[u])}function he(e){if(R.has(e))return;R.add(e),queueMicrotask(()=>{R.delete(e);let n=ne.get(e)??[],a=ci(e);if(ne.set(e,a),!pe(n,a))e.dispatchEvent(new r("slotchange"))})}function ci(e,n={}){let a=re(e);if(!a)return[];let u=e.getAttribute?.("name")??"";if(ie(a.host).find((h)=>(h.getAttribute?.("name")??"")===u)!==e)return[];let p=(a.host?.childNodes??[]).filter((h)=>{if(h.nodeType!==t&&h.nodeType!==i)return!1;return(h.nodeType===t?h.getAttribute?.("slot")??"":"")===u});if(!n.flatten)return p;return(p.length>0?p:e.childNodes??[]).flatMap((h)=>{if(h?.tagName==="SLOT"&&typeof h.assignedNodes==="function")return h.assignedNodes({flatten:!0});return[h]})}function Gi(e,n={}){return ci(e,n).filter((a)=>a.nodeType===t)}function B(e){let n=e?._getInternalShadowRoot?.()?e:null,a=oe(e)?e:re(e),u=e?.parentNode?._getInternalShadowRoot?.()?e.parentNode:null,N=n??a?.host??u;if(!N)return;for(let p of ie(N))he(p)}function S(e,n,a,u,N){if(n.length===0&&a.length===0)return;l._queueMutationRecord({type:"childList",target:e,addedNodes:n,removedNodes:a,previousSibling:u,nextSibling:N,attributeName:null,attributeNamespace:null,oldValue:null}),B(e)}function ae(e){return e.nodeType===o?e:e.ownerDocument}function fe(e){return e._getInternalShadowRoot?.()??null}function ge(e){return e.tagName==="TEMPLATE"?e.content??null:null}function A(e){if(!e._lastTraversalParent&&!e._lastTraversalNextSibling)return;e._lastTraversalParent=null,e._lastTraversalNextSibling=null;for(let n of e.childNodes)A(n)}function E(e,n){if(e.ownerDocument===n&&e.nodeType!==o)return;let a=e.ownerDocument??null;if(e.nodeType!==o)e.ownerDocument=n;if(e.nodeType===t){let u=e.attributes?.get("id");if(u!==void 0){if(a?._idIndex)a._idIndex.delete(u);if(n?._idIndex)n._idIndex.set(u,e)}let N=fe(e);if(N)E(N,n);let p=ge(e);if(p)p.ownerDocument=n}te(e,a,n);for(let u of e.childNodes)E(u,n)}function we(e,n){let a=n;while(a){if(a===e)return!0;a=a.parentNode}return!1}function _e(e){let n=e.ownerDocument;if(!n||!n._idIndex||n._idIndex.size===0)return;if(e.nodeType===t){let a=e.attributes?.get("id");if(a!==void 0)n._idIndex.delete(a);for(let u of e.childNodes)if(u.nodeType===t)_e(u)}}function le(e){let n=e.isConnected===!0;if(!e.parentNode)return;_e(e);let a=e.parentNode,u=a.childNodes,N=u.indexOf(e),p=N>=0&&N<u.length-1?u[N+1]:null;if(N!==-1)u.splice(N,1);if(e._lastTraversalParent=a,e._lastTraversalNextSibling=p,e.parentNode=null,B(a),n)I(e)}function L(e,n){if(n===e||we(n,e))throw Error("The new child element contains the parent");if(n.nodeType===C){let a=[...n.childNodes];n.childNodes=[];let u=ae(e);for(let N of a){if(N.parentNode)le(N),A(N);N.parentNode=e,E(N,u)}return a}if(n.parentNode)le(n),A(n);return n.parentNode=e,E(n,ae(e)),[n]}function P(e,n){let a=L(e,n),u=e.childNodes.length>0?e.childNodes[e.childNodes.length-1]:null;if(a.length===1)e.childNodes.push(a[0]);else e.childNodes.push(...a);for(let N of a)if(N.isConnected===!0)Ee(N);return S(e,a,[],u,null),n}function ze(e,n,a){if(a===null)return P(e,n);let u=e.childNodes.indexOf(a);if(u===-1)throw Error("Reference node not found");let N=L(e,n),p=u>0?e.childNodes[u-1]:null;e.childNodes.splice(u,0,...N);for(let T of N)if(T.isConnected===!0)Ee(T);return S(e,N,[],p,a),n}function Se(e,n){let a=e.childNodes.indexOf(n);if(a===-1)throw Error("Child node not found");_e(n);let u=n.isConnected===!0,N=a>0?e.childNodes[a-1]:null,p=a<e.childNodes.length-1?e.childNodes[a+1]:null;if(e.childNodes.splice(a,1),n._lastTraversalParent=e,n._lastTraversalNextSibling=p,n.parentNode=null,u)I(n);return S(e,[],[n],N,p),n}function je(e,n,a){let u=e.childNodes.indexOf(a);if(u===-1)throw Error("Old node not found");_e(a);let N=L(e,n),p=a.isConnected===!0,T=u>0?e.childNodes[u-1]:null,h=u<e.childNodes.length-1?e.childNodes[u+1]:null;if(e.childNodes.splice(u,1,...N),a._lastTraversalParent=e,a._lastTraversalNextSibling=h,a.parentNode=null,p)I(a);for(let y of N)if(y.isConnected===!0)Ee(y);return S(e,N,[a],T,h),a}function H(e){if(e.nodeType===i)return e.nodeValue||"";if(e.nodeType===c)return"";let n="";for(let a of e.childNodes)n+=H(a);return n}function ye(e,n,a,u){if(e===n)return!0;if(!a)return!1;let N=e.parentNode;while(N){if(N===n)return!0;N=N.parentNode}for(let p of u)if(e===p||we(p,e))return!0;return!1}function Oe(e,n){if(e.type==="childList")return n.childList===!0;if(e.type==="attributes"){if(n.attributes!==!0)return!1;if(n.attributeFilter&&e.attributeName)return n.attributeFilter.map((a)=>a.toLowerCase()).includes(e.attributeName.toLowerCase());return!0}if(e.type==="characterData")return n.characterData===!0;return!1}function be(e){let n={...e};if(n.attributeOldValue===!0||n.attributeFilter){if(n.attributes===!1)throw TypeError("Failed to execute observe: attributeOldValue/attributeFilter requires attributes to be true");n.attributes=!0}if(n.characterDataOldValue===!0){if(n.characterData===!1)throw TypeError("Failed to execute observe: characterDataOldValue requires characterData to be true");n.characterData=!0}if(n.childList!==!0&&n.attributes!==!0&&n.characterData!==!0)throw TypeError("Failed to execute observe: at least one of childList, attributes, or characterData must be true");return n}class l{static _observers=new Set;_callback;_records=[];_observations=new Map;_scheduled=!1;_transientRoots=new Set;constructor(e){this._callback=e}observe(e,n={}){let a=be(n),u=this._observations.get(e);if(u){let N={...u,...a};if(u.attributeFilter&&a.attributeFilter){let p=new Set([...u.attributeFilter,...a.attributeFilter]);N.attributeFilter=Array.from(p)}this._observations.set(e,N)}else this._observations.set(e,a);l._observers.add(this)}disconnect(){this._observations.clear(),l._observers.delete(this),this._records=[],this._scheduled=!1,this._transientRoots.clear()}takeRecords(){let e=this._records;return this._records=[],e}_addRecord(e){if(this._records.push(e),this._scheduled)return;this._scheduled=!0,queueMicrotask(()=>{if(this._scheduled=!1,this._records.length>0){let n=this.takeRecords();this._callback(n,this)}this._transientRoots.clear()})}static _queueMutationRecord(e){if(l._observers.size===0)return;for(let n of l._observers)for(let[a,u]of n._observations){if(!ye(e.target,a,u.subtree===!0,n._transientRoots))continue;if(e.type==="childList"&&e.removedNodes.length>0&&u.subtree===!0)for(let p of e.removedNodes)n._transientRoots.add(p);if(!Oe(e,u))continue;n._addRecord({...e,oldValue:e.type==="attributes"?u.attributeOldValue?e.oldValue:null:e.type==="characterData"?u.characterDataOldValue?e.oldValue:null:null})}}}class s extends d{nodeType=i;nodeKind="text";nodeName="#text";nodeValue;constructor(e){super();this.nodeValue=e}get textContent(){return this.nodeValue||""}set textContent(e){let n=this.nodeValue||"";this.nodeValue=e,l._queueMutationRecord({type:"characterData",target:this,addedNodes:[],removedNodes:[],previousSibling:null,nextSibling:null,attributeName:null,attributeNamespace:null,oldValue:n})}get data(){return this.nodeValue||""}set data(e){this.textContent=e}get length(){return(this.nodeValue||"").length}substringData(e,n){let a=this.nodeValue||"";if(e<0||e>a.length)throw new DOMException("The index is not in the allowed range.","IndexSizeError");return a.slice(e,e+n)}appendData(e){this.textContent=(this.nodeValue||"")+e}insertData(e,n){let a=this.nodeValue||"";if(e<0||e>a.length)throw new DOMException("The index is not in the allowed range.","IndexSizeError");this.textContent=a.slice(0,e)+n+a.slice(e)}deleteData(e,n){let a=this.nodeValue||"";if(e<0||e>a.length)throw new DOMException("The index is not in the allowed range.","IndexSizeError");this.textContent=a.slice(0,e)+a.slice(e+n)}replaceData(e,n,a){let u=this.nodeValue||"";if(e<0||e>u.length)throw new DOMException("The index is not in the allowed range.","IndexSizeError");this.textContent=u.slice(0,e)+a+u.slice(e+n)}splitText(e){let n=this.nodeValue||"";if(e<0||e>n.length)throw new DOMException("The index is not in the allowed range.","IndexSizeError");let a=n.slice(e);this.textContent=n.slice(0,e);let u=new s(a);if(u.ownerDocument=this.ownerDocument,this.parentNode){let N=this.parentNode,p=N.childNodes,T=p.indexOf(this);if(T!==-1&&T<p.length-1)N.insertBefore(u,p[T+1]);else N.appendChild(u)}return u}get wholeText(){let e="",n=this;while(n?.previousSibling?.nodeType===i)n=n.previousSibling;while(n&&n.nodeType===i)e+=n.nodeValue||"",n=n.nextSibling;return e}cloneNode(){return new s(this.nodeValue)}}
|
|
3
|
+
export{f,r,Ee,ve,ci,Gi,B,E,we,_e,P,ze,Se,je,H,l,s,t,i,c,o,C,J,Te,Ii,d};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Z={transparent:{r:0,g:0,b:0,a:0},black:{r:0,g:0,b:0,a:255},white:{r:255,g:255,b:255,a:255},red:{r:255,g:0,b:0,a:255},green:{r:0,g:128,b:0,a:255},blue:{r:0,g:0,b:255,a:255},yellow:{r:255,g:255,b:0,a:255},cyan:{r:0,g:255,b:255,a:255},magenta:{r:255,g:0,b:255,a:255},gray:{r:128,g:128,b:128,a:255},grey:{r:128,g:128,b:128,a:255},silver:{r:192,g:192,b:192,a:255},maroon:{r:128,g:0,b:0,a:255},olive:{r:128,g:128,b:0,a:255},lime:{r:0,g:255,b:0,a:255},aqua:{r:0,g:255,b:255,a:255},teal:{r:0,g:128,b:128,a:255},navy:{r:0,g:0,b:128,a:255},fuchsia:{r:255,g:0,b:255,a:255},purple:{r:128,g:0,b:128,a:255},orange:{r:255,g:165,b:0,a:255},pink:{r:255,g:192,b:203,a:255},brown:{r:165,g:42,b:42,a:255},gold:{r:255,g:215,b:0,a:255},indigo:{r:75,g:0,b:130,a:255},violet:{r:238,g:130,b:238,a:255},coral:{r:255,g:127,b:80,a:255},salmon:{r:250,g:128,b:114,a:255},khaki:{r:240,g:230,b:140,a:255},plum:{r:221,g:160,b:221,a:255},orchid:{r:218,g:112,b:214,a:255},turquoise:{r:64,g:224,b:208,a:255},tan:{r:210,g:180,b:140,a:255},chocolate:{r:210,g:105,b:30,a:255},tomato:{r:255,g:99,b:71,a:255},crimson:{r:220,g:20,b:60,a:255},darkblue:{r:0,g:0,b:139,a:255},darkgreen:{r:0,g:100,b:0,a:255},darkred:{r:139,g:0,b:0,a:255},darkorange:{r:255,g:140,b:0,a:255},lightblue:{r:173,g:216,b:230,a:255},lightgreen:{r:144,g:238,b:144,a:255},lightgray:{r:211,g:211,b:211,a:255},lightgrey:{r:211,g:211,b:211,a:255},lightpink:{r:255,g:182,b:193,a:255},lightyellow:{r:255,g:255,b:224,a:255},darkgray:{r:169,g:169,b:169,a:255},darkgrey:{r:169,g:169,b:169,a:255},slategray:{r:112,g:128,b:144,a:255},slategrey:{r:112,g:128,b:144,a:255},dimgray:{r:105,g:105,b:105,a:255},dimgrey:{r:105,g:105,b:105,a:255},whitesmoke:{r:245,g:245,b:245,a:255},snow:{r:255,g:250,b:250,a:255},ivory:{r:255,g:255,b:240,a:255},beige:{r:245,g:245,b:220,a:255},linen:{r:250,g:240,b:230,a:255},aliceblue:{r:240,g:248,b:255,a:255},antiquewhite:{r:250,g:235,b:215,a:255},azure:{r:240,g:255,b:255,a:255},bisque:{r:255,g:228,b:196,a:255},blanchedalmond:{r:255,g:235,b:205,a:255},burlywood:{r:222,g:184,b:135,a:255},cadetblue:{r:95,g:158,b:160,a:255},chartreuse:{r:127,g:255,b:0,a:255},cornflowerblue:{r:100,g:149,b:237,a:255},cornsilk:{r:255,g:248,b:220,a:255},deeppink:{r:255,g:20,b:147,a:255},deepskyblue:{r:0,g:191,b:255,a:255},dodgerblue:{r:30,g:144,b:255,a:255},firebrick:{r:178,g:34,b:34,a:255},floralwhite:{r:255,g:250,b:240,a:255},forestgreen:{r:34,g:139,b:34,a:255},gainsboro:{r:220,g:220,b:220,a:255},ghostwhite:{r:248,g:248,b:255,a:255},greenyellow:{r:173,g:255,b:47,a:255},honeydew:{r:240,g:255,b:240,a:255},hotpink:{r:255,g:105,b:180,a:255},indianred:{r:205,g:92,b:92,a:255},lavender:{r:230,g:230,b:250,a:255},lavenderblush:{r:255,g:240,b:245,a:255},lawngreen:{r:124,g:252,b:0,a:255},lemonchiffon:{r:255,g:250,b:205,a:255},lightcoral:{r:240,g:128,b:128,a:255},lightcyan:{r:224,g:255,b:255,a:255},lightgoldenrodyellow:{r:250,g:250,b:210,a:255},lightsalmon:{r:255,g:160,b:122,a:255},lightseagreen:{r:32,g:178,b:170,a:255},lightskyblue:{r:135,g:206,b:250,a:255},lightslategray:{r:119,g:136,b:153,a:255},lightslategrey:{r:119,g:136,b:153,a:255},lightsteelblue:{r:176,g:196,b:222,a:255},limegreen:{r:50,g:205,b:50,a:255},mediumaquamarine:{r:102,g:205,b:170,a:255},mediumblue:{r:0,g:0,b:205,a:255},mediumorchid:{r:186,g:85,b:211,a:255},mediumpurple:{r:147,g:112,b:219,a:255},mediumseagreen:{r:60,g:179,b:113,a:255},mediumslateblue:{r:123,g:104,b:238,a:255},mediumspringgreen:{r:0,g:250,b:154,a:255},mediumturquoise:{r:72,g:209,b:204,a:255},mediumvioletred:{r:199,g:21,b:133,a:255},midnightblue:{r:25,g:25,b:112,a:255},mintcream:{r:245,g:255,b:250,a:255},mistyrose:{r:255,g:228,b:225,a:255},moccasin:{r:255,g:228,b:181,a:255},navajowhite:{r:255,g:222,b:173,a:255},oldlace:{r:253,g:245,b:230,a:255},olivedrab:{r:107,g:142,b:35,a:255},orangered:{r:255,g:69,b:0,a:255},palegoldenrod:{r:238,g:232,b:170,a:255},palegreen:{r:152,g:251,b:152,a:255},paleturquoise:{r:175,g:238,b:238,a:255},palevioletred:{r:219,g:112,b:147,a:255},papayawhip:{r:255,g:239,b:213,a:255},peachpuff:{r:255,g:218,b:185,a:255},peru:{r:205,g:133,b:63,a:255},powderblue:{r:176,g:224,b:230,a:255},rosybrown:{r:188,g:143,b:143,a:255},royalblue:{r:65,g:105,b:225,a:255},saddlebrown:{r:139,g:69,b:19,a:255},sandybrown:{r:244,g:164,b:96,a:255},seagreen:{r:46,g:139,b:87,a:255},seashell:{r:255,g:245,b:238,a:255},sienna:{r:160,g:82,b:45,a:255},skyblue:{r:135,g:206,b:235,a:255},slateblue:{r:106,g:90,b:205,a:255},springgreen:{r:0,g:255,b:127,a:255},steelblue:{r:70,g:130,b:180,a:255},thistle:{r:216,g:191,b:216,a:255},wheat:{r:245,g:222,b:179,a:255},yellowgreen:{r:154,g:205,b:50,a:255}};function w(r){if(!r)return{r:0,g:0,b:0,a:0};if(r=r.trim().toLowerCase(),Z[r])return{...Z[r]};if(r.startsWith("#"))return dr(r);if(r.startsWith("rgb"))return cr(r);if(r.startsWith("hsl"))return lr(r);return{r:0,g:0,b:0,a:0}}function dr(r){r=r.slice(1);let o,e,a,t=255;if(r.length===3)o=Number.parseInt(r[0]+r[0],16),e=Number.parseInt(r[1]+r[1],16),a=Number.parseInt(r[2]+r[2],16);else if(r.length===4)o=Number.parseInt(r[0]+r[0],16),e=Number.parseInt(r[1]+r[1],16),a=Number.parseInt(r[2]+r[2],16),t=Number.parseInt(r[3]+r[3],16);else if(r.length===6)o=Number.parseInt(r.slice(0,2),16),e=Number.parseInt(r.slice(2,4),16),a=Number.parseInt(r.slice(4,6),16);else if(r.length===8)o=Number.parseInt(r.slice(0,2),16),e=Number.parseInt(r.slice(2,4),16),a=Number.parseInt(r.slice(4,6),16),t=Number.parseInt(r.slice(6,8),16);else return{r:0,g:0,b:0,a:0};return{r:o,g:e,b:a,a:t}}function cr(r){let o=r.match(/rgba?\s*\(\s*([^)]+)\s*\)/);if(!o)return{r:0,g:0,b:0,a:0};let e=o[1].split(/[\s,/]+/).map((b)=>b.trim()).filter(Boolean),a=R(e[0],255),t=R(e[1],255),n=R(e[2],255),g=e[3]!==void 0?R(e[3],1)*255:255;return{r:Math.round(Math.min(255,Math.max(0,a))),g:Math.round(Math.min(255,Math.max(0,t))),b:Math.round(Math.min(255,Math.max(0,n))),a:Math.round(Math.min(255,Math.max(0,g)))}}function lr(r){let o=r.match(/hsla?\s*\(\s*([^)]+)\s*\)/);if(!o)return{r:0,g:0,b:0,a:0};let e=o[1].split(/[\s,/]+/).map((p)=>p.trim()).filter(Boolean),a=ur(e[0]),t=R(e[1],100)/100,n=R(e[2],100)/100,g=e[3]!==void 0?R(e[3],1):1,{r:b,g:s,b:l}=mr(a,t,n);return{r:Math.round(b),g:Math.round(s),b:Math.round(l),a:Math.round(g*255)}}function R(r,o){if(!r)return 0;if(r.endsWith("%"))return Number.parseFloat(r)/100*o;return Number.parseFloat(r)}function ur(r){if(!r)return 0;if(r=r.toLowerCase(),r.endsWith("deg"))return Number.parseFloat(r)/360;if(r.endsWith("rad"))return Number.parseFloat(r)/(2*Math.PI);if(r.endsWith("grad"))return Number.parseFloat(r)/400;if(r.endsWith("turn"))return Number.parseFloat(r);return Number.parseFloat(r)/360}function mr(r,o,e){let a,t,n;if(o===0)a=t=n=e*255;else{let g=(l,p,i)=>{if(i<0)i+=1;if(i>1)i-=1;if(i<0.16666666666666666)return l+(p-l)*6*i;if(i<0.5)return p;if(i<0.6666666666666666)return l+(p-l)*(0.6666666666666666-i)*6;return l},b=e<0.5?e*(1+o):e+o-e*o,s=2*e-b;a=g(s,b,r+0.3333333333333333)*255,t=g(s,b,r)*255,n=g(s,b,r-0.3333333333333333)*255}return{r:a,g:t,b:n}}function c(r,o=0,e=0){if(!r)return o;if(r=r.trim().toLowerCase(),r==="auto")return o;if(r.endsWith("px"))return Number.parseFloat(r);if(r.endsWith("%"))return Number.parseFloat(r)/100*e;if(r.endsWith("em"))return Number.parseFloat(r)*16;if(r.endsWith("rem"))return Number.parseFloat(r)*16;if(r.endsWith("vw"))return Number.parseFloat(r)/100*e;if(r.endsWith("vh"))return Number.parseFloat(r)/100*e;let a=Number.parseFloat(r);return Number.isNaN(a)?o:a}function z(r){if(!r)return[0,0,0,0];let e=r.trim().split(/\s+/).map((a)=>c(a,0));switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return[e[0],e[1],e[2],e[3]];default:return[0,0,0,0]}}function v(r){let o={};if(!r)return o;let e=r.split(";");for(let a of e){let[t,...n]=a.split(":");if(t&&n.length>0){let g=t.trim().toLowerCase(),b=n.join(":").trim();o[g]=b}}return o}function Si(r,o){let e=r.a/255,a=o.a/255,t=e+a*(1-e);if(t===0)return{r:0,g:0,b:0,a:0};return{r:Math.round((r.r*e+o.r*a*(1-e))/t),g:Math.round((r.g*e+o.g*a*(1-e))/t),b:Math.round((r.b*e+o.b*a*(1-e))/t),a:Math.round(t*255)}}var or={backgroundColor:{r:0,g:0,b:0,a:0},color:{r:0,g:0,b:0,a:255},borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftWidth:0,borderTopColor:{r:0,g:0,b:0,a:255},borderRightColor:{r:0,g:0,b:0,a:255},borderBottomColor:{r:0,g:0,b:0,a:255},borderLeftColor:{r:0,g:0,b:0,a:255},borderRadius:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,fontSize:16,fontWeight:"normal",fontFamily:"sans-serif",textAlign:"left",display:"block",position:"static",top:0,right:0,bottom:0,left:0,opacity:1,overflow:"visible",boxShadow:null},ar=new Set(["div","p","h1","h2","h3","h4","h5","h6","section","article","header","footer","main","nav","aside","ul","ol","li","dl","dt","dd","table","tr","th","td","thead","tbody","tfoot","form","fieldset","legend","blockquote","pre","address","hr","figure","figcaption"]);function pr(r){let o={tagName:"div",attributes:{},children:[]},e=[o],a=o,t=0,n=(g)=>g.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/&#(\d+);/g,(b,s)=>String.fromCharCode(Number.parseInt(s))).replace(/&#x([0-9a-f]+);/gi,(b,s)=>String.fromCharCode(Number.parseInt(s,16))).replace(/ /g," ");while(t<r.length){let g=r.indexOf("<",t);if(g>t||g===-1){let i=g===-1?r.length:g,u=n(r.slice(t,i).trim());if(u)a.children.push(u);if(g===-1)break;t=g}if(r.slice(t,t+4)==="<!--"){let i=r.indexOf("-->",t+4);t=i===-1?r.length:i+3;continue}if(r.slice(t,t+2).toLowerCase()==="<!"){let i=r.indexOf(">",t);t=i===-1?r.length:i+1;continue}let b=r.indexOf(">",t);if(b===-1)break;let s=r.slice(t+1,b),l=s.endsWith("/")||s.endsWith("/");if(s.startsWith("/")){let i=s.slice(1).trim().toLowerCase().split(/\s/)[0];while(e.length>1){let u=e.pop();if(a=e[e.length-1],u.tagName===i)break}}else{let i=s.search(/\s/),u=i===-1?s:s.slice(0,i);u=u.replace(/\/$/,"").toLowerCase();let h={};if(i!==-1){let M=s.slice(i).replace(/\/$/,""),d=/([a-z-]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gi,f;while((f=d.exec(M))!==null){let G=f[1].toLowerCase(),P=f[2]??f[3]??f[4]??"";h[G]=n(P)}}let S={tagName:u,attributes:h,children:[]};if(a.children.push(S),!l&&!new Set(["br","hr","img","input","meta","link","area","base","col","embed","param","source","track","wbr"]).has(u))e.push(S),a=S}t=b+1}return o}function rr(r){let o=[];r=r.replace(/\/\*[\s\S]*?\*\//g,"");let e=/([^{}]+)\{([^}]*)\}/g,a;while((a=e.exec(r))!==null){let t=a[1].trim(),n={},b=a[2].split(";");for(let s of b){let l=s.indexOf(":");if(l!==-1){let p=s.slice(0,l).trim().toLowerCase(),i=s.slice(l+1).trim();if(p&&i)n[p]=i}}if(Object.keys(n).length>0)o.push({selector:t,properties:n})}return o}function hr(r,o){if(o=o.trim(),o==="*")return!0;if(/^[a-z][a-z0-9-]*$/i.test(o))return r.tagName===o.toLowerCase();if(o.startsWith(".")){let g=o.slice(1);return(r.attributes.class||"").split(/\s+/).includes(g)}if(o.startsWith("#")){let g=o.slice(1);return r.attributes.id===g}let e=o.match(/^([a-z][a-z0-9-]*)/i),a=o.match(/\.([a-z][a-z0-9-]*)/gi)||[],t=o.match(/#([a-z][a-z0-9-]*)/i),n=!0;if(e)n=n&&r.tagName===e[1].toLowerCase();if(t)n=n&&r.attributes.id===t[1];for(let g of a){let b=g.slice(1),s=(r.attributes.class||"").split(/\s+/);n=n&&s.includes(b)}return n}function tr(r,o,e,a){let t={...or};t.color={...e.color},t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight;for(let g of o){let b=g.selector.split(",").map((s)=>s.trim());for(let s of b)if(hr(r,s))er(t,g.properties,a)}let n=v(r.attributes.style);if(er(t,n,a),t.display==="block"&&!n.display)t.display=ar.has(r.tagName)?"block":"inline";return t}function er(r,o,e){for(let[a,t]of Object.entries(o))switch(a){case"background":case"background-color":r.backgroundColor=w(t);break;case"color":r.color=w(t);break;case"border":{let n=t.match(/(\d+(?:px)?)\s+(\w+)\s+(\S+)/);if(n){let g=c(n[1],0),b=w(n[3]);r.borderTopWidth=r.borderRightWidth=r.borderBottomWidth=r.borderLeftWidth=g,r.borderTopColor=r.borderRightColor=r.borderBottomColor=r.borderLeftColor={...b}}break}case"border-width":{let[n,g,b,s]=z(t);r.borderTopWidth=n,r.borderRightWidth=g,r.borderBottomWidth=b,r.borderLeftWidth=s;break}case"border-color":{let n=w(t);r.borderTopColor=r.borderRightColor=r.borderBottomColor=r.borderLeftColor={...n};break}case"border-top-width":r.borderTopWidth=c(t,0);break;case"border-right-width":r.borderRightWidth=c(t,0);break;case"border-bottom-width":r.borderBottomWidth=c(t,0);break;case"border-left-width":r.borderLeftWidth=c(t,0);break;case"border-top-color":r.borderTopColor=w(t);break;case"border-right-color":r.borderRightColor=w(t);break;case"border-bottom-color":r.borderBottomColor=w(t);break;case"border-left-color":r.borderLeftColor=w(t);break;case"border-radius":r.borderRadius=c(t,0);break;case"padding":{let[n,g,b,s]=z(t);r.paddingTop=n,r.paddingRight=g,r.paddingBottom=b,r.paddingLeft=s;break}case"padding-top":r.paddingTop=c(t,0,e);break;case"padding-right":r.paddingRight=c(t,0,e);break;case"padding-bottom":r.paddingBottom=c(t,0,e);break;case"padding-left":r.paddingLeft=c(t,0,e);break;case"margin":{let[n,g,b,s]=z(t);r.marginTop=n,r.marginRight=g,r.marginBottom=b,r.marginLeft=s;break}case"margin-top":r.marginTop=c(t,0,e);break;case"margin-right":r.marginRight=c(t,0,e);break;case"margin-bottom":r.marginBottom=c(t,0,e);break;case"margin-left":r.marginLeft=c(t,0,e);break;case"font-size":r.fontSize=c(t,16);break;case"font-weight":r.fontWeight=t;break;case"font-family":r.fontFamily=t.split(",")[0].trim().replace(/['"]/g,"");break;case"text-align":r.textAlign=t;break;case"display":r.display=t;break;case"position":r.position=t;break;case"top":r.top=c(t,0,e);break;case"right":r.right=c(t,0,e);break;case"bottom":r.bottom=c(t,0,e);break;case"left":r.left=c(t,0,e);break;case"opacity":r.opacity=Number.parseFloat(t)||1;break;case"overflow":r.overflow=t;break;case"width":break;case"height":break;case"box-shadow":r.boxShadow=t;break}}function oi(r,o,e,a){let t=pr(r),n=rr(o),g=(i)=>{let u="";if(i.tagName==="style"){for(let h of i.children)if(typeof h==="string")u+=h}for(let h of i.children)if(typeof h!=="string")u+=g(h);return u},b=g(t),s=[...n,...rr(b)];function l(i,u,h,S,B,M){let d=tr(i,s,u,B);if(d.display==="none")return{tagName:i.tagName,box:{x:0,y:0,width:0,height:0},styles:d,text:null,children:[],visible:!1};let{marginLeft:f,marginTop:G,marginRight:P,marginBottom:fr,borderLeftWidth:T,borderTopWidth:D,borderRightWidth:V,borderBottomWidth:nr,paddingLeft:E,paddingTop:Y,paddingRight:K,paddingBottom:ir}=d,U=null;if(i.attributes.style){let m=i.attributes.style.match(/width\s*:\s*(\S+)/);if(m)U=c(m[1],B,B)}let L=U??B-f-P-T-V-E-K,X=null;if(i.attributes.style){let m=i.attributes.style.match(/height\s*:\s*(\S+)/);if(m)X=c(m[1],0,M)}let A=h+f,O=S+G;if(d.position==="absolute"||d.position==="fixed"){if(d.left!==0)A=d.left;if(d.top!==0)O=d.top}let J=[],H=A+T+E,q=O+D+Y,F=0,x=0,C=0,y=0;for(let m of i.children){if(typeof m==="string")continue;let k=tr(m,s,d,L);if(k.display==="none")continue;let _=k.display==="block"||ar.has(m.tagName);if(_&&y>0)q+=C,x+=C,C=0,y=0,H=A+T+E;let N=l(m,d,H,q,_?L:L-y,M-x);if(J.push(N),N.visible)if(_){let W=N.box.height+k.marginTop+k.marginBottom;q+=W,x+=W,F=Math.max(F,N.box.width)}else{let W=N.box.width+k.marginLeft+k.marginRight;y+=W,H+=W,C=Math.max(C,N.box.height+k.marginTop+k.marginBottom),F=Math.max(F,y)}}if(C>0)x+=C;let I=null,j=[];for(let m of i.children)if(typeof m==="string")j.push(m);if(j.length>0)I=j.join(" ");let Q=0;if(I)Q=(Math.ceil(I.length*d.fontSize*0.6/L)||1)*d.fontSize*1.2;let gr=Math.max(x,Q,X??0),sr=T+E+L+K+V,br=D+Y+gr+ir+nr;return{tagName:i.tagName,box:{x:A,y:O,width:sr,height:br},styles:d,text:I,children:J,visible:!0}}let p={...or,backgroundColor:{r:255,g:255,b:255,a:255}};return l(t,p,0,0,e,a)}
|
|
3
|
-
export{
|
|
2
|
+
var Z={transparent:{r:0,g:0,b:0,a:0},black:{r:0,g:0,b:0,a:255},white:{r:255,g:255,b:255,a:255},red:{r:255,g:0,b:0,a:255},green:{r:0,g:128,b:0,a:255},blue:{r:0,g:0,b:255,a:255},yellow:{r:255,g:255,b:0,a:255},cyan:{r:0,g:255,b:255,a:255},magenta:{r:255,g:0,b:255,a:255},gray:{r:128,g:128,b:128,a:255},grey:{r:128,g:128,b:128,a:255},silver:{r:192,g:192,b:192,a:255},maroon:{r:128,g:0,b:0,a:255},olive:{r:128,g:128,b:0,a:255},lime:{r:0,g:255,b:0,a:255},aqua:{r:0,g:255,b:255,a:255},teal:{r:0,g:128,b:128,a:255},navy:{r:0,g:0,b:128,a:255},fuchsia:{r:255,g:0,b:255,a:255},purple:{r:128,g:0,b:128,a:255},orange:{r:255,g:165,b:0,a:255},pink:{r:255,g:192,b:203,a:255},brown:{r:165,g:42,b:42,a:255},gold:{r:255,g:215,b:0,a:255},indigo:{r:75,g:0,b:130,a:255},violet:{r:238,g:130,b:238,a:255},coral:{r:255,g:127,b:80,a:255},salmon:{r:250,g:128,b:114,a:255},khaki:{r:240,g:230,b:140,a:255},plum:{r:221,g:160,b:221,a:255},orchid:{r:218,g:112,b:214,a:255},turquoise:{r:64,g:224,b:208,a:255},tan:{r:210,g:180,b:140,a:255},chocolate:{r:210,g:105,b:30,a:255},tomato:{r:255,g:99,b:71,a:255},crimson:{r:220,g:20,b:60,a:255},darkblue:{r:0,g:0,b:139,a:255},darkgreen:{r:0,g:100,b:0,a:255},darkred:{r:139,g:0,b:0,a:255},darkorange:{r:255,g:140,b:0,a:255},lightblue:{r:173,g:216,b:230,a:255},lightgreen:{r:144,g:238,b:144,a:255},lightgray:{r:211,g:211,b:211,a:255},lightgrey:{r:211,g:211,b:211,a:255},lightpink:{r:255,g:182,b:193,a:255},lightyellow:{r:255,g:255,b:224,a:255},darkgray:{r:169,g:169,b:169,a:255},darkgrey:{r:169,g:169,b:169,a:255},slategray:{r:112,g:128,b:144,a:255},slategrey:{r:112,g:128,b:144,a:255},dimgray:{r:105,g:105,b:105,a:255},dimgrey:{r:105,g:105,b:105,a:255},whitesmoke:{r:245,g:245,b:245,a:255},snow:{r:255,g:250,b:250,a:255},ivory:{r:255,g:255,b:240,a:255},beige:{r:245,g:245,b:220,a:255},linen:{r:250,g:240,b:230,a:255},aliceblue:{r:240,g:248,b:255,a:255},antiquewhite:{r:250,g:235,b:215,a:255},azure:{r:240,g:255,b:255,a:255},bisque:{r:255,g:228,b:196,a:255},blanchedalmond:{r:255,g:235,b:205,a:255},burlywood:{r:222,g:184,b:135,a:255},cadetblue:{r:95,g:158,b:160,a:255},chartreuse:{r:127,g:255,b:0,a:255},cornflowerblue:{r:100,g:149,b:237,a:255},cornsilk:{r:255,g:248,b:220,a:255},deeppink:{r:255,g:20,b:147,a:255},deepskyblue:{r:0,g:191,b:255,a:255},dodgerblue:{r:30,g:144,b:255,a:255},firebrick:{r:178,g:34,b:34,a:255},floralwhite:{r:255,g:250,b:240,a:255},forestgreen:{r:34,g:139,b:34,a:255},gainsboro:{r:220,g:220,b:220,a:255},ghostwhite:{r:248,g:248,b:255,a:255},greenyellow:{r:173,g:255,b:47,a:255},honeydew:{r:240,g:255,b:240,a:255},hotpink:{r:255,g:105,b:180,a:255},indianred:{r:205,g:92,b:92,a:255},lavender:{r:230,g:230,b:250,a:255},lavenderblush:{r:255,g:240,b:245,a:255},lawngreen:{r:124,g:252,b:0,a:255},lemonchiffon:{r:255,g:250,b:205,a:255},lightcoral:{r:240,g:128,b:128,a:255},lightcyan:{r:224,g:255,b:255,a:255},lightgoldenrodyellow:{r:250,g:250,b:210,a:255},lightsalmon:{r:255,g:160,b:122,a:255},lightseagreen:{r:32,g:178,b:170,a:255},lightskyblue:{r:135,g:206,b:250,a:255},lightslategray:{r:119,g:136,b:153,a:255},lightslategrey:{r:119,g:136,b:153,a:255},lightsteelblue:{r:176,g:196,b:222,a:255},limegreen:{r:50,g:205,b:50,a:255},mediumaquamarine:{r:102,g:205,b:170,a:255},mediumblue:{r:0,g:0,b:205,a:255},mediumorchid:{r:186,g:85,b:211,a:255},mediumpurple:{r:147,g:112,b:219,a:255},mediumseagreen:{r:60,g:179,b:113,a:255},mediumslateblue:{r:123,g:104,b:238,a:255},mediumspringgreen:{r:0,g:250,b:154,a:255},mediumturquoise:{r:72,g:209,b:204,a:255},mediumvioletred:{r:199,g:21,b:133,a:255},midnightblue:{r:25,g:25,b:112,a:255},mintcream:{r:245,g:255,b:250,a:255},mistyrose:{r:255,g:228,b:225,a:255},moccasin:{r:255,g:228,b:181,a:255},navajowhite:{r:255,g:222,b:173,a:255},oldlace:{r:253,g:245,b:230,a:255},olivedrab:{r:107,g:142,b:35,a:255},orangered:{r:255,g:69,b:0,a:255},palegoldenrod:{r:238,g:232,b:170,a:255},palegreen:{r:152,g:251,b:152,a:255},paleturquoise:{r:175,g:238,b:238,a:255},palevioletred:{r:219,g:112,b:147,a:255},papayawhip:{r:255,g:239,b:213,a:255},peachpuff:{r:255,g:218,b:185,a:255},peru:{r:205,g:133,b:63,a:255},powderblue:{r:176,g:224,b:230,a:255},rosybrown:{r:188,g:143,b:143,a:255},royalblue:{r:65,g:105,b:225,a:255},saddlebrown:{r:139,g:69,b:19,a:255},sandybrown:{r:244,g:164,b:96,a:255},seagreen:{r:46,g:139,b:87,a:255},seashell:{r:255,g:245,b:238,a:255},sienna:{r:160,g:82,b:45,a:255},skyblue:{r:135,g:206,b:235,a:255},slateblue:{r:106,g:90,b:205,a:255},springgreen:{r:0,g:255,b:127,a:255},steelblue:{r:70,g:130,b:180,a:255},thistle:{r:216,g:191,b:216,a:255},wheat:{r:245,g:222,b:179,a:255},yellowgreen:{r:154,g:205,b:50,a:255}};function S(r){if(!r)return{r:0,g:0,b:0,a:0};if(r=r.trim().toLowerCase(),Z[r])return{...Z[r]};if(r.startsWith("#"))return dr(r);if(r.startsWith("rgb"))return cr(r);if(r.startsWith("hsl"))return lr(r);return{r:0,g:0,b:0,a:0}}function dr(r){r=r.slice(1);let o,e,a,t=255;if(r.length===3)o=Number.parseInt(r[0]+r[0],16),e=Number.parseInt(r[1]+r[1],16),a=Number.parseInt(r[2]+r[2],16);else if(r.length===4)o=Number.parseInt(r[0]+r[0],16),e=Number.parseInt(r[1]+r[1],16),a=Number.parseInt(r[2]+r[2],16),t=Number.parseInt(r[3]+r[3],16);else if(r.length===6)o=Number.parseInt(r.slice(0,2),16),e=Number.parseInt(r.slice(2,4),16),a=Number.parseInt(r.slice(4,6),16);else if(r.length===8)o=Number.parseInt(r.slice(0,2),16),e=Number.parseInt(r.slice(2,4),16),a=Number.parseInt(r.slice(4,6),16),t=Number.parseInt(r.slice(6,8),16);else return{r:0,g:0,b:0,a:0};return{r:o,g:e,b:a,a:t}}function cr(r){let o=r.match(/rgba?\s*\(\s*([^)]+)\s*\)/);if(!o)return{r:0,g:0,b:0,a:0};let e=o[1].split(/[\s,/]+/).map((b)=>b.trim()).filter(Boolean),a=w(e[0],255),t=w(e[1],255),n=w(e[2],255),g=e[3]!==void 0?w(e[3],1)*255:255;return{r:Math.round(Math.min(255,Math.max(0,a))),g:Math.round(Math.min(255,Math.max(0,t))),b:Math.round(Math.min(255,Math.max(0,n))),a:Math.round(Math.min(255,Math.max(0,g)))}}function lr(r){let o=r.match(/hsla?\s*\(\s*([^)]+)\s*\)/);if(!o)return{r:0,g:0,b:0,a:0};let e=o[1].split(/[\s,/]+/).map((p)=>p.trim()).filter(Boolean),a=ur(e[0]),t=w(e[1],100)/100,n=w(e[2],100)/100,g=e[3]!==void 0?w(e[3],1):1,{r:b,g:s,b:l}=mr(a,t,n);return{r:Math.round(b),g:Math.round(s),b:Math.round(l),a:Math.round(g*255)}}function w(r,o){if(!r)return 0;if(r.endsWith("%"))return Number.parseFloat(r)/100*o;return Number.parseFloat(r)}function ur(r){if(!r)return 0;if(r=r.toLowerCase(),r.endsWith("deg"))return Number.parseFloat(r)/360;if(r.endsWith("rad"))return Number.parseFloat(r)/(2*Math.PI);if(r.endsWith("grad"))return Number.parseFloat(r)/400;if(r.endsWith("turn"))return Number.parseFloat(r);return Number.parseFloat(r)/360}function mr(r,o,e){let a,t,n;if(o===0)a=t=n=e*255;else{let g=(l,p,i)=>{if(i<0)i+=1;if(i>1)i-=1;if(i<0.16666666666666666)return l+(p-l)*6*i;if(i<0.5)return p;if(i<0.6666666666666666)return l+(p-l)*(0.6666666666666666-i)*6;return l},b=e<0.5?e*(1+o):e+o-e*o,s=2*e-b;a=g(s,b,r+0.3333333333333333)*255,t=g(s,b,r)*255,n=g(s,b,r-0.3333333333333333)*255}return{r:a,g:t,b:n}}function c(r,o=0,e=0){if(!r)return o;if(r=r.trim().toLowerCase(),r==="auto")return o;if(r.endsWith("px"))return Number.parseFloat(r);if(r.endsWith("%"))return Number.parseFloat(r)/100*e;if(r.endsWith("em"))return Number.parseFloat(r)*16;if(r.endsWith("rem"))return Number.parseFloat(r)*16;if(r.endsWith("vw"))return Number.parseFloat(r)/100*e;if(r.endsWith("vh"))return Number.parseFloat(r)/100*e;let a=Number.parseFloat(r);return Number.isNaN(a)?o:a}function z(r){if(!r)return[0,0,0,0];let e=r.trim().split(/\s+/).map((a)=>c(a,0));switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return[e[0],e[1],e[2],e[3]];default:return[0,0,0,0]}}function v(r){let o={};if(!r)return o;let e=r.split(";");for(let a of e){let[t,...n]=a.split(":");if(t&&n.length>0){let g=t.trim().toLowerCase(),b=n.join(":").trim();o[g]=b}}return o}function Pi(r,o){let e=r.a/255,a=o.a/255,t=e+a*(1-e);if(t===0)return{r:0,g:0,b:0,a:0};return{r:Math.round((r.r*e+o.r*a*(1-e))/t),g:Math.round((r.g*e+o.g*a*(1-e))/t),b:Math.round((r.b*e+o.b*a*(1-e))/t),a:Math.round(t*255)}}var or={backgroundColor:{r:0,g:0,b:0,a:0},color:{r:0,g:0,b:0,a:255},borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftWidth:0,borderTopColor:{r:0,g:0,b:0,a:255},borderRightColor:{r:0,g:0,b:0,a:255},borderBottomColor:{r:0,g:0,b:0,a:255},borderLeftColor:{r:0,g:0,b:0,a:255},borderRadius:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,fontSize:16,fontWeight:"normal",fontFamily:"sans-serif",textAlign:"left",display:"block",position:"static",top:0,right:0,bottom:0,left:0,opacity:1,overflow:"visible",boxShadow:null},ar=new Set(["div","p","h1","h2","h3","h4","h5","h6","section","article","header","footer","main","nav","aside","ul","ol","li","dl","dt","dd","table","tr","th","td","thead","tbody","tfoot","form","fieldset","legend","blockquote","pre","address","hr","figure","figcaption"]);function pr(r){let o={tagName:"div",attributes:{},children:[]},e=[o],a=o,t=0,n=(g)=>g.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/&#(\d+);/g,(b,s)=>String.fromCharCode(Number.parseInt(s))).replace(/&#x([0-9a-f]+);/gi,(b,s)=>String.fromCharCode(Number.parseInt(s,16))).replace(/ /g," ");while(t<r.length){let g=r.indexOf("<",t);if(g>t||g===-1){let i=g===-1?r.length:g,u=n(r.slice(t,i).trim());if(u)a.children.push(u);if(g===-1)break;t=g}if(r.slice(t,t+4)==="<!--"){let i=r.indexOf("-->",t+4);t=i===-1?r.length:i+3;continue}if(r.slice(t,t+2).toLowerCase()==="<!"){let i=r.indexOf(">",t);t=i===-1?r.length:i+1;continue}let b=r.indexOf(">",t);if(b===-1)break;let s=r.slice(t+1,b),l=s.endsWith("/")||s.endsWith("/");if(s.startsWith("/")){let i=s.slice(1).trim().toLowerCase().split(/\s/)[0];while(e.length>1){let u=e.pop();if(a=e[e.length-1],u.tagName===i)break}}else{let i=s.search(/\s/),u=i===-1?s:s.slice(0,i);u=u.replace(/\/$/,"").toLowerCase();let h={};if(i!==-1){let M=s.slice(i).replace(/\/$/,""),d=/([a-z-]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gi,f;while((f=d.exec(M))!==null){let G=f[1].toLowerCase(),P=f[2]??f[3]??f[4]??"";h[G]=n(P)}}let N={tagName:u,attributes:h,children:[]};if(a.children.push(N),!l&&!new Set(["br","hr","img","input","meta","link","area","base","col","embed","param","source","track","wbr"]).has(u))e.push(N),a=N}t=b+1}return o}function rr(r){let o=[];r=r.replace(/\/\*[\s\S]*?\*\//g,"");let e=/([^{}]+)\{([^}]*)\}/g,a;while((a=e.exec(r))!==null){let t=a[1].trim(),n={},b=a[2].split(";");for(let s of b){let l=s.indexOf(":");if(l!==-1){let p=s.slice(0,l).trim().toLowerCase(),i=s.slice(l+1).trim();if(p&&i)n[p]=i}}if(Object.keys(n).length>0)o.push({selector:t,properties:n})}return o}function hr(r,o){if(o=o.trim(),o==="*")return!0;if(/^[a-z][a-z0-9-]*$/i.test(o))return r.tagName===o.toLowerCase();if(o.startsWith(".")){let g=o.slice(1);return(r.attributes.class||"").split(/\s+/).includes(g)}if(o.startsWith("#")){let g=o.slice(1);return r.attributes.id===g}let e=o.match(/^([a-z][a-z0-9-]*)/i),a=o.match(/\.([a-z][a-z0-9-]*)/gi)||[],t=o.match(/#([a-z][a-z0-9-]*)/i),n=!0;if(e)n=n&&r.tagName===e[1].toLowerCase();if(t)n=n&&r.attributes.id===t[1];for(let g of a){let b=g.slice(1),s=(r.attributes.class||"").split(/\s+/);n=n&&s.includes(b)}return n}function tr(r,o,e,a){let t={...or};t.color={...e.color},t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight;for(let g of o){let b=g.selector.split(",").map((s)=>s.trim());for(let s of b)if(hr(r,s))er(t,g.properties,a)}let n=v(r.attributes.style);if(er(t,n,a),t.display==="block"&&!n.display)t.display=ar.has(r.tagName)?"block":"inline";return t}function er(r,o,e){for(let[a,t]of Object.entries(o))switch(a){case"background":case"background-color":r.backgroundColor=S(t);break;case"color":r.color=S(t);break;case"border":{let n=t.match(/(\d+(?:px)?)\s+(\w+)\s+(\S+)/);if(n){let g=c(n[1],0),b=S(n[3]);r.borderTopWidth=r.borderRightWidth=r.borderBottomWidth=r.borderLeftWidth=g,r.borderTopColor=r.borderRightColor=r.borderBottomColor=r.borderLeftColor={...b}}break}case"border-width":{let[n,g,b,s]=z(t);r.borderTopWidth=n,r.borderRightWidth=g,r.borderBottomWidth=b,r.borderLeftWidth=s;break}case"border-color":{let n=S(t);r.borderTopColor=r.borderRightColor=r.borderBottomColor=r.borderLeftColor={...n};break}case"border-top-width":r.borderTopWidth=c(t,0);break;case"border-right-width":r.borderRightWidth=c(t,0);break;case"border-bottom-width":r.borderBottomWidth=c(t,0);break;case"border-left-width":r.borderLeftWidth=c(t,0);break;case"border-top-color":r.borderTopColor=S(t);break;case"border-right-color":r.borderRightColor=S(t);break;case"border-bottom-color":r.borderBottomColor=S(t);break;case"border-left-color":r.borderLeftColor=S(t);break;case"border-radius":r.borderRadius=c(t,0);break;case"padding":{let[n,g,b,s]=z(t);r.paddingTop=n,r.paddingRight=g,r.paddingBottom=b,r.paddingLeft=s;break}case"padding-top":r.paddingTop=c(t,0,e);break;case"padding-right":r.paddingRight=c(t,0,e);break;case"padding-bottom":r.paddingBottom=c(t,0,e);break;case"padding-left":r.paddingLeft=c(t,0,e);break;case"margin":{let[n,g,b,s]=z(t);r.marginTop=n,r.marginRight=g,r.marginBottom=b,r.marginLeft=s;break}case"margin-top":r.marginTop=c(t,0,e);break;case"margin-right":r.marginRight=c(t,0,e);break;case"margin-bottom":r.marginBottom=c(t,0,e);break;case"margin-left":r.marginLeft=c(t,0,e);break;case"font-size":r.fontSize=c(t,16);break;case"font-weight":r.fontWeight=t;break;case"font-family":r.fontFamily=t.split(",")[0].trim().replace(/['"]/g,"");break;case"text-align":r.textAlign=t;break;case"display":r.display=t;break;case"position":r.position=t;break;case"top":r.top=c(t,0,e);break;case"right":r.right=c(t,0,e);break;case"bottom":r.bottom=c(t,0,e);break;case"left":r.left=c(t,0,e);break;case"opacity":r.opacity=Number.parseFloat(t)||1;break;case"overflow":r.overflow=t;break;case"width":break;case"height":break;case"box-shadow":r.boxShadow=t;break}}function hi(r,o,e,a){let t=pr(r),n=rr(o),g=(i)=>{let u="";if(i.tagName==="style"){for(let h of i.children)if(typeof h==="string")u+=h}for(let h of i.children)if(typeof h!=="string")u+=g(h);return u},b=g(t),s=[...n,...rr(b)];function l(i,u,h,N,B,M){let d=tr(i,s,u,B);if(d.display==="none")return{tagName:i.tagName,box:{x:0,y:0,width:0,height:0},styles:d,text:null,children:[],visible:!1};let{marginLeft:f,marginTop:G,marginRight:P,marginBottom:fr,borderLeftWidth:T,borderTopWidth:D,borderRightWidth:V,borderBottomWidth:nr,paddingLeft:E,paddingTop:Y,paddingRight:K,paddingBottom:ir}=d,U=null;if(i.attributes.style){let m=i.attributes.style.match(/width\s*:\s*(\S+)/);if(m)U=c(m[1],B,B)}let L=U??B-f-P-T-V-E-K,X=null;if(i.attributes.style){let m=i.attributes.style.match(/height\s*:\s*(\S+)/);if(m)X=c(m[1],0,M)}let A=h+f,O=N+G;if(d.position==="absolute"||d.position==="fixed"){if(d.left!==0)A=d.left;if(d.top!==0)O=d.top}let J=[],H=A+T+E,q=O+D+Y,F=0,x=0,C=0,y=0;for(let m of i.children){if(typeof m==="string")continue;let k=tr(m,s,d,L);if(k.display==="none")continue;let _=k.display==="block"||ar.has(m.tagName);if(_&&y>0)q+=C,x+=C,C=0,y=0,H=A+T+E;let R=l(m,d,H,q,_?L:L-y,M-x);if(J.push(R),R.visible)if(_){let W=R.box.height+k.marginTop+k.marginBottom;q+=W,x+=W,F=Math.max(F,R.box.width)}else{let W=R.box.width+k.marginLeft+k.marginRight;y+=W,H+=W,C=Math.max(C,R.box.height+k.marginTop+k.marginBottom),F=Math.max(F,y)}}if(C>0)x+=C;let I=null,j=[];for(let m of i.children)if(typeof m==="string")j.push(m);if(j.length>0)I=j.join(" ");let Q=0;if(I)Q=(Math.ceil(I.length*d.fontSize*0.6/L)||1)*d.fontSize*1.2;let gr=Math.max(x,Q,X??0),sr=T+E+L+K+V,br=D+Y+gr+ir+nr;return{tagName:i.tagName,box:{x:A,y:O,width:sr,height:br},styles:d,text:I,children:J,visible:!0}}let p={...or,backgroundColor:{r:255,g:255,b:255,a:255}};return l(t,p,0,0,e,a)}
|
|
3
|
+
export{S,Pi,hi};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{f,r,Ee,ve,ci,Gi,E,P,l,s,t,i,c,o,C,J,Te,d}from"./chunk-3d9kwyx0.js";import{I,y,_}from"./chunk-h2qtm7yn.js";import{N,p}from"./chunk-7yd4gnqy.js";import{Y,k,X,fe,ge,ke,Be,He,Fe,Ge,Ue,We,be,ye,$e,ii,si,e}from"./chunk-vxcq2fte.js";import{n}from"./chunk-j2wys65b.js";class Xe{_marks=new Map;_measures=new Map;_startTime=Date.now();now(){return Date.now()-this._startTime}mark(a){this._marks.set(a,this.now())}measure(a,S,T){let D=T?this._marks.get(T):this.now(),w=S?this._marks.get(S):0;if(D!==void 0&&w!==void 0)this._measures.set(a,{start:w,duration:D-w})}clearMarks(a){if(a)this._marks.delete(a);else this._marks.clear()}clearMeasures(a){if(a)this._measures.delete(a);else this._measures.clear()}getEntriesByName(a){let S=[];if(this._marks.has(a))S.push({name:a,entryType:"mark",startTime:this._marks.get(a)});if(this._measures.has(a)){let T=this._measures.get(a);S.push({name:a,entryType:"measure",startTime:T.start,duration:T.duration})}return S}}class Je{_coords=null;_setPosition(a){this._coords=a}_position(){return{coords:{latitude:this._coords?.latitude??37.7749,longitude:this._coords?.longitude??-122.4194,accuracy:this._coords?.accuracy??10,altitude:null,altitudeAccuracy:null,heading:null,speed:null},timestamp:Date.now()}}getCurrentPosition(a,S,T){setTimeout(()=>{a(this._position())},0)}watchPosition(a,S,T){return setInterval(()=>{a(this._position())},1000)}clearWatch(a){clearInterval(a)}}class Qe{static permission="default";title;body;icon;tag;onclick=null;onclose=null;onerror=null;onshow=null;constructor(a,S){this.title=a,this.body=S?.body,this.icon=S?.icon,this.tag=S?.tag,setTimeout(()=>{if(this.onshow)this.onshow({})},0)}static requestPermission(){return Promise.resolve("granted")}close(){if(this.onclose)this.onclose({})}}class ki{_groups=[];_timers=new Map;log(...a){console.log(...this._prefix(),...a)}warn(...a){console.warn(...this._prefix(),...a)}error(...a){console.error(...this._prefix(),...a)}info(...a){console.info(...this._prefix(),...a)}debug(...a){console.debug(...this._prefix(),...a)}table(a){console.table(a)}group(a){if(a)this._groups.push(a),console.log(...this._prefix(),`\u25BC ${a}`)}groupCollapsed(a){this.group(a)}groupEnd(){this._groups.pop()}time(a){this._timers.set(a,Date.now())}timeEnd(a){let S=this._timers.get(a);if(S){let T=Date.now()-S;console.log(...this._prefix(),`${a}: ${T}ms`),this._timers.delete(a)}}timeLog(a,...S){let T=this._timers.get(a);if(T){let D=Date.now()-T;console.log(...this._prefix(),`${a}: ${D}ms`,...S)}}clear(){console.clear()}count(a="default"){console.log(...this._prefix(),a)}assert(a,...S){if(!a)console.error(...this._prefix(),"Assertion failed:",...S)}trace(...a){console.trace(...this._prefix(),...a)}_prefix(){return this._groups.map(()=>" ")}}class Ze{_data=new Map;dropEffect="none";effectAllowed="uninitialized";files=[];items=[];types=[];setData(a,S){if(this._data.set(a,S),!this.types.includes(a))this.types.push(a)}getData(a){return this._data.get(a)||""}clearData(a){if(a){this._data.delete(a);let S=this.types.indexOf(a);if(S!==-1)this.types.splice(S,1)}else this._data.clear(),this.types=[]}setDragImage(a,S,T){}}class G{_properties=new Map;get length(){return this._properties.size}getPropertyValue(a){return this._properties.get(a)?.value??""}setProperty(a,S,T){this._properties.set(a,{value:S,priority:T??""})}removeProperty(a){let S=this.getPropertyValue(a);return this._properties.delete(a),S}getPropertyPriority(a){return this._properties.get(a)?.priority??""}get cssText(){return Array.from(this._properties.entries()).map(([a,{value:S,priority:T}])=>`${a}: ${S}${T?" !important":""}`).join("; ")}set cssText(a){this._properties.clear();for(let S of a.split(";")){let[T,...D]=S.split(":");if(T&&D.length){let w=D.join(":").trim(),H=w.endsWith("!important");this.setProperty(T.trim(),H?w.replace(/\s*!important\s*$/,"").trim():w,H?"important":"")}}}item(a){return Array.from(this._properties.keys())[a]??""}[Symbol.iterator](){return this._properties.keys()}}class ee{_media=[];get mediaText(){return this._media.join(", ")}set mediaText(a){this._media=a?a.split(",").map((S)=>S.trim()):[]}get length(){return this._media.length}item(a){return this._media[a]??null}appendMedium(a){if(!this._media.includes(a))this._media.push(a)}deleteMedium(a){this._media=this._media.filter((S)=>S!==a)}toString(){return this.mediaText}}class h{static STYLE_RULE=1;static CHARSET_RULE=2;static IMPORT_RULE=3;static MEDIA_RULE=4;static FONT_FACE_RULE=5;static PAGE_RULE=6;static KEYFRAMES_RULE=7;static KEYFRAME_RULE=8;static NAMESPACE_RULE=10;static COUNTER_STYLE_RULE=11;static SUPPORTS_RULE=12;static FONT_FEATURE_VALUES_RULE=14;static CONTAINER_RULE=17;type;cssText="";parentRule=null;parentStyleSheet=null;constructor(a){this.type=a}}class te extends h{cssRules=[];insertRule(a,S=0){let T=new W;return T.cssText=a,T.parentRule=this,T.parentStyleSheet=this.parentStyleSheet,this.cssRules.splice(S,0,T),S}deleteRule(a){this.cssRules.splice(a,1)}}class U extends te{conditionText=""}class W extends h{selectorText="";style=new G;constructor(){super(h.STYLE_RULE)}}class et extends U{media=new ee;constructor(){super(h.MEDIA_RULE)}}class xe extends h{keyText="";style=new G;constructor(){super(h.KEYFRAME_RULE)}}class tt extends h{name="";cssRules=[];constructor(){super(h.KEYFRAMES_RULE)}appendRule(a){let S=new xe;S.cssText=a,S.parentRule=this,S.parentStyleSheet=this.parentStyleSheet,this.cssRules.push(S)}deleteRule(a){let S=this.cssRules.findIndex((T)=>T.keyText===a);if(S!==-1)this.cssRules.splice(S,1)}findRule(a){return this.cssRules.find((S)=>S.keyText===a)??null}}class rt extends h{style=new G;constructor(){super(h.FONT_FACE_RULE)}}class nt extends U{constructor(){super(h.SUPPORTS_RULE)}}class it extends U{containerName="";containerQuery="";constructor(){super(h.CONTAINER_RULE)}}class st extends te{start="";end="";constructor(){super(h.STYLE_RULE)}}class re{cssRules=[];disabled=!1;href=null;media=new ee;ownerNode=null;ownerRule=null;parentStyleSheet=null;title=null;type="text/css";insertRule(a,S=0){let T=new W;return T.cssText=a,T.parentStyleSheet=this,this.cssRules.splice(S,0,T),S}deleteRule(a){this.cssRules.splice(a,1)}replace(a){return this.replaceSync(a),Promise.resolve(this)}replaceSync(a){let S=this.cssRules;S.length=0;for(let T of ds(a)){let D=T.trim();if(!D)continue;let w=D.indexOf("{");if(w===-1)continue;let H=D.slice(0,w).trim(),A=D.slice(w+1,D.lastIndexOf("}")).trim(),F=new W;F.selectorText=H,F.parentStyleSheet=this;for(let B of A.split(";")){let Q=B.indexOf(":");if(Q===-1)continue;let Z=B.slice(0,Q).trim(),Se=B.slice(Q+1).trim();if(!Z||!Se)continue;let we=/!\s*important$/i.test(Se),_e=we?Se.replace(/\s*!\s*important$/i,"").trim():Se;if(_e)F.style.setProperty(Z,_e,we?"important":"")}S.push(F)}}}function ds(a){let S=[],T=0,D=0;for(let w=0;w<a.length;w++){let H=a[w];if(H==="{")T++;else if(H==="}"){if(T--,T===0)S.push(a.slice(D,w+1)),D=w+1}}return S}var ze=/^[\w-]+$/,os=/^\w+\(.+\)$/,ot={escape(a){return a.replace(/([^\w-])/g,"\\$1")},supports(a,S){if(S===void 0){let D=a.trim();if(!D)return!1;if(D.startsWith("not ")){let w=D.slice(4).trim().replace(/^\(|\)$/g,""),H=w.indexOf(":");if(H===-1)return!1;return!ot.supports(w.slice(0,H).trim(),w.slice(H+1).trim())}return!0}if(!a||!S)return!1;if(!ze.test(a))return!1;let T=S.trim();if(!T)return!1;if(ze.test(T))return!0;if(os.test(T))return!0;if(/^-?\d+(?:\.\d+)?(?:[a-z%]+)?$/i.test(T))return!0;if(/^#[0-9a-f]{3,8}$/i.test(T))return!0;return T.split(/\s+/).every((D)=>ze.test(D)||os.test(D)||/^-?\d+(?:\.\d+)?(?:[a-z%]+)?$/i.test(D)||/^#[0-9a-f]{3,8}$/i.test(D))}};class Ce{get size(){return 0}has(a){return!1}get(a){return}getAll(a){return[]}forEach(a){}entries(){return[][Symbol.iterator]()}keys(){return[][Symbol.iterator]()}values(){return[][Symbol.iterator]()}}class at extends Ce{set(a,...S){}append(a,...S){}delete(a){}clear(){}}class ne{fillStyle="#000000";strokeStyle="#000000";globalAlpha=1;globalCompositeOperation="source-over";lineWidth=1;lineCap="butt";lineJoin="miter";miterLimit=10;lineDashOffset=0;shadowOffsetX=0;shadowOffsetY=0;shadowBlur=0;shadowColor="rgba(0, 0, 0, 0)";font="10px sans-serif";textAlign="start";textBaseline="alphabetic";canvas;savedStates=[];currentPath=[];transformMatrix=[1,0,0,1,0,0];constructor(a){this.canvas=a}save(){this.savedStates.push({fillStyle:this.fillStyle,strokeStyle:this.strokeStyle,globalAlpha:this.globalAlpha,globalCompositeOperation:this.globalCompositeOperation,lineWidth:this.lineWidth,lineCap:this.lineCap,lineJoin:this.lineJoin,miterLimit:this.miterLimit,lineDashOffset:this.lineDashOffset,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,font:this.font,textAlign:this.textAlign,textBaseline:this.textBaseline,transformMatrix:[...this.transformMatrix]})}restore(){let a=this.savedStates.pop();if(a)Object.assign(this,a)}scale(a,S){this.transformMatrix[0]*=a,this.transformMatrix[3]*=S}rotate(a){let S=Math.cos(a),T=Math.sin(a),[D,w,H,A,F,B]=this.transformMatrix;this.transformMatrix[0]=D*S+H*T,this.transformMatrix[1]=w*S+A*T,this.transformMatrix[2]=H*S-D*T,this.transformMatrix[3]=A*S-w*T}translate(a,S){this.transformMatrix[4]+=a,this.transformMatrix[5]+=S}transform(a,S,T,D,w,H){let[A,F,B,Q,Z,Se]=this.transformMatrix;this.transformMatrix[0]=A*a+B*S,this.transformMatrix[1]=F*a+Q*S,this.transformMatrix[2]=A*T+B*D,this.transformMatrix[3]=F*T+Q*D,this.transformMatrix[4]=A*w+B*H+Z,this.transformMatrix[5]=F*w+Q*H+Se}setTransform(a,S,T,D,w,H){this.transformMatrix=[a,S,T,D,w,H]}resetTransform(){this.transformMatrix=[1,0,0,1,0,0]}beginPath(){this.currentPath=[]}closePath(){this.currentPath.push({type:"closePath",args:[]})}moveTo(a,S){this.currentPath.push({type:"moveTo",args:[a,S]})}lineTo(a,S){this.currentPath.push({type:"lineTo",args:[a,S]})}arc(a,S,T,D,w,H=!1){this.currentPath.push({type:"arc",args:[a,S,T,D,w,H]})}arcTo(a,S,T,D,w){this.currentPath.push({type:"arcTo",args:[a,S,T,D,w]})}quadraticCurveTo(a,S,T,D){this.currentPath.push({type:"quadraticCurveTo",args:[a,S,T,D]})}bezierCurveTo(a,S,T,D,w,H){this.currentPath.push({type:"bezierCurveTo",args:[a,S,T,D,w,H]})}rect(a,S,T,D){this.currentPath.push({type:"rect",args:[a,S,T,D]})}ellipse(a,S,T,D,w,H,A,F=!1){this.currentPath.push({type:"ellipse",args:[a,S,T,D,w,H,A,F]})}fill(){}stroke(){}clip(){}fillRect(a,S,T,D){}strokeRect(a,S,T,D){}clearRect(a,S,T,D){}fillText(a,S,T,D){}strokeText(a,S,T,D){}measureText(a){let S=a.length*8;return{width:S,actualBoundingBoxLeft:0,actualBoundingBoxRight:S,fontBoundingBoxAscent:10,fontBoundingBoxDescent:2,actualBoundingBoxAscent:10,actualBoundingBoxDescent:2,emHeightAscent:10,emHeightDescent:2,hangingBaseline:8,alphabeticBaseline:0,ideographicBaseline:-2}}drawImage(a,...S){}createImageData(a,S){if(typeof a==="number"&&typeof S==="number"){let T=new Uint8ClampedArray(a*S*4);return{width:a,height:S,data:T}}else{let T=a;return this.createImageData(T.width,T.height)}}getImageData(a,S,T,D){let w=new Uint8ClampedArray(T*D*4);return{width:T,height:D,data:w}}putImageData(...a){}createLinearGradient(a,S,T,D){let w=new Map;return{addColorStop(H,A){w.set(H,A)}}}createRadialGradient(a,S,T,D,w,H){let A=new Map;return{addColorStop(F,B){A.set(F,B)}}}createPattern(a,S){return{setTransform(T){}}}_lineDash=[];setLineDash(a){this._lineDash=[...a]}getLineDash(){return[...this._lineDash]}isPointInPath(a,S){return!1}isPointInStroke(a,S){return!1}}class Ve{types;_data;constructor(a){this._data=new Map(Object.entries(a)),this.types=Array.from(this._data.keys())}async getType(a){let S=this._data.get(a);if(S===void 0)throw new DOMException(`Type "${a}" not available on ClipboardItem`,"NotFoundError");let T=await S;if(T instanceof Blob)return T;return new Blob([T],{type:a})}static supports(a){return typeof a==="string"&&a.length>0}}class mi{_text="";async writeText(a){this._text=a}async readText(){return this._text}async write(a){for(let S of a)for(let T of S.types){let D=await S.getType(T);if(T==="text/plain")this._text=await D.text()}}async read(){let a=new Blob([this._text],{type:"text/plain"});return[new Ve({"text/plain":a})]}}function ps(){if(typeof process<"u"&&process.platform)switch(process.platform){case"darwin":return"MacIntel";case"win32":return"Win32";case"linux":return"Linux x86_64";default:return process.platform}return"Linux x86_64"}class pi{_granted=null;query(a){return Promise.resolve(new gi(a.name,this._stateFor(a.name)))}_stateFor(a){if(this._granted===null)return"granted";return this._granted.has(a)?"granted":"prompt"}_grant(a){this._granted=new Set([...this._granted??[],...a])}_clearGrants(){this._granted=new Set}}class fi{async estimate(){return{usage:0,quota:1073741824}}async persist(){return!0}async persisted(){return!0}async getDirectory(){throw new DOMException("OPFS not supported","NotSupportedError")}}class gi{name;state;onchange=null;constructor(a,S){this.name=a,this.state=S}}class lt{clipboard=new mi;geolocation=new Je;permissions=new pi;storage=new fi;userAgent="Mozilla/5.0 (X11; Linux x64) AppleWebKit/537.36 (KHTML, like Gecko) VeryHappyDOM/1.0.0";language=typeof process<"u"&&process.env?.LANG?process.env.LANG.split(".")[0].replace("_","-"):"en-US";languages=["en-US","en"];platform=ps();cookieEnabled=!0;onLine=!0;hardwareConcurrency=typeof navigator<"u"&&"hardwareConcurrency"in navigator?navigator.hardwareConcurrency:4;maxTouchPoints=0;vendor="";doNotTrack=null;sendBeacon(a,S){try{return globalThis.fetch(a,{method:"POST",body:S??void 0,keepalive:!0}).catch(()=>{}),!0}catch{return!1}}}class ut extends Blob{name;lastModified;constructor(a,S,T){super(a,T);this.name=S,this.lastModified=T?.lastModified||Date.now()}}class u{static EMPTY=0;static LOADING=1;static DONE=2;readyState=u.EMPTY;result=null;error=null;onload=null;onerror=null;onloadstart=null;onloadend=null;onprogress=null;onabort=null;_eventListeners=new Map;readAsText(a,S="UTF-8"){this.readyState=u.LOADING,this._trigger("loadstart"),a.text().then((T)=>{this.result=T,this.readyState=u.DONE,this._trigger("load"),this._trigger("loadend")}).catch((T)=>{this.error=T,this.readyState=u.DONE,this._trigger("error"),this._trigger("loadend")})}readAsDataURL(a){this.readyState=u.LOADING,this._trigger("loadstart"),a.arrayBuffer().then((S)=>{let T=Buffer.from(S).toString("base64");this.result=`data:${a.type};base64,${T}`,this.readyState=u.DONE,this._trigger("load"),this._trigger("loadend")}).catch((S)=>{this.error=S,this.readyState=u.DONE,this._trigger("error"),this._trigger("loadend")})}readAsArrayBuffer(a){this.readyState=u.LOADING,this._trigger("loadstart"),a.arrayBuffer().then((S)=>{this.result=S,this.readyState=u.DONE,this._trigger("load"),this._trigger("loadend")}).catch((S)=>{this.error=S,this.readyState=u.DONE,this._trigger("error"),this._trigger("loadend")})}readAsBinaryString(a){this.readyState=u.LOADING,this._trigger("loadstart"),a.arrayBuffer().then((S)=>{this.result=String.fromCharCode(...new Uint8Array(S)),this.readyState=u.DONE,this._trigger("load"),this._trigger("loadend")}).catch((S)=>{this.error=S,this.readyState=u.DONE,this._trigger("error"),this._trigger("loadend")})}abort(){this.readyState=u.DONE,this._trigger("abort"),this._trigger("loadend")}addEventListener(a,S){if(!this._eventListeners.has(a))this._eventListeners.set(a,new Set);this._eventListeners.get(a).add(S)}removeEventListener(a,S){let T=this._eventListeners.get(a);if(T)T.delete(S)}_trigger(a){let S={type:a,lengthComputable:!1,loaded:0,total:0},T=this._eventListeners.get(a);if(T)for(let w of T)w(S);let D=this[`on${a}`];if(D)D.call(this,S)}}class ct{_files=[];constructor(a=[]){this._files=a}get length(){return this._files.length}item(a){return this._files[a]||null}[Symbol.iterator](){return this._files[Symbol.iterator]()}}class v extends r{detail;view;which;constructor(a,S={}){super(a,S);this.detail=S.detail??0,this.view=S.view??null,this.which=S.which??0}}class V extends v{clientX;clientY;screenX;screenY;pageX;pageY;offsetX;offsetY;movementX;movementY;button;buttons;ctrlKey;shiftKey;altKey;metaKey;relatedTarget;constructor(a,S={}){super(a,S);this.clientX=S.clientX??0,this.clientY=S.clientY??0,this.screenX=S.screenX??0,this.screenY=S.screenY??0,this.pageX=S.pageX??0,this.pageY=S.pageY??0,this.offsetX=S.offsetX??0,this.offsetY=S.offsetY??0,this.movementX=S.movementX??0,this.movementY=S.movementY??0,this.button=S.button??0,this.buttons=S.buttons??0,this.ctrlKey=S.ctrlKey??!1,this.shiftKey=S.shiftKey??!1,this.altKey=S.altKey??!1,this.metaKey=S.metaKey??!1,this.relatedTarget=S.relatedTarget??null}}class ie extends v{key;code;location;repeat;ctrlKey;shiftKey;altKey;metaKey;isComposing;charCode;keyCode;constructor(a,S={}){super(a,S);this.key=S.key??"",this.code=S.code??"",this.location=S.location??0,this.repeat=S.repeat??!1,this.ctrlKey=S.ctrlKey??!1,this.shiftKey=S.shiftKey??!1,this.altKey=S.altKey??!1,this.metaKey=S.metaKey??!1,this.isComposing=S.isComposing??!1,this.charCode=S.charCode??0,this.keyCode=S.keyCode??0}}class se extends v{relatedTarget;constructor(a,S={}){super(a,S);this.relatedTarget=S.relatedTarget??null}}class dt extends v{data;inputType;isComposing;dataTransfer;constructor(a,S={}){super(a,S);this.data=S.data??null,this.inputType=S.inputType??"",this.isComposing=S.isComposing??!1,this.dataTransfer=S.dataTransfer??null}}class ht extends V{static DOM_DELTA_PIXEL=0;static DOM_DELTA_LINE=1;static DOM_DELTA_PAGE=2;deltaX;deltaY;deltaZ;deltaMode;constructor(a,S={}){super(a,S);this.deltaX=S.deltaX??0,this.deltaY=S.deltaY??0,this.deltaZ=S.deltaZ??0,this.deltaMode=S.deltaMode??0}}class mt extends V{pointerId;width;height;pressure;tangentialPressure;tiltX;tiltY;twist;pointerType;isPrimary;constructor(a,S={}){super(a,S);this.pointerId=S.pointerId??0,this.width=S.width??1,this.height=S.height??1,this.pressure=S.pressure??0,this.tangentialPressure=S.tangentialPressure??0,this.tiltX=S.tiltX??0,this.tiltY=S.tiltY??0,this.twist=S.twist??0,this.pointerType=S.pointerType??"",this.isPrimary=S.isPrimary??!1}}class pt extends v{touches;targetTouches;changedTouches;ctrlKey;shiftKey;altKey;metaKey;constructor(a,S={}){super(a,S);this.touches=S.touches??[],this.targetTouches=S.targetTouches??[],this.changedTouches=S.changedTouches??[],this.ctrlKey=S.ctrlKey??!1,this.shiftKey=S.shiftKey??!1,this.altKey=S.altKey??!1,this.metaKey=S.metaKey??!1}}class ft extends r{animationName;elapsedTime;pseudoElement;constructor(a,S={}){super(a,S);this.animationName=S.animationName??"",this.elapsedTime=S.elapsedTime??0,this.pseudoElement=S.pseudoElement??""}}class gt extends r{propertyName;elapsedTime;pseudoElement;constructor(a,S={}){super(a,S);this.propertyName=S.propertyName??"",this.elapsedTime=S.elapsedTime??0,this.pseudoElement=S.pseudoElement??""}}class bt extends r{clipboardData;constructor(a,S={}){super(a,S);this.clipboardData=S.clipboardData??null}}class yt extends V{dataTransfer;constructor(a,S={}){super(a,S);this.dataTransfer=S.dataTransfer??null}}class oe extends r{message;filename;lineno;colno;error;constructor(a,S={}){super(a,S);this.message=S.message??"",this.filename=S.filename??"",this.lineno=S.lineno??0,this.colno=S.colno??0,this.error=S.error??null}}class Et extends r{oldURL;newURL;constructor(a,S={}){super(a,S);this.oldURL=S.oldURL??"",this.newURL=S.newURL??""}}class vt extends r{state;constructor(a,S={}){super(a,S);this.state=S.state??null}}class wt extends r{lengthComputable;loaded;total;constructor(a,S={}){super(a,S);this.lengthComputable=S.lengthComputable??!1,this.loaded=S.loaded??0,this.total=S.total??0}}class M extends r{data;origin;lastEventId;source;ports;constructor(a,S={}){super(a,S);this.data=S.data??null,this.origin=S.origin??"",this.lastEventId=S.lastEventId??"",this.source=S.source??null,this.ports=S.ports??[]}}class _t extends r{code;reason;wasClean;constructor(a,S={}){super(a,S);this.code=S.code??0,this.reason=S.reason??"",this.wasClean=S.wasClean??!1}}class St extends r{key;oldValue;newValue;url;storageArea;constructor(a,S={}){super(a,S);this.key=S.key??null,this.oldValue=S.oldValue??null,this.newValue=S.newValue??null,this.url=S.url??"",this.storageArea=S.storageArea??null}}class Tt extends r{submitter;constructor(a,S={}){super(a,S);this.submitter=S.submitter??null}}class Nt extends r{matches;media;constructor(a,S={}){super(a,S);this.matches=S.matches??!1,this.media=S.media??""}}class xt extends v{data;constructor(a,S={}){super(a,S);this.data=S.data??""}}class Ct{identifier;target;clientX;clientY;screenX;screenY;pageX;pageY;radiusX;radiusY;rotationAngle;force;constructor(a){this.identifier=a.identifier,this.target=a.target,this.clientX=a.clientX??0,this.clientY=a.clientY??0,this.screenX=a.screenX??0,this.screenY=a.screenY??0,this.pageX=a.pageX??0,this.pageY=a.pageY??0,this.radiusX=a.radiusX??0,this.radiusY=a.radiusY??0,this.rotationAngle=a.rotationAngle??0,this.force=a.force??0}}var Ke=new Map;class Vt extends f{name;_closed=!1;onmessage=null;onmessageerror=null;constructor(a){super();this.name=String(a);let S=Ke.get(this.name);if(!S)S=new Set,Ke.set(this.name,S);S.add(this)}postMessage(a){if(this._closed)throw Error("InvalidStateError: BroadcastChannel is closed");let S=Ke.get(this.name);if(!S)return;queueMicrotask(()=>{for(let T of S){if(T===this||T._closed)continue;let D=new M("message",{data:a,origin:""});try{T.onmessage?.(D)}catch{}T.dispatchEvent(D)}})}close(){if(this._closed)return;this._closed=!0;let a=Ke.get(this.name);if(a){if(a.delete(this),a.size===0)Ke.delete(this.name)}}}class ae extends f{_onmessage=null;onmessageerror=null;get onmessage(){return this._onmessage}set onmessage(a){if(this._onmessage=a,a)this.start()}_peer=null;_started=!1;_queue=[];_closed=!1;postMessage(a){if(this._closed||!this._peer)return;let S=new M("message",{data:a,origin:""}),T=this._peer;queueMicrotask(()=>{if(T._closed)return;if(T._started)T._deliver(S);else T._queue.push(S)})}start(){if(this._started)return;this._started=!0;let a=this._queue;this._queue=[];for(let S of a)this._deliver(S)}close(){this._closed=!0}_deliver(a){try{this._onmessage?.(a)}catch{}this.dispatchEvent(a)}addEventListener(a,S,T){if(super.addEventListener(a,S,T),a==="message")this.start()}}class Mt{port1;port2;constructor(){this.port1=new ae,this.port2=new ae,this.port1._peer=this.port2,this.port2._peer=this.port1}}class O extends f{static CONNECTING=0;static OPEN=1;static CLOSED=2;CONNECTING=0;OPEN=1;CLOSED=2;url;withCredentials;readyState=O.CONNECTING;onopen=null;onmessage=null;onerror=null;_abort;_reconnectTimeout=3000;_lastEventId="";_closed=!1;constructor(a,S={}){super();this.url=typeof a==="string"?a:a.href,this.withCredentials=S.withCredentials===!0,this._abort=new AbortController,this._connect()}close(){this._closed=!0,this.readyState=O.CLOSED,this._abort.abort()}async _connect(){while(!this._closed){try{let a=await globalThis.fetch(this.url,{signal:this._abort.signal,headers:{Accept:"text/event-stream",...this._lastEventId?{"Last-Event-ID":this._lastEventId}:{}},credentials:this.withCredentials?"include":"same-origin"});if(!a.ok||!a.body){this._fireError();return}this.readyState=O.OPEN;let S=new r("open");try{this.onopen?.(S)}catch{}this.dispatchEvent(S),await this._pump(a.body)}catch{if(this._closed)return;this._fireError()}if(this._closed)return;await new Promise((a)=>setTimeout(a,this._reconnectTimeout)),this.readyState=O.CONNECTING}}async _pump(a){let S=a.getReader(),T=new TextDecoder,D="";try{while(!this._closed){let{value:w,done:H}=await S.read();if(H)return;D+=T.decode(w,{stream:!0});let A;while((A=D.indexOf(`
|
|
3
|
+
|
|
4
|
+
`))>=0||(A=D.indexOf(`\r
|
|
5
|
+
\r
|
|
6
|
+
`))>=0){let F=D[A+1]===`
|
|
7
|
+
`?4:2,B=D.slice(0,A);D=D.slice(A+F),this._dispatchFrame(B)}}}finally{S.releaseLock()}}_dispatchFrame(a){let S="message",T=[],D;for(let H of a.split(/\r?\n/)){if(!H||H.startsWith(":"))continue;let A=H.indexOf(":"),F=A===-1?H:H.slice(0,A),B=A===-1?"":H.slice(A+1);if(B.startsWith(" "))B=B.slice(1);switch(F){case"event":S=B;break;case"data":T.push(B);break;case"id":D=B;break;case"retry":{let Q=Number(B);if(Number.isFinite(Q))this._reconnectTimeout=Q;break}}}if(D!==void 0)this._lastEventId=D;if(T.length===0)return;let w=new M(S,{data:T.join(`
|
|
8
|
+
`),lastEventId:this._lastEventId,origin:new URL(this.url,"http://localhost").origin});if(S==="message")try{this.onmessage?.(w)}catch{}this.dispatchEvent(w)}_fireError(){this.readyState=O.CLOSED;let a=new oe("error");try{this.onerror?.(a)}catch{}this.dispatchEvent(a)}}var es=globalThis.FormData;function Bi(a,S){let T=new es;if(!a||typeof a!=="object")return T;let D=a;if(D.tagName!=="FORM")return T;let w=D.elements?Array.from(D.elements):D.querySelectorAll?Array.from(D.querySelectorAll("input,select,textarea,button")):[];for(let H of w){let A=H,F=A.name;if(!F||A.disabled)continue;let B=(A.tagName??"").toUpperCase(),Q=(A.type??"").toLowerCase();if(B==="BUTTON"||Q==="button"||Q==="reset"){if(A!==S)continue}if(Q==="submit"&&A!==S)continue;if((Q==="checkbox"||Q==="radio")&&!A.checked)continue;if(Q==="file"){let Z=A.files;if(!Z||Z.length===0)T.append(F,new File([],"",{type:"application/octet-stream"}));else for(let Se of Z)T.append(F,Se);continue}if(B==="SELECT"){let Z=A.multiple&&A.options?A.options.filter((Se)=>Se.selected).map((Se)=>Se.value):[A.value??""];for(let Se of Z)T.append(F,Se);continue}T.append(F,A.value??"")}return T}var bi=new Proxy(es,{construct(a,S){let[T,D]=S;if(T===void 0)return new es;return Bi(T,D)}});class ts extends Array{contains(a){return this.includes(a)}item(a){return this[a]??null}}class le extends f{result=void 0;error=null;source=null;transaction=null;readyState="pending";onsuccess=null;onerror=null;_resolve(a){this.result=a,this.readyState="done",queueMicrotask(()=>{let S=new r("success");try{this.onsuccess?.(S)}catch{}this.dispatchEvent(S),this._notifyTransaction()})}_reject(a){this.error=a,this.readyState="done",queueMicrotask(()=>{let S=new r("error");try{this.onerror?.(S)}catch{}this.dispatchEvent(S),this._notifyTransaction()})}_notifyTransaction(){this.transaction?._settled?.()}}class ue extends le{onupgradeneeded=null;onblocked=null}class Me{name;keyPath;autoIncrement;indexNames=[];transaction=null;_data=new Map;_autoKey=1;constructor(a,S={}){this.name=a,this.keyPath=S.keyPath??null,this.autoIncrement=S.autoIncrement===!0}add(a,S){return this._put(a,S,!0)}put(a,S){return this._put(a,S,!1)}get(a){let S=this._request();return S._resolve(this._data.get(String(a))),S}getAll(){let a=this._request();return a._resolve(Array.from(this._data.values())),a}delete(a){let S=this._request();return this._beforeWrite(),this._data.delete(String(a)),S._resolve(void 0),S}clear(){let a=this._request();return this._beforeWrite(),this._data.clear(),a._resolve(void 0),a}count(){let a=this._request();return a._resolve(this._data.size),a}createIndex(){throw Error("IDBObjectStore.createIndex not supported in the stub")}_put(a,S,T){let D=this._request(),w;if(S!==void 0)w=String(S);else if(this.keyPath&&typeof a==="object"&&a!==null){let H=Array.isArray(this.keyPath)?this.keyPath[0]:this.keyPath;w=String(a[H])}else if(this.autoIncrement)w=String(this._autoKey++);else return D._reject(new DOMException("No key specified","DataError")),D;if(T&&this._data.has(w))return D._reject(new DOMException("Key already exists","ConstraintError")),D;return this._beforeWrite(),this._data.set(w,a),D._resolve(w),D}_request(){let a=new le;return a.source=this,a.transaction=this.transaction,this.transaction?._pending(1),a}_beforeWrite(){this.transaction?._noteWrite(this)}_snapshot(){return{data:new Map(this._data),autoKey:this._autoKey}}_restore(a){this._data=new Map(a.data),this._autoKey=a.autoKey}}class Oe extends f{mode;objectStoreNames;db;error=null;oncomplete=null;onabort=null;onerror=null;_snapshots=new Map;_outstanding=0;_settledOnce=!1;_done=!1;_didAbort=!1;constructor(a,S,T){super();this.db=a,this.objectStoreNames=new ts(...S),this.mode=T,queueMicrotask(()=>{this._settledOnce=!0,this._maybeComplete()})}objectStore(a){let S=this.db._getStore(a);if(!S)throw new DOMException(`No object store named "${a}"`,"NotFoundError");return S.transaction=this,S}abort(){if(this._done)return;this._done=!0,this._didAbort=!0;for(let[S,T]of this._snapshots)S._restore(T);this._snapshots.clear();let a=new r("abort");try{this.onabort?.(a)}catch{}this.dispatchEvent(a)}_noteWrite(a){if(this.mode==="readonly"||this._done||this._snapshots.has(a))return;this._snapshots.set(a,a._snapshot())}_pending(a){this._outstanding+=a}_settled(){this._outstanding--,queueMicrotask(()=>this._maybeComplete())}_maybeComplete(){if(this._done||!this._settledOnce||this._outstanding>0)return;this._done=!0,this._snapshots.clear();let a=new r("complete");try{this.oncomplete?.(a)}catch{}this.dispatchEvent(a)}get aborted(){return this._didAbort}}class Le extends f{name;version;objectStoreNames=new ts;_stores=new Map;onabort=null;onclose=null;onerror=null;onversionchange=null;constructor(a,S){super();this.name=a,this.version=S}createObjectStore(a,S){let T=new Me(a,S);return this._stores.set(a,T),this.objectStoreNames.push(a),T}deleteObjectStore(a){this._stores.delete(a);let S=this.objectStoreNames.indexOf(a);if(S>=0)this.objectStoreNames.splice(S,1)}transaction(a,S="readonly"){let T=Array.isArray(a)?a:[a];return new Oe(this,T,S)}close(){}_getStore(a){return this._stores.get(a)}}class Re{_dbs=new Map;open(a,S=1){let T=new ue,D=this._dbs.get(a),w=!D||D.version<S,H=D??new Le(a,S);if(this._dbs.set(a,H),w)queueMicrotask(()=>{let A=new r("upgradeneeded"),F=A;F.oldVersion=D?.version??0,F.newVersion=S,T.result=H;try{T.onupgradeneeded?.(A),T.dispatchEvent(A)}catch(B){T._reject(B instanceof DOMException?B:new DOMException(String(B?.message??B),"AbortError"));return}T._resolve(H)});else T._resolve(H);return T}deleteDatabase(a){let S=new ue;return this._dbs.delete(a),S._resolve(void 0),S}databases(){return Promise.resolve(Array.from(this._dbs.values()).map((a)=>({name:a.name,version:a.version})))}cmp(a,S){let T=String(a),D=String(S);return T<D?-1:T>D?1:0}}function yi(){return new Re}var ms=Object.freeze(["mark","measure","resource","navigation","paint","longtask","element","event"]);class Ot{static supportedEntryTypes=ms;_callback;_types=new Set;_records=[];constructor(a){this._callback=a}observe(a={}){if(a.entryTypes)for(let S of a.entryTypes)this._types.add(S);else if(a.type)this._types.add(a.type)}disconnect(){this._types.clear(),this._records=[]}takeRecords(){let a=this._records;return this._records=[],a}_push(a){if(!this._types.has(a.entryType))return;this._records.push(a);let S={getEntries:()=>this._records.slice(),getEntriesByType:(T)=>this._records.filter((D)=>D.entryType===T),getEntriesByName:(T,D)=>this._records.filter((w)=>w.name===T&&(!D||w.entryType===D))};try{this._callback(S,this)}catch{}}}class ce extends r{detail;constructor(a,S={}){super(a,S);this.detail=S.detail}}class g{static UNSENT=0;static OPENED=1;static HEADERS_RECEIVED=2;static LOADING=3;static DONE=4;readyState=g.UNSENT;response=null;responseText="";responseType="";responseURL="";responseXML=null;status=0;statusText="";timeout=0;upload=new is;withCredentials=!1;onreadystatechange=null;onload=null;onerror=null;onabort=null;onloadstart=null;onloadend=null;onprogress=null;ontimeout=null;_method="";_url="";_requestHeaders=new Map;_responseHeaders=new Map;_aborted=!1;_eventListeners=new Map;constructor(){}open(a,S,T=!0,D,w){this._method=a.toUpperCase(),this._url=S,this.readyState=g.OPENED,this._triggerEvent("readystatechange")}send(a){if(this.readyState!==g.OPENED)throw Error("InvalidStateError: Object state must be OPENED");this._triggerEvent("loadstart",!0);let S={};for(let[H,A]of this._requestHeaders)S[H]=A;let T={method:this._method,headers:S,body:a,credentials:this.withCredentials?"include":"same-origin"},D=new AbortController,w=null;if(this.timeout>0)w=setTimeout(()=>{D.abort(),this._triggerEvent("timeout",!0)},this.timeout);fetch(this._url,{...T,signal:D.signal}).then(async(H)=>{if(w)clearTimeout(w);if(this._aborted)return;if(this.status=H.status,this.statusText=H.statusText,this.responseURL=H.url,H.headers.forEach((A,F)=>{this._responseHeaders.set(F.toLowerCase(),A)}),this.readyState=g.HEADERS_RECEIVED,this._triggerEvent("readystatechange"),this.readyState=g.LOADING,this._triggerEvent("readystatechange"),this.responseType===""||this.responseType==="text")this.responseText=await H.text(),this.response=this.responseText;else if(this.responseType==="json")this.response=await H.json(),this.responseText=JSON.stringify(this.response);else if(this.responseType==="arraybuffer")this.response=await H.arrayBuffer();else if(this.responseType==="blob")this.response=await H.blob();this.readyState=g.DONE,this._triggerEvent("readystatechange"),this._triggerEvent("load",!0),this._triggerEvent("loadend",!0)}).catch(()=>{if(w)clearTimeout(w);if(this._aborted){this._triggerEvent("abort",!0),this._triggerEvent("loadend",!0);return}this.readyState=g.DONE,this._triggerEvent("readystatechange"),this._triggerEvent("error",!0),this._triggerEvent("loadend",!0)})}abort(){if(this._aborted=!0,this.readyState!==g.UNSENT&&this.readyState!==g.DONE)this.readyState=g.UNSENT,this._triggerEvent("abort",!0),this._triggerEvent("loadend",!0)}setRequestHeader(a,S){if(this.readyState!==g.OPENED)throw Error("InvalidStateError: Object state must be OPENED");this._requestHeaders.set(a.toLowerCase(),S)}getResponseHeader(a){return this._responseHeaders.get(a.toLowerCase())||null}getAllResponseHeaders(){let a=[];for(let[S,T]of this._responseHeaders)a.push(`${S}: ${T}`);return a.join(`\r
|
|
9
|
+
`)}overrideMimeType(a){}addEventListener(a,S){if(!this._eventListeners.has(a))this._eventListeners.set(a,new Set);this._eventListeners.get(a).add(S)}removeEventListener(a,S){let T=this._eventListeners.get(a);if(T)T.delete(S)}dispatchEvent(a){let S=this._eventListeners.get(a.type);if(S)for(let D of S)D(a);let T=this[`on${a.type}`];if(T)T.call(this,a);return!0}_triggerEvent(a,S=!1){let T=S?{type:a,lengthComputable:!1,loaded:0,total:0}:{type:a};this.dispatchEvent(T)}}class is{onprogress=null;onload=null;onerror=null;addEventListener(a,S){}removeEventListener(a,S){}dispatchEvent(a){return!0}}class Lt{static CONNECTING=0;static OPEN=1;static CLOSING=2;static CLOSED=3;readyState=0;url;protocol="";extensions="";binaryType="blob";bufferedAmount=0;onopen=null;onmessage=null;onerror=null;onclose=null;_ws=null;_eventListeners=new Map;constructor(a,S){this.url=a;try{this._ws=new WebSocket(a,S),this._ws.addEventListener("open",(T)=>{if(this.readyState=1,this._ws)this.protocol=this._ws.protocol||"",this.extensions=this._ws.extensions||"";this.dispatchEvent({type:"open"})}),this._ws.addEventListener("message",(T)=>{let D={type:"message",data:T.data,origin:this.url,lastEventId:"",source:null,ports:[]};this.dispatchEvent(D)}),this._ws.addEventListener("error",(T)=>{this.dispatchEvent({type:"error"})}),this._ws.addEventListener("close",(T)=>{this.readyState=3;let D={type:"close",code:T.code||1000,reason:T.reason||"",wasClean:T.wasClean!==!1};this.dispatchEvent(D)})}catch{setTimeout(()=>{this.readyState=3,this.dispatchEvent({type:"error"})},0)}}send(a){if(this.readyState!==1)throw Error(`WebSocket is not open: readyState ${this.readyState}`);if(this._ws)if(a instanceof Blob)a.arrayBuffer().then((S)=>{this._ws?.send(S)});else this._ws.send(a)}close(a,S){if(this.readyState===2||this.readyState===3)return;if(this.readyState=2,this._ws)this._ws.close(a,S)}addEventListener(a,S){if(!this._eventListeners.has(a))this._eventListeners.set(a,new Set);this._eventListeners.get(a).add(S)}removeEventListener(a,S){let T=this._eventListeners.get(a);if(T)T.delete(S)}dispatchEvent(a){let S=this._eventListeners.get(a.type);if(S)for(let D of S)D(a);let T=this[`on${a.type}`];if(T)T.call(this,a);return!0}}var Ei;((D)=>{D.none="None";D.lax="Lax";D.strict="Strict"})(Ei||={});function hs(a,S,T){if(T)return a===S;return a===S||a.endsWith(`.${S}`)}function gs(a,S){if(a===S)return!0;if(!a.startsWith(S))return!1;if(S.endsWith("/"))return!0;return a[S.length]==="/"}class L{_cookies=[];addCookies(a){for(let S of a){let T=(S.domain||new URL(S.originURL).hostname).replace(/^\./,"").toLowerCase(),D=S.path||"/";if(this._cookies=this._cookies.filter((w)=>!(w.key===S.key&&(w.domain||new URL(w.originURL).hostname).toLowerCase()===T&&(w.path||"/")===D)),S.expires&&S.expires<=new Date)continue;this._cookies.push({...S,value:S.value||"",domain:T,hostOnly:S.hostOnly??!S.domain,path:D,expires:S.expires,httpOnly:S.httpOnly||!1,secure:S.secure||!1,sameSite:S.sameSite||"Lax"})}}getCookies(a,S=!1){let T=new URL(a),D=T.hostname.toLowerCase(),w=T.pathname,H=T.protocol==="https:",A=new Date;return this._cookies.filter((F)=>{if(F.expires&&F.expires<A)return!1;if(F.httpOnly&&!S)return!1;if(F.secure&&!H)return!1;let B=(F.domain||new URL(F.originURL).hostname).toLowerCase();if(!hs(D,B,F.hostOnly===!0))return!1;let Q=F.path||"/";if(!gs(w,Q))return!1;return!0}).sort((F,B)=>(B.path?.length||0)-(F.path?.length||0))}getAllCookies(){return[...this._cookies]}clearCookies(){this._cookies=[]}}var R=1,q=2,Rt=3,Ae=4294967295,vi=1,wi=4,_i=128,Si=256,Ti=1024,Ni={FILTER_ACCEPT:R,FILTER_REJECT:q,FILTER_SKIP:Rt,SHOW_ALL:Ae,SHOW_ELEMENT:vi,SHOW_TEXT:wi,SHOW_COMMENT:_i,SHOW_DOCUMENT:Si,SHOW_DOCUMENT_FRAGMENT:Ti};function fs(a){switch(a.nodeType){case t:return vi;case i:return wi;case c:return _i;case o:return Si;case C:return Ti;default:return 0}}function bs(a){if(!a)return null;if(typeof a==="function")return a;return typeof a.acceptNode==="function"?a.acceptNode.bind(a):null}function Ye(a,S,T){if(!(S===Ae||(S&fs(a))!==0))return Rt;let w=R,H=bs(T);if(!H)return w;let A=H(a);return A===R||A===q||A===Rt?A:w}function ys(a){let S=[],T=(D)=>{S.push(D);for(let w of D.childNodes)T(w)};return T(a),S}function qe(a,S,T){let D=[],w=(H)=>{let A=Ye(H,S,T);if(A===R)D.push(H);if(A!==q)for(let F of H.childNodes)w(F)};return w(a),D}function ns(a,S,T){let D=Ye(a,S,T);if(D===R)return a;if(D===q)return null;for(let w of a.childNodes){let H=ns(w,S,T);if(H)return H}return null}function rs(a,S,T){let D=Ye(a,S,T);if(D!==q)for(let w=a.childNodes.length-1;w>=0;w--){let H=rs(a.childNodes[w],S,T);if(H)return H}return D===R?a:null}function as(a,S){let T=a;while(T){if(T===S)return!0;T=T.parentNode}return!1}function Es(a){if(a.nodeType===i||a.nodeType===c)return a.nodeValue?.length||0;return a.childNodes.length}function Ne(a){if(!a.parentNode)return 0;return a.parentNode.childNodes.indexOf(a)}function Ie(a,S,T,D){if(a===T)return S===D?0:S<D?-1:1;if(typeof a.contains==="function"&&a.contains(T)){let F=T;while(F.parentNode!==a&&F.parentNode)F=F.parentNode;return S<=Ne(F)?-1:1}if(typeof T.contains==="function"&&T.contains(a)){let F=a;while(F.parentNode!==T&&F.parentNode)F=F.parentNode;return Ne(F)<D?-1:1}let A=a.compareDocumentPosition?.(T);if((A&J)===J)return-1;if((A&Te)===Te)return-1;return 1}function vs(a,S){let T=new Set,D=a;while(D)T.add(D),D=D.parentNode;D=S;while(D){if(T.has(D))return D;D=D.parentNode}return a}function ss(a,S,T){if(!a.parentNode&&a!==S){let{_lastTraversalParent:w,_lastTraversalNextSibling:H}=a;if(w&&as(w,S)){if(H&&H.parentNode===w)return H;return ss(w,S,!0)}}if(!T&&a.childNodes.length>0)return a.childNodes[0];let D=a;while(D&&D!==S){let w=D.parentNode;if(!w)return null;let H=w.childNodes,A=H.indexOf(D);if(A>=0&&A+1<H.length)return H[A+1];D=w}return null}class de{root;whatToShow;filter;currentNode;constructor(a,S=Ae,T=null){this.root=a,this.whatToShow=S,this.filter=T,this.currentNode=a}parentNode(){let a=this.currentNode.parentNode;while(a&&as(a,this.root)){if(Ye(a,this.whatToShow,this.filter)===R)return this.currentNode=a,a;a=a.parentNode}return null}firstChild(){for(let a of this.currentNode.childNodes){let S=ns(a,this.whatToShow,this.filter);if(S)return this.currentNode=S,S}return null}lastChild(){for(let a=this.currentNode.childNodes.length-1;a>=0;a--){let S=rs(this.currentNode.childNodes[a],this.whatToShow,this.filter);if(S)return this.currentNode=S,S}return null}previousSibling(){if(!this.currentNode.parentNode)return null;let a=this.currentNode.parentNode.childNodes,S=a.indexOf(this.currentNode);for(let T=S-1;T>=0;T--){let D=rs(a[T],this.whatToShow,this.filter);if(D)return this.currentNode=D,D}return null}nextSibling(){if(!this.currentNode.parentNode)return null;let a=this.currentNode.parentNode.childNodes,S=a.indexOf(this.currentNode);for(let T=S+1;T<a.length;T++){let D=ns(a[T],this.whatToShow,this.filter);if(D)return this.currentNode=D,D}return null}previousNode(){let a=ys(this.root),S=new Set(qe(this.root,this.whatToShow,this.filter)),T=a.indexOf(this.currentNode);for(let D=T-1;D>=0;D--)if(S.has(a[D]))return this.currentNode=a[D],a[D];return null}nextNode(){let a=ss(this.currentNode,this.root,!1);while(a){let S=Ye(a,this.whatToShow,this.filter);if(S===R)return this.currentNode=a,a;a=ss(a,this.root,S===q)}return null}}class he{root;whatToShow;filter;_cursor=-1;constructor(a,S=Ae,T=null){this.root=a,this.whatToShow=S,this.filter=T}get referenceNode(){let a=qe(this.root,this.whatToShow,this.filter);return this._cursor>=0?a[Math.min(this._cursor,a.length-1)]??this.root:this.root}get pointerBeforeReferenceNode(){return this._cursor<0}nextNode(){let a=qe(this.root,this.whatToShow,this.filter);if(this._cursor+1>=a.length)return null;return this._cursor++,a[this._cursor]??null}previousNode(){let a=qe(this.root,this.whatToShow,this.filter);if(this._cursor<0||this._cursor>=a.length)return null;let S=a[this._cursor]??null;return this._cursor--,S}detach(){}}class m{static START_TO_START=0;static START_TO_END=1;static END_TO_END=2;static END_TO_START=3;START_TO_START=m.START_TO_START;START_TO_END=m.START_TO_END;END_TO_END=m.END_TO_END;END_TO_START=m.END_TO_START;startContainer;startOffset;endContainer;endOffset;_document;constructor(a){this._document=a;let S=a.body||a.documentElement||a;this.startContainer=S,this.startOffset=0,this.endContainer=S,this.endOffset=0}get collapsed(){return this.startContainer===this.endContainer&&this.startOffset===this.endOffset}get commonAncestorContainer(){return vs(this.startContainer,this.endContainer)}setStart(a,S){if(this.startContainer=a,this.startOffset=S,Ie(this.startContainer,this.startOffset,this.endContainer,this.endOffset)>0)this.endContainer=a,this.endOffset=S}setEnd(a,S){if(this.endContainer=a,this.endOffset=S,Ie(this.startContainer,this.startOffset,this.endContainer,this.endOffset)>0)this.startContainer=a,this.startOffset=S}setStartBefore(a){if(!a.parentNode)return;this.setStart(a.parentNode,Ne(a))}setStartAfter(a){if(!a.parentNode)return;this.setStart(a.parentNode,Ne(a)+1)}setEndBefore(a){if(!a.parentNode)return;this.setEnd(a.parentNode,Ne(a))}setEndAfter(a){if(!a.parentNode)return;this.setEnd(a.parentNode,Ne(a)+1)}selectNode(a){if(!a.parentNode)return;let S=Ne(a);this.startContainer=a.parentNode,this.startOffset=S,this.endContainer=a.parentNode,this.endOffset=S+1}selectNodeContents(a){this.startContainer=a,this.startOffset=0,this.endContainer=a,this.endOffset=Es(a)}collapse(a=!1){if(a)this.endContainer=this.startContainer,this.endOffset=this.startOffset;else this.startContainer=this.endContainer,this.startOffset=this.endOffset}cloneRange(){let a=new m(this._document);return a.startContainer=this.startContainer,a.startOffset=this.startOffset,a.endContainer=this.endContainer,a.endOffset=this.endOffset,a}compareBoundaryPoints(a,S){if(a===m.START_TO_START)return Ie(this.startContainer,this.startOffset,S.startContainer,S.startOffset);if(a===m.START_TO_END)return Ie(this.startContainer,this.startOffset,S.endContainer,S.endOffset);if(a===m.END_TO_END)return Ie(this.endContainer,this.endOffset,S.endContainer,S.endOffset);return Ie(this.endContainer,this.endOffset,S.startContainer,S.startOffset)}_removeContents(){if(this.collapsed)return;if(this.startContainer===this.endContainer){if(this.startContainer.nodeType===i||this.startContainer.nodeType===c){let S=this.startContainer.nodeValue||"";this.startContainer.nodeValue=`${S.slice(0,this.startOffset)}${S.slice(this.endOffset)}`,this.collapse(!0);return}let a=this.startContainer.childNodes.slice(this.startOffset,this.endOffset);for(let S of a)this.startContainer.removeChild(S);this.setEnd(this.startContainer,this.startOffset);return}this.collapse(!0)}cloneContents(){let a=this._document.createDocumentFragment();if(this.collapsed)return a;if(this.startContainer===this.endContainer){if(this.startContainer.nodeType===i||this.startContainer.nodeType===c){let T=(this.startContainer.nodeValue||"").slice(this.startOffset,this.endOffset);if(T)a.appendChild(this._document.createTextNode(T));return a}for(let T of this.startContainer.childNodes.slice(this.startOffset,this.endOffset))a.appendChild(T.cloneNode(!0));return a}let S=this.toString();if(S)a.appendChild(this._document.createTextNode(S));return a}deleteContents(){this._removeContents()}extractContents(){let a=this.cloneContents();return this._removeContents(),a}surroundContents(a){if(this.collapsed){this.insertNode(a),this.selectNode(a);return}if(this.startContainer!==this.endContainer&&(this.startContainer.nodeType!==i||this.endContainer.nodeType!==i))throw Error("Failed to execute surroundContents on Range: unsupported partially selected non-Text nodes");let S=this.extractContents();while(a.childNodes.length>0)a.removeChild(a.childNodes[0]);this.insertNode(a);while(S.childNodes.length>0)a.appendChild(S.childNodes[0]);this.selectNode(a)}insertNode(a){if(this.startContainer.nodeType===i&&this.startContainer.parentNode){let D=this.startContainer.nodeValue||"",w=D.slice(0,this.startOffset),H=D.slice(this.startOffset);this.startContainer.nodeValue=w;let A=this._document.createTextNode(H),F=this.startContainer.parentNode,B=this.startContainer.parentNode.childNodes,Q=B.indexOf(this.startContainer),Z=B[Q+1]??null;F.insertBefore(a,Z),F.insertBefore(A,Z),this.setStart(F,Ne(a)),this.setEnd(F,Ne(a)+1);return}let S=this.startContainer,T=this.startContainer.childNodes[this.startOffset]??null;S.insertBefore(a,T),this.setStart(S,this.startOffset),this.setEnd(S,this.startOffset+1)}toString(){if(this.collapsed)return"";if(this.startContainer===this.endContainer){if(this.startContainer.nodeType===i||this.startContainer.nodeType===c)return(this.startContainer.nodeValue||"").slice(this.startOffset,this.endOffset);return this.startContainer.childNodes.slice(this.startOffset,this.endOffset).map((a)=>a.textContent).join("")}return this.cloneContents().textContent||""}createContextualFragment(a){let S=this.startContainer.ownerDocument??this.startContainer,T=S.createDocumentFragment();if(a){let{parseHTML:D}=import.meta.require("./chunk-gkeyaw9g.js"),w=D(a,S);for(let H of w)T.appendChild(H)}return T}getBoundingClientRect(){return{x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0}}getClientRects(){return[]}detach(){}}class me{_document;_range=null;constructor(a){this._document=a}get anchorNode(){return this._range?.startContainer??null}get anchorOffset(){return this._range?.startOffset??0}get focusNode(){return this._range?.endContainer??null}get focusOffset(){return this._range?.endOffset??0}get isCollapsed(){return this._range?.collapsed??!0}get rangeCount(){return this._range?1:0}get type(){if(!this._range)return"None";return this._range.collapsed?"Caret":"Range"}addRange(a){this._range=a}getRangeAt(a){if(a!==0||!this._range)throw Error("Failed to execute getRangeAt on Selection: index is out of range");return this._range}removeRange(a){if(this._range===a)this._range=null}removeAllRanges(){this._range=null}empty(){this.removeAllRanges()}collapse(a,S=0){if(a===null){this.removeAllRanges();return}let T=this._document.createRange();T.setStart(a,S),T.collapse(!0),this._range=T}setPosition(a,S=0){this.collapse(a,S)}selectAllChildren(a){let S=this._document.createRange();S.selectNodeContents(a),this._range=S}containsNode(a,S=!1){if(!this._range)return!1;try{let T=this._range.compareBoundaryPoints(m.START_TO_START,(()=>{let w=this._document.createRange();return w.selectNode(a),w})()),D=this._range.compareBoundaryPoints(m.END_TO_END,(()=>{let w=this._document.createRange();return w.selectNode(a),w})());if(S)return T<=0||D>=0;return T<=0&&D>=0}catch{return!1}}deleteFromDocument(){this._range?.deleteContents()}toString(){return this._range?.toString()??""}}var xi;((Z)=>{Z[Z.ANY_TYPE=0]="ANY_TYPE";Z[Z.NUMBER_TYPE=1]="NUMBER_TYPE";Z[Z.STRING_TYPE=2]="STRING_TYPE";Z[Z.BOOLEAN_TYPE=3]="BOOLEAN_TYPE";Z[Z.UNORDERED_NODE_ITERATOR_TYPE=4]="UNORDERED_NODE_ITERATOR_TYPE";Z[Z.ORDERED_NODE_ITERATOR_TYPE=5]="ORDERED_NODE_ITERATOR_TYPE";Z[Z.UNORDERED_NODE_SNAPSHOT_TYPE=6]="UNORDERED_NODE_SNAPSHOT_TYPE";Z[Z.ORDERED_NODE_SNAPSHOT_TYPE=7]="ORDERED_NODE_SNAPSHOT_TYPE";Z[Z.ANY_UNORDERED_NODE_TYPE=8]="ANY_UNORDERED_NODE_TYPE";Z[Z.FIRST_ORDERED_NODE_TYPE=9]="FIRST_ORDERED_NODE_TYPE"})(xi||={});class At{resultType;numberValue;stringValue;booleanValue;singleNodeValue;snapshotLength;_nodes=[];_iteratorIndex=0;constructor(a,S=[],T=0,D="",w=!1){this.resultType=a,this._nodes=S,this.numberValue=T,this.stringValue=D,this.booleanValue=w,this.singleNodeValue=S.length>0?S[0]:null,this.snapshotLength=S.length}iterateNext(){if(this._iteratorIndex<this._nodes.length)return this._nodes[this._iteratorIndex++];return null}snapshotItem(a){return this._nodes[a]||null}}class Dt{evaluate(a,S,T=null,D=0,w=null){let H=this._evaluateExpression(a,S),A=D;if(D===0)A=7;return new At(A,H)}_evaluateExpression(a,S){let T=a.trim();if(T===".")return[S];if(T==="..")return S.parentNode?[S.parentNode]:[];if(T.startsWith("//")){let D=T.substring(2);return this._findDescendants(S,D)}if(T.startsWith("/")){let D=T.substring(1);return this._findChildren(S,D)}if(T.startsWith("@")){let D=T.substring(1);if(S.nodeType===t){let w=S.getAttribute(D);if(w!==null)return[new s(w)]}return[]}return this._findDescendants(S,T)}_findChildren(a,S){let T=[],D=S.split("/").filter((A)=>A.trim());if(D.length===0)return T;let[w,...H]=D;for(let A of a.children||[])if(this._matchesExpression(A,w))if(H.length===0)T.push(A);else T.push(...this._findChildren(A,H.join("/")));return T}_findDescendants(a,S){let T=[],D=S.split("/").filter((F)=>F.trim());if(D.length===0)return T;let[w,...H]=D,A=(F)=>{if(this._matchesExpression(F,w))if(H.length===0)T.push(F);else T.push(...this._findChildren(F,H.join("/")));for(let B of F.children||[])A(B)};return A(a),T}_matchesExpression(a,S){if(S==="*")return a.nodeType===t;if(S==="text()")return a.nodeType===i;if(S==="node()")return!0;let T=S.match(/^(\w+)\[(.+)\]$/);if(T){let[,D,w]=T;if(a.nodeType!==t)return!1;let H=a;if(D!=="*"&&H.tagName!==D.toUpperCase())return!1;return this._evaluatePredicate(H,w)}if(a.nodeType===t)return a.tagName===S.toUpperCase();return!1}_evaluatePredicate(a,S){let T=S.match(/^@(\w+)=['"](.+)['"]$/);if(T){let[,w,H]=T;return a.getAttribute(w)===H}if(S.startsWith("@")){let w=S.substring(1);return a.getAttribute(w)!==null}let D=S.match(/^(\d+)$/);if(D){let w=Number.parseInt(D[1]),H=a.parentNode;if(H)return H.children.filter((F)=>F.nodeType===t).indexOf(a)===w-1}return!1}_parseTagName(a){let S=a.match(/^(\w+)/);return S?S[1]:a}}class z extends e{content;constructor(){super("template");this.content=new _,Object.defineProperty(this,"childNodes",{configurable:!0,enumerable:!0,get:()=>this.content.childNodes,set:(a)=>{this.content.childNodes=a}})}appendChild(a){return this.content.appendChild(a)}removeChild(a){return this.content.removeChild(a)}insertBefore(a,S){return this.content.insertBefore(a,S)}replaceChild(a,S){return this.content.replaceChild(a,S)}cloneNode(a=!1){let S=new z;S.namespaceURI=this.namespaceURI,S.nodeName=this.nodeName,S.tagName=this.tagName,S.ownerDocument=this.ownerDocument,S.content.ownerDocument=this.content.ownerDocument||this.ownerDocument;for(let[T,D]of this.attributes)S.setAttribute(T,D);if(a)for(let T of this.content.childNodes){let D=T.cloneNode?.(!0);if(D)S.appendChild(D)}return S}}class It extends e{constructor(){super("a")}}class Pt extends e{constructor(){super("area")}}class kt extends e{constructor(){super("audio")}}class Bt extends e{constructor(){super("base")}}class Ht extends e{constructor(){super("body")}}class Ft extends e{constructor(){super("br")}}class Gt extends e{constructor(){super("button")}}class Ut extends e{constructor(){super("data")}}class Wt extends e{constructor(){super("datalist")}}class $t extends e{constructor(){super("details")}}class qt extends e{constructor(){super("dialog")}}class zt extends e{constructor(){super("div")}}class jt extends e{constructor(){super("dl")}}class Kt extends e{constructor(){super("embed")}}class Yt extends e{constructor(){super("fieldset")}}class Xt extends e{constructor(){super("form")}}class Jt extends e{constructor(){super("head")}}class Qt extends e{constructor(){super("h1")}}class Zt extends e{constructor(){super("hr")}}class er extends e{constructor(){super("html")}}class tr extends e{constructor(){super("iframe")}}class rr extends e{constructor(){super("img")}}class nr extends e{constructor(){super("input")}}class ir extends e{constructor(){super("label")}}class sr extends e{constructor(){super("legend")}}class or extends e{constructor(){super("li")}}class ar extends e{constructor(){super("link")}}class lr extends e{constructor(){super("map")}}class ur extends e{constructor(){super("video")}}class cr extends e{constructor(){super("menu")}}class dr extends e{constructor(){super("meta")}}class hr extends e{constructor(){super("meter")}}class mr extends e{constructor(){super("ins")}}class pr extends e{constructor(){super("object")}}class fr extends e{constructor(){super("ol")}}class gr extends e{constructor(){super("optgroup")}}class br extends e{constructor(){super("option")}}class yr extends e{constructor(){super("output")}}class Er extends e{constructor(){super("p")}}class vr extends e{constructor(){super("param")}}class wr extends e{constructor(){super("picture")}}class _r extends e{constructor(){super("pre")}}class Sr extends e{constructor(){super("progress")}}class Tr extends e{constructor(){super("blockquote")}}class Nr extends e{constructor(){super("script")}}class xr extends e{constructor(){super("select")}}class j extends e{constructor(){super("slot")}cloneNode(a=!1){let S=new j;S.namespaceURI=this.namespaceURI,S.nodeName=this.nodeName,S.tagName=this.tagName,S.ownerDocument=this.ownerDocument;for(let[T,D]of this.attributes)S.setAttribute(T,D);if(a)for(let T of this.childNodes){let D=T.cloneNode?.(!0);if(D)S.appendChild(D)}return S}assignedNodes(a={}){return ci(this,a)}assignedElements(a={}){return Gi(this,a)}}class Cr extends e{constructor(){super("source")}}class Vr extends e{constructor(){super("span")}}class Mr extends e{constructor(){super("style")}}class Or extends e{constructor(){super("caption")}}class Lr extends e{constructor(){super("td")}}class Rr extends e{constructor(){super("col")}}class Ar extends e{constructor(){super("table")}}class Dr extends e{constructor(){super("tr")}}class Ir extends e{constructor(){super("tbody")}}class Pr extends e{constructor(){super("textarea")}}class kr extends e{constructor(){super("time")}}class Br extends e{constructor(){super("title")}}class Hr extends e{constructor(){super("track")}}class Fr extends e{constructor(){super("ul")}}class Gr extends e{constructor(){super("unknown")}}class Ur extends e{constructor(){super("video")}}class Wr extends e{constructor(a,S){super("img");if(a!==void 0)this.setAttribute("width",String(a));if(S!==void 0)this.setAttribute("height",String(S))}}class $r extends e{constructor(a){super("audio");if(a!==void 0)this.setAttribute("src",a)}}var Ss=300,_s=150;function ls(a,S){if(a===null)return S;let T=Number.parseInt(a,10);return Number.isNaN(T)||T<0?S:T}class K extends e{context2d=null;constructor(){super("canvas")}get width(){return ls(this.getAttribute("width"),Ss)}set width(a){this.setAttribute("width",String(a))}get height(){return ls(this.getAttribute("height"),_s)}set height(a){this.setAttribute("height",String(a))}cloneNode(a=!1){let S=new K;S.namespaceURI=this.namespaceURI,S.nodeName=this.nodeName,S.tagName=this.tagName,S.ownerDocument=this.ownerDocument;for(let[T,D]of this.attributes)S.setAttribute(T,D);if(a)for(let T of this.childNodes){let D=T.cloneNode?.(!0);if(D)S.appendChild(D)}return S}getContext(a){if(a==="2d"){if(!this.context2d)this.context2d=new ne(this);return this.context2d}return null}toDataURL(a,S){return`data:${a||"image/png"};base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==`}toBlob(a,S,T){setTimeout(()=>{let D=new Blob(["fake canvas data"],{type:S||"image/png"});a(D)},0)}async toBlobAsync(a,S){return new Promise((T)=>{this.toBlob((D)=>{if(D)T(D)},a,S)})}}var Pe=Symbol("very-happy-dom.custom-element-owner-document");function je(a,S,...T){let D=a,w=Object.prototype.hasOwnProperty.call(D,Pe),H=D[Pe];D[Pe]=S;try{return new a(...T)}finally{if(w)D[Pe]=H;else delete D[Pe]}}function us(a){return a[Pe]??null}class x extends d{nodeType=o;nodeKind="document";nodeName="#document";defaultView=null;_idIndex=new Map;get parentWindow(){return this.defaultView}documentElement=null;location;history;get head(){return this._documentElementChild("HEAD")}set head(a){this._replaceDocumentElementChild("HEAD",a)}get body(){return this._documentElementChild("BODY")}set body(a){this._replaceDocumentElementChild("BODY",a)}_documentElementChild(a){let S=this.documentElement?.childNodes;if(!S)return null;for(let T of S)if(T.nodeType===t&&T.tagName===a)return T;return null}_replaceDocumentElementChild(a,S){let T=this._documentElementChild(a);if(T===S)return;if(!this.documentElement)return;if(T&&S)this.documentElement.replaceChild(S,T);else if(T)this.documentElement.removeChild(T);else if(S)this.documentElement.appendChild(S)}_fallbackTitle="";get title(){return this.head?.querySelector("title")?.textContent??this._fallbackTitle}set title(a){if(this._fallbackTitle=a,!this.head)return;let S=this.head.querySelector("title");if(!S){if(S=this.createElement("title"),!S)return;this.head.appendChild(S)}S.textContent=a}readyState="complete";compatMode="CSS1Compat";contentType="text/html";characterSet="UTF-8";doctype=null;hidden=!1;visibilityState="visible";dir="";referrer="";designMode="off";get charset(){return this.characterSet}get inputEncoding(){return this.characterSet}get URL(){return this.location.href}get documentURI(){return this.URL}get baseURI(){let S=(this.head?.querySelector("base[href]")||this.querySelector("base[href]"))?.getAttribute("href");return S?this._resolveAgainstDocumentURL(S):this._getDocumentURLForResolution()}get domain(){if(this._locationState.hostname)return this._locationState.hostname;try{return new URL(this._getDocumentURLForResolution()).hostname}catch{return""}}get lastModified(){return new Date().toLocaleString()}_focusedElement=null;get activeElement(){return this._focusedElement||this.body}get scrollingElement(){return this.documentElement}get forms(){return this.querySelectorAll("form")}get images(){return this.querySelectorAll("img")}get links(){return this.querySelectorAll("a[href], area[href]")}get scripts(){return this.querySelectorAll("script")}get anchors(){return this.querySelectorAll("a[name]")}get embeds(){return this.querySelectorAll("embed")}get plugins(){return this.embeds}currentScript=null;_adoptedStyleSheets=[];_parsedStyleSheets=new WeakMap;get styleSheets(){let a=[];for(let S of this.querySelectorAll("style")){let T=S.textContent??"",D=this._parsedStyleSheets.get(S);if(D&&D.text===T){a.push(D.sheet);continue}let w=new re;w.replaceSync(T),this._parsedStyleSheets.set(S,{text:T,sheet:w}),a.push(w)}return a}get adoptedStyleSheets(){return this._adoptedStyleSheets}set adoptedStyleSheets(a){this._adoptedStyleSheets=a}implementation={createHTMLDocument:(a)=>{let S=new x;if(a!==void 0)S.title=a;return S},hasFeature:()=>!0};_historyStack=[];_historyIndex=-1;_xpathEvaluator=new Dt;_cookieContainer=new L;_setCookieContainer(a){this._cookieContainer=a}_getCookieContainer(){return this._cookieContainer}_selection=null;_locationState={href:"",protocol:"",host:"",hostname:"",port:"",pathname:"",search:"",hash:"",origin:""};constructor(){super();this.documentElement=new e("html"),this.documentElement.appendChild(new e("head")),this.documentElement.appendChild(new e("body")),this.appendChild(this.documentElement),this.location=this._createLocation();let a=this;this.history={get length(){return a._historyStack.length},get state(){return a._historyStack[a._historyIndex]?.state||null},pushState(S,T,D){let w=D?a._resolveLocationString(D):a.location.href;if(a._historyStack=a._historyStack.slice(0,a._historyIndex+1),a._historyStack.push({state:S,title:T,url:w}),a._historyIndex++,D)a._updateLocation(w,{triggerHashchange:!1})},replaceState(S,T,D){let w=D?a._resolveLocationString(D):a.location.href;if(a._historyIndex>=0)a._historyStack[a._historyIndex]={state:S,title:T,url:w};if(D)a._updateLocation(w,{triggerHashchange:!1})},back(){if(a._historyIndex>0){a._historyIndex--;let S=a._historyStack[a._historyIndex];if(S.url)a._updateLocation(S.url,{triggerPopstate:!0,popState:S.state})}},forward(){if(a._historyIndex<a._historyStack.length-1){a._historyIndex++;let S=a._historyStack[a._historyIndex];if(S.url)a._updateLocation(S.url,{triggerPopstate:!0,popState:S.state})}},go(S){let T=a._historyIndex+S;if(T>=0&&T<a._historyStack.length){a._historyIndex=T;let D=a._historyStack[a._historyIndex];if(D.url)a._updateLocation(D.url,{triggerPopstate:!0,popState:D.state})}}}}_createLocation(){let a={},S=(T)=>{let D=new URL(this._getDocumentURLForResolution(),"http://localhost/");T(D),this._updateLocation(D.href)};return Object.defineProperties(a,{href:{enumerable:!0,get:()=>this._locationState.href,set:(T)=>{this._updateLocation(`${T}`)}},protocol:{enumerable:!0,get:()=>this._locationState.protocol,set:(T)=>S((D)=>{D.protocol=T.endsWith(":")?T:`${T}:`})},host:{enumerable:!0,get:()=>this._locationState.host,set:(T)=>S((D)=>{D.host=T})},hostname:{enumerable:!0,get:()=>this._locationState.hostname,set:(T)=>S((D)=>{D.hostname=T})},port:{enumerable:!0,get:()=>this._locationState.port,set:(T)=>S((D)=>{D.port=T})},pathname:{enumerable:!0,get:()=>this._locationState.pathname,set:(T)=>S((D)=>{D.pathname=T.startsWith("/")?T:`/${T}`})},search:{enumerable:!0,get:()=>this._locationState.search,set:(T)=>S((D)=>{D.search=T?T.startsWith("?")?T:`?${T}`:""})},hash:{enumerable:!0,get:()=>this._locationState.hash,set:(T)=>S((D)=>{D.hash=T?T.startsWith("#")?T:`#${T}`:""})},origin:{enumerable:!0,get:()=>this._locationState.origin}}),a.assign=(T)=>{this._updateLocation(T)},a.replace=(T)=>{this._updateLocation(T)},a.reload=()=>{},a.toString=()=>this._locationState.href,a}_getDocumentURLForResolution(){return this.location.href||this.defaultView?.location?.href||"http://localhost/"}_resolveAgainstDocumentURL(a){try{return new URL(a,this._getDocumentURLForResolution()).href}catch{return a}}_resolveLocationString(a){try{return new URL(a,this._getDocumentURLForResolution()).href}catch{return a}}_updateLocation(a,S={}){let{triggerHashchange:T=!0,triggerPopstate:D=!1,popState:w=null}=S,H=this._locationState.href,A=this._locationState.hash;try{let F=this.location.href||this.defaultView?.location?.href||"",B;if(F&&!F.startsWith("about:"))B=new URL(a,F);else B=new URL(a);this._locationState.href=B.href,this._locationState.protocol=B.protocol,this._locationState.host=B.host,this._locationState.hostname=B.hostname,this._locationState.port=B.port,this._locationState.pathname=B.pathname,this._locationState.search=B.search,this._locationState.hash=B.hash,this._locationState.origin=B.origin}catch{this._locationState.href=a,this._locationState.protocol="",this._locationState.host="",this._locationState.hostname="",this._locationState.port="",this._locationState.pathname="",this._locationState.search="",this._locationState.hash="",this._locationState.origin=""}if(T&&H&&A!==this._locationState.hash)this._dispatchWindowEvent("hashchange",{oldURL:H,newURL:this._locationState.href});if(D)this._dispatchWindowEvent("popstate",{state:w})}_dispatchWindowEvent(a,S){if(!this.defaultView)return;let T=new r(a);for(let[D,w]of Object.entries(S))T[D]=w;this.defaultView.dispatchEvent(T)}_getCookieOrigin(){let a=this._getDocumentURLForResolution();if(!a||a==="about:blank"||a.startsWith("about:"))return"http://localhost/";try{let S=new URL(a,"http://localhost/");if(S.protocol!=="http:"&&S.protocol!=="https:")return"http://localhost/";return S.href}catch{return"http://localhost/"}}_getDefaultCookiePath(){let a="/";try{a=new URL(this._getDocumentURLForResolution(),"http://localhost/").pathname||"/"}catch{a=this.location.pathname||"/"}if(!a.startsWith("/"))return"/";if(a==="/")return"/";let S=a.lastIndexOf("/");if(S<=0)return"/";return a.slice(0,S+1)}get textContent(){return this.documentElement?.textContent||""}set textContent(a){if(this.documentElement)this.documentElement.textContent=a}appendChild(a){return P(this,a)}_setOwnerDocumentRecursive(a,S){E(a,S)}createElement(a){if(a.toLowerCase()==="canvas"){let D=new K;return D.ownerDocument=this,D}if(a.toLowerCase()==="template"){let D=new z;return D.ownerDocument=this,D.content.ownerDocument=this,D}if(a.toLowerCase()==="slot"){let D=new j;return D.ownerDocument=this,D}let S=this.defaultView?.customElements?.get?.(a.toLowerCase()),T=S?je(S,this,a):new e(a);return T.ownerDocument=this,T}createElementNS(a,S){let T;if(a==="http://www.w3.org/2000/svg")T=new n(S);else T=new e(S),T.namespaceURI=a;return T.ownerDocument=this,T}createTextNode(a){let S=new s(a);return S.ownerDocument=this,S}createComment(a){let S=new N(a);return S.ownerDocument=this,S}createDocumentFragment(){let a=new _;return a.ownerDocument=this,a}_setFocusedElement(a){this._focusedElement=a}createEvent(a){switch(a.toLowerCase()){case"customevent":case"customevents":return new ce("");case"mouseevent":case"mouseevents":return new V("");case"keyboardevent":return new ie("");case"focusevent":return new se("");case"uievent":case"uievents":return new v("");default:return new r("")}}createAttribute(a){return{name:a.toLowerCase(),value:"",specified:!0}}importNode(a,S=!1){if(typeof a.cloneNode!=="function")throw Error("Failed to execute 'importNode': parameter 1 is not of type 'Node'.");let T=a.cloneNode(S);return this._setOwnerDocumentRecursive(T,this),T}adoptNode(a){if(a.parentNode)a.parentNode.removeChild(a);return this._setOwnerDocumentRecursive(a,this),a}hasFocus(){return this._focusedElement!==null}execCommand(a,S,T){return!1}queryCommandEnabled(a){return!1}queryCommandSupported(a){return!1}createTreeWalker(a,S=4294967295,T=null){return new de(a,S,T)}createNodeIterator(a,S=4294967295,T=null){return new he(a,S,T)}createRange(){return new m(this)}getSelection(){if(!this._selection)this._selection=new me(this);return this._selection}querySelector(a){return I(this,a)}querySelectorAll(a){return y(this,a)}getElementById(a){return this._idIndex.get(a)??null}getElementsByTagName(a){return this.querySelectorAll(a)}getElementsByName(a){return this.querySelectorAll(`[name="${a}"]`)}getElementsByClassName(a){let S=a.trim().split(/\s+/).filter(Boolean);if(S.length===0)return[];return this.querySelectorAll(S.map((T)=>`.${T}`).join(""))}parseHTML(a){let S=p(a,this);if(this.body){this.body.childNodes=[];for(let T of S)this.body.appendChild(T)}}write(a){let S=p(a,this);for(let T of S)if(T.nodeType===t){let D=T;if(D.tagName==="HTML"){this.childNodes=[],this.documentElement=D,this.appendChild(D);return}}if(this.body)for(let T of S)this.body.appendChild(T)}open(){if(this.body)this.body.childNodes=[];return this}close(){}writeln(a){this.write(`${a}
|
|
10
|
+
`)}getComputedStyle(a,S){let T={ADDRESS:"block",ARTICLE:"block",ASIDE:"block",BLOCKQUOTE:"block",BODY:"block",DETAILS:"block",DIALOG:"block",DIV:"block",DL:"block",DT:"block",FIELDSET:"block",FIGCAPTION:"block",FIGURE:"block",FOOTER:"block",FORM:"block",H1:"block",H2:"block",H3:"block",H4:"block",H5:"block",H6:"block",HEADER:"block",HR:"block",HTML:"block",LEGEND:"block",MAIN:"block",NAV:"block",OL:"block",P:"block",PRE:"block",SECTION:"block",UL:"block",LI:"list-item",TABLE:"table",CAPTION:"table-caption",THEAD:"table-header-group",TBODY:"table-row-group",TFOOT:"table-footer-group",TR:"table-row",TH:"table-cell",TD:"table-cell",COLGROUP:"table-column-group",COL:"table-column",BUTTON:"inline-block",INPUT:"inline-block",SELECT:"inline-block",TEXTAREA:"inline-block",A:"inline",ABBR:"inline",B:"inline",CITE:"inline",CODE:"inline",DFN:"inline",EM:"inline",I:"inline",KBD:"inline",LABEL:"inline",MARK:"inline",Q:"inline",S:"inline",SAMP:"inline",SMALL:"inline",SPAN:"inline",STRONG:"inline",SUB:"inline",SUP:"inline",TIME:"inline",U:"inline",VAR:"inline",IMG:"inline",BR:"inline",SCRIPT:"none",STYLE:"none",HEAD:"none",TITLE:"none",META:"none",LINK:"none"},D=(B,Q)=>{switch(B){case"display":return T[Q]||"inline";case"visibility":return"visible";case"opacity":return"1";case"position":return"static";case"float":return"none";case"clear":return"none";case"overflow":case"overflow-x":case"overflow-y":return"visible";case"box-sizing":return"content-box";case"z-index":return"auto";case"flex-direction":return"row";case"flex-wrap":return"nowrap";case"justify-content":return"normal";case"align-items":return"normal";case"align-content":return"normal";case"text-align":return"start";case"text-transform":return"none";case"text-decoration":case"text-decoration-line":return"none";case"font-size":return"16px";case"font-family":return"serif";case"font-weight":return"400";case"font-style":return"normal";case"line-height":return"normal";case"color":return"rgb(0, 0, 0)";case"background-color":return"rgba(0, 0, 0, 0)";case"border-width":case"border-top-width":case"border-right-width":case"border-bottom-width":case"border-left-width":return"0px";case"border-style":case"border-top-style":case"border-right-style":case"border-bottom-style":case"border-left-style":return"none";case"margin":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":return"0px";case"width":case"height":case"min-width":case"min-height":return"auto";case"max-width":case"max-height":return"none";case"cursor":return"auto";case"pointer-events":return"auto";default:return""}},w=a,H=null,A=()=>{if(!H)H=ii(w,[...this.styleSheets,...this._adoptedStyleSheets]);return H},F=(B)=>{let Q=si(B,w.style,A());if(Q!==null)return Q;return D(B,w.tagName)};return new Proxy({getPropertyValue(B){return F(B)},getPropertyPriority(B){if(w.style.getPropertyPriority(B)==="important")return"important";return A().important.has(B)?"important":""}},{get(B,Q){if(Q==="getPropertyValue")return B.getPropertyValue;if(Q==="getPropertyPriority")return B.getPropertyPriority;if(typeof Q!=="string")return;let Z=Q.replace(/[A-Z]/g,(Se)=>`-${Se.toLowerCase()}`);return F(Z)}})}addEventListener(a,S,T={}){super.addEventListener(a,S,T)}removeEventListener(a,S,T={}){super.removeEventListener(a,S,T)}dispatchEvent(a){return super.dispatchEvent(a)}evaluate(a,S=this,T=null,D=0,w=null){let H=S===this?this.documentElement||this:S;return this._xpathEvaluator.evaluate(a,H,T,D,w)}createExpression(a,S=null){return{evaluate:(T,D=0)=>{let w=T===this?this.documentElement||this:T;return this._xpathEvaluator.evaluate(a,w,S,D,null)}}}get cookie(){return this._cookieContainer.getCookies(this._getCookieOrigin()).map((a)=>`${a.key}=${a.value||""}`).join("; ")}set cookie(a){let S=a.split(";").map((B)=>B.trim()).filter(Boolean),[T,...D]=S;if(!T)return;let w=T.indexOf("="),H=(w===-1?T:T.slice(0,w)).trim(),A=w===-1?"":T.slice(w+1).trim();if(!H)return;let F={key:H,value:A,originURL:this._getCookieOrigin(),path:this._getDefaultCookiePath(),hostOnly:!0};for(let B of D){let[Q,...Z]=B.split("="),Se=Q.trim().toLowerCase(),we=Z.join("=").trim();if(Se==="expires"){let _e=new Date(we);if(!Number.isNaN(_e.getTime()))F.expires=_e}else if(Se==="max-age"){let _e=Number.parseInt(we,10);if(!Number.isNaN(_e))F.expires=new Date(Date.now()+_e*1000)}else if(Se==="path")F.path=we||"/";else if(Se==="domain")F.domain=we.replace(/^\./,""),F.hostOnly=!1;else if(Se==="secure")F.secure=!0;else if(Se==="httponly")F.httpOnly=!0;else if(Se==="samesite"){let _e=we.toLowerCase();F.sameSite=_e==="strict"?"Strict":_e==="none"?"None":"Lax"}}this._cookieContainer.addCookies([F])}getElementsByTagNameNS(a,S){return this.getElementsByTagName(S)}createAttributeNS(a,S){return{name:S.toLowerCase(),value:"",namespaceURI:a,specified:!0}}createProcessingInstruction(a,S){return new N(`?${a} ${S}?`)}elementFromPoint(a,S){return this.body}elementsFromPoint(a,S){return this.body?[this.body]:[]}}function Ui(){return new x}class qr{root;rootMargin;thresholds;_callback;_observedElements=new Set;_pendingEntries=[];constructor(a,S={}){if(this._callback=a,this.root=S.root||null,this.rootMargin=S.rootMargin||"0px",S.threshold===void 0)this.thresholds=[0];else if(Array.isArray(S.threshold))this.thresholds=S.threshold;else this.thresholds=[S.threshold]}observe(a){if(this._observedElements.has(a))return;this._observedElements.add(a);let S=this._createEntry(a,!0);this._pendingEntries.push(S),setTimeout(()=>{if(this._observedElements.has(a)){let T=this._pendingEntries.indexOf(S);if(T!==-1)this._pendingEntries.splice(T,1);this._callback([S],this)}},0)}unobserve(a){this._observedElements.delete(a)}disconnect(){this._observedElements.clear()}takeRecords(){return this._pendingEntries.splice(0)}_createEntry(a,S){let T=this._getBoundingClientRect(a);return{boundingClientRect:T,intersectionRatio:S?1:0,intersectionRect:S?T:this._createEmptyRect(),isIntersecting:S,rootBounds:this.root?this._getBoundingClientRect(this.root):null,target:a,time:Date.now()}}_getBoundingClientRect(a){return{x:0,y:0,width:100,height:100,top:0,right:100,bottom:100,left:0}}_createEmptyRect(){return{x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0}}}class zr{_callback;_observedElements=new Set;constructor(a){this._callback=a}observe(a,S){if(this._observedElements.has(a))return;this._observedElements.add(a),setTimeout(()=>{if(this._observedElements.has(a)){let T=this._createEntry(a);this._callback([T],this)}},0)}unobserve(a){this._observedElements.delete(a)}disconnect(){this._observedElements.clear()}_createEntry(a){let S=this._getContentRect(a),T={inlineSize:S.width,blockSize:S.height};return{target:a,contentRect:S,borderBoxSize:[T],contentBoxSize:[T],devicePixelContentBoxSize:[T]}}_getContentRect(a){return{x:0,y:0,width:100,height:100,top:0,right:100,bottom:100,left:0}}}class Ci{_data=new Map;get length(){return this._data.size}key(a){return Array.from(this._data.keys())[a]??null}getItem(a){return this._data.get(a)??null}setItem(a,S){this._data.set(a,String(S))}removeItem(a){this._data.delete(a)}clear(){this._data.clear()}}function pe(){let a=new Ci;return new Proxy(a,{get(S,T){if(T in S||typeof T==="symbol")return S[T];return S.getItem(T)},set(S,T,D){if(T in S)return S[T]=D,!0;return S.setItem(T,D),!0},deleteProperty(S,T){return S.removeItem(T),!0},has(S,T){return T in S||S.getItem(T)!==null}})}class jr{_timeouts=new Map;_intervals=new Map;_animationFrames=new Map;_nextId=1;_aborted=!1;setTimeout(a,S=0,...T){if(this._aborted)return-1;let D=this._nextId++,w=globalThis.setTimeout(()=>{if(this._timeouts.delete(D),!this._aborted)a(...T)},S);return this._timeouts.set(D,w),D}clearTimeout(a){let S=this._timeouts.get(a);if(S)globalThis.clearTimeout(S),this._timeouts.delete(a)}setInterval(a,S=0,...T){if(this._aborted)return-1;let D=this._nextId++,w=globalThis.setInterval(()=>{if(!this._aborted)a(...T)},S);return this._intervals.set(D,w),D}clearInterval(a){let S=this._intervals.get(a);if(S)globalThis.clearInterval(S),this._intervals.delete(a)}requestAnimationFrame(a){if(this._aborted)return-1;let S=this._nextId++,T=globalThis.setTimeout(()=>{if(this._animationFrames.delete(S),!this._aborted)a(Date.now())},16);return this._animationFrames.set(S,T),S}cancelAnimationFrame(a){let S=this._animationFrames.get(a);if(S)globalThis.clearTimeout(S),this._animationFrames.delete(a)}hasPendingTimers(){return this._timeouts.size>0||this._animationFrames.size>0}async waitForTimers(){while(this._timeouts.size>0||this._animationFrames.size>0)await new Promise((a)=>globalThis.setTimeout(a,10))}clearAll(){for(let a of this._timeouts.values())globalThis.clearTimeout(a);this._timeouts.clear();for(let a of this._intervals.values())globalThis.clearInterval(a);this._intervals.clear();for(let a of this._animationFrames.values())globalThis.clearTimeout(a);this._animationFrames.clear()}abort(){this._aborted=!0,this.clearAll()}}var Ts=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),xs=new Set(["attributes","childNodes","namespaceURI","nodeKind","nodeName","nodeType","nodeValue","ownerDocument","parentNode","tagName"]);function cs(a){return/^[a-z][.0-9_a-z-]*-[.0-9_a-z-]*$/.test(a)&&!Ts.has(a)}function Vs(a,S){if(!(a instanceof Map)||!(S instanceof Map))return a??S;for(let[T,D]of S){let w=a.get(T)??[];a.set(T,[...w,...D])}return a}function Ms(a,S){let T=a._getInternalShadowRoot?.()??null,D=je(S,a.ownerDocument),w=D._getInternalShadowRoot?.()??null,H=a._eventListeners;for(let F of Reflect.ownKeys(D))if(!xs.has(F))a[F]=D[F];if(a._eventListeners=Vs(H,D._eventListeners),T){if(w){for(let F of Reflect.ownKeys(a))if(a[F]===w)a[F]=T}a._shadowRoot=T}let A=a._getInternalShadowRoot?.();if(A){A.host=a,A.parentNode=a;let F=(B)=>{B.ownerDocument=a.ownerDocument;for(let Q of B.childNodes??[])F(Q)};F(A)}}class Kr{_definitions=new Map;_document=null;_whenDefinedPromises=new Map;define(a,S,T){if(!cs(a))throw Error(`Failed to execute 'define' on 'CustomElementRegistry': "${a}" is not a valid custom element name`);if(this._definitions.has(a))throw Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${a}" has already been used`);if([...this._definitions.values()].includes(S))throw Error("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used");if(S.__veryHappyCustomElementName=a,this._definitions.set(a,S),this._document)this.upgrade(this._document);let D=this._whenDefinedPromises.get(a);if(D)D.forEach((w)=>w.resolve()),this._whenDefinedPromises.delete(a)}get(a){return this._definitions.get(a)}whenDefined(a){if(!cs(a))return Promise.reject(Error(`Failed to execute 'whenDefined' on 'CustomElementRegistry': "${a}" is not a valid custom element name`));if(this._definitions.has(a))return Promise.resolve(this._definitions.get(a));return new Promise((S,T)=>{if(!this._whenDefinedPromises.has(a))this._whenDefinedPromises.set(a,[]);this._whenDefinedPromises.get(a).push({resolve:()=>S(this._definitions.get(a)),reject:T})})}_setDocument(a){this._document=a}upgrade(a){let S=(T)=>{if(T?.tagName){let w=`${T.tagName}`.toLowerCase(),H=this._definitions.get(w);if(H&&!(T instanceof H)){Ms(T,H),Object.setPrototypeOf(T,H.prototype),T.__veryHappyCustomElementName=w;for(let[A,F]of T.attributes??[])ve(T,A,null,F);if(T.isConnected)Ee(T)}}let D=T?._getInternalShadowRoot?.();if(D)S(D);for(let w of T?.childNodes??[])S(w)};S(a)}}class Yr extends e{constructor(a){let S=new.target;super(a||S.__veryHappyCustomElementName||"div");this.ownerDocument=us(S)}static get observedAttributes(){return[]}}class Xr extends n{constructor(){super("svg")}}class Jr extends n{constructor(){super("g")}}class Qr extends n{constructor(){super("path")}}class Zr extends n{constructor(){super("animate")}}class en extends n{constructor(){super("circle")}}class tn extends n{constructor(){super("clipPath")}}class rn extends n{constructor(){super("defs")}}class nn extends n{constructor(){super("desc")}}class sn extends n{constructor(){super("ellipse")}}class on extends n{constructor(){super("filter")}}class an extends n{constructor(){super("foreignObject")}}class ln extends n{constructor(){super("g")}}class un extends n{constructor(){super("image")}}class cn extends n{constructor(){super("line")}}class dn extends n{constructor(){super("linearGradient")}}class hn extends n{constructor(){super("marker")}}class mn extends n{constructor(){super("mask")}}class pn extends n{constructor(){super("metadata")}}class fn extends n{constructor(){super("path")}}class gn extends n{constructor(){super("pattern")}}class bn extends n{constructor(){super("polygon")}}class yn extends n{constructor(){super("polyline")}}class En extends n{constructor(){super("radialGradient")}}class vn extends n{constructor(){super("rect")}}class wn extends n{constructor(){super("script")}}class _n extends n{constructor(){super("stop")}}class Sn extends n{constructor(){super("style")}}class Tn extends n{constructor(){super("switch")}}class Nn extends n{constructor(){super("symbol")}}class xn extends n{constructor(){super("text")}}class Cn extends n{constructor(){super("textPath")}}class Vn extends n{constructor(){super("title")}}class Mn extends n{constructor(){super("tspan")}}class On extends n{constructor(){super("use")}}class Ln extends n{constructor(){super("view")}}class Rn extends n{constructor(){super("feBlend")}}class An extends n{constructor(){super("feColorMatrix")}}class Dn extends n{constructor(){super("feComponentTransfer")}}class In extends n{constructor(){super("feComposite")}}class Pn extends n{constructor(){super("feConvolveMatrix")}}class kn extends n{constructor(){super("feDiffuseLighting")}}class Bn extends n{constructor(){super("feDisplacementMap")}}class Hn extends n{constructor(){super("feDistantLight")}}class Fn extends n{constructor(){super("feFlood")}}class Gn extends n{constructor(){super("feGaussianBlur")}}class Un extends n{constructor(){super("feImage")}}class Wn extends n{constructor(){super("feMerge")}}class $n extends n{constructor(){super("feMergeNode")}}class qn extends n{constructor(){super("feMorphology")}}class zn extends n{constructor(){super("feOffset")}}class jn extends n{constructor(){super("fePointLight")}}class Kn extends n{constructor(){super("feSpecularLighting")}}class Yn extends n{constructor(){super("feSpotLight")}}class Xn extends n{constructor(){super("feTile")}}class Jn extends n{constructor(){super("feTurbulence")}}class Qn{static SVG_ANGLETYPE_UNKNOWN=0;static SVG_ANGLETYPE_UNSPECIFIED=1;static SVG_ANGLETYPE_DEG=2;static SVG_ANGLETYPE_RAD=3;static SVG_ANGLETYPE_GRAD=4;unitType=0;value=0;valueInSpecifiedUnits=0;valueAsString="0"}class Zn{static SVG_LENGTHTYPE_UNKNOWN=0;static SVG_LENGTHTYPE_NUMBER=1;static SVG_LENGTHTYPE_PERCENTAGE=2;static SVG_LENGTHTYPE_PX=5;unitType=0;value=0;valueInSpecifiedUnits=0;valueAsString="0"}class ei{value=0}class ti{x=0;y=0}class ri{x=0;y=0;width=0;height=0}class De{a=1;b=0;c=0;d=1;e=0;f=0}class ni{static SVG_TRANSFORM_UNKNOWN=0;static SVG_TRANSFORM_MATRIX=1;static SVG_TRANSFORM_TRANSLATE=2;static SVG_TRANSFORM_SCALE=3;static SVG_TRANSFORM_ROTATE=4;static SVG_TRANSFORM_SKEWX=5;static SVG_TRANSFORM_SKEWY=6;type=0;matrix=new De;angle=0}class b extends f{document;happyDOM;console;navigator;customElements;HTMLElement=Yr;localStorage;sessionStorage;fetch=globalThis.fetch.bind(globalThis);Request=globalThis.Request;Response=globalThis.Response;Headers=globalThis.Headers;FormData=bi;ClipboardItem=Ve;URL=globalThis.URL;URLSearchParams=globalThis.URLSearchParams;AbortController=globalThis.AbortController;AbortSignal=globalThis.AbortSignal;Blob=globalThis.Blob;TextEncoder=globalThis.TextEncoder;TextDecoder=globalThis.TextDecoder;ReadableStream=globalThis.ReadableStream;WritableStream=globalThis.WritableStream;TransformStream=globalThis.TransformStream;CustomEvent=ce;MutationObserver=l;IntersectionObserver=qr;ResizeObserver=zr;XMLHttpRequest=g;WebSocket=Lt;File=ut;FileReader=u;FileList=ct;HTMLCanvasElement=K;CanvasRenderingContext2D=ne;HTMLAnchorElement=It;HTMLAreaElement=Pt;HTMLAudioElement=kt;HTMLBaseElement=Bt;HTMLBodyElement=Ht;HTMLBRElement=Ft;HTMLButtonElement=Gt;HTMLDataElement=Ut;HTMLDataListElement=Wt;HTMLDetailsElement=$t;HTMLDialogElement=qt;HTMLDivElement=zt;HTMLDListElement=jt;HTMLEmbedElement=Kt;HTMLFieldSetElement=Yt;HTMLFormElement=Xt;HTMLHeadElement=Jt;HTMLHeadingElement=Qt;HTMLHRElement=Zt;HTMLHtmlElement=er;HTMLIFrameElement=tr;HTMLImageElement=rr;HTMLInputElement=nr;HTMLLabelElement=ir;HTMLLegendElement=sr;HTMLLIElement=or;HTMLLinkElement=ar;HTMLMapElement=lr;HTMLMediaElement=ur;HTMLMenuElement=cr;HTMLMetaElement=dr;HTMLMeterElement=hr;HTMLModElement=mr;HTMLObjectElement=pr;HTMLOListElement=fr;HTMLOptGroupElement=gr;HTMLOptionElement=br;HTMLOutputElement=yr;HTMLParagraphElement=Er;HTMLParamElement=vr;HTMLPictureElement=wr;HTMLPreElement=_r;HTMLProgressElement=Sr;HTMLQuoteElement=Tr;HTMLScriptElement=Nr;HTMLSelectElement=xr;HTMLSlotElement=j;HTMLSourceElement=Cr;HTMLSpanElement=Vr;HTMLStyleElement=Mr;HTMLTableCaptionElement=Or;HTMLTableCellElement=Lr;HTMLTableColElement=Rr;HTMLTableElement=Ar;HTMLTableRowElement=Dr;HTMLTableSectionElement=Ir;HTMLTextAreaElement=Pr;HTMLTimeElement=kr;HTMLTitleElement=Br;HTMLTrackElement=Hr;HTMLUListElement=Fr;HTMLUnknownElement=Gr;HTMLVideoElement=Ur;Image=Wr;Audio=$r;Document=x;Element=e;HTMLTemplateElement=z;Node=d;NodeFilter=Ni;NodeIterator=he;Range=m;Selection=me;Text=s;TreeWalker=de;Comment=N;DocumentFragment=_;Event=r;SVGElement=n;SVGSVGElement=Xr;SVGGraphicsElement=Jr;SVGGeometryElement=Qr;SVGAnimationElement=Zr;SVGCircleElement=en;SVGClipPathElement=tn;SVGDefsElement=rn;SVGDescElement=nn;SVGEllipseElement=sn;SVGFilterElement=on;SVGForeignObjectElement=an;SVGGElement=ln;SVGImageElement=un;SVGLineElement=cn;SVGLinearGradientElement=dn;SVGMarkerElement=hn;SVGMaskElement=mn;SVGMetadataElement=pn;SVGPathElement=fn;SVGPatternElement=gn;SVGPolygonElement=bn;SVGPolylineElement=yn;SVGRadialGradientElement=En;SVGRectElement=vn;SVGScriptElement=wn;SVGStopElement=_n;SVGStyleElement=Sn;SVGSwitchElement=Tn;SVGSymbolElement=Nn;SVGTextElement=xn;SVGTextPathElement=Cn;SVGTitleElement=Vn;SVGTSpanElement=Mn;SVGUseElement=On;SVGViewElement=Ln;SVGFEBlendElement=Rn;SVGFEColorMatrixElement=An;SVGFEComponentTransferElement=Dn;SVGFECompositeElement=In;SVGFEConvolveMatrixElement=Pn;SVGFEDiffuseLightingElement=kn;SVGFEDisplacementMapElement=Bn;SVGFEDistantLightElement=Hn;SVGFEFloodElement=Fn;SVGFEGaussianBlurElement=Gn;SVGFEImageElement=Un;SVGFEMergeElement=Wn;SVGFEMergeNodeElement=$n;SVGFEMorphologyElement=qn;SVGFEOffsetElement=zn;SVGFEPointLightElement=jn;SVGFESpecularLightingElement=Kn;SVGFESpotLightElement=Yn;SVGFETileElement=Xn;SVGFETurbulenceElement=Jn;SVGAngle=Qn;SVGLength=Zn;SVGNumber=ei;SVGPoint=ti;SVGRect=ri;SVGMatrix=De;SVGTransform=ni;CSSStyleSheet=re;CSSStyleDeclaration=G;CSSRule=h;CSSStyleRule=W;CSSMediaRule=et;CSSKeyframesRule=tt;CSSKeyframeRule=xe;CSSFontFaceRule=rt;CSSSupportsRule=nt;CSSContainerRule=it;CSSConditionRule=U;CSSGroupingRule=te;CSSScopeRule=st;CSS=ot;MediaList=ee;StylePropertyMap=at;StylePropertyMapReadOnly=Ce;DOMRect=k;DOMRectReadOnly=Y;DOMPoint=fe;DOMPointReadOnly=X;DOMMatrix=ke;DOMMatrixReadOnly=ge;NodeList=Be;HTMLCollection=He;NamedNodeMap=Ge;Attr=Fe;XMLSerializer=Ue;ValidityState=We;Screen=be;MediaQueryList=ye;DocumentType=$e;HTMLDocument=x;XMLDocument=x;UIEvent=v;MouseEvent=V;KeyboardEvent=ie;FocusEvent=se;InputEvent=dt;WheelEvent=ht;PointerEvent=mt;TouchEvent=pt;Touch=Ct;AnimationEvent=ft;TransitionEvent=gt;ClipboardEvent=bt;DragEvent=yt;ErrorEvent=oe;HashChangeEvent=Et;PopStateEvent=vt;ProgressEvent=wt;MessageEvent=M;CloseEvent=_t;StorageEvent=St;SubmitEvent=Tt;MediaQueryListEvent=Nt;CompositionEvent=xt;performance=new Xe;Notification=Qe;DataTransfer=Ze;crypto=globalThis.crypto;BroadcastChannel=Vt;MessageChannel=Mt;MessagePort=ae;EventSource=O;PerformanceObserver=Ot;indexedDB=yi();IDBFactory=Re;IDBDatabase=Le;IDBObjectStore=Me;IDBTransaction=Oe;IDBRequest=le;IDBOpenDBRequest=ue;DOMParser=class{parseFromString(S,T){let D=new x;if(T==="text/html"||T==="application/xhtml+xml"){let w=p(S,D);for(let H of w)if(H.tagName==="HTML"){D.childNodes=[],D.documentElement=H,D.appendChild(H);for(let A of H.children)if(A.tagName==="HEAD")D.head=A;else if(A.tagName==="BODY")D.body=A;return D}if(D.body){D.body.childNodes=[];for(let H of w)D.body.appendChild(H)}}else if(T==="text/xml"||T==="application/xml"||T==="image/svg+xml"){let w=p(S,D);D.childNodes=[];for(let H of w)D.appendChild(H)}return D}};get self(){return this}get window(){return this}get parent(){return this}get top(){return this}get frames(){return this}frameElement=null;opener=null;name="";closed=!1;scrollX=0;scrollY=0;get pageXOffset(){return this.scrollX}get pageYOffset(){return this.scrollY}devicePixelRatio=1;atob(a){return globalThis.atob(a)}btoa(a){return globalThis.btoa(a)}queueMicrotask(a){globalThis.queueMicrotask(a)}structuredClone(a,S){return globalThis.structuredClone(a,S)}_location;_settings;_width;_height;_timerManager;_idleCallbackId=0;constructor(a={}){super();let{url:S="about:blank",width:T=1024,height:D=768,console:w,settings:H={}}=a;if(this._width=T,this._height=D,this._settings={navigator:{userAgent:H.navigator?.userAgent||"Mozilla/5.0 (X11; Linux x64) AppleWebKit/537.36 (KHTML, like Gecko) VeryHappyDOM/1.0.0"},device:{prefersColorScheme:H.device?.prefersColorScheme||"light"}},this.console=w||globalThis.console,this.navigator=new lt,this.navigator.userAgent=this._settings.navigator.userAgent,this.customElements=new Kr,this.localStorage=pe(),this.sessionStorage=pe(),this._timerManager=new jr,this.document=new x,this.document.defaultView=this,this.customElements._setDocument(this.document),S)try{this.document.location.href=S}catch{}this._location=this._createLocation(S);let{DetachedWindowAPI:A}=import.meta.require("./chunk-ew1knb9c.js");this.happyDOM=new A(this)}get location(){return this.document?.location??this._location}set location(a){let S=typeof a==="string"?a:a.href;if(this.document)this.document.location.href=S;else this._location=this._createLocation(S)}get innerWidth(){return this._width}get innerHeight(){return this._height}get outerWidth(){return this._width}get outerHeight(){return this._height}getSelection(){return this.document.getSelection()}_createLocation(a){try{let S=new URL(a);return{href:S.href,origin:S.origin,protocol:S.protocol,host:S.host,hostname:S.hostname,port:S.port,pathname:S.pathname,search:S.search,hash:S.hash,assign:(T)=>{this.location=T},replace:(T)=>{this.location=T},reload:()=>{},toString:()=>S.href}}catch{return{href:a,origin:"",protocol:"",host:"",hostname:"",port:"",pathname:"",search:"",hash:"",assign:(S)=>{this.location=S},replace:(S)=>{this.location=S},reload:()=>{},toString:()=>a}}}get settings(){return this._settings}setTimeout(a,S,...T){return this._timerManager.setTimeout(a,S,...T)}clearTimeout(a){this._timerManager.clearTimeout(a)}setInterval(a,S,...T){return this._timerManager.setInterval(a,S,...T)}clearInterval(a){this._timerManager.clearInterval(a)}requestAnimationFrame(a){return this._timerManager.requestAnimationFrame(a)}cancelAnimationFrame(a){this._timerManager.cancelAnimationFrame(a)}getComputedStyle(a,S){return this.document.getComputedStyle(a)}get screen(){return new be(this._width,this._height)}get isSecureContext(){return this._location.protocol==="https:"}get origin(){return this._location.origin}matchMedia(a){let S=!1,T=a.match(/\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)/);if(T)S=this._settings.device.prefersColorScheme===T[1];let D=a.match(/\(\s*min-width\s*:\s*(\d+(?:\.\d+)?)(px|em|rem)?\s*\)/);if(D){let Q=Number.parseFloat(D[1]);S=this._width>=Q}let w=a.match(/\(\s*max-width\s*:\s*(\d+(?:\.\d+)?)(px|em|rem)?\s*\)/);if(w){let Q=Number.parseFloat(w[1]);S=this._width<=Q}let H=a.match(/\(\s*min-height\s*:\s*(\d+(?:\.\d+)?)(px|em|rem)?\s*\)/);if(H){let Q=Number.parseFloat(H[1]);S=this._height>=Q}let A=a.match(/\(\s*max-height\s*:\s*(\d+(?:\.\d+)?)(px|em|rem)?\s*\)/);if(A){let Q=Number.parseFloat(A[1]);S=this._height<=Q}let F=a.match(/\(\s*orientation\s*:\s*(portrait|landscape)\s*\)/);if(F){let Q=this._height>=this._width;S=F[1]==="portrait"?Q:!Q}let B=a.match(/\(\s*prefers-reduced-motion\s*:\s*(reduce|no-preference)\s*\)/);if(B)S=B[1]==="no-preference";return new ye(a,S)}get history(){return this.document.history}postMessage(a,S){let T=typeof S==="string"?S:S?.targetOrigin??"*";setTimeout(()=>{let D=new r("message");D.data=a,D.origin=T==="*"?this._location.origin:T,D.source=this,D.ports=[],this.dispatchEvent(D)},0)}requestIdleCallback(a,S){let T=++this._idleCallbackId,D=S?.timeout??50;return this._timerManager.setTimeout(()=>{a({didTimeout:!1,timeRemaining:()=>Math.max(0,D)})},0),T}cancelIdleCallback(a){}focus(){}blur(){}print(){}stop(){}open(a="about:blank",S="_blank",T=""){let D=String(a||"about:blank");try{D=new URL(D,this.location.href).href}catch{}let w=new b({url:D,width:this._width,height:this._height,console:this.console,settings:this._settings});w.name=S&&S!=="_blank"?S:"";let H=T.split(/[\s,]+/).map((A)=>A.split("=",1)[0]?.toLowerCase());return w.opener=H.includes("noopener")||H.includes("noreferrer")?null:this,w}close(){this.closed=!0}resizeTo(a,S){}resizeBy(a,S){}moveTo(a,S){}moveBy(a,S){}scrollTo(a,S){if(typeof a==="object"&&a!==null){if(typeof a.left==="number")this.scrollX=a.left;if(typeof a.top==="number")this.scrollY=a.top;return}if(typeof a==="number")this.scrollX=a;if(typeof S==="number")this.scrollY=S}scroll(a,S){this.scrollTo(a,S)}scrollBy(a,S){if(typeof a==="object"&&a!==null){if(typeof a.left==="number")this.scrollX+=a.left;if(typeof a.top==="number")this.scrollY+=a.top;return}if(typeof a==="number")this.scrollX+=a;if(typeof S==="number")this.scrollY+=S}alert(a){}confirm(a){return!1}prompt(a,S){return null}_getTimerManager(){return this._timerManager}}
|
|
11
|
+
export{Xe,Je,Qe,ki,Ze,G,ee,h,te,U,W,et,xe,tt,rt,nt,it,st,re,ot,Ce,at,ne,Ve,mi,pi,fi,gi,lt,ut,u,ct,v,V,ie,se,dt,ht,mt,pt,ft,gt,bt,yt,oe,Et,vt,wt,M,_t,St,Tt,Nt,xt,Ct,Vt,ae,Mt,O,Bi,bi,le,ue,Me,Oe,Le,Re,yi,Ot,ce,g,Lt,Ei,L,R,q,Rt,Ae,vi,wi,_i,Si,Ti,Ni,de,he,m,me,xi,At,Dt,z,It,Pt,kt,Bt,Ht,Ft,Gt,Ut,Wt,$t,qt,zt,jt,Kt,Yt,Xt,Jt,Qt,Zt,er,tr,rr,nr,ir,sr,or,ar,lr,ur,cr,dr,hr,mr,pr,fr,gr,br,yr,Er,vr,wr,_r,Sr,Tr,Nr,xr,j,Cr,Vr,Mr,Or,Lr,Rr,Ar,Dr,Ir,Pr,kr,Br,Hr,Fr,Gr,Ur,Wr,$r,K,x,Ui,qr,zr,Ci,pe,jr,Kr,Yr,Xr,Jr,Qr,Zr,en,tn,rn,nn,sn,on,an,ln,un,cn,dn,hn,mn,pn,fn,gn,bn,yn,En,vn,wn,_n,Sn,Tn,Nn,xn,Cn,Vn,Mn,On,Ln,Rn,An,Dn,In,Pn,kn,Bn,Hn,Fn,Gn,Un,Wn,$n,qn,zn,jn,Kn,Yn,Xn,Jn,Qn,Zn,ei,ti,ri,De,ni,b};
|