@redvars/peacock 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (890) hide show
  1. package/dist/accordion-item.js +54 -35
  2. package/dist/accordion-item.js.map +1 -1
  3. package/dist/accordion.js +9 -9
  4. package/dist/accordion.js.map +1 -1
  5. package/dist/agent.js +1937 -0
  6. package/dist/agent.js.map +1 -0
  7. package/dist/ai-badge.js +5 -8
  8. package/dist/ai-badge.js.map +1 -1
  9. package/dist/ai-summary.js +5 -8
  10. package/dist/ai-summary.js.map +1 -1
  11. package/dist/alert.js +6 -9
  12. package/dist/alert.js.map +1 -1
  13. package/dist/anchor-nav.js +6 -9
  14. package/dist/anchor-nav.js.map +1 -1
  15. package/dist/announce-Cqen_7FM.js +45 -0
  16. package/dist/announce-Cqen_7FM.js.map +1 -0
  17. package/dist/app-bar.js +5 -8
  18. package/dist/app-bar.js.map +1 -1
  19. package/dist/app-shell.js +6 -9
  20. package/dist/app-shell.js.map +1 -1
  21. package/dist/assistant-panel.js +5 -8
  22. package/dist/assistant-panel.js.map +1 -1
  23. package/dist/assistant-step.js +4 -7
  24. package/dist/assistant-step.js.map +1 -1
  25. package/dist/assistant-steps.js +5 -8
  26. package/dist/assistant-steps.js.map +1 -1
  27. package/dist/{attachable-controller-DofeyflD.js → attachable-controller-seKf2eqC.js} +2 -2
  28. package/dist/{attachable-controller-DofeyflD.js.map → attachable-controller-seKf2eqC.js.map} +1 -1
  29. package/dist/avatar-group.js +5 -8
  30. package/dist/avatar-group.js.map +1 -1
  31. package/dist/avatar.js +6 -9
  32. package/dist/avatar.js.map +1 -1
  33. package/dist/badge.js +5 -8
  34. package/dist/badge.js.map +1 -1
  35. package/dist/banner.js +6 -9
  36. package/dist/banner.js.map +1 -1
  37. package/dist/{base-button-9tGu5RSC.js → base-button-CkV2vtVA.js} +2 -3
  38. package/dist/base-button-CkV2vtVA.js.map +1 -0
  39. package/dist/bottom-sheet.js +7 -10
  40. package/dist/bottom-sheet.js.map +1 -1
  41. package/dist/breadcrumb-item.js +7 -10
  42. package/dist/breadcrumb-item.js.map +1 -1
  43. package/dist/breadcrumb.js +7 -10
  44. package/dist/breadcrumb.js.map +1 -1
  45. package/dist/{ButtonConstants-CahP2_NA.js → button-constants-CahP2_NA.js} +1 -1
  46. package/dist/button-constants-CahP2_NA.js.map +1 -0
  47. package/dist/button-group.js +16 -17
  48. package/dist/button-group.js.map +1 -1
  49. package/dist/button.js +237 -16
  50. package/dist/button.js.map +1 -1
  51. package/dist/calendar-column-view.js +7 -10
  52. package/dist/calendar-column-view.js.map +1 -1
  53. package/dist/{calendar-header-DVrfThwr.js → calendar-header-CXz48-1c.js} +2 -2
  54. package/dist/{calendar-header-DVrfThwr.js.map → calendar-header-CXz48-1c.js.map} +1 -1
  55. package/dist/calendar-month-view.js +7 -10
  56. package/dist/calendar-month-view.js.map +1 -1
  57. package/dist/calendar-timeline.js +8 -11
  58. package/dist/calendar-timeline.js.map +1 -1
  59. package/dist/calendar.js +7 -10
  60. package/dist/calendar.js.map +1 -1
  61. package/dist/{canvas-base-BjiU3Ecl.js → canvas-base-BnbNbzej.js} +15 -15
  62. package/dist/canvas-base-BnbNbzej.js.map +1 -0
  63. package/dist/card-content.js +3 -6
  64. package/dist/card-content.js.map +1 -1
  65. package/dist/card.js +8 -11
  66. package/dist/card.js.map +1 -1
  67. package/dist/carousel.js +7 -10
  68. package/dist/carousel.js.map +1 -1
  69. package/dist/{cartesian-chart-iE3cmeGF.js → cartesian-chart-C8qKDXo8.js} +4 -4
  70. package/dist/{cartesian-chart-iE3cmeGF.js.map → cartesian-chart-C8qKDXo8.js.map} +1 -1
  71. package/dist/cb-divider.js +5 -8
  72. package/dist/cb-divider.js.map +1 -1
  73. package/dist/cb-group.js +9 -12
  74. package/dist/cb-group.js.map +1 -1
  75. package/dist/cb-rule.js +6 -6
  76. package/dist/chart-area.js +9 -12
  77. package/dist/chart-area.js.map +1 -1
  78. package/dist/chart-bar.js +9 -12
  79. package/dist/chart-bar.js.map +1 -1
  80. package/dist/{chart-base-CDyVDmz7.js → chart-base-BpQMZZsw.js} +6 -6
  81. package/dist/{chart-base-CDyVDmz7.js.map → chart-base-BpQMZZsw.js.map} +1 -1
  82. package/dist/chart-doughnut.js +8 -11
  83. package/dist/chart-doughnut.js.map +1 -1
  84. package/dist/chart-line.js +9 -12
  85. package/dist/chart-line.js.map +1 -1
  86. package/dist/chart-pie.js +8 -11
  87. package/dist/chart-pie.js.map +1 -1
  88. package/dist/chat-event.js +4 -7
  89. package/dist/chat-event.js.map +1 -1
  90. package/dist/chat-message.js +6 -9
  91. package/dist/chat-message.js.map +1 -1
  92. package/dist/chat-thread.js +5 -8
  93. package/dist/chat-thread.js.map +1 -1
  94. package/dist/checkbox-group.js +11 -14
  95. package/dist/checkbox-group.js.map +1 -1
  96. package/dist/checkbox.js +50 -32
  97. package/dist/checkbox.js.map +1 -1
  98. package/dist/chip-set.js +8 -11
  99. package/dist/chip-set.js.map +1 -1
  100. package/dist/chip.js +11 -14
  101. package/dist/chip.js.map +1 -1
  102. package/dist/circular-progress.js +8 -11
  103. package/dist/circular-progress.js.map +1 -1
  104. package/dist/citation.js +5 -8
  105. package/dist/citation.js.map +1 -1
  106. package/dist/{class-map-NDIkZErE.js → class-map-DN-g_e4M.js} +2 -2
  107. package/dist/{class-map-NDIkZErE.js.map → class-map-DN-g_e4M.js.map} +1 -1
  108. package/dist/clock.js +4 -7
  109. package/dist/clock.js.map +1 -1
  110. package/dist/code-editor.js +67 -20
  111. package/dist/code-editor.js.map +1 -1
  112. package/dist/code-group.js +5 -8
  113. package/dist/code-group.js.map +1 -1
  114. package/dist/code-highlighter.js +7 -10
  115. package/dist/code-highlighter.js.map +1 -1
  116. package/dist/color-field.js +13 -13
  117. package/dist/color-field.js.map +1 -1
  118. package/dist/color-picker.js +6 -9
  119. package/dist/color-picker.js.map +1 -1
  120. package/dist/{coming-soon-BbkKjSbP.js → coming-soon-D3KYDcUT.js} +2 -2
  121. package/dist/{coming-soon-BbkKjSbP.js.map → coming-soon-D3KYDcUT.js.map} +1 -1
  122. package/dist/command-palette.js +8 -11
  123. package/dist/command-palette.js.map +1 -1
  124. package/dist/comment-composer.js +13 -16
  125. package/dist/comment-composer.js.map +1 -1
  126. package/dist/condition-builder.js +10 -13
  127. package/dist/condition-builder.js.map +1 -1
  128. package/dist/{cb-group-base-CWctDJvy.js → condition-group-base-1g9O6qDB.js} +31 -34
  129. package/dist/condition-group-base-1g9O6qDB.js.map +1 -0
  130. package/dist/{cb-group-base-2Ps2CnBz.js → condition-group-base-NcvOY-Zv.js} +2 -2
  131. package/dist/condition-group-base-NcvOY-Zv.js.map +1 -0
  132. package/dist/confirm-dialog.js +7 -10
  133. package/dist/confirm-dialog.js.map +1 -1
  134. package/dist/container.js +5 -8
  135. package/dist/container.js.map +1 -1
  136. package/dist/copy-button.js +6 -10
  137. package/dist/copy-button.js.map +1 -1
  138. package/dist/currency-field.js +11 -12
  139. package/dist/currency-field.js.map +1 -1
  140. package/dist/custom-elements-jsdocs.json +1225 -1565
  141. package/dist/custom-elements.json +99273 -96538
  142. package/dist/{datasource-DxEA6jHW.js → datasource-C1SmuuOZ.js} +2 -2
  143. package/dist/{datasource-DxEA6jHW.js.map → datasource-C1SmuuOZ.js.map} +1 -1
  144. package/dist/date-field.js +14 -15
  145. package/dist/date-field.js.map +1 -1
  146. package/dist/{date-DPQOY8Zd.js → date-hLvScHFM.js} +2 -2
  147. package/dist/{date-DPQOY8Zd.js.map → date-hLvScHFM.js.map} +1 -1
  148. package/dist/date-picker.js +7 -10
  149. package/dist/date-picker.js.map +1 -1
  150. package/dist/date-range-field.js +14 -15
  151. package/dist/date-range-field.js.map +1 -1
  152. package/dist/datetime-field.js +13 -14
  153. package/dist/datetime-field.js.map +1 -1
  154. package/dist/define-element-DwIWgY_Y.js +2364 -0
  155. package/dist/define-element-DwIWgY_Y.js.map +1 -0
  156. package/dist/{delegate-Bw2wdPFP.js → delegate-BhEozvyn.js} +2 -2
  157. package/dist/{delegate-Bw2wdPFP.js.map → delegate-BhEozvyn.js.map} +1 -1
  158. package/dist/dependency-map.js +9 -12
  159. package/dist/dependency-map.js.map +1 -1
  160. package/dist/description-item.js +5 -8
  161. package/dist/description-item.js.map +1 -1
  162. package/dist/description-list.js +5 -8
  163. package/dist/description-list.js.map +1 -1
  164. package/dist/diagram-controls.js +6 -9
  165. package/dist/diagram-controls.js.map +1 -1
  166. package/dist/{diagram-D2aM93kf.js → diagram-hv7hCgzx.js} +9 -12
  167. package/dist/diagram-hv7hCgzx.js.map +1 -0
  168. package/dist/diagram-minimap.js +5 -8
  169. package/dist/diagram-minimap.js.map +1 -1
  170. package/dist/diagram.js +8 -8
  171. package/dist/diff-viewer.js +6 -9
  172. package/dist/diff-viewer.js.map +1 -1
  173. package/dist/{directive-helpers-Bx3mu42O.js → directive-helpers-DeGn4TbT.js} +2 -2
  174. package/dist/{directive-helpers-Bx3mu42O.js.map → directive-helpers-DeGn4TbT.js.map} +1 -1
  175. package/dist/discussion-activity.js +5 -8
  176. package/dist/discussion-activity.js.map +1 -1
  177. package/dist/discussion-comment.js +7 -11
  178. package/dist/discussion-comment.js.map +1 -1
  179. package/dist/{discussion-time-DqykqvNy.js → discussion-time-Bghw_Adc.js} +2 -2
  180. package/dist/{discussion-time-DqykqvNy.js.map → discussion-time-Bghw_Adc.js.map} +1 -1
  181. package/dist/discussion.js +14 -17
  182. package/dist/discussion.js.map +1 -1
  183. package/dist/divider.js +6 -9
  184. package/dist/divider.js.map +1 -1
  185. package/dist/{document-editor-BS6al7Hq.js → document-editor-CZBlz3ai.js} +12 -15
  186. package/dist/document-editor-CZBlz3ai.js.map +1 -0
  187. package/dist/document-editor.js +8 -8
  188. package/dist/draft-card.js +5 -8
  189. package/dist/draft-card.js.map +1 -1
  190. package/dist/dropdown-button.js +56 -30
  191. package/dist/dropdown-button.js.map +1 -1
  192. package/dist/elevation.js +3 -6
  193. package/dist/elevation.js.map +1 -1
  194. package/dist/{empty-MArzZMl4.js → empty-DEhaDrWj.js} +2 -2
  195. package/dist/{empty-MArzZMl4.js.map → empty-DEhaDrWj.js.map} +1 -1
  196. package/dist/{empty-cart-RTR3HBYT.js → empty-cart-BHaNZ2lY.js} +2 -2
  197. package/dist/{empty-cart-RTR3HBYT.js.map → empty-cart-BHaNZ2lY.js.map} +1 -1
  198. package/dist/{empty-inbox-TkdPARS5.js → empty-inbox-CJJaz9E6.js} +2 -2
  199. package/dist/{empty-inbox-TkdPARS5.js.map → empty-inbox-CJJaz9E6.js.map} +1 -1
  200. package/dist/erd.js +9 -12
  201. package/dist/erd.js.map +1 -1
  202. package/dist/{error-MDLh6Iqt.js → error-BemWzRq8.js} +2 -2
  203. package/dist/{error-MDLh6Iqt.js.map → error-BemWzRq8.js.map} +1 -1
  204. package/dist/{event-manager-DYfeN3VE.js → event-manager-BRD5ndh1.js} +2 -2
  205. package/dist/{event-manager-DYfeN3VE.js.map → event-manager-BRD5ndh1.js.map} +1 -1
  206. package/dist/fab.js +12 -15
  207. package/dist/fab.js.map +1 -1
  208. package/dist/{BaseField-DOCmylob.js → field-base-D9lh_aNl.js} +106 -21
  209. package/dist/field-base-D9lh_aNl.js.map +1 -0
  210. package/dist/field.js +6 -9
  211. package/dist/field.js.map +1 -1
  212. package/dist/fieldset.js +5 -8
  213. package/dist/fieldset.js.map +1 -1
  214. package/dist/file-upload.js +10 -13
  215. package/dist/file-upload.js.map +1 -1
  216. package/dist/filter-bar.js +9 -12
  217. package/dist/filter-bar.js.map +1 -1
  218. package/dist/flow.js +10 -13
  219. package/dist/flow.js.map +1 -1
  220. package/dist/focus-ring.js +5 -8
  221. package/dist/focus-ring.js.map +1 -1
  222. package/dist/{form-associated-BHbg72PG.js → form-associated-CZ4StgI6.js} +2 -3
  223. package/dist/{form-associated-BHbg72PG.js.map → form-associated-CZ4StgI6.js.map} +1 -1
  224. package/dist/{form-submitter-BIFqZ0wq.js → form-submitter-D16XUqJu.js} +3 -3
  225. package/dist/{form-submitter-BIFqZ0wq.js.map → form-submitter-D16XUqJu.js.map} +1 -1
  226. package/dist/form.js +7 -10
  227. package/dist/form.js.map +1 -1
  228. package/dist/{generative-view-DsSOPf26.js → generative-view-DYBvSwd_.js} +5 -8
  229. package/dist/generative-view-DYBvSwd_.js.map +1 -0
  230. package/dist/generative-view.js +3 -3
  231. package/dist/grid.js +4 -7
  232. package/dist/grid.js.map +1 -1
  233. package/dist/{highlight-Be0wu7kh.js → highlight-Do-Syp3T.js} +6 -9
  234. package/dist/highlight-Do-Syp3T.js.map +1 -0
  235. package/dist/highlight.js +4 -4
  236. package/dist/hover-card.js +4 -7
  237. package/dist/hover-card.js.map +1 -1
  238. package/dist/html-editor.js +13 -16
  239. package/dist/html-editor.js.map +1 -1
  240. package/dist/{hyperlink-DycWPKwU.js → hyperlink-DFN9NWCO.js} +2 -3
  241. package/dist/{hyperlink-DycWPKwU.js.map → hyperlink-DFN9NWCO.js.map} +1 -1
  242. package/dist/icon-button.js +12 -15
  243. package/dist/icon-button.js.map +1 -1
  244. package/dist/icon.js +8 -11
  245. package/dist/icon.js.map +1 -1
  246. package/dist/{if-defined-D9DEJR_6.js → if-defined-2i6tzDo8.js} +2 -2
  247. package/dist/{if-defined-D9DEJR_6.js.map → if-defined-2i6tzDo8.js.map} +1 -1
  248. package/dist/{illustration-DQ-_sz1l.js → illustration-C5AFfmfu.js} +24 -27
  249. package/dist/illustration-C5AFfmfu.js.map +1 -0
  250. package/dist/illustration.js +4 -4
  251. package/dist/image.js +5 -8
  252. package/dist/image.js.map +1 -1
  253. package/dist/{index-V2ozemrR.js → index-Bag4vtx-.js} +5 -5
  254. package/dist/{index-V2ozemrR.js.map → index-Bag4vtx-.js.map} +1 -1
  255. package/dist/{index-BnzqYRhq.js → index-CTEt3LtO.js} +6 -6
  256. package/dist/{index-BnzqYRhq.js.map → index-CTEt3LtO.js.map} +1 -1
  257. package/dist/{index-JdgBct78.js → index-DK3fREuj.js} +6 -6
  258. package/dist/{index-JdgBct78.js.map → index-DK3fREuj.js.map} +1 -1
  259. package/dist/index.js +133 -131
  260. package/dist/index.js.map +1 -1
  261. package/dist/{indicator-navigation-item-BsQE3kUr.js → indicator-navigation-item-BG0TrdDE.js} +6 -5
  262. package/dist/indicator-navigation-item-BG0TrdDE.js.map +1 -0
  263. package/dist/inline-edit.js +6 -9
  264. package/dist/inline-edit.js.map +1 -1
  265. package/dist/{BaseInput-Cv03GZLu.js → input-base-u60DF-pm.js} +21 -14
  266. package/dist/input-base-u60DF-pm.js.map +1 -0
  267. package/dist/input.js +609 -32
  268. package/dist/input.js.map +1 -1
  269. package/dist/item.js +5 -8
  270. package/dist/item.js.map +1 -1
  271. package/dist/json-viewer.js +8 -12
  272. package/dist/json-viewer.js.map +1 -1
  273. package/dist/kanban.js +7 -10
  274. package/dist/kanban.js.map +1 -1
  275. package/dist/kbd.js +4 -7
  276. package/dist/kbd.js.map +1 -1
  277. package/dist/linear-progress.js +8 -11
  278. package/dist/linear-progress.js.map +1 -1
  279. package/dist/link-button.js +9 -12
  280. package/dist/link-button.js.map +1 -1
  281. package/dist/link.js +6 -9
  282. package/dist/link.js.map +1 -1
  283. package/dist/list-item.js +9 -12
  284. package/dist/list-item.js.map +1 -1
  285. package/dist/list.js +10 -14
  286. package/dist/list.js.map +1 -1
  287. package/dist/listbox-option.js +5 -8
  288. package/dist/listbox-option.js.map +1 -1
  289. package/dist/listbox.js +8 -11
  290. package/dist/listbox.js.map +1 -1
  291. package/dist/{IndividualComponent-BK7XZjE2.js → lit-element-CKa37m3w.js} +2 -55
  292. package/dist/lit-element-CKa37m3w.js.map +1 -0
  293. package/dist/{live-D_5OfuGD.js → live-gbwOCSod.js} +3 -3
  294. package/dist/{live-D_5OfuGD.js.map → live-gbwOCSod.js.map} +1 -1
  295. package/dist/loader-full.js +87 -84
  296. package/dist/loader-full.js.map +1 -1
  297. package/dist/loader.js +83 -81
  298. package/dist/loader.js.map +1 -1
  299. package/dist/{maintenance-BZw7mQ0A.js → maintenance-tErBUSEw.js} +2 -2
  300. package/dist/{maintenance-BZw7mQ0A.js.map → maintenance-tErBUSEw.js.map} +1 -1
  301. package/dist/markdown-editor.js +13 -16
  302. package/dist/markdown-editor.js.map +1 -1
  303. package/dist/markdown.js +4 -7
  304. package/dist/markdown.js.map +1 -1
  305. package/dist/mention-input.js +13 -13
  306. package/dist/mention-input.js.map +1 -1
  307. package/dist/menu-item.js +44 -27
  308. package/dist/menu-item.js.map +1 -1
  309. package/dist/menu.js +13 -14
  310. package/dist/menu.js.map +1 -1
  311. package/dist/{modal-B78gUfEO.js → modal-Dds0rXAG.js} +2 -2
  312. package/dist/{modal-B78gUfEO.js.map → modal-Dds0rXAG.js.map} +1 -1
  313. package/dist/modal.js +56 -39
  314. package/dist/modal.js.map +1 -1
  315. package/dist/{NativeHyperlinkMixin-WdY0fM-H.js → native-hyperlink-mixin-DClKAwRB.js} +2 -3
  316. package/dist/native-hyperlink-mixin-DClKAwRB.js.map +1 -0
  317. package/dist/navigation-bar-item.js +8 -11
  318. package/dist/navigation-bar-item.js.map +1 -1
  319. package/dist/navigation-bar.js +8 -11
  320. package/dist/navigation-bar.js.map +1 -1
  321. package/dist/navigation-drawer-group.js +6 -9
  322. package/dist/navigation-drawer-group.js.map +1 -1
  323. package/dist/navigation-drawer-item.js +7 -10
  324. package/dist/navigation-drawer-item.js.map +1 -1
  325. package/dist/navigation-drawer.js +7 -10
  326. package/dist/navigation-drawer.js.map +1 -1
  327. package/dist/{navigation-item-base-5ljwtLG_.js → navigation-item-base-HiLyp0Jy.js} +6 -6
  328. package/dist/navigation-item-base-HiLyp0Jy.js.map +1 -0
  329. package/dist/navigation-rail-item.js +8 -11
  330. package/dist/navigation-rail-item.js.map +1 -1
  331. package/dist/navigation-rail.js +8 -11
  332. package/dist/navigation-rail.js.map +1 -1
  333. package/dist/{no-access-DOmzxO0C.js → no-access-D3L12uhZ.js} +2 -2
  334. package/dist/{no-access-DOmzxO0C.js.map → no-access-D3L12uhZ.js.map} +1 -1
  335. package/dist/{no-files-_DUjcOnS.js → no-files--1GlOwIi.js} +2 -2
  336. package/dist/{no-files-_DUjcOnS.js.map → no-files--1GlOwIi.js.map} +1 -1
  337. package/dist/{no-messages-W3p58prD.js → no-messages-RHcmrW_n.js} +2 -2
  338. package/dist/{no-messages-W3p58prD.js.map → no-messages-RHcmrW_n.js.map} +1 -1
  339. package/dist/{no-notifications-Egym20FL.js → no-notifications-3gareJzA.js} +2 -2
  340. package/dist/{no-notifications-Egym20FL.js.map → no-notifications-3gareJzA.js.map} +1 -1
  341. package/dist/{no-results-Czha8DJZ.js → no-results-RWt23viO.js} +2 -2
  342. package/dist/{no-results-Czha8DJZ.js.map → no-results-RWt23viO.js.map} +1 -1
  343. package/dist/{no-team-DdNiPdaJ.js → no-team-25HWP4Fw.js} +2 -2
  344. package/dist/{no-team-DdNiPdaJ.js.map → no-team-25HWP4Fw.js.map} +1 -1
  345. package/dist/{not-found-DYazH-nz.js → not-found-BUGJAd3z.js} +2 -2
  346. package/dist/{not-found-DYazH-nz.js.map → not-found-BUGJAd3z.js.map} +1 -1
  347. package/dist/notification-center.js +9 -12
  348. package/dist/notification-center.js.map +1 -1
  349. package/dist/notification-manager.js +8 -11
  350. package/dist/notification-manager.js.map +1 -1
  351. package/dist/number-counter.js +5 -8
  352. package/dist/number-counter.js.map +1 -1
  353. package/dist/number-field.js +25 -17
  354. package/dist/number-field.js.map +1 -1
  355. package/dist/{offline-C3W_TN1c.js → offline-BUqjpgON.js} +2 -2
  356. package/dist/{offline-C3W_TN1c.js.map → offline-BUqjpgON.js.map} +1 -1
  357. package/dist/option.js +11 -11
  358. package/dist/option.js.map +1 -1
  359. package/dist/page-header.js +6 -9
  360. package/dist/page-header.js.map +1 -1
  361. package/dist/pagination.js +5 -8
  362. package/dist/pagination.js.map +1 -1
  363. package/dist/panel.js +5 -8
  364. package/dist/panel.js.map +1 -1
  365. package/dist/password-field.js +11 -12
  366. package/dist/password-field.js.map +1 -1
  367. package/dist/password-rules.js +6 -9
  368. package/dist/password-rules.js.map +1 -1
  369. package/dist/phone-field.js +12 -14
  370. package/dist/phone-field.js.map +1 -1
  371. package/dist/{picker-field-BiM3iXAQ.js → picker-field-base-C33dJ4iZ.js} +17 -17
  372. package/dist/picker-field-base-C33dJ4iZ.js.map +1 -0
  373. package/dist/pin-input.js +14 -15
  374. package/dist/pin-input.js.map +1 -1
  375. package/dist/platform-DHfE4Fvo.js +954 -0
  376. package/dist/platform-DHfE4Fvo.js.map +1 -0
  377. package/dist/popover-content.js +5 -8
  378. package/dist/popover-content.js.map +1 -1
  379. package/dist/popover.js +4 -7
  380. package/dist/popover.js.map +1 -1
  381. package/dist/presence-indicator.js +6 -9
  382. package/dist/presence-indicator.js.map +1 -1
  383. package/dist/{base-progress-CqsyiVOV.js → progress-base-BhJK__VP.js} +12 -12
  384. package/dist/{base-progress-CqsyiVOV.js.map → progress-base-BhJK__VP.js.map} +1 -1
  385. package/dist/prompt-input.js +13 -16
  386. package/dist/prompt-input.js.map +1 -1
  387. package/dist/property-Dn3pvFDo.js +52 -0
  388. package/dist/property-Dn3pvFDo.js.map +1 -0
  389. package/dist/radio-group.js +7 -10
  390. package/dist/radio-group.js.map +1 -1
  391. package/dist/radio.js +49 -31
  392. package/dist/radio.js.map +1 -1
  393. package/dist/{range-utils-vgG1SJ2o.js → range-utils-Cw7ZRoWX.js} +2 -2
  394. package/dist/range-utils-Cw7ZRoWX.js.map +1 -0
  395. package/dist/rating.js +11 -14
  396. package/dist/rating.js.map +1 -1
  397. package/dist/redvars-loader.js +5 -8
  398. package/dist/redvars-loader.js.map +1 -1
  399. package/dist/relative-time.js +4 -7
  400. package/dist/relative-time.js.map +1 -1
  401. package/dist/{repeat-D_ERDRYT.js → repeat-D6FogcKA.js} +3 -3
  402. package/dist/{repeat-D_ERDRYT.js.map → repeat-D6FogcKA.js.map} +1 -1
  403. package/dist/resizable-panels.js +6 -9
  404. package/dist/resizable-panels.js.map +1 -1
  405. package/dist/{rich-text-input-BCZ46UF8.js → rich-text-input-base-SrsPvc-j.js} +33 -33
  406. package/dist/rich-text-input-base-SrsPvc-j.js.map +1 -0
  407. package/dist/ripple.js +7 -10
  408. package/dist/ripple.js.map +1 -1
  409. package/dist/{sanitize-svg-zWrzQaZj.js → sanitize-svg-CULgPfeE.js} +2 -2
  410. package/dist/{sanitize-svg-zWrzQaZj.js.map → sanitize-svg-CULgPfeE.js.map} +1 -1
  411. package/dist/{schema-D0PCeIEA.js → schema-poFmQ9Kg.js} +2 -2
  412. package/dist/{schema-D0PCeIEA.js.map → schema-poFmQ9Kg.js.map} +1 -1
  413. package/dist/scroll-area.js +6 -9
  414. package/dist/scroll-area.js.map +1 -1
  415. package/dist/search.js +12 -15
  416. package/dist/search.js.map +1 -1
  417. package/dist/segmented-button-group.js +7 -10
  418. package/dist/segmented-button-group.js.map +1 -1
  419. package/dist/segmented-button.js +6 -9
  420. package/dist/segmented-button.js.map +1 -1
  421. package/dist/select.js +103 -19
  422. package/dist/select.js.map +1 -1
  423. package/dist/{server-error-CaExaWmH.js → server-error-C7x8CCtT.js} +2 -2
  424. package/dist/{server-error-CaExaWmH.js.map → server-error-C7x8CCtT.js.map} +1 -1
  425. package/dist/shipped-icons.js +1 -1
  426. package/dist/side-sheet.js +5 -8
  427. package/dist/side-sheet.js.map +1 -1
  428. package/dist/signature-pad.js +10 -13
  429. package/dist/signature-pad.js.map +1 -1
  430. package/dist/site-footer-group.js +4 -7
  431. package/dist/site-footer-group.js.map +1 -1
  432. package/dist/site-footer.js +6 -9
  433. package/dist/site-footer.js.map +1 -1
  434. package/dist/site-header.js +7 -10
  435. package/dist/site-header.js.map +1 -1
  436. package/dist/site-nav-group.js +4 -7
  437. package/dist/site-nav-group.js.map +1 -1
  438. package/dist/site-nav-link.js +7 -10
  439. package/dist/site-nav-link.js.map +1 -1
  440. package/dist/site-nav-menu.js +6 -9
  441. package/dist/site-nav-menu.js.map +1 -1
  442. package/dist/skeleton.js +4 -7
  443. package/dist/skeleton.js.map +1 -1
  444. package/dist/{slash-controller-DAsDquPA.js → slash-controller-DwL0nkqv.js} +4 -4
  445. package/dist/{slash-controller-DAsDquPA.js.map → slash-controller-DwL0nkqv.js.map} +1 -1
  446. package/dist/slider.js +11 -14
  447. package/dist/slider.js.map +1 -1
  448. package/dist/snackbar.js +10 -14
  449. package/dist/snackbar.js.map +1 -1
  450. package/dist/{sparkle-BmtM0vbq.js → sparkle-DbxCXWsC.js} +2 -2
  451. package/dist/{sparkle-BmtM0vbq.js.map → sparkle-DbxCXWsC.js.map} +1 -1
  452. package/dist/sparkline.js +6 -9
  453. package/dist/sparkline.js.map +1 -1
  454. package/dist/split-button.js +41 -25
  455. package/dist/split-button.js.map +1 -1
  456. package/dist/src/__internal/agent/choice-surface.d.ts +23 -0
  457. package/dist/src/__internal/agent/toggle-surface.d.ts +34 -0
  458. package/dist/src/__internal/agent/value-surface.d.ts +13 -0
  459. package/dist/src/__internal/ai/suggestion-controller.d.ts +2 -0
  460. package/dist/src/__internal/aria/aria.d.ts +1 -1
  461. package/dist/src/__internal/diagram/canvas-base.d.ts +1 -1
  462. package/dist/src/{input/BaseField.d.ts → __internal/field-base.d.ts} +22 -3
  463. package/dist/src/__internal/indicator-navigation-item.d.ts +1 -1
  464. package/dist/src/{input/BaseInput.d.ts → __internal/input-base.d.ts} +10 -5
  465. package/dist/src/__internal/mixins/field.d.ts +2 -2
  466. package/dist/src/__internal/mixins/{NativeHyperlinkMixin.d.ts → native-hyperlink-mixin.d.ts} +1 -1
  467. package/dist/src/__internal/navigation-item-base.d.ts +1 -1
  468. package/dist/src/__internal/{picker-field.d.ts → picker-field-base.d.ts} +3 -3
  469. package/dist/src/__internal/rich-text/{rich-text-input.d.ts → rich-text-input-base.d.ts} +2 -2
  470. package/dist/src/__internal/toggle-base.d.ts +9 -2
  471. package/dist/src/accordion/accordion-item.d.ts +5 -0
  472. package/dist/src/agent.d.ts +8 -0
  473. package/dist/src/button/base-button/base-button.d.ts +1 -1
  474. package/dist/src/button/button/button.d.ts +10 -51
  475. package/dist/src/button/icon-button/icon-button.d.ts +1 -1
  476. package/dist/src/button/index.d.ts +1 -1
  477. package/dist/src/button/link-button/link-button.d.ts +1 -1
  478. package/dist/src/card/card.d.ts +1 -1
  479. package/dist/src/checkbox/checkbox.d.ts +3 -0
  480. package/dist/src/checkbox-group/checkbox-group.d.ts +2 -2
  481. package/dist/src/chip/chip-set/chip-set.d.ts +2 -2
  482. package/dist/src/clock/clock.d.ts +1 -1
  483. package/dist/src/code-editor/code-editor.d.ts +5 -5
  484. package/dist/src/color-field/color-field.d.ts +3 -3
  485. package/dist/src/comment-composer/comment-composer.d.ts +2 -2
  486. package/dist/src/condition-builder/cb-group.d.ts +2 -2
  487. package/dist/src/condition-builder/cb-types.d.ts +3 -3
  488. package/dist/src/condition-builder/condition-builder.d.ts +2 -2
  489. package/dist/src/condition-builder/{cb-group-base.d.ts → condition-group-base.d.ts} +1 -1
  490. package/dist/src/copy-button/copy-button.d.ts +1 -1
  491. package/dist/src/currency-field/currency-field.d.ts +3 -3
  492. package/dist/src/date-field/date-field.d.ts +2 -2
  493. package/dist/src/date-field/range-utils.d.ts +1 -1
  494. package/dist/src/date-range-field/date-range-field.d.ts +2 -2
  495. package/dist/src/datetime-field/datetime-field.d.ts +2 -2
  496. package/dist/src/dependency-map/dependency-map.d.ts +2 -2
  497. package/dist/src/diagram/diagram.d.ts +2 -2
  498. package/dist/src/dropdown-button/dropdown-button.d.ts +5 -0
  499. package/dist/src/erd/erd.d.ts +2 -2
  500. package/dist/src/file-upload/file-upload.d.ts +2 -2
  501. package/dist/src/html-editor/html-editor.d.ts +2 -2
  502. package/dist/src/index.d.ts +208 -156
  503. package/dist/src/input/input.d.ts +10 -3
  504. package/dist/src/link/link.d.ts +1 -1
  505. package/dist/src/listbox/listbox.d.ts +2 -2
  506. package/dist/src/markdown-editor/markdown-editor.d.ts +2 -2
  507. package/dist/src/mention-input/mention-input.d.ts +3 -3
  508. package/dist/src/menu/menu-item/menu-item.d.ts +3 -0
  509. package/dist/src/modal/modal.d.ts +3 -0
  510. package/dist/src/number-field/number-field.d.ts +5 -3
  511. package/dist/src/password-field/password-field.d.ts +3 -3
  512. package/dist/src/phone-field/phone-field.d.ts +3 -3
  513. package/dist/src/pin-input/pin-input.d.ts +3 -3
  514. package/dist/src/progress/circular-progress/circular-progress.d.ts +2 -2
  515. package/dist/src/progress/linear-progress/linear-progress.d.ts +2 -2
  516. package/dist/src/progress/{base-progress.d.ts → progress-base.d.ts} +2 -2
  517. package/dist/src/prompt-input/prompt-input.d.ts +2 -2
  518. package/dist/src/radio/radio.d.ts +4 -1
  519. package/dist/src/rating/rating.d.ts +2 -2
  520. package/dist/src/search/search.d.ts +2 -2
  521. package/dist/src/select/select.d.ts +9 -2
  522. package/dist/src/signature-pad/signature-pad.d.ts +2 -2
  523. package/dist/src/slider/slider.d.ts +2 -2
  524. package/dist/src/split-button/split-button.d.ts +3 -0
  525. package/dist/src/stepper/step.d.ts +6 -0
  526. package/dist/src/switch/switch.d.ts +3 -0
  527. package/dist/src/tabs/tab.d.ts +6 -0
  528. package/dist/src/textarea/textarea.d.ts +3 -3
  529. package/dist/src/time-field/time-field.d.ts +2 -2
  530. package/dist/src/transfer-list/transfer-list.d.ts +2 -2
  531. package/dist/src/tree-chart/tree-chart.d.ts +2 -2
  532. package/dist/src/url-field/url-field.d.ts +3 -3
  533. package/dist/src/workflow/workflow.d.ts +2 -2
  534. package/dist/stack.js +4 -7
  535. package/dist/stack.js.map +1 -1
  536. package/dist/stat.js +5 -8
  537. package/dist/stat.js.map +1 -1
  538. package/dist/{state-BCeDVCI9.js → state-Bz6ycyYM.js} +2 -2
  539. package/dist/{state-BCeDVCI9.js.map → state-Bz6ycyYM.js.map} +1 -1
  540. package/dist/status-indicator.js +4 -7
  541. package/dist/status-indicator.js.map +1 -1
  542. package/dist/step.js +38 -19
  543. package/dist/step.js.map +1 -1
  544. package/dist/stepper.js +9 -9
  545. package/dist/stepper.js.map +1 -1
  546. package/dist/{style-map-CHOg6N_R.js → style-map-D1ZICebN.js} +2 -2
  547. package/dist/{style-map-CHOg6N_R.js.map → style-map-D1ZICebN.js.map} +1 -1
  548. package/dist/sub-menu.js +12 -12
  549. package/dist/sub-menu.js.map +1 -1
  550. package/dist/{success-CTqRKz2U.js → success-Dqol3Xwz.js} +2 -2
  551. package/dist/{success-CTqRKz2U.js.map → success-Dqol3Xwz.js.map} +1 -1
  552. package/dist/{suggestion-controller-7YRQqkaI.js → suggestion-controller-DhXsD9gH.js} +6 -2
  553. package/dist/suggestion-controller-DhXsD9gH.js.map +1 -0
  554. package/dist/svg.js +8 -11
  555. package/dist/svg.js.map +1 -1
  556. package/dist/switch.js +42 -24
  557. package/dist/switch.js.map +1 -1
  558. package/dist/tab-group.js +9 -9
  559. package/dist/tab-group.js.map +1 -1
  560. package/dist/tab-panel.js +4 -7
  561. package/dist/tab-panel.js.map +1 -1
  562. package/dist/tab.js +44 -21
  563. package/dist/tab.js.map +1 -1
  564. package/dist/table.js +10 -13
  565. package/dist/table.js.map +1 -1
  566. package/dist/tabs.js +13 -14
  567. package/dist/tabs.js.map +1 -1
  568. package/dist/tag.js +5 -8
  569. package/dist/tag.js.map +1 -1
  570. package/dist/test/ui-sdk-agent.test.d.ts +1 -0
  571. package/dist/textarea.js +12 -13
  572. package/dist/textarea.js.map +1 -1
  573. package/dist/time-field.js +13 -14
  574. package/dist/time-field.js.map +1 -1
  575. package/dist/time-picker.js +7 -10
  576. package/dist/time-picker.js.map +1 -1
  577. package/dist/timeline-item.js +4 -7
  578. package/dist/timeline-item.js.map +1 -1
  579. package/dist/timeline.js +4 -7
  580. package/dist/timeline.js.map +1 -1
  581. package/dist/{toggle-base-BtjRAZ5z.js → toggle-base-DP3PSXbf.js} +22 -10
  582. package/dist/toggle-base-DP3PSXbf.js.map +1 -0
  583. package/dist/toggle-surface-CkMdGtyR.js +164 -0
  584. package/dist/toggle-surface-CkMdGtyR.js.map +1 -0
  585. package/dist/toolbar.js +5 -8
  586. package/dist/toolbar.js.map +1 -1
  587. package/dist/tooltip.js +4 -7
  588. package/dist/tooltip.js.map +1 -1
  589. package/dist/tour.js +6 -9
  590. package/dist/tour.js.map +1 -1
  591. package/dist/transfer-list.js +13 -16
  592. package/dist/transfer-list.js.map +1 -1
  593. package/dist/tree-chart.js +9 -12
  594. package/dist/tree-chart.js.map +1 -1
  595. package/dist/tree-item.js +5 -8
  596. package/dist/tree-item.js.map +1 -1
  597. package/dist/tree.js +5 -8
  598. package/dist/tree.js.map +1 -1
  599. package/dist/tsconfig.tsbuildinfo +1 -1
  600. package/dist/typing-indicator.js +4 -7
  601. package/dist/typing-indicator.js.map +1 -1
  602. package/dist/{unsafe-html-Cy_JqoPT.js → unsafe-html-DPx6fCQn.js} +2 -2
  603. package/dist/{unsafe-html-Cy_JqoPT.js.map → unsafe-html-DPx6fCQn.js.map} +1 -1
  604. package/dist/{upload-BvrrKboG.js → upload-AgGMlvXZ.js} +2 -2
  605. package/dist/{upload-BvrrKboG.js.map → upload-AgGMlvXZ.js.map} +1 -1
  606. package/dist/url-field.js +11 -12
  607. package/dist/url-field.js.map +1 -1
  608. package/dist/user-menu.js +5 -8
  609. package/dist/user-menu.js.map +1 -1
  610. package/dist/{video-DPjOBk6I.js → video-DgtGGvrk.js} +7 -10
  611. package/dist/video-DgtGGvrk.js.map +1 -0
  612. package/dist/video.js +5 -5
  613. package/dist/virtual-list.js +7 -10
  614. package/dist/virtual-list.js.map +1 -1
  615. package/dist/{welcome-CFqBHGa5.js → welcome-Ba4SYcRr.js} +2 -2
  616. package/dist/{welcome-CFqBHGa5.js.map → welcome-Ba4SYcRr.js.map} +1 -1
  617. package/dist/workflow-timeline.js +5 -8
  618. package/dist/workflow-timeline.js.map +1 -1
  619. package/dist/workflow.js +8 -12
  620. package/dist/workflow.js.map +1 -1
  621. package/dist/workspace-switcher.js +6 -9
  622. package/dist/workspace-switcher.js.map +1 -1
  623. package/package.json +11 -5
  624. package/src/__internal/agent/choice-surface.ts +88 -0
  625. package/src/__internal/agent/toggle-surface.ts +233 -0
  626. package/src/__internal/agent/value-surface.ts +76 -0
  627. package/src/__internal/ai/suggestion-controller.ts +5 -0
  628. package/src/__internal/diagram/canvas-base.ts +1 -1
  629. package/src/{input/BaseField.ts → __internal/field-base.ts} +51 -3
  630. package/src/__internal/indicator-navigation-item.ts +1 -1
  631. package/src/{input/BaseInput.ts → __internal/input-base.ts} +9 -1
  632. package/src/__internal/mixins/field.ts +2 -2
  633. package/src/__internal/mixins/{NativeHyperlinkMixin.ts → native-hyperlink-mixin.ts} +1 -1
  634. package/src/__internal/navigation-item-base.ts +1 -1
  635. package/src/__internal/{picker-field.scss → picker-field-base.scss} +2 -2
  636. package/src/__internal/{picker-field.ts → picker-field-base.ts} +3 -3
  637. package/src/__internal/rich-text/editor-chrome.scss +1 -1
  638. package/src/__internal/rich-text/{rich-text-input.ts → rich-text-input-base.ts} +3 -3
  639. package/src/__internal/toggle-base.ts +16 -5
  640. package/src/accordion/accordion-item.ts +53 -28
  641. package/src/accordion/accordion.ts +0 -2
  642. package/src/agent.ts +17 -0
  643. package/src/ai-badge/ai-badge.ts +0 -2
  644. package/src/ai-summary/ai-summary.ts +0 -2
  645. package/src/alert/alert.ts +0 -2
  646. package/src/anchor-nav/anchor-nav.ts +0 -2
  647. package/src/app-bar/app-bar.ts +0 -2
  648. package/src/app-shell/app-shell.ts +0 -2
  649. package/src/assistant-panel/assistant-panel.ts +0 -2
  650. package/src/assistant-steps/assistant-step.ts +0 -2
  651. package/src/assistant-steps/assistant-steps.ts +0 -2
  652. package/src/avatar/avatar.ts +0 -2
  653. package/src/avatar-group/avatar-group.ts +0 -2
  654. package/src/badge/badge.ts +0 -2
  655. package/src/banner/banner.ts +0 -2
  656. package/src/bottom-sheet/bottom-sheet.ts +0 -2
  657. package/src/breadcrumb/breadcrumb/breadcrumb.ts +0 -2
  658. package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +0 -2
  659. package/src/button/base-button/base-button.ts +1 -1
  660. package/src/button/button/button.scss +5 -0
  661. package/src/button/button/button.ts +34 -8
  662. package/src/button/button-group/button-group.ts +0 -2
  663. package/src/button/fab/fab.ts +1 -3
  664. package/src/button/icon-button/icon-button.ts +2 -4
  665. package/src/button/index.ts +1 -1
  666. package/src/button/link-button/link-button.ts +2 -4
  667. package/src/calendar/calendar-column-view.ts +0 -2
  668. package/src/calendar/calendar-month-view.ts +0 -2
  669. package/src/calendar/calendar.ts +0 -2
  670. package/src/calendar-timeline/calendar-timeline.ts +0 -2
  671. package/src/card/card-content.ts +0 -2
  672. package/src/card/card.ts +1 -3
  673. package/src/carousel/carousel.ts +0 -2
  674. package/src/chart-area/chart-area.ts +0 -2
  675. package/src/chart-bar/chart-bar.ts +0 -2
  676. package/src/chart-doughnut/chart-doughnut.ts +0 -2
  677. package/src/chart-line/chart-line.ts +0 -2
  678. package/src/chart-pie/chart-pie.ts +0 -2
  679. package/src/chat-message/chat-message.ts +0 -2
  680. package/src/chat-thread/chat-event.ts +0 -2
  681. package/src/chat-thread/chat-thread.ts +0 -2
  682. package/src/checkbox/checkbox.ts +46 -28
  683. package/src/checkbox-group/checkbox-group.ts +2 -4
  684. package/src/chip/chip/chip.ts +1 -3
  685. package/src/chip/chip-set/chip-set.ts +2 -4
  686. package/src/chip/tag/tag.ts +0 -2
  687. package/src/citation/citation.ts +0 -2
  688. package/src/clock/clock.ts +1 -3
  689. package/src/code-editor/code-editor.scss +70 -1
  690. package/src/code-editor/code-editor.ts +15 -9
  691. package/src/code-highlighter/code-group.ts +0 -2
  692. package/src/code-highlighter/code-highlighter.ts +0 -2
  693. package/src/color-field/color-field.ts +4 -5
  694. package/src/color-picker/color-picker.ts +0 -2
  695. package/src/command-palette/command-palette.ts +0 -2
  696. package/src/comment-composer/comment-composer.ts +3 -5
  697. package/src/components.manifest.json +1406 -0
  698. package/src/condition-builder/cb-divider.ts +0 -2
  699. package/src/condition-builder/cb-group.ts +3 -5
  700. package/src/condition-builder/cb-rule.ts +10 -11
  701. package/src/condition-builder/cb-types.ts +3 -3
  702. package/src/condition-builder/condition-builder.ts +3 -5
  703. package/src/condition-builder/{cb-group-base.ts → condition-group-base.ts} +7 -7
  704. package/src/confirm-dialog/confirm-dialog.ts +1 -3
  705. package/src/container/container.ts +0 -2
  706. package/src/copy-button/copy-button.ts +1 -3
  707. package/src/currency-field/currency-field.ts +3 -5
  708. package/src/date-field/date-field.scss +1 -1
  709. package/src/date-field/date-field.ts +4 -4
  710. package/src/date-field/range-utils.ts +1 -1
  711. package/src/date-picker/date-picker.ts +0 -2
  712. package/src/date-range-field/date-range-field.scss +1 -1
  713. package/src/date-range-field/date-range-field.ts +4 -4
  714. package/src/datetime-field/datetime-field.scss +1 -1
  715. package/src/datetime-field/datetime-field.ts +4 -4
  716. package/src/dependency-map/dependency-map.ts +2 -4
  717. package/src/description-list/description-item.ts +0 -2
  718. package/src/description-list/description-list.ts +0 -2
  719. package/src/diagram/diagram.ts +2 -4
  720. package/src/diagram/flow.ts +0 -2
  721. package/src/diagram-controls/diagram-controls.ts +0 -2
  722. package/src/diagram-minimap/diagram-minimap.ts +0 -2
  723. package/src/diff-viewer/diff-viewer.ts +0 -2
  724. package/src/discussion/discussion-activity.ts +0 -2
  725. package/src/discussion/discussion-comment.ts +0 -2
  726. package/src/discussion/discussion.ts +0 -2
  727. package/src/divider/divider.ts +0 -2
  728. package/src/document-editor/document-editor.ts +0 -2
  729. package/src/draft-card/draft-card.ts +0 -2
  730. package/src/dropdown-button/dropdown-button.ts +49 -23
  731. package/src/elevation/elevation.ts +0 -2
  732. package/src/erd/erd.ts +2 -4
  733. package/src/field/field.ts +0 -2
  734. package/src/fieldset/fieldset.ts +0 -2
  735. package/src/file-upload/file-upload.ts +3 -5
  736. package/src/filter-bar/filter-bar.ts +0 -2
  737. package/src/focus-ring/focus-ring.ts +0 -2
  738. package/src/form/form.ts +0 -2
  739. package/src/generative-view/generative-view.ts +0 -2
  740. package/src/grid/grid.ts +0 -2
  741. package/src/highlight/highlight.ts +0 -2
  742. package/src/hover-card/hover-card.ts +0 -2
  743. package/src/html-editor/html-editor.ts +3 -5
  744. package/src/icon/icon.ts +0 -2
  745. package/src/illustration/illustration.ts +0 -2
  746. package/src/image/image.ts +0 -2
  747. package/src/index.ts +287 -199
  748. package/src/inline-edit/inline-edit.ts +0 -2
  749. package/src/input/input.scss +8 -0
  750. package/src/input/input.ts +36 -25
  751. package/src/item/item.ts +0 -2
  752. package/src/json-viewer/json-viewer.ts +0 -2
  753. package/src/kanban/kanban.ts +0 -2
  754. package/src/kbd/kbd.ts +0 -2
  755. package/src/link/link.ts +1 -3
  756. package/src/list/list-item.ts +0 -2
  757. package/src/list/list.ts +0 -2
  758. package/src/listbox/listbox-option.ts +0 -2
  759. package/src/listbox/listbox.ts +2 -4
  760. package/src/loader.ts +47 -49
  761. package/src/markdown/markdown.ts +0 -2
  762. package/src/markdown-editor/markdown-editor.ts +3 -5
  763. package/src/mention-input/mention-input.ts +4 -5
  764. package/src/menu/menu/menu.ts +0 -2
  765. package/src/menu/menu-item/menu-item.ts +40 -22
  766. package/src/menu/sub-menu/sub-menu.ts +0 -2
  767. package/src/modal/modal.ts +57 -41
  768. package/src/navigation-bar/navigation-bar-item.ts +0 -2
  769. package/src/navigation-bar/navigation-bar.ts +0 -2
  770. package/src/navigation-drawer/navigation-drawer-group.ts +0 -2
  771. package/src/navigation-drawer/navigation-drawer-item.ts +0 -2
  772. package/src/navigation-drawer/navigation-drawer.ts +0 -2
  773. package/src/navigation-rail/navigation-rail-item.ts +0 -2
  774. package/src/navigation-rail/navigation-rail.ts +0 -2
  775. package/src/notification-center/notification-center.ts +0 -2
  776. package/src/notification-manager/notification-manager.ts +0 -2
  777. package/src/number-counter/number-counter.ts +0 -2
  778. package/src/number-field/number-field.ts +12 -5
  779. package/src/page-header/page-header.ts +0 -2
  780. package/src/pagination/pagination.ts +0 -2
  781. package/src/password-field/password-field.ts +3 -5
  782. package/src/password-rules/password-rules.ts +0 -2
  783. package/src/phone-field/phone-field.ts +3 -5
  784. package/src/pin-input/pin-input.ts +4 -6
  785. package/src/popover/popover-content.ts +0 -2
  786. package/src/popover/popover.ts +0 -2
  787. package/src/presence-indicator/presence-indicator.ts +0 -2
  788. package/src/progress/circular-progress/circular-progress.ts +2 -4
  789. package/src/progress/linear-progress/linear-progress.ts +2 -4
  790. package/src/progress/{base-progress.ts → progress-base.ts} +1 -1
  791. package/src/prompt-input/prompt-input.ts +3 -5
  792. package/src/radio/radio-group.ts +0 -2
  793. package/src/radio/radio.ts +36 -16
  794. package/src/rating/rating.ts +3 -5
  795. package/src/redvars-loader/redvars-loader.ts +0 -2
  796. package/src/relative-time/relative-time.ts +0 -2
  797. package/src/resizable-panels/panel.ts +0 -2
  798. package/src/resizable-panels/resizable-panels.ts +0 -2
  799. package/src/ripple/ripple.ts +0 -2
  800. package/src/scroll-area/scroll-area.ts +0 -2
  801. package/src/search/search.ts +3 -5
  802. package/src/segmented-button/segmented-button-group.ts +0 -2
  803. package/src/segmented-button/segmented-button.ts +0 -2
  804. package/src/select/option.ts +0 -2
  805. package/src/select/select.ts +49 -5
  806. package/src/side-sheet/side-sheet.ts +0 -2
  807. package/src/signature-pad/signature-pad.ts +3 -5
  808. package/src/site-footer/site-footer-group.ts +0 -2
  809. package/src/site-footer/site-footer.ts +0 -2
  810. package/src/site-header/site-header.ts +0 -2
  811. package/src/site-header/site-nav-group.ts +0 -2
  812. package/src/site-header/site-nav-link.ts +0 -2
  813. package/src/site-header/site-nav-menu.ts +0 -2
  814. package/src/skeleton/skeleton.ts +0 -2
  815. package/src/slider/slider.ts +3 -5
  816. package/src/snackbar/snackbar.ts +0 -2
  817. package/src/sparkline/sparkline.ts +0 -2
  818. package/src/split-button/split-button.ts +34 -19
  819. package/src/stack/stack.ts +0 -2
  820. package/src/stat/stat.ts +0 -2
  821. package/src/status-indicator/status-indicator.ts +0 -2
  822. package/src/stepper/step.ts +33 -12
  823. package/src/stepper/stepper.ts +0 -2
  824. package/src/svg/svg.ts +0 -2
  825. package/src/switch/switch.ts +31 -13
  826. package/src/table/table.ts +0 -2
  827. package/src/tabs/tab-group.ts +0 -2
  828. package/src/tabs/tab-panel.ts +0 -2
  829. package/src/tabs/tab.ts +40 -14
  830. package/src/tabs/tabs.ts +0 -2
  831. package/src/textarea/textarea.ts +3 -5
  832. package/src/time-field/time-field.scss +1 -1
  833. package/src/time-field/time-field.ts +4 -4
  834. package/src/time-picker/time-picker.ts +0 -2
  835. package/src/timeline/timeline-item.ts +0 -2
  836. package/src/timeline/timeline.ts +0 -2
  837. package/src/toolbar/toolbar.ts +0 -2
  838. package/src/tooltip/tooltip.ts +0 -2
  839. package/src/tour/tour.ts +0 -2
  840. package/src/transfer-list/transfer-list.ts +3 -5
  841. package/src/tree/tree-item.ts +0 -2
  842. package/src/tree/tree.ts +0 -2
  843. package/src/tree-chart/tree-chart.ts +2 -4
  844. package/src/typing-indicator/typing-indicator.ts +0 -2
  845. package/src/url-field/url-field.ts +3 -5
  846. package/src/user-menu/user-menu.ts +0 -2
  847. package/src/video/video.ts +0 -2
  848. package/src/virtual-list/virtual-list.ts +0 -2
  849. package/src/workflow/workflow.ts +2 -4
  850. package/src/workflow-timeline/workflow-timeline.ts +0 -2
  851. package/src/workspace-switcher/workspace-switcher.ts +0 -2
  852. package/dist/BaseField-DOCmylob.js.map +0 -1
  853. package/dist/BaseInput-Cv03GZLu.js.map +0 -1
  854. package/dist/ButtonConstants-CahP2_NA.js.map +0 -1
  855. package/dist/IndividualComponent-BK7XZjE2.js.map +0 -1
  856. package/dist/NativeHyperlinkMixin-WdY0fM-H.js.map +0 -1
  857. package/dist/base-button-9tGu5RSC.js.map +0 -1
  858. package/dist/canvas-base-BjiU3Ecl.js.map +0 -1
  859. package/dist/cb-group-base-2Ps2CnBz.js.map +0 -1
  860. package/dist/cb-group-base-CWctDJvy.js.map +0 -1
  861. package/dist/diagram-D2aM93kf.js.map +0 -1
  862. package/dist/document-editor-BS6al7Hq.js.map +0 -1
  863. package/dist/generative-view-DsSOPf26.js.map +0 -1
  864. package/dist/highlight-Be0wu7kh.js.map +0 -1
  865. package/dist/illustration-DQ-_sz1l.js.map +0 -1
  866. package/dist/indicator-navigation-item-BsQE3kUr.js.map +0 -1
  867. package/dist/navigation-item-base-5ljwtLG_.js.map +0 -1
  868. package/dist/picker-field-BiM3iXAQ.js.map +0 -1
  869. package/dist/property-B2TG3KEE.js +0 -10
  870. package/dist/property-B2TG3KEE.js.map +0 -1
  871. package/dist/range-utils-vgG1SJ2o.js.map +0 -1
  872. package/dist/rich-text-input-BCZ46UF8.js.map +0 -1
  873. package/dist/src/IndividualComponent.d.ts +0 -9
  874. package/dist/suggestion-controller-7YRQqkaI.js.map +0 -1
  875. package/dist/toggle-base-BtjRAZ5z.js.map +0 -1
  876. package/dist/video-DPjOBk6I.js.map +0 -1
  877. package/src/IndividualComponent.ts +0 -10
  878. /package/dist/src/__internal/mixins/{MixinConstructor.d.ts → mixin-constructor.d.ts} +0 -0
  879. /package/dist/src/button/{ButtonConstants.d.ts → button-constants.d.ts} +0 -0
  880. /package/dist/src/button/{ButtonTypes.d.ts → button-types.d.ts} +0 -0
  881. /package/dist/src/clock/{ClockController.d.ts → clock-controller.d.ts} +0 -0
  882. /package/dist/src/{CssLoader.d.ts → css-loader.d.ts} +0 -0
  883. /package/dist/src/{LoaderUtils.d.ts → loader-utils.d.ts} +0 -0
  884. /package/src/__internal/mixins/{MixinConstructor.ts → mixin-constructor.ts} +0 -0
  885. /package/src/button/{ButtonConstants.ts → button-constants.ts} +0 -0
  886. /package/src/button/{ButtonTypes.ts → button-types.ts} +0 -0
  887. /package/src/clock/{ClockController.ts → clock-controller.ts} +0 -0
  888. /package/src/condition-builder/{cb-group-base.scss → condition-group-base.scss} +0 -0
  889. /package/src/{CssLoader.ts → css-loader.ts} +0 -0
  890. /package/src/{LoaderUtils.ts → loader-utils.ts} +0 -0
