haori 0.55.0 → 0.57.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 +2 -2
- package/README.md +2 -2
- package/dist/haori.cjs.js +19 -18
- package/dist/haori.es.js +1030 -861
- package/dist/haori.iife.js +19 -18
- 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 me = class me {
|
|
2
2
|
/**
|
|
3
3
|
* 開発モードの状態を取得します。
|
|
4
4
|
*
|
|
5
5
|
* @returns 開発モードならtrue、そうでなければfalse
|
|
6
6
|
*/
|
|
7
7
|
static isEnabled() {
|
|
8
|
-
return
|
|
8
|
+
return me.devMode;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* 開発モードを有効化します。
|
|
12
12
|
*/
|
|
13
13
|
static enable() {
|
|
14
|
-
|
|
14
|
+
me.devMode = !0;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* 開発モードを無効化します。
|
|
18
18
|
*/
|
|
19
19
|
static disable() {
|
|
20
|
-
|
|
20
|
+
me.devMode = !1;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* 開発モードを切り替えます。
|
|
@@ -25,17 +25,17 @@ const Ee = class Ee {
|
|
|
25
25
|
* @param enabled trueで有効化、falseで無効化
|
|
26
26
|
*/
|
|
27
27
|
static set(e) {
|
|
28
|
-
|
|
28
|
+
me.devMode = e;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
let
|
|
31
|
+
me.devMode = !1;
|
|
32
|
+
let q = me;
|
|
33
33
|
const Be = "embedded";
|
|
34
|
-
function
|
|
34
|
+
function Qe(b) {
|
|
35
35
|
return b === "embedded" || b === "demo";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return b === null ? null :
|
|
37
|
+
function bt(b) {
|
|
38
|
+
return b === null ? null : Qe(b) ? b : Be;
|
|
39
39
|
}
|
|
40
40
|
const ee = class ee {
|
|
41
41
|
/**
|
|
@@ -73,7 +73,7 @@ const ee = class ee {
|
|
|
73
73
|
* @return 戻り値はありません。
|
|
74
74
|
*/
|
|
75
75
|
static setRuntime(e) {
|
|
76
|
-
ee._runtime =
|
|
76
|
+
ee._runtime = Qe(e) ? e : Be;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* 実行環境からプレフィックスと開発モードかどうかを自動検出します。
|
|
@@ -87,7 +87,7 @@ const ee = class ee {
|
|
|
87
87
|
if (e instanceof HTMLScriptElement) {
|
|
88
88
|
const r = e.getAttribute("data-prefix") || ee._prefix;
|
|
89
89
|
ee._prefix = r.endsWith("-") ? r : r + "-";
|
|
90
|
-
const i =
|
|
90
|
+
const i = bt(
|
|
91
91
|
e.getAttribute("data-runtime")
|
|
92
92
|
);
|
|
93
93
|
i !== null && (ee._runtime = i), ee._strictBind = e.hasAttribute(
|
|
@@ -96,15 +96,15 @@ const ee = class ee {
|
|
|
96
96
|
}
|
|
97
97
|
if (e instanceof HTMLScriptElement && e.hasAttribute(`${ee._prefix}dev`)) {
|
|
98
98
|
const r = (e.getAttribute(`${ee._prefix}dev`) ?? "").trim().toLowerCase();
|
|
99
|
-
|
|
99
|
+
q.set(r !== "false" && r !== "off" && r !== "0");
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
const t = window.location.hostname;
|
|
103
103
|
if (t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "::1" || t.endsWith(".local")) {
|
|
104
|
-
|
|
104
|
+
q.set(!0);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
q.set(!1);
|
|
108
108
|
} catch {
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -128,7 +128,7 @@ class m {
|
|
|
128
128
|
* @param args 追加の引数
|
|
129
129
|
*/
|
|
130
130
|
static info(e, ...t) {
|
|
131
|
-
|
|
131
|
+
q.isEnabled() && console.log && console.log(e, ...t);
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* 開発モードでのみコンソールに警告を出力します。
|
|
@@ -137,7 +137,7 @@ class m {
|
|
|
137
137
|
* @param args 追加の引数
|
|
138
138
|
*/
|
|
139
139
|
static warn(e, ...t) {
|
|
140
|
-
|
|
140
|
+
q.isEnabled() && console.warn && console.warn(e, ...t);
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* モードに関係なくコンソールにエラーを出力します。
|
|
@@ -149,7 +149,7 @@ class m {
|
|
|
149
149
|
console.error(e, ...t);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
const
|
|
152
|
+
const Et = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, Ke = "new:", M = class M {
|
|
153
153
|
/**
|
|
154
154
|
* 外部ライブラリ連携を登録します。
|
|
155
155
|
*
|
|
@@ -171,8 +171,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
171
171
|
m.error("[Haori]", `Enhancer "${r}" must have an init function.`);
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
M.enhancers.set(r, t), M.warnedUnknownNames.delete(r), typeof document < "u" && document.body && M.forEachTarget(document.body, (i) => {
|
|
175
|
+
M.visited.has(i) && M.applyElement(i);
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
@@ -183,7 +183,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
183
183
|
* @returns 戻り値はありません。
|
|
184
184
|
*/
|
|
185
185
|
static setMutationCapture(e) {
|
|
186
|
-
|
|
186
|
+
M.mutationCapture = e;
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* 登録済みの連携かどうかを返します。
|
|
@@ -192,7 +192,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
192
192
|
* @returns 登録済みなら true
|
|
193
193
|
*/
|
|
194
194
|
static has(e) {
|
|
195
|
-
return
|
|
195
|
+
return M.enhancers.has(e);
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* 対象要素とその子孫へ、まだ適用していない連携を適用します。
|
|
@@ -204,8 +204,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
204
204
|
* @returns 戻り値はありません。
|
|
205
205
|
*/
|
|
206
206
|
static applySubtree(e) {
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
M.forEachTarget(e, (t) => {
|
|
208
|
+
M.visited.add(t), M.applyElement(t);
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
@@ -215,7 +215,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
215
215
|
* @returns 1 つでも適用済みの連携があれば true
|
|
216
216
|
*/
|
|
217
217
|
static isApplied(e) {
|
|
218
|
-
return (
|
|
218
|
+
return (M.instances.get(e)?.size ?? 0) > 0;
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* 対象要素とその子孫の連携を再同期します。
|
|
@@ -230,8 +230,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
230
230
|
* @returns 戻り値はありません。
|
|
231
231
|
*/
|
|
232
232
|
static refreshSubtree(e, t = !0) {
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
M.forEachTarget(e, (r) => {
|
|
234
|
+
M.refreshElement(r, t);
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
@@ -243,8 +243,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
243
243
|
* @returns 戻り値はありません。
|
|
244
244
|
*/
|
|
245
245
|
static destroySubtree(e) {
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
M.forEachTarget(e, (t) => {
|
|
247
|
+
M.destroyElement(t);
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
/**
|
|
@@ -271,27 +271,27 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
271
271
|
static applyElement(e) {
|
|
272
272
|
if (e.closest(`[${l.prefix}if-false]`))
|
|
273
273
|
return;
|
|
274
|
-
const t =
|
|
275
|
-
|
|
274
|
+
const t = M.instances.get(e) ?? null;
|
|
275
|
+
M.names(e, `${l.prefix}enhance`).forEach((r) => {
|
|
276
276
|
if (t?.has(r))
|
|
277
277
|
return;
|
|
278
|
-
const i =
|
|
278
|
+
const i = M.enhancers.get(r);
|
|
279
279
|
if (!i) {
|
|
280
|
-
|
|
280
|
+
M.warnUnknownName(r);
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
|
-
|
|
283
|
+
M.run(`enhance "${r}"`, () => {
|
|
284
284
|
const n = i.init(e);
|
|
285
|
-
|
|
285
|
+
M.appliedKeys(e).set(r, n);
|
|
286
286
|
});
|
|
287
|
-
}),
|
|
288
|
-
const i = `${
|
|
289
|
-
if (
|
|
287
|
+
}), M.names(e, `${l.prefix}enhance-new`).forEach((r) => {
|
|
288
|
+
const i = `${Ke}${r}`;
|
|
289
|
+
if (M.instances.get(e)?.has(i))
|
|
290
290
|
return;
|
|
291
|
-
const n =
|
|
292
|
-
n !== null &&
|
|
291
|
+
const n = M.resolveGlobal(r);
|
|
292
|
+
n !== null && M.run(`enhance-new "${r}"`, () => {
|
|
293
293
|
const s = new n(e);
|
|
294
|
-
|
|
294
|
+
M.appliedKeys(e).set(i, s);
|
|
295
295
|
});
|
|
296
296
|
});
|
|
297
297
|
}
|
|
@@ -303,15 +303,15 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
303
303
|
* @returns 戻り値はありません。
|
|
304
304
|
*/
|
|
305
305
|
static refreshElement(e, t) {
|
|
306
|
-
const r =
|
|
307
|
-
|
|
306
|
+
const r = M.instances.get(e);
|
|
307
|
+
M.names(e, `${l.prefix}enhance`).forEach((i) => {
|
|
308
308
|
if (!r || !r.has(i))
|
|
309
309
|
return;
|
|
310
|
-
const n =
|
|
311
|
-
!n || typeof n.refresh != "function" ||
|
|
310
|
+
const n = M.enhancers.get(i);
|
|
311
|
+
!n || typeof n.refresh != "function" || M.run(`enhance "${i}" refresh`, () => {
|
|
312
312
|
n.refresh(e, r.get(i));
|
|
313
313
|
});
|
|
314
|
-
}), t &&
|
|
314
|
+
}), t && M.applyElement(e);
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
317
|
* 1 要素の連携を破棄します。
|
|
@@ -320,15 +320,15 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
320
320
|
* @returns 戻り値はありません。
|
|
321
321
|
*/
|
|
322
322
|
static destroyElement(e) {
|
|
323
|
-
const t =
|
|
323
|
+
const t = M.instances.get(e);
|
|
324
324
|
t && (t.forEach((r, i) => {
|
|
325
|
-
if (i.startsWith(
|
|
325
|
+
if (i.startsWith(Ke))
|
|
326
326
|
return;
|
|
327
|
-
const n =
|
|
328
|
-
!n || typeof n.destroy != "function" ||
|
|
327
|
+
const n = M.enhancers.get(i);
|
|
328
|
+
!n || typeof n.destroy != "function" || M.run(`enhance "${i}" destroy`, () => {
|
|
329
329
|
n.destroy(e, r);
|
|
330
330
|
});
|
|
331
|
-
}),
|
|
331
|
+
}), M.instances.delete(e));
|
|
332
332
|
}
|
|
333
333
|
/**
|
|
334
334
|
* 要素の適用状況を返します(無ければ作成します)。
|
|
@@ -337,11 +337,11 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
337
337
|
* @returns キー → インスタンスの対応
|
|
338
338
|
*/
|
|
339
339
|
static appliedKeys(e) {
|
|
340
|
-
const t =
|
|
340
|
+
const t = M.instances.get(e);
|
|
341
341
|
if (t)
|
|
342
342
|
return t;
|
|
343
343
|
const r = /* @__PURE__ */ new Map();
|
|
344
|
-
return
|
|
344
|
+
return M.instances.set(e, r), r;
|
|
345
345
|
}
|
|
346
346
|
/**
|
|
347
347
|
* 空白区切りの属性値を名前の一覧へ分解します。
|
|
@@ -368,7 +368,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
368
368
|
* @returns 解決した値。解決できない場合は null
|
|
369
369
|
*/
|
|
370
370
|
static resolveGlobal(e) {
|
|
371
|
-
if (!
|
|
371
|
+
if (!Et.test(e))
|
|
372
372
|
return m.error(
|
|
373
373
|
"[Haori]",
|
|
374
374
|
`${l.prefix}enhance-new accepts a dot-separated global reference only: ${e}`
|
|
@@ -382,7 +382,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
382
382
|
if (t = t[r], t === void 0)
|
|
383
383
|
break;
|
|
384
384
|
}
|
|
385
|
-
return typeof t != "function" ? (
|
|
385
|
+
return typeof t != "function" ? (q.isEnabled() && !M.warnedMissingGlobals.has(e) && (M.warnedMissingGlobals.add(e), m.warn(
|
|
386
386
|
"[Haori]",
|
|
387
387
|
`${l.prefix}enhance-new could not resolve the global reference (load the library before Haori runs): ${e}`
|
|
388
388
|
)), null) : t;
|
|
@@ -394,7 +394,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
394
394
|
* @returns 戻り値はありません。
|
|
395
395
|
*/
|
|
396
396
|
static warnUnknownName(e) {
|
|
397
|
-
!
|
|
397
|
+
!q.isEnabled() || M.warnedUnknownNames.has(e) || (M.warnedUnknownNames.add(e), m.warn(
|
|
398
398
|
"[Haori]",
|
|
399
399
|
`Enhancer "${e}" is not registered yet; the declaration is kept pending and applied when it is registered (Haori.enhancers.register('${e}', {init(el) {...}})).`
|
|
400
400
|
));
|
|
@@ -417,30 +417,30 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
417
417
|
m.error("[Haori]", `${e} failed:`, i);
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
|
-
|
|
420
|
+
M.mutationCapture ? M.mutationCapture(r) : r();
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
|
-
|
|
424
|
-
let
|
|
425
|
-
const
|
|
426
|
-
function
|
|
423
|
+
M.enhancers = /* @__PURE__ */ new Map(), M.instances = /* @__PURE__ */ new WeakMap(), M.warnedUnknownNames = /* @__PURE__ */ new Set(), M.warnedMissingGlobals = /* @__PURE__ */ new Set(), M.visited = /* @__PURE__ */ new WeakSet(), M.mutationCapture = null;
|
|
424
|
+
let te = M;
|
|
425
|
+
const _e = "yyyy/MM/dd HH:mm", At = "en-US", ze = 1e4;
|
|
426
|
+
function le(b) {
|
|
427
427
|
return String(b).padStart(2, "0");
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function et(b, e, t, r, i, n) {
|
|
430
430
|
return {
|
|
431
431
|
yyyy: String(b).padStart(4, "0"),
|
|
432
|
-
yy:
|
|
433
|
-
MM:
|
|
432
|
+
yy: le(b % 100),
|
|
433
|
+
MM: le(e),
|
|
434
434
|
M: String(e),
|
|
435
|
-
dd:
|
|
435
|
+
dd: le(t),
|
|
436
436
|
d: String(t),
|
|
437
|
-
HH:
|
|
437
|
+
HH: le(r),
|
|
438
438
|
H: String(r),
|
|
439
|
-
mm:
|
|
440
|
-
ss:
|
|
439
|
+
mm: le(i),
|
|
440
|
+
ss: le(n)
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function tt(b, e) {
|
|
444
444
|
let t;
|
|
445
445
|
try {
|
|
446
446
|
t = new Intl.DateTimeFormat("en-US", {
|
|
@@ -460,9 +460,9 @@ function rt(b, e) {
|
|
|
460
460
|
for (const u of t)
|
|
461
461
|
u.type !== "literal" && (r[u.type] = u.value);
|
|
462
462
|
const i = Number(r.year), n = Number(r.month), s = Number(r.day), a = Number(r.hour), o = Number(r.minute), c = Number(r.second);
|
|
463
|
-
return !Number.isFinite(i) || !Number.isFinite(n) || !Number.isFinite(s) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(c) ? null :
|
|
463
|
+
return !Number.isFinite(i) || !Number.isFinite(n) || !Number.isFinite(s) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(c) ? null : et(i, n, s, a, o, c);
|
|
464
464
|
}
|
|
465
|
-
function Pe(b, e =
|
|
465
|
+
function Pe(b, e = _e, t) {
|
|
466
466
|
if (b == null || b === "")
|
|
467
467
|
return "";
|
|
468
468
|
const r = b instanceof Date ? b : new Date(b);
|
|
@@ -470,10 +470,10 @@ function Pe(b, e = et, t) {
|
|
|
470
470
|
return "";
|
|
471
471
|
let i;
|
|
472
472
|
if (typeof t == "string" && t.trim() !== "") {
|
|
473
|
-
if (i =
|
|
473
|
+
if (i = tt(r, t.trim()), i === null)
|
|
474
474
|
return "";
|
|
475
475
|
} else
|
|
476
|
-
i =
|
|
476
|
+
i = et(
|
|
477
477
|
r.getFullYear(),
|
|
478
478
|
r.getMonth() + 1,
|
|
479
479
|
r.getDate(),
|
|
@@ -487,15 +487,15 @@ function Pe(b, e = et, t) {
|
|
|
487
487
|
(s, a) => a !== void 0 ? a === "" ? "'" : a : n[s]
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
490
|
+
const vt = "yyyy-MM-dd";
|
|
491
|
+
function rt(b = _e, e) {
|
|
492
492
|
return Pe(/* @__PURE__ */ new Date(), b, e);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function it(b = 0, e = vt, t) {
|
|
495
495
|
const r = Number.isFinite(b) ? Math.trunc(b) : 0, i = typeof t == "string" && t.trim() !== "" ? t.trim() : "";
|
|
496
496
|
let n, s, a;
|
|
497
497
|
if (i !== "") {
|
|
498
|
-
const c =
|
|
498
|
+
const c = tt(/* @__PURE__ */ new Date(), i);
|
|
499
499
|
if (c === null)
|
|
500
500
|
return "";
|
|
501
501
|
n = Number(c.yyyy), s = Number(c.MM), a = Number(c.dd);
|
|
@@ -506,7 +506,7 @@ function nt(b = 0, e = wt, t) {
|
|
|
506
506
|
const o = new Date(Date.UTC(n, s - 1, a + r));
|
|
507
507
|
return Pe(o, e, "UTC");
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function nt(b, e) {
|
|
510
510
|
if (b == null)
|
|
511
511
|
return "";
|
|
512
512
|
let t;
|
|
@@ -525,23 +525,23 @@ function st(b, e) {
|
|
|
525
525
|
const i = Math.max(0, Math.trunc(e));
|
|
526
526
|
r.minimumFractionDigits = i, r.maximumFractionDigits = i;
|
|
527
527
|
}
|
|
528
|
-
return new Intl.NumberFormat(
|
|
528
|
+
return new Intl.NumberFormat(At, r).format(t);
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function st(b, e, t) {
|
|
531
531
|
let r, i, n;
|
|
532
532
|
if (e === void 0 ? (r = 0, i = b, n = 1) : (r = b, i = e, n = t === void 0 ? 1 : t), !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(n) || n === 0)
|
|
533
533
|
return [];
|
|
534
534
|
r = Math.trunc(r), i = Math.trunc(i), n = Math.trunc(n);
|
|
535
535
|
const s = [];
|
|
536
536
|
if (n > 0)
|
|
537
|
-
for (let a = r; a < i && s.length <
|
|
537
|
+
for (let a = r; a < i && s.length < ze; a += n)
|
|
538
538
|
s.push(a);
|
|
539
539
|
else
|
|
540
|
-
for (let a = r; a > i && s.length <
|
|
540
|
+
for (let a = r; a > i && s.length < ze; a += n)
|
|
541
541
|
s.push(a);
|
|
542
542
|
return s;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function at(b, e, t = {}) {
|
|
545
545
|
const r = Math.trunc(Number(b));
|
|
546
546
|
if (!Number.isFinite(r) || r <= 0)
|
|
547
547
|
return [];
|
|
@@ -578,62 +578,62 @@ function ot(b, e, t = {}) {
|
|
|
578
578
|
}
|
|
579
579
|
return c;
|
|
580
580
|
}
|
|
581
|
-
const
|
|
582
|
-
function
|
|
581
|
+
const wt = /^(\d{4})-(\d{1,2})$/, St = 1200;
|
|
582
|
+
function Ne(b, e) {
|
|
583
583
|
const t = Number(b);
|
|
584
584
|
return Number.isFinite(t) ? Math.trunc(t) : e;
|
|
585
585
|
}
|
|
586
586
|
function Le(b, e) {
|
|
587
587
|
if (typeof b != "string")
|
|
588
588
|
return "";
|
|
589
|
-
const t =
|
|
589
|
+
const t = wt.exec(b.trim());
|
|
590
590
|
if (!t)
|
|
591
591
|
return "";
|
|
592
592
|
const r = Number(t[1]), i = Number(t[2]);
|
|
593
593
|
if (i < 1 || i > 12)
|
|
594
594
|
return "";
|
|
595
595
|
const n = Number.isFinite(e) ? Math.trunc(e) : 0, s = r * 12 + (i - 1) + n, a = Math.floor(s / 12), o = s - a * 12 + 1;
|
|
596
|
-
return `${String(a).padStart(4, "0")}-${
|
|
596
|
+
return `${String(a).padStart(4, "0")}-${le(o)}`;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function Rt(b) {
|
|
599
599
|
if (typeof b == "string" && b.trim() !== "")
|
|
600
600
|
return Le(b, 0);
|
|
601
601
|
const e = /* @__PURE__ */ new Date();
|
|
602
|
-
return `${String(e.getFullYear()).padStart(4, "0")}-${
|
|
602
|
+
return `${String(e.getFullYear()).padStart(4, "0")}-${le(e.getMonth() + 1)}`;
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function ot(b, e) {
|
|
605
605
|
const t = Math.trunc(Number(b));
|
|
606
606
|
if (!Number.isFinite(t) || t < 0)
|
|
607
607
|
return [];
|
|
608
|
-
const r =
|
|
608
|
+
const r = Rt(e);
|
|
609
609
|
if (r === "")
|
|
610
610
|
return [];
|
|
611
|
-
const i = Math.min(t,
|
|
611
|
+
const i = Math.min(t, St), n = [];
|
|
612
612
|
for (let s = 0; s <= i; s += 1) {
|
|
613
613
|
const a = Le(r, -s);
|
|
614
614
|
n.push({ targetMonth: a, label: a.replace(/-/g, "/") });
|
|
615
615
|
}
|
|
616
616
|
return n;
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function lt(b, e) {
|
|
619
619
|
const t = { start: 0, end: 0, total: 0, empty: !0 };
|
|
620
620
|
if (!b || typeof b != "object")
|
|
621
621
|
return t;
|
|
622
|
-
const r = b, i =
|
|
622
|
+
const r = b, i = Ne(r.totalElements ?? r.totalCount, 0);
|
|
623
623
|
if (i <= 0)
|
|
624
624
|
return t;
|
|
625
|
-
const n = Math.max(0,
|
|
625
|
+
const n = Math.max(0, Ne(r.number, 0)), s = Math.max(0, Ne(r.size, 0)), a = n * s, o = Math.min(a + 1, i);
|
|
626
626
|
let c;
|
|
627
627
|
if (e !== void 0 && Number.isFinite(e))
|
|
628
628
|
c = Math.max(0, Math.trunc(e));
|
|
629
629
|
else {
|
|
630
|
-
const d =
|
|
630
|
+
const d = Ne(r.numberOfElements, NaN);
|
|
631
631
|
c = Number.isFinite(d) ? d : Math.min(s, i - a);
|
|
632
632
|
}
|
|
633
633
|
const u = Math.min(a + c, i);
|
|
634
634
|
return { start: o, end: Math.max(u, o), total: i, empty: !1 };
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function ct(b, e, t) {
|
|
637
637
|
if (!Array.isArray(b) || b.length === 0)
|
|
638
638
|
return null;
|
|
639
639
|
const r = String(t), i = b.find(
|
|
@@ -641,7 +641,7 @@ function ut(b, e, t) {
|
|
|
641
641
|
);
|
|
642
642
|
return i === void 0 ? null : i;
|
|
643
643
|
}
|
|
644
|
-
function
|
|
644
|
+
function ut(b, e) {
|
|
645
645
|
if (!Array.isArray(b))
|
|
646
646
|
return 0;
|
|
647
647
|
let t = 0;
|
|
@@ -654,25 +654,25 @@ function dt(b, e) {
|
|
|
654
654
|
}
|
|
655
655
|
return t;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function dt(b, e) {
|
|
658
658
|
return e == null || b == null ? String(b) : String(b[e]);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function ft(b, e) {
|
|
661
661
|
if (!Array.isArray(b))
|
|
662
662
|
return [];
|
|
663
663
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
664
664
|
for (const i of b) {
|
|
665
|
-
const n =
|
|
665
|
+
const n = dt(i, e);
|
|
666
666
|
t.has(n) || (t.add(n), r.push(i));
|
|
667
667
|
}
|
|
668
668
|
return r;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function ht(b, e) {
|
|
671
671
|
if (!Array.isArray(b))
|
|
672
672
|
return [];
|
|
673
673
|
const t = /* @__PURE__ */ new Map(), r = [];
|
|
674
674
|
for (const i of b) {
|
|
675
|
-
const n =
|
|
675
|
+
const n = dt(i, e), s = t.get(n);
|
|
676
676
|
if (s === void 0) {
|
|
677
677
|
const a = i == null ? i : i[e];
|
|
678
678
|
t.set(n, r.length), r.push({ key: a, items: [i] });
|
|
@@ -681,20 +681,20 @@ function pt(b, e) {
|
|
|
681
681
|
}
|
|
682
682
|
return r;
|
|
683
683
|
}
|
|
684
|
-
const
|
|
684
|
+
const Tt = Object.freeze({
|
|
685
685
|
date: Pe,
|
|
686
|
-
now:
|
|
687
|
-
today:
|
|
688
|
-
number:
|
|
689
|
-
pages:
|
|
690
|
-
range:
|
|
686
|
+
now: rt,
|
|
687
|
+
today: it,
|
|
688
|
+
number: nt,
|
|
689
|
+
pages: at,
|
|
690
|
+
range: st,
|
|
691
691
|
monthAdd: Le,
|
|
692
|
-
monthRange:
|
|
693
|
-
pageSummary:
|
|
694
|
-
findBy:
|
|
695
|
-
sum:
|
|
696
|
-
distinct:
|
|
697
|
-
groupBy:
|
|
692
|
+
monthRange: ot,
|
|
693
|
+
pageSummary: lt,
|
|
694
|
+
findBy: ct,
|
|
695
|
+
sum: ut,
|
|
696
|
+
distinct: ft,
|
|
697
|
+
groupBy: ht
|
|
698
698
|
});
|
|
699
699
|
class qe {
|
|
700
700
|
constructor() {
|
|
@@ -827,7 +827,7 @@ const je = class je {
|
|
|
827
827
|
}
|
|
828
828
|
};
|
|
829
829
|
je.ASYNC_QUEUE = new qe();
|
|
830
|
-
let
|
|
830
|
+
let K = je;
|
|
831
831
|
const R = class R {
|
|
832
832
|
/**
|
|
833
833
|
* ストレージを、参照が例外になる環境でも安全に読み出します。
|
|
@@ -974,7 +974,7 @@ const R = class R {
|
|
|
974
974
|
* @returns 戻り値はありません。
|
|
975
975
|
*/
|
|
976
976
|
static reportUnusableBindingKeys(e) {
|
|
977
|
-
if (e.length === 0 || !
|
|
977
|
+
if (e.length === 0 || !q.isEnabled())
|
|
978
978
|
return;
|
|
979
979
|
const t = e.filter(
|
|
980
980
|
(r) => !this.loggedUnusableBindingKeys.has(r)
|
|
@@ -1272,7 +1272,7 @@ let ${e.join(", ")};`;
|
|
|
1272
1272
|
);
|
|
1273
1273
|
return;
|
|
1274
1274
|
}
|
|
1275
|
-
|
|
1275
|
+
q.isEnabled() && (e.forEach((r) => {
|
|
1276
1276
|
this.pendingUnresolvedIdentifiers.add(r);
|
|
1277
1277
|
}), this.scheduleUnresolvedIdentifierReport());
|
|
1278
1278
|
}
|
|
@@ -1283,7 +1283,7 @@ let ${e.join(", ")};`;
|
|
|
1283
1283
|
* @return 戻り値はありません。
|
|
1284
1284
|
*/
|
|
1285
1285
|
static scheduleUnresolvedIdentifierReport() {
|
|
1286
|
-
this.unresolvedReportScheduled || (this.unresolvedReportScheduled = !0,
|
|
1286
|
+
this.unresolvedReportScheduled || (this.unresolvedReportScheduled = !0, K.waitForIdle().then(() => {
|
|
1287
1287
|
this.unresolvedReportScheduled = !1, this.reportUnresolvedIdentifiers();
|
|
1288
1288
|
}));
|
|
1289
1289
|
}
|
|
@@ -1329,7 +1329,7 @@ let ${e.join(", ")};`;
|
|
|
1329
1329
|
* @return 戻り値はありません。
|
|
1330
1330
|
*/
|
|
1331
1331
|
static recordRowScopeIdentifiers(e) {
|
|
1332
|
-
if (
|
|
1332
|
+
if (q.isEnabled())
|
|
1333
1333
|
for (const t of e)
|
|
1334
1334
|
typeof t == "string" && t !== "" && this.rowScopeIdentifiers.add(t);
|
|
1335
1335
|
}
|
|
@@ -1350,7 +1350,7 @@ let ${e.join(", ")};`;
|
|
|
1350
1350
|
this.pendingScopeMissingIdentifiers.delete(t);
|
|
1351
1351
|
return;
|
|
1352
1352
|
}
|
|
1353
|
-
this.pendingScopeMissingIdentifiers.set(t, new Set(e)), !this.scopeMissingReportScheduled && (this.scopeMissingReportScheduled = !0,
|
|
1353
|
+
this.pendingScopeMissingIdentifiers.set(t, new Set(e)), !this.scopeMissingReportScheduled && (this.scopeMissingReportScheduled = !0, K.waitForIdle().then(() => {
|
|
1354
1354
|
this.scopeMissingReportScheduled = !1, this.reportScopeMissingIdentifiers();
|
|
1355
1355
|
}));
|
|
1356
1356
|
}
|
|
@@ -1499,14 +1499,14 @@ ${t}`;
|
|
|
1499
1499
|
s && (this.BUILTIN_DATA_REFERENCE_PATTERN.test(n) ? a[this.BUILTIN_NAMESPACE] = {
|
|
1500
1500
|
...this.BUILTIN_HELPERS,
|
|
1501
1501
|
[this.BUILTIN_DATA_PROPERTY]: { ...a }
|
|
1502
|
-
} : a[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(a),
|
|
1502
|
+
} : a[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(a), q.isEnabled() && this.recordSuppliedIdentifiers(a);
|
|
1503
1503
|
const o = this.canAttemptMissingIdentifierRecovery(e), c = this.extractFreeIdentifiers(e).filter(
|
|
1504
1504
|
(d) => !(d in a) && // 禁止グローバルは buildAssignments が `const` で遮蔽するため対象外
|
|
1505
1505
|
// (二重宣言は構文エラーになる)。
|
|
1506
1506
|
!this.FORBIDDEN_NAMES.includes(d) && // 標準組み込み(`Math` など)は式から参照できる仕様のため遮蔽しない。
|
|
1507
1507
|
!this.ALLOWED_GLOBAL_IDENTIFIERS.has(d)
|
|
1508
1508
|
);
|
|
1509
|
-
if (
|
|
1509
|
+
if (q.isEnabled()) {
|
|
1510
1510
|
const d = this.extractBoundIdentifiers(e);
|
|
1511
1511
|
this.recordScopeMissingIdentifiers(
|
|
1512
1512
|
d.size === 0 ? c : c.filter((g) => !d.has(g)),
|
|
@@ -1527,8 +1527,8 @@ ${t}`;
|
|
|
1527
1527
|
return { value: null, unresolvedReference: !1 };
|
|
1528
1528
|
try {
|
|
1529
1529
|
const y = [], E = this.wrapBoundValues(a);
|
|
1530
|
-
g.bindKeys.forEach((
|
|
1531
|
-
y.push(E[
|
|
1530
|
+
g.bindKeys.forEach((D) => {
|
|
1531
|
+
y.push(E[D]);
|
|
1532
1532
|
});
|
|
1533
1533
|
const A = this.withBlockedPropertyAccess(
|
|
1534
1534
|
() => g.evaluator(...y)
|
|
@@ -2308,7 +2308,7 @@ return (${y});${g}`;
|
|
|
2308
2308
|
}
|
|
2309
2309
|
};
|
|
2310
2310
|
R.MAX_IDENTIFIER_RECOVERY_COUNT = 8, R.BUILTIN_NAMESPACE = "haori", R.BUILTIN_HELPERS = {
|
|
2311
|
-
...
|
|
2311
|
+
...Tt
|
|
2312
2312
|
}, R.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, R.BUILTIN_DATA_PROPERTY = "data", R.BUILTIN_DATA_REFERENCE_PATTERN = /(^|[^\w$.])haori\s*(\.\s*data(?![\w$])|\[)/, R.IDENTIFIER_NAME_PATTERN = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u, R.usableBindingKeyCache = /* @__PURE__ */ new Map(), R.loggedUnusableBindingKeys = /* @__PURE__ */ new Set(), R.compileFailedExpressions = /* @__PURE__ */ new Set(), R.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), R.forbiddenBindingValueCacheResetScheduled = !1, R.loggedForbiddenKeySignatures = /* @__PURE__ */ new Set(), R.loggedForbiddenKeyResetScheduled = !1, R.FORBIDDEN_NAMES = [
|
|
2313
2313
|
// グローバルオブジェクト
|
|
2314
2314
|
"window",
|
|
@@ -2496,13 +2496,13 @@ R.MAX_IDENTIFIER_RECOVERY_COUNT = 8, R.BUILTIN_NAMESPACE = "haori", R.BUILTIN_HE
|
|
|
2496
2496
|
"%",
|
|
2497
2497
|
"..."
|
|
2498
2498
|
]), R.strictComparisonSplits = /* @__PURE__ */ new Map(), R.WRAPPED_VALUES = /* @__PURE__ */ new WeakSet();
|
|
2499
|
-
let
|
|
2500
|
-
const
|
|
2499
|
+
let ie = R;
|
|
2500
|
+
const he = "data-haori-if-disabled", Ge = "input, select, textarea, button, fieldset", C = class C {
|
|
2501
2501
|
/**
|
|
2502
2502
|
* 集計状態を初期化します。
|
|
2503
2503
|
*/
|
|
2504
2504
|
static reset() {
|
|
2505
|
-
|
|
2505
|
+
C.ELEMENT_STORES.clear(), C.ensureGlobalAccess();
|
|
2506
2506
|
}
|
|
2507
2507
|
/**
|
|
2508
2508
|
* 集計を開始します。
|
|
@@ -2510,7 +2510,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2510
2510
|
* @returns 戻り値はありません。
|
|
2511
2511
|
*/
|
|
2512
2512
|
static start() {
|
|
2513
|
-
|
|
2513
|
+
C.collecting = !0;
|
|
2514
2514
|
}
|
|
2515
2515
|
/**
|
|
2516
2516
|
* 集計を停止します。
|
|
@@ -2518,7 +2518,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2518
2518
|
* @returns 戻り値はありません。
|
|
2519
2519
|
*/
|
|
2520
2520
|
static stop() {
|
|
2521
|
-
|
|
2521
|
+
C.collecting = !1;
|
|
2522
2522
|
}
|
|
2523
2523
|
/**
|
|
2524
2524
|
* 集計中かどうかを返します。
|
|
@@ -2526,7 +2526,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2526
2526
|
* @returns 集計中なら true
|
|
2527
2527
|
*/
|
|
2528
2528
|
static isCollecting() {
|
|
2529
|
-
return
|
|
2529
|
+
return C.collecting && q.isEnabled();
|
|
2530
2530
|
}
|
|
2531
2531
|
/**
|
|
2532
2532
|
* 現在の集計結果スナップショットを返します。
|
|
@@ -2534,7 +2534,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2534
2534
|
* @returns エレメントごとの集計結果
|
|
2535
2535
|
*/
|
|
2536
2536
|
static snapshot() {
|
|
2537
|
-
return
|
|
2537
|
+
return C.ensureGlobalAccess(), [...C.ELEMENT_STORES.entries()].map(([e, t]) => ({
|
|
2538
2538
|
elementId: e,
|
|
2539
2539
|
tagName: t.tagName,
|
|
2540
2540
|
attributes: [...t.attributes.entries()].map(([r, i]) => ({
|
|
@@ -2543,7 +2543,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2543
2543
|
calls: i.calls,
|
|
2544
2544
|
totalDurationMs: i.totalDurationMs,
|
|
2545
2545
|
maxDurationMs: i.maxDurationMs,
|
|
2546
|
-
placeholders:
|
|
2546
|
+
placeholders: C.sortPlaceholders(
|
|
2547
2547
|
i.placeholders
|
|
2548
2548
|
)
|
|
2549
2549
|
})).sort((r, i) => i.calls - r.calls),
|
|
@@ -2553,7 +2553,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2553
2553
|
calls: i.calls,
|
|
2554
2554
|
totalDurationMs: i.totalDurationMs,
|
|
2555
2555
|
maxDurationMs: i.maxDurationMs,
|
|
2556
|
-
placeholders:
|
|
2556
|
+
placeholders: C.sortPlaceholders(
|
|
2557
2557
|
i.placeholders
|
|
2558
2558
|
)
|
|
2559
2559
|
})).sort((r, i) => i.calls - r.calls)
|
|
@@ -2577,7 +2577,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2577
2577
|
* @param limit 出力する宣言の数。既定は 20
|
|
2578
2578
|
* @returns 要約。合計は `limit` で絞る前の全件から求める
|
|
2579
2579
|
*/
|
|
2580
|
-
static report(e =
|
|
2580
|
+
static report(e = C.DEFAULT_REPORT_LIMIT) {
|
|
2581
2581
|
const t = /* @__PURE__ */ new Map();
|
|
2582
2582
|
let r = 0, i = 0;
|
|
2583
2583
|
const n = (c, u, d) => {
|
|
@@ -2601,7 +2601,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2601
2601
|
d.maxDurationMs
|
|
2602
2602
|
), d.totalDurationMs > g.representativeDurationMs && (g.where = u, g.representativeDurationMs = d.totalDurationMs);
|
|
2603
2603
|
};
|
|
2604
|
-
|
|
2604
|
+
C.snapshot().forEach((c) => {
|
|
2605
2605
|
c.attributes.forEach((u) => {
|
|
2606
2606
|
n(
|
|
2607
2607
|
`@${u.name}
|
|
@@ -2631,7 +2631,7 @@ ${u.template}`,
|
|
|
2631
2631
|
entryCount: s.length,
|
|
2632
2632
|
top: a
|
|
2633
2633
|
};
|
|
2634
|
-
return
|
|
2634
|
+
return C.logReport(o), o;
|
|
2635
2635
|
}
|
|
2636
2636
|
/**
|
|
2637
2637
|
* 要約を表形式でコンソールへ出力します。
|
|
@@ -2661,30 +2661,30 @@ ${u.template}`,
|
|
|
2661
2661
|
* @param expressions 今回評価した式一覧
|
|
2662
2662
|
*/
|
|
2663
2663
|
static record(e, t, r) {
|
|
2664
|
-
if (!
|
|
2664
|
+
if (!q.isEnabled() || !e || t.length === 0 || (C.ensureGlobalAccess(), !C.isCollecting()))
|
|
2665
2665
|
return;
|
|
2666
|
-
const i =
|
|
2666
|
+
const i = C.getOrCreateElementStore(
|
|
2667
2667
|
e.element
|
|
2668
2668
|
);
|
|
2669
2669
|
if (e.kind === "attribute") {
|
|
2670
|
-
const s =
|
|
2670
|
+
const s = C.getOrCreateCounter(
|
|
2671
2671
|
i.attributes,
|
|
2672
2672
|
e.rawName,
|
|
2673
2673
|
e.template
|
|
2674
2674
|
);
|
|
2675
|
-
|
|
2675
|
+
C.updateCounter(
|
|
2676
2676
|
s,
|
|
2677
2677
|
t,
|
|
2678
2678
|
r
|
|
2679
2679
|
);
|
|
2680
2680
|
return;
|
|
2681
2681
|
}
|
|
2682
|
-
const n =
|
|
2682
|
+
const n = C.getOrCreateCounter(
|
|
2683
2683
|
i.texts,
|
|
2684
2684
|
String(e.childIndex),
|
|
2685
2685
|
e.template
|
|
2686
2686
|
);
|
|
2687
|
-
|
|
2687
|
+
C.updateCounter(
|
|
2688
2688
|
n,
|
|
2689
2689
|
t,
|
|
2690
2690
|
r
|
|
@@ -2694,15 +2694,15 @@ ${u.template}`,
|
|
|
2694
2694
|
* globalThis から dev-only の取得窓口を参照できるようにします。
|
|
2695
2695
|
*/
|
|
2696
2696
|
static ensureGlobalAccess() {
|
|
2697
|
-
if (!
|
|
2697
|
+
if (!q.isEnabled())
|
|
2698
2698
|
return;
|
|
2699
2699
|
const e = globalThis;
|
|
2700
|
-
e[
|
|
2701
|
-
start: () =>
|
|
2702
|
-
stop: () =>
|
|
2703
|
-
reset: () =>
|
|
2704
|
-
snapshot: () =>
|
|
2705
|
-
report: (t) =>
|
|
2700
|
+
e[C.GLOBAL_KEY] === void 0 && (e[C.GLOBAL_KEY] = {
|
|
2701
|
+
start: () => C.start(),
|
|
2702
|
+
stop: () => C.stop(),
|
|
2703
|
+
reset: () => C.reset(),
|
|
2704
|
+
snapshot: () => C.snapshot(),
|
|
2705
|
+
report: (t) => C.report(t)
|
|
2706
2706
|
});
|
|
2707
2707
|
}
|
|
2708
2708
|
/**
|
|
@@ -2712,7 +2712,7 @@ ${u.template}`,
|
|
|
2712
2712
|
* @returns 集計ストア
|
|
2713
2713
|
*/
|
|
2714
2714
|
static getOrCreateElementStore(e) {
|
|
2715
|
-
const t =
|
|
2715
|
+
const t = C.createElementId(e), r = C.ELEMENT_STORES.get(t);
|
|
2716
2716
|
if (r)
|
|
2717
2717
|
return r;
|
|
2718
2718
|
const i = {
|
|
@@ -2720,7 +2720,7 @@ ${u.template}`,
|
|
|
2720
2720
|
attributes: /* @__PURE__ */ new Map(),
|
|
2721
2721
|
texts: /* @__PURE__ */ new Map()
|
|
2722
2722
|
};
|
|
2723
|
-
return
|
|
2723
|
+
return C.ELEMENT_STORES.set(t, i), i;
|
|
2724
2724
|
}
|
|
2725
2725
|
/**
|
|
2726
2726
|
* カウンタを取得または初期化します。
|
|
@@ -2770,7 +2770,7 @@ ${u.template}`,
|
|
|
2770
2770
|
*/
|
|
2771
2771
|
static updateCounter(e, t, r) {
|
|
2772
2772
|
e.calls += 1, e.totalDurationMs += r, e.maxDurationMs = Math.max(e.maxDurationMs, r), t.forEach((i) => {
|
|
2773
|
-
const n =
|
|
2773
|
+
const n = C.getOrCreatePlaceholder(
|
|
2774
2774
|
e.placeholders,
|
|
2775
2775
|
i.expression
|
|
2776
2776
|
);
|
|
@@ -2809,12 +2809,12 @@ ${u.template}`,
|
|
|
2809
2809
|
* @returns 結果と所要時間
|
|
2810
2810
|
*/
|
|
2811
2811
|
static measure(e) {
|
|
2812
|
-
if (!
|
|
2812
|
+
if (!C.isCollecting())
|
|
2813
2813
|
return { value: e(), durationMs: 0 };
|
|
2814
|
-
const t =
|
|
2814
|
+
const t = C.now();
|
|
2815
2815
|
return {
|
|
2816
2816
|
value: e(),
|
|
2817
|
-
durationMs:
|
|
2817
|
+
durationMs: C.now() - t
|
|
2818
2818
|
};
|
|
2819
2819
|
}
|
|
2820
2820
|
/**
|
|
@@ -2841,29 +2841,29 @@ ${u.template}`,
|
|
|
2841
2841
|
return t.join(" > ");
|
|
2842
2842
|
}
|
|
2843
2843
|
};
|
|
2844
|
-
|
|
2845
|
-
let
|
|
2846
|
-
const
|
|
2844
|
+
C.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", C.ELEMENT_STORES = /* @__PURE__ */ new Map(), C.collecting = !1, C.DEFAULT_REPORT_LIMIT = 20;
|
|
2845
|
+
let Me = C;
|
|
2846
|
+
const ce = class ce {
|
|
2847
2847
|
/**
|
|
2848
2848
|
* フラグメントのコンストラクタ。
|
|
2849
2849
|
*
|
|
2850
2850
|
* @param target 対象ノード
|
|
2851
2851
|
*/
|
|
2852
2852
|
constructor(e) {
|
|
2853
|
-
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e,
|
|
2853
|
+
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e, ce.FRAGMENT_CACHE.set(e, this);
|
|
2854
2854
|
}
|
|
2855
2855
|
static get(e) {
|
|
2856
2856
|
if (e == null)
|
|
2857
2857
|
return null;
|
|
2858
|
-
if (
|
|
2859
|
-
return
|
|
2858
|
+
if (ce.FRAGMENT_CACHE.has(e))
|
|
2859
|
+
return ce.FRAGMENT_CACHE.get(e);
|
|
2860
2860
|
let t;
|
|
2861
2861
|
switch (e.nodeType) {
|
|
2862
2862
|
case Node.ELEMENT_NODE:
|
|
2863
2863
|
t = new S(e);
|
|
2864
2864
|
break;
|
|
2865
2865
|
case Node.TEXT_NODE:
|
|
2866
|
-
t = new
|
|
2866
|
+
t = new ne(e);
|
|
2867
2867
|
break;
|
|
2868
2868
|
case Node.COMMENT_NODE:
|
|
2869
2869
|
t = new We(e);
|
|
@@ -2884,7 +2884,7 @@ const de = class de {
|
|
|
2884
2884
|
* @returns キャッシュ済みのフラグメント。無ければ `null`
|
|
2885
2885
|
*/
|
|
2886
2886
|
static peek(e) {
|
|
2887
|
-
return
|
|
2887
|
+
return ce.FRAGMENT_CACHE.get(e) ?? null;
|
|
2888
2888
|
}
|
|
2889
2889
|
/**
|
|
2890
2890
|
* 指定した子ノードを、エンジン自身が出し入れしている最中かどうかを返します。
|
|
@@ -2923,7 +2923,7 @@ const de = class de {
|
|
|
2923
2923
|
return Promise.resolve();
|
|
2924
2924
|
if (this.parent) {
|
|
2925
2925
|
const e = this.parent, t = e.skipMutationNodes;
|
|
2926
|
-
return e.holdSkipMutationNode(this.target),
|
|
2926
|
+
return e.holdSkipMutationNode(this.target), K.enqueue(() => {
|
|
2927
2927
|
e.skipMutationNodes = !0, this.target.parentNode === e.getTarget() && e.getTarget().removeChild(this.target), this.mounted = !1;
|
|
2928
2928
|
}).finally(() => {
|
|
2929
2929
|
e.skipMutationNodes = t, e.releaseSkipMutationNode(this.target);
|
|
@@ -2931,7 +2931,7 @@ const de = class de {
|
|
|
2931
2931
|
} else {
|
|
2932
2932
|
const e = this.target.parentNode;
|
|
2933
2933
|
if (e)
|
|
2934
|
-
return
|
|
2934
|
+
return K.enqueue(() => {
|
|
2935
2935
|
this.target.parentNode === e && e.removeChild(this.target), this.mounted = !1;
|
|
2936
2936
|
});
|
|
2937
2937
|
this.mounted = !1;
|
|
@@ -2948,7 +2948,7 @@ const de = class de {
|
|
|
2948
2948
|
return Promise.resolve();
|
|
2949
2949
|
if (this.parent) {
|
|
2950
2950
|
const e = this.parent, t = e.skipMutationNodes;
|
|
2951
|
-
return e.holdSkipMutationNode(this.target),
|
|
2951
|
+
return e.holdSkipMutationNode(this.target), K.enqueue(() => {
|
|
2952
2952
|
e.skipMutationNodes = !0, this.target.parentNode !== e.getTarget() && e.getTarget().appendChild(this.target), this.mounted = !0;
|
|
2953
2953
|
}).finally(() => {
|
|
2954
2954
|
e.skipMutationNodes = t, e.releaseSkipMutationNode(this.target);
|
|
@@ -2979,7 +2979,7 @@ const de = class de {
|
|
|
2979
2979
|
* @return 除去のPromise
|
|
2980
2980
|
*/
|
|
2981
2981
|
remove(e = !0) {
|
|
2982
|
-
return this.parent && this.parent.removeChild(this),
|
|
2982
|
+
return this.parent && this.parent.removeChild(this), ce.FRAGMENT_CACHE.delete(this.target), e ? this.unmount() : Promise.resolve();
|
|
2983
2983
|
}
|
|
2984
2984
|
/**
|
|
2985
2985
|
* 対象ノードを取得します。
|
|
@@ -3006,9 +3006,9 @@ const de = class de {
|
|
|
3006
3006
|
this.parent = e;
|
|
3007
3007
|
}
|
|
3008
3008
|
};
|
|
3009
|
-
|
|
3010
|
-
let
|
|
3011
|
-
const w = class w extends
|
|
3009
|
+
ce.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
3010
|
+
let I = ce;
|
|
3011
|
+
const w = class w extends I {
|
|
3012
3012
|
/**
|
|
3013
3013
|
* エレメントフラグメントのコンストラクタ。
|
|
3014
3014
|
* アトリビュートや子フラグメントの作成も行います。
|
|
@@ -3028,7 +3028,7 @@ const w = class w extends D {
|
|
|
3028
3028
|
e.childNodes.forEach((i) => {
|
|
3029
3029
|
if (w.isOwnedWithinExternal(i))
|
|
3030
3030
|
return;
|
|
3031
|
-
const n =
|
|
3031
|
+
const n = I.peek(i)?.getParent() ?? null, s = I.get(i);
|
|
3032
3032
|
n !== null && n !== this && (t = t ?? n, n === t && r.push(s)), s.setParent(this), this.children.push(s);
|
|
3033
3033
|
}), t !== null && this.takeOverPlaceOf(t, r);
|
|
3034
3034
|
}
|
|
@@ -3068,7 +3068,7 @@ const w = class w extends D {
|
|
|
3068
3068
|
* @returns 取り込まない場合 true
|
|
3069
3069
|
*/
|
|
3070
3070
|
static isOwnedWithinExternal(e) {
|
|
3071
|
-
const r =
|
|
3071
|
+
const r = I.peek(e)?.getParent() ?? null;
|
|
3072
3072
|
if (r === null)
|
|
3073
3073
|
return !1;
|
|
3074
3074
|
const i = r.getTarget().closest(`[${l.prefix}external]`);
|
|
@@ -3161,7 +3161,7 @@ const w = class w extends D {
|
|
|
3161
3161
|
*/
|
|
3162
3162
|
static dropIfVisibilityArtifacts(e) {
|
|
3163
3163
|
e.hasAttribute(`${l.prefix}if-false`) && (e.style.removeProperty("display"), e.getAttribute("style")?.trim() === "" && e.removeAttribute("style"), e.removeAttribute(`${l.prefix}if-false`), w.forEachFormControlInBranch(e, (t) => {
|
|
3164
|
-
t.hasAttribute(
|
|
3164
|
+
t.hasAttribute(he) && (t.removeAttribute(he), t.removeAttribute("disabled"));
|
|
3165
3165
|
}));
|
|
3166
3166
|
}
|
|
3167
3167
|
/**
|
|
@@ -3172,7 +3172,7 @@ const w = class w extends D {
|
|
|
3172
3172
|
*/
|
|
3173
3173
|
remove(e = !0) {
|
|
3174
3174
|
const t = [];
|
|
3175
|
-
return e &&
|
|
3175
|
+
return e && te.destroySubtree(this.getTarget()), this.getTarget().hasAttribute(`${l.prefix}external`) ? this.detachPreservingSubtree(e) : (this.children.slice().forEach((r) => {
|
|
3176
3176
|
t.push(r.remove(!1));
|
|
3177
3177
|
}), 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(() => {
|
|
3178
3178
|
}));
|
|
@@ -3627,7 +3627,7 @@ const w = class w extends D {
|
|
|
3627
3627
|
return Promise.resolve();
|
|
3628
3628
|
const i = this.getTarget();
|
|
3629
3629
|
if (i instanceof HTMLInputElement && i.type === "file")
|
|
3630
|
-
return e === null || e === "" ? (this.value = null, i.value === "" ? Promise.resolve() :
|
|
3630
|
+
return e === null || e === "" ? (this.value = null, i.value === "" ? Promise.resolve() : K.enqueue(() => {
|
|
3631
3631
|
i.value = "";
|
|
3632
3632
|
})) : (m.warn(
|
|
3633
3633
|
"[Haori]",
|
|
@@ -3716,7 +3716,7 @@ const w = class w extends D {
|
|
|
3716
3716
|
*/
|
|
3717
3717
|
enqueueValueWrite(e) {
|
|
3718
3718
|
this.skipChangeValue = !0;
|
|
3719
|
-
const t =
|
|
3719
|
+
const t = K.enqueue(e).finally(() => {
|
|
3720
3720
|
this.skipChangeValue = !1;
|
|
3721
3721
|
});
|
|
3722
3722
|
return this.pendingValueWrite = t, t;
|
|
@@ -3809,7 +3809,7 @@ const w = class w extends D {
|
|
|
3809
3809
|
* @returns 戻り値はありません。
|
|
3810
3810
|
*/
|
|
3811
3811
|
static notifyValueToEnhancers(e) {
|
|
3812
|
-
|
|
3812
|
+
te.isApplied(e) && te.refreshSubtree(e);
|
|
3813
3813
|
}
|
|
3814
3814
|
/**
|
|
3815
3815
|
* 「載らなかった書き込み」の記録を解除します。
|
|
@@ -4056,7 +4056,7 @@ const w = class w extends D {
|
|
|
4056
4056
|
* @return 戻り値はありません。
|
|
4057
4057
|
*/
|
|
4058
4058
|
static warnUnresolvedAttribute(e, t, r, i) {
|
|
4059
|
-
if (!
|
|
4059
|
+
if (!q.isEnabled())
|
|
4060
4060
|
return;
|
|
4061
4061
|
const n = `${e} ${r}`;
|
|
4062
4062
|
w.loggedUnresolvedAttributes.has(n) || (w.loggedUnresolvedAttributes.add(n), m.warn(
|
|
@@ -4103,7 +4103,7 @@ const w = class w extends D {
|
|
|
4103
4103
|
const t = this.getTarget().closest("select");
|
|
4104
4104
|
if (!t)
|
|
4105
4105
|
return !1;
|
|
4106
|
-
const r =
|
|
4106
|
+
const r = I.get(t);
|
|
4107
4107
|
return r instanceof w ? r.hasPendingUserEdit() : !1;
|
|
4108
4108
|
}
|
|
4109
4109
|
/**
|
|
@@ -4227,7 +4227,7 @@ const w = class w extends D {
|
|
|
4227
4227
|
* @returns 戻り値はありません。
|
|
4228
4228
|
*/
|
|
4229
4229
|
static warnValueTypeDeclaration(e, t, r) {
|
|
4230
|
-
if (!
|
|
4230
|
+
if (!q.isEnabled())
|
|
4231
4231
|
return;
|
|
4232
4232
|
const i = e instanceof HTMLInputElement ? `[type=${e.type}]` : "", n = `${e.tagName}${i} ${t} ${r}`;
|
|
4233
4233
|
w.loggedValueTypeDeclarations.has(n) || (w.loggedValueTypeDeclarations.add(n), m.warn(
|
|
@@ -4368,7 +4368,7 @@ const w = class w extends D {
|
|
|
4368
4368
|
const t = this.getTarget().closest("select");
|
|
4369
4369
|
if (!t)
|
|
4370
4370
|
return;
|
|
4371
|
-
const r =
|
|
4371
|
+
const r = I.get(t);
|
|
4372
4372
|
r instanceof w && r.syncValue();
|
|
4373
4373
|
}
|
|
4374
4374
|
/**
|
|
@@ -4452,7 +4452,7 @@ const w = class w extends D {
|
|
|
4452
4452
|
const i = this.getTarget(), n = i.hasAttribute(e), s = t !== e && i.hasAttribute(t);
|
|
4453
4453
|
if (!n && !s)
|
|
4454
4454
|
return Promise.resolve();
|
|
4455
|
-
const a =
|
|
4455
|
+
const a = K.enqueue(() => {
|
|
4456
4456
|
n && i.removeAttribute(e), s && i.removeAttribute(t);
|
|
4457
4457
|
}).finally(() => {
|
|
4458
4458
|
this.releaseSelfWritingAttributes(r);
|
|
@@ -4485,13 +4485,13 @@ const w = class w extends D {
|
|
|
4485
4485
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
4486
4486
|
const o = new $e(e, r);
|
|
4487
4487
|
if (n) {
|
|
4488
|
-
const
|
|
4489
|
-
if (
|
|
4490
|
-
const
|
|
4488
|
+
const ye = this.attributeMap.get(e);
|
|
4489
|
+
if (ye && (ye.isEvaluate || ye.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
4490
|
+
const Te = K.enqueue(() => {
|
|
4491
4491
|
}).finally(() => {
|
|
4492
4492
|
this.releaseSelfWritingAttributes(s);
|
|
4493
4493
|
});
|
|
4494
|
-
return this.holdSelfWritingAttributes(s,
|
|
4494
|
+
return this.holdSelfWritingAttributes(s, Te), Te;
|
|
4495
4495
|
}
|
|
4496
4496
|
}
|
|
4497
4497
|
this.attributeMap.set(e, o);
|
|
@@ -4500,39 +4500,39 @@ const w = class w extends D {
|
|
|
4500
4500
|
element: c,
|
|
4501
4501
|
rawName: e,
|
|
4502
4502
|
template: r
|
|
4503
|
-
}), d = o.isEvaluate || o.isRawEvaluate, g = e === t && w.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), E =
|
|
4504
|
-
if (
|
|
4503
|
+
}), d = o.isEvaluate || o.isRawEvaluate, g = e === t && w.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), E = ue.joinEvaluateResults(u.results), A = u.results.length === 1 ? u.results[0] : E, D = t === "value" && w.resolveDeclaredValueType(c) === "boolean", N = A === !1 && !D, B = !o.isForceEvaluation() && (t !== e ? u.hasUnresolvedReference || A === null || A === void 0 || N : g ? u.hasUnresolvedReference || A === null || A === void 0 || A === !1 : y ? u.hasUnresolvedReference || A === null || A === void 0 || N : d && E === "");
|
|
4504
|
+
if (B && u.hasUnresolvedReference && w.warnUnresolvedAttribute(
|
|
4505
4505
|
e,
|
|
4506
4506
|
t,
|
|
4507
4507
|
r,
|
|
4508
4508
|
c
|
|
4509
|
-
),
|
|
4510
|
-
const
|
|
4511
|
-
|
|
4509
|
+
), q.isEnabled() && A === !1 && y) {
|
|
4510
|
+
const ye = o.getSingleExpression(), Te = ye === null ? null : ie.diagnoseStrictComparison(
|
|
4511
|
+
ye,
|
|
4512
4512
|
this.getBindingData()
|
|
4513
4513
|
);
|
|
4514
|
-
|
|
4514
|
+
Te !== null && w.warnTypeMismatchedComparison(
|
|
4515
4515
|
e,
|
|
4516
4516
|
r,
|
|
4517
|
-
|
|
4517
|
+
Te,
|
|
4518
4518
|
c
|
|
4519
4519
|
);
|
|
4520
4520
|
}
|
|
4521
|
-
const
|
|
4522
|
-
if (!
|
|
4521
|
+
const F = o.isForceEvaluation() ? r : y ? A : E, j = i && o.isEvaluate && t === "value" && w.isValuePropertyTarget(c), J = c.getRootNode(), _ = j && w.isUserEditableValue(c) && (c === J.activeElement || this.hasPendingUserEdit()), P = B || F === null || F === !1 && !D ? null : String(F), se = e !== t && c.getAttribute(e) !== r, G = P === null ? c.hasAttribute(t) : c.getAttribute(t) !== P, T = P === null ? "" : P, L = j && !_ && c.value !== T, Y = t === "checked" && c instanceof HTMLInputElement && (c.type === "checkbox" || c.type === "radio"), Q = t === "selected" && c instanceof HTMLOptionElement, de = J.activeElement, oe = de !== null && (Y && c === de || Q && c.closest("select") === de) || (Y || Q) && this.hasPendingCheckableUserEdit(Q), W = P !== null, z = Y && o.isEvaluate && !oe && c.checked !== W, X = Q && o.isEvaluate && !oe && c.selected !== W;
|
|
4522
|
+
if (!se && !G && !L && !z && !X)
|
|
4523
4523
|
return j && !_ && (this.value = this.normalizeValueForElement(
|
|
4524
4524
|
c,
|
|
4525
4525
|
T
|
|
4526
|
-
), this.clearUnappliedValueWrite()), (Y ||
|
|
4527
|
-
const
|
|
4528
|
-
|
|
4526
|
+
), this.clearUnappliedValueWrite()), (Y || Q) && !oe && this.syncCheckableValueFromDom(Q), Promise.resolve();
|
|
4527
|
+
const Re = K.enqueue(() => {
|
|
4528
|
+
se && c.setAttribute(e, r), P === null ? c.removeAttribute(t) : G && (c.setAttribute(t, P), t === `${l.prefix}bind` && this.recordSelfWrittenBind(P)), t === "style" && this.captureAndHideDisplay(), j && !_ && (this.value = this.normalizeValueForElement(
|
|
4529
4529
|
c,
|
|
4530
4530
|
T
|
|
4531
|
-
), L && (c.value = T), this.recordValueWriteResult(c.value === T)),
|
|
4531
|
+
), L && (c.value = T), this.recordValueWriteResult(c.value === T)), z && (c.checked = W), X && (c.selected = W), (z || X) && this.syncCheckableValueFromDom(X);
|
|
4532
4532
|
}).finally(() => {
|
|
4533
4533
|
this.releaseSelfWritingAttributes(s);
|
|
4534
4534
|
});
|
|
4535
|
-
return this.holdSelfWritingAttributes(s,
|
|
4535
|
+
return this.holdSelfWritingAttributes(s, Re), Re;
|
|
4536
4536
|
}
|
|
4537
4537
|
/**
|
|
4538
4538
|
* 属性の値を削除します。
|
|
@@ -4551,7 +4551,7 @@ const w = class w extends D {
|
|
|
4551
4551
|
const t = this.getTarget();
|
|
4552
4552
|
if (!t.hasAttribute(e))
|
|
4553
4553
|
return Promise.resolve();
|
|
4554
|
-
const r =
|
|
4554
|
+
const r = K.enqueue(() => {
|
|
4555
4555
|
t.removeAttribute(e);
|
|
4556
4556
|
}).finally(() => {
|
|
4557
4557
|
this.releaseSelfWritingAttributes([e]);
|
|
@@ -4588,7 +4588,7 @@ const w = class w extends D {
|
|
|
4588
4588
|
value: r.results[0],
|
|
4589
4589
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
4590
4590
|
} : {
|
|
4591
|
-
value:
|
|
4591
|
+
value: ue.joinEvaluateResults(r.results),
|
|
4592
4592
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
4593
4593
|
};
|
|
4594
4594
|
}
|
|
@@ -4633,7 +4633,7 @@ const w = class w extends D {
|
|
|
4633
4633
|
const i = t ? r.nextSibling : r;
|
|
4634
4634
|
let n = t ? r.nextSibling : r;
|
|
4635
4635
|
for (; n !== null; ) {
|
|
4636
|
-
const s =
|
|
4636
|
+
const s = I.get(n);
|
|
4637
4637
|
if (s !== null) {
|
|
4638
4638
|
const a = this.children.indexOf(s);
|
|
4639
4639
|
if (a !== -1)
|
|
@@ -4687,7 +4687,7 @@ const w = class w extends D {
|
|
|
4687
4687
|
}
|
|
4688
4688
|
e.setParent(this), e.setMounted(this.mounted);
|
|
4689
4689
|
const d = this.skipMutationNodes;
|
|
4690
|
-
return this.skipMutationNodes = !0, this.holdSkipMutationNode(e.getTarget()),
|
|
4690
|
+
return this.skipMutationNodes = !0, this.holdSkipMutationNode(e.getTarget()), K.enqueue(() => {
|
|
4691
4691
|
this.target.insertBefore(e.getTarget(), u);
|
|
4692
4692
|
}).finally(() => {
|
|
4693
4693
|
this.skipMutationNodes = d, this.releaseSkipMutationNode(e.getTarget());
|
|
@@ -4822,7 +4822,7 @@ const w = class w extends D {
|
|
|
4822
4822
|
* @returns 戻り値はありません。
|
|
4823
4823
|
*/
|
|
4824
4824
|
static reassertHiddenDisplay(e) {
|
|
4825
|
-
const t =
|
|
4825
|
+
const t = I.get(e);
|
|
4826
4826
|
t instanceof w && t.hideDisplayWithoutCapture();
|
|
4827
4827
|
}
|
|
4828
4828
|
/**
|
|
@@ -4849,10 +4849,10 @@ const w = class w extends D {
|
|
|
4849
4849
|
* @returns 戻り値はありません。
|
|
4850
4850
|
*/
|
|
4851
4851
|
static forEachFormControlInBranch(e, t) {
|
|
4852
|
-
e.matches(
|
|
4852
|
+
e.matches(Ge) && t(e);
|
|
4853
4853
|
const r = (i) => {
|
|
4854
4854
|
Array.from(i.children).forEach((n) => {
|
|
4855
|
-
n.hasAttribute(`${l.prefix}if-false`) || (n instanceof HTMLElement && n.matches(
|
|
4855
|
+
n.hasAttribute(`${l.prefix}if-false`) || (n instanceof HTMLElement && n.matches(Ge) && t(n), r(n));
|
|
4856
4856
|
});
|
|
4857
4857
|
};
|
|
4858
4858
|
r(e);
|
|
@@ -4874,7 +4874,7 @@ const w = class w extends D {
|
|
|
4874
4874
|
*/
|
|
4875
4875
|
static disableFormControlsInBranch(e) {
|
|
4876
4876
|
w.forEachFormControlInBranch(e, (t) => {
|
|
4877
|
-
t.hasAttribute("disabled") || (t.setAttribute(
|
|
4877
|
+
t.hasAttribute("disabled") || (t.setAttribute(he, ""), t.setAttribute("disabled", ""));
|
|
4878
4878
|
});
|
|
4879
4879
|
}
|
|
4880
4880
|
/**
|
|
@@ -4888,7 +4888,7 @@ const w = class w extends D {
|
|
|
4888
4888
|
*/
|
|
4889
4889
|
restoreFormControlsDisabledByIf() {
|
|
4890
4890
|
w.forEachFormControlInBranch(this.getTarget(), (e) => {
|
|
4891
|
-
e.hasAttribute(
|
|
4891
|
+
e.hasAttribute(he) && (e.removeAttribute(he), e.removeAttribute("disabled"));
|
|
4892
4892
|
});
|
|
4893
4893
|
}
|
|
4894
4894
|
/**
|
|
@@ -4965,7 +4965,7 @@ w.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, w.VALUE
|
|
|
4965
4965
|
"week"
|
|
4966
4966
|
], w.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), w.sequenceCounter = 0, w.bindingWorkActiveCount = 0, w.pendingMutationFlusher = null, w.loggedUnresolvedAttributes = /* @__PURE__ */ new Set(), w.loggedTypeMismatchedComparisons = /* @__PURE__ */ new Set();
|
|
4967
4967
|
let S = w;
|
|
4968
|
-
class
|
|
4968
|
+
class ne extends I {
|
|
4969
4969
|
/**
|
|
4970
4970
|
* テキストフラグメントのコンストラクタ。
|
|
4971
4971
|
* 対象テキストノードの内容を初期化します。
|
|
@@ -4973,7 +4973,7 @@ class se extends D {
|
|
|
4973
4973
|
* @param target 対象テキストノード
|
|
4974
4974
|
*/
|
|
4975
4975
|
constructor(e) {
|
|
4976
|
-
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new
|
|
4976
|
+
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new ue(this.text);
|
|
4977
4977
|
}
|
|
4978
4978
|
/**
|
|
4979
4979
|
* フラグメントをクローンします。
|
|
@@ -4981,7 +4981,7 @@ class se extends D {
|
|
|
4981
4981
|
* @returns クローンされたフラグメント
|
|
4982
4982
|
*/
|
|
4983
4983
|
clone() {
|
|
4984
|
-
const e = new
|
|
4984
|
+
const e = new ne(this.target.cloneNode(!0));
|
|
4985
4985
|
return e.mounted = !1, e.text = this.text, e.contents = this.contents, e.renderedText = this.renderedText, e;
|
|
4986
4986
|
}
|
|
4987
4987
|
/**
|
|
@@ -5018,7 +5018,7 @@ class se extends D {
|
|
|
5018
5018
|
* @returns 更新のPromise
|
|
5019
5019
|
*/
|
|
5020
5020
|
setContent(e) {
|
|
5021
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new
|
|
5021
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new ue(e), this.evaluate());
|
|
5022
5022
|
}
|
|
5023
5023
|
/**
|
|
5024
5024
|
* フラグメントを評価します。
|
|
@@ -5028,7 +5028,7 @@ class se extends D {
|
|
|
5028
5028
|
evaluate() {
|
|
5029
5029
|
return this.contents.isRawEvaluate && this.parent === null ? Promise.reject(
|
|
5030
5030
|
new Error("Parent fragment is required for raw evaluation")
|
|
5031
|
-
) :
|
|
5031
|
+
) : K.enqueue(() => {
|
|
5032
5032
|
this.skipMutation = !0;
|
|
5033
5033
|
let e = this.text;
|
|
5034
5034
|
this.contents.isRawEvaluate ? e = this.contents.evaluate(this.parent.getBindingData(), {
|
|
@@ -5036,7 +5036,7 @@ class se extends D {
|
|
|
5036
5036
|
element: this.parent.getTarget(),
|
|
5037
5037
|
childIndex: this.parent.getChildren().indexOf(this),
|
|
5038
5038
|
template: this.text
|
|
5039
|
-
})[0] : this.contents.isEvaluate && (e =
|
|
5039
|
+
})[0] : this.contents.isEvaluate && (e = ue.joinEvaluateResults(
|
|
5040
5040
|
this.contents.evaluate(this.parent.getBindingData(), {
|
|
5041
5041
|
kind: "text",
|
|
5042
5042
|
element: this.parent.getTarget(),
|
|
@@ -5051,7 +5051,7 @@ class se extends D {
|
|
|
5051
5051
|
});
|
|
5052
5052
|
}
|
|
5053
5053
|
}
|
|
5054
|
-
class We extends
|
|
5054
|
+
class We extends I {
|
|
5055
5055
|
/**
|
|
5056
5056
|
* コメントフラグメントのコンストラクタ。
|
|
5057
5057
|
* 対象コメントノードの内容を初期化します。
|
|
@@ -5085,14 +5085,14 @@ class We extends D {
|
|
|
5085
5085
|
* @return 更新のPromise
|
|
5086
5086
|
*/
|
|
5087
5087
|
setContent(e) {
|
|
5088
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e,
|
|
5088
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, K.enqueue(() => {
|
|
5089
5089
|
this.skipMutation = !0, this.target.textContent = this.text;
|
|
5090
5090
|
}).finally(() => {
|
|
5091
5091
|
this.skipMutation = !1;
|
|
5092
5092
|
}));
|
|
5093
5093
|
}
|
|
5094
5094
|
}
|
|
5095
|
-
const
|
|
5095
|
+
const Ce = class Ce {
|
|
5096
5096
|
/**
|
|
5097
5097
|
* コンストラクタ。
|
|
5098
5098
|
*
|
|
@@ -5100,7 +5100,7 @@ const Me = class Me {
|
|
|
5100
5100
|
*/
|
|
5101
5101
|
constructor(e) {
|
|
5102
5102
|
this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = e;
|
|
5103
|
-
const t = [...e.matchAll(
|
|
5103
|
+
const t = [...e.matchAll(Ce.PLACEHOLDER_REGEX)];
|
|
5104
5104
|
let r = 0, i = !1, n = !1;
|
|
5105
5105
|
for (const s of t) {
|
|
5106
5106
|
s.index > r && this.contents.push({
|
|
@@ -5205,8 +5205,8 @@ const Me = class Me {
|
|
|
5205
5205
|
return this.contents.forEach((c) => {
|
|
5206
5206
|
try {
|
|
5207
5207
|
if (r(c)) {
|
|
5208
|
-
const u =
|
|
5209
|
-
() =>
|
|
5208
|
+
const u = Me.measure(
|
|
5209
|
+
() => ie.evaluateDetailed(c.text, e)
|
|
5210
5210
|
), d = u.value;
|
|
5211
5211
|
a += u.durationMs, s.push({
|
|
5212
5212
|
expression: c.text,
|
|
@@ -5224,16 +5224,16 @@ const Me = class Me {
|
|
|
5224
5224
|
durationMs: 0
|
|
5225
5225
|
}), n.push("");
|
|
5226
5226
|
}
|
|
5227
|
-
}),
|
|
5227
|
+
}), Me.record(
|
|
5228
5228
|
t,
|
|
5229
5229
|
s,
|
|
5230
5230
|
a
|
|
5231
5231
|
), { results: n, hasUnresolvedReference: o };
|
|
5232
5232
|
}
|
|
5233
5233
|
};
|
|
5234
|
-
|
|
5235
|
-
let
|
|
5236
|
-
const
|
|
5234
|
+
Ce.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
5235
|
+
let ue = Ce;
|
|
5236
|
+
const re = class re extends ue {
|
|
5237
5237
|
/**
|
|
5238
5238
|
* コンストラクタ。
|
|
5239
5239
|
*
|
|
@@ -5241,7 +5241,7 @@ const ie = class ie extends fe {
|
|
|
5241
5241
|
* @param text 属性値
|
|
5242
5242
|
*/
|
|
5243
5243
|
constructor(e, t) {
|
|
5244
|
-
super(t), this.forceEvaluation =
|
|
5244
|
+
super(t), this.forceEvaluation = re.needsForceEvaluation(e);
|
|
5245
5245
|
}
|
|
5246
5246
|
/**
|
|
5247
5247
|
* 属性名が強制評価の対象かどうかを判定します。
|
|
@@ -5254,17 +5254,17 @@ const ie = class ie extends fe {
|
|
|
5254
5254
|
* @returns 強制評価の対象なら true
|
|
5255
5255
|
*/
|
|
5256
5256
|
static needsForceEvaluation(e) {
|
|
5257
|
-
if (
|
|
5257
|
+
if (re.forceEvaluationNames === null || re.forceEvaluationPrefix !== l.prefix) {
|
|
5258
5258
|
const t = /* @__PURE__ */ new Set();
|
|
5259
5259
|
for (const r of [
|
|
5260
5260
|
l.prefix,
|
|
5261
|
-
...
|
|
5261
|
+
...re.FORCE_EVALUATION_PREFIXES
|
|
5262
5262
|
])
|
|
5263
|
-
for (const i of
|
|
5263
|
+
for (const i of re.FORCE_EVALUATION_SUFFIXES)
|
|
5264
5264
|
t.add(`${r}${i}`);
|
|
5265
|
-
|
|
5265
|
+
re.forceEvaluationNames = t, re.forceEvaluationPrefix = l.prefix;
|
|
5266
5266
|
}
|
|
5267
|
-
return
|
|
5267
|
+
return re.forceEvaluationNames.has(e);
|
|
5268
5268
|
}
|
|
5269
5269
|
/**
|
|
5270
5270
|
* 強制評価フラグを取得します。
|
|
@@ -5311,9 +5311,9 @@ const ie = class ie extends fe {
|
|
|
5311
5311
|
}) : r;
|
|
5312
5312
|
}
|
|
5313
5313
|
};
|
|
5314
|
-
|
|
5315
|
-
let $e =
|
|
5316
|
-
const
|
|
5314
|
+
re.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], re.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], re.forceEvaluationNames = null, re.forceEvaluationPrefix = null;
|
|
5315
|
+
let $e = re;
|
|
5316
|
+
const ve = class ve {
|
|
5317
5317
|
/**
|
|
5318
5318
|
* 実行モードを取得します。
|
|
5319
5319
|
*
|
|
@@ -5343,7 +5343,7 @@ const Se = class Se {
|
|
|
5343
5343
|
* @return すべてのレンダリングが完了したら解決される Promise
|
|
5344
5344
|
*/
|
|
5345
5345
|
static waitForRenders() {
|
|
5346
|
-
return
|
|
5346
|
+
return K.waitForIdle();
|
|
5347
5347
|
}
|
|
5348
5348
|
/**
|
|
5349
5349
|
* 通知ダイアログを表示します。
|
|
@@ -5352,7 +5352,7 @@ const Se = class Se {
|
|
|
5352
5352
|
* @returns 通知が閉じられると解決されるPromise
|
|
5353
5353
|
*/
|
|
5354
5354
|
static dialog(e) {
|
|
5355
|
-
return
|
|
5355
|
+
return K.enqueue(() => {
|
|
5356
5356
|
window.alert(e);
|
|
5357
5357
|
}, !0);
|
|
5358
5358
|
}
|
|
@@ -5380,7 +5380,7 @@ const Se = class Se {
|
|
|
5380
5380
|
* @returns ユーザーがOKをクリックした場合はtrue、キャンセルした場合はfalseが解決されるPromise
|
|
5381
5381
|
*/
|
|
5382
5382
|
static confirm(e) {
|
|
5383
|
-
return
|
|
5383
|
+
return K.enqueue(() => window.confirm(e), !0);
|
|
5384
5384
|
}
|
|
5385
5385
|
/**
|
|
5386
5386
|
* ダイアログを開きます。
|
|
@@ -5388,8 +5388,8 @@ const Se = class Se {
|
|
|
5388
5388
|
* @param element 開くダイアログのHTML要素
|
|
5389
5389
|
*/
|
|
5390
5390
|
static openDialog(e) {
|
|
5391
|
-
return
|
|
5392
|
-
e instanceof HTMLDialogElement ? (
|
|
5391
|
+
return K.enqueue(() => {
|
|
5392
|
+
e instanceof HTMLDialogElement ? (ve.clearMessagesSync(e), e.showModal()) : m.error("[Haori]", "Element is not a dialog: ", e);
|
|
5393
5393
|
}, !0);
|
|
5394
5394
|
}
|
|
5395
5395
|
/**
|
|
@@ -5398,7 +5398,7 @@ const Se = class Se {
|
|
|
5398
5398
|
* @param element 閉じるダイアログのHTML要素
|
|
5399
5399
|
*/
|
|
5400
5400
|
static closeDialog(e) {
|
|
5401
|
-
return
|
|
5401
|
+
return K.enqueue(() => {
|
|
5402
5402
|
e instanceof HTMLDialogElement ? e.close() : m.error("[Haori]", "Element is not a dialog: ", e);
|
|
5403
5403
|
}, !0);
|
|
5404
5404
|
}
|
|
@@ -5409,7 +5409,7 @@ const Se = class Se {
|
|
|
5409
5409
|
* @param message エラーメッセージ
|
|
5410
5410
|
*/
|
|
5411
5411
|
static addErrorMessage(e, t) {
|
|
5412
|
-
return
|
|
5412
|
+
return ve.addMessage(e, t, "error");
|
|
5413
5413
|
}
|
|
5414
5414
|
/**
|
|
5415
5415
|
* メッセージをレベル付きで追加します。
|
|
@@ -5419,7 +5419,7 @@ const Se = class Se {
|
|
|
5419
5419
|
* @param level メッセージのレベル(省略可能)
|
|
5420
5420
|
*/
|
|
5421
5421
|
static addMessage(e, t, r) {
|
|
5422
|
-
return
|
|
5422
|
+
return K.enqueue(() => {
|
|
5423
5423
|
const i = e instanceof HTMLFormElement ? e : e.parentElement ?? e;
|
|
5424
5424
|
i.setAttribute("data-message", t), r !== void 0 ? i.setAttribute("data-message-level", r) : i.removeAttribute("data-message-level");
|
|
5425
5425
|
}, !0);
|
|
@@ -5430,8 +5430,8 @@ const Se = class Se {
|
|
|
5430
5430
|
* @param parent メッセージをクリアする親要素
|
|
5431
5431
|
*/
|
|
5432
5432
|
static clearMessages(e) {
|
|
5433
|
-
return
|
|
5434
|
-
|
|
5433
|
+
return K.enqueue(() => {
|
|
5434
|
+
ve.clearMessagesSync(e);
|
|
5435
5435
|
}, !0);
|
|
5436
5436
|
}
|
|
5437
5437
|
/**
|
|
@@ -5471,7 +5471,7 @@ const Se = class Se {
|
|
|
5471
5471
|
* @returns 整形済みの現在日時文字列
|
|
5472
5472
|
*/
|
|
5473
5473
|
static now(e, t) {
|
|
5474
|
-
return
|
|
5474
|
+
return rt(e, t);
|
|
5475
5475
|
}
|
|
5476
5476
|
/**
|
|
5477
5477
|
* 現在日付に日数を加減した日付を指定フォーマットの文字列へ整形します。
|
|
@@ -5485,7 +5485,7 @@ const Se = class Se {
|
|
|
5485
5485
|
* @returns 整形済みの日付文字列。timeZone が不正な場合は空文字
|
|
5486
5486
|
*/
|
|
5487
5487
|
static today(e, t, r) {
|
|
5488
|
-
return
|
|
5488
|
+
return it(e, t, r);
|
|
5489
5489
|
}
|
|
5490
5490
|
/**
|
|
5491
5491
|
* 数値を桁区切り・小数桁付きの文字列へ整形します。
|
|
@@ -5497,7 +5497,7 @@ const Se = class Se {
|
|
|
5497
5497
|
* @returns 整形済み文字列。整形できない場合は空文字
|
|
5498
5498
|
*/
|
|
5499
5499
|
static number(e, t) {
|
|
5500
|
-
return
|
|
5500
|
+
return nt(e, t);
|
|
5501
5501
|
}
|
|
5502
5502
|
/**
|
|
5503
5503
|
* 整数の配列を生成します(終端は排他)。
|
|
@@ -5510,7 +5510,7 @@ const Se = class Se {
|
|
|
5510
5510
|
* @returns 整数配列
|
|
5511
5511
|
*/
|
|
5512
5512
|
static range(e, t, r) {
|
|
5513
|
-
return
|
|
5513
|
+
return st(e, t, r);
|
|
5514
5514
|
}
|
|
5515
5515
|
/**
|
|
5516
5516
|
* 番号ページネーション用の表示要素列を生成します。
|
|
@@ -5523,7 +5523,7 @@ const Se = class Se {
|
|
|
5523
5523
|
* @returns 表示要素の配列
|
|
5524
5524
|
*/
|
|
5525
5525
|
static pages(e, t, r) {
|
|
5526
|
-
return
|
|
5526
|
+
return at(e, t, r);
|
|
5527
5527
|
}
|
|
5528
5528
|
/**
|
|
5529
5529
|
* `YYYY-MM` 形式の年月文字列に月数を加算します。
|
|
@@ -5547,7 +5547,7 @@ const Se = class Se {
|
|
|
5547
5547
|
* @returns 年月情報の降順配列。不正な入力は空配列
|
|
5548
5548
|
*/
|
|
5549
5549
|
static monthRange(e, t) {
|
|
5550
|
-
return
|
|
5550
|
+
return ot(e, t);
|
|
5551
5551
|
}
|
|
5552
5552
|
/**
|
|
5553
5553
|
* ページレスポンスから表示用サマリーを作ります。
|
|
@@ -5559,7 +5559,7 @@ const Se = class Se {
|
|
|
5559
5559
|
* @returns 表示サマリー
|
|
5560
5560
|
*/
|
|
5561
5561
|
static pageSummary(e, t) {
|
|
5562
|
-
return
|
|
5562
|
+
return lt(e, t);
|
|
5563
5563
|
}
|
|
5564
5564
|
/**
|
|
5565
5565
|
* 配列から `item[key]` が指定値に一致する最初の要素を返します。
|
|
@@ -5573,7 +5573,7 @@ const Se = class Se {
|
|
|
5573
5573
|
* @returns 一致した最初の要素。無ければ null
|
|
5574
5574
|
*/
|
|
5575
5575
|
static findBy(e, t, r) {
|
|
5576
|
-
return
|
|
5576
|
+
return ct(e, t, r);
|
|
5577
5577
|
}
|
|
5578
5578
|
/**
|
|
5579
5579
|
* 配列の数値合計を返します。
|
|
@@ -5586,7 +5586,7 @@ const Se = class Se {
|
|
|
5586
5586
|
* @returns 数値の合計。対象が無ければ 0
|
|
5587
5587
|
*/
|
|
5588
5588
|
static sum(e, t) {
|
|
5589
|
-
return
|
|
5589
|
+
return ut(e, t);
|
|
5590
5590
|
}
|
|
5591
5591
|
/**
|
|
5592
5592
|
* 配列から重複を取り除いた新しい配列を返します。
|
|
@@ -5599,7 +5599,7 @@ const Se = class Se {
|
|
|
5599
5599
|
* @returns 重複排除後の新しい配列。非配列は空配列
|
|
5600
5600
|
*/
|
|
5601
5601
|
static distinct(e, t) {
|
|
5602
|
-
return
|
|
5602
|
+
return ft(e, t);
|
|
5603
5603
|
}
|
|
5604
5604
|
/**
|
|
5605
5605
|
* 配列を `item[key]` ごとのグループへ分けて返します。
|
|
@@ -5612,10 +5612,10 @@ const Se = class Se {
|
|
|
5612
5612
|
* @returns グループ情報の配列。非配列は空配列
|
|
5613
5613
|
*/
|
|
5614
5614
|
static groupBy(e, t) {
|
|
5615
|
-
return
|
|
5615
|
+
return ht(e, t);
|
|
5616
5616
|
}
|
|
5617
5617
|
};
|
|
5618
|
-
|
|
5618
|
+
ve.enhancers = {
|
|
5619
5619
|
/**
|
|
5620
5620
|
* 外部ライブラリ連携を登録します。
|
|
5621
5621
|
*
|
|
@@ -5624,7 +5624,7 @@ Se.enhancers = {
|
|
|
5624
5624
|
* @return 戻り値はありません。
|
|
5625
5625
|
*/
|
|
5626
5626
|
register(e, t) {
|
|
5627
|
-
|
|
5627
|
+
te.register(e, t);
|
|
5628
5628
|
},
|
|
5629
5629
|
/**
|
|
5630
5630
|
* 登録済みの連携かどうかを返します。
|
|
@@ -5633,16 +5633,16 @@ Se.enhancers = {
|
|
|
5633
5633
|
* @return 登録済みなら true
|
|
5634
5634
|
*/
|
|
5635
5635
|
has(e) {
|
|
5636
|
-
return
|
|
5636
|
+
return te.has(e);
|
|
5637
5637
|
}
|
|
5638
5638
|
};
|
|
5639
|
-
let
|
|
5640
|
-
const
|
|
5641
|
-
function
|
|
5639
|
+
let Se = ve;
|
|
5640
|
+
const Dt = "入力内容を確認してください", Ft = ["addErrorMessage", "clearMessages"], Ye = "data-haori-group-name";
|
|
5641
|
+
function Xe() {
|
|
5642
5642
|
const e = globalThis.window?.Haori;
|
|
5643
|
-
return
|
|
5643
|
+
return Ft.every(
|
|
5644
5644
|
(r) => typeof e?.[r] == "function"
|
|
5645
|
-
) ? e :
|
|
5645
|
+
) ? e : Se;
|
|
5646
5646
|
}
|
|
5647
5647
|
const h = class h {
|
|
5648
5648
|
/**
|
|
@@ -5825,13 +5825,13 @@ const h = class h {
|
|
|
5825
5825
|
return;
|
|
5826
5826
|
}
|
|
5827
5827
|
const r = e.getTarget();
|
|
5828
|
-
if (!(r instanceof HTMLInputElement) || r.type !== "radio" || r.hasAttribute("name") && !r.hasAttribute(
|
|
5828
|
+
if (!(r instanceof HTMLInputElement) || r.type !== "radio" || r.hasAttribute("name") && !r.hasAttribute(Ye))
|
|
5829
5829
|
return;
|
|
5830
5830
|
const i = h.resolveGroupScope(e), n = `${String(t)}--haori${h.resolveGroupScopeId(
|
|
5831
5831
|
i
|
|
5832
5832
|
)}`;
|
|
5833
5833
|
if (r.getAttribute("name") !== n)
|
|
5834
|
-
return e.setAttribute(
|
|
5834
|
+
return e.setAttribute(Ye, "").then(() => e.setAttribute("name", n));
|
|
5835
5835
|
}
|
|
5836
5836
|
/**
|
|
5837
5837
|
* ラジオグループのスコープとなるフラグメントを解決します。
|
|
@@ -5889,7 +5889,7 @@ const h = class h {
|
|
|
5889
5889
|
return h.isDeclarationResolved(e, "value");
|
|
5890
5890
|
if (t instanceof HTMLSelectElement) {
|
|
5891
5891
|
for (const r of Array.from(t.options)) {
|
|
5892
|
-
const i =
|
|
5892
|
+
const i = I.get(r);
|
|
5893
5893
|
if (i instanceof S && h.hasDeclarativeBinding(i, "selected") && !h.isDeclarationResolved(i, "selected"))
|
|
5894
5894
|
return !1;
|
|
5895
5895
|
}
|
|
@@ -6019,7 +6019,7 @@ const h = class h {
|
|
|
6019
6019
|
*/
|
|
6020
6020
|
static hasDeclarativeSelectedOption(e) {
|
|
6021
6021
|
for (const t of Array.from(e.options)) {
|
|
6022
|
-
const r =
|
|
6022
|
+
const r = I.get(t);
|
|
6023
6023
|
if (r instanceof S && h.hasDeclarativeBinding(r, "selected"))
|
|
6024
6024
|
return !0;
|
|
6025
6025
|
}
|
|
@@ -6427,7 +6427,7 @@ const h = class h {
|
|
|
6427
6427
|
* @param value 祖先が所有している値
|
|
6428
6428
|
*/
|
|
6429
6429
|
static warnArgOwnerIsNotRecord(e, t, r) {
|
|
6430
|
-
if (!
|
|
6430
|
+
if (!q.isEnabled() || r == null)
|
|
6431
6431
|
return;
|
|
6432
6432
|
const i = e.getTarget(), n = h.warnedArgOwnerNotRecord.get(i);
|
|
6433
6433
|
n?.has(t) || (n ? n.add(t) : h.warnedArgOwnerNotRecord.set(i, /* @__PURE__ */ new Set([t])), m.warn(
|
|
@@ -6593,7 +6593,7 @@ const h = class h {
|
|
|
6593
6593
|
r.setCustomValidity("");
|
|
6594
6594
|
return;
|
|
6595
6595
|
}
|
|
6596
|
-
const n = h.buildConditionScope(e), s =
|
|
6596
|
+
const n = h.buildConditionScope(e), s = ie.evaluateDetailed(
|
|
6597
6597
|
h.unwrapConditionExpression(i),
|
|
6598
6598
|
n
|
|
6599
6599
|
);
|
|
@@ -6616,7 +6616,7 @@ const h = class h {
|
|
|
6616
6616
|
*/
|
|
6617
6617
|
static resolveValidityMessage(e) {
|
|
6618
6618
|
const t = e.getAttribute(`${l.prefix}validity-message`);
|
|
6619
|
-
return typeof t == "string" && t.trim() !== "" ? t :
|
|
6619
|
+
return typeof t == "string" && t.trim() !== "" ? t : Dt;
|
|
6620
6620
|
}
|
|
6621
6621
|
/**
|
|
6622
6622
|
* 条件属性の値から式を取り出します。
|
|
@@ -6641,7 +6641,7 @@ const h = class h {
|
|
|
6641
6641
|
* @returns 戻り値はありません。
|
|
6642
6642
|
*/
|
|
6643
6643
|
static warnUnvalidatedCustomValidity(e, t) {
|
|
6644
|
-
if (!
|
|
6644
|
+
if (!q.isEnabled() || !e)
|
|
6645
6645
|
return;
|
|
6646
6646
|
const r = `${l.prefix}validity`;
|
|
6647
6647
|
(e.hasAttribute(r) || e.getTarget().querySelector(`[${r}]`) !== null) && m.warn(
|
|
@@ -6704,7 +6704,7 @@ const h = class h {
|
|
|
6704
6704
|
* @param reason 退いた理由
|
|
6705
6705
|
*/
|
|
6706
6706
|
static warnPositionalRowFallback(e) {
|
|
6707
|
-
!
|
|
6707
|
+
!q.isEnabled() || h.warnedPositionalRowFallbacks.has(e) || (h.warnedPositionalRowFallbacks.add(e), m.warn(
|
|
6708
6708
|
"[Haori]",
|
|
6709
6709
|
`${l.prefix}form-list の行を出現順で対応付けます(${e})。配列と画面の行数・並びが一致していない場合、行の値を取り違えます。`
|
|
6710
6710
|
));
|
|
@@ -6724,7 +6724,7 @@ const h = class h {
|
|
|
6724
6724
|
* @param container `data-form-list` を持つコンテナのフラグメント
|
|
6725
6725
|
*/
|
|
6726
6726
|
static warnDerivedRowsWithoutKey(e) {
|
|
6727
|
-
if (!
|
|
6727
|
+
if (!q.isEnabled() || e.getRawAttribute(`${l.prefix}each-key`) !== null)
|
|
6728
6728
|
return;
|
|
6729
6729
|
const t = e.getRawAttribute(`${l.prefix}each`);
|
|
6730
6730
|
t === null || h.resolveLeadingPath(t) !== null || h.warnedDerivedRowsWithoutKey.has(t) || (h.warnedDerivedRowsWithoutKey.add(t), m.warn(
|
|
@@ -7032,7 +7032,7 @@ const h = class h {
|
|
|
7032
7032
|
static collectShadowingContainers(e) {
|
|
7033
7033
|
const t = `${l.prefix}form-arg`, r = [];
|
|
7034
7034
|
return e.getTarget().querySelectorAll(`form:not([${t}]), [${l.prefix}form]`).forEach((i) => {
|
|
7035
|
-
const n =
|
|
7035
|
+
const n = I.get(i);
|
|
7036
7036
|
if (!(n instanceof S))
|
|
7037
7037
|
return;
|
|
7038
7038
|
const s = n.getRawBindingData();
|
|
@@ -7075,7 +7075,7 @@ const h = class h {
|
|
|
7075
7075
|
static collectArgForms(e) {
|
|
7076
7076
|
const t = `${l.prefix}form-arg`, r = e.getTarget().querySelectorAll(`form[${t}]`), i = [];
|
|
7077
7077
|
return r.forEach((n) => {
|
|
7078
|
-
const s =
|
|
7078
|
+
const s = I.get(n);
|
|
7079
7079
|
if (!(s instanceof S))
|
|
7080
7080
|
return;
|
|
7081
7081
|
const a = s.getAttribute(t);
|
|
@@ -7148,7 +7148,7 @@ const h = class h {
|
|
|
7148
7148
|
for (const i of t) {
|
|
7149
7149
|
if (h.INITIAL_RESTORED_FORMS.has(i))
|
|
7150
7150
|
continue;
|
|
7151
|
-
const n =
|
|
7151
|
+
const n = I.get(i);
|
|
7152
7152
|
if (!(n instanceof S))
|
|
7153
7153
|
continue;
|
|
7154
7154
|
const s = n.getRawBindingData(), a = n.getAttribute(`${l.prefix}form-arg`), o = a ? String(a) : null, c = o !== null && !(s && Object.prototype.hasOwnProperty.call(s, o)) ? h.resolveAncestorArgOwner(n, o) : null;
|
|
@@ -7368,34 +7368,34 @@ const h = class h {
|
|
|
7368
7368
|
const c = h.resolveFieldName(e), u = e.getAttribute(`${l.prefix}form-object`), d = e.getAttribute(`${l.prefix}form-list`), g = e.hasAttribute(`${l.prefix}form-list`);
|
|
7369
7369
|
if (c) {
|
|
7370
7370
|
const y = t[String(c)], E = n && h.hasResolvedDeclarativeState(e), A = n && typeof y > "u" && !h.isDeclarativeStateBound(e);
|
|
7371
|
-
let
|
|
7372
|
-
if (E ?
|
|
7373
|
-
return (
|
|
7371
|
+
let D = y;
|
|
7372
|
+
if (E ? D = void 0 : A && (D = null), h.isFileInput(e))
|
|
7373
|
+
return (D === null || D === "") && o.push(
|
|
7374
7374
|
h.applyFragmentValue(e, null, i, a)
|
|
7375
7375
|
), Promise.all(o).then(() => {
|
|
7376
7376
|
});
|
|
7377
|
-
if (g && Array.isArray(
|
|
7377
|
+
if (g && Array.isArray(D) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
7378
7378
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
7379
7379
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
7380
7380
|
!h.isGroupedCheckable(e) && !h.isMultipleSelect(e)) {
|
|
7381
|
-
const
|
|
7382
|
-
s.set(
|
|
7381
|
+
const N = String(c), B = s.get(N) ?? 0;
|
|
7382
|
+
s.set(N, B + 1), o.push(
|
|
7383
7383
|
h.applyFragmentValue(
|
|
7384
7384
|
e,
|
|
7385
|
-
|
|
7385
|
+
D[B] ?? null,
|
|
7386
7386
|
i,
|
|
7387
7387
|
a
|
|
7388
7388
|
)
|
|
7389
7389
|
);
|
|
7390
|
-
} else typeof
|
|
7390
|
+
} else typeof D > "u" || (Array.isArray(D) && h.isGroupedCheckable(e) || Array.isArray(D) && h.isMultipleSelect(e) || typeof D == "string" || typeof D == "number" || typeof D == "boolean" || D === null ? o.push(
|
|
7391
7391
|
h.applyFragmentValue(
|
|
7392
7392
|
e,
|
|
7393
|
-
|
|
7393
|
+
D,
|
|
7394
7394
|
i,
|
|
7395
7395
|
a
|
|
7396
7396
|
)
|
|
7397
7397
|
) : o.push(
|
|
7398
|
-
h.applyFragmentValue(e, String(
|
|
7398
|
+
h.applyFragmentValue(e, String(D), i, a)
|
|
7399
7399
|
));
|
|
7400
7400
|
} else if (u) {
|
|
7401
7401
|
const y = t[String(u)];
|
|
@@ -7417,18 +7417,18 @@ const h = class h {
|
|
|
7417
7417
|
} else if (d) {
|
|
7418
7418
|
const y = t[String(d)];
|
|
7419
7419
|
if (Array.isArray(y)) {
|
|
7420
|
-
const E = e.getChildElementFragments(), A = e.getAttribute(`${l.prefix}each-key`),
|
|
7420
|
+
const E = e.getChildElementFragments(), A = e.getAttribute(`${l.prefix}each-key`), D = h.isCollectedListFromEachSource(e) ? h.pairRowsWithItems(
|
|
7421
7421
|
E,
|
|
7422
7422
|
y,
|
|
7423
7423
|
A == null ? null : String(A)
|
|
7424
7424
|
) : null;
|
|
7425
|
-
for (let
|
|
7426
|
-
const
|
|
7425
|
+
for (let N = 0; N < E.length; N++) {
|
|
7426
|
+
const B = E[N], F = D ? D[N] : y.length > N ? y[N] : null;
|
|
7427
7427
|
o.push(
|
|
7428
7428
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
7429
7429
|
h.setPartValues(
|
|
7430
|
-
|
|
7431
|
-
h.asPlainRecord(
|
|
7430
|
+
B,
|
|
7431
|
+
h.asPlainRecord(F) ?? {},
|
|
7432
7432
|
r,
|
|
7433
7433
|
i,
|
|
7434
7434
|
n,
|
|
@@ -7476,7 +7476,7 @@ const h = class h {
|
|
|
7476
7476
|
h.markResetSubtree(e, t), $.clearUserEditMarks(e, t), h.clearValues(e), await Promise.all([
|
|
7477
7477
|
h.clearMessages(e),
|
|
7478
7478
|
h.clearEachClones(e)
|
|
7479
|
-
]), await
|
|
7479
|
+
]), await K.enqueue(() => {
|
|
7480
7480
|
const n = h.collectEditsAfter(
|
|
7481
7481
|
e,
|
|
7482
7482
|
t
|
|
@@ -7520,7 +7520,7 @@ const h = class h {
|
|
|
7520
7520
|
sequence: t
|
|
7521
7521
|
});
|
|
7522
7522
|
}
|
|
7523
|
-
|
|
7523
|
+
te.refreshSubtree(e.getTarget());
|
|
7524
7524
|
}
|
|
7525
7525
|
/**
|
|
7526
7526
|
* 祖先が所有するキーを、リセットの書き込み対象から落とします。
|
|
@@ -7571,7 +7571,7 @@ const h = class h {
|
|
|
7571
7571
|
t instanceof HTMLFormElement ? r.push(t) : r.push(...Array.from(t.querySelectorAll("form")));
|
|
7572
7572
|
const i = [];
|
|
7573
7573
|
for (const n of r) {
|
|
7574
|
-
const s =
|
|
7574
|
+
const s = I.get(n);
|
|
7575
7575
|
s instanceof S && i.push(s);
|
|
7576
7576
|
}
|
|
7577
7577
|
return i;
|
|
@@ -7702,7 +7702,7 @@ const h = class h {
|
|
|
7702
7702
|
* @returns Promise(メッセージのクリアが完了したら解決される)
|
|
7703
7703
|
*/
|
|
7704
7704
|
static clearMessages(e) {
|
|
7705
|
-
return
|
|
7705
|
+
return Xe().clearMessages(
|
|
7706
7706
|
e.getTarget()
|
|
7707
7707
|
);
|
|
7708
7708
|
}
|
|
@@ -7729,7 +7729,7 @@ const h = class h {
|
|
|
7729
7729
|
* @return Promise(メッセージの追加が完了したら解決される)
|
|
7730
7730
|
*/
|
|
7731
7731
|
static addMessage(e, t, r, i) {
|
|
7732
|
-
const n = [], s =
|
|
7732
|
+
const n = [], s = Xe(), a = s.addMessage, o = (u) => typeof a == "function" ? a.call(s, u, r, i) : s.addErrorMessage(u, r), c = h.findFragmentsByKey(e, t);
|
|
7733
7733
|
return c.forEach((u) => {
|
|
7734
7734
|
n.push(o(u.getTarget()));
|
|
7735
7735
|
}), c.length === 0 && n.push(o(e.getTarget())), Promise.all(n).then(() => {
|
|
@@ -7807,8 +7807,8 @@ h.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), h.LAST_ANCESTOR_ARG_VA
|
|
|
7807
7807
|
"constructor",
|
|
7808
7808
|
"prototype"
|
|
7809
7809
|
]), h.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), h.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), h.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), h.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), h.warnedDerivedRowsWithoutKey = /* @__PURE__ */ new Set(), h.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
7810
|
-
let
|
|
7811
|
-
class
|
|
7810
|
+
let k = h;
|
|
7811
|
+
class H {
|
|
7812
7812
|
/**
|
|
7813
7813
|
* カスタムイベントを発火します。
|
|
7814
7814
|
*
|
|
@@ -7832,7 +7832,7 @@ class B {
|
|
|
7832
7832
|
* @param version ライブラリバージョン
|
|
7833
7833
|
*/
|
|
7834
7834
|
static ready(e) {
|
|
7835
|
-
|
|
7835
|
+
H.dispatch(document, "ready", { version: e });
|
|
7836
7836
|
}
|
|
7837
7837
|
/**
|
|
7838
7838
|
* importstartイベントを発火します。
|
|
@@ -7841,7 +7841,7 @@ class B {
|
|
|
7841
7841
|
* @param url インポート対象URL
|
|
7842
7842
|
*/
|
|
7843
7843
|
static importStart(e, t) {
|
|
7844
|
-
|
|
7844
|
+
H.dispatch(e, "importstart", {
|
|
7845
7845
|
url: t,
|
|
7846
7846
|
startedAt: performance.now()
|
|
7847
7847
|
});
|
|
@@ -7855,7 +7855,7 @@ class B {
|
|
|
7855
7855
|
* @param startedAt 開始時刻
|
|
7856
7856
|
*/
|
|
7857
7857
|
static importEnd(e, t, r, i) {
|
|
7858
|
-
|
|
7858
|
+
H.dispatch(e, "importend", {
|
|
7859
7859
|
url: t,
|
|
7860
7860
|
bytes: r,
|
|
7861
7861
|
durationMs: performance.now() - i
|
|
@@ -7869,7 +7869,7 @@ class B {
|
|
|
7869
7869
|
* @param error エラー内容
|
|
7870
7870
|
*/
|
|
7871
7871
|
static importError(e, t, r) {
|
|
7872
|
-
|
|
7872
|
+
H.dispatch(e, "importerror", { url: t, error: r });
|
|
7873
7873
|
}
|
|
7874
7874
|
/**
|
|
7875
7875
|
* bindchangeイベントを発火します。
|
|
@@ -7885,7 +7885,7 @@ class B {
|
|
|
7885
7885
|
const u = t?.[c], d = r[c];
|
|
7886
7886
|
u !== d && n.push(c);
|
|
7887
7887
|
}
|
|
7888
|
-
|
|
7888
|
+
H.dispatch(e, "bindchange", {
|
|
7889
7889
|
previous: t || {},
|
|
7890
7890
|
next: r,
|
|
7891
7891
|
changedKeys: n,
|
|
@@ -7904,7 +7904,7 @@ class B {
|
|
|
7904
7904
|
* @param reason 変更理由
|
|
7905
7905
|
*/
|
|
7906
7906
|
static bindComplete(e, t = null, r = "other") {
|
|
7907
|
-
|
|
7907
|
+
H.dispatch(e, "bindcomplete", { bindArg: t, reason: r });
|
|
7908
7908
|
}
|
|
7909
7909
|
/**
|
|
7910
7910
|
* eachupdateイベントを発火します。
|
|
@@ -7915,7 +7915,7 @@ class B {
|
|
|
7915
7915
|
* @param order 現在の順序
|
|
7916
7916
|
*/
|
|
7917
7917
|
static eachUpdate(e, t, r, i) {
|
|
7918
|
-
|
|
7918
|
+
H.dispatch(e, "eachupdate", {
|
|
7919
7919
|
added: t,
|
|
7920
7920
|
removed: r,
|
|
7921
7921
|
order: i,
|
|
@@ -7931,7 +7931,7 @@ class B {
|
|
|
7931
7931
|
* @param item 行データ
|
|
7932
7932
|
*/
|
|
7933
7933
|
static rowAdd(e, t, r, i) {
|
|
7934
|
-
|
|
7934
|
+
H.dispatch(e, "rowadd", { key: t, index: r, item: i });
|
|
7935
7935
|
}
|
|
7936
7936
|
/**
|
|
7937
7937
|
* rowremoveイベントを発火します。
|
|
@@ -7941,7 +7941,7 @@ class B {
|
|
|
7941
7941
|
* @param index インデックス
|
|
7942
7942
|
*/
|
|
7943
7943
|
static rowRemove(e, t, r) {
|
|
7944
|
-
|
|
7944
|
+
H.dispatch(e, "rowremove", { key: t, index: r });
|
|
7945
7945
|
}
|
|
7946
7946
|
/**
|
|
7947
7947
|
* rowmoveイベントを発火します。
|
|
@@ -7952,7 +7952,7 @@ class B {
|
|
|
7952
7952
|
* @param to 移動後インデックス
|
|
7953
7953
|
*/
|
|
7954
7954
|
static rowMove(e, t, r, i) {
|
|
7955
|
-
|
|
7955
|
+
H.dispatch(e, "rowmove", { key: t, from: r, to: i });
|
|
7956
7956
|
}
|
|
7957
7957
|
/**
|
|
7958
7958
|
* showイベントを発火します。
|
|
@@ -7960,7 +7960,7 @@ class B {
|
|
|
7960
7960
|
* @param target data-if要素
|
|
7961
7961
|
*/
|
|
7962
7962
|
static show(e) {
|
|
7963
|
-
|
|
7963
|
+
H.dispatch(e, "show", { visible: !0 });
|
|
7964
7964
|
}
|
|
7965
7965
|
/**
|
|
7966
7966
|
* hideイベントを発火します。
|
|
@@ -7968,7 +7968,7 @@ class B {
|
|
|
7968
7968
|
* @param target data-if要素
|
|
7969
7969
|
*/
|
|
7970
7970
|
static hide(e) {
|
|
7971
|
-
|
|
7971
|
+
H.dispatch(e, "hide", { visible: !1 });
|
|
7972
7972
|
}
|
|
7973
7973
|
/**
|
|
7974
7974
|
* fetchstartイベントを発火します。
|
|
@@ -7981,7 +7981,7 @@ class B {
|
|
|
7981
7981
|
* @return 戻り値はありません。
|
|
7982
7982
|
*/
|
|
7983
7983
|
static fetchStart(e, t, r, i, n) {
|
|
7984
|
-
|
|
7984
|
+
H.dispatch(e, "fetchstart", {
|
|
7985
7985
|
url: t,
|
|
7986
7986
|
options: r || {},
|
|
7987
7987
|
payload: i,
|
|
@@ -7998,7 +7998,7 @@ class B {
|
|
|
7998
7998
|
* @param startedAt 開始時刻
|
|
7999
7999
|
*/
|
|
8000
8000
|
static fetchEnd(e, t, r, i) {
|
|
8001
|
-
|
|
8001
|
+
H.dispatch(e, "fetchend", {
|
|
8002
8002
|
url: t,
|
|
8003
8003
|
status: r,
|
|
8004
8004
|
durationMs: performance.now() - i
|
|
@@ -8014,7 +8014,7 @@ class B {
|
|
|
8014
8014
|
* @param startedAt 開始時刻(存在する場合)
|
|
8015
8015
|
*/
|
|
8016
8016
|
static fetchError(e, t, r, i, n) {
|
|
8017
|
-
|
|
8017
|
+
H.dispatch(e, "fetcherror", {
|
|
8018
8018
|
url: t,
|
|
8019
8019
|
status: i,
|
|
8020
8020
|
error: r,
|
|
@@ -8030,7 +8030,7 @@ class B {
|
|
|
8030
8030
|
* @return 戻り値はありません。
|
|
8031
8031
|
*/
|
|
8032
8032
|
static pollTimeout(e, t, r) {
|
|
8033
|
-
|
|
8033
|
+
H.dispatch(e, "polltimeout", { count: t, elapsedMs: r });
|
|
8034
8034
|
}
|
|
8035
8035
|
/**
|
|
8036
8036
|
* pollstopイベントを発火します。
|
|
@@ -8044,33 +8044,33 @@ class B {
|
|
|
8044
8044
|
* @return 戻り値はありません。
|
|
8045
8045
|
*/
|
|
8046
8046
|
static pollStop(e, t, r, i) {
|
|
8047
|
-
|
|
8047
|
+
H.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
8048
8048
|
}
|
|
8049
8049
|
}
|
|
8050
|
-
const
|
|
8050
|
+
const It = {
|
|
8051
8051
|
401: "unauthorized-redirect",
|
|
8052
8052
|
403: "forbidden-redirect"
|
|
8053
8053
|
};
|
|
8054
|
-
function
|
|
8054
|
+
function kt(b, e) {
|
|
8055
8055
|
return b.replace(/\{\{([\s\S]+?)\}\}/g, (t, r) => {
|
|
8056
8056
|
try {
|
|
8057
|
-
const i =
|
|
8057
|
+
const i = ie.evaluate(String(r).trim(), e);
|
|
8058
8058
|
return i == null ? "" : String(i);
|
|
8059
8059
|
} catch {
|
|
8060
8060
|
return "";
|
|
8061
8061
|
}
|
|
8062
8062
|
});
|
|
8063
8063
|
}
|
|
8064
|
-
function
|
|
8064
|
+
function Nt(b, e) {
|
|
8065
8065
|
const t = b.getAttribute(e);
|
|
8066
8066
|
if (t === null || t === "")
|
|
8067
8067
|
return null;
|
|
8068
8068
|
if (!t.includes("{{"))
|
|
8069
8069
|
return t;
|
|
8070
|
-
const r =
|
|
8070
|
+
const r = I.get(b), i = r instanceof S ? r.getBindingData() : {}, n = kt(t, i);
|
|
8071
8071
|
return n === "" ? null : n;
|
|
8072
8072
|
}
|
|
8073
|
-
function
|
|
8073
|
+
function xt(b, e, t) {
|
|
8074
8074
|
const r = b.getAttribute(`${e}-return-param`);
|
|
8075
8075
|
if (r === null || r === "")
|
|
8076
8076
|
return t;
|
|
@@ -8083,17 +8083,17 @@ function Ct(b, e, t) {
|
|
|
8083
8083
|
const i = window.location.pathname + window.location.search + window.location.hash, s = `${encodeURIComponent(r)}=${encodeURIComponent(i)}`, a = t.indexOf("#"), o = a >= 0 ? t.slice(a) : "", c = a >= 0 ? t.slice(0, a) : t, u = c.includes("?") ? "&" : "?";
|
|
8084
8084
|
return `${c}${u}${s}${o}`;
|
|
8085
8085
|
}
|
|
8086
|
-
function
|
|
8087
|
-
const e =
|
|
8086
|
+
function pt(b) {
|
|
8087
|
+
const e = It[b];
|
|
8088
8088
|
if (e === void 0 || typeof document > "u")
|
|
8089
8089
|
return !1;
|
|
8090
8090
|
const t = `${l.prefix}${e}`, r = [];
|
|
8091
8091
|
document.body && r.push(document.body), document.documentElement && r.push(document.documentElement);
|
|
8092
8092
|
for (const i of r) {
|
|
8093
|
-
const n =
|
|
8093
|
+
const n = Nt(i, t);
|
|
8094
8094
|
if (n === null)
|
|
8095
8095
|
continue;
|
|
8096
|
-
const s =
|
|
8096
|
+
const s = xt(i, t, n);
|
|
8097
8097
|
try {
|
|
8098
8098
|
if (new URL(s, window.location.href).href === window.location.href)
|
|
8099
8099
|
return !1;
|
|
@@ -8103,7 +8103,7 @@ function gt(b) {
|
|
|
8103
8103
|
}
|
|
8104
8104
|
return !1;
|
|
8105
8105
|
}
|
|
8106
|
-
class
|
|
8106
|
+
class Z {
|
|
8107
8107
|
/**
|
|
8108
8108
|
* セレクタ属性の値を評価済みの文字列として読み取ります。
|
|
8109
8109
|
*
|
|
@@ -8570,7 +8570,7 @@ const x = class x {
|
|
|
8570
8570
|
).forEach((i) => {
|
|
8571
8571
|
if (!x.RESTORED_ELEMENTS.has(i))
|
|
8572
8572
|
return;
|
|
8573
|
-
const n =
|
|
8573
|
+
const n = I.get(i);
|
|
8574
8574
|
if (!(n instanceof S))
|
|
8575
8575
|
return;
|
|
8576
8576
|
const s = x.readDeclaration(n);
|
|
@@ -8586,7 +8586,7 @@ const x = class x {
|
|
|
8586
8586
|
};
|
|
8587
8587
|
x.SIGNATURES = /* @__PURE__ */ new WeakMap(), x.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), x.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), x.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
8588
8588
|
let Fe = x;
|
|
8589
|
-
class
|
|
8589
|
+
class gt {
|
|
8590
8590
|
/**
|
|
8591
8591
|
* URLのクエリパラメータを取得します。
|
|
8592
8592
|
*
|
|
@@ -8632,7 +8632,7 @@ class mt {
|
|
|
8632
8632
|
}
|
|
8633
8633
|
}
|
|
8634
8634
|
}
|
|
8635
|
-
const
|
|
8635
|
+
const Mt = [
|
|
8636
8636
|
"addErrorMessage",
|
|
8637
8637
|
"clearMessages",
|
|
8638
8638
|
"closeDialog",
|
|
@@ -8640,25 +8640,26 @@ const $t = [
|
|
|
8640
8640
|
"dialog",
|
|
8641
8641
|
"openDialog",
|
|
8642
8642
|
"toast"
|
|
8643
|
-
],
|
|
8643
|
+
], $t = "__haoriHistoryState__", Oe = "data-haori-click-lock", Je = "ファイルを保存できませんでした", Ct = 100;
|
|
8644
8644
|
let De = null;
|
|
8645
|
-
|
|
8645
|
+
const Pt = ["info", "warning", "error", "success"], Lt = /^(\d{3})-(click|click-await|close|toast|toast-level|no-message)$/;
|
|
8646
|
+
function fe() {
|
|
8646
8647
|
const e = globalThis.window?.Haori;
|
|
8647
|
-
return
|
|
8648
|
+
return Mt.every(
|
|
8648
8649
|
(r) => typeof e?.[r] == "function"
|
|
8649
|
-
) ? e :
|
|
8650
|
+
) ? e : Se;
|
|
8650
8651
|
}
|
|
8651
|
-
const
|
|
8652
|
+
const Ot = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
8652
8653
|
function He(b) {
|
|
8653
|
-
return
|
|
8654
|
+
return Ot.has(b.toUpperCase());
|
|
8654
8655
|
}
|
|
8655
|
-
function
|
|
8656
|
+
function Bt(b, e) {
|
|
8656
8657
|
for (const [t, r] of Object.entries(e))
|
|
8657
8658
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
8658
|
-
b.append(t,
|
|
8659
|
-
}) : b.append(t,
|
|
8659
|
+
b.append(t, be(i));
|
|
8660
|
+
}) : b.append(t, be(r)));
|
|
8660
8661
|
}
|
|
8661
|
-
function
|
|
8662
|
+
function be(b) {
|
|
8662
8663
|
if (b == null)
|
|
8663
8664
|
return "";
|
|
8664
8665
|
if (typeof b == "object" || typeof b == "function")
|
|
@@ -8669,11 +8670,11 @@ function Ae(b) {
|
|
|
8669
8670
|
}
|
|
8670
8671
|
return String(b);
|
|
8671
8672
|
}
|
|
8672
|
-
function
|
|
8673
|
+
function mt(b, e) {
|
|
8673
8674
|
const t = new URL(b, window.location.href), r = new URLSearchParams(t.search);
|
|
8674
|
-
return
|
|
8675
|
+
return Bt(r, e), t.search = r.toString(), t.toString();
|
|
8675
8676
|
}
|
|
8676
|
-
function
|
|
8677
|
+
function Ht(b) {
|
|
8677
8678
|
if (b == null)
|
|
8678
8679
|
return { payload: {}, dropped: !1 };
|
|
8679
8680
|
if (typeof b == "string") {
|
|
@@ -8690,12 +8691,12 @@ function Bt(b) {
|
|
|
8690
8691
|
return { payload: {}, dropped: !0 };
|
|
8691
8692
|
}
|
|
8692
8693
|
return e.includes("=") ? {
|
|
8693
|
-
payload:
|
|
8694
|
+
payload: Ze(new URLSearchParams(e)),
|
|
8694
8695
|
dropped: !1
|
|
8695
8696
|
} : { payload: {}, dropped: !0 };
|
|
8696
8697
|
}
|
|
8697
8698
|
if (b instanceof URLSearchParams)
|
|
8698
|
-
return { payload:
|
|
8699
|
+
return { payload: Ze(b), dropped: !1 };
|
|
8699
8700
|
if (typeof FormData < "u" && b instanceof FormData) {
|
|
8700
8701
|
const e = {};
|
|
8701
8702
|
let t = !1;
|
|
@@ -8704,30 +8705,30 @@ function Bt(b) {
|
|
|
8704
8705
|
t = !0;
|
|
8705
8706
|
continue;
|
|
8706
8707
|
}
|
|
8707
|
-
|
|
8708
|
+
yt(e, r, i);
|
|
8708
8709
|
}
|
|
8709
8710
|
return { payload: e, dropped: t };
|
|
8710
8711
|
}
|
|
8711
8712
|
return { payload: {}, dropped: !0 };
|
|
8712
8713
|
}
|
|
8713
|
-
function
|
|
8714
|
+
function Ze(b) {
|
|
8714
8715
|
const e = {};
|
|
8715
8716
|
for (const [t, r] of b.entries())
|
|
8716
|
-
|
|
8717
|
+
yt(e, t, r);
|
|
8717
8718
|
return e;
|
|
8718
8719
|
}
|
|
8719
|
-
function
|
|
8720
|
+
function yt(b, e, t) {
|
|
8720
8721
|
const r = b[e];
|
|
8721
8722
|
r === void 0 ? b[e] = t : Array.isArray(r) ? r.push(t) : b[e] = [r, t];
|
|
8722
8723
|
}
|
|
8723
|
-
function
|
|
8724
|
-
if (
|
|
8724
|
+
function pe(b, e) {
|
|
8725
|
+
if (k.isCompleteSetValue(e))
|
|
8725
8726
|
return e;
|
|
8726
8727
|
if (Array.isArray(e)) {
|
|
8727
8728
|
const t = Array.isArray(b) ? b.slice() : [];
|
|
8728
8729
|
let r = !1;
|
|
8729
8730
|
return e.forEach((i, n) => {
|
|
8730
|
-
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[n] =
|
|
8731
|
+
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[n] = pe(t[n], i), r = !0));
|
|
8731
8732
|
}), r ? t : b;
|
|
8732
8733
|
}
|
|
8733
8734
|
if (e !== null && typeof e == "object") {
|
|
@@ -8735,16 +8736,16 @@ function ye(b, e) {
|
|
|
8735
8736
|
for (const [r, i] of Object.entries(
|
|
8736
8737
|
e
|
|
8737
8738
|
))
|
|
8738
|
-
t[r] =
|
|
8739
|
+
t[r] = pe(t[r], i);
|
|
8739
8740
|
return t;
|
|
8740
8741
|
}
|
|
8741
8742
|
return e;
|
|
8742
8743
|
}
|
|
8743
|
-
function
|
|
8744
|
+
function Ut(b) {
|
|
8744
8745
|
const e = b?.body;
|
|
8745
8746
|
return e == null ? !1 : typeof e == "string" ? e !== "" : !0;
|
|
8746
8747
|
}
|
|
8747
|
-
function
|
|
8748
|
+
function Vt(b, e) {
|
|
8748
8749
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
8749
8750
|
if (l.runtime !== "demo" || He(r))
|
|
8750
8751
|
return {
|
|
@@ -8754,11 +8755,11 @@ function Ut(b, e) {
|
|
|
8754
8755
|
effectiveMethod: r,
|
|
8755
8756
|
normalized: !1
|
|
8756
8757
|
};
|
|
8757
|
-
const { payload: i, dropped: n } =
|
|
8758
|
+
const { payload: i, dropped: n } = Ht(
|
|
8758
8759
|
t.body
|
|
8759
8760
|
);
|
|
8760
8761
|
let s = b;
|
|
8761
|
-
Object.keys(i).length > 0 && (s =
|
|
8762
|
+
Object.keys(i).length > 0 && (s = mt(s, i)), n && m.warn(
|
|
8762
8763
|
"Haori",
|
|
8763
8764
|
`The ${r} body cannot be converted into a query string and is dropped by the demo runtime normalization. Send the values with ${l.prefix}{event}-data / ${l.prefix}{event}-form, or use the embedded runtime.`
|
|
8764
8765
|
), delete t.body, t.method = "GET";
|
|
@@ -8774,7 +8775,7 @@ function Ut(b, e) {
|
|
|
8774
8775
|
queryString: new URL(s, window.location.href).search || void 0
|
|
8775
8776
|
};
|
|
8776
8777
|
}
|
|
8777
|
-
function
|
|
8778
|
+
function qt(b) {
|
|
8778
8779
|
return b == null ? null : typeof b == "string" ? b : b instanceof URLSearchParams ? b.toString() : b instanceof FormData ? Array.from(b.entries()).map(([e, t]) => t instanceof File ? [
|
|
8779
8780
|
e,
|
|
8780
8781
|
{
|
|
@@ -8790,13 +8791,13 @@ function Ie(b) {
|
|
|
8790
8791
|
Ie
|
|
8791
8792
|
) : !1;
|
|
8792
8793
|
}
|
|
8793
|
-
function
|
|
8794
|
+
function Wt(b) {
|
|
8794
8795
|
return Object.values(b).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
8795
8796
|
(t) => !(t instanceof Blob) && Ie(t)
|
|
8796
8797
|
) : Ie(e));
|
|
8797
8798
|
}
|
|
8798
|
-
function
|
|
8799
|
-
return Ue(
|
|
8799
|
+
function xe(b) {
|
|
8800
|
+
return Ue(k.getValues(b));
|
|
8800
8801
|
}
|
|
8801
8802
|
function Ue(b) {
|
|
8802
8803
|
const e = (r) => {
|
|
@@ -8806,7 +8807,7 @@ function Ue(b) {
|
|
|
8806
8807
|
return "";
|
|
8807
8808
|
if (Array.isArray(r)) {
|
|
8808
8809
|
const i = r.map(e);
|
|
8809
|
-
return
|
|
8810
|
+
return k.carryCollectedRowIdentity(r, i), i;
|
|
8810
8811
|
}
|
|
8811
8812
|
if (r !== null && typeof r == "object") {
|
|
8812
8813
|
const i = {};
|
|
@@ -8814,15 +8815,15 @@ function Ue(b) {
|
|
|
8814
8815
|
r
|
|
8815
8816
|
))
|
|
8816
8817
|
i[n] = e(s);
|
|
8817
|
-
return
|
|
8818
|
+
return k.carryCollectedRowIdentity(r, i), i;
|
|
8818
8819
|
}
|
|
8819
8820
|
return r;
|
|
8820
8821
|
}, t = {};
|
|
8821
8822
|
for (const [r, i] of Object.entries(b))
|
|
8822
8823
|
t[r] = e(i);
|
|
8823
|
-
return
|
|
8824
|
+
return k.carryCollectedRowIdentity(b, t), t;
|
|
8824
8825
|
}
|
|
8825
|
-
function
|
|
8826
|
+
function jt(b, e) {
|
|
8826
8827
|
const t = new Headers(
|
|
8827
8828
|
e.headers || void 0
|
|
8828
8829
|
), r = Array.from(t.entries()).sort(
|
|
@@ -8832,7 +8833,7 @@ function Wt(b, e) {
|
|
|
8832
8833
|
url: b,
|
|
8833
8834
|
method: String(e.method || "GET").toUpperCase(),
|
|
8834
8835
|
headers: r,
|
|
8835
|
-
body:
|
|
8836
|
+
body: qt(e.body || null)
|
|
8836
8837
|
});
|
|
8837
8838
|
}
|
|
8838
8839
|
const p = class p {
|
|
@@ -8879,17 +8880,121 @@ const p = class p {
|
|
|
8879
8880
|
static attrName(e, t, r = !1) {
|
|
8880
8881
|
return e ? `${l.prefix}${e}-${t}` : r ? `${l.prefix}fetch-${t}` : `${l.prefix}${t}`;
|
|
8881
8882
|
}
|
|
8883
|
+
/**
|
|
8884
|
+
* セレクタを値に取る属性(`data-{event}-click` / `-close` / `-error-click` など)
|
|
8885
|
+
* の対象を解決します。
|
|
8886
|
+
*
|
|
8887
|
+
* 値を省略した場合の扱いは属性によって異なります。`-error-click` はエラーを
|
|
8888
|
+
* 記録し、`-open` / `-close` / `-error-close` は祖先方向で最も近い `<dialog>`、
|
|
8889
|
+
* それ以外は自要素を対象にします。
|
|
8890
|
+
*
|
|
8891
|
+
* @param fragment 属性を宣言したフラグメント
|
|
8892
|
+
* @param attrName 属性名
|
|
8893
|
+
* @param attrKey 属性名から `data-{event}-` を除いた部分。ステータスごとの組
|
|
8894
|
+
* (`-error-404-close` など)では、ステータスを除いた `error-close` などを渡す
|
|
8895
|
+
* @returns 対象のフラグメント(見つからない場合は空)
|
|
8896
|
+
*/
|
|
8897
|
+
static resolveSelectorTargets(e, t, r) {
|
|
8898
|
+
const i = Z.read(e, t), n = [];
|
|
8899
|
+
if (i)
|
|
8900
|
+
Z.queryAll(i, t).forEach((a) => {
|
|
8901
|
+
const o = I.get(a);
|
|
8902
|
+
o && n.push(o);
|
|
8903
|
+
}), n.length === 0 && m.error("Haori", `Element not found: ${i} (${t})`);
|
|
8904
|
+
else if (r === "error-click")
|
|
8905
|
+
m.error(
|
|
8906
|
+
"Haori",
|
|
8907
|
+
`${t} にはクリックする要素のセレクタが必要です。`
|
|
8908
|
+
);
|
|
8909
|
+
else if (r === "open" || r === "close" || r === "error-close") {
|
|
8910
|
+
const s = e.getTarget().closest("dialog");
|
|
8911
|
+
s ? n.push(I.get(s)) : m.error("Haori", `Ancestor <dialog> not found (${t})`);
|
|
8912
|
+
} else
|
|
8913
|
+
n.push(e);
|
|
8914
|
+
return n;
|
|
8915
|
+
}
|
|
8882
8916
|
/**
|
|
8883
8917
|
* トーストのレベル(`data-{event}-toast-level` など)を読み取ります。
|
|
8884
|
-
*
|
|
8918
|
+
*
|
|
8919
|
+
* メッセージと同じく表示直前に評価し直すため、開始時の評価情報を記録します
|
|
8920
|
+
* (仕様「`data-{event}-toast`」の「メッセージと同じく**表示直前**に評価する
|
|
8921
|
+
* ため、式を書けます」)。
|
|
8885
8922
|
*
|
|
8886
8923
|
* @param fragment 対象フラグメント
|
|
8924
|
+
* @param options 記録先のオプション
|
|
8925
|
+
* @param key アクション名(`toast-level` / `error-toast-level` など)
|
|
8887
8926
|
* @param attributeName 属性名
|
|
8888
|
-
* @returns
|
|
8927
|
+
* @returns 開始時のレベル。属性が無いか値が不正な場合は null(`info` で表示する)
|
|
8889
8928
|
*/
|
|
8890
|
-
static readToastLevel(e, t) {
|
|
8891
|
-
|
|
8892
|
-
|
|
8929
|
+
static readToastLevel(e, t, r, i) {
|
|
8930
|
+
return p.toToastLevel(
|
|
8931
|
+
p.readLateAttribute(e, t, r, i)
|
|
8932
|
+
);
|
|
8933
|
+
}
|
|
8934
|
+
/**
|
|
8935
|
+
* ステータスごとの失敗時のアクション(`data-{event}-error-{ステータス}-*`)を
|
|
8936
|
+
* 読み取ります。
|
|
8937
|
+
*
|
|
8938
|
+
* 属性名からステータスを集め、ステータスごとに組を作ります。各属性の意味は
|
|
8939
|
+
* ステータスの付かない属性と同じです(仕様「失敗時のアクション」の「意味は
|
|
8940
|
+
* ステータスの付かない属性と同じです」)。
|
|
8941
|
+
*
|
|
8942
|
+
* @param fragment 対象フラグメント
|
|
8943
|
+
* @param options 遅延評価の記録先のオプション
|
|
8944
|
+
* @param event イベント名
|
|
8945
|
+
* @returns ステータスと組の対応(宣言が無い場合は空)
|
|
8946
|
+
*/
|
|
8947
|
+
static readErrorStatusActions(e, t, r) {
|
|
8948
|
+
const i = p.attrName(r, "error-"), n = /* @__PURE__ */ new Set();
|
|
8949
|
+
for (const a of e.getAttributeNames()) {
|
|
8950
|
+
if (!a.startsWith(i))
|
|
8951
|
+
continue;
|
|
8952
|
+
const o = Lt.exec(
|
|
8953
|
+
a.slice(i.length)
|
|
8954
|
+
);
|
|
8955
|
+
o && n.add(o[1]);
|
|
8956
|
+
}
|
|
8957
|
+
const s = /* @__PURE__ */ new Map();
|
|
8958
|
+
return n.forEach((a) => {
|
|
8959
|
+
const o = `error-${a}`, c = (u) => p.attrName(r, `${o}-${u}`);
|
|
8960
|
+
s.set(Number(a), {
|
|
8961
|
+
key: o,
|
|
8962
|
+
clickFragments: e.hasAttribute(c("click")) ? p.resolveSelectorTargets(
|
|
8963
|
+
e,
|
|
8964
|
+
c("click"),
|
|
8965
|
+
"error-click"
|
|
8966
|
+
) : null,
|
|
8967
|
+
clickAwait: e.hasAttribute(c("click-await")),
|
|
8968
|
+
closeFragments: e.hasAttribute(c("close")) ? p.resolveSelectorTargets(
|
|
8969
|
+
e,
|
|
8970
|
+
c("close"),
|
|
8971
|
+
"error-close"
|
|
8972
|
+
) : null,
|
|
8973
|
+
// `-toast` / `-toast-level` が無い場合は、どちらも null になる。
|
|
8974
|
+
toastMessage: p.readLateAttribute(
|
|
8975
|
+
e,
|
|
8976
|
+
t,
|
|
8977
|
+
`${o}-toast`,
|
|
8978
|
+
c("toast")
|
|
8979
|
+
),
|
|
8980
|
+
toastLevel: p.readToastLevel(
|
|
8981
|
+
e,
|
|
8982
|
+
t,
|
|
8983
|
+
`${o}-toast-level`,
|
|
8984
|
+
c("toast-level")
|
|
8985
|
+
),
|
|
8986
|
+
noMessage: e.hasAttribute(c("no-message"))
|
|
8987
|
+
});
|
|
8988
|
+
}), s;
|
|
8989
|
+
}
|
|
8990
|
+
/**
|
|
8991
|
+
* 評価値を、トーストのレベルへ変換します。
|
|
8992
|
+
*
|
|
8993
|
+
* @param value 評価値
|
|
8994
|
+
* @returns レベル。4 つの値のどれとも一致しない場合は null(`info` で表示する)
|
|
8995
|
+
*/
|
|
8996
|
+
static toToastLevel(e) {
|
|
8997
|
+
return Pt.includes(e) ? e : null;
|
|
8893
8998
|
}
|
|
8894
8999
|
/**
|
|
8895
9000
|
* `data-{event}-error-status` の値を、ステータスの一覧へ変換します。
|
|
@@ -9067,7 +9172,7 @@ const p = class p {
|
|
|
9067
9172
|
return { value: e.replace(
|
|
9068
9173
|
p.DATA_PLACEHOLDER_REGEX,
|
|
9069
9174
|
(n, s, a) => {
|
|
9070
|
-
const o =
|
|
9175
|
+
const o = ie.evaluateDetailed(
|
|
9071
9176
|
s ?? a ?? "",
|
|
9072
9177
|
t
|
|
9073
9178
|
);
|
|
@@ -9137,7 +9242,7 @@ const p = class p {
|
|
|
9137
9242
|
return { value: e.replace(
|
|
9138
9243
|
p.DATA_PLACEHOLDER_REGEX,
|
|
9139
9244
|
(n, s, a, o) => {
|
|
9140
|
-
const c =
|
|
9245
|
+
const c = ie.evaluateDetailed(
|
|
9141
9246
|
s ?? a ?? "",
|
|
9142
9247
|
t
|
|
9143
9248
|
);
|
|
@@ -9209,7 +9314,7 @@ const p = class p {
|
|
|
9209
9314
|
}, i = t ? p.attrName(t, "if") : p.attrName(null, "if", !0);
|
|
9210
9315
|
if (e.hasAttribute(i)) {
|
|
9211
9316
|
const T = e.getRawAttribute(i);
|
|
9212
|
-
typeof T == "string" && T.trim() !== "" ? (r.conditionExpression =
|
|
9317
|
+
typeof T == "string" && T.trim() !== "" ? (r.conditionExpression = k.unwrapConditionExpression(T), r.conditionAttributeName = i) : m.warn(
|
|
9213
9318
|
"Haori",
|
|
9214
9319
|
`${i} に条件式が指定されていません。`
|
|
9215
9320
|
);
|
|
@@ -9220,24 +9325,24 @@ const p = class p {
|
|
|
9220
9325
|
e.getAttribute(p.attrName(t, "confirm"))
|
|
9221
9326
|
)
|
|
9222
9327
|
)), e.hasAttribute(p.attrName(t, "data")) && (r.dataAttrName = p.attrName(t, "data")), e.hasAttribute(p.attrName(t, "form"))) {
|
|
9223
|
-
const L =
|
|
9328
|
+
const L = Z.read(
|
|
9224
9329
|
e,
|
|
9225
9330
|
p.attrName(t, "form")
|
|
9226
9331
|
);
|
|
9227
9332
|
if (L) {
|
|
9228
|
-
const Y =
|
|
9333
|
+
const Y = Z.query(
|
|
9229
9334
|
L,
|
|
9230
9335
|
p.attrName(t, "form")
|
|
9231
9336
|
);
|
|
9232
|
-
Y !== null ? r.formFragment =
|
|
9233
|
-
|
|
9337
|
+
Y !== null ? r.formFragment = k.getFormFragment(
|
|
9338
|
+
I.get(Y)
|
|
9234
9339
|
) : m.error(
|
|
9235
9340
|
"Haori",
|
|
9236
9341
|
`Form element not found: ${L} (${p.attrName(t, "form")})`
|
|
9237
9342
|
);
|
|
9238
9343
|
} else
|
|
9239
|
-
r.formFragment =
|
|
9240
|
-
} else (t === "change" || t === "input") && (r.formFragment =
|
|
9344
|
+
r.formFragment = k.getFormFragment(e);
|
|
9345
|
+
} else (t === "change" || t === "input") && (r.formFragment = k.getFormFragment(e), r.formFragment === null && p.isNamedInputFragment(e) && (r.selfValueFragment = e));
|
|
9241
9346
|
if (e.hasAttribute(`${l.prefix}${t}-before-run`)) {
|
|
9242
9347
|
const L = e.getRawAttribute(
|
|
9243
9348
|
`${l.prefix}${t}-before-run`
|
|
@@ -9271,8 +9376,8 @@ ${L}
|
|
|
9271
9376
|
Y = new Function("event", `"use strict";
|
|
9272
9377
|
${L}
|
|
9273
9378
|
`);
|
|
9274
|
-
} catch (
|
|
9275
|
-
m.error("Haori", `Invalid run script: ${
|
|
9379
|
+
} catch (Q) {
|
|
9380
|
+
m.error("Haori", `Invalid run script: ${Q}`);
|
|
9276
9381
|
}
|
|
9277
9382
|
}
|
|
9278
9383
|
Y && (r.runScript = Y);
|
|
@@ -9332,25 +9437,25 @@ ${L}
|
|
|
9332
9437
|
));
|
|
9333
9438
|
const A = t ? p.attrName(t, "bind") : p.attrName(null, "bind", !0);
|
|
9334
9439
|
if (e.hasAttribute(A)) {
|
|
9335
|
-
const T =
|
|
9440
|
+
const T = Z.read(e, A);
|
|
9336
9441
|
if (T) {
|
|
9337
|
-
const L =
|
|
9442
|
+
const L = Z.queryAll(T, A);
|
|
9338
9443
|
L.length > 0 ? (r.bindFragments = [], L.forEach((Y) => {
|
|
9339
|
-
const
|
|
9340
|
-
|
|
9444
|
+
const Q = I.get(Y);
|
|
9445
|
+
Q && r.bindFragments.push(Q);
|
|
9341
9446
|
})) : m.error(
|
|
9342
9447
|
"Haori",
|
|
9343
9448
|
`Bind element not found: ${T} (${A})`
|
|
9344
9449
|
);
|
|
9345
9450
|
}
|
|
9346
9451
|
}
|
|
9347
|
-
const
|
|
9348
|
-
t ? e.hasAttribute(
|
|
9349
|
-
|
|
9350
|
-
) : e.hasAttribute(
|
|
9351
|
-
const
|
|
9352
|
-
if (e.hasAttribute(
|
|
9353
|
-
const T = e.getRawAttribute(
|
|
9452
|
+
const D = p.attrName(t, "bind-arg"), N = p.attrName(null, "arg", !0), B = p.attrName(null, "bind-arg", !0);
|
|
9453
|
+
t ? e.hasAttribute(D) && (r.bindArg = e.getRawAttribute(D)) : e.hasAttribute(N) ? r.bindArg = e.getRawAttribute(
|
|
9454
|
+
N
|
|
9455
|
+
) : e.hasAttribute(B) && (r.bindArg = e.getRawAttribute(B));
|
|
9456
|
+
const F = t ? p.attrName(t, "bind-params") : p.attrName(null, "bind-params", !0);
|
|
9457
|
+
if (e.hasAttribute(F)) {
|
|
9458
|
+
const T = e.getRawAttribute(F);
|
|
9354
9459
|
r.bindParams = T.split("&").map((L) => L.trim());
|
|
9355
9460
|
}
|
|
9356
9461
|
const j = t ? p.attrName(t, "bind-append") : p.attrName(null, "bind-append", !0);
|
|
@@ -9358,8 +9463,8 @@ ${L}
|
|
|
9358
9463
|
const T = e.getRawAttribute(j);
|
|
9359
9464
|
r.bindAppendParams = T.split("&").map((L) => L.trim()).filter(Boolean);
|
|
9360
9465
|
}
|
|
9361
|
-
const
|
|
9362
|
-
e.hasAttribute(
|
|
9466
|
+
const J = t ? p.attrName(t, "bind-merge") : p.attrName(null, "bind-merge", !0);
|
|
9467
|
+
e.hasAttribute(J) && (r.bindMerge = !0);
|
|
9363
9468
|
const _ = t ? p.attrName(t, "bind-transform") : p.attrName(null, "bind-transform", !0);
|
|
9364
9469
|
e.hasAttribute(_) && (r.bindTransform = e.getRawAttribute(_));
|
|
9365
9470
|
const P = t ? p.attrName(t, "copy-params") : null;
|
|
@@ -9369,32 +9474,32 @@ ${L}
|
|
|
9369
9474
|
}
|
|
9370
9475
|
if (t) {
|
|
9371
9476
|
if (e.hasAttribute(p.attrName(t, "adjust"))) {
|
|
9372
|
-
const
|
|
9477
|
+
const W = Z.read(
|
|
9373
9478
|
e,
|
|
9374
9479
|
p.attrName(t, "adjust")
|
|
9375
9480
|
);
|
|
9376
|
-
if (
|
|
9377
|
-
const
|
|
9378
|
-
|
|
9481
|
+
if (W) {
|
|
9482
|
+
const z = Z.queryAll(
|
|
9483
|
+
W,
|
|
9379
9484
|
p.attrName(t, "adjust")
|
|
9380
9485
|
);
|
|
9381
|
-
|
|
9382
|
-
const
|
|
9383
|
-
|
|
9486
|
+
z.length > 0 ? (r.adjustFragments = [], z.forEach((X) => {
|
|
9487
|
+
const Re = I.get(X);
|
|
9488
|
+
Re && r.adjustFragments.push(Re);
|
|
9384
9489
|
})) : m.error(
|
|
9385
9490
|
"Haori",
|
|
9386
|
-
`Adjust element not found: ${
|
|
9491
|
+
`Adjust element not found: ${W} (${p.attrName(t, "adjust")})`
|
|
9387
9492
|
);
|
|
9388
9493
|
}
|
|
9389
9494
|
if (e.hasAttribute(p.attrName(t, "adjust-value"))) {
|
|
9390
|
-
const
|
|
9495
|
+
const z = e.getRawAttribute(
|
|
9391
9496
|
p.attrName(t, "adjust-value")
|
|
9392
|
-
),
|
|
9393
|
-
isNaN(
|
|
9497
|
+
), X = Number(z);
|
|
9498
|
+
isNaN(X) || (r.adjustValue = X);
|
|
9394
9499
|
}
|
|
9395
9500
|
}
|
|
9396
9501
|
if (e.hasAttribute(p.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(p.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(p.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(p.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${l.prefix}${t}-after-run`)) {
|
|
9397
|
-
const
|
|
9502
|
+
const W = e.getRawAttribute(
|
|
9398
9503
|
`${l.prefix}${t}-after-run`
|
|
9399
9504
|
);
|
|
9400
9505
|
try {
|
|
@@ -9402,11 +9507,11 @@ ${L}
|
|
|
9402
9507
|
"response",
|
|
9403
9508
|
`
|
|
9404
9509
|
"use strict";
|
|
9405
|
-
${
|
|
9510
|
+
${W}
|
|
9406
9511
|
`
|
|
9407
9512
|
);
|
|
9408
|
-
} catch (
|
|
9409
|
-
m.error("Haori", `Invalid after script: ${
|
|
9513
|
+
} catch (z) {
|
|
9514
|
+
m.error("Haori", `Invalid after script: ${z}`);
|
|
9410
9515
|
}
|
|
9411
9516
|
}
|
|
9412
9517
|
if (e.hasAttribute(p.attrName(t, "dialog")) && (r.dialogMessage = p.unescapeNewlines(
|
|
@@ -9423,45 +9528,51 @@ ${U}
|
|
|
9423
9528
|
p.attrName(t, "toast")
|
|
9424
9529
|
), r.toastLevel = p.readToastLevel(
|
|
9425
9530
|
e,
|
|
9531
|
+
r,
|
|
9532
|
+
"toast-level",
|
|
9426
9533
|
p.attrName(t, "toast-level")
|
|
9427
9534
|
)), t !== "poll") {
|
|
9428
|
-
const
|
|
9429
|
-
e.hasAttribute(
|
|
9535
|
+
const W = p.attrName(t, "error-toast");
|
|
9536
|
+
e.hasAttribute(W) && (r.errorToastMessage = p.readLateAttribute(
|
|
9430
9537
|
e,
|
|
9431
9538
|
r,
|
|
9432
9539
|
"error-toast",
|
|
9433
|
-
|
|
9540
|
+
W
|
|
9434
9541
|
), r.errorToastLevel = p.readToastLevel(
|
|
9435
9542
|
e,
|
|
9543
|
+
r,
|
|
9544
|
+
"error-toast-level",
|
|
9436
9545
|
p.attrName(t, "error-toast-level")
|
|
9437
9546
|
));
|
|
9438
|
-
const
|
|
9439
|
-
e.hasAttribute(
|
|
9440
|
-
e.getRawAttribute(
|
|
9441
|
-
|
|
9442
|
-
))
|
|
9547
|
+
const z = p.attrName(t, "error-status");
|
|
9548
|
+
e.hasAttribute(z) && (r.errorStatuses = p.parseErrorStatuses(
|
|
9549
|
+
e.getRawAttribute(z),
|
|
9550
|
+
z
|
|
9551
|
+
)), r.errorNoMessage = e.hasAttribute(
|
|
9552
|
+
p.attrName(t, "error-no-message")
|
|
9553
|
+
);
|
|
9443
9554
|
}
|
|
9444
|
-
const T = p.attrName(t, "redirect"), L = p.attrName(t, "redirect-replace"), Y = e.hasAttribute(T),
|
|
9555
|
+
const T = p.attrName(t, "redirect"), L = p.attrName(t, "redirect-replace"), Y = e.hasAttribute(T), Q = e.hasAttribute(L);
|
|
9445
9556
|
if (Y && (r.redirectUrl = p.readLateAttribute(
|
|
9446
9557
|
e,
|
|
9447
9558
|
r,
|
|
9448
9559
|
"redirect",
|
|
9449
9560
|
T
|
|
9450
|
-
)),
|
|
9561
|
+
)), Q && (r.redirectReplaceUrl = p.readLateAttribute(
|
|
9451
9562
|
e,
|
|
9452
9563
|
r,
|
|
9453
9564
|
"redirect-replace",
|
|
9454
9565
|
L
|
|
9455
|
-
)), Y ||
|
|
9456
|
-
const
|
|
9566
|
+
)), Y || Q) {
|
|
9567
|
+
const W = p.attrName(
|
|
9457
9568
|
t,
|
|
9458
9569
|
"redirect-return-param"
|
|
9459
9570
|
);
|
|
9460
|
-
e.hasAttribute(
|
|
9571
|
+
e.hasAttribute(W) && (r.redirectReturnParam = p.readLateAttribute(
|
|
9461
9572
|
e,
|
|
9462
9573
|
r,
|
|
9463
9574
|
"redirect-return-param",
|
|
9464
|
-
|
|
9575
|
+
W
|
|
9465
9576
|
));
|
|
9466
9577
|
}
|
|
9467
9578
|
if (e.hasAttribute(p.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(p.attrName(t, "scroll")) && (r.scrollTarget = p.readLateAttribute(
|
|
@@ -9475,23 +9586,23 @@ ${U}
|
|
|
9475
9586
|
"history",
|
|
9476
9587
|
p.attrName(t, "history")
|
|
9477
9588
|
)), e.hasAttribute(p.attrName(t, "history-data")) && (r.historyDataAttrName = p.attrName(t, "history-data")), e.hasAttribute(p.attrName(t, "history-form"))) {
|
|
9478
|
-
const
|
|
9589
|
+
const W = Z.read(
|
|
9479
9590
|
e,
|
|
9480
9591
|
p.attrName(t, "history-form")
|
|
9481
9592
|
);
|
|
9482
|
-
if (
|
|
9483
|
-
const
|
|
9484
|
-
|
|
9593
|
+
if (W) {
|
|
9594
|
+
const z = Z.query(
|
|
9595
|
+
W,
|
|
9485
9596
|
p.attrName(t, "history-form")
|
|
9486
9597
|
);
|
|
9487
|
-
|
|
9488
|
-
|
|
9598
|
+
z !== null ? r.historyFormFragment = k.getFormFragment(
|
|
9599
|
+
I.get(z)
|
|
9489
9600
|
) : m.error(
|
|
9490
9601
|
"Haori",
|
|
9491
|
-
`Form element not found: ${
|
|
9602
|
+
`Form element not found: ${W} (${p.attrName(t, "history-form")})`
|
|
9492
9603
|
);
|
|
9493
9604
|
} else
|
|
9494
|
-
r.historyFormFragment =
|
|
9605
|
+
r.historyFormFragment = k.getFormFragment(e);
|
|
9495
9606
|
}
|
|
9496
9607
|
[
|
|
9497
9608
|
"reset-before",
|
|
@@ -9503,109 +9614,102 @@ ${U}
|
|
|
9503
9614
|
"close",
|
|
9504
9615
|
"error-click",
|
|
9505
9616
|
"error-close"
|
|
9506
|
-
].forEach((
|
|
9507
|
-
if (
|
|
9617
|
+
].forEach((W) => {
|
|
9618
|
+
if (W.startsWith("error-") && t === "poll")
|
|
9508
9619
|
return;
|
|
9509
|
-
const
|
|
9510
|
-
if (!e.hasAttribute(
|
|
9620
|
+
const z = p.attrName(t, W);
|
|
9621
|
+
if (!e.hasAttribute(z))
|
|
9511
9622
|
return;
|
|
9512
|
-
const
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
m.error(
|
|
9520
|
-
"Haori",
|
|
9521
|
-
`${K} にはクリックする要素のセレクタが必要です。`
|
|
9522
|
-
);
|
|
9523
|
-
else if (U === "open" || U === "close" || U === "error-close") {
|
|
9524
|
-
const le = e.getTarget().closest("dialog");
|
|
9525
|
-
le ? Q.push(D.get(le)) : m.error("Haori", `Ancestor <dialog> not found (${K})`);
|
|
9526
|
-
} else
|
|
9527
|
-
Q.push(e);
|
|
9528
|
-
if (Q.length > 0)
|
|
9529
|
-
switch (U) {
|
|
9623
|
+
const X = p.resolveSelectorTargets(
|
|
9624
|
+
e,
|
|
9625
|
+
z,
|
|
9626
|
+
W
|
|
9627
|
+
);
|
|
9628
|
+
if (X.length > 0)
|
|
9629
|
+
switch (W) {
|
|
9530
9630
|
case "reset-before":
|
|
9531
|
-
r.resetBeforeFragments =
|
|
9631
|
+
r.resetBeforeFragments = X;
|
|
9532
9632
|
break;
|
|
9533
9633
|
case "reset":
|
|
9534
|
-
r.resetFragments =
|
|
9634
|
+
r.resetFragments = X;
|
|
9535
9635
|
break;
|
|
9536
9636
|
case "refetch":
|
|
9537
|
-
r.refetchFragments =
|
|
9637
|
+
r.refetchFragments = X;
|
|
9538
9638
|
break;
|
|
9539
9639
|
case "click":
|
|
9540
|
-
r.clickFragments =
|
|
9640
|
+
r.clickFragments = X, r.clickAwait = e.hasAttribute(`${z}-await`);
|
|
9541
9641
|
break;
|
|
9542
9642
|
case "copy":
|
|
9543
|
-
r.copyFragments =
|
|
9643
|
+
r.copyFragments = X;
|
|
9544
9644
|
break;
|
|
9545
9645
|
case "open":
|
|
9546
|
-
r.openFragments =
|
|
9646
|
+
r.openFragments = X;
|
|
9547
9647
|
break;
|
|
9548
9648
|
case "close":
|
|
9549
|
-
r.closeFragments =
|
|
9649
|
+
r.closeFragments = X;
|
|
9550
9650
|
break;
|
|
9551
9651
|
case "error-click":
|
|
9552
|
-
r.errorClickFragments =
|
|
9553
|
-
`${
|
|
9652
|
+
r.errorClickFragments = X, r.errorClickAwait = e.hasAttribute(
|
|
9653
|
+
`${z}-await`
|
|
9554
9654
|
);
|
|
9555
9655
|
break;
|
|
9556
9656
|
case "error-close":
|
|
9557
|
-
r.errorCloseFragments =
|
|
9657
|
+
r.errorCloseFragments = X;
|
|
9558
9658
|
break;
|
|
9559
9659
|
}
|
|
9560
|
-
})
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9660
|
+
}), t !== "poll" && (r.errorStatusActions = p.readErrorStatusActions(
|
|
9661
|
+
e,
|
|
9662
|
+
r,
|
|
9663
|
+
t
|
|
9664
|
+
));
|
|
9665
|
+
const oe = p.attrName(t, "copy-source");
|
|
9666
|
+
if (e.hasAttribute(oe)) {
|
|
9667
|
+
const W = Z.read(e, oe);
|
|
9668
|
+
if (W) {
|
|
9669
|
+
const z = Z.query(W, oe);
|
|
9670
|
+
if (z !== null) {
|
|
9671
|
+
const X = I.get(z);
|
|
9672
|
+
X ? r.copySourceFragment = X : m.error(
|
|
9569
9673
|
"Haori",
|
|
9570
|
-
`Element is not managed by Haori: ${
|
|
9674
|
+
`Element is not managed by Haori: ${W} (${oe})`
|
|
9571
9675
|
);
|
|
9572
9676
|
} else
|
|
9573
9677
|
m.error(
|
|
9574
9678
|
"Haori",
|
|
9575
|
-
`Element not found: ${
|
|
9679
|
+
`Element not found: ${W} (${oe})`
|
|
9576
9680
|
);
|
|
9577
9681
|
} else
|
|
9578
9682
|
r.copySourceFragment = e;
|
|
9579
9683
|
}
|
|
9580
9684
|
}
|
|
9581
9685
|
if (!t && (e.hasAttribute(p.attrName(null, "data", !0)) && (r.dataAttrName = p.attrName(null, "data", !0)), e.hasAttribute(p.attrName(null, "form", !0)))) {
|
|
9582
|
-
const T =
|
|
9686
|
+
const T = Z.read(
|
|
9583
9687
|
e,
|
|
9584
9688
|
p.attrName(null, "form", !0)
|
|
9585
9689
|
);
|
|
9586
9690
|
if (T) {
|
|
9587
|
-
const L =
|
|
9691
|
+
const L = Z.query(
|
|
9588
9692
|
T,
|
|
9589
9693
|
p.attrName(null, "form", !0)
|
|
9590
9694
|
);
|
|
9591
|
-
L !== null ? r.formFragment =
|
|
9592
|
-
|
|
9695
|
+
L !== null ? r.formFragment = k.getFormFragment(
|
|
9696
|
+
I.get(L)
|
|
9593
9697
|
) : m.error(
|
|
9594
9698
|
"Haori",
|
|
9595
9699
|
`Form element not found: ${T} (${p.attrName(null, "fetch-form", !0)})`
|
|
9596
9700
|
);
|
|
9597
9701
|
} else
|
|
9598
|
-
r.formFragment =
|
|
9599
|
-
}
|
|
9600
|
-
const
|
|
9601
|
-
if (e.hasAttribute(
|
|
9602
|
-
const T =
|
|
9603
|
-
T ? (
|
|
9604
|
-
const
|
|
9605
|
-
|
|
9702
|
+
r.formFragment = k.getFormFragment(e);
|
|
9703
|
+
}
|
|
9704
|
+
const se = t ? p.attrName(t, "fetch-state") : p.attrName(null, "state", !0);
|
|
9705
|
+
if (e.hasAttribute(se)) {
|
|
9706
|
+
const T = Z.read(e, se), L = [];
|
|
9707
|
+
T ? (Z.queryAll(T, se).forEach((Q) => {
|
|
9708
|
+
const de = I.get(Q);
|
|
9709
|
+
de && L.push(de);
|
|
9606
9710
|
}), L.length === 0 && m.error(
|
|
9607
9711
|
"Haori",
|
|
9608
|
-
`Element not found: ${T} (${
|
|
9712
|
+
`Element not found: ${T} (${se})`
|
|
9609
9713
|
)) : L.push(e), L.length > 0 && (r.fetchStateFragments = L);
|
|
9610
9714
|
}
|
|
9611
9715
|
const G = t ? p.attrName(t, "store-clear") : p.attrName(null, "store-clear", !0);
|
|
@@ -9620,10 +9724,10 @@ ${U}
|
|
|
9620
9724
|
r.storeClearKey = L;
|
|
9621
9725
|
const Y = e.getRawAttribute(
|
|
9622
9726
|
`${G}-type`
|
|
9623
|
-
),
|
|
9624
|
-
|
|
9727
|
+
), Q = Y === null ? "session" : Y.trim();
|
|
9728
|
+
Q === "local" || Q === "session" ? r.storeClearKind = Q : (m.warn(
|
|
9625
9729
|
"Haori",
|
|
9626
|
-
`${G}-type は session または local を指定してください(session として扱います): ${
|
|
9730
|
+
`${G}-type は session または local を指定してください(session として扱います): ${Q}`
|
|
9627
9731
|
), r.storeClearKind = "session");
|
|
9628
9732
|
}
|
|
9629
9733
|
}
|
|
@@ -9737,8 +9841,8 @@ ${U}
|
|
|
9737
9841
|
return this.skipped = !0, !1;
|
|
9738
9842
|
if (this.options.formFragment && this.validate(this.options.formFragment) === !1)
|
|
9739
9843
|
return !1;
|
|
9740
|
-
if (!this.options.formFragment && this.options.targetFragment &&
|
|
9741
|
-
|
|
9844
|
+
if (!this.options.formFragment && this.options.targetFragment && k.warnUnvalidatedCustomValidity(
|
|
9845
|
+
k.getFormFragment(this.options.targetFragment),
|
|
9742
9846
|
`${l.prefix}${this.eventType ?? "fetch"}-form が解決できません`
|
|
9743
9847
|
), !this.evaluateExecutionCondition())
|
|
9744
9848
|
return this.skipped = !0, !1;
|
|
@@ -9758,7 +9862,7 @@ ${U}
|
|
|
9758
9862
|
return !1;
|
|
9759
9863
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
9760
9864
|
this.options.resetBeforeFragments.map(
|
|
9761
|
-
(g) =>
|
|
9865
|
+
(g) => k.reset(g, this.operationSequence)
|
|
9762
9866
|
)
|
|
9763
9867
|
), this.captureHistorySnapshots());
|
|
9764
9868
|
const r = this.prepareFetchRequest();
|
|
@@ -9778,40 +9882,40 @@ ${U}
|
|
|
9778
9882
|
}
|
|
9779
9883
|
const c = Object.keys(i).length > 0;
|
|
9780
9884
|
if (n) {
|
|
9781
|
-
const g = (s?.method || "GET").toUpperCase(), E = !a && o && r.transportMode === "query-get" &&
|
|
9885
|
+
const g = (s?.method || "GET").toUpperCase(), E = !a && o && r.transportMode === "query-get" && Ut(s) && !He(g) ? r.baseUrl ?? n : n, A = Vt(
|
|
9782
9886
|
E,
|
|
9783
9887
|
s
|
|
9784
9888
|
);
|
|
9785
9889
|
n = A.url;
|
|
9786
|
-
const
|
|
9787
|
-
if (
|
|
9890
|
+
const D = { ...A.options }, N = A.normalized ? A.requestedMethod : r.requestedMethod, B = A.effectiveMethod, F = r.transportMode === "query-get" || A.normalized, j = A.queryString ?? r.queryString;
|
|
9891
|
+
if (F && m.info("Haori demo fetch normalization", {
|
|
9788
9892
|
runtime: l.runtime,
|
|
9789
|
-
requestedMethod:
|
|
9790
|
-
effectiveMethod:
|
|
9893
|
+
requestedMethod: N,
|
|
9894
|
+
effectiveMethod: B,
|
|
9791
9895
|
transportMode: "query-get",
|
|
9792
9896
|
url: n,
|
|
9793
9897
|
payload: c ? i : void 0,
|
|
9794
9898
|
queryString: j
|
|
9795
9899
|
}), this.options.targetFragment && n) {
|
|
9796
|
-
const
|
|
9900
|
+
const J = performance.now(), _ = {
|
|
9797
9901
|
runtime: l.runtime,
|
|
9798
|
-
requestedMethod:
|
|
9799
|
-
effectiveMethod:
|
|
9800
|
-
transportMode:
|
|
9801
|
-
...
|
|
9902
|
+
requestedMethod: N,
|
|
9903
|
+
effectiveMethod: B,
|
|
9904
|
+
transportMode: F ? "query-get" : "http",
|
|
9905
|
+
...F ? { queryString: j } : {}
|
|
9802
9906
|
};
|
|
9803
|
-
return
|
|
9907
|
+
return H.fetchStart(
|
|
9804
9908
|
this.options.targetFragment.getTarget(),
|
|
9805
9909
|
n,
|
|
9806
|
-
|
|
9910
|
+
D,
|
|
9807
9911
|
c ? i : void 0,
|
|
9808
9912
|
_
|
|
9809
|
-
), await this.injectFetchState("loading"), await p.invokeFetch(n,
|
|
9913
|
+
), await this.injectFetchState("loading"), await p.invokeFetch(n, D).then((P) => this.handleFetchResult(
|
|
9810
9914
|
P,
|
|
9811
9915
|
n || void 0,
|
|
9812
|
-
|
|
9916
|
+
J
|
|
9813
9917
|
)).catch(async (P) => {
|
|
9814
|
-
throw n &&
|
|
9918
|
+
throw n && H.fetchError(
|
|
9815
9919
|
this.options.targetFragment.getTarget(),
|
|
9816
9920
|
n,
|
|
9817
9921
|
P
|
|
@@ -9822,35 +9926,35 @@ ${U}
|
|
|
9822
9926
|
), await this.runErrorActions(null), P;
|
|
9823
9927
|
});
|
|
9824
9928
|
}
|
|
9825
|
-
return await fetch(n,
|
|
9929
|
+
return await fetch(n, D).then((J) => this.handleFetchResult(J, n || void 0));
|
|
9826
9930
|
}
|
|
9827
9931
|
if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && c) {
|
|
9828
9932
|
const g = this.options.formFragment, y = g.getTarget(), E = /* @__PURE__ */ new Set();
|
|
9829
9933
|
e && e.appliedDisabledAttribute && this.options.targetFragment && E.add(this.options.targetFragment);
|
|
9830
|
-
const A = g.getRawBindingData(),
|
|
9831
|
-
let
|
|
9832
|
-
if (
|
|
9833
|
-
|
|
9834
|
-
const
|
|
9835
|
-
|
|
9836
|
-
(j ? j.value :
|
|
9837
|
-
|
|
9934
|
+
const A = g.getRawBindingData(), D = Ue(i), N = g.getAttribute(`${l.prefix}form-arg`);
|
|
9935
|
+
let B;
|
|
9936
|
+
if (N) {
|
|
9937
|
+
B = { ...A ?? {} };
|
|
9938
|
+
const F = String(N), j = k.resolveAncestorArgOwner(g, F);
|
|
9939
|
+
B[F] = k.mergeCollectedValues(
|
|
9940
|
+
(j ? j.value : B[F]) ?? null,
|
|
9941
|
+
D
|
|
9838
9942
|
);
|
|
9839
9943
|
} else
|
|
9840
|
-
|
|
9944
|
+
B = k.mergeCollectedValues(
|
|
9841
9945
|
A,
|
|
9842
|
-
|
|
9843
|
-
|
|
9946
|
+
D,
|
|
9947
|
+
k.ancestorBaseResolver(g)
|
|
9844
9948
|
);
|
|
9845
|
-
await $.setBindingData(y,
|
|
9949
|
+
await $.setBindingData(y, B, {
|
|
9846
9950
|
skipFragments: E,
|
|
9847
9951
|
kind: "nonSupply",
|
|
9848
9952
|
sequence: this.operationSequence,
|
|
9849
|
-
editedPaths:
|
|
9953
|
+
editedPaths: k.collectEditedPaths(
|
|
9850
9954
|
g,
|
|
9851
9955
|
this.operationSequence,
|
|
9852
|
-
|
|
9853
|
-
|
|
9956
|
+
N ? String(N) : "",
|
|
9957
|
+
D
|
|
9854
9958
|
)
|
|
9855
9959
|
});
|
|
9856
9960
|
}
|
|
@@ -10020,7 +10124,7 @@ ${U}
|
|
|
10020
10124
|
break;
|
|
10021
10125
|
await t(s), this.downloadReceivedBytes += s.byteLength, this.dropTotalBytesIfExceeded();
|
|
10022
10126
|
const a = Date.now();
|
|
10023
|
-
a - r >=
|
|
10127
|
+
a - r >= Ct && (r = a, await this.injectFetchState("loading"));
|
|
10024
10128
|
}
|
|
10025
10129
|
} catch (n) {
|
|
10026
10130
|
return m.error("Haori", `応答をファイルとして読み取れませんでした: ${n}`), !1;
|
|
@@ -10094,7 +10198,7 @@ ${U}
|
|
|
10094
10198
|
`保存先のフォルダを確かめられなかったため、今までどおり保存します: ${c}`
|
|
10095
10199
|
), "fallback";
|
|
10096
10200
|
}
|
|
10097
|
-
if (s && !await
|
|
10201
|
+
if (s && !await fe().confirm(
|
|
10098
10202
|
`${n} は既にあります。上書きしますか?`
|
|
10099
10203
|
))
|
|
10100
10204
|
return "cancelled";
|
|
@@ -10178,8 +10282,8 @@ ${U}
|
|
|
10178
10282
|
* @returns 表示の完了 Promise
|
|
10179
10283
|
*/
|
|
10180
10284
|
async showDownloadFailure() {
|
|
10181
|
-
const e = this.options.formFragment ?? (this.options.targetFragment ?
|
|
10182
|
-
await r.clearMessages(t), await r.addErrorMessage(t,
|
|
10285
|
+
const e = this.options.formFragment ?? (this.options.targetFragment ? k.getFormFragment(this.options.targetFragment) || this.options.targetFragment : null), t = e ? e.getTarget() : document.body, r = fe();
|
|
10286
|
+
await r.clearMessages(t), await r.addErrorMessage(t, Je);
|
|
10183
10287
|
}
|
|
10184
10288
|
/**
|
|
10185
10289
|
* 保存するファイル名を決めます。
|
|
@@ -10262,20 +10366,29 @@ ${U}
|
|
|
10262
10366
|
* フェッチ後の処理を実行します。
|
|
10263
10367
|
*/
|
|
10264
10368
|
async handleFetchResult(e, t, r) {
|
|
10265
|
-
const i =
|
|
10266
|
-
if (!e.ok)
|
|
10267
|
-
|
|
10369
|
+
const i = fe();
|
|
10370
|
+
if (!e.ok) {
|
|
10371
|
+
if (pt(e.status))
|
|
10372
|
+
return !1;
|
|
10373
|
+
this.options.targetFragment && t && H.fetchError(
|
|
10268
10374
|
this.options.targetFragment.getTarget(),
|
|
10269
10375
|
t,
|
|
10270
10376
|
new Error(`${e.status} ${e.statusText}`),
|
|
10271
10377
|
e.status,
|
|
10272
10378
|
r
|
|
10273
|
-
)
|
|
10379
|
+
);
|
|
10380
|
+
const E = await this.handleFetchError(
|
|
10381
|
+
e,
|
|
10382
|
+
this.selectErrorActions(e.status)?.noMessage !== !0
|
|
10383
|
+
);
|
|
10384
|
+
return await this.injectFetchState(
|
|
10274
10385
|
"error",
|
|
10275
10386
|
e.status,
|
|
10276
|
-
e.statusText || null
|
|
10277
|
-
|
|
10278
|
-
|
|
10387
|
+
e.statusText || null,
|
|
10388
|
+
E
|
|
10389
|
+
), await this.runErrorActions(e.status), !1;
|
|
10390
|
+
}
|
|
10391
|
+
if (this.options.targetFragment && t && r && H.fetchEnd(
|
|
10279
10392
|
this.options.targetFragment.getTarget(),
|
|
10280
10393
|
t,
|
|
10281
10394
|
e.status,
|
|
@@ -10296,13 +10409,13 @@ ${U}
|
|
|
10296
10409
|
return await this.showDownloadFailure(), await this.injectFetchState(
|
|
10297
10410
|
"error",
|
|
10298
10411
|
e.status,
|
|
10299
|
-
|
|
10412
|
+
Je
|
|
10300
10413
|
), !1;
|
|
10301
10414
|
}
|
|
10302
10415
|
const n = [];
|
|
10303
10416
|
n.push(this.bindResult(e)), n.push(this.adjust()), n.push(this.addRow()), n.push(this.removeRow()), n.push(this.movePrevRow()), n.push(this.moveNextRow()), await Promise.all(n), await this.injectFetchState("success", e.status, null), this.options.resetFragments && this.options.resetFragments.length > 0 && await Promise.all(
|
|
10304
10417
|
this.options.resetFragments.map(
|
|
10305
|
-
(E) =>
|
|
10418
|
+
(E) => k.reset(E, this.operationSequence)
|
|
10306
10419
|
)
|
|
10307
10420
|
), await this.copy();
|
|
10308
10421
|
const s = [];
|
|
@@ -10331,12 +10444,18 @@ ${U}
|
|
|
10331
10444
|
const c = p.normalizeAttributeText(
|
|
10332
10445
|
this.resolveLateAttribute("toast", this.options.toastMessage)
|
|
10333
10446
|
);
|
|
10334
|
-
|
|
10447
|
+
if (c) {
|
|
10448
|
+
const E = p.toToastLevel(
|
|
10449
|
+
this.resolveLateAttribute("toast-level", this.options.toastLevel)
|
|
10450
|
+
);
|
|
10451
|
+
await i.toast(c, E ?? "info");
|
|
10452
|
+
}
|
|
10453
|
+
this.clearStore(), this.pushHistory();
|
|
10335
10454
|
const u = this.resolveLateAttribute(
|
|
10336
10455
|
"scroll",
|
|
10337
10456
|
this.options.scrollTarget
|
|
10338
10457
|
);
|
|
10339
|
-
u &&
|
|
10458
|
+
u && Z.query(
|
|
10340
10459
|
u,
|
|
10341
10460
|
p.attrName(this.eventType, "scroll"),
|
|
10342
10461
|
document
|
|
@@ -10360,12 +10479,12 @@ ${U}
|
|
|
10360
10479
|
this.options.redirectReturnParam
|
|
10361
10480
|
);
|
|
10362
10481
|
if (A) {
|
|
10363
|
-
const
|
|
10364
|
-
if (
|
|
10365
|
-
const
|
|
10366
|
-
|
|
10482
|
+
const N = new URLSearchParams(window.location.search).get(A);
|
|
10483
|
+
if (N !== null) {
|
|
10484
|
+
const B = N.trim();
|
|
10485
|
+
gt.isSafeLocalPath(B) ? E = B : m.warn(
|
|
10367
10486
|
"Haori",
|
|
10368
|
-
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${
|
|
10487
|
+
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${N}`
|
|
10369
10488
|
);
|
|
10370
10489
|
}
|
|
10371
10490
|
}
|
|
@@ -10428,25 +10547,62 @@ ${U}
|
|
|
10428
10547
|
* @returns 実行完了の Promise
|
|
10429
10548
|
*/
|
|
10430
10549
|
async runErrorActions(e) {
|
|
10431
|
-
const t = this.
|
|
10432
|
-
if (
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10550
|
+
const t = this.selectErrorActions(e);
|
|
10551
|
+
if (!t || await this.clickTargets(
|
|
10552
|
+
t.clickFragments,
|
|
10553
|
+
t.clickAwait,
|
|
10554
|
+
`${t.key}-click-await`
|
|
10436
10555
|
))
|
|
10437
10556
|
return;
|
|
10438
|
-
const i =
|
|
10439
|
-
|
|
10557
|
+
const i = fe(), n = [];
|
|
10558
|
+
t.closeFragments?.forEach((a) => {
|
|
10440
10559
|
const o = a.getTarget();
|
|
10441
10560
|
o instanceof HTMLElement ? n.push(i.closeDialog(o)) : m.error("Haori", "Element is not an HTML element: ", o);
|
|
10442
10561
|
}), await Promise.all(n);
|
|
10443
10562
|
const s = p.normalizeAttributeText(
|
|
10444
|
-
this.resolveLateAttribute(
|
|
10445
|
-
);
|
|
10446
|
-
s && await i.toast(
|
|
10447
|
-
s,
|
|
10448
|
-
this.options.errorToastLevel ?? "info"
|
|
10563
|
+
this.resolveLateAttribute(`${t.key}-toast`, t.toastMessage)
|
|
10449
10564
|
);
|
|
10565
|
+
if (s) {
|
|
10566
|
+
const a = p.toToastLevel(
|
|
10567
|
+
this.resolveLateAttribute(
|
|
10568
|
+
`${t.key}-toast-level`,
|
|
10569
|
+
t.toastLevel
|
|
10570
|
+
)
|
|
10571
|
+
);
|
|
10572
|
+
await i.toast(s, a ?? "info");
|
|
10573
|
+
}
|
|
10574
|
+
}
|
|
10575
|
+
/**
|
|
10576
|
+
* 失敗に使う失敗時のアクションの組を選びます。
|
|
10577
|
+
*
|
|
10578
|
+
* 失敗したステータスの組があればその組を、無ければ `data-{event}-error-status`
|
|
10579
|
+
* の絞り込みに当たる場合に限りステータスの付かない組を返します(仕様「失敗時の
|
|
10580
|
+
* アクション」の「ステータスごとの組には、`-error-status` が効きません」)。
|
|
10581
|
+
*
|
|
10582
|
+
* @param status HTTP ステータス。通信の例外では null
|
|
10583
|
+
* @returns 使う組。実行しない場合は null
|
|
10584
|
+
*/
|
|
10585
|
+
selectErrorActions(e) {
|
|
10586
|
+
const t = e === null ? void 0 : this.options.errorStatusActions?.get(e);
|
|
10587
|
+
return t || (this.appliesErrorActions(e) ? {
|
|
10588
|
+
key: "error",
|
|
10589
|
+
clickFragments: this.options.errorClickFragments ?? null,
|
|
10590
|
+
clickAwait: this.options.errorClickAwait === !0,
|
|
10591
|
+
closeFragments: this.options.errorCloseFragments ?? null,
|
|
10592
|
+
toastMessage: this.options.errorToastMessage ?? null,
|
|
10593
|
+
toastLevel: this.options.errorToastLevel ?? null,
|
|
10594
|
+
noMessage: this.options.errorNoMessage === !0
|
|
10595
|
+
} : null);
|
|
10596
|
+
}
|
|
10597
|
+
/**
|
|
10598
|
+
* 失敗時のアクションを実行する失敗かどうかを判定します。
|
|
10599
|
+
*
|
|
10600
|
+
* @param status HTTP ステータス。通信の例外では null
|
|
10601
|
+
* @returns `data-{event}-error-status` の宣言に当たる場合(宣言が無い場合を含む)は true
|
|
10602
|
+
*/
|
|
10603
|
+
appliesErrorActions(e) {
|
|
10604
|
+
const t = this.options.errorStatuses;
|
|
10605
|
+
return t === void 0 || e !== null && t.includes(e);
|
|
10450
10606
|
}
|
|
10451
10607
|
/**
|
|
10452
10608
|
* bind より後で使うアクション属性を、使用直前に評価し直します。
|
|
@@ -10465,7 +10621,7 @@ ${U}
|
|
|
10465
10621
|
if (!i || !n || !n.hasAttribute(i.attributeName))
|
|
10466
10622
|
return r;
|
|
10467
10623
|
const s = n.getAttributeEvaluation(i.attributeName);
|
|
10468
|
-
return s === null ? r : s.hasUnresolvedReference && !i.hasUnresolvedReference ? (
|
|
10624
|
+
return s === null ? r : s.hasUnresolvedReference && !i.hasUnresolvedReference ? (q.isEnabled() && m.warn(
|
|
10469
10625
|
"Haori",
|
|
10470
10626
|
`${i.attributeName} の参照が手続きの途中で解決できなくなったため、手続き開始時の値を使います`
|
|
10471
10627
|
), r) : s.value ?? null;
|
|
@@ -10495,7 +10651,7 @@ ${U}
|
|
|
10495
10651
|
g != null && (Array.isArray(g) ? (o.searchParams.delete(d), g.forEach((y) => o.searchParams.append(d, String(y)))) : typeof g == "object" ? o.searchParams.set(d, JSON.stringify(g)) : o.searchParams.set(d, String(g)));
|
|
10496
10652
|
};
|
|
10497
10653
|
n && c(r), s && c(i), history.pushState(
|
|
10498
|
-
{ [
|
|
10654
|
+
{ [$t]: !0 },
|
|
10499
10655
|
"",
|
|
10500
10656
|
o.toString()
|
|
10501
10657
|
), $.refreshUrlParams();
|
|
@@ -10505,69 +10661,80 @@ ${U}
|
|
|
10505
10661
|
}
|
|
10506
10662
|
/**
|
|
10507
10663
|
* フェッチエラー応答のメッセージを適切な要素へ伝播します。
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10664
|
+
*
|
|
10665
|
+
* 表示しない場合も、既存メッセージのクリアと本文の解析は行います。
|
|
10666
|
+
*
|
|
10667
|
+
* @param response エラー応答
|
|
10668
|
+
* @param showMessages 本文のメッセージを表示するかどうか
|
|
10669
|
+
* @returns 本文から取り出した文言を、表示する順に改行で連結した文字列
|
|
10670
|
+
* (`_fetch.responseMessage`)。取り出せない場合は null
|
|
10671
|
+
*/
|
|
10672
|
+
async handleFetchError(e, t) {
|
|
10673
|
+
let r = null;
|
|
10674
|
+
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r = k.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
|
|
10675
|
+
const i = r ? r.getTarget() : document.body;
|
|
10676
|
+
await fe().clearMessages(i);
|
|
10677
|
+
const n = async (u) => {
|
|
10678
|
+
const d = r ? r.getTarget() : document.body;
|
|
10679
|
+
await fe().addErrorMessage(d, u);
|
|
10680
|
+
}, s = () => {
|
|
10518
10681
|
if (!this.options.scrollOnError)
|
|
10519
10682
|
return;
|
|
10520
|
-
const
|
|
10521
|
-
(
|
|
10683
|
+
const u = r ? r.getTarget() : document.body;
|
|
10684
|
+
(u.getAttribute("data-message-level") === "error" ? u : u.parentElement?.getAttribute("data-message-level") === "error" ? u.parentElement : u.querySelector('[data-message-level="error"]'))?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
10685
|
+
}, a = async (u) => {
|
|
10686
|
+
if (t) {
|
|
10687
|
+
u.length === 0 && await n(`${e.status} ${e.statusText}`);
|
|
10688
|
+
for (const d of u)
|
|
10689
|
+
d.key && r ? await k.addErrorMessage(r, d.key, d.message) : await n(d.message);
|
|
10690
|
+
s();
|
|
10691
|
+
}
|
|
10692
|
+
return u.length === 0 ? null : u.map((d) => d.message).join(`
|
|
10693
|
+
`);
|
|
10522
10694
|
};
|
|
10523
10695
|
if ((e.headers.get("Content-Type") || "").includes("application/json"))
|
|
10524
10696
|
try {
|
|
10525
|
-
const
|
|
10526
|
-
if (Array.isArray(
|
|
10527
|
-
const
|
|
10528
|
-
for (const
|
|
10529
|
-
if (
|
|
10530
|
-
const
|
|
10531
|
-
if (
|
|
10697
|
+
const u = await e.json(), d = [];
|
|
10698
|
+
if (Array.isArray(u)) {
|
|
10699
|
+
const g = /* @__PURE__ */ new Map(), y = [];
|
|
10700
|
+
for (const E of u)
|
|
10701
|
+
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
10702
|
+
const A = E.key, D = E.message, N = typeof A == "string" && A.length > 0 ? A : null, B = typeof D == "string" ? D : D != null ? String(D) : "";
|
|
10703
|
+
if (B.length === 0)
|
|
10532
10704
|
continue;
|
|
10533
|
-
if (
|
|
10534
|
-
const
|
|
10535
|
-
|
|
10705
|
+
if (N !== null) {
|
|
10706
|
+
const F = g.get(N) ?? [];
|
|
10707
|
+
F.push(B), g.set(N, F);
|
|
10536
10708
|
} else
|
|
10537
|
-
|
|
10538
|
-
} else typeof
|
|
10539
|
-
for (const [
|
|
10540
|
-
|
|
10709
|
+
y.push(B);
|
|
10710
|
+
} else typeof E == "string" && E.length > 0 && y.push(E);
|
|
10711
|
+
for (const [E, A] of g)
|
|
10712
|
+
d.push({ key: E, message: A.join(`
|
|
10541
10713
|
`) });
|
|
10542
|
-
for (const
|
|
10543
|
-
|
|
10544
|
-
} else if (
|
|
10545
|
-
if (typeof
|
|
10546
|
-
for (const
|
|
10547
|
-
typeof
|
|
10548
|
-
if (
|
|
10549
|
-
for (const [
|
|
10550
|
-
Array.isArray(
|
|
10551
|
-
`) }) : typeof
|
|
10552
|
-
if (
|
|
10553
|
-
for (const [
|
|
10554
|
-
|
|
10555
|
-
`) }) : typeof
|
|
10714
|
+
for (const E of y)
|
|
10715
|
+
d.push({ message: E });
|
|
10716
|
+
} else if (u && typeof u == "object") {
|
|
10717
|
+
if (typeof u.message == "string" && d.push({ message: u.message }), Array.isArray(u.messages))
|
|
10718
|
+
for (const g of u.messages)
|
|
10719
|
+
typeof g == "string" && d.push({ message: g });
|
|
10720
|
+
if (u.errors && typeof u.errors == "object")
|
|
10721
|
+
for (const [g, y] of Object.entries(u.errors))
|
|
10722
|
+
Array.isArray(y) ? d.push({ key: g, message: y.join(`
|
|
10723
|
+
`) }) : typeof y == "string" ? d.push({ key: g, message: y }) : y != null && d.push({ key: g, message: String(y) });
|
|
10724
|
+
if (d.length === 0)
|
|
10725
|
+
for (const [g, y] of Object.entries(u))
|
|
10726
|
+
g === "message" || g === "messages" || g === "errors" || (Array.isArray(y) ? d.push({ key: g, message: y.join(`
|
|
10727
|
+
`) }) : typeof y == "string" && d.push({ key: g, message: y }));
|
|
10556
10728
|
}
|
|
10557
|
-
|
|
10558
|
-
return await i(`${e.status} ${e.statusText}`), n(), !1;
|
|
10559
|
-
for (const c of o)
|
|
10560
|
-
c.key && t ? await F.addErrorMessage(t, c.key, c.message) : await i(c.message);
|
|
10561
|
-
return n(), !1;
|
|
10729
|
+
return await a(d);
|
|
10562
10730
|
} catch {
|
|
10563
10731
|
}
|
|
10732
|
+
let c = "";
|
|
10564
10733
|
try {
|
|
10565
|
-
|
|
10566
|
-
a && a.trim().length > 0 ? await i(a.trim()) : await i(`${e.status} ${e.statusText}`);
|
|
10734
|
+
c = (await e.text()).trim();
|
|
10567
10735
|
} catch {
|
|
10568
|
-
await i(`${e.status} ${e.statusText}`);
|
|
10569
10736
|
}
|
|
10570
|
-
return
|
|
10737
|
+
return await a(c.length > 0 ? [{ message: c }] : []);
|
|
10571
10738
|
}
|
|
10572
10739
|
/**
|
|
10573
10740
|
* 対象のフラグメント以下の入力要素に対してバリデーションを実行します。
|
|
@@ -10578,11 +10745,11 @@ ${U}
|
|
|
10578
10745
|
*/
|
|
10579
10746
|
validate(e) {
|
|
10580
10747
|
if (this.options.valid !== !0)
|
|
10581
|
-
return
|
|
10748
|
+
return k.warnUnvalidatedCustomValidity(
|
|
10582
10749
|
e,
|
|
10583
10750
|
`${l.prefix}${this.eventType ?? "fetch"}-validate の指定がありません`
|
|
10584
10751
|
), !0;
|
|
10585
|
-
|
|
10752
|
+
k.applyCustomValidity(e);
|
|
10586
10753
|
const t = this.findFirstInvalid(e);
|
|
10587
10754
|
if (t === null)
|
|
10588
10755
|
return !0;
|
|
@@ -10673,14 +10840,14 @@ ${U}
|
|
|
10673
10840
|
const r = this.options.targetFragment;
|
|
10674
10841
|
if (!r)
|
|
10675
10842
|
return !0;
|
|
10676
|
-
const i = this.options.conditionAttributeName ?? `${l.prefix}if`, n =
|
|
10843
|
+
const i = this.options.conditionAttributeName ?? `${l.prefix}if`, n = k.buildConditionScope(
|
|
10677
10844
|
r,
|
|
10678
10845
|
this.options.formFragment ?? null
|
|
10679
|
-
), s =
|
|
10846
|
+
), s = ie.evaluateDetailed(t, n);
|
|
10680
10847
|
return s.unresolvedReference ? (e || m.warn(
|
|
10681
10848
|
"Haori",
|
|
10682
10849
|
`${i} の参照が解決できないため実行しません: ${t}`
|
|
10683
|
-
), !1) : s.value ? !0 : (!e &&
|
|
10850
|
+
), !1) : s.value ? !0 : (!e && q.isEnabled() && m.warn(
|
|
10684
10851
|
"Haori",
|
|
10685
10852
|
`${i} の条件が偽のため手続きを中断しました: ${t}`
|
|
10686
10853
|
), !1);
|
|
@@ -10721,7 +10888,7 @@ ${U}
|
|
|
10721
10888
|
*/
|
|
10722
10889
|
confirm() {
|
|
10723
10890
|
const e = this.options.confirmMessage;
|
|
10724
|
-
return e == null ? Promise.resolve(!0) :
|
|
10891
|
+
return e == null ? Promise.resolve(!0) : fe().confirm(e);
|
|
10725
10892
|
}
|
|
10726
10893
|
/**
|
|
10727
10894
|
* 結果データを対象のフラグメントにバインドします。
|
|
@@ -10738,7 +10905,7 @@ ${U}
|
|
|
10738
10905
|
let i = t ? JSON.parse(r) : r;
|
|
10739
10906
|
if (this.options.bindTransform)
|
|
10740
10907
|
try {
|
|
10741
|
-
i =
|
|
10908
|
+
i = ie.evaluate(this.options.bindTransform, {
|
|
10742
10909
|
response: i
|
|
10743
10910
|
});
|
|
10744
10911
|
} catch (o) {
|
|
@@ -10773,11 +10940,11 @@ ${U}
|
|
|
10773
10940
|
apply: (y) => {
|
|
10774
10941
|
const E = this.resolveCurrentRowItem(o, y), A = { ...E };
|
|
10775
10942
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
10776
|
-
const
|
|
10943
|
+
const D = E[g], N = D !== null && typeof D == "object" && !Array.isArray(D) ? D : {};
|
|
10777
10944
|
A[g] = this.mergeAppendBindingData(
|
|
10778
10945
|
o,
|
|
10779
10946
|
i,
|
|
10780
|
-
|
|
10947
|
+
N
|
|
10781
10948
|
);
|
|
10782
10949
|
} else
|
|
10783
10950
|
A[g] = i;
|
|
@@ -10870,7 +11037,7 @@ ${U}
|
|
|
10870
11037
|
return n.push(this.applyRowWrites(a)), Promise.all(n).then(() => {
|
|
10871
11038
|
const o = this.options.bindArg ?? null;
|
|
10872
11039
|
this.options.bindFragments.forEach((c) => {
|
|
10873
|
-
|
|
11040
|
+
H.bindComplete(c.getTarget(), o);
|
|
10874
11041
|
});
|
|
10875
11042
|
});
|
|
10876
11043
|
});
|
|
@@ -10917,7 +11084,7 @@ ${U}
|
|
|
10917
11084
|
t,
|
|
10918
11085
|
i ? 0 : r
|
|
10919
11086
|
);
|
|
10920
|
-
const n =
|
|
11087
|
+
const n = k.getValuesEditedAfter(
|
|
10921
11088
|
e,
|
|
10922
11089
|
i ? 0 : r
|
|
10923
11090
|
);
|
|
@@ -10926,9 +11093,9 @@ ${U}
|
|
|
10926
11093
|
const s = e.getAttribute(`${l.prefix}form-arg`);
|
|
10927
11094
|
if (s) {
|
|
10928
11095
|
const a = String(s), o = t[a], c = o && typeof o == "object" && !Array.isArray(o) ? o : {};
|
|
10929
|
-
return { ...t, [a]:
|
|
11096
|
+
return { ...t, [a]: pe(c, n) };
|
|
10930
11097
|
}
|
|
10931
|
-
return
|
|
11098
|
+
return pe(t, n);
|
|
10932
11099
|
}
|
|
10933
11100
|
/**
|
|
10934
11101
|
* 編集可能な行へのバインドについて、送信後の編集を要素データへ上書きし直します。
|
|
@@ -10951,11 +11118,11 @@ ${U}
|
|
|
10951
11118
|
return t;
|
|
10952
11119
|
const i = this.eventType === "poll";
|
|
10953
11120
|
!i && !this.twoWayCommitBind && $.clearUserEditMarks(e, r);
|
|
10954
|
-
const n =
|
|
11121
|
+
const n = k.getValuesEditedAfter(
|
|
10955
11122
|
e,
|
|
10956
11123
|
i ? 0 : r
|
|
10957
11124
|
);
|
|
10958
|
-
return Object.keys(n).length === 0 ? t :
|
|
11125
|
+
return Object.keys(n).length === 0 ? t : pe(t, n);
|
|
10959
11126
|
}
|
|
10960
11127
|
/**
|
|
10961
11128
|
* 祖先へのバインドについて、配下の `data-form-arg` フォームで送信後に行われた
|
|
@@ -10973,14 +11140,14 @@ ${U}
|
|
|
10973
11140
|
*/
|
|
10974
11141
|
reconcileAncestorArgFormEdits(e, t, r) {
|
|
10975
11142
|
let i = t;
|
|
10976
|
-
for (const { form: n, key: s } of
|
|
11143
|
+
for (const { form: n, key: s } of k.collectArgForms(e)) {
|
|
10977
11144
|
if (!Object.prototype.hasOwnProperty.call(i, s))
|
|
10978
11145
|
continue;
|
|
10979
|
-
const a =
|
|
11146
|
+
const a = k.getValuesEditedAfter(n, r);
|
|
10980
11147
|
if (Object.keys(a).length === 0)
|
|
10981
11148
|
continue;
|
|
10982
11149
|
const o = i[s], c = o && typeof o == "object" && !Array.isArray(o) ? o : {};
|
|
10983
|
-
i = { ...i, [s]:
|
|
11150
|
+
i = { ...i, [s]: pe(c, a) };
|
|
10984
11151
|
}
|
|
10985
11152
|
return i;
|
|
10986
11153
|
}
|
|
@@ -11056,8 +11223,8 @@ ${U}
|
|
|
11056
11223
|
* @returns 行の入力欄の状態を反映した要素データ
|
|
11057
11224
|
*/
|
|
11058
11225
|
resolveCurrentRowItem(e, t) {
|
|
11059
|
-
const r =
|
|
11060
|
-
return Object.keys(r).length === 0 ? t :
|
|
11226
|
+
const r = k.getValuesEditedAfter(e, 0);
|
|
11227
|
+
return Object.keys(r).length === 0 ? t : pe(t, r);
|
|
11061
11228
|
}
|
|
11062
11229
|
/**
|
|
11063
11230
|
* 行の要素データへコピーの値を反映します。
|
|
@@ -11085,9 +11252,9 @@ ${U}
|
|
|
11085
11252
|
* @returns コピー元のデータ
|
|
11086
11253
|
*/
|
|
11087
11254
|
resolveCopySourceData() {
|
|
11088
|
-
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ?
|
|
11255
|
+
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? xe(this.options.copySourceFragment) : $.withoutReservedBindingKeys(
|
|
11089
11256
|
this.options.copySourceFragment.getRawBindingData() ?? {}
|
|
11090
|
-
) : this.options.formFragment ?
|
|
11257
|
+
) : this.options.formFragment ? xe(this.options.formFragment) : this.options.targetFragment ? $.withoutReservedBindingKeys(
|
|
11091
11258
|
this.options.targetFragment.getRawBindingData() ?? {}
|
|
11092
11259
|
) : {};
|
|
11093
11260
|
}
|
|
@@ -11101,8 +11268,8 @@ ${U}
|
|
|
11101
11268
|
let t = !1;
|
|
11102
11269
|
const r = this.options.formFragment ?? this.options.selfValueFragment;
|
|
11103
11270
|
if (r) {
|
|
11104
|
-
const i =
|
|
11105
|
-
Object.assign(e, i),
|
|
11271
|
+
const i = k.getValues(r);
|
|
11272
|
+
Object.assign(e, i), k.carryCollectedRowIdentity(i, e);
|
|
11106
11273
|
}
|
|
11107
11274
|
if (this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
|
|
11108
11275
|
const i = p.resolveDataAttributeDetailed(
|
|
@@ -11155,7 +11322,7 @@ ${U}
|
|
|
11155
11322
|
), a = (n.method || "GET").toUpperCase(), o = l.runtime === "demo" && !He(a), c = o ? "GET" : a;
|
|
11156
11323
|
if (n.method = c, Object.keys(t).length > 0 && Ie(t)) {
|
|
11157
11324
|
const d = s.get("Content-Type") || "";
|
|
11158
|
-
c !== "GET" && c !== "HEAD" && c !== "OPTIONS" && /multipart\/form-data/i.test(d) ?
|
|
11325
|
+
c !== "GET" && c !== "HEAD" && c !== "OPTIONS" && /multipart\/form-data/i.test(d) ? Wt(t) && m.warn(
|
|
11159
11326
|
"Haori",
|
|
11160
11327
|
`A File value nested under ${l.prefix}form-object / ${l.prefix}form-list cannot be sent. Place file inputs at the top level of the collected form values.`
|
|
11161
11328
|
) : m.warn(
|
|
@@ -11164,7 +11331,7 @@ ${U}
|
|
|
11164
11331
|
);
|
|
11165
11332
|
}
|
|
11166
11333
|
if (c === "GET" || c === "HEAD" || c === "OPTIONS")
|
|
11167
|
-
Object.keys(t).length > 0 && (i =
|
|
11334
|
+
Object.keys(t).length > 0 && (i = mt(i, t));
|
|
11168
11335
|
else if (Object.keys(t).length > 0) {
|
|
11169
11336
|
const d = s.get("Content-Type") || "";
|
|
11170
11337
|
if (/multipart\/form-data/i.test(d)) {
|
|
@@ -11172,13 +11339,13 @@ ${U}
|
|
|
11172
11339
|
const g = new FormData();
|
|
11173
11340
|
for (const [y, E] of Object.entries(t))
|
|
11174
11341
|
E == null ? g.append(y, "") : E instanceof Blob ? g.append(y, E) : Array.isArray(E) ? E.forEach((A) => {
|
|
11175
|
-
A instanceof Blob ? g.append(y, A) : g.append(y,
|
|
11176
|
-
}) : g.append(y,
|
|
11342
|
+
A instanceof Blob ? g.append(y, A) : g.append(y, be(A));
|
|
11343
|
+
}) : g.append(y, be(E));
|
|
11177
11344
|
n.body = g;
|
|
11178
11345
|
} else if (/application\/x-www-form-urlencoded/i.test(d)) {
|
|
11179
11346
|
const g = new URLSearchParams();
|
|
11180
11347
|
for (const [y, E] of Object.entries(t))
|
|
11181
|
-
E !== void 0 && (Array.isArray(E) ? E.forEach((A) => g.append(y,
|
|
11348
|
+
E !== void 0 && (Array.isArray(E) ? E.forEach((A) => g.append(y, be(A))) : g.append(y, be(E)));
|
|
11182
11349
|
n.body = g;
|
|
11183
11350
|
} else
|
|
11184
11351
|
s.set("Content-Type", "application/json"), n.body = JSON.stringify(t);
|
|
@@ -11195,7 +11362,7 @@ ${U}
|
|
|
11195
11362
|
effectiveMethod: c,
|
|
11196
11363
|
queryString: u,
|
|
11197
11364
|
transportMode: o ? "query-get" : "http",
|
|
11198
|
-
signature:
|
|
11365
|
+
signature: jt(i, n)
|
|
11199
11366
|
};
|
|
11200
11367
|
}
|
|
11201
11368
|
/**
|
|
@@ -11205,7 +11372,7 @@ ${U}
|
|
|
11205
11372
|
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = p.resolveDataAttribute(
|
|
11206
11373
|
this.options.targetFragment,
|
|
11207
11374
|
this.options.historyDataAttrName
|
|
11208
|
-
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ?
|
|
11375
|
+
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? xe(this.options.historyFormFragment) : void 0;
|
|
11209
11376
|
}
|
|
11210
11377
|
/**
|
|
11211
11378
|
* history-data の評価値を取得します。
|
|
@@ -11227,7 +11394,7 @@ ${U}
|
|
|
11227
11394
|
if (this.historyFormSnapshot !== void 0)
|
|
11228
11395
|
return this.historyFormSnapshot;
|
|
11229
11396
|
if (this.options.historyFormFragment)
|
|
11230
|
-
return
|
|
11397
|
+
return xe(this.options.historyFormFragment);
|
|
11231
11398
|
}
|
|
11232
11399
|
/**
|
|
11233
11400
|
* copy-params が指定されている場合は include / exclude を考慮して抽出します。
|
|
@@ -11296,15 +11463,15 @@ ${U}
|
|
|
11296
11463
|
const t = this.options.targetFragment;
|
|
11297
11464
|
if (!t)
|
|
11298
11465
|
return m.error("Haori", "Target fragment is not specified for row operation."), null;
|
|
11299
|
-
const r = p.attrName(this.eventType, e), i =
|
|
11466
|
+
const r = p.attrName(this.eventType, e), i = Z.read(t, r);
|
|
11300
11467
|
if (i !== null && i.trim() !== "") {
|
|
11301
|
-
const s =
|
|
11468
|
+
const s = Z.query(i, r, document);
|
|
11302
11469
|
if (s === null)
|
|
11303
11470
|
return m.error(
|
|
11304
11471
|
"Haori",
|
|
11305
11472
|
`Row container not found: ${i} (${r})`
|
|
11306
11473
|
), null;
|
|
11307
|
-
const a =
|
|
11474
|
+
const a = I.get(s);
|
|
11308
11475
|
return a instanceof S ? a.hasAttribute(`${l.prefix}each`) ? a : (m.error(
|
|
11309
11476
|
"Haori",
|
|
11310
11477
|
`Row container must have ${l.prefix}each: ${i} (${r})`
|
|
@@ -11572,7 +11739,7 @@ ${U}
|
|
|
11572
11739
|
);
|
|
11573
11740
|
continue;
|
|
11574
11741
|
}
|
|
11575
|
-
a[d] = y, o = !0, u.syncWhenUnchanged === "supply" &&
|
|
11742
|
+
a[d] = y, o = !0, u.syncWhenUnchanged === "supply" && k.clearRowUserEditMarksForChangedKeys(u.row, y);
|
|
11576
11743
|
}
|
|
11577
11744
|
if (!o)
|
|
11578
11745
|
return;
|
|
@@ -11622,7 +11789,7 @@ ${U}
|
|
|
11622
11789
|
* @returns 反映完了の Promise
|
|
11623
11790
|
*/
|
|
11624
11791
|
static syncUnchangedRowValues(e, t, r) {
|
|
11625
|
-
return r === "supply" &&
|
|
11792
|
+
return r === "supply" && k.clearRowUserEditMarksForChangedKeys(e, t), k.syncRowValues(e, t);
|
|
11626
11793
|
}
|
|
11627
11794
|
/**
|
|
11628
11795
|
* 行の要素データが同じ内容かどうかを判定します。
|
|
@@ -11837,27 +12004,29 @@ ${U}
|
|
|
11837
12004
|
* @param status フェッチ状態('loading' | 'success' | 'error')
|
|
11838
12005
|
* @param statusCode HTTP ステータスコード(無い場合は null)
|
|
11839
12006
|
* @param message エラーメッセージ等(無い場合は null)
|
|
12007
|
+
* @param responseMessage エラー応答の本文から取り出した文言(無い場合は null)
|
|
11840
12008
|
* @returns 注入完了の Promise
|
|
11841
12009
|
*/
|
|
11842
|
-
async injectFetchState(e, t = null, r = null) {
|
|
11843
|
-
const
|
|
11844
|
-
if (!
|
|
12010
|
+
async injectFetchState(e, t = null, r = null, i = null) {
|
|
12011
|
+
const n = this.options.fetchStateFragments;
|
|
12012
|
+
if (!n || n.length === 0)
|
|
11845
12013
|
return;
|
|
11846
|
-
const
|
|
12014
|
+
const s = {
|
|
11847
12015
|
status: e,
|
|
11848
12016
|
loading: e === "loading",
|
|
11849
12017
|
success: e === "success",
|
|
11850
12018
|
error: e === "error",
|
|
11851
12019
|
statusCode: t,
|
|
11852
|
-
message: r
|
|
12020
|
+
message: r,
|
|
12021
|
+
responseMessage: i
|
|
11853
12022
|
};
|
|
11854
|
-
this.options.download && (
|
|
11855
|
-
|
|
11856
|
-
const
|
|
11857
|
-
...
|
|
11858
|
-
_fetch:
|
|
12023
|
+
this.options.download && (s.receivedBytes = this.downloadReceivedBytes, s.totalBytes = this.downloadTotalBytes), await Promise.all(
|
|
12024
|
+
n.map((a) => {
|
|
12025
|
+
const o = a.getTarget(), c = {
|
|
12026
|
+
...a.getRawBindingData() ?? {},
|
|
12027
|
+
_fetch: s
|
|
11859
12028
|
};
|
|
11860
|
-
return $.setBindingData(
|
|
12029
|
+
return $.setBindingData(o, c, {
|
|
11861
12030
|
reflectToAttribute: !1,
|
|
11862
12031
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
11863
12032
|
// 解除しない)。
|
|
@@ -11869,8 +12038,8 @@ ${U}
|
|
|
11869
12038
|
}
|
|
11870
12039
|
};
|
|
11871
12040
|
p.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, p.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, p.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet(), p.CLICK_OUTCOMES = /* @__PURE__ */ new WeakMap(), p.validationReportGeneration = 0, p.VALIDATION_SCROLL_TIMEOUT_MS = 1e3, p.VALIDATION_SCROLL_STABLE_FRAMES = 2;
|
|
11872
|
-
let
|
|
11873
|
-
class
|
|
12041
|
+
let ae = p;
|
|
12042
|
+
class Kt {
|
|
11874
12043
|
/**
|
|
11875
12044
|
* 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
|
|
11876
12045
|
*
|
|
@@ -11891,7 +12060,7 @@ class jt {
|
|
|
11891
12060
|
throw m.error("[Haori]", "Failed to fetch import source:", e, n), new Error(`Failed to fetch: ${e}`);
|
|
11892
12061
|
}
|
|
11893
12062
|
if (!r.ok) {
|
|
11894
|
-
|
|
12063
|
+
pt(r.status);
|
|
11895
12064
|
const n = `${r.status} ${r.statusText}`;
|
|
11896
12065
|
throw m.error("[Haori]", "Import HTTP error:", e, n), new Error(`Failed to load ${e}: ${n}`);
|
|
11897
12066
|
}
|
|
@@ -11960,7 +12129,7 @@ const f = class f {
|
|
|
11960
12129
|
* @returns data-attr-* の内部反映なら true
|
|
11961
12130
|
*/
|
|
11962
12131
|
static isAliasedAttributeReflection(e, t) {
|
|
11963
|
-
const r =
|
|
12132
|
+
const r = I.get(e);
|
|
11964
12133
|
return r instanceof S ? r.hasAttribute(
|
|
11965
12134
|
`${l.prefix}${f.ATTRIBUTE_ALIAS_SUFFIX}${t}`
|
|
11966
12135
|
) : !1;
|
|
@@ -11992,7 +12161,7 @@ const f = class f {
|
|
|
11992
12161
|
static reevaluateChildren(e) {
|
|
11993
12162
|
const t = [];
|
|
11994
12163
|
return e.getChildren().forEach((r) => {
|
|
11995
|
-
r instanceof S ? t.push(f.evaluateAll(r)) : r instanceof
|
|
12164
|
+
r instanceof S ? t.push(f.evaluateAll(r)) : r instanceof ne && t.push(f.evaluateText(r));
|
|
11996
12165
|
}), Promise.all(t).then(() => {
|
|
11997
12166
|
});
|
|
11998
12167
|
}
|
|
@@ -12063,7 +12232,7 @@ const f = class f {
|
|
|
12063
12232
|
if (t.has(e) || !e.isInitialized())
|
|
12064
12233
|
return Promise.resolve();
|
|
12065
12234
|
const r = [];
|
|
12066
|
-
return e.hasAttribute(`${l.prefix}validity`) &&
|
|
12235
|
+
return e.hasAttribute(`${l.prefix}validity`) && k.applyCustomValidity(e), e.hasAttribute(`${l.prefix}fetch`) && r.push(f.executeManagedFetch(e)), e.hasAttribute(`${l.prefix}import`) && r.push(f.executeManagedImport(e)), e.isVisible() ? (e.getChildren().forEach((i) => {
|
|
12067
12236
|
i instanceof S && r.push(
|
|
12068
12237
|
f.reevaluateReactiveSpecialAttributes(i, t)
|
|
12069
12238
|
);
|
|
@@ -12083,7 +12252,7 @@ const f = class f {
|
|
|
12083
12252
|
return i.then(() => f.executeManagedFetch(e, !0)).catch((o) => {
|
|
12084
12253
|
m.error("Haori", `初期表示の取得に失敗しました: ${o}`);
|
|
12085
12254
|
}), Promise.resolve();
|
|
12086
|
-
const n = f.getReactiveFetchState(r), s =
|
|
12255
|
+
const n = f.getReactiveFetchState(r), s = ae.resolveAutoFetchSignature(e);
|
|
12087
12256
|
if (n.running)
|
|
12088
12257
|
return (s.hasUnresolvedReference || s.signature !== n.lastSignature) && (n.rerunRequested = !0), Promise.resolve();
|
|
12089
12258
|
if (s.hasUnresolvedReference || s.signature === null)
|
|
@@ -12091,7 +12260,7 @@ const f = class f {
|
|
|
12091
12260
|
if (n.lastSignature === s.signature)
|
|
12092
12261
|
return Promise.resolve();
|
|
12093
12262
|
n.lastSignature = s.signature, n.running = !0;
|
|
12094
|
-
const a = new
|
|
12263
|
+
const a = new ae(e, null);
|
|
12095
12264
|
return a.markReentrantBind(), a.runWithResult().then(() => {
|
|
12096
12265
|
}).finally(() => {
|
|
12097
12266
|
if (n.running = !1, n.rerunRequested)
|
|
@@ -12116,20 +12285,20 @@ const f = class f {
|
|
|
12116
12285
|
return Promise.resolve();
|
|
12117
12286
|
r.lastUrl = n, r.running = !0;
|
|
12118
12287
|
const s = performance.now();
|
|
12119
|
-
return t.setAttribute(`${l.prefix}importing`, ""),
|
|
12288
|
+
return t.setAttribute(`${l.prefix}importing`, ""), H.importStart(t, n), Kt.load(n).then((a) => {
|
|
12120
12289
|
const o = new TextEncoder().encode(a).length;
|
|
12121
|
-
return
|
|
12290
|
+
return K.enqueue(() => {
|
|
12122
12291
|
t.innerHTML = a;
|
|
12123
12292
|
}).then(() => {
|
|
12124
|
-
t.removeAttribute(`${l.prefix}importing`),
|
|
12293
|
+
t.removeAttribute(`${l.prefix}importing`), H.importEnd(t, n, o, s), f.adoptImportedChildren(e);
|
|
12125
12294
|
const c = [];
|
|
12126
12295
|
return e.getChildren().forEach((u) => {
|
|
12127
|
-
u instanceof S ? c.push(f.scan(u.getTarget())) : u instanceof
|
|
12296
|
+
u instanceof S ? c.push(f.scan(u.getTarget())) : u instanceof ne && c.push(f.evaluateText(u));
|
|
12128
12297
|
}), Promise.all(c).then(() => {
|
|
12129
12298
|
});
|
|
12130
12299
|
});
|
|
12131
12300
|
}).catch((a) => {
|
|
12132
|
-
t.removeAttribute(`${l.prefix}importing`),
|
|
12301
|
+
t.removeAttribute(`${l.prefix}importing`), H.importError(t, n, a), m.error("[Haori]", "Failed to import HTML:", n, a);
|
|
12133
12302
|
}).finally(() => {
|
|
12134
12303
|
if (r.running = !1, r.rerunRequested)
|
|
12135
12304
|
return r.rerunRequested = !1, f.executeManagedImport(e);
|
|
@@ -12152,7 +12321,7 @@ const f = class f {
|
|
|
12152
12321
|
e.getChildren().filter((r) => r.getTarget().parentNode !== t).forEach((r) => {
|
|
12153
12322
|
r.remove(!1);
|
|
12154
12323
|
}), t.childNodes.forEach((r) => {
|
|
12155
|
-
const i =
|
|
12324
|
+
const i = I.get(r);
|
|
12156
12325
|
i !== null && i.getParent() !== e && e.pushChild(i);
|
|
12157
12326
|
});
|
|
12158
12327
|
}
|
|
@@ -12177,14 +12346,14 @@ const f = class f {
|
|
|
12177
12346
|
* @returns Promise (スキャンが完了したときに解決される)
|
|
12178
12347
|
*/
|
|
12179
12348
|
static scanElement(e, t) {
|
|
12180
|
-
const r =
|
|
12349
|
+
const r = I.get(e);
|
|
12181
12350
|
if (!r)
|
|
12182
12351
|
return Promise.resolve();
|
|
12183
12352
|
const i = f.initializeElementFragment(r, !1).then(
|
|
12184
|
-
() =>
|
|
12353
|
+
() => k.restoreInitialValues(e)
|
|
12185
12354
|
), n = f.initialValueRestore;
|
|
12186
12355
|
return f.initialValueRestore = i, i.then(() => {
|
|
12187
|
-
f.initialValueRestore = n, t &&
|
|
12356
|
+
f.initialValueRestore = n, t && te.applySubtree(e);
|
|
12188
12357
|
});
|
|
12189
12358
|
}
|
|
12190
12359
|
/**
|
|
@@ -12205,7 +12374,7 @@ const f = class f {
|
|
|
12205
12374
|
const r = e.getTarget();
|
|
12206
12375
|
return S.retryUnappliedValueWrites(r, t).then(
|
|
12207
12376
|
() => {
|
|
12208
|
-
|
|
12377
|
+
te.applySubtree(r);
|
|
12209
12378
|
}
|
|
12210
12379
|
);
|
|
12211
12380
|
}
|
|
@@ -12218,7 +12387,7 @@ const f = class f {
|
|
|
12218
12387
|
*/
|
|
12219
12388
|
static initializeFreshEachRow(e) {
|
|
12220
12389
|
return f.initializeElementFragment(e, !0).then(() => {
|
|
12221
|
-
f.needsScheduledEvaluateAll(e) && f.scheduleEvaluateAll(e),
|
|
12390
|
+
f.needsScheduledEvaluateAll(e) && f.scheduleEvaluateAll(e), te.applySubtree(e.getTarget());
|
|
12222
12391
|
});
|
|
12223
12392
|
}
|
|
12224
12393
|
/**
|
|
@@ -12236,7 +12405,7 @@ const f = class f {
|
|
|
12236
12405
|
}
|
|
12237
12406
|
const r = [];
|
|
12238
12407
|
return e.getChildren().forEach((i) => {
|
|
12239
|
-
i instanceof S ? r.push(f.initializeElementFragment(i, t)) : i instanceof
|
|
12408
|
+
i instanceof S ? r.push(f.initializeElementFragment(i, t)) : i instanceof ne && r.push(f.evaluateText(i));
|
|
12240
12409
|
}), Promise.all(r).then(() => {
|
|
12241
12410
|
f.refreshDerivedSubtreeSignature(e);
|
|
12242
12411
|
});
|
|
@@ -12292,7 +12461,7 @@ const f = class f {
|
|
|
12292
12461
|
e.getRawAttribute(n)
|
|
12293
12462
|
))), r.add(n));
|
|
12294
12463
|
}
|
|
12295
|
-
return t.then(() => (e.markInitialized(),
|
|
12464
|
+
return t.then(() => (e.markInitialized(), k.prepareFormName(e)));
|
|
12296
12465
|
}
|
|
12297
12466
|
/**
|
|
12298
12467
|
* 子孫初期化をスキップすべきかどうかを返します。
|
|
@@ -12319,7 +12488,7 @@ const f = class f {
|
|
|
12319
12488
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
12320
12489
|
*/
|
|
12321
12490
|
static setAttribute(e, t, r, i = !1, n) {
|
|
12322
|
-
const s =
|
|
12491
|
+
const s = I.get(e), a = f.getAliasedAttributeName(t);
|
|
12323
12492
|
if (a !== null)
|
|
12324
12493
|
return r === null ? s.removeAliasedAttribute(t, a) : s.setAliasedAttribute(
|
|
12325
12494
|
t,
|
|
@@ -12392,10 +12561,10 @@ const f = class f {
|
|
|
12392
12561
|
break;
|
|
12393
12562
|
case `${l.prefix}validity`:
|
|
12394
12563
|
case `${l.prefix}validity-message`:
|
|
12395
|
-
return r !== null &&
|
|
12564
|
+
return r !== null && k.applyCustomValidity(s), Promise.all(o).then(() => {
|
|
12396
12565
|
});
|
|
12397
12566
|
case `${l.prefix}url-param`: {
|
|
12398
|
-
const g = s.getAttribute(`${l.prefix}url-arg`), y =
|
|
12567
|
+
const g = s.getAttribute(`${l.prefix}url-arg`), y = gt.readParams();
|
|
12399
12568
|
g === null && s.hasAttribute(`${l.prefix}store`) && m.warn(
|
|
12400
12569
|
"Haori",
|
|
12401
12570
|
`${l.prefix}url-param を ${l.prefix}url-arg なしで ${l.prefix}store と併用すると復元した値が消えます(${l.prefix}url-arg を指定してください)。`
|
|
@@ -12452,7 +12621,7 @@ const f = class f {
|
|
|
12452
12621
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
12453
12622
|
*/
|
|
12454
12623
|
static setBindingData(e, t, r = {}) {
|
|
12455
|
-
const i =
|
|
12624
|
+
const i = I.get(e), n = r.skipFragments ?? /* @__PURE__ */ new Set(), s = r.reentrant ?? !1, a = r.reflectToAttribute ?? !0, o = r.kind ?? "supply", c = r.sequence ?? S.nextOperationSequence(), u = {
|
|
12456
12625
|
sequence: c,
|
|
12457
12626
|
kind: o,
|
|
12458
12627
|
...r.editedPaths === void 0 ? {} : { editedPaths: r.editedPaths }
|
|
@@ -12461,34 +12630,34 @@ const f = class f {
|
|
|
12461
12630
|
const g = S.currentSequence(), y = i.getRawBindingData();
|
|
12462
12631
|
d && (r.clearUserEdits ?? !0) && f.clearUserEditMarks(i, c);
|
|
12463
12632
|
const E = a ? f.resolveByPathAuthority(i, y, t, u) : t;
|
|
12464
|
-
i.setBindingData(E), a && (
|
|
12633
|
+
i.setBindingData(E), a && (H.bindChange(e, y, E, "manual"), Fe.mirror(i));
|
|
12465
12634
|
const A = () => {
|
|
12466
12635
|
i.markBindingWorkStart();
|
|
12467
|
-
const
|
|
12468
|
-
let
|
|
12636
|
+
const D = i.getRawBindingData() ?? E;
|
|
12637
|
+
let N = a ? i.setAttribute(
|
|
12469
12638
|
`${l.prefix}bind`,
|
|
12470
|
-
JSON.stringify(f.withoutReservedBindingKeys(
|
|
12639
|
+
JSON.stringify(f.withoutReservedBindingKeys(D))
|
|
12471
12640
|
) : Promise.resolve();
|
|
12472
|
-
return e.tagName === "FORM" && (
|
|
12641
|
+
return e.tagName === "FORM" && (N = N.then(() => {
|
|
12473
12642
|
if (i.wasResetAfter(g))
|
|
12474
12643
|
return;
|
|
12475
|
-
const
|
|
12476
|
-
return
|
|
12644
|
+
const B = i.getRawBindingData() ?? E;
|
|
12645
|
+
return k.syncValues(
|
|
12477
12646
|
i,
|
|
12478
|
-
|
|
12647
|
+
k.resolveSyncValues(i, B),
|
|
12479
12648
|
!1,
|
|
12480
12649
|
u
|
|
12481
12650
|
);
|
|
12482
|
-
})),
|
|
12483
|
-
() =>
|
|
12484
|
-
),
|
|
12651
|
+
})), N = N.then(
|
|
12652
|
+
() => k.syncAncestorArgForms(i, g, u, y)
|
|
12653
|
+
), N = N.then(() => f.evaluateAll(i, n)), N = N.then(
|
|
12485
12654
|
() => S.retryUnappliedValueWrites(e, g)
|
|
12486
|
-
),
|
|
12655
|
+
), N = N.then(
|
|
12487
12656
|
() => f.reevaluateReactiveSpecialAttributes(i, n)
|
|
12488
|
-
),
|
|
12657
|
+
), N.then(
|
|
12489
12658
|
() => i.markBindingWorkEnd(),
|
|
12490
|
-
(
|
|
12491
|
-
throw i.markBindingWorkEnd(),
|
|
12659
|
+
(B) => {
|
|
12660
|
+
throw i.markBindingWorkEnd(), B;
|
|
12492
12661
|
}
|
|
12493
12662
|
);
|
|
12494
12663
|
};
|
|
@@ -12558,14 +12727,14 @@ const f = class f {
|
|
|
12558
12727
|
...Object.keys(d)
|
|
12559
12728
|
]);
|
|
12560
12729
|
for (const A of E) {
|
|
12561
|
-
const
|
|
12730
|
+
const D = n === "" ? A : `${n}.${A}`, N = f.mergePathAuthority(
|
|
12562
12731
|
e,
|
|
12563
12732
|
Object.prototype.hasOwnProperty.call(u, A) ? u[A] : f.ABSENT_PATH,
|
|
12564
12733
|
Object.prototype.hasOwnProperty.call(d, A) ? d[A] : f.ABSENT_PATH,
|
|
12565
12734
|
i,
|
|
12566
|
-
|
|
12735
|
+
D
|
|
12567
12736
|
);
|
|
12568
|
-
|
|
12737
|
+
N !== f.ABSENT_PATH && (g[A] = N), N !== (Object.prototype.hasOwnProperty.call(d, A) ? d[A] : f.ABSENT_PATH) && (y = !0);
|
|
12569
12738
|
}
|
|
12570
12739
|
return y ? g : d;
|
|
12571
12740
|
}
|
|
@@ -12734,7 +12903,7 @@ const f = class f {
|
|
|
12734
12903
|
* `resolved: true` のときは解決済みスコープ(常にオブジェクト)。
|
|
12735
12904
|
*/
|
|
12736
12905
|
static getBindingData(e, t = {}) {
|
|
12737
|
-
const r =
|
|
12906
|
+
const r = I.get(e);
|
|
12738
12907
|
return r instanceof S ? t.resolved ? r.getBindingData() : r.getRawBindingData() : null;
|
|
12739
12908
|
}
|
|
12740
12909
|
/**
|
|
@@ -12754,7 +12923,7 @@ const f = class f {
|
|
|
12754
12923
|
*/
|
|
12755
12924
|
static dumpScope(e) {
|
|
12756
12925
|
const t = f.collectScope(e);
|
|
12757
|
-
return
|
|
12926
|
+
return q.isEnabled() && m.info("[Haori]", "scope dump for", e, t), t;
|
|
12758
12927
|
}
|
|
12759
12928
|
/**
|
|
12760
12929
|
* スコープの解決結果と由来を収集します。
|
|
@@ -12767,7 +12936,7 @@ const f = class f {
|
|
|
12767
12936
|
* @return 解決済みスコープと各キーの由来情報
|
|
12768
12937
|
*/
|
|
12769
12938
|
static collectScope(e) {
|
|
12770
|
-
const t =
|
|
12939
|
+
const t = I.get(e);
|
|
12771
12940
|
if (!t)
|
|
12772
12941
|
return { resolved: {}, sources: {} };
|
|
12773
12942
|
const r = t.getBindingData(), i = {}, n = (c) => {
|
|
@@ -12816,16 +12985,16 @@ const f = class f {
|
|
|
12816
12985
|
* @returns 追加したノードの走査(評価)の Promise。走査しない場合は解決済みの Promise
|
|
12817
12986
|
*/
|
|
12818
12987
|
static addNode(e, t) {
|
|
12819
|
-
const r =
|
|
12988
|
+
const r = I.get(e);
|
|
12820
12989
|
if (r.isSkipMutationNode(t))
|
|
12821
12990
|
return Promise.resolve();
|
|
12822
|
-
const i =
|
|
12991
|
+
const i = I.get(t.nextSibling), n = I.get(t);
|
|
12823
12992
|
if (n) {
|
|
12824
12993
|
if (n.getParent() === r)
|
|
12825
12994
|
return Promise.resolve();
|
|
12826
12995
|
if (r.insertBefore(n, i), n instanceof S)
|
|
12827
12996
|
return f.scan(n.getTarget());
|
|
12828
|
-
if (n instanceof
|
|
12997
|
+
if (n instanceof ne)
|
|
12829
12998
|
return f.evaluateText(n);
|
|
12830
12999
|
}
|
|
12831
13000
|
return Promise.resolve();
|
|
@@ -12836,7 +13005,7 @@ const f = class f {
|
|
|
12836
13005
|
* @param node 削除するノード
|
|
12837
13006
|
*/
|
|
12838
13007
|
static removeNode(e) {
|
|
12839
|
-
const t =
|
|
13008
|
+
const t = I.get(e);
|
|
12840
13009
|
if (t) {
|
|
12841
13010
|
const r = t.getParent();
|
|
12842
13011
|
if (r && r.isSkipMutationNode(e))
|
|
@@ -12851,7 +13020,7 @@ const f = class f {
|
|
|
12851
13020
|
* @param text 新しいテキスト
|
|
12852
13021
|
*/
|
|
12853
13022
|
static changeText(e, t) {
|
|
12854
|
-
const r =
|
|
13023
|
+
const r = I.get(e);
|
|
12855
13024
|
r && r.setContent(t);
|
|
12856
13025
|
}
|
|
12857
13026
|
/**
|
|
@@ -12863,27 +13032,27 @@ const f = class f {
|
|
|
12863
13032
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
12864
13033
|
*/
|
|
12865
13034
|
static changeValue(e, t) {
|
|
12866
|
-
const r =
|
|
13035
|
+
const r = I.get(e);
|
|
12867
13036
|
if (r.getValue() === t)
|
|
12868
13037
|
return Promise.resolve();
|
|
12869
13038
|
const i = [];
|
|
12870
13039
|
i.push(r.setValue(t));
|
|
12871
13040
|
const n = f.getFormFragment(r);
|
|
12872
13041
|
if (n) {
|
|
12873
|
-
const s =
|
|
13042
|
+
const s = k.getValues(n), a = n.getAttribute(`${l.prefix}form-arg`), o = n.getRawBindingData();
|
|
12874
13043
|
let c;
|
|
12875
13044
|
if (a) {
|
|
12876
13045
|
c = { ...o ?? {} };
|
|
12877
|
-
const u = String(a), d =
|
|
12878
|
-
c[u] =
|
|
13046
|
+
const u = String(a), d = k.resolveAncestorArgOwner(n, u);
|
|
13047
|
+
c[u] = k.mergeCollectedValues(
|
|
12879
13048
|
(d ? d.value : c[u]) ?? null,
|
|
12880
13049
|
s
|
|
12881
13050
|
);
|
|
12882
13051
|
} else
|
|
12883
|
-
c =
|
|
13052
|
+
c = k.mergeCollectedValues(
|
|
12884
13053
|
o,
|
|
12885
13054
|
s,
|
|
12886
|
-
|
|
13055
|
+
k.ancestorBaseResolver(n)
|
|
12887
13056
|
);
|
|
12888
13057
|
i.push(
|
|
12889
13058
|
// 値の設定に伴うコミットなので、値の供給ではない更新として扱う(権威を
|
|
@@ -12971,7 +13140,7 @@ const f = class f {
|
|
|
12971
13140
|
if (f.canSkipUnchangedNestedEach(A))
|
|
12972
13141
|
return;
|
|
12973
13142
|
E.push(f.evaluateAll(A, t));
|
|
12974
|
-
} else A instanceof
|
|
13143
|
+
} else A instanceof ne && E.push(f.evaluateText(A));
|
|
12975
13144
|
}), Promise.all(E).then(() => {
|
|
12976
13145
|
});
|
|
12977
13146
|
}).then(() => {
|
|
@@ -12994,7 +13163,7 @@ const f = class f {
|
|
|
12994
13163
|
const i = e.getRawDerivedBindingData(), n = typeof r == "string" ? r.trim() : "";
|
|
12995
13164
|
if (!t || n === "")
|
|
12996
13165
|
return i === null ? Promise.resolve(!1) : (e.setDerivedBindingData(null), Promise.resolve(!0));
|
|
12997
|
-
const s =
|
|
13166
|
+
const s = ie.evaluateDetailed(
|
|
12998
13167
|
t,
|
|
12999
13168
|
e.getBindingData()
|
|
13000
13169
|
);
|
|
@@ -13041,7 +13210,7 @@ const f = class f {
|
|
|
13041
13210
|
const t = e.getRawAttribute(`${l.prefix}if`);
|
|
13042
13211
|
if (typeof t != "string" || t.indexOf("{{") >= 0)
|
|
13043
13212
|
return;
|
|
13044
|
-
if (
|
|
13213
|
+
if (ie.hasCompileFailure(t)) {
|
|
13045
13214
|
m.warn(
|
|
13046
13215
|
"[Haori]",
|
|
13047
13216
|
"data-if is hidden because the expression could not be compiled (see the preceding compile error):",
|
|
@@ -13117,7 +13286,7 @@ const f = class f {
|
|
|
13117
13286
|
static evaluateEachFixedChildren(e) {
|
|
13118
13287
|
const t = [];
|
|
13119
13288
|
return e.getChildren().forEach((r) => {
|
|
13120
|
-
r instanceof S ? f.isEachFixedChild(r) && t.push(f.evaluateAll(r)) : r instanceof
|
|
13289
|
+
r instanceof S ? f.isEachFixedChild(r) && t.push(f.evaluateAll(r)) : r instanceof ne && t.push(f.evaluateText(r));
|
|
13121
13290
|
}), Promise.all(t).then(() => {
|
|
13122
13291
|
});
|
|
13123
13292
|
}
|
|
@@ -13153,9 +13322,9 @@ const f = class f {
|
|
|
13153
13322
|
static evaluateIf(e) {
|
|
13154
13323
|
const t = [], r = e.getAttribute(`${l.prefix}if`);
|
|
13155
13324
|
if (f.isHiddenIfCondition(r))
|
|
13156
|
-
|
|
13325
|
+
q.isEnabled() && e.isVisible() && f.logFalsyIfDiagnostics(e), t.push(
|
|
13157
13326
|
e.hide().then(() => {
|
|
13158
|
-
|
|
13327
|
+
H.hide(e.getTarget());
|
|
13159
13328
|
})
|
|
13160
13329
|
);
|
|
13161
13330
|
else {
|
|
@@ -13170,10 +13339,10 @@ const f = class f {
|
|
|
13170
13339
|
() => f.reevaluateReactiveSpecialAttributes(o)
|
|
13171
13340
|
)
|
|
13172
13341
|
) : s.push(f.scanElement(o.getTarget(), !1));
|
|
13173
|
-
} else o instanceof
|
|
13342
|
+
} else o instanceof ne && s.push(f.evaluateText(o));
|
|
13174
13343
|
}), t.push(
|
|
13175
13344
|
e.show().then(() => {
|
|
13176
|
-
|
|
13345
|
+
H.show(e.getTarget()), i || (f.triggerLoadOnShow(e), te.refreshSubtree(e.getTarget(), !1));
|
|
13177
13346
|
})
|
|
13178
13347
|
), t.push(
|
|
13179
13348
|
Promise.all(s).then(() => {
|
|
@@ -13196,7 +13365,7 @@ const f = class f {
|
|
|
13196
13365
|
*/
|
|
13197
13366
|
static triggerLoadOnShow(e) {
|
|
13198
13367
|
const t = `${l.prefix}load-`;
|
|
13199
|
-
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new
|
|
13368
|
+
e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new ae(e, "load").run().catch((i) => {
|
|
13200
13369
|
m.error("[Haori]", "data-load procedure error (on show):", i);
|
|
13201
13370
|
});
|
|
13202
13371
|
}
|
|
@@ -13224,7 +13393,7 @@ const f = class f {
|
|
|
13224
13393
|
* @return 差分更新(再実行を含む)の完了 Promise
|
|
13225
13394
|
*/
|
|
13226
13395
|
static evaluateEach(e) {
|
|
13227
|
-
if (
|
|
13396
|
+
if (q.isEnabled() && ie.recordRowScopeIdentifiers([
|
|
13228
13397
|
f.getRowScopeName(e, "each-arg"),
|
|
13229
13398
|
f.getRowScopeName(e, "each-index")
|
|
13230
13399
|
]), e.isMounted() || f.syncMountedState(e), !e.isVisible() || !e.isMounted())
|
|
@@ -13274,7 +13443,7 @@ const f = class f {
|
|
|
13274
13443
|
t.rerunRequested = !1, await f.performEachUpdate(e);
|
|
13275
13444
|
while (t.rerunRequested);
|
|
13276
13445
|
const i = e.getTarget();
|
|
13277
|
-
i.setAttribute(`${l.prefix}each-done`, ""),
|
|
13446
|
+
i.setAttribute(`${l.prefix}each-done`, ""), te.refreshSubtree(i, !1), f.runEachRenderedScript(i);
|
|
13278
13447
|
} finally {
|
|
13279
13448
|
t.running = !1, t.settled = null;
|
|
13280
13449
|
}
|
|
@@ -13411,10 +13580,10 @@ ${r}
|
|
|
13411
13580
|
(c) => !c.hasAttribute(`${l.prefix}each-before`) && !c.hasAttribute(`${l.prefix}each-after`)
|
|
13412
13581
|
).forEach((c) => {
|
|
13413
13582
|
if (!s) {
|
|
13414
|
-
const d =
|
|
13583
|
+
const d = I.get(c);
|
|
13415
13584
|
d instanceof S && (r = d.clone(), f.markFreshInitializationSkippable(r), e.setTemplate(r), s = !0);
|
|
13416
13585
|
}
|
|
13417
|
-
const u =
|
|
13586
|
+
const u = I.get(c);
|
|
13418
13587
|
u instanceof S && e.getChildren().includes(u) && (e.removeChild(u), u.setMounted(!1)), c.parentNode && c.parentNode.removeChild(c);
|
|
13419
13588
|
});
|
|
13420
13589
|
}
|
|
@@ -13555,7 +13724,7 @@ ${r}
|
|
|
13555
13724
|
if (i instanceof S) {
|
|
13556
13725
|
if (!f.isRowLocalSubtree(i, r))
|
|
13557
13726
|
return !1;
|
|
13558
|
-
} else if (i instanceof
|
|
13727
|
+
} else if (i instanceof ne) {
|
|
13559
13728
|
const n = i.getRawText();
|
|
13560
13729
|
if (n.includes("{{") && !f.areExpressionsRowLocal(
|
|
13561
13730
|
f.extractInterpolations(n),
|
|
@@ -13579,7 +13748,7 @@ ${r}
|
|
|
13579
13748
|
const i = r.trim();
|
|
13580
13749
|
if (i === "")
|
|
13581
13750
|
continue;
|
|
13582
|
-
const n =
|
|
13751
|
+
const n = ie.getFreeIdentifiers(i);
|
|
13583
13752
|
if (n.length === 0 || n.some((s) => !t.has(s)))
|
|
13584
13753
|
return !1;
|
|
13585
13754
|
}
|
|
@@ -13655,7 +13824,7 @@ ${r}
|
|
|
13655
13824
|
const e = `${l.prefix}url-param`, r = Array.from(
|
|
13656
13825
|
document.querySelectorAll(`[${e}]`)
|
|
13657
13826
|
).map((i) => {
|
|
13658
|
-
const n =
|
|
13827
|
+
const n = I.peek(i);
|
|
13659
13828
|
return n instanceof S ? f.setAttribute(
|
|
13660
13829
|
i,
|
|
13661
13830
|
e,
|
|
@@ -13711,7 +13880,7 @@ ${r}
|
|
|
13711
13880
|
* @returns プロファイル
|
|
13712
13881
|
*/
|
|
13713
13882
|
static getOrCreateDerivedSubtreeProfile(e) {
|
|
13714
|
-
if (!
|
|
13883
|
+
if (!q.isEnabled() || !e.hasAttribute(`${l.prefix}derive`))
|
|
13715
13884
|
return null;
|
|
13716
13885
|
const t = f.DERIVE_SUBTREE_PROFILES.get(e);
|
|
13717
13886
|
if (t)
|
|
@@ -13828,7 +13997,7 @@ ${r}
|
|
|
13828
13997
|
const n = e.getRawAttribute(i);
|
|
13829
13998
|
return typeof n == "string" && n.includes("{{");
|
|
13830
13999
|
}) ? !0 : e.getChildren().some(
|
|
13831
|
-
(i) => i instanceof
|
|
14000
|
+
(i) => i instanceof ne && i.hasDynamicContent()
|
|
13832
14001
|
);
|
|
13833
14002
|
}
|
|
13834
14003
|
/**
|
|
@@ -13838,7 +14007,7 @@ ${r}
|
|
|
13838
14007
|
* @returns subtree 全体を省略可能なら true
|
|
13839
14008
|
*/
|
|
13840
14009
|
static markFreshInitializationSkippable(e) {
|
|
13841
|
-
const t = e.getAttributeNames().some((n) => f.isFreshInitializationDynamicAttribute(e, n)), r = e.getChildren().some((n) => n instanceof S ? !f.markFreshInitializationSkippable(n) : n instanceof
|
|
14010
|
+
const t = e.getAttributeNames().some((n) => f.isFreshInitializationDynamicAttribute(e, n)), r = e.getChildren().some((n) => n instanceof S ? !f.markFreshInitializationSkippable(n) : n instanceof ne ? n.hasDynamicContent() : !1), i = !t && !r;
|
|
13842
14011
|
return e.setFreshInitializationSkippable(i), i;
|
|
13843
14012
|
}
|
|
13844
14013
|
/**
|
|
@@ -13871,52 +14040,52 @@ ${r}
|
|
|
13871
14040
|
let i = e.getAttribute(`${l.prefix}each-index`);
|
|
13872
14041
|
i && (i = String(i));
|
|
13873
14042
|
const n = e.getAttribute(`${l.prefix}each-key`), s = e.getAttribute(`${l.prefix}each-arg`), a = t.map(
|
|
13874
|
-
(
|
|
14043
|
+
(F, j) => f.createListKey(F, n ? String(n) : null, j)
|
|
13875
14044
|
), o = new Set(a), c = /* @__PURE__ */ new Map();
|
|
13876
|
-
a.forEach((
|
|
13877
|
-
c.set(
|
|
14045
|
+
a.forEach((F) => {
|
|
14046
|
+
c.set(F, (c.get(F) ?? 0) + 1);
|
|
13878
14047
|
}), n && o.size !== a.length && f.warnDuplicateEachKey(String(n));
|
|
13879
14048
|
const u = [];
|
|
13880
|
-
let d = e.getChildren().filter((
|
|
13881
|
-
(
|
|
14049
|
+
let d = e.getChildren().filter((F) => F instanceof S).filter(
|
|
14050
|
+
(F) => !F.hasAttribute(`${l.prefix}each-before`) && !F.hasAttribute(`${l.prefix}each-after`)
|
|
13882
14051
|
);
|
|
13883
|
-
const g = d.map((
|
|
13884
|
-
d = d.filter((
|
|
13885
|
-
const
|
|
14052
|
+
const g = d.map((F) => F.getListKey()), y = /* @__PURE__ */ new Set();
|
|
14053
|
+
d = d.filter((F, j) => {
|
|
14054
|
+
const J = String(F.getListKey()), _ = c.get(J) ?? 0;
|
|
13886
14055
|
if (_ === 0) {
|
|
13887
|
-
y.add(
|
|
13888
|
-
const P =
|
|
13889
|
-
return P !== null &&
|
|
14056
|
+
y.add(F);
|
|
14057
|
+
const P = F.getListKey();
|
|
14058
|
+
return P !== null && H.rowRemove(F.getTarget(), P, j), u.push(F.remove()), !1;
|
|
13890
14059
|
}
|
|
13891
|
-
return c.set(
|
|
14060
|
+
return c.set(J, _ - 1), !0;
|
|
13892
14061
|
});
|
|
13893
|
-
const E = d.map((
|
|
13894
|
-
d.forEach((
|
|
13895
|
-
const j =
|
|
14062
|
+
const E = d.map((F) => F.getListKey()), A = /* @__PURE__ */ new Map();
|
|
14063
|
+
d.forEach((F) => {
|
|
14064
|
+
const j = F.getListKey();
|
|
13896
14065
|
if (j === null)
|
|
13897
14066
|
return;
|
|
13898
|
-
const
|
|
13899
|
-
|
|
14067
|
+
const J = A.get(j);
|
|
14068
|
+
J ? J.push(F) : A.set(j, [F]);
|
|
13900
14069
|
});
|
|
13901
|
-
const
|
|
13902
|
-
(
|
|
14070
|
+
const D = e.getChildElementFragments().filter((F) => !y.has(F)), N = D.filter(
|
|
14071
|
+
(F) => F.hasAttribute(`${l.prefix}each-before`)
|
|
13903
14072
|
).length;
|
|
13904
|
-
let
|
|
13905
|
-
return a.forEach((
|
|
13906
|
-
const
|
|
14073
|
+
let B = Promise.resolve();
|
|
14074
|
+
return a.forEach((F, j) => {
|
|
14075
|
+
const J = t[j], _ = j;
|
|
13907
14076
|
let P;
|
|
13908
|
-
const
|
|
13909
|
-
if (
|
|
13910
|
-
P =
|
|
13911
|
-
const G =
|
|
13912
|
-
|
|
14077
|
+
const se = A.get(F)?.shift();
|
|
14078
|
+
if (se) {
|
|
14079
|
+
P = se;
|
|
14080
|
+
const G = N + j;
|
|
14081
|
+
B = B.then(
|
|
13913
14082
|
() => f.updateRowFragment(
|
|
13914
14083
|
P,
|
|
13915
|
-
|
|
14084
|
+
J,
|
|
13916
14085
|
i,
|
|
13917
14086
|
_,
|
|
13918
14087
|
s ? String(s) : null,
|
|
13919
|
-
|
|
14088
|
+
F
|
|
13920
14089
|
).then(
|
|
13921
14090
|
(T) => (
|
|
13922
14091
|
// 再利用行も新しい並び順の位置へ移動する。移動しないと、配列を並べ替え
|
|
@@ -13925,17 +14094,17 @@ ${r}
|
|
|
13925
14094
|
f.repositionEachRow(
|
|
13926
14095
|
e,
|
|
13927
14096
|
P,
|
|
13928
|
-
|
|
14097
|
+
D,
|
|
13929
14098
|
G
|
|
13930
14099
|
).then((L) => {
|
|
13931
|
-
if (L !== null &&
|
|
14100
|
+
if (L !== null && H.rowMove(
|
|
13932
14101
|
P.getTarget(),
|
|
13933
|
-
|
|
13934
|
-
L -
|
|
14102
|
+
F,
|
|
14103
|
+
L - N,
|
|
13935
14104
|
j
|
|
13936
14105
|
), !(!T && f.isRowLocalEachTemplate(e)))
|
|
13937
14106
|
return f.evaluateAll(P).then(
|
|
13938
|
-
() => f.applyRowFormValues(e, P,
|
|
14107
|
+
() => f.applyRowFormValues(e, P, J)
|
|
13939
14108
|
);
|
|
13940
14109
|
})
|
|
13941
14110
|
)
|
|
@@ -13943,40 +14112,40 @@ ${r}
|
|
|
13943
14112
|
);
|
|
13944
14113
|
} else {
|
|
13945
14114
|
P = r.clone();
|
|
13946
|
-
const G =
|
|
13947
|
-
|
|
14115
|
+
const G = N + j;
|
|
14116
|
+
B = B.then(
|
|
13948
14117
|
() => f.updateRowFragment(
|
|
13949
14118
|
P,
|
|
13950
|
-
|
|
14119
|
+
J,
|
|
13951
14120
|
i,
|
|
13952
14121
|
_,
|
|
13953
14122
|
s ? String(s) : null,
|
|
13954
|
-
|
|
14123
|
+
F
|
|
13955
14124
|
).then(() => {
|
|
13956
|
-
const T =
|
|
14125
|
+
const T = D[G] ?? null;
|
|
13957
14126
|
return e.insertBefore(P, T).then(() => {
|
|
13958
|
-
|
|
13959
|
-
}).then(() => f.initializeFreshEachRow(P)).then(() => f.applyRowFormValues(e, P,
|
|
13960
|
-
|
|
14127
|
+
D.splice(G, 0, P);
|
|
14128
|
+
}).then(() => f.initializeFreshEachRow(P)).then(() => f.applyRowFormValues(e, P, J)).then(() => {
|
|
14129
|
+
H.rowAdd(P.getTarget(), F, _, J);
|
|
13961
14130
|
});
|
|
13962
14131
|
})
|
|
13963
14132
|
);
|
|
13964
14133
|
}
|
|
13965
|
-
}), Promise.all(u).then(() =>
|
|
13966
|
-
const
|
|
14134
|
+
}), Promise.all(u).then(() => B).then(() => {
|
|
14135
|
+
const F = a.filter(
|
|
13967
14136
|
(G) => G !== null
|
|
13968
14137
|
), j = E.filter(
|
|
13969
14138
|
(G) => G !== null
|
|
13970
|
-
),
|
|
14139
|
+
), J = new Set(j), _ = F.filter((G) => !J.has(G)), se = g.filter(
|
|
13971
14140
|
(G) => G !== null
|
|
13972
14141
|
).filter(
|
|
13973
14142
|
(G) => !o.has(G)
|
|
13974
14143
|
);
|
|
13975
|
-
|
|
14144
|
+
H.eachUpdate(
|
|
13976
14145
|
e.getTarget(),
|
|
13977
14146
|
_,
|
|
13978
|
-
|
|
13979
|
-
|
|
14147
|
+
se,
|
|
14148
|
+
F
|
|
13980
14149
|
);
|
|
13981
14150
|
});
|
|
13982
14151
|
}
|
|
@@ -14027,7 +14196,7 @@ ${r}
|
|
|
14027
14196
|
* @returns 戻り値はありません。
|
|
14028
14197
|
*/
|
|
14029
14198
|
static warnDuplicateEachKey(e) {
|
|
14030
|
-
!
|
|
14199
|
+
!q.isEnabled() || f.WARNED_DUPLICATE_EACH_KEYS.has(e) || (f.WARNED_DUPLICATE_EACH_KEYS.add(e), m.warn(
|
|
14031
14200
|
"[Haori]",
|
|
14032
14201
|
`${l.prefix}each-key="${e}" の値が配列の中で重複しています。行は出現順で対応付けますが、キーによる行の識別はできません。`
|
|
14033
14202
|
));
|
|
@@ -14079,7 +14248,7 @@ ${r}
|
|
|
14079
14248
|
* @returns 反映完了の Promise
|
|
14080
14249
|
*/
|
|
14081
14250
|
static applyRowFormValues(e, t, r) {
|
|
14082
|
-
return !e.hasAttribute(`${l.prefix}form-list`) || !
|
|
14251
|
+
return !e.hasAttribute(`${l.prefix}form-list`) || !k.isCollectedListFromEachSource(e) || typeof r != "object" || r === null || Array.isArray(r) ? Promise.resolve() : k.syncRowValues(t, r);
|
|
14083
14252
|
}
|
|
14084
14253
|
/**
|
|
14085
14254
|
* リスト比較用のキーを生成します。
|
|
@@ -14268,7 +14437,7 @@ f.ATTRIBUTE_ALIAS_SUFFIX = "attr-", f.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
14268
14437
|
"enhance-new"
|
|
14269
14438
|
]), f.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), f.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), f.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), f.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), f.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), f.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), f.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), f.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), f.ABSENT_PATH = Symbol("absent");
|
|
14270
14439
|
let $ = f;
|
|
14271
|
-
const
|
|
14440
|
+
const we = class we {
|
|
14272
14441
|
/**
|
|
14273
14442
|
* コンストラクタ。
|
|
14274
14443
|
*
|
|
@@ -14276,10 +14445,10 @@ const Re = class Re {
|
|
|
14276
14445
|
*/
|
|
14277
14446
|
constructor(e = document) {
|
|
14278
14447
|
this.customEventHandlers = /* @__PURE__ */ new Map(), this.builtinListenersAdded = !1, this.deferred = !1, this.deferredProcedures = [], this.onClick = (t) => this.delegate(t, "click"), this.onReset = (t) => {
|
|
14279
|
-
if (t.defaultPrevented ||
|
|
14448
|
+
if (t.defaultPrevented || k.isResettingInternally())
|
|
14280
14449
|
return;
|
|
14281
14450
|
const r = t.target;
|
|
14282
|
-
r instanceof HTMLElement && setTimeout(() =>
|
|
14451
|
+
r instanceof HTMLElement && setTimeout(() => te.refreshSubtree(r), 0);
|
|
14283
14452
|
}, this.onChange = (t) => this.delegate(t, "change"), this.onInput = (t) => this.delegate(t, "input"), this.onLoadCapture = (t) => this.delegate(t, "load"), this.onWindowLoad = () => {
|
|
14284
14453
|
if (this.deferred) {
|
|
14285
14454
|
this.deferredProcedures.push(() => this.runWindowLoadProcedure());
|
|
@@ -14288,7 +14457,7 @@ const Re = class Re {
|
|
|
14288
14457
|
this.runWindowLoadProcedure();
|
|
14289
14458
|
}, this.onPopstate = (t) => {
|
|
14290
14459
|
const r = t.state;
|
|
14291
|
-
if (!r || r[
|
|
14460
|
+
if (!r || r[we.HISTORY_STATE_KEY] !== !0) {
|
|
14292
14461
|
$.refreshUrlParams();
|
|
14293
14462
|
return;
|
|
14294
14463
|
}
|
|
@@ -14301,8 +14470,8 @@ const Re = class Re {
|
|
|
14301
14470
|
* @returns 戻り値はない。
|
|
14302
14471
|
*/
|
|
14303
14472
|
runWindowLoadProcedure() {
|
|
14304
|
-
const e = document.documentElement, t =
|
|
14305
|
-
t && new
|
|
14473
|
+
const e = document.documentElement, t = I.get(e);
|
|
14474
|
+
t && new ae(t, "load").run();
|
|
14306
14475
|
}
|
|
14307
14476
|
/**
|
|
14308
14477
|
* イベントリスナーの登録を開始します。
|
|
@@ -14396,7 +14565,7 @@ const Re = class Re {
|
|
|
14396
14565
|
subscribeCustomEvent(e) {
|
|
14397
14566
|
if (e === null || e === "")
|
|
14398
14567
|
return;
|
|
14399
|
-
if (
|
|
14568
|
+
if (we.BUILTIN_EVENT_NAMES.has(e)) {
|
|
14400
14569
|
m.warn(
|
|
14401
14570
|
"[Haori]",
|
|
14402
14571
|
`data-on="${e}" は組み込みイベントです。data-${e}-* を使用してください(data-on はカスタムイベント専用)。`
|
|
@@ -14425,8 +14594,8 @@ const Re = class Re {
|
|
|
14425
14594
|
this.root.querySelectorAll(`[${this.onAttributeName}]`).forEach((i) => {
|
|
14426
14595
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
14427
14596
|
return;
|
|
14428
|
-
const n =
|
|
14429
|
-
n instanceof S && new
|
|
14597
|
+
const n = I.get(i);
|
|
14598
|
+
n instanceof S && new ae(n, "on", t).run().catch((s) => {
|
|
14430
14599
|
m.error("[Haori]", "Procedure execution error:", s);
|
|
14431
14600
|
});
|
|
14432
14601
|
});
|
|
@@ -14489,16 +14658,16 @@ const Re = class Re {
|
|
|
14489
14658
|
* @returns 戻り値はない。
|
|
14490
14659
|
*/
|
|
14491
14660
|
runProcedureFor(e, t, r) {
|
|
14492
|
-
const i =
|
|
14661
|
+
const i = I.get(e);
|
|
14493
14662
|
if (!i)
|
|
14494
14663
|
return;
|
|
14495
14664
|
(t === "change" || t === "input") && this.syncUserEdit(e, t === "change");
|
|
14496
14665
|
const n = () => {
|
|
14497
|
-
const s = new
|
|
14666
|
+
const s = new ae(i, t, r).runWithOutcome().catch((a) => (m.error("[Haori]", "Procedure execution error:", a), "failure"));
|
|
14498
14667
|
if (t === "click") {
|
|
14499
|
-
|
|
14668
|
+
ae.recordClickOutcome(e, s);
|
|
14500
14669
|
const a = r.target;
|
|
14501
|
-
a instanceof HTMLElement && a !== e &&
|
|
14670
|
+
a instanceof HTMLElement && a !== e && ae.recordClickOutcome(a, s);
|
|
14502
14671
|
}
|
|
14503
14672
|
};
|
|
14504
14673
|
if (t === "click" && e.hasAttribute(`${l.prefix}click-defer`)) {
|
|
@@ -14549,7 +14718,7 @@ const Re = class Re {
|
|
|
14549
14718
|
* @returns 戻り値はない。
|
|
14550
14719
|
*/
|
|
14551
14720
|
markUserEditOnly(e) {
|
|
14552
|
-
const t =
|
|
14721
|
+
const t = I.get(e);
|
|
14553
14722
|
t instanceof S && t.markUserEdit();
|
|
14554
14723
|
}
|
|
14555
14724
|
/**
|
|
@@ -14565,13 +14734,13 @@ const Re = class Re {
|
|
|
14565
14734
|
* @returns 戻り値はない。
|
|
14566
14735
|
*/
|
|
14567
14736
|
syncUserEdit(e, t) {
|
|
14568
|
-
const r =
|
|
14737
|
+
const r = I.get(e);
|
|
14569
14738
|
if (r instanceof S && (r.syncValue(), t ? r.markUserEditOnChange() : r.markUserEdit(), e instanceof HTMLInputElement && e.type === "radio" && e.name)) {
|
|
14570
14739
|
const i = document.getElementsByName(e.name);
|
|
14571
14740
|
for (const n of Array.from(i)) {
|
|
14572
14741
|
if (n === e || !(n instanceof HTMLInputElement) || n.type !== "radio" || n.form !== e.form)
|
|
14573
14742
|
continue;
|
|
14574
|
-
const s =
|
|
14743
|
+
const s = I.get(n);
|
|
14575
14744
|
s instanceof S && (s.syncValue(), s.markUserEdit());
|
|
14576
14745
|
}
|
|
14577
14746
|
}
|
|
@@ -14619,13 +14788,13 @@ const Re = class Re {
|
|
|
14619
14788
|
return null;
|
|
14620
14789
|
}
|
|
14621
14790
|
};
|
|
14622
|
-
|
|
14791
|
+
we.HISTORY_STATE_KEY = "__haoriHistoryState__", we.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
14623
14792
|
"click",
|
|
14624
14793
|
"change",
|
|
14625
14794
|
"input",
|
|
14626
14795
|
"load"
|
|
14627
14796
|
]);
|
|
14628
|
-
let Ve =
|
|
14797
|
+
let Ve = we;
|
|
14629
14798
|
const V = class V {
|
|
14630
14799
|
/**
|
|
14631
14800
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -14664,7 +14833,7 @@ const V = class V {
|
|
|
14664
14833
|
* @returns 戻り値はありません。
|
|
14665
14834
|
*/
|
|
14666
14835
|
static syncElement(e) {
|
|
14667
|
-
const t = V.registrations.get(e), r =
|
|
14836
|
+
const t = V.registrations.get(e), r = I.get(e);
|
|
14668
14837
|
if (!r || !V.shouldObserve(r)) {
|
|
14669
14838
|
t && (t.observer.disconnect(), V.registrations.delete(e));
|
|
14670
14839
|
return;
|
|
@@ -14725,7 +14894,7 @@ const V = class V {
|
|
|
14725
14894
|
static runProcedure(e, t) {
|
|
14726
14895
|
t.pending = !1, t.running = !0;
|
|
14727
14896
|
let r = !1;
|
|
14728
|
-
new
|
|
14897
|
+
new ae(t.fragment, "intersect").runWithResult().then((i) => {
|
|
14729
14898
|
r = i;
|
|
14730
14899
|
}).catch((i) => {
|
|
14731
14900
|
m.error("[Haori]", "Intersect procedure execution error:", i);
|
|
@@ -14795,7 +14964,7 @@ const V = class V {
|
|
|
14795
14964
|
const r = e.getAttribute(t);
|
|
14796
14965
|
if (typeof r != "string" || r.trim() === "")
|
|
14797
14966
|
return null;
|
|
14798
|
-
const i =
|
|
14967
|
+
const i = Z.query(r, t, document);
|
|
14799
14968
|
return V.isHtmlElement(i) ? i : (m.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
14800
14969
|
}
|
|
14801
14970
|
static resolveRootMargin(e) {
|
|
@@ -14823,7 +14992,7 @@ V.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
14823
14992
|
"disabled",
|
|
14824
14993
|
"once"
|
|
14825
14994
|
]), V.registrations = /* @__PURE__ */ new Map();
|
|
14826
|
-
let
|
|
14995
|
+
let Ee = V;
|
|
14827
14996
|
const v = class v {
|
|
14828
14997
|
/**
|
|
14829
14998
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
@@ -14849,7 +15018,7 @@ const v = class v {
|
|
|
14849
15018
|
const t = v.registrations.get(e);
|
|
14850
15019
|
if (!t && !v.hasPollAttribute(e))
|
|
14851
15020
|
return;
|
|
14852
|
-
const r =
|
|
15021
|
+
const r = I.get(e);
|
|
14853
15022
|
if (!(r instanceof S) || !v.shouldObserve(r)) {
|
|
14854
15023
|
t && v.teardown(e, t);
|
|
14855
15024
|
return;
|
|
@@ -15012,7 +15181,7 @@ const v = class v {
|
|
|
15012
15181
|
t.fetching = !0, t.count += 1;
|
|
15013
15182
|
let i = !1;
|
|
15014
15183
|
try {
|
|
15015
|
-
i = await new
|
|
15184
|
+
i = await new ae(
|
|
15016
15185
|
t.fragment,
|
|
15017
15186
|
"poll"
|
|
15018
15187
|
).runWithResult();
|
|
@@ -15058,7 +15227,7 @@ const v = class v {
|
|
|
15058
15227
|
*/
|
|
15059
15228
|
static async handleTimeout(e) {
|
|
15060
15229
|
const t = v.registrations.get(e);
|
|
15061
|
-
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected &&
|
|
15230
|
+
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected && H.pollTimeout(
|
|
15062
15231
|
e,
|
|
15063
15232
|
t.count,
|
|
15064
15233
|
v.elapsed(t)
|
|
@@ -15078,7 +15247,7 @@ const v = class v {
|
|
|
15078
15247
|
v.registrations.delete(e);
|
|
15079
15248
|
return;
|
|
15080
15249
|
}
|
|
15081
|
-
await v.injectState(t), e.isConnected &&
|
|
15250
|
+
await v.injectState(t), e.isConnected && H.pollStop(
|
|
15082
15251
|
e,
|
|
15083
15252
|
r,
|
|
15084
15253
|
t.count,
|
|
@@ -15191,7 +15360,7 @@ const v = class v {
|
|
|
15191
15360
|
const i = r.getAttribute(t);
|
|
15192
15361
|
if (typeof i != "string" || i.trim() === "")
|
|
15193
15362
|
return r.getTarget().isConnected ? [r] : [];
|
|
15194
|
-
const n =
|
|
15363
|
+
const n = Z.queryAll(
|
|
15195
15364
|
i,
|
|
15196
15365
|
t,
|
|
15197
15366
|
document
|
|
@@ -15202,7 +15371,7 @@ const v = class v {
|
|
|
15202
15371
|
return n.forEach((a) => {
|
|
15203
15372
|
if (!a.isConnected)
|
|
15204
15373
|
return;
|
|
15205
|
-
const o =
|
|
15374
|
+
const o = I.get(a);
|
|
15206
15375
|
o instanceof S && s.push(o);
|
|
15207
15376
|
}), s;
|
|
15208
15377
|
}
|
|
@@ -15350,9 +15519,9 @@ v.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
15350
15519
|
"disabled",
|
|
15351
15520
|
"state"
|
|
15352
15521
|
]), v.DEFAULT_INTERVAL_MS = 5e3, v.MIN_INTERVAL_MS = 100, v.registrations = /* @__PURE__ */ new Map(), v.visibilityListener = null;
|
|
15353
|
-
let
|
|
15354
|
-
const
|
|
15355
|
-
function
|
|
15522
|
+
let Ae = v;
|
|
15523
|
+
const zt = "0.57.0";
|
|
15524
|
+
function Gt(b) {
|
|
15356
15525
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => b()) : Promise.resolve().then(b);
|
|
15357
15526
|
}
|
|
15358
15527
|
const O = class O {
|
|
@@ -15385,7 +15554,7 @@ const O = class O {
|
|
|
15385
15554
|
* @param element 対象要素
|
|
15386
15555
|
*/
|
|
15387
15556
|
static syncElement(e) {
|
|
15388
|
-
const t = O.registrations.get(e), r =
|
|
15557
|
+
const t = O.registrations.get(e), r = I.get(e);
|
|
15389
15558
|
if (!(r instanceof S) || !O.shouldObserve(r)) {
|
|
15390
15559
|
t && (t.observer.disconnect(), O.registrations.delete(e));
|
|
15391
15560
|
return;
|
|
@@ -15490,7 +15659,7 @@ const O = class O {
|
|
|
15490
15659
|
const r = e.getAttribute(t);
|
|
15491
15660
|
if (typeof r != "string" || r.trim() === "")
|
|
15492
15661
|
return null;
|
|
15493
|
-
const i =
|
|
15662
|
+
const i = Z.query(r, t, document);
|
|
15494
15663
|
return O.isHtmlElement(i) ? i : (m.error("[Haori]", `Visible range root element not found: ${r}`), null);
|
|
15495
15664
|
}
|
|
15496
15665
|
/**
|
|
@@ -15534,7 +15703,7 @@ const O = class O {
|
|
|
15534
15703
|
* @param registration 対象の登録
|
|
15535
15704
|
*/
|
|
15536
15705
|
static scheduleCompute(e) {
|
|
15537
|
-
e.scheduled || (e.scheduled = !0,
|
|
15706
|
+
e.scheduled || (e.scheduled = !0, Gt(() => {
|
|
15538
15707
|
e.scheduled = !1;
|
|
15539
15708
|
const t = e.fragment.getTarget();
|
|
15540
15709
|
O.registrations.get(t) === e && O.computeAndPublish(e);
|
|
@@ -15631,28 +15800,28 @@ const O = class O {
|
|
|
15631
15800
|
}
|
|
15632
15801
|
};
|
|
15633
15802
|
O.THRESHOLD = 0, O.DEFAULT_ROOT_MARGIN = "0px", O.registrations = /* @__PURE__ */ new Map();
|
|
15634
|
-
let
|
|
15635
|
-
const
|
|
15803
|
+
let ge = O;
|
|
15804
|
+
const U = class U {
|
|
15636
15805
|
/**
|
|
15637
15806
|
* 既存の MutationObserver をすべて停止します。
|
|
15638
15807
|
*/
|
|
15639
15808
|
static disconnectMutationObservers() {
|
|
15640
|
-
|
|
15809
|
+
U._mutationObservers.forEach((e) => {
|
|
15641
15810
|
e.disconnect();
|
|
15642
|
-
}),
|
|
15811
|
+
}), U._mutationObservers.length = 0;
|
|
15643
15812
|
}
|
|
15644
15813
|
/**
|
|
15645
15814
|
* 初期化メソッド。
|
|
15646
15815
|
* ドキュメントのheadとbodyを監視対象として設定します。
|
|
15647
15816
|
*/
|
|
15648
15817
|
static async init() {
|
|
15649
|
-
if (
|
|
15818
|
+
if (U._initialized)
|
|
15650
15819
|
return;
|
|
15651
|
-
|
|
15652
|
-
|
|
15820
|
+
U._initialized = !0, U.disconnectMutationObservers(), S.setPendingMutationFlusher(() => {
|
|
15821
|
+
U.flushPendingMutations();
|
|
15653
15822
|
});
|
|
15654
15823
|
const e = new Ve();
|
|
15655
|
-
|
|
15824
|
+
U._dispatcher = e, e.startDeferred(), U._initialIntakes = [];
|
|
15656
15825
|
try {
|
|
15657
15826
|
const t = await Promise.allSettled([
|
|
15658
15827
|
$.scan(document.head),
|
|
@@ -15666,11 +15835,11 @@ const H = class H {
|
|
|
15666
15835
|
"[Haori]",
|
|
15667
15836
|
"Failed to build body fragment:",
|
|
15668
15837
|
i.reason
|
|
15669
|
-
), await
|
|
15838
|
+
), await U.waitInitialIntakes(), await K.wait(), document.body.setAttribute("data-haori-ready", ""), U.observe(document.head), U.observe(document.body), Ee.syncTree(document.body), Ae.syncTree(document.body), ge.syncTree(document.body);
|
|
15670
15839
|
} finally {
|
|
15671
|
-
|
|
15840
|
+
U._initialIntakes = null, e.release();
|
|
15672
15841
|
}
|
|
15673
|
-
|
|
15842
|
+
H.ready(zt);
|
|
15674
15843
|
}
|
|
15675
15844
|
/**
|
|
15676
15845
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -15679,7 +15848,7 @@ const H = class H {
|
|
|
15679
15848
|
* @returns 稼働中の EventDispatcher。未初期化の場合は null。
|
|
15680
15849
|
*/
|
|
15681
15850
|
static getDispatcher() {
|
|
15682
|
-
return
|
|
15851
|
+
return U._dispatcher;
|
|
15683
15852
|
}
|
|
15684
15853
|
/**
|
|
15685
15854
|
* 初期化の途中で取り込んだ DOM 変更の処理を、すべて待ちます。
|
|
@@ -15692,7 +15861,7 @@ const H = class H {
|
|
|
15692
15861
|
* @returns 待機完了の Promise
|
|
15693
15862
|
*/
|
|
15694
15863
|
static async waitInitialIntakes() {
|
|
15695
|
-
const e =
|
|
15864
|
+
const e = U._initialIntakes;
|
|
15696
15865
|
for (; e !== null && e.length > 0; )
|
|
15697
15866
|
await Promise.allSettled(e.splice(0));
|
|
15698
15867
|
}
|
|
@@ -15712,7 +15881,7 @@ const H = class H {
|
|
|
15712
15881
|
* @returns 戻り値はありません。
|
|
15713
15882
|
*/
|
|
15714
15883
|
static captureMutations(e) {
|
|
15715
|
-
if (
|
|
15884
|
+
if (U._mutationObservers.length > 0) {
|
|
15716
15885
|
e();
|
|
15717
15886
|
return;
|
|
15718
15887
|
}
|
|
@@ -15727,8 +15896,8 @@ const H = class H {
|
|
|
15727
15896
|
try {
|
|
15728
15897
|
e();
|
|
15729
15898
|
} finally {
|
|
15730
|
-
const r = t.takeRecords().map((i) =>
|
|
15731
|
-
t.disconnect(),
|
|
15899
|
+
const r = t.takeRecords().map((i) => U.toCapturedRecord(i));
|
|
15900
|
+
t.disconnect(), U.processMutations(r);
|
|
15732
15901
|
}
|
|
15733
15902
|
}
|
|
15734
15903
|
/**
|
|
@@ -15753,7 +15922,7 @@ const H = class H {
|
|
|
15753
15922
|
type: e.type,
|
|
15754
15923
|
target: e.target,
|
|
15755
15924
|
addedNodes: Array.from(e.addedNodes).filter(
|
|
15756
|
-
(t) => !
|
|
15925
|
+
(t) => !U.hasKnownDescendant(t)
|
|
15757
15926
|
),
|
|
15758
15927
|
removedNodes: []
|
|
15759
15928
|
};
|
|
@@ -15817,14 +15986,14 @@ const H = class H {
|
|
|
15817
15986
|
*/
|
|
15818
15987
|
static observe(e) {
|
|
15819
15988
|
const t = new MutationObserver((r) => {
|
|
15820
|
-
|
|
15989
|
+
U.processMutations(r);
|
|
15821
15990
|
});
|
|
15822
15991
|
t.observe(e, {
|
|
15823
15992
|
childList: !0,
|
|
15824
15993
|
subtree: !0,
|
|
15825
15994
|
attributes: !0,
|
|
15826
15995
|
characterData: !0
|
|
15827
|
-
}),
|
|
15996
|
+
}), U._mutationObservers.push(t);
|
|
15828
15997
|
}
|
|
15829
15998
|
/**
|
|
15830
15999
|
* 保留中の DOM 変更を同期的に引き取って処理へ載せます。
|
|
@@ -15847,15 +16016,15 @@ const H = class H {
|
|
|
15847
16016
|
* @returns 戻り値はありません。
|
|
15848
16017
|
*/
|
|
15849
16018
|
static flushPendingMutations() {
|
|
15850
|
-
for (const e of
|
|
16019
|
+
for (const e of U._mutationObservers) {
|
|
15851
16020
|
const t = e.takeRecords();
|
|
15852
16021
|
if (t.length === 0)
|
|
15853
16022
|
continue;
|
|
15854
|
-
const r = t.filter(
|
|
15855
|
-
(n) => !
|
|
16023
|
+
const r = t.filter(U.isBindAttributeRecord), i = t.filter(
|
|
16024
|
+
(n) => !U.isBindAttributeRecord(n)
|
|
15856
16025
|
);
|
|
15857
|
-
r.length > 0 &&
|
|
15858
|
-
|
|
16026
|
+
r.length > 0 && U.processMutations(r, S.nextSequence()), i.length > 0 && Promise.resolve().then(() => {
|
|
16027
|
+
U.processMutations(i);
|
|
15859
16028
|
});
|
|
15860
16029
|
}
|
|
15861
16030
|
}
|
|
@@ -15879,12 +16048,12 @@ const H = class H {
|
|
|
15879
16048
|
static processMutations(e, t) {
|
|
15880
16049
|
for (const r of e)
|
|
15881
16050
|
try {
|
|
15882
|
-
if (
|
|
16051
|
+
if (U.isExternallyManaged(r.target))
|
|
15883
16052
|
continue;
|
|
15884
16053
|
switch (r.type) {
|
|
15885
16054
|
case "attributes": {
|
|
15886
16055
|
const i = r.target;
|
|
15887
|
-
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(
|
|
16056
|
+
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(he) && (r.attributeName === "disabled" || r.attributeName === he))
|
|
15888
16057
|
break;
|
|
15889
16058
|
if (r.attributeName && (r.attributeName === `${l.prefix}if-false` || r.attributeName === "style" && i.hasAttribute(`${l.prefix}if-false`))) {
|
|
15890
16059
|
r.attributeName === "style" && S.reassertHiddenDisplay(i);
|
|
@@ -15899,18 +16068,18 @@ const H = class H {
|
|
|
15899
16068
|
!0,
|
|
15900
16069
|
t
|
|
15901
16070
|
);
|
|
15902
|
-
|
|
16071
|
+
U._initialIntakes?.push(n), Ee.syncElement(i), Ae.syncElement(i), ge.syncElement(i);
|
|
15903
16072
|
break;
|
|
15904
16073
|
}
|
|
15905
16074
|
case "childList": {
|
|
15906
16075
|
Array.from(r.removedNodes).forEach((i) => {
|
|
15907
|
-
|
|
16076
|
+
U.isStaleExternalRemoval(r, i) || (Ee.cleanupTree(i), Ae.cleanupTree(i), ge.cleanupTree(i), $.removeNode(i));
|
|
15908
16077
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
15909
16078
|
if (!(i.parentElement instanceof Element))
|
|
15910
16079
|
return;
|
|
15911
16080
|
const n = $.addNode(i.parentElement, i);
|
|
15912
|
-
|
|
15913
|
-
}), r.target instanceof Element &&
|
|
16081
|
+
U._initialIntakes?.push(n), Ee.syncTree(i), Ae.syncTree(i), ge.syncTree(i);
|
|
16082
|
+
}), r.target instanceof Element && ge.syncElement(r.target);
|
|
15914
16083
|
break;
|
|
15915
16084
|
}
|
|
15916
16085
|
case "characterData": {
|
|
@@ -15930,23 +16099,23 @@ const H = class H {
|
|
|
15930
16099
|
}
|
|
15931
16100
|
}
|
|
15932
16101
|
};
|
|
15933
|
-
|
|
15934
|
-
let
|
|
15935
|
-
|
|
15936
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
15937
|
-
const
|
|
16102
|
+
U._initialized = !1, U._mutationObservers = [], U._dispatcher = null, U._initialIntakes = null;
|
|
16103
|
+
let ke = U;
|
|
16104
|
+
te.setMutationCapture((b) => ke.captureMutations(b));
|
|
16105
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", ke.init) : ke.init();
|
|
16106
|
+
const Yt = () => Se.waitForRenders(), Xt = Se.enhancers;
|
|
15938
16107
|
export {
|
|
15939
16108
|
$ as Core,
|
|
15940
|
-
|
|
16109
|
+
te as Enhance,
|
|
15941
16110
|
l as Env,
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
16111
|
+
k as Form,
|
|
16112
|
+
I as Fragment,
|
|
16113
|
+
Se as Haori,
|
|
15945
16114
|
m as Log,
|
|
15946
|
-
|
|
15947
|
-
|
|
15948
|
-
|
|
15949
|
-
|
|
15950
|
-
|
|
16115
|
+
K as Queue,
|
|
16116
|
+
Se as default,
|
|
16117
|
+
Xt as enhancers,
|
|
16118
|
+
zt as version,
|
|
16119
|
+
Yt as waitForRenders
|
|
15951
16120
|
};
|
|
15952
16121
|
//# sourceMappingURL=haori.es.js.map
|