@caspeco/casper-ui-library 10.3.1 → 10.5.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 (785) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +11 -0
  2. package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
  3. package/dist/components/accordion/accordion-context.js +5 -6
  4. package/dist/components/accordion/accordion-item.js +28 -40
  5. package/dist/components/accordion/accordion-panel.js +17 -14
  6. package/dist/components/accordion/accordion-recipe.js +85 -120
  7. package/dist/components/accordion/accordion.js +23 -20
  8. package/dist/components/alert/alert.js +80 -59
  9. package/dist/components/alert/helper.js +30 -42
  10. package/dist/components/alert/types.d.ts.map +1 -1
  11. package/dist/components/badge/badge-recipe.js +57 -49
  12. package/dist/components/badge/badge.js +66 -71
  13. package/dist/components/badge/helper.js +8 -9
  14. package/dist/components/box/box.js +14 -11
  15. package/dist/components/breadcrumbs/breadcrumb-item.js +21 -17
  16. package/dist/components/breadcrumbs/breadcrumb-link.js +21 -20
  17. package/dist/components/breadcrumbs/breadcrumbs.js +123 -90
  18. package/dist/components/button/button-recipe.js +280 -315
  19. package/dist/components/button/button.js +39 -40
  20. package/dist/components/checkbox/checkbox-icon.js +38 -46
  21. package/dist/components/checkbox/checkbox-recipe.js +176 -204
  22. package/dist/components/checkbox/checkbox.js +43 -36
  23. package/dist/components/checkbox/icons/check.js +5 -5
  24. package/dist/components/checkbox/icons/minus.js +5 -5
  25. package/dist/components/checkbox/icons/plus.js +5 -5
  26. package/dist/components/checkbox-group/checkbox-group.js +17 -16
  27. package/dist/components/collapsible/collapsible.js +117 -101
  28. package/dist/components/collapsible/translations.js +29 -29
  29. package/dist/components/combobox/combobox-button.js +173 -143
  30. package/dist/components/combobox/combobox-item.js +45 -23
  31. package/dist/components/combobox/combobox-menu.js +240 -190
  32. package/dist/components/combobox/combobox-recipe.js +69 -103
  33. package/dist/components/combobox/combobox.js +243 -273
  34. package/dist/components/combobox/translations.js +49 -50
  35. package/dist/components/date-picker/base-date-picker.js +238 -248
  36. package/dist/components/date-picker/date-cell-recipe.js +149 -179
  37. package/dist/components/date-picker/date-multi-picker.js +35 -29
  38. package/dist/components/date-picker/date-picker-date-cell.js +109 -114
  39. package/dist/components/date-picker/date-picker-header.js +152 -170
  40. package/dist/components/date-picker/date-picker-week-cell.js +41 -43
  41. package/dist/components/date-picker/date-picker.js +32 -29
  42. package/dist/components/date-picker/date-range-picker.js +29 -24
  43. package/dist/components/date-picker/date-week-picker.js +29 -22
  44. package/dist/components/date-picker/datepicker-week-recipe.js +75 -91
  45. package/dist/components/date-picker/helper.js +11 -16
  46. package/dist/components/divider/divider-recipe.js +9 -11
  47. package/dist/components/divider/divider.js +19 -18
  48. package/dist/components/drawer/drawer-recipe.js +21 -50
  49. package/dist/components/drawer/drawer.js +45 -41
  50. package/dist/components/drawer/inline-drawer.js +69 -66
  51. package/dist/components/drawer/use-drawer-key-down.js +20 -20
  52. package/dist/components/fieldset/fieldset-error-text.js +15 -15
  53. package/dist/components/fieldset/fieldset-helper-text.js +15 -15
  54. package/dist/components/fieldset/fieldset-legend.js +15 -15
  55. package/dist/components/fieldset/fieldset-recipe.js +14 -24
  56. package/dist/components/fieldset/fieldset.js +17 -17
  57. package/dist/components/flex/flex.js +15 -15
  58. package/dist/components/form-control/form-control-recipe.js +42 -46
  59. package/dist/components/form-control/form-control.js +19 -19
  60. package/dist/components/form-control/form-error-message.js +15 -15
  61. package/dist/components/form-control/form-helper-text.js +15 -15
  62. package/dist/components/form-control/form-label.js +24 -26
  63. package/dist/components/grid/grid-item.js +15 -15
  64. package/dist/components/grid/grid.js +15 -15
  65. package/dist/components/heading/heading.js +24 -23
  66. package/dist/components/highlight/highlight.js +22 -21
  67. package/dist/components/icon/create-icon.js +27 -26
  68. package/dist/components/icon/icons/absence-icon.js +5 -5
  69. package/dist/components/icon/icons/accessibility-icon.js +5 -5
  70. package/dist/components/icon/icons/add-absence-icon.js +5 -5
  71. package/dist/components/icon/icons/add-emoji-icon.js +5 -5
  72. package/dist/components/icon/icons/add-icon.js +5 -5
  73. package/dist/components/icon/icons/apple-icon.js +5 -5
  74. package/dist/components/icon/icons/apps-icon.js +5 -5
  75. package/dist/components/icon/icons/archive-icon.js +6 -6
  76. package/dist/components/icon/icons/area-icon.js +5 -5
  77. package/dist/components/icon/icons/at-icon.js +5 -5
  78. package/dist/components/icon/icons/attachment-icon.js +5 -5
  79. package/dist/components/icon/icons/baby-icon.js +5 -5
  80. package/dist/components/icon/icons/back-icon.js +5 -5
  81. package/dist/components/icon/icons/backspace-icon.js +5 -5
  82. package/dist/components/icon/icons/bank-icon.js +5 -5
  83. package/dist/components/icon/icons/bank-id-icon.js +5 -5
  84. package/dist/components/icon/icons/barcode-icon.js +5 -5
  85. package/dist/components/icon/icons/bell-icon.js +5 -5
  86. package/dist/components/icon/icons/bolt-icon.js +7 -7
  87. package/dist/components/icon/icons/calendar-icon.js +5 -5
  88. package/dist/components/icon/icons/camera-icon.js +5 -5
  89. package/dist/components/icon/icons/cancel-icon.js +5 -5
  90. package/dist/components/icon/icons/card-icon.js +5 -5
  91. package/dist/components/icon/icons/cart-icon.js +5 -5
  92. package/dist/components/icon/icons/caspeco-icon.js +7 -7
  93. package/dist/components/icon/icons/channels-icon.js +5 -5
  94. package/dist/components/icon/icons/chart-icon.js +5 -5
  95. package/dist/components/icon/icons/chart-line-icon.js +5 -5
  96. package/dist/components/icon/icons/chart-mixed-icon.js +5 -5
  97. package/dist/components/icon/icons/chart-pie-icon.js +5 -5
  98. package/dist/components/icon/icons/chart-scatter-icon.js +5 -5
  99. package/dist/components/icon/icons/check-icon.js +5 -5
  100. package/dist/components/icon/icons/checkbox-icon.js +5 -5
  101. package/dist/components/icon/icons/chevron-left-icon.js +5 -5
  102. package/dist/components/icon/icons/chevron-right-icon.js +5 -5
  103. package/dist/components/icon/icons/child-icon.js +5 -5
  104. package/dist/components/icon/icons/circle-info-icon.js +5 -5
  105. package/dist/components/icon/icons/circle-parking-icon.js +5 -5
  106. package/dist/components/icon/icons/circle-question-icon.js +5 -5
  107. package/dist/components/icon/icons/circle-select-icon.js +5 -5
  108. package/dist/components/icon/icons/circle-success-icon.js +5 -5
  109. package/dist/components/icon/icons/circle-user-icon.js +5 -5
  110. package/dist/components/icon/icons/clear-icon.js +5 -5
  111. package/dist/components/icon/icons/close-icon.js +5 -5
  112. package/dist/components/icon/icons/closed-icon.js +5 -5
  113. package/dist/components/icon/icons/collapse-icon.js +5 -5
  114. package/dist/components/icon/icons/color-icon.js +5 -5
  115. package/dist/components/icon/icons/columns-icon.js +5 -5
  116. package/dist/components/icon/icons/comment-add-icon.js +5 -5
  117. package/dist/components/icon/icons/comment-icon.js +5 -5
  118. package/dist/components/icon/icons/cookies-icon.js +5 -5
  119. package/dist/components/icon/icons/copy-icon.js +5 -5
  120. package/dist/components/icon/icons/date-icon.js +5 -5
  121. package/dist/components/icon/icons/decrease-icon.js +4 -4
  122. package/dist/components/icon/icons/delete-icon.js +5 -5
  123. package/dist/components/icon/icons/deliverect-icon.js +5 -5
  124. package/dist/components/icon/icons/delivery-icon.js +5 -5
  125. package/dist/components/icon/icons/description-icon.js +5 -5
  126. package/dist/components/icon/icons/discount-icon.js +5 -5
  127. package/dist/components/icon/icons/distribute-evenly-icon.js +5 -5
  128. package/dist/components/icon/icons/door-closed-icon.js +5 -5
  129. package/dist/components/icon/icons/door-open-icon.js +5 -5
  130. package/dist/components/icon/icons/down-icon.js +5 -5
  131. package/dist/components/icon/icons/eat-in-icon.js +5 -5
  132. package/dist/components/icon/icons/edit-icon.js +5 -5
  133. package/dist/components/icon/icons/email-icon.js +5 -5
  134. package/dist/components/icon/icons/error-icon.js +5 -5
  135. package/dist/components/icon/icons/expand-icon.js +5 -5
  136. package/dist/components/icon/icons/export-icon.js +5 -5
  137. package/dist/components/icon/icons/extract-icon.js +5 -5
  138. package/dist/components/icon/icons/facebook-icon.js +5 -5
  139. package/dist/components/icon/icons/failed-print-icon.js +5 -5
  140. package/dist/components/icon/icons/file-icon.js +5 -5
  141. package/dist/components/icon/icons/filter-icon.js +5 -5
  142. package/dist/components/icon/icons/folder-icon.js +5 -5
  143. package/dist/components/icon/icons/foodora-icon.js +5 -5
  144. package/dist/components/icon/icons/forward-icon.js +5 -5
  145. package/dist/components/icon/icons/glovo-icon.js +7 -7
  146. package/dist/components/icon/icons/goal-icon.js +5 -5
  147. package/dist/components/icon/icons/google-icon.js +5 -5
  148. package/dist/components/icon/icons/grip-more-icon.js +5 -5
  149. package/dist/components/icon/icons/hash-icon.js +5 -5
  150. package/dist/components/icon/icons/hexagon-error-icon.js +5 -5
  151. package/dist/components/icon/icons/hide-icon.js +5 -5
  152. package/dist/components/icon/icons/history-icon.js +5 -5
  153. package/dist/components/icon/icons/icon-picker-anchor-icon.js +5 -5
  154. package/dist/components/icon/icons/icon-picker-asterisk-icon.js +5 -5
  155. package/dist/components/icon/icons/icon-picker-beer-icon.js +5 -5
  156. package/dist/components/icon/icons/icon-picker-bicycle-icon.js +5 -5
  157. package/dist/components/icon/icons/icon-picker-binoculars-icon.js +5 -5
  158. package/dist/components/icon/icons/icon-picker-bomb-icon.js +5 -5
  159. package/dist/components/icon/icons/icon-picker-car-icon.js +5 -5
  160. package/dist/components/icon/icons/icon-picker-cocktail-icon.js +5 -5
  161. package/dist/components/icon/icons/icon-picker-gem-icon.js +5 -5
  162. package/dist/components/icon/icons/icon-picker-heart-full-icon.js +5 -5
  163. package/dist/components/icon/icons/icon-picker-heart-icon.js +5 -5
  164. package/dist/components/icon/icons/icon-picker-magnet-icon.js +5 -5
  165. package/dist/components/icon/icons/icon-picker-money-icon.js +5 -5
  166. package/dist/components/icon/icons/icon-picker-moon-icon.js +5 -5
  167. package/dist/components/icon/icons/icon-picker-music-icon.js +5 -5
  168. package/dist/components/icon/icons/icon-picker-star-full-icon.js +5 -5
  169. package/dist/components/icon/icons/icon-picker-star-half-icon.js +5 -5
  170. package/dist/components/icon/icons/icon-picker-star-icon.js +5 -5
  171. package/dist/components/icon/icons/icon-picker-tint-icon.js +5 -5
  172. package/dist/components/icon/icons/icon-picker-tree-icon.js +5 -5
  173. package/dist/components/icon/icons/icon-picker-utensils-icon.js +5 -5
  174. package/dist/components/icon/icons/icon-picker-wheelchair-icon.js +5 -5
  175. package/dist/components/icon/icons/image-icon.js +5 -5
  176. package/dist/components/icon/icons/import-icon.js +5 -5
  177. package/dist/components/icon/icons/inbox-icon.js +5 -5
  178. package/dist/components/icon/icons/increase-icon.js +5 -5
  179. package/dist/components/icon/icons/indeterminate-icon.js +4 -4
  180. package/dist/components/icon/icons/index.d.ts +1 -0
  181. package/dist/components/icon/icons/index.d.ts.map +1 -1
  182. package/dist/components/icon/icons/info-icon.js +5 -5
  183. package/dist/components/icon/icons/inheritance-icon.js +5 -5
  184. package/dist/components/icon/icons/just-eat-icon.js +5 -5
  185. package/dist/components/icon/icons/karma-icon.js +5 -5
  186. package/dist/components/icon/icons/key-command-icon.js +5 -5
  187. package/dist/components/icon/icons/key-enter-icon.js +5 -5
  188. package/dist/components/icon/icons/key-icon.js +5 -5
  189. package/dist/components/icon/icons/key-option-icon.js +5 -5
  190. package/dist/components/icon/icons/language-icon.js +5 -5
  191. package/dist/components/icon/icons/link-broken-icon.js +5 -5
  192. package/dist/components/icon/icons/link-external-icon.js +5 -5
  193. package/dist/components/icon/icons/link-icon.js +5 -5
  194. package/dist/components/icon/icons/list-ol-icon.js +5 -5
  195. package/dist/components/icon/icons/list-ul-icon.js +5 -5
  196. package/dist/components/icon/icons/loading-icon.js +5 -5
  197. package/dist/components/icon/icons/location-icon.js +5 -5
  198. package/dist/components/icon/icons/lock-icon.js +5 -5
  199. package/dist/components/icon/icons/log-in-icon.js +5 -5
  200. package/dist/components/icon/icons/log-out-icon.js +5 -5
  201. package/dist/components/icon/icons/map-icon.js +5 -5
  202. package/dist/components/icon/icons/maximize-icon.js +5 -5
  203. package/dist/components/icon/icons/members-icon.js +5 -5
  204. package/dist/components/icon/icons/menu-hide-icon.js +5 -5
  205. package/dist/components/icon/icons/menu-icon.js +5 -5
  206. package/dist/components/icon/icons/menu-show-icon.js +5 -5
  207. package/dist/components/icon/icons/message-add-icon.js +5 -5
  208. package/dist/components/icon/icons/message-icon.js +5 -5
  209. package/dist/components/icon/icons/message-lines-icon.js +5 -5
  210. package/dist/components/icon/icons/minimize-icon.js +5 -5
  211. package/dist/components/icon/icons/minimize-window-icon.js +5 -5
  212. package/dist/components/icon/icons/mobile-rotate-icon.js +5 -5
  213. package/dist/components/icon/icons/module-accounting-icon.js +5 -5
  214. package/dist/components/icon/icons/module-ai-forecast-icon.js +5 -5
  215. package/dist/components/icon/icons/module-app-icon.js +5 -5
  216. package/dist/components/icon/icons/module-articles-icon.js +5 -5
  217. package/dist/components/icon/icons/module-benchmark-icon.js +5 -5
  218. package/dist/components/icon/icons/module-booking-icon.js +5 -5
  219. package/dist/components/icon/icons/module-cai-icon.js +5 -5
  220. package/dist/components/icon/icons/module-campaigns-icon.js +5 -5
  221. package/dist/components/icon/icons/module-cashier-icon.js +5 -5
  222. package/dist/components/icon/icons/module-communication-icon.js +5 -5
  223. package/dist/components/icon/icons/module-copilot-icon.js +5 -5
  224. package/dist/components/icon/icons/module-dashboard-icon.js +5 -5
  225. package/dist/components/icon/icons/module-document-icon.js +5 -5
  226. package/dist/components/icon/icons/module-employees-icon.js +5 -5
  227. package/dist/components/icon/icons/module-feed-icon.js +5 -5
  228. package/dist/components/icon/icons/module-history-icon.js +5 -5
  229. package/dist/components/icon/icons/module-home-icon.js +5 -5
  230. package/dist/components/icon/icons/module-insights-icon.js +5 -5
  231. package/dist/components/icon/icons/module-kds-icon.js +5 -5
  232. package/dist/components/icon/icons/module-members-icon.js +5 -5
  233. package/dist/components/icon/icons/module-menus-icon.js +5 -5
  234. package/dist/components/icon/icons/module-my-city-icon.js +5 -5
  235. package/dist/components/icon/icons/module-notification-center-icon.js +5 -5
  236. package/dist/components/icon/icons/module-online-order-icon.js +5 -5
  237. package/dist/components/icon/icons/module-organisation-icon.js +5 -5
  238. package/dist/components/icon/icons/module-pos-icon.js +5 -5
  239. package/dist/components/icon/icons/module-pulse-icon.js +5 -5
  240. package/dist/components/icon/icons/module-result-icon.js +5 -5
  241. package/dist/components/icon/icons/module-salary-icon.js +5 -5
  242. package/dist/components/icon/icons/module-schedule-icon.js +5 -5
  243. package/dist/components/icon/icons/module-settings-alt-icon.js +5 -5
  244. package/dist/components/icon/icons/module-settings-icon.js +5 -5
  245. package/dist/components/icon/icons/module-support-icon.js +5 -5
  246. package/dist/components/icon/icons/module-survey-icon.js +5 -5
  247. package/dist/components/icon/icons/module-table-map-icon.js +6 -6
  248. package/dist/components/icon/icons/module-tablet-icon.js +5 -5
  249. package/dist/components/icon/icons/module-time-icon.js +5 -5
  250. package/dist/components/icon/icons/module-timeline-icon.js +5 -5
  251. package/dist/components/icon/icons/module-tip-icon.js +5 -5
  252. package/dist/components/icon/icons/module-to-do-icon.js +5 -5
  253. package/dist/components/icon/icons/module-tools-icon.js +5 -5
  254. package/dist/components/icon/icons/module-top-list-icon.js +5 -5
  255. package/dist/components/icon/icons/module-web-charts-icon.js +5 -5
  256. package/dist/components/icon/icons/module-web-icon.js +5 -5
  257. package/dist/components/icon/icons/more-horizontal-icon.js +5 -5
  258. package/dist/components/icon/icons/more-vertical-icon.js +5 -5
  259. package/dist/components/icon/icons/nfc-icon.js +5 -5
  260. package/dist/components/icon/icons/no-cart-icon.js +5 -5
  261. package/dist/components/icon/icons/note-icon.js +5 -5
  262. package/dist/components/icon/icons/number-icon.js +6 -6
  263. package/dist/components/icon/icons/open-modal-icon.js +5 -5
  264. package/dist/components/icon/icons/parking-icon.js +5 -5
  265. package/dist/components/icon/icons/party-horn-icon.js +5 -5
  266. package/dist/components/icon/icons/paste-icon.d.ts +2 -0
  267. package/dist/components/icon/icons/paste-icon.d.ts.map +1 -0
  268. package/dist/components/icon/icons/paste-icon.js +5 -0
  269. package/dist/components/icon/icons/pause-icon.js +5 -5
  270. package/dist/components/icon/icons/payment-card-icon.js +5 -5
  271. package/dist/components/icon/icons/payment-cash-icon.js +5 -5
  272. package/dist/components/icon/icons/payment-generic-icon.js +5 -5
  273. package/dist/components/icon/icons/payment-giftcard-icon.js +5 -5
  274. package/dist/components/icon/icons/payment-hotel-icon.js +5 -5
  275. package/dist/components/icon/icons/payment-invoice-icon.js +5 -5
  276. package/dist/components/icon/icons/percentage-icon.js +5 -5
  277. package/dist/components/icon/icons/phone-icon.js +5 -5
  278. package/dist/components/icon/icons/pin-icon.js +5 -5
  279. package/dist/components/icon/icons/pin-map-icon.js +5 -5
  280. package/dist/components/icon/icons/play-icon.js +5 -5
  281. package/dist/components/icon/icons/preview-icon.js +5 -5
  282. package/dist/components/icon/icons/print-icon.js +5 -5
  283. package/dist/components/icon/icons/privacy-icon.js +5 -5
  284. package/dist/components/icon/icons/product-admin-icon.js +5 -5
  285. package/dist/components/icon/icons/product-analytics-icon.js +5 -5
  286. package/dist/components/icon/icons/product-booking-icon.js +5 -5
  287. package/dist/components/icon/icons/product-checkout-icon.js +5 -5
  288. package/dist/components/icon/icons/product-my-pages-icon.js +5 -5
  289. package/dist/components/icon/icons/product-staff-icon.js +5 -5
  290. package/dist/components/icon/icons/puck-icon.js +5 -5
  291. package/dist/components/icon/icons/qr-code-icon.js +5 -5
  292. package/dist/components/icon/icons/question-icon.js +5 -5
  293. package/dist/components/icon/icons/radio-icon.js +5 -5
  294. package/dist/components/icon/icons/receipt-icon.js +5 -5
  295. package/dist/components/icon/icons/redo-icon.js +5 -5
  296. package/dist/components/icon/icons/refund-icon.js +5 -5
  297. package/dist/components/icon/icons/remove-icon.js +5 -5
  298. package/dist/components/icon/icons/replace-icon.js +5 -5
  299. package/dist/components/icon/icons/schedule-icon.js +5 -5
  300. package/dist/components/icon/icons/search-icon.js +5 -5
  301. package/dist/components/icon/icons/select-icon.js +4 -4
  302. package/dist/components/icon/icons/send-icon.js +5 -5
  303. package/dist/components/icon/icons/share-icon.js +5 -5
  304. package/dist/components/icon/icons/show-icon.js +5 -5
  305. package/dist/components/icon/icons/shuffle-icon.js +5 -5
  306. package/dist/components/icon/icons/sidebar-hide-icon.js +4 -4
  307. package/dist/components/icon/icons/sidebar-left-icon.js +4 -4
  308. package/dist/components/icon/icons/sidebar-right-icon.js +5 -5
  309. package/dist/components/icon/icons/sidebar-show-icon.js +5 -5
  310. package/dist/components/icon/icons/sliders-icon.js +5 -5
  311. package/dist/components/icon/icons/slightly-sad-icon.js +5 -5
  312. package/dist/components/icon/icons/smile-icon.js +5 -5
  313. package/dist/components/icon/icons/sort-asc-icon.js +5 -5
  314. package/dist/components/icon/icons/sort-desc-icon.js +5 -5
  315. package/dist/components/icon/icons/split-icon.js +5 -5
  316. package/dist/components/icon/icons/status-icon.js +5 -5
  317. package/dist/components/icon/icons/stop-icon.js +5 -5
  318. package/dist/components/icon/icons/submenu-icon.js +5 -5
  319. package/dist/components/icon/icons/success-icon.js +5 -5
  320. package/dist/components/icon/icons/swap-icon.js +5 -5
  321. package/dist/components/icon/icons/swatch-icon.js +5 -5
  322. package/dist/components/icon/icons/sweat-icon.js +5 -5
  323. package/dist/components/icon/icons/table-icon.js +5 -5
  324. package/dist/components/icon/icons/table-map-icon.js +5 -5
  325. package/dist/components/icon/icons/take-away-dot-com-icon.js +5 -5
  326. package/dist/components/icon/icons/take-away-icon.js +5 -5
  327. package/dist/components/icon/icons/talk-icon.js +5 -5
  328. package/dist/components/icon/icons/thumbtack-icon.js +5 -5
  329. package/dist/components/icon/icons/time-icon.js +5 -5
  330. package/dist/components/icon/icons/timeline-icon.js +5 -5
  331. package/dist/components/icon/icons/tip-icon.js +5 -5
  332. package/dist/components/icon/icons/title-icon.js +5 -5
  333. package/dist/components/icon/icons/translate-icon.js +5 -5
  334. package/dist/components/icon/icons/tree-view-collapse-icon.js +4 -4
  335. package/dist/components/icon/icons/tree-view-expand-icon.js +4 -4
  336. package/dist/components/icon/icons/tree-view-last-icon.js +4 -4
  337. package/dist/components/icon/icons/trend-down-icon.js +5 -5
  338. package/dist/components/icon/icons/trend-up-icon.js +5 -5
  339. package/dist/components/icon/icons/triangle-warning-icon.js +5 -5
  340. package/dist/components/icon/icons/trivec-icon.js +6 -6
  341. package/dist/components/icon/icons/uber-eats-icon.js +5 -5
  342. package/dist/components/icon/icons/undo-icon.js +5 -5
  343. package/dist/components/icon/icons/unlock-icon.js +5 -5
  344. package/dist/components/icon/icons/unwrap-content-icon.js +5 -5
  345. package/dist/components/icon/icons/up-icon.js +5 -5
  346. package/dist/components/icon/icons/user-group-icon.js +5 -5
  347. package/dist/components/icon/icons/user-icon.js +5 -5
  348. package/dist/components/icon/icons/user-permissions-icon.js +5 -5
  349. package/dist/components/icon/icons/user-wait-icon.js +5 -5
  350. package/dist/components/icon/icons/users-icon.js +5 -5
  351. package/dist/components/icon/icons/version-control-icon.js +5 -5
  352. package/dist/components/icon/icons/volume-high-icon.js +5 -5
  353. package/dist/components/icon/icons/volume-icon.js +5 -5
  354. package/dist/components/icon/icons/volume-low-icon.js +5 -5
  355. package/dist/components/icon/icons/volume-off-icon.js +5 -5
  356. package/dist/components/icon/icons/warning-icon.js +5 -5
  357. package/dist/components/icon/icons/waste-icon.js +5 -5
  358. package/dist/components/icon/icons/wifi-icon.js +5 -5
  359. package/dist/components/icon/icons/wifi-off-icon.js +5 -5
  360. package/dist/components/icon/icons/wolt-icon.js +5 -5
  361. package/dist/components/icon/icons/wrap-content-icon.js +5 -5
  362. package/dist/components/icon-button/icon-button.js +37 -39
  363. package/dist/components/image/image.js +12 -14
  364. package/dist/components/image-upload/image-cropper.helper.js +74 -82
  365. package/dist/components/image-upload/image-cropper.js +156 -183
  366. package/dist/components/image-upload/image-upload-dropzone.js +134 -112
  367. package/dist/components/image-upload/image-upload-helper.js +15 -19
  368. package/dist/components/image-upload/image-upload-icons.js +52 -20
  369. package/dist/components/image-upload/image-upload-modal.js +131 -106
  370. package/dist/components/image-upload/image-upload.js +96 -86
  371. package/dist/components/image-upload/translations.js +65 -65
  372. package/dist/components/image-upload/types.js +6 -4
  373. package/dist/components/input/helper.js +18 -29
  374. package/dist/components/input/input-addon-recipe.js +37 -43
  375. package/dist/components/input/input-recipe.js +124 -133
  376. package/dist/components/input/input.js +78 -83
  377. package/dist/components/link/link-recipe.js +18 -22
  378. package/dist/components/link/link.js +14 -14
  379. package/dist/components/list/list-item.js +15 -15
  380. package/dist/components/list/list.js +19 -20
  381. package/dist/components/menu/helper.js +12 -16
  382. package/dist/components/menu/menu-box-button.js +22 -18
  383. package/dist/components/menu/menu-button.js +18 -16
  384. package/dist/components/menu/menu-divider.js +31 -28
  385. package/dist/components/menu/menu-group.js +138 -142
  386. package/dist/components/menu/menu-icon-button.js +13 -11
  387. package/dist/components/menu/menu-item.js +44 -45
  388. package/dist/components/menu/menu-list.js +14 -15
  389. package/dist/components/menu/menu-recipe.js +67 -81
  390. package/dist/components/menu/menu.js +34 -41
  391. package/dist/components/message/message.js +52 -38
  392. package/dist/components/modal/modal-body-context.js +6 -7
  393. package/dist/components/modal/modal-body.js +17 -17
  394. package/dist/components/modal/modal-close-button.js +23 -18
  395. package/dist/components/modal/modal-footer.js +29 -32
  396. package/dist/components/modal/modal-header.js +17 -17
  397. package/dist/components/modal/modal-recipe.js +110 -141
  398. package/dist/components/modal/modal.js +54 -58
  399. package/dist/components/navigation-list/navigation-list-item.js +76 -88
  400. package/dist/components/navigation-list/navigation-list.js +23 -17
  401. package/dist/components/paginator/paginator-recipe.js +34 -40
  402. package/dist/components/paginator/paginator.js +65 -70
  403. package/dist/components/paginator/translations.js +35 -35
  404. package/dist/components/phone-input/country-data.js +31 -36
  405. package/dist/components/phone-input/country-list.js +45 -25
  406. package/dist/components/phone-input/country-selector.js +167 -115
  407. package/dist/components/phone-input/phone-input-helpers.js +91 -119
  408. package/dist/components/phone-input/phone-input.js +47 -42
  409. package/dist/components/phone-input/translations.js +53 -53
  410. package/dist/components/phone-input/use-phone-input.js +110 -137
  411. package/dist/components/quantity-button/minus-button.js +18 -16
  412. package/dist/components/quantity-button/plus-button.js +18 -16
  413. package/dist/components/quantity-button/quantity-button.js +72 -40
  414. package/dist/components/radio/check-icon.js +5 -5
  415. package/dist/components/radio/hover-styles.js +21 -36
  416. package/dist/components/radio/radio-group-context.js +5 -6
  417. package/dist/components/radio/radio-group-recipe.js +124 -142
  418. package/dist/components/radio/radio-group.js +30 -28
  419. package/dist/components/radio/radio.js +72 -55
  420. package/dist/components/radio-card/hover-styles.js +21 -36
  421. package/dist/components/radio-card/radio-card-group.js +24 -25
  422. package/dist/components/radio-card/radio-card.js +87 -67
  423. package/dist/components/rich-text-editor/boolean-control.js +51 -54
  424. package/dist/components/rich-text-editor/extensions.js +39 -34
  425. package/dist/components/rich-text-editor/index.js +26 -22
  426. package/dist/components/rich-text-editor/rich-text-editor-context.js +9 -11
  427. package/dist/components/rich-text-editor/rich-text-editor-control.js +290 -284
  428. package/dist/components/rich-text-editor/rich-text-editor-recipe.js +71 -83
  429. package/dist/components/rich-text-editor/rich-text-editor.js +72 -69
  430. package/dist/components/rich-text-editor/rich-text-renderer.js +32 -32
  431. package/dist/components/rich-text-editor/translations.js +119 -119
  432. package/dist/components/rich-text-editor/use-rich-text-editor.js +22 -29
  433. package/dist/components/segmented-control/segmented-control-item.js +24 -25
  434. package/dist/components/segmented-control/segmented-control.js +49 -40
  435. package/dist/components/select/select-recipe.js +91 -106
  436. package/dist/components/select/select.js +27 -29
  437. package/dist/components/skeleton/skeleton-text.js +18 -19
  438. package/dist/components/skeleton/skeleton.js +19 -20
  439. package/dist/components/spinner/spinner.js +44 -28
  440. package/dist/components/stack/stack.js +18 -18
  441. package/dist/components/stepper/check-icon.js +5 -5
  442. package/dist/components/stepper/step-context.js +5 -5
  443. package/dist/components/stepper/step.js +111 -106
  444. package/dist/components/stepper/stepper.js +42 -43
  445. package/dist/components/stepper/times-icon.js +5 -5
  446. package/dist/components/switch/hover-styles.js +30 -44
  447. package/dist/components/switch/switch-recipe.js +76 -84
  448. package/dist/components/switch/switch.d.ts +3 -3
  449. package/dist/components/switch/switch.d.ts.map +1 -1
  450. package/dist/components/switch/switch.js +30 -31
  451. package/dist/components/switch/types.d.ts +4 -2
  452. package/dist/components/switch/types.d.ts.map +1 -1
  453. package/dist/components/table/helper.d.ts +6 -0
  454. package/dist/components/table/helper.d.ts.map +1 -1
  455. package/dist/components/table/helper.js +29 -9
  456. package/dist/components/table/index.d.ts +1 -1
  457. package/dist/components/table/index.d.ts.map +1 -1
  458. package/dist/components/table/table-cell.d.ts.map +1 -1
  459. package/dist/components/table/table-cell.js +136 -122
  460. package/dist/components/table/table-column-resize-handle.d.ts +12 -0
  461. package/dist/components/table/table-column-resize-handle.d.ts.map +1 -0
  462. package/dist/components/table/table-column-resize-handle.js +69 -0
  463. package/dist/components/table/table-content.d.ts.map +1 -1
  464. package/dist/components/table/table-content.js +174 -98
  465. package/dist/components/table/table-context-provider.d.ts +7 -2
  466. package/dist/components/table/table-context-provider.d.ts.map +1 -1
  467. package/dist/components/table/table-context-provider.js +203 -151
  468. package/dist/components/table/table-context.d.ts +24 -0
  469. package/dist/components/table/table-context.d.ts.map +1 -1
  470. package/dist/components/table/table-context.js +18 -11
  471. package/dist/components/table/table-filter.js +170 -118
  472. package/dist/components/table/table-header-dropdown.js +131 -89
  473. package/dist/components/table/table-header-row.d.ts.map +1 -1
  474. package/dist/components/table/table-header-row.js +202 -140
  475. package/dist/components/table/table-recipe.d.ts.map +1 -1
  476. package/dist/components/table/table-recipe.js +75 -96
  477. package/dist/components/table/table-row-expand-toggle-button.js +28 -35
  478. package/dist/components/table/table-row.d.ts.map +1 -1
  479. package/dist/components/table/table-row.js +51 -41
  480. package/dist/components/table/table-toolbar-actions.js +19 -19
  481. package/dist/components/table/table-toolbar-add-button.js +18 -13
  482. package/dist/components/table/table-toolbar-search.js +17 -12
  483. package/dist/components/table/table-toolbar-settings.js +180 -133
  484. package/dist/components/table/table-toolbar.js +72 -51
  485. package/dist/components/table/table.composition.d.ts +1 -0
  486. package/dist/components/table/table.composition.d.ts.map +1 -1
  487. package/dist/components/table/table.constants.d.ts +4 -0
  488. package/dist/components/table/table.constants.d.ts.map +1 -1
  489. package/dist/components/table/table.constants.js +9 -4
  490. package/dist/components/table/table.d.ts +1 -1
  491. package/dist/components/table/table.d.ts.map +1 -1
  492. package/dist/components/table/table.js +41 -37
  493. package/dist/components/table/translations.d.ts +7 -0
  494. package/dist/components/table/translations.d.ts.map +1 -1
  495. package/dist/components/table/translations.js +199 -194
  496. package/dist/components/table/types.d.ts +33 -2
  497. package/dist/components/table/types.d.ts.map +1 -1
  498. package/dist/components/tabs/tab-list.js +16 -17
  499. package/dist/components/tabs/tab-panel.js +14 -14
  500. package/dist/components/tabs/tab-panels.js +15 -15
  501. package/dist/components/tabs/tab-with-image.js +60 -53
  502. package/dist/components/tabs/tab.js +26 -22
  503. package/dist/components/tabs/tabs-recipe.js +96 -116
  504. package/dist/components/tabs/tabs.js +25 -24
  505. package/dist/components/tag/tag-recipe.js +225 -252
  506. package/dist/components/tag/tag.js +121 -62
  507. package/dist/components/text/text-recipe.js +3 -8
  508. package/dist/components/text/text.js +26 -27
  509. package/dist/components/textarea/textarea-recipe.js +90 -96
  510. package/dist/components/textarea/textarea.js +19 -19
  511. package/dist/components/toaster/toast-store.d.ts +2 -2
  512. package/dist/components/toaster/toast-store.d.ts.map +1 -1
  513. package/dist/components/toaster/toast-store.js +25 -32
  514. package/dist/components/toaster/toaster.js +39 -34
  515. package/dist/components/toggle-button/toggle-button.js +23 -25
  516. package/dist/components/toggle-button/use-button-children.js +36 -35
  517. package/dist/components/tooltip/tooltip.js +43 -47
  518. package/dist/hooks/use-color-mode.js +17 -22
  519. package/dist/hooks/use-disclosure.js +10 -13
  520. package/dist/hooks/use-measured-width.js +21 -21
  521. package/dist/hooks/use-remove-attributes.js +25 -24
  522. package/dist/index.js +395 -799
  523. package/dist/node_modules/@dnd-kit/abstract/index.js +658 -1185
  524. package/dist/node_modules/@dnd-kit/collision/dist/index.js +51 -90
  525. package/dist/node_modules/@dnd-kit/dom/index.js +1256 -1518
  526. package/dist/node_modules/@dnd-kit/dom/sortable.js +529 -654
  527. package/dist/node_modules/@dnd-kit/dom/utilities.js +772 -940
  528. package/dist/node_modules/@dnd-kit/geometry/dist/index.js +228 -196
  529. package/dist/node_modules/@dnd-kit/react/hooks.js +51 -63
  530. package/dist/node_modules/@dnd-kit/react/index.js +175 -235
  531. package/dist/node_modules/@dnd-kit/react/sortable.js +67 -142
  532. package/dist/node_modules/@dnd-kit/react/utilities.js +7 -9
  533. package/dist/node_modules/@dnd-kit/state/dist/index.js +157 -172
  534. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +154 -243
  535. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +294 -369
  536. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +95 -133
  537. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +96 -122
  538. package/dist/node_modules/@preact/signals-core/dist/signals-core.module.js +249 -264
  539. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +34 -88
  540. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +74 -88
  541. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1463 -1822
  542. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +633 -768
  543. package/dist/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +30 -32
  544. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +35 -48
  545. package/dist/node_modules/@tiptap/core/dist/index.js +3433 -3946
  546. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +19 -19
  547. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +73 -1498
  548. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +71 -84
  549. package/dist/node_modules/@tiptap/extension-code/dist/index.js +65 -70
  550. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +155 -216
  551. package/dist/node_modules/@tiptap/extension-document/dist/index.js +9 -11
  552. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +48 -60
  553. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +65 -66
  554. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +47 -55
  555. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +68 -82
  556. package/dist/node_modules/@tiptap/extension-link/dist/index.js +365 -334
  557. package/dist/node_modules/@tiptap/extension-list/dist/index.js +936 -1105
  558. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +43 -48
  559. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +53 -65
  560. package/dist/node_modules/@tiptap/extension-text/dist/index.js +12 -12
  561. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +60 -64
  562. package/dist/node_modules/@tiptap/extensions/dist/index.js +439 -462
  563. package/dist/node_modules/@tiptap/react/dist/index.js +314 -0
  564. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +23 -24
  565. package/dist/node_modules/country-flag-icons/modules/countries.json.js +4 -4
  566. package/dist/node_modules/country-flag-icons/modules/hasFlag.js +6 -6
  567. package/dist/node_modules/country-flag-icons/modules/react/3x2/index.js +5469 -6298
  568. package/dist/node_modules/country-flag-icons/react/3x2/index.js +273 -269
  569. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +5 -6
  570. package/dist/node_modules/date-fns/_lib/defaultOptions.js +6 -6
  571. package/dist/node_modules/date-fns/_lib/format/formatters.js +385 -544
  572. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +42 -57
  573. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +37 -48
  574. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +7 -17
  575. package/dist/node_modules/date-fns/_lib/normalizeDates.js +6 -9
  576. package/dist/node_modules/date-fns/_lib/protectedTokens.js +19 -16
  577. package/dist/node_modules/date-fns/addDays.js +8 -8
  578. package/dist/node_modules/date-fns/addMonths.js +11 -18
  579. package/dist/node_modules/date-fns/addWeeks.js +6 -6
  580. package/dist/node_modules/date-fns/constants.js +10 -6
  581. package/dist/node_modules/date-fns/constructFrom.js +6 -6
  582. package/dist/node_modules/date-fns/constructNow.js +6 -6
  583. package/dist/node_modules/date-fns/differenceInCalendarDays.js +10 -14
  584. package/dist/node_modules/date-fns/endOfDay.js +7 -7
  585. package/dist/node_modules/date-fns/endOfMonth.js +7 -7
  586. package/dist/node_modules/date-fns/format.js +57 -55
  587. package/dist/node_modules/date-fns/getDayOfYear.js +9 -9
  588. package/dist/node_modules/date-fns/getISOWeek.js +10 -10
  589. package/dist/node_modules/date-fns/getISOWeekYear.js +13 -13
  590. package/dist/node_modules/date-fns/getWeek.js +10 -10
  591. package/dist/node_modules/date-fns/getWeekYear.js +14 -14
  592. package/dist/node_modules/date-fns/isBefore.js +6 -6
  593. package/dist/node_modules/date-fns/isDate.js +5 -5
  594. package/dist/node_modules/date-fns/isPast.js +6 -6
  595. package/dist/node_modules/date-fns/isSameDay.js +8 -12
  596. package/dist/node_modules/date-fns/isSameMonth.js +7 -11
  597. package/dist/node_modules/date-fns/isSameWeek.js +8 -12
  598. package/dist/node_modules/date-fns/isSameYear.js +7 -11
  599. package/dist/node_modules/date-fns/isToday.js +7 -10
  600. package/dist/node_modules/date-fns/isValid.js +7 -7
  601. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +8 -8
  602. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +16 -17
  603. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +19 -28
  604. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +17 -14
  605. package/dist/node_modules/date-fns/locale/da/_lib/formatDistance.js +68 -69
  606. package/dist/node_modules/date-fns/locale/da/_lib/formatLong.js +31 -32
  607. package/dist/node_modules/date-fns/locale/da/_lib/formatRelative.js +11 -11
  608. package/dist/node_modules/date-fns/locale/da/_lib/localize.js +193 -142
  609. package/dist/node_modules/date-fns/locale/da/_lib/match.js +123 -109
  610. package/dist/node_modules/date-fns/locale/da.js +17 -17
  611. package/dist/node_modules/date-fns/locale/en-GB/_lib/formatLong.js +31 -32
  612. package/dist/node_modules/date-fns/locale/en-GB.js +18 -18
  613. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +68 -69
  614. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +31 -32
  615. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -11
  616. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +200 -153
  617. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +123 -109
  618. package/dist/node_modules/date-fns/locale/en-US.js +18 -18
  619. package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +68 -69
  620. package/dist/node_modules/date-fns/locale/es/_lib/formatLong.js +31 -32
  621. package/dist/node_modules/date-fns/locale/es/_lib/formatRelative.js +18 -18
  622. package/dist/node_modules/date-fns/locale/es/_lib/localize.js +192 -141
  623. package/dist/node_modules/date-fns/locale/es/_lib/match.js +127 -114
  624. package/dist/node_modules/date-fns/locale/es.js +18 -18
  625. package/dist/node_modules/date-fns/locale/et/_lib/formatDistance.js +161 -162
  626. package/dist/node_modules/date-fns/locale/et/_lib/formatLong.js +31 -32
  627. package/dist/node_modules/date-fns/locale/et/_lib/formatRelative.js +11 -11
  628. package/dist/node_modules/date-fns/locale/et/_lib/localize.js +196 -152
  629. package/dist/node_modules/date-fns/locale/et/_lib/match.js +109 -107
  630. package/dist/node_modules/date-fns/locale/et.js +19 -19
  631. package/dist/node_modules/date-fns/locale/fi/_lib/formatDistance.js +101 -101
  632. package/dist/node_modules/date-fns/locale/fi/_lib/formatLong.js +31 -32
  633. package/dist/node_modules/date-fns/locale/fi/_lib/formatRelative.js +11 -11
  634. package/dist/node_modules/date-fns/locale/fi/_lib/localize.js +192 -140
  635. package/dist/node_modules/date-fns/locale/fi/_lib/match.js +122 -108
  636. package/dist/node_modules/date-fns/locale/fi.js +18 -18
  637. package/dist/node_modules/date-fns/locale/fr/_lib/formatDistance.js +68 -69
  638. package/dist/node_modules/date-fns/locale/fr/_lib/formatLong.js +31 -32
  639. package/dist/node_modules/date-fns/locale/fr/_lib/formatRelative.js +11 -11
  640. package/dist/node_modules/date-fns/locale/fr/_lib/localize.js +176 -120
  641. package/dist/node_modules/date-fns/locale/fr/_lib/match.js +122 -108
  642. package/dist/node_modules/date-fns/locale/fr.js +18 -18
  643. package/dist/node_modules/date-fns/locale/lt/_lib/formatDistance.js +93 -109
  644. package/dist/node_modules/date-fns/locale/lt/_lib/formatLong.js +31 -32
  645. package/dist/node_modules/date-fns/locale/lt/_lib/formatRelative.js +11 -11
  646. package/dist/node_modules/date-fns/locale/lt/_lib/localize.js +298 -195
  647. package/dist/node_modules/date-fns/locale/lt/_lib/match.js +154 -121
  648. package/dist/node_modules/date-fns/locale/lt.js +19 -19
  649. package/dist/node_modules/date-fns/locale/lv/_lib/formatDistance.js +226 -120
  650. package/dist/node_modules/date-fns/locale/lv/_lib/formatLong.js +31 -32
  651. package/dist/node_modules/date-fns/locale/lv/_lib/formatRelative.js +22 -22
  652. package/dist/node_modules/date-fns/locale/lv/_lib/localize.js +298 -221
  653. package/dist/node_modules/date-fns/locale/lv/_lib/match.js +138 -112
  654. package/dist/node_modules/date-fns/locale/lv.js +18 -18
  655. package/dist/node_modules/date-fns/locale/nb/_lib/formatDistance.js +68 -69
  656. package/dist/node_modules/date-fns/locale/nb/_lib/formatLong.js +31 -32
  657. package/dist/node_modules/date-fns/locale/nb/_lib/formatRelative.js +11 -11
  658. package/dist/node_modules/date-fns/locale/nb/_lib/localize.js +159 -108
  659. package/dist/node_modules/date-fns/locale/nb/_lib/match.js +112 -108
  660. package/dist/node_modules/date-fns/locale/nb.js +18 -18
  661. package/dist/node_modules/date-fns/locale/nl/_lib/formatDistance.js +68 -69
  662. package/dist/node_modules/date-fns/locale/nl/_lib/formatLong.js +31 -32
  663. package/dist/node_modules/date-fns/locale/nl/_lib/formatRelative.js +11 -11
  664. package/dist/node_modules/date-fns/locale/nl/_lib/localize.js +160 -109
  665. package/dist/node_modules/date-fns/locale/nl/_lib/match.js +120 -108
  666. package/dist/node_modules/date-fns/locale/nl-BE/_lib/formatDistance.js +68 -69
  667. package/dist/node_modules/date-fns/locale/nl-BE/_lib/formatLong.js +31 -32
  668. package/dist/node_modules/date-fns/locale/nl-BE/_lib/formatRelative.js +11 -11
  669. package/dist/node_modules/date-fns/locale/nl-BE/_lib/localize.js +160 -109
  670. package/dist/node_modules/date-fns/locale/nl-BE/_lib/match.js +120 -108
  671. package/dist/node_modules/date-fns/locale/nl-BE.js +18 -18
  672. package/dist/node_modules/date-fns/locale/nl.js +18 -18
  673. package/dist/node_modules/date-fns/locale/sv/_lib/formatDistance.js +82 -86
  674. package/dist/node_modules/date-fns/locale/sv/_lib/formatLong.js +31 -32
  675. package/dist/node_modules/date-fns/locale/sv/_lib/formatRelative.js +11 -11
  676. package/dist/node_modules/date-fns/locale/sv/_lib/localize.js +199 -142
  677. package/dist/node_modules/date-fns/locale/sv/_lib/match.js +109 -107
  678. package/dist/node_modules/date-fns/locale/sv.js +18 -18
  679. package/dist/node_modules/date-fns/startOfDay.js +7 -7
  680. package/dist/node_modules/date-fns/startOfISOWeek.js +9 -6
  681. package/dist/node_modules/date-fns/startOfISOWeekYear.js +9 -9
  682. package/dist/node_modules/date-fns/startOfMonth.js +7 -7
  683. package/dist/node_modules/date-fns/startOfWeek.js +8 -8
  684. package/dist/node_modules/date-fns/startOfWeekYear.js +10 -10
  685. package/dist/node_modules/date-fns/startOfYear.js +7 -7
  686. package/dist/node_modules/date-fns/subDays.js +6 -6
  687. package/dist/node_modules/date-fns/subMonths.js +6 -6
  688. package/dist/node_modules/date-fns/subWeeks.js +6 -6
  689. package/dist/node_modules/date-fns/toDate.js +6 -6
  690. package/dist/node_modules/fast-equals/dist/es/index.js +239 -298
  691. package/dist/node_modules/libphonenumber-js/es6/ParseError.js +116 -89
  692. package/dist/node_modules/libphonenumber-js/es6/PhoneNumber.js +155 -183
  693. package/dist/node_modules/libphonenumber-js/es6/constants.js +4 -10
  694. package/dist/node_modules/libphonenumber-js/es6/format.js +70 -91
  695. package/dist/node_modules/libphonenumber-js/es6/getCountries.js +5 -5
  696. package/dist/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +8 -10
  697. package/dist/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +5 -5
  698. package/dist/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +19 -14
  699. package/dist/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +9 -9
  700. package/dist/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +15 -17
  701. package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +35 -45
  702. package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +20 -26
  703. package/dist/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +17 -22
  704. package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +24 -36
  705. package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +26 -30
  706. package/dist/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +13 -21
  707. package/dist/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +10 -24
  708. package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js +10 -11
  709. package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +6 -8
  710. package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +39 -39
  711. package/dist/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +9 -11
  712. package/dist/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +56 -47
  713. package/dist/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +12 -12
  714. package/dist/node_modules/libphonenumber-js/es6/helpers/isCallingCode.js +5 -5
  715. package/dist/node_modules/libphonenumber-js/es6/helpers/isCountryCode.js +5 -5
  716. package/dist/node_modules/libphonenumber-js/es6/helpers/isObject.js +6 -6
  717. package/dist/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +9 -17
  718. package/dist/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +5 -5
  719. package/dist/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js +39 -0
  720. package/dist/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +46 -77
  721. package/dist/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +17 -18
  722. package/dist/node_modules/libphonenumber-js/es6/isPossible.js +29 -32
  723. package/dist/node_modules/libphonenumber-js/es6/isValid.js +12 -13
  724. package/dist/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +55 -52
  725. package/dist/node_modules/libphonenumber-js/es6/metadata.js +462 -482
  726. package/dist/node_modules/libphonenumber-js/es6/normalizeArguments.js +97 -95
  727. package/dist/node_modules/libphonenumber-js/es6/parse.js +98 -133
  728. package/dist/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +43 -35
  729. package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +8 -8
  730. package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +51 -48
  731. package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +59 -55
  732. package/dist/node_modules/libphonenumber-js/es6/tools/semver-compare.js +13 -13
  733. package/dist/node_modules/libphonenumber-js/metadata.min.json.js +7437 -3
  734. package/dist/node_modules/libphonenumber-js/min/exports/getCountries.js +6 -6
  735. package/dist/node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js +6 -6
  736. package/dist/node_modules/libphonenumber-js/min/exports/isSupportedCountry.js +7 -7
  737. package/dist/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js +6 -6
  738. package/dist/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +7 -7
  739. package/dist/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +6 -6
  740. package/dist/node_modules/linkifyjs/dist/linkify.js +486 -679
  741. package/dist/node_modules/next-themes/dist/index.js +120 -85
  742. package/dist/node_modules/orderedmap/dist/index.js +64 -100
  743. package/dist/node_modules/prosemirror-commands/dist/index.js +313 -368
  744. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +109 -84
  745. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +162 -195
  746. package/dist/node_modules/prosemirror-history/dist/index.js +203 -239
  747. package/dist/node_modules/prosemirror-keymap/dist/index.js +45 -57
  748. package/dist/node_modules/prosemirror-model/dist/index.js +1783 -2735
  749. package/dist/node_modules/prosemirror-schema-list/dist/index.js +66 -81
  750. package/dist/node_modules/prosemirror-state/dist/index.js +517 -814
  751. package/dist/node_modules/prosemirror-transform/dist/index.js +1104 -1505
  752. package/dist/node_modules/prosemirror-view/dist/index.js +3274 -3782
  753. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +15 -21
  754. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +12 -14
  755. package/dist/node_modules/react/compiler-runtime.js +10 -10
  756. package/dist/node_modules/rope-sequence/dist/index.js +82 -99
  757. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +55 -58
  758. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +53 -57
  759. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +53 -58
  760. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +45 -46
  761. package/dist/node_modules/use-sync-external-store/shim/index.js +10 -10
  762. package/dist/node_modules/use-sync-external-store/shim/with-selector.js +10 -10
  763. package/dist/node_modules/w3c-keyname/index.js +87 -92
  764. package/dist/theme/component-recipes.js +52 -53
  765. package/dist/theme/theme-casper-ui.js +179 -420
  766. package/dist/theme/theme-helper.js +4 -4
  767. package/dist/theme/theme-provider.js +33 -34
  768. package/dist/theme/theme-style-props.d.ts.map +1 -1
  769. package/dist/theme/theme-tokens.js +22 -12
  770. package/dist/theme/theme-types.js +22 -12
  771. package/dist/theme/theme.js +213 -268
  772. package/package.json +30 -29
  773. package/dist/_virtual/compiler-runtime.js +0 -5
  774. package/dist/_virtual/compiler-runtime2.js +0 -4
  775. package/dist/_virtual/index.js +0 -5
  776. package/dist/_virtual/index2.js +0 -4
  777. package/dist/_virtual/react-compiler-runtime.development.js +0 -4
  778. package/dist/_virtual/react-compiler-runtime.production.js +0 -4
  779. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -4
  780. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -4
  781. package/dist/_virtual/with-selector.development.js +0 -4
  782. package/dist/_virtual/with-selector.js +0 -5
  783. package/dist/_virtual/with-selector.production.js +0 -4
  784. package/dist/_virtual/with-selector2.js +0 -4
  785. package/dist/packages/casper-ui-library/node_modules/@tiptap/react/dist/index.js +0 -506
