@vonage/vivid 5.2.0 → 5.4.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 (433) hide show
  1. package/accordion-item/definition.cjs +2 -1
  2. package/accordion-item/definition.js +3 -2
  3. package/alert/definition.cjs +1 -1
  4. package/alert/definition.js +2 -2
  5. package/alert/index.cjs +1 -1
  6. package/alert/index.js +1 -1
  7. package/audio-player/definition.cjs +4 -2
  8. package/audio-player/definition.js +4 -2
  9. package/audio-player/index.cjs +5 -3
  10. package/audio-player/index.js +5 -3
  11. package/badge/definition.js +1 -1
  12. package/badge/index.cjs +2 -2
  13. package/badge/index.js +4 -4
  14. package/banner/definition.js +1 -1
  15. package/banner/index.cjs +3 -3
  16. package/banner/index.js +6 -6
  17. package/breadcrumb-item/index.cjs +1 -1
  18. package/breadcrumb-item/index.js +1 -1
  19. package/bundled/affix.cjs +7 -7
  20. package/bundled/affix.js +5 -5
  21. package/bundled/anchored.cjs +1 -1
  22. package/bundled/anchored.js +6 -6
  23. package/bundled/attribute-binding-behaviour.cjs +1 -1
  24. package/bundled/attribute-binding-behaviour.js +15 -13
  25. package/bundled/base-color-picker.cjs +13 -0
  26. package/bundled/base-color-picker.js +194 -0
  27. package/bundled/button.cjs +1 -1
  28. package/bundled/button.js +2 -2
  29. package/bundled/calendar-picker.template.cjs +7 -7
  30. package/bundled/calendar-picker.template.js +118 -118
  31. package/bundled/char-count.cjs +1 -1
  32. package/bundled/char-count.js +1 -1
  33. package/bundled/children.cjs +1 -1
  34. package/bundled/children.js +28 -20
  35. package/bundled/definition.cjs +3 -3
  36. package/bundled/definition.js +38 -38
  37. package/bundled/definition10.cjs +72 -18
  38. package/bundled/definition10.js +351 -65
  39. package/bundled/definition11.cjs +19 -10
  40. package/bundled/definition11.js +217 -36
  41. package/bundled/definition12.cjs +10 -1
  42. package/bundled/definition12.js +38 -14
  43. package/bundled/definition13.cjs +1 -73
  44. package/bundled/definition13.js +15 -354
  45. package/bundled/definition15.cjs +1 -1
  46. package/bundled/definition15.js +1 -1
  47. package/bundled/definition16.cjs +2 -2
  48. package/bundled/definition16.js +8 -8
  49. package/bundled/definition17.cjs +7 -7
  50. package/bundled/definition17.js +17 -17
  51. package/bundled/definition19.cjs +23 -24
  52. package/bundled/definition19.js +151 -163
  53. package/bundled/definition2.cjs +9 -5
  54. package/bundled/definition2.js +21 -17
  55. package/bundled/definition22.cjs +9 -9
  56. package/bundled/definition22.js +31 -31
  57. package/bundled/definition3.cjs +1 -1
  58. package/bundled/definition3.js +1 -1
  59. package/bundled/definition6.cjs +3 -3
  60. package/bundled/definition6.js +28 -28
  61. package/bundled/definition7.cjs +1 -1
  62. package/bundled/definition7.js +6 -6
  63. package/bundled/definition8.cjs +2 -2
  64. package/bundled/definition8.js +4 -4
  65. package/bundled/definition9.cjs +5 -5
  66. package/bundled/definition9.js +394 -392
  67. package/bundled/delegates-aria.cjs +1 -1
  68. package/bundled/delegates-aria.js +59 -46
  69. package/bundled/form-associated.cjs +1 -1
  70. package/bundled/form-associated.js +3 -3
  71. package/bundled/host-semantics.cjs +1 -1
  72. package/bundled/host-semantics.js +48 -34
  73. package/bundled/listbox.cjs +1 -1
  74. package/bundled/listbox.js +82 -102
  75. package/bundled/localized.cjs +1 -1
  76. package/bundled/localized.js +51 -36
  77. package/bundled/mixins.cjs +18 -18
  78. package/bundled/mixins.js +99 -93
  79. package/bundled/normalize.cjs +1 -0
  80. package/bundled/normalize.js +7 -0
  81. package/bundled/picker-field.template.cjs +1 -1
  82. package/bundled/picker-field.template.js +4 -4
  83. package/bundled/ref.cjs +1 -1
  84. package/bundled/ref.js +8 -25
  85. package/bundled/repeat.cjs +1 -1
  86. package/bundled/repeat.js +459 -233
  87. package/bundled/slider.template.cjs +1 -1
  88. package/bundled/slider.template.js +2 -2
  89. package/bundled/slotted.cjs +1 -1
  90. package/bundled/slotted.js +62 -45
  91. package/bundled/time-selection-picker.template.cjs +1 -1
  92. package/bundled/time-selection-picker.template.js +5 -5
  93. package/bundled/vivid-element.cjs +5 -1
  94. package/bundled/vivid-element.js +2159 -1162
  95. package/bundled/when.cjs +1 -1
  96. package/bundled/when.js +8 -7
  97. package/calendar/definition.cjs +1 -1
  98. package/calendar/definition.js +2 -2
  99. package/calendar/index.cjs +1 -1
  100. package/calendar/index.js +15 -15
  101. package/calendar-event/index.cjs +1 -1
  102. package/calendar-event/index.js +1 -1
  103. package/card/definition.cjs +11 -3
  104. package/card/definition.js +11 -3
  105. package/card/index.cjs +19 -11
  106. package/card/index.js +35 -27
  107. package/color-picker/definition.cjs +1079 -0
  108. package/color-picker/definition.js +1073 -0
  109. package/color-picker/index.cjs +127 -0
  110. package/color-picker/index.js +726 -0
  111. package/combobox/definition.cjs +8 -28
  112. package/combobox/definition.js +10 -30
  113. package/combobox/index.cjs +7 -7
  114. package/combobox/index.js +60 -74
  115. package/contextual-help/index.cjs +1 -1
  116. package/contextual-help/index.js +1 -1
  117. package/custom-elements.json +1670 -163
  118. package/data-grid/definition.cjs +862 -27
  119. package/data-grid/definition.js +863 -28
  120. package/data-grid/index.cjs +25 -25
  121. package/data-grid/index.js +175 -168
  122. package/date-picker/definition.cjs +1 -1
  123. package/date-picker/definition.js +1 -1
  124. package/date-picker/index.cjs +1 -1
  125. package/date-picker/index.js +2 -2
  126. package/date-range-picker/definition.cjs +1 -1
  127. package/date-range-picker/definition.js +1 -1
  128. package/date-range-picker/index.cjs +1 -1
  129. package/date-range-picker/index.js +2 -2
  130. package/date-time-picker/definition.cjs +1 -1
  131. package/date-time-picker/definition.js +1 -1
  132. package/date-time-picker/index.cjs +1 -1
  133. package/date-time-picker/index.js +2 -2
  134. package/dial-pad/definition.cjs +4 -0
  135. package/dial-pad/definition.js +4 -0
  136. package/dial-pad/index.cjs +3 -3
  137. package/dial-pad/index.js +42 -39
  138. package/dialog/definition.cjs +6 -3
  139. package/dialog/definition.js +6 -3
  140. package/dialog/index.cjs +22 -19
  141. package/dialog/index.js +48 -45
  142. package/elevation/definition.cjs +1 -1
  143. package/elevation/definition.js +1 -1
  144. package/empty-state/definition.cjs +7 -2
  145. package/empty-state/definition.js +7 -2
  146. package/empty-state/index.cjs +10 -5
  147. package/empty-state/index.js +18 -13
  148. package/fab/definition.js +1 -1
  149. package/fab/index.cjs +2 -2
  150. package/fab/index.js +4 -4
  151. package/file-picker/definition.cjs +2 -2
  152. package/file-picker/definition.js +3 -3
  153. package/file-picker/index.cjs +1 -1
  154. package/file-picker/index.js +4 -4
  155. package/header/definition.cjs +1 -1
  156. package/header/definition.js +1 -1
  157. package/icon/definition.cjs +10 -6
  158. package/icon/definition.js +10 -6
  159. package/index.cjs +7 -4
  160. package/index.js +3 -3
  161. package/lib/accordion/accordion.d.ts +1 -1
  162. package/lib/accordion/definition.d.ts +1 -1
  163. package/lib/accordion-item/accordion-item.d.ts +2 -2
  164. package/lib/action-group/action-group.d.ts +2 -2
  165. package/lib/alert/alert.d.ts +4 -4
  166. package/lib/audio-player/audio-player.d.ts +3 -3
  167. package/lib/avatar/avatar.d.ts +2 -2
  168. package/lib/badge/badge.d.ts +2 -2
  169. package/lib/banner/banner.d.ts +6 -6
  170. package/lib/breadcrumb/breadcrumb.d.ts +2 -2
  171. package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
  172. package/lib/button/button.d.ts +6 -6
  173. package/lib/button/button.template.d.ts +2 -1
  174. package/lib/calendar/calendar.d.ts +1 -1
  175. package/lib/calendar-event/calendar-event.d.ts +2 -2
  176. package/lib/card/card.d.ts +2 -2
  177. package/lib/checkbox/checkbox.d.ts +12 -12
  178. package/lib/color-picker/color-picker.d.ts +2420 -0
  179. package/lib/color-picker/color-picker.template.d.ts +3 -0
  180. package/lib/color-picker/definition.d.ts +4 -0
  181. package/lib/color-picker/locale.d.ts +9 -0
  182. package/lib/combobox/combobox.d.ts +15 -14
  183. package/lib/combobox/combobox.options.d.ts +1 -1
  184. package/lib/components.d.ts +1 -0
  185. package/lib/data-grid/data-grid-cell.d.ts +4 -4
  186. package/lib/data-grid/data-grid-row.d.ts +3 -4
  187. package/lib/data-grid/data-grid.d.ts +1 -2
  188. package/lib/date-picker/date-picker.d.ts +54 -54
  189. package/lib/date-range-picker/date-range-picker.d.ts +28 -28
  190. package/lib/date-time-picker/date-time-picker.d.ts +56 -56
  191. package/lib/dial-pad/dial-pad.d.ts +3 -2
  192. package/lib/dialog/dialog.d.ts +4 -4
  193. package/lib/divider/divider.d.ts +3 -3
  194. package/lib/fab/fab.d.ts +2 -2
  195. package/lib/file-picker/file-picker.d.ts +14 -14
  196. package/lib/header/header.d.ts +2 -2
  197. package/lib/menu/menu.d.ts +4 -4
  198. package/lib/menu-item/menu-item-role.d.ts +1 -1
  199. package/lib/menu-item/menu-item.d.ts +4 -4
  200. package/lib/nav/nav.d.ts +2 -2
  201. package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
  202. package/lib/nav-item/nav-item.d.ts +4 -4
  203. package/lib/note/note.d.ts +2 -2
  204. package/lib/number-field/number-field.d.ts +18 -18
  205. package/lib/option/option.d.ts +4 -4
  206. package/lib/pagination/pagination.d.ts +2 -2
  207. package/lib/popup/popup.d.ts +1 -1
  208. package/lib/progress/progress.d.ts +2 -2
  209. package/lib/progress-ring/progress-ring.d.ts +2 -2
  210. package/lib/radio/radio.d.ts +6 -6
  211. package/lib/radio-group/radio-group.d.ts +2 -2
  212. package/lib/range-slider/range-slider.d.ts +6 -6
  213. package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
  214. package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
  215. package/lib/searchable-select/locale.d.ts +4 -0
  216. package/lib/searchable-select/option-tag.d.ts +2 -2
  217. package/lib/searchable-select/searchable-select.d.ts +21 -18
  218. package/lib/select/select.d.ts +19 -17
  219. package/lib/selectable-box/selectable-box.d.ts +2 -2
  220. package/lib/simple-color-picker/locale.d.ts +0 -1
  221. package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
  222. package/lib/slider/slider.d.ts +7 -7
  223. package/lib/split-button/split-button.d.ts +6 -6
  224. package/lib/switch/switch.d.ts +4 -4
  225. package/lib/tab/tab.d.ts +6 -6
  226. package/lib/tab-panel/tab-panel.d.ts +2 -2
  227. package/lib/tabs/tabs.d.ts +2 -2
  228. package/lib/tag/tag.d.ts +6 -6
  229. package/lib/tag-group/tag-group.d.ts +2 -2
  230. package/lib/tag-name-map.d.ts +2 -1
  231. package/lib/text-area/text-area.d.ts +17 -17
  232. package/lib/text-field/text-field.d.ts +19 -19
  233. package/lib/time-picker/time-picker.d.ts +28 -28
  234. package/lib/toggletip/toggletip.d.ts +4 -4
  235. package/lib/tooltip/tooltip.d.ts +2 -2
  236. package/lib/tree-item/tree-item.d.ts +4 -4
  237. package/lib/tree-view/tree-view.d.ts +2 -2
  238. package/lib/video-player/video-player.d.ts +2 -2
  239. package/locales/de-DE.cjs +17 -2
  240. package/locales/de-DE.js +17 -2
  241. package/locales/en-GB.cjs +17 -2
  242. package/locales/en-GB.js +17 -2
  243. package/locales/en-US.cjs +17 -2
  244. package/locales/en-US.js +17 -2
  245. package/locales/ja-JP.cjs +17 -2
  246. package/locales/ja-JP.js +17 -2
  247. package/locales/zh-CN.cjs +17 -2
  248. package/locales/zh-CN.js +17 -2
  249. package/menu/definition.cjs +6 -6
  250. package/menu/definition.js +7 -7
  251. package/nav-disclosure/definition.js +1 -1
  252. package/nav-item/definition.js +1 -1
  253. package/note/definition.js +1 -1
  254. package/note/index.cjs +2 -2
  255. package/note/index.js +4 -4
  256. package/number-field/definition.cjs +1 -1
  257. package/number-field/definition.js +3 -3
  258. package/number-field/index.cjs +5 -5
  259. package/number-field/index.js +21 -21
  260. package/option/definition.cjs +6 -77
  261. package/option/definition.js +3 -78
  262. package/option/index.cjs +1 -1
  263. package/option/index.js +1 -1
  264. package/package.json +34 -8
  265. package/pagination/definition.cjs +2 -1
  266. package/pagination/definition.js +2 -1
  267. package/pagination/index.cjs +12 -12
  268. package/pagination/index.js +59 -59
  269. package/popup/definition.cjs +2 -2
  270. package/popup/definition.js +2 -2
  271. package/progress/index.cjs +1 -1
  272. package/progress/index.js +1 -1
  273. package/radio/definition.cjs +9 -9
  274. package/radio/definition.js +10 -10
  275. package/radio-group/definition.cjs +2 -1
  276. package/radio-group/definition.js +2 -1
  277. package/radio-group/index.cjs +5 -5
  278. package/radio-group/index.js +80 -77
  279. package/range-slider/definition.cjs +1 -1
  280. package/range-slider/definition.js +1 -1
  281. package/range-slider/index.cjs +1 -1
  282. package/range-slider/index.js +1 -1
  283. package/rich-text-editor/definition.cjs +3 -4
  284. package/rich-text-editor/definition.js +3 -4
  285. package/rich-text-editor/index.cjs +27 -27
  286. package/rich-text-editor/index.js +1208 -1198
  287. package/searchable-select/definition.cjs +106 -14
  288. package/searchable-select/definition.js +107 -15
  289. package/searchable-select/index.cjs +81 -69
  290. package/searchable-select/index.js +362 -276
  291. package/select/definition.cjs +25 -42
  292. package/select/definition.js +26 -43
  293. package/selectable-box/definition.cjs +1 -1
  294. package/selectable-box/definition.js +1 -1
  295. package/selectable-box/index.cjs +3 -3
  296. package/selectable-box/index.js +20 -20
  297. package/shared/aria/aria-change-subscription.d.ts +0 -1
  298. package/shared/aria/aria-mixin.d.ts +3 -3
  299. package/shared/aria/delegate-aria-behavior.d.ts +5 -10
  300. package/shared/aria/delegates-aria.d.ts +3 -3
  301. package/shared/aria/host-semantics-behavior.d.ts +5 -8
  302. package/shared/aria/host-semantics.d.ts +3 -3
  303. package/shared/color-picker/base-color-picker.d.ts +436 -0
  304. package/shared/color-picker/index.d.ts +1 -0
  305. package/shared/color-picker/locale.d.ts +3 -0
  306. package/shared/color-picker/utils.d.ts +1 -0
  307. package/shared/deprecation/replaced-props.d.ts +317 -2
  308. package/shared/design-system/defineVividComponent.d.ts +2 -2
  309. package/shared/feedback/feedback-message.d.ts +2 -2
  310. package/shared/feedback/mixins.d.ts +4 -4
  311. package/shared/foundation/button/button.d.ts +4 -4
  312. package/shared/foundation/form-associated/form-associated.d.ts +4 -4
  313. package/shared/foundation/listbox/listbox.d.ts +4 -0
  314. package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
  315. package/shared/localization/Locale.d.ts +4 -0
  316. package/shared/patterns/affix.d.ts +4 -4
  317. package/shared/patterns/anchored.d.ts +4 -4
  318. package/shared/patterns/char-count/char-count.d.ts +2 -2
  319. package/shared/patterns/form-elements/form-element.d.ts +4 -4
  320. package/shared/patterns/form-elements/with-contextual-help.d.ts +6 -6
  321. package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
  322. package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
  323. package/shared/patterns/linkable.d.ts +2 -2
  324. package/shared/patterns/localized.d.ts +2 -2
  325. package/shared/patterns/trapped-focus.d.ts +2 -2
  326. package/shared/picker-field/mixins/calendar-picker.d.ts +14 -14
  327. package/shared/picker-field/mixins/calendar-picker.template.d.ts +14 -14
  328. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
  329. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +28 -28
  330. package/shared/picker-field/mixins/single-date-picker.d.ts +40 -40
  331. package/shared/picker-field/mixins/single-value-picker.d.ts +12 -12
  332. package/shared/picker-field/mixins/time-selection-picker.d.ts +29 -29
  333. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +28 -28
  334. package/shared/picker-field/picker-field.d.ts +14 -14
  335. package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
  336. package/shared/templating/render-in-light-dom.d.ts +13 -12
  337. package/side-drawer/index.cjs +1 -1
  338. package/side-drawer/index.js +1 -1
  339. package/simple-color-picker/definition.cjs +29 -216
  340. package/simple-color-picker/definition.js +30 -217
  341. package/simple-color-picker/index.cjs +9 -21
  342. package/simple-color-picker/index.js +71 -185
  343. package/slider/definition.cjs +1 -1
  344. package/slider/definition.js +1 -1
  345. package/split-button/definition.js +1 -1
  346. package/styles/core/all.css +1 -1
  347. package/styles/core/theme.css +1 -1
  348. package/styles/core/typography.css +1 -1
  349. package/styles/tokens/theme-dark.css +4 -4
  350. package/styles/tokens/theme-light.css +4 -4
  351. package/styles/tokens/vivid-2-compat.css +1 -1
  352. package/switch/index.cjs +2 -2
  353. package/switch/index.js +4 -4
  354. package/tab/definition.js +1 -1
  355. package/tabs/definition.cjs +1 -1
  356. package/tabs/definition.js +2 -2
  357. package/tabs/index.cjs +2 -2
  358. package/tabs/index.js +16 -16
  359. package/tag/definition.js +1 -1
  360. package/tag/index.cjs +1 -1
  361. package/tag/index.js +1 -1
  362. package/text-area/index.cjs +3 -3
  363. package/text-area/index.js +8 -8
  364. package/text-field/definition.cjs +2 -2
  365. package/text-field/definition.js +4 -4
  366. package/text-field/index.cjs +1 -1
  367. package/text-field/index.js +1 -1
  368. package/time-picker/definition.cjs +1 -1
  369. package/time-picker/definition.js +1 -1
  370. package/time-picker/index.cjs +1 -1
  371. package/time-picker/index.js +2 -2
  372. package/toggletip/definition.cjs +2 -2
  373. package/toggletip/definition.js +3 -3
  374. package/tooltip/definition.cjs +1 -1
  375. package/tooltip/definition.js +1 -1
  376. package/tree-item/definition.cjs +1 -1
  377. package/tree-item/definition.js +1 -1
  378. package/tree-view/definition.cjs +2 -2
  379. package/tree-view/definition.js +3 -3
  380. package/tree-view/index.cjs +2 -2
  381. package/tree-view/index.js +6 -6
  382. package/unbundled/_commonjsHelpers.cjs +36 -0
  383. package/unbundled/_commonjsHelpers.js +32 -0
  384. package/unbundled/affix.cjs +1 -1
  385. package/unbundled/affix.js +2 -2
  386. package/unbundled/attribute-binding-behaviour.cjs +11 -10
  387. package/unbundled/attribute-binding-behaviour.js +11 -10
  388. package/unbundled/base-color-picker.cjs +278 -0
  389. package/unbundled/base-color-picker.js +275 -0
  390. package/unbundled/button.cjs +1 -1
  391. package/unbundled/button.js +2 -2
  392. package/unbundled/calendar-picker.template.cjs +4 -4
  393. package/unbundled/calendar-picker.template.js +5 -5
  394. package/unbundled/definition.js +1 -1
  395. package/unbundled/definition2.cjs +1 -1
  396. package/unbundled/definition2.js +3 -3
  397. package/unbundled/definition3.cjs +222 -140
  398. package/unbundled/definition3.js +220 -138
  399. package/unbundled/definition4.cjs +145 -235
  400. package/unbundled/definition4.js +143 -233
  401. package/unbundled/definition5.cjs +269 -27
  402. package/unbundled/definition5.js +267 -26
  403. package/unbundled/definition6.cjs +56 -0
  404. package/unbundled/definition6.js +52 -0
  405. package/unbundled/delegates-aria.cjs +67 -33
  406. package/unbundled/delegates-aria.js +69 -35
  407. package/unbundled/form-associated.cjs +2 -2
  408. package/unbundled/form-associated.js +3 -3
  409. package/unbundled/host-semantics.cjs +47 -22
  410. package/unbundled/host-semantics.js +48 -23
  411. package/unbundled/listbox.cjs +41 -63
  412. package/unbundled/listbox.js +39 -61
  413. package/unbundled/mixins.cjs +34 -27
  414. package/unbundled/mixins.js +35 -28
  415. package/unbundled/picker-field.template.cjs +3 -3
  416. package/unbundled/picker-field.template.js +4 -4
  417. package/unbundled/slider.template.cjs +1 -1
  418. package/unbundled/slider.template.js +1 -1
  419. package/unbundled/time-selection-picker.template.cjs +4 -4
  420. package/unbundled/time-selection-picker.template.js +5 -5
  421. package/unbundled/vivid-element.cjs +22 -15
  422. package/unbundled/vivid-element.js +23 -15
  423. package/video-player/definition.cjs +69047 -1
  424. package/video-player/definition.js +69047 -1
  425. package/video-player/index.cjs +36 -36
  426. package/video-player/index.js +1895 -1905
  427. package/visually-hidden/index.cjs +1 -1
  428. package/visually-hidden/index.js +1 -1
  429. package/vivid.api.json +719 -224
  430. package/bundled/option.cjs +0 -1
  431. package/bundled/option.js +0 -158
  432. package/unbundled/option.cjs +0 -217
  433. package/unbundled/option.js +0 -214
