haori 0.65.1 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +22 -22
- package/dist/haori.es.js +982 -890
- package/dist/haori.iife.js +25 -25
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Re = class Re {
|
|
2
2
|
/**
|
|
3
3
|
* 開発モードの状態を取得します。
|
|
4
4
|
*
|
|
5
5
|
* @returns 開発モードならtrue、そうでなければfalse
|
|
6
6
|
*/
|
|
7
7
|
static isEnabled() {
|
|
8
|
-
return
|
|
8
|
+
return Re.devMode;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* 開発モードを有効化します。
|
|
12
12
|
*/
|
|
13
13
|
static enable() {
|
|
14
|
-
|
|
14
|
+
Re.devMode = !0;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* 開発モードを無効化します。
|
|
18
18
|
*/
|
|
19
19
|
static disable() {
|
|
20
|
-
|
|
20
|
+
Re.devMode = !1;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* 開発モードを切り替えます。
|
|
@@ -25,11 +25,11 @@ const ve = class ve {
|
|
|
25
25
|
* @param enabled trueで有効化、falseで無効化
|
|
26
26
|
*/
|
|
27
27
|
static set(e) {
|
|
28
|
-
|
|
28
|
+
Re.devMode = e;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
let V =
|
|
31
|
+
Re.devMode = !1;
|
|
32
|
+
let V = Re;
|
|
33
33
|
const rt = "embedded";
|
|
34
34
|
function It(f) {
|
|
35
35
|
return f === "embedded" || f === "demo";
|
|
@@ -451,26 +451,26 @@ const rr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
451
451
|
}
|
|
452
452
|
};
|
|
453
453
|
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;
|
|
454
|
-
let
|
|
454
|
+
let le = I;
|
|
455
455
|
const Ft = "yyyy/MM/dd HH:mm", ir = "en-US", ft = 1e4;
|
|
456
|
-
function
|
|
456
|
+
function ge(f) {
|
|
457
457
|
return String(f).padStart(2, "0");
|
|
458
458
|
}
|
|
459
459
|
function Ct(f, e, t, r, i, s) {
|
|
460
460
|
return {
|
|
461
461
|
yyyy: String(f).padStart(4, "0"),
|
|
462
|
-
yy:
|
|
463
|
-
MM:
|
|
462
|
+
yy: ge(f % 100),
|
|
463
|
+
MM: ge(e),
|
|
464
464
|
M: String(e),
|
|
465
|
-
dd:
|
|
465
|
+
dd: ge(t),
|
|
466
466
|
d: String(t),
|
|
467
|
-
HH:
|
|
467
|
+
HH: ge(r),
|
|
468
468
|
H: String(r),
|
|
469
|
-
mm:
|
|
470
|
-
ss:
|
|
469
|
+
mm: ge(i),
|
|
470
|
+
ss: ge(s)
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function $t(f, e) {
|
|
474
474
|
let t;
|
|
475
475
|
try {
|
|
476
476
|
t = new Intl.DateTimeFormat("en-US", {
|
|
@@ -492,7 +492,7 @@ function Mt(f, e) {
|
|
|
492
492
|
const i = Number(r.year), s = Number(r.month), n = Number(r.day), a = Number(r.hour), o = Number(r.minute), l = Number(r.second);
|
|
493
493
|
return !Number.isFinite(i) || !Number.isFinite(s) || !Number.isFinite(n) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(l) ? null : Ct(i, s, n, a, o, l);
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ze(f, e = Ft, t) {
|
|
496
496
|
if (f == null || f === "")
|
|
497
497
|
return "";
|
|
498
498
|
const r = f instanceof Date ? f : new Date(f);
|
|
@@ -500,7 +500,7 @@ function Je(f, e = Ft, t) {
|
|
|
500
500
|
return "";
|
|
501
501
|
let i;
|
|
502
502
|
if (typeof t == "string" && t.trim() !== "") {
|
|
503
|
-
if (i =
|
|
503
|
+
if (i = $t(r, t.trim()), i === null)
|
|
504
504
|
return "";
|
|
505
505
|
} else
|
|
506
506
|
i = Ct(
|
|
@@ -518,14 +518,14 @@ function Je(f, e = Ft, t) {
|
|
|
518
518
|
);
|
|
519
519
|
}
|
|
520
520
|
const sr = "yyyy-MM-dd";
|
|
521
|
-
function
|
|
522
|
-
return
|
|
521
|
+
function Mt(f = Ft, e) {
|
|
522
|
+
return Ze(/* @__PURE__ */ new Date(), f, e);
|
|
523
523
|
}
|
|
524
524
|
function Pt(f = 0, e = sr, t) {
|
|
525
525
|
const r = Number.isFinite(f) ? Math.trunc(f) : 0, i = typeof t == "string" && t.trim() !== "" ? t.trim() : "";
|
|
526
526
|
let s, n, a;
|
|
527
527
|
if (i !== "") {
|
|
528
|
-
const l =
|
|
528
|
+
const l = $t(/* @__PURE__ */ new Date(), i);
|
|
529
529
|
if (l === null)
|
|
530
530
|
return "";
|
|
531
531
|
s = Number(l.yyyy), n = Number(l.MM), a = Number(l.dd);
|
|
@@ -534,7 +534,7 @@ function Pt(f = 0, e = sr, t) {
|
|
|
534
534
|
s = l.getFullYear(), n = l.getMonth() + 1, a = l.getDate();
|
|
535
535
|
}
|
|
536
536
|
const o = new Date(Date.UTC(s, n - 1, a + r));
|
|
537
|
-
return
|
|
537
|
+
return Ze(o, e, "UTC");
|
|
538
538
|
}
|
|
539
539
|
function Lt(f, e) {
|
|
540
540
|
if (f == null)
|
|
@@ -609,11 +609,11 @@ function Bt(f, e, t = {}) {
|
|
|
609
609
|
return l;
|
|
610
610
|
}
|
|
611
611
|
const nr = /^(\d{4})-(\d{1,2})$/, ar = 1200;
|
|
612
|
-
function
|
|
612
|
+
function qe(f, e) {
|
|
613
613
|
const t = Number(f);
|
|
614
614
|
return Number.isFinite(t) ? Math.trunc(t) : e;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Qe(f, e) {
|
|
617
617
|
if (typeof f != "string")
|
|
618
618
|
return "";
|
|
619
619
|
const t = nr.exec(f.trim());
|
|
@@ -623,13 +623,13 @@ function Ze(f, e) {
|
|
|
623
623
|
if (i < 1 || i > 12)
|
|
624
624
|
return "";
|
|
625
625
|
const s = Number.isFinite(e) ? Math.trunc(e) : 0, n = r * 12 + (i - 1) + s, a = Math.floor(n / 12), o = n - a * 12 + 1;
|
|
626
|
-
return `${String(a).padStart(4, "0")}-${
|
|
626
|
+
return `${String(a).padStart(4, "0")}-${ge(o)}`;
|
|
627
627
|
}
|
|
628
628
|
function or(f) {
|
|
629
629
|
if (typeof f == "string" && f.trim() !== "")
|
|
630
|
-
return
|
|
630
|
+
return Qe(f, 0);
|
|
631
631
|
const e = /* @__PURE__ */ new Date();
|
|
632
|
-
return `${String(e.getFullYear()).padStart(4, "0")}-${
|
|
632
|
+
return `${String(e.getFullYear()).padStart(4, "0")}-${ge(e.getMonth() + 1)}`;
|
|
633
633
|
}
|
|
634
634
|
function Ut(f, e) {
|
|
635
635
|
const t = Math.trunc(Number(f));
|
|
@@ -640,7 +640,7 @@ function Ut(f, e) {
|
|
|
640
640
|
return [];
|
|
641
641
|
const i = Math.min(t, ar), s = [];
|
|
642
642
|
for (let n = 0; n <= i; n += 1) {
|
|
643
|
-
const a =
|
|
643
|
+
const a = Qe(r, -n);
|
|
644
644
|
s.push({ targetMonth: a, label: a.replace(/-/g, "/") });
|
|
645
645
|
}
|
|
646
646
|
return s;
|
|
@@ -649,15 +649,15 @@ function Ht(f, e) {
|
|
|
649
649
|
const t = { start: 0, end: 0, total: 0, empty: !0 };
|
|
650
650
|
if (!f || typeof f != "object")
|
|
651
651
|
return t;
|
|
652
|
-
const r = f, i =
|
|
652
|
+
const r = f, i = qe(r.totalElements ?? r.totalCount, 0);
|
|
653
653
|
if (i <= 0)
|
|
654
654
|
return t;
|
|
655
|
-
const s = Math.max(0,
|
|
655
|
+
const s = Math.max(0, qe(r.number, 0)), n = Math.max(0, qe(r.size, 0)), a = s * n, o = Math.min(a + 1, i);
|
|
656
656
|
let l;
|
|
657
657
|
if (e !== void 0 && Number.isFinite(e))
|
|
658
658
|
l = Math.max(0, Math.trunc(e));
|
|
659
659
|
else {
|
|
660
|
-
const d =
|
|
660
|
+
const d = qe(r.numberOfElements, NaN);
|
|
661
661
|
l = Number.isFinite(d) ? d : Math.min(n, i - a);
|
|
662
662
|
}
|
|
663
663
|
const u = Math.min(a + l, i);
|
|
@@ -712,13 +712,13 @@ function Kt(f, e) {
|
|
|
712
712
|
return r;
|
|
713
713
|
}
|
|
714
714
|
const lr = Object.freeze({
|
|
715
|
-
date:
|
|
716
|
-
now:
|
|
715
|
+
date: Ze,
|
|
716
|
+
now: Mt,
|
|
717
717
|
today: Pt,
|
|
718
718
|
number: Lt,
|
|
719
719
|
pages: Bt,
|
|
720
720
|
range: Ot,
|
|
721
|
-
monthAdd:
|
|
721
|
+
monthAdd: Qe,
|
|
722
722
|
monthRange: Ut,
|
|
723
723
|
pageSummary: Ht,
|
|
724
724
|
findBy: Vt,
|
|
@@ -879,7 +879,7 @@ const lt = class lt {
|
|
|
879
879
|
}
|
|
880
880
|
};
|
|
881
881
|
lt.ASYNC_QUEUE = new at();
|
|
882
|
-
let
|
|
882
|
+
let J = lt;
|
|
883
883
|
const zt = /* @__PURE__ */ new Set([
|
|
884
884
|
"window",
|
|
885
885
|
"self",
|
|
@@ -908,7 +908,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
908
908
|
"sessionStorage",
|
|
909
909
|
"IndexedDB",
|
|
910
910
|
"history"
|
|
911
|
-
]),
|
|
911
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
912
912
|
"eval",
|
|
913
913
|
"arguments"
|
|
914
914
|
]), Gt = /* @__PURE__ */ new Set([
|
|
@@ -919,11 +919,11 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
919
919
|
"localStorage",
|
|
920
920
|
"sessionStorage",
|
|
921
921
|
"IndexedDB"
|
|
922
|
-
]),
|
|
922
|
+
]), ze = /* @__PURE__ */ new Set([
|
|
923
923
|
"constructor",
|
|
924
924
|
"__proto__",
|
|
925
925
|
"prototype"
|
|
926
|
-
]),
|
|
926
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
927
927
|
"await",
|
|
928
928
|
"break",
|
|
929
929
|
"case",
|
|
@@ -1509,7 +1509,7 @@ class pr {
|
|
|
1509
1509
|
* @param position 位置
|
|
1510
1510
|
*/
|
|
1511
1511
|
checkReferenceName(e, t) {
|
|
1512
|
-
if (
|
|
1512
|
+
if (Ge.has(e) || Ke.has(e) || it.has(e))
|
|
1513
1513
|
throw Y(X.notInExpressions(e), t);
|
|
1514
1514
|
}
|
|
1515
1515
|
/**
|
|
@@ -1532,7 +1532,7 @@ class pr {
|
|
|
1532
1532
|
* @param position 位置
|
|
1533
1533
|
*/
|
|
1534
1534
|
checkPropertyName(e, t) {
|
|
1535
|
-
if (
|
|
1535
|
+
if (Ge.has(e) || Ke.has(e) || ze.has(e))
|
|
1536
1536
|
throw Y(X.notProperty(e), t);
|
|
1537
1537
|
}
|
|
1538
1538
|
/**
|
|
@@ -1996,7 +1996,7 @@ class pr {
|
|
|
1996
1996
|
return this.checkPropertyName(e.value, e.start), this.advance(), e.value;
|
|
1997
1997
|
if (e.type === "string") {
|
|
1998
1998
|
const t = e.literal;
|
|
1999
|
-
if (
|
|
1999
|
+
if (ze.has(t))
|
|
2000
2000
|
throw Y(X.notProperty(t), e.start);
|
|
2001
2001
|
return this.advance(), t;
|
|
2002
2002
|
}
|
|
@@ -2129,7 +2129,7 @@ function mt(f, e) {
|
|
|
2129
2129
|
}
|
|
2130
2130
|
function yt(f) {
|
|
2131
2131
|
const e = typeof f == "symbol" ? f : String(f);
|
|
2132
|
-
return
|
|
2132
|
+
return ze.has(e) ? "undefined" : e;
|
|
2133
2133
|
}
|
|
2134
2134
|
function mr(f) {
|
|
2135
2135
|
return typeof f == "bigint" ? f : Number(f);
|
|
@@ -2711,8 +2711,8 @@ const ct = class ct {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
};
|
|
2713
2713
|
ct.COMPILE_CACHE = /* @__PURE__ */ new Map();
|
|
2714
|
-
let
|
|
2715
|
-
const
|
|
2714
|
+
let Le = ct;
|
|
2715
|
+
const T = class T {
|
|
2716
2716
|
/**
|
|
2717
2717
|
* 明示バインド内に持ち込まれてはならない危険値を返します。
|
|
2718
2718
|
*
|
|
@@ -3140,7 +3140,7 @@ let ${e.join(", ")};`;
|
|
|
3140
3140
|
n.push(l), l && s.push({
|
|
3141
3141
|
start: o.position + 1,
|
|
3142
3142
|
end: o.position + 1,
|
|
3143
|
-
text:
|
|
3143
|
+
text: T.MEMBER_KEY_GUARD_OPEN
|
|
3144
3144
|
});
|
|
3145
3145
|
} else o.value === "]" && n.pop() === !0 && s.push({
|
|
3146
3146
|
start: o.position,
|
|
@@ -3210,7 +3210,7 @@ let ${e.join(", ")};`;
|
|
|
3210
3210
|
* @return 戻り値はありません。
|
|
3211
3211
|
*/
|
|
3212
3212
|
static scheduleUnresolvedIdentifierReport() {
|
|
3213
|
-
this.unresolvedReportScheduled || (this.unresolvedReportScheduled = !0,
|
|
3213
|
+
this.unresolvedReportScheduled || (this.unresolvedReportScheduled = !0, J.waitForIdle().then(() => {
|
|
3214
3214
|
this.unresolvedReportScheduled = !1, this.reportUnresolvedIdentifiers();
|
|
3215
3215
|
}));
|
|
3216
3216
|
}
|
|
@@ -3278,7 +3278,7 @@ let ${e.join(", ")};`;
|
|
|
3278
3278
|
this.pendingScopeMissingIdentifiers.delete(t);
|
|
3279
3279
|
return;
|
|
3280
3280
|
}
|
|
3281
|
-
this.pendingScopeMissingIdentifiers.set(t, new Set(e)), !this.scopeMissingReportScheduled && (this.scopeMissingReportScheduled = !0,
|
|
3281
|
+
this.pendingScopeMissingIdentifiers.set(t, new Set(e)), !this.scopeMissingReportScheduled && (this.scopeMissingReportScheduled = !0, J.waitForIdle().then(() => {
|
|
3282
3282
|
this.scopeMissingReportScheduled = !1, this.reportScopeMissingIdentifiers();
|
|
3283
3283
|
}));
|
|
3284
3284
|
}
|
|
@@ -3324,11 +3324,11 @@ ${t}`;
|
|
|
3324
3324
|
* @returns `callback` の戻り値
|
|
3325
3325
|
*/
|
|
3326
3326
|
static withoutDiagnosis(e) {
|
|
3327
|
-
|
|
3327
|
+
T.evaluatingForDiagnosis = !0;
|
|
3328
3328
|
try {
|
|
3329
3329
|
return e();
|
|
3330
3330
|
} finally {
|
|
3331
|
-
|
|
3331
|
+
T.evaluatingForDiagnosis = !1;
|
|
3332
3332
|
}
|
|
3333
3333
|
}
|
|
3334
3334
|
/**
|
|
@@ -3612,7 +3612,7 @@ ${t}`;
|
|
|
3612
3612
|
const o = {};
|
|
3613
3613
|
t.bindKeys.forEach((l, u) => {
|
|
3614
3614
|
o[l] = s[u];
|
|
3615
|
-
}), n = () =>
|
|
3615
|
+
}), n = () => Le.run(a, o);
|
|
3616
3616
|
} else
|
|
3617
3617
|
n = () => t.evaluator.call(this.BUILTIN_HOLDER, ...s);
|
|
3618
3618
|
return this.getExpressionProfile(e).needsPropertyBlocking ? this.withBlockedPropertyAccess(n) : n();
|
|
@@ -3697,7 +3697,7 @@ ${u}return (${y});` + d;
|
|
|
3697
3697
|
*/
|
|
3698
3698
|
static prepareInterpretedEvaluator(e, t) {
|
|
3699
3699
|
try {
|
|
3700
|
-
const r =
|
|
3700
|
+
const r = Le.compile(e);
|
|
3701
3701
|
return { bindKeys: t, evaluator: null, compileFailed: !1, compiled: r };
|
|
3702
3702
|
} catch (r) {
|
|
3703
3703
|
return m.error("[Haori]", "Failed to compile expression:", e, r), this.compileFailedExpressions.add(e), { bindKeys: t, evaluator: null, compileFailed: !0 };
|
|
@@ -3858,17 +3858,17 @@ ${u}return (${y});` + d;
|
|
|
3858
3858
|
* @returns 食い違っている場合は両辺の型。該当しない場合は null
|
|
3859
3859
|
*/
|
|
3860
3860
|
static diagnoseStrictComparison(e, t = {}) {
|
|
3861
|
-
const r =
|
|
3861
|
+
const r = T.splitStrictComparison(e);
|
|
3862
3862
|
if (r === null)
|
|
3863
3863
|
return null;
|
|
3864
|
-
const [i, s] =
|
|
3865
|
-
|
|
3866
|
-
|
|
3864
|
+
const [i, s] = T.withoutDiagnosis(() => [
|
|
3865
|
+
T.evaluateDetailed(r.left, t),
|
|
3866
|
+
T.evaluateDetailed(r.right, t)
|
|
3867
3867
|
]);
|
|
3868
3868
|
if (i.unresolvedReference || s.unresolvedReference)
|
|
3869
3869
|
return null;
|
|
3870
3870
|
const n = i.value, a = s.value;
|
|
3871
|
-
return typeof n == typeof a || !
|
|
3871
|
+
return typeof n == typeof a || !T.isLooselyEqual(n, a) ? null : { left: typeof n, right: typeof a };
|
|
3872
3872
|
}
|
|
3873
3873
|
/**
|
|
3874
3874
|
* 型をまたいだ緩い比較(`==`)を行います。
|
|
@@ -3895,11 +3895,11 @@ ${u}return (${y});` + d;
|
|
|
3895
3895
|
* @returns 左辺と右辺。単一の厳密比較でない場合は null
|
|
3896
3896
|
*/
|
|
3897
3897
|
static splitStrictComparison(e) {
|
|
3898
|
-
const t =
|
|
3898
|
+
const t = T.strictComparisonSplits.get(e);
|
|
3899
3899
|
if (t !== void 0)
|
|
3900
3900
|
return t;
|
|
3901
|
-
const r =
|
|
3902
|
-
return
|
|
3901
|
+
const r = T.computeStrictComparisonSplit(e);
|
|
3902
|
+
return T.strictComparisonSplits.set(e, r), r;
|
|
3903
3903
|
}
|
|
3904
3904
|
/**
|
|
3905
3905
|
* 式を単一の厳密比較として分割します(記憶しない実体)。
|
|
@@ -3908,7 +3908,7 @@ ${u}return (${y});` + d;
|
|
|
3908
3908
|
* @returns 左辺と右辺。単一の厳密比較でない場合は null
|
|
3909
3909
|
*/
|
|
3910
3910
|
static computeStrictComparisonSplit(e) {
|
|
3911
|
-
const t =
|
|
3911
|
+
const t = T.tokenizeExpression(e);
|
|
3912
3912
|
if (t === null)
|
|
3913
3913
|
return null;
|
|
3914
3914
|
let r = 0, i = null;
|
|
@@ -3924,7 +3924,7 @@ ${u}return (${y});` + d;
|
|
|
3924
3924
|
}
|
|
3925
3925
|
if (r === 0) {
|
|
3926
3926
|
if (a.value === "&&")
|
|
3927
|
-
return
|
|
3927
|
+
return T.splitStrictComparison(
|
|
3928
3928
|
e.slice(0, a.position)
|
|
3929
3929
|
);
|
|
3930
3930
|
if (a.value === "===") {
|
|
@@ -3933,7 +3933,7 @@ ${u}return (${y});` + d;
|
|
|
3933
3933
|
i = a;
|
|
3934
3934
|
continue;
|
|
3935
3935
|
}
|
|
3936
|
-
if (
|
|
3936
|
+
if (T.COMPOSING_OPERATORS.has(a.value))
|
|
3937
3937
|
return null;
|
|
3938
3938
|
}
|
|
3939
3939
|
}
|
|
@@ -4464,33 +4464,33 @@ ${u}return (${y});` + d;
|
|
|
4464
4464
|
return a.cut ? (i && (i.cut = !0), !1) : (this.forbiddenBindingValueCache.set(e, !1), !1);
|
|
4465
4465
|
}
|
|
4466
4466
|
};
|
|
4467
|
-
|
|
4467
|
+
T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HELPERS = {
|
|
4468
4468
|
...lr
|
|
4469
|
-
},
|
|
4470
|
-
...[...
|
|
4469
|
+
}, 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.STRICT_PARAMETER_RESERVED_WORDS = /* @__PURE__ */ new Set([
|
|
4470
|
+
...[...Ge].filter((e) => e !== "await"),
|
|
4471
4471
|
...it,
|
|
4472
|
-
...
|
|
4472
|
+
...Ke,
|
|
4473
4473
|
"extends",
|
|
4474
4474
|
"true",
|
|
4475
4475
|
"false",
|
|
4476
4476
|
"null"
|
|
4477
|
-
]),
|
|
4477
|
+
]), T.evalBlockedReported = !1, 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 = [
|
|
4478
4478
|
...zt
|
|
4479
|
-
],
|
|
4480
|
-
...
|
|
4481
|
-
],
|
|
4482
|
-
...
|
|
4483
|
-
(e) => !
|
|
4479
|
+
], T.STRICT_FORBIDDEN_NAMES = [
|
|
4480
|
+
...Ke
|
|
4481
|
+
], T.REBINDABLE_FORBIDDEN_NAMES = Gt, T.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
|
|
4482
|
+
...T.FORBIDDEN_NAMES.filter(
|
|
4483
|
+
(e) => !T.REBINDABLE_FORBIDDEN_NAMES.has(e)
|
|
4484
4484
|
),
|
|
4485
4485
|
"constructor",
|
|
4486
4486
|
"__proto__",
|
|
4487
4487
|
"prototype",
|
|
4488
|
-
...
|
|
4489
|
-
]),
|
|
4488
|
+
...T.STRICT_FORBIDDEN_NAMES
|
|
4489
|
+
]), T.FORBIDDEN_PROPERTY_NAMES = ze, T.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
|
|
4490
4490
|
"get",
|
|
4491
4491
|
"set",
|
|
4492
4492
|
"async"
|
|
4493
|
-
]),
|
|
4493
|
+
]), T.DISALLOWED_KEYWORDS = Ge, T.NON_SHADOWABLE_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
4494
4494
|
// リテラル・グローバル定数
|
|
4495
4495
|
"true",
|
|
4496
4496
|
"false",
|
|
@@ -4500,11 +4500,11 @@ k.MAX_IDENTIFIER_RECOVERY_COUNT = 8, k.BUILTIN_NAMESPACE = "haori", k.BUILTIN_HE
|
|
|
4500
4500
|
"Infinity",
|
|
4501
4501
|
// strict モードの予約語(`let` 宣言が構文エラーになる)
|
|
4502
4502
|
...it
|
|
4503
|
-
]),
|
|
4503
|
+
]), T.ALLOWED_GLOBAL_IDENTIFIERS = Yt, T.BUILTIN_HOLDER = Object.freeze(
|
|
4504
4504
|
Object.defineProperties(
|
|
4505
4505
|
{},
|
|
4506
4506
|
Object.fromEntries(
|
|
4507
|
-
[...
|
|
4507
|
+
[...T.ALLOWED_GLOBAL_IDENTIFIERS].map((e) => [
|
|
4508
4508
|
e,
|
|
4509
4509
|
{
|
|
4510
4510
|
get: () => globalThis[e],
|
|
@@ -4513,10 +4513,10 @@ k.MAX_IDENTIFIER_RECOVERY_COUNT = 8, k.BUILTIN_NAMESPACE = "haori", k.BUILTIN_HE
|
|
|
4513
4513
|
])
|
|
4514
4514
|
)
|
|
4515
4515
|
)
|
|
4516
|
-
),
|
|
4516
|
+
), 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) => ({
|
|
4517
4517
|
name: e,
|
|
4518
4518
|
pattern: new RegExp(`(^|[^\\w$.])${e}(?![\\w$])`)
|
|
4519
|
-
})),
|
|
4519
|
+
})), 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([
|
|
4520
4520
|
"||",
|
|
4521
4521
|
"?",
|
|
4522
4522
|
":",
|
|
@@ -4535,9 +4535,9 @@ k.MAX_IDENTIFIER_RECOVERY_COUNT = 8, k.BUILTIN_NAMESPACE = "haori", k.BUILTIN_HE
|
|
|
4535
4535
|
"/",
|
|
4536
4536
|
"%",
|
|
4537
4537
|
"..."
|
|
4538
|
-
]),
|
|
4539
|
-
let
|
|
4540
|
-
class
|
|
4538
|
+
]), T.strictComparisonSplits = /* @__PURE__ */ new Map(), T.WRAPPED_VALUES = /* @__PURE__ */ new WeakSet();
|
|
4539
|
+
let re = T;
|
|
4540
|
+
class Oe {
|
|
4541
4541
|
/**
|
|
4542
4542
|
* URLのクエリパラメータを取得します。
|
|
4543
4543
|
*
|
|
@@ -4618,12 +4618,12 @@ class $e {
|
|
|
4618
4618
|
return /^(?:javascript|vbscript):/i.test(t);
|
|
4619
4619
|
}
|
|
4620
4620
|
}
|
|
4621
|
-
const
|
|
4621
|
+
const ve = "data-haori-if-disabled", At = "input, select, textarea, button, fieldset", P = class P {
|
|
4622
4622
|
/**
|
|
4623
4623
|
* 集計状態を初期化します。
|
|
4624
4624
|
*/
|
|
4625
4625
|
static reset() {
|
|
4626
|
-
|
|
4626
|
+
P.ELEMENT_STORES.clear(), P.ensureGlobalAccess();
|
|
4627
4627
|
}
|
|
4628
4628
|
/**
|
|
4629
4629
|
* 集計を開始します。
|
|
@@ -4631,7 +4631,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4631
4631
|
* @returns 戻り値はありません。
|
|
4632
4632
|
*/
|
|
4633
4633
|
static start() {
|
|
4634
|
-
|
|
4634
|
+
P.collecting = !0;
|
|
4635
4635
|
}
|
|
4636
4636
|
/**
|
|
4637
4637
|
* 集計を停止します。
|
|
@@ -4639,7 +4639,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4639
4639
|
* @returns 戻り値はありません。
|
|
4640
4640
|
*/
|
|
4641
4641
|
static stop() {
|
|
4642
|
-
|
|
4642
|
+
P.collecting = !1;
|
|
4643
4643
|
}
|
|
4644
4644
|
/**
|
|
4645
4645
|
* 集計中かどうかを返します。
|
|
@@ -4647,7 +4647,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4647
4647
|
* @returns 集計中なら true
|
|
4648
4648
|
*/
|
|
4649
4649
|
static isCollecting() {
|
|
4650
|
-
return
|
|
4650
|
+
return P.collecting && V.isEnabled();
|
|
4651
4651
|
}
|
|
4652
4652
|
/**
|
|
4653
4653
|
* 現在の集計結果スナップショットを返します。
|
|
@@ -4655,7 +4655,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4655
4655
|
* @returns エレメントごとの集計結果
|
|
4656
4656
|
*/
|
|
4657
4657
|
static snapshot() {
|
|
4658
|
-
return
|
|
4658
|
+
return P.ensureGlobalAccess(), [...P.ELEMENT_STORES.entries()].map(([e, t]) => ({
|
|
4659
4659
|
elementId: e,
|
|
4660
4660
|
tagName: t.tagName,
|
|
4661
4661
|
attributes: [...t.attributes.entries()].map(([r, i]) => ({
|
|
@@ -4664,7 +4664,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4664
4664
|
calls: i.calls,
|
|
4665
4665
|
totalDurationMs: i.totalDurationMs,
|
|
4666
4666
|
maxDurationMs: i.maxDurationMs,
|
|
4667
|
-
placeholders:
|
|
4667
|
+
placeholders: P.sortPlaceholders(
|
|
4668
4668
|
i.placeholders
|
|
4669
4669
|
)
|
|
4670
4670
|
})).sort((r, i) => i.calls - r.calls),
|
|
@@ -4674,7 +4674,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4674
4674
|
calls: i.calls,
|
|
4675
4675
|
totalDurationMs: i.totalDurationMs,
|
|
4676
4676
|
maxDurationMs: i.maxDurationMs,
|
|
4677
|
-
placeholders:
|
|
4677
|
+
placeholders: P.sortPlaceholders(
|
|
4678
4678
|
i.placeholders
|
|
4679
4679
|
)
|
|
4680
4680
|
})).sort((r, i) => i.calls - r.calls)
|
|
@@ -4698,7 +4698,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4698
4698
|
* @param limit 出力する宣言の数。既定は 20
|
|
4699
4699
|
* @returns 要約。合計は `limit` で絞る前の全件から求める
|
|
4700
4700
|
*/
|
|
4701
|
-
static report(e =
|
|
4701
|
+
static report(e = P.DEFAULT_REPORT_LIMIT) {
|
|
4702
4702
|
const t = /* @__PURE__ */ new Map();
|
|
4703
4703
|
let r = 0, i = 0;
|
|
4704
4704
|
const s = (l, u, d) => {
|
|
@@ -4722,7 +4722,7 @@ const be = "data-haori-if-disabled", At = "input, select, textarea, button, fiel
|
|
|
4722
4722
|
d.maxDurationMs
|
|
4723
4723
|
), d.totalDurationMs > y.representativeDurationMs && (y.where = u, y.representativeDurationMs = d.totalDurationMs);
|
|
4724
4724
|
};
|
|
4725
|
-
|
|
4725
|
+
P.snapshot().forEach((l) => {
|
|
4726
4726
|
l.attributes.forEach((u) => {
|
|
4727
4727
|
s(
|
|
4728
4728
|
`@${u.name}
|
|
@@ -4752,7 +4752,7 @@ ${u.template}`,
|
|
|
4752
4752
|
entryCount: n.length,
|
|
4753
4753
|
top: a
|
|
4754
4754
|
};
|
|
4755
|
-
return
|
|
4755
|
+
return P.logReport(o), o;
|
|
4756
4756
|
}
|
|
4757
4757
|
/**
|
|
4758
4758
|
* 要約を表形式でコンソールへ出力します。
|
|
@@ -4782,30 +4782,30 @@ ${u.template}`,
|
|
|
4782
4782
|
* @param expressions 今回評価した式一覧
|
|
4783
4783
|
*/
|
|
4784
4784
|
static record(e, t, r) {
|
|
4785
|
-
if (!V.isEnabled() || !e || t.length === 0 || (
|
|
4785
|
+
if (!V.isEnabled() || !e || t.length === 0 || (P.ensureGlobalAccess(), !P.isCollecting()))
|
|
4786
4786
|
return;
|
|
4787
|
-
const i =
|
|
4787
|
+
const i = P.getOrCreateElementStore(
|
|
4788
4788
|
e.element
|
|
4789
4789
|
);
|
|
4790
4790
|
if (e.kind === "attribute") {
|
|
4791
|
-
const n =
|
|
4791
|
+
const n = P.getOrCreateCounter(
|
|
4792
4792
|
i.attributes,
|
|
4793
4793
|
e.rawName,
|
|
4794
4794
|
e.template
|
|
4795
4795
|
);
|
|
4796
|
-
|
|
4796
|
+
P.updateCounter(
|
|
4797
4797
|
n,
|
|
4798
4798
|
t,
|
|
4799
4799
|
r
|
|
4800
4800
|
);
|
|
4801
4801
|
return;
|
|
4802
4802
|
}
|
|
4803
|
-
const s =
|
|
4803
|
+
const s = P.getOrCreateCounter(
|
|
4804
4804
|
i.texts,
|
|
4805
4805
|
String(e.childIndex),
|
|
4806
4806
|
e.template
|
|
4807
4807
|
);
|
|
4808
|
-
|
|
4808
|
+
P.updateCounter(
|
|
4809
4809
|
s,
|
|
4810
4810
|
t,
|
|
4811
4811
|
r
|
|
@@ -4818,12 +4818,12 @@ ${u.template}`,
|
|
|
4818
4818
|
if (!V.isEnabled())
|
|
4819
4819
|
return;
|
|
4820
4820
|
const e = globalThis;
|
|
4821
|
-
e[
|
|
4822
|
-
start: () =>
|
|
4823
|
-
stop: () =>
|
|
4824
|
-
reset: () =>
|
|
4825
|
-
snapshot: () =>
|
|
4826
|
-
report: (t) =>
|
|
4821
|
+
e[P.GLOBAL_KEY] === void 0 && (e[P.GLOBAL_KEY] = {
|
|
4822
|
+
start: () => P.start(),
|
|
4823
|
+
stop: () => P.stop(),
|
|
4824
|
+
reset: () => P.reset(),
|
|
4825
|
+
snapshot: () => P.snapshot(),
|
|
4826
|
+
report: (t) => P.report(t)
|
|
4827
4827
|
});
|
|
4828
4828
|
}
|
|
4829
4829
|
/**
|
|
@@ -4833,7 +4833,7 @@ ${u.template}`,
|
|
|
4833
4833
|
* @returns 集計ストア
|
|
4834
4834
|
*/
|
|
4835
4835
|
static getOrCreateElementStore(e) {
|
|
4836
|
-
const t =
|
|
4836
|
+
const t = P.createElementId(e), r = P.ELEMENT_STORES.get(t);
|
|
4837
4837
|
if (r)
|
|
4838
4838
|
return r;
|
|
4839
4839
|
const i = {
|
|
@@ -4841,7 +4841,7 @@ ${u.template}`,
|
|
|
4841
4841
|
attributes: /* @__PURE__ */ new Map(),
|
|
4842
4842
|
texts: /* @__PURE__ */ new Map()
|
|
4843
4843
|
};
|
|
4844
|
-
return
|
|
4844
|
+
return P.ELEMENT_STORES.set(t, i), i;
|
|
4845
4845
|
}
|
|
4846
4846
|
/**
|
|
4847
4847
|
* カウンタを取得または初期化します。
|
|
@@ -4891,7 +4891,7 @@ ${u.template}`,
|
|
|
4891
4891
|
*/
|
|
4892
4892
|
static updateCounter(e, t, r) {
|
|
4893
4893
|
e.calls += 1, e.totalDurationMs += r, e.maxDurationMs = Math.max(e.maxDurationMs, r), t.forEach((i) => {
|
|
4894
|
-
const s =
|
|
4894
|
+
const s = P.getOrCreatePlaceholder(
|
|
4895
4895
|
e.placeholders,
|
|
4896
4896
|
i.expression
|
|
4897
4897
|
);
|
|
@@ -4930,12 +4930,12 @@ ${u.template}`,
|
|
|
4930
4930
|
* @returns 結果と所要時間
|
|
4931
4931
|
*/
|
|
4932
4932
|
static measure(e) {
|
|
4933
|
-
if (!
|
|
4933
|
+
if (!P.isCollecting())
|
|
4934
4934
|
return { value: e(), durationMs: 0 };
|
|
4935
|
-
const t =
|
|
4935
|
+
const t = P.now();
|
|
4936
4936
|
return {
|
|
4937
4937
|
value: e(),
|
|
4938
|
-
durationMs:
|
|
4938
|
+
durationMs: P.now() - t
|
|
4939
4939
|
};
|
|
4940
4940
|
}
|
|
4941
4941
|
/**
|
|
@@ -4962,29 +4962,29 @@ ${u.template}`,
|
|
|
4962
4962
|
return t.join(" > ");
|
|
4963
4963
|
}
|
|
4964
4964
|
};
|
|
4965
|
-
|
|
4966
|
-
let
|
|
4967
|
-
const
|
|
4965
|
+
P.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", P.ELEMENT_STORES = /* @__PURE__ */ new Map(), P.collecting = !1, P.DEFAULT_REPORT_LIMIT = 20;
|
|
4966
|
+
let Ye = P;
|
|
4967
|
+
const me = class me {
|
|
4968
4968
|
/**
|
|
4969
4969
|
* フラグメントのコンストラクタ。
|
|
4970
4970
|
*
|
|
4971
4971
|
* @param target 対象ノード
|
|
4972
4972
|
*/
|
|
4973
4973
|
constructor(e) {
|
|
4974
|
-
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e,
|
|
4974
|
+
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e, me.FRAGMENT_CACHE.set(e, this);
|
|
4975
4975
|
}
|
|
4976
4976
|
static get(e) {
|
|
4977
4977
|
if (e == null)
|
|
4978
4978
|
return null;
|
|
4979
|
-
if (
|
|
4980
|
-
return
|
|
4979
|
+
if (me.FRAGMENT_CACHE.has(e))
|
|
4980
|
+
return me.FRAGMENT_CACHE.get(e);
|
|
4981
4981
|
let t;
|
|
4982
4982
|
switch (e.nodeType) {
|
|
4983
4983
|
case Node.ELEMENT_NODE:
|
|
4984
4984
|
t = new R(e);
|
|
4985
4985
|
break;
|
|
4986
4986
|
case Node.TEXT_NODE:
|
|
4987
|
-
t = new
|
|
4987
|
+
t = new de(e);
|
|
4988
4988
|
break;
|
|
4989
4989
|
case Node.COMMENT_NODE:
|
|
4990
4990
|
t = new ot(e);
|
|
@@ -5005,7 +5005,7 @@ const pe = class pe {
|
|
|
5005
5005
|
* @returns キャッシュ済みのフラグメント。無ければ `null`
|
|
5006
5006
|
*/
|
|
5007
5007
|
static peek(e) {
|
|
5008
|
-
return
|
|
5008
|
+
return me.FRAGMENT_CACHE.get(e) ?? null;
|
|
5009
5009
|
}
|
|
5010
5010
|
/**
|
|
5011
5011
|
* 指定した子ノードを、エンジン自身が出し入れしている最中かどうかを返します。
|
|
@@ -5044,7 +5044,7 @@ const pe = class pe {
|
|
|
5044
5044
|
return Promise.resolve();
|
|
5045
5045
|
if (this.parent) {
|
|
5046
5046
|
const e = this.parent, t = e.skipMutationNodes;
|
|
5047
|
-
return e.holdSkipMutationNode(this.target),
|
|
5047
|
+
return e.holdSkipMutationNode(this.target), J.enqueue(() => {
|
|
5048
5048
|
e.skipMutationNodes = !0, this.target.parentNode === e.getTarget() && e.getTarget().removeChild(this.target), this.mounted = !1;
|
|
5049
5049
|
}).finally(() => {
|
|
5050
5050
|
e.skipMutationNodes = t, e.releaseSkipMutationNode(this.target);
|
|
@@ -5052,7 +5052,7 @@ const pe = class pe {
|
|
|
5052
5052
|
} else {
|
|
5053
5053
|
const e = this.target.parentNode;
|
|
5054
5054
|
if (e)
|
|
5055
|
-
return
|
|
5055
|
+
return J.enqueue(() => {
|
|
5056
5056
|
this.target.parentNode === e && e.removeChild(this.target), this.mounted = !1;
|
|
5057
5057
|
});
|
|
5058
5058
|
this.mounted = !1;
|
|
@@ -5069,7 +5069,7 @@ const pe = class pe {
|
|
|
5069
5069
|
return Promise.resolve();
|
|
5070
5070
|
if (this.parent) {
|
|
5071
5071
|
const e = this.parent, t = e.skipMutationNodes;
|
|
5072
|
-
return e.holdSkipMutationNode(this.target),
|
|
5072
|
+
return e.holdSkipMutationNode(this.target), J.enqueue(() => {
|
|
5073
5073
|
e.skipMutationNodes = !0, this.target.parentNode !== e.getTarget() && e.getTarget().appendChild(this.target), this.mounted = !0;
|
|
5074
5074
|
}).finally(() => {
|
|
5075
5075
|
e.skipMutationNodes = t, e.releaseSkipMutationNode(this.target);
|
|
@@ -5100,7 +5100,7 @@ const pe = class pe {
|
|
|
5100
5100
|
* @return 除去のPromise
|
|
5101
5101
|
*/
|
|
5102
5102
|
remove(e = !0) {
|
|
5103
|
-
return this.parent && this.parent.removeChild(this),
|
|
5103
|
+
return this.parent && this.parent.removeChild(this), me.FRAGMENT_CACHE.delete(this.target), e ? this.unmount() : Promise.resolve();
|
|
5104
5104
|
}
|
|
5105
5105
|
/**
|
|
5106
5106
|
* 対象ノードを取得します。
|
|
@@ -5127,8 +5127,8 @@ const pe = class pe {
|
|
|
5127
5127
|
this.parent = e;
|
|
5128
5128
|
}
|
|
5129
5129
|
};
|
|
5130
|
-
|
|
5131
|
-
let D =
|
|
5130
|
+
me.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
5131
|
+
let D = me;
|
|
5132
5132
|
const v = class v extends D {
|
|
5133
5133
|
/**
|
|
5134
5134
|
* エレメントフラグメントのコンストラクタ。
|
|
@@ -5140,7 +5140,7 @@ const v = class v extends D {
|
|
|
5140
5140
|
super(e), this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingWorkChain = Promise.resolve(), this.bindingWorkActive = 0, this.lastSupplySequence = 0, this.lastResetSequence = 0, this.initialBindAttribute = null, this.derivedBindingData = null, this.bindingDataCache = null, this.descendantBindingDataCache = null, this.visible = !0, this.display = null, this.displayPriority = null, this.template = null, this.rowLocalTemplate = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.initialized = !1, this.value = null, this.selfWritingAttributes = /* @__PURE__ */ new Map(), this.skipChangeValue = !1, this.valueWriteUnapplied = !1, this.pendingValueWrite = null, this.userEditSequence = 0, this.authoritativeValueSequence = 0, this.lastValueSequence = 0, this.lastValueKind = "nonSupply", this.selfWrittenBind = /* @__PURE__ */ new Map(), this.lastPathApplied = /* @__PURE__ */ new Map(), this.lastChangeSequence = 0, v.dropFollowUpArtifacts(e), this.syncValue(), this.initialBindAttribute = e.getAttribute(`${c.prefix}bind`), e.getAttributeNames().forEach((i) => {
|
|
5141
5141
|
const s = e.getAttribute(i);
|
|
5142
5142
|
if (s !== null && !this.attributeMap.has(i)) {
|
|
5143
|
-
const n = new
|
|
5143
|
+
const n = new Xe(i, s);
|
|
5144
5144
|
this.attributeMap.set(i, n);
|
|
5145
5145
|
}
|
|
5146
5146
|
});
|
|
@@ -5282,7 +5282,7 @@ const v = class v extends D {
|
|
|
5282
5282
|
*/
|
|
5283
5283
|
static dropIfVisibilityArtifacts(e) {
|
|
5284
5284
|
e.hasAttribute(`${c.prefix}if-false`) && (e.style.removeProperty("display"), e.getAttribute("style")?.trim() === "" && e.removeAttribute("style"), e.removeAttribute(`${c.prefix}if-false`), v.forEachFormControlInBranch(e, (t) => {
|
|
5285
|
-
t.hasAttribute(
|
|
5285
|
+
t.hasAttribute(ve) && (t.removeAttribute(ve), t.removeAttribute("disabled"));
|
|
5286
5286
|
}));
|
|
5287
5287
|
}
|
|
5288
5288
|
/**
|
|
@@ -5293,7 +5293,7 @@ const v = class v extends D {
|
|
|
5293
5293
|
*/
|
|
5294
5294
|
remove(e = !0) {
|
|
5295
5295
|
const t = [];
|
|
5296
|
-
return e &&
|
|
5296
|
+
return e && le.destroySubtree(this.getTarget()), this.getTarget().hasAttribute(`${c.prefix}external`) ? this.detachPreservingSubtree(e) : (this.children.slice().forEach((r) => {
|
|
5297
5297
|
t.push(r.remove(!1));
|
|
5298
5298
|
}), this.children.length = 0, this.attributeMap.clear(), this.bindingData = null, this.bindingDataCache = null, this.derivedBindingData = null, this.descendantBindingDataCache = null, this.template && (t.push(this.template.remove(!1)), this.template = null), this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.clearUnappliedValueWrite(), t.push(super.remove(e)), Promise.all(t).then(() => {
|
|
5299
5299
|
}));
|
|
@@ -5314,7 +5314,7 @@ const v = class v extends D {
|
|
|
5314
5314
|
* @returns 戻り値はありません。
|
|
5315
5315
|
*/
|
|
5316
5316
|
detachObserved() {
|
|
5317
|
-
|
|
5317
|
+
le.destroySubtree(this.getTarget());
|
|
5318
5318
|
const e = this.getParent();
|
|
5319
5319
|
e && e.removeChild(this);
|
|
5320
5320
|
}
|
|
@@ -5441,7 +5441,7 @@ const v = class v extends D {
|
|
|
5441
5441
|
* @returns 予約キーなら true
|
|
5442
5442
|
*/
|
|
5443
5443
|
static isReservedBindingKey(e) {
|
|
5444
|
-
return
|
|
5444
|
+
return re.isReservedBindingKey(e);
|
|
5445
5445
|
}
|
|
5446
5446
|
/**
|
|
5447
5447
|
* バインドデータ更新に伴う DOM 反映・再評価を、同一フラグメントでは呼出順
|
|
@@ -5769,7 +5769,7 @@ const v = class v extends D {
|
|
|
5769
5769
|
return Promise.resolve();
|
|
5770
5770
|
const i = this.getTarget();
|
|
5771
5771
|
if (i instanceof HTMLInputElement && i.type === "file")
|
|
5772
|
-
return e === null || e === "" ? (this.value = null, i.value === "" ? Promise.resolve() :
|
|
5772
|
+
return e === null || e === "" ? (this.value = null, i.value === "" ? Promise.resolve() : J.enqueue(() => {
|
|
5773
5773
|
i.value = "";
|
|
5774
5774
|
})) : (m.warn(
|
|
5775
5775
|
"[Haori]",
|
|
@@ -5886,7 +5886,7 @@ const v = class v extends D {
|
|
|
5886
5886
|
*/
|
|
5887
5887
|
enqueueValueWrite(e) {
|
|
5888
5888
|
this.skipChangeValue = !0;
|
|
5889
|
-
const t =
|
|
5889
|
+
const t = J.enqueue(e).finally(() => {
|
|
5890
5890
|
this.skipChangeValue = !1;
|
|
5891
5891
|
});
|
|
5892
5892
|
return this.pendingValueWrite = t, t;
|
|
@@ -5979,7 +5979,7 @@ const v = class v extends D {
|
|
|
5979
5979
|
* @returns 戻り値はありません。
|
|
5980
5980
|
*/
|
|
5981
5981
|
static notifyValueToEnhancers(e) {
|
|
5982
|
-
|
|
5982
|
+
le.isApplied(e) && le.refreshSubtree(e);
|
|
5983
5983
|
}
|
|
5984
5984
|
/**
|
|
5985
5985
|
* 「載らなかった書き込み」の記録を解除します。
|
|
@@ -6673,7 +6673,7 @@ const v = class v extends D {
|
|
|
6673
6673
|
const i = this.getTarget(), s = i.hasAttribute(e), n = t !== e && i.hasAttribute(t);
|
|
6674
6674
|
if (!s && !n)
|
|
6675
6675
|
return Promise.resolve();
|
|
6676
|
-
const a =
|
|
6676
|
+
const a = J.enqueue(() => {
|
|
6677
6677
|
s && i.removeAttribute(e), n && i.removeAttribute(t);
|
|
6678
6678
|
}).finally(() => {
|
|
6679
6679
|
this.releaseSelfWritingAttributes(r);
|
|
@@ -6715,15 +6715,15 @@ const v = class v extends D {
|
|
|
6715
6715
|
);
|
|
6716
6716
|
if (r === null)
|
|
6717
6717
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
6718
|
-
const o = new
|
|
6718
|
+
const o = new Xe(e, r);
|
|
6719
6719
|
if (s) {
|
|
6720
|
-
const
|
|
6721
|
-
if (
|
|
6722
|
-
const
|
|
6720
|
+
const fe = this.attributeMap.get(e);
|
|
6721
|
+
if (fe && (fe.isEvaluate || fe.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
6722
|
+
const Ee = J.enqueue(() => {
|
|
6723
6723
|
}).finally(() => {
|
|
6724
6724
|
this.releaseSelfWritingAttributes(n);
|
|
6725
6725
|
});
|
|
6726
|
-
return this.holdSelfWritingAttributes(n,
|
|
6726
|
+
return this.holdSelfWritingAttributes(n, Ee), Ee;
|
|
6727
6727
|
}
|
|
6728
6728
|
}
|
|
6729
6729
|
this.attributeMap.set(e, o);
|
|
@@ -6732,49 +6732,49 @@ const v = class v extends D {
|
|
|
6732
6732
|
element: l,
|
|
6733
6733
|
rawName: e,
|
|
6734
6734
|
template: r
|
|
6735
|
-
}), d = v.isLateActionAttribute(e) ?
|
|
6735
|
+
}), d = v.isLateActionAttribute(e) ? re.withoutDiagnosis(u) : u(), y = o.isEvaluate || o.isRawEvaluate, b = e === t && v.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), E = o.isSingleExpression(), A = ye.joinEvaluateResults(d.results), w = d.results.length === 1 ? d.results[0] : A, $ = t === "value" && v.resolveDeclaredValueType(l) === "boolean", C = w === !1 && !$, se = !o.isForceEvaluation() && (t !== e ? d.hasUnresolvedReference || w === null || w === void 0 || C : b ? d.hasUnresolvedReference || w === null || w === void 0 || w === !1 : E ? d.hasUnresolvedReference || w === null || w === void 0 || C : y && A === "");
|
|
6736
6736
|
if (se && d.hasUnresolvedReference && v.warnUnresolvedAttribute(
|
|
6737
6737
|
e,
|
|
6738
6738
|
t,
|
|
6739
6739
|
r,
|
|
6740
6740
|
l
|
|
6741
|
-
), V.isEnabled() &&
|
|
6742
|
-
const
|
|
6743
|
-
|
|
6741
|
+
), V.isEnabled() && w === !1 && E) {
|
|
6742
|
+
const fe = o.getSingleExpression(), Ee = fe === null ? null : re.diagnoseStrictComparison(
|
|
6743
|
+
fe,
|
|
6744
6744
|
this.getBindingData()
|
|
6745
6745
|
);
|
|
6746
|
-
|
|
6746
|
+
Ee !== null && v.warnTypeMismatchedComparison(
|
|
6747
6747
|
e,
|
|
6748
6748
|
r,
|
|
6749
|
-
|
|
6749
|
+
Ee,
|
|
6750
6750
|
l
|
|
6751
6751
|
);
|
|
6752
6752
|
}
|
|
6753
|
-
const F = o.isForceEvaluation() ? r : E ?
|
|
6754
|
-
|
|
6753
|
+
const F = o.isForceEvaluation() ? r : E ? w : A, Z = i && o.isEvaluate && t === "value" && v.isValuePropertyTarget(l), ee = l.getRootNode(), ne = this.userEditSequence, K = Z && v.isUserEditableValue(l) && (l === ee.activeElement || this.hasPendingUserEdit()), ae = se || F === null || F === !1 && !$ ? null : String(F), j = o.isEvaluate && ae !== null && v.URL_ATTRIBUTES.has(t) && Oe.hasScriptScheme(ae);
|
|
6754
|
+
j && m.warn(
|
|
6755
6755
|
"[Haori]",
|
|
6756
|
-
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${
|
|
6756
|
+
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${ae}`,
|
|
6757
6757
|
l
|
|
6758
6758
|
);
|
|
6759
|
-
const
|
|
6760
|
-
if (!
|
|
6761
|
-
return
|
|
6759
|
+
const k = j ? null : ae, B = e !== t && l.getAttribute(e) !== r, ue = k === null ? l.hasAttribute(t) : l.getAttribute(t) !== k, U = k === null ? "" : k, Q = Z && !K && l.value !== U, pe = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), ce = t === "selected" && l instanceof HTMLOptionElement, W = ee.activeElement, G = W !== null && (pe && l === W || ce && l.closest("select") === W) || (pe || ce) && this.hasPendingCheckableUserEdit(ce), ie = this.getCheckableUserEditSequence(ce), be = k !== null, _e = pe && o.isEvaluate && !G && l.checked !== be, Ve = ce && o.isEvaluate && !G && l.selected !== be;
|
|
6760
|
+
if (!B && !ue && !Q && !_e && !Ve)
|
|
6761
|
+
return Z && !K && (this.value = this.normalizeValueForElement(
|
|
6762
6762
|
l,
|
|
6763
|
-
|
|
6764
|
-
), this.clearUnappliedValueWrite()), (
|
|
6765
|
-
const ut =
|
|
6766
|
-
const
|
|
6763
|
+
U
|
|
6764
|
+
), this.clearUnappliedValueWrite()), (pe || ce) && !G && this.syncCheckableValueFromDom(ce), Promise.resolve();
|
|
6765
|
+
const ut = J.enqueue(() => {
|
|
6766
|
+
const fe = this.getCheckableUserEditSequence(ce) !== ie, Ee = ce && (G || fe) ? v.captureSelection(
|
|
6767
6767
|
// 守るべき選択があるのは所属する `<select>` があるときだけ。
|
|
6768
6768
|
l.closest(
|
|
6769
6769
|
"select"
|
|
6770
6770
|
)
|
|
6771
6771
|
) : null;
|
|
6772
|
-
|
|
6772
|
+
B && l.setAttribute(e, r), k === null ? l.removeAttribute(t) : ue && (l.setAttribute(t, k), t === `${c.prefix}bind` && this.recordSelfWrittenBind(k)), t === "style" && this.captureAndHideDisplay(), Ee?.(), Z && !K && !(v.isUserEditableValue(l) && this.isSupersededByUserEdit(ne)) && (this.value = this.normalizeValueForElement(
|
|
6773
6773
|
l,
|
|
6774
|
-
|
|
6775
|
-
),
|
|
6776
|
-
const _t = _e && !
|
|
6777
|
-
_t && (l.checked =
|
|
6774
|
+
U
|
|
6775
|
+
), Q && (l.value = U), this.recordValueWriteResult(l.value === U));
|
|
6776
|
+
const _t = _e && !fe, er = Ve && !fe;
|
|
6777
|
+
_t && (l.checked = be), er && (l.selected = be), (_e || Ve) && this.syncCheckableValueFromDom(Ve);
|
|
6778
6778
|
}).finally(() => {
|
|
6779
6779
|
this.releaseSelfWritingAttributes(n);
|
|
6780
6780
|
});
|
|
@@ -6797,7 +6797,7 @@ const v = class v extends D {
|
|
|
6797
6797
|
const t = this.getTarget();
|
|
6798
6798
|
if (!t.hasAttribute(e))
|
|
6799
6799
|
return Promise.resolve();
|
|
6800
|
-
const r =
|
|
6800
|
+
const r = J.enqueue(() => {
|
|
6801
6801
|
t.removeAttribute(e);
|
|
6802
6802
|
}).finally(() => {
|
|
6803
6803
|
this.releaseSelfWritingAttributes([e]);
|
|
@@ -6834,7 +6834,7 @@ const v = class v extends D {
|
|
|
6834
6834
|
value: r.results[0],
|
|
6835
6835
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6836
6836
|
} : {
|
|
6837
|
-
value:
|
|
6837
|
+
value: ye.joinEvaluateResults(r.results),
|
|
6838
6838
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6839
6839
|
};
|
|
6840
6840
|
}
|
|
@@ -6936,7 +6936,7 @@ const v = class v extends D {
|
|
|
6936
6936
|
t,
|
|
6937
6937
|
r
|
|
6938
6938
|
), a = this.skipMutationNodes;
|
|
6939
|
-
return this.skipMutationNodes = !0, this.holdSkipMutationNode(e.getTarget()),
|
|
6939
|
+
return this.skipMutationNodes = !0, this.holdSkipMutationNode(e.getTarget()), J.enqueue(() => {
|
|
6940
6940
|
this.target.insertBefore(e.getTarget(), n);
|
|
6941
6941
|
}).finally(() => {
|
|
6942
6942
|
this.skipMutationNodes = a, this.releaseSkipMutationNode(e.getTarget());
|
|
@@ -7172,7 +7172,7 @@ const v = class v extends D {
|
|
|
7172
7172
|
*/
|
|
7173
7173
|
static disableFormControlsInBranch(e) {
|
|
7174
7174
|
v.forEachFormControlInBranch(e, (t) => {
|
|
7175
|
-
t.hasAttribute("disabled") || (t.setAttribute(
|
|
7175
|
+
t.hasAttribute("disabled") || (t.setAttribute(ve, ""), t.setAttribute("disabled", ""));
|
|
7176
7176
|
});
|
|
7177
7177
|
}
|
|
7178
7178
|
/**
|
|
@@ -7186,7 +7186,7 @@ const v = class v extends D {
|
|
|
7186
7186
|
*/
|
|
7187
7187
|
restoreFormControlsDisabledByIf() {
|
|
7188
7188
|
v.forEachFormControlInBranch(this.getTarget(), (e) => {
|
|
7189
|
-
e.hasAttribute(
|
|
7189
|
+
e.hasAttribute(ve) && (e.removeAttribute(ve), e.removeAttribute("disabled"));
|
|
7190
7190
|
});
|
|
7191
7191
|
}
|
|
7192
7192
|
/**
|
|
@@ -7276,7 +7276,7 @@ v.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, v.VALUE
|
|
|
7276
7276
|
"^.+-(?:dialog|toast|toast-level|history|scroll|redirect|redirect-replace|redirect-return-param)$"
|
|
7277
7277
|
);
|
|
7278
7278
|
let R = v;
|
|
7279
|
-
class
|
|
7279
|
+
class de extends D {
|
|
7280
7280
|
/**
|
|
7281
7281
|
* テキストフラグメントのコンストラクタ。
|
|
7282
7282
|
* 対象テキストノードの内容を初期化します。
|
|
@@ -7284,7 +7284,7 @@ class ce extends D {
|
|
|
7284
7284
|
* @param target 対象テキストノード
|
|
7285
7285
|
*/
|
|
7286
7286
|
constructor(e) {
|
|
7287
|
-
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new
|
|
7287
|
+
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new ye(this.text);
|
|
7288
7288
|
}
|
|
7289
7289
|
/**
|
|
7290
7290
|
* フラグメントをクローンします。
|
|
@@ -7292,7 +7292,7 @@ class ce extends D {
|
|
|
7292
7292
|
* @returns クローンされたフラグメント
|
|
7293
7293
|
*/
|
|
7294
7294
|
clone() {
|
|
7295
|
-
const e = new
|
|
7295
|
+
const e = new de(this.target.cloneNode(!0));
|
|
7296
7296
|
return e.mounted = !1, e.text = this.text, e.contents = this.contents, e.renderedText = this.renderedText, e;
|
|
7297
7297
|
}
|
|
7298
7298
|
/**
|
|
@@ -7329,7 +7329,7 @@ class ce extends D {
|
|
|
7329
7329
|
* @returns 更新のPromise
|
|
7330
7330
|
*/
|
|
7331
7331
|
setContent(e) {
|
|
7332
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new
|
|
7332
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new ye(e), this.evaluate());
|
|
7333
7333
|
}
|
|
7334
7334
|
/**
|
|
7335
7335
|
* フラグメントを評価します。
|
|
@@ -7342,10 +7342,10 @@ class ce extends D {
|
|
|
7342
7342
|
new Error("Parent fragment is required for raw evaluation")
|
|
7343
7343
|
);
|
|
7344
7344
|
let e = null;
|
|
7345
|
-
return
|
|
7345
|
+
return J.enqueue(() => {
|
|
7346
7346
|
this.skipMutation = !0;
|
|
7347
7347
|
let t = this.text;
|
|
7348
|
-
this.contents.isEvaluate && (t =
|
|
7348
|
+
this.contents.isEvaluate && (t = ye.joinEvaluateResults(
|
|
7349
7349
|
this.contents.evaluate(this.parent.getBindingData(), {
|
|
7350
7350
|
kind: "text",
|
|
7351
7351
|
element: this.parent.getTarget(),
|
|
@@ -7394,14 +7394,14 @@ class ot extends D {
|
|
|
7394
7394
|
* @return 更新のPromise
|
|
7395
7395
|
*/
|
|
7396
7396
|
setContent(e) {
|
|
7397
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e,
|
|
7397
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, J.enqueue(() => {
|
|
7398
7398
|
this.skipMutation = !0, this.target.textContent = this.text;
|
|
7399
7399
|
}).finally(() => {
|
|
7400
7400
|
this.skipMutation = !1;
|
|
7401
7401
|
}));
|
|
7402
7402
|
}
|
|
7403
7403
|
}
|
|
7404
|
-
const
|
|
7404
|
+
const Je = class Je {
|
|
7405
7405
|
/**
|
|
7406
7406
|
* コンストラクタ。
|
|
7407
7407
|
*
|
|
@@ -7417,7 +7417,7 @@ const Xe = class Xe {
|
|
|
7417
7417
|
});
|
|
7418
7418
|
return;
|
|
7419
7419
|
}
|
|
7420
|
-
const r = [...e.matchAll(
|
|
7420
|
+
const r = [...e.matchAll(Je.PLACEHOLDER_REGEX)];
|
|
7421
7421
|
let i = 0, s = !1, n = !1;
|
|
7422
7422
|
for (const a of r) {
|
|
7423
7423
|
a.index > i && this.contents.push({
|
|
@@ -7522,8 +7522,8 @@ const Xe = class Xe {
|
|
|
7522
7522
|
return this.contents.forEach((l) => {
|
|
7523
7523
|
try {
|
|
7524
7524
|
if (r(l)) {
|
|
7525
|
-
const u =
|
|
7526
|
-
() =>
|
|
7525
|
+
const u = Ye.measure(
|
|
7526
|
+
() => re.evaluateDetailed(l.text, e)
|
|
7527
7527
|
), d = u.value;
|
|
7528
7528
|
a += u.durationMs, n.push({
|
|
7529
7529
|
expression: l.text,
|
|
@@ -7541,16 +7541,16 @@ const Xe = class Xe {
|
|
|
7541
7541
|
durationMs: 0
|
|
7542
7542
|
}), s.push("");
|
|
7543
7543
|
}
|
|
7544
|
-
}),
|
|
7544
|
+
}), Ye.record(
|
|
7545
7545
|
t,
|
|
7546
7546
|
n,
|
|
7547
7547
|
a
|
|
7548
7548
|
), { results: s, hasUnresolvedReference: o };
|
|
7549
7549
|
}
|
|
7550
7550
|
};
|
|
7551
|
-
|
|
7552
|
-
let
|
|
7553
|
-
const
|
|
7551
|
+
Je.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
7552
|
+
let ye = Je;
|
|
7553
|
+
const _ = class _ extends ye {
|
|
7554
7554
|
/**
|
|
7555
7555
|
* コンストラクタ。
|
|
7556
7556
|
*
|
|
@@ -7558,8 +7558,8 @@ const Q = class Q extends ge {
|
|
|
7558
7558
|
* @param text 属性値
|
|
7559
7559
|
*/
|
|
7560
7560
|
constructor(e, t) {
|
|
7561
|
-
const r =
|
|
7562
|
-
super(t, e === `${c.prefix}bind` || r), this.name = e, this.forceEvaluation =
|
|
7561
|
+
const r = _.isEventHandlerAttribute(e);
|
|
7562
|
+
super(t, e === `${c.prefix}bind` || r), this.name = e, this.forceEvaluation = _.needsForceEvaluation(e), this.checksUrlPath = _.isRequestUrlAttribute(e), r && V.isEnabled() && t.includes("{{") && _.warnEventHandlerPlaceholder(e, t);
|
|
7563
7563
|
}
|
|
7564
7564
|
/**
|
|
7565
7565
|
* イベントハンドラ属性(名前が `on` で始まる属性と `data-attr-on*`)かどうかを
|
|
@@ -7590,7 +7590,7 @@ const Q = class Q extends ge {
|
|
|
7590
7590
|
*/
|
|
7591
7591
|
static warnEventHandlerPlaceholder(e, t) {
|
|
7592
7592
|
const r = `${e}\0${t}`;
|
|
7593
|
-
|
|
7593
|
+
_.WARNED_EVENT_HANDLER_PLACEHOLDERS.has(r) || (_.WARNED_EVENT_HANDLER_PLACEHOLDERS.add(r), m.warn(
|
|
7594
7594
|
"[Haori]",
|
|
7595
7595
|
`Placeholders in event handler attributes are not evaluated: ${e}="${t}". Use ${c.prefix}{event}-run, or read the bound value inside the called function.`
|
|
7596
7596
|
));
|
|
@@ -7610,9 +7610,9 @@ const Q = class Q extends ge {
|
|
|
7610
7610
|
const n = String(e[s]);
|
|
7611
7611
|
if (i.type === 0)
|
|
7612
7612
|
t = !0;
|
|
7613
|
-
else if (t && !/[?#]/.test(r) &&
|
|
7613
|
+
else if (t && !/[?#]/.test(r) && _.changesUrlPath(n)) {
|
|
7614
7614
|
const a = `${this.name}\0${this.getValue()}\0${n}`;
|
|
7615
|
-
|
|
7615
|
+
_.WARNED_URL_PATH_VALUES.has(a) || (_.WARNED_URL_PATH_VALUES.add(a), m.warn(
|
|
7616
7616
|
"[Haori]",
|
|
7617
7617
|
`A value embedded in the URL path is not URL-encoded and changes the request path: ${this.name}="${this.getValue()}", value: ${n}. Encode it with encodeURIComponent, or send it as a query.`
|
|
7618
7618
|
));
|
|
@@ -7640,17 +7640,17 @@ const Q = class Q extends ge {
|
|
|
7640
7640
|
* @returns 強制評価の対象なら true
|
|
7641
7641
|
*/
|
|
7642
7642
|
static needsForceEvaluation(e) {
|
|
7643
|
-
if (
|
|
7643
|
+
if (_.forceEvaluationNames === null || _.forceEvaluationPrefix !== c.prefix) {
|
|
7644
7644
|
const t = /* @__PURE__ */ new Set();
|
|
7645
7645
|
for (const r of [
|
|
7646
7646
|
c.prefix,
|
|
7647
|
-
...
|
|
7647
|
+
..._.FORCE_EVALUATION_PREFIXES
|
|
7648
7648
|
])
|
|
7649
|
-
for (const i of
|
|
7649
|
+
for (const i of _.FORCE_EVALUATION_SUFFIXES)
|
|
7650
7650
|
t.add(`${r}${i}`);
|
|
7651
|
-
|
|
7651
|
+
_.forceEvaluationNames = t, _.forceEvaluationPrefix = c.prefix;
|
|
7652
7652
|
}
|
|
7653
|
-
return
|
|
7653
|
+
return _.forceEvaluationNames.has(e);
|
|
7654
7654
|
}
|
|
7655
7655
|
/**
|
|
7656
7656
|
* 強制評価フラグを取得します。
|
|
@@ -7697,12 +7697,12 @@ const Q = class Q extends ge {
|
|
|
7697
7697
|
}) : r;
|
|
7698
7698
|
}
|
|
7699
7699
|
};
|
|
7700
|
-
|
|
7701
|
-
let
|
|
7700
|
+
_.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], _.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], _.forceEvaluationNames = null, _.forceEvaluationPrefix = null, _.WARNED_EVENT_HANDLER_PLACEHOLDERS = /* @__PURE__ */ new Set(), _.WARNED_URL_PATH_VALUES = /* @__PURE__ */ new Set();
|
|
7701
|
+
let Xe = _;
|
|
7702
7702
|
const vt = "[Haori]", wt = {
|
|
7703
7703
|
nameRequired: "Handler name is required.",
|
|
7704
7704
|
notFunction: (f) => `Handler "${f}" must be a function.`
|
|
7705
|
-
},
|
|
7705
|
+
}, Te = class Te {
|
|
7706
7706
|
/**
|
|
7707
7707
|
* 関数を登録します。同じ名前で登録し直すと置き換えます。
|
|
7708
7708
|
*
|
|
@@ -7720,7 +7720,7 @@ const vt = "[Haori]", wt = {
|
|
|
7720
7720
|
m.error(vt, wt.notFunction(r));
|
|
7721
7721
|
return;
|
|
7722
7722
|
}
|
|
7723
|
-
|
|
7723
|
+
Te.handlers.set(r, t);
|
|
7724
7724
|
}
|
|
7725
7725
|
/**
|
|
7726
7726
|
* 登録した関数かどうかを返します。
|
|
@@ -7729,7 +7729,7 @@ const vt = "[Haori]", wt = {
|
|
|
7729
7729
|
* @returns 登録してあれば true
|
|
7730
7730
|
*/
|
|
7731
7731
|
static has(e) {
|
|
7732
|
-
return
|
|
7732
|
+
return Te.handlers.has(e);
|
|
7733
7733
|
}
|
|
7734
7734
|
/**
|
|
7735
7735
|
* 登録した関数を返します。
|
|
@@ -7738,7 +7738,7 @@ const vt = "[Haori]", wt = {
|
|
|
7738
7738
|
* @returns 関数。登録していなければ undefined
|
|
7739
7739
|
*/
|
|
7740
7740
|
static get(e) {
|
|
7741
|
-
return
|
|
7741
|
+
return Te.handlers.get(e);
|
|
7742
7742
|
}
|
|
7743
7743
|
/**
|
|
7744
7744
|
* 登録した関数をすべて返します(式のスコープへ載せるため)。
|
|
@@ -7746,12 +7746,12 @@ const vt = "[Haori]", wt = {
|
|
|
7746
7746
|
* @returns 名前 → 関数
|
|
7747
7747
|
*/
|
|
7748
7748
|
static entries() {
|
|
7749
|
-
return Object.fromEntries(
|
|
7749
|
+
return Object.fromEntries(Te.handlers);
|
|
7750
7750
|
}
|
|
7751
7751
|
};
|
|
7752
|
-
|
|
7753
|
-
let
|
|
7754
|
-
const
|
|
7752
|
+
Te.handlers = /* @__PURE__ */ new Map();
|
|
7753
|
+
let De = Te;
|
|
7754
|
+
const ke = class ke {
|
|
7755
7755
|
/**
|
|
7756
7756
|
* 実行モードを取得します。
|
|
7757
7757
|
*
|
|
@@ -7802,7 +7802,7 @@ const Se = class Se {
|
|
|
7802
7802
|
* @return すべてのレンダリングが完了したら解決される Promise
|
|
7803
7803
|
*/
|
|
7804
7804
|
static waitForRenders() {
|
|
7805
|
-
return
|
|
7805
|
+
return J.waitForIdle();
|
|
7806
7806
|
}
|
|
7807
7807
|
/**
|
|
7808
7808
|
* 通知ダイアログを表示します。
|
|
@@ -7811,7 +7811,7 @@ const Se = class Se {
|
|
|
7811
7811
|
* @returns 通知が閉じられると解決されるPromise
|
|
7812
7812
|
*/
|
|
7813
7813
|
static dialog(e) {
|
|
7814
|
-
return
|
|
7814
|
+
return J.enqueue(() => {
|
|
7815
7815
|
window.alert(e);
|
|
7816
7816
|
}, !0);
|
|
7817
7817
|
}
|
|
@@ -7839,7 +7839,7 @@ const Se = class Se {
|
|
|
7839
7839
|
* @returns ユーザーがOKをクリックした場合はtrue、キャンセルした場合はfalseが解決されるPromise
|
|
7840
7840
|
*/
|
|
7841
7841
|
static confirm(e) {
|
|
7842
|
-
return
|
|
7842
|
+
return J.enqueue(() => window.confirm(e), !0);
|
|
7843
7843
|
}
|
|
7844
7844
|
/**
|
|
7845
7845
|
* ダイアログを開きます。
|
|
@@ -7847,8 +7847,8 @@ const Se = class Se {
|
|
|
7847
7847
|
* @param element 開くダイアログのHTML要素
|
|
7848
7848
|
*/
|
|
7849
7849
|
static openDialog(e) {
|
|
7850
|
-
return
|
|
7851
|
-
e instanceof HTMLDialogElement ? (
|
|
7850
|
+
return J.enqueue(() => {
|
|
7851
|
+
e instanceof HTMLDialogElement ? (ke.clearMessagesSync(e), e.showModal()) : m.error("[Haori]", "Element is not a dialog: ", e);
|
|
7852
7852
|
}, !0);
|
|
7853
7853
|
}
|
|
7854
7854
|
/**
|
|
@@ -7857,7 +7857,7 @@ const Se = class Se {
|
|
|
7857
7857
|
* @param element 閉じるダイアログのHTML要素
|
|
7858
7858
|
*/
|
|
7859
7859
|
static closeDialog(e) {
|
|
7860
|
-
return
|
|
7860
|
+
return J.enqueue(() => {
|
|
7861
7861
|
e instanceof HTMLDialogElement ? e.close() : m.error("[Haori]", "Element is not a dialog: ", e);
|
|
7862
7862
|
}, !0);
|
|
7863
7863
|
}
|
|
@@ -7868,7 +7868,7 @@ const Se = class Se {
|
|
|
7868
7868
|
* @param message エラーメッセージ
|
|
7869
7869
|
*/
|
|
7870
7870
|
static addErrorMessage(e, t) {
|
|
7871
|
-
return
|
|
7871
|
+
return ke.addMessage(e, t, "error");
|
|
7872
7872
|
}
|
|
7873
7873
|
/**
|
|
7874
7874
|
* メッセージをレベル付きで追加します。
|
|
@@ -7878,7 +7878,7 @@ const Se = class Se {
|
|
|
7878
7878
|
* @param level メッセージのレベル(省略可能)
|
|
7879
7879
|
*/
|
|
7880
7880
|
static addMessage(e, t, r) {
|
|
7881
|
-
return
|
|
7881
|
+
return J.enqueue(() => {
|
|
7882
7882
|
const i = e instanceof HTMLFormElement ? e : e.parentElement ?? e;
|
|
7883
7883
|
i.setAttribute("data-message", t), r !== void 0 ? i.setAttribute("data-message-level", r) : i.removeAttribute("data-message-level");
|
|
7884
7884
|
}, !0);
|
|
@@ -7892,8 +7892,8 @@ const Se = class Se {
|
|
|
7892
7892
|
* @param parent メッセージをクリアする親要素
|
|
7893
7893
|
*/
|
|
7894
7894
|
static clearMessages(e) {
|
|
7895
|
-
return
|
|
7896
|
-
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")),
|
|
7895
|
+
return J.enqueue(() => {
|
|
7896
|
+
!(e instanceof HTMLFormElement) && e.parentElement && (e.parentElement.removeAttribute("data-message"), e.parentElement.removeAttribute("data-message-level")), ke.clearMessagesSync(e);
|
|
7897
7897
|
}, !0);
|
|
7898
7898
|
}
|
|
7899
7899
|
/**
|
|
@@ -7920,7 +7920,7 @@ const Se = class Se {
|
|
|
7920
7920
|
* @returns 整形済み文字列。整形できない場合は空文字
|
|
7921
7921
|
*/
|
|
7922
7922
|
static date(e, t, r) {
|
|
7923
|
-
return
|
|
7923
|
+
return Ze(e, t, r);
|
|
7924
7924
|
}
|
|
7925
7925
|
/**
|
|
7926
7926
|
* 現在日時を指定フォーマットの文字列へ整形します。
|
|
@@ -7933,7 +7933,7 @@ const Se = class Se {
|
|
|
7933
7933
|
* @returns 整形済みの現在日時文字列
|
|
7934
7934
|
*/
|
|
7935
7935
|
static now(e, t) {
|
|
7936
|
-
return
|
|
7936
|
+
return Mt(e, t);
|
|
7937
7937
|
}
|
|
7938
7938
|
/**
|
|
7939
7939
|
* 現在日付に日数を加減した日付を指定フォーマットの文字列へ整形します。
|
|
@@ -7997,7 +7997,7 @@ const Se = class Se {
|
|
|
7997
7997
|
* @returns 加算後の年月(`YYYY-MM` 形式)。不正な入力は空文字
|
|
7998
7998
|
*/
|
|
7999
7999
|
static monthAdd(e, t) {
|
|
8000
|
-
return
|
|
8000
|
+
return Qe(e, t);
|
|
8001
8001
|
}
|
|
8002
8002
|
/**
|
|
8003
8003
|
* 基準月から過去方向へ `count + 1` 個の年月配列を降順で返します。
|
|
@@ -8077,7 +8077,7 @@ const Se = class Se {
|
|
|
8077
8077
|
return Kt(e, t);
|
|
8078
8078
|
}
|
|
8079
8079
|
};
|
|
8080
|
-
|
|
8080
|
+
ke.handlers = {
|
|
8081
8081
|
/**
|
|
8082
8082
|
* 関数を登録します。
|
|
8083
8083
|
*
|
|
@@ -8086,7 +8086,7 @@ Se.handlers = {
|
|
|
8086
8086
|
* @return 戻り値はありません。
|
|
8087
8087
|
*/
|
|
8088
8088
|
register(e, t) {
|
|
8089
|
-
|
|
8089
|
+
De.register(e, t);
|
|
8090
8090
|
},
|
|
8091
8091
|
/**
|
|
8092
8092
|
* 登録した関数かどうかを返します。
|
|
@@ -8095,9 +8095,9 @@ Se.handlers = {
|
|
|
8095
8095
|
* @return 登録してあれば true
|
|
8096
8096
|
*/
|
|
8097
8097
|
has(e) {
|
|
8098
|
-
return
|
|
8098
|
+
return De.has(e);
|
|
8099
8099
|
}
|
|
8100
|
-
},
|
|
8100
|
+
}, ke.enhancers = {
|
|
8101
8101
|
/**
|
|
8102
8102
|
* 外部ライブラリ連携を登録します。
|
|
8103
8103
|
*
|
|
@@ -8106,7 +8106,7 @@ Se.handlers = {
|
|
|
8106
8106
|
* @return 戻り値はありません。
|
|
8107
8107
|
*/
|
|
8108
8108
|
register(e, t) {
|
|
8109
|
-
|
|
8109
|
+
le.register(e, t);
|
|
8110
8110
|
},
|
|
8111
8111
|
/**
|
|
8112
8112
|
* 登録済みの連携かどうかを返します。
|
|
@@ -8115,16 +8115,16 @@ Se.handlers = {
|
|
|
8115
8115
|
* @return 登録済みなら true
|
|
8116
8116
|
*/
|
|
8117
8117
|
has(e) {
|
|
8118
|
-
return
|
|
8118
|
+
return le.has(e);
|
|
8119
8119
|
}
|
|
8120
8120
|
};
|
|
8121
|
-
let
|
|
8121
|
+
let xe = ke;
|
|
8122
8122
|
const yr = "入力内容を確認してください", br = ["addErrorMessage", "clearMessages"], St = "data-haori-group-name";
|
|
8123
8123
|
function Rt() {
|
|
8124
8124
|
const e = globalThis.window?.Haori;
|
|
8125
8125
|
return br.every(
|
|
8126
8126
|
(r) => typeof e?.[r] == "function"
|
|
8127
|
-
) ? e :
|
|
8127
|
+
) ? e : xe;
|
|
8128
8128
|
}
|
|
8129
8129
|
const p = class p {
|
|
8130
8130
|
/**
|
|
@@ -9075,7 +9075,7 @@ const p = class p {
|
|
|
9075
9075
|
r.setCustomValidity("");
|
|
9076
9076
|
return;
|
|
9077
9077
|
}
|
|
9078
|
-
const s = p.buildConditionScope(e), n =
|
|
9078
|
+
const s = p.buildConditionScope(e), n = re.evaluateDetailed(
|
|
9079
9079
|
p.unwrapConditionExpression(i),
|
|
9080
9080
|
s
|
|
9081
9081
|
);
|
|
@@ -9363,7 +9363,7 @@ const p = class p {
|
|
|
9363
9363
|
static createRowKeyIndexes(e, t) {
|
|
9364
9364
|
const r = /* @__PURE__ */ new Map();
|
|
9365
9365
|
return e.forEach((i, s) => {
|
|
9366
|
-
const n =
|
|
9366
|
+
const n = M.createListKey(
|
|
9367
9367
|
i,
|
|
9368
9368
|
t,
|
|
9369
9369
|
s
|
|
@@ -9543,7 +9543,7 @@ const p = class p {
|
|
|
9543
9543
|
const s = { ...i };
|
|
9544
9544
|
for (const n of t)
|
|
9545
9545
|
delete s[n];
|
|
9546
|
-
return
|
|
9546
|
+
return M.setBindingData(e.getTarget(), s, {
|
|
9547
9547
|
kind: r?.kind ?? "supply",
|
|
9548
9548
|
sequence: r?.sequence ?? R.nextSequence()
|
|
9549
9549
|
});
|
|
@@ -9849,44 +9849,44 @@ const p = class p {
|
|
|
9849
9849
|
return Promise.resolve();
|
|
9850
9850
|
const l = p.resolveFieldName(e), u = e.getAttribute(`${c.prefix}form-object`), d = e.getAttribute(`${c.prefix}form-list`), y = e.hasAttribute(`${c.prefix}form-list`);
|
|
9851
9851
|
if (l) {
|
|
9852
|
-
const b = t[String(l)], E = s &&
|
|
9852
|
+
const b = t[String(l)], E = s && re.withoutDiagnosis(
|
|
9853
9853
|
() => p.hasResolvedDeclarativeState(e)
|
|
9854
9854
|
), A = s && typeof b > "u" && !p.isDeclarativeStateBound(e);
|
|
9855
|
-
let
|
|
9856
|
-
if (E ?
|
|
9857
|
-
return (
|
|
9855
|
+
let w = b;
|
|
9856
|
+
if (E ? w = void 0 : A && (w = null), p.isFileInput(e))
|
|
9857
|
+
return (w === null || w === "") && o.push(
|
|
9858
9858
|
p.applyFragmentValue(e, null, i, a)
|
|
9859
9859
|
), Promise.all(o).then(() => {
|
|
9860
9860
|
});
|
|
9861
|
-
if (y && Array.isArray(
|
|
9861
|
+
if (y && Array.isArray(w) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
9862
9862
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
9863
9863
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
9864
9864
|
!p.isGroupedCheckable(e) && !p.isMultipleSelect(e)) {
|
|
9865
|
-
const
|
|
9866
|
-
n.set(C
|
|
9865
|
+
const $ = String(l), C = n.get($) ?? 0;
|
|
9866
|
+
n.set($, C + 1), o.push(
|
|
9867
9867
|
p.applyFragmentValue(
|
|
9868
9868
|
e,
|
|
9869
|
-
|
|
9869
|
+
w[C] ?? null,
|
|
9870
9870
|
i,
|
|
9871
9871
|
a
|
|
9872
9872
|
)
|
|
9873
9873
|
);
|
|
9874
|
-
} else typeof
|
|
9874
|
+
} else typeof w > "u" || (Array.isArray(w) && p.isGroupedCheckable(e) || Array.isArray(w) && p.isMultipleSelect(e) || typeof w == "string" || typeof w == "number" || typeof w == "boolean" || w === null || Array.isArray(w) && e.collectsLines() ? o.push(
|
|
9875
9875
|
p.applyFragmentValue(
|
|
9876
9876
|
e,
|
|
9877
|
-
|
|
9877
|
+
w,
|
|
9878
9878
|
i,
|
|
9879
9879
|
a
|
|
9880
9880
|
)
|
|
9881
9881
|
) : o.push(
|
|
9882
|
-
p.applyFragmentValue(e, String(
|
|
9882
|
+
p.applyFragmentValue(e, String(w), i, a)
|
|
9883
9883
|
));
|
|
9884
9884
|
} else if (u) {
|
|
9885
9885
|
const b = t[String(u)], E = b && typeof b == "object" ? b : {}, A = /* @__PURE__ */ new Map();
|
|
9886
|
-
for (const
|
|
9886
|
+
for (const w of e.getChildElementFragments())
|
|
9887
9887
|
o.push(
|
|
9888
9888
|
p.setPartValues(
|
|
9889
|
-
|
|
9889
|
+
w,
|
|
9890
9890
|
E,
|
|
9891
9891
|
r,
|
|
9892
9892
|
i,
|
|
@@ -9896,13 +9896,13 @@ const p = class p {
|
|
|
9896
9896
|
)
|
|
9897
9897
|
);
|
|
9898
9898
|
} else if (d) {
|
|
9899
|
-
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(),
|
|
9899
|
+
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(), w = e.getAttribute(`${c.prefix}each-key`), $ = p.isCollectedListFromEachSource(e) ? p.pairRowsWithItems(
|
|
9900
9900
|
A,
|
|
9901
9901
|
E,
|
|
9902
|
-
|
|
9902
|
+
w == null ? null : String(w)
|
|
9903
9903
|
) : null;
|
|
9904
|
-
for (let
|
|
9905
|
-
const se = A[
|
|
9904
|
+
for (let C = 0; C < A.length; C++) {
|
|
9905
|
+
const se = A[C], F = $ ? $[C] : E.length > C ? E[C] : null;
|
|
9906
9906
|
o.push(
|
|
9907
9907
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
9908
9908
|
p.setPartValues(
|
|
@@ -9951,10 +9951,10 @@ const p = class p {
|
|
|
9951
9951
|
const r = p.collectBindingTargetForms(e);
|
|
9952
9952
|
if (r.length > 0 && r.every((s) => s.isSupplyStale(t)))
|
|
9953
9953
|
return;
|
|
9954
|
-
p.markResetSubtree(e, t),
|
|
9954
|
+
p.markResetSubtree(e, t), M.clearUserEditMarks(e, t), p.clearValues(e), await Promise.all([
|
|
9955
9955
|
p.clearMessages(e),
|
|
9956
9956
|
p.clearEachClones(e)
|
|
9957
|
-
]), await
|
|
9957
|
+
]), await J.enqueue(() => {
|
|
9958
9958
|
const s = p.collectEditsAfter(
|
|
9959
9959
|
e,
|
|
9960
9960
|
t
|
|
@@ -9965,16 +9965,16 @@ const p = class p {
|
|
|
9965
9965
|
} finally {
|
|
9966
9966
|
p.internalResetDepth -= 1;
|
|
9967
9967
|
}
|
|
9968
|
-
p.clearDeclarativeStateFromDom(e),
|
|
9968
|
+
p.clearDeclarativeStateFromDom(e), M.invalidateDerivedSubtreeSignatures(e), p.restoreEdits(s);
|
|
9969
9969
|
});
|
|
9970
9970
|
const i = r;
|
|
9971
9971
|
for (const s of i) {
|
|
9972
9972
|
const n = p.getInitialBindingData(s);
|
|
9973
|
-
n === null && s.getRawBindingData() === null || await
|
|
9973
|
+
n === null && s.getRawBindingData() === null || await M.setBindingData(s.getTarget(), n ?? {}, {
|
|
9974
9974
|
sequence: t
|
|
9975
9975
|
});
|
|
9976
9976
|
}
|
|
9977
|
-
p.syncValuesFromDom(e), await
|
|
9977
|
+
p.syncValuesFromDom(e), await M.evaluateAll(e);
|
|
9978
9978
|
for (const s of i)
|
|
9979
9979
|
p.getInitialBindingData(s) !== null || s.getRawBindingData() !== null || await p.restoreAncestorArgValues(s, {
|
|
9980
9980
|
sequence: t,
|
|
@@ -9994,11 +9994,11 @@ const p = class p {
|
|
|
9994
9994
|
));
|
|
9995
9995
|
} else
|
|
9996
9996
|
l = p.mergeCollectedValues(l, a), p.deleteAncestorOwnedKeys(s, n, l);
|
|
9997
|
-
await
|
|
9997
|
+
await M.setBindingData(s.getTarget(), l, {
|
|
9998
9998
|
sequence: t
|
|
9999
9999
|
});
|
|
10000
10000
|
}
|
|
10001
|
-
|
|
10001
|
+
le.refreshSubtree(e.getTarget());
|
|
10002
10002
|
}
|
|
10003
10003
|
/**
|
|
10004
10004
|
* 祖先が所有するキーを、リセットの書き込み対象から落とします。
|
|
@@ -10022,7 +10022,7 @@ const p = class p {
|
|
|
10022
10022
|
*/
|
|
10023
10023
|
static getInitialBindingData(e) {
|
|
10024
10024
|
const t = e.getInitialBindAttribute();
|
|
10025
|
-
return t === null ? null :
|
|
10025
|
+
return t === null ? null : M.parseDataBind(t);
|
|
10026
10026
|
}
|
|
10027
10027
|
/**
|
|
10028
10028
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -10305,7 +10305,7 @@ p.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), p.LAST_ANCESTOR_ARG_VA
|
|
|
10305
10305
|
"prototype"
|
|
10306
10306
|
]), p.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), p.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), p.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), p.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), p.warnedDerivedRowsWithoutKey = /* @__PURE__ */ new Set(), p.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
10307
10307
|
let x = p;
|
|
10308
|
-
class
|
|
10308
|
+
class O {
|
|
10309
10309
|
/**
|
|
10310
10310
|
* カスタムイベントを発火します。
|
|
10311
10311
|
*
|
|
@@ -10329,7 +10329,7 @@ class U {
|
|
|
10329
10329
|
* @param version ライブラリバージョン
|
|
10330
10330
|
*/
|
|
10331
10331
|
static ready(e) {
|
|
10332
|
-
|
|
10332
|
+
O.dispatch(document, "ready", { version: e });
|
|
10333
10333
|
}
|
|
10334
10334
|
/**
|
|
10335
10335
|
* importstartイベントを発火します。
|
|
@@ -10338,7 +10338,7 @@ class U {
|
|
|
10338
10338
|
* @param url インポート対象URL
|
|
10339
10339
|
*/
|
|
10340
10340
|
static importStart(e, t) {
|
|
10341
|
-
|
|
10341
|
+
O.dispatch(e, "importstart", {
|
|
10342
10342
|
url: t,
|
|
10343
10343
|
startedAt: performance.now()
|
|
10344
10344
|
});
|
|
@@ -10352,7 +10352,7 @@ class U {
|
|
|
10352
10352
|
* @param startedAt 開始時刻
|
|
10353
10353
|
*/
|
|
10354
10354
|
static importEnd(e, t, r, i) {
|
|
10355
|
-
|
|
10355
|
+
O.dispatch(e, "importend", {
|
|
10356
10356
|
url: t,
|
|
10357
10357
|
bytes: r,
|
|
10358
10358
|
durationMs: performance.now() - i
|
|
@@ -10366,7 +10366,7 @@ class U {
|
|
|
10366
10366
|
* @param error エラー内容
|
|
10367
10367
|
*/
|
|
10368
10368
|
static importError(e, t, r) {
|
|
10369
|
-
|
|
10369
|
+
O.dispatch(e, "importerror", { url: t, error: r });
|
|
10370
10370
|
}
|
|
10371
10371
|
/**
|
|
10372
10372
|
* bindchangeイベントを発火します。
|
|
@@ -10382,7 +10382,7 @@ class U {
|
|
|
10382
10382
|
const u = t?.[l], d = r[l];
|
|
10383
10383
|
u !== d && s.push(l);
|
|
10384
10384
|
}
|
|
10385
|
-
|
|
10385
|
+
O.dispatch(e, "bindchange", {
|
|
10386
10386
|
previous: t || {},
|
|
10387
10387
|
next: r,
|
|
10388
10388
|
changedKeys: s,
|
|
@@ -10401,7 +10401,7 @@ class U {
|
|
|
10401
10401
|
* @param reason 変更理由
|
|
10402
10402
|
*/
|
|
10403
10403
|
static bindComplete(e, t = null, r = "other") {
|
|
10404
|
-
|
|
10404
|
+
O.dispatch(e, "bindcomplete", { bindArg: t, reason: r });
|
|
10405
10405
|
}
|
|
10406
10406
|
/**
|
|
10407
10407
|
* eachupdateイベントを発火します。
|
|
@@ -10412,7 +10412,7 @@ class U {
|
|
|
10412
10412
|
* @param order 現在の順序
|
|
10413
10413
|
*/
|
|
10414
10414
|
static eachUpdate(e, t, r, i) {
|
|
10415
|
-
|
|
10415
|
+
O.dispatch(e, "eachupdate", {
|
|
10416
10416
|
added: t,
|
|
10417
10417
|
removed: r,
|
|
10418
10418
|
order: i,
|
|
@@ -10428,7 +10428,7 @@ class U {
|
|
|
10428
10428
|
* @param item 行データ
|
|
10429
10429
|
*/
|
|
10430
10430
|
static rowAdd(e, t, r, i) {
|
|
10431
|
-
|
|
10431
|
+
O.dispatch(e, "rowadd", { key: t, index: r, item: i });
|
|
10432
10432
|
}
|
|
10433
10433
|
/**
|
|
10434
10434
|
* rowremoveイベントを発火します。
|
|
@@ -10438,7 +10438,7 @@ class U {
|
|
|
10438
10438
|
* @param index インデックス
|
|
10439
10439
|
*/
|
|
10440
10440
|
static rowRemove(e, t, r) {
|
|
10441
|
-
|
|
10441
|
+
O.dispatch(e, "rowremove", { key: t, index: r });
|
|
10442
10442
|
}
|
|
10443
10443
|
/**
|
|
10444
10444
|
* rowmoveイベントを発火します。
|
|
@@ -10449,7 +10449,7 @@ class U {
|
|
|
10449
10449
|
* @param to 移動後インデックス
|
|
10450
10450
|
*/
|
|
10451
10451
|
static rowMove(e, t, r, i) {
|
|
10452
|
-
|
|
10452
|
+
O.dispatch(e, "rowmove", { key: t, from: r, to: i });
|
|
10453
10453
|
}
|
|
10454
10454
|
/**
|
|
10455
10455
|
* showイベントを発火します。
|
|
@@ -10457,7 +10457,7 @@ class U {
|
|
|
10457
10457
|
* @param target data-if要素
|
|
10458
10458
|
*/
|
|
10459
10459
|
static show(e) {
|
|
10460
|
-
|
|
10460
|
+
O.dispatch(e, "show", { visible: !0 });
|
|
10461
10461
|
}
|
|
10462
10462
|
/**
|
|
10463
10463
|
* hideイベントを発火します。
|
|
@@ -10465,7 +10465,7 @@ class U {
|
|
|
10465
10465
|
* @param target data-if要素
|
|
10466
10466
|
*/
|
|
10467
10467
|
static hide(e) {
|
|
10468
|
-
|
|
10468
|
+
O.dispatch(e, "hide", { visible: !1 });
|
|
10469
10469
|
}
|
|
10470
10470
|
/**
|
|
10471
10471
|
* fetchstartイベントを発火します。
|
|
@@ -10478,7 +10478,7 @@ class U {
|
|
|
10478
10478
|
* @return 戻り値はありません。
|
|
10479
10479
|
*/
|
|
10480
10480
|
static fetchStart(e, t, r, i, s) {
|
|
10481
|
-
|
|
10481
|
+
O.dispatch(e, "fetchstart", {
|
|
10482
10482
|
url: t,
|
|
10483
10483
|
options: r || {},
|
|
10484
10484
|
payload: i,
|
|
@@ -10495,7 +10495,7 @@ class U {
|
|
|
10495
10495
|
* @param startedAt 開始時刻
|
|
10496
10496
|
*/
|
|
10497
10497
|
static fetchEnd(e, t, r, i) {
|
|
10498
|
-
|
|
10498
|
+
O.dispatch(e, "fetchend", {
|
|
10499
10499
|
url: t,
|
|
10500
10500
|
status: r,
|
|
10501
10501
|
durationMs: performance.now() - i
|
|
@@ -10511,7 +10511,7 @@ class U {
|
|
|
10511
10511
|
* @param startedAt 開始時刻(存在する場合)
|
|
10512
10512
|
*/
|
|
10513
10513
|
static fetchError(e, t, r, i, s) {
|
|
10514
|
-
|
|
10514
|
+
O.dispatch(e, "fetcherror", {
|
|
10515
10515
|
url: t,
|
|
10516
10516
|
status: i,
|
|
10517
10517
|
error: r,
|
|
@@ -10527,7 +10527,7 @@ class U {
|
|
|
10527
10527
|
* @return 戻り値はありません。
|
|
10528
10528
|
*/
|
|
10529
10529
|
static pollTimeout(e, t, r) {
|
|
10530
|
-
|
|
10530
|
+
O.dispatch(e, "polltimeout", { count: t, elapsedMs: r });
|
|
10531
10531
|
}
|
|
10532
10532
|
/**
|
|
10533
10533
|
* pollstopイベントを発火します。
|
|
@@ -10541,7 +10541,7 @@ class U {
|
|
|
10541
10541
|
* @return 戻り値はありません。
|
|
10542
10542
|
*/
|
|
10543
10543
|
static pollStop(e, t, r, i) {
|
|
10544
|
-
|
|
10544
|
+
O.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
10545
10545
|
}
|
|
10546
10546
|
}
|
|
10547
10547
|
const Er = {
|
|
@@ -10551,7 +10551,7 @@ const Er = {
|
|
|
10551
10551
|
function Ar(f, e) {
|
|
10552
10552
|
return f.replace(/\{\{([\s\S]+?)\}\}/g, (t, r) => {
|
|
10553
10553
|
try {
|
|
10554
|
-
const i =
|
|
10554
|
+
const i = re.evaluate(String(r).trim(), e);
|
|
10555
10555
|
return i == null ? "" : String(i);
|
|
10556
10556
|
} catch {
|
|
10557
10557
|
return "";
|
|
@@ -10582,7 +10582,7 @@ function vr(f, e, t) {
|
|
|
10582
10582
|
}
|
|
10583
10583
|
function kt(f, e, t) {
|
|
10584
10584
|
const r = vr(f, e, t);
|
|
10585
|
-
if (
|
|
10585
|
+
if (!Oe.isNavigableUrl(r))
|
|
10586
10586
|
return m.error(
|
|
10587
10587
|
"Haori",
|
|
10588
10588
|
`遷移先が http: / https: / 現在ページと同じスキームの URL ではないため遷移しません: ${r}`
|
|
@@ -10614,7 +10614,7 @@ function Jt(f, e = null) {
|
|
|
10614
10614
|
}
|
|
10615
10615
|
return !1;
|
|
10616
10616
|
}
|
|
10617
|
-
class
|
|
10617
|
+
class z {
|
|
10618
10618
|
/**
|
|
10619
10619
|
* セレクタ属性の値を評価済みの文字列として読み取ります。
|
|
10620
10620
|
*
|
|
@@ -10663,11 +10663,11 @@ class K {
|
|
|
10663
10663
|
* @returns 一致した要素の配列。セレクタが不正な場合は空配列
|
|
10664
10664
|
*/
|
|
10665
10665
|
static queryAllInListOrder(e, t) {
|
|
10666
|
-
if (
|
|
10666
|
+
if (z.queryAll(e, t).length === 0)
|
|
10667
10667
|
return [];
|
|
10668
10668
|
const r = /* @__PURE__ */ new Set();
|
|
10669
|
-
return
|
|
10670
|
-
|
|
10669
|
+
return z.splitList(e).forEach((i) => {
|
|
10670
|
+
z.queryAll(i, t).forEach(
|
|
10671
10671
|
(s) => r.add(s)
|
|
10672
10672
|
);
|
|
10673
10673
|
}), Array.from(r);
|
|
@@ -11040,7 +11040,7 @@ const N = class N {
|
|
|
11040
11040
|
), Promise.resolve();
|
|
11041
11041
|
N.RESTORED_ELEMENTS.add(r);
|
|
11042
11042
|
const i = N.readRecord(t), s = i ? N.extractFromRecord(t, i) : {}, n = { ...e.getRawBindingData() ?? {}, ...s };
|
|
11043
|
-
return N.seedSignature(r, N.selectFromData(t, n)), Object.keys(s).length === 0 ? Promise.resolve() :
|
|
11043
|
+
return N.seedSignature(r, N.selectFromData(t, n)), Object.keys(s).length === 0 ? Promise.resolve() : M.setBindingData(r, n, {
|
|
11044
11044
|
reentrant: !0,
|
|
11045
11045
|
kind: "nonSupply",
|
|
11046
11046
|
sequence: R.nextSequence()
|
|
@@ -11135,8 +11135,8 @@ const N = class N {
|
|
|
11135
11135
|
}
|
|
11136
11136
|
};
|
|
11137
11137
|
N.SIGNATURES = /* @__PURE__ */ new WeakMap(), N.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), N.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), N.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
11138
|
-
let
|
|
11139
|
-
const
|
|
11138
|
+
let Be = N;
|
|
11139
|
+
const Ne = "[Haori]", Ie = {
|
|
11140
11140
|
bodyIgnored: (f) => `${f} is ignored because ${f}-handler is also declared.`,
|
|
11141
11141
|
notRegistered: (f, e) => `Handler "${f}" is not registered (${e}-handler). Register it with Haori.handlers.register().`,
|
|
11142
11142
|
argsNotArray: (f) => `${f}-args must evaluate to an array without unresolved references; the handler is not called.`,
|
|
@@ -11144,7 +11144,7 @@ const ke = "[Haori]", De = {
|
|
|
11144
11144
|
notExpression: (f) => `${f} is not run in the CSP mode (the default) because it is not a single expression. Use ${f}-handler and ${f}-args. To run it as JavaScript, select the legacy mode with <script data-csp="false">.`,
|
|
11145
11145
|
shadowed: (f, e) => `Handler(s) ${f.join(", ")} are shadowed by binding keys of the same name in ${e}; the binding values are used.`
|
|
11146
11146
|
};
|
|
11147
|
-
class
|
|
11147
|
+
class oe {
|
|
11148
11148
|
/**
|
|
11149
11149
|
* ここで組み立てる宣言かどうかを返します。false の場合、呼び出し側は従来どおり
|
|
11150
11150
|
* 本文を `new Function` で実行します。
|
|
@@ -11176,7 +11176,7 @@ class ne {
|
|
|
11176
11176
|
*/
|
|
11177
11177
|
static compile(e, t, r) {
|
|
11178
11178
|
const i = `${t}-handler`;
|
|
11179
|
-
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(
|
|
11179
|
+
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(Ne, Ie.bodyIgnored(t), e.getTarget()), oe.compileHandler(e, t)) : oe.compileExpression(e, t, r);
|
|
11180
11180
|
}
|
|
11181
11181
|
/**
|
|
11182
11182
|
* 登録した関数を呼ぶ呼び出しを組み立てます(`-handler` / `-args`)。
|
|
@@ -11190,23 +11190,23 @@ class ne {
|
|
|
11190
11190
|
static compileHandler(e, t) {
|
|
11191
11191
|
const r = e.getRawAttribute(`${t}-handler`), i = e.getRawAttribute(`${t}-args`);
|
|
11192
11192
|
return (s) => {
|
|
11193
|
-
const n =
|
|
11193
|
+
const n = De.get(r);
|
|
11194
11194
|
if (n === void 0) {
|
|
11195
11195
|
m.warn(
|
|
11196
|
-
|
|
11197
|
-
|
|
11196
|
+
Ne,
|
|
11197
|
+
Ie.notRegistered(r, t),
|
|
11198
11198
|
e.getTarget()
|
|
11199
11199
|
);
|
|
11200
11200
|
return;
|
|
11201
11201
|
}
|
|
11202
11202
|
let a = [];
|
|
11203
11203
|
if (i !== null) {
|
|
11204
|
-
const o =
|
|
11204
|
+
const o = re.evaluateDetailed(
|
|
11205
11205
|
i,
|
|
11206
11206
|
e.getBindingData()
|
|
11207
11207
|
);
|
|
11208
11208
|
if (!Array.isArray(o.value)) {
|
|
11209
|
-
m.warn(
|
|
11209
|
+
m.warn(Ne, Ie.argsNotArray(t), i);
|
|
11210
11210
|
return;
|
|
11211
11211
|
}
|
|
11212
11212
|
a = o.value;
|
|
@@ -11228,22 +11228,22 @@ class ne {
|
|
|
11228
11228
|
static compileExpression(e, t, r) {
|
|
11229
11229
|
const i = e.getRawAttribute(t);
|
|
11230
11230
|
if (i.includes("{{"))
|
|
11231
|
-
return m.warn(
|
|
11231
|
+
return m.warn(Ne, Ie.templateInBody(t), e.getTarget()), null;
|
|
11232
11232
|
try {
|
|
11233
|
-
|
|
11233
|
+
Le.compile(i);
|
|
11234
11234
|
} catch {
|
|
11235
|
-
return m.warn(
|
|
11235
|
+
return m.warn(Ne, Ie.notExpression(t), e.getTarget()), null;
|
|
11236
11236
|
}
|
|
11237
11237
|
return (s) => {
|
|
11238
11238
|
const n = e.getBindingData();
|
|
11239
|
-
V.isEnabled() &&
|
|
11239
|
+
V.isEnabled() && oe.reportShadowedHandlers(n, t);
|
|
11240
11240
|
const a = {
|
|
11241
|
-
...
|
|
11241
|
+
...De.entries(),
|
|
11242
11242
|
...n
|
|
11243
11243
|
};
|
|
11244
11244
|
return r.forEach((o, l) => {
|
|
11245
11245
|
a[o] = s[l];
|
|
11246
|
-
}),
|
|
11246
|
+
}), re.evaluate(i, a);
|
|
11247
11247
|
};
|
|
11248
11248
|
}
|
|
11249
11249
|
/**
|
|
@@ -11254,8 +11254,8 @@ class ne {
|
|
|
11254
11254
|
* @returns 戻り値はありません。
|
|
11255
11255
|
*/
|
|
11256
11256
|
static reportShadowedHandlers(e, t) {
|
|
11257
|
-
const r = Object.keys(e).filter((i) =>
|
|
11258
|
-
r.length > 0 && m.warn(
|
|
11257
|
+
const r = Object.keys(e).filter((i) => De.has(i));
|
|
11258
|
+
r.length > 0 && m.warn(Ne, Ie.shadowed(r, t));
|
|
11259
11259
|
}
|
|
11260
11260
|
}
|
|
11261
11261
|
const wr = [
|
|
@@ -11267,25 +11267,25 @@ const wr = [
|
|
|
11267
11267
|
"openDialog",
|
|
11268
11268
|
"toast"
|
|
11269
11269
|
], Sr = "__haoriHistoryState__", tt = "data-haori-click-lock", Dt = "ファイルを保存できませんでした", Rr = 100;
|
|
11270
|
-
let
|
|
11270
|
+
let Pe = null;
|
|
11271
11271
|
const Tr = ["info", "warning", "error", "success"], xt = /^(\d{3})-(click|click-await|close|toast|toast-level|no-message|bind)$/;
|
|
11272
|
-
function
|
|
11272
|
+
function Ae() {
|
|
11273
11273
|
const e = globalThis.window?.Haori;
|
|
11274
11274
|
return wr.every(
|
|
11275
11275
|
(r) => typeof e?.[r] == "function"
|
|
11276
|
-
) ? e :
|
|
11276
|
+
) ? e : xe;
|
|
11277
11277
|
}
|
|
11278
11278
|
const kr = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
11279
|
-
function
|
|
11279
|
+
function je(f) {
|
|
11280
11280
|
return kr.has(f.toUpperCase());
|
|
11281
11281
|
}
|
|
11282
11282
|
function Dr(f, e) {
|
|
11283
11283
|
for (const [t, r] of Object.entries(e))
|
|
11284
11284
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
11285
|
-
f.append(t,
|
|
11286
|
-
}) : f.append(t,
|
|
11285
|
+
f.append(t, Fe(i));
|
|
11286
|
+
}) : f.append(t, Fe(r)));
|
|
11287
11287
|
}
|
|
11288
|
-
function
|
|
11288
|
+
function Fe(f) {
|
|
11289
11289
|
if (f == null)
|
|
11290
11290
|
return "";
|
|
11291
11291
|
if (typeof f == "object" || typeof f == "function")
|
|
@@ -11347,14 +11347,14 @@ function Qt(f, e, t) {
|
|
|
11347
11347
|
const r = f[e];
|
|
11348
11348
|
r === void 0 ? f[e] = t : Array.isArray(r) ? r.push(t) : f[e] = [r, t];
|
|
11349
11349
|
}
|
|
11350
|
-
function
|
|
11350
|
+
function we(f, e) {
|
|
11351
11351
|
if (x.isCompleteSetValue(e))
|
|
11352
11352
|
return e;
|
|
11353
11353
|
if (Array.isArray(e)) {
|
|
11354
11354
|
const t = Array.isArray(f) ? f.slice() : [];
|
|
11355
11355
|
let r = !1;
|
|
11356
11356
|
return e.forEach((i, s) => {
|
|
11357
|
-
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[s] =
|
|
11357
|
+
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[s] = we(t[s], i), r = !0));
|
|
11358
11358
|
}), r ? t : f;
|
|
11359
11359
|
}
|
|
11360
11360
|
if (e !== null && typeof e == "object") {
|
|
@@ -11362,7 +11362,7 @@ function Ee(f, e) {
|
|
|
11362
11362
|
for (const [r, i] of Object.entries(
|
|
11363
11363
|
e
|
|
11364
11364
|
))
|
|
11365
|
-
t[r] =
|
|
11365
|
+
t[r] = we(t[r], i);
|
|
11366
11366
|
return t;
|
|
11367
11367
|
}
|
|
11368
11368
|
return e;
|
|
@@ -11373,7 +11373,7 @@ function Nr(f) {
|
|
|
11373
11373
|
}
|
|
11374
11374
|
function Ir(f, e) {
|
|
11375
11375
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
11376
|
-
if (c.runtime !== "demo" ||
|
|
11376
|
+
if (c.runtime !== "demo" || je(r))
|
|
11377
11377
|
return {
|
|
11378
11378
|
url: f,
|
|
11379
11379
|
options: t,
|
|
@@ -11412,17 +11412,17 @@ function Fr(f) {
|
|
|
11412
11412
|
}
|
|
11413
11413
|
] : [e, String(t)]) : String(f);
|
|
11414
11414
|
}
|
|
11415
|
-
function
|
|
11416
|
-
return f instanceof Blob ? !0 : Array.isArray(f) ? f.some(
|
|
11417
|
-
|
|
11415
|
+
function Ue(f) {
|
|
11416
|
+
return f instanceof Blob ? !0 : Array.isArray(f) ? f.some(Ue) : f !== null && typeof f == "object" ? Object.values(f).some(
|
|
11417
|
+
Ue
|
|
11418
11418
|
) : !1;
|
|
11419
11419
|
}
|
|
11420
11420
|
function Cr(f) {
|
|
11421
11421
|
return Object.values(f).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
11422
|
-
(t) => !(t instanceof Blob) &&
|
|
11423
|
-
) :
|
|
11422
|
+
(t) => !(t instanceof Blob) && Ue(t)
|
|
11423
|
+
) : Ue(e));
|
|
11424
11424
|
}
|
|
11425
|
-
function
|
|
11425
|
+
function We(f) {
|
|
11426
11426
|
return st(x.getValues(f));
|
|
11427
11427
|
}
|
|
11428
11428
|
function st(f) {
|
|
@@ -11449,7 +11449,7 @@ function st(f) {
|
|
|
11449
11449
|
t[r] = e(i);
|
|
11450
11450
|
return x.carryCollectedRowIdentity(f, t), t;
|
|
11451
11451
|
}
|
|
11452
|
-
function
|
|
11452
|
+
function $r(f, e) {
|
|
11453
11453
|
const t = new Headers(
|
|
11454
11454
|
e.headers || void 0
|
|
11455
11455
|
), r = Array.from(t.entries()).sort(
|
|
@@ -11546,9 +11546,9 @@ const g = class g {
|
|
|
11546
11546
|
* @returns 対象のフラグメント(見つからない場合は空)
|
|
11547
11547
|
*/
|
|
11548
11548
|
static resolveSelectorTargets(e, t, r) {
|
|
11549
|
-
const i =
|
|
11549
|
+
const i = z.read(e, t), s = [];
|
|
11550
11550
|
if (i)
|
|
11551
|
-
(r === "click" || r === "error-click" ?
|
|
11551
|
+
(r === "click" || r === "error-click" ? z.queryAllInListOrder(i, t) : z.queryAll(i, t)).forEach((a) => {
|
|
11552
11552
|
const o = D.get(a);
|
|
11553
11553
|
o && s.push(o);
|
|
11554
11554
|
}), s.length === 0 && m.error("Haori", `Element not found: ${i} (${t})`);
|
|
@@ -11720,7 +11720,7 @@ const g = class g {
|
|
|
11720
11720
|
* @returns 手続き開始時の評価値
|
|
11721
11721
|
*/
|
|
11722
11722
|
static readLateAttribute(e, t, r, i) {
|
|
11723
|
-
const s =
|
|
11723
|
+
const s = re.withoutDiagnosis(
|
|
11724
11724
|
() => e.getAttributeEvaluation(i)
|
|
11725
11725
|
);
|
|
11726
11726
|
return t.lateAttributes || (t.lateAttributes = /* @__PURE__ */ new Map()), t.lateAttributes.set(r, {
|
|
@@ -11772,7 +11772,7 @@ const g = class g {
|
|
|
11772
11772
|
const r = e.getRawAttribute(t);
|
|
11773
11773
|
let i;
|
|
11774
11774
|
try {
|
|
11775
|
-
i =
|
|
11775
|
+
i = M.parseDataBind(r);
|
|
11776
11776
|
} catch (s) {
|
|
11777
11777
|
return m.error("Haori", `Invalid fetch headers: ${s}`), null;
|
|
11778
11778
|
}
|
|
@@ -11863,7 +11863,7 @@ const g = class g {
|
|
|
11863
11863
|
return { value: e.replace(
|
|
11864
11864
|
g.DATA_PLACEHOLDER_REGEX,
|
|
11865
11865
|
(s, n, a) => {
|
|
11866
|
-
const o =
|
|
11866
|
+
const o = re.evaluateDetailed(
|
|
11867
11867
|
n ?? a ?? "",
|
|
11868
11868
|
t
|
|
11869
11869
|
);
|
|
@@ -11933,7 +11933,7 @@ const g = class g {
|
|
|
11933
11933
|
return { value: e.replace(
|
|
11934
11934
|
g.DATA_PLACEHOLDER_REGEX,
|
|
11935
11935
|
(s, n, a, o) => {
|
|
11936
|
-
const l =
|
|
11936
|
+
const l = re.evaluateDetailed(
|
|
11937
11937
|
n ?? a ?? "",
|
|
11938
11938
|
t
|
|
11939
11939
|
);
|
|
@@ -11970,7 +11970,7 @@ const g = class g {
|
|
|
11970
11970
|
const a = r.trim();
|
|
11971
11971
|
if (g.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
11972
11972
|
return {
|
|
11973
|
-
value:
|
|
11973
|
+
value: M.parseDataBind(s),
|
|
11974
11974
|
hasUnresolvedReference: n
|
|
11975
11975
|
};
|
|
11976
11976
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
@@ -11979,7 +11979,7 @@ const g = class g {
|
|
|
11979
11979
|
e.getBindingData()
|
|
11980
11980
|
);
|
|
11981
11981
|
return {
|
|
11982
|
-
value:
|
|
11982
|
+
value: M.parseDataBind(l.value),
|
|
11983
11983
|
hasUnresolvedReference: n || l.hasUnresolvedReference
|
|
11984
11984
|
};
|
|
11985
11985
|
}
|
|
@@ -11988,7 +11988,7 @@ const g = class g {
|
|
|
11988
11988
|
e.getBindingData()
|
|
11989
11989
|
);
|
|
11990
11990
|
return {
|
|
11991
|
-
value:
|
|
11991
|
+
value: M.parseDataBind(o.value),
|
|
11992
11992
|
hasUnresolvedReference: n || o.hasUnresolvedReference
|
|
11993
11993
|
};
|
|
11994
11994
|
}
|
|
@@ -12004,8 +12004,8 @@ const g = class g {
|
|
|
12004
12004
|
targetFragment: e
|
|
12005
12005
|
}, i = t ? g.attrName(t, "if") : g.attrName(null, "if", !0);
|
|
12006
12006
|
if (e.hasAttribute(i)) {
|
|
12007
|
-
const
|
|
12008
|
-
typeof
|
|
12007
|
+
const k = e.getRawAttribute(i);
|
|
12008
|
+
typeof k == "string" && k.trim() !== "" ? (r.conditionExpression = x.unwrapConditionExpression(k), r.conditionAttributeName = i) : m.warn(
|
|
12009
12009
|
"Haori",
|
|
12010
12010
|
`${i} に条件式が指定されていません。`
|
|
12011
12011
|
);
|
|
@@ -12016,86 +12016,88 @@ const g = class g {
|
|
|
12016
12016
|
e.getAttribute(g.attrName(t, "confirm"))
|
|
12017
12017
|
)
|
|
12018
12018
|
)), e.hasAttribute(g.attrName(t, "data")) && (r.dataAttrName = g.attrName(t, "data")), e.hasAttribute(g.attrName(t, "form"))) {
|
|
12019
|
-
const
|
|
12019
|
+
const U = z.read(
|
|
12020
12020
|
e,
|
|
12021
12021
|
g.attrName(t, "form")
|
|
12022
12022
|
);
|
|
12023
|
-
if (
|
|
12024
|
-
const
|
|
12025
|
-
|
|
12023
|
+
if (U) {
|
|
12024
|
+
const Q = z.query(
|
|
12025
|
+
U,
|
|
12026
12026
|
g.attrName(t, "form")
|
|
12027
12027
|
);
|
|
12028
|
-
|
|
12029
|
-
D.get(
|
|
12028
|
+
Q !== null ? r.formFragment = x.getFormFragment(
|
|
12029
|
+
D.get(Q)
|
|
12030
12030
|
) : m.error(
|
|
12031
12031
|
"Haori",
|
|
12032
|
-
`Form element not found: ${
|
|
12032
|
+
`Form element not found: ${U} (${g.attrName(t, "form")})`
|
|
12033
12033
|
);
|
|
12034
12034
|
} else
|
|
12035
12035
|
r.formFragment = x.getFormFragment(e);
|
|
12036
12036
|
} else if (t === "change" || t === "input") {
|
|
12037
12037
|
r.formFragment = x.getFormFragment(e);
|
|
12038
|
-
const
|
|
12039
|
-
r.implicitFormFragment = !e.getAttributeNames().some((
|
|
12038
|
+
const U = `${c.prefix}${t}-`;
|
|
12039
|
+
r.implicitFormFragment = !e.getAttributeNames().some((Q) => Q.startsWith(U)), r.formFragment === null && g.isNamedInputFragment(e) && (r.selfValueFragment = e);
|
|
12040
12040
|
}
|
|
12041
12041
|
V.isEnabled() && g.warnAuthRedirectWithoutFetch(e, t);
|
|
12042
|
-
const
|
|
12043
|
-
if (
|
|
12044
|
-
const
|
|
12042
|
+
const k = `${c.prefix}${t}-before-run`;
|
|
12043
|
+
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12044
|
+
const U = oe.compile(e, k, [
|
|
12045
12045
|
"fetchUrl",
|
|
12046
12046
|
"fetchOptions"
|
|
12047
12047
|
]);
|
|
12048
|
-
|
|
12049
|
-
} else if (e.hasAttribute(
|
|
12050
|
-
const
|
|
12048
|
+
U && (r.beforeCallback = (Q, pe) => U([Q, pe]));
|
|
12049
|
+
} else if (e.hasAttribute(k)) {
|
|
12050
|
+
const U = e.getRawAttribute(k);
|
|
12051
12051
|
try {
|
|
12052
12052
|
r.beforeCallback = new Function(
|
|
12053
12053
|
"fetchUrl",
|
|
12054
12054
|
"fetchOptions",
|
|
12055
12055
|
`
|
|
12056
12056
|
"use strict";
|
|
12057
|
-
${
|
|
12057
|
+
${U}
|
|
12058
12058
|
`
|
|
12059
12059
|
);
|
|
12060
|
-
} catch (
|
|
12061
|
-
m.error("Haori", `Invalid before script: ${
|
|
12060
|
+
} catch (Q) {
|
|
12061
|
+
m.error("Haori", `Invalid before script: ${Q}`);
|
|
12062
12062
|
}
|
|
12063
12063
|
}
|
|
12064
|
-
const
|
|
12065
|
-
if (
|
|
12066
|
-
const
|
|
12067
|
-
|
|
12068
|
-
} else if (e.hasAttribute(
|
|
12069
|
-
const
|
|
12070
|
-
let
|
|
12064
|
+
const B = g.attrName(t, "run");
|
|
12065
|
+
if (oe.declared(e, B) && oe.applies(e, B)) {
|
|
12066
|
+
const U = oe.compile(e, B, ["event"]);
|
|
12067
|
+
U && (r.runScript = (Q) => U([Q]));
|
|
12068
|
+
} else if (e.hasAttribute(B)) {
|
|
12069
|
+
const U = String(e.getAttribute(B) ?? "");
|
|
12070
|
+
let Q = null;
|
|
12071
12071
|
try {
|
|
12072
|
-
|
|
12072
|
+
Q = new Function(
|
|
12073
12073
|
"event",
|
|
12074
12074
|
`"use strict"; return (
|
|
12075
|
-
${
|
|
12075
|
+
${U}
|
|
12076
12076
|
);`
|
|
12077
12077
|
);
|
|
12078
12078
|
} catch {
|
|
12079
12079
|
try {
|
|
12080
|
-
|
|
12081
|
-
${
|
|
12080
|
+
Q = new Function("event", `"use strict";
|
|
12081
|
+
${U}
|
|
12082
12082
|
`);
|
|
12083
|
-
} catch (
|
|
12084
|
-
m.error("Haori", `Invalid run script: ${
|
|
12083
|
+
} catch (pe) {
|
|
12084
|
+
m.error("Haori", `Invalid run script: ${pe}`);
|
|
12085
12085
|
}
|
|
12086
12086
|
}
|
|
12087
|
-
|
|
12087
|
+
Q && (r.runScript = Q);
|
|
12088
12088
|
}
|
|
12089
|
+
const ue = g.attrName(t, "clipboard");
|
|
12090
|
+
e.hasAttribute(ue) && (r.clipboardAttrName = ue);
|
|
12089
12091
|
}
|
|
12090
12092
|
const s = g.attrName(t, "fetch"), n = e.hasAttribute(s);
|
|
12091
12093
|
if (n) {
|
|
12092
|
-
const
|
|
12093
|
-
|
|
12094
|
+
const k = e.getAttributeEvaluation(s);
|
|
12095
|
+
k && (r.fetchHasUnresolvedReference = k.hasUnresolvedReference, r.fetchUrl = k.hasUnresolvedReference ? null : k.value);
|
|
12094
12096
|
}
|
|
12095
12097
|
const a = {}, o = t ? g.attrName(t, "fetch-method") : g.attrName(null, "method", !0);
|
|
12096
12098
|
if (e.hasAttribute(o)) {
|
|
12097
|
-
const
|
|
12098
|
-
|
|
12099
|
+
const k = e.getAttributeEvaluation(o);
|
|
12100
|
+
k?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method = g.normalizeAttributeText(k?.value) ?? void 0;
|
|
12099
12101
|
}
|
|
12100
12102
|
const l = t ? g.attrName(t, "fetch-headers") : g.attrName(null, "headers", !0), u = g.readFetchHeaders(
|
|
12101
12103
|
e,
|
|
@@ -12105,9 +12107,9 @@ ${W}
|
|
|
12105
12107
|
const d = t ? g.attrName(t, "fetch-content-type") : g.attrName(null, "content-type", !0);
|
|
12106
12108
|
let y = null;
|
|
12107
12109
|
if (e.hasAttribute(d)) {
|
|
12108
|
-
const
|
|
12109
|
-
|
|
12110
|
-
|
|
12110
|
+
const k = e.getAttributeEvaluation(d);
|
|
12111
|
+
k?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), y = g.normalizeAttributeText(
|
|
12112
|
+
k?.value
|
|
12111
12113
|
);
|
|
12112
12114
|
}
|
|
12113
12115
|
if (y !== null)
|
|
@@ -12116,10 +12118,10 @@ ${W}
|
|
|
12116
12118
|
y
|
|
12117
12119
|
);
|
|
12118
12120
|
else if (a.method && !g.hasDeclaredContentType(a.headers)) {
|
|
12119
|
-
const
|
|
12121
|
+
const k = a.method.toUpperCase();
|
|
12120
12122
|
a.headers = g.withContentType(
|
|
12121
12123
|
a.headers,
|
|
12122
|
-
|
|
12124
|
+
k === "GET" || k === "HEAD" || k === "OPTIONS" ? "application/x-www-form-urlencoded" : "application/json"
|
|
12123
12125
|
);
|
|
12124
12126
|
}
|
|
12125
12127
|
Object.keys(a).length > 0 && (r.fetchOptions = a);
|
|
@@ -12131,8 +12133,8 @@ ${W}
|
|
|
12131
12133
|
);
|
|
12132
12134
|
else if (e.hasAttribute(b)) {
|
|
12133
12135
|
r.download = !0;
|
|
12134
|
-
const
|
|
12135
|
-
r.downloadFileName =
|
|
12136
|
+
const k = e.getAttributeEvaluation(b);
|
|
12137
|
+
r.downloadFileName = k?.hasUnresolvedReference ? null : g.normalizeAttributeText(k?.value);
|
|
12136
12138
|
}
|
|
12137
12139
|
const E = t ? g.attrName(t, "fetch-download-folder") : g.attrName(null, "download-folder", !0);
|
|
12138
12140
|
e.hasAttribute(E) && (r.download ? r.downloadFolder = !0 : m.warn(
|
|
@@ -12141,82 +12143,84 @@ ${W}
|
|
|
12141
12143
|
));
|
|
12142
12144
|
const A = t ? g.attrName(t, "bind") : g.attrName(null, "bind", !0);
|
|
12143
12145
|
if (e.hasAttribute(A)) {
|
|
12144
|
-
const
|
|
12145
|
-
if (
|
|
12146
|
-
const
|
|
12147
|
-
|
|
12148
|
-
const
|
|
12149
|
-
|
|
12146
|
+
const k = z.read(e, A);
|
|
12147
|
+
if (k) {
|
|
12148
|
+
const B = z.queryAll(k, A);
|
|
12149
|
+
B.length > 0 ? (r.bindFragments = [], B.forEach((ue) => {
|
|
12150
|
+
const U = D.get(ue);
|
|
12151
|
+
U && r.bindFragments.push(U);
|
|
12150
12152
|
})) : m.error(
|
|
12151
12153
|
"Haori",
|
|
12152
|
-
`Bind element not found: ${
|
|
12154
|
+
`Bind element not found: ${k} (${A})`
|
|
12153
12155
|
);
|
|
12154
12156
|
}
|
|
12155
12157
|
}
|
|
12156
|
-
const
|
|
12157
|
-
t ? e.hasAttribute(
|
|
12158
|
-
|
|
12159
|
-
) : e.hasAttribute(
|
|
12158
|
+
const w = g.attrName(t, "bind-arg"), $ = g.attrName(null, "arg", !0), C = g.attrName(null, "bind-arg", !0);
|
|
12159
|
+
t ? e.hasAttribute(w) && (r.bindArg = e.getRawAttribute(w)) : e.hasAttribute($) ? r.bindArg = e.getRawAttribute(
|
|
12160
|
+
$
|
|
12161
|
+
) : e.hasAttribute(C) && (r.bindArg = e.getRawAttribute(C));
|
|
12160
12162
|
const se = t ? g.attrName(t, "bind-params") : g.attrName(null, "bind-params", !0);
|
|
12161
12163
|
if (e.hasAttribute(se)) {
|
|
12162
|
-
const
|
|
12163
|
-
r.bindParams =
|
|
12164
|
+
const k = e.getRawAttribute(se);
|
|
12165
|
+
r.bindParams = k.split("&").map((B) => B.trim());
|
|
12164
12166
|
}
|
|
12165
12167
|
const F = t ? g.attrName(t, "bind-append") : g.attrName(null, "bind-append", !0);
|
|
12166
12168
|
if (e.hasAttribute(F)) {
|
|
12167
|
-
const
|
|
12168
|
-
r.bindAppendParams =
|
|
12169
|
-
}
|
|
12170
|
-
const
|
|
12171
|
-
e.hasAttribute(
|
|
12172
|
-
const
|
|
12173
|
-
e.hasAttribute(
|
|
12174
|
-
const
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12169
|
+
const k = e.getRawAttribute(F);
|
|
12170
|
+
r.bindAppendParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12171
|
+
}
|
|
12172
|
+
const Z = t ? g.attrName(t, "bind-merge") : g.attrName(null, "bind-merge", !0);
|
|
12173
|
+
e.hasAttribute(Z) && (r.bindMerge = !0);
|
|
12174
|
+
const ee = t ? g.attrName(t, "bind-transform") : g.attrName(null, "bind-transform", !0);
|
|
12175
|
+
e.hasAttribute(ee) && (r.bindTransform = e.getRawAttribute(ee));
|
|
12176
|
+
const ne = t ? g.attrName(t, "payload-transform") : g.attrName(null, "payload-transform", !0);
|
|
12177
|
+
e.hasAttribute(ne) && (r.payloadTransform = e.getRawAttribute(ne));
|
|
12178
|
+
const K = t ? g.attrName(t, "copy-params") : null;
|
|
12179
|
+
if (K && e.hasAttribute(K)) {
|
|
12180
|
+
const k = e.getRawAttribute(K);
|
|
12181
|
+
r.copyParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12178
12182
|
}
|
|
12179
12183
|
if (t) {
|
|
12180
12184
|
if (e.hasAttribute(g.attrName(t, "adjust"))) {
|
|
12181
|
-
const
|
|
12185
|
+
const W = z.read(
|
|
12182
12186
|
e,
|
|
12183
12187
|
g.attrName(t, "adjust")
|
|
12184
12188
|
);
|
|
12185
|
-
if (
|
|
12186
|
-
const G =
|
|
12187
|
-
|
|
12189
|
+
if (W) {
|
|
12190
|
+
const G = z.queryAll(
|
|
12191
|
+
W,
|
|
12188
12192
|
g.attrName(t, "adjust")
|
|
12189
12193
|
);
|
|
12190
|
-
G.length > 0 ? (r.adjustFragments = [], G.forEach((
|
|
12191
|
-
const
|
|
12192
|
-
|
|
12194
|
+
G.length > 0 ? (r.adjustFragments = [], G.forEach((ie) => {
|
|
12195
|
+
const be = D.get(ie);
|
|
12196
|
+
be && r.adjustFragments.push(be);
|
|
12193
12197
|
})) : m.error(
|
|
12194
12198
|
"Haori",
|
|
12195
|
-
`Adjust element not found: ${
|
|
12199
|
+
`Adjust element not found: ${W} (${g.attrName(t, "adjust")})`
|
|
12196
12200
|
);
|
|
12197
12201
|
}
|
|
12198
12202
|
if (e.hasAttribute(g.attrName(t, "adjust-value"))) {
|
|
12199
12203
|
const G = e.getRawAttribute(
|
|
12200
12204
|
g.attrName(t, "adjust-value")
|
|
12201
|
-
),
|
|
12202
|
-
isNaN(
|
|
12205
|
+
), ie = Number(G);
|
|
12206
|
+
isNaN(ie) || (r.adjustValue = ie);
|
|
12203
12207
|
}
|
|
12204
12208
|
}
|
|
12205
12209
|
e.hasAttribute(g.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(g.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(g.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(g.attrName(t, "row-next")) && (r.rowMoveNext = !0);
|
|
12206
|
-
const
|
|
12207
|
-
if (
|
|
12208
|
-
const
|
|
12210
|
+
const k = `${c.prefix}${t}-after-run`;
|
|
12211
|
+
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12212
|
+
const W = oe.compile(e, k, [
|
|
12209
12213
|
"response"
|
|
12210
12214
|
]);
|
|
12211
|
-
|
|
12212
|
-
} else if (e.hasAttribute(
|
|
12213
|
-
const
|
|
12215
|
+
W && (r.afterCallback = (G) => W([G]));
|
|
12216
|
+
} else if (e.hasAttribute(k)) {
|
|
12217
|
+
const W = e.getRawAttribute(k);
|
|
12214
12218
|
try {
|
|
12215
12219
|
r.afterCallback = new Function(
|
|
12216
12220
|
"response",
|
|
12217
12221
|
`
|
|
12218
12222
|
"use strict";
|
|
12219
|
-
${
|
|
12223
|
+
${W}
|
|
12220
12224
|
`
|
|
12221
12225
|
);
|
|
12222
12226
|
} catch (G) {
|
|
@@ -12241,12 +12245,12 @@ ${O}
|
|
|
12241
12245
|
"toast-level",
|
|
12242
12246
|
g.attrName(t, "toast-level")
|
|
12243
12247
|
)), t !== "poll") {
|
|
12244
|
-
const
|
|
12245
|
-
e.hasAttribute(
|
|
12248
|
+
const W = g.attrName(t, "error-toast");
|
|
12249
|
+
e.hasAttribute(W) && (r.errorToastMessage = g.readLateAttribute(
|
|
12246
12250
|
e,
|
|
12247
12251
|
r,
|
|
12248
12252
|
"error-toast",
|
|
12249
|
-
|
|
12253
|
+
W
|
|
12250
12254
|
), r.errorToastLevel = g.readToastLevel(
|
|
12251
12255
|
e,
|
|
12252
12256
|
r,
|
|
@@ -12263,27 +12267,27 @@ ${O}
|
|
|
12263
12267
|
g.attrName(t, "error-bind")
|
|
12264
12268
|
);
|
|
12265
12269
|
}
|
|
12266
|
-
const
|
|
12267
|
-
if (
|
|
12270
|
+
const B = g.attrName(t, "redirect"), ue = g.attrName(t, "redirect-replace"), U = e.hasAttribute(B), Q = e.hasAttribute(ue);
|
|
12271
|
+
if (U && (r.redirectUrl = g.readLateAttribute(
|
|
12268
12272
|
e,
|
|
12269
12273
|
r,
|
|
12270
12274
|
"redirect",
|
|
12271
|
-
|
|
12272
|
-
)),
|
|
12275
|
+
B
|
|
12276
|
+
)), Q && (r.redirectReplaceUrl = g.readLateAttribute(
|
|
12273
12277
|
e,
|
|
12274
12278
|
r,
|
|
12275
12279
|
"redirect-replace",
|
|
12276
|
-
|
|
12277
|
-
)),
|
|
12278
|
-
const
|
|
12280
|
+
ue
|
|
12281
|
+
)), U || Q) {
|
|
12282
|
+
const W = g.attrName(
|
|
12279
12283
|
t,
|
|
12280
12284
|
"redirect-return-param"
|
|
12281
12285
|
);
|
|
12282
|
-
e.hasAttribute(
|
|
12286
|
+
e.hasAttribute(W) && (r.redirectReturnParam = g.readLateAttribute(
|
|
12283
12287
|
e,
|
|
12284
12288
|
r,
|
|
12285
12289
|
"redirect-return-param",
|
|
12286
|
-
|
|
12290
|
+
W
|
|
12287
12291
|
));
|
|
12288
12292
|
}
|
|
12289
12293
|
if (e.hasAttribute(g.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(g.attrName(t, "clear-messages")) && (r.clearMessagesOnSuccess = !0), e.hasAttribute(g.attrName(t, "scroll")) && (r.scrollTarget = g.readLateAttribute(
|
|
@@ -12297,20 +12301,20 @@ ${O}
|
|
|
12297
12301
|
"history",
|
|
12298
12302
|
g.attrName(t, "history")
|
|
12299
12303
|
)), e.hasAttribute(g.attrName(t, "history-data")) && (r.historyDataAttrName = g.attrName(t, "history-data")), e.hasAttribute(g.attrName(t, "history-form"))) {
|
|
12300
|
-
const
|
|
12304
|
+
const W = z.read(
|
|
12301
12305
|
e,
|
|
12302
12306
|
g.attrName(t, "history-form")
|
|
12303
12307
|
);
|
|
12304
|
-
if (
|
|
12305
|
-
const G =
|
|
12306
|
-
|
|
12308
|
+
if (W) {
|
|
12309
|
+
const G = z.query(
|
|
12310
|
+
W,
|
|
12307
12311
|
g.attrName(t, "history-form")
|
|
12308
12312
|
);
|
|
12309
12313
|
G !== null ? r.historyFormFragment = x.getFormFragment(
|
|
12310
12314
|
D.get(G)
|
|
12311
12315
|
) : m.error(
|
|
12312
12316
|
"Haori",
|
|
12313
|
-
`Form element not found: ${
|
|
12317
|
+
`Form element not found: ${W} (${g.attrName(t, "history-form")})`
|
|
12314
12318
|
);
|
|
12315
12319
|
} else
|
|
12316
12320
|
r.historyFormFragment = x.getFormFragment(e);
|
|
@@ -12325,47 +12329,47 @@ ${O}
|
|
|
12325
12329
|
"close",
|
|
12326
12330
|
"error-click",
|
|
12327
12331
|
"error-close"
|
|
12328
|
-
].forEach((
|
|
12329
|
-
if (
|
|
12332
|
+
].forEach((W) => {
|
|
12333
|
+
if (W.startsWith("error-") && t === "poll")
|
|
12330
12334
|
return;
|
|
12331
|
-
const G = g.attrName(t,
|
|
12335
|
+
const G = g.attrName(t, W);
|
|
12332
12336
|
if (!e.hasAttribute(G))
|
|
12333
12337
|
return;
|
|
12334
|
-
const
|
|
12338
|
+
const ie = g.resolveSelectorTargets(
|
|
12335
12339
|
e,
|
|
12336
12340
|
G,
|
|
12337
|
-
|
|
12341
|
+
W
|
|
12338
12342
|
);
|
|
12339
|
-
if (
|
|
12340
|
-
switch (
|
|
12343
|
+
if (ie.length > 0)
|
|
12344
|
+
switch (W) {
|
|
12341
12345
|
case "reset-before":
|
|
12342
|
-
r.resetBeforeFragments =
|
|
12346
|
+
r.resetBeforeFragments = ie;
|
|
12343
12347
|
break;
|
|
12344
12348
|
case "reset":
|
|
12345
|
-
r.resetFragments =
|
|
12349
|
+
r.resetFragments = ie;
|
|
12346
12350
|
break;
|
|
12347
12351
|
case "refetch":
|
|
12348
|
-
r.refetchFragments =
|
|
12352
|
+
r.refetchFragments = ie;
|
|
12349
12353
|
break;
|
|
12350
12354
|
case "click":
|
|
12351
|
-
r.clickFragments =
|
|
12355
|
+
r.clickFragments = ie, r.clickAwait = e.hasAttribute(`${G}-await`);
|
|
12352
12356
|
break;
|
|
12353
12357
|
case "copy":
|
|
12354
|
-
r.copyFragments =
|
|
12358
|
+
r.copyFragments = ie;
|
|
12355
12359
|
break;
|
|
12356
12360
|
case "open":
|
|
12357
|
-
r.openFragments =
|
|
12361
|
+
r.openFragments = ie;
|
|
12358
12362
|
break;
|
|
12359
12363
|
case "close":
|
|
12360
|
-
r.closeFragments =
|
|
12364
|
+
r.closeFragments = ie;
|
|
12361
12365
|
break;
|
|
12362
12366
|
case "error-click":
|
|
12363
|
-
r.errorClickFragments =
|
|
12367
|
+
r.errorClickFragments = ie, r.errorClickAwait = e.hasAttribute(
|
|
12364
12368
|
`${G}-await`
|
|
12365
12369
|
);
|
|
12366
12370
|
break;
|
|
12367
12371
|
case "error-close":
|
|
12368
|
-
r.errorCloseFragments =
|
|
12372
|
+
r.errorCloseFragments = ie;
|
|
12369
12373
|
break;
|
|
12370
12374
|
}
|
|
12371
12375
|
}), t !== "poll" && (r.errorStatusActions = g.readErrorStatusActions(
|
|
@@ -12373,73 +12377,73 @@ ${O}
|
|
|
12373
12377
|
r,
|
|
12374
12378
|
t
|
|
12375
12379
|
));
|
|
12376
|
-
const
|
|
12377
|
-
if (e.hasAttribute(
|
|
12378
|
-
const
|
|
12379
|
-
if (
|
|
12380
|
-
const G =
|
|
12380
|
+
const ce = g.attrName(t, "copy-source");
|
|
12381
|
+
if (e.hasAttribute(ce)) {
|
|
12382
|
+
const W = z.read(e, ce);
|
|
12383
|
+
if (W) {
|
|
12384
|
+
const G = z.query(W, ce);
|
|
12381
12385
|
if (G !== null) {
|
|
12382
|
-
const
|
|
12383
|
-
|
|
12386
|
+
const ie = D.get(G);
|
|
12387
|
+
ie ? r.copySourceFragment = ie : m.error(
|
|
12384
12388
|
"Haori",
|
|
12385
|
-
`Element is not managed by Haori: ${
|
|
12389
|
+
`Element is not managed by Haori: ${W} (${ce})`
|
|
12386
12390
|
);
|
|
12387
12391
|
} else
|
|
12388
12392
|
m.error(
|
|
12389
12393
|
"Haori",
|
|
12390
|
-
`Element not found: ${
|
|
12394
|
+
`Element not found: ${W} (${ce})`
|
|
12391
12395
|
);
|
|
12392
12396
|
} else
|
|
12393
12397
|
r.copySourceFragment = e;
|
|
12394
12398
|
}
|
|
12395
12399
|
}
|
|
12396
12400
|
if (!t && (e.hasAttribute(g.attrName(null, "data", !0)) && (r.dataAttrName = g.attrName(null, "data", !0)), e.hasAttribute(g.attrName(null, "form", !0)))) {
|
|
12397
|
-
const
|
|
12401
|
+
const k = z.read(
|
|
12398
12402
|
e,
|
|
12399
12403
|
g.attrName(null, "form", !0)
|
|
12400
12404
|
);
|
|
12401
|
-
if (
|
|
12402
|
-
const
|
|
12403
|
-
|
|
12405
|
+
if (k) {
|
|
12406
|
+
const B = z.query(
|
|
12407
|
+
k,
|
|
12404
12408
|
g.attrName(null, "form", !0)
|
|
12405
12409
|
);
|
|
12406
|
-
|
|
12407
|
-
D.get(
|
|
12410
|
+
B !== null ? r.formFragment = x.getFormFragment(
|
|
12411
|
+
D.get(B)
|
|
12408
12412
|
) : m.error(
|
|
12409
12413
|
"Haori",
|
|
12410
|
-
`Form element not found: ${
|
|
12414
|
+
`Form element not found: ${k} (${g.attrName(null, "fetch-form", !0)})`
|
|
12411
12415
|
);
|
|
12412
12416
|
} else
|
|
12413
12417
|
r.formFragment = x.getFormFragment(e);
|
|
12414
12418
|
}
|
|
12415
12419
|
(!t || t === "poll") && g.readNoMessageDeclarations(e, r, t ?? "fetch");
|
|
12416
|
-
const
|
|
12417
|
-
if (e.hasAttribute(
|
|
12418
|
-
const
|
|
12419
|
-
|
|
12420
|
-
const
|
|
12421
|
-
|
|
12422
|
-
}),
|
|
12420
|
+
const ae = t ? g.attrName(t, "fetch-state") : g.attrName(null, "state", !0);
|
|
12421
|
+
if (e.hasAttribute(ae)) {
|
|
12422
|
+
const k = z.read(e, ae), B = [];
|
|
12423
|
+
k ? (z.queryAll(k, ae).forEach((U) => {
|
|
12424
|
+
const Q = D.get(U);
|
|
12425
|
+
Q && B.push(Q);
|
|
12426
|
+
}), B.length === 0 && m.error(
|
|
12423
12427
|
"Haori",
|
|
12424
|
-
`Element not found: ${
|
|
12425
|
-
)) :
|
|
12428
|
+
`Element not found: ${k} (${ae})`
|
|
12429
|
+
)) : B.push(e), B.length > 0 && (r.fetchStateFragments = B);
|
|
12426
12430
|
}
|
|
12427
|
-
const
|
|
12428
|
-
if (e.hasAttribute(
|
|
12429
|
-
const
|
|
12430
|
-
if (
|
|
12431
|
+
const j = t ? g.attrName(t, "store-clear") : g.attrName(null, "store-clear", !0);
|
|
12432
|
+
if (e.hasAttribute(j)) {
|
|
12433
|
+
const k = e.getRawAttribute(j), B = k === null ? "" : k.trim();
|
|
12434
|
+
if (B === "")
|
|
12431
12435
|
m.error(
|
|
12432
12436
|
"Haori",
|
|
12433
|
-
`ストレージキーが指定されていません (${
|
|
12437
|
+
`ストレージキーが指定されていません (${j})`
|
|
12434
12438
|
);
|
|
12435
12439
|
else {
|
|
12436
|
-
r.storeClearKey =
|
|
12437
|
-
const
|
|
12438
|
-
`${
|
|
12439
|
-
),
|
|
12440
|
-
|
|
12440
|
+
r.storeClearKey = B;
|
|
12441
|
+
const ue = e.getRawAttribute(
|
|
12442
|
+
`${j}-type`
|
|
12443
|
+
), U = ue === null ? "session" : ue.trim();
|
|
12444
|
+
U === "local" || U === "session" ? r.storeClearKind = U : (m.warn(
|
|
12441
12445
|
"Haori",
|
|
12442
|
-
`${
|
|
12446
|
+
`${j}-type は session または local を指定してください(session として扱います): ${U}`
|
|
12443
12447
|
), r.storeClearKind = "session");
|
|
12444
12448
|
}
|
|
12445
12449
|
}
|
|
@@ -12539,6 +12543,39 @@ ${O}
|
|
|
12539
12543
|
async runWithOutcome() {
|
|
12540
12544
|
return await this.execute() ? "success" : this.skipped ? "skipped" : "failure";
|
|
12541
12545
|
}
|
|
12546
|
+
/**
|
|
12547
|
+
* `data-{event}-clipboard` の値をクリップボードへ書き始めます。
|
|
12548
|
+
*
|
|
12549
|
+
* 値は呼んだ時点で評価します。評価結果が空(`null` / `undefined` / `false` /
|
|
12550
|
+
* `NaN` / 空文字)の場合と未解決参照を含む場合は書きません。書き込みは同期に始め、
|
|
12551
|
+
* 結果は Promise で返します(仕様「`data-{event}-clipboard`」)。
|
|
12552
|
+
*
|
|
12553
|
+
* @param attributeName 値を宣言した属性名
|
|
12554
|
+
* @returns 書き込みが完了したら true、書かなかった・失敗した場合は false
|
|
12555
|
+
* で解決する Promise
|
|
12556
|
+
*/
|
|
12557
|
+
startClipboardWrite(e) {
|
|
12558
|
+
const t = this.options.targetFragment?.getAttributeEvaluation(e);
|
|
12559
|
+
if (t?.hasUnresolvedReference)
|
|
12560
|
+
return Promise.resolve(!1);
|
|
12561
|
+
const r = t?.value, i = r == null || r === !1 || Number.isNaN(r) ? "" : String(r);
|
|
12562
|
+
if (i === "")
|
|
12563
|
+
return Promise.resolve(!1);
|
|
12564
|
+
const s = typeof navigator > "u" ? void 0 : navigator.clipboard;
|
|
12565
|
+
if (!s || typeof s.writeText != "function")
|
|
12566
|
+
return m.warn(
|
|
12567
|
+
"Haori",
|
|
12568
|
+
`${e}: navigator.clipboard is not available (it requires a secure context such as HTTPS).`
|
|
12569
|
+
), Promise.resolve(!1);
|
|
12570
|
+
try {
|
|
12571
|
+
return s.writeText(i).then(
|
|
12572
|
+
() => !0,
|
|
12573
|
+
(n) => (m.warn("Haori", `${e}: failed to write: ${n}`), !1)
|
|
12574
|
+
);
|
|
12575
|
+
} catch (n) {
|
|
12576
|
+
return m.warn("Haori", `${e}: failed to write: ${n}`), Promise.resolve(!1);
|
|
12577
|
+
}
|
|
12578
|
+
}
|
|
12542
12579
|
/**
|
|
12543
12580
|
* 一連の処理を実行します。成功結果を内部で扱うための実体です。
|
|
12544
12581
|
*
|
|
@@ -12558,104 +12595,112 @@ ${O}
|
|
|
12558
12595
|
`${c.prefix}${this.eventType ?? "fetch"}-form が解決できません`
|
|
12559
12596
|
), !this.evaluateExecutionCondition())
|
|
12560
12597
|
return this.skipped = !0, await this.commitEditOnStop(), !1;
|
|
12598
|
+
let t;
|
|
12561
12599
|
if (this.options.runScript) {
|
|
12562
|
-
const
|
|
12600
|
+
const A = this.options.targetFragment?.getTarget() ?? null;
|
|
12563
12601
|
try {
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
);
|
|
12568
|
-
b === !1 && this.domEvent && this.domEvent.preventDefault(), b != null && typeof b.then == "function" && await b;
|
|
12569
|
-
} catch (b) {
|
|
12570
|
-
m.error("Haori", `Run script execution error: ${b}`);
|
|
12602
|
+
t = this.options.runScript.call(A, this.domEvent), t === !1 && this.domEvent && this.domEvent.preventDefault();
|
|
12603
|
+
} catch (w) {
|
|
12604
|
+
m.error("Haori", `Run script execution error: ${w}`);
|
|
12571
12605
|
}
|
|
12572
12606
|
}
|
|
12607
|
+
const r = this.options.clipboardAttrName ? this.startClipboardWrite(this.options.clipboardAttrName) : null;
|
|
12608
|
+
if (t != null && typeof t.then == "function")
|
|
12609
|
+
try {
|
|
12610
|
+
await t;
|
|
12611
|
+
} catch (A) {
|
|
12612
|
+
m.error("Haori", `Run script execution error: ${A}`);
|
|
12613
|
+
}
|
|
12614
|
+
if (r && !await r)
|
|
12615
|
+
return await this.commitEditOnStop(), !1;
|
|
12573
12616
|
if (!await this.confirm())
|
|
12574
12617
|
return await this.commitEditOnStop(), !1;
|
|
12575
12618
|
if (this.options.downloadFolder && await this.prepareDownloadFolder() === "cancelled")
|
|
12576
12619
|
return !1;
|
|
12577
12620
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
12578
12621
|
this.options.resetBeforeFragments.map(
|
|
12579
|
-
(
|
|
12622
|
+
(A) => x.reset(A, this.operationSequence)
|
|
12580
12623
|
)
|
|
12581
12624
|
), this.captureHistorySnapshots());
|
|
12582
|
-
const
|
|
12625
|
+
const s = this.prepareFetchRequest();
|
|
12626
|
+
if (s.payloadTransformFailed)
|
|
12627
|
+
return await this.commitEditOnStop(), !1;
|
|
12583
12628
|
this.requestUserEditSequence = R.currentSequence();
|
|
12584
|
-
const
|
|
12585
|
-
let
|
|
12629
|
+
const n = s.payload, a = Object.keys(s.sentPayload).length > 0 ? s.sentPayload : void 0;
|
|
12630
|
+
let o = s.url, l = s.options, u = !1, d = !1;
|
|
12586
12631
|
if (this.options.beforeCallback) {
|
|
12587
|
-
const
|
|
12588
|
-
|
|
12589
|
-
|
|
12632
|
+
const A = this.options.beforeCallback(
|
|
12633
|
+
o || null,
|
|
12634
|
+
l || null
|
|
12590
12635
|
);
|
|
12591
|
-
if (
|
|
12592
|
-
if (
|
|
12636
|
+
if (A != null) {
|
|
12637
|
+
if (A === !1 || typeof A == "object" && A.stop)
|
|
12593
12638
|
return !1;
|
|
12594
|
-
typeof
|
|
12639
|
+
typeof A == "object" && (u = "fetchUrl" in A, d = "fetchOptions" in A, o = u ? A.fetchUrl : o, l = d ? A.fetchOptions : l);
|
|
12595
12640
|
}
|
|
12596
12641
|
}
|
|
12597
|
-
const
|
|
12598
|
-
if (
|
|
12642
|
+
const y = Object.keys(n).length > 0;
|
|
12643
|
+
if (o) {
|
|
12599
12644
|
this.isInputEditProcedure() && await this.commitFormValues(
|
|
12600
12645
|
this.options.formFragment,
|
|
12601
|
-
|
|
12646
|
+
n,
|
|
12602
12647
|
e
|
|
12603
12648
|
);
|
|
12604
|
-
const
|
|
12605
|
-
|
|
12606
|
-
|
|
12649
|
+
const A = (l?.method || "GET").toUpperCase(), $ = !u && d && s.transportMode === "query-get" && Nr(l) && !je(A) ? s.baseUrl ?? o : o, C = Ir(
|
|
12650
|
+
$,
|
|
12651
|
+
l
|
|
12607
12652
|
);
|
|
12608
|
-
|
|
12609
|
-
const
|
|
12610
|
-
if (
|
|
12653
|
+
o = C.url;
|
|
12654
|
+
const se = { ...C.options }, F = C.normalized ? C.requestedMethod : s.requestedMethod, Z = C.effectiveMethod, ee = s.transportMode === "query-get" || C.normalized, ne = C.queryString ?? s.queryString;
|
|
12655
|
+
if (ee && m.info("Haori demo fetch normalization", {
|
|
12611
12656
|
runtime: c.runtime,
|
|
12612
|
-
requestedMethod:
|
|
12613
|
-
effectiveMethod:
|
|
12657
|
+
requestedMethod: F,
|
|
12658
|
+
effectiveMethod: Z,
|
|
12614
12659
|
transportMode: "query-get",
|
|
12615
|
-
url:
|
|
12616
|
-
payload:
|
|
12617
|
-
queryString:
|
|
12618
|
-
}), this.options.targetFragment &&
|
|
12619
|
-
const
|
|
12660
|
+
url: o,
|
|
12661
|
+
payload: a,
|
|
12662
|
+
queryString: ne
|
|
12663
|
+
}), this.options.targetFragment && o) {
|
|
12664
|
+
const K = performance.now(), ae = {
|
|
12620
12665
|
runtime: c.runtime,
|
|
12621
|
-
requestedMethod:
|
|
12622
|
-
effectiveMethod:
|
|
12623
|
-
transportMode:
|
|
12624
|
-
...
|
|
12666
|
+
requestedMethod: F,
|
|
12667
|
+
effectiveMethod: Z,
|
|
12668
|
+
transportMode: ee ? "query-get" : "http",
|
|
12669
|
+
...ee ? { queryString: ne } : {}
|
|
12625
12670
|
};
|
|
12626
|
-
return
|
|
12671
|
+
return O.fetchStart(
|
|
12627
12672
|
this.options.targetFragment.getTarget(),
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
), await this.injectFetchState("loading"), await g.invokeFetch(
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
)).catch(async (
|
|
12637
|
-
throw
|
|
12673
|
+
o,
|
|
12674
|
+
se,
|
|
12675
|
+
a,
|
|
12676
|
+
ae
|
|
12677
|
+
), await this.injectFetchState("loading"), await g.invokeFetch(o, se).then((j) => this.handleFetchResult(
|
|
12678
|
+
j,
|
|
12679
|
+
o || void 0,
|
|
12680
|
+
K
|
|
12681
|
+
)).catch(async (j) => {
|
|
12682
|
+
throw o && O.fetchError(
|
|
12638
12683
|
this.options.targetFragment.getTarget(),
|
|
12639
|
-
|
|
12640
|
-
|
|
12684
|
+
o,
|
|
12685
|
+
j
|
|
12641
12686
|
), await this.injectFetchState(
|
|
12642
12687
|
"error",
|
|
12643
12688
|
null,
|
|
12644
|
-
|
|
12645
|
-
), await this.runErrorActions(null),
|
|
12689
|
+
j instanceof Error ? j.message : String(j)
|
|
12690
|
+
), await this.runErrorActions(null), j;
|
|
12646
12691
|
});
|
|
12647
12692
|
}
|
|
12648
|
-
return await fetch(
|
|
12693
|
+
return await fetch(o, se).then((K) => this.handleFetchResult(K, o || void 0));
|
|
12649
12694
|
}
|
|
12650
|
-
(!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment &&
|
|
12695
|
+
(!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && y && await this.commitFormValues(
|
|
12651
12696
|
this.options.formFragment,
|
|
12652
|
-
|
|
12697
|
+
n,
|
|
12653
12698
|
e
|
|
12654
|
-
), this.suppressEmptyReplaceBind = !
|
|
12655
|
-
const
|
|
12699
|
+
), this.suppressEmptyReplaceBind = !y && !this.options.formFragment && (this.eventType === "change" || this.eventType === "input"), this.twoWayCommitBind = this.eventType === "change" || this.eventType === "input";
|
|
12700
|
+
const b = y ? st(n) : {}, E = new Response(JSON.stringify(b), {
|
|
12656
12701
|
headers: { "Content-Type": "application/json" }
|
|
12657
12702
|
});
|
|
12658
|
-
return await this.handleFetchResult(
|
|
12703
|
+
return await this.handleFetchResult(E);
|
|
12659
12704
|
} finally {
|
|
12660
12705
|
this.releaseExecutionLock(e);
|
|
12661
12706
|
}
|
|
@@ -12720,7 +12765,7 @@ ${O}
|
|
|
12720
12765
|
a,
|
|
12721
12766
|
x.ancestorBaseResolver(e)
|
|
12722
12767
|
);
|
|
12723
|
-
await
|
|
12768
|
+
await M.setBindingData(i, l, {
|
|
12724
12769
|
skipFragments: s,
|
|
12725
12770
|
kind: "nonSupply",
|
|
12726
12771
|
sequence: this.operationSequence,
|
|
@@ -12795,7 +12840,7 @@ ${O}
|
|
|
12795
12840
|
t.removeAttribute("disabled");
|
|
12796
12841
|
return;
|
|
12797
12842
|
}
|
|
12798
|
-
|
|
12843
|
+
M.setAttribute(t, r.name, r.value).catch(
|
|
12799
12844
|
(i) => {
|
|
12800
12845
|
m.error(
|
|
12801
12846
|
"Haori",
|
|
@@ -12812,7 +12857,7 @@ ${O}
|
|
|
12812
12857
|
* 「選んだフォルダは、そのページが開いている間だけ覚えます」)。
|
|
12813
12858
|
*/
|
|
12814
12859
|
static forgetDownloadFolder() {
|
|
12815
|
-
|
|
12860
|
+
Pe = null;
|
|
12816
12861
|
}
|
|
12817
12862
|
/**
|
|
12818
12863
|
* 保存先のフォルダを用意します。
|
|
@@ -12824,8 +12869,8 @@ ${O}
|
|
|
12824
12869
|
* 今までどおりの保存へ落とす場合は `fallback`
|
|
12825
12870
|
*/
|
|
12826
12871
|
async prepareDownloadFolder() {
|
|
12827
|
-
if (
|
|
12828
|
-
return this.downloadFolder =
|
|
12872
|
+
if (Pe)
|
|
12873
|
+
return this.downloadFolder = Pe, "ready";
|
|
12829
12874
|
const e = globalThis.showDirectoryPicker;
|
|
12830
12875
|
if (typeof e != "function")
|
|
12831
12876
|
return m.info(
|
|
@@ -12834,7 +12879,7 @@ ${O}
|
|
|
12834
12879
|
), "fallback";
|
|
12835
12880
|
try {
|
|
12836
12881
|
const t = await e.call(globalThis, { mode: "readwrite" });
|
|
12837
|
-
return
|
|
12882
|
+
return Pe = t, this.downloadFolder = t, "ready";
|
|
12838
12883
|
} catch (t) {
|
|
12839
12884
|
return t?.name === "AbortError" ? "cancelled" : (m.info(
|
|
12840
12885
|
"Haori",
|
|
@@ -12963,7 +13008,7 @@ ${O}
|
|
|
12963
13008
|
`保存先のフォルダを確かめられなかったため、今までどおり保存します: ${l}`
|
|
12964
13009
|
), "fallback";
|
|
12965
13010
|
}
|
|
12966
|
-
if (n && !await
|
|
13011
|
+
if (n && !await Ae().confirm(
|
|
12967
13012
|
`${s} は既にあります。上書きしますか?`
|
|
12968
13013
|
))
|
|
12969
13014
|
return "cancelled";
|
|
@@ -13020,7 +13065,7 @@ ${O}
|
|
|
13020
13065
|
);
|
|
13021
13066
|
if (a !== "fallback")
|
|
13022
13067
|
return a;
|
|
13023
|
-
this.downloadFolder = null,
|
|
13068
|
+
this.downloadFolder = null, Pe = null;
|
|
13024
13069
|
}
|
|
13025
13070
|
const r = await this.readResponseBody(e);
|
|
13026
13071
|
if (r === null)
|
|
@@ -13049,7 +13094,7 @@ ${O}
|
|
|
13049
13094
|
* @returns 表示の完了 Promise
|
|
13050
13095
|
*/
|
|
13051
13096
|
async showDownloadFailure(e) {
|
|
13052
|
-
const t = this.resolveMessageScope(), r =
|
|
13097
|
+
const t = this.resolveMessageScope(), r = Ae();
|
|
13053
13098
|
await r.clearMessages(t), e && await r.addErrorMessage(t, Dt);
|
|
13054
13099
|
}
|
|
13055
13100
|
/**
|
|
@@ -13133,34 +13178,34 @@ ${O}
|
|
|
13133
13178
|
* フェッチ後の処理を実行します。
|
|
13134
13179
|
*/
|
|
13135
13180
|
async handleFetchResult(e, t, r) {
|
|
13136
|
-
const i =
|
|
13181
|
+
const i = Ae();
|
|
13137
13182
|
if (!e.ok) {
|
|
13138
13183
|
if (Jt(e.status, {
|
|
13139
13184
|
element: this.options.targetFragment.getTarget(),
|
|
13140
13185
|
attrPrefix: g.attrName(this.eventType, "", !0)
|
|
13141
13186
|
}))
|
|
13142
13187
|
return !1;
|
|
13143
|
-
this.options.targetFragment && t &&
|
|
13188
|
+
this.options.targetFragment && t && O.fetchError(
|
|
13144
13189
|
this.options.targetFragment.getTarget(),
|
|
13145
13190
|
t,
|
|
13146
13191
|
new Error(`${e.status} ${e.statusText}`),
|
|
13147
13192
|
e.status,
|
|
13148
13193
|
r
|
|
13149
13194
|
);
|
|
13150
|
-
const E = this.selectErrorActions(e.status), A = E?.bind === !0,
|
|
13195
|
+
const E = this.selectErrorActions(e.status), A = E?.bind === !0, w = await this.handleFetchError(
|
|
13151
13196
|
A ? e.clone() : e,
|
|
13152
13197
|
E?.noMessage !== !0 && !A
|
|
13153
13198
|
);
|
|
13154
|
-
return A && await this.bindResult(e).catch((
|
|
13155
|
-
m.error("Haori", "Failed to bind the error response:",
|
|
13199
|
+
return A && await this.bindResult(e).catch(($) => {
|
|
13200
|
+
m.error("Haori", "Failed to bind the error response:", $);
|
|
13156
13201
|
}), await this.injectFetchState(
|
|
13157
13202
|
"error",
|
|
13158
13203
|
e.status,
|
|
13159
13204
|
e.statusText || null,
|
|
13160
|
-
|
|
13205
|
+
w
|
|
13161
13206
|
), await this.runErrorActions(e.status), !1;
|
|
13162
13207
|
}
|
|
13163
|
-
if (this.options.targetFragment && t && r &&
|
|
13208
|
+
if (this.options.targetFragment && t && r && O.fetchEnd(
|
|
13164
13209
|
this.options.targetFragment.getTarget(),
|
|
13165
13210
|
t,
|
|
13166
13211
|
e.status,
|
|
@@ -13230,7 +13275,7 @@ ${O}
|
|
|
13230
13275
|
"scroll",
|
|
13231
13276
|
this.options.scrollTarget
|
|
13232
13277
|
);
|
|
13233
|
-
u &&
|
|
13278
|
+
u && z.query(
|
|
13234
13279
|
u,
|
|
13235
13280
|
g.attrName(this.eventType, "scroll"),
|
|
13236
13281
|
document
|
|
@@ -13254,16 +13299,16 @@ ${O}
|
|
|
13254
13299
|
this.options.redirectReturnParam
|
|
13255
13300
|
);
|
|
13256
13301
|
if (A) {
|
|
13257
|
-
const
|
|
13258
|
-
if (
|
|
13259
|
-
const
|
|
13260
|
-
|
|
13302
|
+
const $ = new URLSearchParams(window.location.search).get(A);
|
|
13303
|
+
if ($ !== null) {
|
|
13304
|
+
const C = $.trim();
|
|
13305
|
+
Oe.isSafeLocalPath(C) ? E = C : m.warn(
|
|
13261
13306
|
"Haori",
|
|
13262
|
-
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${
|
|
13307
|
+
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${$}`
|
|
13263
13308
|
);
|
|
13264
13309
|
}
|
|
13265
13310
|
}
|
|
13266
|
-
|
|
13311
|
+
Oe.isNavigableUrl(E) ? y ? window.location.replace(E) : window.location.href = E : m.error(
|
|
13267
13312
|
"Haori",
|
|
13268
13313
|
`遷移先が http: / https: / 現在ページと同じスキームの URL ではないため遷移しません: ${E}`
|
|
13269
13314
|
);
|
|
@@ -13278,7 +13323,7 @@ ${O}
|
|
|
13278
13323
|
*/
|
|
13279
13324
|
clearStore() {
|
|
13280
13325
|
const e = this.options.storeClearKey;
|
|
13281
|
-
e &&
|
|
13326
|
+
e && Be.clear(e, this.options.storeClearKind ?? "session");
|
|
13282
13327
|
}
|
|
13283
13328
|
/**
|
|
13284
13329
|
* 対象を宣言した順にクリックします(`data-{event}-click` /
|
|
@@ -13296,7 +13341,7 @@ ${O}
|
|
|
13296
13341
|
if (!e || e.length === 0)
|
|
13297
13342
|
return !1;
|
|
13298
13343
|
for (const i of e) {
|
|
13299
|
-
await
|
|
13344
|
+
await M.evaluateAll(i);
|
|
13300
13345
|
const s = i.getTarget();
|
|
13301
13346
|
if (t && g.takeClickOutcome(s), typeof s.click == "function" ? s.click() : s.dispatchEvent(
|
|
13302
13347
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
@@ -13332,7 +13377,7 @@ ${O}
|
|
|
13332
13377
|
`${t.key}-click-await`
|
|
13333
13378
|
))
|
|
13334
13379
|
return;
|
|
13335
|
-
const i =
|
|
13380
|
+
const i = Ae(), s = [];
|
|
13336
13381
|
t.closeFragments?.forEach((a) => {
|
|
13337
13382
|
const o = a.getTarget();
|
|
13338
13383
|
o instanceof HTMLElement ? s.push(i.closeDialog(o)) : m.error("Haori", "Element is not an HTML element: ", o);
|
|
@@ -13433,7 +13478,7 @@ ${O}
|
|
|
13433
13478
|
{ [Sr]: !0 },
|
|
13434
13479
|
"",
|
|
13435
13480
|
o.toString()
|
|
13436
|
-
),
|
|
13481
|
+
), M.refreshUrlParams();
|
|
13437
13482
|
} catch (a) {
|
|
13438
13483
|
m.error("Haori", `history.pushState failed: ${a}`);
|
|
13439
13484
|
}
|
|
@@ -13464,10 +13509,10 @@ ${O}
|
|
|
13464
13509
|
let r = null;
|
|
13465
13510
|
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r = x.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
|
|
13466
13511
|
const i = r ? r.getTarget() : document.body;
|
|
13467
|
-
await
|
|
13512
|
+
await Ae().clearMessages(i);
|
|
13468
13513
|
const s = async (u) => {
|
|
13469
13514
|
const d = r ? r.getTarget() : document.body;
|
|
13470
|
-
await
|
|
13515
|
+
await Ae().addErrorMessage(d, u);
|
|
13471
13516
|
}, n = () => {
|
|
13472
13517
|
if (!this.options.scrollOnError)
|
|
13473
13518
|
return;
|
|
@@ -13492,14 +13537,14 @@ ${O}
|
|
|
13492
13537
|
const y = /* @__PURE__ */ new Map(), b = [];
|
|
13493
13538
|
for (const E of u)
|
|
13494
13539
|
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
13495
|
-
const A = E.key,
|
|
13496
|
-
if (
|
|
13540
|
+
const A = E.key, w = E.message, $ = typeof A == "string" && A.length > 0 ? A : null, C = typeof w == "string" ? w : w != null ? String(w) : "";
|
|
13541
|
+
if (C.length === 0)
|
|
13497
13542
|
continue;
|
|
13498
|
-
if (
|
|
13499
|
-
const se = y.get(
|
|
13500
|
-
se.push(
|
|
13543
|
+
if ($ !== null) {
|
|
13544
|
+
const se = y.get($) ?? [];
|
|
13545
|
+
se.push(C), y.set($, se);
|
|
13501
13546
|
} else
|
|
13502
|
-
b.push(
|
|
13547
|
+
b.push(C);
|
|
13503
13548
|
} else typeof E == "string" && E.length > 0 && b.push(E);
|
|
13504
13549
|
for (const [E, A] of y)
|
|
13505
13550
|
d.push({ key: E, message: A.join(`
|
|
@@ -13636,7 +13681,7 @@ ${O}
|
|
|
13636
13681
|
const i = this.options.conditionAttributeName ?? `${c.prefix}if`, s = x.buildConditionScope(
|
|
13637
13682
|
r,
|
|
13638
13683
|
this.options.formFragment ?? null
|
|
13639
|
-
), n =
|
|
13684
|
+
), n = re.evaluateDetailed(t, s);
|
|
13640
13685
|
return n.unresolvedReference ? (e || m.warn(
|
|
13641
13686
|
"Haori",
|
|
13642
13687
|
`${i} の参照が解決できないため実行しません: ${t}`
|
|
@@ -13681,7 +13726,7 @@ ${O}
|
|
|
13681
13726
|
*/
|
|
13682
13727
|
confirm() {
|
|
13683
13728
|
const e = this.options.confirmMessage;
|
|
13684
|
-
return e == null ? Promise.resolve(!0) :
|
|
13729
|
+
return e == null ? Promise.resolve(!0) : Ae().confirm(e);
|
|
13685
13730
|
}
|
|
13686
13731
|
/**
|
|
13687
13732
|
* 結果データを対象のフラグメントにバインドします。
|
|
@@ -13698,7 +13743,7 @@ ${O}
|
|
|
13698
13743
|
let i = t ? JSON.parse(r) : r;
|
|
13699
13744
|
if (this.options.bindTransform)
|
|
13700
13745
|
try {
|
|
13701
|
-
i =
|
|
13746
|
+
i = re.evaluate(this.options.bindTransform, {
|
|
13702
13747
|
response: i
|
|
13703
13748
|
});
|
|
13704
13749
|
} catch (o) {
|
|
@@ -13733,11 +13778,11 @@ ${O}
|
|
|
13733
13778
|
apply: (b) => {
|
|
13734
13779
|
const E = this.resolveCurrentRowItem(o, b), A = { ...E };
|
|
13735
13780
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
13736
|
-
const
|
|
13781
|
+
const w = E[y], $ = w !== null && typeof w == "object" && !Array.isArray(w) ? w : {};
|
|
13737
13782
|
A[y] = this.mergeAppendBindingData(
|
|
13738
13783
|
o,
|
|
13739
13784
|
i,
|
|
13740
|
-
|
|
13785
|
+
$
|
|
13741
13786
|
);
|
|
13742
13787
|
} else
|
|
13743
13788
|
A[y] = i;
|
|
@@ -13757,7 +13802,7 @@ ${O}
|
|
|
13757
13802
|
} else
|
|
13758
13803
|
u[d] = i;
|
|
13759
13804
|
s.push(
|
|
13760
|
-
|
|
13805
|
+
M.setBindingData(
|
|
13761
13806
|
o.getTarget(),
|
|
13762
13807
|
this.reconcileUserEditsForBind(o, u, [d]),
|
|
13763
13808
|
{
|
|
@@ -13815,7 +13860,7 @@ ${O}
|
|
|
13815
13860
|
i
|
|
13816
13861
|
), d = this.options.bindMerge ? { ...o.getRawBindingData() ?? {}, ...u } : u;
|
|
13817
13862
|
s.push(
|
|
13818
|
-
|
|
13863
|
+
M.setBindingData(
|
|
13819
13864
|
o.getTarget(),
|
|
13820
13865
|
this.reconcileUserEditsForBind(
|
|
13821
13866
|
o,
|
|
@@ -13834,7 +13879,7 @@ ${O}
|
|
|
13834
13879
|
return s.push(this.applyRowWrites(a)), Promise.all(s).then(() => {
|
|
13835
13880
|
const o = this.options.bindArg ?? null;
|
|
13836
13881
|
this.options.bindFragments.forEach((l) => {
|
|
13837
|
-
|
|
13882
|
+
O.bindComplete(l.getTarget(), o);
|
|
13838
13883
|
});
|
|
13839
13884
|
});
|
|
13840
13885
|
});
|
|
@@ -13877,7 +13922,7 @@ ${O}
|
|
|
13877
13922
|
if (i === null)
|
|
13878
13923
|
return t;
|
|
13879
13924
|
const s = this.eventType === "poll";
|
|
13880
|
-
if (!s && !this.twoWayCommitBind &&
|
|
13925
|
+
if (!s && !this.twoWayCommitBind && M.clearUserEditMarks(e, i), !(e.getTarget() instanceof HTMLFormElement))
|
|
13881
13926
|
return this.reconcileAncestorArgFormEdits(
|
|
13882
13927
|
e,
|
|
13883
13928
|
t,
|
|
@@ -13893,9 +13938,9 @@ ${O}
|
|
|
13893
13938
|
const a = e.getAttribute(`${c.prefix}form-arg`);
|
|
13894
13939
|
if (a) {
|
|
13895
13940
|
const o = String(a), l = t[o], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
13896
|
-
return { ...t, [o]:
|
|
13941
|
+
return { ...t, [o]: we(u, n) };
|
|
13897
13942
|
}
|
|
13898
|
-
return
|
|
13943
|
+
return we(t, n);
|
|
13899
13944
|
}
|
|
13900
13945
|
/**
|
|
13901
13946
|
* 編集可能な行へのバインドについて、送信後の編集を要素データへ上書きし直します。
|
|
@@ -13917,12 +13962,12 @@ ${O}
|
|
|
13917
13962
|
if (r === null)
|
|
13918
13963
|
return t;
|
|
13919
13964
|
const i = this.eventType === "poll";
|
|
13920
|
-
!i && !this.twoWayCommitBind &&
|
|
13965
|
+
!i && !this.twoWayCommitBind && M.clearUserEditMarks(e, r);
|
|
13921
13966
|
const s = x.getValuesEditedAfter(
|
|
13922
13967
|
e,
|
|
13923
13968
|
i ? 0 : r
|
|
13924
13969
|
);
|
|
13925
|
-
return Object.keys(s).length === 0 ? t :
|
|
13970
|
+
return Object.keys(s).length === 0 ? t : we(t, s);
|
|
13926
13971
|
}
|
|
13927
13972
|
/**
|
|
13928
13973
|
* 祖先へのバインドについて、配下の `data-form-arg` フォームで送信後に行われた
|
|
@@ -13948,7 +13993,7 @@ ${O}
|
|
|
13948
13993
|
if (Object.keys(o).length === 0)
|
|
13949
13994
|
continue;
|
|
13950
13995
|
const l = s[a], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
13951
|
-
s = { ...s, [a]:
|
|
13996
|
+
s = { ...s, [a]: we(u, o) };
|
|
13952
13997
|
}
|
|
13953
13998
|
return s;
|
|
13954
13999
|
}
|
|
@@ -13991,7 +14036,7 @@ ${O}
|
|
|
13991
14036
|
...t
|
|
13992
14037
|
};
|
|
13993
14038
|
s.push(
|
|
13994
|
-
|
|
14039
|
+
M.setBindingData(n.getTarget(), o, {
|
|
13995
14040
|
// 通番はコピーを起こした操作のもの(フェッチ応答の反映と同じ理由)。
|
|
13996
14041
|
sequence: this.operationSequence
|
|
13997
14042
|
})
|
|
@@ -14025,7 +14070,7 @@ ${O}
|
|
|
14025
14070
|
*/
|
|
14026
14071
|
resolveCurrentRowItem(e, t) {
|
|
14027
14072
|
const r = x.getValuesEditedAfter(e, 0);
|
|
14028
|
-
return Object.keys(r).length === 0 ? t :
|
|
14073
|
+
return Object.keys(r).length === 0 ? t : we(t, r);
|
|
14029
14074
|
}
|
|
14030
14075
|
/**
|
|
14031
14076
|
* 行の要素データへコピーの値を反映します。
|
|
@@ -14053,9 +14098,9 @@ ${O}
|
|
|
14053
14098
|
* @returns コピー元のデータ
|
|
14054
14099
|
*/
|
|
14055
14100
|
resolveCopySourceData() {
|
|
14056
|
-
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ?
|
|
14101
|
+
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? We(this.options.copySourceFragment) : M.withoutReservedBindingKeys(
|
|
14057
14102
|
this.options.copySourceFragment.getRawBindingData() ?? {}
|
|
14058
|
-
) : this.options.formFragment ?
|
|
14103
|
+
) : this.options.formFragment ? We(this.options.formFragment) : this.options.targetFragment ? M.withoutReservedBindingKeys(
|
|
14059
14104
|
this.options.targetFragment.getRawBindingData() ?? {}
|
|
14060
14105
|
) : {};
|
|
14061
14106
|
}
|
|
@@ -14098,6 +14143,29 @@ ${O}
|
|
|
14098
14143
|
hasUnresolvedReference: e.hasUnresolvedReference
|
|
14099
14144
|
};
|
|
14100
14145
|
}
|
|
14146
|
+
/**
|
|
14147
|
+
* `data-{event}-payload-transform` の式で送信データを変換します。
|
|
14148
|
+
*
|
|
14149
|
+
* 式の中では送信データを `payload` として参照します。評価できない場合、未解決
|
|
14150
|
+
* 参照を含む場合、結果が配列ではないオブジェクトにならない場合は、送信データを
|
|
14151
|
+
* 作れなかったものとして null を返します(仕様
|
|
14152
|
+
* 「`data-{event}-payload-transform`(非イベント:
|
|
14153
|
+
* `data-fetch-payload-transform`)」)。
|
|
14154
|
+
*
|
|
14155
|
+
* @param expression 変換式
|
|
14156
|
+
* @param payload 収集した送信データ
|
|
14157
|
+
* @returns 変換した送信データ。作れなかった場合は null
|
|
14158
|
+
*/
|
|
14159
|
+
transformPayload(e, t) {
|
|
14160
|
+
const r = re.evaluateDetailed(e, { payload: t });
|
|
14161
|
+
if (r.unresolvedReference)
|
|
14162
|
+
return null;
|
|
14163
|
+
const i = r.value;
|
|
14164
|
+
return i === null || typeof i != "object" || Array.isArray(i) ? (m.error(
|
|
14165
|
+
"Haori",
|
|
14166
|
+
"payload-transform must return an object: " + e
|
|
14167
|
+
), null) : i;
|
|
14168
|
+
}
|
|
14101
14169
|
/**
|
|
14102
14170
|
* 現在のオプションから送信前の fetch リクエストを組み立てます。
|
|
14103
14171
|
*
|
|
@@ -14111,19 +14179,42 @@ ${O}
|
|
|
14111
14179
|
baseUrl: null,
|
|
14112
14180
|
options: null,
|
|
14113
14181
|
payload: t,
|
|
14182
|
+
sentPayload: t,
|
|
14114
14183
|
hasUnresolvedReference: r,
|
|
14115
14184
|
requestedMethod: "GET",
|
|
14116
14185
|
effectiveMethod: "GET",
|
|
14117
14186
|
transportMode: "http",
|
|
14118
14187
|
signature: null
|
|
14119
14188
|
};
|
|
14120
|
-
let i =
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14189
|
+
let i = t;
|
|
14190
|
+
if (this.options.payloadTransform) {
|
|
14191
|
+
const y = this.transformPayload(
|
|
14192
|
+
this.options.payloadTransform,
|
|
14193
|
+
t
|
|
14194
|
+
);
|
|
14195
|
+
if (y === null)
|
|
14196
|
+
return {
|
|
14197
|
+
url: null,
|
|
14198
|
+
baseUrl: null,
|
|
14199
|
+
options: null,
|
|
14200
|
+
payload: t,
|
|
14201
|
+
sentPayload: t,
|
|
14202
|
+
payloadTransformFailed: !0,
|
|
14203
|
+
hasUnresolvedReference: !1,
|
|
14204
|
+
requestedMethod: "GET",
|
|
14205
|
+
effectiveMethod: "GET",
|
|
14206
|
+
transportMode: "http",
|
|
14207
|
+
signature: null
|
|
14208
|
+
};
|
|
14209
|
+
i = y;
|
|
14210
|
+
}
|
|
14211
|
+
let s = this.options.fetchUrl;
|
|
14212
|
+
const n = { ...this.options.fetchOptions || {} }, a = new Headers(
|
|
14213
|
+
n.headers || void 0
|
|
14214
|
+
), o = (n.method || "GET").toUpperCase(), l = c.runtime === "demo" && !je(o), u = l ? "GET" : o;
|
|
14215
|
+
if (n.method = u, Object.keys(i).length > 0 && Ue(i)) {
|
|
14216
|
+
const y = a.get("Content-Type") || "";
|
|
14217
|
+
!je(o) && /multipart\/form-data/i.test(y) ? Cr(i) && m.warn(
|
|
14127
14218
|
"Haori",
|
|
14128
14219
|
`A File value nested under ${c.prefix}form-object / ${c.prefix}form-list cannot be sent. Place file inputs at the top level of the collected form values.`
|
|
14129
14220
|
) : m.warn(
|
|
@@ -14131,39 +14222,40 @@ ${O}
|
|
|
14131
14222
|
`A File value cannot be sent without ${c.prefix}fetch-content-type="multipart/form-data" and a body method such as POST.`
|
|
14132
14223
|
);
|
|
14133
14224
|
}
|
|
14134
|
-
if (
|
|
14135
|
-
Object.keys(
|
|
14136
|
-
else if (Object.keys(
|
|
14137
|
-
const
|
|
14138
|
-
if (/multipart\/form-data/i.test(
|
|
14139
|
-
|
|
14140
|
-
const
|
|
14141
|
-
for (const [
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
}) :
|
|
14145
|
-
|
|
14146
|
-
} else if (/application\/x-www-form-urlencoded/i.test(
|
|
14147
|
-
const
|
|
14148
|
-
for (const [
|
|
14149
|
-
|
|
14150
|
-
|
|
14225
|
+
if (u === "GET" || u === "HEAD" || u === "OPTIONS")
|
|
14226
|
+
Object.keys(i).length > 0 && (s = Zt(s, i));
|
|
14227
|
+
else if (Object.keys(i).length > 0) {
|
|
14228
|
+
const y = a.get("Content-Type") || "";
|
|
14229
|
+
if (/multipart\/form-data/i.test(y)) {
|
|
14230
|
+
a.delete("Content-Type");
|
|
14231
|
+
const b = new FormData();
|
|
14232
|
+
for (const [E, A] of Object.entries(i))
|
|
14233
|
+
A == null ? b.append(E, "") : A instanceof Blob ? b.append(E, A) : Array.isArray(A) ? A.forEach((w) => {
|
|
14234
|
+
w instanceof Blob ? b.append(E, w) : b.append(E, Fe(w));
|
|
14235
|
+
}) : b.append(E, Fe(A));
|
|
14236
|
+
n.body = b;
|
|
14237
|
+
} else if (/application\/x-www-form-urlencoded/i.test(y)) {
|
|
14238
|
+
const b = new URLSearchParams();
|
|
14239
|
+
for (const [E, A] of Object.entries(i))
|
|
14240
|
+
A !== void 0 && (Array.isArray(A) ? A.forEach((w) => b.append(E, Fe(w))) : b.append(E, Fe(A)));
|
|
14241
|
+
n.body = b;
|
|
14151
14242
|
} else
|
|
14152
|
-
|
|
14243
|
+
a.set("Content-Type", "application/json"), n.body = JSON.stringify(i);
|
|
14153
14244
|
}
|
|
14154
|
-
|
|
14155
|
-
let
|
|
14156
|
-
return
|
|
14157
|
-
url:
|
|
14245
|
+
n.headers = a;
|
|
14246
|
+
let d;
|
|
14247
|
+
return l && (d = new URL(s, window.location.href).search || void 0, a.delete("Content-Type")), {
|
|
14248
|
+
url: s,
|
|
14158
14249
|
baseUrl: this.options.fetchUrl,
|
|
14159
|
-
options:
|
|
14250
|
+
options: n,
|
|
14160
14251
|
payload: t,
|
|
14252
|
+
sentPayload: i,
|
|
14161
14253
|
hasUnresolvedReference: !1,
|
|
14162
|
-
requestedMethod:
|
|
14163
|
-
effectiveMethod:
|
|
14164
|
-
queryString:
|
|
14165
|
-
transportMode:
|
|
14166
|
-
signature:
|
|
14254
|
+
requestedMethod: o,
|
|
14255
|
+
effectiveMethod: u,
|
|
14256
|
+
queryString: d,
|
|
14257
|
+
transportMode: l ? "query-get" : "http",
|
|
14258
|
+
signature: $r(s, n)
|
|
14167
14259
|
};
|
|
14168
14260
|
}
|
|
14169
14261
|
/**
|
|
@@ -14173,7 +14265,7 @@ ${O}
|
|
|
14173
14265
|
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = g.resolveDataAttribute(
|
|
14174
14266
|
this.options.targetFragment,
|
|
14175
14267
|
this.options.historyDataAttrName
|
|
14176
|
-
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ?
|
|
14268
|
+
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? We(this.options.historyFormFragment) : void 0;
|
|
14177
14269
|
}
|
|
14178
14270
|
/**
|
|
14179
14271
|
* history-data の評価値を取得します。
|
|
@@ -14195,7 +14287,7 @@ ${O}
|
|
|
14195
14287
|
if (this.historyFormSnapshot !== void 0)
|
|
14196
14288
|
return this.historyFormSnapshot;
|
|
14197
14289
|
if (this.options.historyFormFragment)
|
|
14198
|
-
return
|
|
14290
|
+
return We(this.options.historyFormFragment);
|
|
14199
14291
|
}
|
|
14200
14292
|
/**
|
|
14201
14293
|
* copy-params が指定されている場合は include / exclude を考慮して抽出します。
|
|
@@ -14264,9 +14356,9 @@ ${O}
|
|
|
14264
14356
|
const t = this.options.targetFragment;
|
|
14265
14357
|
if (!t)
|
|
14266
14358
|
return m.error("Haori", "Target fragment is not specified for row operation."), null;
|
|
14267
|
-
const r = g.attrName(this.eventType, e), i =
|
|
14359
|
+
const r = g.attrName(this.eventType, e), i = z.read(t, r);
|
|
14268
14360
|
if (i !== null && i.trim() !== "") {
|
|
14269
|
-
const n =
|
|
14361
|
+
const n = z.query(i, r, document);
|
|
14270
14362
|
if (n === null)
|
|
14271
14363
|
return m.error(
|
|
14272
14364
|
"Haori",
|
|
@@ -14544,7 +14636,7 @@ ${O}
|
|
|
14544
14636
|
}
|
|
14545
14637
|
if (!o)
|
|
14546
14638
|
return;
|
|
14547
|
-
const l =
|
|
14639
|
+
const l = M.setBindingData(
|
|
14548
14640
|
n.owner.getTarget(),
|
|
14549
14641
|
g.withPathValue(n.ownerData, n.path, a),
|
|
14550
14642
|
{
|
|
@@ -14560,7 +14652,7 @@ ${O}
|
|
|
14560
14652
|
sequence: this.operationSequence
|
|
14561
14653
|
}
|
|
14562
14654
|
);
|
|
14563
|
-
if (
|
|
14655
|
+
if (M.isEachUpdateRunning(s)) {
|
|
14564
14656
|
l.catch((u) => {
|
|
14565
14657
|
m.error("Haori", "Failed to write row data.", u);
|
|
14566
14658
|
});
|
|
@@ -14656,7 +14748,7 @@ ${O}
|
|
|
14656
14748
|
if (a && o !== null) {
|
|
14657
14749
|
const l = [];
|
|
14658
14750
|
r.forEach((y, b) => {
|
|
14659
|
-
|
|
14751
|
+
M.createListKey(
|
|
14660
14752
|
y,
|
|
14661
14753
|
String(a),
|
|
14662
14754
|
b
|
|
@@ -14775,14 +14867,14 @@ ${O}
|
|
|
14775
14867
|
if (g.isSameRowItem(i.array[E], b))
|
|
14776
14868
|
return;
|
|
14777
14869
|
const A = y.get(
|
|
14778
|
-
|
|
14870
|
+
M.createListKey(
|
|
14779
14871
|
b,
|
|
14780
14872
|
null,
|
|
14781
14873
|
E
|
|
14782
14874
|
)
|
|
14783
14875
|
);
|
|
14784
|
-
A &&
|
|
14785
|
-
}),
|
|
14876
|
+
A && M.clearUserEditMarks(A);
|
|
14877
|
+
}), M.setBindingData(
|
|
14786
14878
|
i.owner.getTarget(),
|
|
14787
14879
|
g.withPathValue(i.ownerData, i.path, d),
|
|
14788
14880
|
{
|
|
@@ -14827,7 +14919,7 @@ ${O}
|
|
|
14827
14919
|
...a.getRawBindingData() ?? {},
|
|
14828
14920
|
_fetch: n
|
|
14829
14921
|
};
|
|
14830
|
-
return
|
|
14922
|
+
return M.setBindingData(o, l, {
|
|
14831
14923
|
reflectToAttribute: !1,
|
|
14832
14924
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
14833
14925
|
// 解除しない)。
|
|
@@ -14839,8 +14931,8 @@ ${O}
|
|
|
14839
14931
|
}
|
|
14840
14932
|
};
|
|
14841
14933
|
g.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, g.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, g.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet(), g.CLICK_OUTCOMES = /* @__PURE__ */ new WeakMap(), g.validationReportGeneration = 0, g.VALIDATION_SCROLL_TIMEOUT_MS = 1e3, g.VALIDATION_SCROLL_STABLE_FRAMES = 2;
|
|
14842
|
-
let
|
|
14843
|
-
class
|
|
14934
|
+
let he = g;
|
|
14935
|
+
class Mr {
|
|
14844
14936
|
/**
|
|
14845
14937
|
* 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
|
|
14846
14938
|
*
|
|
@@ -14963,7 +15055,7 @@ const h = class h {
|
|
|
14963
15055
|
static reevaluateChildren(e) {
|
|
14964
15056
|
const t = [];
|
|
14965
15057
|
return e.getChildren().forEach((r) => {
|
|
14966
|
-
r instanceof R ? t.push(h.evaluateAll(r)) : r instanceof
|
|
15058
|
+
r instanceof R ? t.push(h.evaluateAll(r)) : r instanceof de && t.push(h.evaluateText(r));
|
|
14967
15059
|
}), Promise.all(t).then(() => {
|
|
14968
15060
|
});
|
|
14969
15061
|
}
|
|
@@ -15054,7 +15146,7 @@ const h = class h {
|
|
|
15054
15146
|
return Promise.all(h.initialValueRestores).then(() => h.executeManagedFetch(e, !0)).catch((a) => {
|
|
15055
15147
|
m.error("Haori", `初期表示の取得に失敗しました: ${a}`);
|
|
15056
15148
|
}), Promise.resolve();
|
|
15057
|
-
const i = h.getReactiveFetchState(r), s =
|
|
15149
|
+
const i = h.getReactiveFetchState(r), s = he.resolveAutoFetchSignature(e);
|
|
15058
15150
|
if (i.running)
|
|
15059
15151
|
return (s.hasUnresolvedReference || s.signature !== i.lastSignature) && (i.rerunRequested = !0), Promise.resolve();
|
|
15060
15152
|
if (s.hasUnresolvedReference || s.signature === null)
|
|
@@ -15062,7 +15154,7 @@ const h = class h {
|
|
|
15062
15154
|
if (i.lastSignature === s.signature)
|
|
15063
15155
|
return Promise.resolve();
|
|
15064
15156
|
i.lastSignature = s.signature, i.running = !0;
|
|
15065
|
-
const n = new
|
|
15157
|
+
const n = new he(e, null);
|
|
15066
15158
|
return n.markReentrantBind(), n.runWithResult().then(() => {
|
|
15067
15159
|
}).catch(() => {
|
|
15068
15160
|
}).finally(() => {
|
|
@@ -15088,23 +15180,23 @@ const h = class h {
|
|
|
15088
15180
|
return Promise.resolve();
|
|
15089
15181
|
r.lastUrl = s, r.running = !0;
|
|
15090
15182
|
const n = performance.now();
|
|
15091
|
-
return t.setAttribute(`${c.prefix}importing`, ""),
|
|
15183
|
+
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, s), Mr.load(s, void 0, {
|
|
15092
15184
|
element: t,
|
|
15093
15185
|
attrPrefix: `${c.prefix}import-`
|
|
15094
15186
|
}).then((a) => {
|
|
15095
15187
|
const o = new TextEncoder().encode(a).length;
|
|
15096
|
-
return
|
|
15188
|
+
return J.enqueue(() => {
|
|
15097
15189
|
t.innerHTML = a;
|
|
15098
15190
|
}).then(() => {
|
|
15099
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
15191
|
+
t.removeAttribute(`${c.prefix}importing`), O.importEnd(t, s, o, n), h.adoptImportedChildren(e);
|
|
15100
15192
|
const l = [];
|
|
15101
15193
|
return e.getChildren().forEach((u) => {
|
|
15102
|
-
u instanceof R ? l.push(h.scan(u.getTarget())) : u instanceof
|
|
15194
|
+
u instanceof R ? l.push(h.scan(u.getTarget())) : u instanceof de && l.push(h.evaluateText(u));
|
|
15103
15195
|
}), Promise.all(l).then(() => {
|
|
15104
15196
|
});
|
|
15105
15197
|
});
|
|
15106
15198
|
}).catch((a) => {
|
|
15107
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
15199
|
+
t.removeAttribute(`${c.prefix}importing`), O.importError(t, s, a), m.error("[Haori]", "Failed to import HTML:", s, a);
|
|
15108
15200
|
}).finally(() => {
|
|
15109
15201
|
if (r.running = !1, r.rerunRequested)
|
|
15110
15202
|
return r.rerunRequested = !1, h.executeManagedImport(e);
|
|
@@ -15159,7 +15251,7 @@ const h = class h {
|
|
|
15159
15251
|
() => x.restoreInitialValues(e)
|
|
15160
15252
|
);
|
|
15161
15253
|
return h.initialValueRestores.add(i), i.then(() => {
|
|
15162
|
-
h.initialValueRestores.delete(i), t &&
|
|
15254
|
+
h.initialValueRestores.delete(i), t && le.applySubtree(e);
|
|
15163
15255
|
});
|
|
15164
15256
|
}
|
|
15165
15257
|
/**
|
|
@@ -15180,7 +15272,7 @@ const h = class h {
|
|
|
15180
15272
|
const r = e.getTarget();
|
|
15181
15273
|
return R.retryUnappliedValueWrites(r, t).then(
|
|
15182
15274
|
() => {
|
|
15183
|
-
|
|
15275
|
+
le.applySubtree(r);
|
|
15184
15276
|
}
|
|
15185
15277
|
);
|
|
15186
15278
|
}
|
|
@@ -15193,7 +15285,7 @@ const h = class h {
|
|
|
15193
15285
|
*/
|
|
15194
15286
|
static initializeFreshEachRow(e) {
|
|
15195
15287
|
return h.initializeElementFragment(e, !0).then(() => {
|
|
15196
|
-
h.needsScheduledEvaluateAll(e) && h.scheduleEvaluateAll(e),
|
|
15288
|
+
h.needsScheduledEvaluateAll(e) && h.scheduleEvaluateAll(e), le.applySubtree(e.getTarget());
|
|
15197
15289
|
});
|
|
15198
15290
|
}
|
|
15199
15291
|
/**
|
|
@@ -15214,7 +15306,7 @@ const h = class h {
|
|
|
15214
15306
|
return e.getChildren().forEach((s) => {
|
|
15215
15307
|
s instanceof R ? (!r || h.isEachFixedChild(s)) && i.push(
|
|
15216
15308
|
h.initializeElementFragment(s, t)
|
|
15217
|
-
) : s instanceof
|
|
15309
|
+
) : s instanceof de && i.push(h.evaluateText(s));
|
|
15218
15310
|
}), Promise.all(i).then(() => {
|
|
15219
15311
|
h.refreshDerivedSubtreeSignature(e);
|
|
15220
15312
|
});
|
|
@@ -15369,14 +15461,14 @@ const h = class h {
|
|
|
15369
15461
|
typeof r == "string" && (d = () => h.executeManagedImport(n));
|
|
15370
15462
|
break;
|
|
15371
15463
|
case `${c.prefix}store`:
|
|
15372
|
-
r !== null && o.push(
|
|
15464
|
+
r !== null && o.push(Be.restore(n));
|
|
15373
15465
|
break;
|
|
15374
15466
|
case `${c.prefix}validity`:
|
|
15375
15467
|
case `${c.prefix}validity-message`:
|
|
15376
15468
|
return r !== null && x.applyCustomValidity(n), Promise.all(o).then(() => {
|
|
15377
15469
|
});
|
|
15378
15470
|
case `${c.prefix}url-param`: {
|
|
15379
|
-
const y = n.getAttribute(`${c.prefix}url-arg`), b =
|
|
15471
|
+
const y = n.getAttribute(`${c.prefix}url-arg`), b = Oe.readParams();
|
|
15380
15472
|
y === null && n.hasAttribute(`${c.prefix}store`) && m.warn(
|
|
15381
15473
|
"Haori",
|
|
15382
15474
|
`${c.prefix}url-param を ${c.prefix}url-arg なしで ${c.prefix}store と併用すると復元した値が消えます(${c.prefix}url-arg を指定してください)。`
|
|
@@ -15442,34 +15534,34 @@ const h = class h {
|
|
|
15442
15534
|
const y = R.currentSequence(), b = i.getRawBindingData();
|
|
15443
15535
|
d && (r.clearUserEdits ?? !0) && h.clearUserEditMarks(i, l);
|
|
15444
15536
|
const E = a ? h.resolveByPathAuthority(i, b, t, u) : t;
|
|
15445
|
-
i.setBindingData(E), a && (
|
|
15537
|
+
i.setBindingData(E), a && (O.bindChange(e, b, E, "manual"), Be.mirror(i));
|
|
15446
15538
|
const A = () => {
|
|
15447
15539
|
i.markBindingWorkStart();
|
|
15448
|
-
const
|
|
15449
|
-
let
|
|
15540
|
+
const w = i.getRawBindingData() ?? E;
|
|
15541
|
+
let $ = a ? i.setAttribute(
|
|
15450
15542
|
`${c.prefix}bind`,
|
|
15451
|
-
JSON.stringify(h.withoutReservedBindingKeys(
|
|
15543
|
+
JSON.stringify(h.withoutReservedBindingKeys(w))
|
|
15452
15544
|
) : Promise.resolve();
|
|
15453
|
-
return e.tagName === "FORM" && (
|
|
15545
|
+
return e.tagName === "FORM" && ($ = $.then(() => {
|
|
15454
15546
|
if (i.wasResetAfter(y))
|
|
15455
15547
|
return;
|
|
15456
|
-
const
|
|
15548
|
+
const C = i.getRawBindingData() ?? E;
|
|
15457
15549
|
return x.syncValues(
|
|
15458
15550
|
i,
|
|
15459
|
-
x.resolveSyncValues(i,
|
|
15551
|
+
x.resolveSyncValues(i, C),
|
|
15460
15552
|
!1,
|
|
15461
15553
|
u
|
|
15462
15554
|
);
|
|
15463
|
-
})),
|
|
15555
|
+
})), $ = $.then(
|
|
15464
15556
|
() => x.syncAncestorArgForms(i, y, u, b)
|
|
15465
|
-
),
|
|
15557
|
+
), $ = $.then(() => h.evaluateAll(i, s)), $ = $.then(
|
|
15466
15558
|
() => R.retryUnappliedValueWrites(e, y)
|
|
15467
|
-
),
|
|
15559
|
+
), $ = $.then(
|
|
15468
15560
|
() => h.reevaluateReactiveSpecialAttributes(i, s)
|
|
15469
|
-
),
|
|
15561
|
+
), $.then(
|
|
15470
15562
|
() => i.markBindingWorkEnd(),
|
|
15471
|
-
(
|
|
15472
|
-
throw i.markBindingWorkEnd(),
|
|
15563
|
+
(C) => {
|
|
15564
|
+
throw i.markBindingWorkEnd(), C;
|
|
15473
15565
|
}
|
|
15474
15566
|
);
|
|
15475
15567
|
};
|
|
@@ -15535,22 +15627,22 @@ const h = class h {
|
|
|
15535
15627
|
if (h.isPlainRecord(t) && h.isPlainRecord(r)) {
|
|
15536
15628
|
const d = t, y = r, b = {};
|
|
15537
15629
|
let E = Object.keys(d).some(
|
|
15538
|
-
(
|
|
15630
|
+
(w) => !Object.prototype.hasOwnProperty.call(y, w)
|
|
15539
15631
|
);
|
|
15540
15632
|
const A = /* @__PURE__ */ new Set([
|
|
15541
15633
|
...Object.keys(d),
|
|
15542
15634
|
...Object.keys(y)
|
|
15543
15635
|
]);
|
|
15544
|
-
for (const
|
|
15545
|
-
const
|
|
15636
|
+
for (const w of A) {
|
|
15637
|
+
const $ = s === "" ? w : `${s}.${w}`, C = h.mergePathAuthority(
|
|
15546
15638
|
e,
|
|
15547
|
-
Object.prototype.hasOwnProperty.call(d,
|
|
15548
|
-
Object.prototype.hasOwnProperty.call(y,
|
|
15639
|
+
Object.prototype.hasOwnProperty.call(d, w) ? d[w] : h.ABSENT_PATH,
|
|
15640
|
+
Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH,
|
|
15549
15641
|
i,
|
|
15550
|
-
|
|
15642
|
+
$,
|
|
15551
15643
|
n
|
|
15552
15644
|
);
|
|
15553
|
-
|
|
15645
|
+
C !== h.ABSENT_PATH && (b[w] = C), C !== (Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH) && (E = !0);
|
|
15554
15646
|
}
|
|
15555
15647
|
return E ? b : y;
|
|
15556
15648
|
}
|
|
@@ -15839,7 +15931,7 @@ const h = class h {
|
|
|
15839
15931
|
return Promise.resolve();
|
|
15840
15932
|
if (r.attachObserved(s, i), s instanceof R)
|
|
15841
15933
|
return h.scan(s.getTarget());
|
|
15842
|
-
if (s instanceof
|
|
15934
|
+
if (s instanceof de)
|
|
15843
15935
|
return h.evaluateText(s);
|
|
15844
15936
|
}
|
|
15845
15937
|
return Promise.resolve();
|
|
@@ -15990,7 +16082,7 @@ const h = class h {
|
|
|
15990
16082
|
if (h.canSkipUnchangedNestedEach(A))
|
|
15991
16083
|
return;
|
|
15992
16084
|
E.push(h.evaluateAll(A, t));
|
|
15993
|
-
} else A instanceof
|
|
16085
|
+
} else A instanceof de && !t.has(A) && E.push(h.evaluateText(A));
|
|
15994
16086
|
}), Promise.all(E).then(() => {
|
|
15995
16087
|
});
|
|
15996
16088
|
}).then(() => {
|
|
@@ -16013,7 +16105,7 @@ const h = class h {
|
|
|
16013
16105
|
const i = e.getRawDerivedBindingData(), s = typeof r == "string" ? r.trim() : "";
|
|
16014
16106
|
if (!t || s === "")
|
|
16015
16107
|
return i === null ? Promise.resolve(!1) : (e.setDerivedBindingData(null), Promise.resolve(!0));
|
|
16016
|
-
const n =
|
|
16108
|
+
const n = re.evaluateDetailed(
|
|
16017
16109
|
t,
|
|
16018
16110
|
e.getBindingData()
|
|
16019
16111
|
);
|
|
@@ -16060,7 +16152,7 @@ const h = class h {
|
|
|
16060
16152
|
const t = e.getRawAttribute(`${c.prefix}if`);
|
|
16061
16153
|
if (typeof t != "string" || t.indexOf("{{") >= 0)
|
|
16062
16154
|
return;
|
|
16063
|
-
if (
|
|
16155
|
+
if (re.hasCompileFailure(t)) {
|
|
16064
16156
|
m.warn(
|
|
16065
16157
|
"[Haori]",
|
|
16066
16158
|
"data-if is hidden because the expression could not be compiled (see the preceding compile error):",
|
|
@@ -16136,7 +16228,7 @@ const h = class h {
|
|
|
16136
16228
|
static evaluateEachFixedChildren(e) {
|
|
16137
16229
|
const t = [];
|
|
16138
16230
|
return e.getChildren().forEach((r) => {
|
|
16139
|
-
r instanceof R ? h.isEachFixedChild(r) && t.push(h.evaluateAll(r)) : r instanceof
|
|
16231
|
+
r instanceof R ? h.isEachFixedChild(r) && t.push(h.evaluateAll(r)) : r instanceof de && t.push(h.evaluateText(r));
|
|
16140
16232
|
}), Promise.all(t).then(() => {
|
|
16141
16233
|
});
|
|
16142
16234
|
}
|
|
@@ -16176,7 +16268,7 @@ const h = class h {
|
|
|
16176
16268
|
if (h.isHiddenIfCondition(i))
|
|
16177
16269
|
V.isEnabled() && e.isVisible() && h.logFalsyIfDiagnostics(e), r.push(
|
|
16178
16270
|
e.hide().then(() => {
|
|
16179
|
-
|
|
16271
|
+
O.hide(e.getTarget());
|
|
16180
16272
|
})
|
|
16181
16273
|
);
|
|
16182
16274
|
else {
|
|
@@ -16191,10 +16283,10 @@ const h = class h {
|
|
|
16191
16283
|
() => h.reevaluateReactiveSpecialAttributes(l)
|
|
16192
16284
|
)
|
|
16193
16285
|
) : a.push(h.scanElement(l.getTarget(), !1));
|
|
16194
|
-
} else l instanceof
|
|
16286
|
+
} else l instanceof de && !(s && t.has(l)) && a.push(h.evaluateText(l));
|
|
16195
16287
|
}), r.push(
|
|
16196
16288
|
e.show().then(() => {
|
|
16197
|
-
|
|
16289
|
+
O.show(e.getTarget()), s || (h.triggerLoadOnShow(e), le.refreshSubtree(e.getTarget(), !1));
|
|
16198
16290
|
})
|
|
16199
16291
|
), r.push(
|
|
16200
16292
|
Promise.all(a).then(() => {
|
|
@@ -16217,7 +16309,7 @@ const h = class h {
|
|
|
16217
16309
|
*/
|
|
16218
16310
|
static triggerLoadOnShow(e) {
|
|
16219
16311
|
const t = `${c.prefix}load-`;
|
|
16220
|
-
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new
|
|
16312
|
+
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new he(e, "load").run().catch((i) => {
|
|
16221
16313
|
m.error("[Haori]", "data-load procedure error (on show):", i);
|
|
16222
16314
|
});
|
|
16223
16315
|
}
|
|
@@ -16245,7 +16337,7 @@ const h = class h {
|
|
|
16245
16337
|
* @return 差分更新(再実行を含む)の完了 Promise
|
|
16246
16338
|
*/
|
|
16247
16339
|
static evaluateEach(e) {
|
|
16248
|
-
if (V.isEnabled() &&
|
|
16340
|
+
if (V.isEnabled() && re.recordRowScopeIdentifiers([
|
|
16249
16341
|
h.getRowScopeName(e, "each-arg"),
|
|
16250
16342
|
h.getRowScopeName(e, "each-index")
|
|
16251
16343
|
]), e.isMounted() || h.syncMountedState(e), !e.isVisible() || !e.isMounted())
|
|
@@ -16295,7 +16387,7 @@ const h = class h {
|
|
|
16295
16387
|
t.rerunRequested = !1, await h.performEachUpdate(e);
|
|
16296
16388
|
while (t.rerunRequested);
|
|
16297
16389
|
const i = e.getTarget();
|
|
16298
|
-
i.setAttribute(`${c.prefix}each-done`, ""),
|
|
16390
|
+
i.setAttribute(`${c.prefix}each-done`, ""), le.refreshSubtree(i, !1), h.runEachRenderedScript(i);
|
|
16299
16391
|
} finally {
|
|
16300
16392
|
t.running = !1, t.settled = null;
|
|
16301
16393
|
}
|
|
@@ -16315,10 +16407,10 @@ const h = class h {
|
|
|
16315
16407
|
*/
|
|
16316
16408
|
static runEachRenderedScript(e) {
|
|
16317
16409
|
const t = `${c.prefix}each-rendered-run`, r = D.get(e);
|
|
16318
|
-
if (r === null || !
|
|
16410
|
+
if (r === null || !oe.declared(r, t))
|
|
16319
16411
|
return;
|
|
16320
|
-
if (
|
|
16321
|
-
const n =
|
|
16412
|
+
if (oe.applies(r, t)) {
|
|
16413
|
+
const n = oe.compile(r, t, []);
|
|
16322
16414
|
try {
|
|
16323
16415
|
n?.([]);
|
|
16324
16416
|
} catch (a) {
|
|
@@ -16502,7 +16594,7 @@ ${i}
|
|
|
16502
16594
|
const s = (n) => {
|
|
16503
16595
|
if (h.keepsRowScopeNames(n))
|
|
16504
16596
|
for (const a of n.getChildren())
|
|
16505
|
-
a instanceof
|
|
16597
|
+
a instanceof de ? h.areExpressionsRowLocal(
|
|
16506
16598
|
h.extractInterpolations(a.getRawText()),
|
|
16507
16599
|
i
|
|
16508
16600
|
) && r.add(a) : a instanceof R && (h.isRowLocalSubtree(a, i) ? r.add(a) : s(a));
|
|
@@ -16644,7 +16736,7 @@ ${i}
|
|
|
16644
16736
|
if (i instanceof R) {
|
|
16645
16737
|
if (!h.isRowLocalSubtree(i, r))
|
|
16646
16738
|
return !1;
|
|
16647
|
-
} else if (i instanceof
|
|
16739
|
+
} else if (i instanceof de) {
|
|
16648
16740
|
const s = i.getRawText();
|
|
16649
16741
|
if (s.includes("{{") && !h.areExpressionsRowLocal(
|
|
16650
16742
|
h.extractInterpolations(s),
|
|
@@ -16668,7 +16760,7 @@ ${i}
|
|
|
16668
16760
|
const i = r.trim();
|
|
16669
16761
|
if (i === "")
|
|
16670
16762
|
continue;
|
|
16671
|
-
const s =
|
|
16763
|
+
const s = re.getFreeIdentifiers(i);
|
|
16672
16764
|
if (s.length === 0 || s.some((n) => !t.has(n)))
|
|
16673
16765
|
return !1;
|
|
16674
16766
|
}
|
|
@@ -16917,7 +17009,7 @@ ${i}
|
|
|
16917
17009
|
const s = e.getRawAttribute(i);
|
|
16918
17010
|
return typeof s == "string" && s.includes("{{");
|
|
16919
17011
|
}) ? !0 : e.getChildren().some(
|
|
16920
|
-
(i) => i instanceof
|
|
17012
|
+
(i) => i instanceof de && i.hasDynamicContent()
|
|
16921
17013
|
);
|
|
16922
17014
|
}
|
|
16923
17015
|
/**
|
|
@@ -16927,7 +17019,7 @@ ${i}
|
|
|
16927
17019
|
* @returns subtree 全体を省略可能なら true
|
|
16928
17020
|
*/
|
|
16929
17021
|
static markFreshInitializationSkippable(e) {
|
|
16930
|
-
const t = e.getAttributeNames().some((s) => h.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof R ? !h.markFreshInitializationSkippable(s) : s instanceof
|
|
17022
|
+
const t = e.getAttributeNames().some((s) => h.isFreshInitializationDynamicAttribute(e, s)), r = e.getChildren().some((s) => s instanceof R ? !h.markFreshInitializationSkippable(s) : s instanceof de ? s.hasDynamicContent() : !1), i = !t && !r;
|
|
16931
17023
|
return e.setFreshInitializationSkippable(i), i;
|
|
16932
17024
|
}
|
|
16933
17025
|
/**
|
|
@@ -16960,7 +17052,7 @@ ${i}
|
|
|
16960
17052
|
let i = e.getAttribute(`${c.prefix}each-index`);
|
|
16961
17053
|
i && (i = String(i));
|
|
16962
17054
|
const s = e.getAttribute(`${c.prefix}each-key`), n = e.getAttribute(`${c.prefix}each-arg`), a = t.map(
|
|
16963
|
-
(F,
|
|
17055
|
+
(F, Z) => h.createListKey(F, s ? String(s) : null, Z)
|
|
16964
17056
|
), o = new Set(a), l = /* @__PURE__ */ new Map();
|
|
16965
17057
|
a.forEach((F) => {
|
|
16966
17058
|
l.set(F, (l.get(F) ?? 0) + 1);
|
|
@@ -16970,104 +17062,104 @@ ${i}
|
|
|
16970
17062
|
(F) => !F.hasAttribute(`${c.prefix}each-before`) && !F.hasAttribute(`${c.prefix}each-after`)
|
|
16971
17063
|
);
|
|
16972
17064
|
const y = d.map((F) => F.getListKey()), b = /* @__PURE__ */ new Set();
|
|
16973
|
-
d = d.filter((F,
|
|
16974
|
-
const
|
|
16975
|
-
if (
|
|
17065
|
+
d = d.filter((F, Z) => {
|
|
17066
|
+
const ee = String(F.getListKey()), ne = l.get(ee) ?? 0;
|
|
17067
|
+
if (ne === 0) {
|
|
16976
17068
|
b.add(F);
|
|
16977
|
-
const
|
|
16978
|
-
return
|
|
17069
|
+
const K = F.getListKey();
|
|
17070
|
+
return K !== null && O.rowRemove(F.getTarget(), K, Z), u.push(F.remove()), !1;
|
|
16979
17071
|
}
|
|
16980
|
-
return l.set(
|
|
17072
|
+
return l.set(ee, ne - 1), !0;
|
|
16981
17073
|
});
|
|
16982
17074
|
const E = d.map((F) => F.getListKey()), A = /* @__PURE__ */ new Map();
|
|
16983
17075
|
d.forEach((F) => {
|
|
16984
|
-
const
|
|
16985
|
-
if (
|
|
17076
|
+
const Z = F.getListKey();
|
|
17077
|
+
if (Z === null)
|
|
16986
17078
|
return;
|
|
16987
|
-
const
|
|
16988
|
-
|
|
17079
|
+
const ee = A.get(Z);
|
|
17080
|
+
ee ? ee.push(F) : A.set(Z, [F]);
|
|
16989
17081
|
});
|
|
16990
|
-
const
|
|
17082
|
+
const w = e.getChildElementFragments().filter((F) => !b.has(F)), $ = w.filter(
|
|
16991
17083
|
(F) => F.hasAttribute(`${c.prefix}each-before`)
|
|
16992
17084
|
).length;
|
|
16993
|
-
let
|
|
17085
|
+
let C = Promise.resolve();
|
|
16994
17086
|
const se = [];
|
|
16995
|
-
return a.forEach((F,
|
|
16996
|
-
const
|
|
16997
|
-
let
|
|
16998
|
-
const
|
|
16999
|
-
if (
|
|
17000
|
-
|
|
17001
|
-
const
|
|
17002
|
-
|
|
17087
|
+
return a.forEach((F, Z) => {
|
|
17088
|
+
const ee = t[Z], ne = Z;
|
|
17089
|
+
let K;
|
|
17090
|
+
const ae = A.get(F)?.shift();
|
|
17091
|
+
if (ae) {
|
|
17092
|
+
K = ae;
|
|
17093
|
+
const j = $ + Z;
|
|
17094
|
+
C = C.then(
|
|
17003
17095
|
() => h.updateRowFragment(
|
|
17004
|
-
|
|
17005
|
-
re,
|
|
17006
|
-
i,
|
|
17096
|
+
K,
|
|
17007
17097
|
ee,
|
|
17098
|
+
i,
|
|
17099
|
+
ne,
|
|
17008
17100
|
n ? String(n) : null,
|
|
17009
17101
|
F
|
|
17010
17102
|
).then(
|
|
17011
|
-
(
|
|
17103
|
+
(k) => (
|
|
17012
17104
|
// 再利用行も新しい並び順の位置へ移動する。移動しないと、配列を並べ替え
|
|
17013
17105
|
// ただけの更新(data-each-key 指定時はキーが変わらないため全行が再利用
|
|
17014
17106
|
// される)で DOM の順序が古いまま残る。
|
|
17015
17107
|
h.repositionEachRow(
|
|
17016
17108
|
e,
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
).then((
|
|
17021
|
-
|
|
17022
|
-
|
|
17109
|
+
K,
|
|
17110
|
+
w,
|
|
17111
|
+
j
|
|
17112
|
+
).then((B) => {
|
|
17113
|
+
B !== null && O.rowMove(
|
|
17114
|
+
K.getTarget(),
|
|
17023
17115
|
F,
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
), !(!
|
|
17116
|
+
B - $,
|
|
17117
|
+
Z
|
|
17118
|
+
), !(!k && h.isRowLocalEachTemplate(e)) && se.push(
|
|
17027
17119
|
h.evaluateAll(
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
).then(() => h.applyRowFormValues(e,
|
|
17120
|
+
K,
|
|
17121
|
+
k ? /* @__PURE__ */ new Set() : h.collectRowLocalFragments(e, K)
|
|
17122
|
+
).then(() => h.applyRowFormValues(e, K, ee))
|
|
17031
17123
|
);
|
|
17032
17124
|
})
|
|
17033
17125
|
)
|
|
17034
17126
|
)
|
|
17035
17127
|
);
|
|
17036
17128
|
} else {
|
|
17037
|
-
|
|
17038
|
-
const
|
|
17039
|
-
|
|
17129
|
+
K = r.clone();
|
|
17130
|
+
const j = $ + Z;
|
|
17131
|
+
C = C.then(
|
|
17040
17132
|
() => h.updateRowFragment(
|
|
17041
|
-
|
|
17042
|
-
re,
|
|
17043
|
-
i,
|
|
17133
|
+
K,
|
|
17044
17134
|
ee,
|
|
17135
|
+
i,
|
|
17136
|
+
ne,
|
|
17045
17137
|
n ? String(n) : null,
|
|
17046
17138
|
F
|
|
17047
17139
|
).then(() => {
|
|
17048
|
-
const
|
|
17049
|
-
return e.insertBefore(
|
|
17050
|
-
|
|
17051
|
-
}).then(() => h.initializeFreshEachRow(
|
|
17052
|
-
|
|
17140
|
+
const k = w[j] ?? null;
|
|
17141
|
+
return e.insertBefore(K, k).then(() => {
|
|
17142
|
+
w.splice(j, 0, K);
|
|
17143
|
+
}).then(() => h.initializeFreshEachRow(K)).then(() => h.applyRowFormValues(e, K, ee)).then(() => {
|
|
17144
|
+
O.rowAdd(K.getTarget(), F, ne, ee);
|
|
17053
17145
|
});
|
|
17054
17146
|
})
|
|
17055
17147
|
);
|
|
17056
17148
|
}
|
|
17057
|
-
}), Promise.all(u).then(() =>
|
|
17149
|
+
}), Promise.all(u).then(() => C).then(() => Promise.all(se)).then(() => {
|
|
17058
17150
|
const F = a.filter(
|
|
17059
|
-
(
|
|
17060
|
-
),
|
|
17061
|
-
(
|
|
17062
|
-
),
|
|
17063
|
-
(
|
|
17151
|
+
(j) => j !== null
|
|
17152
|
+
), Z = E.filter(
|
|
17153
|
+
(j) => j !== null
|
|
17154
|
+
), ee = new Set(Z), ne = F.filter((j) => !ee.has(j)), ae = y.filter(
|
|
17155
|
+
(j) => j !== null
|
|
17064
17156
|
).filter(
|
|
17065
|
-
(
|
|
17157
|
+
(j) => !o.has(j)
|
|
17066
17158
|
);
|
|
17067
|
-
|
|
17159
|
+
O.eachUpdate(
|
|
17068
17160
|
e.getTarget(),
|
|
17069
|
-
|
|
17070
|
-
|
|
17161
|
+
ne,
|
|
17162
|
+
ae,
|
|
17071
17163
|
F
|
|
17072
17164
|
);
|
|
17073
17165
|
});
|
|
@@ -17359,8 +17451,8 @@ h.ATTRIBUTE_ALIAS_SUFFIX = "attr-", h.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
17359
17451
|
"enhance",
|
|
17360
17452
|
"enhance-new"
|
|
17361
17453
|
]), h.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), h.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), h.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), h.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), h.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), h.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), h.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), h.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), h.ABSENT_PATH = Symbol("absent");
|
|
17362
|
-
let
|
|
17363
|
-
const
|
|
17454
|
+
let M = h;
|
|
17455
|
+
const Me = class Me {
|
|
17364
17456
|
/**
|
|
17365
17457
|
* コンストラクタ。
|
|
17366
17458
|
*
|
|
@@ -17371,7 +17463,7 @@ const Fe = class Fe {
|
|
|
17371
17463
|
if (t.defaultPrevented || x.isResettingInternally())
|
|
17372
17464
|
return;
|
|
17373
17465
|
const r = t.target;
|
|
17374
|
-
r instanceof HTMLElement && setTimeout(() =>
|
|
17466
|
+
r instanceof HTMLElement && setTimeout(() => le.refreshSubtree(r), 0);
|
|
17375
17467
|
}, this.onChange = (t) => this.delegate(t, "change"), this.onInput = (t) => this.delegate(t, "input"), this.onLoadCapture = (t) => this.delegate(t, "load"), this.onWindowLoad = () => {
|
|
17376
17468
|
if (this.deferred) {
|
|
17377
17469
|
this.deferredProcedures.push(() => this.runWindowLoadProcedure());
|
|
@@ -17380,8 +17472,8 @@ const Fe = class Fe {
|
|
|
17380
17472
|
this.runWindowLoadProcedure();
|
|
17381
17473
|
}, this.onPopstate = (t) => {
|
|
17382
17474
|
const r = t.state;
|
|
17383
|
-
if (!r || r[
|
|
17384
|
-
|
|
17475
|
+
if (!r || r[Me.HISTORY_STATE_KEY] !== !0) {
|
|
17476
|
+
M.refreshUrlParams();
|
|
17385
17477
|
return;
|
|
17386
17478
|
}
|
|
17387
17479
|
location.reload();
|
|
@@ -17394,7 +17486,7 @@ const Fe = class Fe {
|
|
|
17394
17486
|
*/
|
|
17395
17487
|
runWindowLoadProcedure() {
|
|
17396
17488
|
const e = document.documentElement, t = D.get(e);
|
|
17397
|
-
t && new
|
|
17489
|
+
t && new he(t, "load").run();
|
|
17398
17490
|
}
|
|
17399
17491
|
/**
|
|
17400
17492
|
* イベントリスナーの登録を開始します。
|
|
@@ -17488,7 +17580,7 @@ const Fe = class Fe {
|
|
|
17488
17580
|
subscribeCustomEvent(e) {
|
|
17489
17581
|
if (e === null || e === "")
|
|
17490
17582
|
return;
|
|
17491
|
-
if (
|
|
17583
|
+
if (Me.BUILTIN_EVENT_NAMES.has(e)) {
|
|
17492
17584
|
m.warn(
|
|
17493
17585
|
"[Haori]",
|
|
17494
17586
|
`data-on="${e}" は組み込みイベントです。data-${e}-* を使用してください(data-on はカスタムイベント専用)。`
|
|
@@ -17518,7 +17610,7 @@ const Fe = class Fe {
|
|
|
17518
17610
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
17519
17611
|
return;
|
|
17520
17612
|
const s = D.get(i);
|
|
17521
|
-
s instanceof R && this.isFromTarget(s, t) && new
|
|
17613
|
+
s instanceof R && this.isFromTarget(s, t) && new he(s, "on", t).run().catch((n) => {
|
|
17522
17614
|
m.error("[Haori]", "Procedure execution error:", n);
|
|
17523
17615
|
});
|
|
17524
17616
|
});
|
|
@@ -17538,8 +17630,8 @@ const Fe = class Fe {
|
|
|
17538
17630
|
const r = `${this.onAttributeName}-target`;
|
|
17539
17631
|
if (!e.hasAttribute(r))
|
|
17540
17632
|
return !0;
|
|
17541
|
-
const i =
|
|
17542
|
-
return i === null || !(s instanceof Node) ? !1 :
|
|
17633
|
+
const i = z.read(e, r), s = t.target;
|
|
17634
|
+
return i === null || !(s instanceof Node) ? !1 : z.queryAll(i, r).some(
|
|
17543
17635
|
(n) => n.contains(s)
|
|
17544
17636
|
);
|
|
17545
17637
|
}
|
|
@@ -17606,11 +17698,11 @@ const Fe = class Fe {
|
|
|
17606
17698
|
return;
|
|
17607
17699
|
(t === "change" || t === "input") && this.syncUserEdit(e, t === "change");
|
|
17608
17700
|
const s = () => {
|
|
17609
|
-
const n = new
|
|
17701
|
+
const n = new he(i, t, r).runWithOutcome().catch((a) => (m.error("[Haori]", "Procedure execution error:", a), "failure"));
|
|
17610
17702
|
if (t === "click") {
|
|
17611
|
-
|
|
17703
|
+
he.recordClickOutcome(e, n);
|
|
17612
17704
|
const a = r.target;
|
|
17613
|
-
a instanceof HTMLElement && a !== e &&
|
|
17705
|
+
a instanceof HTMLElement && a !== e && he.recordClickOutcome(a, n);
|
|
17614
17706
|
}
|
|
17615
17707
|
};
|
|
17616
17708
|
if (t === "click" && e.hasAttribute(`${c.prefix}click-defer`)) {
|
|
@@ -17731,13 +17823,13 @@ const Fe = class Fe {
|
|
|
17731
17823
|
return null;
|
|
17732
17824
|
}
|
|
17733
17825
|
};
|
|
17734
|
-
|
|
17826
|
+
Me.HISTORY_STATE_KEY = "__haoriHistoryState__", Me.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
17735
17827
|
"click",
|
|
17736
17828
|
"change",
|
|
17737
17829
|
"input",
|
|
17738
17830
|
"load"
|
|
17739
17831
|
]);
|
|
17740
|
-
let nt =
|
|
17832
|
+
let nt = Me;
|
|
17741
17833
|
const q = class q {
|
|
17742
17834
|
/**
|
|
17743
17835
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -17837,7 +17929,7 @@ const q = class q {
|
|
|
17837
17929
|
static runProcedure(e, t) {
|
|
17838
17930
|
t.pending = !1, t.running = !0;
|
|
17839
17931
|
let r = !1;
|
|
17840
|
-
new
|
|
17932
|
+
new he(t.fragment, "intersect").runWithResult().then((i) => {
|
|
17841
17933
|
r = i;
|
|
17842
17934
|
}).catch((i) => {
|
|
17843
17935
|
m.error("[Haori]", "Intersect procedure execution error:", i);
|
|
@@ -17907,7 +17999,7 @@ const q = class q {
|
|
|
17907
17999
|
const r = e.getAttribute(t);
|
|
17908
18000
|
if (typeof r != "string" || r.trim() === "")
|
|
17909
18001
|
return null;
|
|
17910
|
-
const i =
|
|
18002
|
+
const i = z.query(r, t, document);
|
|
17911
18003
|
return q.isHtmlElement(i) ? i : (m.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
17912
18004
|
}
|
|
17913
18005
|
static resolveRootMargin(e) {
|
|
@@ -17935,8 +18027,8 @@ q.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
17935
18027
|
"disabled",
|
|
17936
18028
|
"once"
|
|
17937
18029
|
]), q.registrations = /* @__PURE__ */ new Map();
|
|
17938
|
-
let
|
|
17939
|
-
const
|
|
18030
|
+
let Ce = q;
|
|
18031
|
+
const S = class S {
|
|
17940
18032
|
/**
|
|
17941
18033
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
17942
18034
|
*
|
|
@@ -17944,8 +18036,8 @@ const w = class w {
|
|
|
17944
18036
|
* @returns 戻り値はありません。
|
|
17945
18037
|
*/
|
|
17946
18038
|
static syncTree(e) {
|
|
17947
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
17948
|
-
|
|
18039
|
+
(e instanceof Element || e instanceof DocumentFragment) && (S.isHtmlElement(e) && S.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
18040
|
+
S.syncElement(t);
|
|
17949
18041
|
}));
|
|
17950
18042
|
}
|
|
17951
18043
|
/**
|
|
@@ -17958,23 +18050,23 @@ const w = class w {
|
|
|
17958
18050
|
* @returns 戻り値はありません。
|
|
17959
18051
|
*/
|
|
17960
18052
|
static syncElement(e) {
|
|
17961
|
-
const t =
|
|
17962
|
-
if (!t && !
|
|
18053
|
+
const t = S.registrations.get(e);
|
|
18054
|
+
if (!t && !S.hasPollAttribute(e))
|
|
17963
18055
|
return;
|
|
17964
18056
|
const r = D.get(e);
|
|
17965
|
-
if (!(r instanceof R) || !
|
|
17966
|
-
t &&
|
|
18057
|
+
if (!(r instanceof R) || !S.shouldObserve(r)) {
|
|
18058
|
+
t && S.teardown(e, t);
|
|
17967
18059
|
return;
|
|
17968
18060
|
}
|
|
17969
|
-
const i =
|
|
18061
|
+
const i = S.buildConfigKey(r);
|
|
17970
18062
|
if (t) {
|
|
17971
18063
|
if (t.configKey === i) {
|
|
17972
18064
|
t.fragment = r;
|
|
17973
18065
|
return;
|
|
17974
18066
|
}
|
|
17975
|
-
|
|
18067
|
+
S.teardown(e, t);
|
|
17976
18068
|
}
|
|
17977
|
-
|
|
18069
|
+
S.startPolling(e, r, i);
|
|
17978
18070
|
}
|
|
17979
18071
|
/**
|
|
17980
18072
|
* 指定ノードとその子孫の監視を解除します。
|
|
@@ -17986,13 +18078,13 @@ const w = class w {
|
|
|
17986
18078
|
* @returns 戻り値はありません。
|
|
17987
18079
|
*/
|
|
17988
18080
|
static cleanupTree(e) {
|
|
17989
|
-
if (
|
|
17990
|
-
const t =
|
|
17991
|
-
t &&
|
|
18081
|
+
if (S.isHtmlElement(e)) {
|
|
18082
|
+
const t = S.registrations.get(e);
|
|
18083
|
+
t && S.teardown(e, t);
|
|
17992
18084
|
}
|
|
17993
18085
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
17994
|
-
const r =
|
|
17995
|
-
r &&
|
|
18086
|
+
const r = S.registrations.get(t);
|
|
18087
|
+
r && S.teardown(t, r);
|
|
17996
18088
|
});
|
|
17997
18089
|
}
|
|
17998
18090
|
/**
|
|
@@ -18001,12 +18093,12 @@ const w = class w {
|
|
|
18001
18093
|
* @returns 戻り値はありません。
|
|
18002
18094
|
*/
|
|
18003
18095
|
static disconnectAll() {
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
}),
|
|
18096
|
+
S.registrations.forEach((e) => {
|
|
18097
|
+
S.clearTimers(e);
|
|
18098
|
+
}), S.registrations.clear(), S.visibilityListener && typeof document < "u" && document.removeEventListener(
|
|
18007
18099
|
"visibilitychange",
|
|
18008
|
-
|
|
18009
|
-
),
|
|
18100
|
+
S.visibilityListener
|
|
18101
|
+
), S.visibilityListener = null;
|
|
18010
18102
|
}
|
|
18011
18103
|
/**
|
|
18012
18104
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -18048,7 +18140,7 @@ const w = class w {
|
|
|
18048
18140
|
*/
|
|
18049
18141
|
static shouldObserve(e) {
|
|
18050
18142
|
const t = `${c.prefix}poll-`;
|
|
18051
|
-
return e.getAttributeNames().some((r) => r.startsWith(t) ? !
|
|
18143
|
+
return e.getAttributeNames().some((r) => r.startsWith(t) ? !S.CONFIG_KEYS.has(r.slice(t.length)) : !1);
|
|
18052
18144
|
}
|
|
18053
18145
|
/**
|
|
18054
18146
|
* 設定の同一性を判定するキーを組み立てます。
|
|
@@ -18080,9 +18172,9 @@ const w = class w {
|
|
|
18080
18172
|
const i = {
|
|
18081
18173
|
fragment: t,
|
|
18082
18174
|
configKey: r,
|
|
18083
|
-
intervalMs:
|
|
18084
|
-
timeoutMs:
|
|
18085
|
-
errorLimit:
|
|
18175
|
+
intervalMs: S.resolveInterval(t),
|
|
18176
|
+
timeoutMs: S.resolveTimeout(t),
|
|
18177
|
+
errorLimit: S.resolveErrorLimit(t),
|
|
18086
18178
|
startedAt: performance.now(),
|
|
18087
18179
|
intervalTimerId: null,
|
|
18088
18180
|
timeoutTimerId: null,
|
|
@@ -18094,9 +18186,9 @@ const w = class w {
|
|
|
18094
18186
|
count: 0,
|
|
18095
18187
|
consecutiveErrors: 0
|
|
18096
18188
|
};
|
|
18097
|
-
|
|
18098
|
-
|
|
18099
|
-
}, i.timeoutMs)),
|
|
18189
|
+
S.registrations.set(e, i), S.ensureVisibilityListener(), i.timeoutMs !== null && (i.timeoutTimerId = setTimeout(() => {
|
|
18190
|
+
S.handleTimeout(e);
|
|
18191
|
+
}, i.timeoutMs)), S.injectState(i), S.tick(e);
|
|
18100
18192
|
}
|
|
18101
18193
|
/**
|
|
18102
18194
|
* 1回分のポーリング処理を実行し、継続する場合は次回を予約します。
|
|
@@ -18105,26 +18197,26 @@ const w = class w {
|
|
|
18105
18197
|
* @returns 処理完了の Promise
|
|
18106
18198
|
*/
|
|
18107
18199
|
static async tick(e) {
|
|
18108
|
-
const t =
|
|
18200
|
+
const t = S.registrations.get(e);
|
|
18109
18201
|
if (!t || t.stopped || t.fetching)
|
|
18110
18202
|
return;
|
|
18111
18203
|
if (t.intervalTimerId = null, !e.isConnected) {
|
|
18112
|
-
await
|
|
18204
|
+
await S.stop(e, t, "detached");
|
|
18113
18205
|
return;
|
|
18114
18206
|
}
|
|
18115
|
-
const r =
|
|
18116
|
-
if (r !== t.paused && (t.paused = r, await
|
|
18117
|
-
|
|
18207
|
+
const r = S.isHidden(e) || S.isDisabled(t.fragment);
|
|
18208
|
+
if (r !== t.paused && (t.paused = r, await S.injectState(t)), r) {
|
|
18209
|
+
S.schedule(e, t);
|
|
18118
18210
|
return;
|
|
18119
18211
|
}
|
|
18120
|
-
if (
|
|
18121
|
-
await
|
|
18212
|
+
if (S.isUntilSatisfied(t.fragment)) {
|
|
18213
|
+
await S.stop(e, t, "until");
|
|
18122
18214
|
return;
|
|
18123
18215
|
}
|
|
18124
18216
|
t.fetching = !0, t.count += 1;
|
|
18125
18217
|
let i = !1;
|
|
18126
18218
|
try {
|
|
18127
|
-
i = await new
|
|
18219
|
+
i = await new he(
|
|
18128
18220
|
t.fragment,
|
|
18129
18221
|
"poll"
|
|
18130
18222
|
).runWithResult();
|
|
@@ -18133,18 +18225,18 @@ const w = class w {
|
|
|
18133
18225
|
} finally {
|
|
18134
18226
|
t.fetching = !1;
|
|
18135
18227
|
}
|
|
18136
|
-
if (!(
|
|
18228
|
+
if (!(S.registrations.get(e) !== t || t.stopped)) {
|
|
18137
18229
|
if (i)
|
|
18138
18230
|
t.consecutiveErrors = 0;
|
|
18139
18231
|
else if (t.consecutiveErrors += 1, t.errorLimit !== null && t.consecutiveErrors >= t.errorLimit) {
|
|
18140
|
-
await
|
|
18232
|
+
await S.stop(e, t, "error");
|
|
18141
18233
|
return;
|
|
18142
18234
|
}
|
|
18143
|
-
if (i &&
|
|
18144
|
-
await
|
|
18235
|
+
if (i && S.isUntilSatisfied(t.fragment)) {
|
|
18236
|
+
await S.stop(e, t, "until");
|
|
18145
18237
|
return;
|
|
18146
18238
|
}
|
|
18147
|
-
|
|
18239
|
+
S.schedule(e, t);
|
|
18148
18240
|
}
|
|
18149
18241
|
}
|
|
18150
18242
|
/**
|
|
@@ -18159,7 +18251,7 @@ const w = class w {
|
|
|
18159
18251
|
*/
|
|
18160
18252
|
static schedule(e, t) {
|
|
18161
18253
|
t.stopped || t.intervalTimerId !== null || (t.intervalTimerId = setTimeout(() => {
|
|
18162
|
-
|
|
18254
|
+
S.tick(e);
|
|
18163
18255
|
}, t.intervalMs));
|
|
18164
18256
|
}
|
|
18165
18257
|
/**
|
|
@@ -18169,12 +18261,12 @@ const w = class w {
|
|
|
18169
18261
|
* @returns 処理完了の Promise
|
|
18170
18262
|
*/
|
|
18171
18263
|
static async handleTimeout(e) {
|
|
18172
|
-
const t =
|
|
18173
|
-
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected &&
|
|
18264
|
+
const t = S.registrations.get(e);
|
|
18265
|
+
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected && O.pollTimeout(
|
|
18174
18266
|
e,
|
|
18175
18267
|
t.count,
|
|
18176
|
-
|
|
18177
|
-
), await
|
|
18268
|
+
S.elapsed(t)
|
|
18269
|
+
), await S.stop(e, t, "timeout"));
|
|
18178
18270
|
}
|
|
18179
18271
|
/**
|
|
18180
18272
|
* ポーリングを恒久停止します。
|
|
@@ -18186,15 +18278,15 @@ const w = class w {
|
|
|
18186
18278
|
*/
|
|
18187
18279
|
static async stop(e, t, r) {
|
|
18188
18280
|
if (!t.stopped) {
|
|
18189
|
-
if (t.stopped = !0, t.stopReason = r, t.paused = !1,
|
|
18190
|
-
|
|
18281
|
+
if (t.stopped = !0, t.stopReason = r, t.paused = !1, S.clearTimers(t), r === "detached") {
|
|
18282
|
+
S.registrations.delete(e);
|
|
18191
18283
|
return;
|
|
18192
18284
|
}
|
|
18193
|
-
await
|
|
18285
|
+
await S.injectState(t), e.isConnected && O.pollStop(
|
|
18194
18286
|
e,
|
|
18195
18287
|
r,
|
|
18196
18288
|
t.count,
|
|
18197
|
-
|
|
18289
|
+
S.elapsed(t)
|
|
18198
18290
|
);
|
|
18199
18291
|
}
|
|
18200
18292
|
}
|
|
@@ -18206,7 +18298,7 @@ const w = class w {
|
|
|
18206
18298
|
* @returns 戻り値はありません。
|
|
18207
18299
|
*/
|
|
18208
18300
|
static teardown(e, t) {
|
|
18209
|
-
|
|
18301
|
+
S.clearTimers(t), S.registrations.delete(e);
|
|
18210
18302
|
}
|
|
18211
18303
|
/**
|
|
18212
18304
|
* 登録情報が持つタイマーをすべて破棄します。
|
|
@@ -18235,16 +18327,16 @@ const w = class w {
|
|
|
18235
18327
|
* @returns 戻り値はありません。
|
|
18236
18328
|
*/
|
|
18237
18329
|
static ensureVisibilityListener() {
|
|
18238
|
-
if (
|
|
18330
|
+
if (S.visibilityListener || typeof document > "u")
|
|
18239
18331
|
return;
|
|
18240
18332
|
const e = () => {
|
|
18241
|
-
document.visibilityState === "visible" && Array.from(
|
|
18333
|
+
document.visibilityState === "visible" && Array.from(S.registrations.entries()).forEach(
|
|
18242
18334
|
([t, r]) => {
|
|
18243
|
-
r.stopped || r.fetching || (r.intervalTimerId !== null && (clearTimeout(r.intervalTimerId), r.intervalTimerId = null),
|
|
18335
|
+
r.stopped || r.fetching || (r.intervalTimerId !== null && (clearTimeout(r.intervalTimerId), r.intervalTimerId = null), S.tick(t));
|
|
18244
18336
|
}
|
|
18245
18337
|
);
|
|
18246
18338
|
};
|
|
18247
|
-
|
|
18339
|
+
S.visibilityListener = e, document.addEventListener("visibilitychange", e);
|
|
18248
18340
|
}
|
|
18249
18341
|
/**
|
|
18250
18342
|
* `_poll` 状態を注入先のバインディングデータへ反映します。
|
|
@@ -18258,7 +18350,7 @@ const w = class w {
|
|
|
18258
18350
|
* @returns 注入完了の Promise
|
|
18259
18351
|
*/
|
|
18260
18352
|
static injectState(e) {
|
|
18261
|
-
const t =
|
|
18353
|
+
const t = S.resolveStateFragments(e);
|
|
18262
18354
|
if (t.length === 0)
|
|
18263
18355
|
return Promise.resolve();
|
|
18264
18356
|
const r = {
|
|
@@ -18268,7 +18360,7 @@ const w = class w {
|
|
|
18268
18360
|
timedOut: e.timedOut,
|
|
18269
18361
|
stopReason: e.stopReason,
|
|
18270
18362
|
count: e.count,
|
|
18271
|
-
elapsedMs:
|
|
18363
|
+
elapsedMs: S.elapsed(e)
|
|
18272
18364
|
};
|
|
18273
18365
|
return Promise.all(
|
|
18274
18366
|
t.map((i) => {
|
|
@@ -18276,7 +18368,7 @@ const w = class w {
|
|
|
18276
18368
|
...i.getRawBindingData() ?? {},
|
|
18277
18369
|
_poll: r
|
|
18278
18370
|
};
|
|
18279
|
-
return
|
|
18371
|
+
return M.setBindingData(s, n, {
|
|
18280
18372
|
reflectToAttribute: !1,
|
|
18281
18373
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
18282
18374
|
// 解除しない)。
|
|
@@ -18303,7 +18395,7 @@ const w = class w {
|
|
|
18303
18395
|
const i = r.getAttribute(t);
|
|
18304
18396
|
if (typeof i != "string" || i.trim() === "")
|
|
18305
18397
|
return r.getTarget().isConnected ? [r] : [];
|
|
18306
|
-
const s =
|
|
18398
|
+
const s = z.queryAll(
|
|
18307
18399
|
i,
|
|
18308
18400
|
t,
|
|
18309
18401
|
document
|
|
@@ -18330,15 +18422,15 @@ const w = class w {
|
|
|
18330
18422
|
static resolveInterval(e) {
|
|
18331
18423
|
const t = `${c.prefix}poll-interval`;
|
|
18332
18424
|
if (!e.hasAttribute(t))
|
|
18333
|
-
return
|
|
18334
|
-
const r =
|
|
18425
|
+
return S.DEFAULT_INTERVAL_MS;
|
|
18426
|
+
const r = S.toNumber(e.getAttribute(t));
|
|
18335
18427
|
return r === null ? (m.warn(
|
|
18336
18428
|
"[Haori]",
|
|
18337
|
-
`${t} は数値で指定してください。既定値 ${
|
|
18338
|
-
),
|
|
18429
|
+
`${t} は数値で指定してください。既定値 ${S.DEFAULT_INTERVAL_MS}ms を使用します。`
|
|
18430
|
+
), S.DEFAULT_INTERVAL_MS) : r < S.MIN_INTERVAL_MS ? (m.warn(
|
|
18339
18431
|
"[Haori]",
|
|
18340
|
-
`${t} の下限は ${
|
|
18341
|
-
),
|
|
18432
|
+
`${t} の下限は ${S.MIN_INTERVAL_MS}ms です。${r}ms は下限へ切り上げます。`
|
|
18433
|
+
), S.MIN_INTERVAL_MS) : r;
|
|
18342
18434
|
}
|
|
18343
18435
|
/**
|
|
18344
18436
|
* `data-poll-timeout` を解決します。
|
|
@@ -18350,7 +18442,7 @@ const w = class w {
|
|
|
18350
18442
|
const t = `${c.prefix}poll-timeout`;
|
|
18351
18443
|
if (!e.hasAttribute(t))
|
|
18352
18444
|
return null;
|
|
18353
|
-
const r =
|
|
18445
|
+
const r = S.toNumber(e.getAttribute(t));
|
|
18354
18446
|
return r === null || r <= 0 ? (m.warn(
|
|
18355
18447
|
"[Haori]",
|
|
18356
18448
|
`${t} は正の数値で指定してください。無制限として扱います。`
|
|
@@ -18366,7 +18458,7 @@ const w = class w {
|
|
|
18366
18458
|
const t = `${c.prefix}poll-error-limit`;
|
|
18367
18459
|
if (!e.hasAttribute(t))
|
|
18368
18460
|
return null;
|
|
18369
|
-
const r =
|
|
18461
|
+
const r = S.toNumber(e.getAttribute(t));
|
|
18370
18462
|
return r === null || r < 1 ? (m.warn(
|
|
18371
18463
|
"[Haori]",
|
|
18372
18464
|
`${t} は 1 以上の数値で指定してください。無制限として扱います。`
|
|
@@ -18408,7 +18500,7 @@ const w = class w {
|
|
|
18408
18500
|
*/
|
|
18409
18501
|
static isDisabled(e) {
|
|
18410
18502
|
const t = `${c.prefix}poll-disabled`;
|
|
18411
|
-
return e.hasAttribute(t) ?
|
|
18503
|
+
return e.hasAttribute(t) ? S.isTruthy(e.getAttribute(t)) : !1;
|
|
18412
18504
|
}
|
|
18413
18505
|
/**
|
|
18414
18506
|
* `data-poll-until` の条件が成立したかどうかを判定します。
|
|
@@ -18431,7 +18523,7 @@ const w = class w {
|
|
|
18431
18523
|
`${t} に未解決の参照が含まれています(停止条件は成立扱いにしません):`,
|
|
18432
18524
|
e.getRawAttribute(t),
|
|
18433
18525
|
e.getTarget()
|
|
18434
|
-
), !1) :
|
|
18526
|
+
), !1) : S.isTruthy(r.value) : !1;
|
|
18435
18527
|
}
|
|
18436
18528
|
/**
|
|
18437
18529
|
* 属性の評価値を真偽値として解釈します。
|
|
@@ -18454,20 +18546,20 @@ const w = class w {
|
|
|
18454
18546
|
return !!e;
|
|
18455
18547
|
}
|
|
18456
18548
|
};
|
|
18457
|
-
|
|
18549
|
+
S.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
18458
18550
|
"interval",
|
|
18459
18551
|
"timeout",
|
|
18460
18552
|
"until",
|
|
18461
18553
|
"error-limit",
|
|
18462
18554
|
"disabled",
|
|
18463
18555
|
"state"
|
|
18464
|
-
]),
|
|
18465
|
-
let
|
|
18466
|
-
const Pr = "0.
|
|
18556
|
+
]), S.DEFAULT_INTERVAL_MS = 5e3, S.MIN_INTERVAL_MS = 100, S.registrations = /* @__PURE__ */ new Map(), S.visibilityListener = null;
|
|
18557
|
+
let $e = S;
|
|
18558
|
+
const Pr = "0.66.0";
|
|
18467
18559
|
function Lr(f) {
|
|
18468
18560
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => f()) : Promise.resolve().then(f);
|
|
18469
18561
|
}
|
|
18470
|
-
const
|
|
18562
|
+
const L = class L {
|
|
18471
18563
|
/**
|
|
18472
18564
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
18473
18565
|
*
|
|
@@ -18486,8 +18578,8 @@ const B = class B {
|
|
|
18486
18578
|
* @param root 走査の起点ノード
|
|
18487
18579
|
*/
|
|
18488
18580
|
static syncTree(e) {
|
|
18489
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
18490
|
-
|
|
18581
|
+
(e instanceof Element || e instanceof DocumentFragment) && (L.isHtmlElement(e) && L.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
18582
|
+
L.syncElement(t);
|
|
18491
18583
|
}));
|
|
18492
18584
|
}
|
|
18493
18585
|
/**
|
|
@@ -18497,42 +18589,42 @@ const B = class B {
|
|
|
18497
18589
|
* @param element 対象要素
|
|
18498
18590
|
*/
|
|
18499
18591
|
static syncElement(e) {
|
|
18500
|
-
const t =
|
|
18501
|
-
if (!(r instanceof R) || !
|
|
18502
|
-
t && (t.observer.disconnect(),
|
|
18592
|
+
const t = L.registrations.get(e), r = D.get(e);
|
|
18593
|
+
if (!(r instanceof R) || !L.shouldObserve(r)) {
|
|
18594
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
18503
18595
|
return;
|
|
18504
18596
|
}
|
|
18505
18597
|
if (typeof IntersectionObserver > "u")
|
|
18506
18598
|
return;
|
|
18507
|
-
const i =
|
|
18599
|
+
const i = L.resolveVarName(r);
|
|
18508
18600
|
if (i === "") {
|
|
18509
|
-
t && (t.observer.disconnect(),
|
|
18601
|
+
t && (t.observer.disconnect(), L.registrations.delete(e)), m.warn(
|
|
18510
18602
|
"[Haori]",
|
|
18511
18603
|
'data-each-visible requires a variable name (e.g. data-each-visible="visibleRange").'
|
|
18512
18604
|
);
|
|
18513
18605
|
return;
|
|
18514
18606
|
}
|
|
18515
|
-
const s =
|
|
18607
|
+
const s = L.resolveRoot(r), n = L.resolveRootMargin(r);
|
|
18516
18608
|
if (t && t.observer.root === s && t.observer.rootMargin === n && t.varName === i) {
|
|
18517
|
-
t.fragment = r,
|
|
18609
|
+
t.fragment = r, L.refreshRows(t);
|
|
18518
18610
|
return;
|
|
18519
18611
|
}
|
|
18520
|
-
t && (t.observer.disconnect(),
|
|
18612
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
18521
18613
|
const a = new IntersectionObserver(
|
|
18522
18614
|
(l) => {
|
|
18523
|
-
const u =
|
|
18615
|
+
const u = L.registrations.get(e);
|
|
18524
18616
|
if (!u)
|
|
18525
18617
|
return;
|
|
18526
18618
|
let d = !1;
|
|
18527
18619
|
l.forEach((y) => {
|
|
18528
18620
|
const b = y.target;
|
|
18529
18621
|
u.observedRows.has(b) && (y.isIntersecting ? u.visibleRows.has(b) || (u.visibleRows.add(b), d = !0) : u.visibleRows.delete(b) && (d = !0));
|
|
18530
|
-
}), d &&
|
|
18622
|
+
}), d && L.scheduleCompute(u);
|
|
18531
18623
|
},
|
|
18532
18624
|
{
|
|
18533
18625
|
root: s,
|
|
18534
18626
|
rootMargin: n,
|
|
18535
|
-
threshold:
|
|
18627
|
+
threshold: L.THRESHOLD
|
|
18536
18628
|
}
|
|
18537
18629
|
), o = {
|
|
18538
18630
|
fragment: r,
|
|
@@ -18545,7 +18637,7 @@ const B = class B {
|
|
|
18545
18637
|
scheduled: !1,
|
|
18546
18638
|
lastSnapshot: null
|
|
18547
18639
|
};
|
|
18548
|
-
|
|
18640
|
+
L.registrations.set(e, o), L.refreshRows(o);
|
|
18549
18641
|
}
|
|
18550
18642
|
/**
|
|
18551
18643
|
* 指定ノード配下の監視登録を解放します。
|
|
@@ -18553,22 +18645,22 @@ const B = class B {
|
|
|
18553
18645
|
* @param root 走査の起点ノード
|
|
18554
18646
|
*/
|
|
18555
18647
|
static cleanupTree(e) {
|
|
18556
|
-
if (
|
|
18557
|
-
const t =
|
|
18558
|
-
t && (t.observer.disconnect(),
|
|
18648
|
+
if (L.isHtmlElement(e)) {
|
|
18649
|
+
const t = L.registrations.get(e);
|
|
18650
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
18559
18651
|
}
|
|
18560
18652
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
18561
|
-
const r =
|
|
18562
|
-
r && (r.observer.disconnect(),
|
|
18653
|
+
const r = L.registrations.get(t);
|
|
18654
|
+
r && (r.observer.disconnect(), L.registrations.delete(t));
|
|
18563
18655
|
});
|
|
18564
18656
|
}
|
|
18565
18657
|
/**
|
|
18566
18658
|
* すべての監視登録を解放します。
|
|
18567
18659
|
*/
|
|
18568
18660
|
static disconnectAll() {
|
|
18569
|
-
|
|
18661
|
+
L.registrations.forEach((e) => {
|
|
18570
18662
|
e.observer.disconnect();
|
|
18571
|
-
}),
|
|
18663
|
+
}), L.registrations.clear();
|
|
18572
18664
|
}
|
|
18573
18665
|
/**
|
|
18574
18666
|
* 監視対象(`data-each` かつ `data-each-visible`)かどうかを判定します。
|
|
@@ -18602,8 +18694,8 @@ const B = class B {
|
|
|
18602
18694
|
const r = e.getAttribute(t);
|
|
18603
18695
|
if (typeof r != "string" || r.trim() === "")
|
|
18604
18696
|
return null;
|
|
18605
|
-
const i =
|
|
18606
|
-
return
|
|
18697
|
+
const i = z.query(r, t, document);
|
|
18698
|
+
return L.isHtmlElement(i) ? i : (m.error("[Haori]", `Visible range root element not found: ${r}`), null);
|
|
18607
18699
|
}
|
|
18608
18700
|
/**
|
|
18609
18701
|
* rootMargin を解決します。
|
|
@@ -18613,7 +18705,7 @@ const B = class B {
|
|
|
18613
18705
|
*/
|
|
18614
18706
|
static resolveRootMargin(e) {
|
|
18615
18707
|
const t = `${c.prefix}each-visible-margin`, r = e.getAttribute(t);
|
|
18616
|
-
return r === null || r === !1 || r === "" ?
|
|
18708
|
+
return r === null || r === !1 || r === "" ? L.DEFAULT_ROOT_MARGIN : String(r);
|
|
18617
18709
|
}
|
|
18618
18710
|
/**
|
|
18619
18711
|
* コンテナ直下の実際の行要素(`each-before`/`each-after` を除く)を描画順で返します。
|
|
@@ -18633,12 +18725,12 @@ const B = class B {
|
|
|
18633
18725
|
* @param registration 対象の登録
|
|
18634
18726
|
*/
|
|
18635
18727
|
static refreshRows(e) {
|
|
18636
|
-
const t =
|
|
18728
|
+
const t = L.realRowElements(e.fragment), r = new Set(t);
|
|
18637
18729
|
for (const i of [...e.observedRows])
|
|
18638
18730
|
r.has(i) || (e.observer.unobserve(i), e.observedRows.delete(i), e.visibleRows.delete(i));
|
|
18639
18731
|
for (const i of t)
|
|
18640
18732
|
e.observedRows.has(i) || (e.observer.observe(i), e.observedRows.add(i));
|
|
18641
|
-
|
|
18733
|
+
L.scheduleCompute(e);
|
|
18642
18734
|
}
|
|
18643
18735
|
/**
|
|
18644
18736
|
* 次フレームでの集計・公開を予約します(多発する交差イベントを 1 回にまとめる)。
|
|
@@ -18649,7 +18741,7 @@ const B = class B {
|
|
|
18649
18741
|
e.scheduled || (e.scheduled = !0, Lr(() => {
|
|
18650
18742
|
e.scheduled = !1;
|
|
18651
18743
|
const t = e.fragment.getTarget();
|
|
18652
|
-
|
|
18744
|
+
L.registrations.get(t) === e && L.computeAndPublish(e);
|
|
18653
18745
|
}));
|
|
18654
18746
|
}
|
|
18655
18747
|
/**
|
|
@@ -18658,7 +18750,7 @@ const B = class B {
|
|
|
18658
18750
|
* @param registration 対象の登録
|
|
18659
18751
|
*/
|
|
18660
18752
|
static computeAndPublish(e) {
|
|
18661
|
-
const t =
|
|
18753
|
+
const t = L.realRowElements(e.fragment), r = /* @__PURE__ */ new Map();
|
|
18662
18754
|
t.forEach((a, o) => r.set(a, o));
|
|
18663
18755
|
const i = [];
|
|
18664
18756
|
for (const a of e.visibleRows) {
|
|
@@ -18691,7 +18783,7 @@ const B = class B {
|
|
|
18691
18783
|
};
|
|
18692
18784
|
}
|
|
18693
18785
|
const n = JSON.stringify(s);
|
|
18694
|
-
n !== e.lastSnapshot && (e.lastSnapshot = n,
|
|
18786
|
+
n !== e.lastSnapshot && (e.lastSnapshot = n, L.publish(e, s));
|
|
18695
18787
|
}
|
|
18696
18788
|
/**
|
|
18697
18789
|
* 可視範囲スナップショットを最近接の上位 `data-bind` スコープへ公開します。
|
|
@@ -18700,7 +18792,7 @@ const B = class B {
|
|
|
18700
18792
|
* @param snapshot 公開するスナップショット
|
|
18701
18793
|
*/
|
|
18702
18794
|
static publish(e, t) {
|
|
18703
|
-
const r =
|
|
18795
|
+
const r = L.resolveBindOwner(e.fragment);
|
|
18704
18796
|
if (!r) {
|
|
18705
18797
|
m.warn(
|
|
18706
18798
|
"[Haori]",
|
|
@@ -18713,7 +18805,7 @@ const B = class B {
|
|
|
18713
18805
|
};
|
|
18714
18806
|
s[e.varName] = { ...t };
|
|
18715
18807
|
const n = e.fragment.getTarget(), a = i === n ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([e.fragment]);
|
|
18716
|
-
|
|
18808
|
+
M.setBindingData(i, s, {
|
|
18717
18809
|
skipFragments: a,
|
|
18718
18810
|
reflectToAttribute: !1,
|
|
18719
18811
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
@@ -18742,8 +18834,8 @@ const B = class B {
|
|
|
18742
18834
|
return e.hasAttribute(t) ? e : null;
|
|
18743
18835
|
}
|
|
18744
18836
|
};
|
|
18745
|
-
|
|
18746
|
-
let
|
|
18837
|
+
L.THRESHOLD = 0, L.DEFAULT_ROOT_MARGIN = "0px", L.registrations = /* @__PURE__ */ new Map();
|
|
18838
|
+
let Se = L;
|
|
18747
18839
|
const H = class H {
|
|
18748
18840
|
/**
|
|
18749
18841
|
* 既存の MutationObserver をすべて停止します。
|
|
@@ -18767,8 +18859,8 @@ const H = class H {
|
|
|
18767
18859
|
H._dispatcher = e, e.startDeferred(), H._initialIntakes = [];
|
|
18768
18860
|
try {
|
|
18769
18861
|
const t = await Promise.allSettled([
|
|
18770
|
-
|
|
18771
|
-
|
|
18862
|
+
M.scan(document.head),
|
|
18863
|
+
M.scan(document.body)
|
|
18772
18864
|
]), [r, i] = t;
|
|
18773
18865
|
r.status !== "fulfilled" && m.error(
|
|
18774
18866
|
"[Haori]",
|
|
@@ -18778,11 +18870,11 @@ const H = class H {
|
|
|
18778
18870
|
"[Haori]",
|
|
18779
18871
|
"Failed to build body fragment:",
|
|
18780
18872
|
i.reason
|
|
18781
|
-
), await H.waitInitialIntakes(), await
|
|
18873
|
+
), await H.waitInitialIntakes(), await J.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), Ce.syncTree(document.body), $e.syncTree(document.body), Se.syncTree(document.body);
|
|
18782
18874
|
} finally {
|
|
18783
18875
|
H._initialIntakes = null, e.release();
|
|
18784
18876
|
}
|
|
18785
|
-
|
|
18877
|
+
O.ready(Pr);
|
|
18786
18878
|
}
|
|
18787
18879
|
/**
|
|
18788
18880
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -18996,37 +19088,37 @@ const H = class H {
|
|
|
18996
19088
|
switch (r.type) {
|
|
18997
19089
|
case "attributes": {
|
|
18998
19090
|
const i = r.target;
|
|
18999
|
-
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(
|
|
19091
|
+
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(ve) && (r.attributeName === "disabled" || r.attributeName === ve))
|
|
19000
19092
|
break;
|
|
19001
19093
|
if (r.attributeName && (r.attributeName === `${c.prefix}if-false` || r.attributeName === "style" && i.hasAttribute(`${c.prefix}if-false`))) {
|
|
19002
19094
|
r.attributeName === "style" && R.reassertHiddenDisplay(i);
|
|
19003
19095
|
break;
|
|
19004
19096
|
}
|
|
19005
|
-
if (r.attributeName &&
|
|
19097
|
+
if (r.attributeName && M.isAliasedAttributeReflection(i, r.attributeName))
|
|
19006
19098
|
break;
|
|
19007
|
-
const s =
|
|
19099
|
+
const s = M.setAttribute(
|
|
19008
19100
|
i,
|
|
19009
19101
|
r.attributeName,
|
|
19010
19102
|
i.getAttribute(r.attributeName),
|
|
19011
19103
|
!0,
|
|
19012
19104
|
t
|
|
19013
19105
|
);
|
|
19014
|
-
H._initialIntakes?.push(s),
|
|
19106
|
+
H._initialIntakes?.push(s), Ce.syncElement(i), $e.syncElement(i), Se.syncElement(i);
|
|
19015
19107
|
break;
|
|
19016
19108
|
}
|
|
19017
19109
|
case "childList": {
|
|
19018
19110
|
Array.from(r.removedNodes).forEach((i) => {
|
|
19019
|
-
H.isStaleExternalRemoval(r, i) || (
|
|
19111
|
+
H.isStaleExternalRemoval(r, i) || (Ce.cleanupTree(i), $e.cleanupTree(i), Se.cleanupTree(i), M.removeNode(i));
|
|
19020
19112
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
19021
19113
|
if (!(i.parentElement instanceof Element))
|
|
19022
19114
|
return;
|
|
19023
|
-
const s =
|
|
19024
|
-
H._initialIntakes?.push(s),
|
|
19025
|
-
}), r.target instanceof Element &&
|
|
19115
|
+
const s = M.addNode(i.parentElement, i);
|
|
19116
|
+
H._initialIntakes?.push(s), Ce.syncTree(i), $e.syncTree(i), Se.syncTree(i);
|
|
19117
|
+
}), r.target instanceof Element && Se.syncElement(r.target);
|
|
19026
19118
|
break;
|
|
19027
19119
|
}
|
|
19028
19120
|
case "characterData": {
|
|
19029
|
-
r.target instanceof Text || r.target instanceof Comment ?
|
|
19121
|
+
r.target instanceof Text || r.target instanceof Comment ? M.changeText(r.target, r.target.textContent) : m.warn(
|
|
19030
19122
|
"[Haori]",
|
|
19031
19123
|
"Unsupported character data type:",
|
|
19032
19124
|
r.target
|
|
@@ -19043,20 +19135,20 @@ const H = class H {
|
|
|
19043
19135
|
}
|
|
19044
19136
|
};
|
|
19045
19137
|
H._initialized = !1, H._mutationObservers = [], H._dispatcher = null, H._initialIntakes = null;
|
|
19046
|
-
let
|
|
19047
|
-
|
|
19048
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
19049
|
-
const Or = () =>
|
|
19138
|
+
let He = H;
|
|
19139
|
+
le.setMutationCapture((f) => He.captureMutations(f));
|
|
19140
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", He.init) : He.init();
|
|
19141
|
+
const Or = () => xe.waitForRenders(), Br = xe.enhancers, Ur = xe.handlers;
|
|
19050
19142
|
export {
|
|
19051
|
-
|
|
19052
|
-
|
|
19143
|
+
M as Core,
|
|
19144
|
+
le as Enhance,
|
|
19053
19145
|
c as Env,
|
|
19054
19146
|
x as Form,
|
|
19055
19147
|
D as Fragment,
|
|
19056
|
-
|
|
19148
|
+
xe as Haori,
|
|
19057
19149
|
m as Log,
|
|
19058
|
-
|
|
19059
|
-
|
|
19150
|
+
J as Queue,
|
|
19151
|
+
xe as default,
|
|
19060
19152
|
Br as enhancers,
|
|
19061
19153
|
Ur as handlers,
|
|
19062
19154
|
Pr as version,
|