@@ -1,770 +1,635 @@
1
- import { createLazyMeasurementsView as F } from "./lazy-measurements.js";
2
- import { memo as M, notUndefined as w, approxEqual as R, debounce as D } from "./utils.js";
3
- let z;
4
- const y = () => {
5
- if (z !== void 0) return z;
6
- if (typeof navigator > "u") return z = !1;
7
- if (/iP(hone|od|ad)/.test(navigator.userAgent)) return z = !0;
8
- const r = navigator.maxTouchPoints;
9
- return z = navigator.platform === "MacIntel" && r !== void 0 && r > 0;
10
- }, C = (r) => {
11
- const { offsetWidth: a, offsetHeight: t } = r;
12
- return { width: a, height: t };
13
- }, k = (r) => r, W = (r) => {
14
- const a = Math.max(r.startIndex - r.overscan, 0), e = Math.min(r.endIndex + r.overscan, r.count - 1) - a + 1, s = new Array(e);
15
- for (let i = 0; i < e; i++)
16
- s[i] = a + i;
17
- return s;
18
- }, H = (r, a) => {
19
- const t = r.scrollElement;
20
- if (!t)
21
- return;
22
- const e = r.targetWindow;
23
- if (!e)
24
- return;
25
- const s = (n) => {
26
- const { width: o, height: l } = n;
27
- a({ width: Math.round(o), height: Math.round(l) });
28
- };
29
- if (s(C(t)), !e.ResizeObserver)
30
- return () => {
31
- };
32
- const i = new e.ResizeObserver((n) => {
33
- const o = () => {
34
- const l = n[0];
35
- if (l?.borderBoxSize) {
36
- const u = l.borderBoxSize[0];
37
- if (u) {
38
- s({ width: u.inlineSize, height: u.blockSize });
39
- return;
40
- }
41
- }
42
- s(C(t));
43
- };
44
- r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
45
- });
46
- return i.observe(t, { box: "border-box" }), () => {
47
- i.unobserve(t);
48
- };
49
- }, x = {
50
- passive: !0
51
- }, L = typeof window > "u" ? !0 : "onscrollend" in window, j = (r, a, t) => {
52
- const e = r.scrollElement;
53
- if (!e)
54
- return;
55
- const s = r.targetWindow;
56
- if (!s)
57
- return;
58
- const i = r.options.useScrollendEvent && L;
59
- let n = 0;
60
- const o = i ? null : D(
61
- s,
62
- () => a(n, !1),
63
- r.options.isScrollingResetDelay
64
- ), l = (m) => () => {
65
- n = t(e), o?.(), a(n, m);
66
- }, u = l(!0), d = l(!1);
67
- return e.addEventListener("scroll", u, x), i && e.addEventListener("scrollend", d, x), () => {
68
- e.removeEventListener("scroll", u), i && e.removeEventListener("scrollend", d);
69
- };
70
- }, J = (r, a) => j(r, a, (t) => {
71
- const { horizontal: e, isRtl: s } = r.options;
72
- return e ? t.scrollLeft * (s && -1 || 1) : t.scrollTop;
73
- }), V = (r, a, t) => {
74
- if (t.options.useCachedMeasurements) {
75
- const e = t.indexFromElement(r), s = t.options.getItemKey(e);
76
- return t.itemSizeCache.get(s) ?? t.options.estimateSize(e);
77
- }
78
- if (a?.borderBoxSize) {
79
- const e = a.borderBoxSize[0];
80
- if (e)
81
- return Math.round(
82
- e[t.options.horizontal ? "inlineSize" : "blockSize"]
83
- );
84
- }
85
- if (!a) {
86
- const e = t.indexFromElement(r), s = t.options.getItemKey(e), i = t.itemSizeCache.get(s);
87
- if (i !== void 0)
88
- return i;
89
- }
90
- return r[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
91
- }, N = (r, {
92
- adjustments: a = 0,
93
- behavior: t
94
- }, e) => {
95
- var s, i;
96
- (i = (s = e.scrollElement) == null ? void 0 : s.scrollTo) == null || i.call(s, {
97
- [e.options.horizontal ? "left" : "top"]: r + a,
98
- behavior: t
99
- });
100
- }, q = N;
101
- class U {
102
- constructor(a) {
103
- this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._flatMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._intendedScrollOffset = null, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
104
- var t, e, s;
105
- return ((s = (e = (t = this.targetWindow) == null ? void 0 : t.performance) == null ? void 0 : e.now) == null ? void 0 : s.call(e)) ?? Date.now();
106
- }, this.observer = /* @__PURE__ */ (() => {
107
- let t = null;
108
- const e = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
109
- s.forEach((i) => {
110
- const n = () => {
111
- const o = i.target, l = this.indexFromElement(o);
112
- if (!o.isConnected) {
113
- this.observer.unobserve(o);
114
- for (const [u, d] of this.elementsCache)
115
- if (d === o) {
116
- this.elementsCache.delete(u);
117
- break;
118
- }
119
- return;
120
- }
121
- this.shouldMeasureDuringScroll(l) && this.resizeItem(
122
- l,
123
- this.options.measureElement(o, i, this)
124
- );
125
- };
126
- this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
127
- });
128
- }));
129
- return {
130
- disconnect: () => {
131
- var s;
132
- (s = e()) == null || s.disconnect(), t = null;
133
- },
134
- observe: (s) => {
135
- var i;
136
- return (i = e()) == null ? void 0 : i.observe(s, { box: "border-box" });
137
- },
138
- unobserve: (s) => {
139
- var i;
140
- return (i = e()) == null ? void 0 : i.unobserve(s);
141
- }
142
- };
143
- })(), this.range = null, this.setOptions = (t) => {
144
- var e, s;
145
- const i = {
146
- debug: !1,
147
- initialOffset: 0,
148
- overscan: 1,
149
- paddingStart: 0,
150
- paddingEnd: 0,
151
- scrollPaddingStart: 0,
152
- scrollPaddingEnd: 0,
153
- horizontal: !1,
154
- getItemKey: k,
155
- rangeExtractor: W,
156
- onChange: () => {
157
- },
158
- measureElement: V,
159
- initialRect: { width: 0, height: 0 },
160
- scrollMargin: 0,
161
- gap: 0,
162
- indexAttribute: "data-index",
163
- initialMeasurementsCache: [],
164
- lanes: 1,
165
- anchorTo: "start",
166
- followOnAppend: !1,
167
- scrollEndThreshold: 1,
168
- isScrollingResetDelay: 150,
169
- enabled: !0,
170
- isRtl: !1,
171
- useScrollendEvent: !1,
172
- useAnimationFrameWithResizeObserver: !1,
173
- laneAssignmentMode: "estimate",
174
- useCachedMeasurements: !1
175
- };
176
- for (const h in t) {
177
- const S = t[h];
178
- S !== void 0 && (i[h] = S);
179
- }
180
- const n = this.options;
181
- let o = null, l = null, u = !1;
182
- if (n !== void 0 && n.enabled && i.enabled && i.anchorTo === "end" && this.scrollElement !== null) {
183
- const h = n.count, S = i.count, c = this.getMeasurements(), v = h > 0 ? ((e = c[0]) == null ? void 0 : e.key) ?? n.getItemKey(0) : null, g = h > 0 ? ((s = c[h - 1]) == null ? void 0 : s.key) ?? n.getItemKey(h - 1) : null;
184
- if (S !== h || h > 0 && S > 0 && (i.getItemKey(0) !== v || i.getItemKey(S - 1) !== g)) {
185
- u = !0;
186
- const f = h > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? c[0] : null;
187
- f && (o = [f.key, this.getScrollOffset() - f.start]);
188
- const b = i.followOnAppend === !0 ? "auto" : i.followOnAppend || null;
189
- b && S > h && this.isAtEnd(n.scrollEndThreshold) && (h === 0 || i.getItemKey(S - 1) !== g) && (l = b);
190
- }
191
- }
192
- this.options = i, u && (this.pendingMin = 0, this.itemSizeCacheVersion++);
193
- let d = !1, m = 0;
194
- if (o && this.scrollOffset !== null) {
195
- const [h, S] = o, c = this.getMeasurements(), { count: v, getItemKey: g } = this.options;
196
- let p = 0;
197
- for (; p < v && g(p) !== h; )
198
- p++;
199
- if (p < v) {
200
- const E = c[p];
201
- if (E) {
202
- const f = E.start + S;
203
- f !== this.scrollOffset && (m = f - this.scrollOffset, this.scrollOffset = f, d = !0);
204
- }
205
- }
206
- }
207
- (d || l) && (this.pendingScrollAnchor = [
208
- d ? o[0] : null,
209
- d ? o[1] : 0,
210
- l,
211
- m
212
- ]);
213
- }, this.notify = (t) => {
214
- var e, s;
215
- (s = (e = this.options).onChange) == null || s.call(e, this, t);
216
- }, this.maybeNotify = M(
217
- () => (this.calculateRange(), [
218
- this.isScrolling,
219
- this.range ? this.range.startIndex : null,
220
- this.range ? this.range.endIndex : null
221
- ]),
222
- (t) => {
223
- this.notify(t);
224
- },
225
- {
226
- key: process.env.NODE_ENV !== "production" && "maybeNotify",
227
- debug: () => this.options.debug,
228
- initialDeps: [
229
- this.isScrolling,
230
- this.range ? this.range.startIndex : null,
231
- this.range ? this.range.endIndex : null
232
- ]
233
- }
234
- ), this.cleanup = () => {
235
- this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
236
- }, this._didMount = () => () => {
237
- this.cleanup();
238
- }, this._willUpdate = () => {
239
- var t;
240
- const e = this.options.enabled ? this.options.getScrollElement() : null;
241
- if (this.scrollElement !== e) {
242
- if (this.cleanup(), !e) {
243
- this.maybeNotify();
244
- return;
245
- }
246
- if (this.scrollElement = e, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((i) => {
247
- this.observer.observe(i);
248
- }), this.unsubs.push(
249
- this.options.observeElementRect(this, (i) => {
250
- this.scrollRect = i, this.maybeNotify();
251
- })
252
- ), this.unsubs.push(
253
- this.options.observeElementOffset(this, (i, n) => {
254
- this._intendedScrollOffset !== null && Math.abs(i - this._intendedScrollOffset) < 1.5 && (i = this._intendedScrollOffset), this._intendedScrollOffset = null, this.scrollAdjustments = 0, this.scrollDirection = n ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = n, this._flushIosDeferredIfReady(), this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
255
- })
256
- ), "addEventListener" in this.scrollElement) {
257
- const i = this.scrollElement, n = () => {
258
- this._iosTouching = !0, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
259
- }, o = () => {
260
- this._iosTouching = !1, !(!y() || this.targetWindow == null) && (this._iosJustTouchEnded = !0, this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
261
- this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._flushIosDeferredIfReady();
262
- }, 150));
263
- };
264
- i.addEventListener(
265
- "touchstart",
266
- n,
267
- x
268
- ), i.addEventListener(
269
- "touchend",
270
- o,
271
- x
272
- ), this.unsubs.push(() => {
273
- i.removeEventListener("touchstart", n), i.removeEventListener("touchend", o), this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
274
- });
275
- }
276
- this._scrollToOffset(this.getScrollOffset(), {
277
- adjustments: void 0,
278
- behavior: void 0
279
- });
280
- }
281
- const s = this.pendingScrollAnchor;
282
- if (this.pendingScrollAnchor = null, s && this.scrollElement && this.options.enabled) {
283
- const [i, n, o, l] = s;
284
- i !== null && !o && (y() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? l !== 0 && (this._iosDeferredAdjustment += l) : this._scrollToOffset(this.getScrollOffset(), {
285
- adjustments: void 0,
286
- behavior: void 0
287
- })), o && this.scrollToEnd({ behavior: o });
288
- }
289
- }, this._flushIosDeferredIfReady = () => {
290
- if (this._iosDeferredAdjustment === 0 || this.isScrolling || this._iosTouching || this._iosJustTouchEnded) return;
291
- const t = this.getScrollOffset(), e = this.getMaxScrollOffset();
292
- if (t < 0 || t > e) return;
293
- const s = this._iosDeferredAdjustment;
294
- this._iosDeferredAdjustment = 0, this._scrollToOffset(t, {
295
- adjustments: this.scrollAdjustments += s,
296
- behavior: void 0
297
- });
298
- }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, e) => {
299
- const s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
300
- for (let n = e - 1; n >= 0; n--) {
301
- const o = t[n];
302
- if (s.has(o.lane))
303
- continue;
304
- const l = i.get(
305
- o.lane
306
- );
307
- if (l == null || o.end > l.end ? i.set(o.lane, o) : o.end < l.end && s.set(o.lane, !0), s.size === this.options.lanes)
308
- break;
309
- }
310
- return i.size === this.options.lanes ? Array.from(i.values()).sort((n, o) => n.end === o.end ? n.index - o.index : n.end - o.end)[0] : void 0;
311
- }, this.getMeasurementOptions = M(
312
- () => [
313
- this.options.count,
314
- this.options.paddingStart,
315
- this.options.scrollMargin,
316
- this.options.getItemKey,
317
- this.options.enabled,
318
- this.options.lanes,
319
- this.options.laneAssignmentMode
320
- ],
321
- (t, e, s, i, n, o, l) => (this.prevLanes !== void 0 && this.prevLanes !== o && (this.lanesChangedFlag = !0), this.prevLanes = o, this.pendingMin = null, {
322
- count: t,
323
- paddingStart: e,
324
- scrollMargin: s,
325
- getItemKey: i,
326
- enabled: n,
327
- lanes: o,
328
- laneAssignmentMode: l
329
- }),
330
- {
331
- key: !1
332
- }
333
- ), this.getMeasurements = M(
334
- () => [this.getMeasurementOptions(), this.itemSizeCacheVersion],
335
- ({
336
- count: t,
337
- paddingStart: e,
338
- scrollMargin: s,
339
- getItemKey: i,
340
- enabled: n,
341
- lanes: o,
342
- laneAssignmentMode: l
343
- }, u) => {
344
- const d = this.itemSizeCache;
345
- if (!n)
346
- return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
347
- if (this.laneAssignments.size > t)
348
- for (const c of this.laneAssignments.keys())
349
- c >= t && this.laneAssignments.delete(c);
350
- this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
351
- this.itemSizeCache.set(c.key, c.size);
352
- }));
353
- const m = this.lanesSettling ? 0 : this.pendingMin ?? 0;
354
- if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1), o === 1) {
355
- const c = this.options.gap, v = t * 2;
356
- let g = this._flatMeasurements;
357
- if (!g || g.length < v) {
358
- const f = new Float64Array(v);
359
- g && m > 0 && f.set(g.subarray(0, m * 2)), g = f, this._flatMeasurements = g;
360
- }
361
- let p;
362
- if (m === 0)
363
- p = e + s;
364
- else {
365
- const f = m - 1;
366
- p = g[f * 2] + g[f * 2 + 1] + c;
367
- }
368
- for (let f = m; f < t; f++) {
369
- const b = i(f), _ = d.get(b), I = typeof _ == "number" ? _ : this.options.estimateSize(f);
370
- g[f * 2] = p, g[f * 2 + 1] = I, p += I + c;
371
- }
372
- const E = F(t, g, i);
373
- return this.measurementsCache = E, E;
374
- }
375
- const h = this.measurementsCache.slice(0, m), S = new Array(o).fill(
376
- void 0
377
- );
378
- for (let c = 0; c < m; c++) {
379
- const v = h[c];
380
- v && (S[v.lane] = c);
381
- }
382
- for (let c = m; c < t; c++) {
383
- const v = i(c), g = this.laneAssignments.get(c);
384
- let p, E;
385
- const f = l === "estimate" || d.has(v);
386
- if (g !== void 0 && this.options.lanes > 1) {
387
- p = g;
388
- const O = S[p], T = O !== void 0 ? h[O] : void 0;
389
- E = T ? T.end + this.options.gap : e + s;
390
- } else {
391
- const O = this.options.lanes === 1 ? h[c - 1] : this.getFurthestMeasurement(h, c);
392
- E = O ? O.end + this.options.gap : e + s, p = O ? O.lane : c % this.options.lanes, this.options.lanes > 1 && f && this.laneAssignments.set(c, p);
393
- }
394
- const b = d.get(v), _ = typeof b == "number" ? b : this.options.estimateSize(c), I = E + _;
395
- h[c] = {
396
- index: c,
397
- start: E,
398
- size: _,
399
- end: I,
400
- key: v,
401
- lane: p
402
- }, S[p] = c;
403
- }
404
- return this.measurementsCache = h, h;
405
- },
406
- {
407
- key: process.env.NODE_ENV !== "production" && "getMeasurements",
408
- debug: () => this.options.debug
409
- }
410
- ), this.calculateRange = M(
411
- () => [
412
- this.getMeasurements(),
413
- this.getSize(),
414
- this.getScrollOffset(),
415
- this.options.lanes
416
- ],
417
- (t, e, s, i) => this.range = t.length > 0 && e > 0 ? K({
418
- measurements: t,
419
- outerSize: e,
420
- scrollOffset: s,
421
- lanes: i,
422
- // Pass the typed array so binary search + forward-walk can
423
- // read start/end directly from Float64Array, skipping the
424
- // Proxy traps that materialize a full VirtualItem per probe.
425
- flat: i === 1 && this._flatMeasurements != null ? this._flatMeasurements : null
426
- }) : null,
427
- {
428
- key: process.env.NODE_ENV !== "production" && "calculateRange",
429
- debug: () => this.options.debug
430
- }
431
- ), this.getVirtualIndexes = M(
432
- () => {
433
- let t = null, e = null;
434
- const s = this.calculateRange();
435
- return s && (t = s.startIndex, e = s.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, e]), [
436
- this.options.rangeExtractor,
437
- this.options.overscan,
438
- this.options.count,
439
- t,
440
- e
441
- ];
442
- },
443
- (t, e, s, i, n) => i === null || n === null ? [] : t({
444
- startIndex: i,
445
- endIndex: n,
446
- overscan: e,
447
- count: s
448
- }),
449
- {
450
- key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
451
- debug: () => this.options.debug
452
- }
453
- ), this.indexFromElement = (t) => {
454
- const e = this.options.indexAttribute, s = t.getAttribute(e);
455
- return s ? parseInt(s, 10) : (console.warn(
456
- `Missing attribute name '${e}={index}' on measured element.`
457
- ), -1);
458
- }, this.shouldMeasureDuringScroll = (t) => {
459
- var e;
460
- if (!this.scrollState || this.scrollState.behavior !== "smooth")
461
- return !0;
462
- const s = this.scrollState.index ?? ((e = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : e.index);
463
- if (s !== void 0 && this.range) {
464
- const i = Math.max(
465
- this.options.overscan,
466
- Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
467
- ), n = Math.max(0, s - i), o = Math.min(
468
- this.options.count - 1,
469
- s + i
470
- );
471
- return t >= n && t <= o;
472
- }
473
- return !0;
474
- }, this.measureElement = (t) => {
475
- if (!t) {
476
- this.elementsCache.forEach((n, o) => {
477
- n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(o));
478
- });
479
- return;
480
- }
481
- const e = this.indexFromElement(t), s = this.options.getItemKey(e), i = this.elementsCache.get(s);
482
- i !== t && (i && this.observer.unobserve(i), this.observer.observe(t), this.elementsCache.set(s, t)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(e) && this.resizeItem(e, this.options.measureElement(t, void 0, this));
483
- }, this.resizeItem = (t, e) => {
484
- var s, i;
485
- if (t < 0 || t >= this.options.count) return;
486
- let n, o, l;
487
- const u = this._flatMeasurements;
488
- if (this.options.lanes === 1 && u !== null)
489
- l = this.options.getItemKey(t), o = u[t * 2], n = u[t * 2 + 1];
490
- else {
491
- const h = this.measurementsCache[t];
492
- if (!h) return;
493
- l = h.key, o = h.start, n = h.size;
494
- }
495
- const d = this.itemSizeCache.get(l) ?? n, m = e - d;
496
- if (m !== 0) {
497
- const h = this.options.anchorTo === "end" && ((s = this.scrollState) == null ? void 0 : s.behavior) !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, S = h ? this.getTotalSize() : 0, c = ((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
498
- // The callback expects a VirtualItem; build one lazily only
499
- // when the consumer actually supplied a custom predicate.
500
- this.measurementsCache[t] ?? {
501
- index: t,
502
- key: l,
503
- start: o,
504
- size: n,
505
- end: o + n,
506
- lane: 0
507
- },
508
- m,
509
- this
510
- ) : (
511
- // Default: adjust when the resize is an above-viewport item.
512
- // First measurement (!has(key)): always adjust — the item
513
- // has never been sized, so the estimate→actual delta must
514
- // be compensated regardless of scroll direction.
515
- // Re-measurement (has(key)): skip during backward scroll
516
- // to avoid the "items jump while scrolling up" cascade.
517
- o < this.getScrollOffset() + this.scrollAdjustments && (!this.itemSizeCache.has(l) || this.scrollDirection !== "backward")
518
- ));
519
- (this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(l, e), this.itemSizeCacheVersion++, h ? this.applyScrollAdjustment(this.getTotalSize() - S) : c && this.applyScrollAdjustment(m), this.notify(!1);
520
- }
521
- }, this.getVirtualItems = M(
522
- () => [this.getVirtualIndexes(), this.getMeasurements()],
523
- (t, e) => {
524
- const s = [];
525
- for (let i = 0, n = t.length; i < n; i++) {
526
- const o = t[i], l = e[o];
527
- s.push(l);
528
- }
529
- return s;
530
- },
531
- {
532
- key: process.env.NODE_ENV !== "production" && "getVirtualItems",
533
- debug: () => this.options.debug
534
- }
535
- ), this.getVirtualItemForOffset = (t) => {
536
- const e = this.getMeasurements();
537
- if (e.length === 0)
538
- return;
539
- const s = this._flatMeasurements, i = this.options.lanes === 1 && s != null, n = A(
540
- 0,
541
- e.length - 1,
542
- i ? (o) => s[o * 2] : (o) => w(e[o]).start,
543
- t
544
- );
545
- return w(e[n]);
546
- }, this.getMaxScrollOffset = () => {
547
- if (!this.scrollElement) return 0;
548
- if ("scrollHeight" in this.scrollElement)
549
- return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
550
- {
551
- const t = this.scrollElement.document.documentElement;
552
- return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
553
- }
554
- }, this.getVirtualDistanceFromEnd = () => Math.max(
555
- this.getTotalSize() - this.getSize() - this.getScrollOffset(),
556
- 0
557
- ), this.getDistanceFromEnd = () => Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0), this.isAtEnd = (t = this.options.scrollEndThreshold) => this.getDistanceFromEnd() <= t, this.getOffsetForAlignment = (t, e, s = 0) => {
558
- if (!this.scrollElement) return 0;
559
- const i = this.getSize(), n = this.getScrollOffset();
560
- e === "auto" && (e = t >= n + i ? "end" : "start"), e === "center" ? t += (s - i) / 2 : e === "end" && (t -= i);
561
- const o = this.getMaxScrollOffset();
562
- return Math.max(Math.min(o, t), 0);
563
- }, this.getOffsetForIndex = (t, e = "auto") => {
564
- t = Math.max(0, Math.min(t, this.options.count - 1));
565
- const s = this.getSize(), i = this.getScrollOffset(), n = this.measurementsCache[t];
566
- if (!n) return;
567
- if (e === "auto")
568
- if (n.end >= i + s - this.options.scrollPaddingEnd)
569
- e = "end";
570
- else if (n.start <= i + this.options.scrollPaddingStart)
571
- e = "start";
572
- else
573
- return [i, e];
574
- if (e === "end" && t === this.options.count - 1)
575
- return [this.getMaxScrollOffset(), e];
576
- const o = e === "end" ? n.end + this.options.scrollPaddingEnd : n.start - this.options.scrollPaddingStart;
577
- return [
578
- this.getOffsetForAlignment(o, e, n.size),
579
- e
580
- ];
581
- }, this.scrollToOffset = (t, { align: e = "start", behavior: s = "auto" } = {}) => {
582
- const i = this.getOffsetForAlignment(t, e), n = this.now();
583
- this.scrollState = {
584
- index: null,
585
- align: e,
586
- behavior: s,
587
- startedAt: n,
588
- lastTargetOffset: i,
589
- stableFrames: 0
590
- }, this._scrollToOffset(i, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
591
- }, this.scrollToIndex = (t, {
592
- align: e = "auto",
593
- behavior: s = "auto"
594
- } = {}) => {
595
- t = Math.max(0, Math.min(t, this.options.count - 1));
596
- const i = this.getOffsetForIndex(t, e);
597
- if (!i)
598
- return;
599
- const [n, o] = i, l = this.now();
600
- this.scrollState = {
601
- index: t,
602
- align: o,
603
- behavior: s,
604
- startedAt: l,
605
- lastTargetOffset: n,
606
- stableFrames: 0
607
- }, this._scrollToOffset(n, { adjustments: void 0, behavior: s }), this.scheduleScrollReconcile();
608
- }, this.scrollBy = (t, { behavior: e = "auto" } = {}) => {
609
- const s = this.getScrollOffset() + t, i = this.now();
610
- this.scrollState = {
611
- index: null,
612
- align: "start",
613
- behavior: e,
614
- startedAt: i,
615
- lastTargetOffset: s,
616
- stableFrames: 0
617
- }, this._scrollToOffset(s, { adjustments: void 0, behavior: e }), this.scheduleScrollReconcile();
618
- }, this.scrollToEnd = ({ behavior: t = "auto" } = {}) => {
619
- if (this.options.count > 0) {
620
- this.scrollToIndex(this.options.count - 1, {
621
- align: "end",
622
- behavior: t
623
- });
624
- return;
625
- }
626
- this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), {
627
- behavior: t
628
- });
629
- }, this.getTotalSize = () => {
630
- var t;
631
- const e = this.getMeasurements();
632
- let s;
633
- if (e.length === 0)
634
- s = this.options.paddingStart;
635
- else if (this.options.lanes === 1) {
636
- const i = e.length - 1, n = this._flatMeasurements;
637
- n != null ? s = n[i * 2] + n[i * 2 + 1] : s = ((t = e[i]) == null ? void 0 : t.end) ?? 0;
638
- } else {
639
- const i = Array(this.options.lanes).fill(null);
640
- let n = e.length - 1;
641
- for (; n >= 0 && i.some((o) => o === null); ) {
642
- const o = e[n];
643
- i[o.lane] === null && (i[o.lane] = o.end), n--;
644
- }
645
- s = Math.max(...i.filter((o) => o !== null));
646
- }
647
- return Math.max(
648
- s - this.options.scrollMargin + this.options.paddingEnd,
649
- 0
650
- );
651
- }, this.takeSnapshot = () => {
652
- const t = [];
653
- if (this.itemSizeCache.size === 0) return t;
654
- const e = this.getMeasurements();
655
- for (const s of e)
656
- s && this.itemSizeCache.has(s.key) && t.push({
657
- index: s.index,
658
- key: s.key,
659
- start: s.start,
660
- size: s.size,
661
- end: s.end,
662
- lane: s.lane
663
- });
664
- return t;
665
- }, this._scrollToOffset = (t, {
666
- adjustments: e,
667
- behavior: s
668
- }) => {
669
- this._intendedScrollOffset = t + (e ?? 0), this.options.scrollToFn(t, { behavior: s, adjustments: e }, this);
670
- }, this.measure = () => {
671
- this.pendingMin = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.itemSizeCacheVersion++, this.notify(!1);
672
- }, this.setOptions(a);
673
- }
674
- applyScrollAdjustment(a, t) {
675
- a !== 0 && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", a), y() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? this._iosDeferredAdjustment += a : this._scrollToOffset(this.getScrollOffset(), {
676
- adjustments: this.scrollAdjustments += a,
677
- behavior: t
678
- }));
679
- }
680
- scheduleScrollReconcile() {
681
- if (!this.targetWindow) {
682
- this.scrollState = null;
683
- return;
684
- }
685
- this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
686
- this.rafId = null, this.reconcileScroll();
687
- }));
688
- }
689
- reconcileScroll() {
690
- if (!this.scrollState || !this.scrollElement) return;
691
- if (this.now() - this.scrollState.startedAt > 5e3) {
692
- this.scrollState = null;
693
- return;
694
- }
695
- const e = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, s = e ? e[0] : this.scrollState.lastTargetOffset, i = 1, n = s !== this.scrollState.lastTargetOffset;
696
- if (!n && R(s, this.getScrollOffset())) {
697
- if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= i) {
698
- this.getScrollOffset() !== s && this._scrollToOffset(s, {
699
- adjustments: void 0,
700
- behavior: "auto"
701
- }), this.scrollState = null;
702
- return;
703
- }
704
- } else if (this.scrollState.stableFrames = 0, n) {
705
- const o = this.getSize() || 600, l = Math.abs(s - this.getScrollOffset()), u = this.scrollState.behavior === "smooth" && l > o;
706
- this.scrollState.lastTargetOffset = s, u || (this.scrollState.behavior = "auto"), this._scrollToOffset(s, {
707
- adjustments: void 0,
708
- behavior: u ? "smooth" : "auto"
709
- });
710
- }
711
- this.scheduleScrollReconcile();
712
- }
713
- }
714
- const A = (r, a, t, e) => {
715
- for (; r <= a; ) {
716
- const s = (r + a) / 2 | 0, i = t(s);
717
- if (i < e)
718
- r = s + 1;
719
- else if (i > e)
720
- a = s - 1;
721
- else
722
- return s;
723
- }
724
- return r > 0 ? r - 1 : 0;
1
+ import { createLazyMeasurementsView as e } from "./lazy-measurements.js";
2
+ import { approxEqual as t, debounce as n, memo as r, notUndefined as i } from "./utils.js";
3
+ //#region ../../node_modules/@tanstack/virtual-core/dist/esm/index.js
4
+ var a, o = () => {
5
+ if (a !== void 0) return a;
6
+ if (typeof navigator > "u") return a = !1;
7
+ if (/iP(hone|od|ad)/.test(navigator.userAgent)) return a = !0;
8
+ let e = navigator.maxTouchPoints;
9
+ return a = navigator.platform === "MacIntel" && e !== void 0 && e > 0;
10
+ }, s = (e) => {
11
+ let { offsetWidth: t, offsetHeight: n } = e;
12
+ return {
13
+ width: t,
14
+ height: n
15
+ };
16
+ }, c = (e) => e, l = (e) => {
17
+ let t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1) - t + 1, r = Array(n);
18
+ for (let e = 0; e < n; e++) r[e] = t + e;
19
+ return r;
20
+ }, u = (e, t) => {
21
+ let n = e.scrollElement;
22
+ if (!n) return;
23
+ let r = e.targetWindow;
24
+ if (!r) return;
25
+ let i = (e) => {
26
+ let { width: n, height: r } = e;
27
+ t({
28
+ width: Math.round(n),
29
+ height: Math.round(r)
30
+ });
31
+ };
32
+ if (i(s(n)), !r.ResizeObserver) return () => {};
33
+ let a = new r.ResizeObserver((t) => {
34
+ let r = () => {
35
+ let e = t[0];
36
+ if (e?.borderBoxSize) {
37
+ let t = e.borderBoxSize[0];
38
+ if (t) {
39
+ i({
40
+ width: t.inlineSize,
41
+ height: t.blockSize
42
+ });
43
+ return;
44
+ }
45
+ }
46
+ i(s(n));
47
+ };
48
+ e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
49
+ });
50
+ return a.observe(n, { box: "border-box" }), () => {
51
+ a.unobserve(n);
52
+ };
53
+ }, d = { passive: !0 }, f = typeof window > "u" || "onscrollend" in window, p = (e, t, r) => {
54
+ let i = e.scrollElement;
55
+ if (!i) return;
56
+ let a = e.targetWindow;
57
+ if (!a) return;
58
+ let o = e.options.useScrollendEvent && f, s = 0, c = o ? null : n(a, () => t(s, !1), e.options.isScrollingResetDelay), l = (e) => () => {
59
+ s = r(i), c?.(), t(s, e);
60
+ }, u = l(!0), p = l(!1);
61
+ return i.addEventListener("scroll", u, d), o && i.addEventListener("scrollend", p, d), () => {
62
+ i.removeEventListener("scroll", u), o && i.removeEventListener("scrollend", p), c?.cancel();
63
+ };
64
+ }, m = (e, t) => p(e, t, (t) => {
65
+ let { horizontal: n, isRtl: r } = e.options;
66
+ return n ? t.scrollLeft * (r && -1 || 1) : t.scrollTop;
67
+ }), h = (e, t, n) => {
68
+ if (n.options.useCachedMeasurements) {
69
+ let t = n.indexFromElement(e), r = n.options.getItemKey(t);
70
+ return n.itemSizeCache.get(r) ?? n.options.estimateSize(t);
71
+ }
72
+ if (t?.borderBoxSize) {
73
+ let e = t.borderBoxSize[0];
74
+ if (e) return Math.round(e[n.options.horizontal ? "inlineSize" : "blockSize"]);
75
+ }
76
+ if (!t) {
77
+ let t = n.indexFromElement(e), r = n.options.getItemKey(t), i = n.itemSizeCache.get(r);
78
+ if (i !== void 0) return i;
79
+ }
80
+ return e[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
81
+ }, g = (e, { adjustments: t = 0, behavior: n }, r) => {
82
+ var i, a;
83
+ (a = (i = r.scrollElement)?.scrollTo) == null || a.call(i, {
84
+ [r.options.horizontal ? "left" : "top"]: e + t,
85
+ behavior: n
86
+ });
87
+ }, _ = class {
88
+ constructor(t) {
89
+ this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._flatMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._intendedScrollOffset = null, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
90
+ var e;
91
+ return ((e = this.targetWindow?.performance)?.now)?.call(e) ?? Date.now();
92
+ }, this.observer = /* @__PURE__ */ (() => {
93
+ let e = null, t = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((e) => {
94
+ e.forEach((e) => {
95
+ let t = () => {
96
+ let t = e.target, n = this.indexFromElement(t);
97
+ if (!t.isConnected) {
98
+ this.observer.unobserve(t);
99
+ for (let [e, n] of this.elementsCache) if (n === t) {
100
+ this.elementsCache.delete(e);
101
+ break;
102
+ }
103
+ return;
104
+ }
105
+ this.isIndexInRange(n) && this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, e, this));
106
+ };
107
+ this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(t) : t();
108
+ });
109
+ }));
110
+ return {
111
+ disconnect: () => {
112
+ var n;
113
+ (n = t()) == null || n.disconnect(), e = null;
114
+ },
115
+ observe: (e) => t()?.observe(e, { box: "border-box" }),
116
+ unobserve: (e) => t()?.unobserve(e)
117
+ };
118
+ })(), this.range = null, this.setOptions = (e) => {
119
+ let t = {
120
+ debug: !1,
121
+ initialOffset: 0,
122
+ overscan: 1,
123
+ paddingStart: 0,
124
+ paddingEnd: 0,
125
+ scrollPaddingStart: 0,
126
+ scrollPaddingEnd: 0,
127
+ horizontal: !1,
128
+ getItemKey: c,
129
+ rangeExtractor: l,
130
+ onChange: () => {},
131
+ measureElement: h,
132
+ initialRect: {
133
+ width: 0,
134
+ height: 0
135
+ },
136
+ scrollMargin: 0,
137
+ gap: 0,
138
+ indexAttribute: "data-index",
139
+ initialMeasurementsCache: [],
140
+ lanes: 1,
141
+ anchorTo: "start",
142
+ followOnAppend: !1,
143
+ scrollEndThreshold: 1,
144
+ isScrollingResetDelay: 150,
145
+ enabled: !0,
146
+ isRtl: !1,
147
+ useScrollendEvent: !1,
148
+ useAnimationFrameWithResizeObserver: !1,
149
+ laneAssignmentMode: "estimate",
150
+ useCachedMeasurements: !1
151
+ };
152
+ for (let n in e) {
153
+ let r = e[n];
154
+ r !== void 0 && (t[n] = r);
155
+ }
156
+ let n = this.options, r = null, i = null, a = !1;
157
+ if (n !== void 0 && n.enabled && t.enabled && t.anchorTo === "end" && this.scrollElement !== null) {
158
+ let e = n.count, o = t.count, s = this.getMeasurements(), c = e > 0 ? s[0]?.key ?? n.getItemKey(0) : null, l = e > 0 ? s[e - 1]?.key ?? n.getItemKey(e - 1) : null;
159
+ if (o !== e || e > 0 && o > 0 && (t.getItemKey(0) !== c || t.getItemKey(o - 1) !== l)) {
160
+ a = !0;
161
+ let c = e > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? s[0] : null;
162
+ c && (r = [c.key, this.getScrollOffset() - c.start]);
163
+ let u = t.followOnAppend === !0 ? "auto" : t.followOnAppend || null;
164
+ u && o > e && this.isAtEnd(n.scrollEndThreshold) && (e === 0 || t.getItemKey(o - 1) !== l) && (i = u);
165
+ }
166
+ }
167
+ this.options = t, a && (this.pendingMin = 0, this.itemSizeCacheVersion++);
168
+ let o = !1, s = 0;
169
+ if (r && this.scrollOffset !== null) {
170
+ let [e, t] = r, n = this.getMeasurements(), { count: i, getItemKey: a } = this.options, c = 0;
171
+ for (; c < i && a(c) !== e;) c++;
172
+ if (c < i) {
173
+ let e = n[c];
174
+ if (e) {
175
+ let n = Math.max(0, e.start + t);
176
+ n !== this.scrollOffset && (s = n - this.scrollOffset, this.scrollOffset = n, o = !0);
177
+ }
178
+ }
179
+ }
180
+ (o || i) && (this.pendingScrollAnchor = [
181
+ o ? r[0] : null,
182
+ o ? r[1] : 0,
183
+ i,
184
+ s
185
+ ]);
186
+ }, this.notify = (e) => {
187
+ var t, n;
188
+ (n = (t = this.options).onChange) == null || n.call(t, this, e);
189
+ }, this.maybeNotify = r(() => (this.calculateRange(), [
190
+ this.isScrolling,
191
+ this.range ? this.range.startIndex : null,
192
+ this.range ? this.range.endIndex : null
193
+ ]), (e) => {
194
+ this.notify(e);
195
+ }, {
196
+ key: process.env.NODE_ENV !== "production" && "maybeNotify",
197
+ debug: () => this.options.debug,
198
+ initialDeps: [
199
+ this.isScrolling,
200
+ this.range ? this.range.startIndex : null,
201
+ this.range ? this.range.endIndex : null
202
+ ]
203
+ }), this.cleanup = () => {
204
+ this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.isScrolling = !1, this.scrollDirection = null, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this.scrollElement = null, this.targetWindow = null;
205
+ }, this._didMount = () => () => {
206
+ this.cleanup();
207
+ }, this._willUpdate = () => {
208
+ let e = this.options.enabled ? this.options.getScrollElement() : null;
209
+ if (this.scrollElement !== e) {
210
+ if (this.cleanup(), !e) {
211
+ this.maybeNotify();
212
+ return;
213
+ }
214
+ if (this.scrollElement = e, this.targetWindow = this.scrollElement && "ownerDocument" in this.scrollElement ? this.scrollElement.ownerDocument.defaultView : this.scrollElement?.window ?? null, this.elementsCache.forEach((e) => {
215
+ this.observer.observe(e);
216
+ }), this.unsubs.push(this.options.observeElementRect(this, (e) => {
217
+ this.scrollRect = e, this.maybeNotify();
218
+ })), this.unsubs.push(this.options.observeElementOffset(this, (e, t) => {
219
+ if (t && this._intendedScrollOffset === null && e === this.scrollOffset) return;
220
+ this._intendedScrollOffset !== null && Math.abs(e - this._intendedScrollOffset) < 1.5 && (e = this._intendedScrollOffset), this._intendedScrollOffset = null, this.scrollAdjustments = 0;
221
+ let n = this.getScrollOffset();
222
+ this.scrollDirection = t ? n === e ? this.scrollDirection : n < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = t, this._flushIosDeferredIfReady(), this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
223
+ })), "addEventListener" in this.scrollElement) {
224
+ let e = this.scrollElement, t = () => {
225
+ this._iosTouching = !0, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
226
+ }, n = () => {
227
+ this._iosTouching = !1, !(!o() || this.targetWindow == null) && (this._iosJustTouchEnded = !0, this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
228
+ this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._flushIosDeferredIfReady();
229
+ }, 150));
230
+ };
231
+ e.addEventListener("touchstart", t, d), e.addEventListener("touchend", n, d), this.unsubs.push(() => {
232
+ e.removeEventListener("touchstart", t), e.removeEventListener("touchend", n), this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
233
+ });
234
+ }
235
+ this._scrollToOffset(this.getScrollOffset(), {
236
+ adjustments: void 0,
237
+ behavior: void 0
238
+ });
239
+ }
240
+ let t = this.pendingScrollAnchor;
241
+ if (this.pendingScrollAnchor = null, t && this.scrollElement && this.options.enabled) {
242
+ let [e, n, r, i] = t;
243
+ e !== null && !r && (o() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? i !== 0 && (this._iosDeferredAdjustment += i) : this._scrollToOffset(this.getScrollOffset(), {
244
+ adjustments: void 0,
245
+ behavior: void 0
246
+ })), r && this.scrollToEnd({ behavior: r });
247
+ }
248
+ }, this._flushIosDeferredIfReady = () => {
249
+ if (this._iosDeferredAdjustment === 0 || this.isScrolling || this._iosTouching || this._iosJustTouchEnded) return;
250
+ let e = this.getScrollOffset(), t = this.getMaxScrollOffset();
251
+ if (e < 0 || e > t) return;
252
+ if (this._iosDeferredAdjustment < 0 && e >= t - 1) {
253
+ this._iosDeferredAdjustment = 0;
254
+ return;
255
+ }
256
+ let n = this._iosDeferredAdjustment;
257
+ this._iosDeferredAdjustment = 0, this._scrollToOffset(e, {
258
+ adjustments: this.scrollAdjustments += n,
259
+ behavior: void 0
260
+ });
261
+ }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getMeasurementOptions = r(() => [
262
+ this.options.count,
263
+ this.options.paddingStart,
264
+ this.options.scrollMargin,
265
+ this.options.getItemKey,
266
+ this.options.enabled,
267
+ this.options.lanes,
268
+ this.options.laneAssignmentMode,
269
+ this.options.gap
270
+ ], (e, t, n, r, i, a, o, s) => (this.prevLanes !== void 0 && this.prevLanes !== a && (this.lanesChangedFlag = !0), this.prevLanes = a, this.pendingMin = null, {
271
+ count: e,
272
+ paddingStart: t,
273
+ scrollMargin: n,
274
+ getItemKey: r,
275
+ enabled: i,
276
+ lanes: a,
277
+ laneAssignmentMode: o,
278
+ gap: s
279
+ }), { key: !1 }), this.isIndexInRange = (e) => e >= 0 && e < this.options.count, this.getMeasurements = r(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: n, scrollMargin: r, getItemKey: i, enabled: a, lanes: o, laneAssignmentMode: s, gap: c }, l) => {
280
+ let u = this.itemSizeCache;
281
+ if (!a) return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
282
+ if (this.laneAssignments.size > t) for (let e of this.laneAssignments.keys()) e >= t && this.laneAssignments.delete(e);
283
+ this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((e) => {
284
+ this.itemSizeCache.set(e.key, e.size);
285
+ }));
286
+ let d = this.lanesSettling ? 0 : this.pendingMin ?? 0;
287
+ if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1), o === 1) {
288
+ let a = t * 2, o = this._flatMeasurements;
289
+ if (!o || o.length < a) {
290
+ let e = new Float64Array(a);
291
+ o && d > 0 && e.set(o.subarray(0, d * 2)), o = e, this._flatMeasurements = o;
292
+ }
293
+ let s;
294
+ if (d === 0) s = n + r;
295
+ else {
296
+ let e = d - 1;
297
+ s = o[e * 2] + o[e * 2 + 1] + c;
298
+ }
299
+ for (let e = d; e < t; e++) {
300
+ let t = i(e), n = u.get(t), r = typeof n == "number" ? n : this.options.estimateSize(e);
301
+ o[e * 2] = s, o[e * 2 + 1] = r, s += r + c;
302
+ }
303
+ let l = e(t, o, i);
304
+ return this.measurementsCache = l, l;
305
+ }
306
+ let f = this.measurementsCache.slice(0, d), p = Array(o).fill(void 0), m = new Float64Array(o), h = 0;
307
+ for (let e = 0; e < d; e++) {
308
+ let t = f[e];
309
+ t && (p[t.lane] === void 0 && h++, p[t.lane] = e, m[t.lane] = t.end);
310
+ }
311
+ for (let e = d; e < t; e++) {
312
+ let t = i(e), a = this.laneAssignments.get(e), l, d, g = s === "estimate" || u.has(t);
313
+ if (a !== void 0 && this.options.lanes > 1) {
314
+ l = a;
315
+ let e = p[l], t = e === void 0 ? void 0 : f[e];
316
+ d = t ? t.end + c : n + r;
317
+ } else if (h === o) {
318
+ let t = 0, n = m[0], r = p[0];
319
+ for (let e = 1; e < o; e++) {
320
+ let i = m[e];
321
+ (i < n || i === n && p[e] < r) && (t = e, n = i, r = p[e]);
322
+ }
323
+ l = t, d = n + c, g && this.laneAssignments.set(e, l);
324
+ } else l = e % this.options.lanes, d = n + r, g && this.laneAssignments.set(e, l);
325
+ let _ = u.get(t), v = typeof _ == "number" ? _ : this.options.estimateSize(e), y = d + v;
326
+ f[e] = {
327
+ index: e,
328
+ start: d,
329
+ size: v,
330
+ end: y,
331
+ key: t,
332
+ lane: l
333
+ }, p[l] === void 0 && h++, p[l] = e, m[l] = y;
334
+ }
335
+ return this.measurementsCache = f, f;
336
+ }, {
337
+ key: process.env.NODE_ENV !== "production" && "getMeasurements",
338
+ debug: () => this.options.debug
339
+ }), this.calculateRange = r(() => [
340
+ this.getMeasurements(),
341
+ this.getSize(),
342
+ this.getScrollOffset(),
343
+ this.options.lanes
344
+ ], (e, t, n, r) => e.length === 0 || t === 0 ? (this.range = null, null) : (this.range = b(e, t, n, r, r === 1 && this._flatMeasurements != null ? this._flatMeasurements : null), this.range), {
345
+ key: process.env.NODE_ENV !== "production" && "calculateRange",
346
+ debug: () => this.options.debug
347
+ }), this.getVirtualIndexes = r(() => {
348
+ let e = null, t = null, n = this.calculateRange();
349
+ return n && (e = n.startIndex, t = n.endIndex), this.maybeNotify.updateDeps([
350
+ this.isScrolling,
351
+ e,
352
+ t
353
+ ]), [
354
+ this.options.rangeExtractor,
355
+ this.options.overscan,
356
+ this.options.count,
357
+ e,
358
+ t
359
+ ];
360
+ }, (e, t, n, r, i) => r === null || i === null ? [] : e({
361
+ startIndex: r,
362
+ endIndex: i,
363
+ overscan: t,
364
+ count: n
365
+ }), {
366
+ key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
367
+ debug: () => this.options.debug
368
+ }), this.indexFromElement = (e) => {
369
+ let t = this.options.indexAttribute, n = e.getAttribute(t);
370
+ return n ? parseInt(n, 10) : (console.warn(`Missing attribute name '${t}={index}' on measured element.`), -1);
371
+ }, this.shouldMeasureDuringScroll = (e) => {
372
+ if (!this.scrollState || this.scrollState.behavior !== "smooth") return !0;
373
+ let t = this.scrollState.index ?? this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;
374
+ if (t !== void 0 && this.range) {
375
+ let n = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), r = Math.max(0, t - n), i = Math.min(this.options.count - 1, t + n);
376
+ return e >= r && e <= i;
377
+ }
378
+ return !0;
379
+ }, this.measureElement = (e) => {
380
+ if (!e) {
381
+ this.elementsCache.forEach((e, t) => {
382
+ e.isConnected || (this.observer.unobserve(e), this.elementsCache.delete(t));
383
+ });
384
+ return;
385
+ }
386
+ let t = this.indexFromElement(e);
387
+ if (!this.isIndexInRange(t)) return;
388
+ let n = this.options.getItemKey(t), r = this.elementsCache.get(n);
389
+ r !== e && (r && this.observer.unobserve(r), this.observer.observe(e), this.elementsCache.set(n, e)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(t) && this.resizeItem(t, this.options.measureElement(e, void 0, this));
390
+ }, this.resizeItem = (e, t) => {
391
+ if (!this.isIndexInRange(e)) return;
392
+ let n, r, i, a = this._flatMeasurements;
393
+ if (this.options.lanes === 1 && a !== null) i = this.options.getItemKey(e), r = a[e * 2], n = a[e * 2 + 1];
394
+ else {
395
+ let t = this.measurementsCache[e];
396
+ if (!t) return;
397
+ i = t.key, r = t.start, n = t.size;
398
+ }
399
+ let o = this.itemSizeCache.get(i) ?? n, s = t - o;
400
+ if (s !== 0) {
401
+ let a = this.options.anchorTo === "end" && this.scrollState?.behavior !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, c = a ? this.getTotalSize() : 0, l = this.getScrollOffset() + this.scrollAdjustments, u = this.itemSizeCache.has(i) ? r + o <= l && this.scrollDirection !== "backward" : r < l, d = this.scrollState?.behavior !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange === void 0 ? u : this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e] ?? {
402
+ index: e,
403
+ key: i,
404
+ start: r,
405
+ size: n,
406
+ end: r + n,
407
+ lane: 0
408
+ }, s, this));
409
+ (this.pendingMin === null || e < this.pendingMin) && (this.pendingMin = e), this.itemSizeCache.set(i, t), this.itemSizeCacheVersion++;
410
+ let f = !1;
411
+ a ? f = this.applyScrollAdjustment(this.getTotalSize() - c) : d && (f = this.applyScrollAdjustment(s)), this.notify(f);
412
+ }
413
+ }, this.getVirtualItems = r(() => [this.getVirtualIndexes(), this.getMeasurements()], (e, t) => {
414
+ let n = [];
415
+ for (let r = 0, i = e.length; r < i; r++) {
416
+ let i = t[e[r]];
417
+ n.push(i);
418
+ }
419
+ return n;
420
+ }, {
421
+ key: process.env.NODE_ENV !== "production" && "getVirtualItems",
422
+ debug: () => this.options.debug
423
+ }), this.getVirtualItemForOffset = (e) => {
424
+ let t = this.getMeasurements();
425
+ if (t.length === 0) return;
426
+ let n = this._flatMeasurements, r = this.options.lanes === 1 && n != null, a = v(0, t.length - 1, r ? (e) => n[e * 2] : (e) => i(t[e]).start, e);
427
+ return i(t[a]);
428
+ }, this.getMaxScrollOffset = () => {
429
+ if (!this.scrollElement) return 0;
430
+ if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
431
+ {
432
+ let e = this.scrollElement.document.documentElement;
433
+ return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
434
+ }
435
+ }, this.getVirtualDistanceFromEnd = () => Math.max(this.getTotalSize() - this.getSize() - this.getScrollOffset(), 0), this.getDistanceFromEnd = () => Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0), this.isAtEnd = (e = this.options.scrollEndThreshold) => this.getDistanceFromEnd() <= e, this.getOffsetForAlignment = (e, t, n = 0) => {
436
+ if (!this.scrollElement) return 0;
437
+ let r = this.getSize(), i = this.getScrollOffset();
438
+ t === "auto" && (t = e >= i + r ? "end" : "start"), t === "center" ? e += (n - r) / 2 : t === "end" && (e -= r);
439
+ let a = this.getMaxScrollOffset();
440
+ return Math.max(Math.min(a, e), 0);
441
+ }, this.getOffsetForIndex = (e, t = "auto") => {
442
+ e = Math.max(0, Math.min(e, this.options.count - 1));
443
+ let n = this.getSize(), r = this.getScrollOffset(), i = this.measurementsCache[e];
444
+ if (!i) return;
445
+ if (t === "auto") {
446
+ if (i.end >= r + n - this.options.scrollPaddingEnd) t = "end";
447
+ else if (i.start <= r + this.options.scrollPaddingStart) t = "start";
448
+ else return [r, t];
449
+ }
450
+ if (t === "end" && e === this.options.count - 1) return [this.getMaxScrollOffset(), t];
451
+ let a = t === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
452
+ return [this.getOffsetForAlignment(a, t, i.size), t];
453
+ }, this.scrollToOffset = (e, { align: t = "start", behavior: n = "auto" } = {}) => {
454
+ this._iosDeferredAdjustment = 0;
455
+ let r = this.getOffsetForAlignment(e, t), i = this.now();
456
+ this.scrollState = {
457
+ index: null,
458
+ align: t,
459
+ behavior: n,
460
+ startedAt: i,
461
+ lastTargetOffset: r,
462
+ stableFrames: 0
463
+ }, this._scrollToOffset(r, {
464
+ adjustments: void 0,
465
+ behavior: n
466
+ }), this.scheduleScrollReconcile();
467
+ }, this.scrollToIndex = (e, { align: t = "auto", behavior: n = "auto" } = {}) => {
468
+ this._iosDeferredAdjustment = 0, e = Math.max(0, Math.min(e, this.options.count - 1));
469
+ let r = this.getOffsetForIndex(e, t);
470
+ if (!r) return;
471
+ let [i, a] = r, o = this.now();
472
+ this.scrollState = {
473
+ index: e,
474
+ align: a,
475
+ behavior: n,
476
+ startedAt: o,
477
+ lastTargetOffset: i,
478
+ stableFrames: 0
479
+ }, this._scrollToOffset(i, {
480
+ adjustments: void 0,
481
+ behavior: n
482
+ }), this.scheduleScrollReconcile();
483
+ }, this.scrollBy = (e, { behavior: t = "auto" } = {}) => {
484
+ let n = this.getScrollOffset() + e, r = this.now();
485
+ this.scrollState = {
486
+ index: null,
487
+ align: "start",
488
+ behavior: t,
489
+ startedAt: r,
490
+ lastTargetOffset: n,
491
+ stableFrames: 0
492
+ }, this._scrollToOffset(n, {
493
+ adjustments: void 0,
494
+ behavior: t
495
+ }), this.scheduleScrollReconcile();
496
+ }, this.scrollToEnd = ({ behavior: e = "auto" } = {}) => {
497
+ if (this.options.count > 0) {
498
+ this.scrollToIndex(this.options.count - 1, {
499
+ align: "end",
500
+ behavior: e
501
+ });
502
+ return;
503
+ }
504
+ this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), { behavior: e });
505
+ }, this.getTotalSize = () => {
506
+ let e = this.getMeasurements(), t;
507
+ if (e.length === 0) t = this.options.paddingStart;
508
+ else if (this.options.lanes === 1) {
509
+ let n = e.length - 1, r = this._flatMeasurements;
510
+ t = r == null ? e[n]?.end ?? 0 : r[n * 2] + r[n * 2 + 1];
511
+ } else {
512
+ let n = Array(this.options.lanes).fill(null), r = e.length - 1;
513
+ for (; r >= 0 && n.some((e) => e === null);) {
514
+ let t = e[r];
515
+ n[t.lane] === null && (n[t.lane] = t.end), r--;
516
+ }
517
+ t = Math.max(...n.filter((e) => e !== null));
518
+ }
519
+ return Math.max(t - this.options.scrollMargin + this.options.paddingEnd, 0);
520
+ }, this.takeSnapshot = () => {
521
+ let e = [];
522
+ if (this.itemSizeCache.size === 0) return e;
523
+ let t = this.getMeasurements();
524
+ for (let n of t) n && this.itemSizeCache.has(n.key) && e.push({
525
+ index: n.index,
526
+ key: n.key,
527
+ start: n.start,
528
+ size: n.size,
529
+ end: n.end,
530
+ lane: n.lane
531
+ });
532
+ return e;
533
+ }, this._scrollToOffset = (e, { adjustments: t, behavior: n }) => {
534
+ this._intendedScrollOffset = e + (t ?? 0), this.options.scrollToFn(e, {
535
+ behavior: n,
536
+ adjustments: t
537
+ }, this);
538
+ }, this.measure = () => {
539
+ this.pendingMin = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.itemSizeCacheVersion++, this.notify(!1);
540
+ }, this.setOptions(t);
541
+ }
542
+ applyScrollAdjustment(e, t) {
543
+ return e !== 0 && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", e), o() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? (this._iosDeferredAdjustment += e, !1) : (this._scrollToOffset(this.getScrollOffset(), {
544
+ adjustments: this.scrollAdjustments += e,
545
+ behavior: t
546
+ }), this.scrollOffset !== null && (this.scrollOffset += this.scrollAdjustments, this.scrollOffset < 0 && (this.scrollOffset = 0), this.scrollAdjustments = 0), !0));
547
+ }
548
+ scheduleScrollReconcile() {
549
+ if (!this.targetWindow) {
550
+ this.scrollState = null;
551
+ return;
552
+ }
553
+ this.rafId ??= this.targetWindow.requestAnimationFrame(() => {
554
+ this.rafId = null, this.reconcileScroll();
555
+ });
556
+ }
557
+ reconcileScroll() {
558
+ if (!this.scrollState || !this.scrollElement) return;
559
+ if (this.now() - this.scrollState.startedAt > 5e3) {
560
+ this.scrollState = null;
561
+ return;
562
+ }
563
+ let e = this.scrollState.index == null ? void 0 : this.getOffsetForIndex(this.scrollState.index, this.scrollState.align), n = e ? e[0] : this.scrollState.lastTargetOffset, r = n !== this.scrollState.lastTargetOffset;
564
+ if (!r && t(n, this.getScrollOffset())) {
565
+ if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= 1) {
566
+ this.getScrollOffset() !== n && this._scrollToOffset(n, {
567
+ adjustments: void 0,
568
+ behavior: "auto"
569
+ }), this.scrollState = null;
570
+ return;
571
+ }
572
+ } else if (this.scrollState.stableFrames = 0, r) {
573
+ let e = this.getSize() || 600, t = Math.abs(n - this.getScrollOffset()), r = this.scrollState.behavior === "smooth" && t > e;
574
+ this.scrollState.lastTargetOffset = n, r || (this.scrollState.behavior = "auto"), this._scrollToOffset(n, {
575
+ adjustments: void 0,
576
+ behavior: r ? "smooth" : "auto"
577
+ });
578
+ }
579
+ this.scheduleScrollReconcile();
580
+ }
581
+ }, v = (e, t, n, r) => {
582
+ for (; e <= t;) {
583
+ let i = (e + t) / 2 | 0, a = n(i);
584
+ if (a < r) e = i + 1;
585
+ else if (a > r) t = i - 1;
586
+ else return i;
587
+ }
588
+ return e > 0 ? e - 1 : 0;
725
589
  };