package/bundled/mixins.js CHANGED
@@ -1,102 +1,108 @@
1
- import { d as k, h as d, V as _, a as y, H as $, D as F, O as f, o as x } from "./vivid-element.js";
2
- import { i as I, I as D } from "./definition2.js";
3
- import { v as w } from "./definition12.js";
4
- import { c as C } from "./class-names.js";
5
- import { w as u } from "./when.js";
6
- import { L as S } from "./localized.js";
7
- import { s as T } from "./slotted.js";
8
- const H = ":host{display:contents}.message{display:flex;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message.none-message{display:none}.message.helper-message{color:var(--_low-ink-color)}.message.error-message,.message.success-message{color:var(--vvd-color-canvas-text)}slot{display:inline}.icon{font-size:16px}.error-message .icon{color:var(--vvd-color-alert-500)}.success-message .icon{color:var(--vvd-color-success-500)}.announcement{display:contents}";
9
- var B = Object.defineProperty, U = (e, t, s, o) => {
10
- for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
11
- (a = e[r]) && (n = a(t, s, n) || n);
12
- return n && B(t, s, n), n;
1
+ import { n as k } from "./normalize.js";
2
+ import { d as _, h as d, V as $, a as y, M as F, H as I, o as f } from "./vivid-element.js";
3
+ import { i as w, I as D } from "./definition2.js";
4
+ import { v as C } from "./definition13.js";
5
+ import { w as m } from "./when.js";
6
+ import { c as B } from "./class-names.js";
7
+ import { L as H } from "./localized.js";
8
+ import { s as x } from "./slotted.js";
9
+ const S = ":host{display:contents}.message{display:flex;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message.none-message{display:none}.message.helper-message{color:var(--_low-ink-color)}.message.error-message,.message.success-message{color:var(--vvd-color-canvas-text)}slot{display:inline}.icon{font-size:16px}.error-message .icon{color:var(--vvd-color-alert-500)}.success-message .icon{color:var(--vvd-color-success-500)}.announcement{display:contents}";
10
+ var M = Object.defineProperty, O = (t, e, o, s) => {
11
+ for (var n = void 0, r = t.length - 1, a; r >= 0; r--)
12
+ (a = t[r]) && (n = a(e, o, n) || n);
13
+ return n && M(e, o, n), n;
13
14
  };
14
- class l extends S(_) {
15
+ class l extends H($) {
15
16
  constructor() {
16
17
  super(...arguments), this.type = "none";
17
18
  }
18
19
  }
19
- U([
20
+ O([
20
21
  y
21
22
  ], l.prototype, "type");
22
- function m(e, t, s) {
23
- const o = e.tagFor(D);
24
- return d`<${o} class="icon" name="${t}" label="${(n) => n.locale.feedbackMessage[s]}"></${o}>`;
23
+ function u(t, e, o) {
24
+ const s = t.tagFor(D);
25
+ return d`<${s} class="icon" name="${e}" label="${(n) => n.locale.feedbackMessage[o]}"></${s}>`;
25
26
  }
26
- function V(e) {
27
- const t = {
27
+ function U(t) {
28
+ const e = {
28
29
  none: "",
29
30
  helper: "",
30
- error: m(e, "info-line", "errorIconText"),
31
- success: m(e, "check-circle-line", "successIconText")
31
+ error: u(t, "info-line", "errorIconText"),
32
+ success: u(t, "check-circle-line", "successIconText")
32
33
  };
33
- return d`${(s) => t[s.type]}`;
34
+ return d`${(o) => e[o.type]}`;
34
35
  }
35
- const g = (e) => e === "error", M = (e) => {
36
- const t = d`<div
37
- class="${(s) => C("message", `${s.type}-message`)}"
36
+ const g = (t) => t === "error", L = (t) => {
37
+ const e = d`<div
38
+ class="${(o) => B("message", `${o.type}-message`)}"
38
39
  >
39
- ${V(e)}<slot></slot>
40
+ ${U(t)}<slot></slot>
40
41
  </div>`;
41
- return d`${u((s) => !g(s.type), t)}
42
+ return d`${m((o) => !g(o.type), e)}
42
43
  <span class="announcement" role="status" aria-live="polite">
43
- ${u((s) => g(s.type), t)}
44
+ ${m((o) => g(o.type), e)}
44
45
  </span>`;
45
- }, Z = k(
46
+ }, ee = _(
46
47
  "feedback-message",
47
48
  l,
48
- M,
49
- [I, w],
49
+ L,
50
+ [w, C],
50
51
  {
51
- styles: H
52
+ styles: S
52
53
  }
53
54
  );
54
55
  class P {
55
- constructor(t, s) {
56
- this.source = null, this.templateBindingObserver = f.binding(
57
- t,
56
+ constructor(e) {
57
+ this.source = null, this.templateBindingObserver = e.templateBinding.createObserver(
58
58
  this,
59
- s
59
+ e
60
60
  );
61
61
  }
62
- bind(t, s) {
63
- this.source = t, this.context = s, this.insertionPoint || (this.insertionPoint = document.createComment(""), t.appendChild(this.insertionPoint)), this.handleChange();
64
- }
65
- unbind() {
66
- this.source = null, this.view.unbind(), this.templateBindingObserver.disconnect();
62
+ bind(e) {
63
+ this.source = e.source, this.context = e.context, this.controller = e, this.insertionPoint || (this.insertionPoint = document.createComment(""), this.source.appendChild(this.insertionPoint)), this.templateBindingObserver.bind(e), this.handleChange(this.source, this.templateBindingObserver);
67
64
  }
65
+ // unbind(): void {
66
+ // this.source = null;
67
+ // if (this.view) {
68
+ // this.view.unbind();
69
+ // }
70
+ // // The observer will be automatically cleaned up when the behavior is destroyed
71
+ // }
68
72
  /**
69
73
  * Handles change of the template itself.
70
74
  */
71
- handleChange() {
72
- this.instantiateTemplate(
73
- this.templateBindingObserver.observe(this.source, this.context)
74
- );
75
+ handleChange(e, o) {
76
+ if (o === this.templateBindingObserver) {
77
+ const s = this.templateBindingObserver.bind(this.controller);
78
+ this.instantiateTemplate(s);
79
+ }
75
80
  }
76
- instantiateTemplate(t) {
77
- this.view && this.view.dispose(), this.view = t.create(), this.view.bind(this.source, this.context), this.view.insertBefore(this.insertionPoint);
81
+ instantiateTemplate(e) {
82
+ this.view && this.view.dispose(), this.view = e.create(), this.view.bind(this.source, this.context), this.view.insertBefore(this.insertionPoint);
78
83
  }
79
84
  }
80
- class L extends $ {
81
- constructor(t) {
82
- super(), this.templateBinding = t, this.createPlaceholder = F.createBlockPlaceholder, this.isTemplateBindingVolatile = f.isVolatileBinding(t);
85
+ class T {
86
+ constructor(e) {
87
+ this.targetNodeId = "", this.templateBinding = e, this.dataBinding = e;
88
+ }
89
+ createHTML(e) {
90
+ return F.comment(e(this));
83
91
  }
84
92
  createBehavior() {
85
- return new P(
86
- this.templateBinding,
87
- this.isTemplateBindingVolatile
88
- );
93
+ return new P(this);
89
94
  }
90
95
  }
91
- function O(e) {
92
- const t = typeof e == "function" ? e : () => e;
93
- return new L(t);
96
+ I.define(T);
97
+ function R(t) {
98
+ const e = k(t);
99
+ return new T(e);
94
100
  }
95
101
  const i = [];
96
- for (let e = 0; e < 256; ++e)
97
- i.push((e + 256).toString(16).slice(1));
98
- function R(e, t = 0) {
99
- return (i[e[t + 0]] + i[e[t + 1]] + i[e[t + 2]] + i[e[t + 3]] + "-" + i[e[t + 4]] + i[e[t + 5]] + "-" + i[e[t + 6]] + i[e[t + 7]] + "-" + i[e[t + 8]] + i[e[t + 9]] + "-" + i[e[t + 10]] + i[e[t + 11]] + i[e[t + 12]] + i[e[t + 13]] + i[e[t + 14]] + i[e[t + 15]]).toLowerCase();
102
+ for (let t = 0; t < 256; ++t)
103
+ i.push((t + 256).toString(16).slice(1));
104
+ function V(t, e = 0) {
105
+ return (i[t[e + 0]] + i[t[e + 1]] + i[t[e + 2]] + i[t[e + 3]] + "-" + i[t[e + 4]] + i[t[e + 5]] + "-" + i[t[e + 6]] + i[t[e + 7]] + "-" + i[t[e + 8]] + i[t[e + 9]] + "-" + i[t[e + 10]] + i[t[e + 11]] + i[t[e + 12]] + i[t[e + 13]] + i[t[e + 14]] + i[t[e + 15]]).toLowerCase();
100
106
  }
101
107
  let p;
102
108
  const E = new Uint8Array(16);
@@ -109,23 +115,23 @@ function W() {
109
115
  return p(E);
110
116
  }
111
117
  const j = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), b = { randomUUID: j };
112
- function z(e, t, s) {
113
- if (b.randomUUID && !e)
118
+ function z(t, e, o) {
119
+ if (b.randomUUID && !t)
114
120
  return b.randomUUID();
115
- e = e || {};
116
- const o = e.random ?? e.rng?.() ?? W();
117
- if (o.length < 16)
121
+ t = t || {};
122
+ const s = t.random ?? t.rng?.() ?? W();
123
+ if (s.length < 16)
118
124
  throw new Error("Random bytes length must be >= 16");
119
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, R(o);
125
+ return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, V(s);
120
126
  }
121
127
  const v = () => z();
122
- var A = Object.defineProperty, h = (e, t, s, o) => {
123
- for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
124
- (a = e[r]) && (n = a(t, s, n) || n);
125
- return n && A(t, s, n), n;
128
+ var A = Object.defineProperty, h = (t, e, o, s) => {
129
+ for (var n = void 0, r = t.length - 1, a; r >= 0; r--)
130
+ (a = t[r]) && (n = a(e, o, n) || n);
131
+ return n && A(e, o, n), n;
126
132
  };
127
- const N = (e) => {
128
- class t extends e {
133
+ const N = (t) => {
134
+ class e extends t {
129
135
  /**
130
136
  * Ids of the feedback content that the control should use for aria-describedby.
131
137
  *
@@ -138,8 +144,8 @@ const N = (e) => {
138
144
  * @internal
139
145
  */
140
146
  _internalFeedback() {
141
- const o = this._helperTextSlottedContent?.length ? "" : this.helperText, n = this.errorValidationMessage, r = this.successText;
142
- return r ? { type: "success", message: r } : n ? { type: "error", message: n } : o ? { type: "helper", message: o } : { type: "none", message: "" };
147
+ const s = this._helperTextSlottedContent?.length ? "" : this.helperText, n = this.errorValidationMessage, r = this.successText;
148
+ return r ? { type: "success", message: r } : n ? { type: "error", message: n } : s ? { type: "helper", message: s } : { type: "none", message: "" };
143
149
  }
144
150
  /**
145
151
  * @internal
@@ -150,8 +156,8 @@ const N = (e) => {
150
156
  /**
151
157
  * @internal
152
158
  */
153
- _getFeedbackTemplate(o) {
154
- const n = o.tagFor(l);
159
+ _getFeedbackTemplate(s) {
160
+ const n = s.tagFor(l);
155
161
  return d`
156
162
  <${n} id="feedback" :type="${(r) => r._internalFeedback().type}">
157
163
  ${(r) => r._internalFeedback().message}
@@ -160,28 +166,28 @@ const N = (e) => {
160
166
  id="slotted-helper-text-feedback"
161
167
  :type="${(r) => r._slottedHelperTextFeedbackType()}"
162
168
  >
163
- <slot name="helper-text" ${T("_helperTextSlottedContent")}></slot>
169
+ <slot name="helper-text" ${x("_helperTextSlottedContent")}></slot>
164
170
  </${n}>
165
171
  `;
166
172
  }
167
173
  }
168
174
  return h([
169
175
  y({ attribute: "helper-text" })
170
- ], t.prototype, "helperText"), h([
171
- x
172
- ], t.prototype, "_helperTextSlottedContent"), t;
173
- }, ee = (e) => {
174
- const t = () => `vvd-feedback-${v()}`, s = () => `vvd-slotted-feedback-${v()}`;
175
- class o extends N(e) {
176
+ ], e.prototype, "helperText"), h([
177
+ f
178
+ ], e.prototype, "_helperTextSlottedContent"), e;
179
+ }, te = (t) => {
180
+ const e = () => `vvd-feedback-${v()}`, o = () => `vvd-slotted-feedback-${v()}`;
181
+ class s extends N(t) {
176
182
  constructor() {
177
- super(...arguments), this._slottedHelperTextIds = [], this._feedbackId = t();
183
+ super(...arguments), this._slottedHelperTextIds = [], this._feedbackId = e();
178
184
  }
179
185
  /**
180
186
  * @internal
181
187
  */
182
188
  _helperTextSlottedContentChanged(r, a) {
183
189
  for (const c of a)
184
- c.id || (c.id = s());
190
+ c.id || (c.id = o());
185
191
  this._slottedHelperTextIds = a.map((c) => c.id);
186
192
  }
187
193
  /**
@@ -197,7 +203,7 @@ const N = (e) => {
197
203
  const a = r.tagFor(l);
198
204
  return d`
199
205
  <slot name="_feedback"></slot>
200
- ${O(d`<${a}
206
+ ${R(d`<${a}
201
207
  slot="_feedback"
202
208
  id="${(c) => c._feedbackId}"
203
209
  :type="${(c) => c._internalFeedback().type}"
@@ -207,20 +213,20 @@ const N = (e) => {
207
213
  <${a} :type="${(c) => c._slottedHelperTextFeedbackType()}">
208
214
  <slot
209
215
  name="helper-text"
210
- ${T("_helperTextSlottedContent")}
216
+ ${x("_helperTextSlottedContent")}
211
217
  ></slot>
212
218
  </${a}>
213
219
  `;
214
220
  }
215
221
  }
216
222
  return h([
217
- x
218
- ], o.prototype, "_slottedHelperTextIds"), o;
223
+ f
224
+ ], s.prototype, "_slottedHelperTextIds"), s;
219
225
  };
220
226
  export {
221
227
  N as W,
222
- ee as a,
223
- Z as f,
228
+ te as a,
229
+ ee as f,
224
230
  v as g,
225
- O as r
231
+ R as r
226
232
  };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./vivid-element.cjs");function e(n){return i.isFunction(n)?i.oneWay(n):n instanceof i.Binding?n:i.oneTime(()=>n)}exports.normalizeBinding=e;
@@ -0,0 +1,7 @@
1
+ import { g as i, u as o, f as s, B as r } from "./vivid-element.js";
2
+ function a(n) {
3
+ return s(n) ? i(n) : n instanceof r ? n : o(() => n);
4
+ }
5
+ export {
6
+ a as n
7
+ };
@@ -1,4 +1,4 @@
1
- "use strict";const _=require("./index.cjs"),v=require("./mixins.cjs"),g=require("./form-associated.cjs"),r=require("./vivid-element.cjs"),$=require("./with-contextual-help.cjs"),x=require("./with-error-text.cjs"),m=require("./form-element.cjs"),k=require("./localized.cjs"),F=require("./definition9.cjs"),E=require("./definition13.cjs"),y=require("./definition3.cjs"),p=require("./ref.cjs"),h=require("./slotted.cjs"),f=require("./class-names.cjs"),b=new WeakSet,C=l=>{b.add(l)},O=l=>{class t extends l{_trappedFocus(a,i){if(!b.has(a)&&a.key==="Tab"){const s=i(),o=s[0],e=s[s.length-1];if(a.shiftKey){if(this.shadowRoot.activeElement===o)return e.focus(),!0}else if(this.shadowRoot.activeElement===e)return o.focus(),!0}return!1}}return t},T=":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";var P=Object.defineProperty,u=(l,t,n,a)=>{for(var i=void 0,s=l.length-1,o;s>=0;s--)(o=l[s])&&(i=o(t,n,i)||i);return i&&P(t,n,i),i};class c extends $.WithContextualHelp(v.WithFeedback(x.WithErrorText(m.FormElement(O(k.Localized(g.FormAssociated(r.VividElement))))))){constructor(){super(),this.readOnly=!1,this.#e=()=>{this.$emit("focus",void 0,{bubbles:!1})},this.#t=()=>{this.$emit("blur",void 0,{bubbles:!1})},this.proxy=document.createElement("input"),this.#l={handleChange:()=>{this._updatePresentationValue()}},this._popupOpen=!1,this.#o=t=>{if(!this._popupOpen)return;const n=t.composedPath();[this._dialogEl,this._pickerButtonEl].some(i=>n.includes(i))||this._closePopup(!1)},this._presentationValue="",this.value=""}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#o),this.addEventListener("focusin",this.#e),this.addEventListener("focusout",this.#t),this.#s()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.#o),this.removeEventListener("focusin",this.#e),this.removeEventListener("focusout",this.#t),this.#n()}#e;#t;validate(){this.proxy&&this.proxy.setCustomValidity(this._getCustomValidationError()??""),super.validate(this._textFieldEl?.querySelector("input")??void 0)}#l;#i;#s(){this.#i=r.Observable.binding(()=>this.locale,this.#l),this.#i.observe(this,r.defaultExecutionContext)}#n(){this.#i.disconnect()}#o;#a(){this.readOnly||(this._popupOpen=!0)}_closePopup(t=!0){this._popupOpen=!1,t&&this._textFieldEl.focus()}_onBaseKeyDown(t){return this._popupOpen&&_.handleEscapeKeyAndStopPropogation(t)?(this._closePopup(),!1):!this._trappedFocus(t,()=>this._focusableElsWithinDialog())}_presentationValueChanged(){this.dirtyValue=!0,this.validate()}_onTextFieldInput(t){const n=t.currentTarget;this._presentationValue=n.value}_onPickerButtonClick(){this._popupOpen?this._closePopup():this.#a()}_onOkClick(){this._closePopup()}_onClearClick(){this.$emit("clear-click")}}u([r.attr({attribute:"readonly",mode:"boolean"})],c.prototype,"readOnly");u([r.observable],c.prototype,"_popupOpen");u([r.observable],c.prototype,"_presentationValue");const q=(l,t,{withSeparator:n,padded:a})=>{const i=l.tagFor(F.Popup),s=l.tagFor(E.TextField),o=l.tagFor(y.Button);return r.html`
1
+ "use strict";const _=require("./index.cjs"),v=require("./mixins.cjs"),g=require("./form-associated.cjs"),r=require("./vivid-element.cjs"),$=require("./with-contextual-help.cjs"),x=require("./with-error-text.cjs"),m=require("./form-element.cjs"),k=require("./localized.cjs"),F=require("./definition9.cjs"),E=require("./definition10.cjs"),y=require("./definition3.cjs"),p=require("./ref.cjs"),h=require("./slotted.cjs"),f=require("./class-names.cjs"),b=new WeakSet,C=l=>{b.add(l)},O=l=>{class t extends l{_trappedFocus(a,i){if(!b.has(a)&&a.key==="Tab"){const s=i(),o=s[0],e=s[s.length-1];if(a.shiftKey){if(this.shadowRoot.activeElement===o)return e.focus(),!0}else if(this.shadowRoot.activeElement===e)return o.focus(),!0}return!1}}return t},T=":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";var P=Object.defineProperty,u=(l,t,n,a)=>{for(var i=void 0,s=l.length-1,o;s>=0;s--)(o=l[s])&&(i=o(t,n,i)||i);return i&&P(t,n,i),i};class c extends $.WithContextualHelp(v.WithFeedback(x.WithErrorText(m.FormElement(O(k.Localized(g.FormAssociated(r.VividElement))))))){constructor(){super(),this.readOnly=!1,this.#e=()=>{this.$emit("focus",void 0,{bubbles:!1})},this.#t=()=>{this.$emit("blur",void 0,{bubbles:!1})},this.proxy=document.createElement("input"),this.#l={handleChange:()=>{this._updatePresentationValue()}},this._popupOpen=!1,this.#o=t=>{if(!this._popupOpen)return;const n=t.composedPath();[this._dialogEl,this._pickerButtonEl].some(i=>n.includes(i))||this._closePopup(!1)},this._presentationValue="",this.value=""}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#o),this.addEventListener("focusin",this.#e),this.addEventListener("focusout",this.#t),this.#s()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.#o),this.removeEventListener("focusin",this.#e),this.removeEventListener("focusout",this.#t),this.#n()}#e;#t;validate(){this.proxy&&this.proxy.setCustomValidity(this._getCustomValidationError()??""),super.validate(this._textFieldEl?.querySelector("input")??void 0)}#l;#i;#s(){this.#i=r.Observable.binding(()=>this.locale,this.#l),this.#i.observe(this,r.ExecutionContext.default)}#n(){this.#i.dispose()}#o;#a(){this.readOnly||(this._popupOpen=!0)}_closePopup(t=!0){this._popupOpen=!1,t&&this._textFieldEl.focus()}_onBaseKeyDown(t){return this._popupOpen&&_.handleEscapeKeyAndStopPropogation(t)?(this._closePopup(),!1):!this._trappedFocus(t,()=>this._focusableElsWithinDialog())}_presentationValueChanged(){this.dirtyValue=!0,this.validate()}_onTextFieldInput(t){const n=t.currentTarget;this._presentationValue=n.value}_onPickerButtonClick(){this._popupOpen?this._closePopup():this.#a()}_onOkClick(){this._closePopup()}_onClearClick(){this.$emit("clear-click")}}u([r.attr({attribute:"readonly",mode:"boolean"})],c.prototype,"readOnly");u([r.observable],c.prototype,"_popupOpen");u([r.observable],c.prototype,"_presentationValue");const q=(l,t,{withSeparator:n,padded:a})=>{const i=l.tagFor(F.Popup),s=l.tagFor(E.TextField),o=l.tagFor(y.Button);return r.html`
2
2
  <div class='base' @keydown='${(e,{event:d})=>e._onBaseKeyDown(d)}'>
3
3
  <${s} id='text-field'
4
4
  ${p.ref("_textFieldEl")}
@@ -1,13 +1,13 @@
1
1
  import { h as b } from "./index.js";
2
2
  import { W as _ } from "./mixins.js";
3
3
  import { F as g } from "./form-associated.js";
4
- import { V as v, O as $, b as x, a as k, o as f, h as F } from "./vivid-element.js";
4
+ import { V as v, O as $, E as x, a as k, o as f, h as F } from "./vivid-element.js";
5
5
  import { W as y } from "./with-contextual-help.js";
6
6
  import { W as C } from "./with-error-text.js";
7
7
  import { F as E } from "./form-element.js";
8
8
  import { L as O } from "./localized.js";
9
9
  import { P as T } from "./definition9.js";
10
- import { T as P } from "./definition13.js";
10
+ import { T as P } from "./definition10.js";
11
11
  import { B as L } from "./definition3.js";
12
12
  import { r as p } from "./ref.js";
13
13
  import { s as u } from "./slotted.js";
@@ -95,10 +95,10 @@ class c extends y(
95
95
  this.#o = $.binding(
96
96
  () => this.locale,
97
97
  this.#s
98
- ), this.#o.observe(this, x);
98
+ ), this.#o.observe(this, x.default);
99
99
  }
100
100
  #a() {
101
- this.#o.disconnect();
101
+ this.#o.dispose();
102
102
  }
103
103
  #i;
104
104
  #n() {
package/bundled/ref.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const i=require("./vivid-element.cjs");class s{constructor(e,r){this.target=e,this.propertyName=r}bind(e){e[this.propertyName]=this.target}unbind(){}}function n(t){return new i.AttachedBehaviorHTMLDirective("fast-ref",s,t)}exports.ref=n;
1
+ "use strict";const i=require("./vivid-element.cjs");class s extends i.StatelessAttachedAttributeDirective{bind(t){t.source[this.options]=t.targets[this.targetNodeId]}}i.HTMLDirective.define(s);const r=e=>new s(e);exports.ref=r;
package/bundled/ref.js CHANGED
@@ -1,32 +1,15 @@
1
- import { A as i } from "./vivid-element.js";
2
- class a {
1
+ import { S as i, H as r } from "./vivid-element.js";
2
+ class s extends i {
3
3
  /**
4
- * Creates an instance of RefBehavior.
5
- * @param target - The element to reference.
6
- * @param propertyName - The name of the property to assign the reference to.
7
- */
8
- constructor(t, e) {
9
- this.target = t, this.propertyName = e;
10
- }
11
- /**
12
- * Bind this behavior to the source.
13
- * @param source - The source to bind to.
14
- * @param context - The execution context that the binding is operating within.
4
+ * Bind this behavior.
5
+ * @param controller - The view controller that manages the lifecycle of this behavior.
15
6
  */
16
7
  bind(t) {
17
- t[this.propertyName] = this.target;
8
+ t.source[this.options] = t.targets[this.targetNodeId];
18
9
  }
19
- /**
20
- * Unbinds this behavior from the source.
21
- * @param source - The source to unbind from.
22
- */
23
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
24
- unbind() {
25
- }
26
- }
27
- function s(r) {
28
- return new i("fast-ref", a, r);
29
10
  }
11
+ r.define(s);
12
+ const c = (e) => new s(e);
30
13
  export {
31
- s as r
14
+ c as r
32
15
  };
@@ -1 +1 @@
1
- "use strict";const a=require("./vivid-element.cjs");function v(i,e,t){return{index:i,removed:e,addedCount:t}}const I=0,$=1,y=2,O=3;function M(i,e,t,o,s,d){const c=d-s+1,f=t-e+1,n=new Array(c);let r,h;for(let l=0;l<c;++l)n[l]=new Array(f),n[l][0]=l;for(let l=0;l<f;++l)n[0][l]=l;for(let l=1;l<c;++l)for(let u=1;u<f;++u)i[e+u-1]===o[s+l-1]?n[l][u]=n[l-1][u-1]:(r=n[l-1][u]+1,h=n[l][u-1]+1,n[l][u]=r<h?r:h);return n}function Q(i){let e=i.length-1,t=i[0].length-1,o=i[e][t];const s=[];for(;e>0||t>0;){if(e===0){s.push(y),t--;continue}if(t===0){s.push(O),e--;continue}const d=i[e-1][t-1],c=i[e-1][t],f=i[e][t-1];let n;c<f?n=c<d?c:d:n=f<d?f:d,n===d?(d===o?s.push(I):(s.push($),o=d),e--,t--):n===c?(s.push(O),e--,o=c):(s.push(y),t--,o=f)}return s.reverse(),s}function k(i,e,t){for(let o=0;o<t;++o)if(i[o]!==e[o])return o;return t}function E(i,e,t){let o=i.length,s=e.length,d=0;for(;d<t&&i[--o]===e[--s];)d++;return d}function _(i,e,t,o){return e<t||o<i?-1:e===t||o===i?0:i<t?e<o?e-t:o-t:o<e?o-i:e-i}function j(i,e,t,o,s,d){let c=0,f=0;const n=Math.min(t-e,d-s);if(e===0&&s===0&&(c=k(i,o,n)),t===i.length&&d===o.length&&(f=E(i,o,n-c)),e+=c,s+=c,t-=f,d-=f,t-e===0&&d-s===0)return a.emptyArray;if(e===t){const m=v(e,[],0);for(;s<d;)m.removed.push(o[s++]);return[m]}else if(s===d)return[v(e,[],t-e)];const r=Q(M(i,e,t,o,s,d)),h=[];let l,u=e,p=s;for(let m=0;m<r.length;++m)switch(r[m]){case I:l!==void 0&&(h.push(l),l=void 0),u++,p++;break;case $:l===void 0&&(l=v(u,[],0)),l.addedCount++,u++,l.removed.push(o[p]),p++;break;case y:l===void 0&&(l=v(u,[],0)),l.addedCount++,u++;break;case O:l===void 0&&(l=v(u,[],0)),l.removed.push(o[p]),p++;break}return l!==void 0&&h.push(l),h}const B=Array.prototype.push;function q(i,e,t,o){const s=v(e,t,o);let d=!1,c=0;for(let f=0;f<i.length;f++){const n=i[f];if(n.index+=c,d)continue;const r=_(s.index,s.index+s.removed.length,n.index,n.index+n.addedCount);if(r>=0){i.splice(f,1),f--,c-=n.addedCount-n.removed.length,s.addedCount+=n.addedCount-r;const h=s.removed.length+n.removed.length-r;if(!s.addedCount&&!h)d=!0;else{let l=n.removed;if(s.index<n.index){const u=s.removed.slice(0,n.index-s.index);B.apply(u,l),l=u}if(s.index+s.removed.length>n.index+n.addedCount){const u=s.removed.slice(n.index+n.addedCount-s.index);B.apply(l,u)}s.removed=l,n.index<s.index&&(s.index=n.index)}}else if(s.index<n.index){d=!0,i.splice(f,0,s),f++;const h=s.addedCount-s.removed.length;n.index+=h,c+=h}}d||i.push(s)}function U(i){const e=[];for(let t=0,o=i.length;t<o;t++){const s=i[t];q(e,s.index,s.removed,s.addedCount)}return e}function W(i,e){let t=[];const o=U(e);for(let s=0,d=o.length;s<d;++s){const c=o[s];if(c.addedCount===1&&c.removed.length===1){c.removed[0]!==i[c.index]&&t.push(c);continue}t=t.concat(j(i,c.index,c.index+c.addedCount,c.removed,0,c.removed.length))}return t}let A=!1;function w(i,e){let t=i.index;const o=e.length;return t>o?t=o-i.addedCount:t<0&&(t=o+i.removed.length+t-i.addedCount),t<0&&(t=0),i.index=t,i}class F extends a.SubscriberSet{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this.call=this.flush,Reflect.defineProperty(e,"$fastController",{value:this,enumerable:!1})}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){this.splices===void 0?this.splices=[e]:this.splices.push(e),this.needsQueue&&(this.needsQueue=!1,a.DOM.queueUpdate(this))}reset(e){this.oldCollection=e,this.needsQueue&&(this.needsQueue=!1,a.DOM.queueUpdate(this))}flush(){const e=this.splices,t=this.oldCollection;if(e===void 0&&t===void 0)return;this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0;const o=t===void 0?W(this.source,e):j(this.source,0,this.source.length,t,0,t.length);this.notify(o)}}function H(){if(A)return;A=!0,a.Observable.setArrayObserverFactory(n=>new F(n));const i=Array.prototype;if(i.$fastPatch)return;Reflect.defineProperty(i,"$fastPatch",{value:1,enumerable:!1});const e=i.pop,t=i.push,o=i.reverse,s=i.shift,d=i.sort,c=i.splice,f=i.unshift;i.pop=function(){const n=this.length>0,r=e.apply(this,arguments),h=this.$fastController;return h!==void 0&&n&&h.addSplice(v(this.length,[r],0)),r},i.push=function(){const n=t.apply(this,arguments),r=this.$fastController;return r!==void 0&&r.addSplice(w(v(this.length-arguments.length,[],arguments.length),this)),n},i.reverse=function(){let n;const r=this.$fastController;r!==void 0&&(r.flush(),n=this.slice());const h=o.apply(this,arguments);return r!==void 0&&r.reset(n),h},i.shift=function(){const n=this.length>0,r=s.apply(this,arguments),h=this.$fastController;return h!==void 0&&n&&h.addSplice(v(0,[r],0)),r},i.sort=function(){let n;const r=this.$fastController;r!==void 0&&(r.flush(),n=this.slice());const h=d.apply(this,arguments);return r!==void 0&&r.reset(n),h},i.splice=function(){const n=c.apply(this,arguments),r=this.$fastController;return r!==void 0&&r.addSplice(w(v(+arguments[0],n,arguments.length>2?arguments.length-2:0),this)),n},i.unshift=function(){const n=f.apply(this,arguments),r=this.$fastController;return r!==void 0&&r.addSplice(w(v(0,[],arguments.length),this)),n}}const D=Object.freeze({positioning:!1,recycle:!0});function N(i,e,t,o){i.bind(e[t],o)}function z(i,e,t,o){const s=Object.create(o);s.index=t,s.length=e.length,i.bind(e[t],s)}class G{constructor(e,t,o,s,d,c){this.location=e,this.itemsBinding=t,this.templateBinding=s,this.options=c,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.originalContext=void 0,this.childContext=void 0,this.bindView=N,this.itemsBindingObserver=a.Observable.binding(t,this,o),this.templateBindingObserver=a.Observable.binding(s,this,d),c.positioning&&(this.bindView=z)}bind(e,t){this.source=e,this.originalContext=t,this.childContext=Object.create(t),this.childContext.parent=e,this.childContext.parentContext=this.originalContext,this.items=this.itemsBindingObserver.observe(e,this.originalContext),this.template=this.templateBindingObserver.observe(e,this.originalContext),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.disconnect(),this.templateBindingObserver.disconnect()}handleChange(e,t){e===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.originalContext),this.observeItems(),this.refreshAllViews()):e===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.originalContext),this.refreshAllViews(!0)):this.updateViews(t)}observeItems(e=!1){if(!this.items){this.items=a.emptyArray;return}const t=this.itemsObserver,o=this.itemsObserver=a.Observable.getNotifier(this.items),s=t!==o;s&&t!==null&&t.unsubscribe(this),(s||e)&&o.subscribe(this)}updateViews(e){const t=this.childContext,o=this.views,s=this.bindView,d=this.items,c=this.template,f=this.options.recycle,n=[];let r=0,h=0;for(let l=0,u=e.length;l<u;++l){const p=e[l],m=p.removed;let C=0,g=p.index;const R=g+p.addedCount,x=o.splice(p.index,m.length),T=h=n.length+x.length;for(;g<R;++g){const V=o[g],L=V?V.firstChild:this.location;let b;f&&h>0?(C<=T&&x.length>0?(b=x[C],C++):(b=n[r],r++),h--):b=c.create(),o.splice(g,0,b),s(b,d,g,t),b.insertBefore(L)}x[C]&&n.push(...x.slice(C))}for(let l=r,u=n.length;l<u;++l)n[l].dispose();if(this.options.positioning)for(let l=0,u=o.length;l<u;++l){const p=o[l].context;p.length=u,p.index=l}}refreshAllViews(e=!1){const t=this.items,o=this.childContext,s=this.template,d=this.location,c=this.bindView;let f=t.length,n=this.views,r=n.length;if((f===0||e||!this.options.recycle)&&(a.HTMLView.disposeContiguousBatch(n),r=0),r===0){this.views=n=new Array(f);for(let h=0;h<f;++h){const l=s.create();c(l,t,h,o),n[h]=l,l.insertBefore(d)}}else{let h=0;for(;h<f;++h)if(h<r){const u=n[h];c(u,t,h,o)}else{const u=s.create();c(u,t,h,o),n.push(u),u.insertBefore(d)}const l=n.splice(h,r-h);for(h=0,f=l.length;h<f;++h)l[h].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,o=e.length;t<o;++t)e[t].unbind()}}class P extends a.HTMLDirective{constructor(e,t,o){super(),this.itemsBinding=e,this.templateBinding=t,this.options=o,this.createPlaceholder=a.DOM.createBlockPlaceholder,H(),this.isItemsBindingVolatile=a.Observable.isVolatileBinding(e),this.isTemplateBindingVolatile=a.Observable.isVolatileBinding(t)}createBehavior(e){return new G(e,this.itemsBinding,this.isItemsBindingVolatile,this.templateBinding,this.isTemplateBindingVolatile,this.options)}}function J(i,e,t=D){const o=typeof e=="function"?e:()=>e;return new P(i,o,Object.assign(Object.assign({},D),t))}exports.RepeatDirective=P;exports.repeat=J;
1
+ "use strict";const f=require("./vivid-element.cjs"),V=require("./normalize.cjs");class v{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class S{constructor(e){this.sorted=e}}const T=Object.freeze({reset:1,splice:2,optimized:3}),j=new v(0,f.emptyArray,0);j.reset=!0;const _=[j];function H(i,e,t,s,o,n){const l=n-o+1,h=t-e+1,d=new Array(l);let a,c;for(let r=0;r<l;++r)d[r]=new Array(h),d[r][0]=r;for(let r=0;r<h;++r)d[0][r]=r;for(let r=1;r<l;++r)for(let u=1;u<h;++u)i[e+u-1]===s[o+r-1]?d[r][u]=d[r-1][u-1]:(a=d[r-1][u]+1,c=d[r][u-1]+1,d[r][u]=a<c?a:c);return d}function L(i){let e=i.length-1,t=i[0].length-1,s=i[e][t];const o=[];for(;e>0||t>0;){if(e===0){o.push(2),t--;continue}if(t===0){o.push(3),e--;continue}const n=i[e-1][t-1],l=i[e-1][t],h=i[e][t-1];let d;l<h?d=l<n?l:n:d=h<n?h:n,d===n?(n===s?o.push(0):(o.push(1),s=n),e--,t--):d===l?(o.push(3),e--,s=l):(o.push(2),t--,s=h)}return o.reverse()}function $(i,e,t){for(let s=0;s<t;++s)if(i[s]!==e[s])return s;return t}function E(i,e,t){let s=i.length,o=e.length,n=0;for(;n<t&&i[--s]===e[--o];)n++;return n}function q(i,e,t,s){return e<t||s<i?-1:e===t||s===i?0:i<t?e<s?e-t:s-t:s<e?s-i:e-i}function D(i,e,t,s,o,n){let l=0,h=0;const d=Math.min(t-e,n-o);if(e===0&&o===0&&(l=$(i,s,d)),t===i.length&&n===s.length&&(h=E(i,s,d-l)),e+=l,o+=l,t-=h,n-=h,t-e===0&&n-o===0)return f.emptyArray;if(e===t){const g=new v(e,[],0);for(;o<n;)g.removed.push(s[o++]);return[g]}else if(o===n)return[new v(e,[],t-e)];const a=L(H(i,e,t,s,o,n)),c=[];let r,u=e,p=o;for(let g=0;g<a.length;++g)switch(a[g]){case 0:r!==void 0&&(c.push(r),r=void 0),u++,p++;break;case 1:r===void 0&&(r=new v(u,[],0)),r.addedCount++,u++,r.removed.push(s[p]),p++;break;case 2:r===void 0&&(r=new v(u,[],0)),r.addedCount++,u++;break;case 3:r===void 0&&(r=new v(u,[],0)),r.removed.push(s[p]),p++;break}return r!==void 0&&c.push(r),c}function P(i,e){let t=!1,s=0;for(let o=0;o<e.length;o++){const n=e[o];if(n.index+=s,t)continue;const l=q(i.index,i.index+i.removed.length,n.index,n.index+n.addedCount);if(l>=0){e.splice(o,1),o--,s-=n.addedCount-n.removed.length,i.addedCount+=n.addedCount-l;const h=i.removed.length+n.removed.length-l;if(!i.addedCount&&!h)t=!0;else{let d=n.removed;if(i.index<n.index){const a=i.removed.slice(0,n.index-i.index);a.push(...d),d=a}if(i.index+i.removed.length>n.index+n.addedCount){const a=i.removed.slice(n.index+n.addedCount-i.index);d.push(...a)}i.removed=d,n.index<i.index&&(i.index=n.index)}}else if(i.index<n.index){t=!0,e.splice(o,0,i),o++;const h=i.addedCount-i.removed.length;n.index+=h,s+=h}}t||e.push(i)}function Q(i,e){let t=[];const s=[];for(let o=0,n=e.length;o<n;o++)P(e[o],s);for(let o=0,n=s.length;o<n;++o){const l=s[o];if(l.addedCount===1&&l.removed.length===1){l.removed[0]!==i[l.index]&&t.push(l);continue}t=t.concat(D(i,l.index,l.index+l.addedCount,l.removed,0,l.removed.length))}return t}let z=Object.freeze({support:T.optimized,normalize(i,e,t){return i===void 0?t===void 0?f.emptyArray:Q(e,t):_},pop(i,e,t,s){const o=i.length>0,n=t.apply(i,s);return o&&e.addSplice(new v(i.length,[n],0)),n},push(i,e,t,s){const o=t.apply(i,s);return e.addSplice(new v(i.length-s.length,[],s.length).adjustTo(i)),o},reverse(i,e,t,s){const o=t.apply(i,s);i.sorted++;const n=[];for(let l=i.length-1;l>=0;l--)n.push(l);return e.addSort(new S(n)),o},shift(i,e,t,s){const o=i.length>0,n=t.apply(i,s);return o&&e.addSplice(new v(0,[n],0)),n},sort(i,e,t,s){const o=new Map;for(let h=0,d=i.length;h<d;++h){const a=o.get(i[h])||[];o.set(i[h],[...a,h])}const n=t.apply(i,s);i.sorted++;const l=[];for(let h=0,d=i.length;h<d;++h){const a=o.get(i[h]);l.push(a[0]),o.set(i[h],a.splice(1))}return e.addSort(new S(l)),n},splice(i,e,t,s){const o=t.apply(i,s);return e.addSplice(new v(+s[0],o,s.length>2?s.length-2:0).adjustTo(i)),o},unshift(i,e,t,s){const o=t.apply(i,s);return e.addSplice(new v(0,[],s.length).adjustTo(i)),o}});function y(i,e,t,s=!0){Reflect.defineProperty(i,e,{value:t,enumerable:!1,writable:s})}class W extends f.SubscriberSet{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,y(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(e===void 0){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,f.Observable.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(e===void 0){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,f.Observable.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){this.splices===void 0?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){this.sorts===void 0?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,o=this.oldCollection;t===void 0&&o===void 0&&s===void 0||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,s!==void 0?this.notify(s):this.notify(((e=this._strategy)!==null&&e!==void 0?e:z).normalize(o,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,f.Updates.enqueue(this))}}let B=!1;const F=Object.freeze({sorted:0,enable(){if(B)return;B=!0,f.Observable.setArrayObserverFactory(e=>new W(e));const i=Array.prototype;i.$fastPatch||(y(i,"$fastPatch",1),y(i,"sorted",0),[i.pop,i.push,i.reverse,i.shift,i.sort,i.splice,i.unshift].forEach(e=>{i[e.name]=function(...t){var s;const o=this.$fastController;return o===void 0?e.apply(this,t):((s=o.strategy)!==null&&s!==void 0?s:z)[e.name](this,o,e,t)}}))}}),N=Object.freeze({positioning:!1,recycle:!0});function U(i,e,t,s){i.context.parent=s.source,i.context.parentContext=s.context,i.bind(e[t])}function X(i,e,t,s){i.context.parent=s.source,i.context.parentContext=s.context,i.context.length=e.length,i.context.index=t,i.bind(e[t])}function M(i){return i.nodeType===Node.COMMENT_NODE}class A extends Error{constructor(e,t){super(e),this.propertyBag=t}}class G{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=U,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=X)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),f.isHydratable(this.template)&&f.isHydratable(e)&&e.hydrationStage!==f.HydrationStage.hydrated?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else if(t[0])t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t);else return}observeItems(e=!1){if(!this.items){this.items=f.emptyArray;return}const t=this.itemsObserver,s=this.itemsObserver=f.Observable.getNotifier(this.items),o=t!==s;o&&t!==null&&t.unsubscribe(this),(o||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,o=e.length;s<o;++s){const n=e[s].sorted.slice(),l=n.slice().sort();for(let h=0,d=n.length;h<d;++h){const a=n.find(c=>n[h]===l[c]);if(a!==h){const c=l.splice(a,1);l.splice(h,0,...c);const r=t[h],u=r?r.firstChild:this.location;t[a].remove(),t[a].insertBefore(u);const p=t.splice(a,1);t.splice(h,0,...p)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,o=this.items,n=this.template,l=this.controller,h=this.directive.options.recycle,d=[];let a=0,c=0;for(let r=0,u=e.length;r<u;++r){const p=e[r],g=p.removed;let w=0,m=p.index;const R=m+p.addedCount,x=t.splice(p.index,g.length),k=c=d.length+x.length;for(;m<R;++m){const C=t[m],I=C?C.firstChild:this.location;let b;h&&c>0?(w<=k&&x.length>0?(b=x[w],w++):(b=d[a],a++),c--):b=n.create(),t.splice(m,0,b),s(b,o,m,l),b.insertBefore(I)}x[w]&&d.push(...x.slice(w))}for(let r=a,u=d.length;r<u;++r)d[r].dispose();if(this.directive.options.positioning)for(let r=0,u=t.length;r<u;++r){const p=t[r].context;p.length=u,p.index=r}}refreshAllViews(e=!1){const t=this.items,s=this.template,o=this.location,n=this.bindView,l=this.controller;let h=t.length,d=this.views,a=d.length;if((h===0||e||!this.directive.options.recycle)&&(f.HTMLView.disposeContiguousBatch(d),a=0),a===0){this.views=d=new Array(h);for(let c=0;c<h;++c){const r=s.create();n(r,t,c,l),d[c]=r,r.insertBefore(o)}}else{let c=0;for(;c<h;++c)if(c<a){const u=d[c];if(!u){const p=new XMLSerializer;throw new A(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:c,hydrationStage:this.controller.hydrationStage,itemsLength:h,viewsState:d.map(g=>g?"hydrated":"empty"),viewTemplateString:p.serializeToString(s.create().fragment),rootNodeContent:p.serializeToString(this.location.getRootNode())})}n(u,t,c,l)}else{const u=s.create();n(u,t,c,l),d.push(u),u.insertBefore(o)}const r=d.splice(c,a-c);for(c=0,h=r.length;c<h;++c)r[c].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const o=e[t];if(!o){const n=new XMLSerializer;throw new A(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map(l=>l?"hydrated":"empty"),rootNodeContent:n.serializeToString(this.location.getRootNode())})}o.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;t!==null;){if(!M(t)){t=t.previousSibling;continue}const s=f.HydrationMarkup.parseRepeatEndMarker(t.data);if(s===null){t=t.previousSibling;continue}t.data="";const o=t.previousSibling;if(!o)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=o,l=0;for(;n!==null;){if(M(n)){if(f.HydrationMarkup.isRepeatViewEndMarker(n.data))l++;else if(f.HydrationMarkup.isRepeatViewStartMarker(n.data))if(l)l--;else{if(f.HydrationMarkup.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const h=e.hydrate(n,o);this.views[s]=h,this.bindView(h,this.items,s,this.controller);break}}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class O{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,F.enable()}createHTML(e){return f.Markup.comment(e(this))}createBehavior(){return new G(this)}}f.HTMLDirective.define(O);function J(i,e,t=N){const s=V.normalizeBinding(i),o=V.normalizeBinding(e);return new O(s,o,Object.assign(Object.assign({},N),t))}exports.RepeatDirective=O;exports.repeat=J;