@geektech/tsone-cli 0.1.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli.js +1 -1
- package/dist/{index-p7jrckn1.js → index-y6qrqbwv.js} +1021 -1458
- package/dist/index-y6qrqbwv.js.map +18 -0
- package/dist/index.js +1 -1
- package/package.json +7 -2
- package/dist/index-p7jrckn1.js.map +0 -18
|
@@ -222,75 +222,60 @@ function isJavaScriptPath(path) {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
// ../tsone/dist/dom/index.js
|
|
225
|
-
var
|
|
226
|
-
((
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
})(
|
|
225
|
+
var ce;
|
|
226
|
+
((s) => {
|
|
227
|
+
s[s.ELEMENT_NODE = 1] = "ELEMENT_NODE";
|
|
228
|
+
s[s.TEXT_NODE = 3] = "TEXT_NODE";
|
|
229
|
+
s[s.COMMENT_NODE = 8] = "COMMENT_NODE";
|
|
230
|
+
s[s.DOCUMENT_NODE = 9] = "DOCUMENT_NODE";
|
|
231
|
+
s[s.DOCUMENT_FRAGMENT_NODE = 11] = "DOCUMENT_FRAGMENT_NODE";
|
|
232
|
+
})(ce ||= {});
|
|
233
233
|
|
|
234
|
-
class
|
|
234
|
+
class K extends Error {
|
|
235
235
|
code;
|
|
236
|
-
constructor(
|
|
237
|
-
super(
|
|
238
|
-
this.name =
|
|
239
|
-
this.code = 0;
|
|
236
|
+
constructor(e, t = "Error") {
|
|
237
|
+
super(e);
|
|
238
|
+
this.name = t, this.code = 0;
|
|
240
239
|
}
|
|
241
240
|
}
|
|
242
241
|
|
|
243
|
-
class
|
|
242
|
+
class A {
|
|
244
243
|
listenerMap = new Map;
|
|
245
|
-
addEventListener(
|
|
246
|
-
if (!
|
|
244
|
+
addEventListener(e, t, n) {
|
|
245
|
+
if (!t)
|
|
247
246
|
return;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
let entries = this.listenerMap.get(type);
|
|
253
|
-
if (!entries) {
|
|
254
|
-
entries = [];
|
|
255
|
-
this.listenerMap.set(type, entries);
|
|
256
|
-
}
|
|
257
|
-
if (entries.some((entry) => entry.listener === listener && entry.capture === capture)) {
|
|
247
|
+
let i = typeof n === "boolean" ? n : n?.capture ?? false, r = typeof n === "object" ? n.once ?? false : false, s = typeof n === "object" ? n.passive ?? false : false, l = this.listenerMap.get(e);
|
|
248
|
+
if (!l)
|
|
249
|
+
l = [], this.listenerMap.set(e, l);
|
|
250
|
+
if (l.some((a) => a.listener === t && a.capture === i))
|
|
258
251
|
return;
|
|
259
|
-
}
|
|
260
|
-
entries.push({ listener, capture, once, passive });
|
|
252
|
+
l.push({ listener: t, capture: i, once: r, passive: s });
|
|
261
253
|
}
|
|
262
|
-
removeEventListener(
|
|
263
|
-
if (!
|
|
254
|
+
removeEventListener(e, t, n) {
|
|
255
|
+
if (!t)
|
|
264
256
|
return;
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
const entries = this.listenerMap.get(type);
|
|
268
|
-
if (!entries) {
|
|
257
|
+
let i = typeof n === "boolean" ? n : n?.capture ?? false, r = this.listenerMap.get(e);
|
|
258
|
+
if (!r)
|
|
269
259
|
return;
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (entries.length === 0) {
|
|
276
|
-
this.listenerMap.delete(type);
|
|
277
|
-
}
|
|
260
|
+
let s = r.findIndex((l) => l.listener === t && l.capture === i);
|
|
261
|
+
if (s >= 0)
|
|
262
|
+
r.splice(s, 1);
|
|
263
|
+
if (r.length === 0)
|
|
264
|
+
this.listenerMap.delete(e);
|
|
278
265
|
}
|
|
279
|
-
dispatchEvent(
|
|
280
|
-
if (!(
|
|
281
|
-
throw
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
return dispatchOnTarget(this, event);
|
|
266
|
+
dispatchEvent(e) {
|
|
267
|
+
if (!(e instanceof c))
|
|
268
|
+
throw TypeError("dispatchEvent requires an Event instance");
|
|
269
|
+
if (e.dispatched)
|
|
270
|
+
throw Error("Event has already been dispatched");
|
|
271
|
+
return pe(this, e);
|
|
287
272
|
}
|
|
288
|
-
getListeners(
|
|
289
|
-
return this.listenerMap.get(
|
|
273
|
+
getListeners(e) {
|
|
274
|
+
return this.listenerMap.get(e) ?? [];
|
|
290
275
|
}
|
|
291
276
|
}
|
|
292
277
|
|
|
293
|
-
class
|
|
278
|
+
class c {
|
|
294
279
|
static NONE = 0;
|
|
295
280
|
static CAPTURING_PHASE = 1;
|
|
296
281
|
static AT_TARGET = 2;
|
|
@@ -301,7 +286,7 @@ class Event {
|
|
|
301
286
|
composed;
|
|
302
287
|
target = null;
|
|
303
288
|
currentTarget = null;
|
|
304
|
-
eventPhase =
|
|
289
|
+
eventPhase = c.NONE;
|
|
305
290
|
defaultPrevented = false;
|
|
306
291
|
isTrusted = false;
|
|
307
292
|
timeStamp;
|
|
@@ -310,26 +295,18 @@ class Event {
|
|
|
310
295
|
propagationStopped = false;
|
|
311
296
|
immediateStopped = false;
|
|
312
297
|
canceled = false;
|
|
313
|
-
constructor(
|
|
314
|
-
this.type =
|
|
315
|
-
this.bubbles = init?.bubbles ?? false;
|
|
316
|
-
this.cancelable = init?.cancelable ?? false;
|
|
317
|
-
this.composed = init?.composed ?? false;
|
|
318
|
-
this.timeStamp = Date.now();
|
|
298
|
+
constructor(e, t) {
|
|
299
|
+
this.type = e, this.bubbles = t?.bubbles ?? false, this.cancelable = t?.cancelable ?? false, this.composed = t?.composed ?? false, this.timeStamp = Date.now();
|
|
319
300
|
}
|
|
320
301
|
preventDefault() {
|
|
321
|
-
if (this.cancelable)
|
|
302
|
+
if (this.cancelable)
|
|
322
303
|
this.canceled = true;
|
|
323
|
-
}
|
|
324
304
|
}
|
|
325
305
|
stopPropagation() {
|
|
326
|
-
this.propagationStopped = true;
|
|
327
|
-
this.cancelBubble = true;
|
|
306
|
+
this.propagationStopped = true, this.cancelBubble = true;
|
|
328
307
|
}
|
|
329
308
|
stopImmediatePropagation() {
|
|
330
|
-
this.propagationStopped = true;
|
|
331
|
-
this.immediateStopped = true;
|
|
332
|
-
this.cancelBubble = true;
|
|
309
|
+
this.propagationStopped = true, this.immediateStopped = true, this.cancelBubble = true;
|
|
333
310
|
}
|
|
334
311
|
propagationPrevented() {
|
|
335
312
|
return this.propagationStopped;
|
|
@@ -342,131 +319,104 @@ class Event {
|
|
|
342
319
|
}
|
|
343
320
|
}
|
|
344
321
|
|
|
345
|
-
class
|
|
322
|
+
class I extends c {
|
|
346
323
|
detail;
|
|
347
|
-
constructor(
|
|
348
|
-
super(
|
|
349
|
-
this.detail =
|
|
324
|
+
constructor(e, t) {
|
|
325
|
+
super(e, t);
|
|
326
|
+
this.detail = t?.detail;
|
|
350
327
|
}
|
|
351
328
|
}
|
|
352
329
|
|
|
353
|
-
class
|
|
330
|
+
class O extends c {
|
|
354
331
|
clientX;
|
|
355
332
|
clientY;
|
|
356
333
|
button;
|
|
357
334
|
buttons;
|
|
358
335
|
relatedTarget;
|
|
359
|
-
constructor(
|
|
360
|
-
super(
|
|
361
|
-
this.clientX =
|
|
362
|
-
this.clientY = init?.clientY ?? 0;
|
|
363
|
-
this.button = init?.button ?? 0;
|
|
364
|
-
this.buttons = init?.buttons ?? 0;
|
|
365
|
-
this.relatedTarget = init?.relatedTarget ?? null;
|
|
336
|
+
constructor(e, t) {
|
|
337
|
+
super(e, t);
|
|
338
|
+
this.clientX = t?.clientX ?? 0, this.clientY = t?.clientY ?? 0, this.button = t?.button ?? 0, this.buttons = t?.buttons ?? 0, this.relatedTarget = t?.relatedTarget ?? null;
|
|
366
339
|
}
|
|
367
340
|
}
|
|
368
341
|
|
|
369
|
-
class
|
|
342
|
+
class H extends c {
|
|
370
343
|
key;
|
|
371
344
|
code;
|
|
372
|
-
constructor(
|
|
373
|
-
super(
|
|
374
|
-
this.key =
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const targetIndex = capturePath.length - 1;
|
|
392
|
-
event.eventPhase = Event.CAPTURING_PHASE;
|
|
393
|
-
for (let index = 0;index < targetIndex; index += 1) {
|
|
394
|
-
const current = capturePath[index];
|
|
395
|
-
if (event.propagationPrevented()) {
|
|
345
|
+
constructor(e, t) {
|
|
346
|
+
super(e, t);
|
|
347
|
+
this.key = t?.key ?? "", this.code = t?.code ?? "";
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function de(e, t) {
|
|
351
|
+
let n = e.listener;
|
|
352
|
+
if (typeof n === "function")
|
|
353
|
+
n.call(t.currentTarget, t);
|
|
354
|
+
else
|
|
355
|
+
n.handleEvent(t);
|
|
356
|
+
}
|
|
357
|
+
function pe(e, t) {
|
|
358
|
+
t.dispatched = true, t.target = e;
|
|
359
|
+
let i = [...he(e)].reverse(), r = i.length - 1;
|
|
360
|
+
t.eventPhase = c.CAPTURING_PHASE;
|
|
361
|
+
for (let s = 0;s < r; s += 1) {
|
|
362
|
+
let l = i[s];
|
|
363
|
+
if (t.propagationPrevented())
|
|
396
364
|
break;
|
|
397
|
-
|
|
398
|
-
event.currentTarget = current;
|
|
399
|
-
runListeners(current, event, true);
|
|
365
|
+
t.currentTarget = l, x(l, t, true);
|
|
400
366
|
}
|
|
401
|
-
if (!
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
runListeners(target, event, true);
|
|
405
|
-
if (!event.immediatePrevented()) {
|
|
406
|
-
runListeners(target, event, false);
|
|
407
|
-
}
|
|
367
|
+
if (!t.propagationPrevented()) {
|
|
368
|
+
if (t.eventPhase = c.AT_TARGET, t.currentTarget = e, x(e, t, true), !t.immediatePrevented())
|
|
369
|
+
x(e, t, false);
|
|
408
370
|
}
|
|
409
|
-
if (
|
|
410
|
-
|
|
411
|
-
for (let
|
|
412
|
-
|
|
413
|
-
if (
|
|
371
|
+
if (t.bubbles && !t.propagationPrevented()) {
|
|
372
|
+
t.eventPhase = c.BUBBLING_PHASE;
|
|
373
|
+
for (let s = i.length - 2;s >= 0; s -= 1) {
|
|
374
|
+
let l = i[s];
|
|
375
|
+
if (t.propagationPrevented())
|
|
414
376
|
break;
|
|
415
|
-
|
|
416
|
-
event.currentTarget = current;
|
|
417
|
-
runListeners(current, event, false);
|
|
377
|
+
t.currentTarget = l, x(l, t, false);
|
|
418
378
|
}
|
|
419
379
|
}
|
|
420
|
-
|
|
421
|
-
event.currentTarget = null;
|
|
422
|
-
return !event.wasCanceled();
|
|
380
|
+
return t.eventPhase = c.NONE, t.currentTarget = null, !t.wasCanceled();
|
|
423
381
|
}
|
|
424
|
-
function
|
|
425
|
-
|
|
426
|
-
for (
|
|
427
|
-
if (
|
|
382
|
+
function x(e, t, n) {
|
|
383
|
+
let i = e.getListeners(t.type);
|
|
384
|
+
for (let r of [...i]) {
|
|
385
|
+
if (r.capture !== n)
|
|
428
386
|
continue;
|
|
429
|
-
|
|
430
|
-
if (event.immediatePrevented()) {
|
|
387
|
+
if (t.immediatePrevented())
|
|
431
388
|
break;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
const node = current;
|
|
447
|
-
if (node.nodeType === 9) {
|
|
448
|
-
const view = node.defaultView;
|
|
449
|
-
if (view) {
|
|
450
|
-
path.push(view);
|
|
451
|
-
}
|
|
389
|
+
if (r.once)
|
|
390
|
+
e.removeEventListener(t.type, r.listener, { capture: r.capture });
|
|
391
|
+
de(r, t);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
function he(e) {
|
|
395
|
+
let t = [], n = e;
|
|
396
|
+
while (n) {
|
|
397
|
+
t.push(n);
|
|
398
|
+
let i = n;
|
|
399
|
+
if (i.nodeType === 9) {
|
|
400
|
+
let s = i.defaultView;
|
|
401
|
+
if (s)
|
|
402
|
+
t.push(s);
|
|
452
403
|
break;
|
|
453
404
|
}
|
|
454
|
-
|
|
455
|
-
if (
|
|
456
|
-
|
|
405
|
+
let r = i.parentNode;
|
|
406
|
+
if (r) {
|
|
407
|
+
n = r;
|
|
457
408
|
continue;
|
|
458
409
|
}
|
|
459
410
|
break;
|
|
460
411
|
}
|
|
461
|
-
return
|
|
412
|
+
return t;
|
|
462
413
|
}
|
|
463
414
|
|
|
464
|
-
class
|
|
415
|
+
class X {
|
|
465
416
|
element;
|
|
466
417
|
attributeName;
|
|
467
|
-
constructor(
|
|
468
|
-
this.element =
|
|
469
|
-
this.attributeName = attributeName;
|
|
418
|
+
constructor(e, t = "class") {
|
|
419
|
+
this.element = e, this.attributeName = t;
|
|
470
420
|
}
|
|
471
421
|
get length() {
|
|
472
422
|
return this.tokens().length;
|
|
@@ -474,210 +424,157 @@ class DOMTokenList {
|
|
|
474
424
|
get value() {
|
|
475
425
|
return this.element.getAttribute(this.attributeName) ?? "";
|
|
476
426
|
}
|
|
477
|
-
set value(
|
|
478
|
-
this.setTokens(
|
|
479
|
-
}
|
|
480
|
-
item(
|
|
481
|
-
return this.tokens()[
|
|
482
|
-
}
|
|
483
|
-
contains(
|
|
484
|
-
return this.tokens().includes(
|
|
485
|
-
}
|
|
486
|
-
add(...
|
|
487
|
-
|
|
488
|
-
for (
|
|
489
|
-
if (
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
this.
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
this.setTokens([...current]);
|
|
511
|
-
return shouldAdd;
|
|
512
|
-
}
|
|
513
|
-
replace(oldToken, newToken) {
|
|
514
|
-
const current = this.tokens();
|
|
515
|
-
const index = current.indexOf(oldToken);
|
|
516
|
-
if (index < 0) {
|
|
427
|
+
set value(e) {
|
|
428
|
+
this.setTokens(q(e));
|
|
429
|
+
}
|
|
430
|
+
item(e) {
|
|
431
|
+
return this.tokens()[e] ?? null;
|
|
432
|
+
}
|
|
433
|
+
contains(e) {
|
|
434
|
+
return this.tokens().includes(e);
|
|
435
|
+
}
|
|
436
|
+
add(...e) {
|
|
437
|
+
let t = new Set(this.tokens());
|
|
438
|
+
for (let n of e)
|
|
439
|
+
if (n)
|
|
440
|
+
t.add(n);
|
|
441
|
+
this.setTokens([...t]);
|
|
442
|
+
}
|
|
443
|
+
remove(...e) {
|
|
444
|
+
let t = new Set(this.tokens());
|
|
445
|
+
for (let n of e)
|
|
446
|
+
t.delete(n);
|
|
447
|
+
this.setTokens([...t]);
|
|
448
|
+
}
|
|
449
|
+
toggle(e, t) {
|
|
450
|
+
let n = new Set(this.tokens()), i = t ?? !n.has(e);
|
|
451
|
+
if (i)
|
|
452
|
+
n.add(e);
|
|
453
|
+
else
|
|
454
|
+
n.delete(e);
|
|
455
|
+
return this.setTokens([...n]), i;
|
|
456
|
+
}
|
|
457
|
+
replace(e, t) {
|
|
458
|
+
let n = this.tokens(), i = n.indexOf(e);
|
|
459
|
+
if (i < 0)
|
|
517
460
|
return false;
|
|
518
|
-
|
|
519
|
-
current[index] = newToken;
|
|
520
|
-
this.setTokens(current);
|
|
521
|
-
return true;
|
|
461
|
+
return n[i] = t, this.setTokens(n), true;
|
|
522
462
|
}
|
|
523
463
|
[Symbol.iterator]() {
|
|
524
464
|
return this.tokens()[Symbol.iterator]();
|
|
525
465
|
}
|
|
526
|
-
forEach(
|
|
527
|
-
this.tokens().forEach((
|
|
466
|
+
forEach(e) {
|
|
467
|
+
this.tokens().forEach((t, n) => e(t, n, this));
|
|
528
468
|
}
|
|
529
469
|
toString() {
|
|
530
470
|
return this.value;
|
|
531
471
|
}
|
|
532
472
|
tokens() {
|
|
533
|
-
return
|
|
473
|
+
return q(this.element.getAttribute(this.attributeName) ?? "");
|
|
534
474
|
}
|
|
535
|
-
setTokens(
|
|
536
|
-
|
|
537
|
-
if (
|
|
538
|
-
this.element.setAttribute(this.attributeName,
|
|
539
|
-
|
|
475
|
+
setTokens(e) {
|
|
476
|
+
let t = e.filter(Boolean).join(" ");
|
|
477
|
+
if (t)
|
|
478
|
+
this.element.setAttribute(this.attributeName, t);
|
|
479
|
+
else
|
|
540
480
|
this.element.removeAttribute(this.attributeName);
|
|
541
|
-
}
|
|
542
481
|
}
|
|
543
482
|
}
|
|
544
|
-
function
|
|
545
|
-
return
|
|
546
|
-
}
|
|
547
|
-
function
|
|
548
|
-
return
|
|
549
|
-
}
|
|
550
|
-
function
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
const handler = {
|
|
603
|
-
get(t, property, receiver) {
|
|
604
|
-
if (typeof property === "symbol") {
|
|
605
|
-
return Reflect.get(t, property, receiver);
|
|
606
|
-
}
|
|
607
|
-
if (property in t) {
|
|
608
|
-
const value = Reflect.get(t, property, receiver);
|
|
609
|
-
return typeof value === "function" ? value.bind(t) : value;
|
|
610
|
-
}
|
|
611
|
-
return t.getPropertyValue(property);
|
|
612
|
-
},
|
|
613
|
-
set(t, property, value, receiver) {
|
|
614
|
-
if (typeof property === "symbol") {
|
|
615
|
-
return Reflect.set(t, property, value, receiver);
|
|
616
|
-
}
|
|
617
|
-
if (property in t) {
|
|
618
|
-
return Reflect.set(t, property, value, receiver);
|
|
619
|
-
}
|
|
620
|
-
t.setProperty(property, String(value));
|
|
483
|
+
function q(e) {
|
|
484
|
+
return e.trim().split(/\s+/).filter(Boolean);
|
|
485
|
+
}
|
|
486
|
+
function L(e) {
|
|
487
|
+
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
488
|
+
}
|
|
489
|
+
function R() {
|
|
490
|
+
let e = new Map, t = { properties: e, setProperty(i, r, s = "") {
|
|
491
|
+
let l = L(i);
|
|
492
|
+
if (r === "")
|
|
493
|
+
e.delete(l);
|
|
494
|
+
else
|
|
495
|
+
e.set(l, { value: r, priority: s });
|
|
496
|
+
}, getPropertyValue(i) {
|
|
497
|
+
return e.get(L(i))?.value ?? "";
|
|
498
|
+
}, getPropertyPriority(i) {
|
|
499
|
+
return e.get(L(i))?.priority ?? "";
|
|
500
|
+
}, removeProperty(i) {
|
|
501
|
+
let r = L(i), s = e.get(r)?.value ?? "";
|
|
502
|
+
return e.delete(r), s;
|
|
503
|
+
}, item(i) {
|
|
504
|
+
return [...e.keys()][i] ?? "";
|
|
505
|
+
}, get length() {
|
|
506
|
+
return e.size;
|
|
507
|
+
}, get cssText() {
|
|
508
|
+
return [...e.entries()].map(([i, r]) => `${i}: ${r.value}${r.priority ? ` ${r.priority}` : ""};`).join(" ");
|
|
509
|
+
}, set cssText(i) {
|
|
510
|
+
e.clear();
|
|
511
|
+
for (let r of i.split(";")) {
|
|
512
|
+
let s = r.trim();
|
|
513
|
+
if (!s)
|
|
514
|
+
continue;
|
|
515
|
+
let l = s.indexOf(":");
|
|
516
|
+
if (l < 0)
|
|
517
|
+
continue;
|
|
518
|
+
let a = s.slice(0, l).trim(), o = s.slice(l + 1).trim();
|
|
519
|
+
if (a)
|
|
520
|
+
t.setProperty(a, o);
|
|
521
|
+
}
|
|
522
|
+
} };
|
|
523
|
+
return new Proxy(t, { get(i, r, s) {
|
|
524
|
+
if (typeof r === "symbol")
|
|
525
|
+
return Reflect.get(i, r, s);
|
|
526
|
+
if (r in i) {
|
|
527
|
+
let l = Reflect.get(i, r, s);
|
|
528
|
+
return typeof l === "function" ? l.bind(i) : l;
|
|
529
|
+
}
|
|
530
|
+
return i.getPropertyValue(r);
|
|
531
|
+
}, set(i, r, s, l) {
|
|
532
|
+
if (typeof r === "symbol")
|
|
533
|
+
return Reflect.set(i, r, s, l);
|
|
534
|
+
if (r in i)
|
|
535
|
+
return Reflect.set(i, r, s, l);
|
|
536
|
+
return i.setProperty(r, String(s)), true;
|
|
537
|
+
}, has(i, r) {
|
|
538
|
+
if (typeof r === "symbol")
|
|
539
|
+
return Reflect.has(i, r);
|
|
540
|
+
if (r in i)
|
|
621
541
|
return true;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
...[...properties.keys()].map((name) => camelCaseProperty(name))
|
|
636
|
-
];
|
|
637
|
-
},
|
|
638
|
-
getOwnPropertyDescriptor(t, property) {
|
|
639
|
-
if (typeof property === "symbol") {
|
|
640
|
-
return Reflect.getOwnPropertyDescriptor(t, property);
|
|
641
|
-
}
|
|
642
|
-
if (property in t) {
|
|
643
|
-
return Reflect.getOwnPropertyDescriptor(t, property);
|
|
644
|
-
}
|
|
645
|
-
const value = t.getPropertyValue(property);
|
|
646
|
-
if (value !== "") {
|
|
647
|
-
return { configurable: true, enumerable: true, writable: true, value };
|
|
648
|
-
}
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
};
|
|
652
|
-
return new Proxy(target, handler);
|
|
542
|
+
return i.getPropertyValue(r) !== "";
|
|
543
|
+
}, ownKeys() {
|
|
544
|
+
return [...Reflect.ownKeys(t), ...[...e.keys()].map((i) => be(i))];
|
|
545
|
+
}, getOwnPropertyDescriptor(i, r) {
|
|
546
|
+
if (typeof r === "symbol")
|
|
547
|
+
return Reflect.getOwnPropertyDescriptor(i, r);
|
|
548
|
+
if (r in i)
|
|
549
|
+
return Reflect.getOwnPropertyDescriptor(i, r);
|
|
550
|
+
let s = i.getPropertyValue(r);
|
|
551
|
+
if (s !== "")
|
|
552
|
+
return { configurable: true, enumerable: true, writable: true, value: s };
|
|
553
|
+
return;
|
|
554
|
+
} });
|
|
653
555
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
556
|
+
function be(e) {
|
|
557
|
+
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
656
558
|
}
|
|
657
559
|
|
|
658
|
-
class
|
|
560
|
+
class f {
|
|
659
561
|
items;
|
|
660
|
-
constructor(
|
|
661
|
-
this.items =
|
|
662
|
-
for (let
|
|
663
|
-
Object.defineProperty(this, String(
|
|
664
|
-
configurable: true,
|
|
665
|
-
enumerable: true,
|
|
666
|
-
get: () => this.items[index]
|
|
667
|
-
});
|
|
668
|
-
}
|
|
562
|
+
constructor(e = []) {
|
|
563
|
+
this.items = e;
|
|
564
|
+
for (let t = 0;t < e.length; t += 1)
|
|
565
|
+
Object.defineProperty(this, String(t), { configurable: true, enumerable: true, get: () => this.items[t] });
|
|
669
566
|
}
|
|
670
567
|
get length() {
|
|
671
568
|
return this.items.length;
|
|
672
569
|
}
|
|
673
|
-
item(
|
|
674
|
-
return this.items[
|
|
570
|
+
item(e) {
|
|
571
|
+
return this.items[e] ?? null;
|
|
675
572
|
}
|
|
676
573
|
[Symbol.iterator]() {
|
|
677
574
|
return this.items[Symbol.iterator]();
|
|
678
575
|
}
|
|
679
|
-
forEach(
|
|
680
|
-
this.items.forEach((
|
|
576
|
+
forEach(e) {
|
|
577
|
+
this.items.forEach((t, n) => e(t, n, this));
|
|
681
578
|
}
|
|
682
579
|
entries() {
|
|
683
580
|
return this.items.entries();
|
|
@@ -693,7 +590,7 @@ class NodeList {
|
|
|
693
590
|
}
|
|
694
591
|
}
|
|
695
592
|
|
|
696
|
-
class
|
|
593
|
+
class b extends A {
|
|
697
594
|
static ELEMENT_NODE = 1;
|
|
698
595
|
static TEXT_NODE = 3;
|
|
699
596
|
static COMMENT_NODE = 8;
|
|
@@ -704,17 +601,16 @@ class Node extends EventTarget {
|
|
|
704
601
|
parentNode = null;
|
|
705
602
|
ownerDocument = null;
|
|
706
603
|
childList = [];
|
|
707
|
-
constructor(
|
|
604
|
+
constructor(e, t) {
|
|
708
605
|
super();
|
|
709
|
-
this.nodeType =
|
|
710
|
-
this.nodeName = nodeName;
|
|
606
|
+
this.nodeType = e, this.nodeName = t;
|
|
711
607
|
}
|
|
712
608
|
get parentElement() {
|
|
713
|
-
|
|
714
|
-
return
|
|
609
|
+
let e = this.parentNode;
|
|
610
|
+
return e instanceof M ? e : null;
|
|
715
611
|
}
|
|
716
612
|
get childNodes() {
|
|
717
|
-
return new
|
|
613
|
+
return new f([...this.childList]);
|
|
718
614
|
}
|
|
719
615
|
get firstChild() {
|
|
720
616
|
return this.childList[0] ?? null;
|
|
@@ -723,160 +619,125 @@ class Node extends EventTarget {
|
|
|
723
619
|
return this.childList[this.childList.length - 1] ?? null;
|
|
724
620
|
}
|
|
725
621
|
get nextSibling() {
|
|
726
|
-
|
|
727
|
-
if (!
|
|
622
|
+
let e = this.parentNode;
|
|
623
|
+
if (!e)
|
|
728
624
|
return null;
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
return index >= 0 ? parent.childList[index + 1] ?? null : null;
|
|
625
|
+
let t = e.childList.indexOf(this);
|
|
626
|
+
return t >= 0 ? e.childList[t + 1] ?? null : null;
|
|
732
627
|
}
|
|
733
628
|
get previousSibling() {
|
|
734
|
-
|
|
735
|
-
if (!
|
|
629
|
+
let e = this.parentNode;
|
|
630
|
+
if (!e)
|
|
736
631
|
return null;
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
return index > 0 ? parent.childList[index - 1] : null;
|
|
632
|
+
let t = e.childList.indexOf(this);
|
|
633
|
+
return t > 0 ? e.childList[t - 1] : null;
|
|
740
634
|
}
|
|
741
635
|
get textContent() {
|
|
742
|
-
let
|
|
743
|
-
for (
|
|
744
|
-
if (
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
}
|
|
750
|
-
return text;
|
|
636
|
+
let e = "";
|
|
637
|
+
for (let t of this.childList)
|
|
638
|
+
if (t.nodeType === 3)
|
|
639
|
+
e += t.data;
|
|
640
|
+
else if (t.nodeType === 1)
|
|
641
|
+
e += t.textContent;
|
|
642
|
+
return e;
|
|
751
643
|
}
|
|
752
|
-
set textContent(
|
|
753
|
-
this.childList = []
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
textNode.ownerDocument = this.ownerDocument;
|
|
757
|
-
textNode.parentNode = this;
|
|
758
|
-
this.childList.push(textNode);
|
|
644
|
+
set textContent(e) {
|
|
645
|
+
if (this.childList = [], e) {
|
|
646
|
+
let t = new u(e);
|
|
647
|
+
t.ownerDocument = this.ownerDocument, t.parentNode = this, this.childList.push(t);
|
|
759
648
|
}
|
|
760
649
|
}
|
|
761
650
|
hasChildNodes() {
|
|
762
651
|
return this.childList.length > 0;
|
|
763
652
|
}
|
|
764
|
-
appendChild(
|
|
765
|
-
if (
|
|
766
|
-
throw
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
if (
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
if (
|
|
780
|
-
node
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
this.childList.
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
if (
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
if (newChild.parentNode) {
|
|
808
|
-
newChild.parentNode.removeChild(newChild);
|
|
809
|
-
}
|
|
810
|
-
newChild.parentNode = this;
|
|
811
|
-
if (newChild.ownerDocument === null) {
|
|
812
|
-
newChild.ownerDocument = this.ownerDocument;
|
|
813
|
-
}
|
|
814
|
-
this.childList[index] = newChild;
|
|
815
|
-
oldChild.parentNode = null;
|
|
816
|
-
return newChild;
|
|
817
|
-
}
|
|
818
|
-
replaceChildren(...nodes) {
|
|
819
|
-
for (const child of [...this.childList]) {
|
|
820
|
-
this.removeChild(child);
|
|
821
|
-
}
|
|
822
|
-
for (const node of nodes) {
|
|
823
|
-
this.appendChild(node);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
contains(node) {
|
|
827
|
-
if (!node) {
|
|
653
|
+
appendChild(e) {
|
|
654
|
+
if (e === this)
|
|
655
|
+
throw Error("Cannot append a node to itself");
|
|
656
|
+
return this.insertBefore(e, null), e;
|
|
657
|
+
}
|
|
658
|
+
insertBefore(e, t) {
|
|
659
|
+
if (e === this)
|
|
660
|
+
throw Error("Cannot insert a node before itself");
|
|
661
|
+
if (e.parentNode)
|
|
662
|
+
e.parentNode.removeChild(e);
|
|
663
|
+
if (e.parentNode = this, e.ownerDocument === null)
|
|
664
|
+
e.ownerDocument = this.ownerDocument;
|
|
665
|
+
if (t === null)
|
|
666
|
+
return this.childList.push(e), e;
|
|
667
|
+
let n = this.childList.indexOf(t);
|
|
668
|
+
if (n < 0)
|
|
669
|
+
throw Error("Reference node is not a child of this node");
|
|
670
|
+
return this.childList.splice(n, 0, e), e;
|
|
671
|
+
}
|
|
672
|
+
removeChild(e) {
|
|
673
|
+
let t = this.childList.indexOf(e);
|
|
674
|
+
if (t < 0)
|
|
675
|
+
throw Error("Node is not a child of this node");
|
|
676
|
+
return this.childList.splice(t, 1), e.parentNode = null, e;
|
|
677
|
+
}
|
|
678
|
+
replaceChild(e, t) {
|
|
679
|
+
let n = this.childList.indexOf(t);
|
|
680
|
+
if (n < 0)
|
|
681
|
+
throw Error("Old child is not a child of this node");
|
|
682
|
+
if (e.parentNode)
|
|
683
|
+
e.parentNode.removeChild(e);
|
|
684
|
+
if (e.parentNode = this, e.ownerDocument === null)
|
|
685
|
+
e.ownerDocument = this.ownerDocument;
|
|
686
|
+
return this.childList[n] = e, t.parentNode = null, e;
|
|
687
|
+
}
|
|
688
|
+
replaceChildren(...e) {
|
|
689
|
+
for (let t of [...this.childList])
|
|
690
|
+
this.removeChild(t);
|
|
691
|
+
for (let t of e)
|
|
692
|
+
this.appendChild(t);
|
|
693
|
+
}
|
|
694
|
+
contains(e) {
|
|
695
|
+
if (!e)
|
|
828
696
|
return false;
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
if (current === this) {
|
|
697
|
+
let t = e;
|
|
698
|
+
while (t) {
|
|
699
|
+
if (t === this)
|
|
833
700
|
return true;
|
|
834
|
-
|
|
835
|
-
current = current.parentNode;
|
|
701
|
+
t = t.parentNode;
|
|
836
702
|
}
|
|
837
703
|
return false;
|
|
838
704
|
}
|
|
839
705
|
remove() {
|
|
840
706
|
this.parentNode?.removeChild(this);
|
|
841
707
|
}
|
|
842
|
-
cloneNode(
|
|
843
|
-
|
|
844
|
-
if (
|
|
845
|
-
for (
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
}
|
|
849
|
-
return clone;
|
|
708
|
+
cloneNode(e = false) {
|
|
709
|
+
let t = this.createClone();
|
|
710
|
+
if (e)
|
|
711
|
+
for (let n of this.childList)
|
|
712
|
+
t.appendChild(n.cloneNode(true));
|
|
713
|
+
return t;
|
|
850
714
|
}
|
|
851
715
|
createClone() {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
return clone;
|
|
716
|
+
let e = new b(this.nodeType, this.nodeName);
|
|
717
|
+
return e.ownerDocument = this.ownerDocument, e;
|
|
855
718
|
}
|
|
856
719
|
getRootNode() {
|
|
857
|
-
if (!this.parentNode)
|
|
720
|
+
if (!this.parentNode)
|
|
858
721
|
return this;
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
864
|
-
return parent;
|
|
722
|
+
let e = this.parentNode;
|
|
723
|
+
while (e.parentNode)
|
|
724
|
+
e = e.parentNode;
|
|
725
|
+
return e;
|
|
865
726
|
}
|
|
866
727
|
isConnected() {
|
|
867
728
|
return this.getRootNode().nodeType === 9;
|
|
868
729
|
}
|
|
869
730
|
}
|
|
870
731
|
|
|
871
|
-
class
|
|
732
|
+
class M extends b {
|
|
872
733
|
namespaceURI;
|
|
873
734
|
attributeList = [];
|
|
874
735
|
styleValue;
|
|
875
736
|
classListValue;
|
|
876
737
|
datasetProxy;
|
|
877
|
-
constructor(
|
|
878
|
-
super(1,
|
|
879
|
-
this.namespaceURI =
|
|
738
|
+
constructor(e, t = null) {
|
|
739
|
+
super(1, e.toUpperCase());
|
|
740
|
+
this.namespaceURI = t;
|
|
880
741
|
}
|
|
881
742
|
get tagName() {
|
|
882
743
|
return this.nodeName;
|
|
@@ -887,35 +748,32 @@ class Element extends Node {
|
|
|
887
748
|
get id() {
|
|
888
749
|
return this.getAttribute("id") ?? "";
|
|
889
750
|
}
|
|
890
|
-
set id(
|
|
891
|
-
this.setAttribute("id",
|
|
751
|
+
set id(e) {
|
|
752
|
+
this.setAttribute("id", e);
|
|
892
753
|
}
|
|
893
754
|
get className() {
|
|
894
755
|
return this.getAttribute("class") ?? "";
|
|
895
756
|
}
|
|
896
|
-
set className(
|
|
897
|
-
this.setAttribute("class",
|
|
757
|
+
set className(e) {
|
|
758
|
+
this.setAttribute("class", e);
|
|
898
759
|
}
|
|
899
760
|
get classList() {
|
|
900
|
-
if (!this.classListValue)
|
|
901
|
-
this.classListValue = new
|
|
902
|
-
}
|
|
761
|
+
if (!this.classListValue)
|
|
762
|
+
this.classListValue = new X(this, "class");
|
|
903
763
|
return this.classListValue;
|
|
904
764
|
}
|
|
905
765
|
get style() {
|
|
906
|
-
if (!this.styleValue)
|
|
907
|
-
this.styleValue =
|
|
908
|
-
}
|
|
766
|
+
if (!this.styleValue)
|
|
767
|
+
this.styleValue = R();
|
|
909
768
|
return this.styleValue;
|
|
910
769
|
}
|
|
911
770
|
get dataset() {
|
|
912
|
-
if (!this.datasetProxy)
|
|
913
|
-
this.datasetProxy =
|
|
914
|
-
}
|
|
771
|
+
if (!this.datasetProxy)
|
|
772
|
+
this.datasetProxy = Ce(this);
|
|
915
773
|
return this.datasetProxy;
|
|
916
774
|
}
|
|
917
775
|
get children() {
|
|
918
|
-
return new
|
|
776
|
+
return new f(this.childList.filter((e) => e.nodeType === 1));
|
|
919
777
|
}
|
|
920
778
|
get firstElementChild() {
|
|
921
779
|
return this.children.item(0);
|
|
@@ -927,214 +785,166 @@ class Element extends Node {
|
|
|
927
785
|
return this.children.length;
|
|
928
786
|
}
|
|
929
787
|
get attributes() {
|
|
930
|
-
return new
|
|
788
|
+
return new Z(this);
|
|
931
789
|
}
|
|
932
|
-
getAttribute(
|
|
933
|
-
|
|
934
|
-
return
|
|
790
|
+
getAttribute(e) {
|
|
791
|
+
let t = this.findAttribute(e);
|
|
792
|
+
return t ? t.value : null;
|
|
935
793
|
}
|
|
936
794
|
getAttributeNames() {
|
|
937
|
-
return this.attributeList.map((
|
|
938
|
-
}
|
|
939
|
-
setAttribute(
|
|
940
|
-
|
|
941
|
-
if (
|
|
942
|
-
this.styleValue =
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
if (
|
|
954
|
-
this.
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
if (shouldAdd) {
|
|
967
|
-
this.setAttribute(name, "");
|
|
968
|
-
} else {
|
|
969
|
-
this.removeAttribute(name);
|
|
970
|
-
}
|
|
971
|
-
return shouldAdd;
|
|
795
|
+
return this.attributeList.map((e) => e.name);
|
|
796
|
+
}
|
|
797
|
+
setAttribute(e, t) {
|
|
798
|
+
let n = String(t);
|
|
799
|
+
if (e === "style")
|
|
800
|
+
this.styleValue = R(), this.styleValue.cssText = n;
|
|
801
|
+
let i = this.findAttribute(e);
|
|
802
|
+
if (i)
|
|
803
|
+
i.value = n;
|
|
804
|
+
else
|
|
805
|
+
this.attributeList.push({ name: e, value: n });
|
|
806
|
+
}
|
|
807
|
+
removeAttribute(e) {
|
|
808
|
+
if (e === "style")
|
|
809
|
+
this.styleValue = R();
|
|
810
|
+
let t = this.attributeList.findIndex((n) => n.name === e);
|
|
811
|
+
if (t >= 0)
|
|
812
|
+
this.attributeList.splice(t, 1);
|
|
813
|
+
}
|
|
814
|
+
hasAttribute(e) {
|
|
815
|
+
return this.findAttribute(e) !== undefined;
|
|
816
|
+
}
|
|
817
|
+
toggleAttribute(e, t) {
|
|
818
|
+
let n = t ?? !this.hasAttribute(e);
|
|
819
|
+
if (n)
|
|
820
|
+
this.setAttribute(e, "");
|
|
821
|
+
else
|
|
822
|
+
this.removeAttribute(e);
|
|
823
|
+
return n;
|
|
972
824
|
}
|
|
973
825
|
hasAttributes() {
|
|
974
826
|
return this.attributeList.length > 0;
|
|
975
827
|
}
|
|
976
828
|
get innerHTML() {
|
|
977
|
-
return
|
|
829
|
+
return oe(this);
|
|
978
830
|
}
|
|
979
|
-
set innerHTML(
|
|
980
|
-
this.replaceChildren(...
|
|
831
|
+
set innerHTML(e) {
|
|
832
|
+
this.replaceChildren(...ye(e, this.ownerDocument));
|
|
981
833
|
}
|
|
982
834
|
get outerHTML() {
|
|
983
|
-
return
|
|
835
|
+
return le(this);
|
|
984
836
|
}
|
|
985
837
|
get value() {
|
|
986
838
|
return this.getAttribute("value") ?? "";
|
|
987
839
|
}
|
|
988
|
-
set value(
|
|
989
|
-
this.setAttribute("value",
|
|
840
|
+
set value(e) {
|
|
841
|
+
this.setAttribute("value", e);
|
|
990
842
|
}
|
|
991
|
-
querySelector(
|
|
992
|
-
return
|
|
843
|
+
querySelector(e) {
|
|
844
|
+
return C(this, e).item(0);
|
|
993
845
|
}
|
|
994
|
-
querySelectorAll(
|
|
995
|
-
return
|
|
846
|
+
querySelectorAll(e) {
|
|
847
|
+
return C(this, e);
|
|
996
848
|
}
|
|
997
|
-
getElementsByTagName(
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
}
|
|
1004
|
-
});
|
|
1005
|
-
return new NodeList(results);
|
|
849
|
+
getElementsByTagName(e) {
|
|
850
|
+
let t = e.toLowerCase(), n = [];
|
|
851
|
+
return N(this, (i) => {
|
|
852
|
+
if (i.localName === t)
|
|
853
|
+
n.push(i);
|
|
854
|
+
}), new f(n);
|
|
1006
855
|
}
|
|
1007
|
-
matches(
|
|
1008
|
-
return
|
|
856
|
+
matches(e) {
|
|
857
|
+
return ue(this, e);
|
|
1009
858
|
}
|
|
1010
|
-
closest(
|
|
1011
|
-
if (this.matches(
|
|
859
|
+
closest(e) {
|
|
860
|
+
if (this.matches(e))
|
|
1012
861
|
return this;
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
}
|
|
1019
|
-
parent = parent.parentElement;
|
|
862
|
+
let t = this.parentElement;
|
|
863
|
+
while (t) {
|
|
864
|
+
if (t.matches(e))
|
|
865
|
+
return t;
|
|
866
|
+
t = t.parentElement;
|
|
1020
867
|
}
|
|
1021
868
|
return null;
|
|
1022
869
|
}
|
|
1023
870
|
getBoundingClientRect() {
|
|
1024
|
-
return {
|
|
1025
|
-
x: 0,
|
|
1026
|
-
|
|
1027
|
-
top: 0,
|
|
1028
|
-
left: 0,
|
|
1029
|
-
right: 0,
|
|
1030
|
-
bottom: 0,
|
|
1031
|
-
width: 0,
|
|
1032
|
-
height: 0,
|
|
1033
|
-
toJSON() {
|
|
1034
|
-
return {
|
|
1035
|
-
x: 0,
|
|
1036
|
-
y: 0,
|
|
1037
|
-
top: 0,
|
|
1038
|
-
left: 0,
|
|
1039
|
-
right: 0,
|
|
1040
|
-
bottom: 0,
|
|
1041
|
-
width: 0,
|
|
1042
|
-
height: 0
|
|
1043
|
-
};
|
|
1044
|
-
}
|
|
1045
|
-
};
|
|
871
|
+
return { x: 0, y: 0, top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0, toJSON() {
|
|
872
|
+
return { x: 0, y: 0, top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0 };
|
|
873
|
+
} };
|
|
1046
874
|
}
|
|
1047
875
|
scrollIntoView() {}
|
|
1048
876
|
focus() {}
|
|
1049
877
|
blur() {}
|
|
1050
878
|
click() {
|
|
1051
|
-
this.dispatchEvent(new
|
|
1052
|
-
}
|
|
1053
|
-
append(...
|
|
1054
|
-
for (
|
|
1055
|
-
if (typeof
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
before(...nodes) {
|
|
1077
|
-
const parent = this.parentNode;
|
|
1078
|
-
if (!parent) {
|
|
879
|
+
this.dispatchEvent(new O("click", { bubbles: true, cancelable: true }));
|
|
880
|
+
}
|
|
881
|
+
append(...e) {
|
|
882
|
+
for (let t of e)
|
|
883
|
+
if (typeof t === "string") {
|
|
884
|
+
let n = new u(t);
|
|
885
|
+
n.ownerDocument = this.ownerDocument, this.appendChild(n);
|
|
886
|
+
} else
|
|
887
|
+
this.appendChild(t);
|
|
888
|
+
}
|
|
889
|
+
prepend(...e) {
|
|
890
|
+
let t = this.firstChild;
|
|
891
|
+
for (let n of e)
|
|
892
|
+
if (typeof n === "string") {
|
|
893
|
+
let i = new u(n);
|
|
894
|
+
i.ownerDocument = this.ownerDocument, this.insertBefore(i, t);
|
|
895
|
+
} else
|
|
896
|
+
this.insertBefore(n, t);
|
|
897
|
+
}
|
|
898
|
+
before(...e) {
|
|
899
|
+
let t = this.parentNode;
|
|
900
|
+
if (!t)
|
|
1079
901
|
return;
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}
|
|
1091
|
-
after(...nodes) {
|
|
1092
|
-
const parent = this.parentNode;
|
|
1093
|
-
if (!parent) {
|
|
902
|
+
for (let n of e)
|
|
903
|
+
if (typeof n === "string") {
|
|
904
|
+
let i = new u(n);
|
|
905
|
+
i.ownerDocument = this.ownerDocument, t.insertBefore(i, this);
|
|
906
|
+
} else
|
|
907
|
+
t.insertBefore(n, this);
|
|
908
|
+
}
|
|
909
|
+
after(...e) {
|
|
910
|
+
let t = this.parentNode;
|
|
911
|
+
if (!t)
|
|
1094
912
|
return;
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
}
|
|
1107
|
-
replaceWith(...nodes) {
|
|
1108
|
-
const parent = this.parentNode;
|
|
1109
|
-
if (!parent) {
|
|
913
|
+
let n = this.nextSibling;
|
|
914
|
+
for (let i of e)
|
|
915
|
+
if (typeof i === "string") {
|
|
916
|
+
let r = new u(i);
|
|
917
|
+
r.ownerDocument = this.ownerDocument, t.insertBefore(r, n);
|
|
918
|
+
} else
|
|
919
|
+
t.insertBefore(i, n);
|
|
920
|
+
}
|
|
921
|
+
replaceWith(...e) {
|
|
922
|
+
let t = this.parentNode;
|
|
923
|
+
if (!t)
|
|
1110
924
|
return;
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
} else {
|
|
1120
|
-
parent.insertBefore(node, reference);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
925
|
+
let n = this.nextSibling;
|
|
926
|
+
t.removeChild(this);
|
|
927
|
+
for (let i of e)
|
|
928
|
+
if (typeof i === "string") {
|
|
929
|
+
let r = new u(i);
|
|
930
|
+
r.ownerDocument = this.ownerDocument, t.insertBefore(r, n);
|
|
931
|
+
} else
|
|
932
|
+
t.insertBefore(i, n);
|
|
1123
933
|
}
|
|
1124
|
-
setAttributeNS(
|
|
1125
|
-
this.setAttribute(
|
|
934
|
+
setAttributeNS(e, t, n) {
|
|
935
|
+
this.setAttribute(t, n);
|
|
1126
936
|
}
|
|
1127
|
-
removeAttributeNS(
|
|
1128
|
-
this.removeAttribute(
|
|
937
|
+
removeAttributeNS(e, t) {
|
|
938
|
+
this.removeAttribute(t);
|
|
1129
939
|
}
|
|
1130
|
-
hasAttributeNS(
|
|
1131
|
-
return this.hasAttribute(
|
|
940
|
+
hasAttributeNS(e, t) {
|
|
941
|
+
return this.hasAttribute(t);
|
|
1132
942
|
}
|
|
1133
|
-
getAttributeNS(
|
|
1134
|
-
return this.getAttribute(
|
|
943
|
+
getAttributeNS(e, t) {
|
|
944
|
+
return this.getAttribute(t);
|
|
1135
945
|
}
|
|
1136
|
-
findAttribute(
|
|
1137
|
-
return this.attributeList.find((
|
|
946
|
+
findAttribute(e) {
|
|
947
|
+
return this.attributeList.find((t) => t.name === e);
|
|
1138
948
|
}
|
|
1139
949
|
attributeEntries() {
|
|
1140
950
|
return [...this.attributeList];
|
|
@@ -1143,62 +953,56 @@ class Element extends Node {
|
|
|
1143
953
|
return this.styleValue?.cssText ?? "";
|
|
1144
954
|
}
|
|
1145
955
|
createClone() {
|
|
1146
|
-
|
|
1147
|
-
for (
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
return clone;
|
|
956
|
+
let e = m(this.localName, this.ownerDocument);
|
|
957
|
+
for (let t of this.attributeList)
|
|
958
|
+
e.setAttribute(t.name, t.value);
|
|
959
|
+
return e;
|
|
1151
960
|
}
|
|
1152
961
|
}
|
|
1153
962
|
|
|
1154
|
-
class
|
|
1155
|
-
constructor(
|
|
1156
|
-
super(
|
|
963
|
+
class p extends M {
|
|
964
|
+
constructor(e) {
|
|
965
|
+
super(e);
|
|
1157
966
|
}
|
|
1158
967
|
}
|
|
1159
968
|
|
|
1160
|
-
class
|
|
969
|
+
class Z {
|
|
1161
970
|
element;
|
|
1162
|
-
constructor(
|
|
1163
|
-
this.element =
|
|
1164
|
-
for (let
|
|
1165
|
-
Object.defineProperty(this, String(
|
|
1166
|
-
configurable: true,
|
|
1167
|
-
enumerable: true,
|
|
1168
|
-
get: () => this.element.attributeEntries()[index] ?? null
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
971
|
+
constructor(e) {
|
|
972
|
+
this.element = e;
|
|
973
|
+
for (let t = 0;t < e.attributeEntries().length; t += 1)
|
|
974
|
+
Object.defineProperty(this, String(t), { configurable: true, enumerable: true, get: () => this.element.attributeEntries()[t] ?? null });
|
|
1171
975
|
}
|
|
1172
976
|
get length() {
|
|
1173
977
|
return this.element.attributeEntries().length;
|
|
1174
978
|
}
|
|
1175
|
-
item(
|
|
1176
|
-
return this.element.attributeEntries()[
|
|
979
|
+
item(e) {
|
|
980
|
+
return this.element.attributeEntries()[e] ?? null;
|
|
1177
981
|
}
|
|
1178
|
-
getNamedItem(
|
|
1179
|
-
return this.element.findAttribute(
|
|
982
|
+
getNamedItem(e) {
|
|
983
|
+
return this.element.findAttribute(e) ?? null;
|
|
1180
984
|
}
|
|
1181
|
-
setNamedItem(
|
|
1182
|
-
this.element.setAttribute(
|
|
985
|
+
setNamedItem(e) {
|
|
986
|
+
this.element.setAttribute(e.name, e.value);
|
|
1183
987
|
}
|
|
1184
|
-
removeNamedItem(
|
|
1185
|
-
this.element.removeAttribute(
|
|
988
|
+
removeNamedItem(e) {
|
|
989
|
+
this.element.removeAttribute(e);
|
|
1186
990
|
}
|
|
1187
991
|
[Symbol.iterator]() {
|
|
1188
992
|
return this.element.attributeEntries()[Symbol.iterator]();
|
|
1189
993
|
}
|
|
1190
994
|
}
|
|
1191
995
|
|
|
1192
|
-
class
|
|
996
|
+
class k extends p {
|
|
1193
997
|
selectedValue;
|
|
1194
|
-
constructor(
|
|
1195
|
-
super(
|
|
998
|
+
constructor(e = "option") {
|
|
999
|
+
super(e);
|
|
1196
1000
|
}
|
|
1197
1001
|
get value() {
|
|
1198
1002
|
return this.getAttribute("value") ?? this.textContent;
|
|
1199
1003
|
}
|
|
1200
|
-
set value(
|
|
1201
|
-
this.setAttribute("value",
|
|
1004
|
+
set value(e) {
|
|
1005
|
+
this.setAttribute("value", e);
|
|
1202
1006
|
}
|
|
1203
1007
|
get text() {
|
|
1204
1008
|
return this.textContent;
|
|
@@ -1209,130 +1013,106 @@ class HTMLOptionElement extends HTMLElement {
|
|
|
1209
1013
|
get selected() {
|
|
1210
1014
|
return this.hasSelectedValue();
|
|
1211
1015
|
}
|
|
1212
|
-
set selected(
|
|
1213
|
-
this.setSelectedRaw(
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
option.setSelectedRaw(false);
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1016
|
+
set selected(e) {
|
|
1017
|
+
if (this.setSelectedRaw(e), e) {
|
|
1018
|
+
let t = this.parentElement;
|
|
1019
|
+
if (t instanceof P && !t.multiple) {
|
|
1020
|
+
for (let n of t.options.toArray())
|
|
1021
|
+
if (n !== this)
|
|
1022
|
+
n.setSelectedRaw(false);
|
|
1222
1023
|
}
|
|
1223
1024
|
}
|
|
1224
1025
|
}
|
|
1225
|
-
setSelectedRaw(
|
|
1226
|
-
this.selectedValue =
|
|
1227
|
-
if (value) {
|
|
1026
|
+
setSelectedRaw(e) {
|
|
1027
|
+
if (this.selectedValue = e, e)
|
|
1228
1028
|
this.setAttribute("selected", "");
|
|
1229
|
-
|
|
1029
|
+
else
|
|
1230
1030
|
this.removeAttribute("selected");
|
|
1231
|
-
}
|
|
1232
1031
|
}
|
|
1233
1032
|
hasSelectedValue() {
|
|
1234
|
-
if (this.selectedValue !== undefined)
|
|
1033
|
+
if (this.selectedValue !== undefined)
|
|
1235
1034
|
return this.selectedValue;
|
|
1236
|
-
}
|
|
1237
1035
|
return this.hasAttribute("selected");
|
|
1238
1036
|
}
|
|
1239
1037
|
}
|
|
1240
1038
|
|
|
1241
|
-
class
|
|
1242
|
-
constructor(
|
|
1243
|
-
super(
|
|
1039
|
+
class P extends p {
|
|
1040
|
+
constructor(e = "select") {
|
|
1041
|
+
super(e);
|
|
1244
1042
|
}
|
|
1245
1043
|
get multiple() {
|
|
1246
1044
|
return this.hasAttribute("multiple");
|
|
1247
1045
|
}
|
|
1248
|
-
set multiple(
|
|
1249
|
-
if (
|
|
1046
|
+
set multiple(e) {
|
|
1047
|
+
if (e)
|
|
1250
1048
|
this.setAttribute("multiple", "");
|
|
1251
|
-
|
|
1049
|
+
else
|
|
1252
1050
|
this.removeAttribute("multiple");
|
|
1253
|
-
}
|
|
1254
1051
|
}
|
|
1255
1052
|
get options() {
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
if (
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
});
|
|
1262
|
-
return new HTMLOptionsCollection(options);
|
|
1053
|
+
let e = [];
|
|
1054
|
+
return N(this, (t) => {
|
|
1055
|
+
if (t instanceof k)
|
|
1056
|
+
e.push(t);
|
|
1057
|
+
}), new Q(e);
|
|
1263
1058
|
}
|
|
1264
1059
|
get selectedOptions() {
|
|
1265
|
-
return new
|
|
1060
|
+
return new f(this.options.toArray().filter((e) => e.hasSelectedValue()));
|
|
1266
1061
|
}
|
|
1267
1062
|
get selectedIndex() {
|
|
1268
|
-
return this.options.toArray().findIndex((
|
|
1063
|
+
return this.options.toArray().findIndex((e) => e.hasSelectedValue());
|
|
1269
1064
|
}
|
|
1270
|
-
set selectedIndex(
|
|
1271
|
-
|
|
1272
|
-
options.forEach((option, optionIndex) => option.setSelectedRaw(optionIndex === index));
|
|
1065
|
+
set selectedIndex(e) {
|
|
1066
|
+
this.options.toArray().forEach((n, i) => n.setSelectedRaw(i === e));
|
|
1273
1067
|
}
|
|
1274
1068
|
get value() {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
if (!this.multiple && options.length > 0) {
|
|
1281
|
-
return options[0].value;
|
|
1282
|
-
}
|
|
1069
|
+
let e = this.options.toArray(), t = e.find((n) => n.hasSelectedValue());
|
|
1070
|
+
if (t)
|
|
1071
|
+
return t.value;
|
|
1072
|
+
if (!this.multiple && e.length > 0)
|
|
1073
|
+
return e[0].value;
|
|
1283
1074
|
return "";
|
|
1284
1075
|
}
|
|
1285
|
-
set value(
|
|
1286
|
-
|
|
1287
|
-
for (
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
other.setSelectedRaw(other === option);
|
|
1295
|
-
}
|
|
1076
|
+
set value(e) {
|
|
1077
|
+
let t = this.options.toArray();
|
|
1078
|
+
for (let n of t)
|
|
1079
|
+
if (n.value === e)
|
|
1080
|
+
if (this.multiple)
|
|
1081
|
+
n.setSelectedRaw(true);
|
|
1082
|
+
else {
|
|
1083
|
+
for (let r of t)
|
|
1084
|
+
r.setSelectedRaw(r === n);
|
|
1296
1085
|
return;
|
|
1297
1086
|
}
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
1087
|
}
|
|
1301
|
-
add(
|
|
1302
|
-
this.appendChild(
|
|
1088
|
+
add(e) {
|
|
1089
|
+
this.appendChild(e);
|
|
1303
1090
|
}
|
|
1304
|
-
removeOption(
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
option.remove();
|
|
1309
|
-
}
|
|
1091
|
+
removeOption(e) {
|
|
1092
|
+
let n = this.options.toArray()[e];
|
|
1093
|
+
if (n)
|
|
1094
|
+
n.remove();
|
|
1310
1095
|
}
|
|
1311
1096
|
}
|
|
1312
1097
|
|
|
1313
|
-
class
|
|
1098
|
+
class Q {
|
|
1314
1099
|
items;
|
|
1315
|
-
constructor(
|
|
1316
|
-
this.items =
|
|
1317
|
-
for (let
|
|
1318
|
-
Object.defineProperty(this, String(
|
|
1319
|
-
configurable: true,
|
|
1320
|
-
enumerable: true,
|
|
1321
|
-
get: () => this.items[index]
|
|
1322
|
-
});
|
|
1323
|
-
}
|
|
1100
|
+
constructor(e) {
|
|
1101
|
+
this.items = e;
|
|
1102
|
+
for (let t = 0;t < e.length; t += 1)
|
|
1103
|
+
Object.defineProperty(this, String(t), { configurable: true, enumerable: true, get: () => this.items[t] });
|
|
1324
1104
|
}
|
|
1325
1105
|
get length() {
|
|
1326
1106
|
return this.items.length;
|
|
1327
1107
|
}
|
|
1328
|
-
item(
|
|
1329
|
-
return this.items[
|
|
1108
|
+
item(e) {
|
|
1109
|
+
return this.items[e] ?? null;
|
|
1330
1110
|
}
|
|
1331
1111
|
get value() {
|
|
1332
|
-
return this.items.find((
|
|
1112
|
+
return this.items.find((e) => e.hasSelectedValue())?.value ?? "";
|
|
1333
1113
|
}
|
|
1334
1114
|
get selectedIndex() {
|
|
1335
|
-
return this.items.findIndex((
|
|
1115
|
+
return this.items.findIndex((e) => e.hasSelectedValue());
|
|
1336
1116
|
}
|
|
1337
1117
|
toArray() {
|
|
1338
1118
|
return [...this.items];
|
|
@@ -1342,29 +1122,29 @@ class HTMLOptionsCollection {
|
|
|
1342
1122
|
}
|
|
1343
1123
|
}
|
|
1344
1124
|
|
|
1345
|
-
class
|
|
1125
|
+
class U extends p {
|
|
1346
1126
|
inputValue;
|
|
1347
1127
|
checkedValue;
|
|
1348
|
-
constructor(
|
|
1349
|
-
super(
|
|
1128
|
+
constructor(e = "input") {
|
|
1129
|
+
super(e);
|
|
1350
1130
|
}
|
|
1351
1131
|
get type() {
|
|
1352
1132
|
return this.getAttribute("type") ?? "text";
|
|
1353
1133
|
}
|
|
1354
|
-
set type(
|
|
1355
|
-
this.setAttribute("type",
|
|
1134
|
+
set type(e) {
|
|
1135
|
+
this.setAttribute("type", e);
|
|
1356
1136
|
}
|
|
1357
1137
|
get name() {
|
|
1358
1138
|
return this.getAttribute("name") ?? "";
|
|
1359
1139
|
}
|
|
1360
|
-
set name(
|
|
1361
|
-
this.setAttribute("name",
|
|
1140
|
+
set name(e) {
|
|
1141
|
+
this.setAttribute("name", e);
|
|
1362
1142
|
}
|
|
1363
1143
|
get value() {
|
|
1364
1144
|
return this.inputValue ?? this.getAttribute("value") ?? "";
|
|
1365
1145
|
}
|
|
1366
|
-
set value(
|
|
1367
|
-
this.inputValue =
|
|
1146
|
+
set value(e) {
|
|
1147
|
+
this.inputValue = e;
|
|
1368
1148
|
}
|
|
1369
1149
|
get defaultValue() {
|
|
1370
1150
|
return this.getAttribute("value") ?? "";
|
|
@@ -1372,168 +1152,154 @@ class HTMLInputElement extends HTMLElement {
|
|
|
1372
1152
|
get checked() {
|
|
1373
1153
|
return this.checkedValue ?? this.hasAttribute("checked");
|
|
1374
1154
|
}
|
|
1375
|
-
set checked(
|
|
1376
|
-
this.checkedValue =
|
|
1155
|
+
set checked(e) {
|
|
1156
|
+
this.checkedValue = e;
|
|
1377
1157
|
}
|
|
1378
1158
|
get disabled() {
|
|
1379
1159
|
return this.hasAttribute("disabled");
|
|
1380
1160
|
}
|
|
1381
|
-
set disabled(
|
|
1382
|
-
if (
|
|
1161
|
+
set disabled(e) {
|
|
1162
|
+
if (e)
|
|
1383
1163
|
this.setAttribute("disabled", "");
|
|
1384
|
-
|
|
1164
|
+
else
|
|
1385
1165
|
this.removeAttribute("disabled");
|
|
1386
|
-
}
|
|
1387
1166
|
}
|
|
1388
1167
|
createClone() {
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
clone.checkedValue = this.checkedValue;
|
|
1392
|
-
return clone;
|
|
1168
|
+
let e = super.createClone();
|
|
1169
|
+
return e.inputValue = this.inputValue, e.checkedValue = this.checkedValue, e;
|
|
1393
1170
|
}
|
|
1394
1171
|
}
|
|
1395
1172
|
|
|
1396
|
-
class
|
|
1173
|
+
class B extends p {
|
|
1397
1174
|
textareaValue;
|
|
1398
|
-
constructor(
|
|
1399
|
-
super(
|
|
1175
|
+
constructor(e = "textarea") {
|
|
1176
|
+
super(e);
|
|
1400
1177
|
}
|
|
1401
1178
|
get value() {
|
|
1402
1179
|
return this.textareaValue ?? this.textContent;
|
|
1403
1180
|
}
|
|
1404
|
-
set value(
|
|
1405
|
-
this.textareaValue =
|
|
1181
|
+
set value(e) {
|
|
1182
|
+
this.textareaValue = e;
|
|
1406
1183
|
}
|
|
1407
1184
|
}
|
|
1408
1185
|
|
|
1409
|
-
class
|
|
1410
|
-
constructor(
|
|
1411
|
-
super(
|
|
1186
|
+
class W extends p {
|
|
1187
|
+
constructor(e = "button") {
|
|
1188
|
+
super(e);
|
|
1412
1189
|
}
|
|
1413
1190
|
get type() {
|
|
1414
1191
|
return this.getAttribute("type") ?? "submit";
|
|
1415
1192
|
}
|
|
1416
1193
|
}
|
|
1417
1194
|
|
|
1418
|
-
class
|
|
1419
|
-
constructor(
|
|
1420
|
-
super(
|
|
1195
|
+
class z extends p {
|
|
1196
|
+
constructor(e = "style") {
|
|
1197
|
+
super(e);
|
|
1421
1198
|
}
|
|
1422
1199
|
}
|
|
1423
1200
|
|
|
1424
|
-
class
|
|
1425
|
-
constructor(
|
|
1426
|
-
super(
|
|
1201
|
+
class G extends p {
|
|
1202
|
+
constructor(e = "a") {
|
|
1203
|
+
super(e);
|
|
1427
1204
|
}
|
|
1428
1205
|
get href() {
|
|
1429
1206
|
return this.getAttribute("href") ?? "";
|
|
1430
1207
|
}
|
|
1431
|
-
set href(
|
|
1432
|
-
this.setAttribute("href",
|
|
1208
|
+
set href(e) {
|
|
1209
|
+
this.setAttribute("href", e);
|
|
1433
1210
|
}
|
|
1434
1211
|
}
|
|
1435
1212
|
|
|
1436
|
-
class
|
|
1213
|
+
class u extends b {
|
|
1437
1214
|
data;
|
|
1438
|
-
constructor(
|
|
1215
|
+
constructor(e = "") {
|
|
1439
1216
|
super(3, "#text");
|
|
1440
|
-
this.data =
|
|
1217
|
+
this.data = e;
|
|
1441
1218
|
}
|
|
1442
1219
|
get nodeValue() {
|
|
1443
1220
|
return this.data;
|
|
1444
1221
|
}
|
|
1445
|
-
set nodeValue(
|
|
1446
|
-
this.data =
|
|
1222
|
+
set nodeValue(e) {
|
|
1223
|
+
this.data = e;
|
|
1447
1224
|
}
|
|
1448
1225
|
get textContent() {
|
|
1449
1226
|
return this.data;
|
|
1450
1227
|
}
|
|
1451
|
-
set textContent(
|
|
1452
|
-
this.data =
|
|
1228
|
+
set textContent(e) {
|
|
1229
|
+
this.data = e;
|
|
1453
1230
|
}
|
|
1454
1231
|
get wholeText() {
|
|
1455
1232
|
return this.data;
|
|
1456
1233
|
}
|
|
1457
1234
|
createClone() {
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
return clone;
|
|
1235
|
+
let e = new u(this.data);
|
|
1236
|
+
return e.ownerDocument = this.ownerDocument, e;
|
|
1461
1237
|
}
|
|
1462
1238
|
}
|
|
1463
1239
|
|
|
1464
|
-
class
|
|
1240
|
+
class w extends b {
|
|
1465
1241
|
data;
|
|
1466
|
-
constructor(
|
|
1242
|
+
constructor(e = "") {
|
|
1467
1243
|
super(8, "#comment");
|
|
1468
|
-
this.data =
|
|
1244
|
+
this.data = e;
|
|
1469
1245
|
}
|
|
1470
1246
|
get nodeValue() {
|
|
1471
1247
|
return this.data;
|
|
1472
1248
|
}
|
|
1473
|
-
set nodeValue(
|
|
1474
|
-
this.data =
|
|
1249
|
+
set nodeValue(e) {
|
|
1250
|
+
this.data = e;
|
|
1475
1251
|
}
|
|
1476
1252
|
createClone() {
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
return clone;
|
|
1253
|
+
let e = new w(this.data);
|
|
1254
|
+
return e.ownerDocument = this.ownerDocument, e;
|
|
1480
1255
|
}
|
|
1481
1256
|
}
|
|
1482
1257
|
|
|
1483
|
-
class
|
|
1258
|
+
class _ extends b {
|
|
1484
1259
|
constructor() {
|
|
1485
1260
|
super(11, "#document-fragment");
|
|
1486
1261
|
}
|
|
1487
1262
|
}
|
|
1488
1263
|
|
|
1489
|
-
class
|
|
1264
|
+
class S extends b {
|
|
1490
1265
|
defaultView = null;
|
|
1491
1266
|
constructor() {
|
|
1492
1267
|
super(9, "#document");
|
|
1493
1268
|
}
|
|
1494
|
-
createElement(
|
|
1495
|
-
return
|
|
1269
|
+
createElement(e) {
|
|
1270
|
+
return m(e, this);
|
|
1496
1271
|
}
|
|
1497
|
-
createElementNS(
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
return element;
|
|
1272
|
+
createElementNS(e, t) {
|
|
1273
|
+
let n = m(t, this);
|
|
1274
|
+
return n.namespaceURI = e, n;
|
|
1501
1275
|
}
|
|
1502
|
-
createTextNode(
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
return text;
|
|
1276
|
+
createTextNode(e) {
|
|
1277
|
+
let t = new u(e);
|
|
1278
|
+
return t.ownerDocument = this, t;
|
|
1506
1279
|
}
|
|
1507
|
-
createComment(
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
return comment;
|
|
1280
|
+
createComment(e) {
|
|
1281
|
+
let t = new w(e);
|
|
1282
|
+
return t.ownerDocument = this, t;
|
|
1511
1283
|
}
|
|
1512
1284
|
createDocumentFragment() {
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
if (
|
|
1522
|
-
return new
|
|
1523
|
-
|
|
1524
|
-
if (type === "CustomEvent" || type === "customevent") {
|
|
1525
|
-
return new CustomEvent("");
|
|
1526
|
-
}
|
|
1527
|
-
return new Event("");
|
|
1285
|
+
let e = new _;
|
|
1286
|
+
return e.ownerDocument = this, e;
|
|
1287
|
+
}
|
|
1288
|
+
createEvent(e) {
|
|
1289
|
+
if (e === "MouseEvent" || e === "mouseevent")
|
|
1290
|
+
return new O("");
|
|
1291
|
+
if (e === "KeyboardEvent" || e === "keyboardevent")
|
|
1292
|
+
return new H("");
|
|
1293
|
+
if (e === "CustomEvent" || e === "customevent")
|
|
1294
|
+
return new I("");
|
|
1295
|
+
return new c("");
|
|
1528
1296
|
}
|
|
1529
1297
|
get documentElement() {
|
|
1530
|
-
|
|
1531
|
-
if (
|
|
1532
|
-
return
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
this.appendChild(created);
|
|
1536
|
-
return created;
|
|
1298
|
+
let e = this.childList.find((n) => n.nodeType === 1);
|
|
1299
|
+
if (e)
|
|
1300
|
+
return e;
|
|
1301
|
+
let t = m("html", this);
|
|
1302
|
+
return this.appendChild(t), t;
|
|
1537
1303
|
}
|
|
1538
1304
|
get head() {
|
|
1539
1305
|
return this.ensureDocumentChild("head");
|
|
@@ -1542,59 +1308,51 @@ class Document extends Node {
|
|
|
1542
1308
|
return this.ensureDocumentChild("body");
|
|
1543
1309
|
}
|
|
1544
1310
|
get title() {
|
|
1545
|
-
|
|
1546
|
-
return titleElement?.textContent ?? "";
|
|
1311
|
+
return this.querySelector("title")?.textContent ?? "";
|
|
1547
1312
|
}
|
|
1548
|
-
set title(
|
|
1549
|
-
let
|
|
1550
|
-
if (!
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
}
|
|
1554
|
-
titleElement.textContent = value;
|
|
1313
|
+
set title(e) {
|
|
1314
|
+
let t = this.querySelector("title");
|
|
1315
|
+
if (!t)
|
|
1316
|
+
t = m("title", this), this.head.appendChild(t);
|
|
1317
|
+
t.textContent = e;
|
|
1555
1318
|
}
|
|
1556
|
-
querySelector(
|
|
1557
|
-
return
|
|
1319
|
+
querySelector(e) {
|
|
1320
|
+
return C(this, e).item(0);
|
|
1558
1321
|
}
|
|
1559
|
-
querySelectorAll(
|
|
1560
|
-
return
|
|
1322
|
+
querySelectorAll(e) {
|
|
1323
|
+
return C(this, e);
|
|
1561
1324
|
}
|
|
1562
|
-
getElementById(
|
|
1563
|
-
let
|
|
1564
|
-
|
|
1565
|
-
if (!
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
});
|
|
1569
|
-
return result;
|
|
1325
|
+
getElementById(e) {
|
|
1326
|
+
let t = null;
|
|
1327
|
+
return N(this, (n) => {
|
|
1328
|
+
if (!t && n.id === e)
|
|
1329
|
+
t = n;
|
|
1330
|
+
}), t;
|
|
1570
1331
|
}
|
|
1571
|
-
getElementsByTagName(
|
|
1572
|
-
return this.documentElement.getElementsByTagName(
|
|
1332
|
+
getElementsByTagName(e) {
|
|
1333
|
+
return this.documentElement.getElementsByTagName(e);
|
|
1573
1334
|
}
|
|
1574
1335
|
createClone() {
|
|
1575
|
-
return new
|
|
1336
|
+
return new S;
|
|
1576
1337
|
}
|
|
1577
|
-
ensureDocumentChild(
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
documentElement.appendChild(child);
|
|
1583
|
-
}
|
|
1584
|
-
return child;
|
|
1338
|
+
ensureDocumentChild(e) {
|
|
1339
|
+
let t = this.documentElement, n = t.childList.find((i) => i.nodeType === 1 && i.localName === e);
|
|
1340
|
+
if (!n)
|
|
1341
|
+
n = m(e, this), t.appendChild(n);
|
|
1342
|
+
return n;
|
|
1585
1343
|
}
|
|
1586
1344
|
}
|
|
1587
1345
|
|
|
1588
|
-
class
|
|
1346
|
+
class Y {
|
|
1589
1347
|
url;
|
|
1590
|
-
constructor(
|
|
1591
|
-
this.url = new URL(
|
|
1348
|
+
constructor(e) {
|
|
1349
|
+
this.url = new URL(e);
|
|
1592
1350
|
}
|
|
1593
1351
|
get href() {
|
|
1594
1352
|
return this.url.href;
|
|
1595
1353
|
}
|
|
1596
|
-
set href(
|
|
1597
|
-
this.url = new URL(
|
|
1354
|
+
set href(e) {
|
|
1355
|
+
this.url = new URL(e, this.url.href);
|
|
1598
1356
|
}
|
|
1599
1357
|
get origin() {
|
|
1600
1358
|
return this.url.origin;
|
|
@@ -1614,23 +1372,22 @@ class Location {
|
|
|
1614
1372
|
get pathname() {
|
|
1615
1373
|
return this.url.pathname;
|
|
1616
1374
|
}
|
|
1617
|
-
set pathname(
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
url.pathname = next.pathname;
|
|
1375
|
+
set pathname(e) {
|
|
1376
|
+
let t = this.url, n = new URL(e, t.href);
|
|
1377
|
+
t.pathname = n.pathname;
|
|
1621
1378
|
}
|
|
1622
1379
|
get search() {
|
|
1623
1380
|
return this.url.search;
|
|
1624
1381
|
}
|
|
1625
|
-
set search(
|
|
1626
|
-
this.url.search =
|
|
1382
|
+
set search(e) {
|
|
1383
|
+
this.url.search = e.startsWith("?") ? e : `?${e}`;
|
|
1627
1384
|
}
|
|
1628
1385
|
get hash() {
|
|
1629
1386
|
return this.url.hash;
|
|
1630
1387
|
}
|
|
1631
|
-
set hash(
|
|
1632
|
-
|
|
1633
|
-
this.url.hash =
|
|
1388
|
+
set hash(e) {
|
|
1389
|
+
let t = e.startsWith("#") ? e : `#${e}`;
|
|
1390
|
+
this.url.hash = t;
|
|
1634
1391
|
}
|
|
1635
1392
|
get username() {
|
|
1636
1393
|
return this.url.username;
|
|
@@ -1638,11 +1395,11 @@ class Location {
|
|
|
1638
1395
|
get password() {
|
|
1639
1396
|
return this.url.password;
|
|
1640
1397
|
}
|
|
1641
|
-
assign(
|
|
1642
|
-
this.url = new URL(
|
|
1398
|
+
assign(e) {
|
|
1399
|
+
this.url = new URL(e, this.url.href);
|
|
1643
1400
|
}
|
|
1644
|
-
replace(
|
|
1645
|
-
this.url = new URL(
|
|
1401
|
+
replace(e) {
|
|
1402
|
+
this.url = new URL(e, this.url.href);
|
|
1646
1403
|
}
|
|
1647
1404
|
reload() {}
|
|
1648
1405
|
toString() {
|
|
@@ -1652,19 +1409,18 @@ class Location {
|
|
|
1652
1409
|
return this.url.hash.slice(1);
|
|
1653
1410
|
}
|
|
1654
1411
|
getHrefWithoutHash() {
|
|
1655
|
-
|
|
1656
|
-
return `${
|
|
1412
|
+
let e = this.url;
|
|
1413
|
+
return `${e.origin}${e.pathname}${e.search}`;
|
|
1657
1414
|
}
|
|
1658
1415
|
}
|
|
1659
1416
|
|
|
1660
|
-
class
|
|
1417
|
+
class J {
|
|
1661
1418
|
windowRef;
|
|
1662
1419
|
entries = [];
|
|
1663
1420
|
index = 0;
|
|
1664
1421
|
scrollRestoration = "auto";
|
|
1665
|
-
constructor(
|
|
1666
|
-
this.windowRef =
|
|
1667
|
-
this.entries = [{ state: null, url: windowRef.location.href }];
|
|
1422
|
+
constructor(e) {
|
|
1423
|
+
this.windowRef = e, this.entries = [{ state: null, url: e.location.href }];
|
|
1668
1424
|
}
|
|
1669
1425
|
get length() {
|
|
1670
1426
|
return this.entries.length;
|
|
@@ -1672,17 +1428,13 @@ class History {
|
|
|
1672
1428
|
get state() {
|
|
1673
1429
|
return this.entries[this.index]?.state ?? null;
|
|
1674
1430
|
}
|
|
1675
|
-
pushState(
|
|
1676
|
-
|
|
1677
|
-
this.entries = this.entries.slice(0, this.index + 1);
|
|
1678
|
-
this.entries.push({ state, url: nextUrl });
|
|
1679
|
-
this.index = this.entries.length - 1;
|
|
1680
|
-
this.windowRef.setLocationUrl(nextUrl);
|
|
1431
|
+
pushState(e, t, n) {
|
|
1432
|
+
let i = n ? new URL(n, this.windowRef.location.href).href : this.windowRef.location.href;
|
|
1433
|
+
this.entries = this.entries.slice(0, this.index + 1), this.entries.push({ state: e, url: i }), this.index = this.entries.length - 1, this.windowRef.setLocationUrl(i);
|
|
1681
1434
|
}
|
|
1682
|
-
replaceState(
|
|
1683
|
-
|
|
1684
|
-
this.entries[this.index] = { state, url:
|
|
1685
|
-
this.windowRef.setLocationUrl(nextUrl);
|
|
1435
|
+
replaceState(e, t, n) {
|
|
1436
|
+
let i = n ? new URL(n, this.windowRef.location.href).href : this.windowRef.location.href;
|
|
1437
|
+
this.entries[this.index] = { state: e, url: i }, this.windowRef.setLocationUrl(i);
|
|
1686
1438
|
}
|
|
1687
1439
|
back() {
|
|
1688
1440
|
this.go(-1);
|
|
@@ -1690,673 +1442,483 @@ class History {
|
|
|
1690
1442
|
forward() {
|
|
1691
1443
|
this.go(1);
|
|
1692
1444
|
}
|
|
1693
|
-
go(
|
|
1694
|
-
|
|
1695
|
-
if (
|
|
1445
|
+
go(e = 0) {
|
|
1446
|
+
let t = this.index + e;
|
|
1447
|
+
if (t < 0 || t >= this.entries.length)
|
|
1696
1448
|
return;
|
|
1697
|
-
}
|
|
1698
|
-
this.index = nextIndex;
|
|
1699
|
-
this.windowRef.setLocationUrl(this.entries[nextIndex].url);
|
|
1700
|
-
this.windowRef.dispatchEvent(new Event("popstate", { bubbles: false, cancelable: false }));
|
|
1449
|
+
this.index = t, this.windowRef.setLocationUrl(this.entries[t].url), this.windowRef.dispatchEvent(new c("popstate", { bubbles: false, cancelable: false }));
|
|
1701
1450
|
}
|
|
1702
1451
|
}
|
|
1703
1452
|
|
|
1704
|
-
class
|
|
1453
|
+
class ee {
|
|
1705
1454
|
store = new Map;
|
|
1706
1455
|
get length() {
|
|
1707
1456
|
return this.store.size;
|
|
1708
1457
|
}
|
|
1709
|
-
key(
|
|
1710
|
-
return [...this.store.keys()][
|
|
1458
|
+
key(e) {
|
|
1459
|
+
return [...this.store.keys()][e] ?? null;
|
|
1711
1460
|
}
|
|
1712
|
-
getItem(
|
|
1713
|
-
return this.store.has(
|
|
1461
|
+
getItem(e) {
|
|
1462
|
+
return this.store.has(e) ? this.store.get(e) : null;
|
|
1714
1463
|
}
|
|
1715
|
-
setItem(
|
|
1716
|
-
this.store.set(
|
|
1464
|
+
setItem(e, t) {
|
|
1465
|
+
this.store.set(e, String(t));
|
|
1717
1466
|
}
|
|
1718
|
-
removeItem(
|
|
1719
|
-
this.store.delete(
|
|
1467
|
+
removeItem(e) {
|
|
1468
|
+
this.store.delete(e);
|
|
1720
1469
|
}
|
|
1721
1470
|
clear() {
|
|
1722
1471
|
this.store.clear();
|
|
1723
1472
|
}
|
|
1724
1473
|
}
|
|
1725
1474
|
|
|
1726
|
-
class
|
|
1727
|
-
userAgent = "TSone/0.1
|
|
1475
|
+
class te {
|
|
1476
|
+
userAgent = "TSone/0.2.1";
|
|
1728
1477
|
platform = "TSone";
|
|
1729
1478
|
language = "zh-CN";
|
|
1730
1479
|
languages = ["zh-CN"];
|
|
1731
1480
|
onLine = true;
|
|
1732
1481
|
maxTouchPoints = 0;
|
|
1733
1482
|
}
|
|
1734
|
-
function
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
if (
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
},
|
|
1757
|
-
dispatchEvent(event) {
|
|
1758
|
-
for (const listener of [...listeners]) {
|
|
1759
|
-
if (typeof listener === "function") {
|
|
1760
|
-
listener.call(list, event);
|
|
1761
|
-
} else {
|
|
1762
|
-
listener.handleEvent(event);
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
return true;
|
|
1766
|
-
}
|
|
1767
|
-
};
|
|
1768
|
-
return list;
|
|
1769
|
-
}
|
|
1770
|
-
var DOM_GLOBAL_KEYS = [
|
|
1771
|
-
"window",
|
|
1772
|
-
"document",
|
|
1773
|
-
"Node",
|
|
1774
|
-
"Text",
|
|
1775
|
-
"Comment",
|
|
1776
|
-
"Element",
|
|
1777
|
-
"HTMLElement",
|
|
1778
|
-
"HTMLInputElement",
|
|
1779
|
-
"HTMLTextAreaElement",
|
|
1780
|
-
"HTMLSelectElement",
|
|
1781
|
-
"HTMLButtonElement",
|
|
1782
|
-
"HTMLOptionElement",
|
|
1783
|
-
"HTMLStyleElement",
|
|
1784
|
-
"HTMLAnchorElement",
|
|
1785
|
-
"DocumentFragment",
|
|
1786
|
-
"Document",
|
|
1787
|
-
"Event",
|
|
1788
|
-
"MouseEvent",
|
|
1789
|
-
"KeyboardEvent",
|
|
1790
|
-
"CustomEvent",
|
|
1791
|
-
"EventTarget",
|
|
1792
|
-
"DOMException",
|
|
1793
|
-
"history",
|
|
1794
|
-
"location",
|
|
1795
|
-
"navigator",
|
|
1796
|
-
"localStorage",
|
|
1797
|
-
"matchMedia",
|
|
1798
|
-
"getComputedStyle",
|
|
1799
|
-
"requestAnimationFrame",
|
|
1800
|
-
"cancelAnimationFrame",
|
|
1801
|
-
"ResizeObserver"
|
|
1802
|
-
];
|
|
1483
|
+
function ge(e, t) {
|
|
1484
|
+
let n = new Set, i = false, r = { media: t, matches: false, onchange: null, addEventListener(s, l) {
|
|
1485
|
+
if (s === "change")
|
|
1486
|
+
n.add(l);
|
|
1487
|
+
}, removeEventListener(s, l) {
|
|
1488
|
+
if (s === "change")
|
|
1489
|
+
n.delete(l);
|
|
1490
|
+
}, addListener(s) {
|
|
1491
|
+
n.add(s);
|
|
1492
|
+
}, removeListener(s) {
|
|
1493
|
+
n.delete(s);
|
|
1494
|
+
}, dispatchEvent(s) {
|
|
1495
|
+
for (let l of [...n])
|
|
1496
|
+
if (typeof l === "function")
|
|
1497
|
+
l.call(r, s);
|
|
1498
|
+
else
|
|
1499
|
+
l.handleEvent(s);
|
|
1500
|
+
return true;
|
|
1501
|
+
} };
|
|
1502
|
+
return r;
|
|
1503
|
+
}
|
|
1504
|
+
var fe = ["window", "document", "Node", "Text", "Comment", "Element", "HTMLElement", "HTMLInputElement", "HTMLTextAreaElement", "HTMLSelectElement", "HTMLButtonElement", "HTMLOptionElement", "HTMLStyleElement", "HTMLAnchorElement", "DocumentFragment", "Document", "Event", "MouseEvent", "KeyboardEvent", "CustomEvent", "EventTarget", "DOMException", "history", "location", "navigator", "localStorage", "matchMedia", "getComputedStyle", "requestAnimationFrame", "cancelAnimationFrame", "ResizeObserver"];
|
|
1803
1505
|
|
|
1804
|
-
class
|
|
1506
|
+
class ne extends A {
|
|
1805
1507
|
window = this;
|
|
1806
1508
|
document;
|
|
1807
1509
|
location;
|
|
1808
1510
|
history;
|
|
1809
|
-
localStorage = new
|
|
1810
|
-
navigator = new
|
|
1811
|
-
Node =
|
|
1812
|
-
Text =
|
|
1813
|
-
Comment =
|
|
1814
|
-
Element =
|
|
1815
|
-
HTMLElement =
|
|
1816
|
-
HTMLInputElement =
|
|
1817
|
-
HTMLTextAreaElement =
|
|
1818
|
-
HTMLSelectElement =
|
|
1819
|
-
HTMLButtonElement =
|
|
1820
|
-
HTMLOptionElement =
|
|
1821
|
-
HTMLStyleElement =
|
|
1822
|
-
HTMLAnchorElement =
|
|
1823
|
-
DocumentFragment =
|
|
1824
|
-
Document =
|
|
1825
|
-
Event =
|
|
1826
|
-
MouseEvent =
|
|
1827
|
-
KeyboardEvent =
|
|
1828
|
-
CustomEvent =
|
|
1829
|
-
EventTarget =
|
|
1830
|
-
DOMException =
|
|
1831
|
-
NodeList =
|
|
1832
|
-
constructor(
|
|
1511
|
+
localStorage = new ee;
|
|
1512
|
+
navigator = new te;
|
|
1513
|
+
Node = b;
|
|
1514
|
+
Text = u;
|
|
1515
|
+
Comment = w;
|
|
1516
|
+
Element = M;
|
|
1517
|
+
HTMLElement = p;
|
|
1518
|
+
HTMLInputElement = U;
|
|
1519
|
+
HTMLTextAreaElement = B;
|
|
1520
|
+
HTMLSelectElement = P;
|
|
1521
|
+
HTMLButtonElement = W;
|
|
1522
|
+
HTMLOptionElement = k;
|
|
1523
|
+
HTMLStyleElement = z;
|
|
1524
|
+
HTMLAnchorElement = G;
|
|
1525
|
+
DocumentFragment = _;
|
|
1526
|
+
Document = S;
|
|
1527
|
+
Event = c;
|
|
1528
|
+
MouseEvent = O;
|
|
1529
|
+
KeyboardEvent = H;
|
|
1530
|
+
CustomEvent = I;
|
|
1531
|
+
EventTarget = A;
|
|
1532
|
+
DOMException = K;
|
|
1533
|
+
NodeList = f;
|
|
1534
|
+
constructor(e = {}) {
|
|
1833
1535
|
super();
|
|
1834
|
-
|
|
1835
|
-
this.location = new
|
|
1836
|
-
this.history = new History(this);
|
|
1837
|
-
this.document = new Document;
|
|
1838
|
-
this.document.defaultView = this;
|
|
1839
|
-
setupDocumentTree(this.document);
|
|
1536
|
+
let t = e.url ?? "http://localhost/";
|
|
1537
|
+
this.location = new Y(t), this.history = new J(this), this.document = new S, this.document.defaultView = this, Se(this.document);
|
|
1840
1538
|
}
|
|
1841
|
-
matchMedia(
|
|
1842
|
-
return
|
|
1539
|
+
matchMedia(e) {
|
|
1540
|
+
return ge(this, e);
|
|
1843
1541
|
}
|
|
1844
|
-
getComputedStyle(
|
|
1845
|
-
return
|
|
1542
|
+
getComputedStyle(e) {
|
|
1543
|
+
return e.style;
|
|
1846
1544
|
}
|
|
1847
|
-
requestAnimationFrame(
|
|
1848
|
-
return setTimeout(() =>
|
|
1545
|
+
requestAnimationFrame(e) {
|
|
1546
|
+
return setTimeout(() => e(Date.now()), 0);
|
|
1849
1547
|
}
|
|
1850
|
-
cancelAnimationFrame(
|
|
1851
|
-
clearTimeout(
|
|
1548
|
+
cancelAnimationFrame(e) {
|
|
1549
|
+
clearTimeout(e);
|
|
1852
1550
|
}
|
|
1853
|
-
setLocationUrl(
|
|
1854
|
-
this.location.href =
|
|
1551
|
+
setLocationUrl(e) {
|
|
1552
|
+
this.location.href = e;
|
|
1855
1553
|
}
|
|
1856
1554
|
installKeys() {
|
|
1857
|
-
return [...
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
function
|
|
1861
|
-
return new
|
|
1862
|
-
}
|
|
1863
|
-
function
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
}
|
|
1877
|
-
Object.defineProperty(target, "window", {
|
|
1878
|
-
configurable: true,
|
|
1879
|
-
enumerable: true,
|
|
1880
|
-
writable: true,
|
|
1881
|
-
value: windowRef
|
|
1882
|
-
});
|
|
1883
|
-
return () => {
|
|
1884
|
-
for (const key of keys) {
|
|
1885
|
-
const descriptor = previous.get(key);
|
|
1886
|
-
if (descriptor) {
|
|
1887
|
-
Object.defineProperty(target, key, descriptor);
|
|
1888
|
-
} else {
|
|
1889
|
-
Reflect.deleteProperty(target, key);
|
|
1890
|
-
}
|
|
1555
|
+
return [...fe];
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
function ke(e = {}) {
|
|
1559
|
+
return new ne(e);
|
|
1560
|
+
}
|
|
1561
|
+
function Pe(e, t = globalThis) {
|
|
1562
|
+
let n = new Map, i = e.installKeys();
|
|
1563
|
+
for (let r of i)
|
|
1564
|
+
n.set(r, Object.getOwnPropertyDescriptor(t, r));
|
|
1565
|
+
for (let r of i)
|
|
1566
|
+
Object.defineProperty(t, r, { configurable: true, enumerable: true, writable: true, value: e[r] });
|
|
1567
|
+
return Object.defineProperty(t, "window", { configurable: true, enumerable: true, writable: true, value: e }), () => {
|
|
1568
|
+
for (let r of i) {
|
|
1569
|
+
let s = n.get(r);
|
|
1570
|
+
if (s)
|
|
1571
|
+
Object.defineProperty(t, r, s);
|
|
1572
|
+
else
|
|
1573
|
+
Reflect.deleteProperty(t, r);
|
|
1891
1574
|
}
|
|
1892
1575
|
};
|
|
1893
1576
|
}
|
|
1894
|
-
function
|
|
1895
|
-
|
|
1896
|
-
if (
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
let index = 0;
|
|
1906
|
-
const length = source.length;
|
|
1907
|
-
const append = (node) => {
|
|
1908
|
-
if (node.ownerDocument === null) {
|
|
1909
|
-
node.ownerDocument = documentRef;
|
|
1910
|
-
}
|
|
1911
|
-
current.appendChild(node);
|
|
1577
|
+
function ye(e, t) {
|
|
1578
|
+
let n = new _;
|
|
1579
|
+
if (t)
|
|
1580
|
+
n.ownerDocument = t;
|
|
1581
|
+
return Ee(n, e, t), [...n.childList];
|
|
1582
|
+
}
|
|
1583
|
+
function Ee(e, t, n) {
|
|
1584
|
+
let i = [], r = e, s = 0, l = t.length, a = (o) => {
|
|
1585
|
+
if (o.ownerDocument === null)
|
|
1586
|
+
o.ownerDocument = n;
|
|
1587
|
+
r.appendChild(o);
|
|
1912
1588
|
};
|
|
1913
|
-
while (
|
|
1914
|
-
|
|
1915
|
-
if (
|
|
1916
|
-
|
|
1589
|
+
while (s < l) {
|
|
1590
|
+
let o = t.indexOf("<", s);
|
|
1591
|
+
if (o < 0) {
|
|
1592
|
+
a(new u(t.slice(s)));
|
|
1917
1593
|
break;
|
|
1918
1594
|
}
|
|
1919
|
-
if (
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
const commentEnd = closeIndex < 0 ? length : closeIndex;
|
|
1925
|
-
append(new Comment(source.slice(openIndex + 4, commentEnd)));
|
|
1926
|
-
index = closeIndex < 0 ? length : closeIndex + 3;
|
|
1595
|
+
if (o > s)
|
|
1596
|
+
a(new u(t.slice(s, o)));
|
|
1597
|
+
if (t.startsWith("<!--", o)) {
|
|
1598
|
+
let d = t.indexOf("-->", o + 4), E = d < 0 ? l : d;
|
|
1599
|
+
a(new w(t.slice(o + 4, E))), s = d < 0 ? l : d + 3;
|
|
1927
1600
|
continue;
|
|
1928
1601
|
}
|
|
1929
|
-
|
|
1930
|
-
if (
|
|
1931
|
-
|
|
1602
|
+
let h = ve(t, o);
|
|
1603
|
+
if (h < 0) {
|
|
1604
|
+
a(new u(t.slice(o)));
|
|
1932
1605
|
break;
|
|
1933
1606
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
current = stack[stack.length - 1] ?? parent;
|
|
1941
|
-
}
|
|
1942
|
-
index = tagEnd + 1;
|
|
1607
|
+
let T = t.slice(o + 1, h).trim();
|
|
1608
|
+
if (T.startsWith("/")) {
|
|
1609
|
+
let d = T.slice(1).trim().toLowerCase();
|
|
1610
|
+
if (i.length > 0 && i[i.length - 1].localName === d)
|
|
1611
|
+
i.pop(), r = i[i.length - 1] ?? e;
|
|
1612
|
+
s = h + 1;
|
|
1943
1613
|
continue;
|
|
1944
1614
|
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
index = tagEnd + 1;
|
|
1615
|
+
let ae = T.endsWith("/"), y = we(T.replace(/\/$/, "").trim());
|
|
1616
|
+
if (!y) {
|
|
1617
|
+
s = h + 1;
|
|
1949
1618
|
continue;
|
|
1950
1619
|
}
|
|
1951
|
-
|
|
1952
|
-
for (
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
if (VOID_TAGS.has(parsed.name) || selfClosing) {
|
|
1957
|
-
index = tagEnd + 1;
|
|
1620
|
+
let v = m(y.name, n);
|
|
1621
|
+
for (let d of y.attributes)
|
|
1622
|
+
v.setAttribute(d.name, d.value);
|
|
1623
|
+
if (a(v), ie.has(y.name) || ae) {
|
|
1624
|
+
s = h + 1;
|
|
1958
1625
|
continue;
|
|
1959
1626
|
}
|
|
1960
|
-
if (
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
const rawText = source.slice(tagEnd + 1, rawEnd < 0 ? length : rawEnd);
|
|
1964
|
-
element.appendChild(documentRef?.createTextNode(rawText) ?? new Text(rawText));
|
|
1965
|
-
index = rawEnd < 0 ? length : rawEnd + closeTag.length;
|
|
1627
|
+
if (re.has(y.name)) {
|
|
1628
|
+
let d = `</${y.name}>`, E = t.toLowerCase().indexOf(d, h + 1), j = t.slice(h + 1, E < 0 ? l : E);
|
|
1629
|
+
v.appendChild(n?.createTextNode(j) ?? new u(j)), s = E < 0 ? l : E + d.length;
|
|
1966
1630
|
continue;
|
|
1967
1631
|
}
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
"img",
|
|
1981
|
-
"input",
|
|
1982
|
-
"link",
|
|
1983
|
-
"meta",
|
|
1984
|
-
"param",
|
|
1985
|
-
"source",
|
|
1986
|
-
"track",
|
|
1987
|
-
"wbr"
|
|
1988
|
-
]);
|
|
1989
|
-
var RAW_TEXT_TAGS = new Set(["script", "style", "textarea", "title"]);
|
|
1990
|
-
function findTagEnd(source, openIndex) {
|
|
1991
|
-
let inQuote = null;
|
|
1992
|
-
for (let index = openIndex + 1;index < source.length; index += 1) {
|
|
1993
|
-
const char = source[index];
|
|
1994
|
-
if (inQuote) {
|
|
1995
|
-
if (char === inQuote) {
|
|
1996
|
-
inQuote = null;
|
|
1997
|
-
}
|
|
1632
|
+
i.push(v), r = v, s = h + 1;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
var ie = new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
|
|
1636
|
+
var re = new Set(["script", "style", "textarea", "title"]);
|
|
1637
|
+
function ve(e, t) {
|
|
1638
|
+
let n = null;
|
|
1639
|
+
for (let i = t + 1;i < e.length; i += 1) {
|
|
1640
|
+
let r = e[i];
|
|
1641
|
+
if (n) {
|
|
1642
|
+
if (r === n)
|
|
1643
|
+
n = null;
|
|
1998
1644
|
continue;
|
|
1999
1645
|
}
|
|
2000
|
-
if (
|
|
2001
|
-
|
|
1646
|
+
if (r === '"' || r === "'") {
|
|
1647
|
+
n = r;
|
|
2002
1648
|
continue;
|
|
2003
1649
|
}
|
|
2004
|
-
if (
|
|
2005
|
-
return
|
|
2006
|
-
}
|
|
1650
|
+
if (r === ">")
|
|
1651
|
+
return i;
|
|
2007
1652
|
}
|
|
2008
1653
|
return -1;
|
|
2009
1654
|
}
|
|
2010
|
-
function
|
|
2011
|
-
|
|
2012
|
-
if (!
|
|
1655
|
+
function we(e) {
|
|
1656
|
+
let t = e.match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*(.*)$/);
|
|
1657
|
+
if (!t)
|
|
2013
1658
|
return null;
|
|
1659
|
+
let n = t[1].toLowerCase(), i = [], r = t[2], s = /([a-zA-Z_:][a-zA-Z0-9_:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g, l;
|
|
1660
|
+
while ((l = s.exec(r)) !== null) {
|
|
1661
|
+
let a = l[1], o = l[2] ?? l[3] ?? l[4] ?? "";
|
|
1662
|
+
i.push({ name: a, value: Ne(o) });
|
|
2014
1663
|
}
|
|
2015
|
-
|
|
2016
|
-
const attributes = [];
|
|
2017
|
-
const attributeSource = match[2];
|
|
2018
|
-
const pattern = /([a-zA-Z_:][a-zA-Z0-9_:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;
|
|
2019
|
-
let attributeMatch;
|
|
2020
|
-
while ((attributeMatch = pattern.exec(attributeSource)) !== null) {
|
|
2021
|
-
const attrName = attributeMatch[1];
|
|
2022
|
-
const value = attributeMatch[2] ?? attributeMatch[3] ?? attributeMatch[4] ?? "";
|
|
2023
|
-
attributes.push({ name: attrName, value: decodeEntities(value) });
|
|
2024
|
-
}
|
|
2025
|
-
return { name, attributes };
|
|
1664
|
+
return { name: n, attributes: i };
|
|
2026
1665
|
}
|
|
2027
|
-
function
|
|
2028
|
-
return
|
|
1666
|
+
function Ne(e) {
|
|
1667
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, "\xA0");
|
|
2029
1668
|
}
|
|
2030
|
-
function
|
|
2031
|
-
return
|
|
1669
|
+
function se(e) {
|
|
1670
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2032
1671
|
}
|
|
2033
|
-
function
|
|
2034
|
-
return
|
|
1672
|
+
function F(e) {
|
|
1673
|
+
return se(e).replace(/"/g, """);
|
|
2035
1674
|
}
|
|
2036
|
-
function
|
|
2037
|
-
switch (
|
|
1675
|
+
function le(e) {
|
|
1676
|
+
switch (e.nodeType) {
|
|
2038
1677
|
case 3:
|
|
2039
|
-
return
|
|
1678
|
+
return se(e.data);
|
|
2040
1679
|
case 8:
|
|
2041
|
-
return `<!--${
|
|
1680
|
+
return `<!--${e.data}-->`;
|
|
2042
1681
|
case 1:
|
|
2043
|
-
return
|
|
1682
|
+
return Te(e);
|
|
2044
1683
|
default:
|
|
2045
1684
|
return "";
|
|
2046
1685
|
}
|
|
2047
1686
|
}
|
|
2048
|
-
function
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
if (entry.name === "style") {
|
|
1687
|
+
function Te(e) {
|
|
1688
|
+
let t = e.localName, n = [];
|
|
1689
|
+
for (let s of e.attributeEntries()) {
|
|
1690
|
+
if (s.name === "style")
|
|
2053
1691
|
continue;
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
if (
|
|
2063
|
-
return `<${
|
|
2064
|
-
}
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
let index = 0;
|
|
2077
|
-
while (index < group.length) {
|
|
2078
|
-
while (index < group.length && group[index] === " ") {
|
|
2079
|
-
index += 1;
|
|
2080
|
-
}
|
|
2081
|
-
if (index >= group.length) {
|
|
1692
|
+
n.push(`${s.name}="${F(s.value)}"`);
|
|
1693
|
+
}
|
|
1694
|
+
let i = e.inlineStyleText();
|
|
1695
|
+
if (i)
|
|
1696
|
+
n.push(`style="${F(i)}"`);
|
|
1697
|
+
let r = n.length > 0 ? ` ${n.join(" ")}` : "";
|
|
1698
|
+
if (ie.has(t))
|
|
1699
|
+
return `<${t}${r}>`;
|
|
1700
|
+
if (re.has(t))
|
|
1701
|
+
return `<${t}${r}>${e.textContent}</${t}>`;
|
|
1702
|
+
return `<${t}${r}>${oe(e)}</${t}>`;
|
|
1703
|
+
}
|
|
1704
|
+
function oe(e) {
|
|
1705
|
+
return e.childList.map((t) => le(t)).join("");
|
|
1706
|
+
}
|
|
1707
|
+
function xe(e) {
|
|
1708
|
+
return e.split(",").map((t) => {
|
|
1709
|
+
let n = [], i = 0;
|
|
1710
|
+
while (i < t.length) {
|
|
1711
|
+
while (i < t.length && t[i] === " ")
|
|
1712
|
+
i += 1;
|
|
1713
|
+
if (i >= t.length)
|
|
2082
1714
|
break;
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
segments.push({ type: "child" });
|
|
2086
|
-
index += 1;
|
|
1715
|
+
if (t[i] === ">") {
|
|
1716
|
+
n.push({ type: "child" }), i += 1;
|
|
2087
1717
|
continue;
|
|
2088
1718
|
}
|
|
2089
|
-
|
|
2090
|
-
while (
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
segments.push(parseCompound(group.slice(start, index)));
|
|
1719
|
+
let r = i;
|
|
1720
|
+
while (i < t.length && t[i] !== " " && t[i] !== ">")
|
|
1721
|
+
i += 1;
|
|
1722
|
+
n.push(Le(t.slice(r, i)));
|
|
2094
1723
|
}
|
|
2095
|
-
return
|
|
1724
|
+
return n;
|
|
2096
1725
|
});
|
|
2097
1726
|
}
|
|
2098
|
-
function
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
} else if (
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
type: "
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
} else if (
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
} else {
|
|
2140
|
-
index += 1;
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
if (selectors.length === 1) {
|
|
2144
|
-
return selectors[0];
|
|
2145
|
-
}
|
|
2146
|
-
return { type: "compound", parts: selectors };
|
|
2147
|
-
}
|
|
2148
|
-
function scanIdentifier(source, start) {
|
|
2149
|
-
let index = start;
|
|
2150
|
-
while (index < source.length && /[a-zA-Z0-9:_-]/.test(source[index])) {
|
|
2151
|
-
index += 1;
|
|
2152
|
-
}
|
|
2153
|
-
return index;
|
|
2154
|
-
}
|
|
2155
|
-
function matchSelector(element, selector) {
|
|
2156
|
-
const groups = parseSelector(selector);
|
|
2157
|
-
return groups.some((group) => matchGroup(element, group));
|
|
2158
|
-
}
|
|
2159
|
-
function matchGroup(element, group) {
|
|
2160
|
-
let index = group.length - 1;
|
|
2161
|
-
if (index < 0) {
|
|
1727
|
+
function Le(e) {
|
|
1728
|
+
let t = [], n = 0;
|
|
1729
|
+
while (n < e.length) {
|
|
1730
|
+
let i = e[n];
|
|
1731
|
+
if (i === "*")
|
|
1732
|
+
t.push({ type: "universal" }), n += 1;
|
|
1733
|
+
else if (i === "#") {
|
|
1734
|
+
let r = V(e, n + 1);
|
|
1735
|
+
t.push({ type: "id", id: e.slice(n + 1, r) }), n = r;
|
|
1736
|
+
} else if (i === ".") {
|
|
1737
|
+
let r = V(e, n + 1);
|
|
1738
|
+
t.push({ type: "class", className: e.slice(n + 1, r) }), n = r;
|
|
1739
|
+
} else if (i === "[") {
|
|
1740
|
+
let r = e.indexOf("]", n), s = e.slice(n + 1, r < 0 ? e.length : r).trim(), l = s.match(/^([a-zA-Z_:][a-zA-Z0-9_:.-]*)(?:([~|^$*]?=)(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?$/);
|
|
1741
|
+
if (l)
|
|
1742
|
+
t.push({ type: "attribute", name: l[1], operator: l[2], value: l[3] ?? l[4] ?? l[5] });
|
|
1743
|
+
else
|
|
1744
|
+
t.push({ type: "attribute", name: s });
|
|
1745
|
+
n = r < 0 ? e.length : r + 1;
|
|
1746
|
+
} else if (/[a-zA-Z_]/.test(i)) {
|
|
1747
|
+
let r = V(e, n);
|
|
1748
|
+
t.push({ type: "tag", name: e.slice(n, r).toLowerCase() }), n = r;
|
|
1749
|
+
} else
|
|
1750
|
+
n += 1;
|
|
1751
|
+
}
|
|
1752
|
+
if (t.length === 1)
|
|
1753
|
+
return t[0];
|
|
1754
|
+
return { type: "compound", parts: t };
|
|
1755
|
+
}
|
|
1756
|
+
function V(e, t) {
|
|
1757
|
+
let n = t;
|
|
1758
|
+
while (n < e.length && /[a-zA-Z0-9:_-]/.test(e[n]))
|
|
1759
|
+
n += 1;
|
|
1760
|
+
return n;
|
|
1761
|
+
}
|
|
1762
|
+
function ue(e, t) {
|
|
1763
|
+
return xe(t).some((i) => De(e, i));
|
|
1764
|
+
}
|
|
1765
|
+
function De(e, t) {
|
|
1766
|
+
let n = t.length - 1;
|
|
1767
|
+
if (n < 0)
|
|
2162
1768
|
return true;
|
|
2163
|
-
|
|
2164
|
-
if (!matchSegment(element, group[index])) {
|
|
1769
|
+
if (!D(e, t[n]))
|
|
2165
1770
|
return false;
|
|
2166
|
-
|
|
2167
|
-
if (index === 0) {
|
|
1771
|
+
if (n === 0)
|
|
2168
1772
|
return true;
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
if (!selector) {
|
|
1773
|
+
let i = e.parentElement;
|
|
1774
|
+
n -= 1;
|
|
1775
|
+
while (i) {
|
|
1776
|
+
let r = t[n];
|
|
1777
|
+
if (!r)
|
|
2175
1778
|
return true;
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
if (!parentSelector || !matchSegment(current, parentSelector)) {
|
|
1779
|
+
if (r.type === "child") {
|
|
1780
|
+
let s = t[n - 1];
|
|
1781
|
+
if (!s || !D(i, s))
|
|
2180
1782
|
return false;
|
|
2181
|
-
|
|
2182
|
-
index -= 2;
|
|
2183
|
-
if (index < 0) {
|
|
1783
|
+
if (n -= 2, n < 0)
|
|
2184
1784
|
return true;
|
|
2185
|
-
|
|
2186
|
-
current = current.parentElement;
|
|
1785
|
+
i = i.parentElement;
|
|
2187
1786
|
continue;
|
|
2188
1787
|
}
|
|
2189
|
-
if (
|
|
2190
|
-
|
|
2191
|
-
if (index < 0) {
|
|
1788
|
+
if (D(i, r)) {
|
|
1789
|
+
if (n -= 1, n < 0)
|
|
2192
1790
|
return true;
|
|
2193
|
-
}
|
|
2194
1791
|
}
|
|
2195
|
-
|
|
1792
|
+
i = i.parentElement;
|
|
2196
1793
|
}
|
|
2197
1794
|
return false;
|
|
2198
1795
|
}
|
|
2199
|
-
function
|
|
2200
|
-
switch (
|
|
1796
|
+
function D(e, t) {
|
|
1797
|
+
switch (t.type) {
|
|
2201
1798
|
case "universal":
|
|
2202
1799
|
return true;
|
|
2203
1800
|
case "tag":
|
|
2204
|
-
return
|
|
1801
|
+
return e.localName === t.name;
|
|
2205
1802
|
case "id":
|
|
2206
|
-
return
|
|
1803
|
+
return e.id === t.id;
|
|
2207
1804
|
case "class":
|
|
2208
|
-
return
|
|
1805
|
+
return e.classList.contains(t.className);
|
|
2209
1806
|
case "attribute":
|
|
2210
|
-
return
|
|
1807
|
+
return Ae(e, t);
|
|
2211
1808
|
case "compound":
|
|
2212
|
-
return
|
|
1809
|
+
return t.parts.every((n) => D(e, n));
|
|
2213
1810
|
case "child":
|
|
2214
1811
|
return false;
|
|
2215
1812
|
default:
|
|
2216
1813
|
return false;
|
|
2217
1814
|
}
|
|
2218
1815
|
}
|
|
2219
|
-
function
|
|
2220
|
-
|
|
2221
|
-
if (!
|
|
2222
|
-
return
|
|
2223
|
-
|
|
2224
|
-
if (attributeValue === null) {
|
|
1816
|
+
function Ae(e, t) {
|
|
1817
|
+
let n = e.getAttribute(t.name);
|
|
1818
|
+
if (!t.operator)
|
|
1819
|
+
return n !== null;
|
|
1820
|
+
if (n === null)
|
|
2225
1821
|
return false;
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
switch (selector.operator) {
|
|
1822
|
+
let i = t.value ?? "";
|
|
1823
|
+
switch (t.operator) {
|
|
2229
1824
|
case "=":
|
|
2230
|
-
return
|
|
1825
|
+
return n === i;
|
|
2231
1826
|
case "~=":
|
|
2232
|
-
return
|
|
1827
|
+
return n.split(/\s+/).includes(i);
|
|
2233
1828
|
case "|=":
|
|
2234
|
-
return
|
|
1829
|
+
return n === i || n.startsWith(`${i}-`);
|
|
2235
1830
|
case "^=":
|
|
2236
|
-
return
|
|
1831
|
+
return n.startsWith(i);
|
|
2237
1832
|
case "$=":
|
|
2238
|
-
return
|
|
1833
|
+
return n.endsWith(i);
|
|
2239
1834
|
case "*=":
|
|
2240
|
-
return
|
|
1835
|
+
return n.includes(i);
|
|
2241
1836
|
default:
|
|
2242
1837
|
return false;
|
|
2243
1838
|
}
|
|
2244
1839
|
}
|
|
2245
|
-
function
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
if (
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
if (
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
const body = documentRef.createElement("body");
|
|
2291
|
-
html.appendChild(head);
|
|
2292
|
-
html.appendChild(body);
|
|
2293
|
-
}
|
|
2294
|
-
function createDatasetProxy(element) {
|
|
2295
|
-
const handler = {
|
|
2296
|
-
get(_target, property) {
|
|
2297
|
-
if (typeof property === "symbol") {
|
|
2298
|
-
return;
|
|
2299
|
-
}
|
|
2300
|
-
return element.getAttribute(`data-${toKebabCase(property)}`) ?? "";
|
|
2301
|
-
},
|
|
2302
|
-
set(_target, property, value) {
|
|
2303
|
-
if (typeof property === "symbol") {
|
|
2304
|
-
return true;
|
|
2305
|
-
}
|
|
2306
|
-
if (value === "" || value === null || value === undefined) {
|
|
2307
|
-
element.removeAttribute(`data-${toKebabCase(property)}`);
|
|
2308
|
-
} else {
|
|
2309
|
-
element.setAttribute(`data-${toKebabCase(property)}`, String(value));
|
|
2310
|
-
}
|
|
2311
|
-
return true;
|
|
2312
|
-
},
|
|
2313
|
-
deleteProperty(_target, property) {
|
|
2314
|
-
if (typeof property !== "symbol") {
|
|
2315
|
-
element.removeAttribute(`data-${toKebabCase(property)}`);
|
|
2316
|
-
}
|
|
1840
|
+
function C(e, t) {
|
|
1841
|
+
let n = [];
|
|
1842
|
+
return N(e, (i) => {
|
|
1843
|
+
if (i !== e && ue(i, t))
|
|
1844
|
+
n.push(i);
|
|
1845
|
+
}), new f(n);
|
|
1846
|
+
}
|
|
1847
|
+
function N(e, t) {
|
|
1848
|
+
for (let n of e.childList)
|
|
1849
|
+
if (n.nodeType === 1)
|
|
1850
|
+
t(n), N(n, t);
|
|
1851
|
+
}
|
|
1852
|
+
function m(e, t) {
|
|
1853
|
+
let n = e.toLowerCase(), i;
|
|
1854
|
+
if (n === "input")
|
|
1855
|
+
i = new U(n);
|
|
1856
|
+
else if (n === "textarea")
|
|
1857
|
+
i = new B(n);
|
|
1858
|
+
else if (n === "select")
|
|
1859
|
+
i = new P(n);
|
|
1860
|
+
else if (n === "option")
|
|
1861
|
+
i = new k(n);
|
|
1862
|
+
else if (n === "button")
|
|
1863
|
+
i = new W(n);
|
|
1864
|
+
else if (n === "style")
|
|
1865
|
+
i = new z(n);
|
|
1866
|
+
else if (n === "a")
|
|
1867
|
+
i = new G(n);
|
|
1868
|
+
else
|
|
1869
|
+
i = new p(n);
|
|
1870
|
+
return i.ownerDocument = t, i;
|
|
1871
|
+
}
|
|
1872
|
+
function Se(e) {
|
|
1873
|
+
let t = e.createElement("html");
|
|
1874
|
+
t.setAttribute("lang", "en"), e.appendChild(t);
|
|
1875
|
+
let n = e.createElement("head"), i = e.createElement("body");
|
|
1876
|
+
t.appendChild(n), t.appendChild(i);
|
|
1877
|
+
}
|
|
1878
|
+
function Ce(e) {
|
|
1879
|
+
return new Proxy({}, { get(n, i) {
|
|
1880
|
+
if (typeof i === "symbol")
|
|
1881
|
+
return;
|
|
1882
|
+
return e.getAttribute(`data-${g(i)}`) ?? "";
|
|
1883
|
+
}, set(n, i, r) {
|
|
1884
|
+
if (typeof i === "symbol")
|
|
2317
1885
|
return true;
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
return {
|
|
2340
|
-
configurable: true,
|
|
2341
|
-
enumerable: true,
|
|
2342
|
-
writable: true,
|
|
2343
|
-
value: element.getAttribute(`data-${toKebabCase(property)}`)
|
|
2344
|
-
};
|
|
2345
|
-
}
|
|
1886
|
+
if (r === "" || r === null || r === undefined)
|
|
1887
|
+
e.removeAttribute(`data-${g(i)}`);
|
|
1888
|
+
else
|
|
1889
|
+
e.setAttribute(`data-${g(i)}`, String(r));
|
|
1890
|
+
return true;
|
|
1891
|
+
}, deleteProperty(n, i) {
|
|
1892
|
+
if (typeof i !== "symbol")
|
|
1893
|
+
e.removeAttribute(`data-${g(i)}`);
|
|
1894
|
+
return true;
|
|
1895
|
+
}, has(n, i) {
|
|
1896
|
+
if (typeof i === "symbol")
|
|
1897
|
+
return false;
|
|
1898
|
+
return e.hasAttribute(`data-${g(i)}`);
|
|
1899
|
+
}, ownKeys() {
|
|
1900
|
+
let n = [];
|
|
1901
|
+
for (let i of e.attributeEntries())
|
|
1902
|
+
if (i.name.startsWith("data-"))
|
|
1903
|
+
n.push(Oe(i.name.slice(5)));
|
|
1904
|
+
return n;
|
|
1905
|
+
}, getOwnPropertyDescriptor(n, i) {
|
|
1906
|
+
if (typeof i === "symbol")
|
|
2346
1907
|
return;
|
|
2347
|
-
}
|
|
2348
|
-
|
|
2349
|
-
|
|
1908
|
+
if (e.hasAttribute(`data-${g(i)}`))
|
|
1909
|
+
return { configurable: true, enumerable: true, writable: true, value: e.getAttribute(`data-${g(i)}`) };
|
|
1910
|
+
return;
|
|
1911
|
+
} });
|
|
2350
1912
|
}
|
|
2351
|
-
function
|
|
2352
|
-
return
|
|
1913
|
+
function g(e) {
|
|
1914
|
+
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
2353
1915
|
}
|
|
2354
|
-
function
|
|
2355
|
-
return
|
|
1916
|
+
function Oe(e) {
|
|
1917
|
+
return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
|
|
2356
1918
|
}
|
|
2357
1919
|
|
|
2358
1920
|
// src/project.ts
|
|
2359
|
-
var PROJECT_GLOBAL_KEYS = [...
|
|
1921
|
+
var PROJECT_GLOBAL_KEYS = [...fe, "__APP__"];
|
|
2360
1922
|
var projectDomQueue = Promise.resolve();
|
|
2361
1923
|
async function renderProjectHtml(config, options, entry = config.entry) {
|
|
2362
1924
|
return withProjectDom(async () => {
|
|
@@ -2378,7 +1940,7 @@ async function withProjectDom(callback) {
|
|
|
2378
1940
|
return task;
|
|
2379
1941
|
}
|
|
2380
1942
|
async function runWithProjectDom(callback) {
|
|
2381
|
-
const windowRef =
|
|
1943
|
+
const windowRef = ke({ url: "http://127.0.0.1/" });
|
|
2382
1944
|
Object.assign(windowRef, {
|
|
2383
1945
|
Error,
|
|
2384
1946
|
EvalError,
|
|
@@ -2390,7 +1952,7 @@ async function runWithProjectDom(callback) {
|
|
|
2390
1952
|
});
|
|
2391
1953
|
const descriptors = captureGlobalDescriptors();
|
|
2392
1954
|
try {
|
|
2393
|
-
|
|
1955
|
+
Pe(windowRef);
|
|
2394
1956
|
return await callback();
|
|
2395
1957
|
} finally {
|
|
2396
1958
|
restoreGlobalDescriptors(descriptors);
|
|
@@ -2538,6 +2100,7 @@ async function buildPage(config, route, entry) {
|
|
|
2538
2100
|
outdir: config.build.outDir,
|
|
2539
2101
|
target: "browser",
|
|
2540
2102
|
format: "esm",
|
|
2103
|
+
minify: process.env.TSONE_MINIFY !== "0",
|
|
2541
2104
|
naming: { entry: "[name].[ext]", chunk: "[name]-[hash].[ext]" },
|
|
2542
2105
|
throw: false
|
|
2543
2106
|
});
|
|
@@ -3254,5 +2817,5 @@ function buildFailureResponse() {
|
|
|
3254
2817
|
|
|
3255
2818
|
export { defineConfig, resolveConfig, build, startDevServer };
|
|
3256
2819
|
|
|
3257
|
-
//# debugId=
|
|
3258
|
-
//# sourceMappingURL=index-
|
|
2820
|
+
//# debugId=12585AE602C4C51764756E2164756E21
|
|
2821
|
+
//# sourceMappingURL=index-y6qrqbwv.js.map
|