@tempots/beatui 0.95.0 → 1.0.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.
Files changed (239) hide show
  1. package/dist/{ar-BVXPzVJB.cjs → ar-CuI1Jgt6.cjs} +1 -1
  2. package/dist/{ar-B4jDJwHQ.js → ar-DaKbK_t8.js} +87 -11
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +1 -1
  5. package/dist/{auth-divider-BPwKk8MW.js → auth-divider-CbME_yVQ.js} +87 -86
  6. package/dist/auth-divider-MMhfmLBu.cjs +1 -0
  7. package/dist/beatui.css +1628 -545
  8. package/dist/beatui.tailwind.css +1628 -545
  9. package/dist/better-auth/index.cjs.js +1 -1
  10. package/dist/better-auth/index.es.js +6 -6
  11. package/dist/codehighlight/index.cjs.js +22 -0
  12. package/dist/codehighlight/index.es.js +76 -0
  13. package/dist/colors-B-p6IzX9.cjs +1 -0
  14. package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
  15. package/dist/{de-Dd33yWzb.js → de-3MTPDS1i.js} +82 -6
  16. package/dist/{de-BdfPZskW.cjs → de-DthHehbh.cjs} +1 -1
  17. package/dist/{deep-merge-C8dSqIXI.js → deep-merge-BzIheQtH.js} +511 -517
  18. package/dist/deep-merge-EkjEgK0N.cjs +1 -0
  19. package/dist/{duration-input-IuFWywO5.cjs → duration-input-ClgYjeBa.cjs} +1 -1
  20. package/dist/{duration-input-DFZwkg6M.js → duration-input-DGzmIImj.js} +5 -5
  21. package/dist/{editor-toolbar-group-DiJFgGcI.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
  22. package/dist/{editor-toolbar-group-BCBfu8pG.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
  23. package/dist/es-B6GJLk9h.cjs +1 -0
  24. package/dist/{es-jHMT3_7O.js → es-DwMUvBeU.js} +94 -18
  25. package/dist/{fa-eX3_BAZR.js → fa-0rvQiKrJ.js} +87 -11
  26. package/dist/{fa-BXnP4pbN.cjs → fa-BwgP93iV.cjs} +1 -1
  27. package/dist/{fr-Bj-GjMJm.js → fr-B4i6NzLl.js} +86 -10
  28. package/dist/{fr-HJDhGjI2.cjs → fr-CQzk5zqY.cjs} +1 -1
  29. package/dist/{he-DYgmPPkG.js → he-C71n-hsn.js} +87 -11
  30. package/dist/{he-C6nEVZhN.cjs → he-DcxxvRfs.cjs} +1 -1
  31. package/dist/{hi-DMVSXAJt.cjs → hi-D-KHVWg4.cjs} +1 -1
  32. package/dist/{hi-CgYLonE9.js → hi-xmrXpeVU.js} +87 -11
  33. package/dist/index-B5MAsOC-.cjs +1 -0
  34. package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
  35. package/dist/index.cjs.js +4 -4
  36. package/dist/index.es.js +8055 -5285
  37. package/dist/input-container-BvEcp7FU.js +275 -0
  38. package/dist/input-container-Di1YvVB_.cjs +1 -0
  39. package/dist/{it-CO2BPqah.js → it-CDZTtOBC.js} +83 -7
  40. package/dist/{it-DhfVcjKb.cjs → it-D344Dutu.cjs} +1 -1
  41. package/dist/{ja-Bt6fGS_Q.cjs → ja-BNgnDZ27.cjs} +1 -1
  42. package/dist/{ja-BrzwjH8T.js → ja-Zz1LzidW.js} +91 -15
  43. package/dist/json-schema/index.cjs.js +1 -1
  44. package/dist/json-schema/index.es.js +261 -257
  45. package/dist/json-schema-display/index.cjs.js +1 -1
  46. package/dist/json-schema-display/index.es.js +2 -2
  47. package/dist/json-structure/index.cjs.js +1 -1
  48. package/dist/json-structure/index.es.js +132 -133
  49. package/dist/{ko-D-lJ4wYQ.js → ko-9laUsZDL.js} +90 -14
  50. package/dist/{ko-DfAaBGrz.cjs → ko-D-WJ9NK7.cjs} +1 -1
  51. package/dist/lexical/index.cjs.js +2 -39
  52. package/dist/lexical/index.es.js +2056 -20626
  53. package/dist/markdown/index.cjs.js +1 -1
  54. package/dist/markdown/index.es.js +41 -4
  55. package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
  56. package/dist/menu-B92oSDct.cjs +1 -0
  57. package/dist/modal-BT0jjDqX.cjs +1 -0
  58. package/dist/{modal-CwZuWiSK.js → modal-DBguyX-b.js} +9 -9
  59. package/dist/monaco/index.cjs.js +2 -2
  60. package/dist/monaco/index.es.js +7 -7
  61. package/dist/{nl-CNWBQjK5.cjs → nl-CrqUlFie.cjs} +1 -1
  62. package/dist/{nl-ClsworIe.js → nl-Dcll9fVA.js} +86 -10
  63. package/dist/notice-B5wTXoTq.cjs +1 -0
  64. package/dist/{notice-D7hYFM5A.js → notice-BKcyJD5w.js} +37 -37
  65. package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
  66. package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
  67. package/dist/{pl-CqHTeu3-.cjs → pl-9UksIrvX.cjs} +1 -1
  68. package/dist/{pl-WTwLAxnV.js → pl-Dm9N9Gbr.js} +83 -7
  69. package/dist/prosemirror/index.cjs.js +3 -1
  70. package/dist/prosemirror/index.es.js +636 -4
  71. package/dist/{pt-CgkjJnsG.js → pt-CFi5cn0k.js} +88 -12
  72. package/dist/{pt-BQmsiqbo.cjs → pt-_kfdzwqi.cjs} +1 -1
  73. package/dist/{ru-CtgH7OY9.js → ru-CEhZUw8R.js} +91 -15
  74. package/dist/{ru-CG56A2To.cjs → ru-CW1WNNlr.cjs} +1 -1
  75. package/dist/stack-BLMteGTn.js +15 -0
  76. package/dist/stack-dwLevGa2.cjs +1 -0
  77. package/dist/tailwind/preset.cjs.js +1 -1
  78. package/dist/tailwind/preset.es.js +2 -2
  79. package/dist/tailwind/vite-plugin.cjs.js +1 -1
  80. package/dist/tailwind/vite-plugin.es.js +1 -1
  81. package/dist/text-input-DfqXolVe.js +55 -0
  82. package/dist/text-input-X_q01NsY.cjs +1 -0
  83. package/dist/toolbar-DY0ax2Qd.js +130 -0
  84. package/dist/toolbar-DoKdYXIL.cjs +1 -0
  85. package/dist/{tr-DE7_VtKu.cjs → tr-B6GIRegf.cjs} +1 -1
  86. package/dist/{tr-D1O1vEmr.js → tr-ZmnVDhLP.js} +81 -5
  87. package/dist/{translations-yu4gNqlP.js → translations-A4kR7CW8.js} +1 -1
  88. package/dist/{translations-DyCmyLE_.js → translations-B1_yyDUK.js} +207 -129
  89. package/dist/{translations-DBxIjvWR.cjs → translations-C81buKAw.cjs} +1 -1
  90. package/dist/translations-Dbx7L7Q1.cjs +1 -0
  91. package/dist/types/beatui-i18n/default.d.ts +71 -0
  92. package/dist/types/beatui-i18n/locales/en.d.ts +71 -0
  93. package/dist/types/beatui-i18n/translations.d.ts +71 -0
  94. package/dist/types/codehighlight/code-highlight.d.ts +21 -0
  95. package/dist/types/codehighlight/index.d.ts +14 -0
  96. package/dist/types/components/button/toggle-button.d.ts +4 -4
  97. package/dist/types/components/data/avatar.d.ts +3 -1
  98. package/dist/types/components/data/badge.d.ts +10 -18
  99. package/dist/types/components/data/column-filter-panel.d.ts +31 -0
  100. package/dist/types/components/data/column-filter.d.ts +110 -0
  101. package/dist/types/components/data/column-header-menu.d.ts +42 -0
  102. package/dist/types/components/data/data-source.d.ts +190 -0
  103. package/dist/types/components/data/data-table-body.d.ts +12 -0
  104. package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
  105. package/dist/types/components/data/data-table-context.d.ts +53 -0
  106. package/dist/types/components/data/data-table-header.d.ts +6 -0
  107. package/dist/types/components/data/data-table-resolve.d.ts +26 -0
  108. package/dist/types/components/data/data-table-types.d.ts +201 -0
  109. package/dist/types/components/data/data-table.d.ts +38 -0
  110. package/dist/types/components/data/data-toolbar.d.ts +44 -0
  111. package/dist/types/components/data/date-picker-shared.d.ts +55 -0
  112. package/dist/types/components/data/date-picker.d.ts +58 -0
  113. package/dist/types/components/data/date-range-picker.d.ts +56 -0
  114. package/dist/types/components/data/filter.d.ts +268 -0
  115. package/dist/types/components/data/index.d.ts +13 -4
  116. package/dist/types/components/data/indicator.d.ts +41 -0
  117. package/dist/types/components/data/progress-bar.d.ts +2 -2
  118. package/dist/types/components/data/selection-checkbox.d.ts +63 -0
  119. package/dist/types/components/data/skeleton.d.ts +1 -1
  120. package/dist/types/components/data/sortable-header.d.ts +55 -0
  121. package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
  122. package/dist/types/components/form/control/control.d.ts +9 -9
  123. package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
  124. package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
  125. package/dist/types/components/form/input/bigint-input.d.ts +3 -3
  126. package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
  127. package/dist/types/components/form/input/color-input.d.ts +1 -1
  128. package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
  129. package/dist/types/components/form/input/combobox-input.d.ts +5 -5
  130. package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
  131. package/dist/types/components/form/input/date-input.d.ts +4 -4
  132. package/dist/types/components/form/input/date-time-input.d.ts +4 -4
  133. package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
  134. package/dist/types/components/form/input/editable-text.d.ts +2 -2
  135. package/dist/types/components/form/input/index.d.ts +1 -0
  136. package/dist/types/components/form/input/input-container.d.ts +1 -1
  137. package/dist/types/components/form/input/input-options.d.ts +28 -1
  138. package/dist/types/components/form/input/mask-input.d.ts +8 -2
  139. package/dist/types/components/form/input/native-select.d.ts +3 -3
  140. package/dist/types/components/form/input/nullable-bigint-input.d.ts +3 -3
  141. package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
  142. package/dist/types/components/form/input/nullable-date-time-input.d.ts +2 -2
  143. package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
  144. package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
  145. package/dist/types/components/form/input/number-input.d.ts +3 -3
  146. package/dist/types/components/form/input/otp-input.d.ts +12 -12
  147. package/dist/types/components/form/input/rating-input.d.ts +7 -8
  148. package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
  149. package/dist/types/components/form/input/switch.d.ts +2 -2
  150. package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
  151. package/dist/types/components/form/input/uuid-input.d.ts +2 -2
  152. package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
  153. package/dist/types/components/layout/card.d.ts +66 -0
  154. package/dist/types/components/layout/collapse.d.ts +2 -2
  155. package/dist/types/components/layout/flex.d.ts +26 -0
  156. package/dist/types/components/layout/index.d.ts +1 -0
  157. package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
  158. package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
  159. package/dist/types/components/misc/index.d.ts +1 -0
  160. package/dist/types/components/misc/loading-overlay.d.ts +29 -0
  161. package/dist/types/components/misc/notice.d.ts +4 -4
  162. package/dist/types/components/misc/notification-provider.d.ts +9 -3
  163. package/dist/types/components/misc/notification.d.ts +9 -9
  164. package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
  165. package/dist/types/components/navigation/menu.d.ts +6 -6
  166. package/dist/types/components/navigation/pagination.d.ts +17 -4
  167. package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
  168. package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
  169. package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
  170. package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
  171. package/dist/types/components/overlay/dialogs.d.ts +2 -2
  172. package/dist/types/components/overlay/modal.d.ts +9 -2
  173. package/dist/types/components/overlay/tooltip.d.ts +6 -6
  174. package/dist/types/components/theme/types.d.ts +15 -4
  175. package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
  176. package/dist/types/tokens/z-index.d.ts +18 -18
  177. package/dist/types/utils/use-animated-toggle.d.ts +12 -4
  178. package/dist/{ur-ZJgsSpG2.cjs → ur-CtFl_tz6.cjs} +1 -1
  179. package/dist/{ur-BcuB7IqE.js → ur-yYgj3NmT.js} +87 -11
  180. package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
  181. package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
  182. package/dist/use-form-CaW192gw.cjs +2 -0
  183. package/dist/{use-form-CfxvyTfd.js → use-form-Dn6v2tEh.js} +153 -152
  184. package/dist/utils-DmEuG3Np.cjs +1 -0
  185. package/dist/utils-vUtP6iPG.js +165 -0
  186. package/dist/{vi-D0rQ3dIx.js → vi-D5u4CLQO.js} +88 -12
  187. package/dist/{vi-BOgLRkuK.cjs → vi-DyCZSpsk.cjs} +1 -1
  188. package/dist/widget-customization-B49MeU4E.cjs +1 -0
  189. package/dist/widget-customization-DEiQ_31d.js +1063 -0
  190. package/dist/{zh-DoYqiZO1.js → zh-B0kwMMer.js} +90 -14
  191. package/dist/{zh-BTZ8OZ4H.cjs → zh-C3ZxMQKb.cjs} +1 -1
  192. package/package.json +208 -37
  193. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
  194. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  195. package/dist/auth-divider-BgaQ8ifw.cjs +0 -1
  196. package/dist/colors-BI0YhONJ.cjs +0 -1
  197. package/dist/deep-merge-ChJQbUKq.cjs +0 -1
  198. package/dist/es-C8TpneCm.cjs +0 -1
  199. package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
  200. package/dist/hls.light.min-hEMf_E8u.js +0 -8311
  201. package/dist/index-1JaBwDB-.js +0 -921
  202. package/dist/index-CN10Cyqr.cjs +0 -1
  203. package/dist/index-CTcbhnPw.cjs +0 -4
  204. package/dist/index-DF7RFzD9.cjs +0 -1
  205. package/dist/index-D_zOXmU5.cjs +0 -36
  206. package/dist/index-DfPkCwdC.js +0 -2709
  207. package/dist/index-vowHNIPH.js +0 -14308
  208. package/dist/index-yOU4Ceaq.js +0 -68
  209. package/dist/index-zQ3IYJFH.cjs +0 -1
  210. package/dist/input-container-BWYHj0Iq.cjs +0 -1
  211. package/dist/input-container-DMoVdH6E.js +0 -263
  212. package/dist/menu-De_-sGeb.cjs +0 -1
  213. package/dist/modal-CiGmgsOI.cjs +0 -1
  214. package/dist/notice-CPZQuxcA.cjs +0 -1
  215. package/dist/oneof-branch-detection-BFxukD63.cjs +0 -8
  216. package/dist/oneof-branch-detection-izpPjBCR.js +0 -6290
  217. package/dist/stack-4VUGISn6.cjs +0 -1
  218. package/dist/stack-Bm-UZosx.js +0 -879
  219. package/dist/string-B9vVyfq3.cjs +0 -1
  220. package/dist/string-DYyMxBl-.js +0 -19
  221. package/dist/text-input-BLupB3cU.js +0 -45
  222. package/dist/text-input-M6WBhhVj.cjs +0 -1
  223. package/dist/timer-BJHOsuS6.cjs +0 -1
  224. package/dist/timer-Rd2sKnvH.js +0 -65
  225. package/dist/toolbar-Be1eU0qU.js +0 -118
  226. package/dist/toolbar-WWv5kcYG.cjs +0 -1
  227. package/dist/translations-OOsMRpX9.cjs +0 -1
  228. package/dist/types/components/data/calendar-shared.d.ts +0 -59
  229. package/dist/types/components/data/calendar.d.ts +0 -107
  230. package/dist/types/components/data/icon-badge.d.ts +0 -14
  231. package/dist/types/components/data/range-calendar.d.ts +0 -104
  232. package/dist/types/components/data/tag.d.ts +0 -51
  233. package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
  234. package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
  235. package/dist/use-form-ClA0ZRco.cjs +0 -2
  236. package/dist/utils-DEbsp9Q9.js +0 -129
  237. package/dist/utils-DIUEhA-Z.cjs +0 -1
  238. package/dist/widget-customization-CLZNGavL.js +0 -1042
  239. package/dist/widget-customization-DtEEo35Y.cjs +0 -1
@@ -0,0 +1,1063 @@
1
+ import { Value as p, prop as ut, computedOf as D, html as x, attr as u, svg as ot, svgAttr as Q, Empty as S, on as I, When as z, Fragment as j, aria as B, emitValue as st, Use as ft, input as pt, emitValueAsNullableDate as ct, emitValueAsNullableDateTime as it, Repeat as mt, emit as bt, style as wt, emitValueAsNumber as E } from "@tempots/dom";
2
+ import { F as yt, N as X, T as Mt, U as It, a as $t } from "./deep-merge-BzIheQtH.js";
3
+ import { decodeBase64 as xt } from "@tempots/std";
4
+ import { I as P } from "./input-container-BvEcp7FU.js";
5
+ import { C as L, m as dt, T as _t } from "./text-input-DfqXolVe.js";
6
+ import { B as kt, I as tt, b as lt, a as Ft } from "./translations-B1_yyDUK.js";
7
+ import { AutoSelect as Ct } from "@tempots/ui";
8
+ import { E as Tt, P as St } from "./notice-BKcyJD5w.js";
9
+ import { s as At } from "./session-id-3KiilioY.js";
10
+ import { r as vt } from "./utils-vUtP6iPG.js";
11
+ function ht(t) {
12
+ if (typeof t != "string") return !1;
13
+ const e = t.startsWith("#") ? t.slice(1) : t;
14
+ return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(e);
15
+ }
16
+ function Nt(t) {
17
+ if (typeof t != "string") return !1;
18
+ const e = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i, a = t.match(e);
19
+ if (!a) return !1;
20
+ const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
21
+ return o >= 0 && o <= 255 && c >= 0 && c <= 255 && i >= 0 && i <= 255;
22
+ }
23
+ function Rt(t) {
24
+ if (typeof t != "string") return !1;
25
+ const e = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i, a = t.match(e);
26
+ if (!a) return !1;
27
+ const [, n, r, s, o] = a, c = parseInt(n, 10), i = parseInt(r, 10), l = parseInt(s, 10), d = parseFloat(o);
28
+ return c >= 0 && c <= 255 && i >= 0 && i <= 255 && l >= 0 && l <= 255 && d >= 0 && d <= 1;
29
+ }
30
+ function Bt(t) {
31
+ if (typeof t != "string") return !1;
32
+ const e = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i, a = t.match(e);
33
+ if (!a) return !1;
34
+ const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
35
+ return o >= 0 && o <= 360 && c >= 0 && c <= 100 && i >= 0 && i <= 100;
36
+ }
37
+ function de(t) {
38
+ return ht(t) || Nt(t) || Rt(t) || Bt(t);
39
+ }
40
+ function Dt(t) {
41
+ if (!ht(t)) return null;
42
+ let e = t.startsWith("#") ? t.slice(1) : t;
43
+ return e.length === 3 && (e = e.split("").map((a) => a + a).join("")), `#${e.toLowerCase()}`;
44
+ }
45
+ function et(t, e, a) {
46
+ const n = (r) => {
47
+ const s = Math.round(Math.max(0, Math.min(255, r))).toString(16);
48
+ return s.length === 1 ? "0" + s : s;
49
+ };
50
+ return `#${n(t)}${n(e)}${n(a)}`;
51
+ }
52
+ function H(t) {
53
+ const e = Dt(t);
54
+ if (!e) return null;
55
+ const a = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
56
+ return a ? {
57
+ r: parseInt(a[1], 16),
58
+ g: parseInt(a[2], 16),
59
+ b: parseInt(a[3], 16)
60
+ } : null;
61
+ }
62
+ function he(t, e) {
63
+ const a = H(t), n = H(e);
64
+ if (!a || !n) return null;
65
+ const r = (l, d, h) => {
66
+ const [y, f, g] = [l, d, h].map((M) => (M = M / 255, M <= 0.03928 ? M / 12.92 : Math.pow((M + 0.055) / 1.055, 2.4)));
67
+ return 0.2126 * y + 0.7152 * f + 0.0722 * g;
68
+ }, s = r(a.r, a.g, a.b), o = r(n.r, n.g, n.b), c = Math.max(s, o), i = Math.min(s, o);
69
+ return (c + 0.05) / (i + 0.05);
70
+ }
71
+ function Vt(t) {
72
+ if (!t) return [0, 0, 0, 1];
73
+ const a = t.trim().match(
74
+ /^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
75
+ );
76
+ if (a) {
77
+ const l = a[1];
78
+ if (l.length === 8) {
79
+ const d = parseInt(l.slice(0, 2), 16), h = parseInt(l.slice(2, 4), 16), y = parseInt(l.slice(4, 6), 16), f = parseInt(l.slice(6, 8), 16) / 255;
80
+ return [d, h, y, f];
81
+ }
82
+ if (l.length === 6)
83
+ return [
84
+ parseInt(l.slice(0, 2), 16),
85
+ parseInt(l.slice(2, 4), 16),
86
+ parseInt(l.slice(4, 6), 16),
87
+ 1
88
+ ];
89
+ if (l.length === 4) {
90
+ const d = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), y = parseInt(l[2] + l[2], 16), f = parseInt(l[3] + l[3], 16) / 255;
91
+ return [d, h, y, f];
92
+ }
93
+ if (l.length === 3) {
94
+ const d = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), y = parseInt(l[2] + l[2], 16);
95
+ return [d, h, y, 1];
96
+ }
97
+ }
98
+ const n = t.match(
99
+ /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i
100
+ );
101
+ if (n)
102
+ return [
103
+ parseInt(n[1], 10),
104
+ parseInt(n[2], 10),
105
+ parseInt(n[3], 10),
106
+ parseFloat(n[4])
107
+ ];
108
+ const r = t.match(
109
+ /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i
110
+ );
111
+ if (r)
112
+ return [parseInt(r[1], 10), parseInt(r[2], 10), parseInt(r[3], 10), 1];
113
+ const s = t.match(
114
+ /^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
115
+ );
116
+ if (s) {
117
+ const l = parseFloat(s[1]), d = parseFloat(s[2]), h = parseFloat(s[3]), y = s[4] != null ? parseFloat(s[4]) : 1, [f, g, M] = gt(l, d / 100, h / 100);
118
+ return [f, g, M, y];
119
+ }
120
+ const o = t.match(
121
+ /^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
122
+ );
123
+ if (o) {
124
+ const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100, h = parseFloat(o[3]) / 100, y = o[4] != null ? parseFloat(o[4]) : 1, [f, g, M] = Lt(l, d, h);
125
+ return [f, g, M, y];
126
+ }
127
+ const c = t.match(
128
+ /^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
129
+ );
130
+ if (c) {
131
+ const l = c[1], d = parseFloat(c[2]), h = parseFloat(c[3]), y = c[4] != null ? parseFloat(c[4]) : 1, f = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [g, M, k] = Ut(f, d, h);
132
+ return [g, M, k, y];
133
+ }
134
+ const i = H(t);
135
+ return i ? [i.r, i.g, i.b, 1] : [0, 0, 0, 1];
136
+ }
137
+ function Et(t, e, a, n) {
138
+ return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(a)}, ${Math.max(
139
+ 0,
140
+ Math.min(1, Math.round(n * 100) / 100)
141
+ )})`;
142
+ }
143
+ function Pt(t) {
144
+ let e = t + 1831565813;
145
+ return function() {
146
+ return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
147
+ };
148
+ }
149
+ function gt(t, e, a) {
150
+ t = (t % 360 + 360) % 360;
151
+ const n = (1 - Math.abs(2 * a - 1)) * e, r = n * (1 - Math.abs(t / 60 % 2 - 1)), s = a - n / 2;
152
+ let o, c, i;
153
+ return 0 <= t && t < 60 ? [o, c, i] = [n, r, 0] : 60 <= t && t < 120 ? [o, c, i] = [r, n, 0] : 120 <= t && t < 180 ? [o, c, i] = [0, n, r] : 180 <= t && t < 240 ? [o, c, i] = [0, r, n] : 240 <= t && t < 300 ? [o, c, i] = [r, 0, n] : [o, c, i] = [n, 0, r], [
154
+ Math.round((o + s) * 255),
155
+ Math.round((c + s) * 255),
156
+ Math.round((i + s) * 255)
157
+ ];
158
+ }
159
+ function Lt(t, e, a) {
160
+ t = (t % 360 + 360) % 360;
161
+ const n = e + a;
162
+ n > 1 && (e /= n, a /= n);
163
+ const [r, s, o] = gt(t, 1, 0.5).map((h) => h / 255), c = 1 - e - a, i = r * c + e, l = s * c + e, d = o * c + e;
164
+ return [Math.round(i * 255), Math.round(l * 255), Math.round(d * 255)];
165
+ }
166
+ function nt(t, e, a) {
167
+ t /= 255, e /= 255, a /= 255;
168
+ const n = Math.max(t, e, a), r = Math.min(t, e, a);
169
+ let s = 0, o = 0;
170
+ const c = (n + r) / 2, i = n - r;
171
+ if (i !== 0) {
172
+ switch (o = c > 0.5 ? i / (2 - n - r) : i / (n + r), n) {
173
+ case t:
174
+ s = (e - a) / i + (e < a ? 6 : 0);
175
+ break;
176
+ case e:
177
+ s = (a - t) / i + 2;
178
+ break;
179
+ default:
180
+ s = (t - e) / i + 4;
181
+ }
182
+ s *= 60;
183
+ }
184
+ return [Math.round(s), Math.round(o * 100), Math.round(c * 100)];
185
+ }
186
+ function Ot(t, e, a) {
187
+ const [n] = nt(t, e, a), r = t / 255, s = e / 255, o = a / 255, c = Math.min(r, s, o), i = 1 - Math.max(r, s, o);
188
+ return [n, Math.round(c * 100), Math.round(i * 100)];
189
+ }
190
+ function J(t) {
191
+ const e = t / 255;
192
+ return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
193
+ }
194
+ function Z(t) {
195
+ const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
196
+ return Math.round(Math.max(0, Math.min(1, e)) * 255);
197
+ }
198
+ function Ut(t, e, a) {
199
+ const n = a * Math.PI / 180, r = Math.cos(n) * e, s = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * s, c = t - 0.1055613458 * r - 0.0638541728 * s, i = t - 0.0894841775 * r - 1.291485548 * s, l = o * o * o, d = c * c * c, h = i * i * i, y = 4.0767416621 * l - 3.3077115913 * d + 0.2309699292 * h, f = -1.2684380046 * l + 2.6097574011 * d - 0.3413193965 * h, g = -0.0041960863 * l - 0.7034186147 * d + 1.707614701 * h;
200
+ return [Z(y), Z(f), Z(g)];
201
+ }
202
+ function Wt(t, e, a) {
203
+ const n = J(t), r = J(e), s = J(a), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * s, c = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * s, i = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * s, l = Math.cbrt(o), d = Math.cbrt(c), h = Math.cbrt(i), y = 0.2104542553 * l + 0.793617785 * d - 0.0040720468 * h, f = 1.9779984951 * l - 2.428592205 * d + 0.4505937099 * h, g = 0.0259040371 * l + 0.7827717662 * d - 0.808675766 * h, M = Math.sqrt(f * f + g * g);
204
+ let k = Math.atan2(g, f) * 180 / Math.PI;
205
+ return k < 0 && (k += 360), [y, M, k];
206
+ }
207
+ function U(t, e, a, n, r, s) {
208
+ switch (r) {
209
+ case "hex":
210
+ if (s) {
211
+ const o = (i) => i.toString(16).padStart(2, "0"), c = Math.max(0, Math.min(255, Math.round(n * 255)));
212
+ return `#${o(t)}${o(e)}${o(a)}${o(c)}`;
213
+ }
214
+ return et(t, e, a);
215
+ case "rgb":
216
+ return `rgb(${t}, ${e}, ${a})`;
217
+ case "rgba":
218
+ return `rgba(${t}, ${e}, ${a}, ${Math.round(n * 100) / 100})`;
219
+ case "hsl": {
220
+ const [o, c, i] = nt(t, e, a);
221
+ return `hsl(${o}, ${c}%, ${i}%)`;
222
+ }
223
+ case "hsla": {
224
+ const [o, c, i] = nt(t, e, a);
225
+ return `hsla(${o}, ${c}%, ${i}%, ${Math.round(n * 100) / 100})`;
226
+ }
227
+ case "hwb": {
228
+ const [o, c, i] = Ot(t, e, a);
229
+ return n < 1 ? `hwb(${o} ${c}% ${i}% / ${Math.round(n * 100) / 100})` : `hwb(${o} ${c}% ${i}%)`;
230
+ }
231
+ case "oklch": {
232
+ const [o, c, i] = Wt(t, e, a), l = (Math.round(o * 1e3) / 1e3).toFixed(3), d = (Math.round(c * 1e3) / 1e3).toFixed(3), h = (Math.round(i * 10) / 10).toFixed(1), y = Math.round(n * 100) / 100;
233
+ return s || n < 1 ? `oklch(${l} ${d} ${h} / ${y})` : `oklch(${l} ${d} ${h})`;
234
+ }
235
+ }
236
+ }
237
+ function W(t, e) {
238
+ return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
239
+ }
240
+ async function zt(t) {
241
+ return new Promise((e, a) => {
242
+ const n = new FileReader();
243
+ n.readAsDataURL(t), n.onload = () => {
244
+ const r = n.result;
245
+ e(r.split(",")[1]);
246
+ }, n.onerror = (r) => a(r);
247
+ });
248
+ }
249
+ function Ht(t) {
250
+ return Promise.all(t.map(zt));
251
+ }
252
+ function jt(t) {
253
+ if (t.length >= 4) {
254
+ if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
255
+ return "image/png";
256
+ if (t[0] === 255 && t[1] === 216) return "image/jpeg";
257
+ if (t[0] === 71 && t[1] === 73 && t[2] === 70)
258
+ return "image/gif";
259
+ if (t[0] === 82 && t[1] === 73 && t[2] === 70 && t[3] === 70 && t.length >= 12 && t[8] === 87 && t[9] === 69 && t[10] === 66 && t[11] === 80)
260
+ return "image/webp";
261
+ }
262
+ try {
263
+ if (new TextDecoder("utf-8").decode(t.slice(0, 256)).includes("<svg")) return "image/svg+xml";
264
+ } catch {
265
+ }
266
+ return "application/octet-stream";
267
+ }
268
+ function Xt(t) {
269
+ const e = xt(t ?? ""), a = e.length, n = new Uint8Array(a);
270
+ for (let r = 0; r < a; r++) n[r] = e.charCodeAt(r);
271
+ return n;
272
+ }
273
+ function Yt(t) {
274
+ const {
275
+ value: e,
276
+ onChange: a,
277
+ onInput: n,
278
+ ...r
279
+ } = t, s = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((h, y) => {
280
+ const f = s.get(h), g = Xt(h ?? ""), M = f?.type || jt(g), k = f?.name ?? `file-${y}`, w = g.buffer.slice(
281
+ g.byteOffset,
282
+ g.byteOffset + g.byteLength
283
+ ), F = new Blob([w], { type: M });
284
+ return new File([F], k, { type: M });
285
+ })), c = (d) => (h) => {
286
+ d && Ht(h).then((y) => {
287
+ for (const [f, g] of y.entries())
288
+ s.set(g, { name: h[f].name, type: h[f].type });
289
+ d(y);
290
+ });
291
+ }, i = c(a), l = c(n);
292
+ return yt({
293
+ ...r,
294
+ value: o,
295
+ onChange: i,
296
+ onInput: l
297
+ });
298
+ }
299
+ function ge(t) {
300
+ const {
301
+ value: e,
302
+ onInput: a,
303
+ onChange: n,
304
+ ...r
305
+ } = t;
306
+ return Yt({
307
+ ...r,
308
+ maxFiles: 1,
309
+ value: p.map(e, (s) => s == null ? [] : [s]),
310
+ onChange: (s) => {
311
+ n?.(s[0]);
312
+ },
313
+ onInput: (s) => {
314
+ a?.(s[0]);
315
+ }
316
+ });
317
+ }
318
+ function Gt(t, e) {
319
+ const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o = Pt(s), c = 6 + Math.floor(o() * 5), i = 0.18 + o() * 0.06, l = [];
320
+ for (let f = 0; f < c; f++) {
321
+ const g = f / c * Math.PI * 2, M = e * (1 + (o() * 2 - 1) * i), k = Math.cos(g) * M, w = Math.sin(g) * M;
322
+ l.push({ x: k, y: w });
323
+ }
324
+ const d = (l[0].x + l[c - 1].x) / 2, h = (l[0].y + l[c - 1].y) / 2;
325
+ let y = `M ${d.toFixed(3)} ${h.toFixed(3)}`;
326
+ for (let f = 0; f < c; f++) {
327
+ const g = l[f], M = l[(f + 1) % c], k = (g.x + M.x) / 2, w = (g.y + M.y) / 2;
328
+ y += ` Q ${g.x.toFixed(3)} ${g.y.toFixed(3)} ${k.toFixed(3)} ${w.toFixed(3)}`;
329
+ }
330
+ return y += " Z", y;
331
+ }
332
+ const fe = (t) => {
333
+ const {
334
+ value: e,
335
+ onBlur: a,
336
+ onChange: n,
337
+ onInput: r,
338
+ displayValue: s,
339
+ swatchSize: o,
340
+ withAlpha: c
341
+ } = t, i = {
342
+ xs: 20,
343
+ sm: 26,
344
+ md: 32,
345
+ lg: 40,
346
+ xl: 52
347
+ }, l = o != null ? p.map(o, (m) => Number(m)) : p.map(t.size ?? "md", (m) => i[m] ?? 32), d = p.map(e, (m) => Vt(m ?? "#000000")), h = p.map(
348
+ d,
349
+ ([m, $, C]) => [m, $, C]
350
+ ), y = p.map(d, ([, , , m]) => m), f = ut(p.get(y) ?? 1), g = p.map(c ?? !1, (m) => m), M = p.map(
351
+ t.colorTextFormat ?? "rgb",
352
+ (m) => m
353
+ ), k = D(
354
+ h,
355
+ f,
356
+ M,
357
+ g
358
+ )(
359
+ ([m, $, C], v, N, R) => U(m, $, C, v ?? 1, W(N, R), R)
360
+ ), w = p.map(
361
+ t.colorTextFormat ?? "hex",
362
+ (m) => m
363
+ ), F = p.map(l, (m) => `${-m / 2} ${-m / 2} ${m} ${m}`), b = D(
364
+ h,
365
+ l
366
+ )((m, $) => Gt(m, $ / 2)), A = D(
367
+ h,
368
+ f,
369
+ g
370
+ )(
371
+ ([m, $, C], v, N) => N || v < 1 ? Et(m, $, C, v) : et(m, $, C)
372
+ ), T = x.div(
373
+ u.class("bc-color-swatch-input__control"),
374
+ u.class(
375
+ p.map(
376
+ g,
377
+ (m) => m ? "bc-color-swatch-input__control--alpha" : ""
378
+ )
379
+ ),
380
+ u.style(
381
+ D(l)((m) => `width:${m + 2}px;height:${m + 2}px`)
382
+ ),
383
+ // The SVG blob preview
384
+ ot.svg(
385
+ u.class("bc-color-swatch-input__svg"),
386
+ Q.viewBox(F),
387
+ ot.path(Q.d(b), Q.fill(A))
388
+ ),
389
+ // Invisible native input overlays the blob for picker and accessibility
390
+ x.input(
391
+ u.type("color"),
392
+ L(t),
393
+ // Native color input needs hex without alpha
394
+ u.value(p.map(h, ([m, $, C]) => et(m, $, C))),
395
+ u.class(
396
+ "bc-input bc-color-swatch-input bc-color-swatch-input__native"
397
+ ),
398
+ a != null ? I.blur(a) : S,
399
+ n != null ? I.change((m) => {
400
+ const $ = m.target.value;
401
+ if (!n) return;
402
+ const { r: C, g: v, b: N } = H($) ?? { r: 0, g: 0, b: 0 }, R = p.get(f) ?? 1, V = W(
403
+ p.get(w),
404
+ p.get(g)
405
+ ), q = U(C, v, N, R, V, p.get(g));
406
+ n(q);
407
+ }) : S,
408
+ r != null ? I.input((m) => {
409
+ const $ = m.target.value;
410
+ if (!r) return;
411
+ const { r: C, g: v, b: N } = H($) ?? { r: 0, g: 0, b: 0 }, R = p.get(f) ?? 1, V = W(
412
+ p.get(w),
413
+ p.get(g)
414
+ ), q = U(C, v, N, R, V, p.get(g));
415
+ r(q);
416
+ }) : S
417
+ )
418
+ ), _ = z(
419
+ g,
420
+ () => x.input(
421
+ u.type("range"),
422
+ u.class("bc-color-swatch-input__alpha"),
423
+ u.min(0),
424
+ u.max(1),
425
+ u.step(0.01),
426
+ u.value(p.map(f, (m) => String(m ?? 1))),
427
+ u.disabled(t.disabled),
428
+ I.input((m) => {
429
+ const $ = parseFloat(m.target.value);
430
+ f.set($);
431
+ const [C, v, N] = p.get(h), R = W(
432
+ p.get(w),
433
+ p.get(g)
434
+ ), V = U(C, v, N, $, R, p.get(g));
435
+ r?.(V);
436
+ }),
437
+ I.change((m) => {
438
+ const $ = parseFloat(m.target.value);
439
+ f.set($);
440
+ const [C, v, N] = p.get(h), R = W(
441
+ p.get(w),
442
+ p.get(g)
443
+ ), V = U(C, v, N, $, R, p.get(g));
444
+ n?.(V);
445
+ })
446
+ )
447
+ ), {
448
+ swatchSize: Y,
449
+ displayValue: at,
450
+ withAlpha: K,
451
+ colorTextFormat: rt,
452
+ ...G
453
+ } = t;
454
+ return P({
455
+ baseContainer: !0,
456
+ ...G,
457
+ // ensure our control does not try to grow
458
+ growInput: !1,
459
+ input: T,
460
+ // If caller provided an `after`, append RGB before it
461
+ after: j(
462
+ z(
463
+ s ?? !1,
464
+ () => x.span(u.class("bc-color-swatch-input__rgb"), k)
465
+ ),
466
+ _,
467
+ t.after
468
+ )
469
+ });
470
+ }, Kt = (t) => typeof t == "string" && t.trim() === "" ? null : t, qt = (t) => t ?? "";
471
+ function O(t) {
472
+ return (e) => {
473
+ const { after: a, disabled: n } = e, r = dt(e, qt, Kt), s = X(
474
+ e.value,
475
+ n,
476
+ e.onChange ?? e.onInput
477
+ );
478
+ return t({
479
+ ...r,
480
+ after: a != null ? j(s, a) : s
481
+ });
482
+ };
483
+ }
484
+ const me = ({
485
+ startEditing: t,
486
+ value: e,
487
+ onChange: a,
488
+ placeholder: n,
489
+ disabled: r
490
+ }) => {
491
+ const s = p.deriveProp(t ?? !1), o = ut(!1), c = p.map(r ?? !1, (i) => i);
492
+ return x.div(
493
+ u.class("bc-editable-text"),
494
+ u.class(
495
+ p.map(
496
+ c,
497
+ (i) => i ? "bc-editable-text--disabled" : ""
498
+ )
499
+ ),
500
+ B.disabled(c),
501
+ z(
502
+ s,
503
+ () => x.input(
504
+ u.placeholder(n),
505
+ u.value(e),
506
+ u.class("bc-editable-text__input"),
507
+ Ct(),
508
+ I.keydown((i) => {
509
+ i.key === "Enter" ? s.set(!1) : i.key === "Escape" && (o.set(!0), s.set(!1));
510
+ }),
511
+ I.blur(
512
+ st((i) => {
513
+ if (s.set(!1), o.value) {
514
+ o.set(!1);
515
+ return;
516
+ }
517
+ a(i);
518
+ })
519
+ )
520
+ ),
521
+ () => x.span(
522
+ I.click(() => {
523
+ p.get(c) || s.set(!0);
524
+ }),
525
+ u.class("bc-editable-text__display"),
526
+ z(
527
+ p.map(e, (i) => i != null && i.trim() !== ""),
528
+ () => x.span(u.class("bc-editable-text__text"), e),
529
+ () => x.span(
530
+ u.class("bc-editable-text__placeholder"),
531
+ n
532
+ )
533
+ ),
534
+ z(
535
+ p.map(c, (i) => !i),
536
+ () => x.button(
537
+ u.type("button"),
538
+ u.class("bc-editable-text__edit-button"),
539
+ ft(kt, (i) => B.label(i.$.editLabel)),
540
+ I.click(() => s.set(!0)),
541
+ tt({ icon: "line-md/pencil", color: "neutral" })
542
+ )
543
+ )
544
+ )
545
+ )
546
+ );
547
+ }, be = (t) => {
548
+ const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = X(e, o, n ?? r);
549
+ return P({
550
+ ...t,
551
+ input: pt.date(
552
+ L(t),
553
+ u.valueAsDate(e),
554
+ u.class("bc-input"),
555
+ a != null ? I.blur(st(a)) : S,
556
+ n != null ? I.change(ct(n)) : S,
557
+ r != null ? I.input(ct(r)) : S
558
+ ),
559
+ after: s != null ? j(c, s) : c
560
+ });
561
+ }, Qt = (t) => {
562
+ const e = t.getFullYear(), a = t.getMonth() + 1, n = t.getDate(), r = t.getHours(), s = t.getMinutes(), o = t.getSeconds();
563
+ return `${e}-${a.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${r.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
564
+ }, we = (t) => {
565
+ const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = p.map(e, (l) => l != null ? Qt(l) : null), i = X(e, o, n ?? r);
566
+ return P({
567
+ ...t,
568
+ input: pt["datetime-local"](
569
+ L(t),
570
+ u.value(p.map(c, (l) => l ?? null)),
571
+ u.class("bc-input"),
572
+ a != null ? I.blur(st(a)) : S,
573
+ n != null ? I.change(it(n)) : S,
574
+ r != null ? I.input(it(r)) : S
575
+ ),
576
+ after: s != null ? j(i, s) : i
577
+ });
578
+ }, ye = O(Tt), Me = O(_t), Ie = O(St), $e = O(
579
+ Mt
580
+ ), xe = ({
581
+ value: t,
582
+ onChange: e,
583
+ onInput: a,
584
+ onBlur: n,
585
+ offLabel: r,
586
+ onLabel: s,
587
+ disabled: o = !1,
588
+ size: c = "md",
589
+ id: i,
590
+ color: l = "primary",
591
+ tabIndex: d = 0,
592
+ matchInputHeight: h = !0
593
+ }) => {
594
+ const y = i ?? At("switch");
595
+ function f(w, F) {
596
+ const b = [
597
+ "bc-switch",
598
+ `bc-switch--size-${F}`,
599
+ `bc-switch--${F}`
600
+ ];
601
+ return h && b.push("bc-switch--match-input"), w && b.push("bc-switch--disabled"), b.join(" ");
602
+ }
603
+ function g(w) {
604
+ const F = w ?? "primary", b = /* @__PURE__ */ new Map(), A = lt(F, "solid", "light"), T = lt(F, "solid", "dark");
605
+ return b.set("--switch-track-on-bg", A.backgroundColor), b.set("--switch-track-on-label", A.textColor), b.set("--switch-track-on-bg-dark", T.backgroundColor), b.set("--switch-track-on-label-dark", T.textColor), b.set(
606
+ "--switch-track-on-border-dark",
607
+ Ft(F, "dark")
608
+ ), Array.from(b.entries()).map(([_, Y]) => `${_}: ${Y}`).join("; ");
609
+ }
610
+ const M = () => {
611
+ p.get(o) || (e?.(!p.get(t)), a?.(!p.get(t)));
612
+ }, k = (w) => {
613
+ p.get(o) || (w.key === " " || w.key === "Enter") && (w.preventDefault(), M());
614
+ };
615
+ return x.div(
616
+ u.class(
617
+ D(
618
+ o ?? !1,
619
+ c
620
+ )(
621
+ (w, F) => f(w ?? !1, F ?? "md")
622
+ )
623
+ ),
624
+ u.style(
625
+ D(l)(
626
+ (w) => g(w)
627
+ )
628
+ ),
629
+ u.id(y),
630
+ u.role("switch"),
631
+ u.tabindex(
632
+ D(
633
+ o ?? !1,
634
+ d
635
+ )((w, F) => w ? -1 : F ?? 0)
636
+ ),
637
+ B.checked(t),
638
+ B.disabled(o),
639
+ I.click(M),
640
+ I.keydown(k),
641
+ n != null ? I.blur(n) : null,
642
+ x.div(
643
+ u.class("bc-switch__track"),
644
+ u.class(
645
+ p.map(
646
+ t,
647
+ (w) => w ? "bc-switch__track--on" : "bc-switch__track--off"
648
+ )
649
+ ),
650
+ r != null ? x.div(
651
+ B.hidden(!0),
652
+ u.class("bc-switch__track-label bc-switch__track-label--off"),
653
+ u.class(
654
+ p.map(
655
+ t,
656
+ (w) => w ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
657
+ )
658
+ ),
659
+ r
660
+ ) : null,
661
+ s != null ? x.div(
662
+ u.class("bc-switch__track-label bc-switch__track-label--on"),
663
+ u.class(
664
+ p.map(
665
+ t,
666
+ (w) => w ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
667
+ )
668
+ ),
669
+ s
670
+ ) : null,
671
+ x.div(
672
+ u.class("bc-switch__thumb"),
673
+ u.class(
674
+ p.map(
675
+ t,
676
+ (w) => w ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
677
+ )
678
+ )
679
+ )
680
+ )
681
+ );
682
+ }, _e = O(It), Jt = "line-md:star-alt-filled", Zt = "line-md:star-alt", te = (t) => {
683
+ const {
684
+ value: e,
685
+ onChange: a,
686
+ onInput: n,
687
+ disabled: r,
688
+ max: s = 5,
689
+ fullColor: o = "yellow",
690
+ emptyColor: c = "neutral",
691
+ activeIcon: i = Jt,
692
+ inactiveIcon: l = Zt,
693
+ size: d = "md",
694
+ onBlur: h,
695
+ rounding: y = 1
696
+ } = t, f = () => {
697
+ const b = p.get(y);
698
+ return b > 0 ? b : 1;
699
+ }, g = (b) => Math.min(Math.max(b, 0), p.get(s)), M = (b, A) => {
700
+ if (p.get(r ?? !1)) return;
701
+ const _ = b.currentTarget.getBoundingClientRect(), Y = (b.clientX - _.left) / _.width, at = A - 1 + Y, K = f(), rt = Math.ceil(at / K) * K, G = g(rt);
702
+ a?.(G), n?.(G);
703
+ }, k = (b) => {
704
+ if (p.get(r ?? !1)) return;
705
+ const A = f(), T = p.get(e) ?? 0;
706
+ let _;
707
+ switch (b.key) {
708
+ case "ArrowRight":
709
+ case "ArrowUp":
710
+ _ = g(T + A);
711
+ break;
712
+ case "ArrowLeft":
713
+ case "ArrowDown":
714
+ _ = g(T - A);
715
+ break;
716
+ case "Home":
717
+ _ = 0;
718
+ break;
719
+ case "End":
720
+ _ = p.get(s);
721
+ break;
722
+ default:
723
+ return;
724
+ }
725
+ b.preventDefault(), a?.(_), n?.(_);
726
+ }, w = p.map(d, (b) => `bc-icon--${b}`), F = ({ index: b, counter: A }) => x.span(
727
+ u.class("bc-rating-input__icon-container"),
728
+ u.class(w),
729
+ I.click(
730
+ bt((T) => M(T, A), {
731
+ preventDefault: !0,
732
+ stopPropagation: !0
733
+ })
734
+ ),
735
+ tt(
736
+ {
737
+ icon: l,
738
+ size: d,
739
+ color: c,
740
+ tone: "soft"
741
+ },
742
+ u.class("bc-rating-input__icon-empty")
743
+ ),
744
+ x.span(
745
+ u.class("bc-rating-input__icon-clipper"),
746
+ u.class(w),
747
+ wt.width(
748
+ p.map(e, (T) => {
749
+ const _ = Math.floor(T);
750
+ return _ > b ? "100%" : _ < b ? "0%" : `${(T - b) * 100}%`;
751
+ })
752
+ ),
753
+ tt(
754
+ {
755
+ icon: i,
756
+ size: d,
757
+ color: o,
758
+ tone: "soft"
759
+ },
760
+ u.class("bc-rating-input__icon-full")
761
+ )
762
+ )
763
+ );
764
+ return P({
765
+ baseContainer: !0,
766
+ growInput: !1,
767
+ focusableSelector: '[role="slider"]',
768
+ ...t,
769
+ input: x.div(
770
+ // Common input attributes (id, required, invalid, custom classes, etc.)
771
+ L(t),
772
+ u.class("bc-rating-input"),
773
+ // ARIA slider semantics
774
+ u.role("slider"),
775
+ u.tabindex(p.map(r ?? !1, (b) => b ? -1 : 0)),
776
+ B.disabled(r ?? !1),
777
+ B.valuemin(0),
778
+ B.valuemax(p.map(s, (b) => b ?? 0)),
779
+ B.valuenow(p.map(e, (b) => b ?? 0)),
780
+ B.valuetext(
781
+ D(
782
+ e,
783
+ s
784
+ )((b, A) => {
785
+ const T = b ?? 0, _ = A ?? 0;
786
+ return `${String(T)} / ${String(_)}`;
787
+ })
788
+ ),
789
+ // Keyboard & focus handlers
790
+ I.keydown(k),
791
+ h != null ? I.blur(h) : null,
792
+ mt(s, F)
793
+ )
794
+ });
795
+ }, ke = (t) => {
796
+ const { after: e, disabled: a } = t, n = dt(
797
+ t,
798
+ (s) => s ?? 0,
799
+ (s) => s
800
+ ), r = X(
801
+ t.value,
802
+ a,
803
+ t.onChange ?? t.onInput
804
+ );
805
+ return te({
806
+ ...n,
807
+ after: e != null ? j(r, e) : r
808
+ });
809
+ }, Fe = (t) => {
810
+ const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t;
811
+ return P({
812
+ ...t,
813
+ // Make sure clicks anywhere focus the range input
814
+ focusableSelector: 'input[type="range"]',
815
+ input: x.input(
816
+ u.type("range"),
817
+ L(t),
818
+ u.min(n),
819
+ u.max(r),
820
+ u.step(a),
821
+ // Using value as number to keep it in sync
822
+ u.valueAsNumber(e),
823
+ u.class("bc-input bc-slider-input"),
824
+ s != null ? I.blur(E(s)) : S,
825
+ o != null ? I.change(E(o)) : S,
826
+ c != null ? I.input(E(c)) : S
827
+ )
828
+ });
829
+ }, Ce = (t) => {
830
+ const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t, i = p.map(e, (d) => {
831
+ if (d != null) return d;
832
+ const h = n != null ? p.get(n) : void 0;
833
+ return typeof h == "number" ? h : 0;
834
+ }), l = X(
835
+ e,
836
+ t.disabled,
837
+ o ?? c
838
+ );
839
+ return P({
840
+ ...t,
841
+ focusableSelector: 'input[type="range"]',
842
+ after: l,
843
+ input: x.input(
844
+ u.type("range"),
845
+ L(t),
846
+ u.min(n),
847
+ u.max(r),
848
+ u.step(a),
849
+ u.valueAsNumber(i),
850
+ u.class("bc-input bc-slider-input"),
851
+ s != null ? I.blur(E(s)) : S,
852
+ o != null ? I.change(
853
+ E((d) => {
854
+ o(d);
855
+ })
856
+ ) : S,
857
+ c != null ? I.input(
858
+ E((d) => {
859
+ c(d);
860
+ })
861
+ ) : S
862
+ )
863
+ });
864
+ }, Te = O($t);
865
+ class ee {
866
+ widgets = /* @__PURE__ */ new Map();
867
+ typeMapping = /* @__PURE__ */ new Map();
868
+ // JSON Schema type -> widget names
869
+ /**
870
+ * Register a custom widget
871
+ */
872
+ register(e, a) {
873
+ if (this.widgets.set(e, a), a.supportedTypes)
874
+ for (const n of a.supportedTypes)
875
+ this.typeMapping.has(n) || this.typeMapping.set(n, []), this.typeMapping.get(n).push(e), this.typeMapping.get(n).sort((r, s) => {
876
+ const o = this.widgets.get(r)?.priority || 0;
877
+ return (this.widgets.get(s)?.priority || 0) - o;
878
+ });
879
+ }
880
+ /**
881
+ * Unregister a widget
882
+ */
883
+ unregister(e) {
884
+ const a = this.widgets.get(e);
885
+ if (a && (this.widgets.delete(e), a.supportedTypes))
886
+ for (const n of a.supportedTypes) {
887
+ const r = this.typeMapping.get(n);
888
+ if (r) {
889
+ const s = r.indexOf(e);
890
+ s >= 0 && r.splice(s, 1), r.length === 0 && this.typeMapping.delete(n);
891
+ }
892
+ }
893
+ }
894
+ /**
895
+ * Get a registered widget
896
+ */
897
+ get(e) {
898
+ return this.widgets.get(e);
899
+ }
900
+ /**
901
+ * Get all registered widgets
902
+ */
903
+ getAll() {
904
+ return new Map(this.widgets);
905
+ }
906
+ /**
907
+ * Get widgets that support a specific JSON Schema type
908
+ */
909
+ getForType(e) {
910
+ return (this.typeMapping.get(e) || []).map((n) => this.widgets.get(n)).filter(Boolean);
911
+ }
912
+ /**
913
+ * Find the best widget for a schema context
914
+ */
915
+ findBestWidget(e) {
916
+ const a = vt(e.definition, e.name);
917
+ if (a?.widget) {
918
+ const r = this.widgets.get(a.widget);
919
+ if (r)
920
+ return { name: a.widget, registration: r, resolved: a };
921
+ }
922
+ const n = [];
923
+ for (const [r, s] of this.widgets.entries())
924
+ if (s.matcher)
925
+ try {
926
+ s.matcher(e) && n.push({
927
+ name: r,
928
+ registration: s,
929
+ priority: s.priority ?? 0
930
+ });
931
+ } catch (o) {
932
+ console.warn(`Error in matcher for widget "${r}":`, o);
933
+ }
934
+ if (n.length > 0) {
935
+ n.sort((s, o) => o.priority - s.priority);
936
+ const r = n[0];
937
+ return {
938
+ name: r.name,
939
+ registration: r.registration,
940
+ resolved: { widget: r.name, source: "heuristics" }
941
+ };
942
+ }
943
+ if (typeof e.definition == "object" && e.definition.type) {
944
+ const r = Array.isArray(e.definition.type) ? e.definition.type[0] : e.definition.type, s = this.getForType(r);
945
+ if (s.length > 0) {
946
+ const o = this.typeMapping.get(r)[0];
947
+ return {
948
+ name: o,
949
+ registration: s[0],
950
+ resolved: { widget: o, source: "type-fallback" }
951
+ };
952
+ }
953
+ }
954
+ return null;
955
+ }
956
+ }
957
+ const Se = new ee();
958
+ function Ae(t, e, a) {
959
+ return {
960
+ factory: e,
961
+ matcher: (n) => {
962
+ const s = n.definition["x:ui"];
963
+ return s === t || typeof s == "object" && s !== null && s.widget === t;
964
+ },
965
+ displayName: a?.displayName ?? t,
966
+ priority: a?.priority ?? 100,
967
+ // High priority for explicit matches
968
+ ...a
969
+ };
970
+ }
971
+ function ve(t, e, a) {
972
+ return {
973
+ factory: e,
974
+ matcher: (n) => n.definition.format === t,
975
+ displayName: a?.displayName ?? `${t} widget`,
976
+ priority: a?.priority ?? 75,
977
+ ...a
978
+ };
979
+ }
980
+ function Ne(t, e, a, n) {
981
+ return {
982
+ factory: a,
983
+ matcher: (r) => {
984
+ const s = r.definition;
985
+ return s.type === t && s.format === e;
986
+ },
987
+ displayName: n?.displayName ?? `${t}:${e} widget`,
988
+ priority: n?.priority ?? 80,
989
+ ...n
990
+ };
991
+ }
992
+ function Re(t) {
993
+ const e = t?.logPrefix ?? "WIDGET_DIAG", a = t?.filterFn ?? (() => !0);
994
+ return {
995
+ factory: () => null,
996
+ displayName: "Diagnostic Widget (never matches)",
997
+ priority: -1e3,
998
+ // Very low priority, should never actually match
999
+ matcher: (n) => {
1000
+ if (!a(n)) return !1;
1001
+ const r = n.definition, s = {
1002
+ name: n.name,
1003
+ path: n.path.map(String),
1004
+ type: r?.type,
1005
+ hasRegistry: n.widgetRegistry !== void 0,
1006
+ definition: r
1007
+ };
1008
+ return console.log(
1009
+ `[${e}] name="${s.name ?? "ROOT"}" path=[${s.path.join(", ")}] type="${s.type ?? "unknown"}" hasRegistry=${s.hasRegistry}`
1010
+ ), t?.onProcess?.(s), !1;
1011
+ }
1012
+ };
1013
+ }
1014
+ export {
1015
+ Lt as A,
1016
+ ge as B,
1017
+ fe as C,
1018
+ Bt as D,
1019
+ me as E,
1020
+ Nt as F,
1021
+ Rt as G,
1022
+ Z as H,
1023
+ Pt as I,
1024
+ Ut as J,
1025
+ Vt as K,
1026
+ W as L,
1027
+ et as M,
1028
+ Me as N,
1029
+ nt as O,
1030
+ Ot as P,
1031
+ Wt as Q,
1032
+ te as R,
1033
+ Fe as S,
1034
+ J as T,
1035
+ Et as U,
1036
+ ee as W,
1037
+ $e as a,
1038
+ _e as b,
1039
+ Te as c,
1040
+ Ie as d,
1041
+ we as e,
1042
+ be as f,
1043
+ Se as g,
1044
+ ye as h,
1045
+ Ce as i,
1046
+ ke as j,
1047
+ xe as k,
1048
+ Re as l,
1049
+ ve as m,
1050
+ Ne as n,
1051
+ Ae as o,
1052
+ Kt as p,
1053
+ qt as q,
1054
+ de as r,
1055
+ ht as s,
1056
+ Dt as t,
1057
+ Yt as u,
1058
+ zt as v,
1059
+ U as w,
1060
+ he as x,
1061
+ H as y,
1062
+ gt as z
1063
+ };