@jboltai/tokui 0.2.0 → 0.2.1

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/tokui.mjs CHANGED
@@ -79,6 +79,22 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
79
79
  "popconfirm.trigger": "确认",
80
80
  "popconfirm.aria": "确认操作",
81
81
  "backToTop.aria": "回到顶部",
82
+ "anchor.aria": "锚点导航",
83
+ "tour.aria": "漫游引导",
84
+ "tour.prev": "上一步",
85
+ "tour.next": "下一步",
86
+ "tour.finish": "完成",
87
+ "tour.skip": "跳过",
88
+ "tour.stepCounter": "{cur} / {total}",
89
+ "modal.aria": "确认操作",
90
+ "colorPicker.aria": "选择颜色",
91
+ "colorPicker.hue": "色相",
92
+ "colorPicker.hex": "色值",
93
+ "colorPicker.clear": "清除",
94
+ "colorPicker.preset": "预设色板",
95
+ "previewGroup.aria": "图片预览组",
96
+ "editable.aria": "点击编辑",
97
+ "floatButton.aria": "浮动操作",
82
98
  "datepicker.title": "{y}年{m}月",
83
99
  "datepicker.weekday.0": "日",
84
100
  "datepicker.weekday.1": "一",
@@ -201,6 +217,22 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
201
217
  "popconfirm.trigger": "Confirm",
202
218
  "popconfirm.aria": "Confirm action",
203
219
  "backToTop.aria": "Back to top",
220
+ "anchor.aria": "Anchor navigation",
221
+ "tour.aria": "Tour guide",
222
+ "tour.prev": "Previous",
223
+ "tour.next": "Next",
224
+ "tour.finish": "Finish",
225
+ "tour.skip": "Skip",
226
+ "tour.stepCounter": "{cur} / {total}",
227
+ "modal.aria": "Confirm action",
228
+ "colorPicker.aria": "Pick a color",
229
+ "colorPicker.hue": "Hue",
230
+ "colorPicker.hex": "Hex value",
231
+ "colorPicker.clear": "Clear",
232
+ "colorPicker.preset": "Preset colors",
233
+ "previewGroup.aria": "Image preview group",
234
+ "editable.aria": "Click to edit",
235
+ "floatButton.aria": "Floating actions",
204
236
  "datepicker.title": "{m}/{y}",
205
237
  "datepicker.weekday.0": "Sun",
206
238
  "datepicker.weekday.1": "Mon",
@@ -486,9 +518,13 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
486
518
  }
487
519
  var S = {
488
520
  generatePalette: b,
489
- generateThemeTokens: x
521
+ generateThemeTokens: x,
522
+ hexToRgb: n,
523
+ rgbToHex: r,
524
+ rgbToHsv: i,
525
+ hsvToRgb: a
490
526
  };
491
- typeof window < "u" && (window.TokUI = window.TokUI || {}, window.TokUI._internal = window.TokUI._internal || {}, window.TokUI._internal.generatePalette = b, window.TokUI._internal.generateThemeTokens = x, window.TokUI._internal.ColorGenerator = S), t !== void 0 && t.exports && (t.exports = S);
527
+ typeof window < "u" && (window.TokUI = window.TokUI || {}, window.TokUI._internal = window.TokUI._internal || {}, window.TokUI._internal.generatePalette = b, window.TokUI._internal.generateThemeTokens = x, window.TokUI._internal.ColorGenerator = S, window.TokUI._internal.hexToRgb = n, window.TokUI._internal.rgbToHex = r, window.TokUI._internal.rgbToHsv = i, window.TokUI._internal.hsvToRgb = a), t !== void 0 && t.exports && (t.exports = S);
492
528
  })), p = /* @__PURE__ */ o(((e, t) => {
493
529
  var n = {
494
530
  container: null,
@@ -551,14 +587,14 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
551
587
  }
552
588
  return -1;
553
589
  }
554
- var i = new Set(/* @__PURE__ */ "form.table.thead.tbody.card.ft.row.col.list.select.radio.checkbox.code.imgs.md.textarea.tabs.tab.accordion.collapse.dialog.btngroup.picker.timeline.steps.drawer.ol.ul.i.item.think.think-chain.think-step.bubble.toolbar.badge-box.dropdown.transfer.callout.cascader.tree.tn.desc.carousel.popover.input-tag.watermark.menu.print-area.chat-input.msg-actions.tool-call.diff.quick-reply.plan.file-tree.ft-folder.terminal.sandbox.test-result.quote.toggle-group.conversations.welcome.welcome-feature.suggestions.attachments.artifact.artifact-code.artifact-preview.scroll-area.sidebar.sidebar-content.sidebar-footer.command.command-group.hover-card.hover-trigger.hover-content.resizable.canvas.canvas-content.chart.ins.katex.mermaid.p".split("."));
590
+ var i = new Set(/* @__PURE__ */ "form.table.thead.tbody.card.ft.row.col.list.select.radio.checkbox.code.imgs.md.textarea.tabs.tab.accordion.collapse.dialog.btngroup.picker.timeline.steps.drawer.ol.ul.i.item.think.think-chain.think-step.bubble.toolbar.badge-box.dropdown.transfer.callout.cascader.tree.tn.desc.carousel.popover.input-tag.watermark.menu.print-area.chat-input.msg-actions.tool-call.diff.quick-reply.plan.file-tree.ft-folder.terminal.sandbox.test-result.quote.toggle-group.conversations.welcome.welcome-feature.suggestions.attachments.artifact.artifact-code.artifact-preview.scroll-area.sidebar.sidebar-content.sidebar-footer.command.command-group.hover-card.hover-trigger.hover-content.resizable.canvas.canvas-content.chart.ins.katex.mermaid.p.tour.affix.preview-group.segmented.anchor.float-button.masonry".split("."));
555
591
  function a(e) {
556
592
  if (!e || e.type !== "chart") return !1;
557
593
  var t = e.attrs || {};
558
594
  return !!(t.d || t.tasks || t.rows || t.nodes && t.flows || t.v !== void 0 && (t.t === "gauge" || t.t === "progress"));
559
595
  }
560
596
  function o(e) {
561
- return e.type !== "radio" && e.type !== "select" && e.type !== "checkbox" ? !1 : !!(e.attrs && e.attrs.opt);
597
+ return e.type !== "radio" && e.type !== "select" && e.type !== "checkbox" && e.type !== "segmented" && e.type !== "anchor" ? !1 : !!(e.attrs && e.attrs.opt);
562
598
  }
563
599
  function s(e) {
564
600
  return e.type === "checkbox" && (e.attrs ? e.attrs.multi : void 0) === void 0 && !o(e);
@@ -586,8 +622,9 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
586
622
  "em",
587
623
  "mark",
588
624
  "sub",
589
- "sup"
590
- ]), d = new Set(/* @__PURE__ */ "stripe.dis.ro.req.chk.multi.disabled.readonly.required.checked.multiple.striped.auto.plain.round.closable.bordered.open.pill.dot.leaf.inline.rounded.container.copy.regenerate.like.dislike.visible.delete.controls.open.active.collapsible.toggle.search.thumb.reset.print.show-total.live.approval.streaming.range.half.sortable.filter.virtual.lazy.pagination".split(".")), f = null;
625
+ "sup",
626
+ "kbd"
627
+ ]), d = new Set(/* @__PURE__ */ "stripe.dis.ro.req.chk.multi.disabled.readonly.required.checked.multiple.striped.auto.plain.round.closable.bordered.open.pill.dot.leaf.inline.rounded.container.copy.regenerate.like.dislike.visible.delete.controls.open.active.collapsible.toggle.search.thumb.reset.print.show-total.live.approval.streaming.range.half.sortable.filter.virtual.lazy.pagination.mask".split(".")), f = null;
591
628
  function p(e) {
592
629
  f = e;
593
630
  }
@@ -599,7 +636,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
599
636
  }
600
637
  return null;
601
638
  }
602
- var h = new Set(/* @__PURE__ */ "t.l.tx.tt.ph.u.s.n.v.w.h.clk.sub.act.mtd.dis.ro.req.chk.id.bg.fc.cap.cols.span.min.max.step.alt.target.src.name.value.pre.pos".split("."));
639
+ var h = new Set(/* @__PURE__ */ "t.l.tx.tt.ph.u.s.n.v.w.h.clk.sub.act.mtd.dis.ro.req.chk.id.bg.fc.cap.cols.span.min.max.step.alt.target.src.name.value.pre.pos.tgt".split("."));
603
640
  function g(e, t) {
604
641
  for (var n = [];;) {
605
642
  var r = t.match(/^([\s\S]*?[^\x00-\x7f])([a-zA-Z][a-zA-Z0-9]{0,6}):([\s\S]*)$/);
@@ -943,7 +980,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
943
980
  "input-tag",
944
981
  "watermark",
945
982
  "badge-box"
946
- ]), r = i.has(e.type) && !n.has(e.type) && e.attrs.tx, l = e.type === "tn" && e.attrs.leaf !== void 0, d = e.type === "input-tag" && e.attrs.tags, f = e.type === "katex" && !!e.attrs.f, p = r || l || d || f || o(e) || s(e), m = e.attrs.cols && e.type !== "desc" && e.type !== "suggestions" && e.type !== "chart", h = a(e);
983
+ ]), r = i.has(e.type) && !n.has(e.type) && e.attrs.tx, l = e.type === "tn" && e.attrs.leaf !== void 0, d = e.type === "input-tag" && e.attrs.tags, f = e.type === "katex" && !!e.attrs.f, p = r || l || d || f || o(e) || s(e), m = e.attrs.cols && e.type !== "desc" && e.type !== "suggestions" && e.type !== "chart" && e.type !== "masonry", h = a(e);
947
984
  h && (e._previewKey = e._dslStart), i.has(e.type) && !m && !p && !h ? this.stack.length >= this.maxDepth ? (console.warn("TokUI Parser: 嵌套深度超过 maxDepth (" + this.maxDepth + "),按自闭合处理"), this.stack.length > 0 && this.stack[this.stack.length - 1].children.push(e), this.onNode(e)) : (e._stream = "open", this.stack.push(e), this.onNode(e)) : (this.stack.length > 0 && this.stack[this.stack.length - 1].children.push(e), this.onNode(e));
948
985
  }
949
986
  _emitBuffered(e) {
@@ -962,7 +999,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
962
999
  "input-tag",
963
1000
  "watermark",
964
1001
  "badge-box"
965
- ]), r = i.has(e.type) && !n.has(e.type) && e.attrs.tx, c = e.type === "tn" && e.attrs.leaf !== void 0, l = e.type === "input-tag" && e.attrs.tags, d = e.type === "katex" && !!e.attrs.f, f = r || c || l || d || o(e) || s(e), p = e.attrs.cols && e.type !== "desc" && e.type !== "suggestions" && e.type !== "chart", m = a(e);
1002
+ ]), r = i.has(e.type) && !n.has(e.type) && e.attrs.tx, c = e.type === "tn" && e.attrs.leaf !== void 0, l = e.type === "input-tag" && e.attrs.tags, d = e.type === "katex" && !!e.attrs.f, f = r || c || l || d || o(e) || s(e), p = e.attrs.cols && e.type !== "desc" && e.type !== "suggestions" && e.type !== "chart" && e.type !== "masonry", m = a(e);
966
1003
  m && (e._previewKey = e._dslStart), i.has(e.type) && !p && !f && !m ? this.stack.length >= this.maxDepth ? (console.warn("TokUI Parser: 嵌套深度超过 maxDepth (" + this.maxDepth + "),按自闭合处理"), this.stack.length > 0 ? this.stack[this.stack.length - 1].children.push(e) : this.onNode(e)) : this.stack.push(e) : this.stack.length > 0 ? this.stack[this.stack.length - 1].children.push(e) : this.onNode(e);
967
1004
  }
968
1005
  startStream() {
@@ -1282,7 +1319,16 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
1282
1319
  transfer: new Set(["sm", "lg"]),
1283
1320
  cascader: new Set(["error", "success"]),
1284
1321
  upload: new Set(["sm", "lg"]),
1285
- tree: new Set(["sm", "lg"])
1322
+ tree: new Set(["sm", "lg"]),
1323
+ segmented: new Set([
1324
+ "sm",
1325
+ "lg",
1326
+ "block",
1327
+ "pill",
1328
+ "vertical"
1329
+ ]),
1330
+ anchor: new Set(["horizontal"]),
1331
+ kbd: new Set(["sm", "lg"])
1286
1332
  }, m = class {
1287
1333
  constructor(e) {
1288
1334
  this.registry = {}, this.eventBus = e, this.slotStack = [], this._boundElements = [], this._onError = null, this._onComponentEvent = null;
@@ -1485,22 +1531,30 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
1485
1531
  }
1486
1532
  return l.nodeType === 1 && l.classList.add("tokui-fade-in"), i.appendChild(l), l;
1487
1533
  }
1534
+ if (e.type === "opt" && n && n.el._slot && n.el._slot._segmentedName) {
1535
+ var d = n.el._slot._segmentedName, f = this.render(e, "segmented");
1536
+ if (d && f.querySelector) {
1537
+ var p = f.querySelector("input[type=radio]");
1538
+ p && (p.name = d);
1539
+ }
1540
+ return f.nodeType === 1 && f.classList.add("tokui-fade-in"), i.appendChild(f), f;
1541
+ }
1488
1542
  if (e.type === "opt" && n && n.containerType === "picker") {
1489
- var d = n.slot, f = this.render(e, "picker");
1490
- f.nodeType === 1 && f.classList.add("tokui-fade-in");
1491
- var p = d.querySelector(".tokui-picker-empty");
1492
- return p ? d.insertBefore(f, p) : d.appendChild(f), f;
1543
+ var m = n.slot, h = this.render(e, "picker");
1544
+ h.nodeType === 1 && h.classList.add("tokui-fade-in");
1545
+ var g = m.querySelector(".tokui-picker-empty");
1546
+ return g ? m.insertBefore(h, g) : m.appendChild(h), h;
1493
1547
  }
1494
1548
  if (e.type === "opt" && n && n.containerType === "transfer" && n.el._tokuiTransferAppend) {
1495
- var m = n.el._tokuiTransferAppend(e);
1496
- return m && m.nodeType === 1 && m.classList.add("tokui-fade-in"), null;
1549
+ var _ = n.el._tokuiTransferAppend(e);
1550
+ return _ && _.nodeType === 1 && _.classList.add("tokui-fade-in"), null;
1497
1551
  }
1498
1552
  if (e.type === "conv" && n && n.el && typeof n.el._renderConvChild == "function") {
1499
- var h = n.el._renderConvChild(e);
1500
- return h && h.nodeType === 1 && h.classList.add("tokui-fade-in"), i.appendChild(h), h;
1553
+ var v = n.el._renderConvChild(e);
1554
+ return v && v.nodeType === 1 && v.classList.add("tokui-fade-in"), i.appendChild(v), v;
1501
1555
  }
1502
- var g = this.render(e, r);
1503
- return g.nodeType === 1 && g.classList.add("tokui-fade-in"), i.appendChild(g), n && n.el && n.el._streamAppendHook && n.el._streamAppendHook(e), this.slotStack.length === 0 && this.bindEvents(g), g;
1556
+ var y = this.render(e, r);
1557
+ return y.nodeType === 1 && y.classList.add("tokui-fade-in"), i.appendChild(y), n && n.el && n.el._streamAppendHook && n.el._streamAppendHook(e), this.slotStack.length === 0 && this.bindEvents(y), y;
1504
1558
  }
1505
1559
  _collectFormData(e) {
1506
1560
  let t = {};
@@ -7973,7 +8027,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
7973
8027
  let i = t(n, { class: `tokui-${n}` }, e.content || e.attrs && e.attrs.tx);
7974
8028
  e.attrs && e.attrs.id && (i.id = e.attrs.id);
7975
8029
  let a = r(e.attrs.bg), o = r(e.attrs.fc), s = e.attrs.v || "";
7976
- return a && (s.includes("underline") ? i.style.setProperty("--tokui-title-bg", a) : i.style.background = a), o && (i.style.color = o), i;
8030
+ return a && (s.includes("underline") || s.includes("ribbon") || s.includes("badge") || s.includes("pill") ? i.style.setProperty("--tokui-title-bg", a) : i.style.background = a), o && (i.style.color = o), i;
7977
8031
  });
7978
8032
  }), e.register("p", (e, n) => {
7979
8033
  var r = { class: "tokui-p" };
@@ -8044,6 +8098,68 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
8044
8098
  c.style.display = "none";
8045
8099
  }, 260));
8046
8100
  }, c;
