haori 0.13.1 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/haori.es.js CHANGED
@@ -1,23 +1,23 @@
1
- const z = class z {
1
+ const K = class K {
2
2
  /**
3
3
  * 開発モードの状態を取得します。
4
4
  *
5
5
  * @returns 開発モードならtrue、そうでなければfalse
6
6
  */
7
7
  static isEnabled() {
8
- return z.devMode;
8
+ return K.devMode;
9
9
  }
10
10
  /**
11
11
  * 開発モードを有効化します。
12
12
  */
13
13
  static enable() {
14
- z.devMode = !0;
14
+ K.devMode = !0;
15
15
  }
16
16
  /**
17
17
  * 開発モードを無効化します。
18
18
  */
19
19
  static disable() {
20
- z.devMode = !1;
20
+ K.devMode = !1;
21
21
  }
22
22
  /**
23
23
  * 開発モードを切り替えます。
@@ -25,11 +25,11 @@ const z = class z {
25
25
  * @param enabled trueで有効化、falseで無効化
26
26
  */
27
27
  static set(e) {
28
- z.devMode = e;
28
+ K.devMode = e;
29
29
  }
30
30
  };
31
- z.devMode = !1;
32
- let B = z;
31
+ K.devMode = !1;
32
+ let B = K;
33
33
  const ne = "embedded";
34
34
  function de(E) {
35
35
  return E === "embedded" || E === "demo";
@@ -97,7 +97,7 @@ const H = class H {
97
97
  H._prefix = "data-", H._runtime = ne;
98
98
  let l = H;
99
99
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", l.detect) : l.detect();
100
- class p {
100
+ class g {
101
101
  /**
102
102
  * 開発モードでのみコンソールに情報を出力します。
103
103
  *
@@ -149,14 +149,22 @@ function fe(E, e = ye) {
149
149
  ss: W(t.getSeconds())
150
150
  };
151
151
  return e.replace(
152
- /yyyy|yy|MM|dd|HH|mm|ss|M|d|H/g,
153
- (i) => r[i]
152
+ /'([^']*)'|yyyy|yy|MM|dd|HH|mm|ss|M|d|H/g,
153
+ (i, s) => s !== void 0 ? s === "" ? "'" : s : r[i]
154
154
  );
155
155
  }
156
156
  function pe(E, e) {
157
- if (E == null || E === "")
157
+ if (E == null)
158
158
  return "";
159
- const t = typeof E == "number" ? E : Number(E);
159
+ let t;
160
+ if (typeof E == "number")
161
+ t = E;
162
+ else {
163
+ const i = String(E).trim();
164
+ if (i === "")
165
+ return "";
166
+ t = Number(i);
167
+ }
160
168
  if (!Number.isFinite(t))
161
169
  return "";
162
170
  const r = {};
@@ -194,15 +202,27 @@ function me(E, e, t = {}) {
194
202
  a.add(h);
195
203
  for (let h = Math.max(0, i - s); h <= Math.min(r - 1, i + s); h += 1)
196
204
  a.add(h);
197
- const o = Array.from(a).sort((h, g) => h - g), c = [];
205
+ const o = Array.from(a).sort((h, p) => h - p), c = [];
198
206
  let d = null;
199
- for (const h of o)
200
- d !== null && h - d > 1 && c.push({ page: null, label: "…", active: !1, ellipsis: !0 }), c.push({
207
+ for (const h of o) {
208
+ if (d !== null && h - d > 1)
209
+ if (h - d === 2) {
210
+ const p = d + 1;
211
+ c.push({
212
+ page: p,
213
+ label: p + 1,
214
+ active: p === i,
215
+ ellipsis: !1
216
+ });
217
+ } else
218
+ c.push({ page: null, label: "…", active: !1, ellipsis: !0 });
219
+ c.push({
201
220
  page: h,
202
221
  label: h + 1,
203
222
  active: h === i,
204
223
  ellipsis: !1
205
224
  }), d = h;
225
+ }
206
226
  return c;
207
227
  }
208
228
  const Ae = Object.freeze({ date: fe, number: pe, pages: me, range: ge }), I = class I {
@@ -288,18 +308,18 @@ const Ae = Object.freeze({ date: fe, number: pe, pages: me, range: ge }), I = cl
288
308
  */
289
309
  static evaluateDetailed(e, t = {}) {
290
310
  if (this.scheduleForbiddenBindingValueCacheReset(), e.trim() === "")
291
- return p.warn("[Haori]", e, "Expression is empty"), { value: null, unresolvedReference: !1 };
311
+ return g.warn("[Haori]", e, "Expression is empty"), { value: null, unresolvedReference: !1 };
292
312
  if (this.containsDangerousPatterns(e)) {
293
- const a = this.detectDisallowedKeywords(e);
294
- if (a.length > 0) {
295
- const o = a.some((c) => c === "function" || c === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
296
- p.warn(
313
+ const o = this.detectDisallowedKeywords(e);
314
+ if (o.length > 0) {
315
+ const c = o.some((d) => d === "function" || d === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
316
+ g.warn(
297
317
  "[Haori]",
298
318
  e,
299
- "Expression uses disallowed keyword(s): " + a.join(", ") + "." + o
319
+ "Expression uses disallowed keyword(s): " + o.join(", ") + "." + c
300
320
  );
301
321
  } else
302
- p.warn(
322
+ g.warn(
303
323
  "[Haori]",
304
324
  e,
305
325
  "Expression contains dangerous patterns"
@@ -307,59 +327,64 @@ const Ae = Object.freeze({ date: fe, number: pe, pages: me, range: ge }), I = cl
307
327
  return { value: null, unresolvedReference: !1 };
308
328
  }
309
329
  if (this.containsForbiddenKeys(t))
310
- return p.warn("[Haori]", t, "Binded values contain forbidden keys"), { value: null, unresolvedReference: !1 };
330
+ return g.warn("[Haori]", t, "Binded values contain forbidden keys"), { value: null, unresolvedReference: !1 };
311
331
  const r = this.getForbiddenBindingValueSet();
312
332
  if (this.containsForbiddenBindingValues(
313
333
  t,
314
334
  /* @__PURE__ */ new WeakSet(),
315
335
  r
316
336
  ))
317
- return p.warn(
337
+ return g.warn(
318
338
  "[Haori]",
319
339
  t,
320
340
  "Binded values contain forbidden values"
321
341
  ), { value: null, unresolvedReference: !1 };
322
- const i = this.BUILTIN_REFERENCE_PATTERN.test(e);
323
- i && this.BUILTIN_NAMESPACE in t && p.warn(
342
+ const i = e.replace(
343
+ /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,
344
+ ""
345
+ ), s = this.BUILTIN_REFERENCE_PATTERN.test(
346
+ i
347
+ );
348
+ s && this.BUILTIN_NAMESPACE in t && g.warn(
324
349
  "[Haori]",
325
350
  `Binding key "${this.BUILTIN_NAMESPACE}" is reserved for built-in helpers; the bound value is ignored in expressions.`
326
351
  );
327
- const s = i ? { ...t, [this.BUILTIN_NAMESPACE]: this.BUILTIN_HELPERS } : { ...t }, n = this.canAttemptMissingIdentifierRecovery(e);
328
- for (let a = 0; a <= this.MAX_IDENTIFIER_RECOVERY_COUNT; a += 1) {
329
- const o = this.prepareEvaluator(e, s);
330
- if (o.compileFailed || o.evaluator === null)
352
+ const n = s ? { ...t, [this.BUILTIN_NAMESPACE]: this.BUILTIN_HELPERS } : { ...t }, a = this.canAttemptMissingIdentifierRecovery(e);
353
+ for (let o = 0; o <= this.MAX_IDENTIFIER_RECOVERY_COUNT; o += 1) {
354
+ const c = this.prepareEvaluator(e, n);
355
+ if (c.compileFailed || c.evaluator === null)
331
356
  return { value: null, unresolvedReference: !1 };
332
357
  try {
333
- const c = [], d = this.wrapBoundValues(s);
334
- return o.bindKeys.forEach((h) => {
335
- c.push(d[h]);
358
+ const d = [], h = this.wrapBoundValues(n);
359
+ return c.bindKeys.forEach((p) => {
360
+ d.push(h[p]);
336
361
  }), {
337
362
  value: this.withBlockedPropertyAccess(
338
- () => o.evaluator(...c)
363
+ () => c.evaluator(...d)
339
364
  ),
340
365
  unresolvedReference: !1
341
366
  };
342
- } catch (c) {
343
- if (n && c instanceof ReferenceError) {
344
- const h = this.extractMissingIdentifier(c);
345
- if (h !== null && this.canRecoverMissingIdentifier(h, s)) {
346
- s[h] = void 0;
367
+ } catch (d) {
368
+ if (a && d instanceof ReferenceError) {
369
+ const p = this.extractMissingIdentifier(d);
370
+ if (p !== null && this.canRecoverMissingIdentifier(p, n)) {
371
+ n[p] = void 0;
347
372
  continue;
348
373
  }
349
374
  }
350
- const d = this.detectForbiddenIdentifiers(e);
351
- return d.length > 0 && p.warn(
375
+ const h = this.detectForbiddenIdentifiers(e);
376
+ return h.length > 0 && g.warn(
352
377
  "[Haori]",
353
- "Expression references blocked identifier(s): " + d.join(", ") + ". These are blocked in expressions and evaluate to undefined (often the cause of this error). Use spread {...a, ...b} instead of Object.assign.",
378
+ "Expression references blocked identifier(s): " + h.join(", ") + ". These are blocked in expressions and evaluate to undefined (often the cause of this error). Use spread {...a, ...b} instead of Object.assign.",
354
379
  e
355
- ), p.error("[Haori]", "Expression evaluation error:", e, c), c instanceof ReferenceError ? { value: void 0, unresolvedReference: !0 } : { value: null, unresolvedReference: !1 };
380
+ ), g.error("[Haori]", "Expression evaluation error:", e, d), d instanceof ReferenceError ? { value: void 0, unresolvedReference: !0 } : { value: null, unresolvedReference: !1 };
356
381
  }
357
382
  }
358
- return p.error(
383
+ return g.error(
359
384
  "[Haori]",
360
385
  "Failed to recover missing identifiers:",
361
386
  e,
362
- s
387
+ n
363
388
  ), { value: void 0, unresolvedReference: !0 };
364
389
  }
365
390
  /**
@@ -389,7 +414,7 @@ return (${e});`;
389
414
  compileFailed: !1
390
415
  };
391
416
  } catch (o) {
392
- return p.error(
417
+ return g.error(
393
418
  "[Haori]",
394
419
  "Failed to compile expression:",
395
420
  e,
@@ -1013,13 +1038,13 @@ class oe {
1013
1038
  const r = await t.task();
1014
1039
  t.resolve(r);
1015
1040
  } catch (r) {
1016
- t.reject(r), p.error("[Haori]", `Task ${t.timestamp} failed:`, r);
1041
+ t.reject(r), g.error("[Haori]", `Task ${t.timestamp} failed:`, r);
1017
1042
  }
1018
1043
  if (performance.now() - e > this.MAX_BUDGET)
1019
1044
  break;
1020
1045
  }
1021
1046
  } catch (e) {
1022
- p.error("[Haori]", "Error processing queue:", e);
1047
+ g.error("[Haori]", "Error processing queue:", e);
1023
1048
  } finally {
1024
1049
  this.processing = !1, this.queue.length > 0 && this.scheduleProcessing();
1025
1050
  }
@@ -1179,7 +1204,7 @@ class X {
1179
1204
  */
1180
1205
  static openDialog(e) {
1181
1206
  return x.enqueue(() => {
1182
- e instanceof HTMLDialogElement ? e.showModal() : p.error("[Haori]", "Element is not a dialog: ", e);
1207
+ e instanceof HTMLDialogElement ? e.showModal() : g.error("[Haori]", "Element is not a dialog: ", e);
1183
1208
  }, !0);
1184
1209
  }
1185
1210
  /**
@@ -1189,7 +1214,7 @@ class X {
1189
1214
  */
1190
1215
  static closeDialog(e) {
1191
1216
  return x.enqueue(() => {
1192
- e instanceof HTMLDialogElement ? e.close() : p.error("[Haori]", "Element is not a dialog: ", e);
1217
+ e instanceof HTMLDialogElement ? e.close() : g.error("[Haori]", "Element is not a dialog: ", e);
1193
1218
  }, !0);
1194
1219
  }
1195
1220
  /**
@@ -1308,7 +1333,7 @@ class S {
1308
1333
  static getPartValues(e, t) {
1309
1334
  const r = e.getAttribute("name"), i = e.getAttribute(`${l.prefix}form-object`), s = e.getAttribute(`${l.prefix}form-list`);
1310
1335
  if (r) {
1311
- s ? Array.isArray(t[String(r)]) ? t[String(r)].push(e.getValue()) : t[String(r)] = [e.getValue()] : t[String(r)] = e.getValue(), i && p.warn(
1336
+ s ? Array.isArray(t[String(r)]) ? t[String(r)].push(e.getValue()) : t[String(r)] = [e.getValue()] : t[String(r)] = e.getValue(), i && g.warn(
1312
1337
  "Haori",
1313
1338
  `Element cannot have both ${l.prefix}form-object and name attributes.`
1314
1339
  );
@@ -1318,7 +1343,7 @@ class S {
1318
1343
  const n = {};
1319
1344
  for (const a of e.getChildElementFragments())
1320
1345
  S.getPartValues(a, n);
1321
- Object.keys(n).length > 0 && (t[String(i)] = n), s && p.warn(
1346
+ Object.keys(n).length > 0 && (t[String(i)] = n), s && g.warn(
1322
1347
  "Haori",
1323
1348
  `Element cannot have both ${l.prefix}form-list and ${l.prefix}form-object attributes.`
1324
1349
  );
@@ -1392,10 +1417,10 @@ class S {
1392
1417
  } else if (o) {
1393
1418
  const h = t[String(o)];
1394
1419
  if (h && typeof h == "object")
1395
- for (const g of e.getChildElementFragments())
1420
+ for (const p of e.getChildElementFragments())
1396
1421
  n.push(
1397
1422
  S.setPartValues(
1398
- g,
1423
+ p,
1399
1424
  h,
1400
1425
  null,
1401
1426
  i,
@@ -1405,9 +1430,9 @@ class S {
1405
1430
  } else if (c) {
1406
1431
  const h = t[String(c)];
1407
1432
  if (Array.isArray(h)) {
1408
- const g = e.getChildElementFragments();
1409
- for (let v = 0; v < g.length; v++) {
1410
- const T = g[v];
1433
+ const p = e.getChildElementFragments();
1434
+ for (let v = 0; v < p.length; v++) {
1435
+ const T = p[v];
1411
1436
  h.length > v ? n.push(
1412
1437
  S.setPartValues(
1413
1438
  T,
@@ -1557,9 +1582,9 @@ class S {
1557
1582
  if (s === o) {
1558
1583
  const c = i.substring(n + 1, a), d = Number(c);
1559
1584
  if (isNaN(d))
1560
- p.error("Haori", `Invalid index: ${i}`);
1585
+ g.error("Haori", `Invalid index: ${i}`);
1561
1586
  else {
1562
- const h = e.getChildElementFragments().filter((g) => g.hasAttribute(`${l.prefix}row`));
1587
+ const h = e.getChildElementFragments().filter((p) => p.hasAttribute(`${l.prefix}row`));
1563
1588
  d < h.length && r.push(
1564
1589
  ...S.findFragmentByKeyParts(h[d], t.slice(1))
1565
1590
  );
@@ -1844,7 +1869,7 @@ const G = class G {
1844
1869
  t = new le(e);
1845
1870
  break;
1846
1871
  default:
1847
- return p.warn("[Haori]", "Unsupported node type:", e.nodeType), null;
1872
+ return g.warn("[Haori]", "Unsupported node type:", e.nodeType), null;
1848
1873
  }
1849
1874
  return t;
1850
1875
  }
@@ -2021,7 +2046,7 @@ const V = class V extends w {
2021
2046
  removeChild(e) {
2022
2047
  const t = this.children.indexOf(e);
2023
2048
  if (t < 0) {
2024
- p.warn("[Haori]", "Child fragment not found.", e);
2049
+ g.warn("[Haori]", "Child fragment not found.", e);
2025
2050
  return;
2026
2051
  }
2027
2052
  this.children.splice(t, 1), e.setParent(null);
@@ -2294,7 +2319,7 @@ const V = class V extends w {
2294
2319
  r.value = e === null ? "" : String(e), t && ((r instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(r.type) || r instanceof HTMLTextAreaElement) && r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 })));
2295
2320
  }).finally(() => {
2296
2321
  this.skipChangeValue = !1;
2297
- })) : (p.warn(
2322
+ })) : (g.warn(
2298
2323
  "[Haori]",
2299
2324
  "setValue is not supported for this element type.",
2300
2325
  r
@@ -2431,9 +2456,9 @@ const V = class V extends w {
2431
2456
  element: a,
2432
2457
  rawName: e,
2433
2458
  template: r
2434
- }), c = n.isEvaluate || n.isRawEvaluate, d = e === t && V.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), h = n.isSingleExpression(), g = j.joinEvaluateResults(o.results), v = o.results.length === 1 ? o.results[0] : g, T = !n.isForceEvaluation() && (t !== e || d || h ? o.hasUnresolvedReference || v === null || v === void 0 || v === !1 : c && g === ""), b = n.isForceEvaluation() ? r : h ? v : g, y = i && n.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), m = T || b === null || b === !1 ? null : String(b), A = e !== t && a.getAttribute(e) !== r, F = m === null ? a.hasAttribute(t) : a.getAttribute(t) !== m, M = y && m !== null && a.value !== m;
2435
- return !A && !F && !M ? (y && m !== null && (this.value = m), Promise.resolve()) : (this.skipMutationAttributes = !0, x.enqueue(() => {
2436
- A && a.setAttribute(e, r), m === null ? a.removeAttribute(t) : (F && a.setAttribute(t, m), y && (this.value = m, M && (a.value = m)));
2459
+ }), c = n.isEvaluate || n.isRawEvaluate, d = e === t && V.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), h = n.isSingleExpression(), p = j.joinEvaluateResults(o.results), v = o.results.length === 1 ? o.results[0] : p, T = !n.isForceEvaluation() && (t !== e || d || h ? o.hasUnresolvedReference || v === null || v === void 0 || v === !1 : c && p === ""), b = n.isForceEvaluation() ? r : h ? v : p, y = i && n.isEvaluate && t === "value" && (a instanceof HTMLInputElement && this.INPUT_EVENT_TYPES.includes(a.type) || a instanceof HTMLTextAreaElement || a instanceof HTMLSelectElement), m = T || b === null || b === !1 ? null : String(b), A = e !== t && a.getAttribute(e) !== r, F = m === null ? a.hasAttribute(t) : a.getAttribute(t) !== m, M = y && m !== null && a.value !== m;
2460
+ return !A && !F && !M ? (y && m !== null && (this.value = this.normalizeValueForElement(a, m)), Promise.resolve()) : (this.skipMutationAttributes = !0, x.enqueue(() => {
2461
+ A && a.setAttribute(e, r), m === null ? a.removeAttribute(t) : (F && a.setAttribute(t, m), y && (this.value = this.normalizeValueForElement(a, m), M && (a.value = m)));
2437
2462
  }).finally(() => {
2438
2463
  this.skipMutationAttributes = !1;
2439
2464
  }));
@@ -2552,13 +2577,13 @@ const V = class V extends w {
2552
2577
  if (this.skipMutationNodes)
2553
2578
  return Promise.resolve();
2554
2579
  if (e === this)
2555
- return p.error("[Haori]", "Cannot insert element as child of itself"), Promise.reject(new Error("Self-insertion not allowed"));
2580
+ return g.error("[Haori]", "Cannot insert element as child of itself"), Promise.reject(new Error("Self-insertion not allowed"));
2556
2581
  const i = /* @__PURE__ */ new Set();
2557
2582
  let s = this.parent;
2558
2583
  for (; s; )
2559
2584
  i.add(s), s = s.getParent();
2560
2585
  if (i.has(e))
2561
- return p.error("[Haori]", "Cannot create circular reference"), Promise.reject(new Error("Circular reference detected"));
2586
+ return g.error("[Haori]", "Cannot create circular reference"), Promise.reject(new Error("Circular reference detected"));
2562
2587
  const n = e.getParent() === this;
2563
2588
  let a = -1, o = -1;
2564
2589
  n && (a = this.children.indexOf(e), t !== null && (o = this.children.indexOf(t)));
@@ -2568,19 +2593,19 @@ const V = class V extends w {
2568
2593
  if (t === null)
2569
2594
  this.children.push(e);
2570
2595
  else {
2571
- let g;
2572
- if (n ? a !== -1 && a < o ? g = o - 1 : g = o : g = this.children.indexOf(t), g === -1) {
2596
+ let p;
2597
+ if (n ? a !== -1 && a < o ? p = o - 1 : p = o : p = this.children.indexOf(t), p === -1) {
2573
2598
  const v = this.resolveInsertionPointFromDom(
2574
2599
  t,
2575
2600
  !1
2576
2601
  );
2577
- v === null ? (p.warn(
2602
+ v === null ? (g.warn(
2578
2603
  "[Haori]",
2579
2604
  "Reference child not found in children.",
2580
2605
  t
2581
2606
  ), this.children.push(e)) : (this.children.splice(v.index, 0, e), d = v.referenceNode);
2582
2607
  } else
2583
- this.children.splice(g, 0, e);
2608
+ this.children.splice(p, 0, e);
2584
2609
  }
2585
2610
  e.setParent(this), e.setMounted(this.mounted);
2586
2611
  const h = this.skipMutationNodes;
@@ -2606,7 +2631,7 @@ const V = class V extends w {
2606
2631
  t,
2607
2632
  !0
2608
2633
  );
2609
- return i === null ? (p.warn(
2634
+ return i === null ? (g.warn(
2610
2635
  "[Haori]",
2611
2636
  "Reference child not found in children.",
2612
2637
  t
@@ -2897,7 +2922,7 @@ const ee = class ee {
2897
2922
  */
2898
2923
  checkRawExpressions() {
2899
2924
  for (let e = 0; e < this.contents.length; e++)
2900
- this.contents[e].type === 2 && this.contents.length > 1 && (p.error(
2925
+ this.contents[e].type === 2 && this.contents.length > 1 && (g.error(
2901
2926
  "[Haori]",
2902
2927
  "Raw expressions are not allowed in multi-content expressions."
2903
2928
  ), this.contents[e].type = 1);
@@ -2953,7 +2978,7 @@ const ee = class ee {
2953
2978
  } else
2954
2979
  s.push(c.text);
2955
2980
  } catch (d) {
2956
- p.error(
2981
+ g.error(
2957
2982
  "[Haori]",
2958
2983
  `Error evaluating ${i} expression: ${c.text}`,
2959
2984
  d
@@ -3016,7 +3041,7 @@ const te = class te extends j {
3016
3041
  (i) => this.forceEvaluation && i.type === 0 || i.type === 1 || i.type === 2,
3017
3042
  "attribute"
3018
3043
  );
3019
- return this.forceEvaluation && r.results.length > 1 ? (p.error(
3044
+ return this.forceEvaluation && r.results.length > 1 ? (g.error(
3020
3045
  "[Haori]",
3021
3046
  "each or if expressions must have a single content.",
3022
3047
  r.results
@@ -3502,7 +3527,7 @@ const f = class f {
3502
3527
  const m = document.body.querySelector(y);
3503
3528
  m !== null ? r.formFragment = S.getFormFragment(
3504
3529
  w.get(m)
3505
- ) : p.error(
3530
+ ) : g.error(
3506
3531
  "Haori",
3507
3532
  `Form element not found: ${y} (${f.attrName(t, "form")})`
3508
3533
  );
@@ -3523,7 +3548,7 @@ ${y}
3523
3548
  `
3524
3549
  );
3525
3550
  } catch (m) {
3526
- p.error("Haori", `Invalid before script: ${m}`);
3551
+ g.error("Haori", `Invalid before script: ${m}`);
3527
3552
  }
3528
3553
  }
3529
3554
  const b = f.attrName(t, "run");
@@ -3538,7 +3563,7 @@ ${y}
3538
3563
  `
3539
3564
  );
3540
3565
  } catch (m) {
3541
- p.error("Haori", `Invalid run script: ${m}`);
3566
+ g.error("Haori", `Invalid run script: ${m}`);
3542
3567
  }
3543
3568
  }
3544
3569
  }
@@ -3572,7 +3597,7 @@ ${y}
3572
3597
  try {
3573
3598
  n.headers = P.parseDataBind(y);
3574
3599
  } catch (m) {
3575
- p.error("Haori", `Invalid fetch headers: ${m}`);
3600
+ g.error("Haori", `Invalid fetch headers: ${m}`);
3576
3601
  }
3577
3602
  }
3578
3603
  } else {
@@ -3588,7 +3613,7 @@ ${y}
3588
3613
  try {
3589
3614
  n.headers = P.parseDataBind(y);
3590
3615
  } catch (m) {
3591
- p.error("Haori", `Invalid fetch headers: ${m}`);
3616
+ g.error("Haori", `Invalid fetch headers: ${m}`);
3592
3617
  }
3593
3618
  }
3594
3619
  }
@@ -3642,7 +3667,7 @@ ${y}
3642
3667
  y.length > 0 ? (r.bindFragments = [], y.forEach((m) => {
3643
3668
  const A = w.get(m);
3644
3669
  A && r.bindFragments.push(A);
3645
- })) : p.error(
3670
+ })) : g.error(
3646
3671
  "Haori",
3647
3672
  `Bind element not found: ${b} (${a})`
3648
3673
  );
@@ -3665,9 +3690,9 @@ ${y}
3665
3690
  const b = e.getRawAttribute(h);
3666
3691
  r.bindParams = b.split("&").map((y) => y.trim());
3667
3692
  }
3668
- const g = t ? f.attrName(t, "bind-append") : f.attrName(null, "bind-append", !0);
3669
- if (e.hasAttribute(g)) {
3670
- const b = e.getRawAttribute(g);
3693
+ const p = t ? f.attrName(t, "bind-append") : f.attrName(null, "bind-append", !0);
3694
+ if (e.hasAttribute(p)) {
3695
+ const b = e.getRawAttribute(p);
3671
3696
  r.bindAppendParams = b.split("&").map((y) => y.trim()).filter(Boolean);
3672
3697
  }
3673
3698
  const v = t ? f.attrName(t, "bind-merge") : f.attrName(null, "bind-merge", !0);
@@ -3687,7 +3712,7 @@ ${y}
3687
3712
  A.length > 0 ? (r.adjustFragments = [], A.forEach((F) => {
3688
3713
  const M = w.get(F);
3689
3714
  M && r.adjustFragments.push(M);
3690
- })) : p.error(
3715
+ })) : g.error(
3691
3716
  "Haori",
3692
3717
  `Adjust element not found: ${m} (${f.attrName(t, "adjust")})`
3693
3718
  );
@@ -3712,7 +3737,7 @@ ${m}
3712
3737
  `
3713
3738
  );
3714
3739
  } catch (A) {
3715
- p.error("Haori", `Invalid after script: ${A}`);
3740
+ g.error("Haori", `Invalid after script: ${A}`);
3716
3741
  }
3717
3742
  }
3718
3743
  if (e.hasAttribute(f.attrName(t, "dialog")) && (r.dialogMessage = e.getAttribute(f.attrName(t, "dialog")).replace(/\\n/g, `
@@ -3739,7 +3764,7 @@ ${m}
3739
3764
  const A = document.body.querySelector(m);
3740
3765
  A !== null ? r.historyFormFragment = S.getFormFragment(
3741
3766
  w.get(A)
3742
- ) : p.error(
3767
+ ) : g.error(
3743
3768
  "Haori",
3744
3769
  `Form element not found: ${m} (${f.attrName(t, "history-form")})`
3745
3770
  );
@@ -3760,9 +3785,9 @@ ${m}
3760
3785
  return;
3761
3786
  const F = e.getRawAttribute(A), M = [];
3762
3787
  if (F ? (document.body.querySelectorAll(F).forEach(($) => {
3763
- const K = w.get($);
3764
- K && M.push(K);
3765
- }), M.length === 0 && p.error("Haori", `Element not found: ${F} (${A})`)) : M.push(e), M.length > 0)
3788
+ const z = w.get($);
3789
+ z && M.push(z);
3790
+ }), M.length === 0 && g.error("Haori", `Element not found: ${F} (${A})`)) : M.push(e), M.length > 0)
3766
3791
  switch (m) {
3767
3792
  case "reset-before":
3768
3793
  r.resetBeforeFragments = M;
@@ -3796,12 +3821,12 @@ ${m}
3796
3821
  const A = document.body.querySelector(m);
3797
3822
  if (A !== null) {
3798
3823
  const F = w.get(A);
3799
- F ? r.copySourceFragment = F : p.error(
3824
+ F ? r.copySourceFragment = F : g.error(
3800
3825
  "Haori",
3801
3826
  `Element is not managed by Haori: ${m} (${y})`
3802
3827
  );
3803
3828
  } else
3804
- p.error(
3829
+ g.error(
3805
3830
  "Haori",
3806
3831
  `Element not found: ${m} (${y})`
3807
3832
  );
@@ -3817,7 +3842,7 @@ ${m}
3817
3842
  const y = document.body.querySelector(b);
3818
3843
  y !== null ? r.formFragment = S.getFormFragment(
3819
3844
  w.get(y)
3820
- ) : p.error(
3845
+ ) : g.error(
3821
3846
  "Haori",
3822
3847
  `Form element not found: ${b} (${f.attrName(null, "fetch-form", !0)})`
3823
3848
  );
@@ -3894,7 +3919,7 @@ ${m}
3894
3919
  this.domEvent
3895
3920
  ) === !1 && this.domEvent && this.domEvent.preventDefault();
3896
3921
  } catch (h) {
3897
- p.error("Haori", `Run script execution error: ${h}`);
3922
+ g.error("Haori", `Run script execution error: ${h}`);
3898
3923
  }
3899
3924
  }
3900
3925
  if (!await this.confirm())
@@ -3919,11 +3944,11 @@ ${m}
3919
3944
  }
3920
3945
  const a = Object.keys(i).length > 0;
3921
3946
  if (s) {
3922
- const d = { ...n || {} }, h = r.requestedMethod, g = r.effectiveMethod, v = r.transportMode === "query-get", T = r.queryString;
3923
- if (v && p.info("Haori demo fetch normalization", {
3947
+ const d = { ...n || {} }, h = r.requestedMethod, p = r.effectiveMethod, v = r.transportMode === "query-get", T = r.queryString;
3948
+ if (v && g.info("Haori demo fetch normalization", {
3924
3949
  runtime: l.runtime,
3925
3950
  requestedMethod: h,
3926
- effectiveMethod: g,
3951
+ effectiveMethod: p,
3927
3952
  transportMode: "query-get",
3928
3953
  url: s,
3929
3954
  payload: a ? i : void 0,
@@ -3932,7 +3957,7 @@ ${m}
3932
3957
  const b = performance.now(), y = {
3933
3958
  runtime: l.runtime,
3934
3959
  requestedMethod: h,
3935
- effectiveMethod: g,
3960
+ effectiveMethod: p,
3936
3961
  transportMode: v ? "query-get" : "http",
3937
3962
  ...v ? { queryString: T } : {}
3938
3963
  };
@@ -3957,10 +3982,10 @@ ${m}
3957
3982
  return fetch(s, d).then((b) => this.handleFetchResult(b, s || void 0));
3958
3983
  }
3959
3984
  if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && a) {
3960
- const d = this.options.formFragment, h = d.getTarget(), g = /* @__PURE__ */ new Set();
3961
- e && e.appliedDisabledAttribute && this.options.targetFragment && g.add(this.options.targetFragment), h.setAttribute(`${l.prefix}bind`, JSON.stringify(i));
3985
+ const d = this.options.formFragment, h = d.getTarget(), p = /* @__PURE__ */ new Set();
3986
+ e && e.appliedDisabledAttribute && this.options.targetFragment && p.add(this.options.targetFragment), h.setAttribute(`${l.prefix}bind`, JSON.stringify(i));
3962
3987
  const v = d.getBindingData();
3963
- Object.assign(v, i), await P.setBindingData(h, v, g);
3988
+ Object.assign(v, i), await P.setBindingData(h, v, p);
3964
3989
  }
3965
3990
  const o = a ? i : {}, c = new Response(JSON.stringify(o), {
3966
3991
  headers: { "Content-Type": "application/json" }
@@ -4041,10 +4066,10 @@ ${m}
4041
4066
  }
4042
4067
  return this.options.openFragments && this.options.openFragments.length > 0 && this.options.openFragments.forEach((a) => {
4043
4068
  const o = a.getTarget();
4044
- o instanceof HTMLElement ? n.push(i.openDialog(o)) : p.error("Haori", "Element is not an HTML element: ", o);
4069
+ o instanceof HTMLElement ? n.push(i.openDialog(o)) : g.error("Haori", "Element is not an HTML element: ", o);
4045
4070
  }), this.options.closeFragments && this.options.closeFragments.length > 0 && this.options.closeFragments.forEach((a) => {
4046
4071
  const o = a.getTarget();
4047
- o instanceof HTMLElement ? n.push(i.closeDialog(o)) : p.error("Haori", "Element is not an HTML element: ", o);
4072
+ o instanceof HTMLElement ? n.push(i.closeDialog(o)) : g.error("Haori", "Element is not an HTML element: ", o);
4048
4073
  }), await Promise.all(n), this.options.dialogMessage && await i.dialog(this.options.dialogMessage), this.options.toastMessage && await i.toast(
4049
4074
  this.options.toastMessage,
4050
4075
  this.options.toastLevel ?? "info"
@@ -4064,12 +4089,12 @@ ${m}
4064
4089
  const n = e ? this.options.historyUrl : window.location.pathname, a = new URL(n, window.location.href);
4065
4090
  if (a.origin !== window.location.origin) {
4066
4091
  const c = "history.pushState: cross-origin URL is not allowed: " + a.toString();
4067
- p.error("Haori", c);
4092
+ g.error("Haori", c);
4068
4093
  return;
4069
4094
  }
4070
4095
  const o = (c) => {
4071
4096
  for (const [d, h] of Object.entries(c))
4072
- h != null && (Array.isArray(h) ? h.forEach((g) => a.searchParams.append(d, String(g))) : typeof h == "object" ? a.searchParams.set(d, JSON.stringify(h)) : a.searchParams.set(d, String(h)));
4097
+ h != null && (Array.isArray(h) ? h.forEach((p) => a.searchParams.append(d, String(p))) : typeof h == "object" ? a.searchParams.set(d, JSON.stringify(h)) : a.searchParams.set(d, String(h)));
4073
4098
  };
4074
4099
  i && o(t), s && o(r), history.pushState(
4075
4100
  { [we]: !0 },
@@ -4077,7 +4102,7 @@ ${m}
4077
4102
  a.toString()
4078
4103
  );
4079
4104
  } catch (n) {
4080
- p.error("Haori", `history.pushState failed: ${n}`);
4105
+ g.error("Haori", `history.pushState failed: ${n}`);
4081
4106
  }
4082
4107
  }
4083
4108
  /**
@@ -4205,7 +4230,7 @@ ${m}
4205
4230
  });
4206
4231
  else {
4207
4232
  if (typeof r == "string")
4208
- return p.error("Haori", "string data cannot be bound without a bindArg."), Promise.reject(
4233
+ return g.error("Haori", "string data cannot be bound without a bindArg."), Promise.reject(
4209
4234
  new Error("string data cannot be bound without a bindArg.")
4210
4235
  );
4211
4236
  this.options.bindFragments.forEach((s) => {
@@ -4324,15 +4349,15 @@ ${m}
4324
4349
  const h = n.get("Content-Type") || "";
4325
4350
  if (/multipart\/form-data/i.test(h)) {
4326
4351
  n.delete("Content-Type");
4327
- const g = new FormData();
4352
+ const p = new FormData();
4328
4353
  for (const [v, T] of Object.entries(t))
4329
- T == null ? g.append(v, "") : T instanceof Blob ? g.append(v, T) : Array.isArray(T) ? T.forEach((b) => g.append(v, String(b))) : typeof T == "object" ? g.append(v, JSON.stringify(T)) : g.append(v, String(T));
4330
- s.body = g;
4354
+ T == null ? p.append(v, "") : T instanceof Blob ? p.append(v, T) : Array.isArray(T) ? T.forEach((b) => p.append(v, String(b))) : typeof T == "object" ? p.append(v, JSON.stringify(T)) : p.append(v, String(T));
4355
+ s.body = p;
4331
4356
  } else if (/application\/x-www-form-urlencoded/i.test(h)) {
4332
- const g = new URLSearchParams();
4357
+ const p = new URLSearchParams();
4333
4358
  for (const [v, T] of Object.entries(t))
4334
- T !== void 0 && (T === null ? g.append(v, "") : Array.isArray(T) ? T.forEach((b) => g.append(v, String(b))) : typeof T == "object" ? g.append(v, JSON.stringify(T)) : g.append(v, String(T)));
4335
- s.body = g;
4359
+ T !== void 0 && (T === null ? p.append(v, "") : Array.isArray(T) ? T.forEach((b) => p.append(v, String(b))) : typeof T == "object" ? p.append(v, JSON.stringify(T)) : p.append(v, String(T)));
4360
+ s.body = p;
4336
4361
  } else
4337
4362
  n.set("Content-Type", "application/json"), s.body = JSON.stringify(t);
4338
4363
  }
@@ -4427,11 +4452,11 @@ ${m}
4427
4452
  */
4428
4453
  getRowFragment() {
4429
4454
  if (!this.options.targetFragment)
4430
- return p.error("Haori", "Target fragment is not specified for row operation."), null;
4455
+ return g.error("Haori", "Target fragment is not specified for row operation."), null;
4431
4456
  const e = this.options.targetFragment.closestByAttribute(
4432
4457
  `${l.prefix}row`
4433
4458
  );
4434
- return e || (p.error("Haori", "Row fragment not found."), null);
4459
+ return e || (g.error("Haori", "Row fragment not found."), null);
4435
4460
  }
4436
4461
  /**
4437
4462
  * 行を追加します。
@@ -4532,23 +4557,23 @@ class Ie {
4532
4557
  try {
4533
4558
  r = await fetch(e, t);
4534
4559
  } catch (s) {
4535
- throw p.error("[Haori]", "Failed to fetch import source:", e, s), new Error(`Failed to fetch: ${e}`);
4560
+ throw g.error("[Haori]", "Failed to fetch import source:", e, s), new Error(`Failed to fetch: ${e}`);
4536
4561
  }
4537
4562
  if (!r.ok) {
4538
4563
  const s = `${r.status} ${r.statusText}`;
4539
- throw p.error("[Haori]", "Import HTTP error:", e, s), new Error(`Failed to load ${e}: ${s}`);
4564
+ throw g.error("[Haori]", "Import HTTP error:", e, s), new Error(`Failed to load ${e}: ${s}`);
4540
4565
  }
4541
4566
  let i;
4542
4567
  try {
4543
4568
  i = await r.text();
4544
4569
  } catch (s) {
4545
- throw p.error("[Haori]", "Failed to read response text:", e, s), new Error(`Failed to read response from: ${e}`);
4570
+ throw g.error("[Haori]", "Failed to read response text:", e, s), new Error(`Failed to read response from: ${e}`);
4546
4571
  }
4547
4572
  try {
4548
4573
  const n = new DOMParser().parseFromString(i, "text/html");
4549
- return n && n.body ? n.body.innerHTML : (p.warn("[Haori]", "No body found in imported document:", e), i);
4574
+ return n && n.body ? n.body.innerHTML : (g.warn("[Haori]", "No body found in imported document:", e), i);
4550
4575
  } catch (s) {
4551
- return p.error("[Haori]", "Failed to parse imported HTML:", e, s), i;
4576
+ return g.error("[Haori]", "Failed to parse imported HTML:", e, s), i;
4552
4577
  }
4553
4578
  }
4554
4579
  }
@@ -4738,7 +4763,7 @@ const u = class u {
4738
4763
  }
4739
4764
  });
4740
4765
  }).catch((a) => {
4741
- t.removeAttribute(`${l.prefix}importing`), R.importError(t, s, a), p.error("[Haori]", "Failed to import HTML:", s, a);
4766
+ t.removeAttribute(`${l.prefix}importing`), R.importError(t, s, a), g.error("[Haori]", "Failed to import HTML:", s, a);
4742
4767
  }).finally(() => {
4743
4768
  if (r.running = !1, r.rerunRequested)
4744
4769
  return r.rerunRequested = !1, u.executeManagedImport(e);
@@ -4921,8 +4946,8 @@ const u = class u {
4921
4946
  if (d === null)
4922
4947
  a.push(u.setBindingData(e, h));
4923
4948
  else {
4924
- const g = s.getRawBindingData() || {};
4925
- g[String(d)] = h, a.push(u.setBindingData(e, g));
4949
+ const p = s.getRawBindingData() || {};
4950
+ p[String(d)] = h, a.push(u.setBindingData(e, p));
4926
4951
  }
4927
4952
  break;
4928
4953
  }
@@ -4982,20 +5007,20 @@ const u = class u {
4982
5007
  const r = t.getBindingData(), i = {}, s = (c) => {
4983
5008
  const d = c.getTarget();
4984
5009
  return d.id ? `#${d.id}` : d.tagName.toLowerCase();
4985
- }, n = (c, d, h, g) => {
5010
+ }, n = (c, d, h, p) => {
4986
5011
  if (c)
4987
5012
  for (const v of Object.keys(c))
4988
5013
  v in i || (i[v] = {
4989
5014
  value: c[v],
4990
5015
  source: s(d),
4991
5016
  kind: h,
4992
- depth: g
5017
+ depth: p
4993
5018
  });
4994
5019
  };
4995
5020
  let a = t, o = 0;
4996
5021
  for (; a; )
4997
5022
  a !== t && n(a.getRawDerivedBindingData(), a, "derive", o), n(a.getRawBindingData(), a, "bind", o), a = a.getParent(), o += 1;
4998
- return B.isEnabled() && p.info("[Haori]", "scope dump for", e, { resolved: r, sources: i }), { resolved: r, sources: i };
5023
+ return B.isEnabled() && g.info("[Haori]", "scope dump for", e, { resolved: r, sources: i }), { resolved: r, sources: i };
4999
5024
  }
5000
5025
  /**
5001
5026
  * data-bind 属性の値をパースします。
@@ -5008,7 +5033,7 @@ const u = class u {
5008
5033
  try {
5009
5034
  return JSON.parse(e);
5010
5035
  } catch (t) {
5011
- return p.error("[Haori]", "Invalid JSON in data-bind:", t), {};
5036
+ return g.error("[Haori]", "Invalid JSON in data-bind:", t), {};
5012
5037
  }
5013
5038
  else {
5014
5039
  const t = new URLSearchParams(e), r = {};
@@ -5102,22 +5127,22 @@ const u = class u {
5102
5127
  const i = e.hasAttribute(`${l.prefix}derive`), s = e.hasAttribute(`${l.prefix}if`), n = e.hasAttribute(`${l.prefix}each`), a = e.getRawAttribute(`${l.prefix}derive`), o = e.getRawAttribute(`${l.prefix}derive-name`);
5103
5128
  let c = !1, d = !1, h = null;
5104
5129
  if (!i && e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), !i && e.getDeriveInputSignature() !== null && e.setDeriveInputSignature(null), i) {
5105
- const g = u.createDeriveInputSignature(
5130
+ const p = u.createDeriveInputSignature(
5106
5131
  e,
5107
5132
  a,
5108
5133
  o
5109
5134
  );
5110
- g === null ? (e.getDeriveInputSignature() !== null && e.setDeriveInputSignature(null), r = r.then(
5135
+ p === null ? (e.getDeriveInputSignature() !== null && e.setDeriveInputSignature(null), r = r.then(
5111
5136
  () => u.evaluateDerive(e, a, o).then(
5112
5137
  () => {
5113
5138
  }
5114
5139
  )
5115
- )) : e.getDeriveInputSignature() !== g && (r = r.then(() => u.evaluateDerive(
5140
+ )) : e.getDeriveInputSignature() !== p && (r = r.then(() => u.evaluateDerive(
5116
5141
  e,
5117
5142
  a,
5118
5143
  o
5119
5144
  ).then(() => {
5120
- e.setDeriveInputSignature(g);
5145
+ e.setDeriveInputSignature(p);
5121
5146
  })));
5122
5147
  }
5123
5148
  return s && (r = r.then(() => u.evaluateIf(e))), n ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => u.evaluateEach(e))) : s ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => {
@@ -5136,14 +5161,14 @@ const u = class u {
5136
5161
  })), r.then(() => {
5137
5162
  if (c)
5138
5163
  return;
5139
- const g = [];
5164
+ const p = [];
5140
5165
  return e.getChildren().forEach((v) => {
5141
5166
  if (v instanceof C) {
5142
5167
  if (u.canSkipUnchangedNestedEach(v))
5143
5168
  return;
5144
- g.push(u.evaluateAll(v, t));
5145
- } else v instanceof L && g.push(u.evaluateText(v));
5146
- }), Promise.all(g).then(() => {
5169
+ p.push(u.evaluateAll(v, t));
5170
+ } else v instanceof L && p.push(u.evaluateText(v));
5171
+ }), Promise.all(p).then(() => {
5147
5172
  });
5148
5173
  }).then(() => {
5149
5174
  d && h !== null && e.setDeriveSubtreeSignature(h);
@@ -5221,7 +5246,7 @@ const u = class u {
5221
5246
  const a = {};
5222
5247
  i.forEach((o) => {
5223
5248
  o in r && (a[o] = r[o]);
5224
- }), p.info(
5249
+ }), g.info(
5225
5250
  "[Haori]",
5226
5251
  "data-if is falsy (hidden):",
5227
5252
  t,
@@ -5273,7 +5298,7 @@ const u = class u {
5273
5298
  static triggerLoadOnShow(e) {
5274
5299
  const t = `${l.prefix}load-`;
5275
5300
  e.getTarget().getAttributeNames().some((i) => i.startsWith(t)) && new q(e, "load").run().catch((i) => {
5276
- p.error("[Haori]", "data-load procedure error (on show):", i);
5301
+ g.error("[Haori]", "data-load procedure error (on show):", i);
5277
5302
  });
5278
5303
  }
5279
5304
  /**
@@ -5382,7 +5407,7 @@ const u = class u {
5382
5407
  */
5383
5408
  static resolveEachItems(e) {
5384
5409
  const t = e.getAttributeEvaluation(`${l.prefix}each`), r = t?.value;
5385
- return t?.hasUnresolvedReference || r === !1 || r === null || r === void 0 ? [] : Array.isArray(r) ? r : (p.error("[Haori]", "Invalid each attribute:", r), null);
5410
+ return t?.hasUnresolvedReference || r === !1 || r === null || r === void 0 ? [] : Array.isArray(r) ? r : (g.error("[Haori]", "Invalid each attribute:", r), null);
5386
5411
  }
5387
5412
  /**
5388
5413
  * nested data-each の入力が同値で、要素自身に他の動的要素が無い場合は
@@ -5540,7 +5565,7 @@ const u = class u {
5540
5565
  */
5541
5566
  static logDerivedSubtreeProfileSnapshot(e, t) {
5542
5567
  const r = u.getOrCreateDerivedSubtreeProfile(e);
5543
- r !== null && (t === "skip-hit" ? r.skipHitCount += 1 : t === "skip-miss" ? r.skipMissCount += 1 : t === "skip-ineligible" && (r.skipIneligibleCount += 1), p.info("[Haori][derive-profile]", {
5568
+ r !== null && (t === "skip-hit" ? r.skipHitCount += 1 : t === "skip-miss" ? r.skipMissCount += 1 : t === "skip-ineligible" && (r.skipIneligibleCount += 1), g.info("[Haori][derive-profile]", {
5544
5569
  reason: t,
5545
5570
  hostId: r.hostId,
5546
5571
  signatureComputeTotal: r.signatureComputeTotal,
@@ -5607,7 +5632,7 @@ const u = class u {
5607
5632
  static updateDiff(e, t) {
5608
5633
  const r = e.getTemplate();
5609
5634
  if (r === null)
5610
- return p.error("[Haori]", "Template is not set for each element."), Promise.resolve();
5635
+ return g.error("[Haori]", "Template is not set for each element."), Promise.resolve();
5611
5636
  let i = e.getAttribute(`${l.prefix}each-index`);
5612
5637
  i && (i = String(i));
5613
5638
  const s = e.getAttribute(`${l.prefix}each-key`), n = e.getAttribute(`${l.prefix}each-arg`), a = /* @__PURE__ */ new Map(), o = [];
@@ -5623,7 +5648,7 @@ const u = class u {
5623
5648
  let h = e.getChildren().filter((A) => A instanceof C).filter(
5624
5649
  (A) => !A.hasAttribute(`${l.prefix}each-before`) && !A.hasAttribute(`${l.prefix}each-after`)
5625
5650
  );
5626
- const g = h.map((A) => A.getListKey());
5651
+ const p = h.map((A) => A.getListKey());
5627
5652
  h = h.filter((A) => c.has(String(A.getListKey())) ? !0 : (d.push(A.remove()), !1));
5628
5653
  const v = h.map((A) => A.getListKey()), T = /* @__PURE__ */ new Map();
5629
5654
  h.forEach((A) => {
@@ -5637,9 +5662,9 @@ const u = class u {
5637
5662
  return o.forEach((A, F) => {
5638
5663
  const { item: M, itemIndex: U } = a.get(A);
5639
5664
  let $;
5640
- const K = T.get(A);
5641
- if (K)
5642
- $ = K, m = m.then(
5665
+ const z = T.get(A);
5666
+ if (z)
5667
+ $ = z, m = m.then(
5643
5668
  () => u.updateRowFragment(
5644
5669
  $,
5645
5670
  M,
@@ -5676,7 +5701,7 @@ const u = class u {
5676
5701
  (k) => k !== null
5677
5702
  ), F = v.filter(
5678
5703
  (k) => k !== null
5679
- ), M = new Set(F), U = A.filter((k) => !M.has(k)), K = g.filter(
5704
+ ), M = new Set(F), U = A.filter((k) => !M.has(k)), z = p.filter(
5680
5705
  (k) => k !== null
5681
5706
  ).filter(
5682
5707
  (k) => !c.has(k)
@@ -5684,7 +5709,7 @@ const u = class u {
5684
5709
  R.eachUpdate(
5685
5710
  e.getTarget(),
5686
5711
  U,
5687
- K,
5712
+ z,
5688
5713
  A
5689
5714
  );
5690
5715
  });
@@ -5731,7 +5756,7 @@ const u = class u {
5731
5756
  [s]: t
5732
5757
  }, r && (a[r] = i);
5733
5758
  else
5734
- return p.error(
5759
+ return g.error(
5735
5760
  "[Haori]",
5736
5761
  `Primitive value requires '${l.prefix}each-arg' attribute: ${t}`
5737
5762
  ), Promise.resolve(!1);
@@ -5881,17 +5906,17 @@ const re = class re {
5881
5906
  const r = this.getElementFromTarget(e.target, t);
5882
5907
  if (!r)
5883
5908
  return;
5884
- r.hasAttribute(`data-${t}-prevent`) && e.preventDefault();
5909
+ r.hasAttribute(`${l.prefix}${t}-prevent`) && e.preventDefault();
5885
5910
  const i = w.get(r);
5886
5911
  if (!i)
5887
5912
  return;
5888
5913
  t === "change" && i instanceof C && i.syncValue();
5889
5914
  const s = () => {
5890
5915
  new q(i, t, e).run().catch((n) => {
5891
- p.error("[Haori]", "Procedure execution error:", n);
5916
+ g.error("[Haori]", "Procedure execution error:", n);
5892
5917
  });
5893
5918
  };
5894
- if (t === "click" && r.hasAttribute("data-click-defer")) {
5919
+ if (t === "click" && r.hasAttribute(`${l.prefix}click-defer`)) {
5895
5920
  typeof requestAnimationFrame < "u" ? requestAnimationFrame(() => s()) : setTimeout(s, 0);
5896
5921
  return;
5897
5922
  }
@@ -5924,7 +5949,8 @@ const re = class re {
5924
5949
  findClickableElement(e) {
5925
5950
  let t = e;
5926
5951
  for (; t; ) {
5927
- if (t.getAttributeNames().some((r) => r.startsWith("data-click-")))
5952
+ const r = `${l.prefix}click-`;
5953
+ if (t.getAttributeNames().some((i) => i.startsWith(r)))
5928
5954
  return t;
5929
5955
  t = t.parentElement;
5930
5956
  }
@@ -5972,17 +5998,17 @@ const D = class D {
5972
5998
  (c) => {
5973
5999
  const d = D.registrations.get(e);
5974
6000
  d && c.forEach((h) => {
5975
- !h.isIntersecting || d.running || D.isDisabled(d.fragment) || (d.running = !0, new q(d.fragment, "intersect").runWithResult().then((g) => {
5976
- g && d.once && (d.observer.disconnect(), D.registrations.delete(e));
5977
- }).catch((g) => {
5978
- p.error(
6001
+ !h.isIntersecting || d.running || D.isDisabled(d.fragment) || (d.running = !0, new q(d.fragment, "intersect").runWithResult().then((p) => {
6002
+ p && d.once && (d.observer.disconnect(), D.registrations.delete(e));
6003
+ }).catch((p) => {
6004
+ g.error(
5979
6005
  "[Haori]",
5980
6006
  "Intersect procedure execution error:",
5981
- g
6007
+ p
5982
6008
  );
5983
6009
  }).finally(() => {
5984
- const g = D.registrations.get(e);
5985
- g && (g.running = !1);
6010
+ const p = D.registrations.get(e);
6011
+ p && (p.running = !1);
5986
6012
  }));
5987
6013
  });
5988
6014
  },
@@ -6030,7 +6056,7 @@ const D = class D {
6030
6056
  if (typeof r != "string" || r.trim() === "")
6031
6057
  return null;
6032
6058
  const i = document.querySelector(r);
6033
- return D.isHtmlElement(i) ? i : (p.error("[Haori]", `Intersect root element not found: ${r}`), null);
6059
+ return D.isHtmlElement(i) ? i : (g.error("[Haori]", `Intersect root element not found: ${r}`), null);
6034
6060
  }
6035
6061
  static resolveRootMargin(e) {
6036
6062
  const t = `${l.prefix}intersect-root-margin`, r = e.getAttribute(t);
@@ -6082,7 +6108,7 @@ const O = class O {
6082
6108
  P.scan(document.head),
6083
6109
  P.scan(document.body)
6084
6110
  ]), [t, r] = e;
6085
- t.status !== "fulfilled" && p.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && p.error("[Haori]", "Failed to build body fragment:", r.reason), await x.wait(), document.body.setAttribute("data-haori-ready", ""), O.observe(document.head), O.observe(document.body), new ae().start(), Y.syncTree(document.body);
6111
+ t.status !== "fulfilled" && g.error("[Haori]", "Failed to build head fragment:", t.reason), r.status !== "fulfilled" && g.error("[Haori]", "Failed to build body fragment:", r.reason), await x.wait(), document.body.setAttribute("data-haori-ready", ""), O.observe(document.head), O.observe(document.body), new ae().start(), Y.syncTree(document.body);
6086
6112
  }
6087
6113
  /**
6088
6114
  * 指定された要素を監視します。
@@ -6118,7 +6144,7 @@ const O = class O {
6118
6144
  break;
6119
6145
  }
6120
6146
  case "characterData": {
6121
- i.target instanceof Text || i.target instanceof Comment ? P.changeText(i.target, i.target.textContent) : p.warn(
6147
+ i.target instanceof Text || i.target instanceof Comment ? P.changeText(i.target, i.target.textContent) : g.warn(
6122
6148
  "[Haori]",
6123
6149
  "Unsupported character data type:",
6124
6150
  i.target
@@ -6126,11 +6152,11 @@ const O = class O {
6126
6152
  break;
6127
6153
  }
6128
6154
  default:
6129
- p.warn("[Haori]", "Unknown mutation type:", i.type);
6155
+ g.warn("[Haori]", "Unknown mutation type:", i.type);
6130
6156
  continue;
6131
6157
  }
6132
6158
  } catch (s) {
6133
- p.error("[Haori]", "Error processing mutation:", s);
6159
+ g.error("[Haori]", "Error processing mutation:", s);
6134
6160
  }
6135
6161
  });
6136
6162
  t.observe(e, {
@@ -6144,14 +6170,14 @@ const O = class O {
6144
6170
  O._initialized = !1, O._mutationObservers = [];
6145
6171
  let _ = O;
6146
6172
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", _.init) : _.init();
6147
- const Ce = () => X.waitForRenders(), ke = "0.13.1";
6173
+ const Ce = () => X.waitForRenders(), ke = "0.13.2";
6148
6174
  export {
6149
6175
  P as Core,
6150
6176
  l as Env,
6151
6177
  S as Form,
6152
6178
  w as Fragment,
6153
6179
  X as Haori,
6154
- p as Log,
6180
+ g as Log,
6155
6181
  x as Queue,
6156
6182
  X as default,
6157
6183
  ke as version,