themelia-react-ui 2.0.5 → 3.0.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 (968) hide show
  1. package/CHANGELOG.md +326 -0
  2. package/MIGRATION.md +858 -0
  3. package/README.md +35 -24
  4. package/dist/{accordion-B9MHG0cT.js → accordion-DNVqwEIC.js} +37 -37
  5. package/dist/accordion-DNVqwEIC.js.map +1 -0
  6. package/dist/action-menu-D5343RwT.js +286 -0
  7. package/dist/action-menu-D5343RwT.js.map +1 -0
  8. package/dist/ai-artifact-otrz9ZwS.js +1214 -0
  9. package/dist/ai-artifact-otrz9ZwS.js.map +1 -0
  10. package/dist/anchored-positioning-1U_eBFNx.js +9 -0
  11. package/dist/anchored-positioning-1U_eBFNx.js.map +1 -0
  12. package/dist/app-shell-CPN30Nb1.js +372 -0
  13. package/dist/app-shell-CPN30Nb1.js.map +1 -0
  14. package/dist/{attachment-Dg_69lPS.js → attachment-D2-fpfmv.js} +15 -15
  15. package/dist/{attachment-Dg_69lPS.js.map → attachment-D2-fpfmv.js.map} +1 -1
  16. package/dist/{auth-DTkkshS8.js → auth-g_oUTDDC.js} +236 -243
  17. package/dist/auth-g_oUTDDC.js.map +1 -0
  18. package/dist/{avatar-CeZaFmNH.js → avatar-Ca3Ihrq4.js} +4 -4
  19. package/dist/{avatar-CeZaFmNH.js.map → avatar-Ca3Ihrq4.js.map} +1 -1
  20. package/dist/{badge-xIiV_E7f.js → badge-oGiXblW7.js} +8 -9
  21. package/dist/badge-oGiXblW7.js.map +1 -0
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +2 -2
  29. package/dist/base/cards.js +3 -3
  30. package/dist/base/carousel.js +11 -11
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +1 -1
  33. package/dist/base/chart.js +1 -1
  34. package/dist/base/choice-inputs.js +2 -2
  35. package/dist/base/code-block.js +1 -1
  36. package/dist/base/combobox.js +1 -1
  37. package/dist/base/command.js +1 -1
  38. package/dist/base/copyable.js +1 -1
  39. package/dist/base/date-pickers.js +2 -2
  40. package/dist/base/display.js +7 -7
  41. package/dist/base/feedback.js +4 -4
  42. package/dist/base/forms-numeric.js +2 -2
  43. package/dist/base/forms.js +2 -2
  44. package/dist/base/inline-edit.js +13 -13
  45. package/dist/base/inline-edit.js.map +1 -1
  46. package/dist/base/item.js +1 -1
  47. package/dist/base/media-gallery.js +203 -2
  48. package/dist/base/media-gallery.js.map +1 -0
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +7 -7
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +32 -22
  54. package/dist/base/qr-code.js.map +1 -1
  55. package/dist/base/repeaters.js +208 -198
  56. package/dist/base/repeaters.js.map +1 -1
  57. package/dist/base/sidebar.js +2 -2
  58. package/dist/base/signature-pad.js +14 -14
  59. package/dist/base/signature-pad.js.map +1 -1
  60. package/dist/base/skeleton.js +1 -1
  61. package/dist/base/spinner.js +8 -14
  62. package/dist/base/spinner.js.map +1 -1
  63. package/dist/base/structure.js +1 -1
  64. package/dist/base/table.js +1 -1
  65. package/dist/base/text-inputs.js +3 -3
  66. package/dist/base/toaster.js +2 -2
  67. package/dist/base/tree.js +2 -2
  68. package/dist/base/upload-queue.js +303 -2
  69. package/dist/base/upload-queue.js.map +1 -0
  70. package/dist/base/upload.js +3 -4
  71. package/dist/base/value-inputs.js +1 -1
  72. package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-D6MZQNnC.js} +10 -10
  73. package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-D6MZQNnC.js.map} +1 -1
  74. package/dist/blocks/admin.js +242 -228
  75. package/dist/blocks/admin.js.map +1 -1
  76. package/dist/blocks/ai.js +398 -354
  77. package/dist/blocks/ai.js.map +1 -1
  78. package/dist/blocks/analytics/charts.js +1022 -0
  79. package/dist/blocks/analytics/charts.js.map +1 -0
  80. package/dist/blocks/analytics/usage-card.js +1 -1
  81. package/dist/blocks/analytics.js +173 -1392
  82. package/dist/blocks/analytics.js.map +1 -1
  83. package/dist/blocks/collaboration.js +1 -1
  84. package/dist/blocks/commerce/receipt.js +1 -1
  85. package/dist/blocks/commerce.js +1533 -1399
  86. package/dist/blocks/commerce.js.map +1 -1
  87. package/dist/blocks/data-display.js +2 -3
  88. package/dist/blocks/onboarding.js +91 -82
  89. package/dist/blocks/onboarding.js.map +1 -1
  90. package/dist/blocks/planning.js +25 -25
  91. package/dist/blocks/planning.js.map +1 -1
  92. package/dist/blocks/timelines.js +2 -2
  93. package/dist/breadcrumbs-CQ9JSlez.js +136 -0
  94. package/dist/breadcrumbs-CQ9JSlez.js.map +1 -0
  95. package/dist/{button-S2Cubiiz.js → button-rd6FiHfQ.js} +12 -8
  96. package/dist/button-rd6FiHfQ.js.map +1 -0
  97. package/dist/{buttons-BedGfygC.js → buttons-pZVgPTZn.js} +230 -246
  98. package/dist/buttons-pZVgPTZn.js.map +1 -0
  99. package/dist/{cards-rNX1M4Xn.js → cards-CgWyqvgZ.js} +25 -22
  100. package/dist/{cards-rNX1M4Xn.js.map → cards-CgWyqvgZ.js.map} +1 -1
  101. package/dist/cascader-Cf05pwaq.js +444 -0
  102. package/dist/cascader-Cf05pwaq.js.map +1 -0
  103. package/dist/{chart-Darg_0Kv.js → chart-CygRCyIZ.js} +5 -5
  104. package/dist/{chart-Darg_0Kv.js.map → chart-CygRCyIZ.js.map} +1 -1
  105. package/dist/{checkbox-fflqmODR.js → checkbox-Dy5_XBMZ.js} +4 -4
  106. package/dist/{checkbox-fflqmODR.js.map → checkbox-Dy5_XBMZ.js.map} +1 -1
  107. package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-oJEsrb5Y.js} +195 -184
  108. package/dist/choice-inputs-oJEsrb5Y.js.map +1 -0
  109. package/dist/{code-block-BzmM9Eig.js → code-block-BrLD7mCi.js} +44 -60
  110. package/dist/code-block-BrLD7mCi.js.map +1 -0
  111. package/dist/collapsible-CRCCg_bO.js +80 -0
  112. package/dist/collapsible-CRCCg_bO.js.map +1 -0
  113. package/dist/{collection-content-gDh1v6O4.js → collection-content-D7SoDlYd.js} +3 -3
  114. package/dist/{collection-content-gDh1v6O4.js.map → collection-content-D7SoDlYd.js.map} +1 -1
  115. package/dist/combobox-Dl6f6kHz.js +362 -0
  116. package/dist/combobox-Dl6f6kHz.js.map +1 -0
  117. package/dist/combobox-DrDXtSSt.js +929 -0
  118. package/dist/combobox-DrDXtSSt.js.map +1 -0
  119. package/dist/command-CjZ2VzKC.js +432 -0
  120. package/dist/command-CjZ2VzKC.js.map +1 -0
  121. package/dist/comments-C2MZyRmh.js +1214 -0
  122. package/dist/comments-C2MZyRmh.js.map +1 -0
  123. package/dist/components/base/accordion/accordion.d.ts +11 -3
  124. package/dist/components/base/action-menu/action-menu.d.ts +11 -3
  125. package/dist/components/base/buttons/button.d.ts +2 -2
  126. package/dist/components/base/buttons/index.d.ts +1 -1
  127. package/dist/components/base/buttons/loader-button.d.ts +6 -15
  128. package/dist/components/base/cards/index.d.ts +1 -1
  129. package/dist/components/base/cards/partials/card-body-context.d.ts +6 -0
  130. package/dist/components/base/cards/smart-card.d.ts +0 -2
  131. package/dist/components/base/cards/smart-card.types.d.ts +12 -10
  132. package/dist/components/base/cascader/cascader.d.ts +8 -2
  133. package/dist/components/base/cascader/cascader.types.d.ts +24 -2
  134. package/dist/components/base/cascader/index.d.ts +1 -1
  135. package/dist/components/base/choice-inputs/choice-types.d.ts +4 -0
  136. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
  137. package/dist/components/base/choice-inputs/switch.d.ts +1 -1
  138. package/dist/components/base/code-block/use-code-copy.d.ts +2 -6
  139. package/dist/components/base/combobox/combobox-field.d.ts +2 -2
  140. package/dist/components/base/command/command.d.ts +1 -1
  141. package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
  142. package/dist/components/base/date-pickers/datepicker.types.d.ts +11 -7
  143. package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
  144. package/dist/components/base/display/dialog.d.ts +3 -9
  145. package/dist/components/base/display/index.d.ts +2 -3
  146. package/dist/components/base/display/separator.d.ts +1 -1
  147. package/dist/components/base/feedback/alert.d.ts +2 -1
  148. package/dist/components/base/feedback/empty.d.ts +10 -2
  149. package/dist/components/base/feedback/state-display.d.ts +5 -1
  150. package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
  151. package/dist/components/base/forms/form-field.d.ts +7 -2
  152. package/dist/components/base/forms/workflow.d.ts +2 -2
  153. package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -1
  154. package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
  155. package/dist/components/base/forms-numeric/dimensions-input.d.ts +13 -18
  156. package/dist/components/base/forms-numeric/index.d.ts +3 -3
  157. package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
  158. package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
  159. package/dist/components/base/item/item.types.d.ts +6 -2
  160. package/dist/components/base/metadata-list/index.d.ts +1 -3
  161. package/dist/components/base/metadata-list/metadata-list.d.ts +4 -1
  162. package/dist/components/base/navigation/index.d.ts +2 -2
  163. package/dist/components/base/navigation/language-switcher.d.ts +17 -8
  164. package/dist/components/base/navigation/navigation-tabs.d.ts +8 -1
  165. package/dist/components/base/navigation/page-header/index.d.ts +1 -1
  166. package/dist/components/base/navigation/page-header/page-header.d.ts +13 -17
  167. package/dist/components/base/navigation/pagination.d.ts +5 -5
  168. package/dist/components/base/popover/popover.recipes.d.ts +0 -1
  169. package/dist/components/base/qr-code/qr-code.d.ts +4 -0
  170. package/dist/components/base/repeaters/index.d.ts +1 -1
  171. package/dist/components/base/repeaters/key-value-editor.d.ts +6 -1
  172. package/dist/components/base/sheet/sheet.d.ts +6 -15
  173. package/dist/components/base/sidebar/index.d.ts +1 -6
  174. package/dist/components/base/sidebar/sidebar.d.ts +40 -10
  175. package/dist/components/base/skeleton/skeleton.d.ts +1 -1
  176. package/dist/components/base/structure/structure.types.d.ts +11 -2
  177. package/dist/components/base/text-inputs/index.d.ts +1 -1
  178. package/dist/components/base/tree/index.d.ts +1 -0
  179. package/dist/components/base/tree/tree.d.ts +2 -2
  180. package/dist/components/base/tree/tree.types.d.ts +7 -1
  181. package/dist/components/base/upload/avatar-upload.d.ts +2 -1
  182. package/dist/components/base/upload/file-upload.validation.d.ts +37 -1
  183. package/dist/components/base/upload/image-upload.d.ts +4 -1
  184. package/dist/components/base/upload/index.d.ts +3 -9
  185. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -0
  186. package/dist/components/base/value-inputs/slider.d.ts +5 -2
  187. package/dist/components/blocks/admin/action-surfaces/index.d.ts +17 -4
  188. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +9 -3
  189. package/dist/components/blocks/admin/index.d.ts +1 -1
  190. package/dist/components/blocks/ai/ai-artifact/ai-artifact.d.ts +1 -1
  191. package/dist/components/blocks/ai/ai-artifact/types.d.ts +9 -4
  192. package/dist/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.d.ts +1 -1
  193. package/dist/components/blocks/ai/ai-chain-of-thought/types.d.ts +11 -1
  194. package/dist/components/blocks/ai/ai-citation/ai-citation.d.ts +1 -1
  195. package/dist/components/blocks/ai/ai-citation/types.d.ts +8 -0
  196. package/dist/components/blocks/ai/ai-confirmation/ai-confirmation.d.ts +1 -1
  197. package/dist/components/blocks/ai/ai-confirmation/types.d.ts +21 -5
  198. package/dist/components/blocks/ai/ai-feedback/types.d.ts +7 -2
  199. package/dist/components/blocks/ai/ai-inline-citation/types.d.ts +9 -3
  200. package/dist/components/blocks/ai/ai-package-info/ai-package-info.d.ts +1 -1
  201. package/dist/components/blocks/ai/ai-package-info/types.d.ts +6 -0
  202. package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
  203. package/dist/components/blocks/ai/ai-sources/ai-sources.d.ts +1 -1
  204. package/dist/components/blocks/ai/ai-sources/types.d.ts +10 -2
  205. package/dist/components/blocks/ai/ai-task/ai-task.d.ts +1 -1
  206. package/dist/components/blocks/ai/ai-task/types.d.ts +10 -1
  207. package/dist/components/blocks/ai/ai-tool-call/ai-tool-call.d.ts +1 -1
  208. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +8 -0
  209. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  210. package/dist/components/blocks/analytics/activity-heatmap/types.d.ts +1 -1
  211. package/dist/components/blocks/analytics/analytics.strings.d.ts +2 -0
  212. package/dist/components/blocks/analytics/atoms/metric-trend-chip.d.ts +11 -1
  213. package/dist/components/blocks/analytics/chart-card/chart-card.d.ts +7 -5
  214. package/dist/components/blocks/analytics/charts/index.d.ts +27 -0
  215. package/dist/components/blocks/analytics/index.d.ts +17 -24
  216. package/dist/components/blocks/analytics/metric/metric.d.ts +7 -3
  217. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
  218. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
  219. package/dist/components/blocks/analytics/types.d.ts +13 -4
  220. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  221. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  222. package/dist/components/blocks/commerce/address-card/types.d.ts +5 -16
  223. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +2 -2
  224. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +6 -4
  225. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +0 -2
  226. package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
  227. package/dist/components/blocks/commerce/cart-summary/types.d.ts +9 -11
  228. package/dist/components/blocks/commerce/coupon-input/coupon-input.d.ts +1 -1
  229. package/dist/components/blocks/commerce/coupon-input/types.d.ts +7 -3
  230. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +0 -2
  231. package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
  232. package/dist/components/blocks/commerce/discount-stack/types.d.ts +4 -6
  233. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  234. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +2 -0
  235. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-balance.d.ts +18 -0
  236. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-compact.d.ts +1 -1
  237. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.d.ts +0 -1
  238. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-dark.d.ts +1 -1
  239. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-full.d.ts +1 -1
  240. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.d.ts +1 -1
  241. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.d.ts +1 -1
  242. package/dist/components/blocks/commerce/giftcard-card/types.d.ts +16 -5
  243. package/dist/components/blocks/commerce/index.d.ts +8 -8
  244. package/dist/components/blocks/commerce/inventory-level/inventory-level.strings.d.ts +2 -0
  245. package/dist/components/blocks/commerce/inventory-level/types.d.ts +1 -1
  246. package/dist/components/blocks/commerce/inventory-section/types.d.ts +0 -5
  247. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +6 -3
  248. package/dist/components/blocks/commerce/loyalty-points/loyalty-points.d.ts +1 -1
  249. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +11 -5
  250. package/dist/components/blocks/commerce/order-status/order-status.d.ts +1 -1
  251. package/dist/components/blocks/commerce/order-status/types.d.ts +12 -8
  252. package/dist/components/blocks/commerce/order-timeline/order-timeline.d.ts +1 -1
  253. package/dist/components/blocks/commerce/order-timeline/types.d.ts +3 -1
  254. package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
  255. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +0 -8
  256. package/dist/components/blocks/commerce/payment-method/types.d.ts +0 -2
  257. package/dist/components/blocks/commerce/receipt/index.d.ts +1 -1
  258. package/dist/components/blocks/commerce/receipt/receipt-items.d.ts +1 -1
  259. package/dist/components/blocks/commerce/receipt/types.d.ts +10 -0
  260. package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
  261. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +0 -2
  262. package/dist/components/blocks/commerce/refund-status/types.d.ts +0 -2
  263. package/dist/components/blocks/commerce/seo-listing/types.d.ts +7 -0
  264. package/dist/components/blocks/commerce/shared/code-entry.d.ts +39 -0
  265. package/dist/components/blocks/commerce/shared/order-status.d.ts +1 -1
  266. package/dist/components/blocks/commerce/subscription-summary/subscription-summary.d.ts +1 -1
  267. package/dist/components/blocks/commerce/subscription-summary/types.d.ts +10 -1
  268. package/dist/components/blocks/commerce/upcoming-booking/index.d.ts +2 -1
  269. package/dist/components/blocks/commerce/upcoming-booking/types.d.ts +8 -0
  270. package/dist/components/blocks/commerce/upcoming-booking/upcoming-booking.d.ts +2 -2
  271. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -5
  272. package/dist/components/blocks/commerce/voucher-entry/types.d.ts +6 -3
  273. package/dist/components/blocks/commerce/voucher-entry/voucher-entry.d.ts +1 -1
  274. package/dist/components/blocks/content-block-hooks.d.ts +22 -0
  275. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +5 -1
  276. package/dist/components/blocks/data-display/dense-info-card/helpers.d.ts +3 -1
  277. package/dist/components/blocks/data-display/dense-info-card/index.d.ts +1 -1
  278. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-classification.d.ts +1 -1
  279. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-dashboard.d.ts +1 -1
  280. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-financial.d.ts +1 -1
  281. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-project.d.ts +1 -1
  282. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-score.d.ts +1 -1
  283. package/dist/components/blocks/data-display/dense-info-card/types.d.ts +12 -5
  284. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +10 -3
  285. package/dist/components/blocks/data-display/index.d.ts +0 -1
  286. package/dist/components/blocks/data-display/relationship-card-frame.d.ts +1 -1
  287. package/dist/components/blocks/onboarding/checklist/checklist.types.d.ts +5 -3
  288. package/dist/components/blocks/planning/task-card.types.d.ts +7 -3
  289. package/dist/components/blocks/timelines/changelog/types.d.ts +2 -2
  290. package/dist/components/blocks/timelines/index.d.ts +2 -2
  291. package/dist/components/blocks/timelines/milestones/types.d.ts +2 -2
  292. package/dist/components/blocks/timelines/shared/timeline.d.ts +6 -0
  293. package/dist/components/blocks/timelines/steps-card/index.d.ts +2 -1
  294. package/dist/components/blocks/timelines/steps-card/steps-card.d.ts +2 -2
  295. package/dist/components/blocks/timelines/steps-card/types.d.ts +13 -1
  296. package/dist/components/features/activities/activities.strings.d.ts +5 -3
  297. package/dist/components/features/activities/activities.types.d.ts +46 -22
  298. package/dist/components/features/activities/hooks/use-activity-feed.d.ts +6 -0
  299. package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
  300. package/dist/components/features/activities/index.d.ts +1 -1
  301. package/dist/components/features/activities/partials/activity-headline.d.ts +5 -0
  302. package/dist/components/features/activities/partials/activity-row.d.ts +12 -13
  303. package/dist/components/features/activities/partials/row-layers.d.ts +7 -0
  304. package/dist/components/features/activities/relative-time.d.ts +18 -0
  305. package/dist/components/features/ai-chat/ai-chat.d.ts +6 -2
  306. package/dist/components/features/ai-chat/ai-chat.strings.d.ts +41 -2
  307. package/dist/components/features/ai-chat/ai-chat.types.d.ts +6 -0
  308. package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
  309. package/dist/components/features/ai-chat/partials/ai-chat-attachments-strip.d.ts +5 -1
  310. package/dist/components/features/ai-chat/partials/ai-chat-prompt-input.d.ts +2 -2
  311. package/dist/components/features/ai-chat/partials/ai-chat-queue.d.ts +3 -1
  312. package/dist/components/features/ai-chat/partials/ai-chat-suggestions-row.d.ts +6 -1
  313. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  314. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +20 -4
  315. package/dist/components/features/appointment-calendar/index.d.ts +1 -1
  316. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +18 -10
  317. package/dist/components/features/async-preview/async-preview.d.ts +2 -2
  318. package/dist/components/features/async-preview/async-preview.types.d.ts +30 -1
  319. package/dist/components/features/async-preview/preview-trigger-cell.d.ts +7 -2
  320. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  321. package/dist/components/features/combobox/combobox.d.ts +12 -3
  322. package/dist/components/features/combobox/components/error-message.d.ts +3 -1
  323. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +4 -3
  324. package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
  325. package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
  326. package/dist/components/features/combobox/index.d.ts +1 -1
  327. package/dist/components/features/combobox/types.d.ts +68 -37
  328. package/dist/components/features/comments/comments.strings.d.ts +6 -5
  329. package/dist/components/features/comments/comments.types.d.ts +40 -26
  330. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -1
  331. package/dist/components/features/comments/hooks/use-comments.d.ts +8 -1
  332. package/dist/components/features/data-view/data-view.strings.d.ts +9 -2
  333. package/dist/components/features/data-view/data-view.types.d.ts +15 -2
  334. package/dist/components/features/email-composer/email-html.d.ts +5 -0
  335. package/dist/components/features/email-composer/http.d.ts +2 -0
  336. package/dist/components/features/email-composer/strings.d.ts +17 -2
  337. package/dist/components/features/email-composer/types.d.ts +19 -2
  338. package/dist/components/features/email-composer/use-composer.d.ts +2 -78
  339. package/dist/components/features/event-calendar/event-calendar-day-cell.d.ts +1 -1
  340. package/dist/components/features/event-calendar/event-calendar-event-badge.d.ts +1 -1
  341. package/dist/components/features/event-calendar/event-calendar-header.d.ts +1 -1
  342. package/dist/components/features/event-calendar/event-calendar-legend.d.ts +2 -2
  343. package/dist/components/features/event-calendar/event-calendar.d.ts +1 -1
  344. package/dist/components/features/event-calendar/event-calendar.types.d.ts +126 -21
  345. package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
  346. package/dist/components/features/filters/facets/range-facet.d.ts +24 -7
  347. package/dist/components/features/filters/filter-context.d.ts +9 -0
  348. package/dist/components/features/filters/filters.strings.d.ts +36 -3
  349. package/dist/components/features/filters/filters.types.d.ts +75 -8
  350. package/dist/components/features/filters/hooks/use-filter-draft.d.ts +1 -0
  351. package/dist/components/features/filters/index.d.ts +2 -2
  352. package/dist/components/features/filters/operator-options.d.ts +25 -2
  353. package/dist/components/features/filters/partials/active-filter-item.d.ts +0 -13
  354. package/dist/components/features/filters/partials/async-options-status.d.ts +32 -0
  355. package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
  356. package/dist/components/features/filters/partials/filter-draft-footer.d.ts +11 -0
  357. package/dist/components/features/filters/partials/filter-operator-select.d.ts +4 -2
  358. package/dist/components/features/filters/partials/filter-pill.d.ts +5 -1
  359. package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
  360. package/dist/components/features/filters/partials/filter-tabs.d.ts +2 -1
  361. package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
  362. package/dist/components/features/filters/partials/regular-filter-content.d.ts +1 -1
  363. package/dist/components/features/filters/utils/filter-utils.d.ts +34 -5
  364. package/dist/components/features/global-search/global-search-dialog.d.ts +7 -1
  365. package/dist/components/features/global-search/global-search.d.ts +7 -1
  366. package/dist/components/features/global-search/global-search.strings.d.ts +19 -3
  367. package/dist/components/features/global-search/global-search.types.d.ts +30 -6
  368. package/dist/components/features/global-search/index.d.ts +1 -1
  369. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +6 -1
  370. package/dist/components/features/global-search/partials/global-search-input.d.ts +2 -0
  371. package/dist/components/features/kanban/index.d.ts +2 -2
  372. package/dist/components/features/kanban/kanban-context.d.ts +4 -0
  373. package/dist/components/features/kanban/kanban-keyboard.d.ts +7 -2
  374. package/dist/components/features/kanban/kanban.d.ts +10 -1
  375. package/dist/components/features/kanban/kanban.strings.d.ts +11 -2
  376. package/dist/components/features/kanban/kanban.types.d.ts +26 -0
  377. package/dist/components/features/map/map.d.ts +4 -0
  378. package/dist/components/features/map/place-autocomplete.d.ts +10 -1
  379. package/dist/components/features/media-library/hooks/use-media-library.d.ts +3 -1
  380. package/dist/components/features/media-library/media-library.d.ts +1 -1
  381. package/dist/components/features/media-library/media-library.strings.d.ts +39 -3
  382. package/dist/components/features/media-library/media-library.types.d.ts +82 -9
  383. package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
  384. package/dist/components/features/mentions/hooks/use-mentions-search.d.ts +7 -0
  385. package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
  386. package/dist/components/features/mentions/index.d.ts +1 -1
  387. package/dist/components/features/mentions/mentions.strings.d.ts +10 -2
  388. package/dist/components/features/mentions/partials/mention-chip.d.ts +1 -0
  389. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +12 -1
  390. package/dist/components/features/mentions/partials/mention-picker.d.ts +8 -1
  391. package/dist/components/features/mentions/partials/mention-search-error.d.ts +6 -0
  392. package/dist/components/features/mentions/utils/index.d.ts +0 -1
  393. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  394. package/dist/components/features/overlays/dialog.d.ts +1 -1
  395. package/dist/components/features/overlays/drawer.d.ts +1 -1
  396. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
  397. package/dist/components/features/overlays/index.d.ts +2 -2
  398. package/dist/components/features/overlays/overlays.strings.d.ts +2 -1
  399. package/dist/components/features/overlays/overlays.types.d.ts +27 -10
  400. package/dist/components/features/products/components/index.d.ts +0 -10
  401. package/dist/components/features/products/components/product-contract-overview.d.ts +1 -1
  402. package/dist/components/features/products/components/product-details-card.d.ts +1 -1
  403. package/dist/components/features/products/components/product-operations-card.d.ts +1 -1
  404. package/dist/components/features/products/components/product-option-action-menu.d.ts +1 -1
  405. package/dist/components/features/products/components/product-options-summary.d.ts +1 -1
  406. package/dist/components/features/products/components/product-policies-card.d.ts +1 -1
  407. package/dist/components/features/products/components/product-quote-preview-card.d.ts +1 -1
  408. package/dist/components/features/products/components/product-readiness-card.d.ts +1 -1
  409. package/dist/components/features/products/components/product-structure-card.d.ts +1 -1
  410. package/dist/components/features/products/components/product-variant-action-menu.d.ts +1 -1
  411. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  412. package/dist/components/features/products/components/product-variants-table.d.ts +1 -1
  413. package/dist/components/features/products/partials/product-surface.d.ts +15 -0
  414. package/dist/components/features/products/products.strings.d.ts +8 -0
  415. package/dist/components/features/products/products.types.d.ts +26 -8
  416. package/dist/components/features/questionnaire/questionnaire.types.d.ts +7 -2
  417. package/dist/components/features/resource/index.d.ts +2 -3
  418. package/dist/components/features/resource/resource.d.ts +2 -10
  419. package/dist/components/features/resource/resource.types.d.ts +7 -147
  420. package/dist/components/features/resource-assignment/partials/assignment-surface.d.ts +15 -0
  421. package/dist/components/features/resource-assignment/resource-assignment.strings.d.ts +6 -1
  422. package/dist/components/features/resource-assignment/resource-assignment.types.d.ts +6 -0
  423. package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
  424. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +5 -7
  425. package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
  426. package/dist/components/features/rich-text-editor/partials/html-helpers.d.ts +2 -3
  427. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +6 -2
  428. package/dist/components/features/rich-text-editor/partials/index.d.ts +2 -3
  429. package/dist/components/features/rich-text-editor/partials/rich-text-editor-tiptap.d.ts +0 -1
  430. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +5 -4
  431. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
  432. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +30 -4
  433. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +10 -1
  434. package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
  435. package/dist/components/features/schema-form/schema-form.d.ts +1 -1
  436. package/dist/components/features/schema-form/schema-form.types.d.ts +13 -5
  437. package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
  438. package/dist/components/features/suggestions/suggestions.strings.d.ts +14 -0
  439. package/dist/components/features/suggestions/suggestions.types.d.ts +13 -5
  440. package/dist/components/features/table/data-table.d.ts +1 -1
  441. package/dist/components/features/table/filter-bar.d.ts +1 -1
  442. package/dist/components/features/table/index.d.ts +1 -0
  443. package/dist/components/features/table/pagination.d.ts +1 -1
  444. package/dist/components/features/table/partials/cell-value.d.ts +1 -1
  445. package/dist/components/features/table/table-body.d.ts +1 -1
  446. package/dist/components/features/table/table-header.d.ts +1 -1
  447. package/dist/components/features/table/table-helpers.d.ts +37 -12
  448. package/dist/components/features/table/table-region.recipes.d.ts +11 -0
  449. package/dist/components/features/table/table-toolbar.d.ts +1 -1
  450. package/dist/components/features/table/table.strings.d.ts +4 -0
  451. package/dist/components/features/table/table.types.d.ts +91 -49
  452. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +4 -0
  453. package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +10 -7
  454. package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +17 -0
  455. package/dist/components/layout/app-shell/app-shell.types.d.ts +46 -49
  456. package/dist/components/layout/app-shell/index.d.ts +2 -2
  457. package/dist/components/layout/app-shell/shell-regions.d.ts +9 -0
  458. package/dist/components/layout/app-shell/shell-skip-link.d.ts +9 -0
  459. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  460. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  461. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  462. package/dist/components/layout/auth/auth-shell.d.ts +1 -1
  463. package/dist/components/layout/auth/auth.types.d.ts +0 -5
  464. package/dist/components/layout/containers/inline-gutter-context.d.ts +7 -0
  465. package/dist/components/layout/containers/main-landmark-context.d.ts +6 -0
  466. package/dist/components/layout/header/header.types.d.ts +19 -8
  467. package/dist/components/layout/header/partials/header-global-search-trigger.d.ts +1 -1
  468. package/dist/components/layout/header/partials/header-notifications.d.ts +1 -1
  469. package/dist/components/layout/header/partials/header-search.d.ts +1 -1
  470. package/dist/components/layout/hooks/use-command-shortcut.d.ts +10 -1
  471. package/dist/components/layout/layout.types.d.ts +6 -4
  472. package/dist/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.d.ts +1 -1
  473. package/dist/components/layout/navigation/breadcrumb-progress/types.d.ts +9 -0
  474. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +8 -1
  475. package/dist/components/layout/navigation/side-nav.d.ts +3 -2
  476. package/dist/components/layout/normalize-layout-path.d.ts +1 -0
  477. package/dist/components/layout/page/index.d.ts +2 -3
  478. package/dist/components/layout/page/page.strings.d.ts +12 -0
  479. package/dist/components/layout/page/page.types.d.ts +7 -110
  480. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  481. package/dist/components/layout/settings/index.d.ts +1 -1
  482. package/dist/components/layout/settings/settings.d.ts +4 -6
  483. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  484. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  485. package/dist/components/layout/sidebar/components/sidebar-navigation-footer.d.ts +1 -1
  486. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  487. package/dist/components/layout/sidebar/index.d.ts +1 -1
  488. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +17 -7
  489. package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
  490. package/dist/components/layout/sidebar/sidebar.types.d.ts +12 -12
  491. package/dist/components/layout/sidebar/sidebar.utils.d.ts +4 -0
  492. package/dist/components/layout/workspace/workspace.strings.d.ts +2 -2
  493. package/dist/components/layout/workspace/workspace.types.d.ts +13 -7
  494. package/dist/components/primitives/date.d.ts +22 -3
  495. package/dist/components/primitives/file-size.d.ts +8 -2
  496. package/dist/components/primitives/index.d.ts +1 -1
  497. package/dist/components/primitives/initials.d.ts +3 -1
  498. package/dist/components/primitives/link.d.ts +11 -3
  499. package/dist/components/primitives/money.d.ts +2 -2
  500. package/dist/components/primitives/number.d.ts +3 -2
  501. package/dist/components/typography/heading.d.ts +9 -3
  502. package/dist/components/typography/index.d.ts +1 -1
  503. package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
  504. package/dist/components/typography/text-link.d.ts +10 -3
  505. package/dist/components/ui/badge.d.ts +2 -4
  506. package/dist/components/ui/breadcrumb.d.ts +2 -3
  507. package/dist/components/ui/button.d.ts +8 -2
  508. package/dist/components/ui/collapsible.d.ts +1 -4
  509. package/dist/components/ui/command.d.ts +20 -18
  510. package/dist/components/ui/dialog.d.ts +3 -9
  511. package/dist/components/ui/empty.d.ts +2 -2
  512. package/dist/components/ui/input-group.d.ts +3 -3
  513. package/dist/components/ui/item.d.ts +3 -3
  514. package/dist/components/ui/popover.d.ts +3 -7
  515. package/dist/components/ui/sheet.d.ts +4 -12
  516. package/dist/components/ui/sidebar-state.d.ts +6 -1
  517. package/dist/components/ui/sidebar.d.ts +7 -4
  518. package/dist/components/ui/tabs.d.ts +2 -2
  519. package/dist/components/ui/toggle-group.d.ts +3 -3
  520. package/dist/components/ui/toggle.d.ts +2 -2
  521. package/dist/components/ui/tooltip.d.ts +1 -3
  522. package/dist/{containers-CIxwbZt5.js → containers-BdfLTP4w.js} +37 -32
  523. package/dist/containers-BdfLTP4w.js.map +1 -0
  524. package/dist/content-block-hooks-Z3iKjqd1.js +17 -0
  525. package/dist/content-block-hooks-Z3iKjqd1.js.map +1 -0
  526. package/dist/{copyable-DIznBqiT.js → copyable-Bmr14W0d.js} +6 -6
  527. package/dist/{copyable-DIznBqiT.js.map → copyable-Bmr14W0d.js.map} +1 -1
  528. package/dist/{data-display-BdgCAw8T.js → data-display-CWe9SOYh.js} +264 -250
  529. package/dist/data-display-CWe9SOYh.js.map +1 -0
  530. package/dist/date-3qsCE1ID.js +209 -0
  531. package/dist/date-3qsCE1ID.js.map +1 -0
  532. package/dist/date-picker-D1keJQIG.js +1617 -0
  533. package/dist/date-picker-D1keJQIG.js.map +1 -0
  534. package/dist/date-pickers-D8aJoeHc.js +185 -0
  535. package/dist/date-pickers-D8aJoeHc.js.map +1 -0
  536. package/dist/disclosure-panel-B0HFNZ9x.js.map +1 -1
  537. package/dist/{display-KsZLw9Ov.js → display-VlmP1I0i.js} +23 -46
  538. package/dist/display-VlmP1I0i.js.map +1 -0
  539. package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-B8hjvbkS.js} +9 -9
  540. package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-B8hjvbkS.js.map} +1 -1
  541. package/dist/dropzone-CHBNK3de.js +116 -0
  542. package/dist/dropzone-CHBNK3de.js.map +1 -0
  543. package/dist/features/activities.js +767 -700
  544. package/dist/features/activities.js.map +1 -1
  545. package/dist/features/ai-chat.js +280 -235
  546. package/dist/features/ai-chat.js.map +1 -1
  547. package/dist/features/appointment-calendar.js +430 -334
  548. package/dist/features/appointment-calendar.js.map +1 -1
  549. package/dist/features/async-preview.js +351 -265
  550. package/dist/features/async-preview.js.map +1 -1
  551. package/dist/features/combobox.js +2 -2
  552. package/dist/features/comments.js +1 -1
  553. package/dist/features/data-view.js +212 -151
  554. package/dist/features/data-view.js.map +1 -1
  555. package/dist/features/email-composer/engine.js +1 -1
  556. package/dist/features/email-composer.js +347 -313
  557. package/dist/features/email-composer.js.map +1 -1
  558. package/dist/features/event-calendar.js +501 -348
  559. package/dist/features/event-calendar.js.map +1 -1
  560. package/dist/features/filters.js +2 -2
  561. package/dist/features/global-search.js +250 -210
  562. package/dist/features/global-search.js.map +1 -1
  563. package/dist/features/kanban.js +280 -210
  564. package/dist/features/kanban.js.map +1 -1
  565. package/dist/features/map/style.css +15 -0
  566. package/dist/features/map.js +435 -404
  567. package/dist/features/map.js.map +1 -1
  568. package/dist/features/media-library.js +1745 -1195
  569. package/dist/features/media-library.js.map +1 -1
  570. package/dist/features/mentions.js +2 -2
  571. package/dist/features/overlays.js +2 -2
  572. package/dist/features/products.js +1862 -1759
  573. package/dist/features/products.js.map +1 -1
  574. package/dist/features/questionnaire.js +188 -168
  575. package/dist/features/questionnaire.js.map +1 -1
  576. package/dist/features/resource-assignment.js +223 -191
  577. package/dist/features/resource-assignment.js.map +1 -1
  578. package/dist/features/resource.js +55 -217
  579. package/dist/features/resource.js.map +1 -1
  580. package/dist/features/rich-text-editor.js +28 -19
  581. package/dist/features/rich-text-editor.js.map +1 -1
  582. package/dist/features/schema-form.js +380 -287
  583. package/dist/features/schema-form.js.map +1 -1
  584. package/dist/features/suggestions.js +90 -74
  585. package/dist/features/suggestions.js.map +1 -1
  586. package/dist/features/table.js +2 -2
  587. package/dist/features/theme-tweaker.js +718 -627
  588. package/dist/features/theme-tweaker.js.map +1 -1
  589. package/dist/feedback-DmqmXKLn.js +254 -0
  590. package/dist/feedback-DmqmXKLn.js.map +1 -0
  591. package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-DfbMadot.js} +13 -9
  592. package/dist/field-affordance-recipes-DfbMadot.js.map +1 -0
  593. package/dist/field-control-attributes-B6i335wr.js +18 -0
  594. package/dist/field-control-attributes-B6i335wr.js.map +1 -0
  595. package/dist/field-state-recipes-EtCxpEy3.js +18 -0
  596. package/dist/field-state-recipes-EtCxpEy3.js.map +1 -0
  597. package/dist/filters-BviMRMLS.js +2692 -0
  598. package/dist/filters-BviMRMLS.js.map +1 -0
  599. package/dist/{focus-recipes-B653VaLq.js → focus-recipes-DSkiUvUp.js} +3 -3
  600. package/dist/focus-recipes-DSkiUvUp.js.map +1 -0
  601. package/dist/form-field-BdfCwSoQ.js +74 -0
  602. package/dist/form-field-BdfCwSoQ.js.map +1 -0
  603. package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-DE_dZw32.js} +3 -3
  604. package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-DE_dZw32.js.map} +1 -1
  605. package/dist/{forms-C0RGnJTe.js → forms-B8DzJnBN.js} +35 -35
  606. package/dist/forms-B8DzJnBN.js.map +1 -0
  607. package/dist/forms-numeric-DOBswjKj.js +992 -0
  608. package/dist/forms-numeric-DOBswjKj.js.map +1 -0
  609. package/dist/{header-DMMxG__r.js → header-Cq3G0ZRP.js} +163 -158
  610. package/dist/header-Cq3G0ZRP.js.map +1 -0
  611. package/dist/hooks/use-files.d.ts +2 -0
  612. package/dist/{hooks-DB6CJ4MR.js → hooks-DHfeSMAO.js} +34 -14
  613. package/dist/hooks-DHfeSMAO.js.map +1 -0
  614. package/dist/{http-D_6rOnzU.js → http-Cu-GPpss.js} +61 -35
  615. package/dist/http-Cu-GPpss.js.map +1 -0
  616. package/dist/{icon-badge-DZF-YjQp.js → icon-badge-B0Kq7wom.js} +3 -3
  617. package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-B0Kq7wom.js.map} +1 -1
  618. package/dist/index.js +6 -6
  619. package/dist/inline-gutter-context-CSqmrMFZ.js +11 -0
  620. package/dist/inline-gutter-context-CSqmrMFZ.js.map +1 -0
  621. package/dist/{input-DMBwAZmr.js → input-2YrgTUrz.js} +3 -3
  622. package/dist/{input-DMBwAZmr.js.map → input-2YrgTUrz.js.map} +1 -1
  623. package/dist/{input-CvyDQlY7.js → input-DfJyrjoR.js} +7 -7
  624. package/dist/{input-CvyDQlY7.js.map → input-DfJyrjoR.js.map} +1 -1
  625. package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-DmuS1ase.js} +2 -2
  626. package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-DmuS1ase.js.map} +1 -1
  627. package/dist/item-GJ9mvCcg.js +279 -0
  628. package/dist/item-GJ9mvCcg.js.map +1 -0
  629. package/dist/layout/app-shell.js +1 -1
  630. package/dist/layout/auth.js +1 -1
  631. package/dist/layout/containers.js +1 -1
  632. package/dist/layout/header.js +1 -1
  633. package/dist/layout/hooks.js +1 -1
  634. package/dist/layout/navigation.js +1 -1
  635. package/dist/layout/page.js +2 -2
  636. package/dist/layout/settings.js +2 -2
  637. package/dist/layout/sidebar.js +3 -3
  638. package/dist/layout/workspace.js +1 -1
  639. package/dist/layout.js +12 -12
  640. package/dist/layout.types-DbtnyAtd.js +33 -0
  641. package/dist/layout.types-DbtnyAtd.js.map +1 -0
  642. package/dist/lib/anchored-positioning.d.ts +11 -0
  643. package/dist/lib/field-affordance-recipes.d.ts +10 -0
  644. package/dist/lib/field-control-attributes.d.ts +11 -0
  645. package/dist/lib/field-state-recipes.d.ts +8 -0
  646. package/dist/lib/focus-recipes.d.ts +7 -0
  647. package/dist/lib/format.d.ts +26 -0
  648. package/dist/lib/money-format.d.ts +6 -0
  649. package/dist/lib/motion-recipes.d.ts +6 -0
  650. package/dist/lib/surface-recipes.d.ts +33 -3
  651. package/dist/lib/theme-scope.d.ts +17 -1
  652. package/dist/lib/token-merge.generated.d.ts +19 -25
  653. package/dist/lib/ui-provider/index.d.ts +1 -1
  654. package/dist/lib/ui-provider/types.d.ts +5 -0
  655. package/dist/lib/use-controllable-state.d.ts +16 -0
  656. package/dist/lib/use-copy-feedback.d.ts +15 -0
  657. package/dist/lib/utils.js +1 -1
  658. package/dist/lib/variant-props.d.ts +9 -0
  659. package/dist/main-landmark-context-BAsyqp2I.js +11 -0
  660. package/dist/main-landmark-context-BAsyqp2I.js.map +1 -0
  661. package/dist/mentions-zz0ewNIq.js +670 -0
  662. package/dist/mentions-zz0ewNIq.js.map +1 -0
  663. package/dist/message-BiiVrRrm.js +138 -0
  664. package/dist/message-BiiVrRrm.js.map +1 -0
  665. package/dist/{metadata-list-C3MkU-Om.js → metadata-list-G85roWjS.js} +13 -12
  666. package/dist/metadata-list-G85roWjS.js.map +1 -0
  667. package/dist/{motion-recipes-DitYv6P2.js → motion-recipes-CUc_aHuG.js} +7 -4
  668. package/dist/motion-recipes-CUc_aHuG.js.map +1 -0
  669. package/dist/navigation-C0Be5C3i.js +304 -0
  670. package/dist/navigation-C0Be5C3i.js.map +1 -0
  671. package/dist/navigation-CmqaQR_G.js +257 -0
  672. package/dist/navigation-CmqaQR_G.js.map +1 -0
  673. package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
  674. package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
  675. package/dist/number-NFWKIoiK.js +340 -0
  676. package/dist/number-NFWKIoiK.js.map +1 -0
  677. package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-DV7HE_3t.js} +8 -8
  678. package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-DV7HE_3t.js.map} +1 -1
  679. package/dist/{overlays-BSgCtM2v.js → overlays-D-gAIfPF.js} +369 -364
  680. package/dist/overlays-D-gAIfPF.js.map +1 -0
  681. package/dist/page-D4pQhgSq.js +216 -0
  682. package/dist/page-D4pQhgSq.js.map +1 -0
  683. package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-elelNOfd.js} +29 -29
  684. package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-elelNOfd.js.map} +1 -1
  685. package/dist/{pagination-CgCjElfu.js → pagination-BuSWw1US.js} +22 -23
  686. package/dist/pagination-BuSWw1US.js.map +1 -0
  687. package/dist/popover-BpMxbqEK.js +205 -0
  688. package/dist/popover-BpMxbqEK.js.map +1 -0
  689. package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-CO-_iiuz.js} +7 -7
  690. package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-CO-_iiuz.js.map} +1 -1
  691. package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-BqkdvlZn.js} +3 -4
  692. package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-BqkdvlZn.js.map} +1 -1
  693. package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-BPeS4rGB.js} +2 -2
  694. package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-BPeS4rGB.js.map} +1 -1
  695. package/dist/primitives-BlC1lXBr.js +447 -0
  696. package/dist/primitives-BlC1lXBr.js.map +1 -0
  697. package/dist/primitives.js +4 -4
  698. package/dist/{progress-BJhQP9WX.js → progress-RARK8AjB.js} +5 -5
  699. package/dist/{progress-BJhQP9WX.js.map → progress-RARK8AjB.js.map} +1 -1
  700. package/dist/receipt-CUf2Vegp.js +114 -0
  701. package/dist/receipt-CUf2Vegp.js.map +1 -0
  702. package/dist/rich-text-Cypm9__d.js +44 -0
  703. package/dist/rich-text-Cypm9__d.js.map +1 -0
  704. package/dist/rich-text-editor-Z6cQepsA.js +919 -0
  705. package/dist/rich-text-editor-Z6cQepsA.js.map +1 -0
  706. package/dist/rich-text-editor-toolbar-DYbRJARB.js +100 -0
  707. package/dist/rich-text-editor-toolbar-DYbRJARB.js.map +1 -0
  708. package/dist/rich-text-tree-DdKHIJx4.js +154 -0
  709. package/dist/rich-text-tree-DdKHIJx4.js.map +1 -0
  710. package/dist/{scroll-area-B0dB2cBi.js → scroll-area-B9HKbji0.js} +3 -3
  711. package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-B9HKbji0.js.map} +1 -1
  712. package/dist/{separator-Ct_WSWTJ.js → separator-DaDe26sf.js} +3 -3
  713. package/dist/separator-DaDe26sf.js.map +1 -0
  714. package/dist/{separator-Bb17I4pu.js → separator-KGsNXt2J.js} +2 -2
  715. package/dist/{separator-Bb17I4pu.js.map → separator-KGsNXt2J.js.map} +1 -1
  716. package/dist/services/actions/action-adapters.d.ts +5 -2
  717. package/dist/services/actions/index.d.ts +1 -1
  718. package/dist/services/actions.js +2 -2
  719. package/dist/services/actions.js.map +1 -1
  720. package/dist/settings-D5j_RJvT.js +160 -0
  721. package/dist/settings-D5j_RJvT.js.map +1 -0
  722. package/dist/sheet-B6j_BE9O.js +241 -0
  723. package/dist/sheet-B6j_BE9O.js.map +1 -0
  724. package/dist/{sidebar-f9gRWXIR.js → sidebar-C-iQ_TJP.js} +379 -350
  725. package/dist/sidebar-C-iQ_TJP.js.map +1 -0
  726. package/dist/sidebar-D5VO2W8S.js +715 -0
  727. package/dist/sidebar-D5VO2W8S.js.map +1 -0
  728. package/dist/{skeleton-BapcJd9C.js → skeleton-Cab_KgVo.js} +13 -13
  729. package/dist/skeleton-Cab_KgVo.js.map +1 -0
  730. package/dist/{smart-card-CW0hjetE.js → smart-card-C59z6KFO.js} +217 -210
  731. package/dist/smart-card-C59z6KFO.js.map +1 -0
  732. package/dist/{structure-DuxKl954.js → structure-DElaQwwN.js} +2 -2
  733. package/dist/{structure-DuxKl954.js.map → structure-DElaQwwN.js.map} +1 -1
  734. package/dist/style.css +1 -1
  735. package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-DV6rrOFq.js} +11 -3
  736. package/dist/surface-recipes-DV6rrOFq.js.map +1 -0
  737. package/dist/table-CSRUgpdK.js +180 -0
  738. package/dist/table-CSRUgpdK.js.map +1 -0
  739. package/dist/table-DdXDBsR_.js +1657 -0
  740. package/dist/table-DdXDBsR_.js.map +1 -0
  741. package/dist/tabs-WnHfV2pM.js +192 -0
  742. package/dist/tabs-WnHfV2pM.js.map +1 -0
  743. package/dist/{text-inputs-B1culiSK.js → text-inputs-ljyBYaCd.js} +112 -112
  744. package/dist/text-inputs-ljyBYaCd.js.map +1 -0
  745. package/dist/theme.css +21 -5
  746. package/dist/timelines-mOmS9Eh3.js +479 -0
  747. package/dist/timelines-mOmS9Eh3.js.map +1 -0
  748. package/dist/tooltip-yjX-Uv-p.js +112 -0
  749. package/dist/tooltip-yjX-Uv-p.js.map +1 -0
  750. package/dist/{tree-CzUJHnFs.js → tree-YpkxUG2Z.js} +80 -72
  751. package/dist/tree-YpkxUG2Z.js.map +1 -0
  752. package/dist/typography/rich-text.js +1 -1
  753. package/dist/{typography-BQnine1k.js → typography-C0dELqYV.js} +46 -40
  754. package/dist/typography-C0dELqYV.js.map +1 -0
  755. package/dist/typography.js +1 -1
  756. package/dist/{ui-provider-C-74NVLc.js → ui-provider-Bu1S-o96.js} +4 -3
  757. package/dist/ui-provider-Bu1S-o96.js.map +1 -0
  758. package/dist/ui-provider.js +2 -2
  759. package/dist/upload-DMuMYJFT.js +875 -0
  760. package/dist/upload-DMuMYJFT.js.map +1 -0
  761. package/dist/{usage-card-BeSLY0i0.js → usage-card-DDPki5P1.js} +57 -54
  762. package/dist/usage-card-DDPki5P1.js.map +1 -0
  763. package/dist/use-controllable-state-BlP8SyBI.js +13 -0
  764. package/dist/use-controllable-state-BlP8SyBI.js.map +1 -0
  765. package/dist/use-copy-feedback-CzcaqlLf.js +28 -0
  766. package/dist/use-copy-feedback-CzcaqlLf.js.map +1 -0
  767. package/dist/use-metric-format-options-Dk4rC1NO.js +251 -0
  768. package/dist/use-metric-format-options-Dk4rC1NO.js.map +1 -0
  769. package/dist/{utils-B6kKb8jB.js → utils-BVbAG2J6.js} +128 -112
  770. package/dist/utils-BVbAG2J6.js.map +1 -0
  771. package/dist/value-inputs-h5MwjGCo.js +982 -0
  772. package/dist/value-inputs-h5MwjGCo.js.map +1 -0
  773. package/dist/value-typography-D15uwfj-.js +154 -0
  774. package/dist/value-typography-D15uwfj-.js.map +1 -0
  775. package/dist/workspace-DIryPqBt.js +400 -0
  776. package/dist/workspace-DIryPqBt.js.map +1 -0
  777. package/docs/consumer-skill/SKILL.md +7 -0
  778. package/docs/consumer-skill/agents/themelia-ui-designer.md +11 -2
  779. package/docs/consumer-skill/examples/analytics.tsx +1 -1
  780. package/docs/consumer-skill/examples/app-layout.tsx +3 -3
  781. package/docs/consumer-skill/examples/commerce-lines.tsx +7 -5
  782. package/docs/consumer-skill/examples/detail.tsx +3 -2
  783. package/docs/consumer-skill/examples/edit.tsx +3 -3
  784. package/docs/consumer-skill/examples/email-composer.tsx +1 -1
  785. package/docs/consumer-skill/examples/index-table.tsx +2 -2
  786. package/docs/consumer-skill/examples/scoped-directory.tsx +7 -6
  787. package/docs/consumer-skill/references/agents-md.md +27 -23
  788. package/docs/consumer-skill/references/analytics.md +33 -4
  789. package/docs/consumer-skill/references/building-views.md +213 -0
  790. package/docs/consumer-skill/references/catalogue.md +617 -0
  791. package/docs/consumer-skill/references/component-contracts.json +25852 -32067
  792. package/docs/consumer-skill/references/composition.md +42 -21
  793. package/docs/consumer-skill/references/design-contract.md +1 -0
  794. package/docs/consumer-skill/references/discovery.md +8 -5
  795. package/docs/consumer-skill/references/installation.md +59 -10
  796. package/docs/consumer-skill/references/integration.md +28 -5
  797. package/docs/consumer-skill/references/product-composition.md +2 -2
  798. package/docs/consumer-skill/references/public-api.json +726 -641
  799. package/docs/consumer-skill/references/review.md +57 -15
  800. package/docs/consumer-skill/references/rhf-workflows.md +72 -0
  801. package/docs/consumer-skill/references/screen-archetypes.md +2 -2
  802. package/docs/consumer-skill/references/theming.md +8 -3
  803. package/docs/consumer-skill/references/tokens.json +4 -4
  804. package/docs/consumer-skill/references/workflows.md +7 -7
  805. package/docs/consumer-skill/scripts/composition-policy.mjs +178 -44
  806. package/docs/consumer-skill/scripts/composition.mjs +4 -1
  807. package/docs/consumer-skill/scripts/discovery.mjs +3 -1
  808. package/docs/consumer-skill/scripts/setup-skills.mjs +74 -10
  809. package/docs/consumer-skills/themelia-components/SKILL.md +8 -4
  810. package/docs/consumer-skills/themelia-composition/SKILL.md +7 -3
  811. package/docs/consumer-skills/themelia-design/SKILL.md +7 -1
  812. package/docs/consumer-skills/themelia-tokenization/SKILL.md +1 -1
  813. package/package.json +12 -13
  814. package/templates/README.md +3 -2
  815. package/templates/admin-shell-template.tsx +50 -11
  816. package/templates/analytics-operations-template.tsx +20 -24
  817. package/templates/customers-template.tsx +30 -25
  818. package/templates/index.ts +2 -8
  819. package/templates/orders-template.tsx +28 -24
  820. package/templates/products-template.tsx +14 -4
  821. package/templates/user-permissions-template.tsx +11 -14
  822. package/dist/accordion-B9MHG0cT.js.map +0 -1
  823. package/dist/action-menu-Dr8K-ghE.js +0 -284
  824. package/dist/action-menu-Dr8K-ghE.js.map +0 -1
  825. package/dist/ai-artifact-C58tQcBy.js +0 -1185
  826. package/dist/ai-artifact-C58tQcBy.js.map +0 -1
  827. package/dist/anchored-positioning-DPnKTvNs.js +0 -6
  828. package/dist/anchored-positioning-DPnKTvNs.js.map +0 -1
  829. package/dist/app-shell-B_IuNWOo.js +0 -321
  830. package/dist/app-shell-B_IuNWOo.js.map +0 -1
  831. package/dist/auth-DTkkshS8.js.map +0 -1
  832. package/dist/badge-xIiV_E7f.js.map +0 -1
  833. package/dist/base/sheet.js +0 -3
  834. package/dist/breadcrumbs-J-K2kl4c.js +0 -129
  835. package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
  836. package/dist/button-S2Cubiiz.js.map +0 -1
  837. package/dist/buttons-BedGfygC.js.map +0 -1
  838. package/dist/cascader-B1MiqkBq.js +0 -439
  839. package/dist/cascader-B1MiqkBq.js.map +0 -1
  840. package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
  841. package/dist/code-block-BzmM9Eig.js.map +0 -1
  842. package/dist/collapsible-BkAI_XD4.js +0 -81
  843. package/dist/collapsible-BkAI_XD4.js.map +0 -1
  844. package/dist/combobox-BEx0vJgF.js +0 -362
  845. package/dist/combobox-BEx0vJgF.js.map +0 -1
  846. package/dist/combobox-BwzoXFSG.js +0 -884
  847. package/dist/combobox-BwzoXFSG.js.map +0 -1
  848. package/dist/command-CrlPIL6m.js +0 -425
  849. package/dist/command-CrlPIL6m.js.map +0 -1
  850. package/dist/comments-Dmpp0YIc.js +0 -1169
  851. package/dist/comments-Dmpp0YIc.js.map +0 -1
  852. package/dist/components/base/buttons/tooltip-button.d.ts +0 -7
  853. package/dist/components/base/display/content-block.d.ts +0 -75
  854. package/dist/components/base/display/content-block.strings.d.ts +0 -5
  855. package/dist/components/base/sheet/index.d.ts +0 -29
  856. package/dist/components/blocks/ai/use-copy-feedback.d.ts +0 -6
  857. package/dist/components/blocks/data-display/metadata/index.d.ts +0 -30
  858. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +0 -16
  859. package/dist/components/features/resource/resource.strings.d.ts +0 -12
  860. package/dist/components/features/rich-text-editor/partials/rich-text-editor-fallback.d.ts +0 -8
  861. package/dist/components/features/sync/index.d.ts +0 -26
  862. package/dist/components/features/sync/sync-range-dialog-form.d.ts +0 -5
  863. package/dist/components/features/sync/sync.strings.d.ts +0 -18
  864. package/dist/components/features/sync/sync.types.d.ts +0 -44
  865. package/dist/components/layout/page/partials/page-actions.d.ts +0 -3
  866. package/dist/components/ui/slot.d.ts +0 -6
  867. package/dist/containers-CIxwbZt5.js.map +0 -1
  868. package/dist/data-display-BdgCAw8T.js.map +0 -1
  869. package/dist/date-Cq8ioE4o.js +0 -144
  870. package/dist/date-Cq8ioE4o.js.map +0 -1
  871. package/dist/date-picker-RlIzKom_.js +0 -1551
  872. package/dist/date-picker-RlIzKom_.js.map +0 -1
  873. package/dist/date-pickers-DY-CpXS1.js +0 -179
  874. package/dist/date-pickers-DY-CpXS1.js.map +0 -1
  875. package/dist/display-KsZLw9Ov.js.map +0 -1
  876. package/dist/features/sync.js +0 -142
  877. package/dist/features/sync.js.map +0 -1
  878. package/dist/feedback-Dm4izqFn.js +0 -240
  879. package/dist/feedback-Dm4izqFn.js.map +0 -1
  880. package/dist/field-affordance-recipes-DWcNcOjh.js.map +0 -1
  881. package/dist/field-state-recipes-BVA2CWHo.js +0 -12
  882. package/dist/field-state-recipes-BVA2CWHo.js.map +0 -1
  883. package/dist/filters-DzgSJpMK.js +0 -2257
  884. package/dist/filters-DzgSJpMK.js.map +0 -1
  885. package/dist/focus-recipes-B653VaLq.js.map +0 -1
  886. package/dist/form-field-BriWAXyg.js +0 -63
  887. package/dist/form-field-BriWAXyg.js.map +0 -1
  888. package/dist/forms-C0RGnJTe.js.map +0 -1
  889. package/dist/forms-numeric-DIhghX1Q.js +0 -910
  890. package/dist/forms-numeric-DIhghX1Q.js.map +0 -1
  891. package/dist/header-DMMxG__r.js.map +0 -1
  892. package/dist/hooks-DB6CJ4MR.js.map +0 -1
  893. package/dist/http-D_6rOnzU.js.map +0 -1
  894. package/dist/item-DjCcM18E.js +0 -277
  895. package/dist/item-DjCcM18E.js.map +0 -1
  896. package/dist/layout.types-Cn7aUzJp.js +0 -20
  897. package/dist/layout.types-Cn7aUzJp.js.map +0 -1
  898. package/dist/media-gallery-C-vChPmE.js +0 -203
  899. package/dist/media-gallery-C-vChPmE.js.map +0 -1
  900. package/dist/mentions-0_4nWuI-.js +0 -570
  901. package/dist/mentions-0_4nWuI-.js.map +0 -1
  902. package/dist/message-g8p7eVtN.js +0 -128
  903. package/dist/message-g8p7eVtN.js.map +0 -1
  904. package/dist/metadata-list-C3MkU-Om.js.map +0 -1
  905. package/dist/motion-recipes-DitYv6P2.js.map +0 -1
  906. package/dist/navigation-C90-oQFq.js +0 -255
  907. package/dist/navigation-C90-oQFq.js.map +0 -1
  908. package/dist/navigation-DaRjthVk.js +0 -288
  909. package/dist/navigation-DaRjthVk.js.map +0 -1
  910. package/dist/number-CRU3kGuk.js +0 -354
  911. package/dist/number-CRU3kGuk.js.map +0 -1
  912. package/dist/overlays-BSgCtM2v.js.map +0 -1
  913. package/dist/page-DUUKDAjo.js +0 -331
  914. package/dist/page-DUUKDAjo.js.map +0 -1
  915. package/dist/pagination-CgCjElfu.js.map +0 -1
  916. package/dist/popover-B85RenIl.js +0 -201
  917. package/dist/popover-B85RenIl.js.map +0 -1
  918. package/dist/primitives-ByWgGUgt.js +0 -380
  919. package/dist/primitives-ByWgGUgt.js.map +0 -1
  920. package/dist/receipt-tOc7B3hw.js +0 -116
  921. package/dist/receipt-tOc7B3hw.js.map +0 -1
  922. package/dist/rich-text-Dth5E882.js +0 -78
  923. package/dist/rich-text-Dth5E882.js.map +0 -1
  924. package/dist/rich-text-editor-C1fOjBTd.js +0 -1195
  925. package/dist/rich-text-editor-C1fOjBTd.js.map +0 -1
  926. package/dist/rich-text-editor-toolbar-laT3tpBT.js +0 -98
  927. package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +0 -1
  928. package/dist/sanitize-html-DsQmI48u.js +0 -92
  929. package/dist/sanitize-html-DsQmI48u.js.map +0 -1
  930. package/dist/separator-Ct_WSWTJ.js.map +0 -1
  931. package/dist/settings-Bar5wiSo.js +0 -167
  932. package/dist/settings-Bar5wiSo.js.map +0 -1
  933. package/dist/sheet-BGPERY55.js +0 -250
  934. package/dist/sheet-BGPERY55.js.map +0 -1
  935. package/dist/sidebar-D-JYMMbY.js +0 -686
  936. package/dist/sidebar-D-JYMMbY.js.map +0 -1
  937. package/dist/sidebar-f9gRWXIR.js.map +0 -1
  938. package/dist/skeleton-BapcJd9C.js.map +0 -1
  939. package/dist/slot-CLF9kLrS.js +0 -16
  940. package/dist/slot-CLF9kLrS.js.map +0 -1
  941. package/dist/smart-card-CW0hjetE.js.map +0 -1
  942. package/dist/surface-recipes-BKRVW8Os.js.map +0 -1
  943. package/dist/table-B4TE7iOV.js +0 -175
  944. package/dist/table-B4TE7iOV.js.map +0 -1
  945. package/dist/table-CFOWY9pQ.js +0 -1536
  946. package/dist/table-CFOWY9pQ.js.map +0 -1
  947. package/dist/tabs-e7ko9S2o.js +0 -191
  948. package/dist/tabs-e7ko9S2o.js.map +0 -1
  949. package/dist/text-inputs-B1culiSK.js.map +0 -1
  950. package/dist/timelines-D3Sl9ueq.js +0 -458
  951. package/dist/timelines-D3Sl9ueq.js.map +0 -1
  952. package/dist/tooltip-8wz5S_Zr.js +0 -113
  953. package/dist/tooltip-8wz5S_Zr.js.map +0 -1
  954. package/dist/tree-CzUJHnFs.js.map +0 -1
  955. package/dist/typography-BQnine1k.js.map +0 -1
  956. package/dist/ui-provider-C-74NVLc.js.map +0 -1
  957. package/dist/upload-BOW6U2tI.js +0 -855
  958. package/dist/upload-BOW6U2tI.js.map +0 -1
  959. package/dist/upload-queue-qUXn1ykN.js +0 -409
  960. package/dist/upload-queue-qUXn1ykN.js.map +0 -1
  961. package/dist/usage-card-BeSLY0i0.js.map +0 -1
  962. package/dist/utils-B6kKb8jB.js.map +0 -1
  963. package/dist/value-inputs-skdVB2zh.js +0 -980
  964. package/dist/value-inputs-skdVB2zh.js.map +0 -1
  965. package/dist/value-typography-uAmWUAL1.js +0 -116
  966. package/dist/value-typography-uAmWUAL1.js.map +0 -1
  967. package/dist/workspace-DHeHv0qw.js +0 -411
  968. package/dist/workspace-DHeHv0qw.js.map +0 -1