8101
+ }), e.register("kbd", (e) => {
8102
+ var n = e.attrs || {}, r = t("kbd", { class: "tokui-kbd" }, e.content || n.tx || "");
8103
+ return n.id && (r.id = n.id), r;
8104
+ }), e.register("editable", (r) => {
8105
+ var i = r.attrs || {}, a = t("span", { class: "tokui-editable" });
8106
+ i.id && (a.id = i.id), i.dis !== void 0 && a.classList.add("tokui-editable--disabled");
8107
+ var o = i.tx === void 0 ? i.v === void 0 ? r.content || "" : String(i.v) : String(i.tx), s = i.dis !== void 0, c = t("span", {
8108
+ class: "tokui-editable__text",
8109
+ role: "button",
8110
+ "aria-label": n("editable.aria")
8111
+ });
8112
+ s || c.setAttribute("tabindex", "0"), c.textContent = o || i.ph || "", !o && i.ph && c.classList.add("tokui-editable__text--ph"), a.appendChild(c), a._tokuiType = "editable";
8113
+ var l = e.createReporter("editable", i, a), u = !1;
8114
+ function d(e) {
8115
+ if (u) {
8116
+ u = !1;
8117
+ var t = e.value;
8118
+ e.parentNode && e.parentNode.removeChild(e), c.style.display = "", c.textContent = t || i.ph || "", c.classList.toggle("tokui-editable__text--ph", !t && !!i.ph), a.classList.remove("tokui-editable--editing"), t !== o && (o = t, l("change", {
8119
+ value: t,
8120
+ name: i.n || void 0
8121
+ }));
8122
+ }
8123
+ }
8124
+ function f() {
8125
+ if (!(u || s)) {
8126
+ u = !0;
8127
+ var e = t("input", {
8128
+ type: "text",
8129
+ class: "tokui-editable__input"
8130
+ });
8131
+ e.value = o, a.appendChild(e), c.style.display = "none", a.classList.add("tokui-editable--editing"), typeof e.focus == "function" && e.focus(), e.addEventListener("keydown", function(t) {
8132
+ t.key === "Enter" ? d(e) : t.key === "Escape" && (e.value = o, d(e));
8133
+ }), e.addEventListener("blur", function() {
8134
+ d(e);
8135
+ });
8136
+ }
8137
+ }
8138
+ return c.addEventListener("click", f), c.addEventListener("keydown", function(e) {
8139
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f());
8140
+ }), a._update = function(e) {
8141
+ (e.tx !== void 0 || e.v !== void 0) && (o = String(e.tx === void 0 ? e.v : e.tx), c.textContent = o || i.ph || "", c.classList.toggle("tokui-editable__text--ph", !o && !!i.ph)), (e.dis === !0 || e.dis === "true" || e.dis === !1 || e.dis === "false") && (s = e.dis === !0 || e.dis === "true", a.classList.toggle("tokui-editable--disabled", s));
8142
+ }, a;
8143
+ }), e.register("float-button", (e, r) => {
8144
+ var i = e.attrs || {}, a = i.pos || "right-bottom";
8145
+ [
8146
+ "right-bottom",
8147
+ "right-top",
8148
+ "left-bottom",
8149
+ "left-top"
8150
+ ].indexOf(a) === -1 && (a = "right-bottom");
8151
+ var o = t("div", {
8152
+ class: "tokui-float-button tokui-float-button--" + a,
8153
+ role: "group",
8154
+ "aria-label": n("floatButton.aria")
8155
+ });
8156
+ if (i.id && (o.id = i.id), i.offset !== void 0) {
8157
+ var s = parseInt(i.offset);
8158
+ isNaN(s) || o.style.setProperty("--tokui-float-offset", s + "px");
8159
+ }
8160
+ return r(e.children || []).forEach(function(e) {
8161
+ e && e.nodeType && o.appendChild(e);
8162
+ }), o._slot = o, o._tokuiType = "float-button", o;
8047
8163
  }), e.register("toggle", (e) => {
8048
8164
  let n = e.attrs || {}, r = n.tx || e.content || "", i = n.chk === !0, a = n.s || "", o = n.dis !== void 0, s = ["tokui-toggle"];
8049
8165
  i && s.push("tokui-toggle--pressed"), a === "sm" ? s.push("tokui-toggle--sm") : a === "lg" && s.push("tokui-toggle--lg"), o && s.push("tokui-toggle--disabled");
@@ -8497,38 +8613,54 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
8497
8613
  var r = e.attrs || {}, i = r.n || n("file.unnamed"), a = r.s || "", o = r.t || "default", s = r.u || "", c = r.tt || "", l = {
8498
8614
  pdf: {
8499
8615
  icon: "PDF",
8500
- color: "#f5222d"
8616
+ color: "#d4380d",
8617
+ bg: "#f5222d1a",
8618
+ border: "#f5222d26"
8501
8619
  },
8502
8620
  word: {
8503
8621
  icon: "W",
8504
- color: "#1677ff"
8622
+ color: "#0958d9",
8623
+ bg: "#1677ff1a",
8624
+ border: "#1677ff26"
8505
8625
  },
8506
8626
  excel: {
8507
8627
  icon: "XLS",
8508
- color: "#52c41a"
8628
+ color: "#389e0d",
8629
+ bg: "#52c41a1a",
8630
+ border: "#52c41a26"
8509
8631
  },
8510
8632
  ppt: {
8511
8633
  icon: "PPT",
8512
- color: "#fa8c16"
8634
+ color: "#d46b08",
8635
+ bg: "#fa8c161a",
8636
+ border: "#fa8c1626"
8513
8637
  },
8514
8638
  image: {
8515
8639
  icon: "IMG",
8516
- color: "#eb2f96"
8640
+ color: "#c41d7f",
8641
+ bg: "#eb2f961a",
8642
+ border: "#eb2f9626"
8517
8643
  },
8518
8644
  zip: {
8519
8645
  icon: "ZIP",
8520
- color: "#722ed1"
8646
+ color: "#531dab",
8647
+ bg: "#722ed11a",
8648
+ border: "#722ed126"
8521
8649
  },
8522
8650
  code: {
8523
8651
  icon: "</>",
8524
- color: "#13c2c2"
8652
+ color: "#08979c",
8653
+ bg: "#13c2c21a",
8654
+ border: "#13c2c226"
8525
8655
  },
8526
8656
  default: {
8527
8657
  icon: "FILE",
8528
- color: "#8c8c8c"
8658
+ color: "#595959",
8659
+ bg: "#8c8c8c1a",
8660
+ border: "#8c8c8c26"
8529
8661
  }
8530
8662
  }, u = l[o] || l.default, d = t("div", { class: "tokui-file" }), f = t("div", { class: "tokui-file__icon" });
8531
- f.style.background = u.color, f.textContent = u.icon, d.appendChild(f);
8663
+ f.style.background = u.bg, f.style.color = u.color, f.style.border = "1px solid " + u.border, f.textContent = u.icon, d.appendChild(f);
8532
8664
  var p = t("div", { class: "tokui-file__info" }), m = t("div", { class: "tokui-file__name" });
8533
8665
  if (m.textContent = i, s && (m.style.cursor = "pointer", m.style.color = "var(--tokui-primary)", m.addEventListener("click", function() {
8534
8666
  window.open(s, "_blank");
@@ -9364,6 +9496,75 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
9364
9496
  e.removeEventListener("scroll", o);
9365
9497
  };
9366
9498
  }), f;
9499
+ }), e.register("affix", (n, r) => {
9500
+ var i = n.attrs || {}, a = i.top === void 0 ? null : parseInt(i.top) || 0, o = i.bottom === void 0 ? null : parseInt(i.bottom) || 0;
9501
+ a === null && o === null && (a = 0);
9502
+ var s = i.target || "", c = t("div", { class: "tokui-affix" });
9503
+ i.id && (c.id = i.id), r(n.children || []).forEach(function(e) {
9504
+ e && e.nodeType && c.appendChild(e);
9505
+ }), c._slot = c, c._tokuiType = "affix";
9506
+ var l = e.createReporter("affix", i, c);
9507
+ if (typeof window < "u") {
9508
+ var u = window.requestAnimationFrame || function(e) {
9509
+ return e();
9510
+ };
9511
+ u(function() {
9512
+ var e = null;
9513
+ function n() {
9514
+ if (s && typeof document < "u" && typeof document.querySelector == "function") {
9515
+ var e = document.querySelector(s);
9516
+ if (e) return e;
9517
+ }
9518
+ for (var t = c.parentElement; t;) {
9519
+ if (typeof getComputedStyle == "function") {
9520
+ var n = getComputedStyle(t);
9521
+ if ((n.overflowY === "auto" || n.overflowY === "scroll") && t.scrollHeight > t.clientHeight) return t;
9522
+ }
9523
+ t = t.parentElement;
9524
+ }
9525
+ return null;
9526
+ }
9527
+ var r = !1, i = null;
9528
+ function d() {
9529
+ if (e) {
9530
+ var t = e.getBoundingClientRect();
9531
+ return {
9532
+ top: t.top,
9533
+ bottom: t.bottom
9534
+ };
9535
+ }
9536
+ return {
9537
+ top: 0,
9538
+ bottom: window.innerHeight || 768
9539
+ };
9540
+ }
9541
+ var f = function() {
9542
+ if (typeof c.getBoundingClientRect == "function") {
9543
+ (!s || !e) && (e = n());
9544
+ var u = r && i ? i : c;
9545
+ if (typeof u.getBoundingClientRect == "function") {
9546
+ var f = u.getBoundingClientRect(), p = d(), m = a === null ? f.top > p.bottom - o - f.height : f.top - p.top < a;
9547
+ if (m && !r) {
9548
+ r = !0;
9549
+ var h = c.getBoundingClientRect();
9550
+ i = t("div", { class: "tokui-affix__placeholder" }), i.style.height = h.height + "px", i.style.width = h.width + "px", c.parentNode && c.parentNode.insertBefore(i, c), c.style.width = h.width + "px", c.style.top = a === null ? p.bottom - o - h.height + "px" : p.top + a + "px", c.classList.add("tokui-affix--fixed"), l("change", { fixed: !0 });
9551
+ } else !m && r && (r = !1, c.classList.remove("tokui-affix--fixed"), c.style.top = "", c.style.width = "", i && i.parentNode && i.parentNode.removeChild(i), i = null, l("change", { fixed: !1 }));
9552
+ }
9553
+ }
9554
+ }, p = !1, m = function() {
9555
+ p || (p = !0, u(function() {
9556
+ p = !1, f();
9557
+ }));
9558
+ };
9559
+ window.addEventListener && window.addEventListener("scroll", m, {
9560
+ capture: !0,
9561
+ passive: !0
9562
+ }), window.addEventListener && window.addEventListener("resize", m, { passive: !0 }), f(), c._streamCloseHook = f, c._affixCleanup = function() {
9563
+ window.removeEventListener && (window.removeEventListener("scroll", m, { capture: !0 }), window.removeEventListener("resize", m));
9564
+ };
9565
+ });
9566
+ }
9567
+ return c;
9367
9568
  }), e.register("calendar", (e) => {
9368
9569
  var r = e.attrs || {}, i = r.month || "", a = /* @__PURE__ */ new Date(), o, s;
9369
9570
  if (i) {
@@ -11719,20 +11920,20 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11719
11920
  return Object.assign({}, e, { children: (e.children || []).concat(t) });
11720
11921
  }
11721
11922
  function s(e) {
11722
- let { el: t, resolveButtonAction: n, evaluateRules: s } = typeof l == "function" ? h() : window.TokUI._internal, c = typeof l == "function" ? S().resolveColor : window.TokUI._internal.resolveColor, d = typeof l == "function" ? v().iconSvg : window.TokUI._internal.iconSvg, f = typeof l == "function" ? v().iconEl : window.TokUI._internal.iconEl, p = typeof l == "function" ? u().t : window.TokUI._internal.t;
11723
- function m(e, t, n, r, a, o) {
11923
+ let { el: t, resolveButtonAction: n, evaluateRules: s } = typeof l == "function" ? h() : window.TokUI._internal, c = typeof l == "function" ? S().resolveColor : window.TokUI._internal.resolveColor, d = typeof l == "function" ? v().iconSvg : window.TokUI._internal.iconSvg, p = typeof l == "function" ? v().iconEl : window.TokUI._internal.iconEl, m = typeof l == "function" ? u().t : window.TokUI._internal.t;
11924
+ function g(e, t, n, r, a, o) {
11724
11925
  if (!r.rule) return;
11725
11926
  e.setAttribute("data-tokui-rule", r.rule);
11726
11927
  var c = r.hint || (n ? n.textContent : "");
11727
11928
  function l() {
11728
- var e = s(o(), r.rule), l = e ? r.msg || p("rule." + e.name, { n: e.n }) : null;
11929
+ var e = s(o(), r.rule), l = e ? r.msg || m("rule." + e.name, { n: e.n }) : null;
11729
11930
  return i(t, n, l ? "error" : "", a), n && (n.textContent = l || c), l;
11730
11931
  }
11731
11932
  e._tokuiValidate = l, r.live !== void 0 && typeof t.addEventListener == "function" && (t.addEventListener("blur", l), t.addEventListener("input", function() {
11732
11933
  (r.live === "input" || t.classList.contains(a + "--error")) && l();
11733
11934
  }));
11734
11935
  }
11735
- function g(e) {
11936
+ function _(e) {
11736
11937
  if (!e) return null;
11737
11938
  var t = e.indexOf("|");
11738
11939
  return t === -1 ? {
@@ -11743,7 +11944,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11743
11944
  variant: e.substring(t + 1)
11744
11945
  };
11745
11946
  }
11746
- function _(e) {
11947
+ function y(e) {
11747
11948
  if (!e) return null;
11748
11949
  var t = e.indexOf("|"), n = t === -1 ? e : e.substring(0, t), r = t === -1 ? null : e.substring(t + 1), i = n.indexOf(":");
11749
11950
  return i === -1 ? {
@@ -11756,32 +11957,32 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11756
11957
  variant: r
11757
11958
  };
11758
11959
  }
11759
- function y(e) {
11960
+ function b(e) {
11760
11961
  var t = e.attrs;
11761
11962
  return !!(t.pre || t.app || t.prebtn || t.appbtn);
11762
11963
  }
11763
- function b(e, n) {
11964
+ function x(e, n) {
11764
11965
  var r = t("div", { class: "tokui-input-group" });
11765
11966
  if (e.attrs.pre) {
11766
- var i = g(e.attrs.pre), a = i.variant ? "tokui-input-pre tokui-input-pre--" + i.variant : "tokui-input-pre";
11967
+ var i = _(e.attrs.pre), a = i.variant ? "tokui-input-pre tokui-input-pre--" + i.variant : "tokui-input-pre";
11767
11968
  r.appendChild(t("span", { class: a }, i.text));
11768
11969
  }
11769
11970
  if (e.attrs.prebtn) {
11770
- var i = _(e.attrs.prebtn), a = i.variant ? "tokui-input-prebtn tokui-input-prebtn--" + i.variant : "tokui-input-prebtn", o = {
11971
+ var i = y(e.attrs.prebtn), a = i.variant ? "tokui-input-prebtn tokui-input-prebtn--" + i.variant : "tokui-input-prebtn", o = {
11771
11972
  class: a,
11772
11973
  type: "button"
11773
11974
  };
11774
11975
  i.handler && (o["data-tokui-clk"] = i.handler), r.appendChild(t("button", o, i.text));
11775
11976
  }
11776
11977
  if (r.appendChild(n), e.attrs.appbtn) {
11777
- var i = _(e.attrs.appbtn), a = i.variant ? "tokui-input-appbtn tokui-input-appbtn--" + i.variant : "tokui-input-appbtn", o = {
11978
+ var i = y(e.attrs.appbtn), a = i.variant ? "tokui-input-appbtn tokui-input-appbtn--" + i.variant : "tokui-input-appbtn", o = {
11778
11979
  class: a,
11779
11980
  type: "button"
11780
11981
  };
11781
11982
  i.handler && (o["data-tokui-clk"] = i.handler), r.appendChild(t("button", o, i.text));
11782
11983
  }
11783
11984
  if (e.attrs.app) {
11784
- var i = g(e.attrs.app), a = i.variant ? "tokui-input-app tokui-input-app--" + i.variant : "tokui-input-app";
11985
+ var i = _(e.attrs.app), a = i.variant ? "tokui-input-app tokui-input-app--" + i.variant : "tokui-input-app";
11785
11986
  r.appendChild(t("span", { class: a }, i.text));
11786
11987
  }
11787
11988
  return r;
@@ -11798,7 +11999,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11798
11999
  e && e.nodeType && a.appendChild(e);
11799
12000
  }), a._slot = a, a._tokuiType = "form", a;
11800
12001
  });
11801
- var x = "<svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"11\" cy=\"11\" r=\"8\"/><line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\"/></svg>";
12002
+ var C = "<svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"11\" cy=\"11\" r=\"8\"/><line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\"/></svg>";
11802
12003
  e.register("input", (n) => {
11803
12004
  var r = n.attrs.v ? n.attrs.v.split(",").map(function(e) {
11804
12005
  return e.trim();
@@ -11821,27 +12022,27 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11821
12022
  var p = null;
11822
12023
  if (s) {
11823
12024
  p = t("div", { class: "tokui-search-input" }), c && p.classList.add("tokui-search-input--right");
11824
- var h = t("span", { class: "tokui-search-input__icon" });
11825
- h.innerHTML = x, p.appendChild(h), p.appendChild(f);
12025
+ var m = t("span", { class: "tokui-search-input__icon" });
12026
+ m.innerHTML = C, p.appendChild(m), p.appendChild(f);
11826
12027
  }
11827
- var g = p || f;
11828
- if (y(n)) {
11829
- var _ = b(n, g);
11830
- r.indexOf("pill") !== -1 && _.classList.add("tokui-input-group--pill"), g = _;
12028
+ var h = p || f;
12029
+ if (b(n)) {
12030
+ var _ = x(n, h);
12031
+ r.indexOf("pill") !== -1 && _.classList.add("tokui-input-group--pill"), h = _;
11831
12032
  }
11832
12033
  var v = null;
11833
12034
  if (n.attrs.sug) {
11834
- var S = t("div", { class: "tokui-sug-wrap" });
11835
- S.appendChild(g), v = t("div", {
12035
+ var y = t("div", { class: "tokui-sug-wrap" });
12036
+ y.appendChild(h), v = t("div", {
11836
12037
  class: "tokui-sug",
11837
12038
  role: "listbox"
11838
- }), v.style.display = "none", S.appendChild(v), l.appendChild(S);
11839
- } else l.appendChild(g);
11840
- var C = null;
11841
- (n.attrs.hint || n.attrs.live !== void 0 || n.attrs.rule) && (C = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), r.indexOf("error") === -1 ? r.indexOf("success") !== -1 && C.classList.add("tokui-field__hint--success") : C.classList.add("tokui-field__hint--error"), l.appendChild(C)), n.attrs.live !== void 0 && a(f, C, n.attrs, "tokui-input"), m(l, f, C, n.attrs, "tokui-input", function() {
12039
+ }), v.style.display = "none", y.appendChild(v), l.appendChild(y);
12040
+ } else l.appendChild(h);
12041
+ var S = null;
12042
+ (n.attrs.hint || n.attrs.live !== void 0 || n.attrs.rule) && (S = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), r.indexOf("error") === -1 ? r.indexOf("success") !== -1 && S.classList.add("tokui-field__hint--success") : S.classList.add("tokui-field__hint--error"), l.appendChild(S)), n.attrs.live !== void 0 && a(f, S, n.attrs, "tokui-input"), g(l, f, S, n.attrs, "tokui-input", function() {
11842
12043
  return f.value;
11843
12044
  }), l._update = function(e) {
11844
- e.v !== void 0 && (f.value = e.v), e.dis === !0 || e.dis === "true" ? f.disabled = !0 : (e.dis === !1 || e.dis === "false") && (f.disabled = !1), e.ph !== void 0 && (f.placeholder = e.ph), e.ro === !0 || e.ro === "true" ? f.readOnly = !0 : (e.ro === !1 || e.ro === "false") && (f.readOnly = !1), e.hint !== void 0 && C && (C.textContent = e.hint), e.status !== void 0 && i(f, C, e.status, "tokui-input");
12045
+ e.v !== void 0 && (f.value = e.v), e.dis === !0 || e.dis === "true" ? f.disabled = !0 : (e.dis === !1 || e.dis === "false") && (f.disabled = !1), e.ph !== void 0 && (f.placeholder = e.ph), e.ro === !0 || e.ro === "true" ? f.readOnly = !0 : (e.ro === !1 || e.ro === "false") && (f.readOnly = !1), e.hint !== void 0 && S && (S.textContent = e.hint), e.status !== void 0 && i(f, S, e.status, "tokui-input");
11845
12046
  };
11846
12047
  var w = e.createReporter("input", n.attrs, l), T = e.debounce(function() {
11847
12048
  w("change", {
@@ -11909,14 +12110,14 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11909
12110
  }
11910
12111
  return l._variantTarget = f, l;
11911
12112
  });
11912
- var C = {};
11913
- function w(e, t, n) {
12113
+ var w = {};
12114
+ function T(e, t, n) {
11914
12115
  if (typeof document < "u" && document.createElement) {
11915
- if (!(t in C)) {
12116
+ if (!(t in w)) {
11916
12117
  var r = document.createElement("span");
11917
- r.innerHTML = n, C[t] = r.firstChild || !1;
12118
+ r.innerHTML = n, w[t] = r.firstChild || !1;
11918
12119
  }
11919
- var i = C[t];
12120
+ var i = w[t];
11920
12121
  if (i && i.cloneNode) {
11921
12122
  e.innerHTML = "", e.appendChild(i.cloneNode(!0));
11922
12123
  return;
@@ -11947,24 +12148,24 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11947
12148
  tabindex: "-1"
11948
12149
  }), u.setAttribute("aria-label", "Toggle password visibility");
11949
12150
  var d = "<svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg>", f = "<svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\"/><path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\"/><line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\"/><path d=\"M14.12 14.12a3 3 0 1 1-4.24-4.24\"/></svg>";
11950
- w(u, "closed", f), u.addEventListener("click", function() {
12151
+ T(u, "closed", f), u.addEventListener("click", function() {
11951
12152
  var e = l.type === "password";
11952
- l.type = e ? "text" : "password", w(u, e ? "open" : "closed", e ? d : f), u.classList.toggle("tokui-pwd-toggle--active", e);
12153
+ l.type = e ? "text" : "password", T(u, e ? "open" : "closed", e ? d : f), u.classList.toggle("tokui-pwd-toggle--active", e);
11953
12154
  });
11954
12155
  }
11955
- if (y(n) || u) {
11956
- var p = b(n, l);
12156
+ if (b(n) || u) {
12157
+ var p = x(n, l);
11957
12158
  if (u) {
11958
- var h = l.nextSibling;
11959
- h ? p.insertBefore(u, h) : p.appendChild(u);
12159
+ var m = l.nextSibling;
12160
+ m ? p.insertBefore(u, m) : p.appendChild(u);
11960
12161
  }
11961
12162
  o.appendChild(p);
11962
12163
  } else o.appendChild(l);
11963
- var g = null;
11964
- (n.attrs.hint || n.attrs.live !== void 0 || n.attrs.rule) && (g = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), r.indexOf("error") === -1 ? r.indexOf("success") !== -1 && g.classList.add("tokui-field__hint--success") : g.classList.add("tokui-field__hint--error"), o.appendChild(g)), n.attrs.live !== void 0 && a(l, g, n.attrs, "tokui-input"), m(o, l, g, n.attrs, "tokui-input", function() {
12164
+ var h = null;
12165
+ (n.attrs.hint || n.attrs.live !== void 0 || n.attrs.rule) && (h = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), r.indexOf("error") === -1 ? r.indexOf("success") !== -1 && h.classList.add("tokui-field__hint--success") : h.classList.add("tokui-field__hint--error"), o.appendChild(h)), n.attrs.live !== void 0 && a(l, h, n.attrs, "tokui-input"), g(o, l, h, n.attrs, "tokui-input", function() {
11965
12166
  return l.value;
11966
12167
  }), o._update = function(e) {
11967
- e.v !== void 0 && (l.value = e.v), e.dis === !0 || e.dis === "true" ? l.disabled = !0 : (e.dis === !1 || e.dis === "false") && (l.disabled = !1), e.ph !== void 0 && (l.placeholder = e.ph), e.ro === !0 || e.ro === "true" ? l.readOnly = !0 : (e.ro === !1 || e.ro === "false") && (l.readOnly = !1), e.hint !== void 0 && g && (g.textContent = e.hint), e.status !== void 0 && i(l, g, e.status, "tokui-input");
12168
+ e.v !== void 0 && (l.value = e.v), e.dis === !0 || e.dis === "true" ? l.disabled = !0 : (e.dis === !1 || e.dis === "false") && (l.disabled = !1), e.ph !== void 0 && (l.placeholder = e.ph), e.ro === !0 || e.ro === "true" ? l.readOnly = !0 : (e.ro === !1 || e.ro === "false") && (l.readOnly = !1), e.hint !== void 0 && h && (h.textContent = e.hint), e.status !== void 0 && i(l, h, e.status, "tokui-input");
11968
12169
  };
11969
12170
  var _ = e.createReporter("pwd", n.attrs, o), v = e.debounce(function() {
11970
12171
  _("change", {
@@ -11989,7 +12190,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
11989
12190
  let d = t("textarea", u), f = n.children && n.children.length > 0 ? n.children.map((e) => e.content || "").join("") : n.content || n.attrs.tx || "";
11990
12191
  if (d.textContent = f, o) {
11991
12192
  d.classList.add("tokui-textarea--auto");
11992
- var p = 0, h = 0;
12193
+ var p = 0, m = 0;
11993
12194
  function e() {
11994
12195
  if (!p) {
11995
12196
  var e = d.getAttribute("rows"), t = d.style.minHeight;
@@ -12001,11 +12202,11 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12001
12202
  var i = r - n, a = n - i;
12002
12203
  d.style.height = "auto";
12003
12204
  var o = d.scrollHeight;
12004
- p = Math.max(a + i * s, o), h = c > 0 && i > 0 ? a + i * c : 0;
12205
+ p = Math.max(a + i * s, o), m = c > 0 && i > 0 ? a + i * c : 0;
12005
12206
  }
12006
12207
  d.style.height = "auto";
12007
12208
  var l = d.scrollHeight, u = Math.max(l, p);
12008
- h > 0 && (u = Math.min(u, h)), d.style.height = u + "px", d.style.overflow = h > 0 && l > h ? "auto" : "hidden";
12209
+ m > 0 && (u = Math.min(u, m)), d.style.height = u + "px", d.style.overflow = m > 0 && l > m ? "auto" : "hidden";
12009
12210
  }
12010
12211
  d.addEventListener && d.addEventListener("input", e), setTimeout(e, 0);
12011
12212
  }
@@ -12018,8 +12219,8 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12018
12219
  });
12019
12220
  }
12020
12221
  } else i.appendChild(d);
12021
- var g = null;
12022
- (n.attrs.hint || n.attrs.rule) && (g = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), i.appendChild(g)), m(i, d, g, n.attrs, "tokui-input", function() {
12222
+ var h = null;
12223
+ (n.attrs.hint || n.attrs.rule) && (h = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), i.appendChild(h)), g(i, d, h, n.attrs, "tokui-input", function() {
12023
12224
  return d.value;
12024
12225
  }), i._update = function(e) {
12025
12226
  e.v !== void 0 && (d.value = e.v), e.dis === !0 || e.dis === "true" ? d.disabled = !0 : (e.dis === !1 || e.dis === "false") && (d.disabled = !1), e.ro === !0 || e.ro === "true" ? d.readOnly = !0 : (e.ro === !1 || e.ro === "false") && (d.readOnly = !1);
@@ -12049,21 +12250,21 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12049
12250
  i || n.children.forEach((e) => {
12050
12251
  e.attrs && e.attrs.chk !== void 0 && (d = e.attrs.v || "", f = e.attrs && e.attrs.tx || d);
12051
12252
  });
12052
- let m = t("div", { class: "tokui-picker-control" });
12253
+ let p = t("div", { class: "tokui-picker-control" });
12053
12254
  i && n.children.forEach((e) => {
12054
- e.attrs && e.attrs.chk !== void 0 && m.appendChild(E(e, u, o));
12255
+ e.attrs && e.attrs.chk !== void 0 && p.appendChild(D(e, u, o));
12055
12256
  });
12056
12257
  let h = {
12057
12258
  class: "tokui-picker-search",
12058
12259
  type: "text",
12059
12260
  autocomplete: "off"
12060
12261
  };
12061
- s && !f && (h.placeholder = s), a && (h.disabled = "disabled"), f && (h.value = f), m.appendChild(t("input", h)), m.appendChild(t("span", { class: "tokui-picker-arrow" })), u.appendChild(m);
12262
+ s && !f && (h.placeholder = s), a && (h.disabled = "disabled"), f && (h.value = f), p.appendChild(t("input", h)), p.appendChild(t("span", { class: "tokui-picker-arrow" })), u.appendChild(p);
12062
12263
  let g = t("ul", { class: "tokui-picker-dropdown" });
12063
12264
  n.children.forEach((e) => {
12064
- g.appendChild(T(e));
12265
+ g.appendChild(E(e));
12065
12266
  });
12066
- var _ = t("li", { class: "tokui-picker-empty" }, p("picker.noMatch"));
12267
+ var _ = t("li", { class: "tokui-picker-empty" }, m("picker.noMatch"));
12067
12268
  _.style.display = "none", g.appendChild(_), u.appendChild(g), i ? n.children.forEach((e) => {
12068
12269
  e.attrs && e.attrs.chk !== void 0 && u.appendChild(t("input", {
12069
12270
  type: "hidden",
@@ -12093,20 +12294,20 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12093
12294
  class: "tokui-picker-tag",
12094
12295
  "data-value": r
12095
12296
  }, n + " "), a = t("span", { class: "tokui-picker-tag-close" }, "×");
12096
- i.appendChild(a), m.insertBefore(i, m.querySelector(".tokui-picker-search")), u.appendChild(t("input", {
12297
+ i.appendChild(a), p.insertBefore(i, p.querySelector(".tokui-picker-search")), u.appendChild(t("input", {
12097
12298
  type: "hidden",
12098
12299
  name: o,
12099
12300
  value: r
12100
12301
  }));
12101
- }), !a && typeof document < "u" && D(u, {
12302
+ }), !a && typeof document < "u" && O(u, {
12102
12303
  multi: i,
12103
12304
  name: o,
12104
12305
  onChange: y
12105
12306
  });
12106
12307
  }, c.setAttribute("data-tokui-resettable", ""), c._tokuiReset = function() {
12107
12308
  var e = u.querySelector(".tokui-picker-search"), n = u.querySelector("input[type=hidden]"), r = g.querySelectorAll(".tokui-picker-option");
12108
- i ? (m.querySelectorAll(".tokui-picker-tag").forEach(function(e) {
12109
- m.removeChild(e);
12309
+ i ? (p.querySelectorAll(".tokui-picker-tag").forEach(function(e) {
12310
+ p.removeChild(e);
12110
12311
  }), u.querySelectorAll("input[type=hidden][name=\"" + o + "\"]").forEach(function(e) {
12111
12312
  u.removeChild(e);
12112
12313
  }), r.forEach(function(n) {
@@ -12116,7 +12317,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12116
12317
  class: "tokui-picker-tag",
12117
12318
  "data-value": a
12118
12319
  }, i + " ");
12119
- s.appendChild(t("span", { class: "tokui-picker-tag-close" }, "×")), m.insertBefore(s, e), u.appendChild(t("input", {
12320
+ s.appendChild(t("span", { class: "tokui-picker-tag-close" }, "×")), p.insertBefore(s, e), u.appendChild(t("input", {
12120
12321
  type: "hidden",
12121
12322
  name: o,
12122
12323
  value: a
@@ -12131,8 +12332,8 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12131
12332
  var n = String(e.v).split(",").map(function(e) {
12132
12333
  return e.trim();
12133
12334
  }).filter(Boolean), r = g.querySelectorAll(".tokui-picker-option"), a = u.querySelector(".tokui-picker-search");
12134
- if (i) m.querySelectorAll(".tokui-picker-tag").forEach(function(e) {
12135
- m.removeChild(e);
12335
+ if (i) p.querySelectorAll(".tokui-picker-tag").forEach(function(e) {
12336
+ p.removeChild(e);
12136
12337
  }), u.querySelectorAll("input[type=hidden][name=\"" + o + "\"]").forEach(function(e) {
12137
12338
  u.removeChild(e);
12138
12339
  }), r.forEach(function(e) {
@@ -12145,7 +12346,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12145
12346
  class: "tokui-picker-tag",
12146
12347
  "data-value": e
12147
12348
  }, r + " ");
12148
- i.appendChild(t("span", { class: "tokui-picker-tag-close" }, "×")), m.insertBefore(i, a), u.appendChild(t("input", {
12349
+ i.appendChild(t("span", { class: "tokui-picker-tag-close" }, "×")), p.insertBefore(i, a), u.appendChild(t("input", {
12149
12350
  type: "hidden",
12150
12351
  name: o,
12151
12352
  value: e
@@ -12165,7 +12366,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12165
12366
  }
12166
12367
  }, c;
12167
12368
  });
12168
- function T(e) {
12369
+ function E(e) {
12169
12370
  let n = e.attrs && e.attrs.v || "", r = e.attrs && e.attrs.tx || n || e.content || "", i = e.attrs && e.attrs.chk !== void 0, a = t("li", {
12170
12371
  class: "tokui-picker-option",
12171
12372
  "data-value": n,
@@ -12176,14 +12377,14 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12176
12377
  }, r);
12177
12378
  return i && a.classList.add("tokui-picker-option--selected"), i && a.setAttribute("data-selected-initial", "1"), a;
12178
12379
  }
12179
- function E(e, n, r) {
12380
+ function D(e, n, r) {
12180
12381
  let i = e.attrs && e.attrs.tx || e.attrs && e.attrs.v || e.content || "", a = t("span", {
12181
12382
  class: "tokui-picker-tag",
12182
12383
  "data-value": e.attrs && e.attrs.v || e.content || ""
12183
12384
  }, i + " "), o = t("span", { class: "tokui-picker-tag-close" }, "×");
12184
12385
  return a.appendChild(o), a;
12185
12386
  }
12186
- function D(e, n) {
12387
+ function O(e, n) {
12187
12388
  var r = n.multi, i = n.name, a = typeof n.onChange == "function" ? n.onChange : null, o = e.querySelector(".tokui-picker-control"), s = e.querySelector(".tokui-picker-search"), c = e.querySelector(".tokui-picker-dropdown"), l = e.querySelector(".tokui-picker-empty"), u = !1, d = -1;
12188
12389
  function f() {
12189
12390
  if (a) if (r) {
@@ -12323,7 +12524,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12323
12524
  e && e.nodeType && l.appendChild(e);
12324
12525
  }), s.appendChild(l);
12325
12526
  var u = null;
12326
- (n.attrs.hint || n.attrs.rule) && (u = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), s.appendChild(u)), m(s, l, u, n.attrs, "tokui-select", function() {
12527
+ (n.attrs.hint || n.attrs.rule) && (u = t("div", { class: "tokui-field__hint" }, n.attrs.hint || ""), s.appendChild(u)), g(s, l, u, n.attrs, "tokui-select", function() {
12327
12528
  if (!i) return l.value;
12328
12529
  var e = [];
12329
12530
  return Array.prototype.forEach.call(l.children, function(t) {
@@ -12364,7 +12565,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12364
12565
  n.attrs.id && (s.id = n.attrs.id);
12365
12566
  let c = n.attrs.n || n.attrs.id || "radio";
12366
12567
  s._radioName = c, n.children.forEach((e) => {
12367
- s.appendChild(O(e, c));
12568
+ s.appendChild(k(e, c));
12368
12569
  }), a.appendChild(s), a._slot = s, a._tokuiType = "radio";
12369
12570
  var l = e.createReporter("radio", n.attrs, a);
12370
12571
  return s.addEventListener("change", function(e) {
@@ -12382,7 +12583,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12382
12583
  }
12383
12584
  }, a;
12384
12585
  });
12385
- function O(e, n) {
12586
+ function k(e, n) {
12386
12587
  let r = t("label", { class: "tokui-radio-item" });
12387
12588
  r.setAttribute("data-tokui-tag", "opt");
12388
12589
  let i = {
@@ -12394,7 +12595,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12394
12595
  let a = e.attrs && e.attrs.tx || e.attrs && e.attrs.v || e.content || "";
12395
12596
  return r.appendChild(t("span", { class: "tokui-radio-text" }, a)), r;
12396
12597
  }
12397
- function k(e, n) {
12598
+ function A(e, n) {
12398
12599
  let r = t("label", { class: "tokui-checkbox-item" });
12399
12600
  r.setAttribute("data-tokui-tag", "opt");
12400
12601
  let i = {
@@ -12407,9 +12608,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12407
12608
  return r.appendChild(t("span", { class: "tokui-checkbox-text" }, a)), r;
12408
12609
  }
12409
12610
  e.register("opt", (e, n, r) => {
12410
- if (r === "radio") return O(e, "");
12411
- if (r === "checkbox") return k(e, "");
12412
- if (r === "picker") return T(e);
12611
+ if (r === "radio") return k(e, "");
12612
+ if (r === "checkbox") return A(e, "");
12613
+ if (r === "segmented") return j(e, "", null, !1);
12614
+ if (r === "picker") return E(e);
12413
12615
  let i = e.attrs ? e.attrs.v : "", a = e.attrs && e.attrs.tx || i || e.content || "", o = { value: i };
12414
12616
  return e.attrs && e.attrs.chk !== void 0 && (o.selected = ""), t("option", o, a);
12415
12617
  }), e.register("checkbox", (n, r) => {
@@ -12450,7 +12652,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12450
12652
  role: "group"
12451
12653
  });
12452
12654
  f._checkboxName = d, n.attrs.id && (f.id = n.attrs.id), n.children && n.children.length && n.children.forEach(function(e) {
12453
- f.appendChild(k(e, d));
12655
+ f.appendChild(A(e, d));
12454
12656
  }), u.appendChild(f), u._slot = f, u._tokuiType = "checkbox";
12455
12657
  var a = e.createReporter("checkbox", n.attrs, u);
12456
12658
  return f.addEventListener("change", function() {
@@ -12471,7 +12673,71 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12471
12673
  });
12472
12674
  }
12473
12675
  }, u;
12474
- }), e.register("switch", (n) => {
12676
+ }), e.register("segmented", (n) => {
12677
+ n = o(n);
12678
+ let r = t("div", { class: "tokui-field" });
12679
+ n.attrs.l && r.appendChild(t("div", { class: "tokui-label" + (n.attrs.req === void 0 ? "" : " tokui-label--req") }, n.attrs.l));
12680
+ let i = t("div", {
12681
+ class: "tokui-segmented",
12682
+ role: "radiogroup"
12683
+ });
12684
+ n.attrs.id && (i.id = n.attrs.id);
12685
+ let a = n.attrs.n || n.attrs.id || "segmented";
12686
+ i._segmentedName = a;
12687
+ let s = n.attrs.v === void 0 ? [] : String(n.attrs.v).split(",").map(function(e) {
12688
+ return e.trim();
12689
+ }).filter(Boolean), c = [
12690
+ "sm",
12691
+ "lg",
12692
+ "block",
12693
+ "pill",
12694
+ "vertical"
12695
+ ], l = (function() {
12696
+ for (var e = 0; e < s.length; e++) if (c.indexOf(s[e]) === -1) return s[e];
12697
+ return null;
12698
+ })(), u = n.attrs.dis !== void 0;
12699
+ (n.children || []).forEach(function(e) {
12700
+ i.appendChild(j(e, a, l, u));
12701
+ }), u && i.classList.add("tokui-segmented--disabled"), r.appendChild(i), r._slot = i, r._tokuiType = "segmented";
12702
+ var d = e.createReporter("segmented", n.attrs, r);
12703
+ i.addEventListener("change", function(e) {
12704
+ var t = e.target;
12705
+ t && t.type === "radio" && t.checked && d("change", {
12706
+ value: t.value,
12707
+ name: n.attrs.n || void 0
12708
+ });
12709
+ }), r._update = function(e) {
12710
+ if (e.v !== void 0) {
12711
+ var t = String(e.v);
12712
+ i.querySelectorAll("input[type=radio]").forEach(function(e) {
12713
+ e.checked = String(e.value) === t;
12714
+ });
12715
+ }
12716
+ if (e.dis === !0 || e.dis === "true" || e.dis === !1 || e.dis === "false") {
12717
+ var n = e.dis === !0 || e.dis === "true";
12718
+ i.querySelectorAll("input[type=radio]").forEach(function(e) {
12719
+ e.disabled = n;
12720
+ }), i.classList.toggle("tokui-segmented--disabled", n);
12721
+ }
12722
+ };
12723
+ var f = l;
12724
+ return r.setAttribute("data-tokui-resettable", ""), r._tokuiReset = function() {
12725
+ i.querySelectorAll("input[type=radio]").forEach(function(e) {
12726
+ e.checked = f !== null && String(e.value) === f;
12727
+ });
12728
+ }, r;
12729
+ });
12730
+ function j(e, n, r, i) {
12731
+ let a = e.attrs || {}, o = a.v === void 0 ? "" : String(a.v), s = i || a.dis !== void 0, c = t("label", { class: "tokui-segmented__item" + (s ? " tokui-segmented__item--disabled" : "") });
12732
+ c.setAttribute("data-tokui-tag", "opt");
12733
+ let l = {
12734
+ type: "radio",
12735
+ name: n,
12736
+ class: "tokui-segmented__input"
12737
+ };
12738
+ return l.value = o, (r !== null && o === r || r === null && a.chk !== void 0) && (l.checked = "checked"), s && (l.disabled = "disabled"), c.appendChild(t("input", l)), a.i && c.appendChild(t("span", { class: "tokui-segmented__icon" }, a.i)), c.appendChild(t("span", { class: "tokui-segmented__text" }, a.tx || o)), c;
12739
+ }
12740
+ e.register("switch", (n) => {
12475
12741
  var r = t("label", { class: "tokui-switch" }), i = {
12476
12742
  type: "checkbox",
12477
12743
  class: "tokui-switch-input"
@@ -12683,14 +12949,14 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12683
12949
  var l = t("div", {
12684
12950
  class: "tokui-rate tokui-rate--half",
12685
12951
  role: "radiogroup",
12686
- "aria-label": n.attrs.l || p("rate.defaultLabel"),
12952
+ "aria-label": n.attrs.l || m("rate.defaultLabel"),
12687
12953
  tabindex: "0"
12688
12954
  }), u = t("input", { type: "hidden" });
12689
12955
  n.attrs.id && (u.id = n.attrs.id), n.attrs.n ? u.name = n.attrs.n : n.attrs.id && (u.name = n.attrs.id);
12690
- for (var d = [], f = [], m = 0; m < r; m++) {
12956
+ for (var d = [], f = [], p = 0; p < r; p++) {
12691
12957
  var h = t("span", {
12692
12958
  class: "tokui-rate__star",
12693
- "data-index": String(m + 1),
12959
+ "data-index": String(p + 1),
12694
12960
  role: "radio",
12695
12961
  "aria-checked": "false"
12696
12962
  });
@@ -12760,7 +13026,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
12760
13026
  var x = t("div", {
12761
13027
  class: "tokui-rate",
12762
13028
  role: "radiogroup",
12763
- "aria-label": n.attrs.l || p("rate.defaultLabel"),
13029
+ "aria-label": n.attrs.l || m("rate.defaultLabel"),
12764
13030
  tabindex: "0"
12765
13031
  }), S = t("input", { type: "hidden" });
12766
13032
  n.attrs.id && (S.id = n.attrs.id), n.attrs.n ? S.name = n.attrs.n : n.attrs.id && (S.name = n.attrs.id), S.value = i;
@@ -13000,7 +13266,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13000
13266
  o = v, f.value = String(o), f.setAttribute("value", String(o)), h.value = o;
13001
13267
  }, c.appendChild(l), c._variantTarget = l, c;
13002
13268
  });
13003
- var A = new Set([
13269
+ var M = new Set([
13004
13270
  "primary",
13005
13271
  "danger",
13006
13272
  "success",
@@ -13015,7 +13281,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13015
13281
  e.register("btn", (e) => {
13016
13282
  let i = n(e.attrs);
13017
13283
  var a = i.act === "submit" ? "submit" : i.act === "reset" ? "reset" : "button", o = "tokui-btn";
13018
- e.attrs.t && A.has(e.attrs.t) && (o += " tokui-btn--" + e.attrs.t), i.act === "print" && (o += " tokui-btn--print");
13284
+ e.attrs.t && M.has(e.attrs.t) && (o += " tokui-btn--" + e.attrs.t), i.act === "print" && (o += " tokui-btn--print");
13019
13285
  let s = {
13020
13286
  class: o,
13021
13287
  type: a
@@ -13025,8 +13291,8 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13025
13291
  });
13026
13292
  let l = "", u = r(e.attrs.w);
13027
13293
  u && (l += "width:" + u + ";");
13028
- let p = c(e.attrs.bg);
13029
- p && (l += "background:" + p + ";");
13294
+ let f = c(e.attrs.bg);
13295
+ f && (l += "background:" + f + ";");
13030
13296
  let m = c(e.attrs.fc);
13031
13297
  m && (l += "color:" + m + ";");
13032
13298
  let h = r(e.attrs.radius);
@@ -13038,7 +13304,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13038
13304
  t && (x.setAttribute("aria-label", t), x.setAttribute("data-tokui-tip", t));
13039
13305
  }
13040
13306
  if (_) {
13041
- let e = t("span", { class: "tokui-btn__icon" }), n = f ? f(_, 16) : null;
13307
+ let e = t("span", { class: "tokui-btn__icon" }), n = p ? p(_, 16) : null;
13042
13308
  n ? e.appendChild(n) : e.innerHTML = y, x.appendChild(e), x.classList.add("tokui-btn--has-icon");
13043
13309
  } else if (v) {
13044
13310
  let e = t("span", { class: "tokui-btn__icon tokui-btn__icon--emoji" }, v);
@@ -13065,7 +13331,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13065
13331
  e && e.nodeType && i.appendChild(e);
13066
13332
  }), i._slot = i, i._tokuiType = "btngroup", i;
13067
13333
  }), e.register("cascader", (n, r) => {
13068
- var i = n.attrs.dis !== void 0, a = n.attrs.ph || p("select.placeholder"), o = t("div", { class: "tokui-field" });
13334
+ var i = n.attrs.dis !== void 0, a = n.attrs.ph || m("select.placeholder"), o = t("div", { class: "tokui-field" });
13069
13335
  n.attrs.l && o.appendChild(t("label", { class: "tokui-label" + (n.attrs.req === void 0 ? "" : " tokui-label--req") }, n.attrs.l)), n.attrs.id && (o.id = n.attrs.id);
13070
13336
  var s = t("div", {
13071
13337
  class: "tokui-cascader" + (i ? " tokui-cascader--disabled" : ""),
@@ -13085,8 +13351,8 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13085
13351
  s.appendChild(d);
13086
13352
  var f = t("input", { type: "hidden" });
13087
13353
  n.attrs.n ? f.name = n.attrs.n : n.attrs.id && (f.name = n.attrs.id), s.appendChild(f);
13088
- var m = t("div", {});
13089
- m.style.display = "none", s.appendChild(m), o.appendChild(s);
13354
+ var p = t("div", {});
13355
+ p.style.display = "none", s.appendChild(p), o.appendChild(s);
13090
13356
  function h(e) {
13091
13357
  var t = {}, n = [];
13092
13358
  return (e || []).forEach(function(e) {
@@ -13226,29 +13492,29 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13226
13492
  w.hidden = f.value, w.text = l.value;
13227
13493
  }
13228
13494
  return n.children && n.children.length && T(h(n.children)), o._streamCloseHook = function() {
13229
- m.innerHTML = "", T(h(n.children));
13230
- }, o._slot = m, o._tokuiType = "cascader", o._variantTarget = s, o.setAttribute("data-tokui-resettable", ""), o._tokuiReset = function() {
13495
+ p.innerHTML = "", T(h(n.children));
13496
+ }, o._slot = p, o._tokuiType = "cascader", o._variantTarget = s, o.setAttribute("data-tokui-resettable", ""), o._tokuiReset = function() {
13231
13497
  f.value = w.hidden, l.value = w.text, b.isOpen && S();
13232
13498
  }, o;
13233
13499
  }), e.register("upload", (n) => {
13234
- var r = n.attrs.dis !== void 0, i = n.attrs.multi !== void 0, a = parseInt(n.attrs.max) || 0, o = n.attrs.ph || p("upload.hint"), s = n.attrs.accept || "", c = "";
13500
+ var r = n.attrs.dis !== void 0, i = n.attrs.multi !== void 0, a = parseInt(n.attrs.max) || 0, o = n.attrs.ph || m("upload.hint"), s = n.attrs.accept || "", c = "";
13235
13501
  n.attrs.u && (/^(https?:\/\/|\/)/i.test(n.attrs.u) ? c = n.attrs.u : console.warn("TokUI: upload u: 仅支持 http(s) 或以 / 开头的路径,已忽略: " + n.attrs.u));
13236
13502
  var l = (n.attrs.mtd || "POST").toUpperCase(), u = n.attrs.n || "file", d = t("div", { class: "tokui-field" });
13237
13503
  n.attrs.l && d.appendChild(t("label", { class: "tokui-label" + (n.attrs.req === void 0 ? "" : " tokui-label--req") }, n.attrs.l)), n.attrs.id && (d.id = n.attrs.id);
13238
- var f = t("div", { class: "tokui-upload" + (r ? " tokui-upload--disabled" : "") }), m = t("div", {
13504
+ var f = t("div", { class: "tokui-upload" + (r ? " tokui-upload--disabled" : "") }), p = t("div", {
13239
13505
  class: "tokui-upload-dropzone",
13240
13506
  role: "button",
13241
13507
  "aria-label": o,
13242
13508
  tabindex: "0"
13243
13509
  }), h = t("div", { class: "tokui-upload-icon" });
13244
- h.innerHTML = "<svg viewBox=\"0 0 48 48\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M24 32V12\"/><path d=\"M16 20l8-8 8 8\"/><path d=\"M8 36h32\"/></svg>", m.appendChild(h);
13510
+ h.innerHTML = "<svg viewBox=\"0 0 48 48\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M24 32V12\"/><path d=\"M16 20l8-8 8 8\"/><path d=\"M8 36h32\"/></svg>", p.appendChild(h);
13245
13511
  var g = t("div", { class: "tokui-upload-text" });
13246
- g.textContent = o, m.appendChild(g);
13512
+ g.textContent = o, p.appendChild(g);
13247
13513
  var _ = t("button", {
13248
13514
  class: "tokui-upload-btn",
13249
13515
  type: "button"
13250
13516
  });
13251
- _.textContent = p("upload.browse"), m.appendChild(_), f.appendChild(m);
13517
+ _.textContent = m("upload.browse"), p.appendChild(_), f.appendChild(p);
13252
13518
  var v = {
13253
13519
  type: "file",
13254
13520
  style: "display:none"
@@ -13283,24 +13549,24 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13283
13549
  var s = t("div", {
13284
13550
  class: "tokui-upload__progress",
13285
13551
  role: "progressbar",
13286
- title: p("upload.uploading")
13552
+ title: m("upload.uploading")
13287
13553
  }), c = t("div", { class: "tokui-upload__progress-bar" });
13288
13554
  c.style.width = (e.percent || 0) + "%", s.appendChild(c), r.appendChild(s);
13289
13555
  var l = t("span", { class: "tokui-upload__percent" });
13290
13556
  l.textContent = (e.percent || 0) + "%", r.appendChild(l);
13291
13557
  } else if (e.status === "done") r.appendChild(t("span", {
13292
13558
  class: "tokui-upload__status tokui-upload__status--done",
13293
- title: p("upload.done")
13559
+ title: m("upload.done")
13294
13560
  }, "✓"));
13295
13561
  else if (e.status === "error") {
13296
13562
  r.appendChild(t("span", {
13297
13563
  class: "tokui-upload__status tokui-upload__status--error",
13298
- title: p("upload.failed")
13564
+ title: m("upload.failed")
13299
13565
  }, "✗"));
13300
13566
  var u = t("button", {
13301
13567
  class: "tokui-upload__retry",
13302
13568
  type: "button"
13303
- }, p("upload.retry"));
13569
+ }, m("upload.retry"));
13304
13570
  u.setAttribute("data-idx", n), r.appendChild(u);
13305
13571
  }
13306
13572
  var d = t("span", { class: "tokui-upload-file-remove" });
@@ -13358,17 +13624,17 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13358
13624
  T();
13359
13625
  for (var l = 0; l < r.length; l++) D(r[l]);
13360
13626
  }
13361
- return r || (m.addEventListener("click", function(e) {
13362
- (e.target === _ || m.contains(e.target)) && y.click();
13627
+ return r || (p.addEventListener("click", function(e) {
13628
+ (e.target === _ || p.contains(e.target)) && y.click();
13363
13629
  }), _.addEventListener("click", function(e) {
13364
13630
  e.stopPropagation(), y.click();
13365
13631
  }), y.addEventListener("change", function() {
13366
13632
  y.files && y.files.length && (O(y.files), y.value = "");
13367
- }), m.addEventListener("dragover", function(e) {
13633
+ }), p.addEventListener("dragover", function(e) {
13368
13634
  e.preventDefault(), f.classList.add("tokui-upload--dragover");
13369
- }), m.addEventListener("dragleave", function(e) {
13635
+ }), p.addEventListener("dragleave", function(e) {
13370
13636
  e.preventDefault(), f.classList.remove("tokui-upload--dragover");
13371
- }), m.addEventListener("drop", function(e) {
13637
+ }), p.addEventListener("drop", function(e) {
13372
13638
  e.preventDefault(), f.classList.remove("tokui-upload--dragover"), e.dataTransfer && e.dataTransfer.files.length && O(e.dataTransfer.files);
13373
13639
  }), b.addEventListener("click", function(e) {
13374
13640
  var t = e.target.closest(".tokui-upload__retry");
@@ -13386,29 +13652,29 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13386
13652
  e.act === "clear" && (C.length = 0, y.value = "", E());
13387
13653
  }, d;
13388
13654
  });
13389
- function j(e) {
13655
+ function N(e) {
13390
13656
  if (!e) return null;
13391
13657
  var t = e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);
13392
13658
  return t ? new Date(parseInt(t[1]), parseInt(t[2]) - 1, parseInt(t[3])) : null;
13393
13659
  }
13394
- function M(e) {
13660
+ function P(e) {
13395
13661
  if (!e) return null;
13396
13662
  var t = e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})\s+(\d{1,2}):(\d{1,2})/);
13397
13663
  return t ? new Date(parseInt(t[1]), parseInt(t[2]) - 1, parseInt(t[3]), parseInt(t[4]), parseInt(t[5])) : null;
13398
13664
  }
13399
- function N(e, t) {
13665
+ function F(e, t) {
13400
13666
  var n = e.getFullYear(), r = e.getMonth() + 1, i = e.getDate(), a = e.getHours(), o = e.getMinutes(), s = e.getSeconds();
13401
13667
  return t.replace("YYYY", String(n)).replace("MM", r < 10 ? "0" + r : String(r)).replace("DD", i < 10 ? "0" + i : String(i)).replace("HH", a < 10 ? "0" + a : String(a)).replace("mm", o < 10 ? "0" + o : String(o)).replace("ss", s < 10 ? "0" + s : String(s));
13402
13668
  }
13403
- function P(e, t, n, r) {
13669
+ function I(e, t, n, r) {
13404
13670
  return r.replace("HH", e < 10 ? "0" + e : String(e)).replace("mm", t < 10 ? "0" + t : String(t)).replace("ss", n < 10 ? "0" + n : String(n));
13405
13671
  }
13406
- function F(e, t) {
13672
+ function L(e, t) {
13407
13673
  var n = e._tpItems;
13408
13674
  !n || !n.length || (t < 0 && (t = 0), t > n.length - 1 && (t = n.length - 1), e._tpHl !== t && (e._tpHl >= 0 && n[e._tpHl] && n[e._tpHl].classList.remove("tokui-timepicker-column-item--selected"), n[t].classList.add("tokui-timepicker-column-item--selected"), e._tpHl = t));
13409
13675
  }
13410
- function I(e, t) {
13411
- F(e, t);
13676
+ function R(e, t) {
13677
+ L(e, t);
13412
13678
  var n = e._tpList, r = e._tpItems;
13413
13679
  if (!(!n || !r || !r.length)) {
13414
13680
  t < 0 && (t = 0), t > r.length - 1 && (t = r.length - 1);
@@ -13419,7 +13685,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13419
13685
  }
13420
13686
  }
13421
13687
  }
13422
- function L(e) {
13688
+ function z(e) {
13423
13689
  if (e._tpGeom) return e._tpGeom;
13424
13690
  var t = e._tpList, n = e._tpItems;
13425
13691
  if (!t || !n || !n.length) return null;
@@ -13432,10 +13698,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13432
13698
  }
13433
13699
  return null;
13434
13700
  }
13435
- function R(e) {
13701
+ function B(e) {
13436
13702
  var t = e._tpList, n = e._tpItems;
13437
13703
  if (!t || !n || !n.length) return 0;
13438
- var r = L(e);
13704
+ var r = z(e);
13439
13705
  if (r) {
13440
13706
  var i = Math.round(((t.scrollTop || 0) - r.base) / r.itemH - 1e-6);
13441
13707
  return Math.max(0, Math.min(i, n.length - 1));
@@ -13443,14 +13709,14 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13443
13709
  var a = n[0].offsetHeight || 32, o = Math.round(((t.scrollTop || 0) + (t.clientHeight || 192) / 2) / a);
13444
13710
  return Math.max(0, Math.min(o, n.length - 1));
13445
13711
  }
13446
- function z(e, n, r) {
13712
+ function V(e, n, r) {
13447
13713
  for (var i = t("div", { class: "tokui-timepicker-column" }), a = t("div", { class: "tokui-timepicker-column-list" }), o = [], s = 0; s < n; s++) {
13448
13714
  var c = t("div", {
13449
13715
  class: "tokui-timepicker-column-item" + (s === r ? " tokui-timepicker-column-item--selected" : ""),
13450
13716
  "data-value": String(s)
13451
13717
  }, s < 10 ? "0" + s : String(s));
13452
13718
  c.addEventListener("click", function(e) {
13453
- e.stopPropagation(), I(i, parseInt(this.getAttribute("data-value"), 10));
13719
+ e.stopPropagation(), R(i, parseInt(this.getAttribute("data-value"), 10));
13454
13720
  }), a.appendChild(c), o.push(c);
13455
13721
  }
13456
13722
  i.appendChild(a), i._tpList = a, i._tpItems = o, i._tpHl = r;
@@ -13459,48 +13725,48 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13459
13725
  };
13460
13726
  return a.addEventListener("scroll", function() {
13461
13727
  l || (l = 1, u(function() {
13462
- l = 0, F(i, R(i));
13728
+ l = 0, L(i, B(i));
13463
13729
  }));
13464
13730
  }), i._label = e, i;
13465
13731
  }
13466
- function B(e) {
13467
- var t = R(e);
13468
- F(e, t);
13732
+ function H(e) {
13733
+ var t = B(e);
13734
+ L(e, t);
13469
13735
  var n = e._tpItems;
13470
13736
  return parseInt(n[t].getAttribute("data-value")) || 0;
13471
13737
  }
13472
- function V(e, t) {
13473
- I(e, t);
13738
+ function U(e, t) {
13739
+ R(e, t);
13474
13740
  }
13475
- var H = typeof window < "u" && window.TokUI && window.TokUI._internal ? window.TokUI._internal._datePickers = window.TokUI._internal._datePickers || /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set();
13476
- function U(e) {
13741
+ var W = typeof window < "u" && window.TokUI && window.TokUI._internal ? window.TokUI._internal._datePickers = window.TokUI._internal._datePickers || /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set();
13742
+ function G(e) {
13477
13743
  var t = [];
13478
- H.forEach(function(n) {
13744
+ W.forEach(function(n) {
13479
13745
  n !== e && t.push(n);
13480
13746
  }), t.forEach(function(e) {
13481
13747
  try {
13482
13748
  e();
13483
13749
  } catch {}
13484
- }), H.add(e);
13750
+ }), W.add(e);
13485
13751
  }
13486
- function W(e) {
13487
- H.delete(e);
13752
+ function K(e) {
13753
+ W.delete(e);
13488
13754
  }
13489
- function G() {
13755
+ function q() {
13490
13756
  var e = [];
13491
- H.forEach(function(t) {
13757
+ W.forEach(function(t) {
13492
13758
  e.push(t);
13493
- }), H.clear(), e.forEach(function(e) {
13759
+ }), W.clear(), e.forEach(function(e) {
13494
13760
  try {
13495
13761
  e();
13496
13762
  } catch {}
13497
13763
  });
13498
13764
  }
13499
- typeof window < "u" && !window.TokUI._internal._dateScrollBound && (window.addEventListener("scroll", G), window.TokUI._internal._dateScrollBound = !0);
13500
- function K() {
13765
+ typeof window < "u" && !window.TokUI._internal._dateScrollBound && (window.addEventListener("scroll", q), window.TokUI._internal._dateScrollBound = !0);
13766
+ function J() {
13501
13767
  return typeof window < "u" && window.innerWidth ? window.innerWidth : typeof document < "u" && document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : 1024;
13502
13768
  }
13503
- function q(e, n, r, i, a, o) {
13769
+ function Y(e, n, r, i, a, o) {
13504
13770
  var s = t("div", { class: "tokui-datepicker-header" }), c = t("button", {
13505
13771
  class: "tokui-datepicker-nav tokui-datepicker-nav--prev",
13506
13772
  type: "button"
@@ -13511,24 +13777,24 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13511
13777
  type: "button"
13512
13778
  });
13513
13779
  l.innerHTML = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"9 18 15 12 9 6\"/></svg>";
13514
- var u = t("span", { class: "tokui-datepicker-title" }, p("datepicker.title", {
13780
+ var u = t("span", { class: "tokui-datepicker-title" }, m("datepicker.title", {
13515
13781
  y: e,
13516
13782
  m: n + 1
13517
13783
  }));
13518
13784
  s.appendChild(c), s.appendChild(u), s.appendChild(l), a.appendChild(s);
13519
13785
  var d = [
13520
- p("datepicker.weekday.0"),
13521
- p("datepicker.weekday.1"),
13522
- p("datepicker.weekday.2"),
13523
- p("datepicker.weekday.3"),
13524
- p("datepicker.weekday.4"),
13525
- p("datepicker.weekday.5"),
13526
- p("datepicker.weekday.6")
13786
+ m("datepicker.weekday.0"),
13787
+ m("datepicker.weekday.1"),
13788
+ m("datepicker.weekday.2"),
13789
+ m("datepicker.weekday.3"),
13790
+ m("datepicker.weekday.4"),
13791
+ m("datepicker.weekday.5"),
13792
+ m("datepicker.weekday.6")
13527
13793
  ], f = t("div", { class: "tokui-datepicker-weekdays" });
13528
13794
  d.forEach(function(e) {
13529
13795
  f.appendChild(t("span", { class: "tokui-datepicker-weekday" }, e));
13530
13796
  }), a.appendChild(f);
13531
- for (var m = t("div", { class: "tokui-datepicker-grid" }), h = new Date(e, n, 1).getDay(), g = new Date(e, n + 1, 0).getDate(), _ = new Date(e, n, 0).getDate(), v = i.getDate(), y = i.getFullYear() === e && i.getMonth() === n, b = h - 1; b >= 0; b--) m.appendChild(t("span", { class: "tokui-datepicker-day tokui-datepicker-day--other" }, String(_ - b)));
13797
+ for (var p = t("div", { class: "tokui-datepicker-grid" }), h = new Date(e, n, 1).getDay(), g = new Date(e, n + 1, 0).getDate(), _ = new Date(e, n, 0).getDate(), v = i.getDate(), y = i.getFullYear() === e && i.getMonth() === n, b = h - 1; b >= 0; b--) p.appendChild(t("span", { class: "tokui-datepicker-day tokui-datepicker-day--other" }, String(_ - b)));
13532
13798
  for (var x = 1; x <= g; x++) {
13533
13799
  var S = ["tokui-datepicker-day"];
13534
13800
  if (y && x === v && S.push("tokui-datepicker-day--today"), r && r.getFullYear() === e && r.getMonth() === n && r.getDate() === x && S.push("tokui-datepicker-day--selected"), o && (o.start || o.end)) {
@@ -13539,10 +13805,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13539
13805
  class: S.join(" "),
13540
13806
  "data-day": String(x)
13541
13807
  }, String(x));
13542
- m.appendChild(E);
13808
+ p.appendChild(E);
13543
13809
  }
13544
- for (var D = 42 - h - g, O = 1; O <= D; O++) m.appendChild(t("span", { class: "tokui-datepicker-day tokui-datepicker-day--other" }, String(O)));
13545
- return a.appendChild(m), {
13810
+ for (var D = 42 - h - g, O = 1; O <= D; O++) p.appendChild(t("span", { class: "tokui-datepicker-day tokui-datepicker-day--other" }, String(O)));
13811
+ return a.appendChild(p), {
13546
13812
  prevBtn: c,
13547
13813
  nextBtn: l
13548
13814
  };
@@ -13551,7 +13817,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13551
13817
  var r = n.attrs || {}, i = r.dis !== void 0, a = r.fmt || "YYYY-MM-DD", o = r.range !== void 0, s = r.ph || (o ? "YYYY-MM-DD ~ YYYY-MM-DD" : a), c = r.v || "", l = null, u = null;
13552
13818
  if (o && c) {
13553
13819
  var d = String(c).split(" ~ ");
13554
- if (l = j(d[0]), u = d.length > 1 ? j(d[1]) : null, l && u && u.getTime() < l.getTime()) {
13820
+ if (l = N(d[0]), u = d.length > 1 ? N(d[1]) : null, l && u && u.getTime() < l.getTime()) {
13555
13821
  var f = l;
13556
13822
  l = u, u = f;
13557
13823
  }
@@ -13572,13 +13838,13 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13572
13838
  var y = t("span", { class: "tokui-datepicker-icon" });
13573
13839
  y.innerHTML = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"/><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"/><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"/></svg>", g.appendChild(y), h.appendChild(g);
13574
13840
  var b = t("div", { class: "tokui-datepicker-dropdown" }), x = /* @__PURE__ */ new Date(), S, C, w;
13575
- c && (w = j(c), w && (S = w.getFullYear(), C = w.getMonth())), S || (S = x.getFullYear(), C = x.getMonth());
13841
+ c && (w = N(c), w && (S = w.getFullYear(), C = w.getMonth())), S || (S = x.getFullYear(), C = x.getMonth());
13576
13842
  var T = t("input", { type: "hidden" });
13577
13843
  r.n ? T.name = r.n : r.id && (T.name = r.id), T.value = c, h.appendChild(T);
13578
13844
  var E = e.createReporter("datepicker", r, p);
13579
13845
  function D(e, t) {
13580
13846
  b.innerHTML = "";
13581
- var n = q(e, t, w, x, b, o ? {
13847
+ var n = Y(e, t, w, x, b, o ? {
13582
13848
  start: l,
13583
13849
  end: u
13584
13850
  } : null);
@@ -13592,13 +13858,13 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13592
13858
  var O = !1;
13593
13859
  function k() {
13594
13860
  if (!(i || O)) {
13595
- U(A), O = !0, b.style.display = "", h.classList.add("tokui-datepicker--open");
13596
- var e = g.getBoundingClientRect(), t = b.offsetWidth, n = K(), r = e.left;
13861
+ G(A), O = !0, b.style.display = "", h.classList.add("tokui-datepicker--open");
13862
+ var e = g.getBoundingClientRect(), t = b.offsetWidth, n = J(), r = e.left;
13597
13863
  e.left + t > n - 8 && (r = Math.max(8, n - t - 8)), b.style.left = r + "px", b.style.top = e.bottom + 4 + "px", b.style.width = "auto";
13598
13864
  }
13599
13865
  }
13600
13866
  function A() {
13601
- O && (O = !1, b.style.display = "none", h.classList.remove("tokui-datepicker--open"), W(A));
13867
+ O && (O = !1, b.style.display = "none", h.classList.remove("tokui-datepicker--open"), K(A));
13602
13868
  }
13603
13869
  return i || (g.addEventListener("click", function(e) {
13604
13870
  e.stopPropagation(), O ? A() : k();
@@ -13610,7 +13876,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13610
13876
  if (o) {
13611
13877
  var s = new Date(S, C, i);
13612
13878
  if (!l || l && u ? (l = s, u = null) : s.getTime() < l.getTime() ? (u = l, l = s) : u = s, l && u) {
13613
- var c = N(l, "YYYY-MM-DD") + " ~ " + N(u, "YYYY-MM-DD");
13879
+ var c = F(l, "YYYY-MM-DD") + " ~ " + F(u, "YYYY-MM-DD");
13614
13880
  if (v.value = c, T.value = c, A(), r.clk) {
13615
13881
  var d = e.eventBus ? e.eventBus.getHandler(r.clk) : null;
13616
13882
  d && d({
@@ -13629,7 +13895,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13629
13895
  return;
13630
13896
  }
13631
13897
  w = new Date(S, C, i);
13632
- var f = N(w, a);
13898
+ var f = F(w, a);
13633
13899
  if (v.value = f, T.value = f, A(), D(S, C), r.clk) {
13634
13900
  var p = e.eventBus ? e.eventBus.getHandler(r.clk) : null;
13635
13901
  p && p({
@@ -13658,8 +13924,8 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13658
13924
  placeholder: o
13659
13925
  };
13660
13926
  r.id && (f.id = r.id), i && (f.disabled = "disabled"), s && (f.value = s);
13661
- var m = t("input", f);
13662
- d.appendChild(m);
13927
+ var p = t("input", f);
13928
+ d.appendChild(p);
13663
13929
  var h = t("span", { class: "tokui-timepicker-icon" });
13664
13930
  h.innerHTML = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><polyline points=\"12 6 12 12 16 14\"/></svg>", d.appendChild(h), u.appendChild(d);
13665
13931
  var g = 0, _ = 0, v = 0;
@@ -13667,14 +13933,14 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13667
13933
  var y = s.split(":");
13668
13934
  g = parseInt(y[0]) || 0, _ = parseInt(y[1]) || 0, v = parseInt(y[2]) || 0;
13669
13935
  }
13670
- var b = t("div", { class: "tokui-timepicker-dropdown" }), x = a.indexOf("ss") !== -1 || a.indexOf("s") !== -1, S = t("div", { class: "tokui-timepicker-columns" }), C = z(p("duration.hour"), 24, g), w = z(p("duration.minute"), 60, _);
13936
+ var b = t("div", { class: "tokui-timepicker-dropdown" }), x = a.indexOf("ss") !== -1 || a.indexOf("s") !== -1, S = t("div", { class: "tokui-timepicker-columns" }), C = V(m("duration.hour"), 24, g), w = V(m("duration.minute"), 60, _);
13671
13937
  S.appendChild(C), S.appendChild(w);
13672
13938
  var T = null;
13673
- x && (T = z(p("duration.second"), 60, v), S.appendChild(T)), b.appendChild(S);
13939
+ x && (T = V(m("duration.second"), 60, v), S.appendChild(T)), b.appendChild(S);
13674
13940
  var E = t("div", { class: "tokui-timepicker-footer" }), D = t("button", {
13675
13941
  class: "tokui-timepicker-confirm",
13676
13942
  type: "button"
13677
- }, p("common.ok"));
13943
+ }, m("common.ok"));
13678
13944
  E.appendChild(D), b.appendChild(E);
13679
13945
  var O = t("input", { type: "hidden" });
13680
13946
  r.n ? O.name = r.n : r.id && (O.name = r.id), O.value = s, u.appendChild(O);
@@ -13683,20 +13949,20 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13683
13949
  var A = !1;
13684
13950
  function j() {
13685
13951
  if (!(i || A)) {
13686
- U(M), A = !0, b.style.display = "", u.classList.add("tokui-timepicker--open");
13687
- var e = d.getBoundingClientRect(), t = b.offsetWidth, n = K(), r = e.left;
13688
- e.left + t > n - 8 && (r = Math.max(8, n - t - 8)), b.style.left = r + "px", b.style.top = e.bottom + 4 + "px", b.style.width = "auto", V(C, g), V(w, _), x && T && V(T, v);
13952
+ G(M), A = !0, b.style.display = "", u.classList.add("tokui-timepicker--open");
13953
+ var e = d.getBoundingClientRect(), t = b.offsetWidth, n = J(), r = e.left;
13954
+ e.left + t > n - 8 && (r = Math.max(8, n - t - 8)), b.style.left = r + "px", b.style.top = e.bottom + 4 + "px", b.style.width = "auto", U(C, g), U(w, _), x && T && U(T, v);
13689
13955
  }
13690
13956
  }
13691
13957
  function M() {
13692
- A && (A = !1, b.style.display = "none", u.classList.remove("tokui-timepicker--open"), W(M));
13958
+ A && (A = !1, b.style.display = "none", u.classList.remove("tokui-timepicker--open"), K(M));
13693
13959
  }
13694
13960
  return i || (d.addEventListener("click", function(e) {
13695
13961
  e.stopPropagation(), A ? M() : j();
13696
13962
  }), D.addEventListener("click", function(t) {
13697
- t.stopPropagation(), g = B(C), _ = B(w), x && T && (v = B(T));
13698
- var n = P(g, _, v, a);
13699
- if (m.value = n, O.value = n, M(), r.clk) {
13963
+ t.stopPropagation(), g = H(C), _ = H(w), x && T && (v = H(T));
13964
+ var n = I(g, _, v, a);
13965
+ if (p.value = n, O.value = n, M(), r.clk) {
13700
13966
  var i = e.eventBus ? e.eventBus.getHandler(r.clk) : null;
13701
13967
  i && i({
13702
13968
  value: n,
@@ -13725,21 +13991,21 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13725
13991
  placeholder: o
13726
13992
  };
13727
13993
  r.id && (f.id = r.id), i && (f.disabled = "disabled"), s && (f.value = s);
13728
- var m = t("input", f);
13729
- d.appendChild(m);
13994
+ var p = t("input", f);
13995
+ d.appendChild(p);
13730
13996
  var h = t("span", { class: "tokui-datetimepicker-icon" });
13731
13997
  h.innerHTML = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"/><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"/><line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"/></svg>", d.appendChild(h), u.appendChild(d);
13732
13998
  var g = /* @__PURE__ */ new Date(), _, v, y, b = 0, x = 0, S = 0;
13733
- s && (y = M(s) || j(s), y && (_ = y.getFullYear(), v = y.getMonth(), b = y.getHours(), x = y.getMinutes(), S = y.getSeconds())), _ || (_ = g.getFullYear(), v = g.getMonth());
13999
+ s && (y = P(s) || N(s), y && (_ = y.getFullYear(), v = y.getMonth(), b = y.getHours(), x = y.getMinutes(), S = y.getSeconds())), _ || (_ = g.getFullYear(), v = g.getMonth());
13734
14000
  var C = t("input", { type: "hidden" });
13735
14001
  r.n ? C.name = r.n : r.id && (C.name = r.id), C.value = s, u.appendChild(C);
13736
- var w = e.createReporter("datetimepicker", r, c), T = t("div", { class: "tokui-datetimepicker-dropdown" }), E = t("div", { class: "tokui-datetimepicker-date" }), D = a.indexOf("ss") !== -1 || a.indexOf("s") !== -1, O = t("div", { class: "tokui-datetimepicker-time" }), k = t("div", { class: "tokui-timepicker-columns" }), A = z(p("duration.hour"), 24, b), P = z(p("duration.minute"), 60, x);
13737
- k.appendChild(A), k.appendChild(P);
13738
- var F = null;
13739
- D && (F = z(p("duration.second"), 60, S), k.appendChild(F)), O.appendChild(k);
14002
+ var w = e.createReporter("datetimepicker", r, c), T = t("div", { class: "tokui-datetimepicker-dropdown" }), E = t("div", { class: "tokui-datetimepicker-date" }), D = a.indexOf("ss") !== -1 || a.indexOf("s") !== -1, O = t("div", { class: "tokui-datetimepicker-time" }), k = t("div", { class: "tokui-timepicker-columns" }), A = V(m("duration.hour"), 24, b), j = V(m("duration.minute"), 60, x);
14003
+ k.appendChild(A), k.appendChild(j);
14004
+ var M = null;
14005
+ D && (M = V(m("duration.second"), 60, S), k.appendChild(M)), O.appendChild(k);
13740
14006
  function I(e, t) {
13741
14007
  E.innerHTML = "";
13742
- var n = q(e, t, y, g, E);
14008
+ var n = Y(e, t, y, g, E);
13743
14009
  n.prevBtn.addEventListener("click", function(e) {
13744
14010
  e.stopPropagation(), v--, v < 0 && (v = 11, _--), I(_, v);
13745
14011
  }), n.nextBtn.addEventListener("click", function(e) {
@@ -13749,23 +14015,23 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13749
14015
  var L = t("div", { class: "tokui-datetimepicker-footer" }), R = t("button", {
13750
14016
  class: "tokui-timepicker-confirm",
13751
14017
  type: "button"
13752
- }, p("common.ok"));
14018
+ }, m("common.ok"));
13753
14019
  L.appendChild(R);
13754
- var H = t("div", { class: "tokui-datetimepicker-body" });
13755
- H.appendChild(E), H.appendChild(O), T.appendChild(H), T.appendChild(L), I(_, v), T.style.display = "none", u.appendChild(T);
13756
- var G = !1;
13757
- function J() {
13758
- if (!(i || G)) {
13759
- U(Y), G = !0, T.style.display = "", u.classList.add("tokui-datetimepicker--open");
13760
- var e = d.getBoundingClientRect(), t = T.offsetWidth, n = K(), r = e.left;
13761
- e.left + t > n - 8 && (r = Math.max(8, n - t - 8)), T.style.left = r + "px", T.style.top = e.bottom + 4 + "px", T.style.width = "auto", V(A, b), V(P, x), D && F && V(F, S);
14020
+ var z = t("div", { class: "tokui-datetimepicker-body" });
14021
+ z.appendChild(E), z.appendChild(O), T.appendChild(z), T.appendChild(L), I(_, v), T.style.display = "none", u.appendChild(T);
14022
+ var B = !1;
14023
+ function W() {
14024
+ if (!(i || B)) {
14025
+ G(q), B = !0, T.style.display = "", u.classList.add("tokui-datetimepicker--open");
14026
+ var e = d.getBoundingClientRect(), t = T.offsetWidth, n = J(), r = e.left;
14027
+ e.left + t > n - 8 && (r = Math.max(8, n - t - 8)), T.style.left = r + "px", T.style.top = e.bottom + 4 + "px", T.style.width = "auto", U(A, b), U(j, x), D && M && U(M, S);
13762
14028
  }
13763
14029
  }
13764
- function Y() {
13765
- G && (G = !1, T.style.display = "none", u.classList.remove("tokui-datetimepicker--open"), W(Y));
14030
+ function q() {
14031
+ B && (B = !1, T.style.display = "none", u.classList.remove("tokui-datetimepicker--open"), K(q));
13766
14032
  }
13767
14033
  return i || (d.addEventListener("click", function(e) {
13768
- e.stopPropagation(), G ? Y() : J();
14034
+ e.stopPropagation(), B ? q() : W();
13769
14035
  }), E.addEventListener("click", function(e) {
13770
14036
  e.stopPropagation();
13771
14037
  var t = e.target.closest(".tokui-datepicker-day");
@@ -13774,9 +14040,9 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13774
14040
  y = new Date(_, v, n), I(_, v);
13775
14041
  }
13776
14042
  }), R.addEventListener("click", function(t) {
13777
- t.stopPropagation(), y ||= new Date(_, v, g.getDate()), b = B(A), x = B(P), D && F && (S = B(F)), y.setHours(b, x, S);
13778
- var n = N(y, a);
13779
- if (m.value = n, C.value = n, Y(), r.clk) {
14043
+ t.stopPropagation(), y ||= new Date(_, v, g.getDate()), b = H(A), x = H(j), D && M && (S = H(M)), y.setHours(b, x, S);
14044
+ var n = F(y, a);
14045
+ if (p.value = n, C.value = n, q(), r.clk) {
13780
14046
  var i = e.eventBus ? e.eventBus.getHandler(r.clk) : null;
13781
14047
  i && i({
13782
14048
  value: n,
@@ -13789,8 +14055,192 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13789
14055
  name: r.n || void 0
13790
14056
  });
13791
14057
  }), typeof document < "u" && document.addEventListener("click", function(e) {
13792
- u.contains(e.target) || Y();
14058
+ u.contains(e.target) || q();
13793
14059
  })), c.appendChild(u), c._variantTarget = u, c;
14060
+ }), e.register("color-picker", (n) => {
14061
+ var r = n.attrs || {}, i = typeof l == "function" ? f() : window.TokUI && window.TokUI._internal || {};
14062
+ function a(e) {
14063
+ var t = String(e ?? "").trim();
14064
+ return /^#[0-9a-fA-F]{6}$/.test(t) ? t.toLowerCase() : /^[0-9a-fA-F]{6}$/.test(t) ? ("#" + t).toLowerCase() : null;
14065
+ }
14066
+ var o = a(r.v) || "#1677ff", s = r.dis !== void 0, c = t("div", { class: "tokui-field" });
14067
+ r.l && c.appendChild(t("div", { class: "tokui-label" + (r.req === void 0 ? "" : " tokui-label--req") }, r.l));
14068
+ var u = t("div", { class: "tokui-color-picker" + (s ? " tokui-color-picker--disabled" : "") });
14069
+ r.id && (u.id = r.id);
14070
+ var d = t("button", {
14071
+ class: "tokui-color-picker__trigger",
14072
+ type: "button",
14073
+ "aria-label": m("colorPicker.aria")
14074
+ });
14075
+ s && (d.disabled = "disabled");
14076
+ var p = t("span", { class: "tokui-color-picker__swatch" }), h = t("span", { class: "tokui-color-picker__hex" });
14077
+ d.appendChild(p), d.appendChild(h), u.appendChild(d);
14078
+ var g = {
14079
+ type: "hidden",
14080
+ class: "tokui-color-picker__input"
14081
+ };
14082
+ r.n ? g.name = r.n : r.id && (g.name = r.id);
14083
+ var _ = t("input", g);
14084
+ u.appendChild(_);
14085
+ var v = t("div", { class: "tokui-color-picker__panel" });
14086
+ v.style.display = "none";
14087
+ var y = t("div", { class: "tokui-color-picker__sb" }), b = t("span", { class: "tokui-color-picker__sb-cursor" });
14088
+ y.appendChild(b), v.appendChild(y);
14089
+ var x = t("input", {
14090
+ type: "range",
14091
+ class: "tokui-color-picker__hue",
14092
+ min: "0",
14093
+ max: "360",
14094
+ step: "1",
14095
+ "aria-label": m("colorPicker.hue")
14096
+ });
14097
+ v.appendChild(x);
14098
+ var S = t("div", { class: "tokui-color-picker__hex-row" }), C = t("input", {
14099
+ type: "text",
14100
+ class: "tokui-color-picker__hex-input",
14101
+ maxlength: "7",
14102
+ "aria-label": m("colorPicker.hex")
14103
+ }), w = t("button", {
14104
+ class: "tokui-color-picker__clear",
14105
+ type: "button"
14106
+ }, m("colorPicker.clear"));
14107
+ S.appendChild(C), S.appendChild(w), v.appendChild(S);
14108
+ var T = String(r.presets || "").split(",").map(function(e) {
14109
+ return a(e);
14110
+ }).filter(Boolean);
14111
+ if (T.length) {
14112
+ var E = t("div", {
14113
+ class: "tokui-color-picker__presets",
14114
+ "aria-label": m("colorPicker.preset")
14115
+ });
14116
+ T.forEach(function(e) {
14117
+ var n = t("button", {
14118
+ class: "tokui-color-picker__preset",
14119
+ type: "button",
14120
+ "data-color": e,
14121
+ "aria-label": e
14122
+ });
14123
+ n.style.backgroundColor = e, E.appendChild(n);
14124
+ }), v.appendChild(E);
14125
+ }
14126
+ u.appendChild(v), c.appendChild(u), c._tokuiType = "color-picker", c._slot = u;
14127
+ var D = i.rgbToHsv ? (function() {
14128
+ var e = i.hexToRgb(o);
14129
+ return i.rgbToHsv(e.r, e.g, e.b);
14130
+ })() : {
14131
+ h: 220,
14132
+ s: 1,
14133
+ v: 1
14134
+ }, O = o;
14135
+ function k() {
14136
+ if (!i.hsvToRgb || !i.rgbToHex) return O;
14137
+ var e = i.hsvToRgb(D.h, D.s, D.v);
14138
+ return i.rgbToHex(e);
14139
+ }
14140
+ function A() {
14141
+ O = k(), p.style.backgroundColor = O, h.textContent = O, _.value = O, y.style.backgroundColor = i.hsvToRgb && i.rgbToHex ? i.rgbToHex(i.hsvToRgb(D.h, 1, 1)) : "#f00", b.style.left = D.s * 100 + "%", b.style.top = (1 - D.v) * 100 + "%", x.value = String(Math.round(D.h)), L.activeElement !== C && (C.value = O);
14142
+ }
14143
+ var j = e.createReporter("color-picker", r, c);
14144
+ function M(e) {
14145
+ var t = i.hexToRgb(e);
14146
+ D = i.rgbToHsv(t.r, t.g, t.b), A(), j("change", {
14147
+ value: O,
14148
+ name: r.n || void 0
14149
+ });
14150
+ }
14151
+ var N = !1;
14152
+ function P() {
14153
+ if (!(typeof d.getBoundingClientRect != "function" || typeof window > "u")) {
14154
+ var e = d.getBoundingClientRect(), t = v.offsetWidth || 232, n = v.offsetHeight || 260, r = window.innerWidth || 1024, i = window.innerHeight || 768, a = e.left, o = e.bottom + 4;
14155
+ a + t > r - 8 && (a = Math.max(8, r - t - 8)), o + n > i - 8 && (o = Math.max(8, e.top - n - 4)), v.style.left = a + "px", v.style.top = o + "px";
14156
+ }
14157
+ }
14158
+ function F() {
14159
+ s || N || (N = !0, L && L.body && v.parentNode !== L.body && L.body.appendChild(v), v.style.display = "", P(), u.classList.add("tokui-color-picker--open"));
14160
+ }
14161
+ function I() {
14162
+ N && (N = !1, v.style.display = "none", u.classList.remove("tokui-color-picker--open"));
14163
+ }
14164
+ var L = typeof document < "u" ? document : null;
14165
+ L && (L.addEventListener("click", function(e) {
14166
+ N && u.contains && !u.contains(e.target) && !(v.contains && v.contains(e.target)) && I();
14167
+ }), L.addEventListener("keydown", function(e) {
14168
+ N && e.key === "Escape" && I();
14169
+ }), typeof window < "u" && window.addEventListener && window.addEventListener("scroll", function() {
14170
+ if (N) {
14171
+ if (!L.contains(u)) {
14172
+ I(), v.parentNode && v.parentNode.removeChild(v);
14173
+ return;
14174
+ }
14175
+ P();
14176
+ }
14177
+ }, {
14178
+ capture: !0,
14179
+ passive: !0
14180
+ })), d.addEventListener("click", function(e) {
14181
+ typeof e.stopPropagation == "function" && e.stopPropagation(), N ? I() : F();
14182
+ });
14183
+ function R(e) {
14184
+ if (typeof y.getBoundingClientRect == "function") {
14185
+ var t = y.getBoundingClientRect();
14186
+ if (!(!t.width || !t.height)) {
14187
+ var n = (e.clientX == null ? 0 : e.clientX) - t.left, i = (e.clientY == null ? 0 : e.clientY) - t.top;
14188
+ D.s = Math.max(0, Math.min(1, n / t.width)), D.v = Math.max(0, Math.min(1, 1 - i / t.height)), A(), j("change", {
14189
+ value: O,
14190
+ name: r.n || void 0
14191
+ });
14192
+ }
14193
+ }
14194
+ }
14195
+ y.addEventListener("pointerdown", function(e) {
14196
+ if (typeof e.preventDefault == "function" && e.preventDefault(), typeof y.setPointerCapture == "function" && e.pointerId != null) try {
14197
+ y.setPointerCapture(e.pointerId);
14198
+ } catch {}
14199
+ R(e);
14200
+ var t = function(e) {
14201
+ R(e);
14202
+ }, n = function() {
14203
+ L && (L.removeEventListener("pointermove", t), L.removeEventListener("pointerup", n));
14204
+ };
14205
+ L && (L.addEventListener("pointermove", t), L.addEventListener("pointerup", n));
14206
+ }), x.addEventListener("input", function() {
14207
+ D.h = parseFloat(x.value) || 0, A(), j("change", {
14208
+ value: O,
14209
+ name: r.n || void 0
14210
+ });
14211
+ }), C.addEventListener("change", function() {
14212
+ var e = a(C.value);
14213
+ e ? M(e) : C.value = O;
14214
+ }), T.length && v.addEventListener("click", function(e) {
14215
+ var t = e.target && e.target.closest ? e.target.closest(".tokui-color-picker__preset") : null;
14216
+ t && M(t.getAttribute("data-color"));
14217
+ }), w.addEventListener("click", function(e) {
14218
+ typeof e.stopPropagation == "function" && e.stopPropagation(), O = "", p.style.backgroundColor = "transparent", h.textContent = "", _.value = "", C.value = "", j("change", {
14219
+ value: "",
14220
+ name: r.n || void 0
14221
+ });
14222
+ }), c._update = function(e) {
14223
+ if (e.v !== void 0) {
14224
+ var t = a(e.v);
14225
+ if (t && i.hexToRgb) {
14226
+ var n = i.hexToRgb(t);
14227
+ D = i.rgbToHsv(n.r, n.g, n.b), A();
14228
+ }
14229
+ }
14230
+ (e.dis === !0 || e.dis === "true" || e.dis === !1 || e.dis === "false") && (s = e.dis === !0 || e.dis === "true", d.disabled = s, u.classList.toggle("tokui-color-picker--disabled", s), s && I());
14231
+ };
14232
+ var z = {
14233
+ h: D.h,
14234
+ s: D.s,
14235
+ v: D.v
14236
+ };
14237
+ return c.setAttribute("data-tokui-resettable", ""), c._tokuiReset = function() {
14238
+ D = {
14239
+ h: z.h,
14240
+ s: z.s,
14241
+ v: z.v
14242
+ }, A();
14243
+ }, A(), c;
13794
14244
  });
13795
14245
  }
13796
14246
  typeof window < "u" && (window.TokUI = window.TokUI || {}, window.TokUI._internal = window.TokUI._internal || {}, window.TokUI._internal.registerFormComponents = s, window.TokUI._internal._parseOptShorthand = n, window.TokUI._internal._expandOptChildren = o), t !== void 0 && t.exports && (t.exports = {
@@ -13802,20 +14252,70 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13802
14252
  var n = typeof l == "function" ? u().t : window.TokUI && window.TokUI._internal && window.TokUI._internal.t || function(e) {
13803
14253
  return e;
13804
14254
  };
13805
- function r(e) {
14255
+ function r() {
14256
+ if (typeof window > "u" || typeof document > "u" || (window.TokUI = window.TokUI || {}, window.TokUI.modal && window.TokUI.modal.confirm)) return;
14257
+ function e(e) {
14258
+ return e ||= {}, new Promise(function(t) {
14259
+ var r = document, i = r.createElement("div");
14260
+ i.className = "tokui-modal__overlay", i.setAttribute("role", "dialog"), i.setAttribute("aria-modal", "true"), i.setAttribute("aria-label", e.tt || n("modal.aria"));
14261
+ var a = r.createElement("div");
14262
+ a.className = "tokui-modal__panel";
14263
+ var o = r.createElement("div");
14264
+ o.className = "tokui-modal__header";
14265
+ var s = r.createElement("div");
14266
+ if (s.className = "tokui-modal__title", s.textContent = e.tt || n("modal.aria"), o.appendChild(s), a.appendChild(o), e.tx) {
14267
+ var c = r.createElement("div");
14268
+ c.className = "tokui-modal__body", c.textContent = e.tx, a.appendChild(c);
14269
+ }
14270
+ var l = r.createElement("div");
14271
+ l.className = "tokui-modal__footer";
14272
+ var u = r.createElement("button");
14273
+ u.type = "button", u.className = "tokui-btn tokui-modal__cancel", u.textContent = e["cancel-text"] || n("common.cancel");
14274
+ var d = r.createElement("button");
14275
+ d.type = "button", d.className = "tokui-btn tokui-modal__ok" + (e.t === "danger" ? " tokui-btn--danger" : " tokui-btn--primary"), d.textContent = e["ok-text"] || n("common.ok"), l.appendChild(u), l.appendChild(d), a.appendChild(l), i.appendChild(a);
14276
+ var f = !1;
14277
+ function p() {
14278
+ r.removeEventListener("keydown", h, !0), i.parentNode && i.parentNode.removeChild(i);
14279
+ }
14280
+ function m(n) {
14281
+ if (!f) {
14282
+ f = !0, p();
14283
+ var r = n ? e.onOk : e.onCancel;
14284
+ if (typeof r == "function") try {
14285
+ r();
14286
+ } catch {}
14287
+ t(n);
14288
+ }
14289
+ }
14290
+ function h(e) {
14291
+ e.key === "Escape" && (typeof e.stopPropagation == "function" && e.stopPropagation(), m(!1));
14292
+ }
14293
+ d.addEventListener("click", function() {
14294
+ m(!0);
14295
+ }), u.addEventListener("click", function() {
14296
+ m(!1);
14297
+ }), i.addEventListener("click", function(e) {
14298
+ e.target === i && m(!1);
14299
+ }), r.addEventListener("keydown", h, !0), r.body && r.body.appendChild(i), typeof d.focus == "function" && d.focus();
14300
+ });
14301
+ }
14302
+ window.TokUI.modal = { confirm: e }, window.TokUI.confirm || (window.TokUI.confirm = e);
14303
+ }
14304
+ function i(e) {
13806
14305
  let { el: t } = typeof l == "function" ? h() : window.TokUI._internal;
13807
- var r = /^(background-color|color|border(-radius|-top|-bottom|-left|-right)?|padding(-top|-bottom|-left|-right)?|margin(-top|-bottom|-left|-right)?|text-align|max-width|min-height|box-shadow|opacity|font-size|font-weight|line-height|border-radius|overflow|cursor|gap|display|flex-wrap|align-items|justify-content|width|height|float|clear|visibility|white-space|word-break|text-overflow|text-decoration|list-style|vertical-align|transition|transform)$/;
13808
- function i(e) {
14306
+ r();
14307
+ var i = /^(background-color|color|border(-radius|-top|-bottom|-left|-right)?|padding(-top|-bottom|-left|-right)?|margin(-top|-bottom|-left|-right)?|text-align|max-width|min-height|box-shadow|opacity|font-size|font-weight|line-height|border-radius|overflow|cursor|gap|display|flex-wrap|align-items|justify-content|width|height|float|clear|visibility|white-space|word-break|text-overflow|text-decoration|list-style|vertical-align|transition|transform)$/;
14308
+ function a(e) {
13809
14309
  if (e) return e.split(";").filter(function(e) {
13810
14310
  var t = e.split(":")[0].trim().toLowerCase();
13811
- return t && r.test(t);
14311
+ return t && i.test(t);
13812
14312
  }).join(";") || void 0;
13813
14313
  }
13814
14314
  e.register("card", (e, n) => {
13815
14315
  let r = { class: "tokui-card" };
13816
14316
  e.attrs.id && (r.id = e.attrs.id);
13817
- var a = i(e.attrs.style);
13818
- a && (r.style = a);
14317
+ var i = a(e.attrs.style);
14318
+ i && (r.style = i);
13819
14319
  let o = t("div", r);
13820
14320
  if (e.attrs.w && (o.style.width = /^\d+$/.test(e.attrs.w) ? e.attrs.w + "px" : e.attrs.w), e.attrs.tt) {
13821
14321
  var s = "tokui-card-header", c = e.attrs.hc || "";
@@ -13840,21 +14340,21 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13840
14340
  "info",
13841
14341
  "dark"
13842
14342
  ].indexOf(c) === -1) {
13843
- var u = e.attrs.ht || "";
13844
- u === "fill" ? (l.style.background = c, l.style.color = "#fff") : u === "accent" ? l.style.borderLeftColor = c : u === "underline" ? l.style.setProperty("--tokui-card-header-underline-color", c) : u === "dot" ? l.style.setProperty("--tokui-card-header-dot-color", c) : u === "pill" && (l.style.background = c, l.style.color = "#fff");
14343
+ var u = e.attrs.ht || "", d = /^(#[0-9a-fA-F]{3,8}|rgba?\([\d\s.,%]+\)|[a-zA-Z]+)$/.test(c) ? c : "";
14344
+ u === "fill" || u === "pill" ? d && (l.style.background = "color-mix(in srgb, " + d + " 10%, transparent)", l.style.color = d, u === "fill" ? l.style.borderBottom = "1px solid color-mix(in srgb, " + d + " 22%, transparent)" : l.style.borderColor = "color-mix(in srgb, " + d + " 22%, transparent)") : u === "accent" ? l.style.borderLeftColor = c : u === "underline" ? l.style.setProperty("--tokui-card-header-underline-color", c) : u === "dot" && l.style.setProperty("--tokui-card-header-dot-color", c);
13845
14345
  }
13846
14346
  o.appendChild(l);
13847
14347
  }
13848
- let d = [], f = [];
14348
+ let f = [], p = [];
13849
14349
  (e.children || []).forEach((e) => {
13850
- e.type === "ft" ? f.push(e) : d.push(e);
14350
+ e.type === "ft" ? p.push(e) : f.push(e);
13851
14351
  });
13852
- let p = t("div", { class: "tokui-card-body" });
13853
- return e.attrs.tx && (p.textContent = e.attrs.tx), n(d).forEach((e) => {
13854
- e && e.nodeType && p.appendChild(e);
13855
- }), o.appendChild(p), n(f).forEach((e) => {
14352
+ let m = t("div", { class: "tokui-card-body" });
14353
+ return e.attrs.tx && (m.textContent = e.attrs.tx), n(f).forEach((e) => {
14354
+ e && e.nodeType && m.appendChild(e);
14355
+ }), o.appendChild(m), n(p).forEach((e) => {
13856
14356
  e && e.nodeType && o.appendChild(e);
13857
- }), o._slot = p, o._tokuiType = "card", o._update = function(e) {
14357
+ }), o._slot = m, o._tokuiType = "card", o._update = function(e) {
13858
14358
  if (e.tt !== void 0) {
13859
14359
  var t = o.querySelector(".tokui-card-header");
13860
14360
  t && (t.textContent = e.tt);
@@ -13892,7 +14392,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13892
14392
  e && e.nodeType && r.appendChild(e);
13893
14393
  }), r._slot = r, r._tokuiType = "list", r;
13894
14394
  });
13895
- function a(e, n) {
14395
+ function o(e, n) {
13896
14396
  var r = e.attrs || {}, i = parseInt(r.span) || 1, a = t("div", {
13897
14397
  class: "tokui-desc__item",
13898
14398
  "data-tokui-tag": e.type
@@ -13908,11 +14408,11 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13908
14408
  }
13909
14409
  e.register("item", (e, n, r) => {
13910
14410
  var i;
13911
- if (r === "desc") i = a(e);
13912
- else if (r === "carousel") i = u(e, n);
14411
+ if (r === "desc") i = o(e);
14412
+ else if (r === "carousel") i = d(e, n);
13913
14413
  else if (r === "command-group") {
13914
- var o = typeof window < "u" && window.TokUI && window.TokUI._internal && window.TokUI._internal.buildCommandItem || null;
13915
- o && (i = o(e));
14414
+ var a = typeof window < "u" && window.TokUI && window.TokUI._internal && window.TokUI._internal.buildCommandItem || null;
14415
+ a && (i = a(e));
13916
14416
  }
13917
14417
  if (!i) {
13918
14418
  i = t("li", { class: "tokui-list-item" });
@@ -13930,9 +14430,9 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13930
14430
  n.attrs.id && (i.id = n.attrs.id);
13931
14431
  let a = "tokui-tab-" + Math.random().toString(36).slice(2, 8);
13932
14432
  i._tabId = a, i._tabCount = 0;
13933
- var s = e.createReporter("tabs", n.attrs, i);
14433
+ var o = e.createReporter("tabs", n.attrs, i);
13934
14434
  return (n.children || []).forEach((e, t) => {
13935
- e.type === "tab" && (o(i, e, r, a, t), i._tabCount = t + 1);
14435
+ e.type === "tab" && (s(i, e, r, a, t), i._tabCount = t + 1);
13936
14436
  }), i._slot = i, i._tokuiType = "tabs", i.addEventListener("keydown", function(e) {
13937
14437
  if (!(e.key !== "ArrowRight" && e.key !== "ArrowLeft")) {
13938
14438
  var t = Array.from(i.querySelectorAll(".tokui-tabs-label")), n = t.indexOf(e.target);
@@ -13946,7 +14446,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13946
14446
  var t = e.target;
13947
14447
  if (!(!t || !t.classList || !t.classList.contains("tokui-tabs-input"))) {
13948
14448
  var n = parseInt(t.getAttribute("data-index"), 10), r = i.querySelector(".tokui-tabs-label[data-index=\"" + n + "\"]");
13949
- s("change", {
14449
+ o("change", {
13950
14450
  index: n,
13951
14451
  title: r ? r.textContent : ""
13952
14452
  });
@@ -13963,7 +14463,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
13963
14463
  }
13964
14464
  }, i;
13965
14465
  });
13966
- function o(e, n, r, i, a) {
14466
+ function s(e, n, r, i, a) {
13967
14467
  var o = {
13968
14468
  type: "radio",
13969
14469
  name: i,
@@ -14145,7 +14645,13 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14145
14645
  function u(e, t) {
14146
14646
  e.querySelectorAll(".tokui-img").forEach((e) => {
14147
14647
  if (e._lbBound) return;
14148
- e._lbBound = !0;
14648
+ if (e._lbBound = !0, typeof e.cloneNode != "function" || !e.parentNode) {
14649
+ e.style.cursor = "pointer", e.addEventListener("click", function() {
14650
+ let { getLightbox: n } = typeof l == "function" ? g() : window.TokUI._internal;
14651
+ n(typeof document < "u" ? document : void 0).open(e.getAttribute("src"), t);
14652
+ });
14653
+ return;
14654
+ }
14149
14655
  let n = e.cloneNode(!0);
14150
14656
  e.parentNode.replaceChild(n, e), n.style.cursor = "pointer", n.addEventListener("click", function() {
14151
14657
  let { getLightbox: e } = typeof l == "function" ? g() : window.TokUI._internal;
@@ -14161,6 +14667,135 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14161
14667
  t.push(e.getAttribute("src"));
14162
14668
  }), u(i, t);
14163
14669
  }, i;
14670
+ }), e.register("preview-group", (e, r) => {
14671
+ var i = e.attrs || {}, a = t("div", {
14672
+ class: "tokui-preview-group",
14673
+ role: "group",
14674
+ "aria-label": n("previewGroup.aria")
14675
+ });
14676
+ i.id && (a.id = i.id), r(e.children || []).forEach(function(e) {
14677
+ e && e.nodeType && a.appendChild(e);
14678
+ }), a._slot = a, a._tokuiType = "preview-group";
14679
+ function o(e) {
14680
+ var t = e.querySelectorAll(".tokui-img"), n = [];
14681
+ t.forEach(function(e) {
14682
+ var t = e.getAttribute("src");
14683
+ t && n.push(t);
14684
+ }), t.forEach(function(e) {
14685
+ if (!e._pgBound) {
14686
+ e._pgBound = !0;
14687
+ var t = e;
14688
+ typeof e.cloneNode == "function" && e.parentNode && (t = e.cloneNode(!0), t._pgBound = !0, e.parentNode.replaceChild(t, e)), t.style.cursor = "zoom-in", t.addEventListener("click", function() {
14689
+ var e = (typeof l == "function" ? g().getLightbox : window.TokUI._internal.getLightbox)(typeof document < "u" ? document : void 0), r = [];
14690
+ a.querySelectorAll(".tokui-img").forEach(function(e) {
14691
+ var t = e.getAttribute("src");
14692
+ t && r.push(t);
14693
+ }), e.open(t.getAttribute("src"), r.length ? r : n);
14694
+ });
14695
+ }
14696
+ });
14697
+ }
14698
+ return o(a), a._streamCloseHook = function() {
14699
+ o(a);
14700
+ }, a;
14701
+ }), e.register("tour", (r, i) => {
14702
+ var a = r.attrs || {}, o = t("div", { class: "tokui-tour" });
14703
+ a.id && (o.id = a.id), i(r.children || []).forEach(function(e) {
14704
+ e && e.nodeType && o.appendChild(e);
14705
+ }), o._slot = o, o._tokuiType = "tour", o._report = e.createReporter("tour", a, o), o._tourMask = a.mask !== "false", o._collectSteps = function() {
14706
+ var e = [];
14707
+ return o.querySelectorAll(".tokui-tour-step").forEach(function(t) {
14708
+ e.push({
14709
+ tgt: t.getAttribute("data-tgt") || "",
14710
+ tt: t.getAttribute("data-tt") || "",
14711
+ tx: t.getAttribute("data-tx") || "",
14712
+ pos: t.getAttribute("data-pos") || "bottom"
14713
+ });
14714
+ }), e;
14715
+ };
14716
+ var s = null, c = 0, l = typeof document < "u" ? document : null;
14717
+ function u(e) {
14718
+ return !e || !l || typeof l.getElementById != "function" ? null : l.getElementById(String(e).replace(/^#/, ""));
14719
+ }
14720
+ function d(e, t, n) {
14721
+ var r = u(n.tgt);
14722
+ if (!r || typeof r.getBoundingClientRect != "function" || typeof e.getBoundingClientRect != "function" || typeof window > "u") {
14723
+ t.style.display = "none", e.style.left = "50%", e.style.top = "50%", e.style.transform = "translate(-50%, -50%)";
14724
+ return;
14725
+ }
14726
+ e.style.transform = "";
14727
+ var i = r.getBoundingClientRect();
14728
+ t.style.display = "", t.style.left = i.left - 4 + "px", t.style.top = i.top - 4 + "px", t.style.width = i.width + 8 + "px", t.style.height = i.height + 8 + "px";
14729
+ var a = e.offsetWidth || 280, o = e.offsetHeight || 120, s = window.innerWidth || 1024, c = window.innerHeight || 768, l = i.left, d = i.bottom + 8;
14730
+ n.pos === "top" ? d = i.top - o - 8 : n.pos === "left" ? (l = i.left - a - 8, d = i.top) : n.pos === "right" && (l = i.right + 8, d = i.top), l = Math.max(8, Math.min(l, s - a - 8)), d = Math.max(8, Math.min(d, c - o - 8)), e.style.left = l + "px", e.style.top = d + "px";
14731
+ }
14732
+ function f(e, t) {
14733
+ var r = o._collectSteps();
14734
+ if (!(!s || r.length === 0)) {
14735
+ c = Math.max(0, Math.min(e, r.length - 1));
14736
+ var i = r[c], a = s.querySelector(".tokui-tour__title"), l = s.querySelector(".tokui-tour__body"), u = s.querySelector(".tokui-tour__counter"), f = s.querySelector(".tokui-tour__prev"), p = s.querySelector(".tokui-tour__next"), m = s.querySelector(".tokui-tour__highlight"), h = s.querySelector(".tokui-tour__panel");
14737
+ a && (a.textContent = i.tt), l && (l.textContent = i.tx), u && (u.textContent = n("tour.stepCounter", {
14738
+ cur: c + 1,
14739
+ total: r.length
14740
+ })), f && (f.disabled = c === 0), p && (p.textContent = c === r.length - 1 ? n("tour.finish") : n("tour.next")), d(h, m, i), t || o._report("change", {
14741
+ index: c,
14742
+ target: i.tgt || void 0
14743
+ });
14744
+ }
14745
+ }
14746
+ function p(e, t) {
14747
+ s && (l && l.removeEventListener("keydown", m, !0), s.parentNode && s.parentNode.removeChild(s), s = null, t || o._report(e === "finish" ? "finish" : "close", { index: c }));
14748
+ }
14749
+ function m(e) {
14750
+ s && (e.key === "Escape" ? p("close", !1) : e.key === "ArrowRight" ? f(c + 1, !1) : e.key === "ArrowLeft" && f(c - 1, !1));
14751
+ }
14752
+ function h(e, r) {
14753
+ var i = o._collectSteps();
14754
+ if (!(!l || !l.body || i.length === 0)) {
14755
+ p("close", !0), s = t("div", {
14756
+ class: "tokui-tour__layer",
14757
+ role: "dialog",
14758
+ "aria-modal": "true",
14759
+ "aria-label": n("tour.aria")
14760
+ });
14761
+ var a = t("div", { class: "tokui-tour__highlight" + (o._tourMask ? " tokui-tour__highlight--mask" : "") }), u = t("div", { class: "tokui-tour__panel" }), d = t("div", { class: "tokui-tour__header" });
14762
+ d.appendChild(t("span", { class: "tokui-tour__title" })), d.appendChild(t("span", { class: "tokui-tour__counter" }));
14763
+ var h = t("button", {
14764
+ class: "tokui-tour__close",
14765
+ type: "button",
14766
+ "aria-label": n("common.close")
14767
+ }, "×");
14768
+ d.appendChild(h), u.appendChild(d), u.appendChild(t("div", { class: "tokui-tour__body" }));
14769
+ var g = t("div", { class: "tokui-tour__footer" }), _ = t("button", {
14770
+ class: "tokui-tour__skip",
14771
+ type: "button"
14772
+ }, n("tour.skip")), v = t("button", {
14773
+ class: "tokui-tour__prev",
14774
+ type: "button"
14775
+ }, n("tour.prev")), y = t("button", {
14776
+ class: "tokui-tour__next",
14777
+ type: "button"
14778
+ }, n("tour.next"));
14779
+ g.appendChild(_), g.appendChild(v), g.appendChild(y), u.appendChild(g), s.appendChild(a), s.appendChild(u), h.addEventListener("click", function() {
14780
+ p("close", !1);
14781
+ }), _.addEventListener("click", function() {
14782
+ p("close", !1);
14783
+ }), v.addEventListener("click", function() {
14784
+ f(c - 1, !1);
14785
+ }), y.addEventListener("click", function() {
14786
+ var e = o._collectSteps();
14787
+ c >= e.length - 1 ? p("finish", !1) : f(c + 1, !1);
14788
+ }), l.addEventListener("keydown", m, !0), l.body.appendChild(s), f(e || 0, r);
14789
+ }
14790
+ }
14791
+ return o._update = function(e) {
14792
+ e.act === "open" ? h(e.v === void 0 ? 0 : parseInt(e.v) || 0, !0) : e.act === "goto" && e.v !== void 0 ? f(parseInt(e.v) || 0, !0) : e.act === "close" && p("close", !0);
14793
+ }, a.open !== void 0 && (o._streamCloseHook = function() {
14794
+ s || h(0, !0);
14795
+ }), o;
14796
+ }), e.register("tour-step", (e) => {
14797
+ var n = e.attrs || {}, r = t("span", { class: "tokui-tour-step" });
14798
+ return n.tgt && r.setAttribute("data-tgt", String(n.tgt).replace(/^#/, "")), n.tt && r.setAttribute("data-tt", n.tt), r.setAttribute("data-tx", n.tx || e.content || ""), n.pos && r.setAttribute("data-pos", n.pos), r;
14164
14799
  }), e.register("timeline", (e, n) => {
14165
14800
  let r = e.attrs || {}, i = ["tokui-timeline"], a = r.v || "", o = a === "alternate" || a === "alt";
14166
14801
  (a === "h" || a === "horizontal") && i.push("tokui-timeline--horizontal"), o && i.push("tokui-timeline--alternate"), a === "card" && i.push("tokui-timeline--card");
@@ -14260,7 +14895,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14260
14895
  }
14261
14896
  return r.appendChild(a), r;
14262
14897
  });
14263
- function s(e) {
14898
+ function c(e) {
14264
14899
  for (var t = e.querySelectorAll(".tokui-desc__item--last-row"), n = 0; n < t.length; n++) t[n].classList.remove("tokui-desc__item--last-row");
14265
14900
  var r = e.querySelectorAll(".tokui-desc__item");
14266
14901
  if (r.length) {
@@ -14279,14 +14914,14 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14279
14914
  if (!o) for (var u = (Math.ceil(r.length / a) - 1) * a; u < r.length; u++) r[u].classList.add("tokui-desc__item--last-row");
14280
14915
  }
14281
14916
  }
14282
- function c(e) {
14283
- if (s(e), typeof MutationObserver > "u") return;
14917
+ function u(e) {
14918
+ if (c(e), typeof MutationObserver > "u") return;
14284
14919
  var t = !1;
14285
14920
  function n() {
14286
14921
  t || (t = !0, (typeof requestAnimationFrame == "function" ? requestAnimationFrame : function(e) {
14287
14922
  e();
14288
14923
  })(function() {
14289
- t = !1, e.isConnected && s(e);
14924
+ t = !1, e.isConnected && c(e);
14290
14925
  }));
14291
14926
  }
14292
14927
  var r = new MutationObserver(function() {
@@ -14297,22 +14932,22 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14297
14932
  n();
14298
14933
  });
14299
14934
  r.observe(e, { childList: !0 }), typeof requestAnimationFrame == "function" && requestAnimationFrame(function() {
14300
- e.isConnected && s(e);
14935
+ e.isConnected && c(e);
14301
14936
  });
14302
14937
  }
14303
14938
  e.register("desc", (e, n) => {
14304
- var r = e.attrs || {}, i = parseInt(r.cols) || 3, o = ["tokui-desc"];
14305
- r.stripe !== void 0 && o.push("tokui-desc--stripe"), r.bordered !== void 0 && o.push("tokui-desc--bordered"), (r.v === "horizontal" || r.v === "h") && o.push("tokui-desc--horizontal");
14306
- var s = t("div", { class: o.join(" ") });
14939
+ var r = e.attrs || {}, i = parseInt(r.cols) || 3, a = ["tokui-desc"];
14940
+ r.stripe !== void 0 && a.push("tokui-desc--stripe"), r.bordered !== void 0 && a.push("tokui-desc--bordered"), (r.v === "horizontal" || r.v === "h") && a.push("tokui-desc--horizontal");
14941
+ var s = t("div", { class: a.join(" ") });
14307
14942
  s.style.setProperty("--tokui-desc-cols", String(i)), r.lw && s.style.setProperty("--tokui-desc-label-w", r.lw);
14308
- var l = (e.children || []).filter(function(e) {
14943
+ var c = (e.children || []).filter(function(e) {
14309
14944
  return e.type === "desc-item" || e.type === "item";
14310
14945
  });
14311
- return l.length > 0 && l.forEach(function(e) {
14312
- s.appendChild(a(e, i));
14313
- }), c(s), s._slot = s, s._tokuiType = "desc", s;
14314
- }), e.register("desc-item", (e) => a(e));
14315
- function u(e, n) {
14946
+ return c.length > 0 && c.forEach(function(e) {
14947
+ s.appendChild(o(e, i));
14948
+ }), u(s), s._slot = s, s._tokuiType = "desc", s;
14949
+ }), e.register("desc-item", (e) => o(e));
14950
+ function d(e, n) {
14316
14951
  var r = e.attrs || {}, i = t("div", {
14317
14952
  class: "tokui-carousel__slide",
14318
14953
  "data-tokui-tag": e.type
@@ -14335,7 +14970,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14335
14970
  e.register("carousel", (r, i) => {
14336
14971
  var a = r.attrs || {}, o = a.thumb !== void 0, s = { class: "tokui-carousel" + (o ? " tokui-carousel--thumb" : "") };
14337
14972
  a.id && (s.id = a.id), s["data-carousel"] = a.id || "carousel-" + Math.random().toString(36).slice(2, 8);
14338
- var c = t("div", s), l = e.createReporter("carousel", a, c), d = t("div", { class: "tokui-carousel__viewport" }), f = t("div", { class: "tokui-carousel__track" });
14973
+ var c = t("div", s), l = e.createReporter("carousel", a, c), u = t("div", { class: "tokui-carousel__viewport" }), f = t("div", { class: "tokui-carousel__track" });
14339
14974
  function p(e) {
14340
14975
  return e = String(e).trim(), /^\d+(\.\d+)?$/.test(e) ? e + "px" : e;
14341
14976
  }
@@ -14348,35 +14983,35 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14348
14983
  var i = parseFloat(e);
14349
14984
  return i > 0 ? i : 0;
14350
14985
  }
14351
- if (a.w && (c.style.width = p(a.w)), a.h) d.style.height = p(a.h), c.classList.add("tokui-carousel--sized");
14986
+ if (a.w && (c.style.width = p(a.w)), a.h) u.style.height = p(a.h), c.classList.add("tokui-carousel--sized");
14352
14987
  else if (a.ratio) {
14353
14988
  var h = m(a.ratio);
14354
- h && (d.style.aspectRatio = String(h), c.classList.add("tokui-carousel--sized"));
14989
+ h && (u.style.aspectRatio = String(h), c.classList.add("tokui-carousel--sized"));
14355
14990
  }
14356
14991
  var g = (r.children || []).filter(function(e) {
14357
14992
  return e.type === "carousel-item" || e.type === "item" || e.type === "img";
14358
14993
  });
14359
14994
  g.forEach(function(e) {
14360
- if (e.type === "carousel-item" || e.type === "item") f.appendChild(u(e, i));
14995
+ if (e.type === "carousel-item" || e.type === "item") f.appendChild(d(e, i));
14361
14996
  else if (e.type === "img") {
14362
14997
  var n = t("div", { class: "tokui-carousel__slide" });
14363
14998
  i([e]).forEach(function(e) {
14364
14999
  e && e.nodeType && n.appendChild(e);
14365
15000
  }), f.appendChild(n);
14366
15001
  }
14367
- }), d.appendChild(f);
15002
+ }), u.appendChild(f);
14368
15003
  var _ = t("button", {
14369
15004
  class: "tokui-carousel__arrow tokui-carousel__arrow--prev",
14370
15005
  "aria-label": n("layout.carouselPrev"),
14371
15006
  "data-dir": "prev"
14372
15007
  });
14373
- _.innerHTML = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"15 18 9 12 15 6\"/></svg>", d.appendChild(_);
15008
+ _.innerHTML = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"15 18 9 12 15 6\"/></svg>", u.appendChild(_);
14374
15009
  var v = t("button", {
14375
15010
  class: "tokui-carousel__arrow tokui-carousel__arrow--next",
14376
15011
  "aria-label": n("layout.carouselNext"),
14377
15012
  "data-dir": "next"
14378
15013
  });
14379
- v.innerHTML = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"9 6 15 12 9 18\"/></svg>", d.appendChild(v), c.appendChild(d);
15014
+ v.innerHTML = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"9 6 15 12 9 18\"/></svg>", u.appendChild(v), c.appendChild(u);
14380
15015
  var y = null, b = null, x = !1;
14381
15016
  function S() {
14382
15017
  return Array.prototype.filter.call(f.children, function(e) {
@@ -14407,7 +15042,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14407
15042
  "data-index": String(r)
14408
15043
  });
14409
15044
  y.appendChild(i);
14410
- }), d.appendChild(y)));
15045
+ }), u.appendChild(y)));
14411
15046
  }
14412
15047
  }
14413
15048
  c._slot = f, c._tokuiType = "carousel";
@@ -14491,7 +15126,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14491
15126
  return g.length > 0 && w(), c._streamCloseHook = function() {
14492
15127
  w();
14493
15128
  }, c;
14494
- }), e.register("carousel-item", (e, t) => u(e, t)), e.register("tn", (e, n) => {
15129
+ }), e.register("carousel-item", (e, t) => d(e, t)), e.register("tn", (e, n) => {
14495
15130
  var r = e.attrs.leaf !== void 0, i = e.attrs.open !== void 0, a = e.attrs.dis !== void 0, o = e.attrs.load && !(e.children && e.children.length) ? String(e.attrs.load) : null, s = t("div", {
14496
15131
  class: "tokui-tree-node" + (r ? " tokui-tree-node--leaf" : "") + (i ? " tokui-tree-node--open" : "") + (a ? " tokui-tree-node--disabled" : ""),
14497
15132
  role: "treeitem",
@@ -14679,12 +15314,12 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14679
15314
  return (n.children || []).filter(function(e) {
14680
15315
  return e.type === "menu-item";
14681
15316
  }).forEach(function(e) {
14682
- var t = p(e, l);
15317
+ var t = m(e, l);
14683
15318
  c.appendChild(t);
14684
15319
  }), c._slot = c, c._tokuiType = "menu", c._activeClk = l, c._report = e.createReporter("menu", i, c), c._update = function(e) {
14685
15320
  if (!(e.act !== "activate" || e.v === void 0)) {
14686
- for (var t = c.querySelectorAll(".tokui-menu__item"), n = 0; n < t.length; n++) if (d(t[n]) === String(e.v)) {
14687
- f(t[n], !0);
15321
+ for (var t = c.querySelectorAll(".tokui-menu__item"), n = 0; n < t.length; n++) if (f(t[n]) === String(e.v)) {
15322
+ p(t[n], !0);
14688
15323
  break;
14689
15324
  }
14690
15325
  }
@@ -14696,18 +15331,18 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14696
15331
  }
14697
15332
  }), c;
14698
15333
  });
14699
- function d(e) {
15334
+ function f(e) {
14700
15335
  if (e._menuValue !== void 0) return e._menuValue;
14701
15336
  var t = e.querySelector(".tokui-menu__text");
14702
15337
  return t ? t.textContent : e.textContent;
14703
15338
  }
14704
- function f(e, t) {
15339
+ function p(e, t) {
14705
15340
  var n = e.closest(".tokui-menu");
14706
15341
  n && n.querySelectorAll(".tokui-menu__item--active").forEach(function(e) {
14707
15342
  e.classList.remove("tokui-menu__item--active");
14708
- }), e.classList.add("tokui-menu__item--active"), !t && n && n._report && n._report("change", { value: d(e) });
15343
+ }), e.classList.add("tokui-menu__item--active"), !t && n && n._report && n._report("change", { value: f(e) });
14709
15344
  }
14710
- function p(e, n) {
15345
+ function m(e, n) {
14711
15346
  var r = e.attrs || {}, i = ["tokui-menu__item"];
14712
15347
  r.dis !== void 0 && i.push("tokui-menu__item--disabled"), n && r.clk === n && i.push("tokui-menu__item--active");
14713
15348
  var a = t("div", {
@@ -14721,7 +15356,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14721
15356
  }
14722
15357
  var s = t("span", { class: "tokui-menu__text" }, r.tx || e.content || "");
14723
15358
  return a.appendChild(s), a._menuValue = r.id || r.v || r.tx || e.content || "", r.dis === void 0 && (r.clk && a.setAttribute("data-tokui-clk", r.clk), a.addEventListener("click", function() {
14724
- f(a);
15359
+ p(a);
14725
15360
  })), a;
14726
15361
  }
14727
15362
  e.register("menu-item", (e) => {
@@ -14733,8 +15368,144 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14733
15368
  tabindex: "0"
14734
15369
  });
14735
15370
  return n.i && i.appendChild(t("span", { class: "tokui-menu__icon" }, n.i)), i.appendChild(t("span", { class: "tokui-menu__text" }, n.tx || e.content || "")), i._menuValue = n.id || n.v || n.tx || e.content || "", n.dis === void 0 && (n.clk && i.setAttribute("data-tokui-clk", n.clk), i.addEventListener("click", function() {
14736
- f(i);
15371
+ p(i);
14737
15372
  })), i;
15373
+ }), e.register("anchor", (r, i) => {
15374
+ var a = r.attrs || {}, o = t("nav", {
15375
+ class: "tokui-anchor",
15376
+ "aria-label": n("anchor.aria")
15377
+ });
15378
+ a.id && (o.id = a.id), o._anchorOffset = parseInt(a.top) || 12, o._report = e.createReporter("anchor", a, o), v(a.opt).forEach(function(e) {
15379
+ o.appendChild(_(o, e.v, e.tx, 0));
15380
+ }), i(r.children || []).forEach(function(e) {
15381
+ e && e.nodeType && o.appendChild(e);
15382
+ }), o._slot = o, o._tokuiType = "anchor";
15383
+ function s() {
15384
+ if (!o.querySelector(".tokui-anchor__item--active")) {
15385
+ var e = o.querySelector(".tokui-anchor__item");
15386
+ e && e.classList.add("tokui-anchor__item--active");
15387
+ }
15388
+ }
15389
+ if (s(), o._streamCloseHook = s, o._update = function(e) {
15390
+ if (e.v !== void 0) {
15391
+ for (var t = String(e.v).replace(/^#/, ""), n = o.querySelectorAll(".tokui-anchor__item"), r = 0; r < n.length; r++) if (n[r]._anchorValue === t) {
15392
+ y(o, n[r], !0), o._spySuppressUntil = Date.now() + 900;
15393
+ break;
15394
+ }
15395
+ }
15396
+ }, typeof window < "u") {
15397
+ var c = window.requestAnimationFrame || function(e) {
15398
+ return e();
15399
+ };
15400
+ c(function() {
15401
+ var e = null;
15402
+ function t() {
15403
+ for (var e = o.parentElement; e;) {
15404
+ if (typeof getComputedStyle == "function") {
15405
+ var t = getComputedStyle(e);
15406
+ if ((t.overflowY === "auto" || t.overflowY === "scroll") && e.scrollHeight > e.clientHeight) return e;
15407
+ }
15408
+ e = e.parentElement;
15409
+ }
15410
+ return null;
15411
+ }
15412
+ var n = function() {
15413
+ if (!(o._spySuppressUntil && Date.now() < o._spySuppressUntil)) {
15414
+ e ||= t();
15415
+ for (var n = e ? e.getBoundingClientRect().top : 0, r = o._anchorOffset || 12, i = o.querySelectorAll(".tokui-anchor__item"), a = null, s = 0; s < i.length; s++) {
15416
+ var c = document.getElementById(i[s]._anchorValue);
15417
+ !c || typeof c.getBoundingClientRect != "function" || c.getBoundingClientRect().top - n <= r && (a = i[s]);
15418
+ }
15419
+ if (!a && i.length > 0) {
15420
+ var l = document.getElementById(i[0]._anchorValue);
15421
+ l && typeof l.getBoundingClientRect == "function" && (a = i[0]);
15422
+ }
15423
+ a && y(o, a, !0);
15424
+ }
15425
+ }, r = !1, i = function() {
15426
+ r || (r = !0, c(function() {
15427
+ r = !1, n();
15428
+ }));
15429
+ };
15430
+ window.addEventListener && window.addEventListener("scroll", i, {
15431
+ capture: !0,
15432
+ passive: !0
15433
+ }), n(), o._anchorCleanup = function() {
15434
+ window.removeEventListener && window.removeEventListener("scroll", i, { capture: !0 });
15435
+ };
15436
+ });
15437
+ }
15438
+ return o;
15439
+ }), e.register("lk", (e) => {
15440
+ var n = e.attrs || {}, r = String(n.h || "").replace(/^#/, ""), i = Math.min(parseInt(n.d) || 0, 3), a = t("div", {
15441
+ class: "tokui-anchor__item" + (i > 0 ? " tokui-anchor__item--depth-" + i : ""),
15442
+ role: "link",
15443
+ tabindex: "0",
15444
+ "data-target": r
15445
+ }, n.tx || e.content || r);
15446
+ a._anchorValue = r;
15447
+ function o() {
15448
+ var e = a.closest(".tokui-anchor");
15449
+ e && (y(e, a, !1), e._spySuppressUntil = Date.now() + 900, b(r));
15450
+ }
15451
+ return a.addEventListener("click", o), a.addEventListener("keydown", function(e) {
15452
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
15453
+ }), a;
15454
+ });
15455
+ function _(e, n, r, i) {
15456
+ i = Math.min(i || 0, 3);
15457
+ var a = t("div", {
15458
+ class: "tokui-anchor__item" + (i > 0 ? " tokui-anchor__item--depth-" + i : ""),
15459
+ role: "link",
15460
+ tabindex: "0",
15461
+ "data-target": n
15462
+ }, r);
15463
+ a._anchorValue = n;
15464
+ function o() {
15465
+ y(e, a, !1), e._spySuppressUntil = Date.now() + 900, b(n);
15466
+ }
15467
+ return a.addEventListener("click", o), a.addEventListener("keydown", function(e) {
15468
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
15469
+ }), a;
15470
+ }
15471
+ function v(e) {
15472
+ return !e || typeof e != "string" ? [] : e.split(";").map(function(e) {
15473
+ return e.trim();
15474
+ }).filter(Boolean).map(function(e) {
15475
+ var t = e.indexOf(":");
15476
+ return t === -1 ? {
15477
+ v: e.replace(/^#/, ""),
15478
+ tx: e
15479
+ } : {
15480
+ v: e.substring(0, t).trim().replace(/^#/, ""),
15481
+ tx: e.substring(t + 1).trim()
15482
+ };
15483
+ });
15484
+ }
15485
+ function y(e, t, n) {
15486
+ e.querySelectorAll(".tokui-anchor__item--active").forEach(function(e) {
15487
+ e.classList.remove("tokui-anchor__item--active");
15488
+ }), t.classList.add("tokui-anchor__item--active"), !n && e._report && e._report("change", { value: t._anchorValue });
15489
+ }
15490
+ function b(e) {
15491
+ var t = document.getElementById(e);
15492
+ t && typeof t.scrollIntoView == "function" && t.scrollIntoView({
15493
+ behavior: "smooth",
15494
+ block: "start"
15495
+ });
15496
+ }
15497
+ e.register("masonry", (e, n) => {
15498
+ var r = e.attrs || {}, i = parseInt(r.gap) || 8, a = t("div", { class: "tokui-masonry" });
15499
+ r.id && (a.id = r.id);
15500
+ var o = parseInt(r.minw);
15501
+ if (o > 0) a.classList.add("tokui-masonry--auto"), a.style.columnWidth = o + "px";
15502
+ else {
15503
+ var s = Math.min(Math.max(parseInt(r.cols) || 2, 1), 6);
15504
+ a.style.columnCount = String(s);
15505
+ }
15506
+ return a.style.columnGap = i + "px", a.style.setProperty("--tokui-masonry-gap", i + "px"), n(e.children || []).forEach(function(e) {
15507
+ e && e.nodeType && a.appendChild(e);
15508
+ }), a._slot = a, a._tokuiType = "masonry", a;
14738
15509
  }), e.register("resizable", (e, n) => {
14739
15510
  var r = e.attrs || {}, i = r.dir || "h", a = parseInt(r.min) || 100, o = parseInt(r.max) || 800, s = parseInt(r.default) || 300, c = i !== "v", l = ["tokui-resizable"];
14740
15511
  l.push(c ? "tokui-resizable--h" : "tokui-resizable--v");
@@ -14898,7 +15669,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
14898
15669
  }), r._slot = r, r._tokuiType = "sidebar-footer", r;
14899
15670
  });
14900
15671
  }
14901
- typeof window < "u" && (window.TokUI = window.TokUI || {}, window.TokUI._internal = window.TokUI._internal || {}, window.TokUI._internal.registerLayoutComponents = r), t !== void 0 && t.exports && (t.exports = { registerLayoutComponents: r });
15672
+ typeof window < "u" && (window.TokUI = window.TokUI || {}, window.TokUI._internal = window.TokUI._internal || {}, window.TokUI._internal.registerLayoutComponents = i, r()), t !== void 0 && t.exports && (t.exports = {
15673
+ registerLayoutComponents: i,
15674
+ mountModalConfirm: r
15675
+ });
14902
15676
  })), E = /* @__PURE__ */ o(((e, t) => {
14903
15677
  var n = !1, r, i, a, o, s, c, u;
14904
15678
  function d() {
@@ -15020,7 +15794,13 @@ var M = /* @__PURE__ */ c(D()), N = k.default.registerHandler.bind(k.default), P
15020
15794
  setLocale: L,
15021
15795
  getLocale: R,
15022
15796
  registerLocale: z,
15023
- el: j.el
15797
+ el: j.el,
15798
+ get modal() {
15799
+ return typeof window < "u" && window.TokUI ? window.TokUI.modal : void 0;
15800
+ },
15801
+ get confirm() {
15802
+ return typeof window < "u" && window.TokUI ? window.TokUI.confirm : void 0;
15803
+ }
15024
15804
  }, V = M.default, H = j.el;
15025
15805
  export { V as TokUI, B as default, H as el, R as getLocale, I as getTheme, N as registerHandler, z as registerLocale, P as removeHandler, L as setLocale, F as setTheme };
15026
15806