themelia-react-ui 2.0.3 → 2.0.5

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 (648) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/README.md +168 -36
  3. package/dist/{accordion-Cjb6sx0G.js → accordion-B9MHG0cT.js} +11 -11
  4. package/dist/accordion-B9MHG0cT.js.map +1 -0
  5. package/dist/action-menu-Dr8K-ghE.js +284 -0
  6. package/dist/action-menu-Dr8K-ghE.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-tF36bREk.js → affordance-geometry.generated-P-aVJisu.js} +42 -36
  8. package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
  9. package/dist/{ai-artifact-DvTwDVyL.js → ai-artifact-C58tQcBy.js} +387 -350
  10. package/dist/ai-artifact-C58tQcBy.js.map +1 -0
  11. package/dist/app-shell-B_IuNWOo.js +321 -0
  12. package/dist/app-shell-B_IuNWOo.js.map +1 -0
  13. package/dist/{attachment-BxDfL2mw.js → attachment-Dg_69lPS.js} +9 -9
  14. package/dist/{attachment-BxDfL2mw.js.map → attachment-Dg_69lPS.js.map} +1 -1
  15. package/dist/{auth-BGua8ouh.js → auth-DTkkshS8.js} +44 -47
  16. package/dist/auth-DTkkshS8.js.map +1 -0
  17. package/dist/{avatar-DAPlDvhJ.js → avatar-CeZaFmNH.js} +8 -8
  18. package/dist/avatar-CeZaFmNH.js.map +1 -0
  19. package/dist/{badge-HpFqoqSY.js → badge-xIiV_E7f.js} +5 -5
  20. package/dist/{badge-HpFqoqSY.js.map → badge-xIiV_E7f.js.map} +1 -1
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/batch-action-bar.js +1 -1
  27. package/dist/base/buttons.js +1 -1
  28. package/dist/base/cards.js +2 -2
  29. package/dist/base/carousel.js +3 -3
  30. package/dist/base/cascader.js +2 -372
  31. package/dist/base/chart.js +1 -1
  32. package/dist/base/choice-inputs.js +2 -2
  33. package/dist/base/code-block.js +1 -1
  34. package/dist/base/combobox.js +2 -2
  35. package/dist/base/command.js +1 -1
  36. package/dist/base/copyable.js +1 -1
  37. package/dist/base/date-pickers.js +2 -2
  38. package/dist/base/display.js +6 -6
  39. package/dist/base/feedback.js +3 -3
  40. package/dist/base/forms-numeric.js +1 -1
  41. package/dist/base/forms.js +3 -3
  42. package/dist/base/inline-edit.js +10 -10
  43. package/dist/base/item.js +1 -1
  44. package/dist/base/media-gallery.js +1 -1
  45. package/dist/base/metadata-list.js +1 -1
  46. package/dist/base/navigation.js +7 -7
  47. package/dist/base/popover-menu.js +1 -1
  48. package/dist/base/popover.js +1 -1
  49. package/dist/base/qr-code.js +1 -1
  50. package/dist/base/repeaters.js +12 -12
  51. package/dist/base/repeaters.js.map +1 -1
  52. package/dist/base/sheet.js +1 -1
  53. package/dist/base/sidebar.js +2 -2
  54. package/dist/base/signature-pad.js +7 -7
  55. package/dist/base/signature-pad.js.map +1 -1
  56. package/dist/base/skeleton.js +1 -1
  57. package/dist/base/spinner.js +4 -4
  58. package/dist/base/structure.js +1 -1
  59. package/dist/base/table.js +1 -1
  60. package/dist/base/text-inputs.js +2 -2
  61. package/dist/base/toaster.js +36 -36
  62. package/dist/base/toaster.js.map +1 -1
  63. package/dist/base/tree.js +1 -1
  64. package/dist/base/upload-queue.js +1 -1
  65. package/dist/base/upload.js +3 -3
  66. package/dist/base/value-inputs.js +1 -1
  67. package/dist/{batch-action-bar-DnUJ21NQ.js → batch-action-bar-Cb8cuvyy.js} +6 -6
  68. package/dist/batch-action-bar-Cb8cuvyy.js.map +1 -0
  69. package/dist/blocks/admin.js +23 -23
  70. package/dist/blocks/admin.js.map +1 -1
  71. package/dist/blocks/ai.js +230 -216
  72. package/dist/blocks/ai.js.map +1 -1
  73. package/dist/blocks/analytics/usage-card.js +1 -1
  74. package/dist/blocks/analytics.js +326 -307
  75. package/dist/blocks/analytics.js.map +1 -1
  76. package/dist/blocks/collaboration.js +1 -1
  77. package/dist/blocks/commerce/receipt.js +1 -1
  78. package/dist/blocks/commerce.js +1247 -1169
  79. package/dist/blocks/commerce.js.map +1 -1
  80. package/dist/blocks/data-display.js +2 -2
  81. package/dist/blocks/onboarding.js +6 -6
  82. package/dist/blocks/onboarding.js.map +1 -1
  83. package/dist/blocks/planning.js +11 -11
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-C-oqs1sQ.js → breadcrumbs-J-K2kl4c.js} +6 -6
  86. package/dist/{breadcrumbs-C-oqs1sQ.js.map → breadcrumbs-J-K2kl4c.js.map} +1 -1
  87. package/dist/{button-DVzspB_G.js → button-S2Cubiiz.js} +3 -3
  88. package/dist/button-S2Cubiiz.js.map +1 -0
  89. package/dist/{buttons-DPZekJFu.js → buttons-BedGfygC.js} +16 -16
  90. package/dist/buttons-BedGfygC.js.map +1 -0
  91. package/dist/cards-rNX1M4Xn.js +69 -0
  92. package/dist/cards-rNX1M4Xn.js.map +1 -0
  93. package/dist/cascader-B1MiqkBq.js +439 -0
  94. package/dist/cascader-B1MiqkBq.js.map +1 -0
  95. package/dist/chart-Darg_0Kv.js +162 -0
  96. package/dist/chart-Darg_0Kv.js.map +1 -0
  97. package/dist/{checkbox-AWIhNhmo.js → checkbox-fflqmODR.js} +9 -5
  98. package/dist/checkbox-fflqmODR.js.map +1 -0
  99. package/dist/choice-inputs-zUgBZfE4.js +777 -0
  100. package/dist/choice-inputs-zUgBZfE4.js.map +1 -0
  101. package/dist/{code-block-DeneBJR_.js → code-block-BzmM9Eig.js} +9 -9
  102. package/dist/code-block-BzmM9Eig.js.map +1 -0
  103. package/dist/{collapsible-C-_l4hpy.js → collapsible-BkAI_XD4.js} +5 -5
  104. package/dist/{collapsible-C-_l4hpy.js.map → collapsible-BkAI_XD4.js.map} +1 -1
  105. package/dist/{collection-content-By56pLog.js → collection-content-gDh1v6O4.js} +3 -3
  106. package/dist/{collection-content-By56pLog.js.map → collection-content-gDh1v6O4.js.map} +1 -1
  107. package/dist/combobox-BEx0vJgF.js +362 -0
  108. package/dist/combobox-BEx0vJgF.js.map +1 -0
  109. package/dist/{combobox-Dxo2fAYQ.js → combobox-BwzoXFSG.js} +254 -247
  110. package/dist/combobox-BwzoXFSG.js.map +1 -0
  111. package/dist/{command-C25VMRII.js → command-CrlPIL6m.js} +12 -12
  112. package/dist/command-CrlPIL6m.js.map +1 -0
  113. package/dist/{comments-DD0DUPwJ.js → comments-Dmpp0YIc.js} +380 -379
  114. package/dist/comments-Dmpp0YIc.js.map +1 -0
  115. package/dist/components/base/action-menu/action-menu.d.ts +9 -1
  116. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  117. package/dist/components/base/cards/card.recipes.d.ts +16 -7
  118. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
  119. package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
  120. package/dist/components/base/cards/smart-card.types.d.ts +11 -7
  121. package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
  122. package/dist/components/base/chart/chart.d.ts +6 -1
  123. package/dist/components/base/choice-inputs/checkbox.d.ts +7 -2
  124. package/dist/components/base/choice-inputs/choice-types.d.ts +1 -1
  125. package/dist/components/base/choice-inputs/switch-card.d.ts +7 -0
  126. package/dist/components/base/choice-inputs/toggle-field.d.ts +7 -0
  127. package/dist/components/base/combobox/index.d.ts +4 -2
  128. package/dist/components/base/date-pickers/datepicker.types.d.ts +7 -0
  129. package/dist/components/base/feedback/alert.d.ts +1 -1
  130. package/dist/components/base/forms/controlled-form-field.d.ts +6 -6
  131. package/dist/components/base/forms/form-field.d.ts +5 -3
  132. package/dist/components/base/forms/form-sizing.d.ts +7 -7
  133. package/dist/components/base/forms/index.d.ts +1 -0
  134. package/dist/components/base/forms/server-errors.d.ts +16 -0
  135. package/dist/components/base/forms/workflow.d.ts +11 -2
  136. package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -0
  137. package/dist/components/base/metadata-list/metadata-list.d.ts +3 -1
  138. package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
  139. package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
  140. package/dist/components/base/navigation/page-header/page-header.d.ts +13 -4
  141. package/dist/components/base/popover/popover.d.ts +3 -3
  142. package/dist/components/base/popover/popover.recipes.d.ts +10 -6
  143. package/dist/components/base/sheet/sheet.d.ts +2 -0
  144. package/dist/components/base/sidebar/index.d.ts +1 -1
  145. package/dist/components/base/sidebar/sidebar.d.ts +27 -5
  146. package/dist/components/base/structure/composition.recipes.d.ts +17 -0
  147. package/dist/components/base/text-inputs/hooks/use-form-field-state.d.ts +7 -2
  148. package/dist/components/base/text-inputs/input.d.ts +4 -2
  149. package/dist/components/base/text-inputs/textarea.d.ts +4 -2
  150. package/dist/components/base/toaster/index.d.ts +1 -0
  151. package/dist/components/base/value-inputs/date-time-input.d.ts +2 -1
  152. package/dist/components/base/value-inputs/slider.d.ts +5 -1
  153. package/dist/components/base/value-inputs/tags-input.d.ts +5 -1
  154. package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
  155. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +3 -1
  156. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  157. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
  158. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  159. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
  160. package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
  161. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
  162. package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
  163. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  164. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
  165. package/dist/components/blocks/commerce/index.d.ts +7 -6
  166. package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
  167. package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
  168. package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
  169. package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
  170. package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
  171. package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
  172. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
  173. package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
  174. package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
  175. package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
  176. package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
  177. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
  178. package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
  179. package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
  180. package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
  181. package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
  182. package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
  183. package/dist/components/features/activities/activities.types.d.ts +8 -2
  184. package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
  185. package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
  186. package/dist/components/features/event-calendar/colors.d.ts +2 -2
  187. package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
  188. package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
  189. package/dist/components/features/filters/filters.strings.d.ts +4 -0
  190. package/dist/components/features/filters/filters.types.d.ts +3 -0
  191. package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
  192. package/dist/components/features/filters/partials/filter-popover-content.d.ts +1 -1
  193. package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
  194. package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
  195. package/dist/components/features/filters/utils/filter-utils.d.ts +21 -3
  196. package/dist/components/features/global-search/global-search.types.d.ts +2 -0
  197. package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
  198. package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
  199. package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
  200. package/dist/components/features/media-library/media-library.types.d.ts +14 -4
  201. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  202. package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
  203. package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
  204. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  205. package/dist/components/features/products/products.strings.d.ts +9 -1
  206. package/dist/components/features/products/products.types.d.ts +43 -6
  207. package/dist/components/features/resource/resource.d.ts +5 -1
  208. package/dist/components/features/resource/resource.types.d.ts +12 -1
  209. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
  210. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
  211. package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
  212. package/dist/components/features/table/table.types.d.ts +1 -1
  213. package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
  214. package/dist/components/layout/app-shell/index.d.ts +1 -1
  215. package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
  216. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  217. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  218. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  219. package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
  220. package/dist/components/layout/header/header.recipes.d.ts +6 -0
  221. package/dist/components/layout/header/header.types.d.ts +6 -6
  222. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
  223. package/dist/components/layout/page/index.d.ts +2 -1
  224. package/dist/components/layout/page/page.d.ts +1 -0
  225. package/dist/components/layout/page/page.strings.d.ts +11 -0
  226. package/dist/components/layout/page/page.types.d.ts +69 -17
  227. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  228. package/dist/components/layout/settings/settings.d.ts +9 -2
  229. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  230. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  231. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  232. package/dist/components/layout/sidebar/index.d.ts +2 -1
  233. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +36 -0
  234. package/dist/components/layout/sidebar/sidebar.context.d.ts +5 -7
  235. package/dist/components/layout/sidebar/sidebar.types.d.ts +48 -10
  236. package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
  237. package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
  238. package/dist/components/typography/text.styles.d.ts +26 -1
  239. package/dist/components/ui/alert-dialog.d.ts +2 -2
  240. package/dist/components/ui/combobox.d.ts +1 -1
  241. package/dist/components/ui/dialog.d.ts +2 -2
  242. package/dist/components/ui/overlay-layer.d.ts +18 -0
  243. package/dist/components/ui/sheet.d.ts +5 -1
  244. package/dist/components/ui/sidebar-state.d.ts +82 -0
  245. package/dist/components/ui/sidebar.d.ts +5 -17
  246. package/dist/composition.recipes-COdiFhxB.js +19 -0
  247. package/dist/composition.recipes-COdiFhxB.js.map +1 -0
  248. package/dist/containers-CIxwbZt5.js +112 -0
  249. package/dist/containers-CIxwbZt5.js.map +1 -0
  250. package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
  251. package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
  252. package/dist/{copyable-ClBuk_UK.js → copyable-DIznBqiT.js} +7 -7
  253. package/dist/{copyable-ClBuk_UK.js.map → copyable-DIznBqiT.js.map} +1 -1
  254. package/dist/{data-display-DT_khPl_.js → data-display-BdgCAw8T.js} +277 -285
  255. package/dist/data-display-BdgCAw8T.js.map +1 -0
  256. package/dist/{date-DCrsDTZc.js → date-Cq8ioE4o.js} +5 -5
  257. package/dist/{date-DCrsDTZc.js.map → date-Cq8ioE4o.js.map} +1 -1
  258. package/dist/{date-picker-B2K3ucWn.js → date-picker-RlIzKom_.js} +501 -480
  259. package/dist/date-picker-RlIzKom_.js.map +1 -0
  260. package/dist/date-pickers-DY-CpXS1.js +179 -0
  261. package/dist/date-pickers-DY-CpXS1.js.map +1 -0
  262. package/dist/{display-hAc1HjpI.js → display-KsZLw9Ov.js} +9 -9
  263. package/dist/{display-hAc1HjpI.js.map → display-KsZLw9Ov.js.map} +1 -1
  264. package/dist/dropdown-menu-CLs8Lihj.js +194 -0
  265. package/dist/dropdown-menu-CLs8Lihj.js.map +1 -0
  266. package/dist/features/activities.js +302 -253
  267. package/dist/features/activities.js.map +1 -1
  268. package/dist/features/ai-chat.js +15 -14
  269. package/dist/features/ai-chat.js.map +1 -1
  270. package/dist/features/appointment-calendar.js +222 -220
  271. package/dist/features/appointment-calendar.js.map +1 -1
  272. package/dist/features/async-preview.js +11 -10
  273. package/dist/features/async-preview.js.map +1 -1
  274. package/dist/features/combobox.js +1 -1
  275. package/dist/features/comments.js +1 -1
  276. package/dist/features/data-view.js +13 -13
  277. package/dist/features/data-view.js.map +1 -1
  278. package/dist/features/email-composer.js +249 -249
  279. package/dist/features/email-composer.js.map +1 -1
  280. package/dist/features/event-calendar.js +264 -269
  281. package/dist/features/event-calendar.js.map +1 -1
  282. package/dist/features/filters.js +1 -1
  283. package/dist/features/global-search.js +167 -138
  284. package/dist/features/global-search.js.map +1 -1
  285. package/dist/features/kanban.js +6 -7
  286. package/dist/features/kanban.js.map +1 -1
  287. package/dist/features/map.js +269 -260
  288. package/dist/features/map.js.map +1 -1
  289. package/dist/features/media-library.js +827 -777
  290. package/dist/features/media-library.js.map +1 -1
  291. package/dist/features/mentions.js +1 -1
  292. package/dist/features/overlays.js +1 -1
  293. package/dist/features/products.js +1246 -1169
  294. package/dist/features/products.js.map +1 -1
  295. package/dist/features/questionnaire.js +13 -13
  296. package/dist/features/questionnaire.js.map +1 -1
  297. package/dist/features/resource-assignment.js +8 -8
  298. package/dist/features/resource.js +127 -123
  299. package/dist/features/resource.js.map +1 -1
  300. package/dist/features/rich-text-editor.js +2 -2
  301. package/dist/features/schema-form.js +254 -253
  302. package/dist/features/schema-form.js.map +1 -1
  303. package/dist/features/suggestions.js +3 -3
  304. package/dist/features/sync.js +3 -3
  305. package/dist/features/table.js +1 -1
  306. package/dist/features/theme-tweaker.js +95 -96
  307. package/dist/features/theme-tweaker.js.map +1 -1
  308. package/dist/{feedback-BYIhtitP.js → feedback-Dm4izqFn.js} +81 -80
  309. package/dist/feedback-Dm4izqFn.js.map +1 -0
  310. package/dist/{field-affordance-recipes-DZhnIL_Y.js → field-affordance-recipes-DWcNcOjh.js} +4 -4
  311. package/dist/field-affordance-recipes-DWcNcOjh.js.map +1 -0
  312. package/dist/{filters-DJVAveHA.js → filters-DzgSJpMK.js} +693 -645
  313. package/dist/filters-DzgSJpMK.js.map +1 -0
  314. package/dist/{form-field-CwH9y77i.js → form-field-BriWAXyg.js} +14 -8
  315. package/dist/form-field-BriWAXyg.js.map +1 -0
  316. package/dist/{form-sizing-BdP_Mf5p.js → form-sizing-Bs2qFUeE.js} +4 -4
  317. package/dist/form-sizing-Bs2qFUeE.js.map +1 -0
  318. package/dist/forms-C0RGnJTe.js +216 -0
  319. package/dist/forms-C0RGnJTe.js.map +1 -0
  320. package/dist/{forms-numeric-B_jraJaQ.js → forms-numeric-DIhghX1Q.js} +295 -291
  321. package/dist/forms-numeric-DIhghX1Q.js.map +1 -0
  322. package/dist/{header-BSfIEWbI.js → header-DMMxG__r.js} +67 -63
  323. package/dist/header-DMMxG__r.js.map +1 -0
  324. package/dist/header.recipes-BigdJjw1.js +6 -0
  325. package/dist/header.recipes-BigdJjw1.js.map +1 -0
  326. package/dist/hooks/useFormErrors.d.ts +1 -1
  327. package/dist/{hooks-ClH9thn4.js → hooks-DB6CJ4MR.js} +26 -14
  328. package/dist/hooks-DB6CJ4MR.js.map +1 -0
  329. package/dist/{icon-badge-DYKIwvOV.js → icon-badge-DZF-YjQp.js} +4 -4
  330. package/dist/{icon-badge-DYKIwvOV.js.map → icon-badge-DZF-YjQp.js.map} +1 -1
  331. package/dist/index.js +4 -5
  332. package/dist/input-CvyDQlY7.js +289 -0
  333. package/dist/input-CvyDQlY7.js.map +1 -0
  334. package/dist/input-DMBwAZmr.js +21 -0
  335. package/dist/input-DMBwAZmr.js.map +1 -0
  336. package/dist/item-DjCcM18E.js +277 -0
  337. package/dist/item-DjCcM18E.js.map +1 -0
  338. package/dist/layout/app-shell.js +1 -1
  339. package/dist/layout/auth.js +1 -1
  340. package/dist/layout/containers.js +1 -1
  341. package/dist/layout/header.js +1 -1
  342. package/dist/layout/hooks.js +1 -1
  343. package/dist/layout/navigation.js +1 -1
  344. package/dist/layout/page.js +2 -2
  345. package/dist/layout/settings.js +1 -1
  346. package/dist/layout/sidebar.js +3 -3
  347. package/dist/layout/workspace.js +1 -1
  348. package/dist/layout.js +11 -11
  349. package/dist/lib/affordance-geometry.generated.d.ts +41 -35
  350. package/dist/lib/control-group-recipes.d.ts +5 -5
  351. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  352. package/dist/lib/motion-recipes.d.ts +3 -0
  353. package/dist/lib/navigation-row-recipes.d.ts +7 -7
  354. package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
  355. package/dist/lib/portal-recipes.d.ts +3 -0
  356. package/dist/lib/token-merge.generated.d.ts +13 -10
  357. package/dist/lib/ui-provider/types.d.ts +1 -1
  358. package/dist/lib/utils.js +1 -1
  359. package/dist/map-demo-tile.svg +1 -1
  360. package/dist/{media-gallery-3zIVLMWH.js → media-gallery-C-vChPmE.js} +6 -6
  361. package/dist/{media-gallery-3zIVLMWH.js.map → media-gallery-C-vChPmE.js.map} +1 -1
  362. package/dist/{mentions-CGlEJ15c.js → mentions-0_4nWuI-.js} +10 -10
  363. package/dist/{mentions-CGlEJ15c.js.map → mentions-0_4nWuI-.js.map} +1 -1
  364. package/dist/{message-DZ_ruyUV.js → message-g8p7eVtN.js} +7 -7
  365. package/dist/message-g8p7eVtN.js.map +1 -0
  366. package/dist/metadata-list-C3MkU-Om.js +443 -0
  367. package/dist/metadata-list-C3MkU-Om.js.map +1 -0
  368. package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
  369. package/dist/motion-recipes-DitYv6P2.js.map +1 -0
  370. package/dist/navigation-C90-oQFq.js +255 -0
  371. package/dist/navigation-C90-oQFq.js.map +1 -0
  372. package/dist/{navigation-BzhHI3lo.js → navigation-DaRjthVk.js} +101 -82
  373. package/dist/navigation-DaRjthVk.js.map +1 -0
  374. package/dist/{navigation-row-recipes-BFLCk_Aq.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
  375. package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
  376. package/dist/{number-DbV1Dija.js → number-CRU3kGuk.js} +5 -5
  377. package/dist/{number-DbV1Dija.js.map → number-CRU3kGuk.js.map} +1 -1
  378. package/dist/overflow-tab-bar-IVFVQFV6.js +172 -0
  379. package/dist/overflow-tab-bar-IVFVQFV6.js.map +1 -0
  380. package/dist/overlays-BSgCtM2v.js +1013 -0
  381. package/dist/overlays-BSgCtM2v.js.map +1 -0
  382. package/dist/page-DUUKDAjo.js +331 -0
  383. package/dist/page-DUUKDAjo.js.map +1 -0
  384. package/dist/page-header-commands-7P3sfE9u.js +193 -0
  385. package/dist/page-header-commands-7P3sfE9u.js.map +1 -0
  386. package/dist/{pagination-BL25hu2s.js → pagination-CgCjElfu.js} +7 -7
  387. package/dist/{pagination-BL25hu2s.js.map → pagination-CgCjElfu.js.map} +1 -1
  388. package/dist/popover-B85RenIl.js +201 -0
  389. package/dist/popover-B85RenIl.js.map +1 -0
  390. package/dist/{popover-menu-Cn9rUkdc.js → popover-menu-DlnQ2zlR.js} +7 -7
  391. package/dist/{popover-menu-Cn9rUkdc.js.map → popover-menu-DlnQ2zlR.js.map} +1 -1
  392. package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DdiEp0rd.js} +18 -11
  393. package/dist/popover.recipes-DdiEp0rd.js.map +1 -0
  394. package/dist/portal-recipes-BpsV_iRw.js +9 -0
  395. package/dist/portal-recipes-BpsV_iRw.js.map +1 -0
  396. package/dist/{primitives-BFK08r9M.js → primitives-ByWgGUgt.js} +6 -6
  397. package/dist/{primitives-BFK08r9M.js.map → primitives-ByWgGUgt.js.map} +1 -1
  398. package/dist/primitives.js +4 -4
  399. package/dist/{progress-B1VnCT0K.js → progress-BJhQP9WX.js} +9 -9
  400. package/dist/{progress-B1VnCT0K.js.map → progress-BJhQP9WX.js.map} +1 -1
  401. package/dist/{receipt-BVSOH3Xo.js → receipt-tOc7B3hw.js} +7 -7
  402. package/dist/receipt-tOc7B3hw.js.map +1 -0
  403. package/dist/{rich-text-GOUyKQ-s.js → rich-text-Dth5E882.js} +4 -4
  404. package/dist/{rich-text-GOUyKQ-s.js.map → rich-text-Dth5E882.js.map} +1 -1
  405. package/dist/{rich-text-editor-cRLC-eBK.js → rich-text-editor-C1fOjBTd.js} +429 -430
  406. package/dist/rich-text-editor-C1fOjBTd.js.map +1 -0
  407. package/dist/{rich-text-editor-toolbar-DfXg0-VC.js → rich-text-editor-toolbar-laT3tpBT.js} +33 -29
  408. package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +1 -0
  409. package/dist/{scroll-area-DcI-M1UT.js → scroll-area-B0dB2cBi.js} +2 -2
  410. package/dist/{scroll-area-DcI-M1UT.js.map → scroll-area-B0dB2cBi.js.map} +1 -1
  411. package/dist/{separator-Bom7NsGO.js → separator-Bb17I4pu.js} +2 -2
  412. package/dist/{separator-Bom7NsGO.js.map → separator-Bb17I4pu.js.map} +1 -1
  413. package/dist/{separator-BDV-Y648.js → separator-Ct_WSWTJ.js} +3 -3
  414. package/dist/{separator-BDV-Y648.js.map → separator-Ct_WSWTJ.js.map} +1 -1
  415. package/dist/services/actions.js +1 -1
  416. package/dist/settings-Bar5wiSo.js +167 -0
  417. package/dist/settings-Bar5wiSo.js.map +1 -0
  418. package/dist/sheet-BGPERY55.js +250 -0
  419. package/dist/sheet-BGPERY55.js.map +1 -0
  420. package/dist/sidebar-D-JYMMbY.js +686 -0
  421. package/dist/sidebar-D-JYMMbY.js.map +1 -0
  422. package/dist/sidebar-f9gRWXIR.js +1001 -0
  423. package/dist/sidebar-f9gRWXIR.js.map +1 -0
  424. package/dist/skeleton-BapcJd9C.js +265 -0
  425. package/dist/skeleton-BapcJd9C.js.map +1 -0
  426. package/dist/smart-card-CW0hjetE.js +617 -0
  427. package/dist/smart-card-CW0hjetE.js.map +1 -0
  428. package/dist/{structure-BmisBK-3.js → structure-DuxKl954.js} +3 -3
  429. package/dist/{structure-BmisBK-3.js.map → structure-DuxKl954.js.map} +1 -1
  430. package/dist/{structure.recipes-EPz60cU8.js → structure.recipes-BB4-n58V.js} +2 -2
  431. package/dist/{structure.recipes-EPz60cU8.js.map → structure.recipes-BB4-n58V.js.map} +1 -1
  432. package/dist/style.css +1 -1
  433. package/dist/{table-DsfzoUia.js → table-B4TE7iOV.js} +3 -3
  434. package/dist/{table-DsfzoUia.js.map → table-B4TE7iOV.js.map} +1 -1
  435. package/dist/{table-BweFy_P9.js → table-CFOWY9pQ.js} +394 -388
  436. package/dist/table-CFOWY9pQ.js.map +1 -0
  437. package/dist/{tabs-CDocW5D1.js → tabs-e7ko9S2o.js} +11 -11
  438. package/dist/tabs-e7ko9S2o.js.map +1 -0
  439. package/dist/{text-inputs-f9Ia-aCi.js → text-inputs-B1culiSK.js} +107 -104
  440. package/dist/text-inputs-B1culiSK.js.map +1 -0
  441. package/dist/{text.styles-g4He6UIW.js → text.styles-B64My8RZ.js} +25 -10
  442. package/dist/text.styles-B64My8RZ.js.map +1 -0
  443. package/dist/theme.css +192 -149
  444. package/dist/{timelines-CwM_9IhD.js → timelines-D3Sl9ueq.js} +13 -12
  445. package/dist/timelines-D3Sl9ueq.js.map +1 -0
  446. package/dist/tooltip-8wz5S_Zr.js +113 -0
  447. package/dist/tooltip-8wz5S_Zr.js.map +1 -0
  448. package/dist/{tree-WnKQzwbq.js → tree-CzUJHnFs.js} +9 -9
  449. package/dist/{tree-WnKQzwbq.js.map → tree-CzUJHnFs.js.map} +1 -1
  450. package/dist/typography/rich-text.js +1 -1
  451. package/dist/typography-BQnine1k.js +117 -0
  452. package/dist/typography-BQnine1k.js.map +1 -0
  453. package/dist/typography.js +1 -1
  454. package/dist/ui-provider-C-74NVLc.js +178 -0
  455. package/dist/ui-provider-C-74NVLc.js.map +1 -0
  456. package/dist/ui-provider.js +2 -3
  457. package/dist/{upload-CXyxmQBP.js → upload-BOW6U2tI.js} +25 -24
  458. package/dist/upload-BOW6U2tI.js.map +1 -0
  459. package/dist/{upload-queue-Boscubn9.js → upload-queue-qUXn1ykN.js} +16 -14
  460. package/dist/upload-queue-qUXn1ykN.js.map +1 -0
  461. package/dist/{usage-card-BhO5eqkX.js → usage-card-BeSLY0i0.js} +145 -137
  462. package/dist/usage-card-BeSLY0i0.js.map +1 -0
  463. package/dist/{utils-BRhFDwuU.js → utils-B6kKb8jB.js} +303 -144
  464. package/dist/utils-B6kKb8jB.js.map +1 -0
  465. package/dist/value-inputs-skdVB2zh.js +980 -0
  466. package/dist/value-inputs-skdVB2zh.js.map +1 -0
  467. package/dist/{value-typography-BP8OG6h5.js → value-typography-uAmWUAL1.js} +2 -2
  468. package/dist/{value-typography-BP8OG6h5.js.map → value-typography-uAmWUAL1.js.map} +1 -1
  469. package/dist/workspace-DHeHv0qw.js +411 -0
  470. package/dist/workspace-DHeHv0qw.js.map +1 -0
  471. package/docs/consumer-skill/SKILL.md +15 -129
  472. package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
  473. package/docs/consumer-skill/examples/app-layout.tsx +74 -13
  474. package/docs/consumer-skill/examples/authentication.tsx +77 -0
  475. package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
  476. package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
  477. package/docs/consumer-skill/examples/detail.tsx +5 -4
  478. package/docs/consumer-skill/examples/edit.tsx +30 -38
  479. package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
  480. package/docs/consumer-skill/examples/index-table.tsx +4 -4
  481. package/docs/consumer-skill/examples/manifest.json +88 -1
  482. package/docs/consumer-skill/examples/product-media.tsx +41 -0
  483. package/docs/consumer-skill/examples/product-parts.tsx +81 -0
  484. package/docs/consumer-skill/examples/rhf-bindings.tsx +86 -0
  485. package/docs/consumer-skill/examples/rhf-edit-page.tsx +141 -0
  486. package/docs/consumer-skill/examples/rhf-overlay-form.tsx +105 -0
  487. package/docs/consumer-skill/examples/rhf-transport.tsx +28 -0
  488. package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
  489. package/docs/consumer-skill/references/agents-md.md +23 -11
  490. package/docs/consumer-skill/references/analytics.md +18 -1
  491. package/docs/consumer-skill/references/authentication.md +42 -0
  492. package/docs/consumer-skill/references/commerce-composition.md +97 -0
  493. package/docs/consumer-skill/references/component-contracts.json +325201 -0
  494. package/docs/consumer-skill/references/composition-mapping.md +106 -0
  495. package/docs/consumer-skill/references/composition.md +198 -46
  496. package/docs/consumer-skill/references/critique-rubric.md +98 -0
  497. package/docs/consumer-skill/references/custom-composition.md +261 -0
  498. package/docs/consumer-skill/references/data-reading.md +79 -0
  499. package/docs/consumer-skill/references/design-contract.md +43 -9
  500. package/docs/consumer-skill/references/discovery.md +109 -8
  501. package/docs/consumer-skill/references/domain-structures.md +124 -0
  502. package/docs/consumer-skill/references/installation.md +51 -36
  503. package/docs/consumer-skill/references/integration.md +41 -2
  504. package/docs/consumer-skill/references/product-composition.md +94 -0
  505. package/docs/consumer-skill/references/public-api.json +4390 -475
  506. package/docs/consumer-skill/references/review.md +47 -5
  507. package/docs/consumer-skill/references/rhf-workflows.md +93 -0
  508. package/docs/consumer-skill/references/screen-archetypes.md +34 -0
  509. package/docs/consumer-skill/references/screen-decisions.md +126 -0
  510. package/docs/consumer-skill/references/theming.md +25 -27
  511. package/docs/consumer-skill/references/tokens.json +20 -11
  512. package/docs/consumer-skill/references/view-craft.md +153 -0
  513. package/docs/consumer-skill/references/view-spec.md +73 -0
  514. package/docs/consumer-skill/references/workflows.md +9 -2
  515. package/docs/consumer-skill/scripts/composition-policy.mjs +39 -3
  516. package/docs/consumer-skill/scripts/composition-schema.d.mts +2 -0
  517. package/docs/consumer-skill/scripts/composition-schema.mjs +32 -0
  518. package/docs/consumer-skill/scripts/composition.mjs +254 -0
  519. package/docs/consumer-skill/scripts/discovery.mjs +96 -10
  520. package/docs/consumer-skill/scripts/inspect-component.mjs +11 -0
  521. package/docs/consumer-skill/scripts/inspect-tokens.mjs +11 -0
  522. package/docs/consumer-skill/scripts/inspection.mjs +193 -0
  523. package/docs/consumer-skill/scripts/map-composition.mjs +12 -0
  524. package/docs/consumer-skill/scripts/setup-skills.mjs +111 -0
  525. package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
  526. package/docs/consumer-skills/themelia-components/SKILL.md +31 -0
  527. package/docs/consumer-skills/themelia-composition/SKILL.md +34 -0
  528. package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
  529. package/docs/consumer-skills/themelia-forms/SKILL.md +12 -0
  530. package/docs/consumer-skills/themelia-foundation/SKILL.md +15 -0
  531. package/docs/consumer-skills/themelia-tokenization/SKILL.md +42 -0
  532. package/package.json +4 -2
  533. package/templates/README.md +39 -0
  534. package/templates/admin-shell-template.tsx +382 -0
  535. package/templates/analytics-operations-template.tsx +376 -0
  536. package/templates/customers-template.tsx +509 -0
  537. package/templates/index.ts +29 -0
  538. package/templates/orders-template.tsx +1102 -0
  539. package/templates/products-template.tsx +834 -0
  540. package/templates/user-permissions-template.tsx +450 -0
  541. package/dist/accordion-Cjb6sx0G.js.map +0 -1
  542. package/dist/action-menu-CllU52Mm.js +0 -280
  543. package/dist/action-menu-CllU52Mm.js.map +0 -1
  544. package/dist/affordance-geometry.generated-tF36bREk.js.map +0 -1
  545. package/dist/ai-artifact-DvTwDVyL.js.map +0 -1
  546. package/dist/app-shell-C4FhvCqF.js +0 -236
  547. package/dist/app-shell-C4FhvCqF.js.map +0 -1
  548. package/dist/auth-BGua8ouh.js.map +0 -1
  549. package/dist/avatar-DAPlDvhJ.js.map +0 -1
  550. package/dist/base/cascader.js.map +0 -1
  551. package/dist/batch-action-bar-DnUJ21NQ.js.map +0 -1
  552. package/dist/button-DVzspB_G.js.map +0 -1
  553. package/dist/buttons-DPZekJFu.js.map +0 -1
  554. package/dist/cards-BaBZR-AU.js +0 -68
  555. package/dist/cards-BaBZR-AU.js.map +0 -1
  556. package/dist/chart-ZOYyK2xG.js +0 -155
  557. package/dist/chart-ZOYyK2xG.js.map +0 -1
  558. package/dist/checkbox-AWIhNhmo.js.map +0 -1
  559. package/dist/choice-inputs-CNHvARCJ.js +0 -770
  560. package/dist/choice-inputs-CNHvARCJ.js.map +0 -1
  561. package/dist/code-block-DeneBJR_.js.map +0 -1
  562. package/dist/combobox-DaHESuiL.js +0 -355
  563. package/dist/combobox-DaHESuiL.js.map +0 -1
  564. package/dist/combobox-Dxo2fAYQ.js.map +0 -1
  565. package/dist/command-C25VMRII.js.map +0 -1
  566. package/dist/comments-DD0DUPwJ.js.map +0 -1
  567. package/dist/containers-Mu1LMGV1.js +0 -103
  568. package/dist/containers-Mu1LMGV1.js.map +0 -1
  569. package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
  570. package/dist/data-display-DT_khPl_.js.map +0 -1
  571. package/dist/date-picker-B2K3ucWn.js.map +0 -1
  572. package/dist/date-pickers-Ds8gLaoP.js +0 -175
  573. package/dist/date-pickers-Ds8gLaoP.js.map +0 -1
  574. package/dist/dropdown-menu-Cl4X7L5S.js +0 -193
  575. package/dist/dropdown-menu-Cl4X7L5S.js.map +0 -1
  576. package/dist/feedback-BYIhtitP.js.map +0 -1
  577. package/dist/field-affordance-recipes-DZhnIL_Y.js.map +0 -1
  578. package/dist/filters-DJVAveHA.js.map +0 -1
  579. package/dist/form-field-CwH9y77i.js.map +0 -1
  580. package/dist/form-sizing-BdP_Mf5p.js.map +0 -1
  581. package/dist/forms-B9G_xwzi.js +0 -194
  582. package/dist/forms-B9G_xwzi.js.map +0 -1
  583. package/dist/forms-numeric-B_jraJaQ.js.map +0 -1
  584. package/dist/header-BSfIEWbI.js.map +0 -1
  585. package/dist/hooks-ClH9thn4.js.map +0 -1
  586. package/dist/input-CZw8iU99.js +0 -21
  587. package/dist/input-CZw8iU99.js.map +0 -1
  588. package/dist/input-DQdEd0YD.js +0 -263
  589. package/dist/input-DQdEd0YD.js.map +0 -1
  590. package/dist/item-K5_ghvze.js +0 -275
  591. package/dist/item-K5_ghvze.js.map +0 -1
  592. package/dist/message-DZ_ruyUV.js.map +0 -1
  593. package/dist/metadata-list-8N16ZMW_.js +0 -405
  594. package/dist/metadata-list-8N16ZMW_.js.map +0 -1
  595. package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
  596. package/dist/navigation-Bnotn4AQ.js +0 -145
  597. package/dist/navigation-Bnotn4AQ.js.map +0 -1
  598. package/dist/navigation-BzhHI3lo.js.map +0 -1
  599. package/dist/navigation-row-recipes-BFLCk_Aq.js.map +0 -1
  600. package/dist/overflow-tab-bar-CWY7Nogn.js +0 -282
  601. package/dist/overflow-tab-bar-CWY7Nogn.js.map +0 -1
  602. package/dist/overlays-tMkF-VAN.js +0 -1003
  603. package/dist/overlays-tMkF-VAN.js.map +0 -1
  604. package/dist/page-CL9YeH_V.js +0 -224
  605. package/dist/page-CL9YeH_V.js.map +0 -1
  606. package/dist/page-header-commands-DOb6WsfD.js +0 -126
  607. package/dist/page-header-commands-DOb6WsfD.js.map +0 -1
  608. package/dist/popover-gnTOhbFM.js +0 -198
  609. package/dist/popover-gnTOhbFM.js.map +0 -1
  610. package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
  611. package/dist/receipt-BVSOH3Xo.js.map +0 -1
  612. package/dist/rich-text-editor-cRLC-eBK.js.map +0 -1
  613. package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +0 -1
  614. package/dist/settings-ybnjVwbd.js +0 -171
  615. package/dist/settings-ybnjVwbd.js.map +0 -1
  616. package/dist/sheet-ijlsjq-n.js +0 -213
  617. package/dist/sheet-ijlsjq-n.js.map +0 -1
  618. package/dist/sidebar-Db6gkh3U.js +0 -619
  619. package/dist/sidebar-Db6gkh3U.js.map +0 -1
  620. package/dist/sidebar-DkTO4VTO.js +0 -512
  621. package/dist/sidebar-DkTO4VTO.js.map +0 -1
  622. package/dist/skeleton-Byjnt7qr.js +0 -264
  623. package/dist/skeleton-Byjnt7qr.js.map +0 -1
  624. package/dist/smart-card-DiC5aac3.js +0 -604
  625. package/dist/smart-card-DiC5aac3.js.map +0 -1
  626. package/dist/table-BweFy_P9.js.map +0 -1
  627. package/dist/tabs-CDocW5D1.js.map +0 -1
  628. package/dist/text-inputs-f9Ia-aCi.js.map +0 -1
  629. package/dist/text.styles-g4He6UIW.js.map +0 -1
  630. package/dist/theme-scope-BJ6eE2xt.js +0 -50
  631. package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
  632. package/dist/timelines-CwM_9IhD.js.map +0 -1
  633. package/dist/tooltip-yiRJUFjp.js +0 -111
  634. package/dist/tooltip-yiRJUFjp.js.map +0 -1
  635. package/dist/typography-UTnveOEy.js +0 -117
  636. package/dist/typography-UTnveOEy.js.map +0 -1
  637. package/dist/ui-provider-C_U0Xma4.js +0 -136
  638. package/dist/ui-provider-C_U0Xma4.js.map +0 -1
  639. package/dist/upload-CXyxmQBP.js.map +0 -1
  640. package/dist/upload-queue-Boscubn9.js.map +0 -1
  641. package/dist/usage-card-BhO5eqkX.js.map +0 -1
  642. package/dist/use-mobile-vaLKwgyf.js +0 -15
  643. package/dist/use-mobile-vaLKwgyf.js.map +0 -1
  644. package/dist/utils-BRhFDwuU.js.map +0 -1
  645. package/dist/value-inputs-TaX4OjNk.js +0 -963
  646. package/dist/value-inputs-TaX4OjNk.js.map +0 -1
  647. package/dist/workspace-B-OEm3Kf.js +0 -408
  648. package/dist/workspace-B-OEm3Kf.js.map +0 -1
