haori 0.62.2 → 0.62.3
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.ja.md +1 -1
- package/README.md +2 -2
- package/dist/haori.cjs.js +19 -19
- package/dist/haori.es.js +673 -581
- package/dist/haori.iife.js +19 -19
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ye = class ye {
|
|
2
2
|
/**
|
|
3
3
|
* 開発モードの状態を取得します。
|
|
4
4
|
*
|
|
5
5
|
* @returns 開発モードならtrue、そうでなければfalse
|
|
6
6
|
*/
|
|
7
7
|
static isEnabled() {
|
|
8
|
-
return
|
|
8
|
+
return ye.devMode;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* 開発モードを有効化します。
|
|
12
12
|
*/
|
|
13
13
|
static enable() {
|
|
14
|
-
|
|
14
|
+
ye.devMode = !0;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* 開発モードを無効化します。
|
|
18
18
|
*/
|
|
19
19
|
static disable() {
|
|
20
|
-
|
|
20
|
+
ye.devMode = !1;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* 開発モードを切り替えます。
|
|
@@ -25,17 +25,17 @@ const be = class be {
|
|
|
25
25
|
* @param enabled trueで有効化、falseで無効化
|
|
26
26
|
*/
|
|
27
27
|
static set(e) {
|
|
28
|
-
|
|
28
|
+
ye.devMode = e;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
let q =
|
|
31
|
+
ye.devMode = !1;
|
|
32
|
+
let q = ye;
|
|
33
33
|
const We = "embedded";
|
|
34
|
-
function nt(
|
|
35
|
-
return
|
|
34
|
+
function nt(b) {
|
|
35
|
+
return b === "embedded" || b === "demo";
|
|
36
36
|
}
|
|
37
|
-
function Tt(
|
|
38
|
-
return
|
|
37
|
+
function Tt(b) {
|
|
38
|
+
return b === null ? null : nt(b) ? b : We;
|
|
39
39
|
}
|
|
40
40
|
const te = class te {
|
|
41
41
|
/**
|
|
@@ -423,13 +423,13 @@ const Dt = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, Je = "new:
|
|
|
423
423
|
I.enhancers = /* @__PURE__ */ new Map(), I.instances = /* @__PURE__ */ new WeakMap(), I.warnedUnknownNames = /* @__PURE__ */ new Set(), I.warnedMissingGlobals = /* @__PURE__ */ new Set(), I.visited = /* @__PURE__ */ new WeakSet(), I.mutationCapture = null;
|
|
424
424
|
let re = I;
|
|
425
425
|
const st = "yyyy/MM/dd HH:mm", Nt = "en-US", Ze = 1e4;
|
|
426
|
-
function ce(
|
|
427
|
-
return String(
|
|
426
|
+
function ce(b) {
|
|
427
|
+
return String(b).padStart(2, "0");
|
|
428
428
|
}
|
|
429
|
-
function at(
|
|
429
|
+
function at(b, e, t, r, i, n) {
|
|
430
430
|
return {
|
|
431
|
-
yyyy: String(
|
|
432
|
-
yy: ce(
|
|
431
|
+
yyyy: String(b).padStart(4, "0"),
|
|
432
|
+
yy: ce(b % 100),
|
|
433
433
|
MM: ce(e),
|
|
434
434
|
M: String(e),
|
|
435
435
|
dd: ce(t),
|
|
@@ -440,7 +440,7 @@ function at(y, e, t, r, i, n) {
|
|
|
440
440
|
ss: ce(n)
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function ot(
|
|
443
|
+
function ot(b, e) {
|
|
444
444
|
let t;
|
|
445
445
|
try {
|
|
446
446
|
t = new Intl.DateTimeFormat("en-US", {
|
|
@@ -452,7 +452,7 @@ function ot(y, e) {
|
|
|
452
452
|
hour: "2-digit",
|
|
453
453
|
minute: "2-digit",
|
|
454
454
|
second: "2-digit"
|
|
455
|
-
}).formatToParts(
|
|
455
|
+
}).formatToParts(b);
|
|
456
456
|
} catch {
|
|
457
457
|
return null;
|
|
458
458
|
}
|
|
@@ -462,10 +462,10 @@ function ot(y, e) {
|
|
|
462
462
|
const i = Number(r.year), n = Number(r.month), s = Number(r.day), a = Number(r.hour), o = Number(r.minute), l = Number(r.second);
|
|
463
463
|
return !Number.isFinite(i) || !Number.isFinite(n) || !Number.isFinite(s) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(l) ? null : at(i, n, s, a, o, l);
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
if (
|
|
465
|
+
function He(b, e = st, t) {
|
|
466
|
+
if (b == null || b === "")
|
|
467
467
|
return "";
|
|
468
|
-
const r =
|
|
468
|
+
const r = b instanceof Date ? b : new Date(b);
|
|
469
469
|
if (Number.isNaN(r.getTime()))
|
|
470
470
|
return "";
|
|
471
471
|
let i;
|
|
@@ -488,11 +488,11 @@ function Ue(y, e = st, t) {
|
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
490
|
const Ft = "yyyy-MM-dd";
|
|
491
|
-
function lt(
|
|
492
|
-
return
|
|
491
|
+
function lt(b = st, e) {
|
|
492
|
+
return He(/* @__PURE__ */ new Date(), b, e);
|
|
493
493
|
}
|
|
494
|
-
function ct(
|
|
495
|
-
const r = Number.isFinite(
|
|
494
|
+
function ct(b = 0, e = Ft, t) {
|
|
495
|
+
const r = Number.isFinite(b) ? Math.trunc(b) : 0, i = typeof t == "string" && t.trim() !== "" ? t.trim() : "";
|
|
496
496
|
let n, s, a;
|
|
497
497
|
if (i !== "") {
|
|
498
498
|
const l = ot(/* @__PURE__ */ new Date(), i);
|
|
@@ -504,16 +504,16 @@ function ct(y = 0, e = Ft, t) {
|
|
|
504
504
|
n = l.getFullYear(), s = l.getMonth() + 1, a = l.getDate();
|
|
505
505
|
}
|
|
506
506
|
const o = new Date(Date.UTC(n, s - 1, a + r));
|
|
507
|
-
return
|
|
507
|
+
return He(o, e, "UTC");
|
|
508
508
|
}
|
|
509
|
-
function ut(
|
|
510
|
-
if (
|
|
509
|
+
function ut(b, e) {
|
|
510
|
+
if (b == null)
|
|
511
511
|
return "";
|
|
512
512
|
let t;
|
|
513
|
-
if (typeof
|
|
514
|
-
t =
|
|
513
|
+
if (typeof b == "number")
|
|
514
|
+
t = b;
|
|
515
515
|
else {
|
|
516
|
-
const i = String(
|
|
516
|
+
const i = String(b).trim();
|
|
517
517
|
if (i === "")
|
|
518
518
|
return "";
|
|
519
519
|
t = Number(i);
|
|
@@ -527,9 +527,9 @@ function ut(y, e) {
|
|
|
527
527
|
}
|
|
528
528
|
return new Intl.NumberFormat(Nt, r).format(t);
|
|
529
529
|
}
|
|
530
|
-
function dt(
|
|
530
|
+
function dt(b, e, t) {
|
|
531
531
|
let r, i, n;
|
|
532
|
-
if (e === void 0 ? (r = 0, i =
|
|
532
|
+
if (e === void 0 ? (r = 0, i = b, n = 1) : (r = b, i = e, n = t === void 0 ? 1 : t), !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(n) || n === 0)
|
|
533
533
|
return [];
|
|
534
534
|
r = Math.trunc(r), i = Math.trunc(i), n = Math.trunc(n);
|
|
535
535
|
const s = [];
|
|
@@ -541,8 +541,8 @@ function dt(y, e, t) {
|
|
|
541
541
|
s.push(a);
|
|
542
542
|
return s;
|
|
543
543
|
}
|
|
544
|
-
function ht(
|
|
545
|
-
const r = Math.trunc(Number(
|
|
544
|
+
function ht(b, e, t = {}) {
|
|
545
|
+
const r = Math.trunc(Number(b));
|
|
546
546
|
if (!Number.isFinite(r) || r <= 0)
|
|
547
547
|
return [];
|
|
548
548
|
const i = Math.min(
|
|
@@ -579,14 +579,14 @@ function ht(y, e, t = {}) {
|
|
|
579
579
|
return l;
|
|
580
580
|
}
|
|
581
581
|
const kt = /^(\d{4})-(\d{1,2})$/, It = 1200;
|
|
582
|
-
function Me(
|
|
583
|
-
const t = Number(
|
|
582
|
+
function Me(b, e) {
|
|
583
|
+
const t = Number(b);
|
|
584
584
|
return Number.isFinite(t) ? Math.trunc(t) : e;
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
if (typeof
|
|
586
|
+
function Ue(b, e) {
|
|
587
|
+
if (typeof b != "string")
|
|
588
588
|
return "";
|
|
589
|
-
const t = kt.exec(
|
|
589
|
+
const t = kt.exec(b.trim());
|
|
590
590
|
if (!t)
|
|
591
591
|
return "";
|
|
592
592
|
const r = Number(t[1]), i = Number(t[2]);
|
|
@@ -595,14 +595,14 @@ function He(y, e) {
|
|
|
595
595
|
const n = Number.isFinite(e) ? Math.trunc(e) : 0, s = r * 12 + (i - 1) + n, a = Math.floor(s / 12), o = s - a * 12 + 1;
|
|
596
596
|
return `${String(a).padStart(4, "0")}-${ce(o)}`;
|
|
597
597
|
}
|
|
598
|
-
function xt(
|
|
599
|
-
if (typeof
|
|
600
|
-
return
|
|
598
|
+
function xt(b) {
|
|
599
|
+
if (typeof b == "string" && b.trim() !== "")
|
|
600
|
+
return Ue(b, 0);
|
|
601
601
|
const e = /* @__PURE__ */ new Date();
|
|
602
602
|
return `${String(e.getFullYear()).padStart(4, "0")}-${ce(e.getMonth() + 1)}`;
|
|
603
603
|
}
|
|
604
|
-
function ft(
|
|
605
|
-
const t = Math.trunc(Number(
|
|
604
|
+
function ft(b, e) {
|
|
605
|
+
const t = Math.trunc(Number(b));
|
|
606
606
|
if (!Number.isFinite(t) || t < 0)
|
|
607
607
|
return [];
|
|
608
608
|
const r = xt(e);
|
|
@@ -610,16 +610,16 @@ function ft(y, e) {
|
|
|
610
610
|
return [];
|
|
611
611
|
const i = Math.min(t, It), n = [];
|
|
612
612
|
for (let s = 0; s <= i; s += 1) {
|
|
613
|
-
const a =
|
|
613
|
+
const a = Ue(r, -s);
|
|
614
614
|
n.push({ targetMonth: a, label: a.replace(/-/g, "/") });
|
|
615
615
|
}
|
|
616
616
|
return n;
|
|
617
617
|
}
|
|
618
|
-
function pt(
|
|
618
|
+
function pt(b, e) {
|
|
619
619
|
const t = { start: 0, end: 0, total: 0, empty: !0 };
|
|
620
|
-
if (!
|
|
620
|
+
if (!b || typeof b != "object")
|
|
621
621
|
return t;
|
|
622
|
-
const r =
|
|
622
|
+
const r = b, i = Me(r.totalElements ?? r.totalCount, 0);
|
|
623
623
|
if (i <= 0)
|
|
624
624
|
return t;
|
|
625
625
|
const n = Math.max(0, Me(r.number, 0)), s = Math.max(0, Me(r.size, 0)), a = n * s, o = Math.min(a + 1, i);
|
|
@@ -633,19 +633,19 @@ function pt(y, e) {
|
|
|
633
633
|
const u = Math.min(a + l, i);
|
|
634
634
|
return { start: o, end: Math.max(u, o), total: i, empty: !1 };
|
|
635
635
|
}
|
|
636
|
-
function gt(
|
|
637
|
-
if (!Array.isArray(
|
|
636
|
+
function gt(b, e, t) {
|
|
637
|
+
if (!Array.isArray(b) || b.length === 0)
|
|
638
638
|
return null;
|
|
639
|
-
const r = String(t), i =
|
|
639
|
+
const r = String(t), i = b.find(
|
|
640
640
|
(n) => n != null && String(n[e]) === r
|
|
641
641
|
);
|
|
642
642
|
return i === void 0 ? null : i;
|
|
643
643
|
}
|
|
644
|
-
function mt(
|
|
645
|
-
if (!Array.isArray(
|
|
644
|
+
function mt(b, e) {
|
|
645
|
+
if (!Array.isArray(b))
|
|
646
646
|
return 0;
|
|
647
647
|
let t = 0;
|
|
648
|
-
for (const r of
|
|
648
|
+
for (const r of b) {
|
|
649
649
|
const i = e == null ? r : r?.[e];
|
|
650
650
|
if (i == null || i === "")
|
|
651
651
|
continue;
|
|
@@ -654,25 +654,25 @@ function mt(y, e) {
|
|
|
654
654
|
}
|
|
655
655
|
return t;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return e == null ||
|
|
657
|
+
function yt(b, e) {
|
|
658
|
+
return e == null || b == null ? String(b) : String(b[e]);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
if (!Array.isArray(
|
|
660
|
+
function bt(b, e) {
|
|
661
|
+
if (!Array.isArray(b))
|
|
662
662
|
return [];
|
|
663
663
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
664
|
-
for (const i of
|
|
665
|
-
const n =
|
|
664
|
+
for (const i of b) {
|
|
665
|
+
const n = yt(i, e);
|
|
666
666
|
t.has(n) || (t.add(n), r.push(i));
|
|
667
667
|
}
|
|
668
668
|
return r;
|
|
669
669
|
}
|
|
670
|
-
function Et(
|
|
671
|
-
if (!Array.isArray(
|
|
670
|
+
function Et(b, e) {
|
|
671
|
+
if (!Array.isArray(b))
|
|
672
672
|
return [];
|
|
673
673
|
const t = /* @__PURE__ */ new Map(), r = [];
|
|
674
|
-
for (const i of
|
|
675
|
-
const n =
|
|
674
|
+
for (const i of b) {
|
|
675
|
+
const n = yt(i, e), s = t.get(n);
|
|
676
676
|
if (s === void 0) {
|
|
677
677
|
const a = i == null ? i : i[e];
|
|
678
678
|
t.set(n, r.length), r.push({ key: a, items: [i] });
|
|
@@ -682,23 +682,23 @@ function Et(y, e) {
|
|
|
682
682
|
return r;
|
|
683
683
|
}
|
|
684
684
|
const Ct = Object.freeze({
|
|
685
|
-
date:
|
|
685
|
+
date: He,
|
|
686
686
|
now: lt,
|
|
687
687
|
today: ct,
|
|
688
688
|
number: ut,
|
|
689
689
|
pages: ht,
|
|
690
690
|
range: dt,
|
|
691
|
-
monthAdd:
|
|
691
|
+
monthAdd: Ue,
|
|
692
692
|
monthRange: ft,
|
|
693
693
|
pageSummary: pt,
|
|
694
694
|
findBy: gt,
|
|
695
695
|
sum: mt,
|
|
696
|
-
distinct:
|
|
696
|
+
distinct: bt,
|
|
697
697
|
groupBy: Et
|
|
698
698
|
});
|
|
699
699
|
class ze {
|
|
700
700
|
constructor() {
|
|
701
|
-
this.MAX_BUDGET = 8, this.queue = [], this.processing = !1;
|
|
701
|
+
this.MAX_BUDGET = 8, this.queue = [], this.processing = !1, this.channel = null;
|
|
702
702
|
}
|
|
703
703
|
/**
|
|
704
704
|
* 処理をキューに追加します
|
|
@@ -752,13 +752,35 @@ class ze {
|
|
|
752
752
|
}
|
|
753
753
|
/**
|
|
754
754
|
* 処理をスケジュールします。
|
|
755
|
+
*
|
|
756
|
+
* 処理は次のタスクで始めます(仕様「7. Queue (queue.ts)」の「処理は次のフレームを待たず、
|
|
757
|
+
* 次のタスクで始めます」)。1 回の更新の中でもキューは何度も空になってから
|
|
758
|
+
* 再開するため、再開のたびに次のフレームを待つと、その待ち時間が積み重なります。
|
|
759
|
+
* タスクの合間にはブラウザが入力の処理と描画を行えるため、8ms で区切って
|
|
760
|
+
* 譲る効果は変わりません。
|
|
755
761
|
*/
|
|
756
762
|
scheduleProcessing() {
|
|
757
|
-
this.processing
|
|
763
|
+
if (this.processing)
|
|
764
|
+
return;
|
|
765
|
+
const e = this.getChannel();
|
|
766
|
+
e !== null ? e.port2.postMessage(null) : setTimeout(() => {
|
|
758
767
|
this.processQueue();
|
|
759
|
-
}
|
|
768
|
+
}, 0);
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* 次のタスクで処理を始めるための `MessageChannel` を返します。
|
|
772
|
+
*
|
|
773
|
+
* `setTimeout(0)` は入れ子が深くなると 4ms 以上に引き延ばされ、背面のタブでは
|
|
774
|
+
* さらに間引かれるため、`MessageChannel` を使います。最初に処理を積んだときに
|
|
775
|
+
* 1 つだけ作って使い回します(仕様「7. Queue (queue.ts)」の「読み込んだだけでは
|
|
776
|
+
* 作りません」)。
|
|
777
|
+
*
|
|
778
|
+
* @returns 通知路。`MessageChannel` の無い環境では null
|
|
779
|
+
*/
|
|
780
|
+
getChannel() {
|
|
781
|
+
return this.channel === null && typeof MessageChannel < "u" && (this.channel = new MessageChannel(), this.channel.port1.onmessage = () => {
|
|
760
782
|
this.processQueue();
|
|
761
|
-
},
|
|
783
|
+
}), this.channel;
|
|
762
784
|
}
|
|
763
785
|
/**
|
|
764
786
|
* キューが空になるまで待機します。
|
|
@@ -828,7 +850,7 @@ const Ye = class Ye {
|
|
|
828
850
|
};
|
|
829
851
|
Ye.ASYNC_QUEUE = new ze();
|
|
830
852
|
let z = Ye;
|
|
831
|
-
const
|
|
853
|
+
const T = class T {
|
|
832
854
|
/**
|
|
833
855
|
* 明示バインド内に持ち込まれてはならない危険値を返します。
|
|
834
856
|
*
|
|
@@ -933,11 +955,10 @@ const D = class D {
|
|
|
933
955
|
/**
|
|
934
956
|
* バインドキーが関数の引数名として使えるかを返します。
|
|
935
957
|
*
|
|
936
|
-
*
|
|
958
|
+
* 評価器の引数は式が参照する名前(識別子の字句)から選ぶため、引数名にできない
|
|
937
959
|
* キー(`customer.email` のようにドットを含むもの、ハイフン、空白、先頭が数字、
|
|
938
|
-
*
|
|
939
|
-
*
|
|
940
|
-
* 例外も出さずに他のキーの値を壊します。
|
|
960
|
+
* 予約語など)は引数になりません。この判定は、そうしたキーを開発モードで報告
|
|
961
|
+
* するために使います(`reportUnusableBindingKeys()`)。
|
|
941
962
|
*
|
|
942
963
|
* 判定は 2 段で行います。実際に `new Function` へ通して予約語(`class` など)と
|
|
943
964
|
* 識別子として不正な文字を弾き、あわせて単一の識別子名かを検査して `a,b`
|
|
@@ -955,7 +976,7 @@ const D = class D {
|
|
|
955
976
|
let r = this.IDENTIFIER_NAME_PATTERN.test(e);
|
|
956
977
|
if (r)
|
|
957
978
|
try {
|
|
958
|
-
new Function(e, "");
|
|
979
|
+
new Function(e, '"use strict"');
|
|
959
980
|
} catch {
|
|
960
981
|
r = !1;
|
|
961
982
|
}
|
|
@@ -971,7 +992,7 @@ const D = class D {
|
|
|
971
992
|
* @returns 戻り値はありません。
|
|
972
993
|
*/
|
|
973
994
|
static reportUnusableBindingKeys(e) {
|
|
974
|
-
if (e.length === 0
|
|
995
|
+
if (e.length === 0)
|
|
975
996
|
return;
|
|
976
997
|
const t = e.filter(
|
|
977
998
|
(r) => !this.loggedUnusableBindingKeys.has(r)
|
|
@@ -1156,6 +1177,27 @@ let ${e.join(", ")};`;
|
|
|
1156
1177
|
static startsCall(e) {
|
|
1157
1178
|
return e === null ? !1 : e.type === "identifier" ? !this.NON_SHADOWABLE_IDENTIFIERS.has(e.value) : e.value === ")" || e.value === "]";
|
|
1158
1179
|
}
|
|
1180
|
+
/**
|
|
1181
|
+
* `(` がアロー関数の引数リストの開始かどうかを判定します。
|
|
1182
|
+
*
|
|
1183
|
+
* `async (x) => x` の `(x)` は引数リストで、呼び出しではありません(仕様
|
|
1184
|
+
* 「暗黙のオプショナルチェーン」の「アロー関数の引数リストやグループ化の丸括弧は
|
|
1185
|
+
* 呼び出しとみなしません」)。呼び出しの位置(直前が識別子・`)`・`]`)にある
|
|
1186
|
+
* `(` のうち、対応する `)` の直後が `=>` のものだけを引数リストとみなします
|
|
1187
|
+
* (`async` 以外の名前の後では構文エラーの式で、どちらとみなしても結果は
|
|
1188
|
+
* 同じです)。引数の既定値は書けないため、引数リストの中に丸括弧は現れず、
|
|
1189
|
+
* 最初の `)` が対応する `)` です。
|
|
1190
|
+
*
|
|
1191
|
+
* @param tokens 式のトークン列
|
|
1192
|
+
* @param index `(` の位置
|
|
1193
|
+
* @returns 引数リストの開始であれば true
|
|
1194
|
+
*/
|
|
1195
|
+
static startsArrowParameters(e, t) {
|
|
1196
|
+
const r = e.findIndex(
|
|
1197
|
+
(i, n) => n > t && i.value === ")"
|
|
1198
|
+
);
|
|
1199
|
+
return e[r + 1]?.value === "=>";
|
|
1200
|
+
}
|
|
1159
1201
|
/**
|
|
1160
1202
|
* メンバーアクセスを暗黙のオプショナルチェーンへ変換します。
|
|
1161
1203
|
*
|
|
@@ -1179,16 +1221,18 @@ let ${e.join(", ")};`;
|
|
|
1179
1221
|
if (r !== null) {
|
|
1180
1222
|
const n = [];
|
|
1181
1223
|
let s = null;
|
|
1182
|
-
for (
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1224
|
+
for (let a = 0; a < r.length; a += 1) {
|
|
1225
|
+
const o = r[a];
|
|
1226
|
+
o.type === "operator" && s?.value !== "?." && (o.value === "." ? n.push({
|
|
1227
|
+
start: o.position,
|
|
1228
|
+
end: o.position + 1,
|
|
1186
1229
|
text: "?."
|
|
1187
|
-
}) : (
|
|
1188
|
-
start:
|
|
1189
|
-
end:
|
|
1230
|
+
}) : (o.value === "[" && this.startsMemberAccess(s) || o.value === "(" && this.startsCall(s) && !this.startsArrowParameters(r, a)) && n.push({
|
|
1231
|
+
start: o.position,
|
|
1232
|
+
end: o.position,
|
|
1190
1233
|
text: "?."
|
|
1191
|
-
})), s =
|
|
1234
|
+
})), s = o;
|
|
1235
|
+
}
|
|
1192
1236
|
for (let a = n.length - 1; a >= 0; a -= 1) {
|
|
1193
1237
|
const o = n[a];
|
|
1194
1238
|
i = i.slice(0, o.start) + o.text + i.slice(o.end);
|
|
@@ -1230,7 +1274,7 @@ let ${e.join(", ")};`;
|
|
|
1230
1274
|
s.push(l), l && n.push({
|
|
1231
1275
|
start: o.position + 1,
|
|
1232
1276
|
end: o.position + 1,
|
|
1233
|
-
text:
|
|
1277
|
+
text: T.MEMBER_KEY_GUARD_OPEN
|
|
1234
1278
|
});
|
|
1235
1279
|
} else o.value === "]" && s.pop() === !0 && n.push({
|
|
1236
1280
|
start: o.position,
|
|
@@ -1435,10 +1479,8 @@ ${t}`;
|
|
|
1435
1479
|
const n = this.prepareEvaluator(e, i);
|
|
1436
1480
|
if (!(n.compileFailed || n.evaluator === null))
|
|
1437
1481
|
try {
|
|
1438
|
-
const s = this.
|
|
1439
|
-
|
|
1440
|
-
);
|
|
1441
|
-
return typeof o == "boolean" ? o : void 0;
|
|
1482
|
+
const s = this.runEvaluator(e, n, i);
|
|
1483
|
+
return typeof s == "boolean" ? s : void 0;
|
|
1442
1484
|
} catch {
|
|
1443
1485
|
return;
|
|
1444
1486
|
}
|
|
@@ -1476,14 +1518,15 @@ ${t}`;
|
|
|
1476
1518
|
static evaluateDetailed(e, t = {}) {
|
|
1477
1519
|
if (this.scheduleForbiddenBindingValueCacheReset(), e.trim() === "")
|
|
1478
1520
|
return g.warn("[Haori]", e, "Expression is empty"), { value: null, unresolvedReference: !1 };
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1521
|
+
const r = this.getExpressionProfile(e);
|
|
1522
|
+
if (r.dangerous) {
|
|
1523
|
+
const y = this.detectDisallowedKeywords(e);
|
|
1524
|
+
if (y.length > 0) {
|
|
1525
|
+
const E = y.some((A) => A === "function" || A === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
|
|
1483
1526
|
g.warn(
|
|
1484
1527
|
"[Haori]",
|
|
1485
1528
|
e,
|
|
1486
|
-
"Expression uses disallowed keyword(s): " +
|
|
1529
|
+
"Expression uses disallowed keyword(s): " + y.join(", ") + "." + E
|
|
1487
1530
|
);
|
|
1488
1531
|
} else
|
|
1489
1532
|
g.warn(
|
|
@@ -1493,50 +1536,43 @@ ${t}`;
|
|
|
1493
1536
|
);
|
|
1494
1537
|
return { value: null, unresolvedReference: !1 };
|
|
1495
1538
|
}
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1498
|
-
const
|
|
1499
|
-
this.loggedForbiddenKeySignatures.has(
|
|
1539
|
+
const i = this.collectForbiddenKeys(t);
|
|
1540
|
+
if (i.length > 0) {
|
|
1541
|
+
const y = i.join(",");
|
|
1542
|
+
this.loggedForbiddenKeySignatures.has(y) || (this.loggedForbiddenKeySignatures.add(y), this.scheduleForbiddenKeyLogReset(), g.error(
|
|
1500
1543
|
"[Haori]",
|
|
1501
|
-
"Binding keys are reserved and ignored: " +
|
|
1544
|
+
"Binding keys are reserved and ignored: " + i.join(", ") + ". These collide with blocked global/prototype names and cannot be used as top-level binding keys; the remaining keys are still evaluated."
|
|
1502
1545
|
));
|
|
1503
1546
|
}
|
|
1504
|
-
const
|
|
1505
|
-
/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,
|
|
1506
|
-
""
|
|
1507
|
-
), n = this.BUILTIN_DATA_REFERENCE_PATTERN.test(
|
|
1508
|
-
i
|
|
1509
|
-
), s = n ? null : this.getReferencedNames(e);
|
|
1547
|
+
const n = r.referencesBuiltinData, s = n ? null : this.getReferencedNames(e);
|
|
1510
1548
|
if (this.containsForbiddenReferencedValues(t, s))
|
|
1511
1549
|
return g.warn(
|
|
1512
1550
|
"[Haori]",
|
|
1513
1551
|
t,
|
|
1514
1552
|
"Binded values contain forbidden values"
|
|
1515
1553
|
), { value: null, unresolvedReference: !1 };
|
|
1516
|
-
const a =
|
|
1517
|
-
i
|
|
1518
|
-
);
|
|
1554
|
+
const a = r.referencesBuiltins;
|
|
1519
1555
|
a && this.BUILTIN_NAMESPACE in t && g.warn(
|
|
1520
1556
|
"[Haori]",
|
|
1521
1557
|
`Binding key "${this.BUILTIN_NAMESPACE}" is reserved for built-in helpers; the bound value is ignored in expressions.`
|
|
1522
1558
|
);
|
|
1523
1559
|
const o = {};
|
|
1524
|
-
for (const
|
|
1525
|
-
this.FORBIDDEN_BINDING_NAMES.has(
|
|
1560
|
+
for (const y of Object.keys(t))
|
|
1561
|
+
this.FORBIDDEN_BINDING_NAMES.has(y) || (o[y] = t[y]);
|
|
1526
1562
|
a && (n ? o[this.BUILTIN_NAMESPACE] = {
|
|
1527
1563
|
...this.BUILTIN_HELPERS,
|
|
1528
1564
|
[this.BUILTIN_DATA_PROPERTY]: { ...o }
|
|
1529
1565
|
} : o[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(o), q.isEnabled() && this.recordSuppliedIdentifiers(o);
|
|
1530
|
-
const l =
|
|
1531
|
-
(
|
|
1566
|
+
const l = r.allowMissingIdentifierRecovery, u = this.extractFreeIdentifiers(e).filter(
|
|
1567
|
+
(y) => !(y in o) && // 禁止グローバルは buildAssignments が `const` で遮蔽するため対象外
|
|
1532
1568
|
// (二重宣言は構文エラーになる)。
|
|
1533
|
-
!this.FORBIDDEN_NAMES.includes(
|
|
1534
|
-
!this.ALLOWED_GLOBAL_IDENTIFIERS.has(
|
|
1569
|
+
!this.FORBIDDEN_NAMES.includes(y) && // 標準組み込み(`Math` など)は式から参照できる仕様のため遮蔽しない。
|
|
1570
|
+
!this.ALLOWED_GLOBAL_IDENTIFIERS.has(y)
|
|
1535
1571
|
);
|
|
1536
1572
|
let f = null;
|
|
1537
1573
|
if (q.isEnabled()) {
|
|
1538
|
-
const
|
|
1539
|
-
f =
|
|
1574
|
+
const y = this.extractBoundIdentifiers(e);
|
|
1575
|
+
f = y.size === 0 ? u : u.filter((E) => !y.has(E));
|
|
1540
1576
|
}
|
|
1541
1577
|
const m = this.evaluateWithShadowing(
|
|
1542
1578
|
e,
|
|
@@ -1548,7 +1584,7 @@ ${t}`;
|
|
|
1548
1584
|
typeof m.value == "boolean" ? (
|
|
1549
1585
|
// 判定する式として結論が出た評価では、予約キーが無いのは正常
|
|
1550
1586
|
// (注入より前の状態)なので報告しない(仕様「未解決参照の診断」)。
|
|
1551
|
-
f.filter((
|
|
1587
|
+
f.filter((y) => !this.isReservedBindingKey(y))
|
|
1552
1588
|
) : f,
|
|
1553
1589
|
e
|
|
1554
1590
|
), m;
|
|
@@ -1577,19 +1613,13 @@ ${t}`;
|
|
|
1577
1613
|
if (a.compileFailed || a.evaluator === null)
|
|
1578
1614
|
return { value: null, unresolvedReference: !1 };
|
|
1579
1615
|
try {
|
|
1580
|
-
const o =
|
|
1581
|
-
|
|
1582
|
-
o
|
|
1583
|
-
});
|
|
1584
|
-
const u = this.withBlockedPropertyAccess(
|
|
1585
|
-
() => a.evaluator.call(this.BUILTIN_HOLDER, ...o)
|
|
1586
|
-
);
|
|
1587
|
-
return u === void 0 && this.warnBlockedIdentifiers(e), {
|
|
1588
|
-
value: u,
|
|
1616
|
+
const o = this.runEvaluator(e, a, t);
|
|
1617
|
+
return o === void 0 && this.warnBlockedIdentifiers(e), {
|
|
1618
|
+
value: o,
|
|
1589
1619
|
// `undefined` になる参照は「値が無い」状態であり、未解決参照として扱う。
|
|
1590
1620
|
// 暗黙のオプショナルチェーンにより、`null` / `undefined` を経由した
|
|
1591
1621
|
// メンバーアクセスもここへ集約される。
|
|
1592
|
-
unresolvedReference:
|
|
1622
|
+
unresolvedReference: o === void 0
|
|
1593
1623
|
};
|
|
1594
1624
|
} catch (o) {
|
|
1595
1625
|
if (i && o instanceof ReferenceError) {
|
|
@@ -1620,6 +1650,78 @@ ${t}`;
|
|
|
1620
1650
|
t
|
|
1621
1651
|
), { value: void 0, unresolvedReference: !0 };
|
|
1622
1652
|
}
|
|
1653
|
+
/**
|
|
1654
|
+
* 式の文字列だけで決まる判定を返します(式ごとに一度だけ求めて控えます)。
|
|
1655
|
+
*
|
|
1656
|
+
* @param expression 評価する式
|
|
1657
|
+
* @returns 式の判定
|
|
1658
|
+
*/
|
|
1659
|
+
static getExpressionProfile(e) {
|
|
1660
|
+
const t = this.PROFILE_CACHE.get(e);
|
|
1661
|
+
if (t !== void 0)
|
|
1662
|
+
return t;
|
|
1663
|
+
const r = e.replace(
|
|
1664
|
+
/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,
|
|
1665
|
+
""
|
|
1666
|
+
), i = {
|
|
1667
|
+
dangerous: this.containsDangerousPatterns(e),
|
|
1668
|
+
referencesBuiltins: this.BUILTIN_REFERENCE_PATTERN.test(
|
|
1669
|
+
r
|
|
1670
|
+
),
|
|
1671
|
+
referencesBuiltinData: this.BUILTIN_DATA_REFERENCE_PATTERN.test(
|
|
1672
|
+
r
|
|
1673
|
+
),
|
|
1674
|
+
allowMissingIdentifierRecovery: this.canAttemptMissingIdentifierRecovery(e),
|
|
1675
|
+
needsPropertyBlocking: this.needsPropertyBlocking(e),
|
|
1676
|
+
parameterCandidates: [...new Set(this.getReferencedNames(e))]
|
|
1677
|
+
};
|
|
1678
|
+
return this.PROFILE_CACHE.set(e, i), i;
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* 評価中に prototype 系プロパティの生アクセスを遮断する必要がある式かを返します。
|
|
1682
|
+
*
|
|
1683
|
+
* 遮断(`withBlockedPropertyAccess()`)が守るのは、式の外のコード(標準組み込みの
|
|
1684
|
+
* メソッドなど)が評価中に `constructor` や `__proto__` を読む経路です。式に書いた
|
|
1685
|
+
* メンバーアクセスは、構文の検証・Proxy・計算プロパティ名の検査が遮断します。
|
|
1686
|
+
* 式の外のコードが `constructor` などを読むのは、`map` などの標準組み込みの
|
|
1687
|
+
* メソッドを呼んだときです(`new` とテンプレートリテラルは書けません)。
|
|
1688
|
+
* スプレッドも反復のメソッドを呼ぶため含めます。どちらも無い式は遮断しても
|
|
1689
|
+
* 結果が変わらないため、評価のたびに `Object.prototype` と `Function.prototype`
|
|
1690
|
+
* を書き換えません。
|
|
1691
|
+
*
|
|
1692
|
+
* 呼び出しは、`(` の直前が識別子・`)`・`]`・`?.` のときとみなします。
|
|
1693
|
+
* `startsCall()` と違い `undefined` などの直後も呼び出しに数えます(同名の
|
|
1694
|
+
* バインドキーに関数を渡せるためです)。
|
|
1695
|
+
*
|
|
1696
|
+
* 字句に分けられない式は `false` を返しますが、そうした式は許可構文の検証
|
|
1697
|
+
* (`hasAllowedSyntax()`)で拒否されるため評価されません。
|
|
1698
|
+
*
|
|
1699
|
+
* @param expression 評価する式
|
|
1700
|
+
* @returns 遮断が必要であれば true
|
|
1701
|
+
*/
|
|
1702
|
+
static needsPropertyBlocking(e) {
|
|
1703
|
+
let t = null;
|
|
1704
|
+
for (const r of this.tokenizeExpression(e) ?? []) {
|
|
1705
|
+
if (r.value === "..." || r.value === "(" && t !== null && (t.type === "identifier" || [")", "]", "?."].includes(t.value)))
|
|
1706
|
+
return !0;
|
|
1707
|
+
t = r;
|
|
1708
|
+
}
|
|
1709
|
+
return !1;
|
|
1710
|
+
}
|
|
1711
|
+
/**
|
|
1712
|
+
* 引数の値を Proxy でラップし、評価関数を実行します。
|
|
1713
|
+
*
|
|
1714
|
+
* @param expression 評価する式
|
|
1715
|
+
* @param setup 評価関数の準備結果(評価関数があること)
|
|
1716
|
+
* @param bindings 評価に用いるバインド値
|
|
1717
|
+
* @returns 評価結果
|
|
1718
|
+
*/
|
|
1719
|
+
static runEvaluator(e, t, r) {
|
|
1720
|
+
const i = /* @__PURE__ */ new WeakMap(), n = t.bindKeys.map(
|
|
1721
|
+
(a) => this.wrapBoundValue(r[a], i)
|
|
1722
|
+
), s = () => t.evaluator.call(this.BUILTIN_HOLDER, ...n);
|
|
1723
|
+
return this.getExpressionProfile(e).needsPropertyBlocking ? this.withBlockedPropertyAccess(s) : s();
|
|
1724
|
+
}
|
|
1623
1725
|
/**
|
|
1624
1726
|
* 現在のバインド集合で evaluator を取得または生成します。
|
|
1625
1727
|
*
|
|
@@ -1629,40 +1731,42 @@ ${t}`;
|
|
|
1629
1731
|
* @returns evaluator 準備結果
|
|
1630
1732
|
*/
|
|
1631
1733
|
static prepareEvaluator(e, t, r = []) {
|
|
1632
|
-
const i =
|
|
1633
|
-
|
|
1634
|
-
)
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1734
|
+
const i = this.getExpressionProfile(
|
|
1735
|
+
e
|
|
1736
|
+
).parameterCandidates.filter(
|
|
1737
|
+
(E) => Object.prototype.propertyIsEnumerable.call(t, E) && !this.FORBIDDEN_BINDING_NAMES.has(E)
|
|
1738
|
+
);
|
|
1739
|
+
q.isEnabled() && this.reportUnusableBindingKeys(
|
|
1740
|
+
Object.keys(t).filter((E) => !this.isUsableBindingKey(E))
|
|
1741
|
+
);
|
|
1742
|
+
const n = new Set(i), s = r.filter((E) => !n.has(E)), a = `${e}:${i.join(",")}:${s.join(
|
|
1639
1743
|
","
|
|
1640
1744
|
)}`;
|
|
1641
|
-
let
|
|
1642
|
-
if (
|
|
1745
|
+
let o = this.EXPRESSION_CACHE.get(a) || null;
|
|
1746
|
+
if (o !== null)
|
|
1643
1747
|
return this.compileFailedExpressions.delete(e), {
|
|
1644
|
-
bindKeys:
|
|
1645
|
-
evaluator:
|
|
1748
|
+
bindKeys: i,
|
|
1749
|
+
evaluator: o,
|
|
1646
1750
|
compileFailed: !1
|
|
1647
1751
|
};
|
|
1648
|
-
const
|
|
1752
|
+
const l = this.buildAssignments(i), u = this.buildBuiltinConstants(e, n), f = this.buildShadowDeclarations(s), m = this.toGuardedMemberExpression(
|
|
1649
1753
|
this.toOptionalChainExpression(e)
|
|
1650
|
-
),
|
|
1651
|
-
${
|
|
1652
|
-
${
|
|
1754
|
+
), y = `"use strict";
|
|
1755
|
+
${l};
|
|
1756
|
+
${u}return (${m});` + f;
|
|
1653
1757
|
try {
|
|
1654
|
-
return
|
|
1655
|
-
bindKeys:
|
|
1656
|
-
evaluator:
|
|
1758
|
+
return o = new Function(...i, y), this.EXPRESSION_CACHE.set(a, o), this.compileFailedExpressions.delete(e), {
|
|
1759
|
+
bindKeys: i,
|
|
1760
|
+
evaluator: o,
|
|
1657
1761
|
compileFailed: !1
|
|
1658
1762
|
};
|
|
1659
|
-
} catch (
|
|
1660
|
-
return
|
|
1763
|
+
} catch (E) {
|
|
1764
|
+
return s.length > 0 ? (g.warn(
|
|
1661
1765
|
"[Haori]",
|
|
1662
|
-
"Failed to shadow undeclared identifier(s): " +
|
|
1766
|
+
"Failed to shadow undeclared identifier(s): " + s.join(", ") + ". Falling back to evaluation without shadowing.",
|
|
1663
1767
|
e
|
|
1664
|
-
), this.prepareEvaluator(e, t, [])) : (g.error("[Haori]", "Failed to compile expression:", e,
|
|
1665
|
-
bindKeys:
|
|
1768
|
+
), this.prepareEvaluator(e, t, [])) : (g.error("[Haori]", "Failed to compile expression:", e, E), this.compileFailedExpressions.add(e), {
|
|
1769
|
+
bindKeys: i,
|
|
1666
1770
|
evaluator: null,
|
|
1667
1771
|
compileFailed: !0
|
|
1668
1772
|
});
|
|
@@ -1823,20 +1927,20 @@ ${m}return (${E});` + b;
|
|
|
1823
1927
|
* @returns 食い違っている場合は両辺の型。該当しない場合は null
|
|
1824
1928
|
*/
|
|
1825
1929
|
static diagnoseStrictComparison(e, t = {}) {
|
|
1826
|
-
const r =
|
|
1930
|
+
const r = T.splitStrictComparison(e);
|
|
1827
1931
|
if (r === null)
|
|
1828
1932
|
return null;
|
|
1829
|
-
|
|
1933
|
+
T.evaluatingForDiagnosis = !0;
|
|
1830
1934
|
let i, n;
|
|
1831
1935
|
try {
|
|
1832
|
-
i =
|
|
1936
|
+
i = T.evaluateDetailed(r.left, t), n = T.evaluateDetailed(r.right, t);
|
|
1833
1937
|
} finally {
|
|
1834
|
-
|
|
1938
|
+
T.evaluatingForDiagnosis = !1;
|
|
1835
1939
|
}
|
|
1836
1940
|
if (i.unresolvedReference || n.unresolvedReference)
|
|
1837
1941
|
return null;
|
|
1838
1942
|
const s = i.value, a = n.value;
|
|
1839
|
-
return typeof s == typeof a || !
|
|
1943
|
+
return typeof s == typeof a || !T.isLooselyEqual(s, a) ? null : { left: typeof s, right: typeof a };
|
|
1840
1944
|
}
|
|
1841
1945
|
/**
|
|
1842
1946
|
* 型をまたいだ緩い比較(`==`)を行います。
|
|
@@ -1863,11 +1967,11 @@ ${m}return (${E});` + b;
|
|
|
1863
1967
|
* @returns 左辺と右辺。単一の厳密比較でない場合は null
|
|
1864
1968
|
*/
|
|
1865
1969
|
static splitStrictComparison(e) {
|
|
1866
|
-
const t =
|
|
1970
|
+
const t = T.strictComparisonSplits.get(e);
|
|
1867
1971
|
if (t !== void 0)
|
|
1868
1972
|
return t;
|
|
1869
|
-
const r =
|
|
1870
|
-
return
|
|
1973
|
+
const r = T.computeStrictComparisonSplit(e);
|
|
1974
|
+
return T.strictComparisonSplits.set(e, r), r;
|
|
1871
1975
|
}
|
|
1872
1976
|
/**
|
|
1873
1977
|
* 式を単一の厳密比較として分割します(記憶しない実体)。
|
|
@@ -1876,7 +1980,7 @@ ${m}return (${E});` + b;
|
|
|
1876
1980
|
* @returns 左辺と右辺。単一の厳密比較でない場合は null
|
|
1877
1981
|
*/
|
|
1878
1982
|
static computeStrictComparisonSplit(e) {
|
|
1879
|
-
const t =
|
|
1983
|
+
const t = T.tokenizeExpression(e);
|
|
1880
1984
|
if (t === null)
|
|
1881
1985
|
return null;
|
|
1882
1986
|
let r = 0, i = null;
|
|
@@ -1892,7 +1996,7 @@ ${m}return (${E});` + b;
|
|
|
1892
1996
|
}
|
|
1893
1997
|
if (r === 0) {
|
|
1894
1998
|
if (a.value === "&&")
|
|
1895
|
-
return
|
|
1999
|
+
return T.splitStrictComparison(
|
|
1896
2000
|
e.slice(0, a.position)
|
|
1897
2001
|
);
|
|
1898
2002
|
if (a.value === "===") {
|
|
@@ -1901,7 +2005,7 @@ ${m}return (${E});` + b;
|
|
|
1901
2005
|
i = a;
|
|
1902
2006
|
continue;
|
|
1903
2007
|
}
|
|
1904
|
-
if (
|
|
2008
|
+
if (T.COMPOSING_OPERATORS.has(a.value))
|
|
1905
2009
|
return null;
|
|
1906
2010
|
}
|
|
1907
2011
|
}
|
|
@@ -2200,18 +2304,6 @@ ${m}return (${E});` + b;
|
|
|
2200
2304
|
}
|
|
2201
2305
|
});
|
|
2202
2306
|
}
|
|
2203
|
-
/**
|
|
2204
|
-
* バインド値を安全なProxyでラップします。
|
|
2205
|
-
*
|
|
2206
|
-
* @param bindedValues バインド値
|
|
2207
|
-
* @returns ラップ済みのバインド値
|
|
2208
|
-
*/
|
|
2209
|
-
static wrapBoundValues(e) {
|
|
2210
|
-
const t = /* @__PURE__ */ new WeakMap(), r = {};
|
|
2211
|
-
return Object.entries(e).forEach(([i, n]) => {
|
|
2212
|
-
r[i] = this.wrapBoundValue(n, t);
|
|
2213
|
-
}), r;
|
|
2214
|
-
}
|
|
2215
2307
|
/**
|
|
2216
2308
|
* 危険なプロパティアクセスを防ぐために値を再帰的にラップします。
|
|
2217
2309
|
*
|
|
@@ -2444,9 +2536,9 @@ ${m}return (${E});` + b;
|
|
|
2444
2536
|
return a.cut ? (i && (i.cut = !0), !1) : (this.forbiddenBindingValueCache.set(e, !1), !1);
|
|
2445
2537
|
}
|
|
2446
2538
|
};
|
|
2447
|
-
|
|
2539
|
+
T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HELPERS = {
|
|
2448
2540
|
...Ct
|
|
2449
|
-
},
|
|
2541
|
+
}, T.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, T.BUILTIN_DATA_PROPERTY = "data", T.BUILTIN_DATA_REFERENCE_PATTERN = /(^|[^\w$.])haori\s*(\.\s*data(?![\w$])|\[)/, T.IDENTIFIER_NAME_PATTERN = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u, T.usableBindingKeyCache = /* @__PURE__ */ new Map(), T.loggedUnusableBindingKeys = /* @__PURE__ */ new Set(), T.compileFailedExpressions = /* @__PURE__ */ new Set(), T.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), T.forbiddenBindingValueSet = null, T.forbiddenBindingValueCacheResetScheduled = !1, T.loggedForbiddenKeySignatures = /* @__PURE__ */ new Set(), T.loggedForbiddenKeyResetScheduled = !1, T.FORBIDDEN_NAMES = [
|
|
2450
2542
|
// グローバルオブジェクト
|
|
2451
2543
|
"window",
|
|
2452
2544
|
"self",
|
|
@@ -2478,7 +2570,7 @@ D.MAX_IDENTIFIER_RECOVERY_COUNT = 8, D.BUILTIN_NAMESPACE = "haori", D.BUILTIN_HE
|
|
|
2478
2570
|
"sessionStorage",
|
|
2479
2571
|
"IndexedDB",
|
|
2480
2572
|
"history"
|
|
2481
|
-
],
|
|
2573
|
+
], T.STRICT_FORBIDDEN_NAMES = ["eval", "arguments"], T.REBINDABLE_FORBIDDEN_NAMES = /* @__PURE__ */ new Set([
|
|
2482
2574
|
"location",
|
|
2483
2575
|
"history",
|
|
2484
2576
|
"document",
|
|
@@ -2486,23 +2578,23 @@ D.MAX_IDENTIFIER_RECOVERY_COUNT = 8, D.BUILTIN_NAMESPACE = "haori", D.BUILTIN_HE
|
|
|
2486
2578
|
"localStorage",
|
|
2487
2579
|
"sessionStorage",
|
|
2488
2580
|
"IndexedDB"
|
|
2489
|
-
]),
|
|
2490
|
-
...
|
|
2491
|
-
(e) => !
|
|
2581
|
+
]), T.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
|
|
2582
|
+
...T.FORBIDDEN_NAMES.filter(
|
|
2583
|
+
(e) => !T.REBINDABLE_FORBIDDEN_NAMES.has(e)
|
|
2492
2584
|
),
|
|
2493
2585
|
"constructor",
|
|
2494
2586
|
"__proto__",
|
|
2495
2587
|
"prototype",
|
|
2496
|
-
...
|
|
2497
|
-
]),
|
|
2588
|
+
...T.STRICT_FORBIDDEN_NAMES
|
|
2589
|
+
]), T.FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
|
|
2498
2590
|
"constructor",
|
|
2499
2591
|
"__proto__",
|
|
2500
2592
|
"prototype"
|
|
2501
|
-
]),
|
|
2593
|
+
]), T.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
|
|
2502
2594
|
"get",
|
|
2503
2595
|
"set",
|
|
2504
2596
|
"async"
|
|
2505
|
-
]),
|
|
2597
|
+
]), T.DISALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
|
|
2506
2598
|
"await",
|
|
2507
2599
|
"break",
|
|
2508
2600
|
"case",
|
|
@@ -2536,7 +2628,7 @@ D.MAX_IDENTIFIER_RECOVERY_COUNT = 8, D.BUILTIN_NAMESPACE = "haori", D.BUILTIN_HE
|
|
|
2536
2628
|
"while",
|
|
2537
2629
|
"with",
|
|
2538
2630
|
"yield"
|
|
2539
|
-
]),
|
|
2631
|
+
]), T.NON_SHADOWABLE_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
2540
2632
|
// リテラル・グローバル定数
|
|
2541
2633
|
"true",
|
|
2542
2634
|
"false",
|
|
@@ -2554,7 +2646,7 @@ D.MAX_IDENTIFIER_RECOVERY_COUNT = 8, D.BUILTIN_NAMESPACE = "haori", D.BUILTIN_HE
|
|
|
2554
2646
|
"public",
|
|
2555
2647
|
"static",
|
|
2556
2648
|
"super"
|
|
2557
|
-
]),
|
|
2649
|
+
]), T.ALLOWED_GLOBAL_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
2558
2650
|
// 名前空間オブジェクト
|
|
2559
2651
|
"Math",
|
|
2560
2652
|
"JSON",
|
|
@@ -2610,11 +2702,11 @@ D.MAX_IDENTIFIER_RECOVERY_COUNT = 8, D.BUILTIN_NAMESPACE = "haori", D.BUILTIN_HE
|
|
|
2610
2702
|
"encodeURIComponent",
|
|
2611
2703
|
"decodeURI",
|
|
2612
2704
|
"decodeURIComponent"
|
|
2613
|
-
]),
|
|
2705
|
+
]), T.BUILTIN_HOLDER = Object.freeze(
|
|
2614
2706
|
Object.defineProperties(
|
|
2615
2707
|
{},
|
|
2616
2708
|
Object.fromEntries(
|
|
2617
|
-
[...
|
|
2709
|
+
[...T.ALLOWED_GLOBAL_IDENTIFIERS].map((e) => [
|
|
2618
2710
|
e,
|
|
2619
2711
|
{
|
|
2620
2712
|
get: () => globalThis[e],
|
|
@@ -2623,10 +2715,10 @@ D.MAX_IDENTIFIER_RECOVERY_COUNT = 8, D.BUILTIN_NAMESPACE = "haori", D.BUILTIN_HE
|
|
|
2623
2715
|
])
|
|
2624
2716
|
)
|
|
2625
2717
|
)
|
|
2626
|
-
),
|
|
2718
|
+
), T.EXPRESSION_CACHE = /* @__PURE__ */ new Map(), T.FREE_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), T.ALLOWED_SYNTAX_CACHE = /* @__PURE__ */ new Map(), T.REFERENCED_NAME_CACHE = /* @__PURE__ */ new Map(), T.PROFILE_CACHE = /* @__PURE__ */ new Map(), T.BOUND_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), T.OPTIONAL_CHAIN_CACHE = /* @__PURE__ */ new Map(), T.GUARDED_MEMBER_CACHE = /* @__PURE__ */ new Map(), T.MEMBER_KEY_GUARD_OPEN = "(_hk=>(_hk=typeof _hk==='symbol'?_hk:`${_hk}`)==='constructor'||_hk==='__proto__'||_hk==='prototype'?undefined:_hk)(", T.FORBIDDEN_NAME_PATTERNS = T.FORBIDDEN_NAMES.map((e) => ({
|
|
2627
2719
|
name: e,
|
|
2628
2720
|
pattern: new RegExp(`(^|[^\\w$.])${e}(?![\\w$])`)
|
|
2629
|
-
})),
|
|
2721
|
+
})), T.FORBIDDEN_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), T.pendingUnresolvedIdentifiers = /* @__PURE__ */ new Set(), T.evaluatingForDiagnosis = !1, T.unresolvedReportScheduled = !1, T.suppliedIdentifiers = /* @__PURE__ */ new Set(), T.pendingScopeMissingIdentifiers = /* @__PURE__ */ new Map(), T.scopeMissingReportScheduled = !1, T.rowScopeIdentifiers = /* @__PURE__ */ new Set(), T.loggedScopeMissingIdentifiers = /* @__PURE__ */ new Set(), T.loggedBlockedIdentifierExpressions = /* @__PURE__ */ new Set(), T.COMPOSING_OPERATORS = /* @__PURE__ */ new Set([
|
|
2630
2722
|
"||",
|
|
2631
2723
|
"?",
|
|
2632
2724
|
":",
|
|
@@ -2645,8 +2737,8 @@ D.MAX_IDENTIFIER_RECOVERY_COUNT = 8, D.BUILTIN_NAMESPACE = "haori", D.BUILTIN_HE
|
|
|
2645
2737
|
"/",
|
|
2646
2738
|
"%",
|
|
2647
2739
|
"..."
|
|
2648
|
-
]),
|
|
2649
|
-
let ie =
|
|
2740
|
+
]), T.strictComparisonSplits = /* @__PURE__ */ new Map(), T.WRAPPED_VALUES = /* @__PURE__ */ new WeakSet();
|
|
2741
|
+
let ie = T;
|
|
2650
2742
|
class De {
|
|
2651
2743
|
/**
|
|
2652
2744
|
* URLのクエリパラメータを取得します。
|
|
@@ -3091,7 +3183,7 @@ const ue = class ue {
|
|
|
3091
3183
|
let t;
|
|
3092
3184
|
switch (e.nodeType) {
|
|
3093
3185
|
case Node.ELEMENT_NODE:
|
|
3094
|
-
t = new
|
|
3186
|
+
t = new w(e);
|
|
3095
3187
|
break;
|
|
3096
3188
|
case Node.TEXT_NODE:
|
|
3097
3189
|
t = new ne(e);
|
|
@@ -4831,13 +4923,13 @@ const v = class v extends N {
|
|
|
4831
4923
|
element: l,
|
|
4832
4924
|
rawName: e,
|
|
4833
4925
|
template: r
|
|
4834
|
-
}), f = o.isEvaluate || o.isRawEvaluate, m = e === t && v.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()),
|
|
4926
|
+
}), f = o.isEvaluate || o.isRawEvaluate, m = e === t && v.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), E = de.joinEvaluateResults(u.results), A = u.results.length === 1 ? u.results[0] : E, D = t === "value" && v.resolveDeclaredValueType(l) === "boolean", C = A === !1 && !D, P = !o.isForceEvaluation() && (t !== e ? u.hasUnresolvedReference || A === null || A === void 0 || C : m ? u.hasUnresolvedReference || A === null || A === void 0 || A === !1 : y ? u.hasUnresolvedReference || A === null || A === void 0 || C : f && E === "");
|
|
4835
4927
|
if (P && u.hasUnresolvedReference && v.warnUnresolvedAttribute(
|
|
4836
4928
|
e,
|
|
4837
4929
|
t,
|
|
4838
4930
|
r,
|
|
4839
4931
|
l
|
|
4840
|
-
), q.isEnabled() && A === !1 &&
|
|
4932
|
+
), q.isEnabled() && A === !1 && y) {
|
|
4841
4933
|
const le = o.getSingleExpression(), he = le === null ? null : ie.diagnoseStrictComparison(
|
|
4842
4934
|
le,
|
|
4843
4935
|
this.getBindingData()
|
|
@@ -4849,31 +4941,31 @@ const v = class v extends N {
|
|
|
4849
4941
|
l
|
|
4850
4942
|
);
|
|
4851
4943
|
}
|
|
4852
|
-
const ee = o.isForceEvaluation() ? r :
|
|
4944
|
+
const ee = o.isForceEvaluation() ? r : y ? A : E, x = i && o.isEvaluate && t === "value" && v.isValuePropertyTarget(l), Y = l.getRootNode(), Q = this.userEditSequence, X = x && v.isUserEditableValue(l) && (l === Y.activeElement || this.hasPendingUserEdit()), j = P || ee === null || ee === !1 && !D ? null : String(ee), se = o.isEvaluate && j !== null && v.URL_ATTRIBUTES.has(t) && De.hasScriptScheme(j);
|
|
4853
4945
|
se && g.warn(
|
|
4854
4946
|
"[Haori]",
|
|
4855
4947
|
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${j}`,
|
|
4856
4948
|
l
|
|
4857
4949
|
);
|
|
4858
|
-
const
|
|
4859
|
-
if (!$ && !K && !
|
|
4950
|
+
const R = se ? null : j, $ = e !== t && l.getAttribute(e) !== r, K = R === null ? l.hasAttribute(t) : l.getAttribute(t) !== R, _ = R === null ? "" : R, be = x && !X && l.value !== _, oe = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), H = t === "selected" && l instanceof HTMLOptionElement, G = Y.activeElement, Z = G !== null && (oe && l === G || H && l.closest("select") === G) || (oe || H) && this.hasPendingCheckableUserEdit(H), Ie = this.getCheckableUserEditSequence(H), xe = R !== null, Ve = oe && o.isEvaluate && !Z && l.checked !== xe, Ce = H && o.isEvaluate && !Z && l.selected !== xe;
|
|
4951
|
+
if (!$ && !K && !be && !Ve && !Ce)
|
|
4860
4952
|
return x && !X && (this.value = this.normalizeValueForElement(
|
|
4861
4953
|
l,
|
|
4862
4954
|
_
|
|
4863
|
-
), this.clearUnappliedValueWrite()), (oe ||
|
|
4955
|
+
), this.clearUnappliedValueWrite()), (oe || H) && !Z && this.syncCheckableValueFromDom(H), Promise.resolve();
|
|
4864
4956
|
const Xe = z.enqueue(() => {
|
|
4865
|
-
const le = this.getCheckableUserEditSequence(
|
|
4957
|
+
const le = this.getCheckableUserEditSequence(H) !== Ie, he = H && (Z || le) ? v.captureSelection(
|
|
4866
4958
|
// 守るべき選択があるのは所属する `<select>` があるときだけ。
|
|
4867
4959
|
l.closest(
|
|
4868
4960
|
"select"
|
|
4869
4961
|
)
|
|
4870
4962
|
) : null;
|
|
4871
|
-
$ && l.setAttribute(e, r),
|
|
4963
|
+
$ && l.setAttribute(e, r), R === null ? l.removeAttribute(t) : K && (l.setAttribute(t, R), t === `${c.prefix}bind` && this.recordSelfWrittenBind(R)), t === "style" && this.captureAndHideDisplay(), he?.(), x && !X && !(v.isUserEditableValue(l) && this.isSupersededByUserEdit(Q)) && (this.value = this.normalizeValueForElement(
|
|
4872
4964
|
l,
|
|
4873
4965
|
_
|
|
4874
|
-
),
|
|
4875
|
-
const
|
|
4876
|
-
|
|
4966
|
+
), be && (l.value = _), this.recordValueWriteResult(l.value === _));
|
|
4967
|
+
const wt = Ve && !le, Rt = Ce && !le;
|
|
4968
|
+
wt && (l.checked = xe), Rt && (l.selected = xe), (Ve || Ce) && this.syncCheckableValueFromDom(Ce);
|
|
4877
4969
|
}).finally(() => {
|
|
4878
4970
|
this.releaseSelfWritingAttributes(s);
|
|
4879
4971
|
});
|
|
@@ -5372,7 +5464,7 @@ v.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, v.VALUE
|
|
|
5372
5464
|
"time",
|
|
5373
5465
|
"week"
|
|
5374
5466
|
], v.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), v.sequenceCounter = 0, v.bindingWorkActiveCount = 0, v.pendingMutationFlusher = null, v.loggedUnresolvedAttributes = /* @__PURE__ */ new Set(), v.loggedTypeMismatchedComparisons = /* @__PURE__ */ new Set();
|
|
5375
|
-
let
|
|
5467
|
+
let w = v;
|
|
5376
5468
|
class ne extends N {
|
|
5377
5469
|
/**
|
|
5378
5470
|
* テキストフラグメントのコンストラクタ。
|
|
@@ -5796,7 +5888,7 @@ const J = class J extends de {
|
|
|
5796
5888
|
};
|
|
5797
5889
|
J.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], J.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], J.forceEvaluationNames = null, J.forceEvaluationPrefix = null, J.WARNED_EVENT_HANDLER_PLACEHOLDERS = /* @__PURE__ */ new Set(), J.WARNED_URL_PATH_VALUES = /* @__PURE__ */ new Set();
|
|
5798
5890
|
let Oe = J;
|
|
5799
|
-
const
|
|
5891
|
+
const Se = class Se {
|
|
5800
5892
|
/**
|
|
5801
5893
|
* 実行モードを取得します。
|
|
5802
5894
|
*
|
|
@@ -5872,7 +5964,7 @@ const we = class we {
|
|
|
5872
5964
|
*/
|
|
5873
5965
|
static openDialog(e) {
|
|
5874
5966
|
return z.enqueue(() => {
|
|
5875
|
-
e instanceof HTMLDialogElement ? (
|
|
5967
|
+
e instanceof HTMLDialogElement ? (Se.clearMessagesSync(e), e.showModal()) : g.error("[Haori]", "Element is not a dialog: ", e);
|
|
5876
5968
|
}, !0);
|
|
5877
5969
|
}
|
|
5878
5970
|
/**
|
|
@@ -5892,7 +5984,7 @@ const we = class we {
|
|
|
5892
5984
|
* @param message エラーメッセージ
|
|
5893
5985
|
*/
|
|
5894
5986
|
static addErrorMessage(e, t) {
|
|
5895
|
-
return
|
|
5987
|
+
return Se.addMessage(e, t, "error");
|
|
5896
5988
|
}
|
|
5897
5989
|
/**
|
|
5898
5990
|
* メッセージをレベル付きで追加します。
|
|
@@ -5917,7 +6009,7 @@ const we = class we {
|
|
|
5917
6009
|
*/
|
|
5918
6010
|
static clearMessages(e) {
|
|
5919
6011
|
return z.enqueue(() => {
|
|
5920
|
-
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")),
|
|
6012
|
+
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")), Se.clearMessagesSync(e);
|
|
5921
6013
|
}, !0);
|
|
5922
6014
|
}
|
|
5923
6015
|
/**
|
|
@@ -5944,7 +6036,7 @@ const we = class we {
|
|
|
5944
6036
|
* @returns 整形済み文字列。整形できない場合は空文字
|
|
5945
6037
|
*/
|
|
5946
6038
|
static date(e, t, r) {
|
|
5947
|
-
return
|
|
6039
|
+
return He(e, t, r);
|
|
5948
6040
|
}
|
|
5949
6041
|
/**
|
|
5950
6042
|
* 現在日時を指定フォーマットの文字列へ整形します。
|
|
@@ -6021,7 +6113,7 @@ const we = class we {
|
|
|
6021
6113
|
* @returns 加算後の年月(`YYYY-MM` 形式)。不正な入力は空文字
|
|
6022
6114
|
*/
|
|
6023
6115
|
static monthAdd(e, t) {
|
|
6024
|
-
return
|
|
6116
|
+
return Ue(e, t);
|
|
6025
6117
|
}
|
|
6026
6118
|
/**
|
|
6027
6119
|
* 基準月から過去方向へ `count + 1` 個の年月配列を降順で返します。
|
|
@@ -6085,7 +6177,7 @@ const we = class we {
|
|
|
6085
6177
|
* @returns 重複排除後の新しい配列。非配列は空配列
|
|
6086
6178
|
*/
|
|
6087
6179
|
static distinct(e, t) {
|
|
6088
|
-
return
|
|
6180
|
+
return bt(e, t);
|
|
6089
6181
|
}
|
|
6090
6182
|
/**
|
|
6091
6183
|
* 配列を `item[key]` ごとのグループへ分けて返します。
|
|
@@ -6101,7 +6193,7 @@ const we = class we {
|
|
|
6101
6193
|
return Et(e, t);
|
|
6102
6194
|
}
|
|
6103
6195
|
};
|
|
6104
|
-
|
|
6196
|
+
Se.enhancers = {
|
|
6105
6197
|
/**
|
|
6106
6198
|
* 外部ライブラリ連携を登録します。
|
|
6107
6199
|
*
|
|
@@ -6122,7 +6214,7 @@ we.enhancers = {
|
|
|
6122
6214
|
return re.has(e);
|
|
6123
6215
|
}
|
|
6124
6216
|
};
|
|
6125
|
-
let Re =
|
|
6217
|
+
let Re = Se;
|
|
6126
6218
|
const Mt = "入力内容を確認してください", $t = ["addErrorMessage", "clearMessages"], _e = "data-haori-group-name";
|
|
6127
6219
|
function et() {
|
|
6128
6220
|
const e = globalThis.window?.Haori;
|
|
@@ -6376,7 +6468,7 @@ const h = class h {
|
|
|
6376
6468
|
if (t instanceof HTMLSelectElement) {
|
|
6377
6469
|
for (const r of Array.from(t.options)) {
|
|
6378
6470
|
const i = N.get(r);
|
|
6379
|
-
if (i instanceof
|
|
6471
|
+
if (i instanceof w && h.hasDeclarativeBinding(i, "selected") && !h.isDeclarationResolved(i, "selected"))
|
|
6380
6472
|
return !1;
|
|
6381
6473
|
}
|
|
6382
6474
|
return !0;
|
|
@@ -6419,7 +6511,7 @@ const h = class h {
|
|
|
6419
6511
|
*/
|
|
6420
6512
|
static isDeclarativeStateBound(e) {
|
|
6421
6513
|
const t = e.getTarget();
|
|
6422
|
-
return t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ? h.hasDeclarativeBinding(e, "checked") :
|
|
6514
|
+
return t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ? h.hasDeclarativeBinding(e, "checked") : w.isValuePropertyTarget(t) ? h.hasDeclarativeBinding(e, "value") ? !0 : t instanceof HTMLSelectElement ? h.hasDeclarativeSelectedOption(t) : !1 : !1;
|
|
6423
6515
|
}
|
|
6424
6516
|
/**
|
|
6425
6517
|
* 対象の部分木にある入力欄を、ネイティブのフォームリセットと同じ既定値へ戻します。
|
|
@@ -6476,7 +6568,7 @@ const h = class h {
|
|
|
6476
6568
|
}), t.selectedIndex = -1) : (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) && (t.value = "");
|
|
6477
6569
|
}
|
|
6478
6570
|
e.getChildren().forEach((t) => {
|
|
6479
|
-
t instanceof
|
|
6571
|
+
t instanceof w && h.clearDeclarativeStateFromDom(t);
|
|
6480
6572
|
});
|
|
6481
6573
|
}
|
|
6482
6574
|
/**
|
|
@@ -6506,7 +6598,7 @@ const h = class h {
|
|
|
6506
6598
|
static hasDeclarativeSelectedOption(e) {
|
|
6507
6599
|
for (const t of Array.from(e.options)) {
|
|
6508
6600
|
const r = N.get(t);
|
|
6509
|
-
if (r instanceof
|
|
6601
|
+
if (r instanceof w && h.hasDeclarativeBinding(r, "selected"))
|
|
6510
6602
|
return !0;
|
|
6511
6603
|
}
|
|
6512
6604
|
return !1;
|
|
@@ -6714,8 +6806,8 @@ const h = class h {
|
|
|
6714
6806
|
const u = h.resolveCollectedValue(e), f = h.isFileInput(e) && Array.isArray(u) ? u : [u];
|
|
6715
6807
|
Array.isArray(t[String(n)]) ? t[String(n)].push(...f) : t[String(n)] = f;
|
|
6716
6808
|
} else if (h.isGroupedCheckable(e)) {
|
|
6717
|
-
const u = e.getTarget(), f = u instanceof HTMLInputElement ? u.checked : !0, m = u instanceof HTMLInputElement ? u.value : e.getValue(),
|
|
6718
|
-
|
|
6809
|
+
const u = e.getTarget(), f = u instanceof HTMLInputElement ? u.checked : !0, m = u instanceof HTMLInputElement ? u.value : e.getValue(), y = f ? m : null, E = String(n);
|
|
6810
|
+
y === null ? E in t || (t[E] = null) : t[E] === null || t[E] === void 0 ? t[E] = y : Array.isArray(t[E]) ? t[E].push(y) : t[E] = [t[E], y];
|
|
6719
6811
|
} else
|
|
6720
6812
|
t[String(n)] = h.resolveCollectedValue(e);
|
|
6721
6813
|
s && g.warn(
|
|
@@ -6740,20 +6832,20 @@ const h = class h {
|
|
|
6740
6832
|
} else if (a) {
|
|
6741
6833
|
const u = [], f = [];
|
|
6742
6834
|
let m = !1;
|
|
6743
|
-
for (const
|
|
6835
|
+
for (const y of e.getChildElementFragments()) {
|
|
6744
6836
|
const E = {}, A = i === null ? null : /* @__PURE__ */ new Set();
|
|
6745
6837
|
h.getPartValues(
|
|
6746
|
-
|
|
6838
|
+
y,
|
|
6747
6839
|
E,
|
|
6748
6840
|
r,
|
|
6749
6841
|
A
|
|
6750
|
-
), A !== null && h.registerCollectedExcludedKeys(E, A), Object.keys(E).length > 0 ? (m = !0, u.push(E), f.push(
|
|
6842
|
+
), A !== null && h.registerCollectedExcludedKeys(E, A), Object.keys(E).length > 0 ? (m = !0, u.push(E), f.push(y.getListKey())) : r !== null && (u.push({}), f.push(y.getListKey()));
|
|
6751
6843
|
}
|
|
6752
6844
|
if (r === null) {
|
|
6753
|
-
const
|
|
6845
|
+
const y = e.getAttribute(`${c.prefix}each-key`);
|
|
6754
6846
|
h.registerCollectedRowIdentity(
|
|
6755
6847
|
u,
|
|
6756
|
-
|
|
6848
|
+
y == null ? null : String(y),
|
|
6757
6849
|
f,
|
|
6758
6850
|
h.isCollectedListFromEachSource(e)
|
|
6759
6851
|
), h.warnDerivedRowsWithoutKey(e), t[String(a)] = u;
|
|
@@ -7038,7 +7130,7 @@ const h = class h {
|
|
|
7038
7130
|
m.hasAttribute(`${c.prefix}form-detach`) && (f = !0), (m.hasAttribute(n) || m.hasAttribute(s)) && (u = m), m = m.parentElement;
|
|
7039
7131
|
if (f)
|
|
7040
7132
|
return;
|
|
7041
|
-
const
|
|
7133
|
+
const y = u ?? l, E = y.getAttribute(n) || y.getAttribute(s) || y.getAttribute(`${c.prefix}form-name`) || y.getAttribute("name");
|
|
7042
7134
|
E && t.add(E);
|
|
7043
7135
|
}), t;
|
|
7044
7136
|
}
|
|
@@ -7519,7 +7611,7 @@ const h = class h {
|
|
|
7519
7611
|
const t = `${c.prefix}form-arg`, r = [];
|
|
7520
7612
|
return e.getTarget().querySelectorAll(`form:not([${t}]), [${c.prefix}form]`).forEach((i) => {
|
|
7521
7613
|
const n = N.get(i);
|
|
7522
|
-
if (!(n instanceof
|
|
7614
|
+
if (!(n instanceof w))
|
|
7523
7615
|
return;
|
|
7524
7616
|
const s = n.getRawBindingData();
|
|
7525
7617
|
if (s === null)
|
|
@@ -7549,7 +7641,7 @@ const h = class h {
|
|
|
7549
7641
|
delete n[s];
|
|
7550
7642
|
return M.setBindingData(e.getTarget(), n, {
|
|
7551
7643
|
kind: r?.kind ?? "supply",
|
|
7552
|
-
sequence: r?.sequence ??
|
|
7644
|
+
sequence: r?.sequence ?? w.nextSequence()
|
|
7553
7645
|
});
|
|
7554
7646
|
}
|
|
7555
7647
|
/**
|
|
@@ -7562,7 +7654,7 @@ const h = class h {
|
|
|
7562
7654
|
const t = `${c.prefix}form-arg`, r = e.getTarget().querySelectorAll(`form[${t}]`), i = [];
|
|
7563
7655
|
return r.forEach((n) => {
|
|
7564
7656
|
const s = N.get(n);
|
|
7565
|
-
if (!(s instanceof
|
|
7657
|
+
if (!(s instanceof w))
|
|
7566
7658
|
return;
|
|
7567
7659
|
const a = s.getAttribute(t);
|
|
7568
7660
|
a && i.push({ form: s, key: String(a) });
|
|
@@ -7635,7 +7727,7 @@ const h = class h {
|
|
|
7635
7727
|
if (h.INITIAL_RESTORED_FORMS.has(i))
|
|
7636
7728
|
continue;
|
|
7637
7729
|
const n = N.get(i);
|
|
7638
|
-
if (!(n instanceof
|
|
7730
|
+
if (!(n instanceof w))
|
|
7639
7731
|
continue;
|
|
7640
7732
|
const s = n.getRawBindingData(), a = n.getAttribute(`${c.prefix}form-arg`), o = a ? String(a) : null, l = o !== null && !(s && Object.prototype.hasOwnProperty.call(s, o)) ? h.resolveAncestorArgOwner(n, o) : null;
|
|
7641
7733
|
if (!(!s && !l)) {
|
|
@@ -7853,14 +7945,14 @@ const h = class h {
|
|
|
7853
7945
|
return Promise.resolve();
|
|
7854
7946
|
const l = h.resolveFieldName(e), u = e.getAttribute(`${c.prefix}form-object`), f = e.getAttribute(`${c.prefix}form-list`), m = e.hasAttribute(`${c.prefix}form-list`);
|
|
7855
7947
|
if (l) {
|
|
7856
|
-
const
|
|
7857
|
-
let
|
|
7858
|
-
if (E ?
|
|
7859
|
-
return (
|
|
7948
|
+
const y = t[String(l)], E = n && h.hasResolvedDeclarativeState(e), A = n && typeof y > "u" && !h.isDeclarativeStateBound(e);
|
|
7949
|
+
let D = y;
|
|
7950
|
+
if (E ? D = void 0 : A && (D = null), h.isFileInput(e))
|
|
7951
|
+
return (D === null || D === "") && o.push(
|
|
7860
7952
|
h.applyFragmentValue(e, null, i, a)
|
|
7861
7953
|
), Promise.all(o).then(() => {
|
|
7862
7954
|
});
|
|
7863
|
-
if (m && Array.isArray(
|
|
7955
|
+
if (m && Array.isArray(D) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
7864
7956
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
7865
7957
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
7866
7958
|
!h.isGroupedCheckable(e) && !h.isMultipleSelect(e)) {
|
|
@@ -7868,27 +7960,27 @@ const h = class h {
|
|
|
7868
7960
|
s.set(C, P + 1), o.push(
|
|
7869
7961
|
h.applyFragmentValue(
|
|
7870
7962
|
e,
|
|
7871
|
-
|
|
7963
|
+
D[P] ?? null,
|
|
7872
7964
|
i,
|
|
7873
7965
|
a
|
|
7874
7966
|
)
|
|
7875
7967
|
);
|
|
7876
|
-
} else typeof
|
|
7968
|
+
} else typeof D > "u" || (Array.isArray(D) && h.isGroupedCheckable(e) || Array.isArray(D) && h.isMultipleSelect(e) || typeof D == "string" || typeof D == "number" || typeof D == "boolean" || D === null || Array.isArray(D) && e.collectsLines() ? o.push(
|
|
7877
7969
|
h.applyFragmentValue(
|
|
7878
7970
|
e,
|
|
7879
|
-
|
|
7971
|
+
D,
|
|
7880
7972
|
i,
|
|
7881
7973
|
a
|
|
7882
7974
|
)
|
|
7883
7975
|
) : o.push(
|
|
7884
|
-
h.applyFragmentValue(e, String(
|
|
7976
|
+
h.applyFragmentValue(e, String(D), i, a)
|
|
7885
7977
|
));
|
|
7886
7978
|
} else if (u) {
|
|
7887
|
-
const
|
|
7888
|
-
for (const
|
|
7979
|
+
const y = t[String(u)], E = y && typeof y == "object" ? y : {}, A = /* @__PURE__ */ new Map();
|
|
7980
|
+
for (const D of e.getChildElementFragments())
|
|
7889
7981
|
o.push(
|
|
7890
7982
|
h.setPartValues(
|
|
7891
|
-
|
|
7983
|
+
D,
|
|
7892
7984
|
E,
|
|
7893
7985
|
r,
|
|
7894
7986
|
i,
|
|
@@ -7898,10 +7990,10 @@ const h = class h {
|
|
|
7898
7990
|
)
|
|
7899
7991
|
);
|
|
7900
7992
|
} else if (f) {
|
|
7901
|
-
const
|
|
7993
|
+
const y = t[String(f)], E = Array.isArray(y) ? y : [], A = e.getChildElementFragments(), D = e.getAttribute(`${c.prefix}each-key`), C = h.isCollectedListFromEachSource(e) ? h.pairRowsWithItems(
|
|
7902
7994
|
A,
|
|
7903
7995
|
E,
|
|
7904
|
-
|
|
7996
|
+
D == null ? null : String(D)
|
|
7905
7997
|
) : null;
|
|
7906
7998
|
for (let P = 0; P < A.length; P++) {
|
|
7907
7999
|
const ee = A[P], x = C ? C[P] : E.length > P ? E[P] : null;
|
|
@@ -7919,10 +8011,10 @@ const h = class h {
|
|
|
7919
8011
|
);
|
|
7920
8012
|
}
|
|
7921
8013
|
} else
|
|
7922
|
-
for (const
|
|
8014
|
+
for (const y of e.getChildElementFragments())
|
|
7923
8015
|
o.push(
|
|
7924
8016
|
h.setPartValues(
|
|
7925
|
-
|
|
8017
|
+
y,
|
|
7926
8018
|
t,
|
|
7927
8019
|
r,
|
|
7928
8020
|
i,
|
|
@@ -7949,7 +8041,7 @@ const h = class h {
|
|
|
7949
8041
|
* 番号を持つことになり、後勝ちが逆転する
|
|
7950
8042
|
* @returns すべての初期化処理が完了するPromise
|
|
7951
8043
|
*/
|
|
7952
|
-
static async reset(e, t =
|
|
8044
|
+
static async reset(e, t = w.nextSequence()) {
|
|
7953
8045
|
const r = h.collectBindingTargetForms(e);
|
|
7954
8046
|
if (r.length > 0 && r.every((n) => n.isSupplyStale(t)))
|
|
7955
8047
|
return;
|
|
@@ -8052,7 +8144,7 @@ const h = class h {
|
|
|
8052
8144
|
const i = [];
|
|
8053
8145
|
for (const n of r) {
|
|
8054
8146
|
const s = N.get(n);
|
|
8055
|
-
s instanceof
|
|
8147
|
+
s instanceof w && i.push(s);
|
|
8056
8148
|
}
|
|
8057
8149
|
return i;
|
|
8058
8150
|
}
|
|
@@ -8550,8 +8642,8 @@ const Pt = {
|
|
|
8550
8642
|
401: "unauthorized-redirect",
|
|
8551
8643
|
403: "forbidden-redirect"
|
|
8552
8644
|
};
|
|
8553
|
-
function Lt(
|
|
8554
|
-
return
|
|
8645
|
+
function Lt(b, e) {
|
|
8646
|
+
return b.replace(/\{\{([\s\S]+?)\}\}/g, (t, r) => {
|
|
8555
8647
|
try {
|
|
8556
8648
|
const i = ie.evaluate(String(r).trim(), e);
|
|
8557
8649
|
return i == null ? "" : String(i);
|
|
@@ -8560,17 +8652,17 @@ function Lt(y, e) {
|
|
|
8560
8652
|
}
|
|
8561
8653
|
});
|
|
8562
8654
|
}
|
|
8563
|
-
function Ot(
|
|
8564
|
-
const t =
|
|
8655
|
+
function Ot(b, e) {
|
|
8656
|
+
const t = b.getAttribute(e);
|
|
8565
8657
|
if (t === null || t === "")
|
|
8566
8658
|
return null;
|
|
8567
8659
|
if (!t.includes("{{"))
|
|
8568
8660
|
return t;
|
|
8569
|
-
const r = N.get(
|
|
8661
|
+
const r = N.get(b), i = r instanceof w ? r.getBindingData() : {}, n = Lt(t, i);
|
|
8570
8662
|
return n === "" ? null : n;
|
|
8571
8663
|
}
|
|
8572
|
-
function Bt(
|
|
8573
|
-
const r =
|
|
8664
|
+
function Bt(b, e, t) {
|
|
8665
|
+
const r = b.getAttribute(`${e}-return-param`);
|
|
8574
8666
|
if (r === null || r === "")
|
|
8575
8667
|
return t;
|
|
8576
8668
|
try {
|
|
@@ -8582,8 +8674,8 @@ function Bt(y, e, t) {
|
|
|
8582
8674
|
const i = window.location.pathname + window.location.search + window.location.hash, s = `${encodeURIComponent(r)}=${encodeURIComponent(i)}`, a = t.indexOf("#"), o = a >= 0 ? t.slice(a) : "", l = a >= 0 ? t.slice(0, a) : t, u = l.includes("?") ? "&" : "?";
|
|
8583
8675
|
return `${l}${u}${s}${o}`;
|
|
8584
8676
|
}
|
|
8585
|
-
function At(
|
|
8586
|
-
const e = Pt[
|
|
8677
|
+
function At(b) {
|
|
8678
|
+
const e = Pt[b];
|
|
8587
8679
|
if (e === void 0 || typeof document > "u")
|
|
8588
8680
|
return !1;
|
|
8589
8681
|
const t = `${c.prefix}${e}`, r = [];
|
|
@@ -8739,7 +8831,7 @@ const k = class k {
|
|
|
8739
8831
|
* @returns 予約キーなら true
|
|
8740
8832
|
*/
|
|
8741
8833
|
static isReservedKey(e) {
|
|
8742
|
-
return
|
|
8834
|
+
return w.isReservedBindingKey(e);
|
|
8743
8835
|
}
|
|
8744
8836
|
/**
|
|
8745
8837
|
* 素の JSON オブジェクト(配列でないオブジェクト)かどうかを判定します。
|
|
@@ -8820,7 +8912,7 @@ const k = class k {
|
|
|
8820
8912
|
const a = e.getRawAttribute(`${c.prefix}store-arg`), o = a === null || a.trim() === "" ? null : a.trim(), l = e.getRawAttribute(`${c.prefix}store-params`);
|
|
8821
8913
|
let u = null;
|
|
8822
8914
|
if (l !== null) {
|
|
8823
|
-
const f = l.split("&").map((
|
|
8915
|
+
const f = l.split("&").map((y) => y.trim()).filter((y) => y !== ""), m = f.filter((y) => !k.isReservedKey(y));
|
|
8824
8916
|
m.length !== f.length && k.warnOnce(
|
|
8825
8917
|
t,
|
|
8826
8918
|
"reserved",
|
|
@@ -9036,7 +9128,7 @@ const k = class k {
|
|
|
9036
9128
|
return k.seedSignature(r, k.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() : M.setBindingData(r, s, {
|
|
9037
9129
|
reentrant: !0,
|
|
9038
9130
|
kind: "nonSupply",
|
|
9039
|
-
sequence:
|
|
9131
|
+
sequence: w.nextSequence()
|
|
9040
9132
|
});
|
|
9041
9133
|
}
|
|
9042
9134
|
/**
|
|
@@ -9114,7 +9206,7 @@ const k = class k {
|
|
|
9114
9206
|
if (!k.RESTORED_ELEMENTS.has(i))
|
|
9115
9207
|
return;
|
|
9116
9208
|
const n = N.get(i);
|
|
9117
|
-
if (!(n instanceof
|
|
9209
|
+
if (!(n instanceof w))
|
|
9118
9210
|
return;
|
|
9119
9211
|
const s = k.readDeclaration(n);
|
|
9120
9212
|
if (!s || s.key !== e || s.kind !== t)
|
|
@@ -9129,7 +9221,7 @@ const k = class k {
|
|
|
9129
9221
|
};
|
|
9130
9222
|
k.SIGNATURES = /* @__PURE__ */ new WeakMap(), k.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), k.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), k.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
9131
9223
|
let Ne = k;
|
|
9132
|
-
const
|
|
9224
|
+
const Ht = [
|
|
9133
9225
|
"addErrorMessage",
|
|
9134
9226
|
"clearMessages",
|
|
9135
9227
|
"closeDialog",
|
|
@@ -9137,45 +9229,45 @@ const Ut = [
|
|
|
9137
9229
|
"dialog",
|
|
9138
9230
|
"openDialog",
|
|
9139
9231
|
"toast"
|
|
9140
|
-
],
|
|
9232
|
+
], Ut = "__haoriHistoryState__", qe = "data-haori-click-lock", tt = "ファイルを保存できませんでした", Vt = 100;
|
|
9141
9233
|
let Te = null;
|
|
9142
9234
|
const qt = ["info", "warning", "error", "success"], rt = /^(\d{3})-(click|click-await|close|toast|toast-level|no-message|bind)$/;
|
|
9143
9235
|
function fe() {
|
|
9144
9236
|
const e = globalThis.window?.Haori;
|
|
9145
|
-
return
|
|
9237
|
+
return Ht.every(
|
|
9146
9238
|
(r) => typeof e?.[r] == "function"
|
|
9147
9239
|
) ? e : Re;
|
|
9148
9240
|
}
|
|
9149
9241
|
const Wt = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
9150
|
-
function Pe(
|
|
9151
|
-
return Wt.has(
|
|
9242
|
+
function Pe(b) {
|
|
9243
|
+
return Wt.has(b.toUpperCase());
|
|
9152
9244
|
}
|
|
9153
|
-
function jt(
|
|
9245
|
+
function jt(b, e) {
|
|
9154
9246
|
for (const [t, r] of Object.entries(e))
|
|
9155
9247
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
9156
|
-
|
|
9157
|
-
}) :
|
|
9248
|
+
b.append(t, Ee(i));
|
|
9249
|
+
}) : b.append(t, Ee(r)));
|
|
9158
9250
|
}
|
|
9159
|
-
function Ee(
|
|
9160
|
-
if (
|
|
9251
|
+
function Ee(b) {
|
|
9252
|
+
if (b == null)
|
|
9161
9253
|
return "";
|
|
9162
|
-
if (typeof
|
|
9254
|
+
if (typeof b == "object" || typeof b == "function")
|
|
9163
9255
|
try {
|
|
9164
|
-
return JSON.stringify(
|
|
9256
|
+
return JSON.stringify(b) ?? "";
|
|
9165
9257
|
} catch {
|
|
9166
9258
|
return "";
|
|
9167
9259
|
}
|
|
9168
|
-
return String(
|
|
9260
|
+
return String(b);
|
|
9169
9261
|
}
|
|
9170
|
-
function vt(
|
|
9171
|
-
const t = new URL(
|
|
9262
|
+
function vt(b, e) {
|
|
9263
|
+
const t = new URL(b, window.location.href), r = new URLSearchParams(t.search);
|
|
9172
9264
|
return jt(r, e), t.search = r.toString(), t.toString();
|
|
9173
9265
|
}
|
|
9174
|
-
function Kt(
|
|
9175
|
-
if (
|
|
9266
|
+
function Kt(b) {
|
|
9267
|
+
if (b == null)
|
|
9176
9268
|
return { payload: {}, dropped: !1 };
|
|
9177
|
-
if (typeof
|
|
9178
|
-
const e =
|
|
9269
|
+
if (typeof b == "string") {
|
|
9270
|
+
const e = b.trim();
|
|
9179
9271
|
if (e === "")
|
|
9180
9272
|
return { payload: {}, dropped: !1 };
|
|
9181
9273
|
if (e.startsWith("{")) {
|
|
@@ -9192,44 +9284,44 @@ function Kt(y) {
|
|
|
9192
9284
|
dropped: !1
|
|
9193
9285
|
} : { payload: {}, dropped: !0 };
|
|
9194
9286
|
}
|
|
9195
|
-
if (
|
|
9196
|
-
return { payload: it(
|
|
9197
|
-
if (typeof FormData < "u" &&
|
|
9287
|
+
if (b instanceof URLSearchParams)
|
|
9288
|
+
return { payload: it(b), dropped: !1 };
|
|
9289
|
+
if (typeof FormData < "u" && b instanceof FormData) {
|
|
9198
9290
|
const e = {};
|
|
9199
9291
|
let t = !1;
|
|
9200
|
-
for (const [r, i] of
|
|
9292
|
+
for (const [r, i] of b.entries()) {
|
|
9201
9293
|
if (typeof i != "string") {
|
|
9202
9294
|
t = !0;
|
|
9203
9295
|
continue;
|
|
9204
9296
|
}
|
|
9205
|
-
|
|
9297
|
+
St(e, r, i);
|
|
9206
9298
|
}
|
|
9207
9299
|
return { payload: e, dropped: t };
|
|
9208
9300
|
}
|
|
9209
9301
|
return { payload: {}, dropped: !0 };
|
|
9210
9302
|
}
|
|
9211
|
-
function it(
|
|
9303
|
+
function it(b) {
|
|
9212
9304
|
const e = {};
|
|
9213
|
-
for (const [t, r] of
|
|
9214
|
-
|
|
9305
|
+
for (const [t, r] of b.entries())
|
|
9306
|
+
St(e, t, r);
|
|
9215
9307
|
return e;
|
|
9216
9308
|
}
|
|
9217
|
-
function
|
|
9218
|
-
const r =
|
|
9219
|
-
r === void 0 ?
|
|
9309
|
+
function St(b, e, t) {
|
|
9310
|
+
const r = b[e];
|
|
9311
|
+
r === void 0 ? b[e] = t : Array.isArray(r) ? r.push(t) : b[e] = [r, t];
|
|
9220
9312
|
}
|
|
9221
|
-
function ge(
|
|
9313
|
+
function ge(b, e) {
|
|
9222
9314
|
if (F.isCompleteSetValue(e))
|
|
9223
9315
|
return e;
|
|
9224
9316
|
if (Array.isArray(e)) {
|
|
9225
|
-
const t = Array.isArray(
|
|
9317
|
+
const t = Array.isArray(b) ? b.slice() : [];
|
|
9226
9318
|
let r = !1;
|
|
9227
9319
|
return e.forEach((i, n) => {
|
|
9228
9320
|
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[n] = ge(t[n], i), r = !0));
|
|
9229
|
-
}), r ? t :
|
|
9321
|
+
}), r ? t : b;
|
|
9230
9322
|
}
|
|
9231
9323
|
if (e !== null && typeof e == "object") {
|
|
9232
|
-
const t =
|
|
9324
|
+
const t = b !== null && typeof b == "object" && !Array.isArray(b) ? { ...b } : {};
|
|
9233
9325
|
for (const [r, i] of Object.entries(
|
|
9234
9326
|
e
|
|
9235
9327
|
))
|
|
@@ -9238,15 +9330,15 @@ function ge(y, e) {
|
|
|
9238
9330
|
}
|
|
9239
9331
|
return e;
|
|
9240
9332
|
}
|
|
9241
|
-
function zt(
|
|
9242
|
-
const e =
|
|
9333
|
+
function zt(b) {
|
|
9334
|
+
const e = b?.body;
|
|
9243
9335
|
return e == null ? !1 : typeof e == "string" ? e !== "" : !0;
|
|
9244
9336
|
}
|
|
9245
|
-
function Gt(
|
|
9337
|
+
function Gt(b, e) {
|
|
9246
9338
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
9247
9339
|
if (c.runtime !== "demo" || Pe(r))
|
|
9248
9340
|
return {
|
|
9249
|
-
url:
|
|
9341
|
+
url: b,
|
|
9250
9342
|
options: t,
|
|
9251
9343
|
requestedMethod: r,
|
|
9252
9344
|
effectiveMethod: r,
|
|
@@ -9255,7 +9347,7 @@ function Gt(y, e) {
|
|
|
9255
9347
|
const { payload: i, dropped: n } = Kt(
|
|
9256
9348
|
t.body
|
|
9257
9349
|
);
|
|
9258
|
-
let s =
|
|
9350
|
+
let s = b;
|
|
9259
9351
|
Object.keys(i).length > 0 && (s = vt(s, i)), n && g.warn(
|
|
9260
9352
|
"Haori",
|
|
9261
9353
|
`The ${r} body cannot be converted into a query string and is dropped by the demo runtime normalization. Send the values with ${c.prefix}{event}-data / ${c.prefix}{event}-form, or use the embedded runtime.`
|
|
@@ -9272,8 +9364,8 @@ function Gt(y, e) {
|
|
|
9272
9364
|
queryString: new URL(s, window.location.href).search || void 0
|
|
9273
9365
|
};
|
|
9274
9366
|
}
|
|
9275
|
-
function Yt(
|
|
9276
|
-
return
|
|
9367
|
+
function Yt(b) {
|
|
9368
|
+
return b == null ? null : typeof b == "string" ? b : b instanceof URLSearchParams ? b.toString() : b instanceof FormData ? Array.from(b.entries()).map(([e, t]) => t instanceof File ? [
|
|
9277
9369
|
e,
|
|
9278
9370
|
{
|
|
9279
9371
|
type: "file",
|
|
@@ -9281,22 +9373,22 @@ function Yt(y) {
|
|
|
9281
9373
|
size: t.size,
|
|
9282
9374
|
mimeType: t.type
|
|
9283
9375
|
}
|
|
9284
|
-
] : [e, String(t)]) : String(
|
|
9376
|
+
] : [e, String(t)]) : String(b);
|
|
9285
9377
|
}
|
|
9286
|
-
function Fe(
|
|
9287
|
-
return
|
|
9378
|
+
function Fe(b) {
|
|
9379
|
+
return b instanceof Blob ? !0 : Array.isArray(b) ? b.some(Fe) : b !== null && typeof b == "object" ? Object.values(b).some(
|
|
9288
9380
|
Fe
|
|
9289
9381
|
) : !1;
|
|
9290
9382
|
}
|
|
9291
|
-
function Xt(
|
|
9292
|
-
return Object.values(
|
|
9383
|
+
function Xt(b) {
|
|
9384
|
+
return Object.values(b).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
9293
9385
|
(t) => !(t instanceof Blob) && Fe(t)
|
|
9294
9386
|
) : Fe(e));
|
|
9295
9387
|
}
|
|
9296
|
-
function $e(
|
|
9297
|
-
return je(F.getValues(
|
|
9388
|
+
function $e(b) {
|
|
9389
|
+
return je(F.getValues(b));
|
|
9298
9390
|
}
|
|
9299
|
-
function je(
|
|
9391
|
+
function je(b) {
|
|
9300
9392
|
const e = (r) => {
|
|
9301
9393
|
if (r instanceof File)
|
|
9302
9394
|
return r.name;
|
|
@@ -9316,18 +9408,18 @@ function je(y) {
|
|
|
9316
9408
|
}
|
|
9317
9409
|
return r;
|
|
9318
9410
|
}, t = {};
|
|
9319
|
-
for (const [r, i] of Object.entries(
|
|
9411
|
+
for (const [r, i] of Object.entries(b))
|
|
9320
9412
|
t[r] = e(i);
|
|
9321
|
-
return F.carryCollectedRowIdentity(
|
|
9413
|
+
return F.carryCollectedRowIdentity(b, t), t;
|
|
9322
9414
|
}
|
|
9323
|
-
function Jt(
|
|
9415
|
+
function Jt(b, e) {
|
|
9324
9416
|
const t = new Headers(
|
|
9325
9417
|
e.headers || void 0
|
|
9326
9418
|
), r = Array.from(t.entries()).sort(
|
|
9327
9419
|
([i], [n]) => i.localeCompare(n)
|
|
9328
9420
|
);
|
|
9329
9421
|
return JSON.stringify({
|
|
9330
|
-
url:
|
|
9422
|
+
url: b,
|
|
9331
9423
|
method: String(e.method || "GET").toUpperCase(),
|
|
9332
9424
|
headers: r,
|
|
9333
9425
|
body: Yt(e.body || null)
|
|
@@ -9342,7 +9434,7 @@ const p = class p {
|
|
|
9342
9434
|
* @param domEvent 起点となった DOM イベント
|
|
9343
9435
|
*/
|
|
9344
9436
|
constructor(e, t = null, r = null) {
|
|
9345
|
-
this.reentrantBind = !1, this.suppressEmptyReplaceBind = !1, this.requestUserEditSequence = null, this.downloadReceivedBytes = 0, this.downloadTotalBytes = null, this.downloadFolder = null, this.twoWayCommitBind = !1, this.skipped = !1, this.operationSequence = r != null ?
|
|
9437
|
+
this.reentrantBind = !1, this.suppressEmptyReplaceBind = !1, this.requestUserEditSequence = null, this.downloadReceivedBytes = 0, this.downloadTotalBytes = null, this.downloadFolder = null, this.twoWayCommitBind = !1, this.skipped = !1, this.operationSequence = r != null ? w.nextOperationSequence() : w.nextSequence(), p.isElementFragment(e) ? (this.options = p.buildOptions(e, t), this.eventType = t) : (this.options = e, this.eventType = null), this.domEvent = r;
|
|
9346
9438
|
}
|
|
9347
9439
|
/**
|
|
9348
9440
|
* クリックで起動した手続きの結果を控えます。
|
|
@@ -9848,8 +9940,8 @@ const p = class p {
|
|
|
9848
9940
|
targetFragment: e
|
|
9849
9941
|
}, i = t ? p.attrName(t, "if") : p.attrName(null, "if", !0);
|
|
9850
9942
|
if (e.hasAttribute(i)) {
|
|
9851
|
-
const
|
|
9852
|
-
typeof
|
|
9943
|
+
const R = e.getRawAttribute(i);
|
|
9944
|
+
typeof R == "string" && R.trim() !== "" ? (r.conditionExpression = F.unwrapConditionExpression(R), r.conditionAttributeName = i) : g.warn(
|
|
9853
9945
|
"Haori",
|
|
9854
9946
|
`${i} に条件式が指定されていません。`
|
|
9855
9947
|
);
|
|
@@ -9899,9 +9991,9 @@ ${$}
|
|
|
9899
9991
|
g.error("Haori", `Invalid before script: ${K}`);
|
|
9900
9992
|
}
|
|
9901
9993
|
}
|
|
9902
|
-
const
|
|
9903
|
-
if (e.hasAttribute(
|
|
9904
|
-
const $ = String(e.getAttribute(
|
|
9994
|
+
const R = p.attrName(t, "run");
|
|
9995
|
+
if (e.hasAttribute(R)) {
|
|
9996
|
+
const $ = String(e.getAttribute(R) ?? "");
|
|
9905
9997
|
let K = null;
|
|
9906
9998
|
try {
|
|
9907
9999
|
K = new Function(
|
|
@@ -9924,13 +10016,13 @@ ${$}
|
|
|
9924
10016
|
}
|
|
9925
10017
|
const n = p.attrName(t, "fetch"), s = e.hasAttribute(n);
|
|
9926
10018
|
if (s) {
|
|
9927
|
-
const
|
|
9928
|
-
|
|
10019
|
+
const R = e.getAttributeEvaluation(n);
|
|
10020
|
+
R && (r.fetchHasUnresolvedReference = R.hasUnresolvedReference, r.fetchUrl = R.hasUnresolvedReference ? null : R.value);
|
|
9929
10021
|
}
|
|
9930
10022
|
const a = {}, o = t ? p.attrName(t, "fetch-method") : p.attrName(null, "method", !0);
|
|
9931
10023
|
if (e.hasAttribute(o)) {
|
|
9932
|
-
const
|
|
9933
|
-
|
|
10024
|
+
const R = e.getAttributeEvaluation(o);
|
|
10025
|
+
R?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method = p.normalizeAttributeText(R?.value) ?? void 0;
|
|
9934
10026
|
}
|
|
9935
10027
|
const l = t ? p.attrName(t, "fetch-headers") : p.attrName(null, "headers", !0), u = p.readFetchHeaders(
|
|
9936
10028
|
e,
|
|
@@ -9940,9 +10032,9 @@ ${$}
|
|
|
9940
10032
|
const f = t ? p.attrName(t, "fetch-content-type") : p.attrName(null, "content-type", !0);
|
|
9941
10033
|
let m = null;
|
|
9942
10034
|
if (e.hasAttribute(f)) {
|
|
9943
|
-
const
|
|
9944
|
-
|
|
9945
|
-
|
|
10035
|
+
const R = e.getAttributeEvaluation(f);
|
|
10036
|
+
R?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), m = p.normalizeAttributeText(
|
|
10037
|
+
R?.value
|
|
9946
10038
|
);
|
|
9947
10039
|
}
|
|
9948
10040
|
if (m !== null)
|
|
@@ -9951,56 +10043,56 @@ ${$}
|
|
|
9951
10043
|
m
|
|
9952
10044
|
);
|
|
9953
10045
|
else if (a.method && !p.hasDeclaredContentType(a.headers)) {
|
|
9954
|
-
const
|
|
10046
|
+
const R = a.method.toUpperCase();
|
|
9955
10047
|
a.headers = p.withContentType(
|
|
9956
10048
|
a.headers,
|
|
9957
|
-
|
|
10049
|
+
R === "GET" || R === "HEAD" || R === "OPTIONS" ? "application/x-www-form-urlencoded" : "application/json"
|
|
9958
10050
|
);
|
|
9959
10051
|
}
|
|
9960
10052
|
Object.keys(a).length > 0 && (r.fetchOptions = a);
|
|
9961
|
-
const
|
|
9962
|
-
if (e.hasAttribute(
|
|
10053
|
+
const y = t ? p.attrName(t, "fetch-download") : p.attrName(null, "download", !0);
|
|
10054
|
+
if (e.hasAttribute(y) && !s)
|
|
9963
10055
|
g.warn(
|
|
9964
10056
|
"Haori",
|
|
9965
|
-
`${
|
|
10057
|
+
`${y} は ${n} と併せて指定してください(保存する応答が無いため、この宣言は無視します)。`
|
|
9966
10058
|
);
|
|
9967
|
-
else if (e.hasAttribute(
|
|
10059
|
+
else if (e.hasAttribute(y)) {
|
|
9968
10060
|
r.download = !0;
|
|
9969
|
-
const
|
|
9970
|
-
r.downloadFileName =
|
|
10061
|
+
const R = e.getAttributeEvaluation(y);
|
|
10062
|
+
r.downloadFileName = R?.hasUnresolvedReference ? null : p.normalizeAttributeText(R?.value);
|
|
9971
10063
|
}
|
|
9972
10064
|
const E = t ? p.attrName(t, "fetch-download-folder") : p.attrName(null, "download-folder", !0);
|
|
9973
10065
|
e.hasAttribute(E) && (r.download ? r.downloadFolder = !0 : g.warn(
|
|
9974
10066
|
"Haori",
|
|
9975
|
-
`${E} は ${
|
|
10067
|
+
`${E} は ${y} と併せて指定してください(書き出す応答が無いため、この宣言は無視します)。`
|
|
9976
10068
|
));
|
|
9977
10069
|
const A = t ? p.attrName(t, "bind") : p.attrName(null, "bind", !0);
|
|
9978
10070
|
if (e.hasAttribute(A)) {
|
|
9979
|
-
const
|
|
9980
|
-
if (
|
|
9981
|
-
const $ = W.queryAll(
|
|
10071
|
+
const R = W.read(e, A);
|
|
10072
|
+
if (R) {
|
|
10073
|
+
const $ = W.queryAll(R, A);
|
|
9982
10074
|
$.length > 0 ? (r.bindFragments = [], $.forEach((K) => {
|
|
9983
10075
|
const _ = N.get(K);
|
|
9984
10076
|
_ && r.bindFragments.push(_);
|
|
9985
10077
|
})) : g.error(
|
|
9986
10078
|
"Haori",
|
|
9987
|
-
`Bind element not found: ${
|
|
10079
|
+
`Bind element not found: ${R} (${A})`
|
|
9988
10080
|
);
|
|
9989
10081
|
}
|
|
9990
10082
|
}
|
|
9991
|
-
const
|
|
9992
|
-
t ? e.hasAttribute(
|
|
10083
|
+
const D = p.attrName(t, "bind-arg"), C = p.attrName(null, "arg", !0), P = p.attrName(null, "bind-arg", !0);
|
|
10084
|
+
t ? e.hasAttribute(D) && (r.bindArg = e.getRawAttribute(D)) : e.hasAttribute(C) ? r.bindArg = e.getRawAttribute(
|
|
9993
10085
|
C
|
|
9994
10086
|
) : e.hasAttribute(P) && (r.bindArg = e.getRawAttribute(P));
|
|
9995
10087
|
const ee = t ? p.attrName(t, "bind-params") : p.attrName(null, "bind-params", !0);
|
|
9996
10088
|
if (e.hasAttribute(ee)) {
|
|
9997
|
-
const
|
|
9998
|
-
r.bindParams =
|
|
10089
|
+
const R = e.getRawAttribute(ee);
|
|
10090
|
+
r.bindParams = R.split("&").map(($) => $.trim());
|
|
9999
10091
|
}
|
|
10000
10092
|
const x = t ? p.attrName(t, "bind-append") : p.attrName(null, "bind-append", !0);
|
|
10001
10093
|
if (e.hasAttribute(x)) {
|
|
10002
|
-
const
|
|
10003
|
-
r.bindAppendParams =
|
|
10094
|
+
const R = e.getRawAttribute(x);
|
|
10095
|
+
r.bindAppendParams = R.split("&").map(($) => $.trim()).filter(Boolean);
|
|
10004
10096
|
}
|
|
10005
10097
|
const Y = t ? p.attrName(t, "bind-merge") : p.attrName(null, "bind-merge", !0);
|
|
10006
10098
|
e.hasAttribute(Y) && (r.bindMerge = !0);
|
|
@@ -10008,18 +10100,18 @@ ${$}
|
|
|
10008
10100
|
e.hasAttribute(Q) && (r.bindTransform = e.getRawAttribute(Q));
|
|
10009
10101
|
const X = t ? p.attrName(t, "copy-params") : null;
|
|
10010
10102
|
if (X && e.hasAttribute(X)) {
|
|
10011
|
-
const
|
|
10012
|
-
r.copyParams =
|
|
10103
|
+
const R = e.getRawAttribute(X);
|
|
10104
|
+
r.copyParams = R.split("&").map(($) => $.trim()).filter(Boolean);
|
|
10013
10105
|
}
|
|
10014
10106
|
if (t) {
|
|
10015
10107
|
if (e.hasAttribute(p.attrName(t, "adjust"))) {
|
|
10016
|
-
const
|
|
10108
|
+
const H = W.read(
|
|
10017
10109
|
e,
|
|
10018
10110
|
p.attrName(t, "adjust")
|
|
10019
10111
|
);
|
|
10020
|
-
if (
|
|
10112
|
+
if (H) {
|
|
10021
10113
|
const G = W.queryAll(
|
|
10022
|
-
|
|
10114
|
+
H,
|
|
10023
10115
|
p.attrName(t, "adjust")
|
|
10024
10116
|
);
|
|
10025
10117
|
G.length > 0 ? (r.adjustFragments = [], G.forEach((Z) => {
|
|
@@ -10027,7 +10119,7 @@ ${$}
|
|
|
10027
10119
|
Ie && r.adjustFragments.push(Ie);
|
|
10028
10120
|
})) : g.error(
|
|
10029
10121
|
"Haori",
|
|
10030
|
-
`Adjust element not found: ${
|
|
10122
|
+
`Adjust element not found: ${H} (${p.attrName(t, "adjust")})`
|
|
10031
10123
|
);
|
|
10032
10124
|
}
|
|
10033
10125
|
if (e.hasAttribute(p.attrName(t, "adjust-value"))) {
|
|
@@ -10038,7 +10130,7 @@ ${$}
|
|
|
10038
10130
|
}
|
|
10039
10131
|
}
|
|
10040
10132
|
if (e.hasAttribute(p.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(p.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(p.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(p.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${c.prefix}${t}-after-run`)) {
|
|
10041
|
-
const
|
|
10133
|
+
const H = e.getRawAttribute(
|
|
10042
10134
|
`${c.prefix}${t}-after-run`
|
|
10043
10135
|
);
|
|
10044
10136
|
try {
|
|
@@ -10046,7 +10138,7 @@ ${$}
|
|
|
10046
10138
|
"response",
|
|
10047
10139
|
`
|
|
10048
10140
|
"use strict";
|
|
10049
|
-
${
|
|
10141
|
+
${H}
|
|
10050
10142
|
`
|
|
10051
10143
|
);
|
|
10052
10144
|
} catch (G) {
|
|
@@ -10071,12 +10163,12 @@ ${U}
|
|
|
10071
10163
|
"toast-level",
|
|
10072
10164
|
p.attrName(t, "toast-level")
|
|
10073
10165
|
)), t !== "poll") {
|
|
10074
|
-
const
|
|
10075
|
-
e.hasAttribute(
|
|
10166
|
+
const H = p.attrName(t, "error-toast");
|
|
10167
|
+
e.hasAttribute(H) && (r.errorToastMessage = p.readLateAttribute(
|
|
10076
10168
|
e,
|
|
10077
10169
|
r,
|
|
10078
10170
|
"error-toast",
|
|
10079
|
-
|
|
10171
|
+
H
|
|
10080
10172
|
), r.errorToastLevel = p.readToastLevel(
|
|
10081
10173
|
e,
|
|
10082
10174
|
r,
|
|
@@ -10093,27 +10185,27 @@ ${U}
|
|
|
10093
10185
|
p.attrName(t, "error-bind")
|
|
10094
10186
|
);
|
|
10095
10187
|
}
|
|
10096
|
-
const
|
|
10188
|
+
const R = p.attrName(t, "redirect"), $ = p.attrName(t, "redirect-replace"), K = e.hasAttribute(R), _ = e.hasAttribute($);
|
|
10097
10189
|
if (K && (r.redirectUrl = p.readLateAttribute(
|
|
10098
10190
|
e,
|
|
10099
10191
|
r,
|
|
10100
10192
|
"redirect",
|
|
10101
|
-
|
|
10193
|
+
R
|
|
10102
10194
|
)), _ && (r.redirectReplaceUrl = p.readLateAttribute(
|
|
10103
10195
|
e,
|
|
10104
10196
|
r,
|
|
10105
10197
|
"redirect-replace",
|
|
10106
10198
|
$
|
|
10107
10199
|
)), K || _) {
|
|
10108
|
-
const
|
|
10200
|
+
const H = p.attrName(
|
|
10109
10201
|
t,
|
|
10110
10202
|
"redirect-return-param"
|
|
10111
10203
|
);
|
|
10112
|
-
e.hasAttribute(
|
|
10204
|
+
e.hasAttribute(H) && (r.redirectReturnParam = p.readLateAttribute(
|
|
10113
10205
|
e,
|
|
10114
10206
|
r,
|
|
10115
10207
|
"redirect-return-param",
|
|
10116
|
-
|
|
10208
|
+
H
|
|
10117
10209
|
));
|
|
10118
10210
|
}
|
|
10119
10211
|
if (e.hasAttribute(p.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(p.attrName(t, "clear-messages")) && (r.clearMessagesOnSuccess = !0), e.hasAttribute(p.attrName(t, "scroll")) && (r.scrollTarget = p.readLateAttribute(
|
|
@@ -10127,20 +10219,20 @@ ${U}
|
|
|
10127
10219
|
"history",
|
|
10128
10220
|
p.attrName(t, "history")
|
|
10129
10221
|
)), e.hasAttribute(p.attrName(t, "history-data")) && (r.historyDataAttrName = p.attrName(t, "history-data")), e.hasAttribute(p.attrName(t, "history-form"))) {
|
|
10130
|
-
const
|
|
10222
|
+
const H = W.read(
|
|
10131
10223
|
e,
|
|
10132
10224
|
p.attrName(t, "history-form")
|
|
10133
10225
|
);
|
|
10134
|
-
if (
|
|
10226
|
+
if (H) {
|
|
10135
10227
|
const G = W.query(
|
|
10136
|
-
|
|
10228
|
+
H,
|
|
10137
10229
|
p.attrName(t, "history-form")
|
|
10138
10230
|
);
|
|
10139
10231
|
G !== null ? r.historyFormFragment = F.getFormFragment(
|
|
10140
10232
|
N.get(G)
|
|
10141
10233
|
) : g.error(
|
|
10142
10234
|
"Haori",
|
|
10143
|
-
`Form element not found: ${
|
|
10235
|
+
`Form element not found: ${H} (${p.attrName(t, "history-form")})`
|
|
10144
10236
|
);
|
|
10145
10237
|
} else
|
|
10146
10238
|
r.historyFormFragment = F.getFormFragment(e);
|
|
@@ -10155,19 +10247,19 @@ ${U}
|
|
|
10155
10247
|
"close",
|
|
10156
10248
|
"error-click",
|
|
10157
10249
|
"error-close"
|
|
10158
|
-
].forEach((
|
|
10159
|
-
if (
|
|
10250
|
+
].forEach((H) => {
|
|
10251
|
+
if (H.startsWith("error-") && t === "poll")
|
|
10160
10252
|
return;
|
|
10161
|
-
const G = p.attrName(t,
|
|
10253
|
+
const G = p.attrName(t, H);
|
|
10162
10254
|
if (!e.hasAttribute(G))
|
|
10163
10255
|
return;
|
|
10164
10256
|
const Z = p.resolveSelectorTargets(
|
|
10165
10257
|
e,
|
|
10166
10258
|
G,
|
|
10167
|
-
|
|
10259
|
+
H
|
|
10168
10260
|
);
|
|
10169
10261
|
if (Z.length > 0)
|
|
10170
|
-
switch (
|
|
10262
|
+
switch (H) {
|
|
10171
10263
|
case "reset-before":
|
|
10172
10264
|
r.resetBeforeFragments = Z;
|
|
10173
10265
|
break;
|
|
@@ -10205,39 +10297,39 @@ ${U}
|
|
|
10205
10297
|
));
|
|
10206
10298
|
const oe = p.attrName(t, "copy-source");
|
|
10207
10299
|
if (e.hasAttribute(oe)) {
|
|
10208
|
-
const
|
|
10209
|
-
if (
|
|
10210
|
-
const G = W.query(
|
|
10300
|
+
const H = W.read(e, oe);
|
|
10301
|
+
if (H) {
|
|
10302
|
+
const G = W.query(H, oe);
|
|
10211
10303
|
if (G !== null) {
|
|
10212
10304
|
const Z = N.get(G);
|
|
10213
10305
|
Z ? r.copySourceFragment = Z : g.error(
|
|
10214
10306
|
"Haori",
|
|
10215
|
-
`Element is not managed by Haori: ${
|
|
10307
|
+
`Element is not managed by Haori: ${H} (${oe})`
|
|
10216
10308
|
);
|
|
10217
10309
|
} else
|
|
10218
10310
|
g.error(
|
|
10219
10311
|
"Haori",
|
|
10220
|
-
`Element not found: ${
|
|
10312
|
+
`Element not found: ${H} (${oe})`
|
|
10221
10313
|
);
|
|
10222
10314
|
} else
|
|
10223
10315
|
r.copySourceFragment = e;
|
|
10224
10316
|
}
|
|
10225
10317
|
}
|
|
10226
10318
|
if (!t && (e.hasAttribute(p.attrName(null, "data", !0)) && (r.dataAttrName = p.attrName(null, "data", !0)), e.hasAttribute(p.attrName(null, "form", !0)))) {
|
|
10227
|
-
const
|
|
10319
|
+
const R = W.read(
|
|
10228
10320
|
e,
|
|
10229
10321
|
p.attrName(null, "form", !0)
|
|
10230
10322
|
);
|
|
10231
|
-
if (
|
|
10323
|
+
if (R) {
|
|
10232
10324
|
const $ = W.query(
|
|
10233
|
-
|
|
10325
|
+
R,
|
|
10234
10326
|
p.attrName(null, "form", !0)
|
|
10235
10327
|
);
|
|
10236
10328
|
$ !== null ? r.formFragment = F.getFormFragment(
|
|
10237
10329
|
N.get($)
|
|
10238
10330
|
) : g.error(
|
|
10239
10331
|
"Haori",
|
|
10240
|
-
`Form element not found: ${
|
|
10332
|
+
`Form element not found: ${R} (${p.attrName(null, "fetch-form", !0)})`
|
|
10241
10333
|
);
|
|
10242
10334
|
} else
|
|
10243
10335
|
r.formFragment = F.getFormFragment(e);
|
|
@@ -10245,18 +10337,18 @@ ${U}
|
|
|
10245
10337
|
(!t || t === "poll") && p.readNoMessageDeclarations(e, r, t ?? "fetch");
|
|
10246
10338
|
const j = t ? p.attrName(t, "fetch-state") : p.attrName(null, "state", !0);
|
|
10247
10339
|
if (e.hasAttribute(j)) {
|
|
10248
|
-
const
|
|
10249
|
-
|
|
10250
|
-
const
|
|
10251
|
-
|
|
10340
|
+
const R = W.read(e, j), $ = [];
|
|
10341
|
+
R ? (W.queryAll(R, j).forEach((_) => {
|
|
10342
|
+
const be = N.get(_);
|
|
10343
|
+
be && $.push(be);
|
|
10252
10344
|
}), $.length === 0 && g.error(
|
|
10253
10345
|
"Haori",
|
|
10254
|
-
`Element not found: ${
|
|
10346
|
+
`Element not found: ${R} (${j})`
|
|
10255
10347
|
)) : $.push(e), $.length > 0 && (r.fetchStateFragments = $);
|
|
10256
10348
|
}
|
|
10257
10349
|
const se = t ? p.attrName(t, "store-clear") : p.attrName(null, "store-clear", !0);
|
|
10258
10350
|
if (e.hasAttribute(se)) {
|
|
10259
|
-
const
|
|
10351
|
+
const R = e.getRawAttribute(se), $ = R === null ? "" : R.trim();
|
|
10260
10352
|
if ($ === "")
|
|
10261
10353
|
g.error(
|
|
10262
10354
|
"Haori",
|
|
@@ -10275,7 +10367,7 @@ ${U}
|
|
|
10275
10367
|
}
|
|
10276
10368
|
return s && !r.download && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [e], r.defaultSelfBind = !0), r.download && r.bindFragments && r.bindFragments.length > 0 && (g.warn(
|
|
10277
10369
|
"Haori",
|
|
10278
|
-
`${
|
|
10370
|
+
`${y} と同時にバインド先が指定されています(応答はファイルとして保存し、バインドは行いません)。`
|
|
10279
10371
|
), r.bindFragments = null), p.recordRowWriteTargets(r), r;
|
|
10280
10372
|
}
|
|
10281
10373
|
/**
|
|
@@ -10391,13 +10483,13 @@ ${U}
|
|
|
10391
10483
|
if (this.options.runScript) {
|
|
10392
10484
|
const m = this.options.targetFragment?.getTarget() ?? null;
|
|
10393
10485
|
try {
|
|
10394
|
-
const
|
|
10486
|
+
const y = this.options.runScript.call(
|
|
10395
10487
|
m,
|
|
10396
10488
|
this.domEvent
|
|
10397
10489
|
);
|
|
10398
|
-
|
|
10399
|
-
} catch (
|
|
10400
|
-
g.error("Haori", `Run script execution error: ${
|
|
10490
|
+
y === !1 && this.domEvent && this.domEvent.preventDefault(), y != null && typeof y.then == "function" && await y;
|
|
10491
|
+
} catch (y) {
|
|
10492
|
+
g.error("Haori", `Run script execution error: ${y}`);
|
|
10401
10493
|
}
|
|
10402
10494
|
}
|
|
10403
10495
|
if (!await this.confirm())
|
|
@@ -10410,7 +10502,7 @@ ${U}
|
|
|
10410
10502
|
)
|
|
10411
10503
|
), this.captureHistorySnapshots());
|
|
10412
10504
|
const r = this.prepareFetchRequest();
|
|
10413
|
-
this.requestUserEditSequence =
|
|
10505
|
+
this.requestUserEditSequence = w.currentSequence();
|
|
10414
10506
|
const i = r.payload;
|
|
10415
10507
|
let n = r.url, s = r.options, a = !1, o = !1;
|
|
10416
10508
|
if (this.options.beforeCallback) {
|
|
@@ -10436,7 +10528,7 @@ ${U}
|
|
|
10436
10528
|
s
|
|
10437
10529
|
);
|
|
10438
10530
|
n = A.url;
|
|
10439
|
-
const
|
|
10531
|
+
const D = { ...A.options }, C = A.normalized ? A.requestedMethod : r.requestedMethod, P = A.effectiveMethod, ee = r.transportMode === "query-get" || A.normalized, x = A.queryString ?? r.queryString;
|
|
10440
10532
|
if (ee && g.info("Haori demo fetch normalization", {
|
|
10441
10533
|
runtime: c.runtime,
|
|
10442
10534
|
requestedMethod: C,
|
|
@@ -10456,10 +10548,10 @@ ${U}
|
|
|
10456
10548
|
return B.fetchStart(
|
|
10457
10549
|
this.options.targetFragment.getTarget(),
|
|
10458
10550
|
n,
|
|
10459
|
-
|
|
10551
|
+
D,
|
|
10460
10552
|
l ? i : void 0,
|
|
10461
10553
|
Q
|
|
10462
|
-
), await this.injectFetchState("loading"), await p.invokeFetch(n,
|
|
10554
|
+
), await this.injectFetchState("loading"), await p.invokeFetch(n, D).then((X) => this.handleFetchResult(
|
|
10463
10555
|
X,
|
|
10464
10556
|
n || void 0,
|
|
10465
10557
|
Y
|
|
@@ -10475,7 +10567,7 @@ ${U}
|
|
|
10475
10567
|
), await this.runErrorActions(null), X;
|
|
10476
10568
|
});
|
|
10477
10569
|
}
|
|
10478
|
-
return await fetch(n,
|
|
10570
|
+
return await fetch(n, D).then((Y) => this.handleFetchResult(Y, n || void 0));
|
|
10479
10571
|
}
|
|
10480
10572
|
(!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && l && await this.commitFormValues(
|
|
10481
10573
|
this.options.formFragment,
|
|
@@ -10974,7 +11066,7 @@ ${U}
|
|
|
10974
11066
|
e.status,
|
|
10975
11067
|
r
|
|
10976
11068
|
);
|
|
10977
|
-
const E = this.selectErrorActions(e.status), A = E?.bind === !0,
|
|
11069
|
+
const E = this.selectErrorActions(e.status), A = E?.bind === !0, D = await this.handleFetchError(
|
|
10978
11070
|
A ? e.clone() : e,
|
|
10979
11071
|
E?.noMessage !== !0 && !A
|
|
10980
11072
|
);
|
|
@@ -10984,7 +11076,7 @@ ${U}
|
|
|
10984
11076
|
"error",
|
|
10985
11077
|
e.status,
|
|
10986
11078
|
e.statusText || null,
|
|
10987
|
-
|
|
11079
|
+
D
|
|
10988
11080
|
), await this.runErrorActions(e.status), !1;
|
|
10989
11081
|
}
|
|
10990
11082
|
if (this.options.targetFragment && t && r && B.fetchEnd(
|
|
@@ -11073,9 +11165,9 @@ ${U}
|
|
|
11073
11165
|
"Haori",
|
|
11074
11166
|
`${p.attrName(this.eventType, "redirect")} と ${p.attrName(this.eventType, "redirect-replace")} の両方が指定されています。履歴を置き換える方を採用します。`
|
|
11075
11167
|
);
|
|
11076
|
-
const
|
|
11077
|
-
if (
|
|
11078
|
-
let E =
|
|
11168
|
+
const y = m || f;
|
|
11169
|
+
if (y) {
|
|
11170
|
+
let E = y;
|
|
11079
11171
|
const A = this.resolveLateAttribute(
|
|
11080
11172
|
"redirect-return-param",
|
|
11081
11173
|
this.options.redirectReturnParam
|
|
@@ -11254,10 +11346,10 @@ ${U}
|
|
|
11254
11346
|
}
|
|
11255
11347
|
const l = (u) => {
|
|
11256
11348
|
for (const [f, m] of Object.entries(u))
|
|
11257
|
-
m != null && (Array.isArray(m) ? (o.searchParams.delete(f), m.forEach((
|
|
11349
|
+
m != null && (Array.isArray(m) ? (o.searchParams.delete(f), m.forEach((y) => o.searchParams.append(f, String(y)))) : typeof m == "object" ? o.searchParams.set(f, JSON.stringify(m)) : o.searchParams.set(f, String(m)));
|
|
11258
11350
|
};
|
|
11259
11351
|
n && l(r), s && l(i), history.pushState(
|
|
11260
|
-
{ [
|
|
11352
|
+
{ [Ut]: !0 },
|
|
11261
11353
|
"",
|
|
11262
11354
|
o.toString()
|
|
11263
11355
|
), M.refreshUrlParams();
|
|
@@ -11316,35 +11408,35 @@ ${U}
|
|
|
11316
11408
|
try {
|
|
11317
11409
|
const u = await e.json(), f = [];
|
|
11318
11410
|
if (Array.isArray(u)) {
|
|
11319
|
-
const m = /* @__PURE__ */ new Map(),
|
|
11411
|
+
const m = /* @__PURE__ */ new Map(), y = [];
|
|
11320
11412
|
for (const E of u)
|
|
11321
11413
|
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
11322
|
-
const A = E.key,
|
|
11414
|
+
const A = E.key, D = E.message, C = typeof A == "string" && A.length > 0 ? A : null, P = typeof D == "string" ? D : D != null ? String(D) : "";
|
|
11323
11415
|
if (P.length === 0)
|
|
11324
11416
|
continue;
|
|
11325
11417
|
if (C !== null) {
|
|
11326
11418
|
const ee = m.get(C) ?? [];
|
|
11327
11419
|
ee.push(P), m.set(C, ee);
|
|
11328
11420
|
} else
|
|
11329
|
-
|
|
11330
|
-
} else typeof E == "string" && E.length > 0 &&
|
|
11421
|
+
y.push(P);
|
|
11422
|
+
} else typeof E == "string" && E.length > 0 && y.push(E);
|
|
11331
11423
|
for (const [E, A] of m)
|
|
11332
11424
|
f.push({ key: E, message: A.join(`
|
|
11333
11425
|
`) });
|
|
11334
|
-
for (const E of
|
|
11426
|
+
for (const E of y)
|
|
11335
11427
|
f.push({ message: E });
|
|
11336
11428
|
} else if (u && typeof u == "object") {
|
|
11337
11429
|
if (typeof u.message == "string" && f.push({ message: u.message }), Array.isArray(u.messages))
|
|
11338
11430
|
for (const m of u.messages)
|
|
11339
11431
|
typeof m == "string" && f.push({ message: m });
|
|
11340
11432
|
if (u.errors && typeof u.errors == "object")
|
|
11341
|
-
for (const [m,
|
|
11342
|
-
Array.isArray(
|
|
11343
|
-
`) }) : typeof
|
|
11433
|
+
for (const [m, y] of Object.entries(u.errors))
|
|
11434
|
+
Array.isArray(y) ? f.push({ key: m, message: y.join(`
|
|
11435
|
+
`) }) : typeof y == "string" ? f.push({ key: m, message: y }) : y != null && f.push({ key: m, message: String(y) });
|
|
11344
11436
|
if (f.length === 0)
|
|
11345
|
-
for (const [m,
|
|
11346
|
-
m === "message" || m === "messages" || m === "errors" || (Array.isArray(
|
|
11347
|
-
`) }) : typeof
|
|
11437
|
+
for (const [m, y] of Object.entries(u))
|
|
11438
|
+
m === "message" || m === "messages" || m === "errors" || (Array.isArray(y) ? f.push({ key: m, message: y.join(`
|
|
11439
|
+
`) }) : typeof y == "string" && f.push({ key: m, message: y }));
|
|
11348
11440
|
}
|
|
11349
11441
|
return await a(f);
|
|
11350
11442
|
} catch {
|
|
@@ -11557,10 +11649,10 @@ ${U}
|
|
|
11557
11649
|
row: o,
|
|
11558
11650
|
attributeName: s,
|
|
11559
11651
|
syncWhenUnchanged: "reflect",
|
|
11560
|
-
apply: (
|
|
11561
|
-
const E = this.resolveCurrentRowItem(o,
|
|
11652
|
+
apply: (y) => {
|
|
11653
|
+
const E = this.resolveCurrentRowItem(o, y), A = { ...E };
|
|
11562
11654
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
11563
|
-
const
|
|
11655
|
+
const D = E[m], C = D !== null && typeof D == "object" && !Array.isArray(D) ? D : {};
|
|
11564
11656
|
A[m] = this.mergeAppendBindingData(
|
|
11565
11657
|
o,
|
|
11566
11658
|
i,
|
|
@@ -11575,11 +11667,11 @@ ${U}
|
|
|
11575
11667
|
}
|
|
11576
11668
|
const u = { ...o.getRawBindingData() ?? {} }, f = this.options.bindArg;
|
|
11577
11669
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
11578
|
-
const m = u[f],
|
|
11670
|
+
const m = u[f], y = m && typeof m == "object" && !Array.isArray(m) ? m : {};
|
|
11579
11671
|
u[f] = this.mergeAppendBindingData(
|
|
11580
11672
|
o,
|
|
11581
11673
|
i,
|
|
11582
|
-
|
|
11674
|
+
y
|
|
11583
11675
|
);
|
|
11584
11676
|
} else
|
|
11585
11677
|
u[f] = i;
|
|
@@ -11627,11 +11719,11 @@ ${U}
|
|
|
11627
11719
|
attributeName: s,
|
|
11628
11720
|
syncWhenUnchanged: "reflect",
|
|
11629
11721
|
apply: (m) => {
|
|
11630
|
-
const
|
|
11722
|
+
const y = this.options.bindMerge ? this.resolveCurrentRowItem(o, m) : m, E = this.mergeAppendBindingData(
|
|
11631
11723
|
o,
|
|
11632
11724
|
i,
|
|
11633
|
-
|
|
11634
|
-
), A = this.options.bindMerge ? { ...
|
|
11725
|
+
y
|
|
11726
|
+
), A = this.options.bindMerge ? { ...y, ...E } : E;
|
|
11635
11727
|
return this.reconcileRowUserEdits(o, A);
|
|
11636
11728
|
}
|
|
11637
11729
|
});
|
|
@@ -11965,15 +12057,15 @@ ${U}
|
|
|
11965
12057
|
if (/multipart\/form-data/i.test(f)) {
|
|
11966
12058
|
s.delete("Content-Type");
|
|
11967
12059
|
const m = new FormData();
|
|
11968
|
-
for (const [
|
|
11969
|
-
E == null ? m.append(
|
|
11970
|
-
A instanceof Blob ? m.append(
|
|
11971
|
-
}) : m.append(
|
|
12060
|
+
for (const [y, E] of Object.entries(t))
|
|
12061
|
+
E == null ? m.append(y, "") : E instanceof Blob ? m.append(y, E) : Array.isArray(E) ? E.forEach((A) => {
|
|
12062
|
+
A instanceof Blob ? m.append(y, A) : m.append(y, Ee(A));
|
|
12063
|
+
}) : m.append(y, Ee(E));
|
|
11972
12064
|
n.body = m;
|
|
11973
12065
|
} else if (/application\/x-www-form-urlencoded/i.test(f)) {
|
|
11974
12066
|
const m = new URLSearchParams();
|
|
11975
|
-
for (const [
|
|
11976
|
-
E !== void 0 && (Array.isArray(E) ? E.forEach((A) => m.append(
|
|
12067
|
+
for (const [y, E] of Object.entries(t))
|
|
12068
|
+
E !== void 0 && (Array.isArray(E) ? E.forEach((A) => m.append(y, Ee(A))) : m.append(y, Ee(E)));
|
|
11977
12069
|
n.body = m;
|
|
11978
12070
|
} else
|
|
11979
12071
|
s.set("Content-Type", "application/json"), n.body = JSON.stringify(t);
|
|
@@ -12100,7 +12192,7 @@ ${U}
|
|
|
12100
12192
|
`Row container not found: ${i} (${r})`
|
|
12101
12193
|
), null;
|
|
12102
12194
|
const a = N.get(s);
|
|
12103
|
-
return a instanceof
|
|
12195
|
+
return a instanceof w ? a.hasAttribute(`${c.prefix}each`) ? a : (g.error(
|
|
12104
12196
|
"Haori",
|
|
12105
12197
|
`Row container must have ${c.prefix}each: ${i} (${r})`
|
|
12106
12198
|
), null) : (g.error(
|
|
@@ -12148,9 +12240,9 @@ ${U}
|
|
|
12148
12240
|
const u = p.resolveRowScopeBase(e, o[0]);
|
|
12149
12241
|
if (u === "unresolvable")
|
|
12150
12242
|
return null;
|
|
12151
|
-
let f, m,
|
|
12243
|
+
let f, m, y;
|
|
12152
12244
|
if (u)
|
|
12153
|
-
f = u.owner, m = u.ownerData,
|
|
12245
|
+
f = u.owner, m = u.ownerData, y = [...u.path, ...o.slice(1)];
|
|
12154
12246
|
else {
|
|
12155
12247
|
for (f = e, m = null; f; ) {
|
|
12156
12248
|
const A = f.getRawBindingData();
|
|
@@ -12160,15 +12252,15 @@ ${U}
|
|
|
12160
12252
|
}
|
|
12161
12253
|
f = f.getParent();
|
|
12162
12254
|
}
|
|
12163
|
-
|
|
12255
|
+
y = o;
|
|
12164
12256
|
}
|
|
12165
12257
|
if (!f || !m)
|
|
12166
12258
|
return t || g.error(
|
|
12167
12259
|
"Haori",
|
|
12168
12260
|
`Binding data owner not found for ${s}="${a}".`
|
|
12169
12261
|
), null;
|
|
12170
|
-
const E = p.readPathValue(m,
|
|
12171
|
-
return Array.isArray(E) ? { owner: f, ownerData: m, array: E, path:
|
|
12262
|
+
const E = p.readPathValue(m, y);
|
|
12263
|
+
return Array.isArray(E) ? { owner: f, ownerData: m, array: E, path: y, mapped: n } : (t || g.error(
|
|
12172
12264
|
"Haori",
|
|
12173
12265
|
`${s}="${a}" does not resolve to an array.`
|
|
12174
12266
|
), null);
|
|
@@ -12356,18 +12448,18 @@ ${U}
|
|
|
12356
12448
|
);
|
|
12357
12449
|
continue;
|
|
12358
12450
|
}
|
|
12359
|
-
const
|
|
12360
|
-
if (p.isSameRowItem(m,
|
|
12451
|
+
const y = u.apply(m);
|
|
12452
|
+
if (p.isSameRowItem(m, y)) {
|
|
12361
12453
|
u.syncWhenUnchanged && r.push(
|
|
12362
12454
|
p.syncUnchangedRowValues(
|
|
12363
12455
|
u.row,
|
|
12364
|
-
|
|
12456
|
+
y,
|
|
12365
12457
|
u.syncWhenUnchanged
|
|
12366
12458
|
)
|
|
12367
12459
|
);
|
|
12368
12460
|
continue;
|
|
12369
12461
|
}
|
|
12370
|
-
a[f] =
|
|
12462
|
+
a[f] = y, o = !0, u.syncWhenUnchanged === "supply" && F.clearRowUserEditMarksForChangedKeys(u.row, y);
|
|
12371
12463
|
}
|
|
12372
12464
|
if (!o)
|
|
12373
12465
|
return;
|
|
@@ -12482,12 +12574,12 @@ ${U}
|
|
|
12482
12574
|
const a = e.getAttribute(`${c.prefix}each-key`), o = t.getListKey();
|
|
12483
12575
|
if (a && o !== null) {
|
|
12484
12576
|
const l = [];
|
|
12485
|
-
r.forEach((m,
|
|
12577
|
+
r.forEach((m, y) => {
|
|
12486
12578
|
M.createListKey(
|
|
12487
12579
|
m,
|
|
12488
12580
|
String(a),
|
|
12489
|
-
|
|
12490
|
-
) === o && l.push(
|
|
12581
|
+
y
|
|
12582
|
+
) === o && l.push(y);
|
|
12491
12583
|
});
|
|
12492
12584
|
const u = n.slice(0, s).filter((m) => m.getListKey() === o).length, f = l[u] ?? -1;
|
|
12493
12585
|
return f === -1 ? (g.warn(
|
|
@@ -12578,12 +12670,12 @@ ${U}
|
|
|
12578
12670
|
const i = p.resolveEachArray(r);
|
|
12579
12671
|
if (!i)
|
|
12580
12672
|
return Promise.reject(new Error("Row array not resolved."));
|
|
12581
|
-
const n = this.options.targetFragment, s = n ? n.closestByAttribute(`${c.prefix}row`) : null, a = p.getRowFragments(r), o = s ? a.indexOf(s) : a.length - 1, l = (
|
|
12673
|
+
const n = this.options.targetFragment, s = n ? n.closestByAttribute(`${c.prefix}row`) : null, a = p.getRowFragments(r), o = s ? a.indexOf(s) : a.length - 1, l = (y) => y < 0 || y >= a.length ? null : i.mapped ? p.resolveRowIndex(
|
|
12582
12674
|
r,
|
|
12583
|
-
a[
|
|
12675
|
+
a[y],
|
|
12584
12676
|
i.array,
|
|
12585
12677
|
p.attrName(this.eventType, e)
|
|
12586
|
-
) :
|
|
12678
|
+
) : y, u = o >= 0 ? l(o) : i.mapped ? i.array.length - 1 : o;
|
|
12587
12679
|
if (u === null)
|
|
12588
12680
|
return Promise.resolve();
|
|
12589
12681
|
const f = i.array.slice();
|
|
@@ -12595,15 +12687,15 @@ ${U}
|
|
|
12595
12687
|
))
|
|
12596
12688
|
return Promise.resolve();
|
|
12597
12689
|
const m = /* @__PURE__ */ new Map();
|
|
12598
|
-
return a.forEach((
|
|
12599
|
-
const E =
|
|
12600
|
-
E !== null && !m.has(String(E)) && m.set(String(E),
|
|
12601
|
-
}), f.forEach((
|
|
12602
|
-
if (p.isSameRowItem(i.array[E],
|
|
12690
|
+
return a.forEach((y) => {
|
|
12691
|
+
const E = y.getListKey();
|
|
12692
|
+
E !== null && !m.has(String(E)) && m.set(String(E), y);
|
|
12693
|
+
}), f.forEach((y, E) => {
|
|
12694
|
+
if (p.isSameRowItem(i.array[E], y))
|
|
12603
12695
|
return;
|
|
12604
12696
|
const A = m.get(
|
|
12605
12697
|
M.createListKey(
|
|
12606
|
-
|
|
12698
|
+
y,
|
|
12607
12699
|
null,
|
|
12608
12700
|
E
|
|
12609
12701
|
)
|
|
@@ -12758,7 +12850,7 @@ const d = class d {
|
|
|
12758
12850
|
*/
|
|
12759
12851
|
static isAliasedAttributeReflection(e, t) {
|
|
12760
12852
|
const r = N.get(e);
|
|
12761
|
-
return r instanceof
|
|
12853
|
+
return r instanceof w ? r.hasAttribute(
|
|
12762
12854
|
`${c.prefix}${d.ATTRIBUTE_ALIAS_SUFFIX}${t}`
|
|
12763
12855
|
) : !1;
|
|
12764
12856
|
}
|
|
@@ -12789,7 +12881,7 @@ const d = class d {
|
|
|
12789
12881
|
static reevaluateChildren(e) {
|
|
12790
12882
|
const t = [];
|
|
12791
12883
|
return e.getChildren().forEach((r) => {
|
|
12792
|
-
r instanceof
|
|
12884
|
+
r instanceof w ? t.push(d.evaluateAll(r)) : r instanceof ne && t.push(d.evaluateText(r));
|
|
12793
12885
|
}), Promise.all(t).then(() => {
|
|
12794
12886
|
});
|
|
12795
12887
|
}
|
|
@@ -12810,9 +12902,9 @@ const d = class d {
|
|
|
12810
12902
|
* @param upTo この通し番号までの編集を解除対象とする(既定は現在の最新)
|
|
12811
12903
|
* @return 戻り値はありません。
|
|
12812
12904
|
*/
|
|
12813
|
-
static clearUserEditMarks(e, t =
|
|
12905
|
+
static clearUserEditMarks(e, t = w.currentSequence()) {
|
|
12814
12906
|
e.clearUserEditMark(t), e.getChildren().forEach((r) => {
|
|
12815
|
-
r instanceof
|
|
12907
|
+
r instanceof w && d.clearUserEditMarks(r, t);
|
|
12816
12908
|
});
|
|
12817
12909
|
}
|
|
12818
12910
|
/**
|
|
@@ -12861,7 +12953,7 @@ const d = class d {
|
|
|
12861
12953
|
return Promise.resolve();
|
|
12862
12954
|
const r = [];
|
|
12863
12955
|
return e.hasAttribute(`${c.prefix}validity`) && F.applyCustomValidity(e), e.hasAttribute(`${c.prefix}fetch`) && r.push(d.executeManagedFetch(e)), e.hasAttribute(`${c.prefix}import`) && r.push(d.executeManagedImport(e)), e.isVisible() ? (e.getChildren().forEach((i) => {
|
|
12864
|
-
i instanceof
|
|
12956
|
+
i instanceof w && r.push(
|
|
12865
12957
|
d.reevaluateReactiveSpecialAttributes(i, t)
|
|
12866
12958
|
);
|
|
12867
12959
|
}), Promise.all(r).then(() => {
|
|
@@ -12921,7 +13013,7 @@ const d = class d {
|
|
|
12921
13013
|
t.removeAttribute(`${c.prefix}importing`), B.importEnd(t, n, o, s), d.adoptImportedChildren(e);
|
|
12922
13014
|
const l = [];
|
|
12923
13015
|
return e.getChildren().forEach((u) => {
|
|
12924
|
-
u instanceof
|
|
13016
|
+
u instanceof w ? l.push(d.scan(u.getTarget())) : u instanceof ne && l.push(d.evaluateText(u));
|
|
12925
13017
|
}), Promise.all(l).then(() => {
|
|
12926
13018
|
});
|
|
12927
13019
|
});
|
|
@@ -13000,7 +13092,7 @@ const d = class d {
|
|
|
13000
13092
|
*/
|
|
13001
13093
|
static applyEnhancersOnShow(e, t) {
|
|
13002
13094
|
const r = e.getTarget();
|
|
13003
|
-
return
|
|
13095
|
+
return w.retryUnappliedValueWrites(r, t).then(
|
|
13004
13096
|
() => {
|
|
13005
13097
|
re.applySubtree(r);
|
|
13006
13098
|
}
|
|
@@ -13034,7 +13126,7 @@ const d = class d {
|
|
|
13034
13126
|
}
|
|
13035
13127
|
const r = t && e.hasAttribute(`${c.prefix}each`), i = [];
|
|
13036
13128
|
return e.getChildren().forEach((n) => {
|
|
13037
|
-
n instanceof
|
|
13129
|
+
n instanceof w ? (!r || d.isEachFixedChild(n)) && i.push(
|
|
13038
13130
|
d.initializeElementFragment(n, t)
|
|
13039
13131
|
) : n instanceof ne && i.push(d.evaluateText(n));
|
|
13040
13132
|
}), Promise.all(i).then(() => {
|
|
@@ -13134,19 +13226,19 @@ const d = class d {
|
|
|
13134
13226
|
let l = null, u = null, f = null;
|
|
13135
13227
|
switch (t) {
|
|
13136
13228
|
case `${c.prefix}bind`: {
|
|
13137
|
-
if (r !== null && i && s instanceof
|
|
13229
|
+
if (r !== null && i && s instanceof w && s.consumeSelfWrittenBind(r))
|
|
13138
13230
|
break;
|
|
13139
13231
|
const m = r === null ? {} : d.parseDataBind(r);
|
|
13140
13232
|
if (i) {
|
|
13141
|
-
const
|
|
13233
|
+
const y = n ?? w.nextSequence();
|
|
13142
13234
|
return r === null ? (o.push(
|
|
13143
13235
|
d.setBindingData(e, m, {
|
|
13144
13236
|
reflectToAttribute: !1,
|
|
13145
|
-
sequence:
|
|
13237
|
+
sequence: y
|
|
13146
13238
|
})
|
|
13147
13239
|
), o.push(s.removeAttribute(t))) : o.push(
|
|
13148
13240
|
d.setBindingData(e, m, {
|
|
13149
|
-
sequence:
|
|
13241
|
+
sequence: y
|
|
13150
13242
|
})
|
|
13151
13243
|
), Promise.all(o).then(() => {
|
|
13152
13244
|
});
|
|
@@ -13198,7 +13290,7 @@ const d = class d {
|
|
|
13198
13290
|
return r !== null && F.applyCustomValidity(s), Promise.all(o).then(() => {
|
|
13199
13291
|
});
|
|
13200
13292
|
case `${c.prefix}url-param`: {
|
|
13201
|
-
const m = s.getAttribute(`${c.prefix}url-arg`),
|
|
13293
|
+
const m = s.getAttribute(`${c.prefix}url-arg`), y = De.readParams();
|
|
13202
13294
|
m === null && s.hasAttribute(`${c.prefix}store`) && g.warn(
|
|
13203
13295
|
"Haori",
|
|
13204
13296
|
`${c.prefix}url-param を ${c.prefix}url-arg なしで ${c.prefix}store と併用すると復元した値が消えます(${c.prefix}url-arg を指定してください)。`
|
|
@@ -13206,13 +13298,13 @@ const d = class d {
|
|
|
13206
13298
|
const E = {
|
|
13207
13299
|
reentrant: !0,
|
|
13208
13300
|
kind: "nonSupply",
|
|
13209
|
-
sequence:
|
|
13301
|
+
sequence: w.nextSequence()
|
|
13210
13302
|
};
|
|
13211
13303
|
if (m === null)
|
|
13212
|
-
o.push(d.setBindingData(e,
|
|
13304
|
+
o.push(d.setBindingData(e, y, E));
|
|
13213
13305
|
else {
|
|
13214
13306
|
const A = s.getRawBindingData() || {};
|
|
13215
|
-
A[String(m)] =
|
|
13307
|
+
A[String(m)] = y, o.push(d.setBindingData(e, A, E));
|
|
13216
13308
|
}
|
|
13217
13309
|
break;
|
|
13218
13310
|
}
|
|
@@ -13255,22 +13347,22 @@ const d = class d {
|
|
|
13255
13347
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
13256
13348
|
*/
|
|
13257
13349
|
static setBindingData(e, t, r = {}) {
|
|
13258
|
-
const i = N.get(e), n = r.skipFragments ?? /* @__PURE__ */ new Set(), s = r.reentrant ?? !1, a = r.reflectToAttribute ?? !0, o = r.kind ?? "supply", l = r.sequence ??
|
|
13350
|
+
const i = N.get(e), n = r.skipFragments ?? /* @__PURE__ */ new Set(), s = r.reentrant ?? !1, a = r.reflectToAttribute ?? !0, o = r.kind ?? "supply", l = r.sequence ?? w.nextOperationSequence(), u = {
|
|
13259
13351
|
sequence: l,
|
|
13260
13352
|
kind: o,
|
|
13261
13353
|
...r.editedPaths === void 0 ? {} : { editedPaths: r.editedPaths }
|
|
13262
13354
|
}, f = o === "supply";
|
|
13263
13355
|
f && i.markSupplyApplied(l);
|
|
13264
|
-
const m =
|
|
13356
|
+
const m = w.currentSequence(), y = i.getRawBindingData();
|
|
13265
13357
|
f && (r.clearUserEdits ?? !0) && d.clearUserEditMarks(i, l);
|
|
13266
|
-
const E = a ? d.resolveByPathAuthority(i,
|
|
13267
|
-
i.setBindingData(E), a && (B.bindChange(e,
|
|
13358
|
+
const E = a ? d.resolveByPathAuthority(i, y, t, u) : t;
|
|
13359
|
+
i.setBindingData(E), a && (B.bindChange(e, y, E, "manual"), Ne.mirror(i));
|
|
13268
13360
|
const A = () => {
|
|
13269
13361
|
i.markBindingWorkStart();
|
|
13270
|
-
const
|
|
13362
|
+
const D = i.getRawBindingData() ?? E;
|
|
13271
13363
|
let C = a ? i.setAttribute(
|
|
13272
13364
|
`${c.prefix}bind`,
|
|
13273
|
-
JSON.stringify(d.withoutReservedBindingKeys(
|
|
13365
|
+
JSON.stringify(d.withoutReservedBindingKeys(D))
|
|
13274
13366
|
) : Promise.resolve();
|
|
13275
13367
|
return e.tagName === "FORM" && (C = C.then(() => {
|
|
13276
13368
|
if (i.wasResetAfter(m))
|
|
@@ -13283,9 +13375,9 @@ const d = class d {
|
|
|
13283
13375
|
u
|
|
13284
13376
|
);
|
|
13285
13377
|
})), C = C.then(
|
|
13286
|
-
() => F.syncAncestorArgForms(i, m, u,
|
|
13378
|
+
() => F.syncAncestorArgForms(i, m, u, y)
|
|
13287
13379
|
), C = C.then(() => d.evaluateAll(i, n)), C = C.then(
|
|
13288
|
-
() =>
|
|
13380
|
+
() => w.retryUnappliedValueWrites(e, m)
|
|
13289
13381
|
), C = C.then(
|
|
13290
13382
|
() => d.reevaluateReactiveSpecialAttributes(i, n)
|
|
13291
13383
|
), C.then(
|
|
@@ -13312,7 +13404,7 @@ const d = class d {
|
|
|
13312
13404
|
static withoutReservedBindingKeys(e) {
|
|
13313
13405
|
const t = {};
|
|
13314
13406
|
for (const r of Object.keys(e))
|
|
13315
|
-
|
|
13407
|
+
w.isReservedBindingKey(r) || (t[r] = e[r]);
|
|
13316
13408
|
return t;
|
|
13317
13409
|
}
|
|
13318
13410
|
/**
|
|
@@ -13355,26 +13447,26 @@ const d = class d {
|
|
|
13355
13447
|
*/
|
|
13356
13448
|
static mergePathAuthority(e, t, r, i, n, s) {
|
|
13357
13449
|
if (d.isPlainRecord(t) && d.isPlainRecord(r)) {
|
|
13358
|
-
const f = t, m = r,
|
|
13450
|
+
const f = t, m = r, y = {};
|
|
13359
13451
|
let E = Object.keys(f).some(
|
|
13360
|
-
(
|
|
13452
|
+
(D) => !Object.prototype.hasOwnProperty.call(m, D)
|
|
13361
13453
|
);
|
|
13362
13454
|
const A = /* @__PURE__ */ new Set([
|
|
13363
13455
|
...Object.keys(f),
|
|
13364
13456
|
...Object.keys(m)
|
|
13365
13457
|
]);
|
|
13366
|
-
for (const
|
|
13367
|
-
const C = n === "" ?
|
|
13458
|
+
for (const D of A) {
|
|
13459
|
+
const C = n === "" ? D : `${n}.${D}`, P = d.mergePathAuthority(
|
|
13368
13460
|
e,
|
|
13369
|
-
Object.prototype.hasOwnProperty.call(f,
|
|
13370
|
-
Object.prototype.hasOwnProperty.call(m,
|
|
13461
|
+
Object.prototype.hasOwnProperty.call(f, D) ? f[D] : d.ABSENT_PATH,
|
|
13462
|
+
Object.prototype.hasOwnProperty.call(m, D) ? m[D] : d.ABSENT_PATH,
|
|
13371
13463
|
i,
|
|
13372
13464
|
C,
|
|
13373
13465
|
s
|
|
13374
13466
|
);
|
|
13375
|
-
P !== d.ABSENT_PATH && (
|
|
13467
|
+
P !== d.ABSENT_PATH && (y[D] = P), P !== (Object.prototype.hasOwnProperty.call(m, D) ? m[D] : d.ABSENT_PATH) && (E = !0);
|
|
13376
13468
|
}
|
|
13377
|
-
return E ?
|
|
13469
|
+
return E ? y : m;
|
|
13378
13470
|
}
|
|
13379
13471
|
const a = d.resolveArrayPairing(
|
|
13380
13472
|
e,
|
|
@@ -13384,7 +13476,7 @@ const d = class d {
|
|
|
13384
13476
|
s
|
|
13385
13477
|
);
|
|
13386
13478
|
if (a !== null) {
|
|
13387
|
-
const f = t, m = r,
|
|
13479
|
+
const f = t, m = r, y = m.map(
|
|
13388
13480
|
(E, A) => d.mergePathAuthority(
|
|
13389
13481
|
e,
|
|
13390
13482
|
f[A],
|
|
@@ -13394,7 +13486,7 @@ const d = class d {
|
|
|
13394
13486
|
s
|
|
13395
13487
|
)
|
|
13396
13488
|
);
|
|
13397
|
-
return
|
|
13489
|
+
return y.some((E, A) => E !== m[A]) ? y : m;
|
|
13398
13490
|
}
|
|
13399
13491
|
if (d.isSameBindingValue(t, r))
|
|
13400
13492
|
return r;
|
|
@@ -13571,7 +13663,7 @@ const d = class d {
|
|
|
13571
13663
|
*/
|
|
13572
13664
|
static getBindingData(e, t = {}) {
|
|
13573
13665
|
const r = N.get(e);
|
|
13574
|
-
return r instanceof
|
|
13666
|
+
return r instanceof w ? t.resolved ? r.getBindingData() : r.getRawBindingData() : null;
|
|
13575
13667
|
}
|
|
13576
13668
|
/**
|
|
13577
13669
|
* 指定要素の式評価で見えるバインディングスコープをダンプします(デバッグ用)。
|
|
@@ -13611,9 +13703,9 @@ const d = class d {
|
|
|
13611
13703
|
return f !== "" ? `#${f}` : u.tagName.toLowerCase();
|
|
13612
13704
|
}, s = (l, u, f, m) => {
|
|
13613
13705
|
if (l)
|
|
13614
|
-
for (const
|
|
13615
|
-
|
|
13616
|
-
value: l[
|
|
13706
|
+
for (const y of Object.keys(l))
|
|
13707
|
+
y in i || (i[y] = {
|
|
13708
|
+
value: l[y],
|
|
13617
13709
|
source: n(u),
|
|
13618
13710
|
kind: f,
|
|
13619
13711
|
depth: m
|
|
@@ -13659,7 +13751,7 @@ const d = class d {
|
|
|
13659
13751
|
if (n) {
|
|
13660
13752
|
if (n.getParent() === r)
|
|
13661
13753
|
return Promise.resolve();
|
|
13662
|
-
if (r.attachObserved(n, i), n instanceof
|
|
13754
|
+
if (r.attachObserved(n, i), n instanceof w)
|
|
13663
13755
|
return d.scan(n.getTarget());
|
|
13664
13756
|
if (n instanceof ne)
|
|
13665
13757
|
return d.evaluateText(n);
|
|
@@ -13677,7 +13769,7 @@ const d = class d {
|
|
|
13677
13769
|
const r = t.getParent();
|
|
13678
13770
|
if (r && r.isSkipMutationNode(e))
|
|
13679
13771
|
return;
|
|
13680
|
-
if (t instanceof
|
|
13772
|
+
if (t instanceof w) {
|
|
13681
13773
|
t.detachObserved();
|
|
13682
13774
|
return;
|
|
13683
13775
|
}
|
|
@@ -13730,7 +13822,7 @@ const d = class d {
|
|
|
13730
13822
|
// 持たず、ユーザー編集の印も解除しない)。
|
|
13731
13823
|
d.setBindingData(n.getTarget(), l, {
|
|
13732
13824
|
kind: "nonSupply",
|
|
13733
|
-
sequence:
|
|
13825
|
+
sequence: w.nextSequence()
|
|
13734
13826
|
})
|
|
13735
13827
|
);
|
|
13736
13828
|
}
|
|
@@ -13781,15 +13873,15 @@ const d = class d {
|
|
|
13781
13873
|
e.setDeriveInputSignature(E);
|
|
13782
13874
|
})));
|
|
13783
13875
|
}
|
|
13784
|
-
let m = !1,
|
|
13876
|
+
let m = !1, y = 0;
|
|
13785
13877
|
return n && (r = r.then(() => {
|
|
13786
13878
|
const E = e.isVisible();
|
|
13787
|
-
return
|
|
13879
|
+
return y = w.currentSequence(), d.evaluateIf(e, t).then(() => {
|
|
13788
13880
|
m = !E && e.isVisible();
|
|
13789
13881
|
});
|
|
13790
13882
|
})), s ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => d.evaluateEachFixedChildren(e)).then(() => d.evaluateEach(e)).then(() => {
|
|
13791
13883
|
if (m)
|
|
13792
|
-
return d.applyEnhancersOnShow(e,
|
|
13884
|
+
return d.applyEnhancersOnShow(e, y);
|
|
13793
13885
|
})) : n ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => {
|
|
13794
13886
|
})) : (i && (r = r.then(() => {
|
|
13795
13887
|
if (!d.canSkipStableDerivedSubtree(e)) {
|
|
@@ -13808,7 +13900,7 @@ const d = class d {
|
|
|
13808
13900
|
return;
|
|
13809
13901
|
const E = [];
|
|
13810
13902
|
return e.getChildren().forEach((A) => {
|
|
13811
|
-
if (A instanceof
|
|
13903
|
+
if (A instanceof w) {
|
|
13812
13904
|
if (d.canSkipUnchangedNestedEach(A))
|
|
13813
13905
|
return;
|
|
13814
13906
|
E.push(d.evaluateAll(A, t));
|
|
@@ -13936,7 +14028,7 @@ const d = class d {
|
|
|
13936
14028
|
*/
|
|
13937
14029
|
static hasEachFixedChildren(e) {
|
|
13938
14030
|
return e.getChildren().some(
|
|
13939
|
-
(t) => t instanceof
|
|
14031
|
+
(t) => t instanceof w && d.isEachFixedChild(t)
|
|
13940
14032
|
);
|
|
13941
14033
|
}
|
|
13942
14034
|
/**
|
|
@@ -13958,7 +14050,7 @@ const d = class d {
|
|
|
13958
14050
|
static evaluateEachFixedChildren(e) {
|
|
13959
14051
|
const t = [];
|
|
13960
14052
|
return e.getChildren().forEach((r) => {
|
|
13961
|
-
r instanceof
|
|
14053
|
+
r instanceof w ? d.isEachFixedChild(r) && t.push(d.evaluateAll(r)) : r instanceof ne && t.push(d.evaluateText(r));
|
|
13962
14054
|
}), Promise.all(t).then(() => {
|
|
13963
14055
|
});
|
|
13964
14056
|
}
|
|
@@ -13977,7 +14069,7 @@ const d = class d {
|
|
|
13977
14069
|
static evaluateIfOnAttributeWrite(e) {
|
|
13978
14070
|
if (!e.hasAttribute(`${c.prefix}each`))
|
|
13979
14071
|
return d.evaluateIf(e);
|
|
13980
|
-
const t = e.isVisible(), r =
|
|
14072
|
+
const t = e.isVisible(), r = w.currentSequence();
|
|
13981
14073
|
return d.evaluateIf(e).then(() => {
|
|
13982
14074
|
if (!t)
|
|
13983
14075
|
return d.evaluateEach(e).then(() => d.reevaluateReactiveSpecialAttributes(e)).then(() => d.applyEnhancersOnShow(e, r));
|
|
@@ -14003,9 +14095,9 @@ const d = class d {
|
|
|
14003
14095
|
);
|
|
14004
14096
|
else {
|
|
14005
14097
|
e.restoreFormControlsDisabledByIf();
|
|
14006
|
-
const n = e.isVisible(), s =
|
|
14098
|
+
const n = e.isVisible(), s = w.currentSequence(), a = [], o = e.hasAttribute(`${c.prefix}each`);
|
|
14007
14099
|
e.getChildren().forEach((l) => {
|
|
14008
|
-
if (l instanceof
|
|
14100
|
+
if (l instanceof w) {
|
|
14009
14101
|
if (o && !d.isEachFixedChild(l))
|
|
14010
14102
|
return;
|
|
14011
14103
|
l.isMounted() ? n ? a.push(d.evaluateAll(l, t)) : a.push(
|
|
@@ -14241,7 +14333,7 @@ ${r}
|
|
|
14241
14333
|
if (r === null) {
|
|
14242
14334
|
let s = !1;
|
|
14243
14335
|
if (e.getChildren().forEach((a) => {
|
|
14244
|
-
if (!s && a instanceof
|
|
14336
|
+
if (!s && a instanceof w) {
|
|
14245
14337
|
if (a.hasAttribute(`${c.prefix}each-before`) || a.hasAttribute(`${c.prefix}each-after`))
|
|
14246
14338
|
return;
|
|
14247
14339
|
r = a.clone(), d.markFreshInitializationSkippable(r), e.setTemplate(r), s = !0, e.removeChild(a);
|
|
@@ -14255,10 +14347,10 @@ ${r}
|
|
|
14255
14347
|
).forEach((l) => {
|
|
14256
14348
|
if (!s) {
|
|
14257
14349
|
const f = N.get(l);
|
|
14258
|
-
f instanceof
|
|
14350
|
+
f instanceof w && (r = f.clone(), d.markFreshInitializationSkippable(r), e.setTemplate(r), s = !0);
|
|
14259
14351
|
}
|
|
14260
14352
|
const u = N.get(l);
|
|
14261
|
-
u instanceof
|
|
14353
|
+
u instanceof w && e.getChildren().includes(u) && (e.removeChild(u), u.setMounted(!1)), l.parentNode && l.parentNode.removeChild(l);
|
|
14262
14354
|
});
|
|
14263
14355
|
}
|
|
14264
14356
|
return this.updateDiff(e, t).then(() => {
|
|
@@ -14318,7 +14410,7 @@ ${r}
|
|
|
14318
14410
|
a instanceof ne ? d.areExpressionsRowLocal(
|
|
14319
14411
|
d.extractInterpolations(a.getRawText()),
|
|
14320
14412
|
i
|
|
14321
|
-
) && r.add(a) : a instanceof
|
|
14413
|
+
) && r.add(a) : a instanceof w && (d.isRowLocalSubtree(a, i) ? r.add(a) : n(a));
|
|
14322
14414
|
};
|
|
14323
14415
|
return n(t), r;
|
|
14324
14416
|
}
|
|
@@ -14454,7 +14546,7 @@ ${r}
|
|
|
14454
14546
|
typeof s == "string" && s !== "" && n.add(s), r = n;
|
|
14455
14547
|
}
|
|
14456
14548
|
for (const i of e.getChildren())
|
|
14457
|
-
if (i instanceof
|
|
14549
|
+
if (i instanceof w) {
|
|
14458
14550
|
if (!d.isRowLocalSubtree(i, r))
|
|
14459
14551
|
return !1;
|
|
14460
14552
|
} else if (i instanceof ne) {
|
|
@@ -14517,7 +14609,7 @@ ${r}
|
|
|
14517
14609
|
* @returns 含むなら true
|
|
14518
14610
|
*/
|
|
14519
14611
|
static hasDisallowedDerivedSubtreeDescendant(e) {
|
|
14520
|
-
return e.getChildren().some((t) => t instanceof
|
|
14612
|
+
return e.getChildren().some((t) => t instanceof w ? t.hasAttribute(`${c.prefix}derive`) || t.hasAttribute(`${c.prefix}derive-name`) || t.hasAttribute(`${c.prefix}fetch`) || t.hasAttribute(`${c.prefix}import`) ? !0 : d.hasDisallowedDerivedSubtreeDescendant(t) : !1);
|
|
14521
14613
|
}
|
|
14522
14614
|
/**
|
|
14523
14615
|
* data-derive host が子孫要素へ公開している binding の署名を返します。
|
|
@@ -14558,7 +14650,7 @@ ${r}
|
|
|
14558
14650
|
document.querySelectorAll(`[${e}]`)
|
|
14559
14651
|
).map((i) => {
|
|
14560
14652
|
const n = N.peek(i);
|
|
14561
|
-
return n instanceof
|
|
14653
|
+
return n instanceof w ? d.setAttribute(
|
|
14562
14654
|
i,
|
|
14563
14655
|
e,
|
|
14564
14656
|
n.getRawAttribute(e) ?? ""
|
|
@@ -14587,7 +14679,7 @@ ${r}
|
|
|
14587
14679
|
r.setDeriveSubtreeSignature(null);
|
|
14588
14680
|
const t = (r) => {
|
|
14589
14681
|
r.setDeriveSubtreeSignature(null), r.getChildren().forEach((i) => {
|
|
14590
|
-
i instanceof
|
|
14682
|
+
i instanceof w && t(i);
|
|
14591
14683
|
});
|
|
14592
14684
|
};
|
|
14593
14685
|
t(e);
|
|
@@ -14667,7 +14759,7 @@ ${r}
|
|
|
14667
14759
|
typeof a == "string" && a.trim() !== "" && (n += `[${c.prefix}derive-name="${a.trim()}"]`);
|
|
14668
14760
|
const o = r.getParent();
|
|
14669
14761
|
if (o) {
|
|
14670
|
-
const l = o.getChildren().filter((u) => u instanceof
|
|
14762
|
+
const l = o.getChildren().filter((u) => u instanceof w).findIndex((u) => u === r);
|
|
14671
14763
|
n += `:nth-child(${l + 1})`;
|
|
14672
14764
|
}
|
|
14673
14765
|
t.unshift(n), r = o;
|
|
@@ -14740,7 +14832,7 @@ ${r}
|
|
|
14740
14832
|
* @returns subtree 全体を省略可能なら true
|
|
14741
14833
|
*/
|
|
14742
14834
|
static markFreshInitializationSkippable(e) {
|
|
14743
|
-
const t = e.getAttributeNames().some((n) => d.isFreshInitializationDynamicAttribute(e, n)), r = e.getChildren().some((n) => n instanceof
|
|
14835
|
+
const t = e.getAttributeNames().some((n) => d.isFreshInitializationDynamicAttribute(e, n)), r = e.getChildren().some((n) => n instanceof w ? !d.markFreshInitializationSkippable(n) : n instanceof ne ? n.hasDynamicContent() : !1), i = !t && !r;
|
|
14744
14836
|
return e.setFreshInitializationSkippable(i), i;
|
|
14745
14837
|
}
|
|
14746
14838
|
/**
|
|
@@ -14779,14 +14871,14 @@ ${r}
|
|
|
14779
14871
|
l.set(x, (l.get(x) ?? 0) + 1);
|
|
14780
14872
|
}), n && o.size !== a.length && d.warnDuplicateEachKey(String(n));
|
|
14781
14873
|
const u = [];
|
|
14782
|
-
let f = e.getChildren().filter((x) => x instanceof
|
|
14874
|
+
let f = e.getChildren().filter((x) => x instanceof w).filter(
|
|
14783
14875
|
(x) => !x.hasAttribute(`${c.prefix}each-before`) && !x.hasAttribute(`${c.prefix}each-after`)
|
|
14784
14876
|
);
|
|
14785
|
-
const m = f.map((x) => x.getListKey()),
|
|
14877
|
+
const m = f.map((x) => x.getListKey()), y = /* @__PURE__ */ new Set();
|
|
14786
14878
|
f = f.filter((x, Y) => {
|
|
14787
14879
|
const Q = String(x.getListKey()), X = l.get(Q) ?? 0;
|
|
14788
14880
|
if (X === 0) {
|
|
14789
|
-
|
|
14881
|
+
y.add(x);
|
|
14790
14882
|
const j = x.getListKey();
|
|
14791
14883
|
return j !== null && B.rowRemove(x.getTarget(), j, Y), u.push(x.remove()), !1;
|
|
14792
14884
|
}
|
|
@@ -14800,7 +14892,7 @@ ${r}
|
|
|
14800
14892
|
const Q = A.get(Y);
|
|
14801
14893
|
Q ? Q.push(x) : A.set(Y, [x]);
|
|
14802
14894
|
});
|
|
14803
|
-
const
|
|
14895
|
+
const D = e.getChildElementFragments().filter((x) => !y.has(x)), C = D.filter(
|
|
14804
14896
|
(x) => x.hasAttribute(`${c.prefix}each-before`)
|
|
14805
14897
|
).length;
|
|
14806
14898
|
let P = Promise.resolve();
|
|
@@ -14811,7 +14903,7 @@ ${r}
|
|
|
14811
14903
|
const se = A.get(x)?.shift();
|
|
14812
14904
|
if (se) {
|
|
14813
14905
|
j = se;
|
|
14814
|
-
const
|
|
14906
|
+
const R = C + Y;
|
|
14815
14907
|
P = P.then(
|
|
14816
14908
|
() => d.updateRowFragment(
|
|
14817
14909
|
j,
|
|
@@ -14828,8 +14920,8 @@ ${r}
|
|
|
14828
14920
|
d.repositionEachRow(
|
|
14829
14921
|
e,
|
|
14830
14922
|
j,
|
|
14831
|
-
|
|
14832
|
-
|
|
14923
|
+
D,
|
|
14924
|
+
R
|
|
14833
14925
|
).then((K) => {
|
|
14834
14926
|
K !== null && B.rowMove(
|
|
14835
14927
|
j.getTarget(),
|
|
@@ -14848,7 +14940,7 @@ ${r}
|
|
|
14848
14940
|
);
|
|
14849
14941
|
} else {
|
|
14850
14942
|
j = r.clone();
|
|
14851
|
-
const
|
|
14943
|
+
const R = C + Y;
|
|
14852
14944
|
P = P.then(
|
|
14853
14945
|
() => d.updateRowFragment(
|
|
14854
14946
|
j,
|
|
@@ -14858,9 +14950,9 @@ ${r}
|
|
|
14858
14950
|
s ? String(s) : null,
|
|
14859
14951
|
x
|
|
14860
14952
|
).then(() => {
|
|
14861
|
-
const $ =
|
|
14953
|
+
const $ = D[R] ?? null;
|
|
14862
14954
|
return e.insertBefore(j, $).then(() => {
|
|
14863
|
-
|
|
14955
|
+
D.splice(R, 0, j);
|
|
14864
14956
|
}).then(() => d.initializeFreshEachRow(j)).then(() => d.applyRowFormValues(e, j, Q)).then(() => {
|
|
14865
14957
|
B.rowAdd(j.getTarget(), x, X, Q);
|
|
14866
14958
|
});
|
|
@@ -14869,13 +14961,13 @@ ${r}
|
|
|
14869
14961
|
}
|
|
14870
14962
|
}), Promise.all(u).then(() => P).then(() => Promise.all(ee)).then(() => {
|
|
14871
14963
|
const x = a.filter(
|
|
14872
|
-
(
|
|
14964
|
+
(R) => R !== null
|
|
14873
14965
|
), Y = E.filter(
|
|
14874
|
-
(
|
|
14875
|
-
), Q = new Set(Y), X = x.filter((
|
|
14876
|
-
(
|
|
14966
|
+
(R) => R !== null
|
|
14967
|
+
), Q = new Set(Y), X = x.filter((R) => !Q.has(R)), se = m.filter(
|
|
14968
|
+
(R) => R !== null
|
|
14877
14969
|
).filter(
|
|
14878
|
-
(
|
|
14970
|
+
(R) => !o.has(R)
|
|
14879
14971
|
);
|
|
14880
14972
|
B.eachUpdate(
|
|
14881
14973
|
e.getTarget(),
|
|
@@ -14910,7 +15002,7 @@ ${r}
|
|
|
14910
15002
|
*/
|
|
14911
15003
|
static warnExtraEachChildren(e) {
|
|
14912
15004
|
const t = e.getChildren().filter(
|
|
14913
|
-
(r) => r instanceof
|
|
15005
|
+
(r) => r instanceof w
|
|
14914
15006
|
).filter(
|
|
14915
15007
|
(r) => !r.hasAttribute(`${c.prefix}each-before`) && !r.hasAttribute(`${c.prefix}each-after`)
|
|
14916
15008
|
);
|
|
@@ -15173,7 +15265,7 @@ d.ATTRIBUTE_ALIAS_SUFFIX = "attr-", d.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
15173
15265
|
"enhance-new"
|
|
15174
15266
|
]), d.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), d.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), d.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), d.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), d.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), d.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), d.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), d.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), d.ABSENT_PATH = Symbol("absent");
|
|
15175
15267
|
let M = d;
|
|
15176
|
-
const
|
|
15268
|
+
const we = class we {
|
|
15177
15269
|
/**
|
|
15178
15270
|
* コンストラクタ。
|
|
15179
15271
|
*
|
|
@@ -15193,7 +15285,7 @@ const Se = class Se {
|
|
|
15193
15285
|
this.runWindowLoadProcedure();
|
|
15194
15286
|
}, this.onPopstate = (t) => {
|
|
15195
15287
|
const r = t.state;
|
|
15196
|
-
if (!r || r[
|
|
15288
|
+
if (!r || r[we.HISTORY_STATE_KEY] !== !0) {
|
|
15197
15289
|
M.refreshUrlParams();
|
|
15198
15290
|
return;
|
|
15199
15291
|
}
|
|
@@ -15301,7 +15393,7 @@ const Se = class Se {
|
|
|
15301
15393
|
subscribeCustomEvent(e) {
|
|
15302
15394
|
if (e === null || e === "")
|
|
15303
15395
|
return;
|
|
15304
|
-
if (
|
|
15396
|
+
if (we.BUILTIN_EVENT_NAMES.has(e)) {
|
|
15305
15397
|
g.warn(
|
|
15306
15398
|
"[Haori]",
|
|
15307
15399
|
`data-on="${e}" は組み込みイベントです。data-${e}-* を使用してください(data-on はカスタムイベント専用)。`
|
|
@@ -15331,7 +15423,7 @@ const Se = class Se {
|
|
|
15331
15423
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
15332
15424
|
return;
|
|
15333
15425
|
const n = N.get(i);
|
|
15334
|
-
n instanceof
|
|
15426
|
+
n instanceof w && this.isFromTarget(n, t) && new ae(n, "on", t).run().catch((s) => {
|
|
15335
15427
|
g.error("[Haori]", "Procedure execution error:", s);
|
|
15336
15428
|
});
|
|
15337
15429
|
});
|
|
@@ -15475,7 +15567,7 @@ const Se = class Se {
|
|
|
15475
15567
|
*/
|
|
15476
15568
|
markUserEditOnly(e) {
|
|
15477
15569
|
const t = N.get(e);
|
|
15478
|
-
t instanceof
|
|
15570
|
+
t instanceof w && t.markUserEdit();
|
|
15479
15571
|
}
|
|
15480
15572
|
/**
|
|
15481
15573
|
* `change` / `input` の対象要素について、内部値の同期とユーザー編集の記録を行います。
|
|
@@ -15491,13 +15583,13 @@ const Se = class Se {
|
|
|
15491
15583
|
*/
|
|
15492
15584
|
syncUserEdit(e, t) {
|
|
15493
15585
|
const r = N.get(e);
|
|
15494
|
-
if (r instanceof
|
|
15586
|
+
if (r instanceof w && (r.syncValue(), t ? r.markUserEditOnChange() : r.markUserEdit(), e instanceof HTMLInputElement && e.type === "radio" && e.name)) {
|
|
15495
15587
|
const i = document.getElementsByName(e.name);
|
|
15496
15588
|
for (const n of Array.from(i)) {
|
|
15497
15589
|
if (n === e || !(n instanceof HTMLInputElement) || n.type !== "radio" || n.form !== e.form)
|
|
15498
15590
|
continue;
|
|
15499
15591
|
const s = N.get(n);
|
|
15500
|
-
s instanceof
|
|
15592
|
+
s instanceof w && (s.syncValue(), s.markUserEdit());
|
|
15501
15593
|
}
|
|
15502
15594
|
}
|
|
15503
15595
|
}
|
|
@@ -15544,13 +15636,13 @@ const Se = class Se {
|
|
|
15544
15636
|
return null;
|
|
15545
15637
|
}
|
|
15546
15638
|
};
|
|
15547
|
-
|
|
15639
|
+
we.HISTORY_STATE_KEY = "__haoriHistoryState__", we.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
15548
15640
|
"click",
|
|
15549
15641
|
"change",
|
|
15550
15642
|
"input",
|
|
15551
15643
|
"load"
|
|
15552
15644
|
]);
|
|
15553
|
-
let Ke =
|
|
15645
|
+
let Ke = we;
|
|
15554
15646
|
const V = class V {
|
|
15555
15647
|
/**
|
|
15556
15648
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -15775,7 +15867,7 @@ const S = class S {
|
|
|
15775
15867
|
if (!t && !S.hasPollAttribute(e))
|
|
15776
15868
|
return;
|
|
15777
15869
|
const r = N.get(e);
|
|
15778
|
-
if (!(r instanceof
|
|
15870
|
+
if (!(r instanceof w) || !S.shouldObserve(r)) {
|
|
15779
15871
|
t && S.teardown(e, t);
|
|
15780
15872
|
return;
|
|
15781
15873
|
}
|
|
@@ -16094,7 +16186,7 @@ const S = class S {
|
|
|
16094
16186
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
16095
16187
|
// 解除しない)。
|
|
16096
16188
|
kind: "nonSupply",
|
|
16097
|
-
sequence:
|
|
16189
|
+
sequence: w.nextSequence()
|
|
16098
16190
|
});
|
|
16099
16191
|
})
|
|
16100
16192
|
).then(() => {
|
|
@@ -16128,7 +16220,7 @@ const S = class S {
|
|
|
16128
16220
|
if (!a.isConnected)
|
|
16129
16221
|
return;
|
|
16130
16222
|
const o = N.get(a);
|
|
16131
|
-
o instanceof
|
|
16223
|
+
o instanceof w && s.push(o);
|
|
16132
16224
|
}), s;
|
|
16133
16225
|
}
|
|
16134
16226
|
/**
|
|
@@ -16276,9 +16368,9 @@ S.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
16276
16368
|
"state"
|
|
16277
16369
|
]), S.DEFAULT_INTERVAL_MS = 5e3, S.MIN_INTERVAL_MS = 100, S.registrations = /* @__PURE__ */ new Map(), S.visibilityListener = null;
|
|
16278
16370
|
let ve = S;
|
|
16279
|
-
const Qt = "0.62.
|
|
16280
|
-
function _t(
|
|
16281
|
-
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() =>
|
|
16371
|
+
const Qt = "0.62.3";
|
|
16372
|
+
function _t(b) {
|
|
16373
|
+
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => b()) : Promise.resolve().then(b);
|
|
16282
16374
|
}
|
|
16283
16375
|
const O = class O {
|
|
16284
16376
|
/**
|
|
@@ -16311,7 +16403,7 @@ const O = class O {
|
|
|
16311
16403
|
*/
|
|
16312
16404
|
static syncElement(e) {
|
|
16313
16405
|
const t = O.registrations.get(e), r = N.get(e);
|
|
16314
|
-
if (!(r instanceof
|
|
16406
|
+
if (!(r instanceof w) || !O.shouldObserve(r)) {
|
|
16315
16407
|
t && (t.observer.disconnect(), O.registrations.delete(e));
|
|
16316
16408
|
return;
|
|
16317
16409
|
}
|
|
@@ -16338,8 +16430,8 @@ const O = class O {
|
|
|
16338
16430
|
return;
|
|
16339
16431
|
let f = !1;
|
|
16340
16432
|
l.forEach((m) => {
|
|
16341
|
-
const
|
|
16342
|
-
u.observedRows.has(
|
|
16433
|
+
const y = m.target;
|
|
16434
|
+
u.observedRows.has(y) && (m.isIntersecting ? u.visibleRows.has(y) || (u.visibleRows.add(y), f = !0) : u.visibleRows.delete(y) && (f = !0));
|
|
16343
16435
|
}), f && O.scheduleCompute(u);
|
|
16344
16436
|
},
|
|
16345
16437
|
{
|
|
@@ -16436,7 +16528,7 @@ const O = class O {
|
|
|
16436
16528
|
*/
|
|
16437
16529
|
static realRowElements(e) {
|
|
16438
16530
|
return e.getChildren().filter(
|
|
16439
|
-
(t) => t instanceof
|
|
16531
|
+
(t) => t instanceof w && !t.hasAttribute(`${c.prefix}each-before`) && !t.hasAttribute(`${c.prefix}each-after`)
|
|
16440
16532
|
).map((t) => t.getTarget());
|
|
16441
16533
|
}
|
|
16442
16534
|
/**
|
|
@@ -16532,7 +16624,7 @@ const O = class O {
|
|
|
16532
16624
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
16533
16625
|
// 解除しない)。
|
|
16534
16626
|
kind: "nonSupply",
|
|
16535
|
-
sequence:
|
|
16627
|
+
sequence: w.nextSequence()
|
|
16536
16628
|
}).catch((o) => {
|
|
16537
16629
|
g.error("[Haori]", "Failed to publish visible range:", o);
|
|
16538
16630
|
});
|
|
@@ -16557,27 +16649,27 @@ const O = class O {
|
|
|
16557
16649
|
};
|
|
16558
16650
|
O.THRESHOLD = 0, O.DEFAULT_ROOT_MARGIN = "0px", O.registrations = /* @__PURE__ */ new Map();
|
|
16559
16651
|
let me = O;
|
|
16560
|
-
const
|
|
16652
|
+
const U = class U {
|
|
16561
16653
|
/**
|
|
16562
16654
|
* 既存の MutationObserver をすべて停止します。
|
|
16563
16655
|
*/
|
|
16564
16656
|
static disconnectMutationObservers() {
|
|
16565
|
-
|
|
16657
|
+
U._mutationObservers.forEach((e) => {
|
|
16566
16658
|
e.disconnect();
|
|
16567
|
-
}),
|
|
16659
|
+
}), U._mutationObservers.length = 0;
|
|
16568
16660
|
}
|
|
16569
16661
|
/**
|
|
16570
16662
|
* 初期化メソッド。
|
|
16571
16663
|
* ドキュメントのheadとbodyを監視対象として設定します。
|
|
16572
16664
|
*/
|
|
16573
16665
|
static async init() {
|
|
16574
|
-
if (
|
|
16666
|
+
if (U._initialized)
|
|
16575
16667
|
return;
|
|
16576
|
-
|
|
16577
|
-
|
|
16668
|
+
U._initialized = !0, U.disconnectMutationObservers(), w.setPendingMutationFlusher(() => {
|
|
16669
|
+
U.flushPendingMutations();
|
|
16578
16670
|
});
|
|
16579
16671
|
const e = new Ke();
|
|
16580
|
-
|
|
16672
|
+
U._dispatcher = e, e.startDeferred(), U._initialIntakes = [];
|
|
16581
16673
|
try {
|
|
16582
16674
|
const t = await Promise.allSettled([
|
|
16583
16675
|
M.scan(document.head),
|
|
@@ -16591,9 +16683,9 @@ const H = class H {
|
|
|
16591
16683
|
"[Haori]",
|
|
16592
16684
|
"Failed to build body fragment:",
|
|
16593
16685
|
i.reason
|
|
16594
|
-
), await
|
|
16686
|
+
), await U.waitInitialIntakes(), await z.wait(), document.body.setAttribute("data-haori-ready", ""), U.observe(document.head), U.observe(document.body), Ae.syncTree(document.body), ve.syncTree(document.body), me.syncTree(document.body);
|
|
16595
16687
|
} finally {
|
|
16596
|
-
|
|
16688
|
+
U._initialIntakes = null, e.release();
|
|
16597
16689
|
}
|
|
16598
16690
|
B.ready(Qt);
|
|
16599
16691
|
}
|
|
@@ -16604,7 +16696,7 @@ const H = class H {
|
|
|
16604
16696
|
* @returns 稼働中の EventDispatcher。未初期化の場合は null。
|
|
16605
16697
|
*/
|
|
16606
16698
|
static getDispatcher() {
|
|
16607
|
-
return
|
|
16699
|
+
return U._dispatcher;
|
|
16608
16700
|
}
|
|
16609
16701
|
/**
|
|
16610
16702
|
* 初期化の途中で取り込んだ DOM 変更の処理を、すべて待ちます。
|
|
@@ -16617,7 +16709,7 @@ const H = class H {
|
|
|
16617
16709
|
* @returns 待機完了の Promise
|
|
16618
16710
|
*/
|
|
16619
16711
|
static async waitInitialIntakes() {
|
|
16620
|
-
const e =
|
|
16712
|
+
const e = U._initialIntakes;
|
|
16621
16713
|
for (; e !== null && e.length > 0; )
|
|
16622
16714
|
await Promise.allSettled(e.splice(0));
|
|
16623
16715
|
}
|
|
@@ -16637,7 +16729,7 @@ const H = class H {
|
|
|
16637
16729
|
* @returns 戻り値はありません。
|
|
16638
16730
|
*/
|
|
16639
16731
|
static captureMutations(e) {
|
|
16640
|
-
if (
|
|
16732
|
+
if (U._mutationObservers.length > 0) {
|
|
16641
16733
|
e();
|
|
16642
16734
|
return;
|
|
16643
16735
|
}
|
|
@@ -16652,8 +16744,8 @@ const H = class H {
|
|
|
16652
16744
|
try {
|
|
16653
16745
|
e();
|
|
16654
16746
|
} finally {
|
|
16655
|
-
const r = t.takeRecords().map((i) =>
|
|
16656
|
-
t.disconnect(),
|
|
16747
|
+
const r = t.takeRecords().map((i) => U.toCapturedRecord(i));
|
|
16748
|
+
t.disconnect(), U.processMutations(r);
|
|
16657
16749
|
}
|
|
16658
16750
|
}
|
|
16659
16751
|
/**
|
|
@@ -16678,7 +16770,7 @@ const H = class H {
|
|
|
16678
16770
|
type: e.type,
|
|
16679
16771
|
target: e.target,
|
|
16680
16772
|
addedNodes: Array.from(e.addedNodes).filter(
|
|
16681
|
-
(t) => !
|
|
16773
|
+
(t) => !U.hasKnownDescendant(t)
|
|
16682
16774
|
),
|
|
16683
16775
|
removedNodes: []
|
|
16684
16776
|
};
|
|
@@ -16696,7 +16788,7 @@ const H = class H {
|
|
|
16696
16788
|
*/
|
|
16697
16789
|
static hasKnownDescendant(e) {
|
|
16698
16790
|
return e instanceof Element && Array.from(e.querySelectorAll("*")).some(
|
|
16699
|
-
(t) =>
|
|
16791
|
+
(t) => w.peek(t) !== null
|
|
16700
16792
|
);
|
|
16701
16793
|
}
|
|
16702
16794
|
/**
|
|
@@ -16716,7 +16808,7 @@ const H = class H {
|
|
|
16716
16808
|
* @returns 捨てる場合 true
|
|
16717
16809
|
*/
|
|
16718
16810
|
static isStaleExternalRemoval(e, t) {
|
|
16719
|
-
const r =
|
|
16811
|
+
const r = w.peek(t)?.getParent() ?? null;
|
|
16720
16812
|
return r === null || r.getTarget() === e.target ? !1 : r.getTarget().closest(`[${c.prefix}external]`) !== null;
|
|
16721
16813
|
}
|
|
16722
16814
|
/**
|
|
@@ -16742,14 +16834,14 @@ const H = class H {
|
|
|
16742
16834
|
*/
|
|
16743
16835
|
static observe(e) {
|
|
16744
16836
|
const t = new MutationObserver((r) => {
|
|
16745
|
-
|
|
16837
|
+
U.processMutations(r);
|
|
16746
16838
|
});
|
|
16747
16839
|
t.observe(e, {
|
|
16748
16840
|
childList: !0,
|
|
16749
16841
|
subtree: !0,
|
|
16750
16842
|
attributes: !0,
|
|
16751
16843
|
characterData: !0
|
|
16752
|
-
}),
|
|
16844
|
+
}), U._mutationObservers.push(t);
|
|
16753
16845
|
}
|
|
16754
16846
|
/**
|
|
16755
16847
|
* 保留中の DOM 変更を同期的に引き取って処理へ載せます。
|
|
@@ -16772,15 +16864,15 @@ const H = class H {
|
|
|
16772
16864
|
* @returns 戻り値はありません。
|
|
16773
16865
|
*/
|
|
16774
16866
|
static flushPendingMutations() {
|
|
16775
|
-
for (const e of
|
|
16867
|
+
for (const e of U._mutationObservers) {
|
|
16776
16868
|
const t = e.takeRecords();
|
|
16777
16869
|
if (t.length === 0)
|
|
16778
16870
|
continue;
|
|
16779
|
-
const r = t.filter(
|
|
16780
|
-
(n) => !
|
|
16871
|
+
const r = t.filter(U.isBindAttributeRecord), i = t.filter(
|
|
16872
|
+
(n) => !U.isBindAttributeRecord(n)
|
|
16781
16873
|
);
|
|
16782
|
-
r.length > 0 &&
|
|
16783
|
-
|
|
16874
|
+
r.length > 0 && U.processMutations(r, w.nextSequence()), i.length > 0 && Promise.resolve().then(() => {
|
|
16875
|
+
U.processMutations(i);
|
|
16784
16876
|
});
|
|
16785
16877
|
}
|
|
16786
16878
|
}
|
|
@@ -16804,7 +16896,7 @@ const H = class H {
|
|
|
16804
16896
|
static processMutations(e, t) {
|
|
16805
16897
|
for (const r of e)
|
|
16806
16898
|
try {
|
|
16807
|
-
if (
|
|
16899
|
+
if (U.isExternallyManaged(r.target))
|
|
16808
16900
|
continue;
|
|
16809
16901
|
switch (r.type) {
|
|
16810
16902
|
case "attributes": {
|
|
@@ -16812,7 +16904,7 @@ const H = class H {
|
|
|
16812
16904
|
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(pe) && (r.attributeName === "disabled" || r.attributeName === pe))
|
|
16813
16905
|
break;
|
|
16814
16906
|
if (r.attributeName && (r.attributeName === `${c.prefix}if-false` || r.attributeName === "style" && i.hasAttribute(`${c.prefix}if-false`))) {
|
|
16815
|
-
r.attributeName === "style" &&
|
|
16907
|
+
r.attributeName === "style" && w.reassertHiddenDisplay(i);
|
|
16816
16908
|
break;
|
|
16817
16909
|
}
|
|
16818
16910
|
if (r.attributeName && M.isAliasedAttributeReflection(i, r.attributeName))
|
|
@@ -16824,17 +16916,17 @@ const H = class H {
|
|
|
16824
16916
|
!0,
|
|
16825
16917
|
t
|
|
16826
16918
|
);
|
|
16827
|
-
|
|
16919
|
+
U._initialIntakes?.push(n), Ae.syncElement(i), ve.syncElement(i), me.syncElement(i);
|
|
16828
16920
|
break;
|
|
16829
16921
|
}
|
|
16830
16922
|
case "childList": {
|
|
16831
16923
|
Array.from(r.removedNodes).forEach((i) => {
|
|
16832
|
-
|
|
16924
|
+
U.isStaleExternalRemoval(r, i) || (Ae.cleanupTree(i), ve.cleanupTree(i), me.cleanupTree(i), M.removeNode(i));
|
|
16833
16925
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
16834
16926
|
if (!(i.parentElement instanceof Element))
|
|
16835
16927
|
return;
|
|
16836
16928
|
const n = M.addNode(i.parentElement, i);
|
|
16837
|
-
|
|
16929
|
+
U._initialIntakes?.push(n), Ae.syncTree(i), ve.syncTree(i), me.syncTree(i);
|
|
16838
16930
|
}), r.target instanceof Element && me.syncElement(r.target);
|
|
16839
16931
|
break;
|
|
16840
16932
|
}
|
|
@@ -16855,9 +16947,9 @@ const H = class H {
|
|
|
16855
16947
|
}
|
|
16856
16948
|
}
|
|
16857
16949
|
};
|
|
16858
|
-
|
|
16859
|
-
let ke =
|
|
16860
|
-
re.setMutationCapture((
|
|
16950
|
+
U._initialized = !1, U._mutationObservers = [], U._dispatcher = null, U._initialIntakes = null;
|
|
16951
|
+
let ke = U;
|
|
16952
|
+
re.setMutationCapture((b) => ke.captureMutations(b));
|
|
16861
16953
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", ke.init) : ke.init();
|
|
16862
16954
|
const er = () => Re.waitForRenders(), tr = Re.enhancers;
|
|
16863
16955
|
export {
|