@@ -0,0 +1,2364 @@
1
+ import { w as withSource, h as whenKept, r as renders, k as withLifecycle, l as createStore, m as standFor, n as watchWhileKept, q as discard, t as whileDestroying, u as heldState, s as sameValue, v as provisional, x as propsRendered, y as extendLifecycle, z as createDetails, b as watchers$1, A as resolveSource, B as authorOwned, C as madeLabel, D as references, E as focusWith, F as labelledBy, G as validityChanged, H as claimInvalidFocus, I as labelsOf, J as elementMoved, K as inDocumentOrder, L as selectedKeys, M as subscribe, N as connect, O as present, P as attrs, Q as conditional, R as bind, S as portalTarget, T as writeStyle, U as attachFormInternals } from './platform-DHfE4Fvo.js';
2
+
3
+ // src/foundation/kernel/trusted.ts
4
+ var trusted = (event) => event.isTrusted;
5
+
6
+ // src/foundation/forms/value.ts
7
+ var watchers = /* @__PURE__ */ new WeakMap();
8
+ function prototypeValue(el) {
9
+ return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), "value");
10
+ }
11
+ function afterReset(event, run) {
12
+ setTimeout(() => {
13
+ if (!event.defaultPrevented) {
14
+ run();
15
+ }
16
+ });
17
+ }
18
+ var scriptWrites = /* @__PURE__ */ new Set();
19
+ function writeFromScript(el, write) {
20
+ if (scriptWrites.has(el)) {
21
+ return write();
22
+ }
23
+ scriptWrites.add(el);
24
+ try {
25
+ write();
26
+ } finally {
27
+ scriptWrites.delete(el);
28
+ }
29
+ }
30
+ function writingFromScript(el) {
31
+ for (let node = el; node; node = node.parentElement) {
32
+ if (scriptWrites.has(node)) {
33
+ return true;
34
+ }
35
+ }
36
+ return false;
37
+ }
38
+ function writeValue(el, value, options) {
39
+ if (options?.asUser && !writingFromScript(el)) {
40
+ prototypeValue(el).set.call(el, value);
41
+ el.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
42
+ } else if (el.value !== value) {
43
+ el.value = value;
44
+ }
45
+ }
46
+ function notify(el, source) {
47
+ watchers.get(el)?.forEach((listener) => listener(source));
48
+ }
49
+ function watchValue(el, listener) {
50
+ let listeners = watchers.get(el);
51
+ if (!listeners) {
52
+ listeners = /* @__PURE__ */ new Set();
53
+ watchers.set(el, listeners);
54
+ intercept(el);
55
+ }
56
+ listeners.add(listener);
57
+ return () => {
58
+ listeners.delete(listener);
59
+ if (listeners.size) {
60
+ return;
61
+ }
62
+ watchers.delete(el);
63
+ release(el);
64
+ };
65
+ }
66
+ var restores = /* @__PURE__ */ new WeakMap();
67
+ var wrapped = /* @__PURE__ */ new WeakMap();
68
+ function intercept(el) {
69
+ let layer = wrapped.get(el);
70
+ if (!layer || !Object.getOwnPropertyDescriptor(el, "value")) {
71
+ const own = Object.getOwnPropertyDescriptor(el, "value");
72
+ const base = own ?? prototypeValue(el);
73
+ const wrapper2 = {
74
+ configurable: true,
75
+ enumerable: base.enumerable,
76
+ get() {
77
+ return base.get.call(el);
78
+ },
79
+ set(value) {
80
+ base.set.call(el, value);
81
+ notify(el, "write");
82
+ }
83
+ };
84
+ Object.defineProperty(el, "value", wrapper2);
85
+ layer = {
86
+ wrapper: wrapper2,
87
+ unwrap: () => {
88
+ if (own) {
89
+ Object.defineProperty(el, "value", own);
90
+ } else {
91
+ delete el.value;
92
+ }
93
+ }
94
+ };
95
+ wrapped.set(el, layer);
96
+ }
97
+ const { wrapper, unwrap } = layer;
98
+ const onInput = () => notify(el, "input");
99
+ const onReset = (event) => {
100
+ if (event.target === el.form) {
101
+ afterReset(event, () => notify(el, "reset"));
102
+ }
103
+ };
104
+ el.addEventListener("input", onInput);
105
+ el.ownerDocument.addEventListener("reset", onReset, true);
106
+ restores.set(el, () => {
107
+ el.removeEventListener("input", onInput);
108
+ el.ownerDocument.removeEventListener("reset", onReset, true);
109
+ if (Object.getOwnPropertyDescriptor(el, "value")?.set === wrapper.set) {
110
+ unwrap();
111
+ wrapped.delete(el);
112
+ }
113
+ });
114
+ }
115
+ function release(el) {
116
+ restores.get(el)?.();
117
+ restores.delete(el);
118
+ }
119
+
120
+ // src/foundation/kernel/dev-stub.ts
121
+ var dev = false;
122
+ function warn(_message, _from, _detail) {
123
+ }
124
+ function checkPrevented(_name, _prevented, _details, _from) {
125
+ }
126
+
127
+ // src/foundation/kernel/action.ts
128
+ var DEFAULT_PENDING_ANNOUNCEMENT = "Loading";
129
+ var PENDING_ANNOUNCE_DELAY = 1e3;
130
+ var popupResults = /* @__PURE__ */ new WeakSet();
131
+ var isPromise = (value) => !!value && typeof value.then === "function" && !popupResults.has(value);
132
+ var canceledAction = /* @__PURE__ */ Symbol("canceled action");
133
+ function runAction(action, source, handlers) {
134
+ const failed = (error) => {
135
+ handlers.failed(error);
136
+ };
137
+ const done = () => withSource(source, handlers.done);
138
+ let result;
139
+ try {
140
+ result = action({ source });
141
+ } catch (error) {
142
+ return failed(error);
143
+ }
144
+ if (result === canceledAction) {
145
+ return;
146
+ }
147
+ if (!isPromise(result)) {
148
+ return done();
149
+ }
150
+ handlers.pending(true);
151
+ result.then(
152
+ () => {
153
+ handlers.pending(false);
154
+ done();
155
+ },
156
+ (error) => {
157
+ handlers.pending(false);
158
+ failed(error);
159
+ }
160
+ );
161
+ }
162
+ function announcePending(context, isPending) {
163
+ const say = () => {
164
+ const text = context.options().pendingAnnouncement ?? DEFAULT_PENDING_ANNOUNCEMENT;
165
+ import('./announce-Cqen_7FM.js').then(
166
+ ({ announce }) => wasPending && announce(text),
167
+ () => {
168
+ }
169
+ );
170
+ };
171
+ let timer;
172
+ let wasPending = false;
173
+ const unsubscribe = context.store.subscribe(() => {
174
+ const pending = isPending();
175
+ if (pending === wasPending) {
176
+ return;
177
+ }
178
+ wasPending = pending;
179
+ clearTimeout(timer);
180
+ if (pending) {
181
+ timer = setTimeout(say, PENDING_ANNOUNCE_DELAY);
182
+ }
183
+ });
184
+ context.onDestroy(() => {
185
+ wasPending = false;
186
+ clearTimeout(timer);
187
+ unsubscribe();
188
+ });
189
+ }
190
+
191
+ // src/foundation/kernel/controller.ts
192
+ var attach = /* @__PURE__ */ Symbol.for("ui-sdk.controller.attach");
193
+ var detach = /* @__PURE__ */ Symbol.for("ui-sdk.controller.detach");
194
+ function attachController(controller, api) {
195
+ controller?.[attach]?.(api);
196
+ }
197
+ function detachController(controller, api) {
198
+ controller?.[detach]?.(api);
199
+ }
200
+ function connectController(context, api) {
201
+ let current = context.options().controller;
202
+ let kept = false;
203
+ whenKept(() => {
204
+ kept = true;
205
+ attachController(current, api);
206
+ return () => {
207
+ kept = false;
208
+ detachController(current, api);
209
+ };
210
+ });
211
+ context.onOptions(({ controller }) => {
212
+ if (controller === current) {
213
+ return;
214
+ }
215
+ detachController(current, api);
216
+ current = controller;
217
+ if (kept) {
218
+ attachController(controller, api);
219
+ }
220
+ });
221
+ }
222
+
223
+ // src/foundation/kernel/derive.ts
224
+ var derivations = /* @__PURE__ */ new WeakMap();
225
+ function withDerived(store, options, synced, state) {
226
+ const list = derivations.get(store);
227
+ if (!list) {
228
+ return synced;
229
+ }
230
+ let result = synced ?? {};
231
+ for (const derivation of list) {
232
+ if (!synced && derivation.from === "state") {
233
+ continue;
234
+ }
235
+ const next = { ...state, ...result };
236
+ const derived = derivation.from === "state" ? store.view(next, () => derivation.derive(next)) : derivation.derive(result, state, options);
237
+ result = { ...result };
238
+ for (const key of derivation.keys) {
239
+ if (derived && key in derived) {
240
+ result[key] = derived[key];
241
+ } else if (derivation.from === "state") {
242
+ result[key] = next[key];
243
+ }
244
+ }
245
+ }
246
+ return synced || Object.keys(result).length ? result : void 0;
247
+ }
248
+
249
+ // src/foundation/kernel/primitive.ts
250
+ function definePrimitive(definition) {
251
+ const slots = definition.slots((slot) => slot);
252
+ const name = definition.name;
253
+ const label = definition.label ?? name;
254
+ const make = (initialOptions) => {
255
+ let options = initialOptions;
256
+ const id = initialOptions.id;
257
+ const store = createStore(
258
+ { ...definition.state(options), ...definition.sync?.(options) },
259
+ definition.live ?? []
260
+ );
261
+ const destroys = [];
262
+ const optionsListeners = [];
263
+ const own = Object.create(
264
+ slots
265
+ );
266
+ const used = /* @__PURE__ */ new Set();
267
+ function use(feature) {
268
+ if (used.has(feature)) {
269
+ return;
270
+ }
271
+ used.add(feature);
272
+ Object.assign(own, feature.slots);
273
+ wake();
274
+ feature.extend?.(api);
275
+ }
276
+ const owner = {
277
+ name,
278
+ label,
279
+ slots: own,
280
+ parts: /* @__PURE__ */ new Map(),
281
+ released: []
282
+ };
283
+ const { parts } = owner;
284
+ function keyOf(props = {}) {
285
+ return props.id ?? (props.value == null ? "" : String(props.value));
286
+ }
287
+ let viewedParts;
288
+ function part(slot, props = {}, rendering = false) {
289
+ const key = keyOf(props);
290
+ const mapKey = `${slot}:${key}`;
291
+ let found = parts.get(mapKey);
292
+ if (!found) {
293
+ parts.set(
294
+ mapKey,
295
+ found = {
296
+ slot,
297
+ key,
298
+ id,
299
+ // Read when used, since an asleep instance builds its api later.
300
+ get api() {
301
+ return api;
302
+ },
303
+ store,
304
+ props,
305
+ el: void 0,
306
+ owner,
307
+ leases: 0
308
+ }
309
+ );
310
+ if (rendering) {
311
+ provisional(found);
312
+ }
313
+ } else if (rendering) {
314
+ return found;
315
+ }
316
+ found.props = props;
317
+ propsRendered(found);
318
+ return found;
319
+ }
320
+ function element(slot, key) {
321
+ if (key === void 0) {
322
+ for (const part2 of parts.values()) {
323
+ if (part2.slot === slot && part2.el?.isConnected) {
324
+ return part2.el;
325
+ }
326
+ }
327
+ return;
328
+ }
329
+ const el = parts.get(`${slot}:${key}`)?.el;
330
+ return el?.isConnected ? el : void 0;
331
+ }
332
+ const context = {
333
+ id,
334
+ label,
335
+ store,
336
+ options: () => options,
337
+ onOptions: (listener) => optionsListeners.push(listener),
338
+ onDestroy: (cleanup) => destroys.push(cleanup),
339
+ parts: () => parts.values(),
340
+ element,
341
+ props: (slot, key = "") => {
342
+ const shown = viewedParts?.[slot];
343
+ return shown && keyOf(shown) === key ? shown : parts.get(`${slot}:${key}`)?.props;
344
+ }
345
+ };
346
+ let api = void 0;
347
+ function build() {
348
+ api = definition.api(context);
349
+ connectController(context, api);
350
+ }
351
+ function wake() {
352
+ const { sleeping } = owner;
353
+ if (!sleeping) {
354
+ return;
355
+ }
356
+ owner.sleeping = void 0;
357
+ extendLifecycle(instance, build);
358
+ for (const bind of [...sleeping.binds]) {
359
+ bind();
360
+ }
361
+ }
362
+ if (definition.asleep?.(options)) {
363
+ owner.sleeping = { wake, binds: /* @__PURE__ */ new Set() };
364
+ } else {
365
+ build();
366
+ }
367
+ let destroyed = false;
368
+ const syncFrom = (options2, state) => withDerived(store, options2, definition.sync?.(options2), state);
369
+ const instance = {
370
+ // Type-only. Lets adapters read slot props, state and api types.
371
+ types: void 0,
372
+ name,
373
+ id,
374
+ get: store.get,
375
+ subscribe: store.subscribe,
376
+ get api() {
377
+ wake();
378
+ return api;
379
+ },
380
+ part,
381
+ use,
382
+ // The state `next` would make, or undefined when it makes none new, so
383
+ // a framework can render a controlled value before it commits it.
384
+ preview(next) {
385
+ const synced = syncFrom({ ...next, id }, store.get());
386
+ const current = store.get();
387
+ for (const key in synced) {
388
+ if (!sameValue(current[key], synced[key])) {
389
+ return { ...current, ...synced };
390
+ }
391
+ }
392
+ },
393
+ // Runs `read` with `get()` returning `state`, and the api reading the
394
+ // parts in `around` with the props given there, so a framework that
395
+ // renders a preview reads the api, like a list's items or a radio
396
+ // group's value, from it too.
397
+ view(state, read, around) {
398
+ const outer = viewedParts;
399
+ viewedParts = around;
400
+ try {
401
+ return store.view(state, read);
402
+ } finally {
403
+ viewedParts = outer;
404
+ }
405
+ },
406
+ setOptions(next) {
407
+ const held = heldState(store);
408
+ const arriving = next.id === id ? next : { ...next, id };
409
+ options = arriving;
410
+ if (owner.sleeping && !definition.asleep(options)) {
411
+ wake();
412
+ }
413
+ const synced = syncFrom(options, held);
414
+ let source;
415
+ try {
416
+ for (const listener of optionsListeners) {
417
+ source = listener(options, synced) ?? source;
418
+ }
419
+ const landing = heldState(store) === held ? synced : syncFrom(options, heldState(store));
420
+ if (landing) {
421
+ withSource(source, () => store.set(landing, true));
422
+ }
423
+ } finally {
424
+ }
425
+ },
426
+ // The state a new instance with `next` would start at. The web adapter
427
+ // reads a form reset's defaults from it when properties set before
428
+ // connecting started an element elsewhere.
429
+ startState: (next) => definition.state({ ...next, id }),
430
+ // Reads the keys `sync` makes from `current`, a framework's props, from
431
+ // now on: state has them the moment the props change, before
432
+ // `setOptions` hands them over from an effect, and parts the framework
433
+ // renders read them through it rather than hear the store. Pass the same
434
+ // object while the props stay the same. Returns a read of what `sync`
435
+ // makes of them. Given the options an earlier read had as `before`, it
436
+ // reads what those make of the same state, so a framework tells what
437
+ // the props changed from what state did.
438
+ follow(current) {
439
+ let last;
440
+ let synced;
441
+ const read = (state = heldState(store), before) => {
442
+ if (before) {
443
+ return syncFrom({ ...before, id }, state);
444
+ }
445
+ if (destroyed) {
446
+ return synced;
447
+ }
448
+ const options2 = current();
449
+ if (last?.options !== options2 || last.state !== state) {
450
+ last = { options: options2, state };
451
+ synced = syncFrom({ ...options2, id }, state);
452
+ }
453
+ return synced;
454
+ };
455
+ store.follow(read);
456
+ return read;
457
+ },
458
+ // The instance left the page. Stops what it started outside itself for
459
+ // good, then runs its `onDestroy` callbacks, which settle what waits on
460
+ // it, like a popup's pending `open()`. Adapters call it once the
461
+ // component unmounts, and a second call does nothing.
462
+ destroy() {
463
+ if (destroyed) {
464
+ return;
465
+ }
466
+ destroyed = true;
467
+ discard(instance);
468
+ whileDestroying(() => destroys.forEach((cleanup) => cleanup()));
469
+ }
470
+ };
471
+ standFor(instance, store);
472
+ watchWhileKept(instance, parts, definition);
473
+ return instance;
474
+ };
475
+ const create = (initialOptions) => withLifecycle(() => make(initialOptions));
476
+ Object.defineProperty(create, "name", { value: name });
477
+ return Object.assign(create, {
478
+ options: definition.options,
479
+ slots
480
+ });
481
+ }
482
+ var schemas = /* @__PURE__ */ new WeakMap();
483
+ function schemaOf(primitive) {
484
+ let schema = schemas.get(primitive);
485
+ if (!schema) {
486
+ const { options, slots = {} } = primitive;
487
+ schema = {
488
+ options: { debug: "boolean", ...options },
489
+ slots: Object.fromEntries(
490
+ Object.entries(slots).map(([slot, def]) => [
491
+ slot,
492
+ def.props ?? {}
493
+ ])
494
+ )
495
+ };
496
+ schemas.set(primitive, schema);
497
+ }
498
+ return schema;
499
+ }
500
+ var renderVersion = (instance) => renders(instance);
501
+
502
+ // src/foundation/kernel/option-names.ts
503
+ var capitalized = (key) => `${key[0].toUpperCase()}${key.slice(1)}`;
504
+ var callbackName = (key, kind) => `on${capitalized(key)}${kind}`;
505
+
506
+ // src/foundation/kernel/change.ts
507
+ function debug(context, key, value, reason, source) {
508
+ }
509
+ function changeFrom(context, source) {
510
+ const { store, options } = context;
511
+ const requested = /* @__PURE__ */ new Map();
512
+ const asked = /* @__PURE__ */ new Map();
513
+ const changing = /* @__PURE__ */ new Map();
514
+ context.onOptions((next, synced) => {
515
+ if (!synced) {
516
+ return;
517
+ }
518
+ let source2;
519
+ for (const [key, entry] of requested) {
520
+ if (!(key in synced)) {
521
+ continue;
522
+ }
523
+ if (sameValue(synced[key], entry.value)) {
524
+ source2 = entry.source;
525
+ }
526
+ requested.delete(key);
527
+ }
528
+ return source2;
529
+ });
530
+ return (key, value, details) => {
531
+ if (changing.has(key) && sameValue(changing.get(key), value)) {
532
+ return false;
533
+ }
534
+ const ask = (asked.get(key) ?? 0) + 1;
535
+ asked.set(key, ask);
536
+ const previous = store.get()[key];
537
+ if (sameValue(previous, value)) {
538
+ return false;
539
+ }
540
+ const { reason, event } = details;
541
+ const callbackDetails = createDetails(
542
+ details,
543
+ details.source ?? source(reason, event)
544
+ );
545
+ debug(context, key, value, reason, callbackDetails.source);
546
+ const current = options();
547
+ const isControlled = current[key] !== void 0;
548
+ const outer = changing.has(key);
549
+ const outerValue = changing.get(key);
550
+ changing.set(key, value);
551
+ try {
552
+ withSource(callbackDetails.source, () => {
553
+ const name = callbackName(key, "Change");
554
+ const callback = current[name];
555
+ if (typeof callback === "function") {
556
+ const prevented = dev && !!event?.defaultPrevented;
557
+ callback(value, callbackDetails);
558
+ if (dev) ;
559
+ }
560
+ const askedInside = asked.get(key) !== ask;
561
+ if (!callbackDetails.canceled && !isControlled && !askedInside) {
562
+ store.set({ [key]: value });
563
+ }
564
+ });
565
+ } finally {
566
+ if (outer) {
567
+ changing.set(key, outerValue);
568
+ } else {
569
+ changing.delete(key);
570
+ }
571
+ }
572
+ if (callbackDetails.canceled) {
573
+ return false;
574
+ }
575
+ watchers$1.change?.(context.id, key, value, callbackDetails, previous);
576
+ if (isControlled) {
577
+ requested.set(key, { value, source: callbackDetails.source });
578
+ }
579
+ return true;
580
+ };
581
+ }
582
+ function log(context, key, value, details) {
583
+ details.source ?? resolveSource(details.reason);
584
+ }
585
+
586
+ // src/foundation/kernel/modality.ts
587
+ var modality = "pointer";
588
+ var installed = false;
589
+ var scheduled = false;
590
+ var lastPointer = "mouse";
591
+ var pointerPressed = false;
592
+ var forgetPointerPress = () => pointerPressed = false;
593
+ var keyTarget = null;
594
+ var forgetKeyTarget = () => keyTarget = null;
595
+ function noteKey(event) {
596
+ if (event.key !== "Enter" && event.key !== " ") {
597
+ return;
598
+ }
599
+ keyTarget = event.target;
600
+ setTimeout(forgetKeyTarget);
601
+ }
602
+ function noteKeydown(event) {
603
+ noteKey(event);
604
+ const modifierOnly = event.metaKey || event.ctrlKey || event.altKey || /^(Meta|Control|Alt|Shift)$/.test(event.key);
605
+ if (event.key === "Tab" || !modifierOnly) {
606
+ modality = "keyboard";
607
+ }
608
+ }
609
+ function notePress(event) {
610
+ modality = "pointer";
611
+ if (!("pointerType" in event)) {
612
+ if (!pointerPressed) {
613
+ lastPointer = "touch";
614
+ }
615
+ return;
616
+ }
617
+ pointerPressed = true;
618
+ setTimeout(forgetPointerPress);
619
+ const type = event.pointerType;
620
+ lastPointer = isSyntheticPointer(event) ? "virtual" : type === "touch" || type === "pen" ? type : "mouse";
621
+ }
622
+ function install() {
623
+ if (installed || typeof document === "undefined") {
624
+ return;
625
+ }
626
+ installed = true;
627
+ document.addEventListener("keydown", noteKeydown, true);
628
+ document.addEventListener("keyup", noteKey, true);
629
+ document.addEventListener("pointerdown", notePress, true);
630
+ document.addEventListener("touchstart", notePress, {
631
+ capture: true,
632
+ passive: true
633
+ });
634
+ window.addEventListener("blur", (event) => {
635
+ if (event.target === window) ;
636
+ });
637
+ }
638
+ function trackInput() {
639
+ if (installed || scheduled) {
640
+ return;
641
+ }
642
+ scheduled = true;
643
+ queueMicrotask(install);
644
+ }
645
+ function isSyntheticPointer(event) {
646
+ if (event.type === "pointermove") {
647
+ return false;
648
+ }
649
+ if (event.width === 0 && event.height === 0 && event.pressure === 0) {
650
+ return true;
651
+ }
652
+ return event.pointerType === "mouse" && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0;
653
+ }
654
+ function clickSource(event) {
655
+ if (event.detail > 0) {
656
+ return lastPointer;
657
+ }
658
+ const fromKey = !!keyTarget && keyTarget.contains(event.target);
659
+ return fromKey ? "keyboard" : "virtual";
660
+ }
661
+ var currentSource = () => modality === "keyboard" ? "keyboard" : lastPointer;
662
+ function sourceOf(event) {
663
+ install();
664
+ if (!event) {
665
+ return currentSource();
666
+ }
667
+ if (!trusted(event)) {
668
+ return "programmatic";
669
+ }
670
+ if (event.type.startsWith("key")) {
671
+ return "keyboard";
672
+ }
673
+ if (event.type.startsWith("touch")) {
674
+ return "touch";
675
+ }
676
+ if (event.type === "click") {
677
+ return clickSource(event);
678
+ }
679
+ const pointerType = event.pointerType;
680
+ if (pointerType === "mouse" || pointerType === "touch" || pointerType === "pen") {
681
+ return isSyntheticPointer(event) ? "virtual" : pointerType;
682
+ }
683
+ if ("button" in event) {
684
+ return lastPointer;
685
+ }
686
+ return currentSource();
687
+ }
688
+
689
+ // src/foundation/kernel/input-source.ts
690
+ var changeSource = (reason, event) => resolveSource(reason, event && (() => sourceOf(event)));
691
+ function inputSource() {
692
+ trackInput();
693
+ return changeSource;
694
+ }
695
+ function createChange(context, source = inputSource()) {
696
+ return changeFrom(context, source);
697
+ }
698
+
699
+ // src/foundation/kernel/live.ts
700
+ var applied = /* @__PURE__ */ new WeakMap();
701
+ var found = /* @__PURE__ */ new WeakMap();
702
+ var writing;
703
+ function applyAttrs(el, attrs2, channel = "render") {
704
+ writeAttrs(el, attrs2, channel, false);
705
+ }
706
+ function releaseAttrs(el, channel) {
707
+ writeAttrs(el, {}, channel, true);
708
+ }
709
+ function markAuthored(el, name) {
710
+ if (el === writing) {
711
+ return;
712
+ }
713
+ for (const written of Object.values(applied.get(el) ?? {})) {
714
+ written.delete(name);
715
+ }
716
+ for (const values of Object.values(found.get(el) ?? {})) {
717
+ values.delete(name);
718
+ }
719
+ }
720
+ function writeAttrs(el, attrs2, channel, release) {
721
+ const outer = writing;
722
+ writing = el;
723
+ try {
724
+ writeChannel(el, attrs2, channel, release);
725
+ } finally {
726
+ writing = outer;
727
+ }
728
+ }
729
+ function writeChannel(el, attrs2, channel, release) {
730
+ const channels = applied.get(el) ?? {};
731
+ const previous = channels[channel] ?? /* @__PURE__ */ new Map();
732
+ const written = /* @__PURE__ */ new Map();
733
+ const styles = attrs2.style === void 0 ? [] : styleDeclarations(attrs2.style);
734
+ for (const [property, value] of styles) {
735
+ written.set(`style:${property}`, value);
736
+ }
737
+ for (const [name, value] of Object.entries(attrs2)) {
738
+ if (value !== void 0 && name !== "style") {
739
+ written.set(name, value);
740
+ }
741
+ }
742
+ const id = written.has("id") || previous.has("id") ? el.getAttribute("id") : null;
743
+ const keeps = keepsId(id, channels, channel);
744
+ if (keeps) {
745
+ written.delete("id");
746
+ }
747
+ const authors = /* @__PURE__ */ new Set();
748
+ const read = /* @__PURE__ */ new Map();
749
+ for (const name of /* @__PURE__ */ new Set([...written.keys(), ...previous.keys()])) {
750
+ if (!authorOwned.has(name)) {
751
+ continue;
752
+ }
753
+ const current = el.getAttribute(name);
754
+ read.set(name, current);
755
+ if (current === null || current === written.get(name) || name === "aria-labelledby" && madeLabel(current)) {
756
+ continue;
757
+ }
758
+ if (!Object.values(channels).some((wrote) => wrote.get(name) === current)) {
759
+ authors.add(name);
760
+ }
761
+ }
762
+ for (const name of authors) {
763
+ written.delete(name);
764
+ }
765
+ for (const name of previous.keys()) {
766
+ if (written.has(name) || authors.has(name) || name === "id" && keeps) {
767
+ continue;
768
+ }
769
+ if (name.startsWith("style:")) {
770
+ el.style.removeProperty(name.slice(6));
771
+ continue;
772
+ }
773
+ if (!release) {
774
+ el.removeAttribute(name);
775
+ keepFound(el, channel, name, null);
776
+ continue;
777
+ }
778
+ const current = el.getAttribute(name);
779
+ if (current !== previous.get(name)) {
780
+ continue;
781
+ }
782
+ const original = found.get(el)?.[channel]?.get(name);
783
+ if (original === void 0) {
784
+ el.removeAttribute(name);
785
+ } else if (current !== original) {
786
+ el.setAttribute(name, original);
787
+ }
788
+ }
789
+ for (const [property, value] of styles) {
790
+ if (el.style.getPropertyValue(property) !== value) {
791
+ el.style.setProperty(property, value);
792
+ }
793
+ }
794
+ for (const [name, value] of Object.entries(attrs2)) {
795
+ if (value === void 0 || !written.has(name)) {
796
+ continue;
797
+ }
798
+ const current = name === "id" ? id : read.has(name) ? read.get(name) : el.getAttribute(name);
799
+ if (current !== (previous.get(name) ?? null)) {
800
+ keepFound(el, channel, name, current);
801
+ }
802
+ if (current === value) {
803
+ continue;
804
+ }
805
+ if (name === "value" && isTextField(el) && el.value !== value) {
806
+ el.value = value;
807
+ }
808
+ el.setAttribute(name, value);
809
+ }
810
+ channels[channel] = written;
811
+ applied.set(el, channels);
812
+ if (release) {
813
+ delete found.get(el)?.[channel];
814
+ }
815
+ }
816
+ function keepFound(el, channel, name, value) {
817
+ const kept = value == null || name === "id" ? void 0 : references.includes(name) ? authoredIds(value) : value;
818
+ if (kept === void 0) {
819
+ return void found.get(el)?.[channel]?.delete(name);
820
+ }
821
+ let channels = found.get(el);
822
+ if (!channels) {
823
+ found.set(el, channels = {});
824
+ }
825
+ (channels[channel] ??= /* @__PURE__ */ new Map()).set(name, kept);
826
+ }
827
+ var authoredIds = (ids) => ids.split(/\s+/).filter((id) => id && !id.startsWith("ui-sdk-")).join(" ") || void 0;
828
+ function keepsId(id, channels, channel) {
829
+ if (id === null || id === channels[channel]?.get("id")) {
830
+ return false;
831
+ }
832
+ return !id.startsWith("ui-sdk-") || Object.values(channels).some((written) => written.get("id") === id);
833
+ }
834
+ var isTextField = (el) => el.localName === "textarea" || el.localName === "input" && el.type !== "file";
835
+ function styleDeclarations(css) {
836
+ const declarations = [];
837
+ for (const declaration of css.split(";")) {
838
+ const index = declaration.indexOf(":");
839
+ if (index > 0) {
840
+ declarations.push([
841
+ declaration.slice(0, index).trim(),
842
+ declaration.slice(index + 1).trim()
843
+ ]);
844
+ }
845
+ }
846
+ return declarations;
847
+ }
848
+
849
+ // src/foundation/forms/form-internals.ts
850
+ var callbacksOf = /* @__PURE__ */ new WeakMap();
851
+ var customMessages = /* @__PURE__ */ new WeakMap();
852
+ function formCallback(el, type, ...args) {
853
+ if (type === "customValidity") {
854
+ customMessages.set(el, args[0]);
855
+ }
856
+ const callback = callbacksOf.get(el)?.[type];
857
+ callback?.(...args);
858
+ return !!callback;
859
+ }
860
+ function bindElementInternals(el, internals, options) {
861
+ let reported = "";
862
+ const sync = () => {
863
+ const value = options.value();
864
+ if (value instanceof FormData) {
865
+ internals.setFormValue(value, options.state());
866
+ } else if (Array.isArray(value)) {
867
+ const data = new FormData();
868
+ const name = options.name?.();
869
+ if (name) {
870
+ for (const item of value) {
871
+ data.append(name, item);
872
+ }
873
+ }
874
+ internals.setFormValue(data, options.state());
875
+ } else {
876
+ internals.setFormValue(value, options.state());
877
+ }
878
+ const missing = options.valueMissing();
879
+ const custom = customMessages.get(el);
880
+ const invalid = options.invalid?.();
881
+ if (custom) {
882
+ internals.setValidity(
883
+ { customError: true },
884
+ custom,
885
+ options.anchor?.() ?? el
886
+ );
887
+ } else if (invalid) {
888
+ internals.setValidity(
889
+ invalid.flags,
890
+ invalid.message,
891
+ invalid.anchor ?? options.anchor?.() ?? el
892
+ );
893
+ } else if (missing) {
894
+ internals.setValidity(
895
+ { valueMissing: true },
896
+ options.message(),
897
+ options.anchor?.() ?? el
898
+ );
899
+ } else {
900
+ internals.setValidity({});
901
+ }
902
+ if ((invalid?.message ?? "") === reported) {
903
+ return;
904
+ }
905
+ reported = invalid?.message ?? "";
906
+ validityChanged(el);
907
+ };
908
+ sync();
909
+ const unsubscribe = options.subscribe(sync);
910
+ const unfocus = options.focus ? focusWith(el, options.focus) : () => {
911
+ };
912
+ if (el.matches(":disabled")) {
913
+ options.disabled(true);
914
+ }
915
+ callbacksOf.set(el, {
916
+ reset: () => {
917
+ options.reset();
918
+ sync();
919
+ },
920
+ disabled: (disabled) => options.disabled(disabled),
921
+ restore: (state) => {
922
+ if (typeof state === "string") {
923
+ options.restore(state);
924
+ }
925
+ },
926
+ customValidity: sync
927
+ });
928
+ const unlabel = labelledBy(el, () => labelsOf(el));
929
+ const onInvalid = () => {
930
+ if (options.focus) {
931
+ claimInvalidFocus(el, internals.form);
932
+ }
933
+ };
934
+ el.addEventListener("invalid", onInvalid);
935
+ return () => {
936
+ el.removeEventListener("invalid", onInvalid);
937
+ unsubscribe();
938
+ unlabel();
939
+ callbacksOf.delete(el);
940
+ unfocus();
941
+ };
942
+ }
943
+
944
+ // src/action.ts
945
+ function waitList() {
946
+ const waiting = [];
947
+ let dispatching = true;
948
+ const waitUntil = (promise) => {
949
+ if (!dispatching) {
950
+ throw new DOMException(
951
+ "waitUntil() can only be called while the event dispatches.",
952
+ "InvalidStateError"
953
+ );
954
+ }
955
+ waiting.push(promise);
956
+ };
957
+ const done = () => {
958
+ dispatching = false;
959
+ return waiting;
960
+ };
961
+ return { waitUntil, done };
962
+ }
963
+ var actionOf = (el) => (_event, details) => {
964
+ const { waitUntil, done } = waitList();
965
+ const proceed = el.dispatchEvent(
966
+ new CustomEvent("action", {
967
+ cancelable: true,
968
+ composed: true,
969
+ detail: { ...details, waitUntil }
970
+ })
971
+ );
972
+ const waiting = done();
973
+ if (!proceed) {
974
+ return canceledAction;
975
+ }
976
+ return waiting.length ? Promise.all(waiting) : void 0;
977
+ };
978
+
979
+ // src/define-element.ts
980
+ var autoIds = /* @__PURE__ */ new WeakMap();
981
+ var count = 0;
982
+ var claimed = /* @__PURE__ */ new Set();
983
+ function claimTag(tagName) {
984
+ if (typeof customElements === "undefined" || claimed.has(tagName)) {
985
+ return false;
986
+ }
987
+ if (customElements.get(tagName)) {
988
+ return false;
989
+ }
990
+ claimed.add(tagName);
991
+ return true;
992
+ }
993
+ function autoId(el) {
994
+ if (!autoIds.has(el)) {
995
+ autoIds.set(el, `auto-${++count}`);
996
+ }
997
+ return autoIds.get(el);
998
+ }
999
+ function wrappedButton(el) {
1000
+ return el.querySelector(
1001
+ ":scope > button, :scope > a, :scope > ui-button > button, :scope > ui-button > a"
1002
+ ) ?? el.firstElementChild;
1003
+ }
1004
+ var wrappedChild = (selector) => (el) => el.querySelector(`:scope > ${selector}`) ?? el.firstElementChild;
1005
+ function boundElement(el, target) {
1006
+ if (target) {
1007
+ return target(el);
1008
+ }
1009
+ return el.hasAttribute("as-child") ? el.firstElementChild : el;
1010
+ }
1011
+ var rekeyed = (previous, next) => previous.id !== next.id || previous.value !== next.value;
1012
+ var kebab = (name) => name.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
1013
+ var semantics = ["role", "aria-disabled"];
1014
+ function parseAttribute(type, value) {
1015
+ if (value === null) {
1016
+ return void 0;
1017
+ }
1018
+ if (typeof type === "function") {
1019
+ return type(value);
1020
+ }
1021
+ if (type === "boolean") {
1022
+ return value !== "false";
1023
+ }
1024
+ if (type === "number") {
1025
+ const number = Number(value);
1026
+ return value.trim() === "" || Number.isNaN(number) ? void 0 : number;
1027
+ }
1028
+ if (type === "list") {
1029
+ return value.split(",").map((item) => item.trim()).filter(Boolean);
1030
+ }
1031
+ return value;
1032
+ }
1033
+ var presence = /* @__PURE__ */ new Set(["disabled", "required"]);
1034
+ function readAttribute(el, name, type) {
1035
+ const value = el.getAttribute(kebab(name));
1036
+ if (type === "boolean" && presence.has(name)) {
1037
+ return value === null ? void 0 : true;
1038
+ }
1039
+ return parseAttribute(type, value);
1040
+ }
1041
+ function readAttributes(el, schema) {
1042
+ const result = {};
1043
+ for (const [name, type] of Object.entries(schema)) {
1044
+ const value = readAttribute(el, name, type);
1045
+ if (value !== void 0) {
1046
+ result[name] = value;
1047
+ }
1048
+ }
1049
+ return result;
1050
+ }
1051
+ var defaultOn = (el, value) => typeof value === "function" ? value(el) : value;
1052
+ function reflectAttributes(proto, schema, defaults = {}) {
1053
+ for (const [name, type] of Object.entries(schema)) {
1054
+ if (name in proto) {
1055
+ continue;
1056
+ }
1057
+ const attribute = kebab(name);
1058
+ Object.defineProperty(proto, name, {
1059
+ configurable: true,
1060
+ get() {
1061
+ return readAttribute(this, name, type) ?? defaultOn(this, defaults[name]) ?? (type === "boolean" ? false : void 0);
1062
+ },
1063
+ set(value) {
1064
+ const removes = value === false && type === "boolean" && !defaultOn(this, defaults[name]);
1065
+ if (value == null || removes) {
1066
+ this.removeAttribute(attribute);
1067
+ } else {
1068
+ this.setAttribute(
1069
+ attribute,
1070
+ value === true ? "" : Array.isArray(value) ? value.join(",") : String(value)
1071
+ );
1072
+ }
1073
+ }
1074
+ });
1075
+ }
1076
+ }
1077
+ function upgradeProperties(el, names) {
1078
+ for (const name of names) {
1079
+ if (!Object.prototype.hasOwnProperty.call(el, name)) {
1080
+ continue;
1081
+ }
1082
+ const value = el[name];
1083
+ delete el[name];
1084
+ el[name] = value;
1085
+ }
1086
+ }
1087
+ var quiet = /* @__PURE__ */ new Set();
1088
+ function restoreQuietly(el, state, mode) {
1089
+ quiet.add(el);
1090
+ try {
1091
+ return formCallback(el, "restore", state, mode);
1092
+ } finally {
1093
+ quiet.delete(el);
1094
+ }
1095
+ }
1096
+ var pendingRestores = /* @__PURE__ */ new Map();
1097
+ function wroteFromScript(el) {
1098
+ for (const waiting of pendingRestores.keys()) {
1099
+ if (waiting.contains(el)) {
1100
+ pendingRestores.delete(waiting);
1101
+ }
1102
+ }
1103
+ }
1104
+ function restoreOnceBound(el, state, mode) {
1105
+ const token = {};
1106
+ pendingRestores.set(el, token);
1107
+ queueMicrotask(() => {
1108
+ if (pendingRestores.get(el) !== token) {
1109
+ return;
1110
+ }
1111
+ pendingRestores.delete(el);
1112
+ restoreQuietly(el, state, mode);
1113
+ });
1114
+ }
1115
+ function quietNow(el) {
1116
+ const owner = partOwners.get(el);
1117
+ if (quiet.has(el) || !!owner && quiet.has(owner)) {
1118
+ return true;
1119
+ }
1120
+ for (const inside of quiet) {
1121
+ if (el.contains(inside)) {
1122
+ return true;
1123
+ }
1124
+ }
1125
+ return false;
1126
+ }
1127
+ function detailsOnly(value, details) {
1128
+ return details === void 0 && !!value && typeof value === "object" && "reason" in value && !(typeof Event !== "undefined" && value instanceof Event);
1129
+ }
1130
+ function withEvents(el, target, silent = [], actions = [], names = {}) {
1131
+ return new Proxy(target, {
1132
+ get(target2, key) {
1133
+ if (key in target2 || typeof key !== "string" || !/^on[A-Z]/.test(key)) {
1134
+ return target2[key];
1135
+ }
1136
+ if (silent.includes(key)) {
1137
+ return void 0;
1138
+ }
1139
+ return (value, details) => {
1140
+ if (quietNow(el)) {
1141
+ return;
1142
+ }
1143
+ const only = detailsOnly(value, details);
1144
+ const { cancel, canceled, ...rest } = (only ? value : details) ?? {};
1145
+ const detail = only ? rest : { ...rest, value };
1146
+ const wait = actions.includes(key) ? waitList() : void 0;
1147
+ if (wait) {
1148
+ detail.waitUntil = wait.waitUntil;
1149
+ }
1150
+ const event = new CustomEvent(
1151
+ names[key] ?? key.slice(2).toLowerCase(),
1152
+ {
1153
+ detail,
1154
+ bubbles: false,
1155
+ // Only a change with details or an event to cancel is cancelable.
1156
+ cancelable: typeof cancel === "function" || typeof value?.preventDefault === "function",
1157
+ composed: true
1158
+ }
1159
+ );
1160
+ const proceed = el.dispatchEvent(event);
1161
+ const waiting = wait?.done() ?? [];
1162
+ if (!proceed) {
1163
+ if (typeof cancel === "function") {
1164
+ cancel();
1165
+ } else if (value && typeof value.preventDefault === "function") {
1166
+ value.preventDefault();
1167
+ }
1168
+ }
1169
+ return waiting.length > 1 ? Promise.all(waiting).then((values) => values.at(-1)) : waiting[0];
1170
+ };
1171
+ }
1172
+ });
1173
+ }
1174
+ var instances = /* @__PURE__ */ new WeakMap();
1175
+ function instanceOf(el) {
1176
+ return el ? instances.get(el) : void 0;
1177
+ }
1178
+ var reads = /^(?:get|is|can)[A-Z]|^focus$/;
1179
+ function controllerView(el, api, methods) {
1180
+ const view = {};
1181
+ for (const name of methods) {
1182
+ const method = api[name];
1183
+ if (typeof method === "function") {
1184
+ view[name] = (...args) => {
1185
+ if (!reads.test(name)) {
1186
+ wroteFromScript(el);
1187
+ }
1188
+ return method.apply(api, args);
1189
+ };
1190
+ }
1191
+ }
1192
+ return Object.freeze(view);
1193
+ }
1194
+ var display = /* @__PURE__ */ new Map();
1195
+ var aligned = /* @__PURE__ */ new Set();
1196
+ var styleId;
1197
+ function documentStyle() {
1198
+ if (styleId) {
1199
+ return styleId;
1200
+ }
1201
+ const copies = globalThis;
1202
+ const key = /* @__PURE__ */ Symbol.for("ui-sdk.web-styles@1");
1203
+ copies[key] = (copies[key] ?? 0) + 1;
1204
+ return styleId = `ui-sdk-web-${copies[key]}`;
1205
+ }
1206
+ var css = "";
1207
+ var rulesVersion = 0;
1208
+ var constructed = /* @__PURE__ */ new WeakMap();
1209
+ function setDisplay(selector, value, align = false) {
1210
+ if (align) {
1211
+ aligned.add(selector);
1212
+ }
1213
+ if (!value && !align) {
1214
+ return;
1215
+ }
1216
+ if (value) {
1217
+ display.set(selector, value);
1218
+ }
1219
+ css = rules();
1220
+ writeStyle(document, documentStyle(), css);
1221
+ rulesVersion++;
1222
+ }
1223
+ function rules() {
1224
+ return [
1225
+ "@layer ui-sdk {",
1226
+ // Parts that aren't shown stay hidden whatever display a class gives them.
1227
+ ' :where([data-slot][hidden]:not([hidden="until-found"])) { display: none !important }',
1228
+ // Content hidden until found is only hidden inside a box, so those keep theirs.
1229
+ ...[...display].map(
1230
+ ([selector, value]) => ` :where(${selector}:not([hidden]), ${selector}[hidden="until-found"]) { display: ${value} }`
1231
+ ),
1232
+ ...[...aligned].map(
1233
+ (tag) => ` :where(${tag}[align]) { text-align: inherit }`
1234
+ ),
1235
+ // A part with as-child hands its role to its child, so it has no box of its own.
1236
+ " :where([as-child]) { display: contents }",
1237
+ "}"
1238
+ ].join("\n");
1239
+ }
1240
+ function adoptStyles(el) {
1241
+ const root = el.getRootNode();
1242
+ if (!isShadowRoot(root)) {
1243
+ return copyStyles(el.ownerDocument);
1244
+ }
1245
+ const shared = sharedSheet(root.ownerDocument);
1246
+ if (!shared || root.adoptedStyleSheets.includes(shared)) {
1247
+ return;
1248
+ }
1249
+ root.adoptedStyleSheets = [shared, ...root.adoptedStyleSheets];
1250
+ }
1251
+ var isShadowRoot = (node) => node.nodeType === 11 && "host" in node;
1252
+ function sharedSheet(doc) {
1253
+ const view = doc.defaultView;
1254
+ if (!view) {
1255
+ return;
1256
+ }
1257
+ let entry = constructed.get(doc);
1258
+ if (!entry) {
1259
+ constructed.set(
1260
+ doc,
1261
+ entry = { sheet: new view.CSSStyleSheet(), version: -1 }
1262
+ );
1263
+ }
1264
+ if (entry.version !== rulesVersion) {
1265
+ entry.sheet.replaceSync(rules());
1266
+ entry.version = rulesVersion;
1267
+ }
1268
+ return entry.sheet;
1269
+ }
1270
+ function copyStyles(doc) {
1271
+ if (css) {
1272
+ writeStyle(doc, documentStyle(), css);
1273
+ }
1274
+ }
1275
+ var dependents = /* @__PURE__ */ new Set();
1276
+ function reconfigureInside(el) {
1277
+ for (const dependent of dependents) {
1278
+ if (dependent !== el && el.contains(dependent)) {
1279
+ dependent.reconfigure();
1280
+ }
1281
+ }
1282
+ }
1283
+ var portals = /* @__PURE__ */ new WeakMap();
1284
+ var partOwners = /* @__PURE__ */ new WeakMap();
1285
+ var slotParts = /* @__PURE__ */ new WeakMap();
1286
+ function innerPart(part, owner) {
1287
+ for (let node = part.el; node && node !== owner; node = node.parentElement) {
1288
+ const other = slotParts.get(node);
1289
+ if (other === part) {
1290
+ return;
1291
+ }
1292
+ if (other?.el === part.el && registered.has(other)) {
1293
+ return other;
1294
+ }
1295
+ }
1296
+ }
1297
+ function handOver(part) {
1298
+ part.dataSlot = void 0;
1299
+ const sharing = [];
1300
+ for (let node = part.el; node; node = node.parentElement) {
1301
+ const other = slotParts.get(node);
1302
+ if (other && other !== part && other.el === part.el && registered.has(other)) {
1303
+ sharing.push(other);
1304
+ }
1305
+ }
1306
+ if (!sharing.length) {
1307
+ return;
1308
+ }
1309
+ part.el.removeAttribute("data-slot");
1310
+ markAuthored(part.el, "data-slot");
1311
+ for (const other of sharing) {
1312
+ other.sync?.();
1313
+ }
1314
+ }
1315
+ var registered = /* @__PURE__ */ new WeakSet();
1316
+ var findOwnerAgain = /* @__PURE__ */ new WeakMap();
1317
+ var hasRichValue = (props) => props.value !== void 0 && typeof props.value !== "string";
1318
+ function propsAround(el, slot, owner) {
1319
+ for (let node = el.parentElement; node; node = node.parentElement) {
1320
+ const part = slotParts.get(node);
1321
+ if (part?.slot !== slot || partOwners.get(node) !== owner) {
1322
+ continue;
1323
+ }
1324
+ return part.keyed && hasRichValue(part.props) ? { ...part.props, value: part.props.id } : part.props;
1325
+ }
1326
+ }
1327
+ function findOwner(el, selector) {
1328
+ const target = el.getAttribute("for");
1329
+ if (target) {
1330
+ const root = el.getRootNode();
1331
+ const owner = "getElementById" in root ? root.getElementById(target) : null;
1332
+ if (owner?.matches(selector)) {
1333
+ return owner;
1334
+ }
1335
+ }
1336
+ for (let node = el.parentElement; node; node = node.parentElement) {
1337
+ if (node.matches(selector)) {
1338
+ return node;
1339
+ }
1340
+ const owner = partOwners.get(node);
1341
+ if (owner?.matches(selector)) {
1342
+ return owner;
1343
+ }
1344
+ }
1345
+ }
1346
+ function whenGone(el, run) {
1347
+ queueMicrotask(() => {
1348
+ if (!el.isConnected) {
1349
+ run();
1350
+ }
1351
+ });
1352
+ }
1353
+ var formStates = /* @__PURE__ */ new WeakMap();
1354
+ var bindInternals = (el, internals, options) => {
1355
+ formStates.set(el, options.state);
1356
+ return bindElementInternals(el, internals, options);
1357
+ };
1358
+ function formAssociated(Base) {
1359
+ return class extends Base {
1360
+ static formAssociated = true;
1361
+ #internals;
1362
+ constructor() {
1363
+ super();
1364
+ this.#internals = this.attachInternals();
1365
+ attachFormInternals(this, this.#internals, bindInternals);
1366
+ }
1367
+ get form() {
1368
+ return this.#internals.form;
1369
+ }
1370
+ get labels() {
1371
+ return this.#internals.labels;
1372
+ }
1373
+ get name() {
1374
+ return this.getAttribute("name") ?? "";
1375
+ }
1376
+ set name(value) {
1377
+ this.setAttribute("name", value);
1378
+ }
1379
+ get validity() {
1380
+ return this.#internals.validity;
1381
+ }
1382
+ get validationMessage() {
1383
+ return this.#internals.validationMessage;
1384
+ }
1385
+ get willValidate() {
1386
+ return this.#internals.willValidate;
1387
+ }
1388
+ checkValidity() {
1389
+ return this.#internals.checkValidity();
1390
+ }
1391
+ reportValidity() {
1392
+ return this.#internals.reportValidity();
1393
+ }
1394
+ setCustomValidity(message) {
1395
+ if (!formCallback(this, "customValidity", message)) {
1396
+ this.#internals.setValidity(
1397
+ message ? { customError: true } : {},
1398
+ message
1399
+ );
1400
+ }
1401
+ }
1402
+ formResetCallback() {
1403
+ pendingRestores.delete(this);
1404
+ formCallback(this, "reset");
1405
+ }
1406
+ formDisabledCallback(disabled) {
1407
+ formCallback(this, "disabled", disabled);
1408
+ }
1409
+ formStateRestoreCallback(state, mode) {
1410
+ pendingRestores.delete(this);
1411
+ if (!restoreQuietly(this, state, mode)) {
1412
+ restoreOnceBound(this, state, mode);
1413
+ }
1414
+ }
1415
+ };
1416
+ }
1417
+ var defaultOf = (name) => `default${name[0].toUpperCase()}${name.slice(1)}`;
1418
+ function defineRootElement(tagName, primitive, config) {
1419
+ if (!claimTag(tagName)) {
1420
+ return;
1421
+ }
1422
+ setDisplay(tagName, config.display);
1423
+ const schema = {
1424
+ debug: "boolean",
1425
+ ...config.attributes
1426
+ };
1427
+ const state = config.state ?? {};
1428
+ const optionsOf = (el, properties, rendered) => {
1429
+ const options = readAttributes(el, schema);
1430
+ for (const name of rendered) {
1431
+ delete options[name];
1432
+ }
1433
+ for (const [name, value] of Object.entries(properties)) {
1434
+ if (value !== void 0) {
1435
+ options[name] = value;
1436
+ }
1437
+ }
1438
+ for (const name of Object.keys(state)) {
1439
+ if (!(name in options)) {
1440
+ continue;
1441
+ }
1442
+ const fallback = defaultOf(name);
1443
+ if (!(fallback in options)) {
1444
+ options[fallback] = options[name];
1445
+ }
1446
+ delete options[name];
1447
+ }
1448
+ return { ...options, ...config.options?.(el) };
1449
+ };
1450
+ customElements.define(
1451
+ tagName,
1452
+ class Owner extends (config.formAssociated ? formAssociated(HTMLElement) : HTMLElement) {
1453
+ static observedAttributes = [
1454
+ ...Object.keys(schema).map(kebab),
1455
+ ...semantics
1456
+ ];
1457
+ #view;
1458
+ get #instance() {
1459
+ return instances.get(this);
1460
+ }
1461
+ // The controller's methods. Internals stay out of reach.
1462
+ get api() {
1463
+ if (!this.#instance) {
1464
+ return void 0;
1465
+ }
1466
+ return this.#view ??= controllerView(
1467
+ this,
1468
+ this.#instance.api,
1469
+ config.api ?? []
1470
+ );
1471
+ }
1472
+ #parts = /* @__PURE__ */ new Set();
1473
+ #pending = /* @__PURE__ */ new Set();
1474
+ #connected = false;
1475
+ #rendering = false;
1476
+ #rendered = /* @__PURE__ */ new Set();
1477
+ #applying = /* @__PURE__ */ new Set();
1478
+ #stale = /* @__PURE__ */ new Set();
1479
+ // Left the page and destroyed its instance, which a reconnect replaces.
1480
+ #gone = false;
1481
+ #properties = {};
1482
+ // State properties set while there's no live instance, like before the
1483
+ // element connects, where the next instance starts.
1484
+ #state = {};
1485
+ // What a form-associated element reported to its form when it left,
1486
+ // which it restores when it's back.
1487
+ #saved;
1488
+ static {
1489
+ for (const [name, { get, set }] of Object.entries(state)) {
1490
+ Object.defineProperty(Owner.prototype, name, {
1491
+ get() {
1492
+ if (name in this.#state) {
1493
+ return this.#state[name];
1494
+ }
1495
+ return this.#instance ? get(this.#instance.api) : void 0;
1496
+ },
1497
+ set(value) {
1498
+ wroteFromScript(this);
1499
+ if (this.#instance && !this.#gone) {
1500
+ this.#quietly(() => set(this.#instance.api, value));
1501
+ } else {
1502
+ this.#state[name] = value;
1503
+ }
1504
+ }
1505
+ });
1506
+ }
1507
+ for (const name of config.properties ?? []) {
1508
+ Object.defineProperty(Owner.prototype, name, {
1509
+ get() {
1510
+ return this.#properties[name];
1511
+ },
1512
+ set(value) {
1513
+ if (Object.is(this.#properties[name], value)) {
1514
+ return;
1515
+ }
1516
+ this.#properties[name] = value;
1517
+ if (!this.#connected) {
1518
+ return;
1519
+ }
1520
+ this.#configure();
1521
+ this.#render();
1522
+ }
1523
+ });
1524
+ }
1525
+ reflectAttributes(
1526
+ Owner.prototype,
1527
+ schema,
1528
+ config.defaults
1529
+ );
1530
+ }
1531
+ // Options come from attributes and properties, with `defaults` over them.
1532
+ // Re-read them into the instance.
1533
+ #configure(defaults) {
1534
+ this.#instance?.setOptions(
1535
+ withEvents(
1536
+ this,
1537
+ {
1538
+ ...optionsOf(this, this.#properties, this.#rendered),
1539
+ ...defaults,
1540
+ id: this.#instance.id
1541
+ },
1542
+ config.silent,
1543
+ config.actions,
1544
+ config.events
1545
+ )
1546
+ );
1547
+ }
1548
+ attributeChangedCallback(name, previous, value) {
1549
+ markAuthored(this, name);
1550
+ if (semantics.includes(name)) {
1551
+ return;
1552
+ }
1553
+ const key = name.replace(
1554
+ /-(\w)/g,
1555
+ (_, char) => char.toUpperCase()
1556
+ );
1557
+ if (key in state && value !== previous && !this.#rendering) {
1558
+ wroteFromScript(this);
1559
+ }
1560
+ if (!this.#rendering || value === null) {
1561
+ this.#rendered.delete(key);
1562
+ } else if (previous === null) {
1563
+ this.#rendered.add(key);
1564
+ }
1565
+ if (!this.#connected) {
1566
+ return;
1567
+ }
1568
+ this.#configure();
1569
+ reconfigureInside(this);
1570
+ if (!(key in state) || value === previous) {
1571
+ return;
1572
+ }
1573
+ const type = schema[key];
1574
+ const cleared = type === "boolean" ? false : type === "list" ? [] : null;
1575
+ this.#quietly(
1576
+ () => state[key].set(
1577
+ this.#instance.api,
1578
+ value === null ? cleared : parseAttribute(type, value)
1579
+ )
1580
+ );
1581
+ }
1582
+ // State set from script commits without events, like a native input's
1583
+ // `value`, so a page that renders the state back never hears its own write.
1584
+ #quietly(write) {
1585
+ const nested = quiet.has(this);
1586
+ quiet.add(this);
1587
+ try {
1588
+ writeFromScript(this, write);
1589
+ } finally {
1590
+ if (!nested) {
1591
+ quiet.delete(this);
1592
+ validityChanged(this);
1593
+ }
1594
+ }
1595
+ }
1596
+ connectedCallback() {
1597
+ adoptStyles(this);
1598
+ if (this.#connected) {
1599
+ for (const part of this.#parts) {
1600
+ elementMoved(part.el);
1601
+ }
1602
+ if (config.options) {
1603
+ this.#configure();
1604
+ }
1605
+ return;
1606
+ }
1607
+ upgradeProperties(this, [
1608
+ ...Object.keys(state),
1609
+ ...config.properties ?? [],
1610
+ ...Object.keys(schema)
1611
+ ]);
1612
+ for (const [name, value] of Object.entries(config.host ?? {})) {
1613
+ if (!this.hasAttribute(name)) {
1614
+ this.setAttribute(name, value);
1615
+ }
1616
+ }
1617
+ const restore = this.#gone && !Object.keys(this.#state).length ? this.#saved : void 0;
1618
+ const starts = {};
1619
+ if (this.#gone && restore === void 0) {
1620
+ for (const [name, { get }] of Object.entries(state)) {
1621
+ starts[name] = get(this.#instance.api);
1622
+ }
1623
+ }
1624
+ Object.assign(starts, this.#state);
1625
+ this.#state = {};
1626
+ const last = Object.fromEntries(
1627
+ Object.entries(starts).map(([name, value]) => [
1628
+ defaultOf(name),
1629
+ value
1630
+ ])
1631
+ );
1632
+ if (this.#gone) {
1633
+ instances.delete(this);
1634
+ this.#view = void 0;
1635
+ this.#gone = false;
1636
+ this.#saved = void 0;
1637
+ }
1638
+ let instance = this.#instance;
1639
+ if (instance) {
1640
+ this.#configure();
1641
+ } else {
1642
+ instance = primitive(
1643
+ withEvents(
1644
+ this,
1645
+ {
1646
+ ...optionsOf(this, this.#properties, this.#rendered),
1647
+ ...last,
1648
+ id: this.id || `ui-sdk-${tagName.replace(/^ui-/, "")}-${++count}`
1649
+ },
1650
+ config.silent,
1651
+ config.actions,
1652
+ config.events
1653
+ )
1654
+ );
1655
+ instances.set(this, instance);
1656
+ }
1657
+ if (config.formAssociated && Object.keys(starts).length) {
1658
+ const base = instance.startState(
1659
+ optionsOf(this, this.#properties, this.#rendered)
1660
+ );
1661
+ this.#configure(
1662
+ Object.fromEntries(
1663
+ Object.keys(starts).map((name) => [defaultOf(name), base[name]])
1664
+ )
1665
+ );
1666
+ }
1667
+ this.#connected = true;
1668
+ if (config.options) {
1669
+ dependents.add(this);
1670
+ }
1671
+ if (config.self) {
1672
+ const el = boundElement(this, config.target);
1673
+ if (el) {
1674
+ this.#registerSelf(el);
1675
+ }
1676
+ }
1677
+ for (const [slot, find] of Object.entries(config.children ?? {})) {
1678
+ const child = find(this);
1679
+ if (child) {
1680
+ this.#registerChild(slot, child);
1681
+ } else if (!config.optionalChildren?.includes(slot)) ;
1682
+ }
1683
+ if (config.children || config.target) {
1684
+ this.#childObserver = new MutationObserver(() => {
1685
+ this.#syncChildren();
1686
+ this.#syncSelf();
1687
+ });
1688
+ this.#childObserver.observe(this, { childList: true });
1689
+ }
1690
+ this.#render();
1691
+ if (this.id) {
1692
+ const root = this.getRootNode();
1693
+ for (const el of root.querySelectorAll(
1694
+ `[for="${CSS.escape(this.id)}"]`
1695
+ )) {
1696
+ findOwnerAgain.get(el)?.();
1697
+ }
1698
+ }
1699
+ if (restore !== void 0) {
1700
+ restoreOnceBound(this, restore, "restore");
1701
+ }
1702
+ }
1703
+ #renderCleanup;
1704
+ // Runs only while connected, when the instance exists.
1705
+ #render() {
1706
+ this.#renderCleanup?.();
1707
+ this.#renderCleanup = config.render?.(this, this.#instance) || void 0;
1708
+ }
1709
+ reconfigure() {
1710
+ if (this.#connected) {
1711
+ this.#configure();
1712
+ }
1713
+ }
1714
+ #childParts = /* @__PURE__ */ new Map();
1715
+ #childObserver;
1716
+ #selfPart;
1717
+ #registerSelf(el) {
1718
+ this.#selfPart = { slot: config.self, el, props: {} };
1719
+ this.register(this.#selfPart);
1720
+ }
1721
+ // The element the own slot binds was replaced: the new one binds instead.
1722
+ #syncSelf() {
1723
+ if (!config.self || !config.target) {
1724
+ return;
1725
+ }
1726
+ const el = boundElement(this, config.target);
1727
+ if (el === this.#selfPart?.el) {
1728
+ return;
1729
+ }
1730
+ if (this.#selfPart) {
1731
+ this.unregister(this.#selfPart);
1732
+ }
1733
+ this.#selfPart = void 0;
1734
+ this.#configure();
1735
+ if (el) {
1736
+ this.#registerSelf(el);
1737
+ }
1738
+ }
1739
+ #registerChild(slot, el) {
1740
+ const part = {
1741
+ slot,
1742
+ el,
1743
+ props: config.childProps?.read?.(el) ?? {}
1744
+ };
1745
+ if (config.childProps) {
1746
+ part.observer = new MutationObserver(() => {
1747
+ part.props = config.childProps.read?.(el) ?? {};
1748
+ this.#configure();
1749
+ this.update(part, false);
1750
+ });
1751
+ part.observer.observe(el, {
1752
+ attributeFilter: config.childProps.attributes
1753
+ });
1754
+ }
1755
+ this.#childParts.set(slot, part);
1756
+ this.register(part);
1757
+ }
1758
+ #syncChildren() {
1759
+ for (const [slot, find] of Object.entries(config.children ?? {})) {
1760
+ const child = find(this);
1761
+ const current = this.#childParts.get(slot);
1762
+ if (current?.el === child) {
1763
+ continue;
1764
+ }
1765
+ if (current) {
1766
+ this.unregister(current);
1767
+ this.#childParts.delete(slot);
1768
+ }
1769
+ if (child) {
1770
+ this.#registerChild(slot, child);
1771
+ }
1772
+ }
1773
+ }
1774
+ disconnectedCallback() {
1775
+ whenGone(this, () => {
1776
+ this.#saved = formStates.get(this)?.();
1777
+ this.#renderCleanup?.();
1778
+ this.#renderCleanup = void 0;
1779
+ this.#childObserver?.disconnect();
1780
+ this.#childObserver = void 0;
1781
+ this.#childParts.clear();
1782
+ this.#selfPart = void 0;
1783
+ this.#connected = false;
1784
+ dependents.delete(this);
1785
+ for (const part of this.#parts) {
1786
+ this.unregister(part);
1787
+ }
1788
+ this.#instance?.destroy();
1789
+ this.#gone = true;
1790
+ });
1791
+ }
1792
+ // Parts register as they upgrade, in no useful order. They sync together a
1793
+ // microtask later in DOM order, so a trigger binds before an open popup.
1794
+ register(part) {
1795
+ this.#parts.add(part);
1796
+ registered.add(part);
1797
+ part.sync = () => this.#pending.has(part) || this.#sync(part);
1798
+ if (!this.#pending.size) {
1799
+ queueMicrotask(() => this.#flush());
1800
+ }
1801
+ this.#pending.add(part);
1802
+ }
1803
+ #flush() {
1804
+ const parts = inDocumentOrder([...this.#pending]);
1805
+ this.#pending.clear();
1806
+ for (const part of parts) {
1807
+ if (!this.#parts.has(part)) {
1808
+ continue;
1809
+ }
1810
+ if (part.reread) {
1811
+ part.props = part.reread();
1812
+ }
1813
+ if (part.feature) {
1814
+ this.#instance.use(part.feature);
1815
+ }
1816
+ this.#watch(part);
1817
+ this.#sync(part);
1818
+ }
1819
+ }
1820
+ // Syncs a part again when a change can affect it, so a highlight change
1821
+ // reaches the two items it moves between, not every part. Live state is
1822
+ // written by the core, so only changes to state that affects rendering
1823
+ // apply attributes again. A part that selects on a live key, like an
1824
+ // item on the highlight, hears that key alone, and has nothing to apply.
1825
+ #watch(part) {
1826
+ const instance = this.#instance;
1827
+ part.unwatch?.();
1828
+ const record = instance.part(part.slot, part.props);
1829
+ part.record = record;
1830
+ part.selected = selectedKeys(record);
1831
+ part.version = renderVersion(instance);
1832
+ part.unwatch = subscribe(record, (liveOnly) => {
1833
+ if (present(record) !== part.shown) {
1834
+ part.version = renderVersion(instance);
1835
+ return this.#sync(part);
1836
+ }
1837
+ if (liveOnly) {
1838
+ return;
1839
+ }
1840
+ const version = renderVersion(instance);
1841
+ if (version === part.version) {
1842
+ return;
1843
+ }
1844
+ part.version = version;
1845
+ this.#sync(part);
1846
+ });
1847
+ }
1848
+ unregister(part) {
1849
+ part.unwatch?.();
1850
+ part.unwatch = void 0;
1851
+ part.observer?.disconnect();
1852
+ part.observer = void 0;
1853
+ this.#unbind(part);
1854
+ releaseAttrs(part.el, this.#channel);
1855
+ part.disconnect?.();
1856
+ part.disconnect = void 0;
1857
+ this.#restore(part);
1858
+ this.#parts.delete(part);
1859
+ registered.delete(part);
1860
+ this.#pending.delete(part);
1861
+ handOver(part);
1862
+ }
1863
+ // Binds every bound part again, in DOM order, for what they found when
1864
+ // they bound, like the menubar a menu joins, which may upgrade later.
1865
+ rebind() {
1866
+ const parts = inDocumentOrder(
1867
+ [...this.#parts].filter((part) => !this.#pending.has(part))
1868
+ );
1869
+ for (const part of parts) {
1870
+ this.#unbind(part);
1871
+ }
1872
+ for (const part of parts) {
1873
+ this.#sync(part);
1874
+ }
1875
+ }
1876
+ // Props changed. A new key needs a new binding. Other parts can depend on
1877
+ // this one's props, like radio items on their group's value, or on its
1878
+ // attributes, like toolbar items on their group's `disabled`, so they
1879
+ // read their props again and sync too.
1880
+ update(part, rebind) {
1881
+ if (this.#pending.has(part)) {
1882
+ return;
1883
+ }
1884
+ this.#rewatch(part, rebind);
1885
+ this.#sync(part);
1886
+ for (const other of this.#parts) {
1887
+ if (other === part || this.#pending.has(other)) {
1888
+ continue;
1889
+ }
1890
+ if (other.reread) {
1891
+ const previous = other.props;
1892
+ other.props = other.reread();
1893
+ this.#rewatch(other, rekeyed(previous, other.props));
1894
+ }
1895
+ this.#sync(other);
1896
+ }
1897
+ reconfigureInside(part.el);
1898
+ }
1899
+ #rewatch(part, rebind) {
1900
+ if (rebind) {
1901
+ this.#unbind(part);
1902
+ }
1903
+ const record = this.#instance.part(part.slot, part.props);
1904
+ if (record !== part.record || selectedKeys(record) !== part.selected) {
1905
+ this.#watch(part);
1906
+ }
1907
+ }
1908
+ #sync(part) {
1909
+ if (this.#applying.has(part)) {
1910
+ return void this.#stale.add(part);
1911
+ }
1912
+ adoptStyles(part.el);
1913
+ const instance = this.#instance;
1914
+ const record = instance.part(part.slot, part.props);
1915
+ part.disconnect ??= connect(record, part.el);
1916
+ part.shown = present(record);
1917
+ if (part.shown) {
1918
+ const target = this.#portalTarget(part);
1919
+ if (target !== void 0 && this.#moves(part, target)) {
1920
+ this.#unbind(part);
1921
+ this.#move(part, target);
1922
+ }
1923
+ const attrs$1 = attrs(record);
1924
+ if (attrs$1.hidden === void 0 && (conditional(record) || "hidden" in attrs$1)) {
1925
+ part.el.removeAttribute("hidden");
1926
+ }
1927
+ this.#apply(part, attrs$1);
1928
+ if (!part.unbind) {
1929
+ this.#bind(part, record);
1930
+ }
1931
+ } else {
1932
+ if (part.unbind) {
1933
+ this.#apply(part, attrs(record));
1934
+ this.#unbind(part);
1935
+ }
1936
+ if (!part.el.hasAttribute("hidden")) {
1937
+ part.el.setAttribute("hidden", "");
1938
+ }
1939
+ const slot = attrs(record)["data-slot"];
1940
+ if (slot && !part.el.hasAttribute("data-slot")) {
1941
+ part.el.setAttribute("data-slot", slot);
1942
+ }
1943
+ this.#restore(part);
1944
+ }
1945
+ }
1946
+ // Binding and unbinding can change state, which syncs parts again. The part
1947
+ // counts as bound from the start, so a nested sync never binds it twice,
1948
+ // and as unbound from the start, so it never unbinds twice.
1949
+ #bind(part, record) {
1950
+ let cleanup;
1951
+ let unbound = false;
1952
+ part.unbind = () => {
1953
+ unbound = true;
1954
+ cleanup?.();
1955
+ };
1956
+ cleanup = bind(record, part.el);
1957
+ if (unbound) {
1958
+ cleanup();
1959
+ }
1960
+ }
1961
+ #unbind(part) {
1962
+ const unbind = part.unbind;
1963
+ part.unbind = void 0;
1964
+ unbind?.();
1965
+ }
1966
+ // Where a portaled slot's part belongs: a container, or null for in
1967
+ // place. Undefined for slots that never move.
1968
+ #portalTarget(part) {
1969
+ if (!config.portal?.slots.includes(part.slot)) {
1970
+ return void 0;
1971
+ }
1972
+ return portalTarget(config.portal.container(this, part));
1973
+ }
1974
+ #moves(part, target) {
1975
+ return target ? part.el.parentNode !== target : !!part.placeholder;
1976
+ }
1977
+ // Moves a part into its container, or back in place for null.
1978
+ #move(part, target) {
1979
+ this.#restore(part);
1980
+ if (!target) {
1981
+ return;
1982
+ }
1983
+ part.placeholder = document.createComment(`${tagName} ${part.slot}`);
1984
+ part.el.replaceWith(part.placeholder);
1985
+ target.appendChild(part.el);
1986
+ portals.set(part.el, target);
1987
+ }
1988
+ // An attribute the owner writes on itself is state, not an option, like a
1989
+ // grouped checkbox's `disabled` from its group, so it never disables it for good.
1990
+ #apply(part, attrs) {
1991
+ const inner = innerPart(part, this);
1992
+ if (inner?.dataSlot) {
1993
+ attrs = { ...attrs, "data-slot": inner.dataSlot };
1994
+ }
1995
+ part.dataSlot = attrs["data-slot"];
1996
+ const rendering = this.#rendering;
1997
+ this.#rendering = part.el === this;
1998
+ this.#applying.add(part);
1999
+ try {
2000
+ applyAttrs(part.el, attrs, this.#channel);
2001
+ } finally {
2002
+ this.#rendering = rendering;
2003
+ this.#applying.delete(part);
2004
+ }
2005
+ if (this.#stale.delete(part)) {
2006
+ this.#sync(part);
2007
+ }
2008
+ }
2009
+ // What the owner writes on its parts' elements. By host, not instance, so
2010
+ // one put back on the page replaces what its last instance wrote, like its parts' ids.
2011
+ get #channel() {
2012
+ return `render:${autoId(this)}`;
2013
+ }
2014
+ #restore(part) {
2015
+ if (!part.placeholder) {
2016
+ return;
2017
+ }
2018
+ part.placeholder.replaceWith(part.el);
2019
+ part.placeholder = void 0;
2020
+ portals.delete(part.el);
2021
+ }
2022
+ }
2023
+ );
2024
+ }
2025
+ function definePartElement(tagName, config) {
2026
+ if (!claimTag(tagName)) {
2027
+ return;
2028
+ }
2029
+ const schema = config.props ?? {};
2030
+ setDisplay(tagName, config.display, "align" in schema);
2031
+ customElements.define(
2032
+ tagName,
2033
+ class PartElement extends (config.formAssociated ? formAssociated(HTMLElement) : HTMLElement) {
2034
+ static observedAttributes = [
2035
+ ...Object.keys(schema).map(kebab),
2036
+ "for",
2037
+ ...semantics
2038
+ ];
2039
+ #owner;
2040
+ #part;
2041
+ #properties = {};
2042
+ constructor() {
2043
+ super();
2044
+ findOwnerAgain.set(this, () => {
2045
+ if (this.isConnected) {
2046
+ this.connectedCallback();
2047
+ }
2048
+ });
2049
+ }
2050
+ static {
2051
+ for (const name of config.properties ?? []) {
2052
+ Object.defineProperty(PartElement.prototype, name, {
2053
+ get() {
2054
+ return this.#properties[name] ?? (schema[name] && readAttribute(this, name, schema[name]));
2055
+ },
2056
+ set(value) {
2057
+ this.#properties[name] = value;
2058
+ this.attributeChangedCallback("");
2059
+ }
2060
+ });
2061
+ }
2062
+ reflectAttributes(PartElement.prototype, schema, config.defaults);
2063
+ }
2064
+ // What the element says itself, its attributes and properties, wins
2065
+ // over what its surroundings give it.
2066
+ #props() {
2067
+ const props = {
2068
+ ...config.context?.(this),
2069
+ ...readAttributes(this, schema)
2070
+ };
2071
+ for (const name of config.properties ?? []) {
2072
+ if (this.#properties[name] !== void 0) {
2073
+ props[name] = this.#properties[name];
2074
+ }
2075
+ }
2076
+ for (const [name, { slot, prop }] of Object.entries(
2077
+ config.from ?? {}
2078
+ )) {
2079
+ props[name] ??= propsAround(this, slot, this.#owner)?.[prop];
2080
+ }
2081
+ for (const name of config.ids ?? []) {
2082
+ props[name] ??= autoId(this);
2083
+ }
2084
+ if (props.value === void 0 && props.id === void 0) {
2085
+ props.id = autoId(this);
2086
+ }
2087
+ if (config.keyed && hasRichValue(props)) {
2088
+ props.id ??= instanceOf(this.#owner)?.api.internal.keyOf(
2089
+ props.value
2090
+ );
2091
+ }
2092
+ return withEvents(this, props, [], config.actions);
2093
+ }
2094
+ // Watches the children for the element the part binds, which can come
2095
+ // later or be replaced, like a framework's conditional content.
2096
+ #children;
2097
+ connectedCallback() {
2098
+ upgradeProperties(this, [
2099
+ ...config.properties ?? [],
2100
+ ...Object.keys(schema)
2101
+ ]);
2102
+ adoptStyles(this);
2103
+ if ((config.target || this.hasAttribute("as-child")) && !this.#children) {
2104
+ this.#children = new MutationObserver(() => this.#retarget());
2105
+ this.#children.observe(this, { childList: true });
2106
+ }
2107
+ const owner = findOwner(this, config.owner) ?? this.#owner;
2108
+ if (!owner) {
2109
+ return queueMicrotask(() => this.#findOwnerLater());
2110
+ }
2111
+ if (!("register" in owner)) {
2112
+ customElements.whenDefined(owner.localName).then(() => this.isConnected && this.connectedCallback());
2113
+ return;
2114
+ }
2115
+ if (owner === this.#owner && this.#part && registered.has(this.#part)) {
2116
+ return;
2117
+ }
2118
+ if (this.#owner && this.#part) {
2119
+ this.#owner.unregister(this.#part);
2120
+ }
2121
+ const el = boundElement(this, config.target);
2122
+ if (!el) {
2123
+ return queueMicrotask(() => {
2124
+ if (this.isConnected && !this.#part && !boundElement(this, config.target)) ;
2125
+ });
2126
+ }
2127
+ if (!this.#part) {
2128
+ config.render?.(this);
2129
+ if (this.#part) {
2130
+ return;
2131
+ }
2132
+ }
2133
+ this.#owner = owner;
2134
+ this.#part = {
2135
+ slot: config.slot,
2136
+ feature: config.feature,
2137
+ el,
2138
+ props: this.#props(),
2139
+ reread: (config.context || config.from) && (() => this.#props()),
2140
+ keyed: config.keyed
2141
+ };
2142
+ partOwners.set(this, owner);
2143
+ slotParts.set(this, this.#part);
2144
+ owner.register(this.#part);
2145
+ }
2146
+ // Put back on the page, a part can connect before what leads to its owner
2147
+ // does, like an item in a list its owner renders again. Warned only when
2148
+ // the owner is still missing once the task's other elements connected.
2149
+ #findOwnerLater() {
2150
+ if (!this.isConnected || this.#owner) {
2151
+ return;
2152
+ }
2153
+ if (findOwner(this, config.owner)) {
2154
+ this.connectedCallback();
2155
+ } else if (config.alone) {
2156
+ config.alone(boundElement(this, config.target) ?? this, this);
2157
+ } else if (!this.hasAttribute("for")) {
2158
+ warn(`<${tagName}> must be inside ${config.owner}.`);
2159
+ }
2160
+ }
2161
+ // The element the part binds came, left or was replaced: the part lets go
2162
+ // of the old one and registers again with what's there now. One the owner
2163
+ // moved into a portal, like an input a sheet puts in its header, stays bound.
2164
+ #retarget() {
2165
+ const old = this.#part?.el;
2166
+ if (!this.isConnected || old && portals.has(old)) {
2167
+ return;
2168
+ }
2169
+ const el = boundElement(this, config.target);
2170
+ if (el === (old ?? null)) {
2171
+ return;
2172
+ }
2173
+ if (this.#owner && this.#part) {
2174
+ this.#owner.unregister(this.#part);
2175
+ }
2176
+ this.#owner = void 0;
2177
+ this.#part = void 0;
2178
+ if (el) {
2179
+ this.connectedCallback();
2180
+ }
2181
+ }
2182
+ disconnectedCallback() {
2183
+ whenGone(this, () => {
2184
+ this.#children?.disconnect();
2185
+ this.#children = void 0;
2186
+ if (this.#owner && this.#part) {
2187
+ this.#owner.unregister(this.#part);
2188
+ }
2189
+ partOwners.delete(this);
2190
+ slotParts.delete(this);
2191
+ this.#owner = void 0;
2192
+ this.#part = void 0;
2193
+ });
2194
+ }
2195
+ attributeChangedCallback(name) {
2196
+ markAuthored(this, name);
2197
+ if (semantics.includes(name)) {
2198
+ return;
2199
+ }
2200
+ if (name === "for") {
2201
+ if (!this.isConnected) {
2202
+ return;
2203
+ }
2204
+ if (!findOwner(this, config.owner) && this.#owner && this.#part) {
2205
+ this.#owner.unregister(this.#part);
2206
+ this.#owner = void 0;
2207
+ partOwners.delete(this);
2208
+ }
2209
+ this.connectedCallback();
2210
+ return;
2211
+ }
2212
+ if (!this.#owner || !this.#part) {
2213
+ if (config.alone && this.isConnected && !findOwner(this, config.owner)) {
2214
+ config.alone(boundElement(this, config.target) ?? this, this);
2215
+ }
2216
+ return;
2217
+ }
2218
+ const previous = this.#part.props;
2219
+ this.#part.props = this.#props();
2220
+ const next = this.#part.props;
2221
+ const rebind = rekeyed(previous, next) || !!config.rebind?.some((name2) => previous[name2] !== next[name2]);
2222
+ this.#owner.update(this.#part, rebind);
2223
+ config.changed?.(this);
2224
+ }
2225
+ }
2226
+ );
2227
+ }
2228
+ var rootTags = /* @__PURE__ */ new WeakMap();
2229
+ function elementProps(props, schema, kinds = {}) {
2230
+ const attributes = {};
2231
+ const properties = [];
2232
+ const ids = [];
2233
+ const actions = [];
2234
+ let keyed = false;
2235
+ const from = {};
2236
+ for (const [name, spec] of Object.entries({ ...props, ...kinds })) {
2237
+ if (!spec) {
2238
+ continue;
2239
+ }
2240
+ if (typeof spec === "object") {
2241
+ const [slot, prop = name] = spec.from.split(".");
2242
+ if (slot in schema.slots) {
2243
+ from[name] = { slot, prop };
2244
+ }
2245
+ if (!(name in kinds)) {
2246
+ continue;
2247
+ }
2248
+ }
2249
+ const kind = typeof spec === "object" ? spec.kind : spec;
2250
+ if (kind === "value") {
2251
+ properties.push(name);
2252
+ } else if (kind === "action") {
2253
+ actions.push(name);
2254
+ } else if (kind === "id") {
2255
+ ids.push(name);
2256
+ } else if (kind === "key") {
2257
+ keyed = true;
2258
+ }
2259
+ if (kind === "value" || kind === "action" || kind === "callback") {
2260
+ continue;
2261
+ }
2262
+ if (name !== "id" || name in kinds) {
2263
+ attributes[name] = kind === "id" || kind === "key" ? "string" : kind;
2264
+ }
2265
+ }
2266
+ return {
2267
+ attributes,
2268
+ properties,
2269
+ ids,
2270
+ actions,
2271
+ keyed,
2272
+ from: Object.keys(from).length ? from : void 0
2273
+ };
2274
+ }
2275
+ var tagOf = (tagOrOptions) => typeof tagOrOptions === "string" ? { tag: tagOrOptions } : tagOrOptions;
2276
+ function partElement(primitive, key, tagOrOptions, root) {
2277
+ const schema = schemaOf(primitive);
2278
+ if (key === "root") {
2279
+ const {
2280
+ tag: tag2,
2281
+ self,
2282
+ kinds: kinds2,
2283
+ properties: properties2 = [],
2284
+ ...options2
2285
+ } = tagOf(tagOrOptions);
2286
+ rootTags.set(primitive, [
2287
+ .../* @__PURE__ */ new Set([...rootTags.get(primitive) ?? [], tag2])
2288
+ ]);
2289
+ const { debug: _debug, ...optionSchema } = schema.options;
2290
+ const props2 = elementProps(optionSchema, schema, kinds2);
2291
+ const config2 = {
2292
+ ...options2,
2293
+ self: self ?? ("root" in schema.slots && !options2.children?.root ? "root" : void 0),
2294
+ attributes: props2.attributes,
2295
+ // Live state has its own property.
2296
+ properties: [.../* @__PURE__ */ new Set([...props2.properties, ...properties2])].filter(
2297
+ (name) => !options2.state?.[name]
2298
+ ),
2299
+ actions: props2.actions
2300
+ };
2301
+ return { kind: "owner", key, tagName: tag2, config: config2 };
2302
+ }
2303
+ const {
2304
+ tag,
2305
+ slot = key,
2306
+ owners = [],
2307
+ kinds,
2308
+ properties = [],
2309
+ ...options
2310
+ } = tagOf(tagOrOptions);
2311
+ const roots = rootTags.get(primitive);
2312
+ if (!roots) {
2313
+ throw new Error(
2314
+ `<${tag}> is a part of ${primitive.name}: define its root first.`
2315
+ );
2316
+ }
2317
+ const slotSchema = schema.slots[slot] ?? (options.feature?.slots[slot] && (options.feature.slots[slot].props ?? {}));
2318
+ if (!slotSchema) {
2319
+ throw new Error(`<${tag}>: ${primitive.name} has no ${slot} slot.`);
2320
+ }
2321
+ const { attributes, ...props } = elementProps(slotSchema, schema, kinds);
2322
+ const config = {
2323
+ ...options,
2324
+ slot,
2325
+ owner: [.../* @__PURE__ */ new Set([...root ? [root] : [], ...roots, ...owners])].join(
2326
+ ", "
2327
+ ),
2328
+ props: attributes,
2329
+ ...props,
2330
+ properties: [.../* @__PURE__ */ new Set([...props.properties, ...properties])]
2331
+ };
2332
+ return { kind: "part", key, tagName: tag, config };
2333
+ }
2334
+ function partElements(primitive, tags) {
2335
+ const { root, ...parts } = tags;
2336
+ const owner = partElement(primitive, "root", root);
2337
+ return [
2338
+ owner,
2339
+ ...Object.entries(
2340
+ parts
2341
+ ).flatMap(
2342
+ ([key, tag]) => tag ? [partElement(primitive, key, tag, owner.tagName)] : []
2343
+ )
2344
+ ];
2345
+ }
2346
+ function defineElement(primitive, element) {
2347
+ if (element.kind === "owner") {
2348
+ defineRootElement(element.tagName, primitive, element.config);
2349
+ } else {
2350
+ definePartElement(element.tagName, element.config);
2351
+ }
2352
+ }
2353
+ var pascal = (name) => name.replace(/(^|-)(\w)/g, (_, _dash, char) => char.toUpperCase());
2354
+ function createParts(primitive, tags) {
2355
+ const parts = {};
2356
+ for (const element of partElements(primitive, tags)) {
2357
+ defineElement(primitive, element);
2358
+ parts[pascal(element.key)] = typeof customElements === "undefined" ? void 0 : customElements.get(element.tagName);
2359
+ }
2360
+ return parts;
2361
+ }
2362
+
2363
+ export { createChange as a, announcePending as b, createParts as c, definePrimitive as d, wrappedButton as e, actionOf as f, writeValue as g, watchValue as h, inputSource as i, afterReset as j, log as l, runAction as r, trusted as t, wrappedChild as w };
2364
+ //# sourceMappingURL=define-element-DwIWgY_Y.js.map