@@ -1,39 +1,40 @@
1
1
  "use client";
2
- import { s as e, v as t } from "../ui-provider-C_U0Xma4.js";
2
+ import { S as e, d as t } from "../ui-provider-C-74NVLc.js";
3
3
  import { interpolateString as n, useStrings as r } from "../lib/strings.js";
4
- import { t as i } from "../utils-BRhFDwuU.js";
5
- import { n as a } from "../buttons-DPZekJFu.js";
6
- import { c as o, o as s } from "../typography-UTnveOEy.js";
4
+ import { t as i } from "../utils-B6kKb8jB.js";
5
+ import { n as a } from "../buttons-BedGfygC.js";
6
+ import { c as o, o as s } from "../typography-BQnine1k.js";
7
7
  import { t as c } from "../focus-recipes-B653VaLq.js";
8
- import { r as l, t as u } from "../structure-BmisBK-3.js";
8
+ import { r as l, t as u } from "../structure-DuxKl954.js";
9
9
  import { t as d } from "../tone-recipes-BPsRAvhu.js";
10
- import { t as f } from "../smart-card-DiC5aac3.js";
11
- import { t as p } from "../progress-B1VnCT0K.js";
12
- import { i as m, t as h } from "../overlays-tMkF-VAN.js";
13
- import { t as g } from "../interaction-recipes-XR9ZpVYL.js";
14
- import { _, g as v } from "../primitives-BFK08r9M.js";
15
- import { n as y } from "../number-DbV1Dija.js";
16
- import { t as b } from "../badge-HpFqoqSY.js";
17
- import { t as x } from "../batch-action-bar-DnUJ21NQ.js";
18
- import { t as S } from "../separator-BDV-Y648.js";
19
- import { n as C } from "../field-affordance-recipes-DZhnIL_Y.js";
20
- import { t as w } from "../input-DQdEd0YD.js";
21
- import { t as T } from "../form-field-CwH9y77i.js";
22
- import { d as E } from "../text-inputs-f9Ia-aCi.js";
23
- import { c as ee, l as D } from "../choice-inputs-CNHvARCJ.js";
24
- import { t as te } from "../checkbox-AWIhNhmo.js";
25
- import { n as O } from "../display-hAc1HjpI.js";
26
- import { r as k, t as ne } from "../control-group-recipes-DBXmfh2E.js";
27
- import { c as A, i as j, n as M, o as N, r as P, t as re, u as ie } from "../item-K5_ghvze.js";
28
- import { t as ae } from "../metadata-list-8N16ZMW_.js";
29
- import { c as oe, i as se, n as ce, o as F, s as le, t as ue } from "../table-DsfzoUia.js";
30
- import { m as de, s as I } from "../data-display-DT_khPl_.js";
31
- import { O as fe, f as pe } from "../table-BweFy_P9.js";
32
- import { Fragment as me, useCallback as L, useId as he, useMemo as R, useRef as ge, useState as _e } from "react";
33
- import { Fragment as ve, jsx as z, jsxs as B } from "react/jsx-runtime";
34
- import { ArrowLeft as ye, ChevronDown as V, Copy as be, Eye as H, GripVertical as U, ListFilter as xe, Pencil as W, Plus as G, PlusCircle as Se, Search as Ce, SlidersHorizontal as K, Trash2 as q, X as J } from "lucide-react";
10
+ import { h as f, p, t as m, v as h } from "../smart-card-CW0hjetE.js";
11
+ import { t as g } from "../progress-BJhQP9WX.js";
12
+ import { n as _, t as v } from "../composition.recipes-COdiFhxB.js";
13
+ import { i as y, t as b } from "../overlays-BSgCtM2v.js";
14
+ import { t as x } from "../interaction-recipes-XR9ZpVYL.js";
15
+ import { _ as S, g as C } from "../primitives-ByWgGUgt.js";
16
+ import { n as w } from "../number-CRU3kGuk.js";
17
+ import { t as ee } from "../badge-xIiV_E7f.js";
18
+ import { t as T } from "../batch-action-bar-Cb8cuvyy.js";
19
+ import { t as E } from "../separator-Ct_WSWTJ.js";
20
+ import { n as D } from "../field-affordance-recipes-DWcNcOjh.js";
21
+ import { t as O } from "../input-CvyDQlY7.js";
22
+ import { t as k } from "../form-field-BriWAXyg.js";
23
+ import { d as A } from "../text-inputs-B1culiSK.js";
24
+ import { c as te, l as j } from "../choice-inputs-zUgBZfE4.js";
25
+ import { t as ne } from "../checkbox-fflqmODR.js";
26
+ import { n as M } from "../display-KsZLw9Ov.js";
27
+ import { r as re, t as ie } from "../control-group-recipes-fMuFo0H7.js";
28
+ import { c as ae, i as N, n as P, o as F, r as I, t as L, u as R } from "../item-DjCcM18E.js";
29
+ import { t as z } from "../metadata-list-C3MkU-Om.js";
30
+ import { c as B, i as oe, n as se, o as ce, s as le, t as ue } from "../table-B4TE7iOV.js";
31
+ import { m as de, s as V } from "../data-display-BdgCAw8T.js";
32
+ import { O as H, f as fe } from "../table-CFOWY9pQ.js";
33
+ import { Fragment as pe, useCallback as U, useEffect as me, useId as he, useMemo as W, useRef as ge, useState as _e } from "react";
34
+ import { Fragment as ve, jsx as G, jsxs as K } from "react/jsx-runtime";
35
+ import { ArrowLeft as ye, ChevronDown as q, Copy as be, Eye as xe, ListFilter as J, Pencil as Se, Plus as Y, PlusCircle as Ce, Search as we, SlidersHorizontal as Te, Trash2 as X, X as Ee } from "lucide-react";
35
36
  //#region src/components/features/products/products.strings.ts
