haori 0.1.3 → 0.1.4

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/dist/haori.es.js CHANGED
@@ -1,23 +1,23 @@
1
- const k = class k {
1
+ const R = class R {
2
2
  /**
3
3
  * 開発モードの状態を取得します。
4
4
  *
5
5
  * @returns 開発モードならtrue、そうでなければfalse
6
6
  */
7
7
  static isEnabled() {
8
- return k.devMode;
8
+ return R.devMode;
9
9
  }
10
10
  /**
11
11
  * 開発モードを有効化します。
12
12
  */
13
13
  static enable() {
14
- k.devMode = !0;
14
+ R.devMode = !0;
15
15
  }
16
16
  /**
17
17
  * 開発モードを無効化します。
18
18
  */
19
19
  static disable() {
20
- k.devMode = !1;
20
+ R.devMode = !1;
21
21
  }
22
22
  /**
23
23
  * 開発モードを切り替えます。
@@ -25,12 +25,12 @@ const k = class k {
25
25
  * @param enabled trueで有効化、falseで無効化
26
26
  */
27
27
  static set(t) {
28
- k.devMode = t;
28
+ R.devMode = t;
29
29
  }
30
30
  };
31
- k.devMode = !1;
32
- let O = k;
33
- const D = class D {
31
+ R.devMode = !1;
32
+ let O = R;
33
+ const M = class M {
34
34
  /**
35
35
  * 実行環境からプレフィックスと開発モードかどうかを自動検出します。
36
36
  * scriptタグにdata-prefixがある場合は、その値+"-"をプレフィックスとして使用します。
@@ -41,10 +41,10 @@ const D = class D {
41
41
  try {
42
42
  const t = document.currentScript || document.querySelector('script[src*="haori"]');
43
43
  if (t instanceof HTMLScriptElement) {
44
- const r = t.getAttribute("data-prefix") || D._prefix;
45
- D._prefix = r.endsWith("-") ? r : r + "-";
44
+ const r = t.getAttribute("data-prefix") || M._prefix;
45
+ M._prefix = r.endsWith("-") ? r : r + "-";
46
46
  }
47
- if (t instanceof HTMLScriptElement && t.hasAttribute(`${D._prefix}dev`)) {
47
+ if (t instanceof HTMLScriptElement && t.hasAttribute(`${M._prefix}dev`)) {
48
48
  O.set(!0);
49
49
  return;
50
50
  }
@@ -63,13 +63,13 @@ const D = class D {
63
63
  * @returns プレフィックス
64
64
  */
65
65
  static get prefix() {
66
- return D._prefix;
66
+ return M._prefix;
67
67
  }
68
68
  };
69
- D._prefix = "data-";
70
- let c = D;
71
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", c.detect) : c.detect();
72
- class h {
69
+ M._prefix = "data-";
70
+ let h = M;
71
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", h.detect) : h.detect();
72
+ class f {
73
73
  /**
74
74
  * 開発モードでのみコンソールに情報を出力します。
75
75
  *
@@ -98,7 +98,7 @@ class h {
98
98
  console.error(t, ...e);
99
99
  }
100
100
  }
101
- class J {
101
+ class z {
102
102
  constructor() {
103
103
  this.MAX_BUDGET = 8, this.queue = [], this.processing = !1;
104
104
  }
@@ -111,16 +111,16 @@ class J {
111
111
  */
112
112
  enqueue(t, e = !1) {
113
113
  let r, n;
114
- const i = new Promise((a, o) => {
114
+ const s = new Promise((a, o) => {
115
115
  r = a, n = o;
116
- }), s = {
116
+ }), i = {
117
117
  task: t,
118
118
  timestamp: performance.now(),
119
- promise: i,
119
+ promise: s,
120
120
  resolve: r,
121
121
  reject: n
122
122
  };
123
- return e ? this.queue.unshift(s) : this.queue.push(s), this.scheduleProcessing(), i;
123
+ return e ? this.queue.unshift(i) : this.queue.push(i), this.scheduleProcessing(), s;
124
124
  }
125
125
  /**
126
126
  * キューを処理します。
@@ -140,13 +140,13 @@ class J {
140
140
  const r = await e.task();
141
141
  e.resolve(r);
142
142
  } catch (r) {
143
- e.reject(r), h.error("[Haori]", `Task ${e.timestamp} failed:`, r);
143
+ e.reject(r), f.error("[Haori]", `Task ${e.timestamp} failed:`, r);
144
144
  }
145
145
  if (performance.now() - t > this.MAX_BUDGET)
146
146
  break;
147
147
  }
148
148
  } catch (t) {
149
- h.error("[Haori]", "Error processing queue:", t);
149
+ f.error("[Haori]", "Error processing queue:", t);
150
150
  } finally {
151
151
  this.processing = !1, this.queue.length > 0 && this.scheduleProcessing();
152
152
  }
@@ -174,7 +174,7 @@ class J {
174
174
  t.length > 0 && await Promise.allSettled(t);
175
175
  }
176
176
  }
177
- const G = class G {
177
+ const J = class J {
178
178
  /**
179
179
  * タスクをキューに追加します。
180
180
  *
@@ -192,9 +192,9 @@ const G = class G {
192
192
  return this.ASYNC_QUEUE.wait();
193
193
  }
194
194
  };
195
- G.ASYNC_QUEUE = new J();
196
- let N = G;
197
- class Y {
195
+ J.ASYNC_QUEUE = new z();
196
+ let N = J;
197
+ class X {
198
198
  /**
199
199
  * 通知ダイアログを表示します。
200
200
  *
@@ -239,7 +239,7 @@ class Y {
239
239
  */
240
240
  static openDialog(t) {
241
241
  return N.enqueue(() => {
242
- t instanceof HTMLDialogElement ? t.showModal() : h.error("[Haori]", "Element is not a dialog: ", t);
242
+ t instanceof HTMLDialogElement ? t.showModal() : f.error("[Haori]", "Element is not a dialog: ", t);
243
243
  }, !0);
244
244
  }
245
245
  /**
@@ -249,7 +249,7 @@ class Y {
249
249
  */
250
250
  static closeDialog(t) {
251
251
  return N.enqueue(() => {
252
- t instanceof HTMLDialogElement ? t.close() : h.error("[Haori]", "Element is not a dialog: ", t);
252
+ t instanceof HTMLDialogElement ? t.close() : f.error("[Haori]", "Element is not a dialog: ", t);
253
253
  }, !0);
254
254
  }
255
255
  /**
@@ -284,12 +284,12 @@ class Y {
284
284
  }, !0);
285
285
  }
286
286
  }
287
- const z = ["addErrorMessage", "clearMessages"];
287
+ const Q = ["addErrorMessage", "clearMessages"];
288
288
  function W() {
289
289
  const t = globalThis.window?.Haori;
290
- return z.every(
290
+ return Q.every(
291
291
  (r) => typeof t?.[r] == "function"
292
- ) ? t : Y;
292
+ ) ? t : X;
293
293
  }
294
294
  class E {
295
295
  /**
@@ -313,32 +313,32 @@ class E {
313
313
  * @returns values と同じオブジェクト
314
314
  */
315
315
  static getPartValues(t, e) {
316
- const r = t.getAttribute("name"), n = t.getAttribute(`${c.prefix}form-object`), i = t.getAttribute(`${c.prefix}form-list`);
316
+ const r = t.getAttribute("name"), n = t.getAttribute(`${h.prefix}form-object`), s = t.getAttribute(`${h.prefix}form-list`);
317
317
  if (r) {
318
- i ? Array.isArray(e[String(r)]) ? e[String(r)].push(t.getValue()) : e[String(r)] = [t.getValue()] : e[String(r)] = t.getValue(), n && h.warn(
318
+ s ? Array.isArray(e[String(r)]) ? e[String(r)].push(t.getValue()) : e[String(r)] = [t.getValue()] : e[String(r)] = t.getValue(), n && f.warn(
319
319
  "Haori",
320
- `Element cannot have both ${c.prefix}form-object and name attributes.`
320
+ `Element cannot have both ${h.prefix}form-object and name attributes.`
321
321
  );
322
- for (const s of t.getChildElementFragments())
323
- E.getPartValues(s, e);
322
+ for (const i of t.getChildElementFragments())
323
+ E.getPartValues(i, e);
324
324
  } else if (n) {
325
- const s = {};
325
+ const i = {};
326
326
  for (const a of t.getChildElementFragments())
327
- E.getPartValues(a, s);
328
- Object.keys(s).length > 0 && (e[String(n)] = s), i && h.warn(
327
+ E.getPartValues(a, i);
328
+ Object.keys(i).length > 0 && (e[String(n)] = i), s && f.warn(
329
329
  "Haori",
330
- `Element cannot have both ${c.prefix}form-list and ${c.prefix}form-object attributes.`
330
+ `Element cannot have both ${h.prefix}form-list and ${h.prefix}form-object attributes.`
331
331
  );
332
- } else if (i) {
333
- const s = [];
332
+ } else if (s) {
333
+ const i = [];
334
334
  for (const a of t.getChildElementFragments()) {
335
335
  const o = {};
336
- E.getPartValues(a, o), Object.keys(o).length > 0 && s.push(o);
336
+ E.getPartValues(a, o), Object.keys(o).length > 0 && i.push(o);
337
337
  }
338
- s.length > 0 && (e[String(i)] = s);
338
+ i.length > 0 && (e[String(s)] = i);
339
339
  } else
340
- for (const s of t.getChildElementFragments())
341
- E.getPartValues(s, e);
340
+ for (const i of t.getChildElementFragments())
341
+ E.getPartValues(i, e);
342
342
  return e;
343
343
  }
344
344
  /**
@@ -363,17 +363,17 @@ class E {
363
363
  * @returns Promise(DOMの更新が完了したら解決される)
364
364
  */
365
365
  static setPartValues(t, e, r = null, n = !1) {
366
- const i = [], s = t.getAttribute("name"), a = t.getAttribute(`${c.prefix}form-object`), o = t.getAttribute(`${c.prefix}form-list`), g = t.getAttribute(`${c.prefix}form-detach`);
367
- if (s) {
366
+ const s = [], i = t.getAttribute("name"), a = t.getAttribute(`${h.prefix}form-object`), o = t.getAttribute(`${h.prefix}form-list`), g = t.getAttribute(`${h.prefix}form-detach`);
367
+ if (i) {
368
368
  if (!g || n) {
369
- const u = e[String(s)];
370
- o && Array.isArray(u) && r !== null ? i.push(t.setValue(u[r])) : typeof u == "string" || typeof u == "number" || typeof u == "boolean" || u === null ? i.push(t.setValue(u)) : i.push(t.setValue(String(u)));
369
+ const u = e[String(i)];
370
+ o && Array.isArray(u) && r !== null ? s.push(t.setValue(u[r])) : typeof u == "string" || typeof u == "number" || typeof u == "boolean" || u === null ? s.push(t.setValue(u)) : s.push(t.setValue(String(u)));
371
371
  }
372
372
  } else if (a) {
373
373
  const u = e[String(a)];
374
374
  if (u && typeof u == "object")
375
375
  for (const b of t.getChildElementFragments())
376
- i.push(
376
+ s.push(
377
377
  E.setPartValues(
378
378
  b,
379
379
  u,
@@ -386,21 +386,21 @@ class E {
386
386
  if (Array.isArray(u)) {
387
387
  const b = t.getChildElementFragments();
388
388
  for (let l = 0; l < b.length; l++) {
389
- const f = b[l];
390
- u.length > l ? i.push(
389
+ const d = b[l];
390
+ u.length > l ? s.push(
391
391
  E.setPartValues(
392
- f,
392
+ d,
393
393
  u[l],
394
394
  l,
395
395
  n
396
396
  )
397
- ) : i.push(E.setPartValues(f, {}, l, n));
397
+ ) : s.push(E.setPartValues(d, {}, l, n));
398
398
  }
399
399
  }
400
400
  } else
401
401
  for (const u of t.getChildElementFragments())
402
- i.push(E.setPartValues(u, e, null, n));
403
- return Promise.all(i).then(() => {
402
+ s.push(E.setPartValues(u, e, null, n));
403
+ return Promise.all(s).then(() => {
404
404
  });
405
405
  }
406
406
  /**
@@ -421,8 +421,8 @@ class E {
421
421
  else {
422
422
  const r = e.parentElement;
423
423
  if (r) {
424
- const n = e.nextElementSibling, i = document.createElement("form");
425
- i.appendChild(e), i.reset(), r.insertBefore(e, n);
424
+ const n = e.nextElementSibling, s = document.createElement("form");
425
+ s.appendChild(e), s.reset(), r.insertBefore(e, n);
426
426
  }
427
427
  }
428
428
  }), await T.evaluateAll(t);
@@ -434,20 +434,20 @@ class E {
434
434
  * 対象エレメント自体は削除しません。
435
435
  */
436
436
  static clearEachClones(t) {
437
- const e = [], r = (i) => {
438
- if (i.hasAttribute(`${c.prefix}each`))
439
- for (const s of i.getChildElementFragments()) {
440
- const a = s.hasAttribute(`${c.prefix}each-before`), o = s.hasAttribute(`${c.prefix}each-after`);
441
- !a && !o && e.push(s.remove());
437
+ const e = [], r = (s) => {
438
+ if (s.hasAttribute(`${h.prefix}each`))
439
+ for (const i of s.getChildElementFragments()) {
440
+ const a = i.hasAttribute(`${h.prefix}each-before`), o = i.hasAttribute(`${h.prefix}each-after`);
441
+ !a && !o && e.push(i.remove());
442
442
  }
443
- }, n = (i) => {
444
- r(i);
445
- for (const s of i.getChildElementFragments())
446
- n(s);
443
+ }, n = (s) => {
444
+ r(s);
445
+ for (const i of s.getChildElementFragments())
446
+ n(i);
447
447
  };
448
448
  r(t);
449
- for (const i of t.getChildElementFragments())
450
- n(i);
449
+ for (const s of t.getChildElementFragments())
450
+ n(s);
451
451
  return Promise.all(e).then(() => {
452
452
  });
453
453
  }
@@ -482,13 +482,13 @@ class E {
482
482
  * @return Promise(メッセージの追加が完了したら解決される)
483
483
  */
484
484
  static addErrorMessage(t, e, r) {
485
- const n = [], i = W(), s = E.findFragmentsByKey(t, e);
486
- return s.forEach((a) => {
485
+ const n = [], s = W(), i = E.findFragmentsByKey(t, e);
486
+ return i.forEach((a) => {
487
487
  n.push(
488
- i.addErrorMessage(a.getTarget(), r)
488
+ s.addErrorMessage(a.getTarget(), r)
489
489
  );
490
- }), s.length === 0 && n.push(
491
- i.addErrorMessage(t.getTarget(), r)
490
+ }), i.length === 0 && n.push(
491
+ s.addErrorMessage(t.getTarget(), r)
492
492
  ), Promise.all(n).then(() => {
493
493
  });
494
494
  }
@@ -512,21 +512,21 @@ class E {
512
512
  */
513
513
  static findFragmentByKeyParts(t, e) {
514
514
  const r = [], n = e[0];
515
- if (e.length == 1 && t.getAttribute("name") === n && r.push(t), t.hasAttribute(`${c.prefix}form-object`))
516
- e.length > 1 && t.getAttribute(`${c.prefix}form-object`) === n && t.getChildElementFragments().forEach((s) => {
517
- r.push(...E.findFragmentByKeyParts(s, e.slice(1)));
515
+ if (e.length == 1 && t.getAttribute("name") === n && r.push(t), t.hasAttribute(`${h.prefix}form-object`))
516
+ e.length > 1 && t.getAttribute(`${h.prefix}form-object`) === n && t.getChildElementFragments().forEach((i) => {
517
+ r.push(...E.findFragmentByKeyParts(i, e.slice(1)));
518
518
  });
519
- else if (t.hasAttribute(`${c.prefix}form-list`)) {
519
+ else if (t.hasAttribute(`${h.prefix}form-list`)) {
520
520
  if (e.length > 1) {
521
- const i = t.getAttribute(`${c.prefix}form-list`), s = n.lastIndexOf("["), a = n.lastIndexOf("]");
522
- if (s !== -1 && a !== -1 && s < a) {
523
- const o = n.substring(0, s);
524
- if (i === o) {
525
- const g = n.substring(s + 1, a), u = Number(g);
521
+ const s = t.getAttribute(`${h.prefix}form-list`), i = n.lastIndexOf("["), a = n.lastIndexOf("]");
522
+ if (i !== -1 && a !== -1 && i < a) {
523
+ const o = n.substring(0, i);
524
+ if (s === o) {
525
+ const g = n.substring(i + 1, a), u = Number(g);
526
526
  if (isNaN(u))
527
- h.error("Haori", `Invalid index: ${n}`);
527
+ f.error("Haori", `Invalid index: ${n}`);
528
528
  else {
529
- const b = t.getChildElementFragments().filter((l) => l.hasAttribute(`${c.prefix}row`));
529
+ const b = t.getChildElementFragments().filter((l) => l.hasAttribute(`${h.prefix}row`));
530
530
  u < b.length && r.push(
531
531
  ...E.findFragmentByKeyParts(b[u], e.slice(1))
532
532
  );
@@ -535,8 +535,8 @@ class E {
535
535
  }
536
536
  }
537
537
  } else
538
- t.getChildElementFragments().forEach((i) => {
539
- r.push(...E.findFragmentByKeyParts(i, e));
538
+ t.getChildElementFragments().forEach((s) => {
539
+ r.push(...E.findFragmentByKeyParts(s, e));
540
540
  });
541
541
  return r;
542
542
  }
@@ -553,7 +553,7 @@ class E {
553
553
  return r ? this.getFormFragment(r) : null;
554
554
  }
555
555
  }
556
- const S = class S {
556
+ const P = class P {
557
557
  /**
558
558
  * 明示バインド内に持ち込まれてはならない危険値を返します。
559
559
  *
@@ -598,28 +598,28 @@ const S = class S {
598
598
  */
599
599
  static evaluate(t, e = {}) {
600
600
  if (t.trim() === "")
601
- return h.warn("[Haori]", t, "Expression is empty"), null;
601
+ return f.warn("[Haori]", t, "Expression is empty"), null;
602
602
  if (this.containsDangerousPatterns(t))
603
- return h.warn("[Haori]", t, "Expression contains dangerous patterns"), null;
603
+ return f.warn("[Haori]", t, "Expression contains dangerous patterns"), null;
604
604
  if (this.containsForbiddenKeys(e))
605
- return h.warn("[Haori]", e, "Binded values contain forbidden keys"), null;
605
+ return f.warn("[Haori]", e, "Binded values contain forbidden keys"), null;
606
606
  if (this.containsForbiddenBindingValues(e))
607
- return h.warn(
607
+ return f.warn(
608
608
  "[Haori]",
609
609
  e,
610
610
  "Binded values contain forbidden values"
611
611
  ), null;
612
- const r = Object.keys(e).filter((s) => !this.FORBIDDEN_BINDING_NAMES.has(s)).sort(), n = `${t}:${r.join(",")}`;
613
- let i = this.EXPRESSION_CACHE.get(n);
614
- if (!i) {
615
- const s = this.buildAssignments(r), a = s ? `"use strict";
616
- ${s};
612
+ const r = Object.keys(e).filter((i) => !this.FORBIDDEN_BINDING_NAMES.has(i)).sort(), n = `${t}:${r.join(",")}`;
613
+ let s = this.EXPRESSION_CACHE.get(n);
614
+ if (!s) {
615
+ const i = this.buildAssignments(r), a = i ? `"use strict";
616
+ ${i};
617
617
  return (${t});` : `"use strict";
618
618
  return (${t});`;
619
619
  try {
620
- i = new Function(...r, a), this.EXPRESSION_CACHE.set(n, i);
620
+ s = new Function(...r, a), this.EXPRESSION_CACHE.set(n, s);
621
621
  } catch (o) {
622
- return h.error(
622
+ return f.error(
623
623
  "[Haori]",
624
624
  "Failed to compile expression:",
625
625
  t,
@@ -628,12 +628,12 @@ return (${t});`;
628
628
  }
629
629
  }
630
630
  try {
631
- const s = [], a = this.wrapBoundValues(e);
631
+ const i = [], a = this.wrapBoundValues(e);
632
632
  return r.forEach((o) => {
633
- s.push(a[o]);
634
- }), this.withBlockedPropertyAccess(() => i(...s));
635
- } catch (s) {
636
- return h.error("[Haori]", "Expression evaluation error:", t, s), s instanceof ReferenceError ? void 0 : null;
633
+ i.push(a[o]);
634
+ }), this.withBlockedPropertyAccess(() => s(...i));
635
+ } catch (i) {
636
+ return f.error("[Haori]", "Expression evaluation error:", t, i), i instanceof ReferenceError ? void 0 : null;
637
637
  }
638
638
  }
639
639
  /**
@@ -664,13 +664,13 @@ return (${t});`;
664
664
  return !1;
665
665
  const r = [];
666
666
  let n = null;
667
- for (let i = 0; i < e.length; i++) {
668
- const s = e[i], a = e[i + 1] || null, o = r[r.length - 1] || null;
669
- if (s.type === "identifier" && (this.DISALLOWED_KEYWORDS.has(s.value) || this.STRICT_FORBIDDEN_NAMES.includes(s.value) || (n?.value === "." || n?.value === "?.") && this.FORBIDDEN_PROPERTY_NAMES.has(s.value)) || o === "member" && s.value !== "]" && s.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
670
- this.decodeStringLiteral(s.value)
671
- ) || s.value === "." && a?.type !== "identifier" || s.value === "?." && a?.type !== "identifier" && a?.value !== "[" && a?.value !== "(")
667
+ for (let s = 0; s < e.length; s++) {
668
+ const i = e[s], a = e[s + 1] || null, o = r[r.length - 1] || null;
669
+ if (i.type === "identifier" && (this.DISALLOWED_KEYWORDS.has(i.value) || this.STRICT_FORBIDDEN_NAMES.includes(i.value) || (n?.value === "." || n?.value === "?.") && this.FORBIDDEN_PROPERTY_NAMES.has(i.value)) || o === "member" && i.value !== "]" && i.type === "string" && this.FORBIDDEN_PROPERTY_NAMES.has(
670
+ this.decodeStringLiteral(i.value)
671
+ ) || i.value === "." && a?.type !== "identifier" || i.value === "?." && a?.type !== "identifier" && a?.value !== "[" && a?.value !== "(")
672
672
  return !1;
673
- switch (s.value) {
673
+ switch (i.value) {
674
674
  case "(":
675
675
  r.push("paren");
676
676
  break;
@@ -690,7 +690,7 @@ return (${t});`;
690
690
  break;
691
691
  }
692
692
  }
693
- n = s;
693
+ n = i;
694
694
  }
695
695
  return r.length === 0;
696
696
  }
@@ -731,41 +731,41 @@ return (${t});`;
731
731
  ">",
732
732
  "<"
733
733
  ]);
734
- let i = 0;
735
- for (; i < t.length; ) {
736
- const s = t[i];
737
- if (/\s/.test(s)) {
738
- i += 1;
734
+ let s = 0;
735
+ for (; s < t.length; ) {
736
+ const i = t[s];
737
+ if (/\s/.test(i)) {
738
+ s += 1;
739
739
  continue;
740
740
  }
741
- if (s === "/" && (t[i + 1] === "/" || t[i + 1] === "*"))
741
+ if (i === "/" && (t[s + 1] === "/" || t[s + 1] === "*"))
742
742
  return null;
743
- if (s === '"' || s === "'") {
744
- const o = this.readStringToken(t, i);
743
+ if (i === '"' || i === "'") {
744
+ const o = this.readStringToken(t, s);
745
745
  if (o === null)
746
746
  return null;
747
- e.push(o.token), i = o.nextIndex;
747
+ e.push(o.token), s = o.nextIndex;
748
748
  continue;
749
749
  }
750
750
  const a = r.find(
751
- (o) => t.startsWith(o, i)
751
+ (o) => t.startsWith(o, s)
752
752
  );
753
753
  if (a) {
754
- e.push({ type: "operator", value: a, position: i }), i += a.length;
754
+ e.push({ type: "operator", value: a, position: s }), s += a.length;
755
755
  continue;
756
756
  }
757
- if (/[0-9]/.test(s)) {
758
- const o = this.readNumberToken(t, i);
759
- e.push(o.token), i = o.nextIndex;
757
+ if (/[0-9]/.test(i)) {
758
+ const o = this.readNumberToken(t, s);
759
+ e.push(o.token), s = o.nextIndex;
760
760
  continue;
761
761
  }
762
- if (/[A-Za-z_$]/.test(s)) {
763
- const o = this.readIdentifierToken(t, i);
764
- e.push(o.token), i = o.nextIndex;
762
+ if (/[A-Za-z_$]/.test(i)) {
763
+ const o = this.readIdentifierToken(t, s);
764
+ e.push(o.token), s = o.nextIndex;
765
765
  continue;
766
766
  }
767
- if (n.has(s)) {
768
- e.push({ type: "operator", value: s, position: i }), i += 1;
767
+ if (n.has(i)) {
768
+ e.push({ type: "operator", value: i, position: s }), s += 1;
769
769
  continue;
770
770
  }
771
771
  return null;
@@ -783,12 +783,12 @@ return (${t});`;
783
783
  const r = t[e];
784
784
  let n = e + 1;
785
785
  for (; n < t.length; ) {
786
- const i = t[n];
787
- if (i === "\\") {
786
+ const s = t[n];
787
+ if (s === "\\") {
788
788
  n += 2;
789
789
  continue;
790
790
  }
791
- if (i === r)
791
+ if (s === r)
792
792
  return {
793
793
  token: {
794
794
  type: "string",
@@ -896,8 +896,8 @@ return (${t});`;
896
896
  */
897
897
  static wrapBoundValues(t) {
898
898
  const e = /* @__PURE__ */ new WeakMap(), r = {};
899
- return Object.entries(t).forEach(([n, i]) => {
900
- r[n] = this.wrapBoundValue(i, e);
899
+ return Object.entries(t).forEach(([n, s]) => {
900
+ r[n] = this.wrapBoundValue(s, e);
901
901
  }), r;
902
902
  }
903
903
  /**
@@ -913,39 +913,39 @@ return (${t});`;
913
913
  const r = t, n = e.get(r);
914
914
  if (n !== void 0)
915
915
  return n;
916
- const i = new Proxy(r, {
917
- get: (s, a, o) => {
916
+ const s = new Proxy(r, {
917
+ get: (i, a, o) => {
918
918
  if (typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a))
919
919
  return;
920
- const g = Reflect.get(s, a, o);
920
+ const g = Reflect.get(i, a, o);
921
921
  return typeof a == "symbol" ? g : this.wrapBoundValue(
922
922
  g,
923
923
  e
924
924
  );
925
925
  },
926
- has: (s, a) => typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a) ? !1 : Reflect.has(s, a),
927
- getOwnPropertyDescriptor: (s, a) => {
926
+ has: (i, a) => typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a) ? !1 : Reflect.has(i, a),
927
+ getOwnPropertyDescriptor: (i, a) => {
928
928
  if (!(typeof a == "string" && this.FORBIDDEN_PROPERTY_NAMES.has(a)))
929
- return Reflect.getOwnPropertyDescriptor(s, a);
929
+ return Reflect.getOwnPropertyDescriptor(i, a);
930
930
  },
931
- apply: (s, a, o) => {
931
+ apply: (i, a, o) => {
932
932
  const g = Reflect.apply(
933
- s,
933
+ i,
934
934
  a,
935
935
  o
936
936
  );
937
937
  return this.isIteratorLike(g) ? g : this.wrapBoundValue(g, e);
938
938
  },
939
- construct: (s, a, o) => this.wrapBoundValue(
939
+ construct: (i, a, o) => this.wrapBoundValue(
940
940
  Reflect.construct(
941
- s,
941
+ i,
942
942
  a,
943
943
  o
944
944
  ),
945
945
  e
946
946
  )
947
947
  });
948
- return e.set(r, i), i;
948
+ return e.set(r, s), s;
949
949
  }
950
950
  /**
951
951
  * Proxy ラップ対象の値かどうかを判定します。
@@ -978,8 +978,8 @@ return (${t});`;
978
978
  ...n,
979
979
  descriptor: Object.getOwnPropertyDescriptor(n.target, n.property)
980
980
  })).filter((n) => n.descriptor?.configurable === !0);
981
- r.forEach(({ target: n, property: i }) => {
982
- Object.defineProperty(n, i, {
981
+ r.forEach(({ target: n, property: s }) => {
982
+ Object.defineProperty(n, s, {
983
983
  configurable: !0,
984
984
  enumerable: !1,
985
985
  get: () => {
@@ -991,8 +991,8 @@ return (${t});`;
991
991
  try {
992
992
  return t();
993
993
  } finally {
994
- r.forEach(({ target: n, property: i, descriptor: s }) => {
995
- s !== void 0 && Object.defineProperty(n, i, s);
994
+ r.forEach(({ target: n, property: s, descriptor: i }) => {
995
+ i !== void 0 && Object.defineProperty(n, s, i);
996
996
  });
997
997
  }
998
998
  }
@@ -1046,7 +1046,7 @@ return (${t});`;
1046
1046
  return !1;
1047
1047
  }
1048
1048
  };
1049
- S.FORBIDDEN_NAMES = [
1049
+ P.FORBIDDEN_NAMES = [
1050
1050
  // グローバルオブジェクト
1051
1051
  "window",
1052
1052
  "self",
@@ -1078,19 +1078,19 @@ S.FORBIDDEN_NAMES = [
1078
1078
  "sessionStorage",
1079
1079
  "IndexedDB",
1080
1080
  "history"
1081
- ], S.STRICT_FORBIDDEN_NAMES = ["eval", "arguments"], S.REBINDABLE_FORBIDDEN_NAMES = /* @__PURE__ */ new Set(["location"]), S.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
1082
- ...S.FORBIDDEN_NAMES.filter(
1083
- (t) => !S.REBINDABLE_FORBIDDEN_NAMES.has(t)
1081
+ ], P.STRICT_FORBIDDEN_NAMES = ["eval", "arguments"], P.REBINDABLE_FORBIDDEN_NAMES = /* @__PURE__ */ new Set(["location"]), P.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
1082
+ ...P.FORBIDDEN_NAMES.filter(
1083
+ (t) => !P.REBINDABLE_FORBIDDEN_NAMES.has(t)
1084
1084
  ),
1085
1085
  "constructor",
1086
1086
  "__proto__",
1087
1087
  "prototype",
1088
- ...S.STRICT_FORBIDDEN_NAMES
1089
- ]), S.FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
1088
+ ...P.STRICT_FORBIDDEN_NAMES
1089
+ ]), P.FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
1090
1090
  "constructor",
1091
1091
  "__proto__",
1092
1092
  "prototype"
1093
- ]), S.DISALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
1093
+ ]), P.DISALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
1094
1094
  "await",
1095
1095
  "break",
1096
1096
  "case",
@@ -1124,35 +1124,35 @@ S.FORBIDDEN_NAMES = [
1124
1124
  "while",
1125
1125
  "with",
1126
1126
  "yield"
1127
- ]), S.EXPRESSION_CACHE = /* @__PURE__ */ new Map();
1128
- let H = S;
1129
- const P = class P {
1127
+ ]), P.EXPRESSION_CACHE = /* @__PURE__ */ new Map();
1128
+ let H = P;
1129
+ const k = class k {
1130
1130
  /**
1131
1131
  * フラグメントのコンストラクタ。
1132
1132
  *
1133
1133
  * @param target 対象ノード
1134
1134
  */
1135
1135
  constructor(t) {
1136
- this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.target = t, P.FRAGMENT_CACHE.set(t, this);
1136
+ this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.target = t, k.FRAGMENT_CACHE.set(t, this);
1137
1137
  }
1138
1138
  static get(t) {
1139
1139
  if (t == null)
1140
1140
  return null;
1141
- if (P.FRAGMENT_CACHE.has(t))
1142
- return P.FRAGMENT_CACHE.get(t);
1141
+ if (k.FRAGMENT_CACHE.has(t))
1142
+ return k.FRAGMENT_CACHE.get(t);
1143
1143
  let e;
1144
1144
  switch (t.nodeType) {
1145
1145
  case Node.ELEMENT_NODE:
1146
- e = new M(t);
1146
+ e = new x(t);
1147
1147
  break;
1148
1148
  case Node.TEXT_NODE:
1149
- e = new $(t);
1149
+ e = new I(t);
1150
1150
  break;
1151
1151
  case Node.COMMENT_NODE:
1152
- e = new K(t);
1152
+ e = new G(t);
1153
1153
  break;
1154
1154
  default:
1155
- return h.warn("[Haori]", "Unsupported node type:", t.nodeType), null;
1155
+ return f.warn("[Haori]", "Unsupported node type:", t.nodeType), null;
1156
1156
  }
1157
1157
  return e;
1158
1158
  }
@@ -1230,7 +1230,7 @@ const P = class P {
1230
1230
  * @return 除去のPromise
1231
1231
  */
1232
1232
  remove(t = !0) {
1233
- return this.parent && this.parent.removeChild(this), P.FRAGMENT_CACHE.delete(this.target), t ? this.unmount() : Promise.resolve();
1233
+ return this.parent && this.parent.removeChild(this), k.FRAGMENT_CACHE.delete(this.target), t ? this.unmount() : Promise.resolve();
1234
1234
  }
1235
1235
  /**
1236
1236
  * 対象ノードを取得します。
@@ -1257,9 +1257,9 @@ const P = class P {
1257
1257
  this.parent = t;
1258
1258
  }
1259
1259
  };
1260
- P.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
1261
- let A = P;
1262
- class M extends A {
1260
+ k.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
1261
+ let A = k;
1262
+ class x extends A {
1263
1263
  /**
1264
1264
  * エレメントフラグメントのコンストラクタ。
1265
1265
  * アトリビュートや子フラグメントの作成も行います。
@@ -1285,7 +1285,7 @@ class M extends A {
1285
1285
  ], this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingDataCache = null, this.visible = !0, this.display = null, this.template = null, this.listKey = null, this.value = null, this.skipMutationAttributes = !1, this.skipChangeValue = !1, this.syncValue(), t.getAttributeNames().forEach((e) => {
1286
1286
  const r = t.getAttribute(e);
1287
1287
  if (r !== null && !this.attributeMap.has(e)) {
1288
- const n = new j(e, r);
1288
+ const n = new L(e, r);
1289
1289
  this.attributeMap.set(e, n);
1290
1290
  }
1291
1291
  }), t.childNodes.forEach((e) => {
@@ -1308,7 +1308,7 @@ class M extends A {
1308
1308
  */
1309
1309
  getChildElementFragments() {
1310
1310
  return this.children.filter(
1311
- (t) => t instanceof M
1311
+ (t) => t instanceof x
1312
1312
  );
1313
1313
  }
1314
1314
  /**
@@ -1329,7 +1329,7 @@ class M extends A {
1329
1329
  removeChild(t) {
1330
1330
  const e = this.children.indexOf(t);
1331
1331
  if (e < 0) {
1332
- h.warn("[Haori]", "Child fragment not found.", t);
1332
+ f.warn("[Haori]", "Child fragment not found.", t);
1333
1333
  return;
1334
1334
  }
1335
1335
  this.children.splice(e, 1), t.setParent(null);
@@ -1340,7 +1340,7 @@ class M extends A {
1340
1340
  * @returns クローンされたフラグメント
1341
1341
  */
1342
1342
  clone() {
1343
- const t = new M(
1343
+ const t = new x(
1344
1344
  this.target.cloneNode(!1)
1345
1345
  );
1346
1346
  return this.children.forEach((e) => {
@@ -1398,7 +1398,7 @@ class M extends A {
1398
1398
  */
1399
1399
  clearBindingDataCache() {
1400
1400
  this.bindingDataCache = null, this.children.forEach((t) => {
1401
- t instanceof M && t.clearBindingDataCache();
1401
+ t instanceof x && t.clearBindingDataCache();
1402
1402
  });
1403
1403
  }
1404
1404
  /**
@@ -1456,7 +1456,7 @@ class M extends A {
1456
1456
  e.value = t === null ? "" : String(t), (e instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(e.type) || e instanceof HTMLTextAreaElement) && e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
1457
1457
  }).finally(() => {
1458
1458
  this.skipChangeValue = !1;
1459
- })) : (h.warn(
1459
+ })) : (f.warn(
1460
1460
  "[Haori]",
1461
1461
  "setValue is not supported for this element type.",
1462
1462
  e
@@ -1510,15 +1510,15 @@ class M extends A {
1510
1510
  return Promise.resolve();
1511
1511
  if (e === null)
1512
1512
  return this.removeAttribute(t);
1513
- const r = new j(t, e);
1513
+ const r = new L(t, e);
1514
1514
  this.attributeMap.set(t, r), this.skipMutationAttributes = !0;
1515
- const n = this.getTarget(), i = r.isForceEvaluation() ? e : this.getAttribute(t);
1515
+ const n = this.getTarget(), s = r.isForceEvaluation() ? e : this.getAttribute(t);
1516
1516
  return N.enqueue(() => {
1517
- if (i === null || i === !1)
1517
+ if (s === null || s === !1)
1518
1518
  n.removeAttribute(t);
1519
1519
  else {
1520
- const s = String(i);
1521
- n.getAttribute(t) !== s && n.setAttribute(t, s);
1520
+ const i = String(s);
1521
+ n.getAttribute(t) !== i && n.setAttribute(t, i);
1522
1522
  }
1523
1523
  }).finally(() => {
1524
1524
  this.skipMutationAttributes = !1;
@@ -1594,15 +1594,15 @@ class M extends A {
1594
1594
  if (r.parentNode !== this.target)
1595
1595
  return null;
1596
1596
  const n = e ? r.nextSibling : r;
1597
- let i = e ? r.nextSibling : r;
1598
- for (; i !== null; ) {
1599
- const s = A.get(i);
1600
- if (s !== null) {
1601
- const a = this.children.indexOf(s);
1597
+ let s = e ? r.nextSibling : r;
1598
+ for (; s !== null; ) {
1599
+ const i = A.get(s);
1600
+ if (i !== null) {
1601
+ const a = this.children.indexOf(i);
1602
1602
  if (a !== -1)
1603
1603
  return { index: a, referenceNode: n };
1604
1604
  }
1605
- i = i.nextSibling;
1605
+ s = s.nextSibling;
1606
1606
  }
1607
1607
  return { index: this.children.length, referenceNode: n };
1608
1608
  }
@@ -1618,16 +1618,16 @@ class M extends A {
1618
1618
  if (this.skipMutationNodes)
1619
1619
  return Promise.resolve();
1620
1620
  if (t === this)
1621
- return h.error("[Haori]", "Cannot insert element as child of itself"), Promise.reject(new Error("Self-insertion not allowed"));
1621
+ return f.error("[Haori]", "Cannot insert element as child of itself"), Promise.reject(new Error("Self-insertion not allowed"));
1622
1622
  const n = /* @__PURE__ */ new Set();
1623
- let i = this.parent;
1624
- for (; i; )
1625
- n.add(i), i = i.getParent();
1623
+ let s = this.parent;
1624
+ for (; s; )
1625
+ n.add(s), s = s.getParent();
1626
1626
  if (n.has(t))
1627
- return h.error("[Haori]", "Cannot create circular reference"), Promise.reject(new Error("Circular reference detected"));
1628
- const s = t.getParent() === this;
1627
+ return f.error("[Haori]", "Cannot create circular reference"), Promise.reject(new Error("Circular reference detected"));
1628
+ const i = t.getParent() === this;
1629
1629
  let a = -1, o = -1;
1630
- s && (a = this.children.indexOf(t), e !== null && (o = this.children.indexOf(e)));
1630
+ i && (a = this.children.indexOf(t), e !== null && (o = this.children.indexOf(e)));
1631
1631
  const g = t.getParent();
1632
1632
  g !== null && g.removeChild(t);
1633
1633
  let u = r === void 0 ? e?.getTarget() || null : r;
@@ -1635,16 +1635,16 @@ class M extends A {
1635
1635
  this.children.push(t);
1636
1636
  else {
1637
1637
  let l;
1638
- if (s ? a !== -1 && a < o ? l = o - 1 : l = o : l = this.children.indexOf(e), l === -1) {
1639
- const f = this.resolveInsertionPointFromDom(
1638
+ if (i ? a !== -1 && a < o ? l = o - 1 : l = o : l = this.children.indexOf(e), l === -1) {
1639
+ const d = this.resolveInsertionPointFromDom(
1640
1640
  e,
1641
1641
  !1
1642
1642
  );
1643
- f === null ? (h.warn(
1643
+ d === null ? (f.warn(
1644
1644
  "[Haori]",
1645
1645
  "Reference child not found in children.",
1646
1646
  e
1647
- ), this.children.push(t)) : (this.children.splice(f.index, 0, t), u = f.referenceNode);
1647
+ ), this.children.push(t)) : (this.children.splice(d.index, 0, t), u = d.referenceNode);
1648
1648
  } else
1649
1649
  this.children.splice(l, 0, t);
1650
1650
  }
@@ -1672,7 +1672,7 @@ class M extends A {
1672
1672
  e,
1673
1673
  !0
1674
1674
  );
1675
- return n === null ? (h.warn(
1675
+ return n === null ? (f.warn(
1676
1676
  "[Haori]",
1677
1677
  "Reference child not found in children.",
1678
1678
  e
@@ -1724,7 +1724,7 @@ class M extends A {
1724
1724
  * @returns エレメントの非表示のPromise
1725
1725
  */
1726
1726
  hide() {
1727
- return this.visible = !1, this.display = this.getTarget().style.display, this.getTarget().style.display = "none", this.getTarget().setAttribute(`${c.prefix}if-false`, ""), Promise.resolve();
1727
+ return this.visible = !1, this.display = this.getTarget().style.display, this.getTarget().style.display = "none", this.getTarget().setAttribute(`${h.prefix}if-false`, ""), Promise.resolve();
1728
1728
  }
1729
1729
  /**
1730
1730
  * エレメントを表示します。
@@ -1732,7 +1732,7 @@ class M extends A {
1732
1732
  * @return エレメントの表示のPromise
1733
1733
  */
1734
1734
  show() {
1735
- return this.getTarget().style.display = this.display ?? "", this.getTarget().removeAttribute(`${c.prefix}if-false`), this.visible = !0, Promise.resolve();
1735
+ return this.getTarget().style.display = this.display ?? "", this.getTarget().removeAttribute(`${h.prefix}if-false`), this.visible = !0, Promise.resolve();
1736
1736
  }
1737
1737
  /**
1738
1738
  * 指定した属性名を持つ最も近い親要素を返します。
@@ -1748,7 +1748,7 @@ class M extends A {
1748
1748
  return e === null ? null : e.closestByAttribute(t);
1749
1749
  }
1750
1750
  }
1751
- class $ extends A {
1751
+ class I extends A {
1752
1752
  /**
1753
1753
  * テキストフラグメントのコンストラクタ。
1754
1754
  * 対象テキストノードの内容を初期化します。
@@ -1764,7 +1764,7 @@ class $ extends A {
1764
1764
  * @returns クローンされたフラグメント
1765
1765
  */
1766
1766
  clone() {
1767
- const t = new $(this.target.cloneNode(!0));
1767
+ const t = new I(this.target.cloneNode(!0));
1768
1768
  return t.mounted = !1, t.text = this.text, t.contents = this.contents, t;
1769
1769
  }
1770
1770
  /**
@@ -1803,7 +1803,7 @@ class $ extends A {
1803
1803
  });
1804
1804
  }
1805
1805
  }
1806
- class K extends A {
1806
+ class G extends A {
1807
1807
  /**
1808
1808
  * コメントフラグメントのコンストラクタ。
1809
1809
  * 対象コメントノードの内容を初期化します。
@@ -1819,7 +1819,7 @@ class K extends A {
1819
1819
  * @returns クローンされたフラグメント
1820
1820
  */
1821
1821
  clone() {
1822
- const t = new K(this.target.cloneNode(!0));
1822
+ const t = new G(this.target.cloneNode(!0));
1823
1823
  return t.mounted = !1, t.text = this.text, t;
1824
1824
  }
1825
1825
  /**
@@ -1844,7 +1844,7 @@ class K extends A {
1844
1844
  }));
1845
1845
  }
1846
1846
  }
1847
- const V = class V {
1847
+ const q = class q {
1848
1848
  /**
1849
1849
  * コンストラクタ。
1850
1850
  *
@@ -1852,26 +1852,26 @@ const V = class V {
1852
1852
  */
1853
1853
  constructor(t) {
1854
1854
  this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = t;
1855
- const e = [...t.matchAll(V.PLACEHOLDER_REGEX)];
1856
- let r = 0, n = !1, i = !1;
1857
- for (const s of e) {
1858
- s.index > r && this.contents.push({
1859
- text: t.slice(r, s.index),
1855
+ const e = [...t.matchAll(q.PLACEHOLDER_REGEX)];
1856
+ let r = 0, n = !1, s = !1;
1857
+ for (const i of e) {
1858
+ i.index > r && this.contents.push({
1859
+ text: t.slice(r, i.index),
1860
1860
  type: 0
1861
1861
  /* TEXT */
1862
1862
  });
1863
1863
  const a = {
1864
- text: s[1] ?? s[2],
1865
- type: s[1] ? 2 : 1
1864
+ text: i[1] ?? i[2],
1865
+ type: i[1] ? 2 : 1
1866
1866
  /* EXPRESSION */
1867
1867
  };
1868
- n = !0, i = i || a.type === 2, this.contents.push(a), r = s.index + s[0].length;
1868
+ n = !0, s = s || a.type === 2, this.contents.push(a), r = i.index + i[0].length;
1869
1869
  }
1870
1870
  r < t.length && this.contents.push({
1871
1871
  text: t.slice(r),
1872
1872
  type: 0
1873
1873
  /* TEXT */
1874
- }), this.isEvaluate = n, this.isRawEvaluate = i, this.checkRawExpressions();
1874
+ }), this.isEvaluate = n, this.isRawEvaluate = s, this.checkRawExpressions();
1875
1875
  }
1876
1876
  /**
1877
1877
  * 評価結果を結合して文字列にします。
@@ -1895,7 +1895,7 @@ const V = class V {
1895
1895
  */
1896
1896
  checkRawExpressions() {
1897
1897
  for (let t = 0; t < this.contents.length; t++)
1898
- this.contents[t].type === 2 && this.contents.length > 1 && (h.error(
1898
+ this.contents[t].type === 2 && this.contents.length > 1 && (f.error(
1899
1899
  "[Haori]",
1900
1900
  "Raw expressions are not allowed in multi-content expressions."
1901
1901
  ), this.contents[t].type = 1);
@@ -1918,7 +1918,7 @@ const V = class V {
1918
1918
  } else
1919
1919
  e.push(r.text);
1920
1920
  } catch (n) {
1921
- h.error(
1921
+ f.error(
1922
1922
  "[Haori]",
1923
1923
  `Error evaluating text expression: ${r.text}`,
1924
1924
  n
@@ -1927,9 +1927,9 @@ const V = class V {
1927
1927
  }), e;
1928
1928
  }
1929
1929
  };
1930
- V.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
1931
- let B = V;
1932
- const q = class q extends B {
1930
+ q.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
1931
+ let B = q;
1932
+ const U = class U extends B {
1933
1933
  /**
1934
1934
  * コンストラクタ。
1935
1935
  *
@@ -1937,7 +1937,7 @@ const q = class q extends B {
1937
1937
  * @param text 属性値
1938
1938
  */
1939
1939
  constructor(t, e) {
1940
- super(e), this.forceEvaluation = q.FORCE_EVALUATION_ATTRIBUTES.includes(t);
1940
+ super(e), this.forceEvaluation = U.FORCE_EVALUATION_ATTRIBUTES.includes(t);
1941
1941
  }
1942
1942
  /**
1943
1943
  * 強制評価フラグを取得します。
@@ -1965,26 +1965,26 @@ const q = class q extends B {
1965
1965
  } else
1966
1966
  e.push(r.text);
1967
1967
  } catch (n) {
1968
- h.error(
1968
+ f.error(
1969
1969
  "[Haori]",
1970
1970
  `Error evaluating attribute expression: ${r.text}`,
1971
1971
  n
1972
1972
  ), e.push("");
1973
1973
  }
1974
- }), this.forceEvaluation && e.length > 1 ? (h.error(
1974
+ }), this.forceEvaluation && e.length > 1 ? (f.error(
1975
1975
  "[Haori]",
1976
1976
  "each or if expressions must have a single content.",
1977
1977
  e
1978
1978
  ), [e[0]]) : e;
1979
1979
  }
1980
1980
  };
1981
- q.FORCE_EVALUATION_ATTRIBUTES = [
1981
+ U.FORCE_EVALUATION_ATTRIBUTES = [
1982
1982
  "data-if",
1983
1983
  "hor-if",
1984
1984
  "data-each",
1985
1985
  "hor-each"
1986
1986
  ];
1987
- let j = q;
1987
+ let L = U;
1988
1988
  class y {
1989
1989
  /**
1990
1990
  * カスタムイベントを発火します。
@@ -1995,13 +1995,13 @@ class y {
1995
1995
  * @param options イベントオプション
1996
1996
  */
1997
1997
  static dispatch(t, e, r, n) {
1998
- const i = new CustomEvent(`haori:${e}`, {
1998
+ const s = new CustomEvent(`haori:${e}`, {
1999
1999
  bubbles: n?.bubbles ?? !0,
2000
2000
  cancelable: n?.cancelable ?? !1,
2001
2001
  composed: n?.composed ?? !0,
2002
2002
  detail: r
2003
2003
  });
2004
- return t.dispatchEvent(i);
2004
+ return t.dispatchEvent(s);
2005
2005
  }
2006
2006
  /**
2007
2007
  * readyイベントを発火します。
@@ -2065,15 +2065,15 @@ class y {
2065
2065
  * @param reason 変更理由
2066
2066
  */
2067
2067
  static bindChange(t, e, r, n = "other") {
2068
- const i = [], s = new Set(Object.keys(e || {})), a = new Set(Object.keys(r)), o = /* @__PURE__ */ new Set([...s, ...a]);
2068
+ const s = [], i = new Set(Object.keys(e || {})), a = new Set(Object.keys(r)), o = /* @__PURE__ */ new Set([...i, ...a]);
2069
2069
  for (const g of o) {
2070
2070
  const u = e?.[g], b = r[g];
2071
- u !== b && i.push(g);
2071
+ u !== b && s.push(g);
2072
2072
  }
2073
2073
  y.dispatch(t, "bindchange", {
2074
2074
  previous: e || {},
2075
2075
  next: r,
2076
- changedKeys: i,
2076
+ changedKeys: s,
2077
2077
  reason: n
2078
2078
  });
2079
2079
  }
@@ -2181,16 +2181,16 @@ class y {
2181
2181
  * @param status HTTPステータス(存在する場合)
2182
2182
  * @param startedAt 開始時刻(存在する場合)
2183
2183
  */
2184
- static fetchError(t, e, r, n, i) {
2184
+ static fetchError(t, e, r, n, s) {
2185
2185
  y.dispatch(t, "fetcherror", {
2186
2186
  url: e,
2187
2187
  status: n,
2188
2188
  error: r,
2189
- durationMs: i ? performance.now() - i : void 0
2189
+ durationMs: s ? performance.now() - s : void 0
2190
2190
  });
2191
2191
  }
2192
2192
  }
2193
- const Q = [
2193
+ const Z = [
2194
2194
  "addErrorMessage",
2195
2195
  "closeDialog",
2196
2196
  "confirm",
@@ -2198,13 +2198,13 @@ const Q = [
2198
2198
  "openDialog",
2199
2199
  "toast"
2200
2200
  ];
2201
- function U() {
2201
+ function K() {
2202
2202
  const t = globalThis.window?.Haori;
2203
- return Q.every(
2203
+ return Z.every(
2204
2204
  (r) => typeof t?.[r] == "function"
2205
- ) ? t : Y;
2205
+ ) ? t : X;
2206
2206
  }
2207
- class d {
2207
+ const c = class c {
2208
2208
  /**
2209
2209
  * イベント属性名を正しく生成します。
2210
2210
  * 例: ("click", "fetch") => "data-click-fetch"
@@ -2213,7 +2213,118 @@ class d {
2213
2213
  * 非イベント変種が "data-fetch-xxx" として存在するものについては、event が null の場合にそちらを返します。
2214
2214
  */
2215
2215
  static attrName(t, e, r = !1) {
2216
- return t ? `${c.prefix}${t}-${e}` : r ? `${c.prefix}fetch-${e}` : `${c.prefix}${e}`;
2216
+ return t ? `${h.prefix}${t}-${e}` : r ? `${h.prefix}fetch-${e}` : `${h.prefix}${e}`;
2217
+ }
2218
+ /**
2219
+ * data 属性のテンプレート式評価結果を URLSearchParams 向けに組み立てます。
2220
+ *
2221
+ * @param rawAttribute 生の属性値
2222
+ * @param bindingValues バインディング値
2223
+ * @returns パラメータ形式として扱える文字列
2224
+ */
2225
+ static resolveDataParamString(t, e) {
2226
+ return t.replace(
2227
+ c.DATA_PLACEHOLDER_REGEX,
2228
+ (r, n, s) => {
2229
+ const i = H.evaluate(
2230
+ n ?? s ?? "",
2231
+ e
2232
+ );
2233
+ return i == null || Number.isNaN(i) ? "" : encodeURIComponent(typeof i == "object" ? JSON.stringify(i) : String(i));
2234
+ }
2235
+ );
2236
+ }
2237
+ /**
2238
+ * JSON 文字列中のテンプレート式かどうかを判定します。
2239
+ *
2240
+ * @param source 生の属性値
2241
+ * @param offset プレースホルダ開始位置
2242
+ * @returns JSON 文字列中なら true
2243
+ */
2244
+ static isJsonStringContext(t, e) {
2245
+ let r = !1, n = !1;
2246
+ for (let s = 0; s < e; s += 1) {
2247
+ const i = t[s];
2248
+ if (n) {
2249
+ n = !1;
2250
+ continue;
2251
+ }
2252
+ if (i === "\\") {
2253
+ n = !0;
2254
+ continue;
2255
+ }
2256
+ i === '"' && (r = !r);
2257
+ }
2258
+ return r;
2259
+ }
2260
+ /**
2261
+ * JSON 値コンテキスト向けにテンプレート式の評価結果を直列化します。
2262
+ *
2263
+ * @param result テンプレート式の評価結果
2264
+ * @returns JSON 値として埋め込める文字列
2265
+ */
2266
+ static stringifyJsonTemplateValue(t) {
2267
+ if (t === void 0 || Number.isNaN(t))
2268
+ return "null";
2269
+ try {
2270
+ return JSON.stringify(t) ?? JSON.stringify(String(t));
2271
+ } catch {
2272
+ return JSON.stringify(String(t));
2273
+ }
2274
+ }
2275
+ /**
2276
+ * JSON 文字列コンテキスト向けにテンプレート式の評価結果を直列化します。
2277
+ *
2278
+ * @param result テンプレート式の評価結果
2279
+ * @returns JSON 文字列へ安全に埋め込める文字列
2280
+ */
2281
+ static stringifyJsonTemplateStringContent(t) {
2282
+ if (t == null || Number.isNaN(t))
2283
+ return "";
2284
+ const e = typeof t == "object" ? c.stringifyJsonTemplateValue(t) : String(t);
2285
+ return JSON.stringify(e).slice(1, -1);
2286
+ }
2287
+ /**
2288
+ * JSON 形式 data 属性内のテンプレート式を安全に解決します。
2289
+ *
2290
+ * @param rawAttribute 生の属性値
2291
+ * @param bindingValues バインディング値
2292
+ * @returns JSON として解釈可能な文字列
2293
+ */
2294
+ static resolveDataJsonString(t, e) {
2295
+ return t.replace(
2296
+ c.DATA_PLACEHOLDER_REGEX,
2297
+ (r, n, s, i) => {
2298
+ const a = H.evaluate(
2299
+ n ?? s ?? "",
2300
+ e
2301
+ );
2302
+ return c.isJsonStringContext(t, i) ? c.stringifyJsonTemplateStringContent(a) : c.stringifyJsonTemplateValue(a);
2303
+ }
2304
+ );
2305
+ }
2306
+ /**
2307
+ * data 属性を評価済みの値として取得します。
2308
+ *
2309
+ * @param fragment フラグメント
2310
+ * @param attrName 属性名
2311
+ * @returns 送信データ
2312
+ */
2313
+ static resolveDataAttribute(t, e) {
2314
+ const r = t.getRawAttribute(e), n = t.getAttribute(e);
2315
+ if (n && typeof n == "object" && !Array.isArray(n))
2316
+ return n;
2317
+ if (typeof n != "string" || r === null)
2318
+ return null;
2319
+ const s = r.trim();
2320
+ return c.SINGLE_PLACEHOLDER_REGEX.test(s) ? T.parseDataBind(n) : s.startsWith("{") || s.startsWith("[") ? T.parseDataBind(
2321
+ c.resolveDataJsonString(
2322
+ r,
2323
+ t.getBindingData()
2324
+ )
2325
+ ) : T.parseDataBind(
2326
+ c.resolveDataParamString(r, t.getBindingData())
2327
+ );
2217
2328
  }
2218
2329
  /**
2219
2330
  * オプションをフラグメントの属性から構築します。
@@ -2227,28 +2338,29 @@ class d {
2227
2338
  targetFragment: t
2228
2339
  };
2229
2340
  if (e) {
2230
- if (t.hasAttribute(d.attrName(e, "validate")) && (r.valid = !0), t.hasAttribute(d.attrName(e, "confirm")) && (r.confirmMessage = t.getAttribute(
2231
- d.attrName(e, "confirm")
2232
- )), t.hasAttribute(d.attrName(e, "data")) && (r.data = T.parseDataBind(
2233
- t.getRawAttribute(d.attrName(e, "data"))
2234
- )), t.hasAttribute(d.attrName(e, "form"))) {
2341
+ if (t.hasAttribute(c.attrName(e, "validate")) && (r.valid = !0), t.hasAttribute(c.attrName(e, "confirm")) && (r.confirmMessage = t.getAttribute(
2342
+ c.attrName(e, "confirm")
2343
+ )), t.hasAttribute(c.attrName(e, "data")) && (r.data = c.resolveDataAttribute(
2344
+ t,
2345
+ c.attrName(e, "data")
2346
+ )), t.hasAttribute(c.attrName(e, "form"))) {
2235
2347
  const l = t.getRawAttribute(
2236
- d.attrName(e, "form")
2348
+ c.attrName(e, "form")
2237
2349
  );
2238
2350
  if (l) {
2239
- const f = document.body.querySelector(l);
2240
- f !== null ? r.formFragment = E.getFormFragment(
2241
- A.get(f)
2242
- ) : h.error(
2351
+ const d = document.body.querySelector(l);
2352
+ d !== null ? r.formFragment = E.getFormFragment(
2353
+ A.get(d)
2354
+ ) : f.error(
2243
2355
  "Haori",
2244
- `Form element not found: ${l} (${d.attrName(e, "form")})`
2356
+ `Form element not found: ${l} (${c.attrName(e, "form")})`
2245
2357
  );
2246
2358
  } else
2247
2359
  r.formFragment = E.getFormFragment(t);
2248
2360
  } else e === "change" && (r.formFragment = E.getFormFragment(t));
2249
- if (t.hasAttribute(`${c.prefix}${e}-before-run`)) {
2361
+ if (t.hasAttribute(`${h.prefix}${e}-before-run`)) {
2250
2362
  const l = t.getRawAttribute(
2251
- `${c.prefix}${e}-before-run`
2363
+ `${h.prefix}${e}-before-run`
2252
2364
  );
2253
2365
  try {
2254
2366
  r.beforeCallback = new Function(
@@ -2259,116 +2371,116 @@ class d {
2259
2371
  ${l}
2260
2372
  `
2261
2373
  );
2262
- } catch (f) {
2263
- h.error("Haori", `Invalid before script: ${f}`);
2374
+ } catch (d) {
2375
+ f.error("Haori", `Invalid before script: ${d}`);
2264
2376
  }
2265
2377
  }
2266
2378
  }
2267
- const n = d.attrName(e, "fetch"), i = t.hasAttribute(n);
2268
- i && (r.fetchUrl = t.getAttribute(n));
2269
- const s = {};
2379
+ const n = c.attrName(e, "fetch"), s = t.hasAttribute(n);
2380
+ s && (r.fetchUrl = t.getAttribute(n));
2381
+ const i = {};
2270
2382
  if (e) {
2271
- const l = d.attrName(e, "fetch-method");
2272
- t.hasAttribute(l) && (s.method = t.getAttribute(
2383
+ const l = c.attrName(e, "fetch-method");
2384
+ t.hasAttribute(l) && (i.method = t.getAttribute(
2273
2385
  l
2274
2386
  ));
2275
2387
  } else {
2276
- const l = d.attrName(null, "method", !0);
2277
- t.hasAttribute(l) && (s.method = t.getAttribute(
2388
+ const l = c.attrName(null, "method", !0);
2389
+ t.hasAttribute(l) && (i.method = t.getAttribute(
2278
2390
  l
2279
2391
  ));
2280
2392
  }
2281
2393
  if (e) {
2282
- const l = d.attrName(e, "fetch-headers");
2394
+ const l = c.attrName(e, "fetch-headers");
2283
2395
  if (t.hasAttribute(l)) {
2284
- const f = t.getRawAttribute(
2396
+ const d = t.getRawAttribute(
2285
2397
  l
2286
2398
  );
2287
2399
  try {
2288
- s.headers = T.parseDataBind(f);
2400
+ i.headers = T.parseDataBind(d);
2289
2401
  } catch (p) {
2290
- h.error("Haori", `Invalid fetch headers: ${p}`);
2402
+ f.error("Haori", `Invalid fetch headers: ${p}`);
2291
2403
  }
2292
2404
  }
2293
2405
  } else {
2294
- const l = d.attrName(
2406
+ const l = c.attrName(
2295
2407
  null,
2296
2408
  "headers",
2297
2409
  !0
2298
2410
  );
2299
2411
  if (t.hasAttribute(l)) {
2300
- const f = t.getRawAttribute(
2412
+ const d = t.getRawAttribute(
2301
2413
  l
2302
2414
  );
2303
2415
  try {
2304
- s.headers = T.parseDataBind(f);
2416
+ i.headers = T.parseDataBind(d);
2305
2417
  } catch (p) {
2306
- h.error("Haori", `Invalid fetch headers: ${p}`);
2418
+ f.error("Haori", `Invalid fetch headers: ${p}`);
2307
2419
  }
2308
2420
  }
2309
2421
  }
2310
2422
  if (e) {
2311
- const l = d.attrName(
2423
+ const l = c.attrName(
2312
2424
  e,
2313
2425
  "fetch-content-type"
2314
2426
  );
2315
2427
  if (t.hasAttribute(l))
2316
- s.headers = {
2317
- ...s.headers,
2428
+ i.headers = {
2429
+ ...i.headers,
2318
2430
  "Content-Type": t.getAttribute(l)
2319
2431
  };
2320
- else if (s.method && s.method !== "GET" && s.method !== "HEAD" && s.method !== "OPTIONS") {
2321
- let f = !1;
2322
- s.headers && typeof s.headers == "object" && (f = "Content-Type" in s.headers), f || (s.headers = {
2323
- ...s.headers,
2432
+ else if (i.method && i.method !== "GET" && i.method !== "HEAD" && i.method !== "OPTIONS") {
2433
+ let d = !1;
2434
+ i.headers && typeof i.headers == "object" && (d = "Content-Type" in i.headers), d || (i.headers = {
2435
+ ...i.headers,
2324
2436
  "Content-Type": "application/json"
2325
2437
  });
2326
- } else s.method && (s.method === "GET" || s.method === "HEAD" || s.method === "OPTIONS") && (s.headers = {
2327
- ...s.headers,
2438
+ } else i.method && (i.method === "GET" || i.method === "HEAD" || i.method === "OPTIONS") && (i.headers = {
2439
+ ...i.headers,
2328
2440
  "Content-Type": "application/x-www-form-urlencoded"
2329
2441
  });
2330
2442
  } else {
2331
- const l = d.attrName(
2443
+ const l = c.attrName(
2332
2444
  null,
2333
2445
  "content-type",
2334
2446
  !0
2335
2447
  );
2336
2448
  if (t.hasAttribute(l))
2337
- s.headers = {
2338
- ...s.headers,
2449
+ i.headers = {
2450
+ ...i.headers,
2339
2451
  "Content-Type": t.getAttribute(l)
2340
2452
  };
2341
- else if (s.method && s.method !== "GET" && s.method !== "HEAD" && s.method !== "OPTIONS") {
2342
- let f = !1;
2343
- s.headers && typeof s.headers == "object" && (f = "Content-Type" in s.headers), f || (s.headers = {
2344
- ...s.headers,
2453
+ else if (i.method && i.method !== "GET" && i.method !== "HEAD" && i.method !== "OPTIONS") {
2454
+ let d = !1;
2455
+ i.headers && typeof i.headers == "object" && (d = "Content-Type" in i.headers), d || (i.headers = {
2456
+ ...i.headers,
2345
2457
  "Content-Type": "application/json"
2346
2458
  });
2347
- } else s.method && (s.method === "GET" || s.method === "HEAD" || s.method === "OPTIONS") && (s.headers = {
2348
- ...s.headers,
2459
+ } else i.method && (i.method === "GET" || i.method === "HEAD" || i.method === "OPTIONS") && (i.headers = {
2460
+ ...i.headers,
2349
2461
  "Content-Type": "application/x-www-form-urlencoded"
2350
2462
  });
2351
2463
  }
2352
- Object.keys(s).length > 0 && (r.fetchOptions = s);
2353
- const a = e ? d.attrName(e, "bind") : d.attrName(null, "bind", !0);
2464
+ Object.keys(i).length > 0 && (r.fetchOptions = i);
2465
+ const a = e ? c.attrName(e, "bind") : c.attrName(null, "bind", !0);
2354
2466
  if (t.hasAttribute(a)) {
2355
2467
  const l = t.getRawAttribute(a);
2356
2468
  if (l) {
2357
- const f = document.body.querySelectorAll(l);
2358
- f.length > 0 ? (r.bindFragments = [], f.forEach((p) => {
2359
- const w = A.get(p);
2360
- w && r.bindFragments.push(w);
2361
- })) : h.error(
2469
+ const d = document.body.querySelectorAll(l);
2470
+ d.length > 0 ? (r.bindFragments = [], d.forEach((p) => {
2471
+ const v = A.get(p);
2472
+ v && r.bindFragments.push(v);
2473
+ })) : f.error(
2362
2474
  "Haori",
2363
2475
  `Bind element not found: ${l} (${a})`
2364
2476
  );
2365
2477
  }
2366
2478
  }
2367
- const o = d.attrName(e, "bind-arg"), g = d.attrName(
2479
+ const o = c.attrName(e, "bind-arg"), g = c.attrName(
2368
2480
  null,
2369
2481
  "arg",
2370
2482
  !0
2371
- ), u = d.attrName(
2483
+ ), u = c.attrName(
2372
2484
  null,
2373
2485
  "bind-arg",
2374
2486
  !0
@@ -2376,113 +2488,108 @@ ${l}
2376
2488
  e ? t.hasAttribute(o) && (r.bindArg = t.getRawAttribute(o)) : t.hasAttribute(g) ? r.bindArg = t.getRawAttribute(
2377
2489
  g
2378
2490
  ) : t.hasAttribute(u) && (r.bindArg = t.getRawAttribute(u));
2379
- const b = e ? d.attrName(e, "bind-params") : d.attrName(null, "bind-params", !0);
2491
+ const b = e ? c.attrName(e, "bind-params") : c.attrName(null, "bind-params", !0);
2380
2492
  if (t.hasAttribute(b)) {
2381
2493
  const l = t.getRawAttribute(b);
2382
- r.bindParams = l.split("&").map((f) => f.trim());
2494
+ r.bindParams = l.split("&").map((d) => d.trim());
2383
2495
  }
2384
2496
  if (e) {
2385
- if (t.hasAttribute(d.attrName(e, "adjust"))) {
2386
- const f = t.getRawAttribute(
2387
- d.attrName(e, "adjust")
2497
+ if (t.hasAttribute(c.attrName(e, "adjust"))) {
2498
+ const d = t.getRawAttribute(
2499
+ c.attrName(e, "adjust")
2388
2500
  );
2389
- if (f) {
2390
- const p = document.body.querySelectorAll(f);
2391
- p.length > 0 ? (r.adjustFragments = [], p.forEach((w) => {
2392
- const v = A.get(w);
2393
- v && r.adjustFragments.push(v);
2394
- })) : h.error(
2501
+ if (d) {
2502
+ const p = document.body.querySelectorAll(d);
2503
+ p.length > 0 ? (r.adjustFragments = [], p.forEach((v) => {
2504
+ const w = A.get(v);
2505
+ w && r.adjustFragments.push(w);
2506
+ })) : f.error(
2395
2507
  "Haori",
2396
- `Adjust element not found: ${f} (${d.attrName(e, "adjust")})`
2508
+ `Adjust element not found: ${d} (${c.attrName(e, "adjust")})`
2397
2509
  );
2398
2510
  }
2399
- if (t.hasAttribute(d.attrName(e, "adjust-value"))) {
2511
+ if (t.hasAttribute(c.attrName(e, "adjust-value"))) {
2400
2512
  const p = t.getRawAttribute(
2401
- d.attrName(e, "adjust-value")
2402
- ), w = Number(p);
2403
- isNaN(w) || (r.adjustValue = w);
2513
+ c.attrName(e, "adjust-value")
2514
+ ), v = Number(p);
2515
+ isNaN(v) || (r.adjustValue = v);
2404
2516
  }
2405
2517
  }
2406
- if (t.hasAttribute(d.attrName(e, "row-add")) && (r.rowAdd = !0), t.hasAttribute(d.attrName(e, "row-remove")) && (r.rowRemove = !0), t.hasAttribute(d.attrName(e, "row-prev")) && (r.rowMovePrev = !0), t.hasAttribute(d.attrName(e, "row-next")) && (r.rowMoveNext = !0), t.hasAttribute(`${c.prefix}${e}-after-run`)) {
2407
- const f = t.getRawAttribute(
2408
- `${c.prefix}${e}-after-run`
2518
+ if (t.hasAttribute(c.attrName(e, "row-add")) && (r.rowAdd = !0), t.hasAttribute(c.attrName(e, "row-remove")) && (r.rowRemove = !0), t.hasAttribute(c.attrName(e, "row-prev")) && (r.rowMovePrev = !0), t.hasAttribute(c.attrName(e, "row-next")) && (r.rowMoveNext = !0), t.hasAttribute(`${h.prefix}${e}-after-run`)) {
2519
+ const d = t.getRawAttribute(
2520
+ `${h.prefix}${e}-after-run`
2409
2521
  );
2410
2522
  try {
2411
2523
  r.afterCallback = new Function(
2412
2524
  "response",
2413
2525
  `
2414
2526
  "use strict";
2415
- ${f}
2527
+ ${d}
2416
2528
  `
2417
2529
  );
2418
2530
  } catch (p) {
2419
- h.error("Haori", `Invalid after script: ${p}`);
2531
+ f.error("Haori", `Invalid after script: ${p}`);
2420
2532
  }
2421
2533
  }
2422
- t.hasAttribute(d.attrName(e, "dialog")) && (r.dialogMessage = t.getAttribute(
2423
- d.attrName(e, "dialog")
2424
- )), t.hasAttribute(d.attrName(e, "toast")) && (r.toastMessage = t.getAttribute(
2425
- d.attrName(e, "toast")
2426
- )), t.hasAttribute(d.attrName(e, "redirect")) && (r.redirectUrl = t.getAttribute(
2427
- d.attrName(e, "redirect")
2534
+ t.hasAttribute(c.attrName(e, "dialog")) && (r.dialogMessage = t.getAttribute(
2535
+ c.attrName(e, "dialog")
2536
+ )), t.hasAttribute(c.attrName(e, "toast")) && (r.toastMessage = t.getAttribute(
2537
+ c.attrName(e, "toast")
2538
+ )), t.hasAttribute(c.attrName(e, "redirect")) && (r.redirectUrl = t.getAttribute(
2539
+ c.attrName(e, "redirect")
2428
2540
  )), [
2429
2541
  "reset",
2430
2542
  "refetch",
2431
2543
  "click",
2432
2544
  "open",
2433
2545
  "close"
2434
- ].forEach((f) => {
2435
- const p = d.attrName(e, f);
2546
+ ].forEach((d) => {
2547
+ const p = c.attrName(e, d);
2436
2548
  if (!t.hasAttribute(p))
2437
2549
  return;
2438
- const w = t.getRawAttribute(p), v = [];
2439
- if (w ? (document.body.querySelectorAll(w).forEach((x) => {
2440
- const F = A.get(x);
2441
- F && v.push(F);
2442
- }), v.length === 0 && h.error("Haori", `Element not found: ${w} (${p})`)) : v.push(t), v.length > 0)
2443
- switch (f) {
2550
+ const v = t.getRawAttribute(p), w = [];
2551
+ if (v ? (document.body.querySelectorAll(v).forEach((S) => {
2552
+ const F = A.get(S);
2553
+ F && w.push(F);
2554
+ }), w.length === 0 && f.error("Haori", `Element not found: ${v} (${p})`)) : w.push(t), w.length > 0)
2555
+ switch (d) {
2444
2556
  case "reset":
2445
- r.resetFragments = v;
2557
+ r.resetFragments = w;
2446
2558
  break;
2447
2559
  case "refetch":
2448
- r.refetchFragments = v;
2560
+ r.refetchFragments = w;
2449
2561
  break;
2450
2562
  case "click":
2451
- r.clickFragments = v;
2563
+ r.clickFragments = w;
2452
2564
  break;
2453
2565
  case "open":
2454
- r.openFragments = v;
2566
+ r.openFragments = w;
2455
2567
  break;
2456
2568
  case "close":
2457
- r.closeFragments = v;
2569
+ r.closeFragments = w;
2458
2570
  break;
2459
2571
  }
2460
2572
  });
2461
2573
  }
2462
- if (!e) {
2463
- if (t.hasAttribute(d.attrName(null, "data", !0))) {
2464
- const l = t.getRawAttribute(
2465
- d.attrName(null, "data", !0)
2466
- );
2467
- r.data = T.parseDataBind(l);
2468
- }
2469
- if (t.hasAttribute(d.attrName(null, "form", !0))) {
2470
- const l = t.getRawAttribute(
2471
- d.attrName(null, "form", !0)
2574
+ if (!e && (t.hasAttribute(c.attrName(null, "data", !0)) && (r.data = c.resolveDataAttribute(
2575
+ t,
2576
+ c.attrName(null, "data", !0)
2577
+ )), t.hasAttribute(c.attrName(null, "form", !0)))) {
2578
+ const l = t.getRawAttribute(
2579
+ c.attrName(null, "form", !0)
2580
+ );
2581
+ if (l) {
2582
+ const d = document.body.querySelector(l);
2583
+ d !== null ? r.formFragment = E.getFormFragment(
2584
+ A.get(d)
2585
+ ) : f.error(
2586
+ "Haori",
2587
+ `Form element not found: ${l} (${c.attrName(null, "fetch-form", !0)})`
2472
2588
  );
2473
- if (l) {
2474
- const f = document.body.querySelector(l);
2475
- f !== null ? r.formFragment = E.getFormFragment(
2476
- A.get(f)
2477
- ) : h.error(
2478
- "Haori",
2479
- `Form element not found: ${l} (${d.attrName(null, "fetch-form", !0)})`
2480
- );
2481
- } else
2482
- r.formFragment = E.getFormFragment(t);
2483
- }
2589
+ } else
2590
+ r.formFragment = E.getFormFragment(t);
2484
2591
  }
2485
- return i && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [t]), r;
2592
+ return s && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [t]), r;
2486
2593
  }
2487
2594
  /**
2488
2595
  * ElementFragment の構造的タイプガード。
@@ -2503,7 +2610,7 @@ ${f}
2503
2610
  * @param arg2 イベント名
2504
2611
  */
2505
2612
  constructor(t, e = null) {
2506
- d.isElementFragment(t) ? this.options = d.buildOptions(t, e) : this.options = t;
2613
+ c.isElementFragment(t) ? this.options = c.buildOptions(t, e) : this.options = t;
2507
2614
  }
2508
2615
  /**
2509
2616
  * 一連の処理を実行します。オプションが空の場合は即座にresolveされます。
@@ -2516,60 +2623,60 @@ ${f}
2516
2623
  return Promise.resolve();
2517
2624
  let e = this.options.fetchUrl, r = this.options.fetchOptions;
2518
2625
  if (this.options.beforeCallback) {
2519
- const s = this.options.beforeCallback(
2626
+ const i = this.options.beforeCallback(
2520
2627
  e || null,
2521
2628
  r || null
2522
2629
  );
2523
- if (s != null) {
2524
- if (s === !1 || typeof s == "object" && s.stop)
2630
+ if (i != null) {
2631
+ if (i === !1 || typeof i == "object" && i.stop)
2525
2632
  return Promise.resolve();
2526
- typeof s == "object" && (e = "fetchUrl" in s ? s.fetchUrl : e, r = "fetchOptions" in s ? s.fetchOptions : r);
2633
+ typeof i == "object" && (e = "fetchUrl" in i ? i.fetchUrl : e, r = "fetchOptions" in i ? i.fetchOptions : r);
2527
2634
  }
2528
2635
  }
2529
2636
  const n = {};
2530
2637
  if (this.options.formFragment) {
2531
- const s = E.getValues(this.options.formFragment);
2532
- Object.assign(n, s);
2638
+ const i = E.getValues(this.options.formFragment);
2639
+ Object.assign(n, i);
2533
2640
  }
2534
2641
  this.options.data && typeof this.options.data == "object" && Object.assign(n, this.options.data);
2535
- const i = Object.keys(n).length > 0;
2642
+ const s = Object.keys(n).length > 0;
2536
2643
  if (e) {
2537
- const s = { ...r || {} }, a = new Headers(
2538
- s.headers || void 0
2539
- ), o = (s.method || "GET").toUpperCase();
2644
+ const i = { ...r || {} }, a = new Headers(
2645
+ i.headers || void 0
2646
+ ), o = (i.method || "GET").toUpperCase();
2540
2647
  if (o === "GET" || o === "HEAD" || o === "OPTIONS") {
2541
- if (i) {
2648
+ if (s) {
2542
2649
  const g = new URL(e, window.location.href), u = new URLSearchParams(g.search);
2543
2650
  for (const [b, l] of Object.entries(n))
2544
- l !== void 0 && (l === null ? u.append(b, "") : Array.isArray(l) ? l.forEach((f) => {
2545
- u.append(b, String(f));
2651
+ l !== void 0 && (l === null ? u.append(b, "") : Array.isArray(l) ? l.forEach((d) => {
2652
+ u.append(b, String(d));
2546
2653
  }) : typeof l == "object" || typeof l == "function" ? u.append(b, JSON.stringify(l)) : u.append(b, String(l)));
2547
2654
  g.search = u.toString(), e = g.toString();
2548
2655
  }
2549
- } else if (i) {
2656
+ } else if (s) {
2550
2657
  const g = a.get("Content-Type") || "";
2551
2658
  if (/multipart\/form-data/i.test(g)) {
2552
2659
  a.delete("Content-Type");
2553
2660
  const u = new FormData();
2554
2661
  for (const [b, l] of Object.entries(n))
2555
- l == null ? u.append(b, "") : l instanceof Blob ? u.append(b, l) : Array.isArray(l) ? l.forEach((f) => u.append(b, String(f))) : typeof l == "object" ? u.append(b, JSON.stringify(l)) : u.append(b, String(l));
2556
- s.body = u;
2662
+ l == null ? u.append(b, "") : l instanceof Blob ? u.append(b, l) : Array.isArray(l) ? l.forEach((d) => u.append(b, String(d))) : typeof l == "object" ? u.append(b, JSON.stringify(l)) : u.append(b, String(l));
2663
+ i.body = u;
2557
2664
  } else if (/application\/x-www-form-urlencoded/i.test(g)) {
2558
2665
  const u = new URLSearchParams();
2559
2666
  for (const [b, l] of Object.entries(n))
2560
- l !== void 0 && (l === null ? u.append(b, "") : Array.isArray(l) ? l.forEach((f) => u.append(b, String(f))) : typeof l == "object" ? u.append(b, JSON.stringify(l)) : u.append(b, String(l)));
2561
- s.body = u;
2667
+ l !== void 0 && (l === null ? u.append(b, "") : Array.isArray(l) ? l.forEach((d) => u.append(b, String(d))) : typeof l == "object" ? u.append(b, JSON.stringify(l)) : u.append(b, String(l)));
2668
+ i.body = u;
2562
2669
  } else
2563
- a.set("Content-Type", "application/json"), s.body = JSON.stringify(n);
2670
+ a.set("Content-Type", "application/json"), i.body = JSON.stringify(n);
2564
2671
  }
2565
- if (s.headers = a, this.options.targetFragment && e) {
2672
+ if (i.headers = a, this.options.targetFragment && e) {
2566
2673
  const g = performance.now();
2567
2674
  return y.fetchStart(
2568
2675
  this.options.targetFragment.getTarget(),
2569
2676
  e,
2570
- s,
2571
- i ? n : void 0
2572
- ), fetch(e, s).then((u) => this.handleFetchResult(
2677
+ i,
2678
+ s ? n : void 0
2679
+ ), fetch(e, i).then((u) => this.handleFetchResult(
2573
2680
  u,
2574
2681
  e || void 0,
2575
2682
  g
@@ -2580,18 +2687,18 @@ ${f}
2580
2687
  u
2581
2688
  ), u;
2582
2689
  });
2583
- } else return e ? fetch(e, s).then((g) => this.handleFetchResult(g, e || void 0)) : Promise.resolve();
2690
+ } else return e ? fetch(e, i).then((g) => this.handleFetchResult(g, e || void 0)) : Promise.resolve();
2584
2691
  } else {
2585
- if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && i) {
2692
+ if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && s) {
2586
2693
  const o = this.options.formFragment, g = o.getTarget();
2587
2694
  g.setAttribute(
2588
- `${c.prefix}bind`,
2695
+ `${h.prefix}bind`,
2589
2696
  JSON.stringify(n)
2590
2697
  );
2591
2698
  const u = o.getBindingData();
2592
2699
  return Object.assign(u, n), T.setBindingData(g, u);
2593
2700
  }
2594
- const s = i ? n : {}, a = new Response(JSON.stringify(s), {
2701
+ const i = s ? n : {}, a = new Response(JSON.stringify(i), {
2595
2702
  headers: { "Content-Type": "application/json" }
2596
2703
  });
2597
2704
  return this.handleFetchResult(a);
@@ -2602,7 +2709,7 @@ ${f}
2602
2709
  * フェッチ後の処理を実行します。
2603
2710
  */
2604
2711
  handleFetchResult(t, e, r) {
2605
- const n = U();
2712
+ const n = K();
2606
2713
  if (!t.ok)
2607
2714
  return this.options.targetFragment && e && y.fetchError(
2608
2715
  this.options.targetFragment.getTarget(),
@@ -2617,30 +2724,30 @@ ${f}
2617
2724
  t.status,
2618
2725
  r
2619
2726
  ), this.options.afterCallback) {
2620
- const s = this.options.afterCallback(t);
2621
- if (s != null) {
2622
- if (s === !1 || typeof s == "object" && s.stop)
2727
+ const i = this.options.afterCallback(t);
2728
+ if (i != null) {
2729
+ if (i === !1 || typeof i == "object" && i.stop)
2623
2730
  return Promise.resolve();
2624
- typeof s == "object" && "response" in s && (t = "response" in s ? s.response : t);
2731
+ typeof i == "object" && "response" in i && (t = "response" in i ? i.response : t);
2625
2732
  }
2626
2733
  }
2627
- const i = [];
2628
- return i.push(this.bindResult(t)), i.push(this.adjust()), i.push(this.addRow()), i.push(this.removeRow()), i.push(this.movePrevRow()), i.push(this.moveNextRow()), this.options.resetFragments && this.options.resetFragments.length > 0 && this.options.resetFragments.forEach((s) => {
2629
- i.push(E.reset(s));
2630
- }), this.options.refetchFragments && this.options.refetchFragments.length > 0 && this.options.refetchFragments.forEach((s) => {
2631
- i.push(new d(s, null).run());
2632
- }), this.options.clickFragments && this.options.clickFragments.length > 0 && this.options.clickFragments.forEach((s) => {
2633
- const a = s.getTarget();
2734
+ const s = [];
2735
+ return s.push(this.bindResult(t)), s.push(this.adjust()), s.push(this.addRow()), s.push(this.removeRow()), s.push(this.movePrevRow()), s.push(this.moveNextRow()), this.options.resetFragments && this.options.resetFragments.length > 0 && this.options.resetFragments.forEach((i) => {
2736
+ s.push(E.reset(i));
2737
+ }), this.options.refetchFragments && this.options.refetchFragments.length > 0 && this.options.refetchFragments.forEach((i) => {
2738
+ s.push(new c(i, null).run());
2739
+ }), this.options.clickFragments && this.options.clickFragments.length > 0 && this.options.clickFragments.forEach((i) => {
2740
+ const a = i.getTarget();
2634
2741
  typeof a.click == "function" ? a.click() : a.dispatchEvent(
2635
2742
  new MouseEvent("click", { bubbles: !0, cancelable: !0 })
2636
2743
  );
2637
- }), this.options.openFragments && this.options.openFragments.length > 0 && this.options.openFragments.forEach((s) => {
2638
- const a = s.getTarget();
2639
- a instanceof HTMLElement ? i.push(n.openDialog(a)) : h.error("Haori", "Element is not an HTML element: ", a);
2640
- }), this.options.closeFragments && this.options.closeFragments.length > 0 && this.options.closeFragments.forEach((s) => {
2641
- const a = s.getTarget();
2642
- a instanceof HTMLElement ? i.push(n.closeDialog(a)) : h.error("Haori", "Element is not an HTML element: ", a);
2643
- }), Promise.all(i).then(() => this.options.dialogMessage ? n.dialog(this.options.dialogMessage) : Promise.resolve()).then(() => this.options.toastMessage ? n.toast(this.options.toastMessage, "info") : Promise.resolve()).then(() => (this.options.redirectUrl && (window.location.href = this.options.redirectUrl), Promise.resolve()));
2744
+ }), this.options.openFragments && this.options.openFragments.length > 0 && this.options.openFragments.forEach((i) => {
2745
+ const a = i.getTarget();
2746
+ a instanceof HTMLElement ? s.push(n.openDialog(a)) : f.error("Haori", "Element is not an HTML element: ", a);
2747
+ }), this.options.closeFragments && this.options.closeFragments.length > 0 && this.options.closeFragments.forEach((i) => {
2748
+ const a = i.getTarget();
2749
+ a instanceof HTMLElement ? s.push(n.closeDialog(a)) : f.error("Haori", "Element is not an HTML element: ", a);
2750
+ }), Promise.all(s).then(() => this.options.dialogMessage ? n.dialog(this.options.dialogMessage) : Promise.resolve()).then(() => this.options.toastMessage ? n.toast(this.options.toastMessage, "info") : Promise.resolve()).then(() => (this.options.redirectUrl && (window.location.href = this.options.redirectUrl), Promise.resolve()));
2644
2751
  }
2645
2752
  /**
2646
2753
  * フェッチエラー応答のメッセージを適切な要素へ伝播します。
@@ -2648,38 +2755,38 @@ ${f}
2648
2755
  async handleFetchError(t) {
2649
2756
  let e = null;
2650
2757
  this.options.formFragment ? e = this.options.formFragment : this.options.targetFragment && (e = E.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
2651
- const r = async (i) => {
2652
- const s = e ? e.getTarget() : document.body;
2653
- await U().addErrorMessage(s, i);
2758
+ const r = async (s) => {
2759
+ const i = e ? e.getTarget() : document.body;
2760
+ await K().addErrorMessage(i, s);
2654
2761
  };
2655
2762
  if ((t.headers.get("Content-Type") || "").includes("application/json"))
2656
2763
  try {
2657
- const i = await t.json(), s = [];
2658
- if (i && typeof i == "object") {
2659
- if (typeof i.message == "string" && s.push({ message: i.message }), Array.isArray(i.messages))
2660
- for (const a of i.messages)
2661
- typeof a == "string" && s.push({ message: a });
2662
- if (i.errors && typeof i.errors == "object")
2663
- for (const [a, o] of Object.entries(i.errors))
2664
- Array.isArray(o) ? s.push({ key: a, message: o.join(`
2665
- `) }) : typeof o == "string" ? s.push({ key: a, message: o }) : o != null && s.push({ key: a, message: String(o) });
2666
- if (s.length === 0)
2667
- for (const [a, o] of Object.entries(i))
2668
- a === "message" || a === "messages" || a === "errors" || (Array.isArray(o) ? s.push({ key: a, message: o.join(`
2669
- `) }) : typeof o == "string" && s.push({ key: a, message: o }));
2764
+ const s = await t.json(), i = [];
2765
+ if (s && typeof s == "object") {
2766
+ if (typeof s.message == "string" && i.push({ message: s.message }), Array.isArray(s.messages))
2767
+ for (const a of s.messages)
2768
+ typeof a == "string" && i.push({ message: a });
2769
+ if (s.errors && typeof s.errors == "object")
2770
+ for (const [a, o] of Object.entries(s.errors))
2771
+ Array.isArray(o) ? i.push({ key: a, message: o.join(`
2772
+ `) }) : typeof o == "string" ? i.push({ key: a, message: o }) : o != null && i.push({ key: a, message: String(o) });
2773
+ if (i.length === 0)
2774
+ for (const [a, o] of Object.entries(s))
2775
+ a === "message" || a === "messages" || a === "errors" || (Array.isArray(o) ? i.push({ key: a, message: o.join(`
2776
+ `) }) : typeof o == "string" && i.push({ key: a, message: o }));
2670
2777
  }
2671
- if (s.length === 0) {
2778
+ if (i.length === 0) {
2672
2779
  await r(`${t.status} ${t.statusText}`);
2673
2780
  return;
2674
2781
  }
2675
- for (const a of s)
2782
+ for (const a of i)
2676
2783
  a.key && e ? await E.addErrorMessage(e, a.key, a.message) : await r(a.message);
2677
2784
  return;
2678
2785
  } catch {
2679
2786
  }
2680
2787
  try {
2681
- const i = await t.text();
2682
- i && i.trim().length > 0 ? await r(i.trim()) : await r(`${t.status} ${t.statusText}`);
2788
+ const s = await t.text();
2789
+ s && s.trim().length > 0 ? await r(s.trim()) : await r(`${t.status} ${t.statusText}`);
2683
2790
  } catch {
2684
2791
  await r(`${t.status} ${t.statusText}`);
2685
2792
  }
@@ -2718,7 +2825,7 @@ ${f}
2718
2825
  */
2719
2826
  confirm() {
2720
2827
  const t = this.options.confirmMessage;
2721
- return t == null ? Promise.resolve(!0) : U().confirm(t);
2828
+ return t == null ? Promise.resolve(!0) : K().confirm(t);
2722
2829
  }
2723
2830
  /**
2724
2831
  * 結果データを対象のフラグメントにバインドします。
@@ -2728,26 +2835,26 @@ ${f}
2728
2835
  bindResult(t) {
2729
2836
  return !this.options.bindFragments || this.options.bindFragments.length === 0 ? Promise.resolve() : (t.headers.get("Content-Type")?.includes("application/json") ? t.json() : t.text()).then((r) => {
2730
2837
  if (this.options.bindParams) {
2731
- const i = {};
2732
- this.options.bindParams.forEach((s) => {
2733
- r && typeof r == "object" && s in r && (i[s] = r[s]);
2734
- }), r = i;
2838
+ const s = {};
2839
+ this.options.bindParams.forEach((i) => {
2840
+ r && typeof r == "object" && i in r && (s[i] = r[i]);
2841
+ }), r = s;
2735
2842
  }
2736
2843
  const n = [];
2737
2844
  if (this.options.bindArg)
2738
- this.options.bindFragments.forEach((i) => {
2739
- const s = i.getBindingData();
2740
- s[this.options.bindArg] = r, n.push(T.setBindingData(i.getTarget(), s));
2845
+ this.options.bindFragments.forEach((s) => {
2846
+ const i = s.getBindingData();
2847
+ i[this.options.bindArg] = r, n.push(T.setBindingData(s.getTarget(), i));
2741
2848
  });
2742
2849
  else {
2743
2850
  if (typeof r == "string")
2744
- return h.error("Haori", "string data cannot be bound without a bindArg."), Promise.reject(
2851
+ return f.error("Haori", "string data cannot be bound without a bindArg."), Promise.reject(
2745
2852
  new Error("string data cannot be bound without a bindArg.")
2746
2853
  );
2747
- this.options.bindFragments.forEach((i) => {
2854
+ this.options.bindFragments.forEach((s) => {
2748
2855
  n.push(
2749
2856
  T.setBindingData(
2750
- i.getTarget(),
2857
+ s.getTarget(),
2751
2858
  r
2752
2859
  )
2753
2860
  );
@@ -2767,8 +2874,8 @@ ${f}
2767
2874
  for (const r of this.options.adjustFragments) {
2768
2875
  let n = r.getValue();
2769
2876
  (n == null || n === "") && (n = "0");
2770
- let i = Number(n);
2771
- isNaN(i) && (i = 0), i += t, e.push(r.setValue(String(i)));
2877
+ let s = Number(n);
2878
+ isNaN(s) && (s = 0), s += t, e.push(r.setValue(String(s)));
2772
2879
  }
2773
2880
  return Promise.all(e).then(() => {
2774
2881
  });
@@ -2780,11 +2887,11 @@ ${f}
2780
2887
  */
2781
2888
  getRowFragment() {
2782
2889
  if (!this.options.targetFragment)
2783
- return h.error("Haori", "Target fragment is not specified for row operation."), null;
2890
+ return f.error("Haori", "Target fragment is not specified for row operation."), null;
2784
2891
  const t = this.options.targetFragment.closestByAttribute(
2785
- `${c.prefix}row`
2892
+ `${h.prefix}row`
2786
2893
  );
2787
- return t || (h.error("Haori", "Row fragment not found."), null);
2894
+ return t || (f.error("Haori", "Row fragment not found."), null);
2788
2895
  }
2789
2896
  /**
2790
2897
  * 行を追加します。
@@ -2815,7 +2922,7 @@ ${f}
2815
2922
  if (!t)
2816
2923
  return Promise.reject(new Error("Row fragment not found."));
2817
2924
  const e = t.getParent();
2818
- return e && e.getChildElementFragments().filter((n) => !n.hasAttribute(`${c.prefix}each-before`) && !n.hasAttribute(`${c.prefix}each-after`)).length <= 1 ? Promise.resolve() : t.remove();
2925
+ return e && e.getChildElementFragments().filter((n) => !n.hasAttribute(`${h.prefix}each-before`) && !n.hasAttribute(`${h.prefix}each-after`)).length <= 1 ? Promise.resolve() : t.remove();
2819
2926
  }
2820
2927
  /**
2821
2928
  * 前の行へ移動します。
@@ -2851,8 +2958,10 @@ ${f}
2851
2958
  const r = t.getParent();
2852
2959
  return r ? r.insertAfter(t, e) : Promise.resolve();
2853
2960
  }
2854
- }
2855
- class Z {
2961
+ };
2962
+ c.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, c.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/;
2963
+ let j = c;
2964
+ class _ {
2856
2965
  /**
2857
2966
  * URLのクエリパラメータを取得します。
2858
2967
  *
@@ -2860,12 +2969,12 @@ class Z {
2860
2969
  */
2861
2970
  static readParams() {
2862
2971
  const t = {}, e = window.location.search;
2863
- return new URLSearchParams(e).forEach((n, i) => {
2864
- t[i] = n;
2972
+ return new URLSearchParams(e).forEach((n, s) => {
2973
+ t[s] = n;
2865
2974
  }), t;
2866
2975
  }
2867
2976
  }
2868
- class _ {
2977
+ class tt {
2869
2978
  /**
2870
2979
  * 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
2871
2980
  *
@@ -2882,24 +2991,24 @@ class _ {
2882
2991
  let r;
2883
2992
  try {
2884
2993
  r = await fetch(t, e);
2885
- } catch (i) {
2886
- throw h.error("[Haori]", "Failed to fetch import source:", t, i), new Error(`Failed to fetch: ${t}`);
2994
+ } catch (s) {
2995
+ throw f.error("[Haori]", "Failed to fetch import source:", t, s), new Error(`Failed to fetch: ${t}`);
2887
2996
  }
2888
2997
  if (!r.ok) {
2889
- const i = `${r.status} ${r.statusText}`;
2890
- throw h.error("[Haori]", "Import HTTP error:", t, i), new Error(`Failed to load ${t}: ${i}`);
2998
+ const s = `${r.status} ${r.statusText}`;
2999
+ throw f.error("[Haori]", "Import HTTP error:", t, s), new Error(`Failed to load ${t}: ${s}`);
2891
3000
  }
2892
3001
  let n;
2893
3002
  try {
2894
3003
  n = await r.text();
2895
- } catch (i) {
2896
- throw h.error("[Haori]", "Failed to read response text:", t, i), new Error(`Failed to read response from: ${t}`);
3004
+ } catch (s) {
3005
+ throw f.error("[Haori]", "Failed to read response text:", t, s), new Error(`Failed to read response from: ${t}`);
2897
3006
  }
2898
3007
  try {
2899
- const s = new DOMParser().parseFromString(n, "text/html");
2900
- return s && s.body ? s.body.innerHTML : (h.warn("[Haori]", "No body found in imported document:", t), n);
2901
- } catch (i) {
2902
- return h.error("[Haori]", "Failed to parse imported HTML:", t, i), n;
3008
+ const i = new DOMParser().parseFromString(n, "text/html");
3009
+ return i && i.body ? i.body.innerHTML : (f.warn("[Haori]", "No body found in imported document:", t), n);
3010
+ } catch (s) {
3011
+ return f.error("[Haori]", "Failed to parse imported HTML:", t, s), n;
2903
3012
  }
2904
3013
  }
2905
3014
  }
@@ -2912,7 +3021,7 @@ const m = class m {
2912
3021
  */
2913
3022
  static isDeferredAttributeName(t) {
2914
3023
  return m.DEFERRED_ATTRIBUTE_SUFFIXES.some(
2915
- (e) => t === `${c.prefix}${e}`
3024
+ (e) => t === `${h.prefix}${e}`
2916
3025
  );
2917
3026
  }
2918
3027
  /**
@@ -2927,34 +3036,34 @@ const m = class m {
2927
3036
  return Promise.resolve();
2928
3037
  t.parentNode && (A.get(t.parentNode)?.isMounted() || document.body.contains(t) ? e.setMounted(!0) : e.setMounted(!1));
2929
3038
  const r = [], n = /* @__PURE__ */ new Set();
2930
- for (const i of m.PRIORITY_ATTRIBUTE_SUFFIXES) {
2931
- const s = c.prefix + i;
2932
- e.hasAttribute(s) && (r.push(
3039
+ for (const s of m.PRIORITY_ATTRIBUTE_SUFFIXES) {
3040
+ const i = h.prefix + s;
3041
+ e.hasAttribute(i) && (r.push(
2933
3042
  m.setAttribute(
2934
3043
  e.getTarget(),
2935
- s,
2936
- e.getRawAttribute(s)
3044
+ i,
3045
+ e.getRawAttribute(i)
2937
3046
  )
2938
- ), n.add(s));
3047
+ ), n.add(i));
2939
3048
  }
2940
- for (const i of e.getAttributeNames()) {
2941
- if (n.has(i) || m.isDeferredAttributeName(i))
3049
+ for (const s of e.getAttributeNames()) {
3050
+ if (n.has(s) || m.isDeferredAttributeName(s))
2942
3051
  continue;
2943
- const s = e.getRawAttribute(i);
2944
- s !== null && r.push(m.setAttribute(e.getTarget(), i, s));
3052
+ const i = e.getRawAttribute(s);
3053
+ i !== null && r.push(m.setAttribute(e.getTarget(), s, i));
2945
3054
  }
2946
- for (const i of m.DEFERRED_ATTRIBUTE_SUFFIXES) {
2947
- const s = c.prefix + i;
2948
- e.hasAttribute(s) && (r.push(
3055
+ for (const s of m.DEFERRED_ATTRIBUTE_SUFFIXES) {
3056
+ const i = h.prefix + s;
3057
+ e.hasAttribute(i) && (r.push(
2949
3058
  m.setAttribute(
2950
3059
  e.getTarget(),
2951
- s,
2952
- e.getRawAttribute(s)
3060
+ i,
3061
+ e.getRawAttribute(i)
2953
3062
  )
2954
- ), n.add(s));
3063
+ ), n.add(i));
2955
3064
  }
2956
- return e.getChildren().forEach((i) => {
2957
- i instanceof M ? r.push(m.scan(i.getTarget())) : i instanceof $ && r.push(m.evaluateText(i));
3065
+ return e.getChildren().forEach((s) => {
3066
+ s instanceof x ? r.push(m.scan(s.getTarget())) : s instanceof I && r.push(m.evaluateText(s));
2958
3067
  }), Promise.all(r).then(() => {
2959
3068
  });
2960
3069
  }
@@ -2968,51 +3077,51 @@ const m = class m {
2968
3077
  * @returns Promise (DOM操作が完了したときに解決される)
2969
3078
  */
2970
3079
  static setAttribute(t, e, r) {
2971
- const n = A.get(t), i = [];
3080
+ const n = A.get(t), s = [];
2972
3081
  switch (e) {
2973
- case `${c.prefix}bind`: {
3082
+ case `${h.prefix}bind`: {
2974
3083
  r === null ? (n.clearBindingDataCache(), n.setBindingData({})) : n.setBindingData(m.parseDataBind(r));
2975
3084
  break;
2976
3085
  }
2977
- case `${c.prefix}if`:
2978
- i.push(m.evaluateIf(n));
3086
+ case `${h.prefix}if`:
3087
+ s.push(m.evaluateIf(n));
2979
3088
  break;
2980
- case `${c.prefix}each`:
2981
- i.push(m.evaluateEach(n));
3089
+ case `${h.prefix}each`:
3090
+ s.push(m.evaluateEach(n));
2982
3091
  break;
2983
- case `${c.prefix}fetch`:
2984
- i.push(new d(n, null).run());
3092
+ case `${h.prefix}fetch`:
3093
+ s.push(new j(n, null).run());
2985
3094
  break;
2986
- case `${c.prefix}import`: {
3095
+ case `${h.prefix}import`: {
2987
3096
  if (typeof r == "string") {
2988
- const s = n.getTarget(), a = performance.now();
2989
- y.importStart(s, r), i.push(
2990
- _.load(r).then((o) => {
3097
+ const i = n.getTarget(), a = performance.now();
3098
+ y.importStart(i, r), s.push(
3099
+ tt.load(r).then((o) => {
2991
3100
  const g = new TextEncoder().encode(o).length;
2992
3101
  return N.enqueue(() => {
2993
- s.innerHTML = o;
3102
+ i.innerHTML = o;
2994
3103
  }).then(() => {
2995
- y.importEnd(s, r, g, a);
3104
+ y.importEnd(i, r, g, a);
2996
3105
  });
2997
3106
  }).catch((o) => {
2998
- y.importError(s, r, o), h.error("[Haori]", "Failed to import HTML:", r, o);
3107
+ y.importError(i, r, o), f.error("[Haori]", "Failed to import HTML:", r, o);
2999
3108
  })
3000
3109
  );
3001
3110
  }
3002
3111
  break;
3003
3112
  }
3004
- case `${c.prefix}url-param`: {
3005
- const s = n.getAttribute(`${c.prefix}url-arg`), a = Z.readParams();
3006
- if (s === null)
3113
+ case `${h.prefix}url-param`: {
3114
+ const i = n.getAttribute(`${h.prefix}url-arg`), a = _.readParams();
3115
+ if (i === null)
3007
3116
  m.setBindingData(t, a);
3008
3117
  else {
3009
3118
  const o = n.getRawBindingData() || {};
3010
- o[String(s)] = a, m.setBindingData(t, o);
3119
+ o[String(i)] = a, m.setBindingData(t, o);
3011
3120
  }
3012
3121
  break;
3013
3122
  }
3014
3123
  }
3015
- return r === null ? i.push(n.removeAttribute(e)) : i.push(n.setAttribute(e, r)), Promise.all(i).then(() => {
3124
+ return r === null ? s.push(n.removeAttribute(e)) : s.push(n.setAttribute(e, r)), Promise.all(s).then(() => {
3016
3125
  });
3017
3126
  }
3018
3127
  /**
@@ -3026,10 +3135,10 @@ const m = class m {
3026
3135
  static setBindingData(t, e) {
3027
3136
  const r = A.get(t), n = r.getRawBindingData();
3028
3137
  r.setBindingData(e);
3029
- const i = [];
3030
- return i.push(
3031
- r.setAttribute(`${c.prefix}bind`, JSON.stringify(e))
3032
- ), i.push(m.evaluateAll(r)), y.bindChange(t, n, e, "manual"), Promise.all(i).then(() => {
3138
+ const s = [];
3139
+ return s.push(
3140
+ r.setAttribute(`${h.prefix}bind`, JSON.stringify(e))
3141
+ ), s.push(m.evaluateAll(r)), y.bindChange(t, n, e, "manual"), Promise.all(s).then(() => {
3033
3142
  });
3034
3143
  }
3035
3144
  /**
@@ -3043,12 +3152,12 @@ const m = class m {
3043
3152
  try {
3044
3153
  return JSON.parse(t);
3045
3154
  } catch (e) {
3046
- return h.error("[Haori]", "Invalid JSON in data-bind:", e), {};
3155
+ return f.error("[Haori]", "Invalid JSON in data-bind:", e), {};
3047
3156
  }
3048
3157
  else {
3049
3158
  const e = new URLSearchParams(t), r = {};
3050
- for (const [n, i] of e.entries())
3051
- r[n] !== void 0 ? Array.isArray(r[n]) ? r[n].push(i) : r[n] = [r[n], i] : r[n] = i;
3159
+ for (const [n, s] of e.entries())
3160
+ r[n] !== void 0 ? Array.isArray(r[n]) ? r[n].push(s) : r[n] = [r[n], s] : r[n] = s;
3052
3161
  return r;
3053
3162
  }
3054
3163
  }
@@ -3062,8 +3171,8 @@ const m = class m {
3062
3171
  const r = A.get(t);
3063
3172
  if (r.isSkipMutationNodes())
3064
3173
  return;
3065
- const n = A.get(e.nextSibling), i = A.get(e);
3066
- i && (r.insertBefore(i, n), i instanceof M ? m.scan(i.getTarget()) : i instanceof $ && m.evaluateText(i));
3174
+ const n = A.get(e.nextSibling), s = A.get(e);
3175
+ s && (r.insertBefore(s, n), s instanceof x ? m.scan(s.getTarget()) : s instanceof I && m.evaluateText(s));
3067
3176
  }
3068
3177
  /**
3069
3178
  * ノードを親要素から削除します。
@@ -3103,11 +3212,11 @@ const m = class m {
3103
3212
  return Promise.resolve();
3104
3213
  const n = [];
3105
3214
  n.push(r.setValue(e));
3106
- const i = m.getFormFragment(r);
3107
- if (i) {
3108
- const s = E.getValues(i), a = i.getAttribute(`${c.prefix}form-arg`);
3215
+ const s = m.getFormFragment(r);
3216
+ if (s) {
3217
+ const i = E.getValues(s), a = s.getAttribute(`${h.prefix}form-arg`);
3109
3218
  let o;
3110
- a ? (o = i.getRawBindingData(), o || (o = {}), o[String(a)] = s) : o = s, n.push(m.setBindingData(i.getTarget(), o));
3219
+ a ? (o = s.getRawBindingData(), o || (o = {}), o[String(a)] = i) : o = i, n.push(m.setBindingData(s.getTarget(), o));
3111
3220
  }
3112
3221
  return Promise.all(n).then(() => {
3113
3222
  });
@@ -3132,8 +3241,8 @@ const m = class m {
3132
3241
  */
3133
3242
  static evaluateAll(t) {
3134
3243
  const e = [];
3135
- return t.hasAttribute(`${c.prefix}if`) && e.push(m.evaluateIf(t)), t.hasAttribute(`${c.prefix}each`) && e.push(m.evaluateEach(t)), t.getChildren().forEach((r) => {
3136
- r instanceof M ? e.push(m.evaluateAll(r)) : r instanceof $ && e.push(m.evaluateText(r));
3244
+ return t.hasAttribute(`${h.prefix}if`) && e.push(m.evaluateIf(t)), t.hasAttribute(`${h.prefix}each`) && e.push(m.evaluateEach(t)), t.getChildren().forEach((r) => {
3245
+ r instanceof x ? e.push(m.evaluateAll(r)) : r instanceof I && e.push(m.evaluateText(r));
3137
3246
  }), Promise.all(e).then(() => {
3138
3247
  });
3139
3248
  }
@@ -3154,7 +3263,7 @@ const m = class m {
3154
3263
  * @return Promise (DOM操作が完了したときに解決される)
3155
3264
  */
3156
3265
  static evaluateIf(t) {
3157
- const e = [], r = t.getAttribute(`${c.prefix}if`);
3266
+ const e = [], r = t.getAttribute(`${h.prefix}if`);
3158
3267
  return r === !1 || r === void 0 || r === null || Number.isNaN(r) ? t.isVisible() && e.push(
3159
3268
  t.hide().then(() => {
3160
3269
  y.hide(t.getTarget());
@@ -3178,20 +3287,20 @@ const m = class m {
3178
3287
  let e = t.getTemplate();
3179
3288
  if (e === null) {
3180
3289
  let n = !1;
3181
- t.getChildren().forEach((s) => {
3182
- if (!n && s instanceof M) {
3183
- if (s.hasAttribute(`${c.prefix}each-before`) || s.hasAttribute(`${c.prefix}each-after`))
3290
+ t.getChildren().forEach((i) => {
3291
+ if (!n && i instanceof x) {
3292
+ if (i.hasAttribute(`${h.prefix}each-before`) || i.hasAttribute(`${h.prefix}each-after`))
3184
3293
  return;
3185
- e = s.clone(), t.setTemplate(e), n = !0, t.removeChild(s);
3186
- const a = s.getTarget();
3187
- a.parentNode && a.parentNode.removeChild(a), s.setMounted(!1);
3294
+ e = i.clone(), t.setTemplate(e), n = !0, t.removeChild(i);
3295
+ const a = i.getTarget();
3296
+ a.parentNode && a.parentNode.removeChild(a), i.setMounted(!1);
3188
3297
  }
3189
3298
  });
3190
- const i = t.getAttribute(`${c.prefix}each`);
3191
- return Array.isArray(i) ? this.updateDiff(t, i) : (h.error("[Haori]", "Invalid each attribute:", i), Promise.reject(new Error("Invalid each attribute.")));
3299
+ const s = t.getAttribute(`${h.prefix}each`);
3300
+ return Array.isArray(s) ? this.updateDiff(t, s) : (f.error("[Haori]", "Invalid each attribute:", s), Promise.reject(new Error("Invalid each attribute.")));
3192
3301
  }
3193
- const r = t.getAttribute(`${c.prefix}each`);
3194
- return Array.isArray(r) ? this.updateDiff(t, r) : (h.error("[Haori]", "Invalid each attribute:", r), Promise.reject(new Error("Invalid each attribute.")));
3302
+ const r = t.getAttribute(`${h.prefix}each`);
3303
+ return Array.isArray(r) ? this.updateDiff(t, r) : (f.error("[Haori]", "Invalid each attribute:", r), Promise.reject(new Error("Invalid each attribute.")));
3195
3304
  }
3196
3305
  /**
3197
3306
  * 差分を更新します。
@@ -3202,68 +3311,68 @@ const m = class m {
3202
3311
  static updateDiff(t, e) {
3203
3312
  const r = t.getTemplate();
3204
3313
  if (r === null)
3205
- return h.error("[Haori]", "Template is not set for each element."), Promise.resolve();
3206
- let n = t.getAttribute(`${c.prefix}each-index`);
3314
+ return f.error("[Haori]", "Template is not set for each element."), Promise.resolve();
3315
+ let n = t.getAttribute(`${h.prefix}each-index`);
3207
3316
  n && (n = String(n));
3208
- const i = t.getAttribute(`${c.prefix}each-key`), s = t.getAttribute(`${c.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
3209
- e.forEach((p, w) => {
3210
- const v = m.createListKey(
3317
+ const s = t.getAttribute(`${h.prefix}each-key`), i = t.getAttribute(`${h.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
3318
+ e.forEach((p, v) => {
3319
+ const w = m.createListKey(
3211
3320
  p,
3212
- i ? String(i) : null,
3213
- w
3321
+ s ? String(s) : null,
3322
+ v
3214
3323
  );
3215
- o.push(v), a.set(v, { item: p, itemIndex: w });
3324
+ o.push(w), a.set(w, { item: p, itemIndex: v });
3216
3325
  });
3217
3326
  const g = [];
3218
- let u = t.getChildren().filter((p) => p instanceof M).filter(
3219
- (p) => !p.hasAttribute(`${c.prefix}each-before`) && !p.hasAttribute(`${c.prefix}each-after`)
3327
+ let u = t.getChildren().filter((p) => p instanceof x).filter(
3328
+ (p) => !p.hasAttribute(`${h.prefix}each-before`) && !p.hasAttribute(`${h.prefix}each-after`)
3220
3329
  );
3221
3330
  u = u.filter((p) => o.indexOf(String(p.getListKey())) === -1 ? (g.push(p.remove()), !1) : !0);
3222
- const b = u.map((p) => p.getListKey()), l = t.getChildren().filter((p) => p instanceof M).filter((p) => p.hasAttribute(`${c.prefix}each-before`)).length;
3223
- let f = Promise.resolve();
3224
- return o.forEach((p, w) => {
3225
- const v = b.indexOf(p), { item: I, itemIndex: x } = a.get(p);
3331
+ const b = u.map((p) => p.getListKey()), l = t.getChildren().filter((p) => p instanceof x).filter((p) => p.hasAttribute(`${h.prefix}each-before`)).length;
3332
+ let d = Promise.resolve();
3333
+ return o.forEach((p, v) => {
3334
+ const w = b.indexOf(p), { item: $, itemIndex: S } = a.get(p);
3226
3335
  let F;
3227
- if (v !== -1)
3228
- F = u[v], m.updateRowFragment(
3336
+ if (w !== -1)
3337
+ F = u[w], m.updateRowFragment(
3229
3338
  F,
3230
- I,
3339
+ $,
3231
3340
  n,
3232
- x,
3233
- s ? String(s) : null,
3341
+ S,
3342
+ i ? String(i) : null,
3234
3343
  p
3235
- ), typeof F.clearBindingDataCache == "function" && F.clearBindingDataCache(), f = f.then(() => m.evaluateAll(F));
3344
+ ), typeof F.clearBindingDataCache == "function" && F.clearBindingDataCache(), d = d.then(() => m.evaluateAll(F));
3236
3345
  else {
3237
3346
  F = r.clone(), m.updateRowFragment(
3238
3347
  F,
3239
- I,
3348
+ $,
3240
3349
  n,
3241
- x,
3242
- s ? String(s) : null,
3350
+ S,
3351
+ i ? String(i) : null,
3243
3352
  p
3244
3353
  ), typeof F.clearBindingDataCache == "function" && F.clearBindingDataCache();
3245
- const X = l + w;
3246
- f = f.then(
3354
+ const Y = l + v;
3355
+ d = d.then(
3247
3356
  () => t.insertBefore(
3248
3357
  F,
3249
- t.getChildren()[X] || null
3358
+ t.getChildren()[Y] || null
3250
3359
  ).then(() => m.evaluateAll(F))
3251
3360
  );
3252
3361
  }
3253
- }), Promise.all(g).then(() => f).then(() => {
3362
+ }), Promise.all(g).then(() => d).then(() => {
3254
3363
  const p = o.filter(
3255
- (x) => x !== null
3256
- ), w = b.filter(
3257
- (x) => x !== null
3258
- ), v = p.filter(
3259
- (x) => !w.includes(x)
3260
- ), I = w.filter(
3261
- (x) => !p.includes(x)
3364
+ (S) => S !== null
3365
+ ), v = b.filter(
3366
+ (S) => S !== null
3367
+ ), w = p.filter(
3368
+ (S) => !v.includes(S)
3369
+ ), $ = v.filter(
3370
+ (S) => !p.includes(S)
3262
3371
  );
3263
3372
  y.eachUpdate(
3264
3373
  t.getTarget(),
3265
- v,
3266
- I,
3374
+ w,
3375
+ $,
3267
3376
  p
3268
3377
  );
3269
3378
  });
@@ -3280,8 +3389,8 @@ const m = class m {
3280
3389
  let n;
3281
3390
  if (typeof t == "object" && t !== null)
3282
3391
  if (e) {
3283
- const i = t[e];
3284
- i == null ? n = `__index_${r}` : typeof i == "object" ? n = JSON.stringify(i) : n = String(i);
3392
+ const s = t[e];
3393
+ s == null ? n = `__index_${r}` : typeof s == "object" ? n = JSON.stringify(s) : n = String(s);
3285
3394
  } else
3286
3395
  n = `__index_${r}`;
3287
3396
  else
@@ -3298,29 +3407,29 @@ const m = class m {
3298
3407
  * @param arg バインドデータパラメータ名
3299
3408
  * @param listKey リストキー
3300
3409
  */
3301
- static updateRowFragment(t, e, r, n, i, s) {
3410
+ static updateRowFragment(t, e, r, n, s, i) {
3302
3411
  let a = e;
3303
3412
  if (typeof e == "object" && e !== null)
3304
- a = { ...e }, r && (a[r] = n), i && (a = {
3305
- [i]: a
3413
+ a = { ...e }, r && (a[r] = n), s && (a = {
3414
+ [s]: a
3306
3415
  });
3307
- else if (i)
3416
+ else if (s)
3308
3417
  a = {
3309
- [i]: e
3418
+ [s]: e
3310
3419
  }, r && (a[r] = n);
3311
3420
  else {
3312
- h.error(
3421
+ f.error(
3313
3422
  "[Haori]",
3314
- `Primitive value requires '${c.prefix}each-arg' attribute: ${e}`
3423
+ `Primitive value requires '${h.prefix}each-arg' attribute: ${e}`
3315
3424
  );
3316
3425
  return;
3317
3426
  }
3318
- t.setListKey(s), t.setAttribute(`${c.prefix}row`, s), t.setBindingData(a);
3427
+ t.setListKey(i), t.setAttribute(`${h.prefix}row`, i), t.setBindingData(a);
3319
3428
  }
3320
3429
  };
3321
3430
  m.PRIORITY_ATTRIBUTE_SUFFIXES = ["bind", "if", "each"], m.DEFERRED_ATTRIBUTE_SUFFIXES = ["fetch", "url-param"];
3322
3431
  let T = m;
3323
- class tt {
3432
+ class et {
3324
3433
  /**
3325
3434
  * コンストラクタ。
3326
3435
  *
@@ -3329,7 +3438,7 @@ class tt {
3329
3438
  constructor(t = document) {
3330
3439
  this.onClick = (e) => this.delegate(e, "click"), this.onChange = (e) => this.delegate(e, "change"), this.onLoadCapture = (e) => this.delegate(e, "load"), this.onWindowLoad = () => {
3331
3440
  const e = document.documentElement, r = A.get(e);
3332
- r && new d(r, "load").run();
3441
+ r && new j(r, "load").run();
3333
3442
  }, this.root = t;
3334
3443
  }
3335
3444
  /**
@@ -3356,8 +3465,8 @@ class tt {
3356
3465
  if (!r)
3357
3466
  return;
3358
3467
  const n = A.get(r);
3359
- n && (e === "change" && n instanceof M && n.syncValue(), new d(n, e).run().catch((i) => {
3360
- h.error("[Haori]", "Procedure execution error:", i);
3468
+ n && (e === "change" && n instanceof x && n.syncValue(), new j(n, e).run().catch((s) => {
3469
+ f.error("[Haori]", "Procedure execution error:", s);
3361
3470
  }));
3362
3471
  }
3363
3472
  /**
@@ -3383,7 +3492,7 @@ const C = class C {
3383
3492
  T.scan(document.head),
3384
3493
  T.scan(document.body)
3385
3494
  ]), [e, r] = t;
3386
- e.status !== "fulfilled" && h.error("[Haori]", "Failed to build head fragment:", e.reason), r.status !== "fulfilled" && h.error("[Haori]", "Failed to build body fragment:", r.reason), C.observe(document.head), C.observe(document.body), new tt().start();
3495
+ e.status !== "fulfilled" && f.error("[Haori]", "Failed to build head fragment:", e.reason), r.status !== "fulfilled" && f.error("[Haori]", "Failed to build body fragment:", r.reason), C.observe(document.head), C.observe(document.body), new et().start();
3387
3496
  }
3388
3497
  /**
3389
3498
  * 指定された要素を監視します。
@@ -3396,40 +3505,40 @@ const C = class C {
3396
3505
  try {
3397
3506
  switch (n.type) {
3398
3507
  case "attributes": {
3399
- h.info(
3508
+ f.info(
3400
3509
  "[Haori]",
3401
3510
  "Attribute changed:",
3402
3511
  n.target,
3403
3512
  n.attributeName
3404
3513
  );
3405
- const i = n.target;
3514
+ const s = n.target;
3406
3515
  T.setAttribute(
3407
- i,
3516
+ s,
3408
3517
  n.attributeName,
3409
- i.getAttribute(n.attributeName)
3518
+ s.getAttribute(n.attributeName)
3410
3519
  );
3411
3520
  break;
3412
3521
  }
3413
3522
  case "childList": {
3414
- h.info(
3523
+ f.info(
3415
3524
  "[Haori]",
3416
3525
  "Child list changed:",
3417
- Array.from(n.removedNodes).map((i) => i.nodeName),
3418
- Array.from(n.addedNodes).map((i) => i.nodeName)
3419
- ), Array.from(n.removedNodes).forEach((i) => {
3420
- T.removeNode(i);
3421
- }), Array.from(n.addedNodes).forEach((i) => {
3422
- i.parentElement instanceof HTMLElement && T.addNode(i.parentElement, i);
3526
+ Array.from(n.removedNodes).map((s) => s.nodeName),
3527
+ Array.from(n.addedNodes).map((s) => s.nodeName)
3528
+ ), Array.from(n.removedNodes).forEach((s) => {
3529
+ T.removeNode(s);
3530
+ }), Array.from(n.addedNodes).forEach((s) => {
3531
+ s.parentElement instanceof HTMLElement && T.addNode(s.parentElement, s);
3423
3532
  });
3424
3533
  break;
3425
3534
  }
3426
3535
  case "characterData": {
3427
- h.info(
3536
+ f.info(
3428
3537
  "[Haori]",
3429
3538
  "Character data changed:",
3430
3539
  n.target,
3431
3540
  n.target.textContent
3432
- ), n.target instanceof Text || n.target instanceof Comment ? T.changeText(n.target, n.target.textContent) : h.warn(
3541
+ ), n.target instanceof Text || n.target instanceof Comment ? T.changeText(n.target, n.target.textContent) : f.warn(
3433
3542
  "[Haori]",
3434
3543
  "Unsupported character data type:",
3435
3544
  n.target
@@ -3437,33 +3546,33 @@ const C = class C {
3437
3546
  break;
3438
3547
  }
3439
3548
  default:
3440
- h.warn("[Haori]", "Unknown mutation type:", n.type);
3549
+ f.warn("[Haori]", "Unknown mutation type:", n.type);
3441
3550
  continue;
3442
3551
  }
3443
- } catch (i) {
3444
- h.error("[Haori]", "Error processing mutation:", i);
3552
+ } catch (s) {
3553
+ f.error("[Haori]", "Error processing mutation:", s);
3445
3554
  }
3446
3555
  }).observe(t, {
3447
3556
  childList: !0,
3448
3557
  subtree: !0,
3449
3558
  attributes: !0,
3450
3559
  characterData: !0
3451
- }), h.info("[Haori]", "Observer initialized for", t);
3560
+ }), f.info("[Haori]", "Observer initialized for", t);
3452
3561
  }
3453
3562
  };
3454
3563
  C._initialized = !1;
3455
- let L = C;
3456
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", L.init) : L.init();
3457
- const et = "0.1.3";
3564
+ let V = C;
3565
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", V.init) : V.init();
3566
+ const rt = "0.1.4";
3458
3567
  export {
3459
3568
  T as Core,
3460
- c as Env,
3569
+ h as Env,
3461
3570
  E as Form,
3462
3571
  A as Fragment,
3463
- Y as Haori,
3464
- h as Log,
3572
+ X as Haori,
3573
+ f as Log,
3465
3574
  N as Queue,
3466
- Y as default,
3467
- et as version
3575
+ X as default,
3576
+ rt as version
3468
3577
  };
3469
3578
  //# sourceMappingURL=haori.es.js.map