726
- function K({
727
- measurements: r,
728
- outerSize: a,
729
- scrollOffset: t,
730
- lanes: e,
731
- flat: s
732
- }) {
733
- const i = r.length - 1, n = s ? (d) => s[d * 2] : (d) => r[d].start, o = s ? (d) => s[d * 2] + s[d * 2 + 1] : (d) => r[d].end;
734
- if (r.length <= e)
735
- return {
736
- startIndex: 0,
737
- endIndex: i
738
- };
739
- let l = A(0, i, n, t), u = l;
740
- if (e === 1)
741
- for (; u < i && o(u) < t + a; )
742
- u++;
743
- else if (e > 1) {
744
- const d = Array(e).fill(0);
745
- for (; u < i && d.some((h) => h < t + a); ) {
746
- const h = r[u];
747
- d[h.lane] = h.end, u++;
748
- }
749
- const m = Array(e).fill(t + a);
750
- for (; l >= 0 && m.some((h) => h >= t); ) {
751
- const h = r[l];
752
- m[h.lane] = h.start, l--;
753
- }
754
- l = Math.max(0, l - l % e), u = Math.min(i, u + (e - 1 - u % e));
755
- }
756
- return { startIndex: l, endIndex: u };
590
+ function y(e, t, n) {
591
+ let r = 0;
592
+ for (; r <= t;) {
593
+ let i = (r + t) / 2 | 0, a = e[i * 2];
594
+ if (a < n) r = i + 1;
595
+ else if (a > n) t = i - 1;
596
+ else return i;
597
+ }
598
+ return r > 0 ? r - 1 : 0;
757
599
  }
758
- export {
759
- U as Virtualizer,
760
- R as approxEqual,
761
- D as debounce,
762
- k as defaultKeyExtractor,
763
- W as defaultRangeExtractor,
764
- q as elementScroll,
765
- V as measureElement,
766
- M as memo,
767
- w as notUndefined,
768
- J as observeElementOffset,
769
- H as observeElementRect
770
- };
600
+ function b(e, t, n, r, i) {
601
+ let a = e.length - 1;
602
+ if (e.length <= r) return {
603
+ startIndex: 0,
604
+ endIndex: a
605
+ };
606
+ if (r === 1 && i !== null) {
607
+ let e = y(i, a, n), r = e, o = n + t;
608
+ for (; r < a && i[r * 2] + i[r * 2 + 1] < o;) r++;
609
+ return {
610
+ startIndex: e,
611
+ endIndex: r
612
+ };
613
+ }
614
+ let o = v(0, a, (t) => e[t].start, n), s = o;
615
+ if (r === 1) for (; s < a && e[s].end < n + t;) s++;
616
+ else if (r > 1) {
617
+ let i = Array(r).fill(0);
618
+ for (; s < a && i.some((e) => e < n + t);) {
619
+ let t = e[s];
620
+ i[t.lane] = t.end, s++;
621
+ }
622
+ let c = Array(r).fill(n + t);
623
+ for (; o >= 0 && c.some((e) => e >= n);) {
624
+ let t = e[o];
625
+ c[t.lane] = t.start, o--;
626
+ }
627
+ o = Math.max(0, o - o % r), s = Math.min(a, s + (r - 1 - s % r));
628
+ }
629
+ return {
630
+ startIndex: o,
631
+ endIndex: s
632
+ };
633
+ }
634
+ //#endregion
635
+ export { _ as Virtualizer, t as approxEqual, n as debounce, c as defaultKeyExtractor, l as defaultRangeExtractor, g as elementScroll, h as measureElement, r as memo, i as notUndefined, m as observeElementOffset, u as observeElementRect };