@@ -1,35 +1,40 @@
1
1
  "use client";
2
- import { S as e, d as t } from "../ui-provider-C-74NVLc.js";
2
+ import { C as e, f as t } from "../ui-provider-Bu1S-o96.js";
3
3
  import { useStrings as n } from "../lib/strings.js";
4
- import { t as r } from "../utils-B6kKb8jB.js";
5
- import { n as i } from "../buttons-BedGfygC.js";
6
- import { c as a, o } from "../typography-BQnine1k.js";
7
- import { t as s } from "../focus-recipes-B653VaLq.js";
8
- import { r as c, t as l } from "../structure-DuxKl954.js";
9
- import { i as u } from "../smart-card-CW0hjetE.js";
10
- import { n as d, t as f } from "../feedback-Dm4izqFn.js";
11
- import { t as p } from "../progress-BJhQP9WX.js";
12
- import { n as m, t as h } from "../composition.recipes-COdiFhxB.js";
13
- import { r as g } from "../overlays-BSgCtM2v.js";
14
- import { t as _ } from "../interaction-recipes-XR9ZpVYL.js";
15
- import { a as v, i as y, t as b } from "../primitives-ByWgGUgt.js";
16
- import { n as x, t as S } from "../number-CRU3kGuk.js";
17
- import { t as C } from "../badge-xIiV_E7f.js";
18
- import { t as ee } from "../batch-action-bar-Cb8cuvyy.js";
19
- import { t as w } from "../input-CvyDQlY7.js";
20
- import { t as T } from "../form-field-BriWAXyg.js";
21
- import { c as E, l as D } from "../choice-inputs-zUgBZfE4.js";
22
- import { r as O, t as k } from "../control-group-recipes-fMuFo0H7.js";
23
- import { t as te } from "../upload.recipes-BbxTqrCT.js";
24
- import { t as ne } from "../metadata-list-C3MkU-Om.js";
25
- import { a as A } from "../upload-queue-qUXn1ykN.js";
26
- import { s as re } from "../data-display-BdgCAw8T.js";
27
- import { createContext as j, useCallback as M, useContext as ie, useEffect as ae, useMemo as N, useRef as oe, useState as P } from "react";
28
- import { Fragment as se, jsx as F, jsxs as I } from "react/jsx-runtime";
29
- import { ArrowLeft as L, ArrowRight as ce, Check as R, File as z, Grid2X2 as B, ImageIcon as le, ImagePlus as ue, Info as de, Layers3 as fe, LayoutList as pe, Lock as me, Play as he, Plus as ge, Search as _e, Star as ve, Trash2 as ye, UploadCloud as be, Video as xe, X as Se } from "lucide-react";
30
- import { createPortal as V } from "react-dom";
4
+ import { t as r } from "../utils-BVbAG2J6.js";
5
+ import { c as i, o as a } from "../typography-C0dELqYV.js";
6
+ import { t as o } from "../focus-recipes-DSkiUvUp.js";
7
+ import { n as s } from "../buttons-pZVgPTZn.js";
8
+ import { r as c, t as l } from "../structure-DElaQwwN.js";
9
+ import { c as u, o as d } from "../surface-recipes-DV6rrOFq.js";
10
+ import { f, m as p, r as m } from "../smart-card-C59z6KFO.js";
11
+ import { n as h, t as g } from "../feedback-DmqmXKLn.js";
12
+ import { t as _ } from "../progress-RARK8AjB.js";
13
+ import { n as v, t as y } from "../composition.recipes-COdiFhxB.js";
14
+ import { n as b } from "../action-menu-D5343RwT.js";
15
+ import { r as x, t as S } from "../overlays-D-gAIfPF.js";
16
+ import { t as C } from "../interaction-recipes-DmuS1ase.js";
17
+ import { a as ee, i as w, t as te } from "../primitives-BlC1lXBr.js";
18
+ import { n as T, t as ne } from "../number-NFWKIoiK.js";
19
+ import { r as E, s as D, t as O } from "../date-3qsCE1ID.js";
20
+ import { t as k } from "../badge-oGiXblW7.js";
21
+ import { t as re } from "../batch-action-bar-D6MZQNnC.js";
22
+ import { t as ie } from "../input-DfJyrjoR.js";
23
+ import { t as A } from "../form-field-BdfCwSoQ.js";
24
+ import { c as j, l as M } from "../choice-inputs-oJEsrb5Y.js";
25
+ import { r as ae, t as oe } from "../control-group-recipes-fMuFo0H7.js";
26
+ import { t as se } from "../upload.recipes-BbxTqrCT.js";
27
+ import { t as N } from "../metadata-list-G85roWjS.js";
28
+ import { i as P, n as ce, r as le, t as ue } from "../tabs-WnHfV2pM.js";
29
+ import { t as de } from "../dropzone-CHBNK3de.js";
30
+ import { s as fe } from "../upload-DMuMYJFT.js";
31
+ import { s as F } from "../data-display-CWe9SOYh.js";
32
+ import { createContext as pe, useCallback as I, useContext as me, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
33
+ import { Fragment as he, jsx as V, jsxs as H } from "react/jsx-runtime";
34
+ import { ArrowLeft as ge, ArrowRight as _e, Check as ve, File as ye, Grid2X2 as be, ImageIcon as xe, ImagePlus as Se, Info as Ce, Layers3 as we, LayoutList as Te, Lock as Ee, Play as De, Plus as Oe, Search as ke, Star as Ae, Trash2 as je, UploadCloud as Me, Video as Ne, X as Pe } from "lucide-react";
35
+ import { createPortal as Fe } from "react-dom";
31
36
  //#region src/components/features/media-library/media-library.strings.ts
32
- var Ce = {
37
+ var U = {
33
38
  title: "Add media",
34
39
  description: "Pick from the library, or upload new files.",
35
40
  close: "Close media library",
@@ -55,8 +60,8 @@ var Ce = {
55
60
  gridView: "Grid view",
56
61
  tableView: "Table view",
57
62
  countAll: "{count} {count, plural, one {item} other {items}}",
58
- countFiltered: "{count} of {total} items",
59
- countSearch: "{count} of {total} items for \"{query}\"",
63
+ countFiltered: "{count} of {total} {total, plural, one {item} other {items}}",
64
+ countSearch: "{count} of {total} {total, plural, one {item} other {items}} for \"{query}\"",
60
65
  activeSearchLabel: "Search",
61
66
  resultsLabel: "Media results",
62
67
  emptyLibraryTitle: "Library is empty",
@@ -69,12 +74,13 @@ var Ce = {
69
74
  errorTitle: "Media could not load",
70
75
  errorDescription: "Check your connection, then try again.",
71
76
  retry: "Try again",
77
+ loadMore: "Load more",
78
+ loadingMore: "Loading more...",
79
+ loadMoreError: "Could not load more media.",
72
80
  cardDetails: "Details for {name}",
73
81
  selectMode: "Select",
74
82
  selectItem: "Select {name}",
75
83
  batchActionsLabel: "Batch actions",
76
- privateLabel: "Private",
77
- publicLabel: "Public",
78
84
  typeImage: "Image",
79
85
  typeVideo: "Video",
80
86
  typeFile: "File",
@@ -105,11 +111,17 @@ var Ce = {
105
111
  usedIn: "Used in",
106
112
  replace: "Replace file",
107
113
  delete: "Delete",
108
- close: "Close details"
114
+ close: "Close details",
115
+ mutationError: "Could not change this asset. Try again.",
116
+ confirmDeleteTitle: "Delete media?",
117
+ confirmDeleteDescription: "{name} will be removed from this library.",
118
+ confirmDeleteLabel: "Delete asset",
119
+ confirmDeleteError: "Could not delete this asset. Try again.",
120
+ noCollection: "No collection"
109
121
  },
110
122
  upload: {
111
123
  dropTitle: "Drag files here or click to browse",
112
- dropHint: "JPG, PNG, WebP, SVG and MP4 up to 50 MB per file",
124
+ dropHint: "JPG, PNG, WebP, SVG and MP4",
113
125
  dragOver: "Release to stage files",
114
126
  collection: "Collection",
115
127
  tags: "Tags",
@@ -120,7 +132,14 @@ var Ce = {
120
132
  stagedCount: "{count} {count, plural, one {file} other {files}}",
121
133
  removeFile: "Remove {name}",
122
134
  uploading: "Uploading",
123
- done: "Done"
135
+ done: "Done",
136
+ error: "Could not upload these files. Try again.",
137
+ noCollection: "No collection",
138
+ fileFailed: "Upload failed",
139
+ unsupportedType: "{name} is not an accepted file type.",
140
+ tooLarge: "{name} is larger than {size}.",
141
+ tooMany: "Only {count} {count, plural, one {file} other {files}} can be staged at once.",
142
+ sizeLimitHint: "Up to {size} per file"
124
143
  },
125
144
  footer: {
126
145
  pickOne: "Pick one item",
@@ -128,7 +147,7 @@ var Ce = {
128
147
  selectedCount: "{count} selected",
129
148
  clear: "Clear",
130
149
  cancel: "Cancel",
131
- confirmEmpty: "Add to product",
150
+ confirmEmpty: "Add items",
132
151
  confirmOne: "Add 1 item",
133
152
  confirmMany: "Add {count} items",
134
153
  noFiles: "No files staged",
@@ -145,27 +164,46 @@ var Ce = {
145
164
  addTile: "Add another media item",
146
165
  cover: "Cover",
147
166
  primary: "Primary",
148
- setPrimary: "Set primary",
149
- remove: "Remove",
150
- movePrevious: "Move previous",
151
- moveNext: "Move next",
167
+ setPrimary: "Set {name} as primary",
168
+ remove: "Remove {name}",
169
+ movePrevious: "Move {name} earlier",
170
+ moveNext: "Move {name} later",
152
171
  itemPosition: "{index} of {total}",
153
- maxReached: "Maximum reached"
172
+ maxReached: "Maximum reached",
173
+ itemActions: "Actions for {name}",
174
+ setCoverAction: "Set as cover",
175
+ movePreviousAction: "Move earlier",
176
+ moveNextAction: "Move later"
154
177
  }
155
178
  };
156
- function H(e, t) {
179
+ function W(e, t) {
157
180
  return e.replace(/\{(\w+), plural, one \{([^}]*)\} other \{([^}]*)\}\}/g, (e, n, r, i) => Number(t[n]) === 1 ? r : i).replace(/\{(\w+)\}/g, (e, n) => String(t[n] ?? ""));
158
181
  }
159
182
  //#endregion
160
183
  //#region src/components/features/media-library/hooks/use-media-library.ts
161
- var we = {
184
+ var Ie = {
162
185
  collection: void 0,
163
186
  tags: [],
164
187
  public: !0
165
- }, Te = [];
166
- function U(e, t, n) {
167
- let [r, i] = P(t), a = e ?? r;
168
- return [a, M((t) => {
188
+ }, Le = [], Re = "image/*,video/*", ze = "Upload failed", Be = 48, Ve = {
189
+ page: 1,
190
+ hasMore: !1
191
+ };
192
+ function He(e, t) {
193
+ return {
194
+ page: e,
195
+ cursor: t.nextCursor,
196
+ hasMore: t.hasMore ?? t.nextCursor != null
197
+ };
198
+ }
199
+ var Ue = {
200
+ "invalid-type": "type",
201
+ "too-large": "size",
202
+ "too-many": "count"
203
+ };
204
+ function We(e, t, n) {
205
+ let [r, i] = B(t), a = e ?? r;
206
+ return [a, I((t) => {
169
207
  let r = typeof t == "function" ? t(a) : t;
170
208
  e === void 0 && i(r), n?.(r);
171
209
  }, [
@@ -174,7 +212,7 @@ function U(e, t, n) {
174
212
  a
175
213
  ])];
176
214
  }
177
- var Ee = {
215
+ var Ge = {
178
216
  getId: (e) => e.id,
179
217
  getName: (e) => e.name,
180
218
  getType: (e) => e.type,
@@ -192,47 +230,91 @@ var Ee = {
192
230
  getTint: (e) => e.tint,
193
231
  getMimeType: (e) => e.mimeType
194
232
  };
195
- function De(e) {
233
+ function Ke(e) {
196
234
  return {
197
- ...Ee,
235
+ ...Ge,
198
236
  ...e
199
237
  };
200
238
  }
201
- function Oe(e) {
202
- return v(e) ?? "";
239
+ function qe(e) {
240
+ return ee(e) ?? "";
203
241
  }
204
- function ke(e, t) {
242
+ function Je(e, t) {
205
243
  let n = t.getWidth(e), r = t.getHeight(e);
206
244
  return !n || !r ? "" : `${n} x ${r}`;
207
245
  }
208
- function Ae(e, t) {
246
+ function G(e, t) {
209
247
  let n = t.getUploadedAt(e);
210
248
  if (!n) return 0;
211
249
  let r = (n instanceof Date ? n : new Date(n)).getTime();
212
250
  return Number.isFinite(r) ? r : 0;
213
251
  }
214
- function je(e) {
252
+ function K(e) {
215
253
  return e.type.startsWith("image/") ? "image" : e.type.startsWith("video/") ? "video" : "file";
216
254
  }
217
- function Me(e) {
255
+ function Ye(e) {
218
256
  if (e.type.startsWith("image/") && typeof URL < "u" && typeof URL.createObjectURL == "function") return URL.createObjectURL(e);
219
257
  }
220
- function Ne(e) {
258
+ function Xe(e) {
221
259
  e && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(e);
222
260
  }
223
- function Pe(e) {
261
+ function q(e) {
224
262
  return Array.isArray(e) ? {
225
263
  items: e,
226
264
  total: e.length
227
265
  } : e;
228
266
  }
229
- function Fe(e, t) {
267
+ function Ze(e, t) {
230
268
  return t && typeof e == "object" && e ? {
231
269
  ...e,
232
270
  ...t
233
271
  } : e;
234
272
  }
235
- function Ie(e, t, n, r, i) {
273
+ var Qe = [
274
+ "alt",
275
+ "collection",
276
+ "tags",
277
+ "public"
278
+ ];
279
+ function $e(e, t, n) {
280
+ let r = {};
281
+ for (let i of n) i === "alt" ? r.alt = t.getAlt(e) : i === "collection" ? r.collection = t.getCollection(e) : i === "tags" ? r.tags = t.getTags(e) : r.public = t.getPublic(e);
282
+ return r;
283
+ }
284
+ function et(e, t) {
285
+ if (Array.isArray(e) || Array.isArray(t)) {
286
+ let n = Array.isArray(e) ? e : [], r = Array.isArray(t) ? t : [];
287
+ return n.length === r.length && n.every((e, t) => e === r[t]);
288
+ }
289
+ return e === t;
290
+ }
291
+ function tt(e, t) {
292
+ return e === t || e.length === t.length && e.every((e, n) => e === t[n]);
293
+ }
294
+ function nt(e, t) {
295
+ if (Object.keys(t).length === 0) return e;
296
+ let n = (n) => t[e.getId(n)];
297
+ return {
298
+ ...e,
299
+ getAlt: (t) => {
300
+ let r = n(t);
301
+ return r && "alt" in r ? r.alt : e.getAlt(t);
302
+ },
303
+ getCollection: (t) => {
304
+ let r = n(t);
305
+ return r && "collection" in r ? r.collection : e.getCollection(t);
306
+ },
307
+ getTags: (t) => {
308
+ let r = n(t);
309
+ return r && "tags" in r ? r.tags ?? [] : e.getTags(t);
310
+ },
311
+ getPublic: (t) => {
312
+ let r = n(t);
313
+ return r && "public" in r ? r.public : e.getPublic(t);
314
+ }
315
+ };
316
+ }
317
+ function rt(e, t, n, r, i) {
236
318
  let a = n.trim().toLowerCase();
237
319
  return e.filter((e) => r !== "all" && t.getType(e) !== r || i !== "all" && t.getCollection(e) !== i ? !1 : !a || [
238
320
  t.getName(e),
@@ -241,326 +323,558 @@ function Ie(e, t, n, r, i) {
241
323
  ...t.getTags(e)
242
324
  ].filter(Boolean).join(" ").toLowerCase().includes(a));
243
325
  }
244
- function Le(e, t, n) {
326
+ function it(e, t, n) {
245
327
  let r = e.slice();
246
- return n === "name" ? r.sort((e, n) => t.getName(e).localeCompare(t.getName(n))) : n === "size" ? r.sort((e, n) => (t.getSize(n) ?? 0) - (t.getSize(e) ?? 0)) : n === "usage" ? r.sort((e, n) => (t.getUsageCount(n) ?? 0) - (t.getUsageCount(e) ?? 0)) : r.sort((e, n) => Ae(n, t) - Ae(e, t)), r;
328
+ return n === "name" ? r.sort((e, n) => t.getName(e).localeCompare(t.getName(n))) : n === "size" ? r.sort((e, n) => (t.getSize(n) ?? 0) - (t.getSize(e) ?? 0)) : n === "usage" ? r.sort((e, n) => (t.getUsageCount(n) ?? 0) - (t.getUsageCount(e) ?? 0)) : r.sort((e, n) => G(n, t) - G(e, t)), r;
247
329
  }
248
- function Re({ items: e = Te, fetcher: t, accessors: n, selectionMode: r = "multiple", value: i, defaultValue: a = [], onValueChange: o, onItemUpdate: s, onItemDelete: c, onUpload: l, onError: u, tab: d, defaultTab: f = "library", onTabChange: p, view: m, defaultView: h = "grid", onViewChange: g, query: _, defaultQuery: v = "", onQueryChange: y, type: b, defaultType: x = "all", onTypeChange: S, collection: C, defaultCollection: ee = "all", onCollectionChange: w, sort: T, defaultSort: E = "newest", onSortChange: D, uploadOptions: O, defaultUploadOptions: k, onUploadOptionsChange: te, selecting: ne, defaultSelecting: A = !1, onSelectingChange: re } = {}) {
249
- let j = N(() => De(n), [n]), [ie, se] = U(d, f, p), [F, I] = U(m, h, g), [L, ce] = U(_, v, y), [R, z] = U(b, x, S), [B, le] = U(C, ee, w), [ue, de] = U(T, E, D), [fe, pe] = P(null), [me, he] = P(() => [...a]), [ge, _e] = P([]), [ve, ye] = P(), [be, xe] = P(!1), [Se, V] = P(null), [Ce, H] = P([]), [Ee, Oe] = P(() => /* @__PURE__ */ new Set()), [ke, Ae] = P({}), [Re, W] = P([]), [ze, Be] = P(!1), Ve = N(() => ({
250
- ...we,
251
- ...k,
252
- tags: k?.tags ?? we.tags
253
- }), [k]), [G, K] = U(N(() => O ? {
254
- ...we,
255
- ...O,
256
- tags: O.tags ?? we.tags
257
- } : void 0, [O]), Ve, te), q = i !== void 0, J = N(() => q ? [...i ?? []] : me, [
258
- me,
259
- q,
260
- i
261
- ]), Y = N(() => new Set(J), [J]), He = oe(/* @__PURE__ */ new Set()), X = oe(null), Ue = oe(/* @__PURE__ */ new Map()), [We, Ge] = P(0), Ke = M(() => Ge((e) => e + 1), []);
262
- ae(() => {
263
- if (!t) return;
264
- let e = new AbortController();
265
- return xe(!0), V(null), t({
266
- query: L,
267
- type: R,
268
- collection: B === "all" ? void 0 : B,
269
- sort: ue,
270
- signal: e.signal
271
- }).then((t) => {
272
- if (e.signal.aborted) return;
273
- let n = Pe(t);
274
- _e(n.items), ye(n.total);
275
- }).catch((t) => {
276
- e.signal.aborted || (V(t), u?.(t));
277
- }).finally(() => {
278
- e.signal.aborted || xe(!1);
279
- }), () => e.abort();
330
+ function at({ items: e = Le, fetcher: t, refreshKey: n, pageSize: r = Be, accessors: i, selectionMode: a = "multiple", value: o, defaultValue: s = [], onValueChange: c, onItemUpdate: l, onItemDelete: u, onUpload: d, uploadAccept: f = Re, maxFileSize: p, maxFiles: m, uploadFailedMessage: h = ze, onError: g, tab: _, defaultTab: v = "library", onTabChange: y, view: b, defaultView: x = "grid", onViewChange: S, query: C, defaultQuery: ee = "", onQueryChange: w, type: te, defaultType: T = "all", onTypeChange: ne, collection: E, defaultCollection: D = "all", onCollectionChange: O, sort: k, defaultSort: re = "newest", onSortChange: ie, uploadOptions: A, defaultUploadOptions: j, onUploadOptionsChange: M, selecting: ae, defaultSelecting: oe = !1, onSelectingChange: se } = {}) {
331
+ let N = !!t, P = R(() => Ke(i), [i]), [ce, le] = We(_, v, y), [ue, de] = We(b, x, S), [F, pe] = We(C, ee, w), [me, he] = We(te, T, ne), [V, H] = We(E, D, O), [ge, _e] = We(k, re, ie), [ve, ye] = B(null), [be, xe] = B(() => [...s]), [Se, Ce] = B(null), [we, Te] = B(N), [Ee, De] = B(null), [Oe, ke] = B(Ve), [Ae, je] = B(!1), [Me, Ne] = B(null), Pe = z(null), [Fe, U] = B(null), [W, Ge] = B(null), [qe, Je] = B([]), [G, at] = B([]), [ot, st] = B(() => /* @__PURE__ */ new Map()), [J, ct] = B(() => /* @__PURE__ */ new Set()), [Y, lt] = B({}), X = R(() => nt(P, Y), [P, Y]), ut = z(/* @__PURE__ */ new Map()), Z = z(/* @__PURE__ */ new Map()), dt = z(/* @__PURE__ */ new Map()), ft = z(/* @__PURE__ */ new Map()), [pt, mt] = B(0), [ht, gt] = B([]), _t = z(ht), [vt, yt] = B([]), bt = z(0), [xt, St] = B(!1), Ct = R(() => ({
332
+ ...Ie,
333
+ ...j,
334
+ tags: j?.tags ?? Ie.tags
335
+ }), [j]), [wt, Tt] = We(R(() => A ? {
336
+ ...Ie,
337
+ ...A,
338
+ tags: A.tags ?? Ie.tags
339
+ } : void 0, [A]), Ct, M), Et = o !== void 0, Q = R(() => Et ? [...o ?? []] : be, [
340
+ be,
341
+ Et,
342
+ o
343
+ ]), Dt = R(() => new Set(Q), [Q]), Ot = z(/* @__PURE__ */ new Set()), kt = z(null), At = z(/* @__PURE__ */ new Map()), [jt, Mt] = B(0), Nt = I(() => Mt((e) => e + 1), []), Pt = z({
344
+ fetcher: t,
345
+ onError: g
346
+ });
347
+ L(() => {
348
+ Pt.current = {
349
+ fetcher: t,
350
+ onError: g
351
+ };
352
+ }, [t, g]), L(() => {
353
+ let e = Pt.current.fetcher;
354
+ if (!N || !e) {
355
+ Te(!1), De(null), Ce(null), ke(Ve), at((e) => e.length ? [] : e);
356
+ return;
357
+ }
358
+ let t = new AbortController();
359
+ return Pe.current?.abort(), Pe.current = null, je(!1), Ne(null), Te(!0), De(null), (async () => {
360
+ try {
361
+ let n = await e({
362
+ query: F,
363
+ type: me,
364
+ collection: V === "all" ? void 0 : V,
365
+ sort: ge,
366
+ limit: r,
367
+ page: 1,
368
+ signal: t.signal
369
+ });
370
+ if (t.signal.aborted) return;
371
+ let i = q(n);
372
+ Ce(i), ke(He(1, i));
373
+ } catch (e) {
374
+ if (t.signal.aborted) return;
375
+ De(() => e ?? /* @__PURE__ */ Error("Media load failed")), Pt.current.onError?.(e);
376
+ } finally {
377
+ t.signal.aborted || Te(!1);
378
+ }
379
+ })(), () => t.abort();
280
380
  }, [
281
- B,
282
- We,
283
- t,
284
- u,
285
- L,
286
- ue,
287
- R
288
- ]), ae(() => {
289
- let e = He.current;
381
+ V,
382
+ jt,
383
+ N,
384
+ r,
385
+ F,
386
+ n,
387
+ ge,
388
+ me
389
+ ]);
390
+ let Ft = I(async () => {
391
+ let e = Pt.current.fetcher;
392
+ if (!e || !Oe.hasMore || we || Pe.current) return;
393
+ let t = new AbortController();
394
+ Pe.current = t;
395
+ let n = Oe.page + 1;
396
+ je(!0), Ne(null);
397
+ try {
398
+ let i = await e({
399
+ query: F,
400
+ type: me,
401
+ collection: V === "all" ? void 0 : V,
402
+ sort: ge,
403
+ limit: r,
404
+ page: n,
405
+ cursor: Oe.cursor,
406
+ signal: t.signal
407
+ });
408
+ if (t.signal.aborted) return;
409
+ let a = q(i);
410
+ Ce((e) => {
411
+ let t = e?.items ?? [], n = new Set(t.map((e) => P.getId(e))), r = [...t, ...a.items.filter((e) => !n.has(P.getId(e)))];
412
+ return {
413
+ items: r,
414
+ total: Array.isArray(i) ? r.length : a.total ?? e?.total
415
+ };
416
+ }), ke(He(n, a));
417
+ } catch (e) {
418
+ if (t.signal.aborted) return;
419
+ Ne(() => e ?? /* @__PURE__ */ Error("Media load failed")), Pt.current.onError?.(e);
420
+ } finally {
421
+ Pe.current === t && (Pe.current = null, je(!1));
422
+ }
423
+ }, [
424
+ P,
425
+ V,
426
+ we,
427
+ r,
428
+ Oe,
429
+ F,
430
+ ge,
431
+ me
432
+ ]);
433
+ L(() => {
434
+ if (!N || !Se) return;
435
+ let e = new Set(Se.items.map((e) => X.getId(e)));
436
+ at((t) => {
437
+ let n = t.filter((t) => !e.has(X.getId(t)));
438
+ return n.length === t.length ? t : n;
439
+ });
440
+ }, [
441
+ X,
442
+ Se,
443
+ N
444
+ ]), L(() => {
445
+ let e = Ot.current;
290
446
  return () => {
291
- X.current?.abort();
292
- for (let t of e) Ne(t);
447
+ kt.current?.abort(), Pe.current?.abort();
448
+ for (let t of e) Xe(t);
293
449
  e.clear();
294
450
  };
295
451
  }, []);
296
- let qe = N(() => t ? ge : [...Ce, ...e], [
297
- Ce,
298
- ge,
299
- t,
300
- e
301
- ]), Z = N(() => qe.filter((e) => !Ee.has(j.getId(e))).map((e) => Fe(e, ke[j.getId(e)])), [
302
- j,
303
- ke,
304
- Ee,
305
- qe
306
- ]), Je = N(() => {
307
- let e = t ? Z : Ie(Z, j, L, R, B);
308
- return t ? e : Le(e, j, ue);
452
+ let It = Se?.items ?? Le, Lt = R(() => {
453
+ let e = new Set(It.map((e) => X.getId(e)));
454
+ return rt(G.filter((t) => {
455
+ let n = X.getId(t);
456
+ return !e.has(n) && !J.has(n);
457
+ }), X, F, me, V);
458
+ }, [
459
+ X,
460
+ V,
461
+ F,
462
+ J,
463
+ It,
464
+ G,
465
+ me
466
+ ]), Rt = R(() => {
467
+ if (N) return [...Lt, ...It];
468
+ if (qe.length === 0) return [...e];
469
+ let t = new Set(e.map((e) => X.getId(e)));
470
+ return [...qe.filter((e) => !t.has(X.getId(e))), ...e];
471
+ }, [
472
+ X,
473
+ qe,
474
+ N,
475
+ e,
476
+ Lt,
477
+ It
478
+ ]), zt = N ? It : e, Bt = z({
479
+ sourceItems: Rt,
480
+ suppliedItems: zt
481
+ });
482
+ L(() => {
483
+ Bt.current = {
484
+ sourceItems: Rt,
485
+ suppliedItems: zt
486
+ };
487
+ }, [Rt, zt]), L(() => {
488
+ let e = Y;
489
+ for (let [t, n] of Object.entries(Y)) {
490
+ if (Z.current.has(t)) continue;
491
+ let r = Rt.find((e) => P.getId(e) === t);
492
+ if (r === void 0) continue;
493
+ let i = ut.current.get(t) ?? {}, a = $e(r, P, Qe), o = { ...n }, s = { ...i };
494
+ for (let e of Qe) e in n && (e in i && !et(a[e], i[e]) || et(a[e], n[e])) && (delete o[e], delete s[e]);
495
+ Object.keys(o).length !== Object.keys(n).length && (e === Y && (e = { ...Y }), Object.keys(o).length > 0 ? (e[t] = o, ut.current.set(t, s)) : (delete e[t], ut.current.delete(t)));
496
+ }
497
+ e !== Y && lt(e);
498
+ let t = [];
499
+ for (let [e, n] of ft.current) dt.current.has(e) || J.has(e) && tt(n, zt) || (ft.current.delete(e), J.has(e) && t.push(e));
500
+ t.length > 0 && ct((e) => {
501
+ let n = new Set(e);
502
+ for (let e of t) n.delete(e);
503
+ return n;
504
+ });
309
505
  }, [
310
- j,
311
- B,
312
- t,
313
- Z,
314
- L,
315
- ue,
316
- R
317
- ]), Ye = ve ?? Z.length, Q = Je.length, Xe = N(() => Z.filter((e) => Y.has(j.getId(e))), [
318
- j,
319
- Z,
320
- Y
321
- ]), Ze = !!L.trim() || R !== "all" || B !== "all", $ = M((e) => {
322
- q || he(e);
323
- let t = new Set(e), n = Z.filter((e) => t.has(j.getId(e)));
324
- o?.(e, n);
506
+ P,
507
+ Y,
508
+ J,
509
+ pt,
510
+ Rt,
511
+ zt
512
+ ]);
513
+ let Vt = R(() => Rt.filter((e) => !J.has(X.getId(e))).map((e) => Ze(e, Y[X.getId(e)])), [
514
+ X,
515
+ Y,
516
+ J,
517
+ Rt
518
+ ]), Ht = R(() => N ? Vt : it(rt(Vt, X, F, me, V), X, ge), [
519
+ X,
520
+ V,
521
+ N,
522
+ Vt,
523
+ F,
524
+ ge,
525
+ me
526
+ ]), Ut = N && Se?.total !== void 0 ? Se.total + Lt.length : Vt.length, Wt = Ht.length, Gt = R(() => new Map([...G, ...It].map((e) => [X.getId(e), e])), [
527
+ X,
528
+ It,
529
+ G
530
+ ]);
531
+ L(() => {
532
+ st((e) => {
533
+ let t = /* @__PURE__ */ new Map();
534
+ if (N) for (let n of Q) {
535
+ let r = Gt.get(n) ?? e.get(n);
536
+ r !== void 0 && t.set(n, r);
537
+ }
538
+ return t.size === e.size && [...t].every(([t, n]) => e.get(t) === n) ? e : t;
539
+ });
325
540
  }, [
326
- j,
327
- q,
328
- o,
329
- Z
330
- ]), Qe = M((e) => {
331
- let t = new Set(r === "single" ? [] : Y);
332
- Y.has(e) && r !== "single" ? t.delete(e) : t.add(e), $(Array.from(t));
541
+ N,
542
+ Gt,
543
+ Q
544
+ ]);
545
+ let Kt = I((e, t = []) => {
546
+ if (!N) {
547
+ let n = new Set(e);
548
+ return [...t, ...Vt].filter((e) => n.delete(X.getId(e)));
549
+ }
550
+ let n = new Map(t.map((e) => [X.getId(e), e]));
551
+ return e.flatMap((e) => {
552
+ if (J.has(e)) return [];
553
+ let t = n.get(e) ?? Gt.get(e) ?? ot.get(e);
554
+ return t === void 0 ? [] : [Ze(t, Y[e])];
555
+ });
333
556
  }, [
334
- $,
557
+ X,
558
+ N,
335
559
  Y,
336
- r
337
- ]), $e = M(() => $([]), [$]), [et, tt] = U(ne, A, re), nt = et || J.length > 0, rt = M((e) => {
338
- tt(e), !e && J.length > 0 && $([]);
560
+ Gt,
561
+ Vt,
562
+ J,
563
+ ot
564
+ ]), qt = R(() => Kt(Q), [Kt, Q]), Jt = !!F.trim() || me !== "all" || V !== "all", Yt = I((e, t) => {
565
+ Et || xe(e), c?.(e, Kt(e, t));
339
566
  }, [
340
- $,
341
- J.length,
342
- tt
343
- ]), it = M(() => {
344
- ce(""), z("all"), le("all");
567
+ Et,
568
+ c,
569
+ Kt
570
+ ]), Xt = z({
571
+ applySelection: Yt,
572
+ selectedIds: Q
573
+ });
574
+ L(() => {
575
+ Xt.current = {
576
+ applySelection: Yt,
577
+ selectedIds: Q
578
+ };
579
+ }, [Yt, Q]);
580
+ let Zt = I((e) => {
581
+ let t = new Set(a === "single" ? [] : Dt);
582
+ Dt.has(e) && a !== "single" ? t.delete(e) : t.add(e), Yt(Array.from(t));
345
583
  }, [
346
- le,
347
- ce,
348
- z
349
- ]), at = M((e) => {
350
- W((t) => [...t, ...e.map((e, t) => {
351
- let n = Me(e);
352
- return n && He.current.add(n), {
353
- id: `staged-${Date.now()}-${t}`,
584
+ Yt,
585
+ Dt,
586
+ a
587
+ ]), Qt = I(() => Yt([]), [Yt]), [$t, en] = We(ae, oe, se), tn = $t || Q.length > 0, nn = I((e) => {
588
+ en(e), !e && Q.length > 0 && Yt([]);
589
+ }, [
590
+ Yt,
591
+ Q.length,
592
+ en
593
+ ]), rn = I(() => {
594
+ pe(""), he("all"), H("all");
595
+ }, [
596
+ H,
597
+ pe,
598
+ he
599
+ ]), $ = I((e) => {
600
+ let t = e(_t.current);
601
+ _t.current = t, gt(t);
602
+ }, []), an = I((e) => {
603
+ e && (Xe(e), Ot.current.delete(e));
604
+ }, []), on = I((e) => {
605
+ if (e.length === 0) return;
606
+ Ge(null);
607
+ let t = fe(e, {
608
+ accept: f.split(",").some((e) => e.trim() === "*/*") ? void 0 : f,
609
+ maxSizeBytes: p,
610
+ maxFiles: m === void 0 ? void 0 : Math.max(0, m - _t.current.length)
611
+ }), n = t.accepted, r = t.rejections.flatMap((e) => {
612
+ let t = Ue[e.code];
613
+ return t ? [{
614
+ name: e.file.name,
615
+ reason: t
616
+ }] : [];
617
+ });
618
+ if (yt(r), n.length === 0) return;
619
+ let i = n.map((e) => {
620
+ let t = Ye(e);
621
+ return t && Ot.current.add(t), {
622
+ id: `staged-${bt.current++}`,
354
623
  file: e,
355
624
  name: e.name,
356
625
  size: e.size,
357
- type: je(e),
358
- src: n,
626
+ type: K(e),
627
+ src: t,
359
628
  progress: 0,
360
629
  status: "staged"
361
630
  };
362
- })]);
363
- }, []), ot = M((e) => {
364
- W((t) => {
365
- let n = t.find((t) => t.id === e);
366
- return n?.src && (Ne(n.src), He.current.delete(n.src)), t.filter((t) => t.id !== e);
367
631
  });
368
- }, []), st = M(() => {
369
- W((e) => {
370
- for (let t of e) t.src && (Ne(t.src), He.current.delete(t.src));
632
+ $((e) => [...e, ...i]);
633
+ }, [
634
+ p,
635
+ m,
636
+ $,
637
+ f
638
+ ]), sn = I((e) => {
639
+ $((t) => (an(t.find((t) => t.id === e)?.src), t.filter((t) => t.id !== e)));
640
+ }, [an, $]), cn = I(() => {
641
+ Ge(null), yt([]), $((e) => {
642
+ for (let t of e) an(t.src);
371
643
  return [];
372
644
  });
373
- }, []), ct = M((e) => {
374
- K((t) => ({
645
+ }, [an, $]), ln = I((e) => {
646
+ Tt((t) => ({
375
647
  ...t,
376
648
  ...e
377
649
  }));
378
- }, [K]), lt = M((e, t) => {
379
- W((n) => n.map((n) => n.id === e ? {
650
+ }, [Tt]), un = I((e, t) => {
651
+ $((n) => n.map((n) => n.id === e ? {
380
652
  ...n,
381
653
  ...t
382
654
  } : n));
383
- }, []);
384
- return {
385
- tab: ie,
386
- setTab: se,
387
- view: F,
388
- setView: I,
389
- query: L,
390
- setQuery: ce,
391
- type: R,
392
- setType: z,
393
- collection: B,
394
- setCollection: le,
395
- sort: ue,
396
- setSort: de,
397
- detailId: fe,
398
- setDetailId: pe,
399
- items: Z,
400
- visibleItems: Je,
401
- selectedIds: J,
402
- selectedItems: Xe,
403
- selectedSet: Y,
404
- toggleSelection: Qe,
405
- clearSelection: $e,
406
- selecting: nt,
407
- setSelecting: rt,
408
- clearFilters: it,
409
- loading: be,
410
- error: Se,
411
- retry: Ke,
412
- hasFilters: Ze,
413
- totalCount: Ye,
414
- filteredCount: Q,
415
- stagedFiles: Re,
416
- addFiles: at,
417
- removeStagedFile: ot,
418
- clearStagedFiles: st,
419
- updateUploadOptions: ct,
420
- uploadOptions: G,
421
- uploading: ze,
422
- startUpload: M(async () => {
423
- if (ze || Re.length === 0) return;
424
- let e = new AbortController();
425
- X.current?.abort(), X.current = e, V(null), Be(!0), W((e) => e.map((e) => ({
426
- ...e,
427
- status: "uploading",
428
- progress: 0
429
- })));
430
- let t = {
431
- signal: e.signal,
432
- setProgress: (t, n) => {
433
- e.signal.aborted || lt(t, { progress: Math.max(0, Math.min(100, n)) });
434
- },
435
- setFileStatus: (t, n, r) => {
436
- e.signal.aborted || lt(t, {
437
- status: n,
438
- error: r
439
- });
440
- }
441
- };
442
- try {
443
- let n = Re.map((e) => e.file), i = await l?.(n, G, t);
444
- if (e.signal.aborted) return;
445
- if (W((e) => e.map((e) => ({
446
- ...e,
447
- status: "done",
448
- progress: 100
449
- }))), i?.length) {
450
- H((e) => [...i, ...e]);
451
- let e = i.map((e) => j.getId(e));
452
- $(r === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...J])));
453
- }
454
- st(), se("library");
455
- } catch (t) {
456
- if (e.signal.aborted) return;
457
- V(t), W((e) => e.map((e) => e.status === "uploading" ? {
458
- ...e,
459
- status: "error",
460
- error: "Upload failed"
461
- } : e)), u?.(t);
462
- } finally {
463
- X.current === e && (X.current = null, Be(!1));
655
+ }, [$]), dn = I(async () => {
656
+ let e = _t.current;
657
+ if (kt.current || e.length === 0) return;
658
+ let t = e.map((e) => e.id), n = new Set(t), r = new AbortController();
659
+ kt.current = r, Ge(null), St(!0), $((e) => e.map((e) => n.has(e.id) ? {
660
+ ...e,
661
+ status: "uploading",
662
+ progress: 0,
663
+ error: void 0
664
+ } : e));
665
+ let i = (e) => !r.signal.aborted && kt.current === r && n.has(e), o = {
666
+ signal: r.signal,
667
+ fileIds: t,
668
+ setProgress: (e, t) => {
669
+ i(e) && un(e, { progress: Math.max(0, Math.min(100, t)) });
670
+ },
671
+ setFileStatus: (e, t, n) => {
672
+ i(e) && un(e, {
673
+ status: t,
674
+ error: n
675
+ });
464
676
  }
465
- }, [
466
- j,
467
- $,
468
- st,
469
- u,
470
- l,
471
- J,
472
- r,
473
- se,
474
- lt,
475
- Re,
476
- G,
477
- ze
478
- ]),
479
- cancelUpload: M(() => {
480
- X.current?.abort(), X.current = null, Be(!1), W((e) => e.map((e) => e.status === "uploading" ? {
481
- ...e,
482
- status: "staged",
483
- progress: 0,
484
- error: void 0
485
- } : e));
486
- }, []),
487
- updateItem: M(async (e, t) => {
488
- let n = j.getId(e), r = `update:${n}`, i = (Ue.current.get(r) ?? 0) + 1;
489
- Ue.current.set(r, i);
490
- let a = ke[n];
491
- V(null), Ae((e) => ({
492
- ...e,
493
- [n]: {
494
- ...e[n],
495
- ...t
496
- }
497
- }));
498
- try {
499
- return await s?.(e, t), !0;
500
- } catch (e) {
501
- return Ue.current.get(r) === i && Ae((e) => {
502
- let t = { ...e };
503
- return a ? t[n] = a : delete t[n], t;
504
- }), V(e), u?.(e), !1;
677
+ };
678
+ try {
679
+ let t = e.map((e) => e.file), i = await d?.(t, wt, o);
680
+ if (r.signal.aborted) return;
681
+ if ($((e) => e.filter((e) => !n.has(e.id) || e.status === "error" || (an(e.src), !1))), i?.length) {
682
+ let e = i.map((e) => X.getId(e));
683
+ if (N) {
684
+ let t = new Set(e);
685
+ at((e) => [...i, ...e.filter((e) => !t.has(X.getId(e)))]);
686
+ } else Je((e) => [...i, ...e]);
687
+ let t = Xt.current;
688
+ t.applySelection(a === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...t.selectedIds])), i);
505
689
  }
506
- }, [
507
- j,
508
- ke,
509
- u,
510
- s
511
- ]),
512
- removeItem: M(async (e) => {
513
- let t = j.getId(e), n = `delete:${t}`, r = (Ue.current.get(n) ?? 0) + 1;
514
- Ue.current.set(n, r);
515
- let i = Ee.has(t);
516
- V(null), Oe((e) => new Set(e).add(t));
517
- try {
518
- return await c?.(e), Y.has(t) && $(J.filter((e) => e !== t)), !0;
519
- } catch (e) {
520
- return !i && Ue.current.get(n) === r && Oe((e) => {
521
- let n = new Set(e);
522
- return n.delete(t), n;
523
- }), V(e), u?.(e), !1;
690
+ N && d && Nt(), _t.current.length === 0 && le("library");
691
+ } catch (e) {
692
+ if (r.signal.aborted) return;
693
+ Ge(() => e ?? /* @__PURE__ */ Error("Media upload failed")), $((e) => e.map((e) => n.has(e.id) && e.status === "uploading" ? {
694
+ ...e,
695
+ status: "error",
696
+ error: h
697
+ } : e)), g?.(e);
698
+ } finally {
699
+ kt.current === r && (kt.current = null, St(!1));
700
+ }
701
+ }, [
702
+ X,
703
+ N,
704
+ g,
705
+ d,
706
+ an,
707
+ Nt,
708
+ a,
709
+ le,
710
+ un,
711
+ $,
712
+ h,
713
+ wt
714
+ ]), fn = I(() => {
715
+ kt.current?.abort(), kt.current = null, St(!1), $((e) => e.map((e) => e.status === "uploading" ? {
716
+ ...e,
717
+ status: "staged",
718
+ progress: 0,
719
+ error: void 0
720
+ } : e));
721
+ }, [$]), pn = I(async (e, t) => {
722
+ if (!l) return !1;
723
+ let n = X.getId(e), r = `update:${n}`, i = (At.current.get(r) ?? 0) + 1;
724
+ At.current.set(r, i);
725
+ let a = Y[n], o = ut.current.get(n), s = Bt.current.sourceItems.find((e) => P.getId(e) === n) ?? e, c = Qe.filter((e) => e in t && !(o && e in o));
726
+ ut.current.set(n, {
727
+ ...$e(s, P, c),
728
+ ...o
729
+ }), Z.current.set(n, (Z.current.get(n) ?? 0) + 1), U((e) => e?.itemId === n ? null : e), lt((e) => ({
730
+ ...e,
731
+ [n]: {
732
+ ...e[n],
733
+ ...t
524
734
  }
525
- }, [
526
- j,
527
- $,
528
- u,
529
- c,
530
- Ee,
531
- J,
532
- Y
533
- ]),
534
- accessors: j
735
+ }));
736
+ try {
737
+ return await l(e, t), !0;
738
+ } catch (e) {
739
+ return At.current.get(r) === i && (U({
740
+ itemId: n,
741
+ operation: "update",
742
+ cause: e
743
+ }), a && o ? ut.current.set(n, o) : ut.current.delete(n), lt((e) => {
744
+ let t = { ...e };
745
+ return a ? t[n] = a : delete t[n], t;
746
+ })), g?.(e), !1;
747
+ } finally {
748
+ let e = (Z.current.get(n) ?? 1) - 1;
749
+ e > 0 ? Z.current.set(n, e) : Z.current.delete(n), mt((e) => e + 1);
750
+ }
751
+ }, [
752
+ X,
753
+ P,
754
+ Y,
755
+ g,
756
+ l
757
+ ]), mn = I(async (e) => {
758
+ if (!u) return !1;
759
+ let t = X.getId(e), n = `delete:${t}`, r = (At.current.get(n) ?? 0) + 1;
760
+ At.current.set(n, r);
761
+ let i = J.has(t);
762
+ dt.current.set(t, (dt.current.get(t) ?? 0) + 1), U((e) => e?.itemId === t ? null : e), ct((e) => new Set(e).add(t));
763
+ try {
764
+ await u(e), ft.current.set(t, Bt.current.suppliedItems);
765
+ let n = (e) => X.getId(e) !== t;
766
+ return Je((e) => e.every(n) ? e : e.filter(n)), at((e) => e.every(n) ? e : e.filter(n)), Dt.has(t) && Yt(Q.filter((e) => e !== t)), !0;
767
+ } catch (e) {
768
+ return At.current.get(n) === r && (U({
769
+ itemId: t,
770
+ operation: "delete",
771
+ cause: e
772
+ }), i || ct((e) => {
773
+ let n = new Set(e);
774
+ return n.delete(t), n;
775
+ })), g?.(e), !1;
776
+ } finally {
777
+ let e = (dt.current.get(t) ?? 1) - 1;
778
+ e > 0 ? dt.current.set(t, e) : dt.current.delete(t), mt((e) => e + 1);
779
+ }
780
+ }, [
781
+ X,
782
+ Yt,
783
+ g,
784
+ u,
785
+ J,
786
+ Q,
787
+ Dt
788
+ ]);
789
+ return {
790
+ tab: ce,
791
+ setTab: le,
792
+ view: ue,
793
+ setView: de,
794
+ query: F,
795
+ setQuery: pe,
796
+ type: me,
797
+ setType: he,
798
+ collection: V,
799
+ setCollection: H,
800
+ sort: ge,
801
+ setSort: _e,
802
+ detailId: ve,
803
+ setDetailId: ye,
804
+ items: Vt,
805
+ visibleItems: Ht,
806
+ selectedIds: Q,
807
+ selectedItems: qt,
808
+ selectedSet: Dt,
809
+ toggleSelection: Zt,
810
+ clearSelection: Qt,
811
+ selecting: tn,
812
+ setSelecting: nn,
813
+ clearFilters: rn,
814
+ loading: we,
815
+ hasLoadedResults: N && (Se !== null || Lt.length > 0),
816
+ loadError: Ee,
817
+ mutationError: Fe,
818
+ uploadError: W,
819
+ retry: Nt,
820
+ hasMore: N && Oe.hasMore,
821
+ loadMore: Ft,
822
+ loadingMore: Ae,
823
+ loadMoreError: Me,
824
+ hasFilters: Jt,
825
+ totalCount: Ut,
826
+ filteredCount: Wt,
827
+ stagedFiles: ht,
828
+ uploadRejections: vt,
829
+ addFiles: on,
830
+ removeStagedFile: sn,
831
+ clearStagedFiles: cn,
832
+ updateUploadOptions: ln,
833
+ uploadOptions: wt,
834
+ uploading: xt,
835
+ startUpload: dn,
836
+ cancelUpload: fn,
837
+ updateItem: pn,
838
+ removeItem: mn,
839
+ accessors: X
535
840
  };
536
841
  }
537
842
  //#endregion
538
843
  //#region src/components/features/media-library/partials/media-library-partials.tsx
539
- var W = `${_.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${s.inset}`, ze = "media-library-card--check absolute left-2 top-2 inline-flex size-icon-lg items-center justify-center rounded-radius border border-border bg-background p-0 text-transparent shadow-xs", Be = "border-primary bg-primary text-primary-foreground opacity-100";
540
- function Ve(e, t) {
541
- return F(e === "image" ? le : e === "video" ? xe : z, { className: t ?? "size-icon" });
844
+ var ot = `${C.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${o.inset}`, st = "media-library-card--check absolute left-2 top-2 inline-flex size-icon-lg items-center justify-center rounded-radius border border-border bg-background p-0 text-transparent shadow-xs", J = "border-primary bg-primary text-primary-foreground opacity-100";
845
+ function ct(e, t) {
846
+ return V(e === "image" ? xe : e === "video" ? Ne : ye, { className: t ?? "size-icon" });
542
847
  }
543
- function G(e, t) {
848
+ function Y(e, t) {
544
849
  return e === "image" ? t.typeImage : e === "video" ? t.typeVideo : t.typeFile;
545
850
  }
546
- function K(e, t) {
547
- return e ? H(t.usedIn, { count: e }) : t.notUsed;
851
+ function lt(e, t) {
852
+ return e ? W(t.usedIn, { count: e }) : t.notUsed;
548
853
  }
549
- function q({ children: e, tint: t, className: n }) {
550
- return /* @__PURE__ */ F("div", {
854
+ var X = /^\d{4}-\d{2}-\d{2}$/;
855
+ function ut({ value: e }) {
856
+ if (typeof e == "string" && e.trim() !== "") {
857
+ if (X.test(e.trim())) return /* @__PURE__ */ V(O, { value: e.trim() });
858
+ if (D(e) === null) return /* @__PURE__ */ V(he, { children: e });
859
+ }
860
+ return /* @__PURE__ */ V(E, { value: e });
861
+ }
862
+ function Z({ children: e, tint: t, className: n, role: i }) {
863
+ return /* @__PURE__ */ V("div", {
864
+ role: i,
551
865
  className: r("media-library-preview relative overflow-hidden bg-muted", n),
552
866
  style: t ? { background: t } : void 0,
553
867
  children: e
554
868
  });
555
869
  }
556
- function J({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
557
- let [a, o] = P(!1);
558
- return ae(() => {
870
+ function dt({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
871
+ let [a, o] = B(!1);
872
+ return L(() => {
559
873
  o(!1);
560
- }, [e]), !e || a ? /* @__PURE__ */ F("div", {
874
+ }, [e]), !e || a ? /* @__PURE__ */ V("div", {
561
875
  className: "media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground",
562
- children: Ve(n, "size-6")
563
- }) : /* @__PURE__ */ F("img", {
876
+ children: ct(n, "size-6")
877
+ }) : /* @__PURE__ */ V("img", {
564
878
  src: e,
565
879
  alt: t,
566
880
  loading: i,
@@ -568,23 +882,23 @@ function J({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
568
882
  onError: () => o(!0)
569
883
  });
570
884
  }
571
- function Y({ icon: e, title: t, description: n, action: i, className: a }) {
572
- return /* @__PURE__ */ F(re, {
885
+ function ft({ icon: e, title: t, description: n, action: i, className: a }) {
886
+ return /* @__PURE__ */ V(F, {
573
887
  title: t,
574
888
  description: n ?? !1,
575
889
  actions: i,
576
- media: e ?? /* @__PURE__ */ F(le, {
890
+ media: e ?? /* @__PURE__ */ V(xe, {
577
891
  className: "size-icon",
578
892
  "aria-hidden": "true"
579
893
  }),
580
894
  mediaVariant: "icon-soft",
581
895
  padding: "md",
582
- border: !0,
583
- className: r("media-library-empty-state--component min-h-64 bg-muted/30", a)
896
+ surface: "wash",
897
+ className: r("media-library-empty-state--component min-h-64", a)
584
898
  });
585
899
  }
586
- function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: v, onViewChange: y, onClearFilters: b, toolbarEnd: x, selecting: S = !1, onSelectingChange: ee, summary: T, disabled: E = !1 }) {
587
- let { defaultScale: te } = t(), ne = e(void 0, te), A = [
900
+ function pt({ query: n, type: a, typeFilters: o, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: _, onViewChange: v, onClearFilters: y, toolbarEnd: b, selecting: x = !1, onSelectingChange: S, summary: ee, disabled: w = !1 }) {
901
+ let { defaultScale: te } = t(), T = e(void 0, te), ne = [
588
902
  {
589
903
  value: "all",
590
904
  label: p.allTypes,
@@ -593,29 +907,29 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
593
907
  {
594
908
  value: "image",
595
909
  label: p.images,
596
- icon: le
910
+ icon: xe
597
911
  },
598
912
  {
599
913
  value: "video",
600
914
  label: p.videos,
601
- icon: xe
915
+ icon: Ne
602
916
  },
603
917
  {
604
918
  value: "file",
605
919
  label: p.files,
606
- icon: z
920
+ icon: ye
607
921
  }
608
- ].filter((e) => (s ?? [
922
+ ].filter((e) => (o ?? [
609
923
  "all",
610
924
  "image",
611
925
  "video"
612
- ]).includes(e.value)), re = [{
926
+ ]).includes(e.value)), E = [{
613
927
  value: "all",
614
928
  label: p.allCollections
615
929
  }, ...f.map((e) => ({
616
930
  value: e.value,
617
931
  label: String(e.label)
618
- }))], j = [
932
+ }))], D = [
619
933
  {
620
934
  value: "newest",
621
935
  label: p.sortNewest
@@ -632,73 +946,72 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
632
946
  value: "usage",
633
947
  label: p.sortUsage
634
948
  }
635
- ], M = n.trim(), ie = M.length > 0, ae = ie || o !== "all" || c !== "all";
636
- return /* @__PURE__ */ I(l, {
949
+ ], O = n.trim(), re = O.length > 0, A = re || a !== "all" || c !== "all";
950
+ return /* @__PURE__ */ H(l, {
637
951
  direction: "horizontal",
638
952
  wrap: !0,
639
953
  align: "start",
640
954
  gap: "md",
641
955
  className: "media-library-toolbar--component",
642
- children: [/* @__PURE__ */ I(l, {
956
+ children: [/* @__PURE__ */ H(l, {
643
957
  direction: "horizontal",
644
958
  wrap: !0,
645
959
  align: "start",
646
960
  gap: "md",
647
961
  className: "media-library-toolbar--filters min-w-0 grow basis-80",
648
962
  children: [
649
- /* @__PURE__ */ I(l, {
963
+ /* @__PURE__ */ H(l, {
650
964
  gap: "xs",
651
965
  className: "media-library-toolbar--search min-w-52 flex-1",
652
- children: [/* @__PURE__ */ F(w, {
966
+ children: [/* @__PURE__ */ V(ie, {
653
967
  value: n,
654
968
  onChange: (e) => m(e.target.value),
655
969
  placeholder: p.searchPlaceholder,
656
- startIcon: _e,
970
+ startIcon: ke,
657
971
  clearable: !0,
658
972
  onClear: () => m(""),
659
973
  strings: { clear: p.clearSearch },
660
- disabled: E,
974
+ disabled: w,
661
975
  className: "bg-background"
662
- }), !!ie && /* @__PURE__ */ F(l, {
976
+ }), !!re && /* @__PURE__ */ V(l, {
663
977
  direction: "horizontal",
664
978
  gap: "xs",
665
979
  wrap: !1,
666
980
  className: "media-library-toolbar--search-value px-space-xs",
667
- children: /* @__PURE__ */ I(C, {
981
+ children: /* @__PURE__ */ H(k, {
668
982
  tone: "secondary",
669
983
  className: "max-w-full",
670
- children: [/* @__PURE__ */ F(a, {
984
+ children: [/* @__PURE__ */ V(i, {
671
985
  tag: "span",
672
986
  size: "inherit",
673
987
  className: "text-current",
674
988
  children: p.activeSearchLabel
675
- }), /* @__PURE__ */ F(a, {
989
+ }), /* @__PURE__ */ V(i, {
676
990
  tag: "span",
677
991
  size: "inherit",
678
992
  weight: "normal",
679
993
  className: "min-w-0 truncate text-current",
680
- children: M
994
+ children: O
681
995
  })]
682
996
  })
683
997
  })]
684
998
  }),
685
- /* @__PURE__ */ F("div", {
686
- className: r("media-library-toolbar--type-toggle shrink-0", O.frame, k[ne]),
687
- role: "tablist",
999
+ /* @__PURE__ */ V("div", {
1000
+ className: r("media-library-toolbar--type-toggle shrink-0", ae.frame, oe[T]),
1001
+ role: "group",
688
1002
  "aria-label": p.typeFilterLabel,
689
- children: A.map((e) => {
690
- let t = e.icon, n = o === e.value;
691
- return /* @__PURE__ */ I(i, {
1003
+ children: ne.map((e) => {
1004
+ let t = e.icon, n = a === e.value;
1005
+ return /* @__PURE__ */ H(s, {
692
1006
  type: "button",
693
- role: "tab",
694
- "aria-selected": n,
1007
+ "aria-pressed": n,
695
1008
  tone: "secondary",
696
1009
  buttonStyle: "ghost",
697
1010
  size: "sm",
698
- disabled: E,
699
- className: r(O.item, "shadow-none", n ? `${_.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1011
+ disabled: w,
1012
+ className: r(ae.item, "shadow-none", n ? `${C.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
700
1013
  onClick: () => h(e.value),
701
- children: [t && /* @__PURE__ */ F(t, { className: "size-icon-md" }), /* @__PURE__ */ F(a, {
1014
+ children: [t && /* @__PURE__ */ V(t, { className: "size-icon-md" }), /* @__PURE__ */ V(i, {
702
1015
  tag: "span",
703
1016
  size: "xs",
704
1017
  weight: "medium",
@@ -708,188 +1021,192 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
708
1021
  }, e.value);
709
1022
  })
710
1023
  }),
711
- /* @__PURE__ */ I(l, {
1024
+ /* @__PURE__ */ H(l, {
712
1025
  direction: "horizontal",
713
1026
  gap: "md",
714
1027
  wrap: !0,
715
1028
  className: "media-library-toolbar--selects min-w-0",
716
- children: [/* @__PURE__ */ F("div", {
1029
+ children: [/* @__PURE__ */ V("div", {
717
1030
  className: "min-w-40 grow",
718
- children: /* @__PURE__ */ F(D, {
1031
+ children: /* @__PURE__ */ V(M, {
719
1032
  value: c,
720
- options: re,
1033
+ options: E,
721
1034
  onValueChange: (e) => g(e ?? "all"),
722
1035
  placeholder: p.collectionFilterLabel,
723
1036
  "aria-label": p.collectionFilterLabel,
724
- disabled: E,
1037
+ disabled: w,
725
1038
  className: "bg-background"
726
1039
  })
727
- }), /* @__PURE__ */ F("div", {
1040
+ }), /* @__PURE__ */ V("div", {
728
1041
  className: "min-w-32 grow",
729
- children: /* @__PURE__ */ F(D, {
1042
+ children: /* @__PURE__ */ V(M, {
730
1043
  value: u,
731
- options: j,
732
- onValueChange: (e) => v(e ?? "newest"),
1044
+ options: D,
1045
+ onValueChange: (e) => _(e ?? "newest"),
733
1046
  placeholder: p.sortLabel,
734
1047
  "aria-label": p.sortLabel,
735
- disabled: E,
1048
+ disabled: w,
736
1049
  className: "bg-background"
737
1050
  })
738
1051
  })]
739
1052
  }),
740
- !!ae && /* @__PURE__ */ F(i, {
1053
+ !!A && /* @__PURE__ */ V(s, {
741
1054
  type: "button",
742
1055
  tone: "secondary",
743
1056
  buttonStyle: "ghost",
744
- disabled: E,
745
- onClick: b,
1057
+ disabled: w,
1058
+ onClick: y,
746
1059
  children: p.clearFilters
747
1060
  })
748
1061
  ]
749
- }), /* @__PURE__ */ I(l, {
1062
+ }), /* @__PURE__ */ H(l, {
750
1063
  direction: "horizontal",
751
1064
  align: "center",
752
1065
  gap: "md",
753
1066
  wrap: !1,
754
1067
  className: "media-library-toolbar--view ms-auto min-w-0 max-w-full",
755
1068
  children: [
756
- T,
757
- /* @__PURE__ */ I("div", {
758
- className: r("media-library-toolbar--view-toggle shrink-0", O.frame, k[ne]),
759
- children: [/* @__PURE__ */ F(i, {
1069
+ ee,
1070
+ /* @__PURE__ */ H("div", {
1071
+ className: r("media-library-toolbar--view-toggle shrink-0", ae.frame, oe[T]),
1072
+ role: "group",
1073
+ "aria-label": p.viewLabel,
1074
+ children: [/* @__PURE__ */ V(s, {
760
1075
  type: "button",
761
1076
  tone: d === "grid" ? "neutral" : "secondary",
762
1077
  buttonStyle: d === "grid" ? "solid" : "ghost",
763
1078
  size: "sm",
764
1079
  iconOnly: !0,
765
- disabled: E,
766
- className: r(O.item, d === "grid" && `${_.segmentActive} hover:bg-card`),
1080
+ disabled: w,
1081
+ className: r(ae.item, d === "grid" && `${C.segmentActive} hover:bg-card`),
767
1082
  "aria-label": p.gridView,
768
- onClick: () => y("grid"),
769
- children: /* @__PURE__ */ F(B, { className: "size-icon-md" })
770
- }), /* @__PURE__ */ F(i, {
1083
+ "aria-pressed": d === "grid",
1084
+ onClick: () => v("grid"),
1085
+ children: /* @__PURE__ */ V(be, { className: "size-icon-md" })
1086
+ }), /* @__PURE__ */ V(s, {
771
1087
  type: "button",
772
1088
  tone: d === "table" ? "neutral" : "secondary",
773
1089
  buttonStyle: d === "table" ? "solid" : "ghost",
774
1090
  size: "sm",
775
1091
  iconOnly: !0,
776
- disabled: E,
777
- className: r(O.item, d === "table" && `${_.segmentActive} hover:bg-card`),
1092
+ disabled: w,
1093
+ className: r(ae.item, d === "table" && `${C.segmentActive} hover:bg-card`),
778
1094
  "aria-label": p.tableView,
779
- onClick: () => y("table"),
780
- children: /* @__PURE__ */ F(pe, { className: "size-icon-md" })
1095
+ "aria-pressed": d === "table",
1096
+ onClick: () => v("table"),
1097
+ children: /* @__PURE__ */ V(Te, { className: "size-icon-md" })
781
1098
  })]
782
1099
  }),
783
- !!ee && /* @__PURE__ */ F(i, {
1100
+ !!S && /* @__PURE__ */ V(s, {
784
1101
  type: "button",
785
- "aria-pressed": S,
1102
+ "aria-pressed": x,
786
1103
  tone: "secondary",
787
1104
  buttonStyle: "outline",
788
- disabled: E,
789
- className: r("media-library-toolbar--select shrink-0", S && _.togglePressed),
790
- onClick: () => ee(!S),
1105
+ disabled: w,
1106
+ className: r("media-library-toolbar--select shrink-0", x && C.togglePressed),
1107
+ onClick: () => S(!x),
791
1108
  children: p.selectMode
792
1109
  }),
793
- x
1110
+ b
794
1111
  ]
795
1112
  })]
796
1113
  });
797
1114
  }
798
- function X({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: h = !1, className: g }) {
799
- let v = u.getType(e), b = u.getName(e), x = u.getSrc(e), S = u.getAlt(e) || b, ee = u.getSize(e), w = u.getUsageCount(e), T = u.getPublic(e) === !1, E = u.getDuration(e), D = !!m && !h, O = D ? m : f;
800
- return /* @__PURE__ */ I("div", {
1115
+ function mt({ item: e, selected: t = !1, density: n = "comfortable", showMeta: a = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: h = !1, className: g }) {
1116
+ let _ = u.getType(e), v = u.getName(e), y = u.getSrc(e), b = u.getAlt(e) || v, x = u.getSize(e), S = u.getUsageCount(e), ee = u.getPublic(e) === !1, te = u.getDuration(e), T = !!m && !h, ne = T ? m : f;
1117
+ return /* @__PURE__ */ H("div", {
801
1118
  "data-selected": t || void 0,
802
1119
  "data-selecting": h || void 0,
803
1120
  "data-gallery-density": n,
804
- className: r("media-library-card--component relative group/card overflow-hidden rounded-radius border border-border bg-card text-card-foreground text-left shadow-xs transition-all", `${_.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", g),
805
- onClick: O,
1121
+ className: r("media-library-card--component relative group/card overflow-hidden rounded-radius border border-border bg-card text-card-foreground text-left shadow-xs transition-all", `${C.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", g),
1122
+ onClick: ne,
806
1123
  children: [
807
- !!O && /* @__PURE__ */ F("button", {
1124
+ !!ne && /* @__PURE__ */ V("button", {
808
1125
  type: "button",
809
- "aria-label": b,
810
- "aria-pressed": D ? void 0 : t,
811
- className: r("media-library-card--select rounded-radius", W),
1126
+ "aria-label": v,
1127
+ "aria-pressed": T ? void 0 : t,
1128
+ className: r("media-library-card--select rounded-radius", ot),
812
1129
  onClick: (e) => {
813
- e.stopPropagation(), O();
1130
+ e.stopPropagation(), ne();
814
1131
  }
815
1132
  }),
816
- /* @__PURE__ */ I(q, {
1133
+ /* @__PURE__ */ H(Z, {
817
1134
  tint: u.getTint(e),
818
1135
  className: r(n === "compact" ? "aspect-square" : "aspect-[4/3]"),
819
1136
  children: [
820
- /* @__PURE__ */ F(J, {
821
- src: x,
822
- alt: S,
823
- type: v,
1137
+ /* @__PURE__ */ V(dt, {
1138
+ src: y,
1139
+ alt: b,
1140
+ type: _,
824
1141
  className: "size-full object-cover"
825
1142
  }),
826
- D && f ? /* @__PURE__ */ F("button", {
1143
+ T && f ? /* @__PURE__ */ V("button", {
827
1144
  type: "button",
828
- "aria-label": H(d.selectItem, { name: b }),
1145
+ "aria-label": W(d.selectItem, { name: v }),
829
1146
  "aria-pressed": t,
830
- className: r(ze, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${s.frame}`, t && Be),
1147
+ className: r(st, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${o.frame}`, t && J),
831
1148
  onClick: (e) => {
832
1149
  e.stopPropagation(), f();
833
1150
  },
834
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
835
- }) : /* @__PURE__ */ F("span", {
836
- className: r(ze, "transition-opacity", h ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && Be),
1151
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
1152
+ }) : /* @__PURE__ */ V("span", {
1153
+ className: r(st, "transition-opacity", h ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && J),
837
1154
  "aria-hidden": "true",
838
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
1155
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
839
1156
  }),
840
- !!p && /* @__PURE__ */ F(i, {
1157
+ !!p && /* @__PURE__ */ V(s, {
841
1158
  type: "button",
842
1159
  tone: "secondary",
843
1160
  buttonStyle: "solid",
844
1161
  size: "sm",
845
1162
  iconOnly: !0,
846
1163
  className: "media-library-card--details absolute z-10 right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100",
847
- "aria-label": H(d.cardDetails, { name: b }),
1164
+ "aria-label": W(d.cardDetails, { name: v }),
848
1165
  onClick: (e) => {
849
1166
  e.stopPropagation(), p();
850
1167
  },
851
- children: /* @__PURE__ */ F(de, { className: "size-icon-md" })
1168
+ children: /* @__PURE__ */ V(Ce, { className: "size-icon-md" })
852
1169
  }),
853
- v === "video" && !!E && /* @__PURE__ */ I(C, {
1170
+ _ === "video" && !!te && /* @__PURE__ */ H(k, {
854
1171
  tone: "secondary",
855
1172
  className: "media-library-card--duration absolute bottom-2 left-2 bg-inverse-background text-inverse-foreground",
856
- children: [/* @__PURE__ */ F(he, { className: "size-icon-sm fill-current" }), E]
1173
+ children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), te]
857
1174
  }),
858
- T && /* @__PURE__ */ F(C, {
1175
+ ee && /* @__PURE__ */ V(k, {
859
1176
  tone: "secondary",
860
1177
  className: "media-library-card--private absolute bottom-2 right-2 bg-card text-card-foreground",
861
- children: /* @__PURE__ */ F(me, { className: "size-icon-sm" })
1178
+ children: /* @__PURE__ */ V(Ee, { className: "size-icon-sm" })
862
1179
  })
863
1180
  ]
864
1181
  }),
865
- /* @__PURE__ */ F("div", {
1182
+ /* @__PURE__ */ V("div", {
866
1183
  className: r("media-library-card--body", n === "compact" ? "p-surface-xs" : "p-surface"),
867
- children: /* @__PURE__ */ I(c, {
1184
+ children: /* @__PURE__ */ H(c, {
868
1185
  columns: 1,
869
1186
  gap: "xs",
870
- children: [/* @__PURE__ */ F(a, {
1187
+ children: [/* @__PURE__ */ V(i, {
871
1188
  tag: "div",
872
1189
  type: "inherit",
873
1190
  weight: "semibold",
874
1191
  className: "truncate",
875
- children: b
876
- }), o && /* @__PURE__ */ I(l, {
1192
+ children: v
1193
+ }), a && /* @__PURE__ */ H(l, {
877
1194
  direction: "horizontal",
878
1195
  align: "center",
879
1196
  justify: "between",
880
1197
  gap: "md",
881
1198
  className: "min-w-0",
882
- children: [/* @__PURE__ */ F(y, {
883
- value: ee,
1199
+ children: [/* @__PURE__ */ V(w, {
1200
+ value: x,
884
1201
  size: "xs",
885
1202
  className: "truncate",
886
1203
  emptyLabel: d.unknownSize
887
- }), !!w && /* @__PURE__ */ I(a, {
1204
+ }), !!S && /* @__PURE__ */ H(i, {
888
1205
  tag: "span",
889
1206
  size: "xs",
890
1207
  type: "secondary",
891
1208
  className: "inline-flex items-center gap-space-xs",
892
- children: [/* @__PURE__ */ F(fe, { className: "size-icon-sm" }), w]
1209
+ children: [/* @__PURE__ */ V(we, { className: "size-icon-sm" }), S]
893
1210
  })]
894
1211
  })]
895
1212
  })
@@ -897,165 +1214,268 @@ function X({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o
897
1214
  ]
898
1215
  });
899
1216
  }
900
- function Ue({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
1217
+ function ht({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
901
1218
  let p = !!d && !f;
902
- return /* @__PURE__ */ I("div", {
903
- className: "media-library-list--component min-w-180",
904
- children: [/* @__PURE__ */ I("div", {
905
- className: "sticky top-0 z-10 grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border bg-background px-row-x py-row-y",
906
- children: [
907
- /* @__PURE__ */ F("span", {}),
908
- /* @__PURE__ */ F("span", {}),
909
- /* @__PURE__ */ F(o, { children: c.table.name }),
910
- /* @__PURE__ */ F(o, { children: c.table.type }),
911
- /* @__PURE__ */ F(o, { children: c.table.size }),
912
- /* @__PURE__ */ F(o, { children: c.table.collection }),
913
- /* @__PURE__ */ F(o, { children: c.table.used }),
914
- /* @__PURE__ */ F("span", {})
915
- ]
916
- }), e.map((e) => {
917
- let o = n.getId(e), f = t.has(o), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), v = n.getPublic(e) === !1;
918
- return /* @__PURE__ */ I("div", {
919
- "data-selected": f || void 0,
920
- className: r("media-library-list--row relative grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border/60 px-row-x py-row-y last:border-b-0", `cursor-pointer rounded-radius transition-colors ${_.rowHover}`, f && _.rowSelected),
921
- onClick: () => p && d ? d(o) : l(o),
1219
+ return /* @__PURE__ */ H("div", {
1220
+ role: "table",
1221
+ "aria-label": c.resultsLabel,
1222
+ className: "media-library-list--component -mx-row-x min-w-180",
1223
+ children: [/* @__PURE__ */ V("div", {
1224
+ role: "rowgroup",
1225
+ className: "contents",
1226
+ children: /* @__PURE__ */ H("div", {
1227
+ role: "row",
1228
+ className: "sticky top-0 z-10 grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border bg-background px-row-x py-row-y",
922
1229
  children: [
923
- /* @__PURE__ */ F("button", {
924
- type: "button",
925
- "aria-label": h,
926
- "aria-pressed": p ? void 0 : f,
927
- className: r("media-library-list--select rounded-radius", W),
928
- onClick: (e) => {
929
- e.stopPropagation(), p && d ? d(o) : l(o);
930
- }
931
- }),
932
- p ? /* @__PURE__ */ F("button", {
933
- type: "button",
934
- "aria-label": H(c.selectItem, { name: h }),
935
- "aria-pressed": f,
936
- className: r(`relative z-10 inline-flex size-icon-lg cursor-pointer items-center justify-center rounded-radius border border-input bg-background p-0 text-transparent ${s.frame}`, f && "border-primary bg-primary text-primary-foreground"),
937
- onClick: (e) => {
938
- e.stopPropagation(), l(o);
939
- },
940
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
941
- }) : /* @__PURE__ */ F("span", {
942
- className: r("inline-flex size-icon-lg items-center justify-center rounded-radius border border-border text-transparent", f && "border-primary bg-primary text-primary-foreground"),
943
- "aria-hidden": "true",
944
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
945
- }),
946
- /* @__PURE__ */ F(q, {
947
- tint: n.getTint(e),
948
- className: "size-9 rounded-radius",
949
- children: g ? /* @__PURE__ */ F("img", {
950
- src: g,
951
- alt: "",
952
- loading: "lazy",
953
- className: "size-full object-cover"
954
- }) : /* @__PURE__ */ F("div", {
955
- className: "flex size-full items-center justify-center text-muted-foreground",
956
- children: Ve(m, "size-icon")
1230
+ /* @__PURE__ */ V("span", {
1231
+ role: "columnheader",
1232
+ children: /* @__PURE__ */ V(i, {
1233
+ tag: "span",
1234
+ size: "inherit",
1235
+ className: "sr-only",
1236
+ children: c.selectMode
957
1237
  })
958
1238
  }),
959
- /* @__PURE__ */ I(a, {
960
- tag: "div",
961
- type: "inherit",
962
- weight: "semibold",
963
- className: "flex min-w-0 items-center gap-space-xs truncate",
964
- children: [h, v && /* @__PURE__ */ F(me, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
1239
+ /* @__PURE__ */ V("span", { role: "cell" }),
1240
+ /* @__PURE__ */ V(a, {
1241
+ role: "columnheader",
1242
+ children: c.table.name
965
1243
  }),
966
- /* @__PURE__ */ F(C, {
967
- tone: "secondary",
968
- children: G(m, c)
1244
+ /* @__PURE__ */ V(a, {
1245
+ role: "columnheader",
1246
+ children: c.table.type
969
1247
  }),
970
- /* @__PURE__ */ F(y, {
971
- value: n.getSize(e),
972
- size: "xs",
973
- emptyLabel: c.unknownSize
1248
+ /* @__PURE__ */ V(a, {
1249
+ role: "columnheader",
1250
+ children: c.table.size
974
1251
  }),
975
- /* @__PURE__ */ F(a, {
976
- size: "xs",
977
- type: "secondary",
978
- className: "truncate",
979
- children: n.getCollection(e) || "—"
1252
+ /* @__PURE__ */ V(a, {
1253
+ role: "columnheader",
1254
+ children: c.table.collection
980
1255
  }),
981
- /* @__PURE__ */ F(a, {
982
- size: "xs",
983
- type: "secondary",
984
- children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
1256
+ /* @__PURE__ */ V(a, {
1257
+ role: "columnheader",
1258
+ children: c.table.used
985
1259
  }),
986
- /* @__PURE__ */ F(i, {
987
- type: "button",
988
- tone: "secondary",
989
- buttonStyle: "ghost",
990
- size: "sm",
991
- iconOnly: !0,
992
- className: "relative z-10",
993
- "aria-label": H(c.cardDetails, { name: h }),
994
- onClick: (e) => {
995
- e.stopPropagation(), u(o);
996
- },
997
- children: /* @__PURE__ */ F(de, { className: "size-icon-md" })
1260
+ /* @__PURE__ */ V("span", {
1261
+ role: "columnheader",
1262
+ children: /* @__PURE__ */ V(i, {
1263
+ tag: "span",
1264
+ size: "inherit",
1265
+ className: "sr-only",
1266
+ children: c.detail.title
1267
+ })
998
1268
  })
999
1269
  ]
1000
- }, o);
1270
+ })
1271
+ }), /* @__PURE__ */ V("div", {
1272
+ role: "rowgroup",
1273
+ className: "contents",
1274
+ children: e.map((e) => {
1275
+ let a = n.getId(e), f = t.has(a), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), _ = n.getPublic(e) === !1;
1276
+ return /* @__PURE__ */ H("div", {
1277
+ role: "row",
1278
+ "data-selected": f || void 0,
1279
+ className: r("media-library-list--row relative grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border/60 px-row-x py-row-y last:border-b-0", `cursor-pointer rounded-radius transition-colors ${C.rowHover}`, f && C.rowSelected),
1280
+ onClick: () => p && d ? d(a) : l(a),
1281
+ children: [
1282
+ /* @__PURE__ */ H("div", {
1283
+ role: "cell",
1284
+ className: "contents",
1285
+ children: [/* @__PURE__ */ V("button", {
1286
+ type: "button",
1287
+ "aria-label": h,
1288
+ "aria-pressed": p ? void 0 : f,
1289
+ className: r("media-library-list--select rounded-radius", ot),
1290
+ onClick: (e) => {
1291
+ e.stopPropagation(), p && d ? d(a) : l(a);
1292
+ }
1293
+ }), p ? /* @__PURE__ */ V("button", {
1294
+ type: "button",
1295
+ "aria-label": W(c.selectItem, { name: h }),
1296
+ "aria-pressed": f,
1297
+ className: r(`relative z-10 inline-flex size-icon-lg cursor-pointer items-center justify-center rounded-radius border border-input bg-background p-0 text-transparent ${o.frame}`, f && "border-primary bg-primary text-primary-foreground"),
1298
+ onClick: (e) => {
1299
+ e.stopPropagation(), l(a);
1300
+ },
1301
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
1302
+ }) : /* @__PURE__ */ V("span", {
1303
+ className: r("inline-flex size-icon-lg items-center justify-center rounded-radius border border-border text-transparent", f && "border-primary bg-primary text-primary-foreground"),
1304
+ "aria-hidden": "true",
1305
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
1306
+ })]
1307
+ }),
1308
+ /* @__PURE__ */ V(Z, {
1309
+ role: "cell",
1310
+ tint: n.getTint(e),
1311
+ className: "size-9 rounded-radius",
1312
+ children: g ? /* @__PURE__ */ V("img", {
1313
+ src: g,
1314
+ alt: "",
1315
+ loading: "lazy",
1316
+ className: "size-full object-cover"
1317
+ }) : /* @__PURE__ */ V("div", {
1318
+ className: "flex size-full items-center justify-center text-muted-foreground",
1319
+ children: ct(m, "size-icon")
1320
+ })
1321
+ }),
1322
+ /* @__PURE__ */ H(i, {
1323
+ tag: "div",
1324
+ role: "rowheader",
1325
+ type: "inherit",
1326
+ weight: "semibold",
1327
+ className: "flex min-w-0 items-center gap-space-xs truncate",
1328
+ children: [h, _ && /* @__PURE__ */ V(Ee, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
1329
+ }),
1330
+ /* @__PURE__ */ V(k, {
1331
+ role: "cell",
1332
+ tone: "secondary",
1333
+ children: Y(m, c)
1334
+ }),
1335
+ /* @__PURE__ */ V(w, {
1336
+ role: "cell",
1337
+ value: n.getSize(e),
1338
+ size: "xs",
1339
+ emptyLabel: c.unknownSize
1340
+ }),
1341
+ /* @__PURE__ */ V(i, {
1342
+ role: "cell",
1343
+ size: "xs",
1344
+ type: "secondary",
1345
+ className: "truncate",
1346
+ children: n.getCollection(e) || "—"
1347
+ }),
1348
+ /* @__PURE__ */ V(i, {
1349
+ role: "cell",
1350
+ size: "xs",
1351
+ type: "secondary",
1352
+ children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
1353
+ }),
1354
+ /* @__PURE__ */ V("div", {
1355
+ role: "cell",
1356
+ className: "contents",
1357
+ children: /* @__PURE__ */ V(s, {
1358
+ type: "button",
1359
+ tone: "secondary",
1360
+ buttonStyle: "ghost",
1361
+ size: "sm",
1362
+ iconOnly: !0,
1363
+ className: "relative z-10",
1364
+ "aria-label": W(c.cardDetails, { name: h }),
1365
+ onClick: (e) => {
1366
+ e.stopPropagation(), u(a);
1367
+ },
1368
+ children: /* @__PURE__ */ V(Ce, { className: "size-icon-md" })
1369
+ })
1370
+ })
1371
+ ]
1372
+ }, a);
1373
+ })
1001
1374
  })]
1002
1375
  });
1003
1376
  }
1004
- function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s, onUpdate: c, onRemove: u, onReplace: d, renderDetail: f }) {
1377
+ function gt({ label: e, value: t, placeholder: n, readOnly: r = !1, onCommit: i }) {
1378
+ let [a, o] = B({
1379
+ source: t,
1380
+ value: t
1381
+ });
1382
+ a.source !== t && o({
1383
+ source: t,
1384
+ value: t
1385
+ });
1386
+ let s = !r && a.value !== t, c = () => o({
1387
+ source: t,
1388
+ value: t
1389
+ }), l = () => {
1390
+ s && (c(), i(a.value));
1391
+ }, u = z(null);
1392
+ return L(() => {
1393
+ u.current = s ? () => i(a.value) : null;
1394
+ }), L(() => () => u.current?.(), []), /* @__PURE__ */ V(A, {
1395
+ label: e,
1396
+ children: /* @__PURE__ */ V(ie, {
1397
+ value: a.value,
1398
+ placeholder: n,
1399
+ readOnly: r,
1400
+ onChange: (e) => o({
1401
+ source: t,
1402
+ value: e.target.value
1403
+ }),
1404
+ onBlur: l,
1405
+ onKeyDown: (e) => {
1406
+ r || e.nativeEvent.isComposing || (e.key === "Enter" ? (e.preventDefault(), l()) : e.key === "Escape" && s && (e.stopPropagation(), c()));
1407
+ }
1408
+ })
1409
+ });
1410
+ }
1411
+ function _t({ label: e, tags: t, placeholder: n, readOnly: r = !1, onValueChange: i }) {
1412
+ return /* @__PURE__ */ V(gt, {
1413
+ label: e,
1414
+ value: t.join(", "),
1415
+ placeholder: n,
1416
+ readOnly: r,
1417
+ onCommit: (e) => {
1418
+ let n = e.split(",").map((e) => e.trim()).filter(Boolean);
1419
+ (n.length !== t.length || n.some((e, n) => e !== t[n])) && i(n);
1420
+ }
1421
+ });
1422
+ }
1423
+ function vt({ item: e, collections: t = [], accessors: n, strings: a, onClose: o, onUpdate: c, readOnly: u = !1, mutationError: m, onRemove: h, allowDelete: g = !0, onReplace: _, renderDetail: v }) {
1005
1424
  if (!e) return null;
1006
- let p = n.getName(e), m = n.getType(e), g = n.getSrc(e), _ = n.getCollection(e) ?? t[0]?.value ?? "", v = n.getTags(e), x = n.getPublic(e) ?? !0, S = f?.(e, {
1425
+ let b = n.getName(e), x = n.getType(e), S = n.getSrc(e), C = n.getCollection(e), ee = n.getTags(e), T = n.getPublic(e) ?? !0, ne = u ? () => Promise.resolve(!1) : c, E = v?.(e, {
1007
1426
  accessors: n,
1008
- update: c,
1009
- remove: u,
1010
- replace: d,
1011
- close: s
1427
+ update: ne,
1428
+ mutationError: m,
1429
+ remove: g ? h : () => Promise.resolve(!1),
1430
+ replace: _,
1431
+ close: o
1012
1432
  });
1013
- return S ? /* @__PURE__ */ F(se, { children: S }) : /* @__PURE__ */ I("aside", {
1433
+ return E ? /* @__PURE__ */ V(he, { children: E }) : /* @__PURE__ */ H("aside", {
1014
1434
  className: "media-library-detail-panel--component flex min-h-0 w-full flex-col border-l border-border bg-background text-foreground @2xl/media-library:w-72",
1015
- children: [/* @__PURE__ */ F("div", {
1016
- className: "media-library-detail-panel--header border-b border-border p-surface",
1017
- children: /* @__PURE__ */ I(l, {
1435
+ children: [/* @__PURE__ */ V("div", {
1436
+ className: r("media-library-detail-panel--header p-surface", d.header),
1437
+ children: /* @__PURE__ */ H(l, {
1018
1438
  direction: "horizontal",
1019
1439
  align: "center",
1020
1440
  gap: "md",
1021
- children: [/* @__PURE__ */ F(i, {
1441
+ children: [/* @__PURE__ */ V(s, {
1022
1442
  type: "button",
1023
1443
  tone: "secondary",
1024
1444
  buttonStyle: "ghost",
1025
1445
  size: "sm",
1026
1446
  iconOnly: !0,
1027
- "aria-label": o.detail.close,
1447
+ "aria-label": a.detail.close,
1028
1448
  "data-media-detail-close": "",
1029
- onClick: s,
1030
- children: /* @__PURE__ */ F(L, { className: "size-icon-md" })
1031
- }), /* @__PURE__ */ F(a, {
1449
+ onClick: o,
1450
+ children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
1451
+ }), /* @__PURE__ */ V(i, {
1032
1452
  weight: "semibold",
1033
- children: o.detail.title
1453
+ children: a.detail.title
1034
1454
  })]
1035
1455
  })
1036
- }), /* @__PURE__ */ I("div", {
1456
+ }), /* @__PURE__ */ H("div", {
1037
1457
  className: "media-library-detail-panel--body grid min-h-0 auto-rows-max gap-space-xl overflow-y-auto p-surface",
1038
1458
  children: [
1039
- /* @__PURE__ */ I(q, {
1459
+ /* @__PURE__ */ H(Z, {
1040
1460
  tint: n.getTint(e),
1041
1461
  className: "aspect-[4/3] rounded-radius border border-border",
1042
- children: [/* @__PURE__ */ F(J, {
1043
- src: g,
1044
- alt: n.getAlt(e) || p,
1045
- type: m,
1462
+ children: [/* @__PURE__ */ V(dt, {
1463
+ src: S,
1464
+ alt: n.getAlt(e) || b,
1465
+ type: x,
1046
1466
  className: "size-full object-cover"
1047
- }), m === "video" && !!n.getDuration(e) && /* @__PURE__ */ I(C, {
1467
+ }), x === "video" && !!n.getDuration(e) && /* @__PURE__ */ H(k, {
1048
1468
  className: "absolute bottom-2 right-2 bg-inverse-background text-inverse-foreground",
1049
- children: [/* @__PURE__ */ F(he, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
1469
+ children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
1050
1470
  })]
1051
1471
  }),
1052
- /* @__PURE__ */ F(a, {
1472
+ /* @__PURE__ */ V(i, {
1053
1473
  tag: "div",
1054
1474
  weight: "semibold",
1055
1475
  className: "break-words",
1056
- children: p
1476
+ children: b
1057
1477
  }),
1058
- /* @__PURE__ */ F(ne, {
1478
+ /* @__PURE__ */ V(N, {
1059
1479
  layout: "rows",
1060
1480
  valueAlign: "end",
1061
1481
  density: "compact",
@@ -1063,231 +1483,257 @@ function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
1063
1483
  items: [
1064
1484
  {
1065
1485
  id: "type",
1066
- label: o.detail.type,
1067
- value: G(m, o)
1486
+ label: a.detail.type,
1487
+ value: Y(x, a)
1068
1488
  },
1069
1489
  {
1070
1490
  id: "size",
1071
- label: o.detail.size,
1072
- value: /* @__PURE__ */ F(y, {
1491
+ label: a.detail.size,
1492
+ value: /* @__PURE__ */ V(w, {
1073
1493
  value: n.getSize(e),
1074
- emptyLabel: o.unknownSize
1494
+ emptyLabel: a.unknownSize
1075
1495
  })
1076
1496
  },
1077
1497
  {
1078
1498
  id: "dimensions",
1079
- label: o.detail.dimensions,
1080
- value: /* @__PURE__ */ F(b, {
1499
+ label: a.detail.dimensions,
1500
+ value: /* @__PURE__ */ V(te, {
1081
1501
  width: n.getWidth(e),
1082
1502
  height: n.getHeight(e),
1083
- emptyLabel: o.unknownSize
1503
+ emptyLabel: a.unknownSize
1084
1504
  })
1085
1505
  },
1086
1506
  {
1087
1507
  id: "uploaded",
1088
- label: o.detail.uploaded,
1089
- value: String(n.getUploadedAt(e) ?? "—")
1508
+ label: a.detail.uploaded,
1509
+ value: /* @__PURE__ */ V(ut, { value: n.getUploadedAt(e) })
1090
1510
  },
1091
1511
  {
1092
1512
  id: "used-in",
1093
- label: o.detail.usedIn,
1094
- value: K(n.getUsageCount(e), o)
1513
+ label: a.detail.usedIn,
1514
+ value: lt(n.getUsageCount(e), a)
1095
1515
  }
1096
1516
  ]
1097
1517
  }),
1098
- /* @__PURE__ */ F(T, {
1099
- label: o.detail.altText,
1100
- children: /* @__PURE__ */ F(w, {
1101
- value: n.getAlt(e) ?? "",
1102
- placeholder: o.detail.altPlaceholder,
1103
- onChange: (e) => c({ alt: e.target.value })
1104
- })
1518
+ m && /* @__PURE__ */ V(f, {
1519
+ tone: "destructive",
1520
+ children: /* @__PURE__ */ V(p, { children: a.detail.mutationError ?? U.detail.mutationError })
1105
1521
  }),
1106
- /* @__PURE__ */ F(T, {
1107
- label: o.detail.collection,
1108
- children: /* @__PURE__ */ F(D, {
1109
- value: _,
1522
+ /* @__PURE__ */ V(gt, {
1523
+ label: a.detail.altText,
1524
+ value: n.getAlt(e) ?? "",
1525
+ placeholder: a.detail.altPlaceholder,
1526
+ readOnly: u,
1527
+ onCommit: (e) => ne({ alt: e })
1528
+ }, `alt:${n.getId(e)}`),
1529
+ /* @__PURE__ */ V(A, {
1530
+ label: a.detail.collection,
1531
+ children: /* @__PURE__ */ V(M, {
1532
+ value: C,
1110
1533
  options: t.map((e) => ({
1111
1534
  value: e.value,
1112
1535
  label: String(e.label)
1113
1536
  })),
1114
- "aria-label": o.detail.collection,
1115
- onValueChange: (e) => c({ collection: e })
1116
- })
1117
- }),
1118
- /* @__PURE__ */ F(T, {
1119
- label: o.detail.tags,
1120
- children: /* @__PURE__ */ F(w, {
1121
- value: v.join(", "),
1122
- placeholder: o.detail.tagsPlaceholder,
1123
- onChange: (e) => c({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
1537
+ placeholder: a.detail.noCollection ?? U.detail.noCollection,
1538
+ "aria-label": a.detail.collection,
1539
+ readOnly: u,
1540
+ onValueChange: (e) => ne({ collection: e })
1124
1541
  })
1125
1542
  }),
1126
- /* @__PURE__ */ F("div", {
1543
+ /* @__PURE__ */ V(_t, {
1544
+ label: a.detail.tags,
1545
+ tags: ee,
1546
+ placeholder: a.detail.tagsPlaceholder,
1547
+ readOnly: u,
1548
+ onValueChange: (e) => ne({ tags: e })
1549
+ }, n.getId(e)),
1550
+ /* @__PURE__ */ V("div", {
1127
1551
  className: "media-library-detail-panel--public",
1128
- children: /* @__PURE__ */ I(l, {
1552
+ children: /* @__PURE__ */ H(l, {
1129
1553
  direction: "horizontal",
1130
1554
  align: "center",
1131
1555
  justify: "between",
1132
1556
  gap: "xl",
1133
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(a, {
1557
+ children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(i, {
1134
1558
  weight: "semibold",
1135
- children: o.detail.public
1136
- }), /* @__PURE__ */ F(a, {
1559
+ children: a.detail.public
1560
+ }), /* @__PURE__ */ V(i, {
1137
1561
  size: "xs",
1138
1562
  type: "secondary",
1139
- children: x ? o.detail.publicHint : o.detail.privateHint
1140
- })] }), /* @__PURE__ */ F(E, {
1141
- "aria-label": o.detail.public,
1142
- checked: x,
1143
- onValueChange: (e) => c({ public: e })
1563
+ children: T ? a.detail.publicHint : a.detail.privateHint
1564
+ })] }), /* @__PURE__ */ V(j, {
1565
+ "aria-label": a.detail.public,
1566
+ checked: T,
1567
+ readOnly: u,
1568
+ onValueChange: (e) => ne({ public: e })
1144
1569
  })]
1145
1570
  })
1146
1571
  }),
1147
- /* @__PURE__ */ I("div", {
1148
- className: r("media-library-detail-panel--actions flex flex-wrap", h.commands),
1149
- children: [d && /* @__PURE__ */ F(i, {
1572
+ (_ || g) && /* @__PURE__ */ H("div", {
1573
+ className: r("media-library-detail-panel--actions flex flex-wrap", y.commands),
1574
+ children: [_ && /* @__PURE__ */ V(s, {
1150
1575
  type: "button",
1151
1576
  tone: "secondary",
1152
1577
  buttonStyle: "outline",
1153
- onClick: d,
1154
- children: o.detail.replace
1155
- }), /* @__PURE__ */ F(i, {
1578
+ onClick: _,
1579
+ children: a.detail.replace
1580
+ }), g && /* @__PURE__ */ V(s, {
1156
1581
  type: "button",
1157
1582
  tone: "destructive",
1158
1583
  buttonStyle: "ghost",
1159
- onClick: u,
1160
- children: o.detail.delete
1584
+ onClick: h,
1585
+ children: a.detail.delete
1161
1586
  })]
1162
1587
  })
1163
1588
  ]
1164
1589
  })]
1165
1590
  });
1166
1591
  }
1167
- function Ge({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, strings: o, onFiles: s, onRemoveFile: c, onOptionsChange: u, empty: d }) {
1168
- return /* @__PURE__ */ F("div", {
1592
+ function yt({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, hasUploadError: a = !1, accept: o = Re, maxFileSize: c, maxFiles: u, rejections: d = [], strings: m, onFiles: h, onRemoveFile: g, onOptionsChange: v, empty: y }) {
1593
+ let b = c === void 0 ? void 0 : ee(c) ?? void 0, x = (e) => m.upload[e] ?? U.upload[e] ?? "", S = b ? `${m.upload.dropHint} · ${W(x("sizeLimitHint"), { size: b })}` : m.upload.dropHint, C = [...d.filter((e) => e.reason !== "count").map((e) => W(x(e.reason === "type" ? "unsupportedType" : "tooLarge"), {
1594
+ name: e.name,
1595
+ size: b ?? ""
1596
+ })), ...d.some((e) => e.reason === "count") ? [W(x("tooMany"), { count: u ?? 0 })] : []];
1597
+ return /* @__PURE__ */ V("div", {
1169
1598
  className: "media-library-upload-panel--component p-surface",
1170
- children: /* @__PURE__ */ I(l, {
1599
+ children: /* @__PURE__ */ H(l, {
1171
1600
  gap: "xl",
1172
1601
  children: [
1173
- /* @__PURE__ */ F(A, {
1174
- onDrop: s,
1175
- accept: "image/*,video/*",
1602
+ /* @__PURE__ */ V(de, {
1603
+ onDrop: h,
1604
+ accept: o,
1176
1605
  multiple: !0,
1177
1606
  size: "md",
1178
1607
  strings: {
1179
- instruction: o.upload.dropTitle,
1180
- helper: o.upload.dropHint,
1181
- dragOver: o.upload.dragOver
1608
+ instruction: m.upload.dropTitle,
1609
+ helper: S,
1610
+ dragOver: m.upload.dragOver
1182
1611
  }
1183
1612
  }),
1184
- e.length > 0 ? /* @__PURE__ */ F(l, {
1613
+ C.length > 0 && /* @__PURE__ */ V(f, {
1614
+ tone: "destructive",
1615
+ className: "media-library-upload-panel--rejections",
1616
+ children: /* @__PURE__ */ V(p, { children: /* @__PURE__ */ V(l, {
1617
+ gap: "xs",
1618
+ children: C.map((e) => /* @__PURE__ */ V(i, {
1619
+ tag: "span",
1620
+ size: "inherit",
1621
+ type: "inherit",
1622
+ children: e
1623
+ }, e))
1624
+ }) })
1625
+ }),
1626
+ a && /* @__PURE__ */ V(f, {
1627
+ tone: "destructive",
1628
+ children: /* @__PURE__ */ V(p, { children: m.upload.error ?? U.upload.error })
1629
+ }),
1630
+ e.length > 0 ? /* @__PURE__ */ V(l, {
1185
1631
  gap: "md",
1186
1632
  className: "media-library-upload-panel--staged",
1187
- children: e.map((e) => /* @__PURE__ */ I("div", {
1633
+ children: e.map((e) => /* @__PURE__ */ H("div", {
1188
1634
  className: "media-library-upload-panel--staged-file flex items-center gap-space-lg rounded-radius border border-border bg-card text-card-foreground px-row-x py-row-y",
1189
1635
  children: [
1190
- /* @__PURE__ */ F(q, {
1636
+ /* @__PURE__ */ V(Z, {
1191
1637
  className: "size-10 rounded-radius",
1192
- children: e.src ? /* @__PURE__ */ F("img", {
1638
+ children: e.src ? /* @__PURE__ */ V("img", {
1193
1639
  src: e.src,
1194
1640
  alt: e.name,
1195
1641
  className: "size-full object-cover"
1196
- }) : /* @__PURE__ */ F("div", {
1642
+ }) : /* @__PURE__ */ V("div", {
1197
1643
  className: "flex size-full items-center justify-center text-muted-foreground",
1198
- children: Ve(e.type, "size-icon")
1644
+ children: ct(e.type, "size-icon")
1199
1645
  })
1200
1646
  }),
1201
- /* @__PURE__ */ I(l, {
1647
+ /* @__PURE__ */ H(l, {
1202
1648
  gap: "md",
1203
1649
  className: "min-w-0 flex-1",
1204
1650
  children: [
1205
- /* @__PURE__ */ I("div", {
1651
+ /* @__PURE__ */ H("div", {
1206
1652
  className: "flex items-baseline gap-space-lg",
1207
- children: [/* @__PURE__ */ F(a, {
1653
+ children: [/* @__PURE__ */ V(i, {
1208
1654
  type: "inherit",
1209
1655
  weight: "semibold",
1210
1656
  className: "truncate",
1211
1657
  children: e.name
1212
- }), /* @__PURE__ */ F(y, {
1658
+ }), /* @__PURE__ */ V(w, {
1213
1659
  value: e.size,
1214
1660
  size: "xs",
1215
1661
  className: "ml-auto shrink-0"
1216
1662
  })]
1217
1663
  }),
1218
- (e.status === "uploading" || e.status === "done") && /* @__PURE__ */ F(p, {
1664
+ (e.status === "uploading" || e.status === "done") && /* @__PURE__ */ V(_, {
1219
1665
  value: e.progress,
1220
1666
  size: "sm",
1221
1667
  "aria-label": e.name
1222
1668
  }),
1223
- e.status === "error" && /* @__PURE__ */ F(a, {
1669
+ e.status === "error" && /* @__PURE__ */ V(i, {
1224
1670
  type: "error",
1225
1671
  children: e.error
1226
1672
  })
1227
1673
  ]
1228
1674
  }),
1229
- e.status === "done" ? /* @__PURE__ */ F(C, {
1675
+ e.status === "done" ? /* @__PURE__ */ V(k, {
1230
1676
  tone: "success",
1231
- children: o.upload.done
1232
- }) : e.status === "uploading" ? /* @__PURE__ */ F(x, {
1677
+ children: m.upload.done
1678
+ }) : e.status === "uploading" ? /* @__PURE__ */ V(T, {
1233
1679
  value: Math.round(e.progress),
1234
1680
  scaled: !0,
1235
1681
  size: "xs",
1236
1682
  type: "secondary"
1237
- }) : /* @__PURE__ */ F(i, {
1683
+ }) : /* @__PURE__ */ V(s, {
1238
1684
  type: "button",
1239
1685
  tone: "secondary",
1240
1686
  buttonStyle: "ghost",
1241
1687
  size: "sm",
1242
1688
  iconOnly: !0,
1243
1689
  disabled: r,
1244
- "aria-label": H(o.upload.removeFile, { name: e.name }),
1245
- onClick: () => c(e.id),
1246
- children: /* @__PURE__ */ F(Se, { className: "size-icon-md" })
1690
+ "aria-label": W(m.upload.removeFile, { name: e.name }),
1691
+ onClick: () => g(e.id),
1692
+ children: /* @__PURE__ */ V(Pe, { className: "size-icon-md" })
1247
1693
  })
1248
1694
  ]
1249
1695
  }, e.id))
1250
- }) : d,
1251
- /* @__PURE__ */ I("div", {
1696
+ }) : y,
1697
+ /* @__PURE__ */ H("div", {
1252
1698
  className: "media-library-upload-panel--options grid gap-space-lg @2xl/media-library:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]",
1253
1699
  children: [
1254
- /* @__PURE__ */ F(T, {
1255
- label: o.upload.collection,
1256
- children: /* @__PURE__ */ F(D, {
1257
- value: t.collection ?? n[0]?.value,
1700
+ /* @__PURE__ */ V(A, {
1701
+ label: m.upload.collection,
1702
+ children: /* @__PURE__ */ V(M, {
1703
+ value: t.collection,
1704
+ placeholder: m.upload.noCollection ?? U.upload.noCollection,
1705
+ allowClear: !0,
1258
1706
  options: n.map((e) => ({
1259
1707
  value: e.value,
1260
1708
  label: String(e.label)
1261
1709
  })),
1262
- "aria-label": o.upload.collection,
1263
- onValueChange: (e) => u({ collection: e })
1710
+ "aria-label": m.upload.collection,
1711
+ onValueChange: (e) => v({ collection: e })
1264
1712
  })
1265
1713
  }),
1266
- /* @__PURE__ */ F(T, {
1267
- label: o.upload.tags,
1268
- children: /* @__PURE__ */ F(w, {
1269
- value: t.tags.join(", "),
1270
- placeholder: o.upload.tagsPlaceholder,
1271
- onChange: (e) => u({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
1272
- })
1714
+ /* @__PURE__ */ V(_t, {
1715
+ label: m.upload.tags,
1716
+ tags: t.tags,
1717
+ placeholder: m.upload.tagsPlaceholder,
1718
+ onValueChange: (e) => v({ tags: e })
1273
1719
  }),
1274
- /* @__PURE__ */ I(l, {
1720
+ /* @__PURE__ */ H(l, {
1275
1721
  direction: "horizontal",
1276
1722
  align: "center",
1277
1723
  justify: "between",
1278
1724
  gap: "xl",
1279
1725
  className: "@2xl/media-library:self-end",
1280
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(a, {
1726
+ children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(i, {
1281
1727
  weight: "semibold",
1282
- children: o.upload.public
1283
- }), /* @__PURE__ */ F(a, {
1728
+ children: m.upload.public
1729
+ }), /* @__PURE__ */ V(i, {
1284
1730
  size: "xs",
1285
1731
  type: "secondary",
1286
- children: o.upload.publicHint
1287
- })] }), /* @__PURE__ */ F(E, {
1288
- "aria-label": o.upload.public,
1732
+ children: m.upload.publicHint
1733
+ })] }), /* @__PURE__ */ V(j, {
1734
+ "aria-label": m.upload.public,
1289
1735
  checked: t.public,
1290
- onValueChange: (e) => u({ public: e })
1736
+ onValueChange: (e) => v({ public: e })
1291
1737
  })]
1292
1738
  })
1293
1739
  ]
@@ -1296,92 +1742,91 @@ function Ge({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading:
1296
1742
  })
1297
1743
  });
1298
1744
  }
1299
- function Ke({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings: s, onClearSelection: c, className: l }) {
1300
- let u = t.length, d = o.reduce((e, t) => e + t.size, 0), f = o.length, p = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
1301
- return e === "upload" ? /* @__PURE__ */ F("div", {
1745
+ function bt({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: a, strings: o, onClearSelection: c, className: l }) {
1746
+ let u = t.length, d = a.reduce((e, t) => e + t.size, 0), f = a.length, p = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
1747
+ return e === "upload" ? /* @__PURE__ */ V("div", {
1302
1748
  className: p,
1303
1749
  "aria-live": "polite",
1304
- children: /* @__PURE__ */ F(a, {
1750
+ children: /* @__PURE__ */ V(i, {
1305
1751
  size: "xs",
1306
1752
  type: "secondary",
1307
1753
  className: "truncate",
1308
- children: f === 0 ? s.footer.noFiles : H(s.footer.stagedSummary, {
1754
+ children: f === 0 ? o.footer.noFiles : W(o.footer.stagedSummary, {
1309
1755
  count: f,
1310
- size: v(d) ?? s.unknownSize
1756
+ size: ee(d) ?? o.unknownSize
1311
1757
  })
1312
1758
  })
1313
- }) : /* @__PURE__ */ F("div", {
1759
+ }) : /* @__PURE__ */ V("div", {
1314
1760
  className: p,
1315
1761
  "aria-live": "polite",
1316
- children: u > 0 ? /* @__PURE__ */ I(se, { children: [/* @__PURE__ */ F(a, {
1762
+ children: u > 0 ? /* @__PURE__ */ H(he, { children: [/* @__PURE__ */ V(i, {
1317
1763
  weight: "semibold",
1318
1764
  className: "whitespace-nowrap",
1319
- children: H(s.footer.selectedCount, { count: u })
1320
- }), /* @__PURE__ */ F(i, {
1765
+ children: W(o.footer.selectedCount, { count: u })
1766
+ }), /* @__PURE__ */ V(s, {
1321
1767
  type: "button",
1322
1768
  tone: "secondary",
1323
1769
  buttonStyle: "ghost",
1324
1770
  size: "sm",
1325
1771
  onClick: c,
1326
- children: s.footer.clear
1327
- })] }) : /* @__PURE__ */ F(a, {
1772
+ children: o.footer.clear
1773
+ })] }) : /* @__PURE__ */ V(i, {
1328
1774
  size: "xs",
1329
1775
  type: "secondary",
1330
1776
  className: "truncate",
1331
- children: n === "single" ? s.footer.pickOne : s.footer.pickMany
1777
+ children: n === "single" ? o.footer.pickOne : o.footer.pickMany
1332
1778
  })
1333
1779
  });
1334
1780
  }
1335
- function qe({ tab: e, selectedItems: t, selectedIds: n, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onUpload: f, onCancelUpload: p, className: m }) {
1336
- let h = n.length, g = a.length;
1337
- return e === "upload" ? /* @__PURE__ */ I("div", {
1338
- className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
1339
- children: [/* @__PURE__ */ F(i, {
1781
+ function xt({ tab: e, selectedIds: t, stagedFiles: n, uploading: i = !1, strings: a, confirmLabel: o, cancelLabel: c, onCancel: l, onConfirm: u, onUpload: d, onCancelUpload: f, className: p }) {
1782
+ let m = t.length, h = n.length;
1783
+ return e === "upload" ? /* @__PURE__ */ H("div", {
1784
+ className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", p),
1785
+ children: [/* @__PURE__ */ V(s, {
1340
1786
  type: "button",
1341
1787
  tone: "secondary",
1342
1788
  buttonStyle: "ghost",
1343
- disabled: o,
1344
- onClick: p,
1345
- children: l ?? s.footer.cancel
1346
- }), /* @__PURE__ */ F(i, {
1789
+ onClick: f,
1790
+ children: c ?? a.footer.cancel
1791
+ }), /* @__PURE__ */ V(s, {
1347
1792
  tone: "primary",
1348
1793
  type: "button",
1349
- disabled: g === 0 || o,
1350
- onClick: f,
1351
- loading: o,
1352
- strings: { loading: s.footer.uploading },
1353
- children: g <= 1 ? s.footer.upload : H(s.footer.uploadMany, { count: g })
1354
- })]
1355
- }) : /* @__PURE__ */ I("div", {
1356
- className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
1357
- children: [/* @__PURE__ */ F(i, {
1794
+ disabled: h === 0 || i,
1795
+ onClick: d,
1796
+ loading: i,
1797
+ strings: { loading: a.footer.uploading },
1798
+ children: h <= 1 ? a.footer.upload : W(a.footer.uploadMany, { count: h })
1799
+ }, "upload")]
1800
+ }) : /* @__PURE__ */ H("div", {
1801
+ className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", p),
1802
+ children: [/* @__PURE__ */ V(s, {
1358
1803
  type: "button",
1359
1804
  tone: "secondary",
1360
1805
  buttonStyle: "ghost",
1361
- onClick: u,
1362
- children: l ?? s.footer.cancel
1363
- }), /* @__PURE__ */ F(i, {
1806
+ onClick: l,
1807
+ children: c ?? a.footer.cancel
1808
+ }), /* @__PURE__ */ V(s, {
1364
1809
  tone: "primary",
1365
1810
  type: "button",
1366
- disabled: h === 0,
1367
- onClick: d,
1368
- children: c ?? (h === 0 ? s.footer.confirmEmpty : t.length === 1 ? s.footer.confirmOne : H(s.footer.confirmMany, { count: h }))
1369
- })]
1811
+ disabled: m === 0,
1812
+ onClick: u,
1813
+ children: o ?? (m === 0 ? a.footer.confirmEmpty : m === 1 ? a.footer.confirmOne : W(a.footer.confirmMany, { count: m }))
1814
+ }, "confirm")]
1370
1815
  });
1371
1816
  }
1372
- function Z({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onClearSelection: f, onUpload: p, onCancelUpload: m, chrome: h = "section", className: g }) {
1373
- return /* @__PURE__ */ F("footer", {
1374
- className: r("media-library-footer--component", h === "section" && "border-t border-border bg-background text-foreground p-surface", g),
1375
- children: /* @__PURE__ */ I("div", {
1817
+ function St({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: f, onClearSelection: p, onUpload: m, onCancelUpload: h, chrome: g = "section", className: _ }) {
1818
+ return /* @__PURE__ */ V("footer", {
1819
+ className: r("media-library-footer--component", g === "section" && r("bg-background text-foreground p-surface", d.footer), _),
1820
+ children: /* @__PURE__ */ H("div", {
1376
1821
  className: "flex min-w-0 flex-col gap-space-lg @md/media-library:flex-row @md/media-library:justify-between",
1377
- children: [/* @__PURE__ */ F(Ke, {
1822
+ children: [/* @__PURE__ */ V(bt, {
1378
1823
  tab: e,
1379
1824
  selectedIds: n,
1380
1825
  selectionMode: i,
1381
1826
  stagedFiles: a,
1382
1827
  strings: s,
1383
- onClearSelection: f
1384
- }), /* @__PURE__ */ F(qe, {
1828
+ onClearSelection: p
1829
+ }), /* @__PURE__ */ V(xt, {
1385
1830
  tab: e,
1386
1831
  selectedItems: t,
1387
1832
  selectedIds: n,
@@ -1391,18 +1836,30 @@ function Z({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedF
1391
1836
  confirmLabel: c,
1392
1837
  cancelLabel: l,
1393
1838
  onCancel: u,
1394
- onConfirm: d,
1395
- onUpload: p,
1396
- onCancelUpload: m
1839
+ onConfirm: f,
1840
+ onUpload: m,
1841
+ onCancelUpload: h
1397
1842
  })]
1398
1843
  })
1399
1844
  });
1400
1845
  }
1401
1846
  //#endregion
1402
1847
  //#region src/components/features/media-library/media-library.tsx
1403
- var Je = j(null);
1404
- function Ye(e, t, n) {
1405
- return N(() => {
1848
+ var Ct = pe(null);
1849
+ function wt({ tab: e, children: t }) {
1850
+ let n = "media-library--body flex min-h-0 flex-1";
1851
+ return e ? /* @__PURE__ */ V(ce, {
1852
+ value: e,
1853
+ tabIndex: -1,
1854
+ className: n,
1855
+ children: t
1856
+ }) : /* @__PURE__ */ V("div", {
1857
+ className: n,
1858
+ children: t
1859
+ });
1860
+ }
1861
+ function Tt(e, t, n) {
1862
+ return R(() => {
1406
1863
  if (e) return e;
1407
1864
  let r = /* @__PURE__ */ new Set();
1408
1865
  for (let e of t) {
@@ -1419,374 +1876,432 @@ function Ye(e, t, n) {
1419
1876
  t
1420
1877
  ]);
1421
1878
  }
1422
- function Q({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLabel: h, selectionMode: g = "multiple", density: v = "comfortable", showMeta: y = !0, allowUpload: b = !0, typeFilters: x, confirmOnSelect: w = !1, onConfirm: T, onCancel: E, onClose: D, bulkActions: te, strings: ne, slots: A, heightClassName: re, className: j, items: M, fetcher: N, accessors: P, collections: se, value: L, defaultValue: ce, onValueChange: R, onItemUpdate: z, onItemDelete: B, onItemReplace: ue, onItemOpen: de, onUpload: fe, onError: pe, selecting: me, defaultSelecting: he, onSelectingChange: ge, tab: _e, defaultTab: ve, onTabChange: ye, view: xe, defaultView: Se, onViewChange: we, query: Te, defaultQuery: U, onQueryChange: Ee, type: De, defaultType: Oe, onTypeChange: ke, collection: Ae, defaultCollection: je, onCollectionChange: Me, sort: Ne, defaultSort: Pe, onSortChange: Fe, uploadOptions: Ie, defaultUploadOptions: Le, onUploadOptionsChange: W, ...ze }) {
1423
- let { defaultScale: Be } = t(), Ve = e(void 0, Be), G = n(Ce, ne), K = Re({
1424
- items: M,
1425
- fetcher: N,
1426
- accessors: P,
1879
+ function Et({ title: e, titleSuffix: t, description: a, confirmLabel: c, cancelLabel: u, selectionMode: _ = "multiple", density: v = "comfortable", showMeta: y = !0, allowUpload: b = !0, typeFilters: x, confirmOnSelect: C = !1, onConfirm: ee, onCancel: w, onClose: te, bulkActions: T, strings: E, slots: D, heightClassName: O, className: ie, items: A, fetcher: j, refreshKey: M, pageSize: ae, accessors: oe, collections: se, value: N, defaultValue: ce, onValueChange: de, onItemUpdate: fe, onItemDelete: F, onItemReplace: pe, onItemOpen: I, onUpload: R, uploadAccept: ge, maxFileSize: _e, maxFiles: ve, uploadFailedMessage: ye, onError: be, selecting: Se, defaultSelecting: Ce, onSelectingChange: we, tab: Te, defaultTab: Ee, onTabChange: De, view: Oe, defaultView: ke, onViewChange: Ae, query: je, defaultQuery: Ne, onQueryChange: Pe, type: Ie, defaultType: Le, onTypeChange: Re, collection: ze, defaultCollection: Be, onCollectionChange: Ve, sort: He, defaultSort: Ue, onSortChange: We, uploadOptions: Ge, defaultUploadOptions: Ke, onUploadOptionsChange: qe, ...Je }) {
1880
+ let G = n(U, E), K = at({
1881
+ items: A,
1882
+ fetcher: j,
1883
+ refreshKey: M,
1884
+ pageSize: ae,
1885
+ accessors: oe,
1427
1886
  collections: se,
1428
- selectionMode: g,
1429
- value: L,
1887
+ selectionMode: _,
1888
+ value: N,
1430
1889
  defaultValue: ce,
1431
- onValueChange: R,
1432
- onItemUpdate: z,
1433
- onItemDelete: B,
1434
- onUpload: fe,
1435
- onError: pe,
1436
- tab: _e,
1437
- defaultTab: ve,
1438
- onTabChange: ye,
1439
- view: xe,
1440
- defaultView: Se,
1441
- onViewChange: we,
1442
- query: Te,
1443
- defaultQuery: U,
1444
- onQueryChange: Ee,
1445
- type: De,
1446
- defaultType: Oe,
1447
- onTypeChange: ke,
1448
- collection: Ae,
1449
- defaultCollection: je,
1450
- onCollectionChange: Me,
1451
- sort: Ne,
1452
- defaultSort: Pe,
1453
- onSortChange: Fe,
1454
- uploadOptions: Ie,
1455
- defaultUploadOptions: Le,
1456
- onUploadOptionsChange: W,
1457
- selecting: me,
1458
- defaultSelecting: he ?? w,
1459
- onSelectingChange: ge
1460
- }), q = Ye(se, K.items, K.accessors.getCollection), J = b ? K.tab : "library", Q = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? null : null, Xe = ie(Je), Ze = !A?.footer, $ = Xe && Ze ? /* @__PURE__ */ F(Ke, {
1461
- tab: J,
1890
+ onValueChange: de,
1891
+ onItemUpdate: fe,
1892
+ onItemDelete: F,
1893
+ onUpload: R,
1894
+ uploadAccept: ge,
1895
+ maxFileSize: _e,
1896
+ maxFiles: ve,
1897
+ uploadFailedMessage: ye ?? G.upload.fileFailed ?? U.upload.fileFailed,
1898
+ onError: be,
1899
+ tab: Te,
1900
+ defaultTab: Ee,
1901
+ onTabChange: De,
1902
+ view: Oe,
1903
+ defaultView: ke,
1904
+ onViewChange: Ae,
1905
+ query: je,
1906
+ defaultQuery: Ne,
1907
+ onQueryChange: Pe,
1908
+ type: Ie,
1909
+ defaultType: Le,
1910
+ onTypeChange: Re,
1911
+ collection: ze,
1912
+ defaultCollection: Be,
1913
+ onCollectionChange: Ve,
1914
+ sort: He,
1915
+ defaultSort: Ue,
1916
+ onSortChange: We,
1917
+ uploadOptions: Ge,
1918
+ defaultUploadOptions: Ke,
1919
+ onUploadOptionsChange: qe,
1920
+ selecting: Se,
1921
+ defaultSelecting: Ce ?? C,
1922
+ onSelectingChange: we
1923
+ }), Ye = Tt(se, K.items, K.accessors.getCollection), Xe = b ? K.tab : "library", [q, Ze] = B(null), Qe = z(null), $e = q ? K.accessors.getId(q.item) : null, et = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? ($e === K.detailId ? q?.item ?? null : null) : null, tt = K.mutationError?.operation === "delete" && K.mutationError.itemId === $e, nt = me(Ct), rt = !D?.footer, it = nt && rt ? /* @__PURE__ */ V(bt, {
1924
+ tab: Xe,
1462
1925
  selectedIds: K.selectedIds,
1463
- selectionMode: g,
1926
+ selectionMode: _,
1464
1927
  stagedFiles: K.stagedFiles,
1465
1928
  strings: G,
1466
1929
  onClearSelection: K.clearSelection,
1467
1930
  className: "media-library-dialog--selection-summary shrink-0 justify-end"
1468
- }) : null, Qe = !!(o || c || p || A?.headerStart), $e = !!(b || A?.headerEnd || $), et = Qe || $e, tt = () => {
1469
- T?.(K.selectedItems, K.selectedIds), D?.();
1470
- }, nt = () => {
1471
- E?.(), D?.();
1472
- }, rt = (e) => {
1931
+ }) : null, ot = !!(e || t || a || D?.headerStart), st = !!(b || D?.headerEnd || it), J = ot || st, ct = () => {
1932
+ ee?.(K.selectedItems, K.selectedIds), te?.();
1933
+ }, Y = () => {
1934
+ w?.(), te?.();
1935
+ }, lt = () => {
1936
+ if (K.uploading) {
1937
+ K.cancelUpload();
1938
+ return;
1939
+ }
1940
+ K.clearStagedFiles(), K.setTab("library");
1941
+ }, X = (e) => {
1473
1942
  let t = K.accessors.getId(e);
1474
- K.toggleSelection(t), w && (T?.([e], [t]), D?.());
1475
- }, it = oe(null), at = oe(null), ot = (e) => {
1476
- at.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
1477
- }, st = (e) => {
1478
- de ? de(e) : ot(K.accessors.getId(e));
1943
+ K.toggleSelection(t), C && (ee?.([e], [t]), te?.());
1944
+ }, ut = z(null), Z = z(null), dt = z(null), gt = z(!1), _t = (e) => !F || Qe.current ? Promise.resolve(!1) : new Promise((t) => {
1945
+ let n = {
1946
+ item: e,
1947
+ resolve: t
1948
+ };
1949
+ Qe.current = n, Ze(n);
1950
+ }), Et = (e) => {
1951
+ let t = Qe.current;
1952
+ Qe.current = null, Ze(null), t?.resolve(e);
1479
1953
  };
1480
- ae(() => {
1954
+ L(() => () => {
1955
+ Qe.current?.resolve(!1), Qe.current = null;
1956
+ }, []);
1957
+ let Q = (e) => {
1958
+ dt.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
1959
+ }, Dt = (e) => {
1960
+ I ? I(e) : Q(K.accessors.getId(e));
1961
+ };
1962
+ L(() => {
1481
1963
  if (K.detailId !== null) {
1482
- at.current && it.current?.querySelector("[data-media-detail-close]")?.focus();
1964
+ dt.current && ut.current?.querySelector("[data-media-detail-close]")?.focus();
1483
1965
  return;
1484
1966
  }
1485
- let e = at.current;
1486
- at.current = null, e?.isConnected && e.focus();
1967
+ let e = dt.current;
1968
+ dt.current = null, gt.current ? (gt.current = !1, Z.current?.focus()) : e?.isConnected && e.focus();
1487
1969
  }, [K.detailId]);
1488
- let ct = !K.loading && !!K.error, lt = K.query.trim(), ut = lt.length > 0 ? H(G.countSearch, {
1970
+ let Ot = !!j && !K.loading && K.loadError != null, kt = z(!1), At = () => {
1971
+ kt.current = !0, K.loadMore();
1972
+ };
1973
+ L(() => {
1974
+ !K.loadingMore && kt.current && (kt.current = !1, !K.hasMore && document.activeElement === document.body && Z.current?.focus());
1975
+ }, [K.hasMore, K.loadingMore]);
1976
+ let jt = !!K.hasMore && !Ot && !(K.loading && !K.hasLoadedResults), Mt = K.query.trim(), Nt = Mt.length > 0 ? W(G.countSearch, {
1489
1977
  count: K.filteredCount,
1490
1978
  total: K.totalCount,
1491
- query: lt
1492
- }) : K.filteredCount === K.totalCount ? H(G.countAll, { count: K.totalCount }) : H(G.countFiltered, {
1979
+ query: Mt
1980
+ }) : K.filteredCount === K.totalCount ? W(G.countAll, { count: K.totalCount }) : W(G.countFiltered, {
1493
1981
  count: K.filteredCount,
1494
1982
  total: K.totalCount
1495
- }), dt = !!te && !(Xe || T && !w), ft = oe(null), pt = J === "library" ? K.selectedIds.length : 0, mt = A?.footer ?? (dt && J === "library" ? null : Xe ? /* @__PURE__ */ F(qe, {
1496
- tab: J,
1983
+ }), Pt = !!T && !(nt || ee && !C), Ft = Xe === "library" ? K.selectedIds.length : 0, It = D?.footer ?? (Pt && Xe === "library" ? null : nt ? /* @__PURE__ */ V(xt, {
1984
+ tab: Xe,
1497
1985
  selectedItems: K.selectedItems,
1498
1986
  selectedIds: K.selectedIds,
1499
1987
  stagedFiles: K.stagedFiles,
1500
1988
  uploading: K.uploading,
1501
1989
  strings: G,
1502
- confirmLabel: m,
1503
- cancelLabel: h,
1504
- onCancel: nt,
1505
- onConfirm: tt,
1990
+ confirmLabel: c,
1991
+ cancelLabel: u,
1992
+ onCancel: Y,
1993
+ onConfirm: ct,
1506
1994
  onUpload: K.startUpload,
1507
- onCancelUpload: () => {
1508
- K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
1509
- },
1995
+ onCancelUpload: lt,
1510
1996
  className: "ml-auto"
1511
- }) : /* @__PURE__ */ F(Z, {
1512
- tab: J,
1997
+ }) : /* @__PURE__ */ V(St, {
1998
+ tab: Xe,
1513
1999
  selectedItems: K.selectedItems,
1514
2000
  selectedIds: K.selectedIds,
1515
- selectionMode: g,
2001
+ selectionMode: _,
1516
2002
  stagedFiles: K.stagedFiles,
1517
2003
  uploading: K.uploading,
1518
2004
  strings: G,
1519
- confirmLabel: m,
1520
- cancelLabel: h,
1521
- onCancel: nt,
1522
- onConfirm: tt,
2005
+ confirmLabel: c,
2006
+ cancelLabel: u,
2007
+ onCancel: Y,
2008
+ onConfirm: ct,
1523
2009
  onClearSelection: K.clearSelection,
1524
2010
  onUpload: K.startUpload,
1525
- onCancelUpload: () => {
1526
- K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
1527
- }
1528
- }));
1529
- return /* @__PURE__ */ I("section", {
1530
- ref: it,
1531
- className: r("media-library--component @container/media-library box-border flex min-h-0 flex-col overflow-hidden rounded-surface border border-border bg-background text-foreground", re ?? "h-190 max-h-[calc(100vh-7rem)]", j),
1532
- ...ze,
1533
- children: [
1534
- et && /* @__PURE__ */ I("header", {
1535
- className: "media-library--header flex flex-col gap-space-lg border-b border-border p-surface @2xl/media-library:flex-row @2xl/media-library:items-center @2xl/media-library:justify-between",
1536
- children: [Qe && /* @__PURE__ */ I(l, {
2011
+ onCancelUpload: lt
2012
+ })), Lt = r("media-library--component @container/media-library box-border flex min-h-0 flex-col overflow-hidden rounded-surface border border-border bg-background text-foreground", O ?? "h-190 max-h-[calc(100vh-7rem)]", ie), Rt = /* @__PURE__ */ H(he, { children: [
2013
+ J && /* @__PURE__ */ H("header", {
2014
+ className: r("media-library--header flex flex-col gap-space-lg p-surface", d.header, "@2xl/media-library:flex-row @2xl/media-library:items-center @2xl/media-library:justify-between"),
2015
+ children: [ot && /* @__PURE__ */ H(l, {
2016
+ direction: "horizontal",
2017
+ align: "start",
2018
+ gap: "lg",
2019
+ className: "min-w-0",
2020
+ children: [D?.headerStart, (e || t || a) && /* @__PURE__ */ H(l, {
2021
+ gap: "normal",
2022
+ className: "min-w-0",
2023
+ children: [!!(e || t) && /* @__PURE__ */ V(m, {
2024
+ title: e,
2025
+ suffix: t,
2026
+ className: "media-library--title"
2027
+ }), !!a && /* @__PURE__ */ V(i, {
2028
+ type: "secondary",
2029
+ children: a
2030
+ })]
2031
+ })]
2032
+ }), st && /* @__PURE__ */ H("div", {
2033
+ className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", it ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
2034
+ children: [/* @__PURE__ */ H(l, {
1537
2035
  direction: "horizontal",
1538
- align: "start",
1539
- gap: "lg",
2036
+ wrap: !0,
2037
+ align: "center",
2038
+ gap: "md",
1540
2039
  className: "min-w-0",
1541
- children: [A?.headerStart, (o || c || p) && /* @__PURE__ */ I(l, {
1542
- gap: "normal",
1543
- className: "min-w-0",
1544
- children: [!!(o || c) && /* @__PURE__ */ F(u, {
1545
- title: o,
1546
- suffix: c,
1547
- className: "media-library--title"
1548
- }), !!p && /* @__PURE__ */ F(a, {
1549
- type: "secondary",
1550
- children: p
2040
+ children: [b && /* @__PURE__ */ H(le, {
2041
+ className: "media-library--tabs",
2042
+ children: [/* @__PURE__ */ H(P, {
2043
+ value: "library",
2044
+ children: [/* @__PURE__ */ V(xe, { className: "size-icon-md" }), G.tabs.library]
2045
+ }), /* @__PURE__ */ H(P, {
2046
+ value: "upload",
2047
+ children: [
2048
+ /* @__PURE__ */ V(Me, { className: "size-icon-md" }),
2049
+ G.tabs.upload,
2050
+ K.stagedFiles.length > 0 && /* @__PURE__ */ V(k, {
2051
+ size: "sm",
2052
+ tone: "secondary",
2053
+ className: "media-library--staged-count",
2054
+ children: /* @__PURE__ */ V(ne, {
2055
+ value: K.stagedFiles.length,
2056
+ size: "inherit",
2057
+ weight: "inherit",
2058
+ type: "inherit",
2059
+ align: "center"
2060
+ })
2061
+ })
2062
+ ]
1551
2063
  })]
1552
- })]
1553
- }), $e && /* @__PURE__ */ I("div", {
1554
- className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", $ ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
1555
- children: [/* @__PURE__ */ I(l, {
1556
- direction: "horizontal",
1557
- wrap: !0,
1558
- align: "center",
1559
- gap: "md",
1560
- className: "min-w-0",
1561
- children: [b && /* @__PURE__ */ I("div", {
1562
- className: r("media-library--tabs", O.frame, k[Ve]),
1563
- role: "tablist",
1564
- children: [/* @__PURE__ */ I(i, {
2064
+ }), D?.headerEnd]
2065
+ }), it]
2066
+ })]
2067
+ }),
2068
+ /* @__PURE__ */ H(wt, {
2069
+ tab: b ? Xe : null,
2070
+ children: [Xe === "upload" ? /* @__PURE__ */ V("div", {
2071
+ className: "min-w-0 flex-1 overflow-y-auto",
2072
+ children: /* @__PURE__ */ V(yt, {
2073
+ stagedFiles: K.stagedFiles,
2074
+ uploadOptions: K.uploadOptions,
2075
+ collections: Ye,
2076
+ uploading: K.uploading,
2077
+ hasUploadError: K.uploadError != null && K.stagedFiles.length > 0,
2078
+ accept: ge,
2079
+ maxFileSize: _e,
2080
+ maxFiles: ve,
2081
+ rejections: K.uploadRejections,
2082
+ strings: G,
2083
+ onFiles: K.addFiles,
2084
+ onRemoveFile: K.removeStagedFile,
2085
+ onOptionsChange: K.updateUploadOptions,
2086
+ empty: D?.uploadEmpty
2087
+ })
2088
+ }) : /* @__PURE__ */ H("div", {
2089
+ className: r("media-library--library min-w-0 flex-1 flex-col", et ? "hidden @2xl/media-library:flex" : "flex"),
2090
+ children: [/* @__PURE__ */ V(l, {
2091
+ gap: "md",
2092
+ className: r("media-library--toolbar p-surface", d.header),
2093
+ children: /* @__PURE__ */ V(pt, {
2094
+ query: K.query,
2095
+ type: K.type,
2096
+ typeFilters: x,
2097
+ collection: K.collection,
2098
+ sort: K.sort,
2099
+ view: K.view,
2100
+ collections: Ye,
2101
+ strings: G,
2102
+ onQueryChange: K.setQuery,
2103
+ onTypeChange: K.setType,
2104
+ onCollectionChange: K.setCollection,
2105
+ onSortChange: K.setSort,
2106
+ onViewChange: K.setView,
2107
+ onClearFilters: K.clearFilters,
2108
+ toolbarEnd: D?.toolbarEnd,
2109
+ selecting: K.selecting,
2110
+ onSelectingChange: K.setSelecting,
2111
+ disabled: Ot,
2112
+ summary: /* @__PURE__ */ V("span", {
2113
+ "aria-live": "polite",
2114
+ className: "media-library--count min-w-0 truncate",
2115
+ children: Ot || K.loading ? null : /* @__PURE__ */ V(i, {
2116
+ tag: "span",
2117
+ size: "xs",
2118
+ type: "secondary",
2119
+ children: Nt
2120
+ })
2121
+ })
2122
+ })
2123
+ }), /* @__PURE__ */ H("div", {
2124
+ ref: Z,
2125
+ role: "region",
2126
+ "aria-label": G.resultsLabel,
2127
+ "aria-busy": K.loading || void 0,
2128
+ tabIndex: 0,
2129
+ className: `media-library--results flex min-h-0 flex-1 flex-col gap-space-lg overflow-y-auto p-surface focus-visible:outline-none ${o.inset}`,
2130
+ children: [K.loading && !K.hasLoadedResults ? /* @__PURE__ */ V("div", {
2131
+ className: "media-library--state my-auto",
2132
+ children: D?.loading ?? /* @__PURE__ */ V(h, {
2133
+ className: "min-h-64",
2134
+ label: G.loading
2135
+ })
2136
+ }) : Ot ? /* @__PURE__ */ V("div", {
2137
+ className: "media-library--state my-auto",
2138
+ children: D?.error ?? /* @__PURE__ */ V(g, {
2139
+ title: G.errorTitle,
2140
+ description: G.errorDescription,
2141
+ onRetry: j ? K.retry : void 0,
2142
+ retryLabel: G.retry ?? U.retry
2143
+ })
2144
+ }) : K.visibleItems.length === 0 ? /* @__PURE__ */ V("div", {
2145
+ className: "media-library--state my-auto",
2146
+ children: D?.empty ?? /* @__PURE__ */ V(ft, {
2147
+ title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
2148
+ description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
2149
+ action: K.hasFilters ? /* @__PURE__ */ V(s, {
1565
2150
  type: "button",
1566
- role: "tab",
1567
- "aria-selected": J === "library",
1568
2151
  tone: "secondary",
1569
- buttonStyle: "ghost",
1570
- size: "sm",
1571
- className: r(O.item, "shadow-none", J === "library" ? `${_.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1572
- onClick: () => K.setTab("library"),
1573
- children: [/* @__PURE__ */ F(le, { className: "size-icon-md" }), G.tabs.library]
1574
- }), /* @__PURE__ */ I(i, {
2152
+ buttonStyle: "outline",
2153
+ onClick: K.clearFilters,
2154
+ children: G.clearFilters
2155
+ }) : b ? /* @__PURE__ */ V(s, {
2156
+ tone: "primary",
1575
2157
  type: "button",
1576
- role: "tab",
1577
- "aria-selected": J === "upload",
1578
- tone: "secondary",
1579
- buttonStyle: "ghost",
1580
- size: "sm",
1581
- className: r(O.item, "shadow-none", J === "upload" ? `${_.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1582
2158
  onClick: () => K.setTab("upload"),
1583
- children: [
1584
- /* @__PURE__ */ F(be, { className: "size-icon-md" }),
1585
- G.tabs.upload,
1586
- K.stagedFiles.length > 0 && /* @__PURE__ */ F(C, {
1587
- size: "sm",
1588
- tone: "secondary",
1589
- className: "media-library--staged-count",
1590
- children: /* @__PURE__ */ F(S, {
1591
- value: K.stagedFiles.length,
1592
- size: "inherit",
1593
- weight: "inherit",
1594
- type: "inherit",
1595
- align: "center"
1596
- })
1597
- })
1598
- ]
1599
- })]
1600
- }), A?.headerEnd]
1601
- }), $]
1602
- })]
1603
- }),
1604
- /* @__PURE__ */ I("div", {
1605
- className: "media-library--body flex min-h-0 flex-1",
1606
- children: [J === "upload" ? /* @__PURE__ */ F("div", {
1607
- className: "min-w-0 flex-1 overflow-y-auto",
1608
- children: /* @__PURE__ */ F(Ge, {
1609
- stagedFiles: K.stagedFiles,
1610
- uploadOptions: K.uploadOptions,
1611
- collections: q,
1612
- uploading: K.uploading,
1613
- strings: G,
1614
- onFiles: K.addFiles,
1615
- onRemoveFile: K.removeStagedFile,
1616
- onOptionsChange: K.updateUploadOptions,
1617
- empty: A?.uploadEmpty
1618
- })
1619
- }) : /* @__PURE__ */ I("div", {
1620
- className: r("media-library--library min-w-0 flex-1 flex-col", Q ? "hidden @2xl/media-library:flex" : "flex"),
1621
- children: [/* @__PURE__ */ F(l, {
1622
- gap: "md",
1623
- className: "media-library--toolbar border-b border-border/60 p-surface",
1624
- children: /* @__PURE__ */ F(He, {
1625
- query: K.query,
1626
- type: K.type,
1627
- typeFilters: x,
1628
- collection: K.collection,
1629
- sort: K.sort,
1630
- view: K.view,
1631
- collections: q,
2159
+ children: G.uploadMedia
2160
+ }) : void 0
2161
+ })
2162
+ }) : K.view === "table" ? /* @__PURE__ */ V("div", {
2163
+ className: "overflow-x-auto",
2164
+ children: /* @__PURE__ */ V(ht, {
2165
+ items: K.visibleItems,
2166
+ selectedSet: K.selectedSet,
2167
+ selectionMode: _,
2168
+ accessors: K.accessors,
1632
2169
  strings: G,
1633
- onQueryChange: K.setQuery,
1634
- onTypeChange: K.setType,
1635
- onCollectionChange: K.setCollection,
1636
- onSortChange: K.setSort,
1637
- onViewChange: K.setView,
1638
- onClearFilters: K.clearFilters,
1639
- toolbarEnd: A?.toolbarEnd,
2170
+ onToggle: (e) => {
2171
+ let t = K.items.find((t) => K.accessors.getId(t) === e);
2172
+ t && X(t);
2173
+ },
2174
+ onDetails: Q,
1640
2175
  selecting: K.selecting,
1641
- onSelectingChange: K.setSelecting,
1642
- disabled: ct,
1643
- summary: /* @__PURE__ */ F("span", {
1644
- "aria-live": "polite",
1645
- className: "media-library--count min-w-0 truncate",
1646
- children: ct || K.loading ? null : /* @__PURE__ */ F(a, {
1647
- tag: "span",
1648
- size: "xs",
1649
- type: "secondary",
1650
- children: ut
1651
- })
1652
- })
2176
+ onOpen: (e) => {
2177
+ let t = K.items.find((t) => K.accessors.getId(t) === e);
2178
+ t && Dt(t);
2179
+ }
1653
2180
  })
1654
- }), /* @__PURE__ */ F("div", {
1655
- ref: ft,
1656
- role: "region",
1657
- "aria-label": G.resultsLabel,
1658
- tabIndex: 0,
1659
- className: `media-library--results flex min-h-0 flex-1 flex-col overflow-y-auto p-surface focus-visible:outline-none ${s.inset}`,
1660
- children: K.loading ? /* @__PURE__ */ F("div", {
1661
- className: "media-library--state my-auto",
1662
- children: A?.loading ?? /* @__PURE__ */ F(d, {
1663
- className: "min-h-64",
1664
- label: G.loading
1665
- })
1666
- }) : ct ? /* @__PURE__ */ F("div", {
1667
- className: "media-library--state my-auto",
1668
- children: A?.error ?? /* @__PURE__ */ F(f, {
1669
- title: G.errorTitle,
1670
- description: G.errorDescription,
1671
- onRetry: N ? K.retry : void 0,
1672
- retryLabel: G.retry ?? Ce.retry
1673
- })
1674
- }) : K.visibleItems.length === 0 ? /* @__PURE__ */ F("div", {
1675
- className: "media-library--state my-auto",
1676
- children: A?.empty ?? /* @__PURE__ */ F(Y, {
1677
- title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
1678
- description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
1679
- action: K.hasFilters ? /* @__PURE__ */ F(i, {
1680
- type: "button",
1681
- tone: "secondary",
1682
- buttonStyle: "outline",
1683
- onClick: K.clearFilters,
1684
- children: G.clearFilters
1685
- }) : b ? /* @__PURE__ */ F(i, {
1686
- tone: "primary",
1687
- type: "button",
1688
- onClick: () => K.setTab("upload"),
1689
- children: G.uploadMedia
1690
- }) : void 0
1691
- })
1692
- }) : K.view === "table" ? /* @__PURE__ */ F("div", {
1693
- className: "overflow-x-auto",
1694
- children: /* @__PURE__ */ F(Ue, {
1695
- items: K.visibleItems,
1696
- selectedSet: K.selectedSet,
1697
- selectionMode: g,
2181
+ }) : /* @__PURE__ */ V("div", {
2182
+ className: r("media-library--grid grid min-w-0 gap-space-lg", v === "compact" ? "grid-cols-[repeat(auto-fill,minmax(136px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(168px,1fr))]"),
2183
+ children: K.visibleItems.map((e) => {
2184
+ let t = K.accessors.getId(e), n = {
2185
+ id: t,
2186
+ selected: K.selectedSet.has(t),
2187
+ selectionMode: _,
2188
+ selecting: K.selecting,
2189
+ accessors: K.accessors,
2190
+ toggle: () => X(e),
2191
+ openDetails: () => Q(t),
2192
+ open: () => Dt(e)
2193
+ }, r = D?.renderItem?.(e, n);
2194
+ return r ? /* @__PURE__ */ V("div", { children: r }, t) : /* @__PURE__ */ V(mt, {
2195
+ item: e,
2196
+ selected: n.selected,
2197
+ density: v,
2198
+ showMeta: y,
2199
+ selectionMode: _,
1698
2200
  accessors: K.accessors,
1699
2201
  strings: G,
1700
- onToggle: (e) => {
1701
- let t = K.items.find((t) => K.accessors.getId(t) === e);
1702
- t && rt(t);
1703
- },
1704
- onDetails: ot,
1705
- selecting: K.selecting,
1706
- onOpen: (e) => {
1707
- let t = K.items.find((t) => K.accessors.getId(t) === e);
1708
- t && st(t);
1709
- }
1710
- })
1711
- }) : /* @__PURE__ */ F("div", {
1712
- className: r("media-library--grid grid min-w-0 gap-space-lg", v === "compact" ? "grid-cols-[repeat(auto-fill,minmax(136px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(168px,1fr))]"),
1713
- children: K.visibleItems.map((e) => {
1714
- let t = K.accessors.getId(e), n = {
1715
- id: t,
1716
- selected: K.selectedSet.has(t),
1717
- selectionMode: g,
1718
- selecting: K.selecting,
1719
- accessors: K.accessors,
1720
- toggle: () => rt(e),
1721
- openDetails: () => ot(t),
1722
- open: () => st(e)
1723
- }, r = A?.renderItem?.(e, n);
1724
- return r ? /* @__PURE__ */ F("div", { children: r }, t) : /* @__PURE__ */ F(X, {
1725
- item: e,
1726
- selected: n.selected,
1727
- density: v,
1728
- showMeta: y,
1729
- selectionMode: g,
1730
- accessors: K.accessors,
1731
- strings: G,
1732
- onToggle: n.toggle,
1733
- onDetails: n.openDetails,
1734
- onOpen: n.open,
1735
- selecting: n.selecting
1736
- }, t);
1737
- })
2202
+ onToggle: n.toggle,
2203
+ onDetails: n.openDetails,
2204
+ onOpen: n.open,
2205
+ selecting: n.selecting
2206
+ }, t);
1738
2207
  })
2208
+ }), jt && /* @__PURE__ */ H(l, {
2209
+ align: "center",
2210
+ gap: "md",
2211
+ className: "media-library--load-more",
2212
+ children: [K.loadMoreError != null && /* @__PURE__ */ V(f, {
2213
+ tone: "destructive",
2214
+ children: /* @__PURE__ */ V(p, { children: G.loadMoreError ?? U.loadMoreError })
2215
+ }), /* @__PURE__ */ V(s, {
2216
+ type: "button",
2217
+ tone: "secondary",
2218
+ buttonStyle: "outline",
2219
+ disabled: K.loading,
2220
+ loading: K.loadingMore,
2221
+ strings: { loading: G.loadingMore ?? U.loadingMore },
2222
+ onClick: At,
2223
+ children: K.loadMoreError == null ? G.loadMore ?? U.loadMore : G.retry ?? U.retry
2224
+ })]
1739
2225
  })]
1740
- }), J === "library" && /* @__PURE__ */ F(We, {
1741
- item: Q,
1742
- collections: q,
1743
- accessors: K.accessors,
1744
- strings: G,
1745
- onClose: () => K.setDetailId(null),
1746
- onUpdate: (e) => Q ? K.updateItem(Q, e) : Promise.resolve(!1),
1747
- onReplace: ue && Q ? () => ue(Q) : void 0,
1748
- onRemove: async () => {
1749
- if (!Q) return !1;
1750
- let e = await K.removeItem(Q);
1751
- return e && K.setDetailId(null), e;
1752
- },
1753
- renderDetail: A?.renderDetail
1754
2226
  })]
1755
- }),
1756
- Xe ? Xe.element ? V(mt, Xe.element) : null : mt,
1757
- dt && /* @__PURE__ */ F(ee, {
1758
- selectedCount: pt,
2227
+ }), Xe === "library" && /* @__PURE__ */ V(vt, {
2228
+ item: et,
2229
+ collections: Ye,
2230
+ accessors: K.accessors,
2231
+ strings: G,
2232
+ onClose: () => K.setDetailId(null),
2233
+ readOnly: !fe,
2234
+ onUpdate: (e) => et ? K.updateItem(et, e) : Promise.resolve(!1),
2235
+ mutationError: K.mutationError?.itemId === K.detailId ? K.mutationError : null,
2236
+ onReplace: pe && et ? () => pe(et) : void 0,
2237
+ allowDelete: !!F,
2238
+ onRemove: () => et ? _t(et) : Promise.resolve(!1),
2239
+ renderDetail: D?.renderDetail
2240
+ })]
2241
+ }),
2242
+ nt ? nt.element ? Fe(It, nt.element) : null : It,
2243
+ (F || q) && /* @__PURE__ */ V(S, {
2244
+ open: q !== null,
2245
+ onOpenChange: (e) => {
2246
+ e || Et(!1);
2247
+ },
2248
+ destructive: !0,
2249
+ title: G.detail.confirmDeleteTitle ?? U.detail.confirmDeleteTitle,
2250
+ description: q ? W(G.detail.confirmDeleteDescription ?? U.detail.confirmDeleteDescription ?? "", { name: K.accessors.getName(q.item) }) : void 0,
2251
+ strings: { confirm: G.detail.confirmDeleteLabel ?? U.detail.confirmDeleteLabel },
2252
+ alertMessage: tt ? G.detail.confirmDeleteError ?? U.detail.confirmDeleteError : void 0,
2253
+ closeOnAsyncComplete: !1,
2254
+ onAsyncConfirm: async () => {
2255
+ q && await K.removeItem(q.item) && Qe.current === q && (gt.current = !0, K.setDetailId(null), Et(!0));
2256
+ }
2257
+ }),
2258
+ Pt && /* @__PURE__ */ V(re, {
2259
+ selectedCount: Ft,
2260
+ totalCount: K.totalCount,
2261
+ onClear: K.clearSelection,
2262
+ returnFocusRef: Z,
2263
+ className: "media-library--bulk-actions",
2264
+ strings: {
2265
+ label: G.batchActionsLabel,
2266
+ summary: (e) => W(G.footer.selectedCount, { count: e }),
2267
+ clear: G.footer.clear
2268
+ },
2269
+ children: Ft > 0 && T?.({
2270
+ selectedItems: K.items.filter((e) => K.selectedSet.has(K.accessors.getId(e))),
2271
+ selectedIds: K.selectedIds,
2272
+ selectedCount: K.selectedIds.length,
2273
+ visibleCount: K.filteredCount,
1759
2274
  totalCount: K.totalCount,
1760
- onClear: K.clearSelection,
1761
- returnFocusRef: ft,
1762
- className: "media-library--bulk-actions",
1763
- strings: {
1764
- label: G.batchActionsLabel,
1765
- summary: (e) => H(G.footer.selectedCount, { count: e }),
1766
- clear: G.footer.clear
1767
- },
1768
- children: pt > 0 && te?.({
1769
- selectedItems: K.selectedItems,
1770
- selectedIds: K.selectedIds,
1771
- selectedCount: K.selectedIds.length,
1772
- visibleCount: K.filteredCount,
1773
- totalCount: K.totalCount,
1774
- clearSelection: K.clearSelection
1775
- })
2275
+ clearSelection: K.clearSelection
1776
2276
  })
1777
- ]
2277
+ })
2278
+ ] });
2279
+ return b ? /* @__PURE__ */ V(ue, {
2280
+ value: Xe,
2281
+ onValueChange: (e) => K.setTab(e),
2282
+ render: /* @__PURE__ */ V("section", {
2283
+ ref: ut,
2284
+ ...Je
2285
+ }),
2286
+ className: r("gap-0", Lt),
2287
+ children: Rt
2288
+ }) : /* @__PURE__ */ V("section", {
2289
+ ref: ut,
2290
+ className: Lt,
2291
+ ...Je,
2292
+ children: Rt
1778
2293
  });
1779
2294
  }
1780
- function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescription: o, onClose: s, className: c, dialogClassName: l, contentClassName: u, closeOnEscape: d = !0, closeOnBackdropClick: f = !0, ...p }) {
1781
- let m = n(Ce, p.strings), [h, _] = P(!1), [v, y] = P(null), b = e !== void 0, x = b ? e : h, S = (e) => {
1782
- b || _(e), t?.(e);
2295
+ function Q({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescription: o, onClose: s, className: c, dialogClassName: l, contentClassName: u, closeOnEscape: d = !0, closeOnBackdropClick: f = !0, ...p }) {
2296
+ let m = n(U, p.strings), [h, g] = B(!1), [_, v] = B(null), y = e !== void 0, b = y ? e : h, S = (e) => {
2297
+ y || g(e), t?.(e);
1783
2298
  }, C = () => {
1784
2299
  S(!1), s?.();
1785
2300
  };
1786
- return /* @__PURE__ */ F(Je.Provider, {
1787
- value: { element: v },
1788
- children: /* @__PURE__ */ F(g, {
1789
- open: x,
2301
+ return /* @__PURE__ */ V(Ct.Provider, {
2302
+ value: { element: _ },
2303
+ children: /* @__PURE__ */ V(x, {
2304
+ open: b,
1790
2305
  onOpenChange: S,
1791
2306
  onClose: s,
1792
2307
  trigger: i,
@@ -1795,15 +2310,15 @@ function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
1795
2310
  size: "full",
1796
2311
  showCancel: !1,
1797
2312
  showConfirm: !1,
1798
- footer: /* @__PURE__ */ F("div", {
1799
- ref: y,
2313
+ footer: /* @__PURE__ */ V("div", {
2314
+ ref: v,
1800
2315
  className: "media-library-dialog--footer @container/media-library w-full"
1801
2316
  }),
1802
2317
  className: r("media-library-dialog--component max-h-[calc(100vh-2rem)] max-w-[min(1060px,calc(100vw-2rem))] sm:max-w-[min(1060px,calc(100vw-2rem))]", l),
1803
2318
  contentClassName: r("media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0", u),
1804
2319
  closeOnBackdropClick: f,
1805
2320
  closeOnEscape: d,
1806
- children: /* @__PURE__ */ F(Q, {
2321
+ children: /* @__PURE__ */ V(Et, {
1807
2322
  ...p,
1808
2323
  defaultSelecting: p.defaultSelecting ?? !0,
1809
2324
  onClose: C,
@@ -1816,45 +2331,45 @@ function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
1816
2331
  }
1817
2332
  //#endregion
1818
2333
  //#region src/components/features/media-library/media-resource-gallery.tsx
1819
- function Ze(e, t, n) {
2334
+ function Dt(e, t, n) {
1820
2335
  let r = e.slice(), [i] = r.splice(t, 1);
1821
2336
  return i === void 0 || r.splice(n, 0, i), r;
1822
2337
  }
1823
- function $({ items: e, accessors: t, title: o, description: s, primaryId: c, onPrimaryChange: u, onRemove: d, onReorder: f, onAdd: p, maxItems: h, layout: g = "field", density: v = "comfortable", readOnly: b = !1, empty: x, action: S, renderItem: ee, strings: w, className: T, ...E }) {
1824
- let D = n(Ce, w), O = De(t), k = e.length, ne = c ?? (k > 0 ? O.getId(e[0]) : void 0), A = !b && !!p && (h === void 0 || k < h), re = !b && !!u, j = !b && !!d, M = !b && !!f, ie = re || j || M, ae = A && (g === "field" || k > 0) ? /* @__PURE__ */ F(i, {
2338
+ function Ot({ items: e, accessors: t, title: a, description: o, primaryId: c, onPrimaryChange: d, onRemove: f, onReorder: p, onAdd: m, maxItems: h, layout: g = "field", density: _ = "comfortable", readOnly: y = !1, empty: x, action: S, renderItem: ee, strings: te, className: T, ...ne }) {
2339
+ let E = n(U, te), D = Ke(t), O = e.length, re = c ?? (O > 0 ? D.getId(e[0]) : void 0), ie = !y && !!m && (h === void 0 || O < h), A = !y && !!d, j = !y && !!f, M = !y && !!p, ae = A || j || M, oe = ie && (g === "field" || O > 0) ? /* @__PURE__ */ V(s, {
1825
2340
  type: "button",
1826
2341
  tone: "secondary",
1827
2342
  buttonStyle: "outline",
1828
- icon: ge,
1829
- onClick: p,
1830
- children: D.gallery.add
1831
- }) : h !== void 0 && k >= h ? /* @__PURE__ */ F(C, {
2343
+ icon: Oe,
2344
+ onClick: m,
2345
+ children: E.gallery.add
2346
+ }) : h !== void 0 && O >= h ? /* @__PURE__ */ V(k, {
1832
2347
  tone: "secondary",
1833
- children: D.gallery.maxReached
2348
+ children: E.gallery.maxReached
1834
2349
  }) : null, N = (t, n) => {
1835
- if (!M || n < 0 || n >= k || t === n) return;
1836
- let r = Ze(e, t, n);
1837
- f?.(r.map((e) => O.getId(e)), r);
1838
- }, oe = !!(o || s || S || ae), P = k === 0 && g !== "field", R = () => !A || g !== "field" ? null : /* @__PURE__ */ I("button", {
2350
+ if (!M || n < 0 || n >= O || t === n) return;
2351
+ let r = Dt(e, t, n);
2352
+ p?.(r.map((e) => D.getId(e)), r);
2353
+ }, P = !!(a || o || S || oe), ce = O === 0 && g !== "field", le = () => !ie || g !== "field" ? null : /* @__PURE__ */ H("button", {
1839
2354
  type: "button",
1840
- className: r("media-resource-gallery--add-tile box-border m-0 inline-flex w-full cursor-pointer items-center justify-center p-space-md font-sans rounded-radius border border-dashed border-border bg-background text-muted-foreground shadow-none", `aspect-square ${te.hover}`),
1841
- "aria-label": D.gallery.addTile,
1842
- onClick: p,
1843
- children: [/* @__PURE__ */ F(ge, { className: "size-icon" }), /* @__PURE__ */ F(a, {
2355
+ className: r("media-resource-gallery--add-tile box-border m-0 inline-flex w-full cursor-pointer items-center justify-center p-space-md font-sans rounded-radius border border-dashed border-border bg-background text-muted-foreground shadow-none", `aspect-square ${se.hover}`),
2356
+ "aria-label": E.gallery.addTile,
2357
+ onClick: m,
2358
+ children: [/* @__PURE__ */ V(Oe, { className: "size-icon" }), /* @__PURE__ */ V(i, {
1844
2359
  tag: "span",
1845
2360
  size: "inherit",
1846
2361
  className: "sr-only",
1847
- children: D.gallery.addTile
2362
+ children: E.gallery.addTile
1848
2363
  })]
1849
2364
  });
1850
- return /* @__PURE__ */ I("section", {
1851
- className: r("media-resource-gallery--component @container/media-resource-gallery rounded-surface border border-border bg-card text-card-foreground shadow-xs", T),
2365
+ return /* @__PURE__ */ H("section", {
2366
+ className: r("media-resource-gallery--component @container/media-resource-gallery", u.frame, T),
1852
2367
  "data-layout": g,
1853
- "data-gallery-density": v,
1854
- ...E,
1855
- children: [oe && /* @__PURE__ */ F("header", {
2368
+ "data-gallery-density": _,
2369
+ ...ne,
2370
+ children: [P && /* @__PURE__ */ V("header", {
1856
2371
  className: "media-resource-gallery--header p-surface",
1857
- children: /* @__PURE__ */ I(l, {
2372
+ children: /* @__PURE__ */ H(l, {
1858
2373
  direction: {
1859
2374
  base: "vertical",
1860
2375
  md: "horizontal"
@@ -1862,301 +2377,336 @@ function $({ items: e, accessors: t, title: o, description: s, primaryId: c, onP
1862
2377
  gap: "lg",
1863
2378
  align: { md: "start" },
1864
2379
  justify: { md: "between" },
1865
- children: [/* @__PURE__ */ I(l, {
2380
+ children: [/* @__PURE__ */ H(l, {
1866
2381
  gap: "normal",
1867
2382
  className: "min-w-0",
1868
- children: [!!o && /* @__PURE__ */ F(a, {
2383
+ children: [!!a && /* @__PURE__ */ V(i, {
1869
2384
  tag: "div",
1870
2385
  type: "inherit",
1871
2386
  weight: "semibold",
1872
- children: o
1873
- }), !!s && /* @__PURE__ */ F(a, {
2387
+ children: a
2388
+ }), !!o && /* @__PURE__ */ V(i, {
1874
2389
  type: "secondary",
1875
- children: s
2390
+ children: o
1876
2391
  })]
1877
- }), /* @__PURE__ */ F(l, {
2392
+ }), /* @__PURE__ */ V(l, {
1878
2393
  direction: "horizontal",
1879
2394
  wrap: !0,
1880
2395
  align: "center",
1881
- gap: m.commands,
2396
+ gap: v.commands,
1882
2397
  className: "media-resource-gallery--actions",
1883
- children: S ?? ae
2398
+ children: S ?? oe
1884
2399
  })]
1885
2400
  })
1886
- }), P ? /* @__PURE__ */ F("div", {
2401
+ }), ce ? /* @__PURE__ */ V("div", {
1887
2402
  className: "media-resource-gallery--empty px-surface pb-surface",
1888
- children: x ?? /* @__PURE__ */ F(Y, {
1889
- title: D.gallery.emptyTitle,
1890
- description: D.gallery.emptyDescription,
1891
- action: A ? /* @__PURE__ */ F(i, {
2403
+ children: x ?? /* @__PURE__ */ V(ft, {
2404
+ title: E.gallery.emptyTitle,
2405
+ description: E.gallery.emptyDescription,
2406
+ action: ie ? /* @__PURE__ */ V(s, {
1892
2407
  tone: "primary",
1893
2408
  type: "button",
1894
- icon: ue,
1895
- onClick: p,
1896
- children: D.gallery.add
2409
+ icon: Se,
2410
+ onClick: m,
2411
+ children: E.gallery.add
1897
2412
  }) : void 0
1898
2413
  })
1899
- }) : /* @__PURE__ */ I("div", {
1900
- className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", oe && "pt-0", g === "list" ? void 0 : g === "field" ? "grid-cols-[repeat(auto-fill,minmax(96px,1fr))] @md/media-resource-gallery:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]" : v === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
2414
+ }) : /* @__PURE__ */ H("div", {
2415
+ className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", P && "pt-0", g === "list" ? void 0 : g === "field" ? "grid-cols-[repeat(auto-fill,minmax(96px,1fr))] @md/media-resource-gallery:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]" : _ === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
1901
2416
  children: [e.map((e, t) => {
1902
- let n = O.getId(e), o = O.getName(e), s = O.getType(e), c = O.getSrc(e), f = O.getAlt(e) || o, p = n === ne, m = O.getPublic(e) === !1, h = O.getDuration(e), b = M && t > 0, x = M && t < k - 1, S = ee?.(e, {
2417
+ let n = D.getId(e), a = D.getName(e), o = D.getType(e), c = D.getSrc(e), u = D.getAlt(e) || a, p = n === re, m = D.getPublic(e) === !1, h = D.getDuration(e), v = M && t > 0, y = M && t < O - 1, x = (e) => W(e, { name: a }), S = {
1903
2418
  id: n,
1904
2419
  index: t,
1905
- total: k,
2420
+ total: O,
1906
2421
  primary: p,
1907
- accessors: O,
1908
- canMovePrevious: b,
1909
- canMoveNext: x,
2422
+ accessors: D,
2423
+ canMovePrevious: v,
2424
+ canMoveNext: y,
1910
2425
  setPrimary: () => {
1911
- re && u?.(n, e);
2426
+ A && d?.(n, e);
1912
2427
  },
1913
2428
  remove: () => {
1914
- j && d?.(n, e);
2429
+ j && f?.(n, e);
1915
2430
  },
1916
2431
  movePrevious: () => N(t, t - 1),
1917
2432
  moveNext: () => N(t, t + 1)
1918
- });
1919
- return S ? /* @__PURE__ */ F("div", { children: S }, n) : g === "field" ? /* @__PURE__ */ I("div", {
1920
- className: r("media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs", `transition-colors ${_.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
1921
- "data-primary": p || void 0,
1922
- children: [
1923
- c ? /* @__PURE__ */ F("img", {
1924
- src: c,
1925
- alt: f,
1926
- loading: "lazy",
1927
- className: "size-full object-cover"
1928
- }) : /* @__PURE__ */ F("div", {
1929
- className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
1930
- children: /* @__PURE__ */ F(z, { className: p ? "size-7" : "size-icon-lg" })
1931
- }),
1932
- p && /* @__PURE__ */ F(C, {
1933
- tone: "secondary",
1934
- className: "absolute left-2 top-2 bg-background shadow-xs",
1935
- children: D.gallery.cover
1936
- }),
1937
- s === "video" && !!h && /* @__PURE__ */ I(C, {
1938
- tone: "secondary",
1939
- className: "absolute bottom-2 left-2 bg-foreground text-background",
1940
- children: [/* @__PURE__ */ F(he, { className: "size-icon-sm fill-current" }), h]
1941
- }),
1942
- m && /* @__PURE__ */ F("span", {
1943
- className: "absolute bottom-2 right-2 inline-flex size-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-xs",
1944
- children: /* @__PURE__ */ F(me, { className: "size-icon-sm" })
1945
- }),
1946
- j && /* @__PURE__ */ F(i, {
1947
- type: "button",
1948
- tone: "secondary",
1949
- buttonStyle: "solid",
1950
- size: "sm",
1951
- iconOnly: !0,
1952
- className: "absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100",
1953
- "aria-label": D.gallery.remove,
1954
- onClick: () => d?.(n, e),
1955
- children: /* @__PURE__ */ F(Se, { className: "size-icon-md" })
1956
- })
1957
- ]
1958
- }, n) : g === "list" ? /* @__PURE__ */ I(l, {
2433
+ }, te = ee?.(e, S);
2434
+ if (te) return /* @__PURE__ */ V("div", { children: te }, n);
2435
+ if (g === "field") {
2436
+ let t = [
2437
+ {
2438
+ id: "cover",
2439
+ label: E.gallery.setCoverAction ?? U.gallery.setCoverAction,
2440
+ visible: A,
2441
+ disabled: p,
2442
+ onClick: S.setPrimary
2443
+ },
2444
+ {
2445
+ id: "previous",
2446
+ label: E.gallery.movePreviousAction ?? U.gallery.movePreviousAction,
2447
+ visible: M,
2448
+ disabled: !v,
2449
+ onClick: S.movePrevious
2450
+ },
2451
+ {
2452
+ id: "next",
2453
+ label: E.gallery.moveNextAction ?? U.gallery.moveNextAction,
2454
+ visible: M,
2455
+ disabled: !y,
2456
+ onClick: S.moveNext
2457
+ }
2458
+ ];
2459
+ return /* @__PURE__ */ H("div", {
2460
+ className: r("media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs", `transition-colors ${C.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
2461
+ "data-primary": p || void 0,
2462
+ children: [
2463
+ c ? /* @__PURE__ */ V("img", {
2464
+ src: c,
2465
+ alt: u,
2466
+ loading: "lazy",
2467
+ className: "size-full object-cover"
2468
+ }) : /* @__PURE__ */ V("div", {
2469
+ className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
2470
+ children: /* @__PURE__ */ V(ye, { className: p ? "size-7" : "size-icon-lg" })
2471
+ }),
2472
+ p && /* @__PURE__ */ V(k, {
2473
+ tone: "secondary",
2474
+ className: "absolute left-2 top-2 bg-background shadow-xs",
2475
+ children: E.gallery.cover
2476
+ }),
2477
+ o === "video" && !!h && /* @__PURE__ */ H(k, {
2478
+ tone: "secondary",
2479
+ className: "absolute bottom-2 left-2 bg-foreground text-background",
2480
+ children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), h]
2481
+ }),
2482
+ m && /* @__PURE__ */ V("span", {
2483
+ className: "absolute bottom-2 right-2 inline-flex size-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-xs",
2484
+ children: /* @__PURE__ */ V(Ee, { className: "size-icon-sm" })
2485
+ }),
2486
+ ae && /* @__PURE__ */ H("div", {
2487
+ className: "media-resource-gallery--tile-actions absolute right-2 top-2 flex items-center gap-space-xs opacity-0 transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100 has-[[aria-expanded=true]]:opacity-100 pointer-coarse:opacity-100",
2488
+ children: [(A || M) && /* @__PURE__ */ V(b, {
2489
+ srText: x(E.gallery.itemActions ?? U.gallery.itemActions ?? ""),
2490
+ actions: t,
2491
+ context: "commands",
2492
+ buttonProps: { size: "sm" }
2493
+ }), j && /* @__PURE__ */ V(s, {
2494
+ type: "button",
2495
+ tone: "secondary",
2496
+ buttonStyle: "solid",
2497
+ size: "sm",
2498
+ iconOnly: !0,
2499
+ className: "shadow-sm",
2500
+ "aria-label": x(E.gallery.remove),
2501
+ onClick: () => f?.(n, e),
2502
+ children: /* @__PURE__ */ V(Pe, { className: "size-icon-md" })
2503
+ })]
2504
+ })
2505
+ ]
2506
+ }, n);
2507
+ }
2508
+ return g === "list" ? /* @__PURE__ */ H(l, {
1959
2509
  direction: "horizontal",
1960
2510
  wrap: !0,
1961
2511
  align: "center",
1962
2512
  gap: "lg",
1963
- className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x", v === "compact" ? "py-row-y-sm" : "py-row-y"),
2513
+ className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x", _ === "compact" ? "py-row-y-sm" : "py-row-y"),
1964
2514
  "data-primary": p || void 0,
1965
2515
  children: [
1966
- /* @__PURE__ */ F("div", {
2516
+ /* @__PURE__ */ V("div", {
1967
2517
  className: "relative size-12 shrink-0 overflow-hidden rounded-radius bg-muted",
1968
- children: c ? /* @__PURE__ */ F("img", {
2518
+ children: c ? /* @__PURE__ */ V("img", {
1969
2519
  src: c,
1970
- alt: f,
2520
+ alt: u,
1971
2521
  loading: "lazy",
1972
2522
  className: "size-full object-cover"
1973
- }) : /* @__PURE__ */ F("div", {
2523
+ }) : /* @__PURE__ */ V("div", {
1974
2524
  className: "flex size-full items-center justify-center text-muted-foreground",
1975
- children: /* @__PURE__ */ F(z, { className: "size-icon" })
2525
+ children: /* @__PURE__ */ V(ye, { className: "size-icon" })
1976
2526
  })
1977
2527
  }),
1978
- /* @__PURE__ */ I("div", {
2528
+ /* @__PURE__ */ H("div", {
1979
2529
  className: "min-w-0 flex-1",
1980
- children: [/* @__PURE__ */ I(l, {
2530
+ children: [/* @__PURE__ */ H(l, {
1981
2531
  direction: "horizontal",
1982
2532
  wrap: !0,
1983
2533
  align: "center",
1984
2534
  gap: "md",
1985
2535
  className: "min-w-0",
1986
- children: [/* @__PURE__ */ F(a, {
2536
+ children: [/* @__PURE__ */ V(i, {
1987
2537
  tag: "div",
1988
2538
  weight: "semibold",
1989
2539
  className: "min-w-0 break-all",
1990
- children: o
1991
- }), p && /* @__PURE__ */ F(C, {
2540
+ children: a
2541
+ }), p && /* @__PURE__ */ V(k, {
1992
2542
  tone: "secondary",
1993
- children: D.gallery.primary
2543
+ children: E.gallery.primary
1994
2544
  })]
1995
- }), /* @__PURE__ */ I(a, {
2545
+ }), /* @__PURE__ */ H(i, {
1996
2546
  size: "xs",
1997
2547
  type: "secondary",
1998
- children: [H(D.gallery.itemPosition, {
2548
+ children: [W(E.gallery.itemPosition, {
1999
2549
  index: t + 1,
2000
- total: k
2001
- }), O.getSize(e) !== void 0 && /* @__PURE__ */ I(se, { children: [" · ", /* @__PURE__ */ F(y, {
2002
- value: O.getSize(e),
2550
+ total: O
2551
+ }), D.getSize(e) !== void 0 && /* @__PURE__ */ H(he, { children: [" · ", /* @__PURE__ */ V(w, {
2552
+ value: D.getSize(e),
2003
2553
  size: "xs",
2004
2554
  align: "left",
2005
- emptyLabel: D.unknownSize
2555
+ emptyLabel: E.unknownSize
2006
2556
  })] })]
2007
2557
  })]
2008
2558
  }),
2009
- ie && /* @__PURE__ */ I("div", {
2559
+ ae && /* @__PURE__ */ H("div", {
2010
2560
  className: "media-resource-gallery--item-actions flex basis-full flex-wrap items-center justify-end gap-space-xs @sm/media-resource-gallery:basis-auto",
2011
2561
  children: [
2012
- re && /* @__PURE__ */ F(i, {
2562
+ A && /* @__PURE__ */ V(s, {
2013
2563
  type: "button",
2014
2564
  tone: "secondary",
2015
2565
  buttonStyle: "ghost",
2016
2566
  size: "sm",
2017
2567
  iconOnly: !0,
2018
2568
  disabled: p,
2019
- "aria-label": D.gallery.setPrimary,
2020
- onClick: () => u?.(n, e),
2021
- children: /* @__PURE__ */ F(ve, { className: "size-icon-md" })
2569
+ "aria-label": x(E.gallery.setPrimary),
2570
+ onClick: () => d?.(n, e),
2571
+ children: /* @__PURE__ */ V(Ae, { className: "size-icon-md" })
2022
2572
  }),
2023
- M && /* @__PURE__ */ F(i, {
2573
+ M && /* @__PURE__ */ V(s, {
2024
2574
  type: "button",
2025
2575
  tone: "secondary",
2026
2576
  buttonStyle: "ghost",
2027
2577
  size: "sm",
2028
2578
  iconOnly: !0,
2029
- disabled: !b,
2030
- "aria-label": D.gallery.movePrevious,
2579
+ disabled: !v,
2580
+ "aria-label": x(E.gallery.movePrevious),
2031
2581
  onClick: () => N(t, t - 1),
2032
- children: /* @__PURE__ */ F(L, { className: "size-icon-md" })
2582
+ children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
2033
2583
  }),
2034
- M && /* @__PURE__ */ F(i, {
2584
+ M && /* @__PURE__ */ V(s, {
2035
2585
  type: "button",
2036
2586
  tone: "secondary",
2037
2587
  buttonStyle: "ghost",
2038
2588
  size: "sm",
2039
2589
  iconOnly: !0,
2040
- disabled: !x,
2041
- "aria-label": D.gallery.moveNext,
2590
+ disabled: !y,
2591
+ "aria-label": x(E.gallery.moveNext),
2042
2592
  onClick: () => N(t, t + 1),
2043
- children: /* @__PURE__ */ F(ce, { className: "size-icon-md" })
2593
+ children: /* @__PURE__ */ V(_e, { className: "size-icon-md" })
2044
2594
  }),
2045
- j && /* @__PURE__ */ F(i, {
2595
+ j && /* @__PURE__ */ V(s, {
2046
2596
  type: "button",
2047
2597
  tone: "destructive",
2048
2598
  buttonStyle: "ghost",
2049
2599
  size: "sm",
2050
2600
  iconOnly: !0,
2051
- "aria-label": D.gallery.remove,
2052
- onClick: () => d?.(n, e),
2053
- children: /* @__PURE__ */ F(ye, { className: "size-icon-md" })
2601
+ "aria-label": x(E.gallery.remove),
2602
+ onClick: () => f?.(n, e),
2603
+ children: /* @__PURE__ */ V(je, { className: "size-icon-md" })
2054
2604
  })
2055
2605
  ]
2056
2606
  })
2057
2607
  ]
2058
- }, n) : /* @__PURE__ */ I("div", {
2059
- className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${_.tileHover}`,
2608
+ }, n) : /* @__PURE__ */ H("div", {
2609
+ className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${C.tileHover}`,
2060
2610
  "data-primary": p || void 0,
2061
- children: [/* @__PURE__ */ I("div", {
2611
+ children: [/* @__PURE__ */ H("div", {
2062
2612
  className: "relative aspect-[4/3] bg-muted",
2063
- children: [c ? /* @__PURE__ */ F("img", {
2613
+ children: [c ? /* @__PURE__ */ V("img", {
2064
2614
  src: c,
2065
- alt: f,
2615
+ alt: u,
2066
2616
  loading: "lazy",
2067
2617
  className: "size-full object-contain"
2068
- }) : /* @__PURE__ */ F("div", {
2618
+ }) : /* @__PURE__ */ V("div", {
2069
2619
  className: "flex size-full items-center justify-center text-muted-foreground",
2070
- children: /* @__PURE__ */ F(z, { className: "size-6" })
2071
- }), /* @__PURE__ */ I("div", {
2620
+ children: /* @__PURE__ */ V(ye, { className: "size-6" })
2621
+ }), /* @__PURE__ */ H("div", {
2072
2622
  className: "absolute left-2 top-2 flex flex-wrap gap-space-xs",
2073
- children: [p && /* @__PURE__ */ F(C, {
2623
+ children: [p && /* @__PURE__ */ V(k, {
2074
2624
  tone: "secondary",
2075
2625
  className: "bg-card text-card-foreground",
2076
- children: D.gallery.primary
2077
- }), /* @__PURE__ */ F(C, {
2626
+ children: E.gallery.primary
2627
+ }), /* @__PURE__ */ V(k, {
2078
2628
  tone: "secondary",
2079
2629
  className: "bg-card text-card-foreground",
2080
- children: H(D.gallery.itemPosition, {
2630
+ children: W(E.gallery.itemPosition, {
2081
2631
  index: t + 1,
2082
- total: k
2632
+ total: O
2083
2633
  })
2084
2634
  })]
2085
2635
  })]
2086
- }), /* @__PURE__ */ F("div", {
2087
- className: r("media-resource-gallery--item-body", v === "compact" ? "p-surface-xs" : "p-surface"),
2088
- children: /* @__PURE__ */ I(l, {
2636
+ }), /* @__PURE__ */ V("div", {
2637
+ className: r("media-resource-gallery--item-body", _ === "compact" ? "p-surface-xs" : "p-surface"),
2638
+ children: /* @__PURE__ */ H(l, {
2089
2639
  gap: "md",
2090
- children: [/* @__PURE__ */ I("div", {
2640
+ children: [/* @__PURE__ */ H("div", {
2091
2641
  className: "min-w-0",
2092
- children: [/* @__PURE__ */ F(a, {
2642
+ children: [/* @__PURE__ */ V(i, {
2093
2643
  tag: "div",
2094
2644
  weight: "semibold",
2095
2645
  className: "truncate",
2096
- children: o
2097
- }), O.getSize(e) !== void 0 && /* @__PURE__ */ F(y, {
2098
- value: O.getSize(e),
2646
+ children: a
2647
+ }), D.getSize(e) !== void 0 && /* @__PURE__ */ V(w, {
2648
+ value: D.getSize(e),
2099
2649
  size: "xs",
2100
2650
  align: "left",
2101
- emptyLabel: D.unknownSize
2651
+ emptyLabel: E.unknownSize
2102
2652
  })]
2103
- }), ie && /* @__PURE__ */ I("div", {
2653
+ }), ae && /* @__PURE__ */ H("div", {
2104
2654
  className: "flex items-center gap-space-xs",
2105
2655
  children: [
2106
- re && /* @__PURE__ */ F(i, {
2656
+ A && /* @__PURE__ */ V(s, {
2107
2657
  type: "button",
2108
2658
  tone: "secondary",
2109
2659
  buttonStyle: "ghost",
2110
2660
  size: "sm",
2111
2661
  iconOnly: !0,
2112
2662
  disabled: p,
2113
- "aria-label": D.gallery.setPrimary,
2114
- onClick: () => u?.(n, e),
2115
- children: /* @__PURE__ */ F(ve, { className: "size-icon-md" })
2663
+ "aria-label": x(E.gallery.setPrimary),
2664
+ onClick: () => d?.(n, e),
2665
+ children: /* @__PURE__ */ V(Ae, { className: "size-icon-md" })
2116
2666
  }),
2117
- M && /* @__PURE__ */ F(i, {
2667
+ M && /* @__PURE__ */ V(s, {
2118
2668
  type: "button",
2119
2669
  tone: "secondary",
2120
2670
  buttonStyle: "ghost",
2121
2671
  size: "sm",
2122
2672
  iconOnly: !0,
2123
- disabled: !b,
2124
- "aria-label": D.gallery.movePrevious,
2673
+ disabled: !v,
2674
+ "aria-label": x(E.gallery.movePrevious),
2125
2675
  onClick: () => N(t, t - 1),
2126
- children: /* @__PURE__ */ F(L, { className: "size-icon-md" })
2676
+ children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
2127
2677
  }),
2128
- M && /* @__PURE__ */ F(i, {
2678
+ M && /* @__PURE__ */ V(s, {
2129
2679
  type: "button",
2130
2680
  tone: "secondary",
2131
2681
  buttonStyle: "ghost",
2132
2682
  size: "sm",
2133
2683
  iconOnly: !0,
2134
- disabled: !x,
2135
- "aria-label": D.gallery.moveNext,
2684
+ disabled: !y,
2685
+ "aria-label": x(E.gallery.moveNext),
2136
2686
  onClick: () => N(t, t + 1),
2137
- children: /* @__PURE__ */ F(ce, { className: "size-icon-md" })
2687
+ children: /* @__PURE__ */ V(_e, { className: "size-icon-md" })
2138
2688
  }),
2139
- j && /* @__PURE__ */ F(i, {
2689
+ j && /* @__PURE__ */ V(s, {
2140
2690
  type: "button",
2141
2691
  tone: "destructive",
2142
2692
  buttonStyle: "ghost",
2143
2693
  size: "sm",
2144
2694
  iconOnly: !0,
2145
2695
  className: "ml-auto",
2146
- "aria-label": D.gallery.remove,
2147
- onClick: () => d?.(n, e),
2148
- children: /* @__PURE__ */ F(ye, { className: "size-icon-md" })
2696
+ "aria-label": x(E.gallery.remove),
2697
+ onClick: () => f?.(n, e),
2698
+ children: /* @__PURE__ */ V(je, { className: "size-icon-md" })
2149
2699
  })
2150
2700
  ]
2151
2701
  })]
2152
2702
  })
2153
2703
  })]
2154
2704
  }, n);
2155
- }), R()]
2705
+ }), le()]
2156
2706
  })]
2157
2707
  });
2158
2708
  }
2159
2709
  //#endregion
2160
- export { Q as MediaLibrary, X as MediaLibraryCard, We as MediaLibraryDetailPanel, Xe as MediaLibraryDialog, Y as MediaLibraryEmptyState, Z as MediaLibraryFooter, Ue as MediaLibraryList, He as MediaLibraryToolbar, Ge as MediaLibraryUploadPanel, $ as MediaResourceGallery, Ce as defaultMediaLibraryStrings, Oe as formatMediaLibrarySize, H as formatMediaLibraryString, ke as getMediaLibraryDimensions, De as resolveMediaLibraryAccessors, Re as useMediaLibrary };
2710
+ export { Et as MediaLibrary, mt as MediaLibraryCard, vt as MediaLibraryDetailPanel, Q as MediaLibraryDialog, ft as MediaLibraryEmptyState, St as MediaLibraryFooter, ht as MediaLibraryList, pt as MediaLibraryToolbar, yt as MediaLibraryUploadPanel, Ot as MediaResourceGallery, U as defaultMediaLibraryStrings, qe as formatMediaLibrarySize, W as formatMediaLibraryString, Je as getMediaLibraryDimensions, Ke as resolveMediaLibraryAccessors, at as useMediaLibrary };
2161
2711
 
2162
2712
  //# sourceMappingURL=media-library.js.map