36
- var we = {
37
+ var De = {
37
38
  title: "Readiness",
38
39
  description: "Publishing checks and operational setup.",
39
40
  scoreLabel: "Overall readiness",
@@ -45,7 +46,7 @@ var we = {
45
46
  emptyTitle: "No readiness checks",
46
47
  emptyDescription: "Pass readiness items from your product workflow to show progress.",
47
48
  actionLabel: "Open"
48
- }, Te = {
49
+ }, Z = {
49
50
  title: "Structure",
50
51
  description: "Media, taxonomy, options, and content coverage.",
51
52
  createLabel: "Add metric",
@@ -55,7 +56,7 @@ var we = {
55
56
  actionsLabel: "Metric actions",
56
57
  emptyTitle: "No structure metrics",
57
58
  emptyDescription: "Pass structure metrics to summarize the product setup."
58
- }, Ee = {
59
+ }, Oe = {
59
60
  title: "Operations",
60
61
  description: "Availability, channels, service rules, and fulfilment signals.",
61
62
  createLabel: "Add signal",
@@ -65,13 +66,13 @@ var we = {
65
66
  emptyTitle: "No operational signals",
66
67
  emptyDescription: "Pass operational rows to show channel and availability health.",
67
68
  actionLabel: "Open"
68
- }, De = {
69
+ }, ke = {
69
70
  title: "Product details",
70
71
  description: "Core identity and catalogue fields.",
71
72
  editLabel: "Edit details",
72
73
  emptyTitle: "No details",
73
74
  emptyDescription: "Pass metadata rows to render product details."
74
- }, Oe = {
75
+ }, Ae = {
75
76
  title: "Contract",
76
77
  description: "Commercial terms, pricing rules, and customer-facing conditions.",
77
78
  termsTitle: "Terms",
@@ -85,7 +86,7 @@ var we = {
85
86
  ruleActionsLabel: "Rule actions",
86
87
  emptyTitle: "No contract summary",
87
88
  emptyDescription: "Pass metrics, terms, or rules to summarize the product contract."
88
- }, ke = {
89
+ }, je = {
89
90
  title: "Options",
90
91
  description: "Variant-driving choices and add-ons customers can select.",
91
92
  manageLabel: "Manage options",
@@ -96,12 +97,12 @@ var we = {
96
97
  actionsLabel: "Option actions",
97
98
  emptyTitle: "No options",
98
99
  emptyDescription: "Pass option groups to summarize configurable product choices."
99
- }, Y = {
100
+ }, Q = {
100
101
  viewLabel: "Open option",
101
102
  editLabel: "Edit option",
102
103
  deleteLabel: "Delete option",
103
104
  actionsLabel: "Option actions"
104
- }, Ae = {
105
+ }, Me = {
105
106
  title: "Variant options",
106
107
  description: "Define option groups and values before generating sellable variants.",
107
108
  createLabel: "Add attribute",
@@ -113,11 +114,15 @@ var we = {
113
114
  deleteValueLabel: "Delete value",
114
115
  confirmDeleteOptionTitle: "Delete this option?",
115
116
  confirmRemoveValuesTitle: "Save and remove these values?",
116
- confirmRemoveValuesDescription: "Saving removes {count} value(s) from this option, and any variant built from them goes with it. This cannot be undone.",
117
+ confirmRemoveValuesDescription: "Saving removes {{count}} value(s) from this option, and any variant built from them goes with it. This cannot be undone.",
117
118
  confirmRemoveValuesLabel: "Save changes",
118
119
  confirmDeleteOptionDescription: "Its values are removed from the product, and any variant built from them goes with it. This cannot be undone.",
119
120
  doneLabel: "Done",
120
121
  saveLabel: "Save",
122
+ savingLabel: "Saving…",
123
+ saveErrorTitle: "Changes were not saved",
124
+ saveErrorMessage: "Your draft has been kept. Try again.",
125
+ retrySaveLabel: "Retry save",
121
126
  cancelLabel: "Cancel",
122
127
  expandOptionLabel: "Expand option",
123
128
  collapseOptionLabel: "Collapse option",
@@ -131,7 +136,7 @@ var we = {
131
136
  emptyTitle: "No option groups",
132
137
  emptyDescription: "Add options such as size, color, or packaging to create variant combinations.",
133
138
  noValuesLabel: "No values"
134
- }, X = {
139
+ }, Ne = {
135
140
  title: "Quote preview",
136
141
  description: "How the product appears in a compact customer quote.",
137
142
  subtotalLabel: "Subtotal",
@@ -146,7 +151,7 @@ var we = {
146
151
  lineActionsLabel: "Line actions",
147
152
  emptyTitle: "No quote lines",
148
153
  emptyDescription: "Pass quote lines to preview pricing."
149
- }, Z = {
154
+ }, Pe = {
150
155
  title: "Policies",
151
156
  description: "Cancellation, booking, service, and customer-facing rules.",
152
157
  createLabel: "Add policy",
@@ -156,7 +161,7 @@ var we = {
156
161
  actionsLabel: "Policy actions",
157
162
  emptyTitle: "No policies",
158
163
  emptyDescription: "Pass policies to summarize customer-facing rules."
159
- }, Q = {
164
+ }, Fe = {
160
165
  title: "Variants",
161
166
  description: "Sellable combinations with price, availability, and SKU.",
162
167
  createLabel: "Add variant",
@@ -175,7 +180,7 @@ var we = {
175
180
  updated: "Updated",
176
181
  actions: "Actions"
177
182
  }
178
- }, je = {
183
+ }, $ = {
179
184
  title: "Variants",
180
185
  description: "Review generated combinations, select rows, and apply bulk operations.",
181
186
  createLabel: "Add variant",
@@ -203,7 +208,7 @@ var we = {
203
208
  updated: "Updated",
204
209
  actions: "Actions"
205
210
  }
206
- }, Me = {
211
+ }, Ie = {
207
212
  title: "Variants",
208
213
  description: "Configure option groups first, then manage the generated sellable variants.",
209
214
  optionsTitle: "Variant options",
@@ -214,13 +219,13 @@ var we = {
214
219
  generateLabel: "Generate variants",
215
220
  createVariantLabel: "Add variant",
216
221
  actionsLabel: "Variant manager actions"
217
- }, Ne = {
222
+ }, Le = {
218
223
  viewLabel: "Open variant",
219
224
  editLabel: "Edit",
220
225
  duplicateLabel: "Duplicate",
221
226
  deleteLabel: "Delete",
222
227
  actionsLabel: "Variant actions"
223
- }, Pe = {
228
+ }, Re = {
224
229
  title: "Variant",
225
230
  description: "Sellable variant details, options, pricing, and fulfilment data.",
226
231
  backLabel: "Back",
@@ -237,7 +242,7 @@ var we = {
237
242
  channels: "Channels",
238
243
  updated: "Updated"
239
244
  }
240
- }, Fe = {
245
+ }, ze = {
241
246
  title: "Edit variant",
242
247
  description: "Controlled form for variant identity, pricing, inventory, and option values.",
243
248
  identityTitle: "Identity",
@@ -267,14 +272,14 @@ var we = {
267
272
  status: "Active",
268
273
  channels: "Online store, POS"
269
274
  }
270
- }, Ie = {
275
+ }, Be = {
271
276
  mainLabel: "Product overview",
272
277
  railLabel: "Product supporting information"
273
278
  };
274
279
  //#endregion
275
280
  //#region src/components/features/products/partials/product-empty-state.tsx
276
- function $({ title: e, description: t, action: n, className: r }) {
277
- return /* @__PURE__ */ z(I, {
281
+ function Ve({ title: e, description: t, action: n, className: r }) {
282
+ return /* @__PURE__ */ G(V, {
278
283
  padding: "md",
279
284
  border: !0,
280
285
  title: e,
@@ -285,34 +290,34 @@ function $({ title: e, description: t, action: n, className: r }) {
285
290
  }
286
291
  //#endregion
287
292
  //#region src/components/features/products/partials/product-tone.tsx
288
- var Le = {
293
+ var He = {
289
294
  neutral: "secondary",
290
295
  primary: "secondary",
291
296
  success: "success",
292
297
  warning: "warning",
293
298
  destructive: "destructive",
294
299
  info: "info"
295
- }, Re = {
300
+ }, Ue = {
296
301
  neutral: void 0,
297
302
  primary: void 0,
298
303
  success: "text-success",
299
304
  warning: "text-warning-accent",
300
305
  destructive: "text-destructive",
301
306
  info: "text-info"
302
- }, ze = /* @__PURE__ */ new Set([
307
+ }, We = /* @__PURE__ */ new Set([
303
308
  "success",
304
309
  "warning",
305
310
  "destructive",
306
311
  "info"
307
312
  ]);
308
- function Be(e) {
309
- return e !== void 0 && ze.has(e);
313
+ function Ge(e) {
314
+ return e !== void 0 && We.has(e);
310
315
  }
311
- function Ve(e) {
316
+ function Ke(e) {
312
317
  return Number.isFinite(e) ? Math.min(100, Math.max(0, Math.round(e))) : 0;
313
318
  }
314
- function He({ tone: e = "neutral" }) {
315
- return /* @__PURE__ */ z("span", {
319
+ function qe({ tone: e = "neutral" }) {
320
+ return /* @__PURE__ */ G("span", {
316
321
  "aria-hidden": "true",
317
322
  className: i("product-tone-dot--component", d.marker, {
318
323
  "bg-muted-foreground": e === "neutral" || e === "primary",
@@ -325,35 +330,35 @@ function He({ tone: e = "neutral" }) {
325
330
  }
326
331
  //#endregion
327
332
  //#region src/components/features/products/partials/product-metric-tile.tsx
328
- function Ue({ metric: e }) {
333
+ function Je({ metric: e }) {
329
334
  let t = "icon" in e ? e.icon : void 0;
330
- return /* @__PURE__ */ B(u, {
335
+ return /* @__PURE__ */ K(u, {
331
336
  gap: "dense",
332
337
  className: "product-metric-tile--component min-w-0",
333
338
  children: [
334
- /* @__PURE__ */ B(u, {
339
+ /* @__PURE__ */ K(u, {
335
340
  direction: "horizontal",
336
341
  gap: "sm",
337
342
  wrap: !1,
338
343
  children: [
339
- Be(e.tone) && /* @__PURE__ */ z(He, { tone: e.tone }),
340
- !!t && /* @__PURE__ */ z("span", {
344
+ Ge(e.tone) && /* @__PURE__ */ G(qe, { tone: e.tone }),
345
+ !!t && /* @__PURE__ */ G("span", {
341
346
  className: "flex shrink-0 text-muted-foreground",
342
347
  children: t
343
348
  }),
344
- /* @__PURE__ */ z(s, {
349
+ /* @__PURE__ */ G(s, {
345
350
  className: "truncate text-inherit",
346
351
  children: e.label
347
352
  })
348
353
  ]
349
354
  }),
350
- /* @__PURE__ */ z(_, {
355
+ /* @__PURE__ */ G(S, {
351
356
  type: "inherit",
352
357
  weight: "semibold",
353
358
  className: "tabular-nums",
354
359
  children: e.value
355
360
  }),
356
- !!e.description && /* @__PURE__ */ z(o, {
361
+ !!e.description && /* @__PURE__ */ G(o, {
357
362
  size: "xs",
358
363
  type: "secondary",
359
364
  lineHeight: "snug",
@@ -364,10 +369,10 @@ function Ue({ metric: e }) {
364
369
  }
365
370
  //#endregion
366
371
  //#region src/components/features/products/partials/product-actions.tsx
367
- function We({ item: e, actions: t, menuLabel: n, className: r }) {
368
- return t.length === 0 ? null : /* @__PURE__ */ z("div", {
372
+ function Ye({ item: e, actions: t, menuLabel: n, className: r }) {
373
+ return t.length === 0 ? null : /* @__PURE__ */ G("div", {
369
374
  className: i("product-row-actions--component flex justify-end", r),
370
- children: /* @__PURE__ */ z(fe, {
375
+ children: /* @__PURE__ */ G(H, {
371
376
  row: e,
372
377
  actions: t,
373
378
  menuLabel: n,
@@ -377,22 +382,22 @@ function We({ item: e, actions: t, menuLabel: n, className: r }) {
377
382
  }
378
383
  //#endregion
379
384
  //#region src/components/features/products/partials/product-rows.tsx
380
- var Ge = "min-w-0 basis-48", Ke = "line-clamp-none break-words overflow-visible", qe = "ml-auto shrink-0 flex-wrap justify-end gap-space-md";
381
- function Je({ label: e, value: t, tone: n, badge: r }) {
382
- let i = /* @__PURE__ */ z(ie, {
383
- className: Ke,
385
+ var Xe = "min-w-0 basis-48", Ze = "line-clamp-none break-words overflow-visible", Qe = "ml-auto shrink-0 flex-wrap justify-end gap-space-md";
386
+ function $e({ label: e, value: t, tone: n, badge: r }) {
387
+ let i = /* @__PURE__ */ G(R, {
388
+ className: Ze,
384
389
  children: e
385
390
  });
386
- return !t && !r ? i : /* @__PURE__ */ B(u, {
391
+ return !t && !r ? i : /* @__PURE__ */ K(u, {
387
392
  direction: "horizontal",
388
393
  gap: "sm",
389
394
  className: "product-row--heading",
390
395
  children: [
391
396
  i,
392
- !!t && (Be(n) ? /* @__PURE__ */ z(b, {
393
- tone: Le[n],
397
+ !!t && (Ge(n) ? /* @__PURE__ */ G(ee, {
398
+ tone: He[n],
394
399
  children: t
395
- }) : /* @__PURE__ */ z(o, {
400
+ }) : /* @__PURE__ */ G(o, {
396
401
  tag: "span",
397
402
  type: "secondary",
398
403
  lineHeight: "tight",
@@ -402,8 +407,8 @@ function Je({ label: e, value: t, tone: n, badge: r }) {
402
407
  ]
403
408
  });
404
409
  }
405
- function Ye({ label: e, onSelect: t }) {
406
- return /* @__PURE__ */ z(a, {
410
+ function et({ label: e, onSelect: t }) {
411
+ return /* @__PURE__ */ G(a, {
407
412
  type: "button",
408
413
  tone: "secondary",
409
414
  buttonStyle: "ghost",
@@ -411,60 +416,60 @@ function Ye({ label: e, onSelect: t }) {
411
416
  children: e
412
417
  });
413
418
  }
414
- function Xe({ metric: e, actions: t }) {
415
- return /* @__PURE__ */ B(re, {
419
+ function tt({ metric: e, actions: t }) {
420
+ return /* @__PURE__ */ K(L, {
416
421
  className: "product-structure-metric-row--component product-structure-card--item",
417
422
  children: [
418
- !!e.icon && /* @__PURE__ */ z(A, {
423
+ !!e.icon && /* @__PURE__ */ G(ae, {
419
424
  variant: "icon",
420
425
  className: "text-muted-foreground",
421
426
  children: e.icon
422
427
  }),
423
- /* @__PURE__ */ B(P, {
424
- className: Ge,
425
- children: [/* @__PURE__ */ z(ie, {
426
- className: Ke,
428
+ /* @__PURE__ */ K(I, {
429
+ className: Xe,
430
+ children: [/* @__PURE__ */ G(R, {
431
+ className: Ze,
427
432
  children: e.label
428
- }), !!e.description && /* @__PURE__ */ z(j, {
433
+ }), !!e.description && /* @__PURE__ */ G(N, {
429
434
  clamp: 2,
430
435
  children: e.description
431
436
  })]
432
437
  }),
433
- /* @__PURE__ */ B(M, {
438
+ /* @__PURE__ */ K(P, {
434
439
  className: "ml-auto shrink-0 gap-space-md",
435
- children: [/* @__PURE__ */ z(_, {
440
+ children: [/* @__PURE__ */ G(S, {
436
441
  type: "inherit",
437
442
  weight: "semibold",
438
- className: i("tabular-nums", e.tone && Re[e.tone]),
443
+ className: i("tabular-nums", e.tone && Ue[e.tone]),
439
444
  children: e.value
440
445
  }), t]
441
446
  })
442
447
  ]
443
448
  });
444
449
  }
445
- function Ze({ item: e, actionFallback: t, onSelect: n, actions: r }) {
450
+ function nt({ item: e, actionFallback: t, onSelect: n, actions: r }) {
446
451
  let i = e.tone ?? (e.completed ? "success" : "neutral"), a = e.onSelect ?? n;
447
- return /* @__PURE__ */ B(re, {
452
+ return /* @__PURE__ */ K(L, {
448
453
  className: "product-readiness-row--component product-readiness-card--item",
449
454
  children: [
450
- /* @__PURE__ */ z(A, {
455
+ /* @__PURE__ */ G(ae, {
451
456
  className: "product-readiness-row--state h-icon-lg",
452
- children: /* @__PURE__ */ z(He, { tone: i })
457
+ children: /* @__PURE__ */ G(qe, { tone: i })
453
458
  }),
454
- /* @__PURE__ */ B(P, {
455
- className: Ge,
456
- children: [/* @__PURE__ */ z(Je, {
459
+ /* @__PURE__ */ K(I, {
460
+ className: Xe,
461
+ children: [/* @__PURE__ */ G($e, {
457
462
  label: e.label,
458
463
  value: e.value,
459
464
  tone: e.tone
460
- }), !!e.description && /* @__PURE__ */ z(j, {
465
+ }), !!e.description && /* @__PURE__ */ G(N, {
461
466
  clamp: 2,
462
467
  children: e.description
463
468
  })]
464
469
  }),
465
- !!(a || r) && /* @__PURE__ */ B(M, {
466
- className: qe,
467
- children: [!!a && /* @__PURE__ */ z(Ye, {
470
+ !!(a || r) && /* @__PURE__ */ K(P, {
471
+ className: Qe,
472
+ children: [!!a && /* @__PURE__ */ G(et, {
468
473
  label: e.actionLabel ?? t,
469
474
  onSelect: a
470
475
  }), r]
@@ -472,57 +477,57 @@ function Ze({ item: e, actionFallback: t, onSelect: n, actions: r }) {
472
477
  ]
473
478
  });
474
479
  }
475
- function Qe({ item: e, actionFallback: t, onSelect: n, actions: r }) {
480
+ function rt({ item: e, actionFallback: t, onSelect: n, actions: r }) {
476
481
  let i = e.onSelect ?? n;
477
- return /* @__PURE__ */ B(re, {
482
+ return /* @__PURE__ */ K(L, {
478
483
  className: "product-operation-row--component product-operations-card--item",
479
- children: [/* @__PURE__ */ B(P, {
480
- className: Ge,
481
- children: [/* @__PURE__ */ z(Je, {
484
+ children: [/* @__PURE__ */ K(I, {
485
+ className: Xe,
486
+ children: [/* @__PURE__ */ G($e, {
482
487
  label: e.label,
483
488
  value: e.value,
484
489
  tone: e.tone
485
- }), !!e.description && /* @__PURE__ */ z(j, {
490
+ }), !!e.description && /* @__PURE__ */ G(N, {
486
491
  clamp: 2,
487
492
  children: e.description
488
493
  })]
489
- }), !!(i || r) && /* @__PURE__ */ B(M, {
490
- className: qe,
491
- children: [!!i && /* @__PURE__ */ z(Ye, {
494
+ }), !!(i || r) && /* @__PURE__ */ K(P, {
495
+ className: Qe,
496
+ children: [!!i && /* @__PURE__ */ G(et, {
492
497
  label: e.actionLabel ?? t,
493
498
  onSelect: i
494
499
  }), r]
495
500
  })]
496
501
  });
497
502
  }
498
- function $e({ item: e, actionLabel: t, onSelect: n, actions: r }) {
503
+ function it({ item: e, actionLabel: t, onSelect: n, actions: r }) {
499
504
  let i = "values" in e ? e.values : void 0;
500
- return /* @__PURE__ */ B(re, {
505
+ return /* @__PURE__ */ K(L, {
501
506
  className: "product-summary-row--component",
502
- children: [/* @__PURE__ */ B(P, {
503
- className: Ge,
507
+ children: [/* @__PURE__ */ K(I, {
508
+ className: Xe,
504
509
  children: [
505
- /* @__PURE__ */ z(Je, {
510
+ /* @__PURE__ */ G($e, {
506
511
  label: e.label,
507
512
  value: e.value,
508
513
  tone: e.tone,
509
514
  badge: e.badge
510
515
  }),
511
- !!e.description && /* @__PURE__ */ z(j, {
516
+ !!e.description && /* @__PURE__ */ G(N, {
512
517
  clamp: 2,
513
518
  children: e.description
514
519
  }),
515
- !!i?.length && /* @__PURE__ */ z("div", {
520
+ !!i?.length && /* @__PURE__ */ G("div", {
516
521
  className: "mt-space-md flex flex-wrap gap-space-xs",
517
- children: i.map((e, t) => /* @__PURE__ */ z(b, {
522
+ children: i.map((e, t) => /* @__PURE__ */ G(ee, {
518
523
  tone: "secondary",
519
524
  children: e
520
525
  }, t))
521
526
  })
522
527
  ]
523
- }), !!(n || r) && /* @__PURE__ */ B(M, {
524
- className: qe,
525
- children: [!!n && /* @__PURE__ */ z(Ye, {
528
+ }), !!(n || r) && /* @__PURE__ */ K(P, {
529
+ className: Qe,
530
+ children: [!!n && /* @__PURE__ */ G(et, {
526
531
  label: t,
527
532
  onSelect: n
528
533
  }), r]
@@ -531,26 +536,26 @@ function $e({ item: e, actionLabel: t, onSelect: n, actions: r }) {
531
536
  }
532
537
  //#endregion
533
538
  //#region src/components/features/products/components/product-contract-overview.tsx
534
- function et({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s, onEditContract: c, onCreateRule: d, onSelectRule: f, onEditRule: p, onDeleteRule: m, renderRuleActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
535
- let x = r(Oe, b), S = e.length > 0 || t.length > 0 || n.length > 0, C = s || c || d ? /* @__PURE__ */ B("div", {
539
+ function at({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s, onEditContract: c, onCreateRule: d, onSelectRule: f, onEditRule: p, onDeleteRule: m, renderRuleActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
540
+ let x = r(Ae, b), S = e.length > 0 || t.length > 0 || n.length > 0, C = s || c || d ? /* @__PURE__ */ K("div", {
536
541
  className: "flex items-center gap-space-md",
537
542
  children: [
538
- !!d && /* @__PURE__ */ z(a, {
543
+ !!d && /* @__PURE__ */ G(a, {
539
544
  type: "button",
540
545
  tone: "secondary",
541
546
  buttonStyle: "ghost",
542
547
  onClick: d,
543
- icon: G,
548
+ icon: Y,
544
549
  children: x.createRuleLabel
545
550
  }),
546
- !!c && /* @__PURE__ */ z(a, {
551
+ !!c && /* @__PURE__ */ G(a, {
547
552
  type: "button",
548
553
  tone: "secondary",
549
554
  buttonStyle: "ghost",
550
555
  onClick: c,
551
556
  children: x.editLabel
552
557
  }),
553
- !!s && /* @__PURE__ */ z(a, {
558
+ !!s && /* @__PURE__ */ G(a, {
554
559
  type: "button",
555
560
  tone: "secondary",
556
561
  buttonStyle: "ghost",
@@ -559,48 +564,49 @@ function et({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
559
564
  })
560
565
  ]
561
566
  }) : void 0;
562
- return /* @__PURE__ */ z(O, {
567
+ return /* @__PURE__ */ G(M, {
563
568
  title: x.title,
564
569
  description: x.description,
565
570
  actions: g,
566
571
  headerAction: C,
567
572
  footerSlot: _,
568
573
  className: i("product-contract-overview--component w-full", y),
569
- children: S ? /* @__PURE__ */ B(u, {
574
+ children: S ? /* @__PURE__ */ K(u, {
570
575
  gap: "2xl",
571
576
  children: [
572
- e.length > 0 && /* @__PURE__ */ z(l, {
577
+ e.length > 0 && /* @__PURE__ */ G(l, {
573
578
  columns: {
574
579
  base: 1,
575
580
  sm: 3
576
581
  },
577
582
  gap: "md",
578
- children: e.map((e) => /* @__PURE__ */ z(Ue, { metric: e }, e.id))
583
+ children: e.map((e) => /* @__PURE__ */ G(Je, { metric: e }, e.id))
579
584
  }),
580
- t.length > 0 && /* @__PURE__ */ B(u, {
585
+ t.length > 0 && /* @__PURE__ */ K(u, {
581
586
  gap: "md",
582
- children: [/* @__PURE__ */ z(o, {
587
+ children: [/* @__PURE__ */ G(o, {
583
588
  type: "inherit",
584
589
  weight: "semibold",
585
590
  children: x.termsTitle
586
- }), /* @__PURE__ */ z(ae, {
591
+ }), /* @__PURE__ */ G(z, {
592
+ adaptTo: "container",
587
593
  items: t,
588
594
  columns: 2,
589
595
  density: "compact"
590
596
  })]
591
597
  }),
592
- n.length > 0 && /* @__PURE__ */ B(u, {
598
+ n.length > 0 && /* @__PURE__ */ K(u, {
593
599
  gap: "md",
594
- children: [/* @__PURE__ */ z(o, {
600
+ children: [/* @__PURE__ */ G(o, {
595
601
  type: "inherit",
596
602
  weight: "semibold",
597
603
  children: x.rulesTitle
598
- }), /* @__PURE__ */ z(N, { children: n.map((e, t) => {
604
+ }), /* @__PURE__ */ G(F, { children: n.map((e, t) => {
599
605
  let n = f ? () => f(e) : void 0, r = p ? () => p(e) : void 0, i = m ? () => m(e) : void 0, a = [
600
606
  ...n ? [{
601
607
  id: "open",
602
608
  label: x.viewRuleLabel,
603
- icon: /* @__PURE__ */ z(H, { className: "size-icon-md" }),
609
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
604
610
  onClick: () => n(),
605
611
  tone: "secondary",
606
612
  buttonStyle: "ghost"
@@ -608,7 +614,7 @@ function et({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
608
614
  ...r ? [{
609
615
  id: "edit",
610
616
  label: x.editRuleLabel,
611
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
617
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
612
618
  onClick: () => r(),
613
619
  tone: "secondary",
614
620
  buttonStyle: "ghost"
@@ -616,7 +622,7 @@ function et({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
616
622
  ...i ? [{
617
623
  id: "delete",
618
624
  label: x.deleteRuleLabel,
619
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
625
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
620
626
  onClick: () => i(),
621
627
  tone: "destructive"
622
628
  }] : []
@@ -625,43 +631,43 @@ function et({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
625
631
  onSelect: n,
626
632
  onEdit: r,
627
633
  onDelete: i
628
- }) : /* @__PURE__ */ z(We, {
634
+ }) : /* @__PURE__ */ G(Ye, {
629
635
  item: e,
630
636
  actions: a,
631
637
  menuLabel: x.ruleActionsLabel
632
638
  });
633
- return /* @__PURE__ */ z($e, {
639
+ return /* @__PURE__ */ G(it, {
634
640
  item: e,
635
641
  actions: o
636
642
  }, e.id);
637
643
  }) })]
638
644
  })
639
645
  ]
640
- }) : v ?? /* @__PURE__ */ z($, {
646
+ }) : v ?? /* @__PURE__ */ G(Ve, {
641
647
  title: x.emptyTitle,
642
648
  description: x.emptyDescription,
643
- action: d ? /* @__PURE__ */ z(a, {
649
+ action: d ? /* @__PURE__ */ G(a, {
644
650
  tone: "primary",
645
651
  type: "button",
646
652
  onClick: d,
647
- icon: G,
653
+ icon: Y,
648
654
  children: x.createRuleLabel
649
655
  }) : void 0
650
656
  })
651
657
  });
652
658
  }
653
- et.displayName = "ProductContractOverview";
659
+ at.displayName = "ProductContractOverview";
654
660
  //#endregion
655
661
  //#region src/components/features/products/components/product-details-card.tsx
656
- function tt({ title: e, description: t, metadata: n = [], media: o, onEditDetails: s, actions: c, headerEnd: l, footerSlot: u, empty: d, className: f, strings: p }) {
657
- let m = r(De, p), h = s ? /* @__PURE__ */ z(a, {
662
+ function ot({ title: e, description: t, metadata: n = [], media: o, onEditDetails: s, actions: c, headerEnd: l, footerSlot: u, empty: d, className: f, strings: p }) {
663
+ let m = r(ke, p), h = s ? /* @__PURE__ */ G(a, {
658
664
  type: "button",
659
665
  tone: "secondary",
660
666
  buttonStyle: "ghost",
661
667
  onClick: s,
662
668
  children: m.editLabel
663
669
  }) : void 0;
664
- return /* @__PURE__ */ z(O, {
670
+ return /* @__PURE__ */ G(M, {
665
671
  title: e ?? m.title,
666
672
  description: t === !1 ? void 0 : t ?? m.description,
667
673
  actions: c,
@@ -669,17 +675,18 @@ function tt({ title: e, description: t, metadata: n = [], media: o, onEditDetail
669
675
  headerEnd: l,
670
676
  footerSlot: u,
671
677
  className: i("product-details-card--component w-full", f),
672
- children: n.length === 0 ? d ?? /* @__PURE__ */ z($, {
678
+ children: n.length === 0 && !o ? d ?? /* @__PURE__ */ G(Ve, {
673
679
  title: m.emptyTitle,
674
680
  description: m.emptyDescription
675
- }) : /* @__PURE__ */ z("div", {
681
+ }) : /* @__PURE__ */ G("div", {
676
682
  className: "@container/product-details",
677
- children: /* @__PURE__ */ B("div", {
678
- className: i("grid min-w-0 grid-cols-1 gap-space-xl", o && "@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]"),
679
- children: [!!o && /* @__PURE__ */ z("div", {
680
- className: "product-details-card--media self-start overflow-hidden rounded-inner border border-border bg-muted/30",
683
+ children: /* @__PURE__ */ K("div", {
684
+ className: i("grid min-w-0 grid-cols-1 gap-space-xl", o && n.length > 0 && "@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]"),
685
+ children: [!!o && /* @__PURE__ */ G("div", {
686
+ className: "product-details-card--media self-start overflow-hidden rounded-radius border border-border bg-muted/30",
681
687
  children: o
682
- }), /* @__PURE__ */ z(ae, {
688
+ }), n.length > 0 && /* @__PURE__ */ G(z, {
689
+ adaptTo: "container",
683
690
  items: n,
684
691
  columns: o ? 1 : 2,
685
692
  density: "compact",
@@ -689,12 +696,12 @@ function tt({ title: e, description: t, metadata: n = [], media: o, onEditDetail
689
696
  })
690
697
  });
691
698
  }
692
- tt.displayName = "ProductDetailsCard";
699
+ ot.displayName = "ProductDetailsCard";
693
700
  //#endregion
694
701
  //#region src/components/features/products/components/product-option-action-menu.tsx
695
- function nt({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDeleteOption: o, renderOptionActions: s, menuLabel: c, className: l, strings: u }) {
696
- let d = r(Y, u), f = n ? () => n(e) : void 0, p = a ? () => a(e) : void 0, m = o ? () => o(e) : void 0;
697
- return f || p || m || s ? s ? /* @__PURE__ */ z("div", {
702
+ function st({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDeleteOption: o, renderOptionActions: s, menuLabel: c, className: l, strings: u }) {
703
+ let d = r(Q, u), f = n ? () => n(e) : void 0, p = a ? () => a(e) : void 0, m = o ? () => o(e) : void 0;
704
+ return f || p || m || s ? s ? /* @__PURE__ */ G("div", {
698
705
  className: i("product-option-action-menu--component flex justify-end", l),
699
706
  children: s(e, {
700
707
  index: t,
@@ -702,7 +709,7 @@ function nt({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
702
709
  onEdit: p,
703
710
  onDelete: m
704
711
  })
705
- }) : /* @__PURE__ */ z(We, {
712
+ }) : /* @__PURE__ */ G(Ye, {
706
713
  item: e,
707
714
  menuLabel: c ?? d.actionsLabel,
708
715
  className: i("product-option-action-menu--component", l),
@@ -710,7 +717,7 @@ function nt({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
710
717
  ...f ? [{
711
718
  id: "open",
712
719
  label: d.viewLabel,
713
- icon: /* @__PURE__ */ z(H, { className: "size-icon-md" }),
720
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
714
721
  onClick: () => f(),
715
722
  tone: "secondary",
716
723
  buttonStyle: "ghost"
@@ -718,7 +725,7 @@ function nt({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
718
725
  ...p ? [{
719
726
  id: "edit",
720
727
  label: d.editLabel,
721
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
728
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
722
729
  onClick: () => p(),
723
730
  tone: "secondary",
724
731
  buttonStyle: "ghost"
@@ -726,54 +733,54 @@ function nt({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
726
733
  ...m ? [{
727
734
  id: "delete",
728
735
  label: d.deleteLabel,
729
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
736
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
730
737
  onClick: () => m(),
731
738
  tone: "destructive"
732
739
  }] : []
733
740
  ]
734
741
  }) : null;
735
742
  }
736
- nt.displayName = "ProductOptionActionMenu";
743
+ st.displayName = "ProductOptionActionMenu";
737
744
  //#endregion
738
745
  //#region src/components/features/products/components/product-operations-card.tsx
739
- function rt({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditOperation: o, onDeleteOperation: s, renderOperationActions: c, actions: l, footerSlot: u, renderItem: d, empty: f, className: p, strings: m }) {
740
- let h = r(Ee, m), g = t ? /* @__PURE__ */ z(a, {
746
+ function ct({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditOperation: o, onDeleteOperation: s, renderOperationActions: c, actions: l, footerSlot: u, renderItem: d, empty: f, className: p, strings: m }) {
747
+ let h = r(Oe, m), g = t ? /* @__PURE__ */ G(a, {
741
748
  type: "button",
742
749
  tone: "secondary",
743
750
  buttonStyle: "ghost",
744
751
  onClick: t,
745
- icon: G,
752
+ icon: Y,
746
753
  children: h.createLabel
747
754
  }) : void 0;
748
- return /* @__PURE__ */ z(O, {
755
+ return /* @__PURE__ */ G(M, {
749
756
  title: h.title,
750
757
  description: h.description,
751
758
  actions: l,
752
759
  headerAction: g,
753
760
  footerSlot: u,
754
761
  className: i("product-operations-card--component w-full", p),
755
- children: e.length === 0 ? f ?? /* @__PURE__ */ z($, {
762
+ children: e.length === 0 ? f ?? /* @__PURE__ */ G(Ve, {
756
763
  title: h.emptyTitle,
757
764
  description: h.emptyDescription,
758
- action: t ? /* @__PURE__ */ z(a, {
765
+ action: t ? /* @__PURE__ */ G(a, {
759
766
  tone: "primary",
760
767
  type: "button",
761
768
  onClick: t,
762
- icon: G,
769
+ icon: Y,
763
770
  children: h.createLabel
764
771
  }) : void 0
765
- }) : /* @__PURE__ */ z(N, { children: e.map((e, t) => {
772
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => {
766
773
  let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [...i ? [{
767
774
  id: "edit",
768
775
  label: h.editLabel,
769
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
776
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
770
777
  onClick: () => i(),
771
778
  tone: "secondary",
772
779
  buttonStyle: "ghost"
773
780
  }] : [], ...a ? [{
774
781
  id: "delete",
775
782
  label: h.deleteLabel,
776
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
783
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
777
784
  onClick: () => a(),
778
785
  tone: "destructive"
779
786
  }] : []], u = c ? c(e, {
@@ -781,12 +788,12 @@ function rt({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditO
781
788
  onSelect: r,
782
789
  onEdit: i,
783
790
  onDelete: a
784
- }) : /* @__PURE__ */ z(We, {
791
+ }) : /* @__PURE__ */ G(Ye, {
785
792
  item: e,
786
793
  actions: l,
787
794
  menuLabel: h.actionsLabel
788
795
  });
789
- return d ? /* @__PURE__ */ z("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ z(Qe, {
796
+ return d ? /* @__PURE__ */ G("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ G(rt, {
790
797
  item: e,
791
798
  actionFallback: h.actionLabel,
792
799
  onSelect: r,
@@ -795,350 +802,381 @@ function rt({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditO
795
802
  }) })
796
803
  });
797
804
  }
798
- rt.displayName = "ProductOperationsCard";
805
+ ct.displayName = "ProductOperationsCard";
799
806
  //#endregion
800
807
  //#region src/components/features/products/components/product-options-matrix.tsx
801
- function it(e) {
808
+ function lt(e) {
802
809
  return typeof e == "string" || typeof e == "number" ? String(e) : "";
803
810
  }
804
- function at(e) {
811
+ function ut(e) {
805
812
  return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
806
813
  }
807
- function ot(e, t) {
808
- let n = it(t.name);
814
+ function dt(e, t) {
815
+ let n = lt(t.name);
809
816
  return n ? `${e}: ${n}` : e;
810
817
  }
811
- function st(e) {
818
+ function ft(e) {
812
819
  return {
813
- name: it(e.name),
820
+ name: lt(e.name),
814
821
  values: (e.values ?? []).map((e) => ({
815
822
  ...e,
816
- label: it(e.label)
823
+ label: lt(e.label)
817
824
  }))
818
825
  };
819
826
  }
820
- function ct({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s, defaultCollapsedOptionIds: l = [], onCollapsedOptionIdsChange: d, editingOptionId: f, defaultEditingOptionId: p, onEditingOptionIdChange: _, onCreateOption: v, onEditOption: y, onDeleteOption: x, confirmDelete: S, onAddValue: E, onDeleteValue: D, onOptionNameChange: te, onValueLabelChange: k, onDoneEditingOption: ne, onSaveEditingOption: A, onCancelEditingOption: j, onToggleUsedForVariants: M, renderOptionActions: N, renderValue: P, showHeader: re, showCollapseControls: ie = !0, showInlineActions: ae = !0, showVariantToggle: oe = !0, actions: se, headerEnd: ce, footerSlot: F, empty: le, className: ue, strings: de }) {
821
- let I = r(Ae, de), fe = s !== void 0, [pe, he] = _e(l), ge = fe ? s : pe, ye = R(() => new Set(ge), [ge]), be = f !== void 0 || p !== void 0 || !!_ || !!te || !!k || !!ne || !!A || !!j, H = f !== void 0, [xe, W] = _e(p ?? null), [Ce, K] = _e({}), we = be ? H ? f : xe : null, Te = e.length > 0, Ee = t === "embedded" && re !== !1, De = Te && !!v, Oe = L((t) => {
822
- fe || he(t), d?.(t, e.filter((e) => t.includes(e.id)));
827
+ function pt({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s, defaultCollapsedOptionIds: l = [], onCollapsedOptionIdsChange: d, editingOptionId: m, defaultEditingOptionId: g, onEditingOptionIdChange: _, onCreateOption: S, onEditOption: C, onDeleteOption: w, confirmDelete: T, onAddValue: E, onDeleteValue: A, onOptionNameChange: j, onValueLabelChange: ne, onDoneEditingOption: re, onSaveEditingOption: ie, onError: ae, onCancelEditingOption: N, onToggleUsedForVariants: P, renderOptionActions: F, renderValue: I, showHeader: L, showCollapseControls: R = !0, showInlineActions: z = !0, showVariantToggle: B = !0, actions: oe, headerEnd: se, footerSlot: ce, empty: le, className: ue, strings: de }) {
828
+ let V = r(Me, de), H = s !== void 0, [fe, he] = _e(l), ye = H ? s : fe, be = W(() => new Set(ye), [ye]), xe = m !== void 0 || g !== void 0 || !!_ || !!j || !!ne || !!re || !!ie || !!N, J = m !== void 0, [Se, we] = _e(g ?? null), [Te, De] = _e({}), Z = ge(!1), Oe = ge(!0), [ke, Ae] = _e(null), [je, Q] = _e(null), Ne = ge(null), Pe = ge(null), Fe = U((e) => {
829
+ e && (e.focus(), Pe.current = null);
830
+ }, []), $ = ke !== null;
831
+ me(() => (Oe.current = !0, () => {
832
+ Oe.current = !1;
833
+ }), []);
834
+ let Ie = xe ? J ? m : Se : null, Le = e.length > 0, Re = t === "embedded" && L !== !1, ze = Le && !!S, Be = U((t) => {
835
+ H || he(t), d?.(t, e.filter((e) => t.includes(e.id)));
823
836
  }, [
824
- fe,
837
+ H,
825
838
  d,
826
839
  e
827
- ]), ke = L((e) => {
828
- let t = ye.has(e.id) ? ge.filter((t) => t !== e.id) : [...ge, e.id];
829
- Oe(t);
840
+ ]), He = U((e) => {
841
+ if (Z.current) return;
842
+ let t = be.has(e.id) ? ye.filter((t) => t !== e.id) : [...ye, e.id];
843
+ Be(t);
830
844
  }, [
845
+ be,
831
846
  ye,
832
- ge,
833
- Oe
834
- ]), Y = L((e, t) => {
835
- be && (H || W(e), _?.(e, t));
847
+ Be
848
+ ]), Ue = U((e, t) => {
849
+ xe && (J || we(e), _?.(e, t));
836
850
  }, [
837
- H,
851
+ J,
838
852
  _,
839
- be
840
- ]), X = L((e) => {
841
- K((t) => ({
853
+ xe
854
+ ]), We = U((e) => {
855
+ Z.current || (Q(null), De((t) => ({
842
856
  ...t,
843
- [e.id]: st(e)
844
- })), Y(e.id, e), y?.(e);
845
- }, [y, Y]), Z = L((e) => Ce[e.id] ?? st(e), [Ce]), Q = L((e, t) => {
846
- K((n) => ({
857
+ [e.id]: ft(e)
858
+ })), Ue(e.id, e), C?.(e));
859
+ }, [C, Ue]), Ge = U((e) => Te[e.id] ?? ft(e), [Te]), Ke = U((e, t) => {
860
+ Z.current || De((n) => ({
847
861
  ...n,
848
- [e.id]: t(n[e.id] ?? st(e))
862
+ [e.id]: t(n[e.id] ?? ft(e))
849
863
  }));
850
- }, []), je = L((e) => {
851
- let t = Z(e);
852
- K((t) => {
864
+ }, []), qe = U((e) => {
865
+ if (Z.current) return;
866
+ let t = Ge(e);
867
+ Q(null), De((t) => {
853
868
  let { [e.id]: n, ...r } = t;
854
869
  return r;
855
- }), Y(null, e), j?.(e, t);
870
+ }), Ue(null, e), N?.(e, t);
856
871
  }, [
857
- Z,
858
- j,
859
- Y
860
- ]), Me = L((e) => {
861
- let t = Z(e), n = e.values ?? [], r = new Set(n.map((e) => e.id)), i = new Set(t.values.map((e) => e.id));
862
- A?.(e, t), te?.(e, t.name), n.forEach((n) => {
863
- let r = t.values.find((e) => e.id === n.id);
864
- r && it(n.label) !== it(r.label) && k?.(e, n, it(r.label));
865
- }), t.values.forEach((t) => {
866
- r.has(t.id) || E?.(e);
867
- }), n.forEach((t) => {
868
- i.has(t.id) || D?.(e, t);
869
- }), K((t) => {
870
- let { [e.id]: n, ...r } = t;
871
- return r;
872
- }), Y(null, e), ne?.(e);
872
+ Ge,
873
+ N,
874
+ Ue
875
+ ]), Je = U(async (e) => {
876
+ if (Z.current) return !1;
877
+ Z.current = !0, Ae(e.id), Q(null);
878
+ let t = Ge(e), n = e.values ?? [], r = new Set(n.map((e) => e.id)), i = new Set(t.values.map((e) => e.id));
879
+ try {
880
+ let a = ie?.(e, t);
881
+ return a && await a, Oe.current ? (j?.(e, t.name), n.forEach((n) => {
882
+ let r = t.values.find((e) => e.id === n.id);
883
+ r && lt(n.label) !== lt(r.label) && ne?.(e, n, lt(r.label));
884
+ }), t.values.forEach((t) => {
885
+ r.has(t.id) || E?.(e);
886
+ }), n.forEach((t) => {
887
+ i.has(t.id) || A?.(e, t);
888
+ }), De((t) => {
889
+ let { [e.id]: n, ...r } = t;
890
+ return r;
891
+ }), Ue(null, e), re?.(e), !0) : !1;
892
+ } catch (t) {
893
+ return Oe.current && (Q({
894
+ optionId: e.id,
895
+ message: t instanceof Error && t.message ? t.message : V.saveErrorMessage ?? Me.saveErrorMessage
896
+ }), ae?.(t)), !1;
897
+ } finally {
898
+ Z.current = !1, Oe.current && Ae(null);
899
+ }
873
900
  }, [
874
- Z,
901
+ Ge,
875
902
  E,
876
- D,
877
- ne,
878
- te,
879
903
  A,
880
- k,
881
- Y
882
- ]), Ne = m(), [Pe, Fe] = _e(null), Ie = L((e) => {
883
- let t = Z(e), n = new Set(t.values.map((e) => e.id)), r = (e.values ?? []).filter((e) => !n.has(e.id)).length;
884
- if (S === !1 || r === 0) {
885
- Me(e);
904
+ re,
905
+ j,
906
+ ie,
907
+ ae,
908
+ ne,
909
+ V.saveErrorMessage,
910
+ Ue
911
+ ]), Xe = y(), [Ze, Qe] = _e(null);
912
+ me(() => {
913
+ je && !Xe.isOpen && (Ne.current?.focus(), Ne.current?.scrollIntoView?.({ block: "nearest" }));
914
+ }, [je, Xe.isOpen]);
915
+ let $e = U((e) => {
916
+ if (Z.current) return;
917
+ let t = Ge(e), n = new Set(t.values.map((e) => e.id)), r = (e.values ?? []).filter((e) => !n.has(e.id)).length;
918
+ if (T === !1 || r === 0) {
919
+ Je(e);
886
920
  return;
887
921
  }
888
- Fe({
922
+ Qe({
889
923
  option: e,
890
924
  removed: r
891
- }), Ne.show();
925
+ }), Xe.show();
892
926
  }, [
893
- Me,
894
- S,
895
- Z,
896
- Ne
897
- ]), Le = L((e) => {
898
- we === e.id && (K((t) => {
927
+ Je,
928
+ T,
929
+ Ge,
930
+ Xe
931
+ ]), et = U((e) => {
932
+ Z.current || (Ie === e.id && (De((t) => {
899
933
  let { [e.id]: n, ...r } = t;
900
934
  return r;
901
- }), Y(null, e)), x?.(e);
935
+ }), Ue(null, e)), w?.(e));
902
936
  }, [
903
- x,
904
- we,
905
- Y
906
- ]), Re = m(), [ze, Be] = _e(null), Ve = L((e) => {
907
- if (S === !1) {
908
- Le(e);
909
- return;
937
+ w,
938
+ Ie,
939
+ Ue
940
+ ]), tt = y(), [nt, rt] = _e(null), it = U((e) => {
941
+ if (!Z.current) {
942
+ if (T === !1) {
943
+ et(e);
944
+ return;
945
+ }
946
+ rt(e), tt.show();
910
947
  }
911
- Be(e), Re.show();
912
948
  }, [
913
- S,
914
- Le,
915
- Re
916
- ]), He = v ? /* @__PURE__ */ z(a, {
949
+ T,
950
+ et,
951
+ tt
952
+ ]), at = S ? /* @__PURE__ */ G(a, {
917
953
  type: "button",
918
954
  tone: "neutral",
919
- onClick: v,
920
- icon: G,
921
- children: I.createLabel
922
- }) : void 0, Ue = Ee ? /* @__PURE__ */ z("div", {
955
+ onClick: () => {
956
+ Z.current || S();
957
+ },
958
+ disabled: $,
959
+ icon: Y,
960
+ children: V.createLabel
961
+ }) : void 0, ot = Re ? /* @__PURE__ */ G("div", {
923
962
  className: "product-options-matrix--panel-header p-surface",
924
- children: /* @__PURE__ */ B(u, {
963
+ children: /* @__PURE__ */ K(u, {
925
964
  direction: "horizontal",
926
965
  gap: "md",
927
966
  justify: "between",
928
- children: [/* @__PURE__ */ z(o, {
967
+ children: [/* @__PURE__ */ G(o, {
929
968
  type: "inherit",
930
969
  weight: "semibold",
931
- children: I.title
932
- }), He]
970
+ children: V.title
971
+ }), at]
933
972
  })
934
- }) : null, Ge = /* @__PURE__ */ B("div", {
973
+ }) : null, st = /* @__PURE__ */ K("div", {
935
974
  className: "product-options-matrix--body min-w-0",
936
975
  children: [
937
- /* @__PURE__ */ B("div", {
938
- className: "product-options-matrix--panel overflow-hidden rounded-radius border border-border bg-background text-foreground",
939
- children: [Ue, Te ? /* @__PURE__ */ B("div", {
940
- className: i("product-options-matrix--list", Ee && "border-t border-border/60"),
976
+ /* @__PURE__ */ K("div", {
977
+ className: "product-options-matrix--panel overflow-hidden rounded-surface border border-border bg-background text-foreground",
978
+ children: [ot, Le ? /* @__PURE__ */ K("div", {
979
+ className: i("product-options-matrix--list", Re && "border-t border-border/60"),
941
980
  children: [e.map((e, t) => {
942
- let n = e.values ?? [], r = ye.has(e.id), s = we === e.id, l = !!y || be, d = !!x, f = !!E, p = Z(e), m = N?.(e, {
981
+ let n = e.values ?? [], r = be.has(e.id), s = Ie === e.id, l = !!C || xe, d = !!w, m = !!E, g = Ge(e), _ = je?.optionId === e.id ? je : null, y = ke === e.id, b = F?.(e, {
943
982
  index: t,
944
- onEdit: l ? () => X(e) : void 0,
945
- onDelete: x ? () => Ve(e) : void 0,
946
- onAddValue: E ? () => E(e) : void 0,
947
- onToggleCollapsed: () => ke(e),
983
+ onEdit: l && !$ ? () => We(e) : void 0,
984
+ onDelete: w && !$ ? () => it(e) : void 0,
985
+ onAddValue: E && !$ ? () => {
986
+ Z.current || E(e);
987
+ } : void 0,
988
+ onToggleCollapsed: () => He(e),
948
989
  collapsed: r
949
- }), h = [...f ? [{
990
+ }), S = [...m ? [{
950
991
  id: "add-value",
951
- label: I.addValueLabel,
952
- icon: /* @__PURE__ */ z(G, { className: "size-icon-md" }),
953
- onClick: () => E?.(e),
992
+ label: V.addValueLabel,
993
+ disabled: $,
994
+ icon: /* @__PURE__ */ G(Y, { className: "size-icon-md" }),
995
+ onClick: () => {
996
+ Z.current || E?.(e);
997
+ },
954
998
  tone: "secondary",
955
999
  buttonStyle: "ghost"
956
1000
  }] : [], ...d ? [{
957
1001
  id: "delete",
958
- label: I.deleteLabel,
959
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
960
- onClick: () => Ve(e),
1002
+ label: V.deleteLabel,
1003
+ disabled: $,
1004
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1005
+ onClick: () => it(e),
961
1006
  tone: "destructive"
962
- }] : []], _ = ae ? /* @__PURE__ */ B(ve, { children: [!!l && /* @__PURE__ */ z(a, {
1007
+ }] : []], T = z && (l || S.length > 0) ? /* @__PURE__ */ K(ve, { children: [!!l && /* @__PURE__ */ G(a, {
963
1008
  type: "button",
964
1009
  tone: "secondary",
965
1010
  buttonStyle: "ghost",
966
- onClick: () => X(e),
967
- children: I.editLabel
968
- }), /* @__PURE__ */ z(We, {
1011
+ onClick: () => We(e),
1012
+ disabled: $,
1013
+ children: V.editLabel
1014
+ }), /* @__PURE__ */ G(Ye, {
969
1015
  item: e,
970
- actions: h,
971
- menuLabel: I.actionsLabel
972
- })] }) : null, v = m === void 0 ? _ : m;
973
- if (s) return /* @__PURE__ */ z("div", {
1016
+ actions: S,
1017
+ menuLabel: V.actionsLabel
1018
+ })] }) : null, j = b === void 0 ? T : b;
1019
+ if (s) return /* @__PURE__ */ G("div", {
974
1020
  className: "product-options-matrix--item product-options-matrix--item-editing border-b border-border/60 p-surface last:border-b-0",
975
- children: /* @__PURE__ */ B("div", {
976
- className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-space-md gap-y-space-lg",
977
- children: [/* @__PURE__ */ z("span", {
978
- className: "product-options-matrix--drag-handle self-start flex size-icon-lg items-center justify-center text-muted-foreground",
979
- "aria-hidden": "true",
980
- children: /* @__PURE__ */ z(U, { className: "size-icon-sm" })
981
- }), /* @__PURE__ */ B(u, {
982
- gap: "lg",
983
- className: "product-options-matrix--editor",
984
- children: [
985
- /* @__PURE__ */ z(T, {
986
- label: I.optionNameLabel,
987
- className: "product-options-matrix--editor-field",
988
- children: /* @__PURE__ */ z(w, {
989
- value: p.name,
990
- onChange: (t) => {
991
- let n = t.currentTarget.value;
992
- Q(e, (e) => ({
993
- ...e,
994
- name: n
995
- }));
996
- },
997
- "aria-label": I.optionNameLabel,
998
- className: "bg-background"
999
- })
1000
- }),
1001
- /* @__PURE__ */ B(u, {
1002
- gap: "sm",
1003
- className: "product-options-matrix--editor-field",
1004
- children: [/* @__PURE__ */ z(o, {
1005
- type: "inherit",
1006
- weight: "medium",
1007
- children: I.optionValuesLabel
1008
- }), /* @__PURE__ */ B(u, {
1009
- gap: "xs",
1010
- className: "product-options-matrix--editor-values",
1011
- children: [
1012
- p.values.length === 0 && /* @__PURE__ */ z(o, {
1013
- size: "xs",
1014
- type: "secondary",
1015
- children: I.noValuesLabel
1016
- }),
1017
- p.values.map((t) => /* @__PURE__ */ B("div", {
1018
- className: "product-options-matrix--editor-value grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-space-sm",
1019
- children: [
1020
- /* @__PURE__ */ z("span", {
1021
- className: "flex size-icon-lg items-center justify-center text-muted-foreground",
1022
- "aria-hidden": "true",
1023
- children: /* @__PURE__ */ z(U, { className: "size-icon-sm" })
1024
- }),
1025
- /* @__PURE__ */ z(w, {
1026
- value: it(t.label),
1027
- onChange: (n) => {
1028
- let r = n.currentTarget.value;
1029
- Q(e, (e) => ({
1030
- ...e,
1031
- values: e.values.map((e) => e.id === t.id ? {
1032
- ...e,
1033
- label: r
1034
- } : e)
1035
- }));
1036
- },
1037
- "aria-label": `${I.optionValuesLabel}: ${it(t.label)}`,
1038
- className: "bg-background"
1039
- }),
1040
- /* @__PURE__ */ B(a, {
1041
- type: "button",
1042
- size: "sm",
1043
- iconOnly: !0,
1044
- tone: "secondary",
1045
- buttonStyle: "ghost",
1046
- onClick: () => Q(e, (e) => ({
1021
+ children: /* @__PURE__ */ K(u, {
1022
+ gap: "lg",
1023
+ className: "product-options-matrix--editor",
1024
+ "aria-busy": y,
1025
+ children: [
1026
+ _ && /* @__PURE__ */ K(p, {
1027
+ ref: Ne,
1028
+ tabIndex: -1,
1029
+ tone: "destructive",
1030
+ children: [/* @__PURE__ */ G(h, { children: V.saveErrorTitle ?? Me.saveErrorTitle }), /* @__PURE__ */ G(f, { children: _.message })]
1031
+ }),
1032
+ /* @__PURE__ */ G(k, {
1033
+ label: V.optionNameLabel,
1034
+ className: "product-options-matrix--editor-field",
1035
+ children: /* @__PURE__ */ G(O, {
1036
+ value: g.name,
1037
+ disabled: $,
1038
+ onChange: (t) => {
1039
+ let n = t.currentTarget.value;
1040
+ Ke(e, (e) => ({
1041
+ ...e,
1042
+ name: n
1043
+ }));
1044
+ },
1045
+ "aria-label": V.optionNameLabel,
1046
+ className: "bg-background"
1047
+ })
1048
+ }),
1049
+ /* @__PURE__ */ K(u, {
1050
+ gap: "sm",
1051
+ className: "product-options-matrix--editor-field",
1052
+ children: [/* @__PURE__ */ G(o, {
1053
+ type: "inherit",
1054
+ weight: "medium",
1055
+ children: V.optionValuesLabel
1056
+ }), /* @__PURE__ */ K(u, {
1057
+ gap: "xs",
1058
+ className: "product-options-matrix--editor-values",
1059
+ children: [
1060
+ g.values.length === 0 && /* @__PURE__ */ G(o, {
1061
+ size: "xs",
1062
+ type: "secondary",
1063
+ children: V.noValuesLabel
1064
+ }),
1065
+ g.values.map((t) => /* @__PURE__ */ K("div", {
1066
+ className: "product-options-matrix--editor-value grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-space-sm",
1067
+ children: [/* @__PURE__ */ G(O, {
1068
+ ref: t.id === Pe.current ? Fe : void 0,
1069
+ value: lt(t.label),
1070
+ disabled: $,
1071
+ onChange: (n) => {
1072
+ let r = n.currentTarget.value;
1073
+ Ke(e, (e) => ({
1074
+ ...e,
1075
+ values: e.values.map((e) => e.id === t.id ? {
1047
1076
  ...e,
1048
- values: e.values.filter((e) => e.id !== t.id)
1049
- })),
1050
- "aria-label": I.deleteValueLabel,
1051
- className: "text-muted-foreground hover:text-destructive",
1052
- children: [/* @__PURE__ */ z(q, {
1053
- className: "size-icon-sm",
1054
- "aria-hidden": "true"
1055
- }), /* @__PURE__ */ z(o, {
1056
- tag: "span",
1057
- size: "pxs",
1058
- className: "sr-only",
1059
- children: I.deleteValueLabel
1060
- })]
1061
- })
1062
- ]
1063
- }, t.id)),
1064
- /* @__PURE__ */ B("div", {
1065
- className: "product-options-matrix--editor-add-value grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-space-sm",
1066
- children: [
1067
- /* @__PURE__ */ z("span", {
1068
- className: "size-icon-lg",
1069
- "aria-hidden": "true"
1070
- }),
1071
- /* @__PURE__ */ z(a, {
1072
- type: "button",
1073
- tone: "secondary",
1074
- buttonStyle: "outline",
1075
- onClick: () => Q(e, (t) => {
1076
- let n = t.values.length + 1;
1077
- return {
1078
- ...t,
1079
- values: [...t.values, {
1080
- id: `${e.id}-draft-value-${n}`,
1081
- label: ""
1082
- }]
1083
- };
1084
- }),
1085
- fullWidth: !0,
1086
- className: "justify-start text-muted-foreground",
1087
- children: I.addAnotherValueLabel
1088
- }),
1089
- /* @__PURE__ */ z("span", {
1090
- className: "size-action-sm",
1091
- "aria-hidden": "true"
1092
- })
1093
- ]
1077
+ label: r
1078
+ } : e)
1079
+ }));
1080
+ },
1081
+ "aria-label": `${V.optionValuesLabel}: ${lt(t.label)}`,
1082
+ className: "bg-background"
1083
+ }), /* @__PURE__ */ K(a, {
1084
+ type: "button",
1085
+ size: "sm",
1086
+ iconOnly: !0,
1087
+ tone: "secondary",
1088
+ buttonStyle: "ghost",
1089
+ onClick: () => Ke(e, (e) => ({
1090
+ ...e,
1091
+ values: e.values.filter((e) => e.id !== t.id)
1092
+ })),
1093
+ "aria-label": V.deleteValueLabel,
1094
+ disabled: $,
1095
+ className: "text-muted-foreground hover:text-destructive",
1096
+ children: [/* @__PURE__ */ G(X, {
1097
+ className: "size-icon-sm",
1098
+ "aria-hidden": "true"
1099
+ }), /* @__PURE__ */ G(o, {
1100
+ tag: "span",
1101
+ size: "pxs",
1102
+ className: "sr-only",
1103
+ children: V.deleteValueLabel
1104
+ })]
1105
+ })]
1106
+ }, t.id)),
1107
+ /* @__PURE__ */ G("div", {
1108
+ className: "product-options-matrix--editor-add-value min-w-0",
1109
+ children: /* @__PURE__ */ G(a, {
1110
+ type: "button",
1111
+ tone: "secondary",
1112
+ buttonStyle: "outline",
1113
+ disabled: $,
1114
+ onClick: () => Ke(e, (t) => {
1115
+ let n = t.values.length + 1, r = `${e.id}-draft-value-${n}`;
1116
+ return Pe.current = r, {
1117
+ ...t,
1118
+ values: [...t.values, {
1119
+ id: r,
1120
+ label: ""
1121
+ }]
1122
+ };
1123
+ }),
1124
+ fullWidth: !0,
1125
+ className: "justify-start text-muted-foreground",
1126
+ children: V.addAnotherValueLabel
1094
1127
  })
1095
- ]
1096
- })]
1097
- }),
1098
- /* @__PURE__ */ B(u, {
1128
+ })
1129
+ ]
1130
+ })]
1131
+ }),
1132
+ /* @__PURE__ */ K(u, {
1133
+ direction: "horizontal",
1134
+ gap: "md",
1135
+ justify: "between",
1136
+ wrap: !1,
1137
+ className: "product-options-matrix--editor-actions",
1138
+ children: [/* @__PURE__ */ G("div", { children: !!w && /* @__PURE__ */ G(a, {
1139
+ type: "button",
1140
+ tone: "destructive",
1141
+ buttonStyle: "outline",
1142
+ onClick: () => it(e),
1143
+ disabled: $,
1144
+ children: V.deleteLabel
1145
+ }) }), /* @__PURE__ */ K(u, {
1099
1146
  direction: "horizontal",
1100
- gap: "md",
1101
- justify: "between",
1147
+ gap: "sm",
1148
+ justify: "end",
1102
1149
  wrap: !1,
1103
- className: "product-options-matrix--editor-actions",
1104
- children: [/* @__PURE__ */ z("div", { children: !!x && /* @__PURE__ */ z(a, {
1150
+ children: [/* @__PURE__ */ G(a, {
1105
1151
  type: "button",
1106
- tone: "destructive",
1107
- buttonStyle: "outline",
1108
- onClick: () => Ve(e),
1109
- children: I.deleteLabel
1110
- }) }), /* @__PURE__ */ B(u, {
1111
- direction: "horizontal",
1112
- gap: "sm",
1113
- justify: "end",
1114
- wrap: !1,
1115
- children: [/* @__PURE__ */ z(a, {
1116
- type: "button",
1117
- tone: "secondary",
1118
- buttonStyle: "ghost",
1119
- onClick: () => je(e),
1120
- children: I.cancelLabel
1121
- }), /* @__PURE__ */ z(a, {
1122
- type: "button",
1123
- tone: "neutral",
1124
- onClick: () => Ie(e),
1125
- children: I.saveLabel ?? I.doneLabel
1126
- })]
1152
+ tone: "secondary",
1153
+ buttonStyle: "ghost",
1154
+ onClick: () => qe(e),
1155
+ disabled: $,
1156
+ children: V.cancelLabel
1157
+ }), /* @__PURE__ */ G(a, {
1158
+ type: "button",
1159
+ tone: "neutral",
1160
+ onClick: () => $e(e),
1161
+ disabled: $,
1162
+ loading: y,
1163
+ strings: { loading: V.savingLabel },
1164
+ children: _ ? V.retrySaveLabel ?? V.saveLabel : V.saveLabel ?? V.doneLabel
1127
1165
  })]
1128
- })
1129
- ]
1130
- })]
1166
+ })]
1167
+ })
1168
+ ]
1131
1169
  })
1132
1170
  }, e.id);
1133
- let S = /* @__PURE__ */ B(u, {
1134
- render: /* @__PURE__ */ z("span", {}),
1171
+ let ne = /* @__PURE__ */ K(u, {
1172
+ render: /* @__PURE__ */ G("span", {}),
1135
1173
  gap: "sm",
1136
1174
  children: [
1137
- /* @__PURE__ */ B(u, {
1138
- render: /* @__PURE__ */ z("span", {}),
1175
+ /* @__PURE__ */ K(u, {
1176
+ render: /* @__PURE__ */ G("span", {}),
1139
1177
  direction: "horizontal",
1140
1178
  gap: "sm",
1141
- children: [/* @__PURE__ */ z(o, {
1179
+ children: [/* @__PURE__ */ G(o, {
1142
1180
  type: "inherit",
1143
1181
  tag: "span",
1144
1182
  weight: "semibold",
@@ -1146,37 +1184,39 @@ function ct({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
1146
1184
  children: e.name
1147
1185
  }), e.badge]
1148
1186
  }),
1149
- !!e.description && /* @__PURE__ */ z(o, {
1187
+ !!e.description && /* @__PURE__ */ G(o, {
1150
1188
  tag: "span",
1151
1189
  size: "xs",
1152
1190
  type: "secondary",
1153
1191
  className: "max-w-prose",
1154
1192
  children: e.description
1155
1193
  }),
1156
- !r && /* @__PURE__ */ z(u, {
1157
- render: /* @__PURE__ */ z("span", {}),
1194
+ !r && /* @__PURE__ */ G(u, {
1195
+ render: /* @__PURE__ */ G("span", {}),
1158
1196
  gap: "sm",
1159
1197
  className: "product-options-matrix--values",
1160
- children: n.length === 0 ? /* @__PURE__ */ z(o, {
1198
+ children: n.length === 0 ? /* @__PURE__ */ G(o, {
1161
1199
  tag: "span",
1162
1200
  size: "xs",
1163
1201
  type: "secondary",
1164
- children: I.noValuesLabel
1165
- }) : /* @__PURE__ */ z("span", {
1202
+ children: V.noValuesLabel
1203
+ }) : /* @__PURE__ */ G("span", {
1166
1204
  className: "flex flex-wrap gap-space-xs",
1167
1205
  children: n.map((n, r) => {
1168
- let a = D ? () => D(e, n) : void 0, s = P?.(n, {
1206
+ let a = A ? () => {
1207
+ Z.current || A(e, n);
1208
+ } : void 0, s = I?.(n, {
1169
1209
  option: e,
1170
1210
  optionIndex: t,
1171
1211
  valueIndex: r,
1172
1212
  onDelete: a
1173
1213
  });
1174
- return s ? /* @__PURE__ */ z(me, { children: s }, n.id) : /* @__PURE__ */ B(b, {
1214
+ return s ? /* @__PURE__ */ G(pe, { children: s }, n.id) : /* @__PURE__ */ K(ee, {
1175
1215
  size: "sm",
1176
1216
  tone: "neutral",
1177
1217
  className: i("product-options-matrix--value", n.disabled && "opacity-50"),
1178
1218
  children: [
1179
- at(n.label) ? /* @__PURE__ */ z(o, {
1219
+ ut(n.label) ? /* @__PURE__ */ G(o, {
1180
1220
  type: "inherit",
1181
1221
  tag: "span",
1182
1222
  size: "inherit",
@@ -1184,19 +1224,20 @@ function ct({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
1184
1224
  children: n.label
1185
1225
  }) : n.label,
1186
1226
  n.badge,
1187
- !!a && ae && /* @__PURE__ */ B("button", {
1227
+ !!a && z && /* @__PURE__ */ K("button", {
1188
1228
  type: "button",
1189
1229
  onClick: a,
1190
- "aria-label": I.deleteValueLabel,
1191
- className: i(C.target, C.focus, c.inset, C.clear, "hover:text-destructive"),
1192
- children: [/* @__PURE__ */ z(J, {
1193
- className: C.icon,
1230
+ disabled: $,
1231
+ "aria-label": V.deleteValueLabel,
1232
+ className: i(D.target, D.focus, c.inset, D.clear, "hover:text-destructive"),
1233
+ children: [/* @__PURE__ */ G(Ee, {
1234
+ className: D.icon,
1194
1235
  "aria-hidden": "true"
1195
- }), /* @__PURE__ */ z(o, {
1236
+ }), /* @__PURE__ */ G(o, {
1196
1237
  tag: "span",
1197
1238
  size: "pxs",
1198
1239
  className: "sr-only",
1199
- children: I.deleteValueLabel
1240
+ children: V.deleteValueLabel
1200
1241
  })]
1201
1242
  })
1202
1243
  ]
@@ -1206,166 +1247,177 @@ function ct({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
1206
1247
  })
1207
1248
  ]
1208
1249
  });
1209
- return /* @__PURE__ */ z("div", {
1250
+ return /* @__PURE__ */ G("div", {
1210
1251
  className: "product-options-matrix--item border-b border-border/60 last:border-b-0",
1211
- children: /* @__PURE__ */ B("div", {
1212
- className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-space-md gap-y-space-md p-surface @2xl/product-options-matrix:grid-cols-[auto_minmax(0,1fr)_auto]",
1252
+ children: /* @__PURE__ */ K("div", {
1253
+ className: i("grid min-w-0 items-center gap-x-space-md gap-y-space-md p-surface", R ? "grid-cols-[auto_minmax(0,1fr)] @2xl/product-options-matrix:grid-cols-[auto_minmax(0,1fr)_auto]" : "grid-cols-1 @2xl/product-options-matrix:grid-cols-[minmax(0,1fr)_auto]"),
1213
1254
  children: [
1214
- ie ? /* @__PURE__ */ B(a, {
1255
+ R && /* @__PURE__ */ K(a, {
1215
1256
  type: "button",
1216
1257
  size: "sm",
1217
1258
  iconOnly: !0,
1218
1259
  tone: "secondary",
1219
1260
  buttonStyle: "ghost",
1220
- onClick: () => ke(e),
1261
+ onClick: () => He(e),
1262
+ disabled: $,
1221
1263
  "aria-expanded": !r,
1222
- "aria-label": r ? I.expandOptionLabel : I.collapseOptionLabel,
1264
+ "aria-label": r ? V.expandOptionLabel : V.collapseOptionLabel,
1223
1265
  className: "product-options-matrix--collapse-trigger mt-space-2xs shrink-0 text-muted-foreground",
1224
- children: [/* @__PURE__ */ z(V, {
1266
+ children: [/* @__PURE__ */ G(q, {
1225
1267
  className: i("size-icon-sm transition-transform", r && "-rotate-90"),
1226
1268
  "aria-hidden": "true"
1227
- }), /* @__PURE__ */ z(o, {
1269
+ }), /* @__PURE__ */ G(o, {
1228
1270
  tag: "span",
1229
1271
  size: "pxs",
1230
1272
  className: "sr-only",
1231
- children: r ? I.expandOptionLabel : I.collapseOptionLabel
1273
+ children: r ? V.expandOptionLabel : V.collapseOptionLabel
1232
1274
  })]
1233
- }) : /* @__PURE__ */ z("span", {
1234
- className: "product-options-matrix--drag-handle flex size-icon-lg items-center justify-center text-muted-foreground",
1235
- "aria-hidden": "true",
1236
- children: /* @__PURE__ */ z(U, { className: "size-icon-sm" })
1237
1275
  }),
1238
- /* @__PURE__ */ z("div", {
1276
+ /* @__PURE__ */ G("div", {
1239
1277
  className: "product-options-matrix--item-main min-w-0",
1240
- children: l && !ae ? /* @__PURE__ */ z("button", {
1278
+ children: l && !z ? /* @__PURE__ */ G("button", {
1241
1279
  type: "button",
1242
- onClick: () => X(e),
1243
- "aria-label": ot(I.editLabel, e),
1244
- className: `product-options-matrix--edit-summary ${g.nativeButtonReset} block w-full cursor-pointer whitespace-normal rounded-inner text-start text-inherit outline-none ${c.edge}`,
1245
- children: S
1246
- }) : S
1280
+ onClick: () => We(e),
1281
+ disabled: $,
1282
+ "aria-label": dt(V.editLabel, e),
1283
+ className: `product-options-matrix--edit-summary ${x.nativeButtonReset} block w-full cursor-pointer whitespace-normal rounded-radius text-start text-inherit outline-none ${c.edge}`,
1284
+ children: ne
1285
+ }) : ne
1247
1286
  }),
1248
- (oe || !!v) && /* @__PURE__ */ B("div", {
1249
- className: "product-options-matrix--item-actions col-start-2 flex min-w-fit items-center gap-space-md justify-start @2xl/product-options-matrix:justify-end lg:col-start-auto",
1250
- children: [!!M && oe && /* @__PURE__ */ B("div", {
1287
+ (!!P && B || !!j) && /* @__PURE__ */ K("div", {
1288
+ className: i("product-options-matrix--item-actions flex min-w-0 flex-wrap items-center justify-start @2xl/product-options-matrix:col-start-auto @2xl/product-options-matrix:justify-end", R ? "col-start-2" : "col-start-1", v.commands),
1289
+ children: [!!P && B && /* @__PURE__ */ K("div", {
1251
1290
  className: "inline-flex items-center gap-space-sm",
1252
- children: [/* @__PURE__ */ z(o, {
1291
+ children: [/* @__PURE__ */ G(o, {
1253
1292
  tag: "span",
1254
1293
  id: `product-option-${e.id}-variant-toggle-label`,
1255
1294
  size: "pxs",
1256
1295
  type: "secondary",
1257
1296
  weight: "medium",
1258
- children: I.useForVariantsLabel
1259
- }), /* @__PURE__ */ z(ee, {
1297
+ children: V.useForVariantsLabel
1298
+ }), /* @__PURE__ */ G(te, {
1260
1299
  checked: !!e.usedForVariants,
1261
- onValueChange: (t) => M(e, t),
1300
+ disabled: $,
1301
+ onValueChange: (t) => {
1302
+ Z.current || P(e, t);
1303
+ },
1262
1304
  "aria-labelledby": `product-option-${e.id}-variant-toggle-label`
1263
1305
  })]
1264
- }), v]
1306
+ }), j]
1265
1307
  })
1266
1308
  ]
1267
1309
  })
1268
1310
  }, e.id);
1269
- }), !!De && /* @__PURE__ */ z("div", {
1311
+ }), !!ze && /* @__PURE__ */ G("div", {
1270
1312
  className: "product-options-matrix--create-row border-t border-border/60 p-surface-xs",
1271
- children: /* @__PURE__ */ z(a, {
1313
+ children: /* @__PURE__ */ G(a, {
1272
1314
  type: "button",
1273
1315
  tone: "secondary",
1274
1316
  buttonStyle: "ghost",
1275
- onClick: v,
1276
- icon: Se,
1317
+ onClick: () => {
1318
+ Z.current || S?.();
1319
+ },
1320
+ disabled: $,
1321
+ icon: Ce,
1277
1322
  size: "sm",
1278
1323
  fullWidth: !0,
1279
1324
  className: "justify-start text-foreground",
1280
- children: I.addAnotherOptionLabel
1325
+ children: V.addAnotherOptionLabel
1281
1326
  })
1282
1327
  })]
1283
- }) : /* @__PURE__ */ z("div", {
1284
- className: i(Ee && "border-t border-border/60"),
1285
- children: le ?? /* @__PURE__ */ z($, {
1286
- title: I.emptyTitle,
1287
- description: I.emptyDescription,
1288
- action: v && !Ee ? /* @__PURE__ */ z(a, {
1328
+ }) : /* @__PURE__ */ G("div", {
1329
+ className: i(Re && "border-t border-border/60"),
1330
+ children: le ?? /* @__PURE__ */ G(Ve, {
1331
+ title: V.emptyTitle,
1332
+ description: V.emptyDescription,
1333
+ action: S && !Re ? /* @__PURE__ */ G(a, {
1289
1334
  tone: "primary",
1290
1335
  type: "button",
1291
- onClick: v,
1292
- icon: G,
1293
- children: I.createLabel
1336
+ onClick: S,
1337
+ icon: Y,
1338
+ children: V.createLabel
1294
1339
  }) : void 0
1295
1340
  })
1296
1341
  })]
1297
1342
  }),
1298
- !!(S !== !1 && Pe) && /* @__PURE__ */ z(h, {
1299
- ...Ne.overlayProps,
1343
+ !!(T !== !1 && Ze) && /* @__PURE__ */ G(b, {
1344
+ ...Xe.overlayProps,
1300
1345
  destructive: !0,
1301
- title: I.confirmRemoveValuesTitle,
1302
- description: n(I.confirmRemoveValuesDescription, { count: Pe.removed }),
1303
- strings: { confirm: I.confirmRemoveValuesLabel },
1304
- onConfirm: () => Me(Pe.option)
1346
+ title: V.confirmRemoveValuesTitle,
1347
+ description: n(V.confirmRemoveValuesDescription, { count: Ze.removed }),
1348
+ strings: {
1349
+ confirm: je?.optionId === Ze.option.id ? V.retrySaveLabel : V.confirmRemoveValuesLabel,
1350
+ loading: V.savingLabel
1351
+ },
1352
+ alertMessage: je?.optionId === Ze.option.id ? je.message : void 0,
1353
+ closeOnAsyncComplete: !1,
1354
+ onAsyncConfirm: async () => {
1355
+ await Je(Ze.option) && Xe.hide();
1356
+ }
1305
1357
  }),
1306
- !!(S !== !1 && x) && /* @__PURE__ */ z(h, {
1307
- ...Re.overlayProps,
1358
+ !!(T !== !1 && w) && /* @__PURE__ */ G(b, {
1359
+ ...tt.overlayProps,
1308
1360
  destructive: !0,
1309
- title: I.confirmDeleteOptionTitle,
1310
- description: I.confirmDeleteOptionDescription,
1311
- strings: { confirm: I.deleteLabel },
1361
+ title: V.confirmDeleteOptionTitle,
1362
+ description: V.confirmDeleteOptionDescription,
1363
+ strings: { confirm: V.deleteLabel },
1312
1364
  onConfirm: () => {
1313
- ze && Le(ze);
1365
+ nt && et(nt);
1314
1366
  }
1315
1367
  })
1316
1368
  ]
1317
1369
  });
1318
- return t === "embedded" ? /* @__PURE__ */ z("section", {
1319
- "aria-label": I.title,
1370
+ return t === "embedded" ? /* @__PURE__ */ G("section", {
1371
+ "aria-label": V.title,
1320
1372
  className: i("product-options-matrix--component @container/product-options-matrix min-w-0", ue),
1321
- children: Ge
1322
- }) : /* @__PURE__ */ z(O, {
1323
- title: I.title,
1324
- description: I.description,
1325
- actions: se,
1326
- headerAction: He,
1327
- headerEnd: ce,
1328
- footerSlot: F,
1373
+ children: st
1374
+ }) : /* @__PURE__ */ G(M, {
1375
+ title: V.title,
1376
+ description: V.description,
1377
+ actions: oe,
1378
+ headerAction: at,
1379
+ headerEnd: se,
1380
+ footerSlot: ce,
1329
1381
  className: i("product-options-matrix--component @container/product-options-matrix w-full", ue),
1330
- children: Ge
1382
+ children: st
1331
1383
  });
1332
1384
  }
1333
- ct.displayName = "ProductOptionsMatrix";
1385
+ pt.displayName = "ProductOptionsMatrix";
1334
1386
  //#endregion
1335
1387
  //#region src/components/features/products/components/product-options-summary.tsx
1336
- function lt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOption: o, onEditOption: s, onDeleteOption: c, renderOptionActions: l, actions: u, footerSlot: d, renderOption: f, empty: p, className: m, strings: h }) {
1337
- let g = r(ke, h), _ = !!(o || s || c || l), v = [...u ?? [], ...n && t ? [{
1388
+ function mt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOption: o, onEditOption: s, onDeleteOption: c, renderOptionActions: l, actions: u, footerSlot: d, renderOption: f, empty: p, className: m, strings: h }) {
1389
+ let g = r(je, h), _ = !!(o || s || c || l), v = [...u ?? [], ...n && t ? [{
1338
1390
  id: "manage-options",
1339
1391
  label: g.manageLabel,
1340
- icon: /* @__PURE__ */ z(K, { className: "size-icon-md" }),
1392
+ icon: /* @__PURE__ */ G(Te, { className: "size-icon-md" }),
1341
1393
  onClick: t
1342
- }] : []], y = n || t ? /* @__PURE__ */ z(a, {
1394
+ }] : []], y = n || t ? /* @__PURE__ */ G(a, {
1343
1395
  type: "button",
1344
1396
  tone: "secondary",
1345
1397
  buttonStyle: "ghost",
1346
1398
  onClick: n ?? t,
1347
- icon: n ? G : void 0,
1399
+ icon: n ? Y : void 0,
1348
1400
  children: n ? g.createLabel : g.manageLabel
1349
1401
  }) : void 0;
1350
- return /* @__PURE__ */ z(O, {
1402
+ return /* @__PURE__ */ G(M, {
1351
1403
  title: g.title,
1352
1404
  description: g.description,
1353
1405
  actions: v.length > 0 ? v : void 0,
1354
1406
  headerAction: y,
1355
1407
  footerSlot: d,
1356
1408
  className: i("product-options-summary--component w-full", m),
1357
- children: e.length === 0 ? p ?? /* @__PURE__ */ z($, {
1409
+ children: e.length === 0 ? p ?? /* @__PURE__ */ G(Ve, {
1358
1410
  title: g.emptyTitle,
1359
1411
  description: g.emptyDescription,
1360
- action: n ? /* @__PURE__ */ z(a, {
1412
+ action: n ? /* @__PURE__ */ G(a, {
1361
1413
  tone: "primary",
1362
1414
  type: "button",
1363
1415
  onClick: n,
1364
- icon: G,
1416
+ icon: Y,
1365
1417
  children: g.createLabel
1366
1418
  }) : void 0
1367
- }) : /* @__PURE__ */ z(N, { children: e.map((e, t) => (() => {
1368
- let n = _ ? /* @__PURE__ */ z(nt, {
1419
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => (() => {
1420
+ let n = _ ? /* @__PURE__ */ G(st, {
1369
1421
  option: e,
1370
1422
  index: t,
1371
1423
  onSelectOption: o,
@@ -1380,54 +1432,54 @@ function lt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOp
1380
1432
  actionsLabel: g.actionsLabel
1381
1433
  }
1382
1434
  }) : void 0;
1383
- return f ? /* @__PURE__ */ z("div", { children: f(e, t) }, e.id) : /* @__PURE__ */ z($e, {
1435
+ return f ? /* @__PURE__ */ G("div", { children: f(e, t) }, e.id) : /* @__PURE__ */ G(it, {
1384
1436
  item: e,
1385
1437
  actions: n
1386
1438
  }, e.id);
1387
1439
  })()) })
1388
1440
  });
1389
1441
  }
1390
- lt.displayName = "ProductOptionsSummary";
1442
+ mt.displayName = "ProductOptionsSummary";
1391
1443
  //#endregion
1392
1444
  //#region src/components/features/products/components/product-policies-card.tsx
1393
- function ut({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPolicy: o, onDeletePolicy: s, renderPolicyActions: c, actions: l, footerSlot: u, renderPolicy: d, empty: f, className: p, strings: m }) {
1394
- let h = r(Z, m), g = t ? /* @__PURE__ */ z(a, {
1445
+ function ht({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPolicy: o, onDeletePolicy: s, renderPolicyActions: c, actions: l, footerSlot: u, renderPolicy: d, empty: f, className: p, strings: m }) {
1446
+ let h = r(Pe, m), g = t ? /* @__PURE__ */ G(a, {
1395
1447
  type: "button",
1396
1448
  tone: "secondary",
1397
1449
  buttonStyle: "ghost",
1398
1450
  onClick: t,
1399
- icon: G,
1451
+ icon: Y,
1400
1452
  children: h.createLabel
1401
1453
  }) : void 0;
1402
- return /* @__PURE__ */ z(O, {
1454
+ return /* @__PURE__ */ G(M, {
1403
1455
  title: h.title,
1404
1456
  description: h.description,
1405
1457
  actions: l,
1406
1458
  headerAction: g,
1407
1459
  footerSlot: u,
1408
1460
  className: i("product-policies-card--component w-full", p),
1409
- children: e.length === 0 ? f ?? /* @__PURE__ */ z($, {
1461
+ children: e.length === 0 ? f ?? /* @__PURE__ */ G(Ve, {
1410
1462
  title: h.emptyTitle,
1411
1463
  description: h.emptyDescription,
1412
- action: t ? /* @__PURE__ */ z(a, {
1464
+ action: t ? /* @__PURE__ */ G(a, {
1413
1465
  tone: "primary",
1414
1466
  type: "button",
1415
1467
  onClick: t,
1416
- icon: G,
1468
+ icon: Y,
1417
1469
  children: h.createLabel
1418
1470
  }) : void 0
1419
- }) : /* @__PURE__ */ z(N, { children: e.map((e, t) => (() => {
1471
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => (() => {
1420
1472
  let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [...i ? [{
1421
1473
  id: "edit",
1422
1474
  label: h.editLabel,
1423
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
1475
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1424
1476
  onClick: () => i(),
1425
1477
  tone: "secondary",
1426
1478
  buttonStyle: "ghost"
1427
1479
  }] : [], ...a ? [{
1428
1480
  id: "delete",
1429
1481
  label: h.deleteLabel,
1430
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
1482
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1431
1483
  onClick: () => a(),
1432
1484
  tone: "destructive"
1433
1485
  }] : []], u = c ? c(e, {
@@ -1435,12 +1487,12 @@ function ut({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPoli
1435
1487
  onSelect: r,
1436
1488
  onEdit: i,
1437
1489
  onDelete: a
1438
- }) : /* @__PURE__ */ z(We, {
1490
+ }) : /* @__PURE__ */ G(Ye, {
1439
1491
  item: e,
1440
1492
  actions: l,
1441
1493
  menuLabel: h.actionsLabel
1442
1494
  });
1443
- return d ? /* @__PURE__ */ z("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ z($e, {
1495
+ return d ? /* @__PURE__ */ G("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ G(it, {
1444
1496
  item: e,
1445
1497
  actionLabel: h.viewLabel,
1446
1498
  onSelect: r,
@@ -1449,69 +1501,69 @@ function ut({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPoli
1449
1501
  })()) })
1450
1502
  });
1451
1503
  }
1452
- ut.displayName = "ProductPoliciesCard";
1504
+ ht.displayName = "ProductPoliciesCard";
1453
1505
  //#endregion
1454
1506
  //#region src/components/features/products/components/product-quote-preview-card.tsx
1455
- function dt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQuote: l, onCreateLine: d, onSelectLine: f, onEditLine: p, onDeleteLine: m, renderLineActions: h, actions: g, footerSlot: v, empty: y, className: b, strings: x }) {
1456
- let C = r(X, x), w = t !== void 0 || n !== void 0 || s !== void 0, T = d || l ? /* @__PURE__ */ B("div", {
1507
+ function gt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQuote: l, onCreateLine: d, onSelectLine: f, onEditLine: p, onDeleteLine: m, renderLineActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
1508
+ let x = r(Ne, b), C = t !== void 0 || n !== void 0 || s !== void 0, w = d || l ? /* @__PURE__ */ K("div", {
1457
1509
  className: "flex items-center gap-space-md",
1458
- children: [!!d && /* @__PURE__ */ z(a, {
1510
+ children: [!!d && /* @__PURE__ */ G(a, {
1459
1511
  type: "button",
1460
1512
  tone: "secondary",
1461
1513
  buttonStyle: "ghost",
1462
1514
  onClick: d,
1463
- icon: G,
1464
- children: C.createLineLabel
1465
- }), !!l && /* @__PURE__ */ z(a, {
1515
+ icon: Y,
1516
+ children: x.createLineLabel
1517
+ }), !!l && /* @__PURE__ */ G(a, {
1466
1518
  type: "button",
1467
1519
  tone: "secondary",
1468
1520
  buttonStyle: "ghost",
1469
1521
  onClick: l,
1470
- children: C.actionLabel
1522
+ children: x.actionLabel
1471
1523
  })]
1472
1524
  }) : void 0;
1473
- return /* @__PURE__ */ z(O, {
1474
- title: C.title,
1475
- description: C.description,
1525
+ return /* @__PURE__ */ G(M, {
1526
+ title: x.title,
1527
+ description: x.description,
1476
1528
  actions: g,
1477
- headerAction: T,
1478
- footerSlot: v,
1479
- className: i("product-quote-preview-card--component w-full", b),
1480
- children: e.length === 0 ? y ?? /* @__PURE__ */ z($, {
1481
- title: C.emptyTitle,
1482
- description: C.emptyDescription,
1483
- action: d ? /* @__PURE__ */ z(a, {
1529
+ headerAction: w,
1530
+ footerSlot: _,
1531
+ className: i("product-quote-preview-card--component w-full", y),
1532
+ children: e.length === 0 ? v ?? /* @__PURE__ */ G(Ve, {
1533
+ title: x.emptyTitle,
1534
+ description: x.emptyDescription,
1535
+ action: d ? /* @__PURE__ */ G(a, {
1484
1536
  tone: "primary",
1485
1537
  type: "button",
1486
1538
  onClick: d,
1487
- icon: G,
1488
- children: C.createLineLabel
1539
+ icon: Y,
1540
+ children: x.createLineLabel
1489
1541
  }) : void 0
1490
- }) : /* @__PURE__ */ B(u, {
1542
+ }) : /* @__PURE__ */ K(u, {
1491
1543
  gap: "2xl",
1492
1544
  className: "product-quote-preview-card--body",
1493
- children: [/* @__PURE__ */ z(N, { children: e.map((e, t) => {
1545
+ children: [/* @__PURE__ */ G(F, { children: e.map((e, t) => {
1494
1546
  let n = f ? () => f(e) : void 0, r = p ? () => p(e) : void 0, i = m ? () => m(e) : void 0, a = [
1495
1547
  ...n ? [{
1496
1548
  id: "open",
1497
- label: C.viewLineLabel,
1498
- icon: /* @__PURE__ */ z(H, { className: "size-icon-md" }),
1549
+ label: x.viewLineLabel,
1550
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
1499
1551
  onClick: () => n(),
1500
1552
  tone: "secondary",
1501
1553
  buttonStyle: "ghost"
1502
1554
  }] : [],
1503
1555
  ...r ? [{
1504
1556
  id: "edit",
1505
- label: C.editLineLabel,
1506
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
1557
+ label: x.editLineLabel,
1558
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1507
1559
  onClick: () => r(),
1508
1560
  tone: "secondary",
1509
1561
  buttonStyle: "ghost"
1510
1562
  }] : [],
1511
1563
  ...i ? [{
1512
1564
  id: "delete",
1513
- label: C.deleteLineLabel,
1514
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
1565
+ label: x.deleteLineLabel,
1566
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1515
1567
  onClick: () => i(),
1516
1568
  tone: "destructive"
1517
1569
  }] : []
@@ -1520,55 +1572,55 @@ function dt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQ
1520
1572
  onSelect: n,
1521
1573
  onEdit: r,
1522
1574
  onDelete: i
1523
- }) : /* @__PURE__ */ z(We, {
1575
+ }) : /* @__PURE__ */ G(Ye, {
1524
1576
  item: e,
1525
1577
  actions: a,
1526
- menuLabel: C.lineActionsLabel
1578
+ menuLabel: x.lineActionsLabel
1527
1579
  });
1528
- return /* @__PURE__ */ B(re, {
1580
+ return /* @__PURE__ */ K(L, {
1529
1581
  className: "product-quote-preview-card--line",
1530
- children: [/* @__PURE__ */ B(P, { children: [
1531
- /* @__PURE__ */ z(ie, { children: e.label }),
1532
- !!e.description && /* @__PURE__ */ z(j, { children: e.description }),
1533
- !!e.quantity && /* @__PURE__ */ z(j, { children: e.quantity })
1534
- ] }), /* @__PURE__ */ B(M, { children: [/* @__PURE__ */ z(_, {
1582
+ children: [/* @__PURE__ */ K(I, { children: [
1583
+ /* @__PURE__ */ G(R, { children: e.label }),
1584
+ !!e.description && /* @__PURE__ */ G(N, { children: e.description }),
1585
+ !!e.quantity && /* @__PURE__ */ G(N, { children: e.quantity })
1586
+ ] }), /* @__PURE__ */ K(P, { children: [/* @__PURE__ */ G(S, {
1535
1587
  type: "inherit",
1536
1588
  className: "tabular-nums",
1537
1589
  children: e.amount
1538
1590
  }), o] })]
1539
1591
  }, e.id);
1540
- }) }), /* @__PURE__ */ B(u, {
1592
+ }) }), /* @__PURE__ */ K(u, {
1541
1593
  gap: "lg",
1542
1594
  className: "product-quote-preview-card--totals",
1543
1595
  children: [
1544
- !!w && /* @__PURE__ */ B(u, {
1596
+ !!C && /* @__PURE__ */ K(u, {
1545
1597
  gap: "sm",
1546
1598
  children: [
1547
- t !== void 0 && /* @__PURE__ */ z(de, {
1548
- label: C.subtotalLabel,
1599
+ t !== void 0 && /* @__PURE__ */ G(de, {
1600
+ label: x.subtotalLabel,
1549
1601
  value: t,
1550
1602
  valueClassName: "tabular-nums"
1551
1603
  }),
1552
- n !== void 0 && /* @__PURE__ */ z(de, {
1553
- label: C.taxLabel,
1604
+ n !== void 0 && /* @__PURE__ */ G(de, {
1605
+ label: x.taxLabel,
1554
1606
  value: n,
1555
1607
  valueClassName: "tabular-nums"
1556
1608
  }),
1557
- s !== void 0 && /* @__PURE__ */ z(de, {
1558
- label: C.discountLabel,
1609
+ s !== void 0 && /* @__PURE__ */ G(de, {
1610
+ label: x.discountLabel,
1559
1611
  value: s,
1560
1612
  valueClassName: "tabular-nums text-success"
1561
1613
  })
1562
1614
  ]
1563
1615
  }),
1564
- !!w && /* @__PURE__ */ z(S, {}),
1565
- /* @__PURE__ */ z(de, {
1566
- label: /* @__PURE__ */ z(o, {
1616
+ !!C && /* @__PURE__ */ G(E, {}),
1617
+ /* @__PURE__ */ G(de, {
1618
+ label: /* @__PURE__ */ G(o, {
1567
1619
  type: "inherit",
1568
1620
  tag: "span",
1569
1621
  weight: "semibold",
1570
1622
  lineHeight: "tight",
1571
- children: C.totalLabel
1623
+ children: x.totalLabel
1572
1624
  }),
1573
1625
  value: c ?? "-",
1574
1626
  valueClassName: "font-semibold tabular-nums"
@@ -1578,135 +1630,135 @@ function dt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQ
1578
1630
  })
1579
1631
  });
1580
1632
  }
1581
- dt.displayName = "ProductQuotePreviewCard";
1633
+ gt.displayName = "ProductQuotePreviewCard";
1582
1634
  //#endregion
1583
1635
  //#region src/components/features/products/components/product-readiness-card.tsx
1584
- function ft({ items: e = [], score: t, scoreLabel: n, summary: s, onCreateReadinessItem: c, onSelectReadinessItem: l, onEditReadinessItem: d, onDeleteReadinessItem: f, renderReadinessItemActions: m, actions: h, footerSlot: g, renderItem: _, empty: v, className: b, strings: x }) {
1585
- let S = r(we, x), C = t === void 0 ? void 0 : Ve(t), w = c ? /* @__PURE__ */ z(a, {
1636
+ function _t({ items: e = [], score: t, scoreLabel: n, summary: s, onCreateReadinessItem: c, onSelectReadinessItem: l, onEditReadinessItem: d, onDeleteReadinessItem: f, renderReadinessItemActions: p, actions: m, footerSlot: h, renderItem: _, empty: v, className: y, strings: b }) {
1637
+ let x = r(De, b), S = t === void 0 ? void 0 : Ke(t), C = c ? /* @__PURE__ */ G(a, {
1586
1638
  type: "button",
1587
1639
  tone: "secondary",
1588
1640
  buttonStyle: "ghost",
1589
1641
  onClick: c,
1590
- icon: G,
1591
- children: S.createLabel
1642
+ icon: Y,
1643
+ children: x.createLabel
1592
1644
  }) : void 0;
1593
- return /* @__PURE__ */ B(O, {
1594
- title: S.title,
1595
- description: S.description,
1596
- actions: h,
1597
- headerAction: w,
1598
- footerSlot: g,
1645
+ return /* @__PURE__ */ K(M, {
1646
+ title: x.title,
1647
+ description: x.description,
1648
+ actions: m,
1649
+ headerAction: C,
1650
+ footerSlot: h,
1599
1651
  contentGap: "2xl",
1600
- className: i("product-readiness-card--component w-full", b),
1601
- children: [(C !== void 0 || !!s) && /* @__PURE__ */ B(u, {
1652
+ className: i("product-readiness-card--component w-full", y),
1653
+ children: [(S !== void 0 || !!s) && /* @__PURE__ */ K(u, {
1602
1654
  gap: "lg",
1603
1655
  className: "product-readiness-card--summary",
1604
- children: [C !== void 0 && /* @__PURE__ */ B(u, {
1656
+ children: [S !== void 0 && /* @__PURE__ */ K(u, {
1605
1657
  gap: "sm",
1606
1658
  className: "product-readiness-card--score",
1607
- children: [/* @__PURE__ */ B(u, {
1659
+ children: [/* @__PURE__ */ K(u, {
1608
1660
  direction: "horizontal",
1609
1661
  justify: "between",
1610
1662
  gap: "lg",
1611
- children: [/* @__PURE__ */ z(o, {
1663
+ children: [/* @__PURE__ */ G(o, {
1612
1664
  size: "xs",
1613
1665
  type: "secondary",
1614
- children: n ?? S.scoreLabel
1615
- }), /* @__PURE__ */ z(y, {
1666
+ children: n ?? x.scoreLabel
1667
+ }), /* @__PURE__ */ G(w, {
1616
1668
  type: "inherit",
1617
- value: C,
1669
+ value: S,
1618
1670
  scaled: !0,
1619
1671
  size: "xs",
1620
1672
  weight: "semibold"
1621
1673
  })]
1622
- }), /* @__PURE__ */ z(p, {
1623
- value: C,
1624
- "aria-label": typeof n == "string" ? n : S.progressLabel,
1625
- "aria-valuetext": `${C}%`,
1674
+ }), /* @__PURE__ */ G(g, {
1675
+ value: S,
1676
+ "aria-label": typeof n == "string" ? n : x.progressLabel,
1677
+ "aria-valuetext": `${S}%`,
1626
1678
  size: "sm"
1627
1679
  })]
1628
- }), !!s && /* @__PURE__ */ z(o, {
1680
+ }), !!s && /* @__PURE__ */ G(o, {
1629
1681
  type: "secondary",
1630
1682
  children: s
1631
1683
  })]
1632
- }), e.length === 0 ? v ?? /* @__PURE__ */ z($, {
1633
- title: S.emptyTitle,
1634
- description: S.emptyDescription,
1635
- action: c ? /* @__PURE__ */ z(a, {
1684
+ }), e.length === 0 ? v ?? /* @__PURE__ */ G(Ve, {
1685
+ title: x.emptyTitle,
1686
+ description: x.emptyDescription,
1687
+ action: c ? /* @__PURE__ */ G(a, {
1636
1688
  tone: "primary",
1637
1689
  type: "button",
1638
1690
  onClick: c,
1639
- icon: G,
1640
- children: S.createLabel
1691
+ icon: Y,
1692
+ children: x.createLabel
1641
1693
  }) : void 0
1642
- }) : /* @__PURE__ */ z(N, { children: e.map((e, t) => {
1694
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => {
1643
1695
  let n = l ? () => l(e) : void 0, r = d ? () => d(e) : void 0, i = f ? () => f(e) : void 0, a = [...r ? [{
1644
1696
  id: "edit",
1645
- label: S.editLabel,
1646
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
1697
+ label: x.editLabel,
1698
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1647
1699
  onClick: () => r(),
1648
1700
  tone: "secondary",
1649
1701
  buttonStyle: "ghost"
1650
1702
  }] : [], ...i ? [{
1651
1703
  id: "delete",
1652
- label: S.deleteLabel,
1653
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
1704
+ label: x.deleteLabel,
1705
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1654
1706
  onClick: () => i(),
1655
1707
  tone: "destructive"
1656
- }] : []], o = m ? m(e, {
1708
+ }] : []], o = p ? p(e, {
1657
1709
  index: t,
1658
1710
  onSelect: n,
1659
1711
  onEdit: r,
1660
1712
  onDelete: i
1661
- }) : /* @__PURE__ */ z(We, {
1713
+ }) : /* @__PURE__ */ G(Ye, {
1662
1714
  item: e,
1663
1715
  actions: a,
1664
- menuLabel: S.actionsLabel
1716
+ menuLabel: x.actionsLabel
1665
1717
  });
1666
- return _ ? /* @__PURE__ */ z("div", { children: _(e, t) }, e.id) : /* @__PURE__ */ z(Ze, {
1718
+ return _ ? /* @__PURE__ */ G("div", { children: _(e, t) }, e.id) : /* @__PURE__ */ G(nt, {
1667
1719
  item: e,
1668
- actionFallback: S.actionLabel,
1720
+ actionFallback: x.actionLabel,
1669
1721
  onSelect: n,
1670
1722
  actions: o
1671
1723
  }, e.id);
1672
1724
  }) })]
1673
1725
  });
1674
1726
  }
1675
- ft.displayName = "ProductReadinessCard";
1727
+ _t.displayName = "ProductReadinessCard";
1676
1728
  //#endregion
1677
1729
  //#region src/components/features/products/components/product-structure-card.tsx
1678
- function pt({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetric: o, onDeleteMetric: s, renderMetricActions: c, actions: l, footerSlot: u, empty: d, className: f, strings: p }) {
1679
- let m = r(Te, p), h = t ? /* @__PURE__ */ z(a, {
1730
+ function vt({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetric: o, onDeleteMetric: s, renderMetricActions: c, actions: l, footerSlot: u, empty: d, className: f, strings: p }) {
1731
+ let m = r(Z, p), h = t ? /* @__PURE__ */ G(a, {
1680
1732
  type: "button",
1681
1733
  tone: "secondary",
1682
1734
  buttonStyle: "ghost",
1683
1735
  onClick: t,
1684
- icon: G,
1736
+ icon: Y,
1685
1737
  children: m.createLabel
1686
1738
  }) : void 0;
1687
- return /* @__PURE__ */ z(O, {
1739
+ return /* @__PURE__ */ G(M, {
1688
1740
  title: m.title,
1689
1741
  description: m.description,
1690
1742
  actions: l,
1691
1743
  headerAction: h,
1692
1744
  footerSlot: u,
1693
1745
  className: i("product-structure-card--component w-full", f),
1694
- children: e.length === 0 ? d ?? /* @__PURE__ */ z($, {
1746
+ children: e.length === 0 ? d ?? /* @__PURE__ */ G(Ve, {
1695
1747
  title: m.emptyTitle,
1696
1748
  description: m.emptyDescription,
1697
- action: t ? /* @__PURE__ */ z(a, {
1749
+ action: t ? /* @__PURE__ */ G(a, {
1698
1750
  tone: "primary",
1699
1751
  type: "button",
1700
1752
  onClick: t,
1701
- icon: G,
1753
+ icon: Y,
1702
1754
  children: m.createLabel
1703
1755
  }) : void 0
1704
- }) : /* @__PURE__ */ z(N, { children: e.map((e, t) => {
1756
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => {
1705
1757
  let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [
1706
1758
  ...r ? [{
1707
1759
  id: "open",
1708
1760
  label: m.viewLabel,
1709
- icon: /* @__PURE__ */ z(H, { className: "size-icon-md" }),
1761
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
1710
1762
  onClick: () => r(),
1711
1763
  tone: "secondary",
1712
1764
  buttonStyle: "ghost"
@@ -1714,7 +1766,7 @@ function pt({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
1714
1766
  ...i ? [{
1715
1767
  id: "edit",
1716
1768
  label: m.editLabel,
1717
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
1769
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1718
1770
  onClick: () => i(),
1719
1771
  tone: "secondary",
1720
1772
  buttonStyle: "ghost"
@@ -1722,7 +1774,7 @@ function pt({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
1722
1774
  ...a ? [{
1723
1775
  id: "delete",
1724
1776
  label: m.deleteLabel,
1725
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
1777
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1726
1778
  onClick: () => a(),
1727
1779
  tone: "destructive"
1728
1780
  }] : []
@@ -1731,51 +1783,51 @@ function pt({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
1731
1783
  onSelect: r,
1732
1784
  onEdit: i,
1733
1785
  onDelete: a
1734
- }) : /* @__PURE__ */ z(We, {
1786
+ }) : /* @__PURE__ */ G(Ye, {
1735
1787
  item: e,
1736
1788
  actions: l,
1737
1789
  menuLabel: m.actionsLabel
1738
1790
  });
1739
- return /* @__PURE__ */ z(Xe, {
1791
+ return /* @__PURE__ */ G(tt, {
1740
1792
  metric: e,
1741
1793
  actions: u
1742
1794
  }, e.id);
1743
1795
  }) })
1744
1796
  });
1745
1797
  }
1746
- pt.displayName = "ProductStructureCard";
1798
+ vt.displayName = "ProductStructureCard";
1747
1799
  //#endregion
1748
1800
  //#region src/components/features/products/components/product-variants-table.tsx
1749
- function mt({ variant: e, channelsLabel: t }) {
1750
- return /* @__PURE__ */ B(u, {
1801
+ function yt({ variant: e, channelsLabel: t }) {
1802
+ return /* @__PURE__ */ K(u, {
1751
1803
  gap: "xs",
1752
1804
  className: "product-variants-table--variant-cell min-w-0",
1753
- children: [/* @__PURE__ */ B(u, {
1805
+ children: [/* @__PURE__ */ K(u, {
1754
1806
  gap: "dense",
1755
- children: [/* @__PURE__ */ B(u, {
1807
+ children: [/* @__PURE__ */ K(u, {
1756
1808
  direction: "horizontal",
1757
1809
  gap: "sm",
1758
- children: [/* @__PURE__ */ z(o, {
1810
+ children: [/* @__PURE__ */ G(o, {
1759
1811
  type: "inherit",
1760
1812
  weight: "semibold",
1761
1813
  className: "truncate",
1762
1814
  children: e.name
1763
- }), !!e.status && /* @__PURE__ */ z(b, {
1815
+ }), !!e.status && /* @__PURE__ */ G(ee, {
1764
1816
  tone: e.statusTone ?? "secondary",
1765
1817
  children: e.status
1766
1818
  })]
1767
- }), !!e.description && /* @__PURE__ */ z(o, {
1819
+ }), !!e.description && /* @__PURE__ */ G(o, {
1768
1820
  size: "xs",
1769
1821
  type: "secondary",
1770
1822
  children: e.description
1771
1823
  })]
1772
- }), !!(e.options?.length || e.channels) && /* @__PURE__ */ B(u, {
1824
+ }), !!(e.options?.length || e.channels) && /* @__PURE__ */ K(u, {
1773
1825
  direction: "horizontal",
1774
1826
  gap: "xs",
1775
- children: [e.options?.map((e, t) => /* @__PURE__ */ z(b, {
1827
+ children: [e.options?.map((e, t) => /* @__PURE__ */ G(ee, {
1776
1828
  tone: "secondary",
1777
1829
  children: e
1778
- }, t)), !!e.channels && /* @__PURE__ */ B(o, {
1830
+ }, t)), !!e.channels && /* @__PURE__ */ K(o, {
1779
1831
  tag: "span",
1780
1832
  size: "xs",
1781
1833
  type: "secondary",
@@ -1788,22 +1840,22 @@ function mt({ variant: e, channelsLabel: t }) {
1788
1840
  })]
1789
1841
  });
1790
1842
  }
1791
- function ht({ value: e, emphasis: t = !1 }) {
1792
- return /* @__PURE__ */ z(e ? _ : v, {
1843
+ function bt({ value: e, emphasis: t = !1 }) {
1844
+ return /* @__PURE__ */ G(e ? S : C, {
1793
1845
  type: e ? "inherit" : "secondary",
1794
1846
  weight: t ? "semibold" : void 0,
1795
1847
  className: "min-w-0 tabular-nums",
1796
1848
  children: e ?? "-"
1797
1849
  });
1798
1850
  }
1799
- function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVariant: o, onDuplicateVariant: s, onDeleteVariant: c, renderVariantActions: l, actions: u, footerSlot: d, empty: f, className: p, strings: m }) {
1800
- let h = r(Q, m), g = R(() => {
1851
+ function xt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVariant: o, onDuplicateVariant: s, onDeleteVariant: c, renderVariantActions: l, actions: u, footerSlot: d, empty: f, className: p, strings: m }) {
1852
+ let h = r(Fe, m), g = W(() => {
1801
1853
  if (l) return;
1802
1854
  let e = [
1803
1855
  ...n ? [{
1804
1856
  id: "open",
1805
1857
  label: h.viewLabel,
1806
- icon: /* @__PURE__ */ z(H, {
1858
+ icon: /* @__PURE__ */ G(xe, {
1807
1859
  className: "size-icon-sm",
1808
1860
  "aria-hidden": "true"
1809
1861
  }),
@@ -1813,7 +1865,7 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1813
1865
  ...o ? [{
1814
1866
  id: "edit",
1815
1867
  label: h.editLabel,
1816
- icon: /* @__PURE__ */ z(W, {
1868
+ icon: /* @__PURE__ */ G(Se, {
1817
1869
  className: "size-icon-sm",
1818
1870
  "aria-hidden": "true"
1819
1871
  }),
@@ -1823,7 +1875,7 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1823
1875
  ...s ? [{
1824
1876
  id: "duplicate",
1825
1877
  label: h.duplicateLabel,
1826
- icon: /* @__PURE__ */ z(be, {
1878
+ icon: /* @__PURE__ */ G(be, {
1827
1879
  className: "size-icon-sm",
1828
1880
  "aria-hidden": "true"
1829
1881
  }),
@@ -1833,7 +1885,7 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1833
1885
  ...c ? [{
1834
1886
  id: "delete",
1835
1887
  label: h.deleteLabel,
1836
- icon: /* @__PURE__ */ z(q, {
1888
+ icon: /* @__PURE__ */ G(X, {
1837
1889
  className: "size-icon-sm",
1838
1890
  "aria-hidden": "true"
1839
1891
  }),
@@ -1852,12 +1904,12 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1852
1904
  h.duplicateLabel,
1853
1905
  h.editLabel,
1854
1906
  h.viewLabel
1855
- ]), _ = R(() => {
1907
+ ]), _ = W(() => {
1856
1908
  let e = [
1857
1909
  {
1858
1910
  accessorKey: "name",
1859
1911
  header: h.headers.variant,
1860
- cell: ({ row: e }) => /* @__PURE__ */ z(mt, {
1912
+ cell: ({ row: e }) => /* @__PURE__ */ G(yt, {
1861
1913
  variant: e.original,
1862
1914
  channelsLabel: h.headers.channels
1863
1915
  })
@@ -1865,7 +1917,7 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1865
1917
  {
1866
1918
  accessorKey: "price",
1867
1919
  header: h.headers.price,
1868
- cell: ({ row: e }) => /* @__PURE__ */ z(ht, {
1920
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, {
1869
1921
  value: e.original.price,
1870
1922
  emphasis: !0
1871
1923
  }),
@@ -1874,17 +1926,17 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1874
1926
  {
1875
1927
  accessorKey: "inventory",
1876
1928
  header: h.headers.inventory,
1877
- cell: ({ row: e }) => /* @__PURE__ */ z(ht, { value: e.original.inventory })
1929
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, { value: e.original.inventory })
1878
1930
  },
1879
1931
  {
1880
1932
  accessorKey: "sku",
1881
1933
  header: h.headers.sku,
1882
- cell: ({ row: e }) => /* @__PURE__ */ z(ht, { value: e.original.sku })
1934
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, { value: e.original.sku })
1883
1935
  },
1884
1936
  {
1885
1937
  accessorKey: "updatedAt",
1886
1938
  header: h.headers.updated,
1887
- cell: ({ row: e }) => /* @__PURE__ */ z(ht, { value: e.original.updatedAt })
1939
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, { value: e.original.updatedAt })
1888
1940
  }
1889
1941
  ];
1890
1942
  return l && e.push({
@@ -1912,32 +1964,32 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1912
1964
  h.headers.sku,
1913
1965
  h.headers.updated,
1914
1966
  h.headers.variant
1915
- ]), v = t ? /* @__PURE__ */ z(a, {
1967
+ ]), v = t ? /* @__PURE__ */ G(a, {
1916
1968
  type: "button",
1917
1969
  tone: "secondary",
1918
1970
  buttonStyle: "ghost",
1919
1971
  onClick: t,
1920
- icon: G,
1972
+ icon: Y,
1921
1973
  children: h.createLabel
1922
1974
  }) : void 0;
1923
- return /* @__PURE__ */ z(O, {
1975
+ return /* @__PURE__ */ G(M, {
1924
1976
  title: h.title,
1925
1977
  description: h.description,
1926
1978
  actions: u,
1927
1979
  headerAction: v,
1928
1980
  footerSlot: d,
1929
1981
  className: i("product-variants-table--component w-full", p),
1930
- children: e.length === 0 ? f ?? /* @__PURE__ */ z($, {
1982
+ children: e.length === 0 ? f ?? /* @__PURE__ */ G(Ve, {
1931
1983
  title: h.emptyTitle,
1932
1984
  description: h.emptyDescription,
1933
- action: t ? /* @__PURE__ */ z(a, {
1985
+ action: t ? /* @__PURE__ */ G(a, {
1934
1986
  tone: "primary",
1935
1987
  type: "button",
1936
1988
  onClick: t,
1937
- icon: G,
1989
+ icon: Y,
1938
1990
  children: h.createLabel
1939
1991
  }) : void 0
1940
- }) : /* @__PURE__ */ z(pe, {
1992
+ }) : /* @__PURE__ */ G(fe, {
1941
1993
  data: e,
1942
1994
  columns: _,
1943
1995
  getRowId: (e) => e.id,
@@ -1954,43 +2006,43 @@ function gt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1954
2006
  })
1955
2007
  });
1956
2008
  }
1957
- gt.displayName = "ProductVariantsTable";
2009
+ xt.displayName = "ProductVariantsTable";
1958
2010
  //#endregion
1959
2011
  //#region src/components/features/products/components/product-overview.tsx
1960
- function _t({ details: e, contract: t, options: n, variants: a, readiness: o, structure: s, operations: c, quote: l, policies: d, slots: f, className: p, mainClassName: m, railClassName: h, strings: g }) {
1961
- let _ = r(Ie, g), v = !!(o || s || c || l || d || f?.railTop || f?.railBottom);
1962
- return /* @__PURE__ */ B(u, {
2012
+ function St({ details: e, contract: t, options: n, variants: a, readiness: o, structure: s, operations: c, quote: l, policies: d, slots: f, className: p, mainClassName: m, railClassName: h, strings: g }) {
2013
+ let _ = r(Be, g), v = !!(o || s || c || l || d || f?.railTop || f?.railBottom);
2014
+ return /* @__PURE__ */ K(u, {
1963
2015
  gap: "3xl",
1964
2016
  className: i("product-overview--component @container/product-overview", p),
1965
2017
  children: [
1966
2018
  f?.before,
1967
- /* @__PURE__ */ B("div", {
2019
+ /* @__PURE__ */ K("div", {
1968
2020
  className: i("grid min-w-0 grid-cols-1 gap-space-3xl", v && "@5xl/product-overview:grid-cols-[minmax(0,1fr)_22rem]"),
1969
- children: [/* @__PURE__ */ B(u, {
1970
- render: /* @__PURE__ */ z("section", {}),
2021
+ children: [/* @__PURE__ */ K(u, {
2022
+ render: /* @__PURE__ */ G("section", {}),
1971
2023
  gap: "3xl",
1972
2024
  "aria-label": _.mainLabel,
1973
2025
  className: i("product-overview--main", m),
1974
2026
  children: [
1975
2027
  f?.mainTop,
1976
- !!e && /* @__PURE__ */ z(tt, { ...e }),
1977
- !!t && /* @__PURE__ */ z(et, { ...t }),
1978
- !!n && /* @__PURE__ */ z(lt, { ...n }),
1979
- !!a && /* @__PURE__ */ z(gt, { ...a }),
2028
+ !!e && /* @__PURE__ */ G(ot, { ...e }),
2029
+ !!t && /* @__PURE__ */ G(at, { ...t }),
2030
+ !!n && /* @__PURE__ */ G(mt, { ...n }),
2031
+ !!a && /* @__PURE__ */ G(xt, { ...a }),
1980
2032
  f?.mainBottom
1981
2033
  ]
1982
- }), !!v && /* @__PURE__ */ B(u, {
1983
- render: /* @__PURE__ */ z("aside", {}),
2034
+ }), !!v && /* @__PURE__ */ K(u, {
2035
+ render: /* @__PURE__ */ G("aside", {}),
1984
2036
  gap: "3xl",
1985
2037
  "aria-label": _.railLabel,
1986
2038
  className: i("product-overview--rail", h),
1987
2039
  children: [
1988
2040
  f?.railTop,
1989
- !!o && /* @__PURE__ */ z(ft, { ...o }),
1990
- !!s && /* @__PURE__ */ z(pt, { ...s }),
1991
- !!c && /* @__PURE__ */ z(rt, { ...c }),
1992
- !!l && /* @__PURE__ */ z(dt, { ...l }),
1993
- !!d && /* @__PURE__ */ z(ut, { ...d }),
2041
+ !!o && /* @__PURE__ */ G(_t, { ...o }),
2042
+ !!s && /* @__PURE__ */ G(vt, { ...s }),
2043
+ !!c && /* @__PURE__ */ G(ct, { ...c }),
2044
+ !!l && /* @__PURE__ */ G(gt, { ...l }),
2045
+ !!d && /* @__PURE__ */ G(ht, { ...d }),
1994
2046
  f?.railBottom
1995
2047
  ]
1996
2048
  })]
@@ -1999,15 +2051,15 @@ function _t({ details: e, contract: t, options: n, variants: a, readiness: o, st
1999
2051
  ]
2000
2052
  });
2001
2053
  }
2002
- _t.displayName = "ProductOverview";
2054
+ St.displayName = "ProductOverview";
2003
2055
  //#endregion
2004
2056
  //#region src/components/features/products/components/product-variant-action-menu.tsx
2005
- function vt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, onDeleteVariant: i }, a) {
2057
+ function Ct(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, onDeleteVariant: i }, a) {
2006
2058
  return [
2007
2059
  ...t ? [{
2008
2060
  id: "open",
2009
2061
  label: a.viewLabel,
2010
- icon: /* @__PURE__ */ z(H, { className: "size-icon-md" }),
2062
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
2011
2063
  onClick: () => t(e),
2012
2064
  tone: "secondary",
2013
2065
  buttonStyle: "ghost"
@@ -2015,7 +2067,7 @@ function vt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
2015
2067
  ...n ? [{
2016
2068
  id: "edit",
2017
2069
  label: a.editLabel,
2018
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
2070
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
2019
2071
  onClick: () => n(e),
2020
2072
  tone: "secondary",
2021
2073
  buttonStyle: "ghost"
@@ -2023,7 +2075,7 @@ function vt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
2023
2075
  ...r ? [{
2024
2076
  id: "duplicate",
2025
2077
  label: a.duplicateLabel,
2026
- icon: /* @__PURE__ */ z(be, { className: "size-icon-md" }),
2078
+ icon: /* @__PURE__ */ G(be, { className: "size-icon-md" }),
2027
2079
  onClick: () => r(e),
2028
2080
  tone: "secondary",
2029
2081
  buttonStyle: "ghost"
@@ -2031,15 +2083,15 @@ function vt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
2031
2083
  ...i ? [{
2032
2084
  id: "delete",
2033
2085
  label: a.deleteLabel,
2034
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
2086
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
2035
2087
  onClick: () => i(e),
2036
2088
  tone: "destructive"
2037
2089
  }] : []
2038
2090
  ];
2039
2091
  }
2040
- function yt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, onDuplicateVariant: o, onDeleteVariant: s, renderVariantActions: c, menuLabel: l, className: u, strings: d }) {
2041
- let f = r(Ne, d), p = n ? () => n(e) : void 0, m = a ? () => a(e) : void 0, h = o ? () => o(e) : void 0, g = s ? () => s(e) : void 0;
2042
- return p || m || h || g || c ? c ? /* @__PURE__ */ z("div", {
2092
+ function wt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, onDuplicateVariant: o, onDeleteVariant: s, renderVariantActions: c, menuLabel: l, className: u, strings: d }) {
2093
+ let f = r(Le, d), p = n ? () => n(e) : void 0, m = a ? () => a(e) : void 0, h = o ? () => o(e) : void 0, g = s ? () => s(e) : void 0;
2094
+ return p || m || h || g || c ? c ? /* @__PURE__ */ G("div", {
2043
2095
  className: i("product-variant-action-menu--component flex justify-end", u),
2044
2096
  children: c(e, {
2045
2097
  index: t,
@@ -2048,11 +2100,11 @@ function yt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, on
2048
2100
  onDuplicate: h,
2049
2101
  onDelete: g
2050
2102
  })
2051
- }) : /* @__PURE__ */ z(We, {
2103
+ }) : /* @__PURE__ */ G(Ye, {
2052
2104
  item: e,
2053
2105
  menuLabel: l ?? f.actionsLabel,
2054
2106
  className: i("product-variant-action-menu--component", u),
2055
- actions: vt(e, {
2107
+ actions: Ct(e, {
2056
2108
  onSelectVariant: n,
2057
2109
  onEditVariant: a,
2058
2110
  onDuplicateVariant: o,
@@ -2063,11 +2115,11 @@ function yt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, on
2063
2115
  }))
2064
2116
  }) : null;
2065
2117
  }
2066
- yt.displayName = "ProductVariantActionMenu";
2118
+ wt.displayName = "ProductVariantActionMenu";
2067
2119
  //#endregion
2068
2120
  //#region src/components/features/products/components/product-variant-details.tsx
2069
- var bt = (e) => e != null && e !== !1 && e !== "";
2070
- function xt(e, t) {
2121
+ var Tt = (e) => e != null && e !== !1 && e !== "";
2122
+ function Et(e, t) {
2071
2123
  return [
2072
2124
  {
2073
2125
  label: t.price,
@@ -2089,214 +2141,221 @@ function xt(e, t) {
2089
2141
  label: t.updated,
2090
2142
  value: e.updatedAt
2091
2143
  }
2092
- ].filter((e) => bt(e.value));
2144
+ ].filter((e) => Tt(e.value));
2093
2145
  }
2094
- function St({ variant: e, metadata: t, optionItems: n = [], media: s, onBack: c, onSelectVariant: l, onEditVariant: d, onDuplicateVariant: f, onDeleteVariant: p, onSelectOption: m, actions: h, headerEnd: g, footerSlot: _, empty: v, renderActions: y, renderMetadata: x, renderOption: S, className: C, strings: w }) {
2095
- let T = r(Pe, w), E = e ? t ?? xt(e, T.metadata) : [], ee = [...e && !y ? vt(e, {
2146
+ function Dt({ variant: e, metadata: t, optionItems: n = [], media: s, onBack: c, onSelectVariant: l, onEditVariant: d, onDuplicateVariant: f, onDeleteVariant: p, onSelectOption: m, actions: h, headerEnd: g, footerSlot: _, empty: y, renderActions: b, renderMetadata: x, renderOption: S, className: C, strings: w }) {
2147
+ let T = r(Re, w), E = e ? t ?? Et(e, T.metadata) : [], D = [...e && !b ? Ct(e, {
2096
2148
  onSelectVariant: l,
2097
2149
  onEditVariant: d,
2098
2150
  onDuplicateVariant: f,
2099
2151
  onDeleteVariant: p
2100
- }, Ne) : [], ...h ?? []], D = !!(e && y), te = /* @__PURE__ */ B("div", {
2101
- className: "product-variant-details--header-actions flex items-center gap-space-md",
2102
- children: [!!c && /* @__PURE__ */ z(a, {
2152
+ }, Le) : [], ...h ?? []], O = !!(e && b), k = /* @__PURE__ */ K("div", {
2153
+ className: i("product-variant-details--header-actions flex items-center", v.commands),
2154
+ children: [!!c && /* @__PURE__ */ G(a, {
2103
2155
  type: "button",
2104
2156
  tone: "secondary",
2105
2157
  buttonStyle: "ghost",
2106
2158
  onClick: c,
2107
2159
  icon: ye,
2108
2160
  children: T.backLabel
2109
- }), !!D && e && /* @__PURE__ */ z(yt, {
2161
+ }), !!O && e && /* @__PURE__ */ G(wt, {
2110
2162
  variant: e,
2111
2163
  onSelectVariant: l,
2112
2164
  onEditVariant: d,
2113
2165
  onDuplicateVariant: f,
2114
2166
  onDeleteVariant: p,
2115
- renderVariantActions: y
2167
+ renderVariantActions: b
2116
2168
  })]
2117
- }), k = e?.options ?? [];
2118
- return /* @__PURE__ */ z(O, {
2169
+ }), A = e?.options ?? [];
2170
+ return /* @__PURE__ */ G(M, {
2119
2171
  title: e?.name ?? T.title,
2120
- titleSuffix: e?.status ? /* @__PURE__ */ z(b, {
2172
+ titleSuffix: e?.status ? /* @__PURE__ */ G(ee, {
2121
2173
  tone: e.statusTone ?? "secondary",
2122
2174
  children: e.status
2123
2175
  }) : void 0,
2124
2176
  description: e?.description ?? T.description,
2125
- actions: ee.length ? ee : void 0,
2126
- headerAction: c || D ? te : void 0,
2177
+ actions: D.length ? D : void 0,
2178
+ headerAction: c || O ? k : void 0,
2127
2179
  headerEnd: g,
2128
2180
  footerSlot: _,
2129
2181
  className: i("product-variant-details--component w-full", C),
2130
- children: e ? /* @__PURE__ */ B(u, {
2182
+ children: e ? /* @__PURE__ */ K(u, {
2131
2183
  gap: "2xl",
2132
2184
  className: "product-variant-details--body",
2133
2185
  children: [
2134
- !!s && /* @__PURE__ */ z("div", {
2135
- className: "product-variant-details--media overflow-hidden rounded-inner border border-border bg-muted/30",
2186
+ !!s && /* @__PURE__ */ G("div", {
2187
+ className: "product-variant-details--media overflow-hidden rounded-radius border border-border bg-muted/30",
2136
2188
  children: s
2137
2189
  }),
2138
- x ? x(e) : E.some(Boolean) && /* @__PURE__ */ B(u, {
2190
+ x ? x(e) : E.some(Boolean) && /* @__PURE__ */ K(u, {
2139
2191
  gap: "md",
2140
2192
  className: "product-variant-details--facts",
2141
- children: [/* @__PURE__ */ z(o, {
2193
+ children: [/* @__PURE__ */ G(o, {
2142
2194
  type: "inherit",
2143
2195
  weight: "semibold",
2144
2196
  children: T.factsTitle
2145
- }), /* @__PURE__ */ z(ae, {
2197
+ }), /* @__PURE__ */ G(z, {
2198
+ adaptTo: "container",
2146
2199
  items: E,
2147
2200
  columns: 3,
2148
2201
  density: "compact",
2149
2202
  className: "product-variant-details--metadata"
2150
2203
  })]
2151
2204
  }),
2152
- !!k.length && /* @__PURE__ */ B(u, {
2205
+ !!A.length && /* @__PURE__ */ K(u, {
2153
2206
  gap: "md",
2154
2207
  className: "product-variant-details--selected-options",
2155
- children: [/* @__PURE__ */ z(o, {
2208
+ children: [/* @__PURE__ */ G(o, {
2156
2209
  type: "inherit",
2157
2210
  weight: "semibold",
2158
2211
  children: T.selectedOptionsTitle
2159
- }), /* @__PURE__ */ z("div", {
2212
+ }), /* @__PURE__ */ G("div", {
2160
2213
  className: "flex flex-wrap gap-space-sm",
2161
- children: k.map((e, t) => /* @__PURE__ */ z(b, {
2214
+ children: A.map((e, t) => /* @__PURE__ */ G(ee, {
2162
2215
  tone: "secondary",
2163
2216
  children: e
2164
2217
  }, t))
2165
2218
  })]
2166
2219
  }),
2167
- !!n.length && /* @__PURE__ */ B(u, {
2220
+ !!n.length && /* @__PURE__ */ K(u, {
2168
2221
  gap: "md",
2169
2222
  className: "product-variant-details--related-options",
2170
- children: [/* @__PURE__ */ z(o, {
2223
+ children: [/* @__PURE__ */ G(o, {
2171
2224
  type: "inherit",
2172
2225
  weight: "semibold",
2173
2226
  children: T.relatedOptionsTitle
2174
- }), /* @__PURE__ */ z(N, { children: n.map((e, t) => S ? /* @__PURE__ */ z("div", { children: S(e, t) }, e.id) : /* @__PURE__ */ z($e, {
2227
+ }), /* @__PURE__ */ G(F, { children: n.map((e, t) => S ? /* @__PURE__ */ G("div", { children: S(e, t) }, e.id) : /* @__PURE__ */ G(it, {
2175
2228
  item: e,
2176
2229
  actionLabel: T.viewOptionLabel,
2177
2230
  onSelect: m ? () => m(e) : void 0
2178
2231
  }, e.id)) })]
2179
2232
  })
2180
2233
  ]
2181
- }) : v ?? /* @__PURE__ */ z($, {
2234
+ }) : y ?? /* @__PURE__ */ G(Ve, {
2182
2235
  title: T.emptyTitle,
2183
2236
  description: T.emptyDescription
2184
2237
  })
2185
2238
  });
2186
2239
  }
2187
- St.displayName = "ProductVariantDetails";
2240
+ Dt.displayName = "ProductVariantDetails";
2188
2241
  //#endregion
2189
2242
  //#region src/components/features/products/components/product-variant-editor.tsx
2190
- var Ct = (e) => e.map((e) => ({
2243
+ var Ot = (e) => e.map((e) => ({
2191
2244
  value: e.value,
2192
2245
  label: e.label,
2193
2246
  disabled: e.disabled
2194
2247
  }));
2195
- function wt({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s = [], onValueChange: c, onSubmit: l, onError: d, onCancel: f, onDelete: p, actions: m, headerEnd: h, footerSlot: g, disabled: _ = !1, submitting: v = !1, className: y, strings: b }) {
2196
- let x = r(Fe, b), S = he(), C = e !== void 0, [ee, te] = _e(t ?? {}), [k, ne] = _e(!1), A = (C ? e : ee) ?? {}, j = v || k, M = _ || j, N = (e) => {
2197
- C || te(e), c?.(e);
2198
- }, P = (e, t) => {
2199
- N({
2200
- ...A,
2248
+ function kt({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s = [], onValueChange: c, onSubmit: l, onError: d, onCancel: f, onDelete: p, actions: m, headerEnd: h, footerSlot: g, visibleFields: _, errors: v, formId: y, showHeader: b = !0, children: x, disabled: S = !1, submitting: C = !1, className: w, strings: ee }) {
2249
+ let T = r(ze, ee), E = he(), D = y ?? E, te = e !== void 0, [ne, re] = _e(t ?? {}), [ie, ae] = _e(!1), N = (te ? e : ne) ?? {}, P = C || ie, F = S || P, I = (e) => _?.[e] !== !1, L = I("name") || I("sku") || I("description"), R = I("price") || I("inventory") || I("status") || I("channels"), z = (e) => {
2250
+ te || re(e), c?.(e);
2251
+ }, B = (e, t) => {
2252
+ z({
2253
+ ...N,
2201
2254
  [e]: t
2202
2255
  });
2203
- }, re = (e, t) => {
2204
- N({
2205
- ...A,
2256
+ }, oe = (e, t) => {
2257
+ z({
2258
+ ...N,
2206
2259
  options: {
2207
- ...A.options,
2260
+ ...N.options,
2208
2261
  [e.id]: t
2209
2262
  }
2210
2263
  });
2211
- }, ie = async (e) => {
2212
- if (e.preventDefault(), l && !j) {
2213
- ne(!0);
2264
+ }, se = async (e) => {
2265
+ if (e.preventDefault(), l && !P) {
2266
+ ae(!0);
2214
2267
  try {
2215
- await l(A);
2268
+ await l(N);
2216
2269
  } catch (e) {
2217
2270
  d?.(e);
2218
2271
  } finally {
2219
- ne(!1);
2272
+ ae(!1);
2220
2273
  }
2221
2274
  }
2222
- }, ae = /* @__PURE__ */ B("div", {
2275
+ }, ce = /* @__PURE__ */ K("div", {
2223
2276
  className: "product-variant-editor--footer flex flex-col-reverse gap-space-md @sm/product-variant-editor:flex-row @sm/product-variant-editor:items-center @sm/product-variant-editor:justify-between",
2224
- children: [/* @__PURE__ */ z("div", { children: !!p && /* @__PURE__ */ z(a, {
2277
+ children: [/* @__PURE__ */ G("div", { children: !!p && /* @__PURE__ */ G(a, {
2225
2278
  type: "button",
2226
2279
  tone: "destructive",
2227
2280
  buttonStyle: "ghost",
2228
- onClick: () => p(A),
2229
- disabled: M,
2230
- children: x.deleteLabel
2231
- }) }), /* @__PURE__ */ B("div", {
2281
+ onClick: () => p(N),
2282
+ disabled: F,
2283
+ children: T.deleteLabel
2284
+ }) }), /* @__PURE__ */ K("div", {
2232
2285
  className: "flex flex-col-reverse gap-space-md @sm/product-variant-editor:flex-row @sm/product-variant-editor:justify-end",
2233
- children: [!!f && /* @__PURE__ */ z(a, {
2286
+ children: [!!f && /* @__PURE__ */ G(a, {
2234
2287
  type: "button",
2235
2288
  tone: "secondary",
2236
2289
  buttonStyle: "ghost",
2237
2290
  onClick: f,
2238
- disabled: M,
2239
- children: x.cancelLabel
2240
- }), !!l && /* @__PURE__ */ z(a, {
2291
+ disabled: F,
2292
+ children: T.cancelLabel
2293
+ }), !!l && /* @__PURE__ */ G(a, {
2241
2294
  tone: "primary",
2242
2295
  type: "submit",
2243
- form: S,
2244
- disabled: M,
2245
- children: j ? x.savingLabel : x.saveLabel
2296
+ form: D,
2297
+ disabled: F,
2298
+ children: P ? T.savingLabel : T.saveLabel
2246
2299
  })]
2247
2300
  })]
2248
- }), oe = !!(p || f || l);
2249
- return /* @__PURE__ */ z(O, {
2250
- title: x.title,
2251
- description: x.description,
2301
+ }), le = !!(p || f || l);
2302
+ return /* @__PURE__ */ G(M, {
2303
+ title: b ? T.title : void 0,
2304
+ description: b ? T.description : void 0,
2252
2305
  actions: m,
2253
2306
  headerEnd: h,
2254
2307
  footerSlot: g,
2255
- className: i("product-variant-editor--component @container/product-variant-editor w-full", y),
2256
- children: /* @__PURE__ */ B(u, {
2257
- render: /* @__PURE__ */ z("form", {
2258
- id: S,
2259
- onSubmit: ie
2308
+ className: i("product-variant-editor--component @container/product-variant-editor w-full", w),
2309
+ children: /* @__PURE__ */ K(u, {
2310
+ render: /* @__PURE__ */ G("form", {
2311
+ id: D,
2312
+ onSubmit: se
2260
2313
  }),
2261
2314
  gap: "2xl",
2262
2315
  className: "product-variant-editor--form",
2263
2316
  children: [
2264
- /* @__PURE__ */ B("section", {
2317
+ L && /* @__PURE__ */ K("section", {
2265
2318
  className: "product-variant-editor--section grid gap-space-lg",
2266
- children: [/* @__PURE__ */ z(o, {
2319
+ children: [/* @__PURE__ */ G(o, {
2267
2320
  type: "inherit",
2268
2321
  weight: "semibold",
2269
- children: x.identityTitle
2270
- }), /* @__PURE__ */ B("div", {
2322
+ children: T.identityTitle
2323
+ }), /* @__PURE__ */ K("div", {
2271
2324
  className: "grid gap-space-lg @sm/product-variant-editor:grid-cols-2",
2272
2325
  children: [
2273
- /* @__PURE__ */ z(T, {
2274
- label: x.fields.name,
2326
+ I("name") && /* @__PURE__ */ G(k, {
2327
+ label: T.fields.name,
2328
+ error: v?.name,
2275
2329
  required: !0,
2276
- children: /* @__PURE__ */ z(w, {
2277
- value: A.name ?? "",
2278
- onChange: (e) => P("name", e.target.value),
2279
- placeholder: x.placeholders.name,
2280
- disabled: M
2330
+ children: /* @__PURE__ */ G(O, {
2331
+ value: N.name ?? "",
2332
+ onChange: (e) => B("name", e.target.value),
2333
+ invalid: !!v?.name,
2334
+ placeholder: T.placeholders.name,
2335
+ disabled: F
2281
2336
  })
2282
2337
  }),
2283
- /* @__PURE__ */ z(T, {
2284
- label: x.fields.sku,
2285
- children: /* @__PURE__ */ z(w, {
2286
- value: A.sku ?? "",
2287
- onChange: (e) => P("sku", e.target.value),
2288
- placeholder: x.placeholders.sku,
2289
- disabled: M
2338
+ I("sku") && /* @__PURE__ */ G(k, {
2339
+ label: T.fields.sku,
2340
+ error: v?.sku,
2341
+ children: /* @__PURE__ */ G(O, {
2342
+ value: N.sku ?? "",
2343
+ onChange: (e) => B("sku", e.target.value),
2344
+ invalid: !!v?.sku,
2345
+ placeholder: T.placeholders.sku,
2346
+ disabled: F
2290
2347
  })
2291
2348
  }),
2292
- /* @__PURE__ */ z(T, {
2293
- label: x.fields.description,
2349
+ I("description") && /* @__PURE__ */ G(k, {
2350
+ label: T.fields.description,
2351
+ error: v?.description,
2294
2352
  className: "@sm/product-variant-editor:col-span-2",
2295
- children: /* @__PURE__ */ z(E, {
2296
- value: A.description ?? "",
2297
- onChange: (e) => P("description", e.target.value),
2298
- placeholder: x.placeholders.description,
2299
- disabled: M,
2353
+ children: /* @__PURE__ */ G(A, {
2354
+ value: N.description ?? "",
2355
+ onChange: (e) => B("description", e.target.value),
2356
+ invalid: !!v?.description,
2357
+ placeholder: T.placeholders.description,
2358
+ disabled: F,
2300
2359
  autoResize: !0,
2301
2360
  minRows: 2
2302
2361
  })
@@ -2304,144 +2363,154 @@ function wt({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s
2304
2363
  ]
2305
2364
  })]
2306
2365
  }),
2307
- /* @__PURE__ */ B("section", {
2366
+ R && /* @__PURE__ */ K("section", {
2308
2367
  className: "product-variant-editor--section grid gap-space-lg",
2309
- children: [/* @__PURE__ */ z(o, {
2368
+ children: [/* @__PURE__ */ G(o, {
2310
2369
  type: "inherit",
2311
2370
  weight: "semibold",
2312
- children: x.commercialTitle
2313
- }), /* @__PURE__ */ B("div", {
2371
+ children: T.commercialTitle
2372
+ }), /* @__PURE__ */ K("div", {
2314
2373
  className: "grid gap-space-lg @sm/product-variant-editor:grid-cols-2",
2315
2374
  children: [
2316
- /* @__PURE__ */ z(T, {
2317
- label: x.fields.price,
2318
- children: /* @__PURE__ */ z(w, {
2319
- value: A.price ?? "",
2320
- onChange: (e) => P("price", e.target.value),
2321
- placeholder: x.placeholders.price,
2322
- disabled: M
2375
+ I("price") && /* @__PURE__ */ G(k, {
2376
+ label: T.fields.price,
2377
+ error: v?.price,
2378
+ children: /* @__PURE__ */ G(O, {
2379
+ value: N.price ?? "",
2380
+ onChange: (e) => B("price", e.target.value),
2381
+ invalid: !!v?.price,
2382
+ placeholder: T.placeholders.price,
2383
+ disabled: F
2323
2384
  })
2324
2385
  }),
2325
- /* @__PURE__ */ z(T, {
2326
- label: x.fields.inventory,
2327
- children: /* @__PURE__ */ z(w, {
2328
- value: A.inventory ?? "",
2329
- onChange: (e) => P("inventory", e.target.value),
2330
- placeholder: x.placeholders.inventory,
2331
- disabled: M,
2386
+ I("inventory") && /* @__PURE__ */ G(k, {
2387
+ label: T.fields.inventory,
2388
+ error: v?.inventory,
2389
+ children: /* @__PURE__ */ G(O, {
2390
+ value: N.inventory ?? "",
2391
+ onChange: (e) => B("inventory", e.target.value),
2392
+ invalid: !!v?.inventory,
2393
+ placeholder: T.placeholders.inventory,
2394
+ disabled: F,
2332
2395
  inputMode: "numeric"
2333
2396
  })
2334
2397
  }),
2335
- /* @__PURE__ */ z(T, {
2336
- label: x.fields.status,
2337
- children: s.length > 0 ? /* @__PURE__ */ z(D, {
2338
- options: Ct(s),
2339
- value: A.status ?? null,
2340
- onValueChange: (e) => P("status", e ?? ""),
2341
- placeholder: x.statusPlaceholder,
2342
- disabled: M,
2343
- "aria-label": x.fields.status
2344
- }) : /* @__PURE__ */ z(w, {
2345
- value: A.status ?? "",
2346
- onChange: (e) => P("status", e.target.value),
2347
- placeholder: x.placeholders.status,
2348
- disabled: M
2398
+ I("status") && /* @__PURE__ */ G(k, {
2399
+ label: T.fields.status,
2400
+ error: v?.status,
2401
+ children: s.length > 0 ? /* @__PURE__ */ G(j, {
2402
+ options: Ot(s),
2403
+ value: N.status ?? null,
2404
+ onValueChange: (e) => B("status", e ?? ""),
2405
+ invalid: !!v?.status,
2406
+ placeholder: T.statusPlaceholder,
2407
+ disabled: F,
2408
+ "aria-label": T.fields.status
2409
+ }) : /* @__PURE__ */ G(O, {
2410
+ value: N.status ?? "",
2411
+ onChange: (e) => B("status", e.target.value),
2412
+ invalid: !!v?.status,
2413
+ placeholder: T.placeholders.status,
2414
+ disabled: F
2349
2415
  })
2350
2416
  }),
2351
- /* @__PURE__ */ z(T, {
2352
- label: x.fields.channels,
2353
- children: /* @__PURE__ */ z(w, {
2354
- value: A.channels ?? "",
2355
- onChange: (e) => P("channels", e.target.value),
2356
- placeholder: x.placeholders.channels,
2357
- disabled: M
2417
+ I("channels") && /* @__PURE__ */ G(k, {
2418
+ label: T.fields.channels,
2419
+ error: v?.channels,
2420
+ children: /* @__PURE__ */ G(O, {
2421
+ value: N.channels ?? "",
2422
+ onChange: (e) => B("channels", e.target.value),
2423
+ invalid: !!v?.channels,
2424
+ placeholder: T.placeholders.channels,
2425
+ disabled: F
2358
2426
  })
2359
2427
  })
2360
2428
  ]
2361
2429
  })]
2362
2430
  }),
2363
- !!n.length && /* @__PURE__ */ B("section", {
2431
+ !!n.length && /* @__PURE__ */ K("section", {
2364
2432
  className: "product-variant-editor--section grid gap-space-lg",
2365
- children: [/* @__PURE__ */ z(o, {
2433
+ children: [/* @__PURE__ */ G(o, {
2366
2434
  type: "inherit",
2367
2435
  weight: "semibold",
2368
- children: x.optionsTitle
2369
- }), /* @__PURE__ */ z("div", {
2436
+ children: T.optionsTitle
2437
+ }), /* @__PURE__ */ G("div", {
2370
2438
  className: "grid gap-space-lg @sm/product-variant-editor:grid-cols-2",
2371
2439
  children: n.map((e) => {
2372
- let t = e.value ?? A.options?.[e.id] ?? "", n = !!e.choices?.length;
2373
- return /* @__PURE__ */ z(T, {
2440
+ let t = e.value ?? N.options?.[e.id] ?? "", n = !!e.choices?.length;
2441
+ return /* @__PURE__ */ G(k, {
2374
2442
  label: e.label,
2375
2443
  helperText: e.helperText,
2376
- children: n ? /* @__PURE__ */ z(D, {
2377
- options: Ct(e.choices ?? []),
2444
+ children: n ? /* @__PURE__ */ G(j, {
2445
+ options: Ot(e.choices ?? []),
2378
2446
  value: t || null,
2379
- onValueChange: (t) => re(e, t),
2380
- placeholder: e.placeholder ?? x.optionPlaceholder,
2381
- disabled: M,
2447
+ onValueChange: (t) => oe(e, t),
2448
+ placeholder: e.placeholder ?? T.optionPlaceholder,
2449
+ disabled: F,
2382
2450
  "aria-label": e.label
2383
- }) : /* @__PURE__ */ z(w, {
2451
+ }) : /* @__PURE__ */ G(O, {
2384
2452
  value: t,
2385
- onChange: (t) => re(e, t.target.value),
2386
- placeholder: e.placeholder ?? x.optionPlaceholder,
2387
- disabled: M
2453
+ onChange: (t) => oe(e, t.target.value),
2454
+ placeholder: e.placeholder ?? T.optionPlaceholder,
2455
+ disabled: F
2388
2456
  })
2389
2457
  }, e.id);
2390
2458
  })
2391
2459
  })]
2392
2460
  }),
2393
- g == null && oe && ae
2461
+ x,
2462
+ g == null && le && ce
2394
2463
  ]
2395
2464
  })
2396
2465
  });
2397
2466
  }
2398
- wt.displayName = "ProductVariantEditor";
2467
+ kt.displayName = "ProductVariantEditor";
2399
2468
  //#endregion
2400
2469
  //#region src/components/features/products/components/product-variants-bulk-table.tsx
2401
- var Tt = [
2470
+ var At = [
2402
2471
  "variant",
2403
2472
  "sku",
2404
2473
  "price",
2405
2474
  "inventory",
2406
2475
  "status"
2407
- ], Et = "text", Dt = "text", Ot = "multiple";
2408
- function kt(e) {
2476
+ ], jt = "text", Mt = "text", Nt = "multiple";
2477
+ function Pt(e) {
2409
2478
  return typeof e == "string" || typeof e == "number" ? String(e) : "";
2410
2479
  }
2411
- function At(e, t) {
2480
+ function Ft(e, t) {
2412
2481
  let n = e.optionValues?.[t.id];
2413
2482
  if (n != null && n !== !1 && n !== "") return n;
2414
2483
  let r = e.optionValueIds?.[t.id];
2415
2484
  return t.values?.find((e) => e.id === r)?.label ?? void 0;
2416
2485
  }
2417
- function jt(e, t) {
2418
- return e.name !== void 0 && e.name !== null && e.name !== "" ? e.name : t.filter((e) => e.usedForVariants !== !1).map((t) => At(e, t)).filter((e) => e != null && e !== "").map((e) => kt(e)).filter(Boolean).join(" / ") || "-";
2486
+ function It(e, t) {
2487
+ return e.name !== void 0 && e.name !== null && e.name !== "" ? e.name : t.filter((e) => e.usedForVariants !== !1).map((t) => Ft(e, t)).filter((e) => e != null && e !== "").map((e) => Pt(e)).filter(Boolean).join(" / ") || "-";
2419
2488
  }
2420
- function Mt(e, t) {
2421
- return t.filter((e) => e.usedForVariants !== !1).map((t) => At(e, t)).filter((e) => e != null && e !== "");
2489
+ function Lt(e, t) {
2490
+ return t.filter((e) => e.usedForVariants !== !1).map((t) => Ft(e, t)).filter((e) => e != null && e !== "");
2422
2491
  }
2423
- function Nt(e) {
2424
- return e.map(kt).filter(Boolean).join(" / ");
2492
+ function Rt(e) {
2493
+ return e.map(Pt).filter(Boolean).join(" / ");
2425
2494
  }
2426
- function Pt(e, t) {
2427
- return kt(At(e, t)) || "-";
2495
+ function zt(e, t) {
2496
+ return Pt(Ft(e, t)) || "-";
2428
2497
  }
2429
- function Ft(e, t) {
2498
+ function Bt(e, t) {
2430
2499
  return e.map((e) => t.get(e)).filter((e) => !!e);
2431
2500
  }
2432
- function It(e) {
2501
+ function Vt(e) {
2433
2502
  return e == null || e === "" ? "-" : e;
2434
2503
  }
2435
- function Lt(e) {
2504
+ function Ht(e) {
2436
2505
  return e != null && e !== "";
2437
2506
  }
2438
- function Rt(e) {
2507
+ function Ut(e) {
2439
2508
  return e === "sku" || e === "price" || e === "inventory";
2440
2509
  }
2441
- function zt(e, t) {
2442
- return e === "text" || e === "field" ? e : e[t] ?? Dt;
2510
+ function Wt(e, t) {
2511
+ return e === "text" || e === "field" ? e : e[t] ?? Mt;
2443
2512
  }
2444
- function Bt(e, t, n, r) {
2513
+ function Gt(e, t, n, r) {
2445
2514
  return {
2446
2515
  index: e,
2447
2516
  field: t,
@@ -2449,244 +2518,243 @@ function Bt(e, t, n, r) {
2449
2518
  value: r
2450
2519
  };
2451
2520
  }
2452
- function Vt(e, t, n, r, a) {
2453
- let o = kt(e);
2521
+ function Kt(e, t, n, r, a, o = "whitespace-normal break-words") {
2522
+ let s = Pt(e);
2454
2523
  if (n === "field") {
2455
2524
  let e = !!r;
2456
- return /* @__PURE__ */ z(w, {
2525
+ return /* @__PURE__ */ G(O, {
2457
2526
  readOnly: !e,
2458
- value: o,
2527
+ value: s,
2459
2528
  onChange: e ? (e) => r(e.currentTarget.value) : void 0,
2460
2529
  onBlur: a ? (e) => a(e.currentTarget.value) : void 0,
2461
2530
  "aria-label": t,
2462
- className: i("h-control-lg w-full min-w-24 bg-background px-control shadow-xs", !e && "text-muted-foreground")
2531
+ className: i("h-control-lg w-full min-w-24 field-sizing-content bg-background px-control shadow-xs", !e && "text-muted-foreground")
2463
2532
  });
2464
2533
  }
2465
- let s = Lt(e) ? _ : v;
2466
- return /* @__PURE__ */ z(s, {
2467
- className: "min-w-0 whitespace-normal break-words tabular-nums",
2468
- children: It(e)
2534
+ let c = Ht(e) ? S : C;
2535
+ return /* @__PURE__ */ G(c, {
2536
+ className: i("min-w-0 tabular-nums", o),
2537
+ children: Vt(e)
2469
2538
  });
2470
2539
  }
2471
- function Ht({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibleColumns: c = Tt, optionCombinationDisplay: l = Et, cellDisplay: d = Dt, selectionMode: f, renderOptionCombination: p, renderCell: m, selectedVariantIds: h, defaultSelectedVariantIds: g = [], onSelectedVariantIdsChange: _, onVariantFieldChange: v, onVariantFieldBlur: y, onCreateVariant: S, onGenerateVariants: C, onSelectVariant: w, onEditVariant: T, onDuplicateVariant: E, onDeleteVariant: ee, onBulkEdit: D, onBulkApply: k, onBulkDelete: ne, renderVariantActions: A, renderBulkActions: j, actions: M, headerEnd: N, footerSlot: P, empty: re, surface: ie = "card", className: ae, strings: de }) {
2472
- let I = r(je, de), fe = h !== void 0, [pe, he] = _e(g), ye = !!(j || D || k || ne), V = (f ?? (ye || fe || _ ? Ot : "none")) === "multiple", U = R(() => V ? fe ? h : pe : [], [
2473
- pe,
2474
- V,
2475
- fe,
2540
+ function qt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibleColumns: c = At, optionCombinationDisplay: l = jt, cellDisplay: d = Mt, selectionMode: f, renderOptionCombination: p, renderCell: m, selectedVariantIds: h, defaultSelectedVariantIds: g = [], onSelectedVariantIdsChange: v, onVariantFieldChange: y, onVariantFieldBlur: b, onCreateVariant: x, onGenerateVariants: S, onSelectVariant: C, onEditVariant: w, onDuplicateVariant: E, onDeleteVariant: D, onBulkEdit: O, onBulkApply: k, onBulkDelete: A, renderVariantActions: te, renderBulkActions: j, actions: re, headerEnd: ie, footerSlot: ae, empty: N, surface: P = "card", className: F, strings: I }) {
2541
+ let L = r($, I), R = h !== void 0, [z, de] = _e(g), V = !!(j || O || k || A), H = (f ?? (V || R || v ? Nt : "none")) === "multiple", fe = W(() => H ? R ? h : z : [], [
2542
+ z,
2543
+ H,
2544
+ R,
2476
2545
  h
2477
- ]), xe = R(() => new Map(e.map((e) => [e.id, e])), [e]), Se = R(() => Ft(U, xe), [xe, U]), Ce = R(() => new Set(U), [U]), K = R(() => new Set(c), [c]), J = R(() => t.find((e) => e.id === n), [t, n]), we = R(() => new Map(e.map((e, t) => [e.id, t])), [e]), Te = R(() => {
2546
+ ]), me = W(() => new Map(e.map((e) => [e.id, e])), [e]), he = W(() => Bt(fe, me), [me, fe]), ye = W(() => new Set(fe), [fe]), q = W(() => new Set(c), [c]), J = W(() => t.find((e) => e.id === n), [t, n]), Ce = W(() => new Map(e.map((e, t) => [e.id, t])), [e]), we = W(() => {
2478
2547
  if (!J) return e;
2479
2548
  let t = new Map((J.values ?? []).map((e, t) => [e.id, t]));
2480
2549
  return [...e].sort((e, n) => {
2481
2550
  let r = e.optionValueIds?.[J.id], i = n.optionValueIds?.[J.id], a = r === void 0 ? void 0 : t.get(r), o = i === void 0 ? void 0 : t.get(i), s = a ?? 2 ** 53 - 1, c = o ?? 2 ** 53 - 1;
2482
- return s === c ? (we.get(e.id) ?? 0) - (we.get(n.id) ?? 0) : s - c;
2551
+ return s === c ? (Ce.get(e.id) ?? 0) - (Ce.get(n.id) ?? 0) : s - c;
2483
2552
  });
2484
2553
  }, [
2485
2554
  J,
2486
- we,
2555
+ Ce,
2487
2556
  e
2488
- ]), Ee = R(() => {
2557
+ ]), Te = W(() => {
2489
2558
  if (!J) return /* @__PURE__ */ new Map();
2490
2559
  let t = /* @__PURE__ */ new Map();
2491
2560
  return e.forEach((e) => {
2492
- let n = Pt(e, J);
2561
+ let n = zt(e, J);
2493
2562
  t.set(n, (t.get(n) ?? 0) + 1);
2494
2563
  }), t;
2495
- }, [J, e]), De = V && ye, Oe = e.length > 0, ke = V && Oe && e.every((e) => Ce.has(e.id)), Y = Se.length > 0 && !ke, Ae = ge(null), X = !!(w || T || E || ee || A), Z = c.filter((e) => K.has(e)).length + +!!V + +!!X, Q = L((e) => {
2496
- let t = Ft(e, xe);
2497
- fe || he(e), _?.(e, t);
2564
+ }, [J, e]), Ee = H && V, De = e.length > 0, Z = H && De && e.every((e) => ye.has(e.id)), Oe = he.length > 0 && !Z, ke = ge(null), Ae = !!(C || w || E || D || te), je = c.filter((e) => q.has(e)).length + +!!H + +!!Ae, Q = U((e) => {
2565
+ let t = Bt(e, me);
2566
+ R || de(e), v?.(e, t);
2498
2567
  }, [
2499
- fe,
2500
- _,
2501
- xe
2502
- ]), Me = L(() => Q([]), [Q]), Ne = L((e, t) => {
2503
- if (!V) return;
2504
- let n = t === !0 ? Array.from(/* @__PURE__ */ new Set([...U, e.id])) : U.filter((t) => t !== e.id);
2568
+ R,
2569
+ v,
2570
+ me
2571
+ ]), Me = U(() => Q([]), [Q]), Ne = U((e, t) => {
2572
+ if (!H) return;
2573
+ let n = t === !0 ? Array.from(/* @__PURE__ */ new Set([...fe, e.id])) : fe.filter((t) => t !== e.id);
2505
2574
  Q(n);
2506
2575
  }, [
2507
- V,
2508
- U,
2576
+ H,
2577
+ fe,
2509
2578
  Q
2510
- ]), Pe = L((t) => {
2511
- V && Q(t === !0 ? e.map((e) => e.id) : []);
2579
+ ]), Pe = U((t) => {
2580
+ H && Q(t === !0 ? e.map((e) => e.id) : []);
2512
2581
  }, [
2513
- V,
2582
+ H,
2514
2583
  Q,
2515
2584
  e
2516
2585
  ]), Fe = {
2517
- selectedRows: Se,
2518
- selectedIds: U,
2586
+ selectedRows: he,
2587
+ selectedIds: fe,
2519
2588
  allRows: e,
2520
- selectedCount: Se.length,
2589
+ selectedCount: he.length,
2521
2590
  totalCount: e.length,
2522
- allRowsSelected: ke,
2591
+ allRowsSelected: Z,
2523
2592
  clearSelection: Me,
2524
2593
  setSelectedIds: Q
2525
- }, Ie = S || C ? /* @__PURE__ */ B(u, {
2594
+ }, Ie = x || S ? /* @__PURE__ */ K(u, {
2526
2595
  direction: "horizontal",
2527
- gap: "sm",
2596
+ gap: _.commands,
2528
2597
  justify: "end",
2529
2598
  className: "product-variants-bulk-table--header-actions",
2530
- children: [!!C && /* @__PURE__ */ z(a, {
2599
+ children: [!!S && /* @__PURE__ */ G(a, {
2531
2600
  type: "button",
2532
2601
  tone: "secondary",
2533
2602
  buttonStyle: "outline",
2534
- onClick: C,
2535
- children: I.generateLabel
2536
- }), !!S && /* @__PURE__ */ z(a, {
2603
+ onClick: S,
2604
+ children: L.generateLabel
2605
+ }), !!x && /* @__PURE__ */ G(a, {
2537
2606
  type: "button",
2538
2607
  tone: "secondary",
2539
2608
  buttonStyle: "ghost",
2540
- onClick: S,
2541
- icon: G,
2542
- children: I.createLabel
2609
+ onClick: x,
2610
+ icon: Y,
2611
+ children: L.createLabel
2543
2612
  })]
2544
- }) : void 0, Le = Se.length > 0 ? j?.(Fe) : void 0, Re = De ? /* @__PURE__ */ z(x, {
2613
+ }) : void 0, Le = he.length > 0 ? j?.(Fe) : void 0, Re = Ee ? /* @__PURE__ */ G(T, {
2545
2614
  placement: "inline",
2546
2615
  className: "product-variants-bulk-table--bulk-toolbar",
2547
- selectedCount: Se.length,
2616
+ selectedCount: he.length,
2548
2617
  totalCount: e.length,
2549
2618
  onClear: Me,
2550
- returnFocusRef: Ae,
2619
+ returnFocusRef: ke,
2551
2620
  strings: {
2552
- summary: (t, n) => I.selectedLabel(t, n ?? e.length),
2553
- clear: I.clearSelectionLabel
2621
+ summary: (t, n) => L.selectedLabel(t, n ?? e.length),
2622
+ clear: L.clearSelectionLabel
2554
2623
  },
2555
- children: Le ?? /* @__PURE__ */ B(ve, { children: [
2556
- !!D && /* @__PURE__ */ z(a, {
2624
+ children: Le ?? /* @__PURE__ */ K(ve, { children: [
2625
+ !!O && /* @__PURE__ */ G(a, {
2557
2626
  type: "button",
2558
- onClick: () => D(Se),
2559
- children: I.bulkEditLabel
2627
+ onClick: () => O(he),
2628
+ children: L.bulkEditLabel
2560
2629
  }),
2561
- !!k && /* @__PURE__ */ z(a, {
2630
+ !!k && /* @__PURE__ */ G(a, {
2562
2631
  type: "button",
2563
2632
  tone: "neutral",
2564
2633
  buttonStyle: "ghost",
2565
- onClick: () => k(Se),
2566
- children: I.bulkApplyLabel
2634
+ onClick: () => k(he),
2635
+ children: L.bulkApplyLabel
2567
2636
  }),
2568
- !!ne && /* @__PURE__ */ z(a, {
2637
+ !!A && /* @__PURE__ */ G(a, {
2569
2638
  type: "button",
2570
2639
  tone: "destructive",
2571
2640
  buttonStyle: "ghost",
2572
- onClick: () => ne(Se),
2573
- children: I.bulkDeleteLabel
2641
+ onClick: () => A(he),
2642
+ children: L.bulkDeleteLabel
2574
2643
  })
2575
2644
  ] })
2576
- }) : null, ze = e.length === 0 ? re ?? /* @__PURE__ */ z($, {
2577
- title: I.emptyTitle,
2578
- description: I.emptyDescription,
2579
- action: C ? /* @__PURE__ */ z(a, {
2645
+ }) : null, ze = e.length === 0 ? N ?? /* @__PURE__ */ G(Ve, {
2646
+ title: L.emptyTitle,
2647
+ description: L.emptyDescription,
2648
+ action: S ? /* @__PURE__ */ G(a, {
2580
2649
  tone: "primary",
2581
2650
  type: "button",
2582
- onClick: C,
2583
- children: I.generateLabel
2651
+ onClick: S,
2652
+ children: L.generateLabel
2584
2653
  }) : void 0
2585
- }) : /* @__PURE__ */ B(u, {
2654
+ }) : /* @__PURE__ */ K(u, {
2586
2655
  gap: "md",
2587
2656
  className: "product-variants-bulk-table--body",
2588
- children: [Re, /* @__PURE__ */ z("div", {
2589
- className: "product-variants-bulk-table--table overflow-hidden rounded-radius border border-border bg-background text-foreground",
2590
- children: /* @__PURE__ */ B(ue, {
2591
- containerClassName: "[scrollbar-gutter:stable] [scrollbar-width:thin] [&::-webkit-scrollbar]:h-2.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-track]:bg-muted/30",
2657
+ children: [Re, /* @__PURE__ */ G("div", {
2658
+ className: "product-variants-bulk-table--table overflow-hidden rounded-surface border border-border bg-background text-foreground",
2659
+ children: /* @__PURE__ */ K(ue, {
2592
2660
  className: "w-full border-collapse",
2593
2661
  children: [
2594
- /* @__PURE__ */ B("colgroup", { children: [
2595
- V && /* @__PURE__ */ z("col", { className: "w-14 min-w-14 max-w-14" }),
2596
- K.has("variant") && /* @__PURE__ */ z("col", {}),
2597
- K.has("sku") && /* @__PURE__ */ z("col", {}),
2598
- K.has("price") && /* @__PURE__ */ z("col", {}),
2599
- K.has("inventory") && /* @__PURE__ */ z("col", {}),
2600
- K.has("status") && /* @__PURE__ */ z("col", {}),
2601
- K.has("updated") && /* @__PURE__ */ z("col", {}),
2602
- X && /* @__PURE__ */ z("col", { className: "w-18" })
2662
+ /* @__PURE__ */ K("colgroup", { children: [
2663
+ H && /* @__PURE__ */ G("col", { className: "w-14 min-w-14 max-w-14" }),
2664
+ q.has("variant") && /* @__PURE__ */ G("col", {}),
2665
+ q.has("sku") && /* @__PURE__ */ G("col", {}),
2666
+ q.has("price") && /* @__PURE__ */ G("col", {}),
2667
+ q.has("inventory") && /* @__PURE__ */ G("col", {}),
2668
+ q.has("status") && /* @__PURE__ */ G("col", {}),
2669
+ q.has("updated") && /* @__PURE__ */ G("col", {}),
2670
+ Ae && /* @__PURE__ */ G("col", { className: "w-18" })
2603
2671
  ] }),
2604
- /* @__PURE__ */ z(le, { children: /* @__PURE__ */ B(oe, {
2672
+ /* @__PURE__ */ G(le, { children: /* @__PURE__ */ K(B, {
2605
2673
  className: "h-12 border-b border-border/60 bg-muted/50",
2606
2674
  children: [
2607
- V && /* @__PURE__ */ z(F, {
2675
+ H && /* @__PURE__ */ G(ce, {
2608
2676
  className: "w-14 min-w-14 max-w-14 px-0 py-space-md text-center align-middle",
2609
- children: /* @__PURE__ */ z(te, {
2610
- ref: Ae,
2611
- checked: ke,
2612
- indeterminate: Y,
2677
+ children: /* @__PURE__ */ G(ne, {
2678
+ ref: ke,
2679
+ checked: Z,
2680
+ indeterminate: Oe,
2613
2681
  onCheckedChange: Pe,
2614
- "aria-label": I.selectAllLabel,
2682
+ "aria-label": L.selectAllLabel,
2615
2683
  className: "mx-auto"
2616
2684
  })
2617
2685
  }),
2618
- K.has("variant") && /* @__PURE__ */ z(F, {
2686
+ q.has("variant") && /* @__PURE__ */ G(ce, {
2619
2687
  className: "px-space-lg py-space-md text-left align-middle",
2620
- children: /* @__PURE__ */ z(s, {
2688
+ children: /* @__PURE__ */ G(s, {
2621
2689
  className: "whitespace-normal",
2622
- children: I.headers.variant
2690
+ children: L.headers.variant
2623
2691
  })
2624
2692
  }),
2625
- K.has("sku") && /* @__PURE__ */ z(F, {
2693
+ q.has("sku") && /* @__PURE__ */ G(ce, {
2626
2694
  className: "px-space-lg py-space-md text-left align-middle",
2627
- children: /* @__PURE__ */ z(s, {
2695
+ children: /* @__PURE__ */ G(s, {
2628
2696
  className: "whitespace-normal",
2629
- children: I.headers.sku
2697
+ children: L.headers.sku
2630
2698
  })
2631
2699
  }),
2632
- K.has("price") && /* @__PURE__ */ z(F, {
2700
+ q.has("price") && /* @__PURE__ */ G(ce, {
2633
2701
  className: "px-space-lg py-space-md text-left align-middle",
2634
- children: /* @__PURE__ */ z(s, {
2702
+ children: /* @__PURE__ */ G(s, {
2635
2703
  className: "whitespace-normal",
2636
- children: I.headers.price
2704
+ children: L.headers.price
2637
2705
  })
2638
2706
  }),
2639
- K.has("inventory") && /* @__PURE__ */ z(F, {
2707
+ q.has("inventory") && /* @__PURE__ */ G(ce, {
2640
2708
  className: "px-space-lg py-space-md text-left align-middle",
2641
- children: /* @__PURE__ */ z(s, {
2709
+ children: /* @__PURE__ */ G(s, {
2642
2710
  className: "whitespace-normal",
2643
- children: I.headers.inventory
2711
+ children: L.headers.inventory
2644
2712
  })
2645
2713
  }),
2646
- K.has("status") && /* @__PURE__ */ z(F, {
2714
+ q.has("status") && /* @__PURE__ */ G(ce, {
2647
2715
  className: "px-space-lg py-space-md text-left align-middle",
2648
- children: /* @__PURE__ */ z(s, {
2716
+ children: /* @__PURE__ */ G(s, {
2649
2717
  className: "whitespace-normal",
2650
- children: I.headers.status
2718
+ children: L.headers.status
2651
2719
  })
2652
2720
  }),
2653
- K.has("updated") && /* @__PURE__ */ z(F, {
2721
+ q.has("updated") && /* @__PURE__ */ G(ce, {
2654
2722
  className: "px-space-lg py-space-md text-left align-middle",
2655
- children: /* @__PURE__ */ z(s, {
2723
+ children: /* @__PURE__ */ G(s, {
2656
2724
  className: "whitespace-normal",
2657
- children: I.headers.updated
2725
+ children: L.headers.updated
2658
2726
  })
2659
2727
  }),
2660
- X && /* @__PURE__ */ z(F, {
2728
+ Ae && /* @__PURE__ */ G(ce, {
2661
2729
  className: "px-space-lg py-space-md text-right align-middle",
2662
- children: /* @__PURE__ */ z(s, {
2730
+ children: /* @__PURE__ */ G(s, {
2663
2731
  className: "whitespace-normal",
2664
- children: I.headers.actions
2732
+ children: L.headers.actions
2665
2733
  })
2666
2734
  })
2667
2735
  ]
2668
2736
  }) }),
2669
- /* @__PURE__ */ z(ce, { children: Te.map((e, n) => {
2670
- let r = we.get(e.id) ?? n, i = J ? Pt(e, J) : null, a = n > 0 ? Te[n - 1] : void 0, s = J && a ? Pt(a, J) : null, c = !!J && i !== s, f = Ce.has(e.id), h = {
2737
+ /* @__PURE__ */ G(se, { children: we.map((e, n) => {
2738
+ let r = Ce.get(e.id) ?? n, i = J ? zt(e, J) : null, a = n > 0 ? we[n - 1] : void 0, s = J && a ? zt(a, J) : null, c = !!J && i !== s, f = ye.has(e.id), h = {
2671
2739
  index: r,
2672
- onSelect: w ? () => w(e) : void 0,
2673
- onEdit: T ? () => T(e) : void 0,
2740
+ onSelect: C ? () => C(e) : void 0,
2741
+ onEdit: w ? () => w(e) : void 0,
2674
2742
  onDuplicate: E ? () => E(e) : void 0,
2675
- onDelete: ee ? () => ee(e) : void 0,
2743
+ onDelete: D ? () => D(e) : void 0,
2676
2744
  isSelected: f,
2677
- onToggleSelected: V ? (t) => Ne(e, t) : void 0
2678
- }, g = J ? t.filter((e) => e.id !== J.id) : t, _ = Mt(e, g), x = J ? jt({
2745
+ onToggleSelected: H ? (t) => Ne(e, t) : void 0
2746
+ }, g = J ? t.filter((e) => e.id !== J.id) : t, _ = Lt(e, g), v = J ? It({
2679
2747
  ...e,
2680
2748
  name: void 0
2681
- }, g) : jt(e, t), S = x === "-" && J ? jt(e, t) : x, C = Nt(_), D = C === kt(S), O = (t, n, i = Dt) => {
2682
- let a = Rt(t) && v ? (i) => v(e, t, i, Bt(r, t, n, i)) : void 0, o = Rt(t) && y ? (i) => y(e, t, i, Bt(r, t, n, i)) : void 0;
2749
+ }, g) : It(e, t), x = v === "-" && J ? It(e, t) : v, S = Rt(_), T = S === Pt(x), O = (t, n, i = Mt) => {
2750
+ let a = Ut(t) && y ? (i) => y(e, t, i, Gt(r, t, n, i)) : void 0, o = Ut(t) && b ? (i) => b(e, t, i, Gt(r, t, n, i)) : void 0;
2683
2751
  return {
2684
2752
  index: r,
2685
2753
  column: t,
2686
2754
  value: n,
2687
- variantName: S,
2755
+ variantName: x,
2688
2756
  optionValues: _,
2689
- optionLabel: C,
2757
+ optionLabel: S,
2690
2758
  cellDisplay: i,
2691
2759
  onValueChange: a,
2692
2760
  onBlur: o
@@ -2694,102 +2762,102 @@ function Ht({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibl
2694
2762
  }, k = (t, n, r, i) => {
2695
2763
  let a = O(t, n, r), o = m?.(e, a);
2696
2764
  return o === void 0 ? i(a) : o;
2697
- }, ne = l !== "none" && _.length > 0 && (J ? !D : l === "tags" || !D), j = l === "none" ? null : p?.(e, {
2765
+ }, A = l !== "none" && _.length > 0 && !T, j = l === "none" ? null : p?.(e, {
2698
2766
  optionGroups: t,
2699
2767
  optionValues: _,
2700
- optionLabel: C,
2768
+ optionLabel: S,
2701
2769
  display: l
2702
2770
  }), M = [
2703
- ...w ? [{
2771
+ ...C ? [{
2704
2772
  id: "view",
2705
- label: I.viewLabel,
2706
- icon: /* @__PURE__ */ z(H, { className: "size-icon-md" }),
2707
- onClick: () => w(e),
2773
+ label: L.viewLabel,
2774
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
2775
+ onClick: () => C(e),
2708
2776
  tone: "secondary",
2709
2777
  buttonStyle: "ghost"
2710
2778
  }] : [],
2711
- ...T ? [{
2779
+ ...w ? [{
2712
2780
  id: "edit",
2713
- label: I.editLabel,
2714
- icon: /* @__PURE__ */ z(W, { className: "size-icon-md" }),
2715
- onClick: () => T(e),
2781
+ label: L.editLabel,
2782
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
2783
+ onClick: () => w(e),
2716
2784
  tone: "secondary",
2717
2785
  buttonStyle: "ghost"
2718
2786
  }] : [],
2719
2787
  ...E ? [{
2720
2788
  id: "duplicate",
2721
- label: I.duplicateLabel,
2722
- icon: /* @__PURE__ */ z(be, { className: "size-icon-md" }),
2789
+ label: L.duplicateLabel,
2790
+ icon: /* @__PURE__ */ G(be, { className: "size-icon-md" }),
2723
2791
  onClick: () => E(e),
2724
2792
  tone: "secondary",
2725
2793
  buttonStyle: "ghost"
2726
2794
  }] : [],
2727
- ...ee ? [{
2795
+ ...D ? [{
2728
2796
  id: "delete",
2729
- label: I.deleteLabel,
2730
- icon: /* @__PURE__ */ z(q, { className: "size-icon-md" }),
2731
- onClick: () => ee(e),
2797
+ label: L.deleteLabel,
2798
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
2799
+ onClick: () => D(e),
2732
2800
  tone: "destructive"
2733
2801
  }] : []
2734
2802
  ];
2735
- return /* @__PURE__ */ B(me, { children: [c && /* @__PURE__ */ z(oe, {
2803
+ return /* @__PURE__ */ K(pe, { children: [c && /* @__PURE__ */ G(B, {
2736
2804
  className: "product-variants-bulk-table--group-row border-b border-border/60 bg-muted/30",
2737
- children: /* @__PURE__ */ z(se, {
2738
- colSpan: Z,
2805
+ children: /* @__PURE__ */ G(oe, {
2806
+ colSpan: je,
2739
2807
  className: "px-space-lg py-space-md align-middle",
2740
- children: /* @__PURE__ */ B(u, {
2808
+ children: /* @__PURE__ */ K(u, {
2741
2809
  direction: "horizontal",
2742
2810
  gap: "sm",
2743
2811
  wrap: !1,
2744
- children: [/* @__PURE__ */ z(o, {
2812
+ children: [/* @__PURE__ */ G(o, {
2745
2813
  type: "inherit",
2746
2814
  tag: "span",
2747
2815
  weight: "semibold",
2748
2816
  className: "min-w-0 whitespace-normal break-words",
2749
2817
  children: i
2750
- }), /* @__PURE__ */ z(o, {
2818
+ }), /* @__PURE__ */ G(o, {
2751
2819
  tag: "span",
2752
2820
  size: "xs",
2753
2821
  type: "secondary",
2754
2822
  className: "whitespace-nowrap",
2755
- children: I.groupCountLabel(Ee.get(i ?? "") ?? 0)
2823
+ children: L.groupCountLabel(Te.get(i ?? "") ?? 0)
2756
2824
  })]
2757
2825
  })
2758
2826
  })
2759
- }), /* @__PURE__ */ B(oe, {
2827
+ }), /* @__PURE__ */ K(B, {
2760
2828
  className: "h-20 border-b border-border/60 last:border-b-0",
2761
2829
  children: [
2762
- V && /* @__PURE__ */ z(se, {
2830
+ H && /* @__PURE__ */ G(oe, {
2763
2831
  className: "w-14 min-w-14 max-w-14 px-0 py-space-lg text-center align-middle",
2764
- children: /* @__PURE__ */ z(te, {
2832
+ children: /* @__PURE__ */ G(ne, {
2765
2833
  checked: f,
2766
2834
  onCheckedChange: (t) => Ne(e, t),
2767
- "aria-label": I.selectRowLabel(r),
2835
+ "aria-label": L.selectRowLabel(r),
2768
2836
  className: "mx-auto"
2769
2837
  })
2770
2838
  }),
2771
- K.has("variant") && /* @__PURE__ */ z(se, {
2839
+ q.has("variant") && /* @__PURE__ */ G(oe, {
2772
2840
  className: "px-space-lg py-space-lg align-middle",
2773
- children: k("variant", S, Dt, () => /* @__PURE__ */ B(u, {
2841
+ children: k("variant", x, Mt, () => /* @__PURE__ */ K(u, {
2774
2842
  gap: "xs",
2775
2843
  children: [
2776
- /* @__PURE__ */ z(o, {
2844
+ /* @__PURE__ */ G(o, {
2777
2845
  type: "inherit",
2778
2846
  weight: "medium",
2779
2847
  className: "min-w-0 whitespace-normal break-words",
2780
- children: S
2848
+ children: x
2781
2849
  }),
2782
2850
  j,
2783
- !j && ne && l === "text" && /* @__PURE__ */ z(o, {
2851
+ !j && A && l === "text" && /* @__PURE__ */ G(o, {
2784
2852
  size: "xs",
2785
2853
  type: "secondary",
2786
2854
  className: "min-w-0 whitespace-normal break-words",
2787
- children: _.map((t, n) => /* @__PURE__ */ B("span", { children: [n > 0 ? " / " : null, t] }, `${e.id}-option-text-${n}`))
2855
+ children: _.map((t, n) => /* @__PURE__ */ K("span", { children: [n > 0 ? " / " : null, t] }, `${e.id}-option-text-${n}`))
2788
2856
  }),
2789
- !j && ne && l === "tags" && /* @__PURE__ */ z(u, {
2857
+ !j && A && l === "tags" && /* @__PURE__ */ G(u, {
2790
2858
  direction: "horizontal",
2791
2859
  gap: "xs",
2792
- children: _.map((t, n) => /* @__PURE__ */ z(b, {
2860
+ children: _.map((t, n) => /* @__PURE__ */ G(ee, {
2793
2861
  size: "sm",
2794
2862
  tone: "secondary",
2795
2863
  className: "max-w-full",
@@ -2799,38 +2867,38 @@ function Ht({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibl
2799
2867
  ]
2800
2868
  }))
2801
2869
  }),
2802
- K.has("sku") && /* @__PURE__ */ z(se, {
2870
+ q.has("sku") && /* @__PURE__ */ G(oe, {
2803
2871
  className: "px-space-lg py-space-md align-middle",
2804
- children: k("sku", e.sku, zt(d, "sku"), (t) => Vt(e.sku, `${I.headers.sku}: ${kt(S)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2872
+ children: k("sku", e.sku, Wt(d, "sku"), (t) => Kt(e.sku, `${L.headers.sku}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur, "whitespace-nowrap"))
2805
2873
  }),
2806
- K.has("price") && /* @__PURE__ */ z(se, {
2874
+ q.has("price") && /* @__PURE__ */ G(oe, {
2807
2875
  className: "px-space-lg py-space-md align-middle",
2808
- children: k("price", e.price, zt(d, "price"), (t) => Vt(e.price, `${I.headers.price}: ${kt(S)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2876
+ children: k("price", e.price, Wt(d, "price"), (t) => Kt(e.price, `${L.headers.price}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2809
2877
  }),
2810
- K.has("inventory") && /* @__PURE__ */ z(se, {
2878
+ q.has("inventory") && /* @__PURE__ */ G(oe, {
2811
2879
  className: "px-space-lg py-space-md align-middle",
2812
- children: k("inventory", e.inventory, zt(d, "inventory"), (t) => Vt(e.inventory, `${I.headers.inventory}: ${kt(S)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2880
+ children: k("inventory", e.inventory, Wt(d, "inventory"), (t) => Kt(e.inventory, `${L.headers.inventory}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2813
2881
  }),
2814
- K.has("status") && /* @__PURE__ */ z(se, {
2882
+ q.has("status") && /* @__PURE__ */ G(oe, {
2815
2883
  className: "px-space-lg py-space-lg align-middle",
2816
- children: k("status", e.status, Dt, () => e.status ? /* @__PURE__ */ z(b, {
2884
+ children: k("status", e.status, Mt, () => e.status ? /* @__PURE__ */ G(ee, {
2817
2885
  tone: e.statusTone ?? "secondary",
2818
2886
  children: e.status
2819
- }) : /* @__PURE__ */ z(o, {
2887
+ }) : /* @__PURE__ */ G(o, {
2820
2888
  type: "secondary",
2821
2889
  children: "-"
2822
2890
  }))
2823
2891
  }),
2824
- K.has("updated") && /* @__PURE__ */ z(se, {
2892
+ q.has("updated") && /* @__PURE__ */ G(oe, {
2825
2893
  className: "px-space-lg py-space-lg align-middle",
2826
- children: k("updated", e.updatedAt, Dt, () => Vt(e.updatedAt, `${I.headers.updated}: ${kt(S)}`, "text"))
2894
+ children: k("updated", e.updatedAt, Mt, () => Kt(e.updatedAt, `${L.headers.updated}: ${Pt(x)}`, "text"))
2827
2895
  }),
2828
- X && /* @__PURE__ */ z(se, {
2896
+ Ae && /* @__PURE__ */ G(oe, {
2829
2897
  className: "px-space-lg py-space-lg text-right align-middle",
2830
- children: A ? A(e, h) : /* @__PURE__ */ z(We, {
2898
+ children: te ? te(e, h) : /* @__PURE__ */ G(Ye, {
2831
2899
  item: e,
2832
2900
  actions: M,
2833
- menuLabel: I.headers.actions
2901
+ menuLabel: L.headers.actions
2834
2902
  })
2835
2903
  })
2836
2904
  ]
@@ -2840,209 +2908,218 @@ function Ht({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibl
2840
2908
  })
2841
2909
  })]
2842
2910
  });
2843
- return ie === "embedded" ? /* @__PURE__ */ z("section", {
2844
- "aria-label": I.title,
2845
- className: i("product-variants-bulk-table--component min-w-0", ae),
2911
+ return P === "embedded" ? /* @__PURE__ */ G("section", {
2912
+ "aria-label": L.title,
2913
+ className: i("product-variants-bulk-table--component min-w-0", F),
2846
2914
  children: ze
2847
- }) : /* @__PURE__ */ z(O, {
2848
- title: I.title,
2849
- description: I.description,
2850
- actions: M,
2915
+ }) : /* @__PURE__ */ G(M, {
2916
+ title: L.title,
2917
+ description: L.description,
2918
+ actions: re,
2851
2919
  headerAction: Ie,
2852
- headerEnd: N,
2853
- footerSlot: P,
2854
- className: i("product-variants-bulk-table--component w-full", ae),
2920
+ headerEnd: ie,
2921
+ footerSlot: ae,
2922
+ className: i("product-variants-bulk-table--component w-full", F),
2855
2923
  children: ze
2856
2924
  });
2857
2925
  }
2858
- Ht.displayName = "ProductVariantsBulkTable";
2926
+ qt.displayName = "ProductVariantsBulkTable";
2859
2927
  //#endregion
2860
2928
  //#region src/components/features/products/components/product-variants-manager.tsx
2861
- function Ut({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionCombinationDisplay: l, cellDisplay: d, selectionMode: p, renderOptionCombination: m, renderCell: h, selectedVariantIds: g, defaultSelectedVariantIds: _, onSelectedVariantIdsChange: v, onVariantFieldChange: y, onVariantFieldBlur: b, collapsedOptionIds: x, defaultCollapsedOptionIds: S, onCollapsedOptionIdsChange: C, editingOptionId: w, defaultEditingOptionId: T, onEditingOptionIdChange: E, onCreateOption: ee, onEditOption: te, onDeleteOption: O, onAddValue: A, onDeleteValue: j, onOptionNameChange: M, onValueLabelChange: N, onDoneEditingOption: P, onSaveEditingOption: re, onCancelEditingOption: ie, onToggleUsedForVariants: ae, renderOptionActions: oe, renderValue: se, onCreateVariant: ce, onGenerateVariants: F, onSelectVariant: le, onEditVariant: ue, onDuplicateVariant: de, onDeleteVariant: I, onBulkEdit: fe, onBulkApply: pe, onBulkDelete: me, renderVariantActions: he, renderBulkActions: ge, groupByOptionId: ve, defaultGroupByOptionId: ye, onGroupByOptionIdChange: V, onSearchVariants: be, onFilterVariants: H, controlsEnd: U, actions: W, headerEnd: Se, footerSlot: K, surface: q = "flat", padding: J = q === "flat" ? "none" : "md", headerDivider: we, footerDivider: Te, className: Ee, strings: De, optionsStrings: Oe, variantsStrings: ke }) {
2862
- let { defaultScale: Y } = e(), Ae = t(void 0, Y), X = r(Me, De), Z = R(() => n.filter((e) => e.usedForVariants !== !1), [n]), Q = Z[0]?.id ?? null, je = ve !== void 0, [Ne, Pe] = _e(ye ?? Q), Fe = ve ?? Ne ?? Q, Ie = R(() => Z.map((e) => ({
2929
+ function Jt({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionCombinationDisplay: l, cellDisplay: d, selectionMode: f, renderOptionCombination: p, renderCell: h, selectedVariantIds: g, defaultSelectedVariantIds: v, onSelectedVariantIdsChange: y, onVariantFieldChange: b, onVariantFieldBlur: x, collapsedOptionIds: S, defaultCollapsedOptionIds: C, onCollapsedOptionIdsChange: w, editingOptionId: ee, defaultEditingOptionId: T, onEditingOptionIdChange: E, onCreateOption: D, onEditOption: O, onDeleteOption: k, onAddValue: A, onDeleteValue: te, onOptionNameChange: ne, onValueLabelChange: M, onDoneEditingOption: ae, onSaveEditingOption: N, onError: P, onCancelEditingOption: F, onToggleUsedForVariants: I, renderOptionActions: L, renderValue: R, onCreateVariant: z, onGenerateVariants: B, onSelectVariant: oe, onEditVariant: se, onDuplicateVariant: ce, onDeleteVariant: le, onBulkEdit: ue, onBulkApply: de, onBulkDelete: V, renderVariantActions: H, renderBulkActions: fe, groupByOptionId: pe, defaultGroupByOptionId: me, onGroupByOptionIdChange: he, showGroupBy: ge = !0, onSearchVariants: ve, onFilterVariants: ye, controlsEnd: q, actions: be, headerEnd: xe, footerSlot: Se, surface: Ce = "flat", padding: Te = Ce === "flat" ? "none" : "md", headerDivider: X, footerDivider: Ee, className: De, strings: Z, optionsStrings: Oe, variantsStrings: ke }) {
2930
+ let { defaultScale: Ae } = t(), je = e(void 0, Ae), Q = r(Ie, Z), Me = W(() => n.filter((e) => e.usedForVariants !== !1), [n]), Ne = Me[0]?.id ?? null, Pe = pe !== void 0, [Fe, $] = _e(me), Le = Pe ? pe : ge ? Fe === void 0 ? Ne : Fe : me ?? null, Re = !!ve && !!ye, ze = !!ve || !!ye, Be = W(() => ge ? Me.map((e) => ({
2863
2931
  value: e.id,
2864
2932
  label: String(typeof e.name == "string" || typeof e.name == "number" ? e.name : e.id)
2865
- })), [Z]), $ = L((e) => {
2933
+ })) : [], [Me, ge]), Ve = U((e) => {
2866
2934
  let t = n.find((t) => t.id === e);
2867
- je || Pe(e ?? null), V?.(e, t);
2935
+ Pe || $(e ?? null), he?.(e, t);
2868
2936
  }, [
2869
- je,
2870
- V,
2937
+ Pe,
2938
+ he,
2871
2939
  n
2872
- ]), Le = F || ce ? /* @__PURE__ */ B(u, {
2940
+ ]), He = B || z ? /* @__PURE__ */ K(u, {
2873
2941
  direction: "horizontal",
2874
- gap: "sm",
2942
+ gap: _.commands,
2875
2943
  justify: "end",
2876
2944
  className: "product-variants-manager--header-actions",
2877
- children: [!!F && /* @__PURE__ */ z(a, {
2945
+ children: [!!B && /* @__PURE__ */ G(a, {
2878
2946
  type: "button",
2879
2947
  tone: "secondary",
2880
2948
  buttonStyle: "outline",
2881
- onClick: F,
2882
- children: X.generateLabel
2883
- }), !!ce && /* @__PURE__ */ z(a, {
2949
+ onClick: B,
2950
+ children: Q.generateLabel
2951
+ }), !!z && /* @__PURE__ */ G(a, {
2884
2952
  type: "button",
2885
2953
  tone: "secondary",
2886
2954
  buttonStyle: "outline",
2887
- onClick: ce,
2888
- icon: G,
2889
- children: X.createVariantLabel
2955
+ onClick: z,
2956
+ icon: Y,
2957
+ children: Q.createVariantLabel
2890
2958
  })]
2891
2959
  }) : void 0;
2892
- return /* @__PURE__ */ z(f, {
2893
- surface: q,
2894
- padding: J,
2895
- headerDivider: we,
2896
- footerDivider: Te,
2897
- title: X.title,
2898
- description: X.description,
2899
- actions: W,
2900
- actionsLabel: X.actionsLabel,
2901
- headerAction: Le,
2902
- headerEnd: Se,
2903
- footerSlot: K,
2904
- className: i("product-variants-manager--component w-full", Ee),
2905
- children: /* @__PURE__ */ B(u, {
2960
+ return /* @__PURE__ */ G(m, {
2961
+ surface: Ce,
2962
+ padding: Te,
2963
+ headerDivider: X,
2964
+ footerDivider: Ee,
2965
+ title: Q.title,
2966
+ description: Q.description,
2967
+ actions: be,
2968
+ actionsLabel: Q.actionsLabel,
2969
+ headerAction: He,
2970
+ headerEnd: xe,
2971
+ footerSlot: Se,
2972
+ className: i("product-variants-manager--component w-full", De),
2973
+ children: /* @__PURE__ */ K(u, {
2906
2974
  gap: "2xl",
2907
2975
  className: "product-variants-manager--body",
2908
- children: [/* @__PURE__ */ z("section", {
2976
+ children: [/* @__PURE__ */ G("section", {
2909
2977
  className: "product-variants-manager--options min-w-0",
2910
- children: /* @__PURE__ */ z(ct, {
2978
+ children: /* @__PURE__ */ G(pt, {
2911
2979
  optionGroups: n,
2912
- collapsedOptionIds: x,
2913
- defaultCollapsedOptionIds: S,
2914
- onCollapsedOptionIdsChange: C,
2915
- editingOptionId: w,
2980
+ collapsedOptionIds: S,
2981
+ defaultCollapsedOptionIds: C,
2982
+ onCollapsedOptionIdsChange: w,
2983
+ editingOptionId: ee,
2916
2984
  defaultEditingOptionId: T,
2917
2985
  onEditingOptionIdChange: E,
2918
2986
  surface: "embedded",
2919
- onCreateOption: ee,
2920
- onEditOption: te,
2921
- onDeleteOption: O,
2987
+ onCreateOption: D,
2988
+ onEditOption: O,
2989
+ onDeleteOption: k,
2922
2990
  onAddValue: A,
2923
- onDeleteValue: j,
2924
- onOptionNameChange: M,
2925
- onValueLabelChange: N,
2926
- onDoneEditingOption: P,
2927
- onSaveEditingOption: re,
2928
- onCancelEditingOption: ie,
2929
- onToggleUsedForVariants: ae,
2930
- renderOptionActions: oe,
2931
- renderValue: se,
2991
+ onDeleteValue: te,
2992
+ onOptionNameChange: ne,
2993
+ onValueLabelChange: M,
2994
+ onDoneEditingOption: ae,
2995
+ onSaveEditingOption: N,
2996
+ onError: P,
2997
+ onCancelEditingOption: F,
2998
+ onToggleUsedForVariants: I,
2999
+ renderOptionActions: L,
3000
+ renderValue: R,
2932
3001
  showHeader: !1,
2933
3002
  showCollapseControls: !1,
2934
3003
  showInlineActions: !1,
2935
3004
  showVariantToggle: !1,
2936
3005
  strings: {
2937
- title: X.optionsTitle,
3006
+ title: Q.optionsTitle,
2938
3007
  ...Oe
2939
3008
  }
2940
3009
  })
2941
- }), /* @__PURE__ */ B(u, {
3010
+ }), /* @__PURE__ */ K(u, {
2942
3011
  gap: "md",
2943
3012
  className: "product-variants-manager--variants-region",
2944
- children: [/* @__PURE__ */ z("div", {
3013
+ children: [(Be.length > 0 || ze || q) && /* @__PURE__ */ G("div", {
2945
3014
  className: "product-variants-manager--controls",
2946
- children: /* @__PURE__ */ B(u, {
3015
+ children: /* @__PURE__ */ K(u, {
2947
3016
  direction: "horizontal",
2948
3017
  gap: "md",
2949
3018
  justify: "between",
2950
- children: [/* @__PURE__ */ B(u, {
3019
+ children: [Be.length > 0 && /* @__PURE__ */ K(u, {
2951
3020
  direction: "horizontal",
2952
3021
  gap: "sm",
2953
3022
  wrap: !1,
2954
3023
  className: "product-variants-manager--group-by",
2955
- children: [/* @__PURE__ */ z(o, {
3024
+ children: [/* @__PURE__ */ G(o, {
2956
3025
  type: "secondary",
2957
3026
  className: "whitespace-nowrap",
2958
- children: X.groupByLabel
2959
- }), Ie.length > 0 && /* @__PURE__ */ z(D, {
2960
- options: Ie,
2961
- value: Fe,
2962
- onValueChange: $,
2963
- "aria-label": X.groupByLabel,
3027
+ children: Q.groupByLabel
3028
+ }), Be.length > 0 && /* @__PURE__ */ G(j, {
3029
+ options: Be,
3030
+ value: Le ?? void 0,
3031
+ onValueChange: Ve,
3032
+ "aria-label": Q.groupByLabel,
2964
3033
  className: "min-w-32 bg-background"
2965
3034
  })]
2966
- }), /* @__PURE__ */ B(u, {
3035
+ }), (ze || q) && /* @__PURE__ */ K(u, {
2967
3036
  direction: "horizontal",
2968
3037
  gap: "sm",
2969
3038
  justify: "end",
2970
3039
  wrap: !1,
2971
- className: "product-variants-manager--controls-end",
2972
- children: [/* @__PURE__ */ B("div", {
2973
- className: i("product-variants-manager--tool-buttons bg-background shadow-xs", k.joinedFrame, ne[Ae]),
2974
- children: [/* @__PURE__ */ B(a, {
3040
+ className: "product-variants-manager--controls-end ms-auto",
3041
+ children: [ze && /* @__PURE__ */ K("div", {
3042
+ className: i("flex", Re && [
3043
+ "product-variants-manager--tool-buttons bg-background shadow-xs",
3044
+ re.joinedFrame,
3045
+ ie[je]
3046
+ ]),
3047
+ children: [ve && /* @__PURE__ */ K(a, {
2975
3048
  type: "button",
2976
- size: "sm",
3049
+ size: je,
2977
3050
  iconOnly: !0,
2978
3051
  tone: "secondary",
2979
- buttonStyle: "ghost",
2980
- onClick: be,
2981
- "aria-label": X.searchLabel,
2982
- className: i(k.joinedItem, k.firstItem, "border-r border-border text-muted-foreground hover:text-foreground"),
2983
- children: [/* @__PURE__ */ z(Ce, {
3052
+ buttonStyle: Re ? "ghost" : "outline",
3053
+ onClick: ve,
3054
+ "aria-label": Q.searchLabel,
3055
+ className: i(Re && [
3056
+ re.joinedItem,
3057
+ re.firstItem,
3058
+ "border-r border-border"
3059
+ ], "text-muted-foreground hover:text-foreground"),
3060
+ children: [/* @__PURE__ */ G(we, {
2984
3061
  className: "size-icon-sm",
2985
3062
  "aria-hidden": "true"
2986
- }), /* @__PURE__ */ z(o, {
3063
+ }), /* @__PURE__ */ G(o, {
2987
3064
  tag: "span",
2988
3065
  size: "pxs",
2989
3066
  className: "sr-only",
2990
- children: X.searchLabel
3067
+ children: Q.searchLabel
2991
3068
  })]
2992
- }), /* @__PURE__ */ B(a, {
3069
+ }), ye && /* @__PURE__ */ K(a, {
2993
3070
  type: "button",
2994
- size: "sm",
3071
+ size: je,
2995
3072
  iconOnly: !0,
2996
3073
  tone: "secondary",
2997
- buttonStyle: "ghost",
2998
- onClick: H,
2999
- "aria-label": X.filterLabel,
3000
- className: i(k.joinedItem, k.lastItem, "text-muted-foreground hover:text-foreground"),
3001
- children: [/* @__PURE__ */ z(xe, {
3074
+ buttonStyle: Re ? "ghost" : "outline",
3075
+ onClick: ye,
3076
+ "aria-label": Q.filterLabel,
3077
+ className: i(Re && [re.joinedItem, re.lastItem], "text-muted-foreground hover:text-foreground"),
3078
+ children: [/* @__PURE__ */ G(J, {
3002
3079
  className: "size-icon-sm",
3003
3080
  "aria-hidden": "true"
3004
- }), /* @__PURE__ */ z(o, {
3081
+ }), /* @__PURE__ */ G(o, {
3005
3082
  tag: "span",
3006
3083
  size: "pxs",
3007
3084
  className: "sr-only",
3008
- children: X.filterLabel
3085
+ children: Q.filterLabel
3009
3086
  })]
3010
3087
  })]
3011
- }), U]
3088
+ }), q]
3012
3089
  })]
3013
3090
  })
3014
- }), /* @__PURE__ */ z("section", {
3091
+ }), /* @__PURE__ */ G("section", {
3015
3092
  className: "product-variants-manager--variants min-w-0",
3016
- children: /* @__PURE__ */ z(Ht, {
3093
+ children: /* @__PURE__ */ G(qt, {
3017
3094
  variants: s,
3018
3095
  optionGroups: n,
3019
- groupByOptionId: Fe,
3096
+ groupByOptionId: Le,
3020
3097
  visibleColumns: c,
3021
3098
  optionCombinationDisplay: l,
3022
3099
  cellDisplay: d,
3023
- selectionMode: p,
3024
- renderOptionCombination: m,
3100
+ selectionMode: f,
3101
+ renderOptionCombination: p,
3025
3102
  renderCell: h,
3026
3103
  surface: "embedded",
3027
3104
  selectedVariantIds: g,
3028
- defaultSelectedVariantIds: _,
3029
- onSelectedVariantIdsChange: v,
3030
- onVariantFieldChange: y,
3031
- onVariantFieldBlur: b,
3032
- onCreateVariant: ce,
3033
- onGenerateVariants: F,
3034
- onSelectVariant: le,
3035
- onEditVariant: ue,
3036
- onDuplicateVariant: de,
3037
- onDeleteVariant: I,
3038
- onBulkEdit: fe,
3039
- onBulkApply: pe,
3040
- onBulkDelete: me,
3041
- renderVariantActions: he,
3042
- renderBulkActions: ge,
3105
+ defaultSelectedVariantIds: v,
3106
+ onSelectedVariantIdsChange: y,
3107
+ onVariantFieldChange: b,
3108
+ onVariantFieldBlur: x,
3109
+ onCreateVariant: z,
3110
+ onGenerateVariants: B,
3111
+ onSelectVariant: oe,
3112
+ onEditVariant: se,
3113
+ onDuplicateVariant: ce,
3114
+ onDeleteVariant: le,
3115
+ onBulkEdit: ue,
3116
+ onBulkApply: de,
3117
+ onBulkDelete: V,
3118
+ renderVariantActions: H,
3119
+ renderBulkActions: fe,
3043
3120
  strings: {
3044
- title: X.variantsTitle,
3045
- generateLabel: X.generateLabel,
3121
+ title: Q.variantsTitle,
3122
+ generateLabel: Q.generateLabel,
3046
3123
  ...ke
3047
3124
  }
3048
3125
  })
@@ -3051,8 +3128,8 @@ function Ut({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionC
3051
3128
  })
3052
3129
  });
3053
3130
  }
3054
- Ut.displayName = "ProductVariantsManager";
3131
+ Jt.displayName = "ProductVariantsManager";
3055
3132
  //#endregion
3056
- export { et as ProductContractOverview, tt as ProductDetailsCard, rt as ProductOperationsCard, nt as ProductOptionActionMenu, ct as ProductOptionsMatrix, lt as ProductOptionsSummary, _t as ProductOverview, ut as ProductPoliciesCard, dt as ProductQuotePreviewCard, ft as ProductReadinessCard, pt as ProductStructureCard, yt as ProductVariantActionMenu, St as ProductVariantDetails, wt as ProductVariantEditor, Ht as ProductVariantsBulkTable, Ut as ProductVariantsManager, gt as ProductVariantsTable, Oe as defaultProductContractOverviewStrings, De as defaultProductDetailsCardStrings, Ee as defaultProductOperationsCardStrings, Y as defaultProductOptionActionMenuStrings, Ae as defaultProductOptionsMatrixStrings, ke as defaultProductOptionsSummaryStrings, Ie as defaultProductOverviewStrings, Z as defaultProductPoliciesCardStrings, X as defaultProductQuotePreviewCardStrings, we as defaultProductReadinessCardStrings, Te as defaultProductStructureCardStrings, Ne as defaultProductVariantActionMenuStrings, Pe as defaultProductVariantDetailsStrings, Fe as defaultProductVariantEditorStrings, je as defaultProductVariantsBulkTableStrings, Me as defaultProductVariantsManagerStrings, Q as defaultProductVariantsTableStrings };
3133
+ export { at as ProductContractOverview, ot as ProductDetailsCard, ct as ProductOperationsCard, st as ProductOptionActionMenu, pt as ProductOptionsMatrix, mt as ProductOptionsSummary, St as ProductOverview, ht as ProductPoliciesCard, gt as ProductQuotePreviewCard, _t as ProductReadinessCard, vt as ProductStructureCard, wt as ProductVariantActionMenu, Dt as ProductVariantDetails, kt as ProductVariantEditor, qt as ProductVariantsBulkTable, Jt as ProductVariantsManager, xt as ProductVariantsTable, Ae as defaultProductContractOverviewStrings, ke as defaultProductDetailsCardStrings, Oe as defaultProductOperationsCardStrings, Q as defaultProductOptionActionMenuStrings, Me as defaultProductOptionsMatrixStrings, je as defaultProductOptionsSummaryStrings, Be as defaultProductOverviewStrings, Pe as defaultProductPoliciesCardStrings, Ne as defaultProductQuotePreviewCardStrings, De as defaultProductReadinessCardStrings, Z as defaultProductStructureCardStrings, Le as defaultProductVariantActionMenuStrings, Re as defaultProductVariantDetailsStrings, ze as defaultProductVariantEditorStrings, $ as defaultProductVariantsBulkTableStrings, Ie as defaultProductVariantsManagerStrings, Fe as defaultProductVariantsTableStrings };
3057
3134
 
3058
3135
  //# sourceMappingURL=products.js.map