@openrails/billing-ui 0.280.0 → 0.281.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/{admin-attempts-CP5CWyNR.js → admin-attempts-DjgBAbx9.js} +71 -72
  2. package/dist/admin-attempts-DjgBAbx9.js.map +1 -0
  3. package/dist/{admin-auth-DlIOmwPo.js → admin-auth-BUUdvmqC.js} +3 -4
  4. package/dist/admin-auth-BUUdvmqC.js.map +1 -0
  5. package/dist/{admin-badge-DR_8AhdC.js → admin-badge-CAlUmS2s.js} +3 -4
  6. package/dist/admin-badge-CAlUmS2s.js.map +1 -0
  7. package/dist/{admin-button-DBzTD6By.js → admin-button-Bn4otsuw.js} +3 -4
  8. package/dist/admin-button-Bn4otsuw.js.map +1 -0
  9. package/dist/{admin-capabilities-CZdT1Pxe.js → admin-capabilities-DS-X-__V.js} +3 -4
  10. package/dist/admin-capabilities-DS-X-__V.js.map +1 -0
  11. package/dist/{admin-card-mZl4-s5d.js → admin-card-BHKW1dfB.js} +3 -4
  12. package/dist/admin-card-BHKW1dfB.js.map +1 -0
  13. package/dist/{admin-catalog-DpTjS0Yo.js → admin-catalog-BdLDhr8R.js} +309 -312
  14. package/dist/admin-catalog-BdLDhr8R.js.map +1 -0
  15. package/dist/{admin-confirm-katGq0Qo.js → admin-confirm-DWq-edDC.js} +2 -3
  16. package/dist/admin-confirm-DWq-edDC.js.map +1 -0
  17. package/dist/{admin-csv-CPoNZj2D.js → admin-csv-CRrmaR6a.js} +2 -3
  18. package/dist/admin-csv-CRrmaR6a.js.map +1 -0
  19. package/dist/{admin-cursor-pager-C-KjCIy9.js → admin-cursor-pager-Qo9Sq6lN.js} +6 -8
  20. package/dist/admin-cursor-pager-Qo9Sq6lN.js.map +1 -0
  21. package/dist/{admin-customers-BE3N839X.js → admin-customers-BZP6Jv-i.js} +21 -22
  22. package/dist/admin-customers-BZP6Jv-i.js.map +1 -0
  23. package/dist/{admin-dashboard-BxjkV15J.js → admin-dashboard-BJSonknv.js} +150 -153
  24. package/dist/admin-dashboard-BJSonknv.js.map +1 -0
  25. package/dist/{admin-data-table-D89AwWz_.js → admin-data-table-BiFmcf0Z.js} +19 -26
  26. package/dist/admin-data-table-BiFmcf0Z.js.map +1 -0
  27. package/dist/admin-detail-C03O0R6e.js +1351 -0
  28. package/dist/{admin-detail-P-UnNvXJ.js.map → admin-detail-C03O0R6e.js.map} +1 -1
  29. package/dist/{admin-detail-Ln56otK0.js → admin-detail-C6VH3i2v.js} +74 -75
  30. package/dist/admin-detail-C6VH3i2v.js.map +1 -0
  31. package/dist/{admin-detail-C8lD7U2t.js → admin-detail-CQws8363.js} +199 -202
  32. package/dist/admin-detail-CQws8363.js.map +1 -0
  33. package/dist/admin-detail-NApy5bio.js +337 -0
  34. package/dist/admin-detail-NApy5bio.js.map +1 -0
  35. package/dist/{admin-detail-D6zD085K.js → admin-detail-cijme9Lc.js} +92 -94
  36. package/dist/admin-detail-cijme9Lc.js.map +1 -0
  37. package/dist/{admin-dialog-Dn2FRJu4.js → admin-dialog-CgYGInHi.js} +4 -5
  38. package/dist/admin-dialog-CgYGInHi.js.map +1 -0
  39. package/dist/{admin-dialog-width-CC7QHT1p.js → admin-dialog-width-C_WFpow0.js} +2 -3
  40. package/dist/admin-dialog-width-C_WFpow0.js.map +1 -0
  41. package/dist/{admin-dom-C7Y7A6Wa.js → admin-dom-BP9QROfy.js} +2 -3
  42. package/dist/admin-dom-BP9QROfy.js.map +1 -0
  43. package/dist/{admin-dropdown-menu-DLUn6Uj3.js → admin-dropdown-menu-CU9RxoEJ.js} +3 -4
  44. package/dist/admin-dropdown-menu-CU9RxoEJ.js.map +1 -0
  45. package/dist/{admin-dunning-COaHzrmN.js → admin-dunning-D8lAP7OA.js} +3 -4
  46. package/dist/admin-dunning-D8lAP7OA.js.map +1 -0
  47. package/dist/{admin-fact-card-DKvBnUXB.js → admin-fact-card-lN-MsuSp.js} +3 -4
  48. package/dist/admin-fact-card-lN-MsuSp.js.map +1 -0
  49. package/dist/{admin-form-field-errors-hbUMIriS.js → admin-form-field-errors-Cuhy38F1.js} +2 -3
  50. package/dist/admin-form-field-errors-Cuhy38F1.js.map +1 -0
  51. package/dist/{admin-format-BbiTCqUG.js → admin-format-D9Ablh0P.js} +3 -5
  52. package/dist/admin-format-D9Ablh0P.js.map +1 -0
  53. package/dist/{admin-health-DmnI4e8K.js → admin-health-CnagC763.js} +91 -93
  54. package/dist/admin-health-CnagC763.js.map +1 -0
  55. package/dist/{admin-imports-C0aMP6sj.js → admin-imports-SM_fKKgW.js} +92 -93
  56. package/dist/admin-imports-SM_fKKgW.js.map +1 -0
  57. package/dist/{admin-input-JKrQIGfD.js → admin-input-B_EUzCAE.js} +3 -4
  58. package/dist/admin-input-B_EUzCAE.js.map +1 -0
  59. package/dist/{admin-invoice-profile-model-Cgjy3zV8.js → admin-invoice-profile-model-CNsvK89v.js} +2 -3
  60. package/dist/admin-invoice-profile-model-CNsvK89v.js.map +1 -0
  61. package/dist/{admin-label-CHWsVIZC.js → admin-label-DQsOkp1p.js} +3 -4
  62. package/dist/admin-label-DQsOkp1p.js.map +1 -0
  63. package/dist/{admin-linked-table-row-BMZYYsuk.js → admin-linked-table-row-BFsgc9tz.js} +5 -6
  64. package/dist/admin-linked-table-row-BFsgc9tz.js.map +1 -0
  65. package/dist/{admin-map-dialog-BHUGdCcv.js → admin-map-dialog-Dt3gTuTD.js} +26 -27
  66. package/dist/admin-map-dialog-Dt3gTuTD.js.map +1 -0
  67. package/dist/{admin-mapping-csv-FtkyTBmk.js → admin-mapping-csv-DzpB9HQn.js} +1 -2
  68. package/dist/admin-mapping-csv-DzpB9HQn.js.map +1 -0
  69. package/dist/admin-metering-DM4KhjOq.js +1717 -0
  70. package/dist/admin-metering-DM4KhjOq.js.map +1 -0
  71. package/dist/{admin-missing-record-BPFs3MmO.js → admin-missing-record-G2Jz-VUn.js} +3 -4
  72. package/dist/admin-missing-record-G2Jz-VUn.js.map +1 -0
  73. package/dist/{admin-ops-CL2kjDwi.js → admin-ops-mwzj-jpg.js} +99 -100
  74. package/dist/admin-ops-mwzj-jpg.js.map +1 -0
  75. package/dist/{admin-orders-C1Sf2qhc.js → admin-orders-D_aqV66h.js} +41 -42
  76. package/dist/admin-orders-D_aqV66h.js.map +1 -0
  77. package/dist/{admin-parked-a0tB5bhG.js → admin-parked-2FjIfyMg.js} +47 -48
  78. package/dist/admin-parked-2FjIfyMg.js.map +1 -0
  79. package/dist/{admin-payments-DJcjwRA4.js → admin-payments-B4hh31PR.js} +36 -37
  80. package/dist/admin-payments-B4hh31PR.js.map +1 -0
  81. package/dist/{admin-price-detail-BOmeWw15.js → admin-price-detail--5Bovz20.js} +88 -90
  82. package/dist/admin-price-detail--5Bovz20.js.map +1 -0
  83. package/dist/{admin-price-format-CqOmHrIn.js → admin-price-format-C-pus9FL.js} +4 -6
  84. package/dist/admin-price-format-C-pus9FL.js.map +1 -0
  85. package/dist/admin-price-wizard-Cj_Bgh-V.js +354 -0
  86. package/dist/admin-price-wizard-Cj_Bgh-V.js.map +1 -0
  87. package/dist/{admin-proposals-DVrl-ym4.js → admin-proposals-DPRFoWel.js} +114 -116
  88. package/dist/admin-proposals-DPRFoWel.js.map +1 -0
  89. package/dist/{admin-provider-prices-BVVogH7Q.js → admin-provider-prices-B8Oc86dP.js} +74 -75
  90. package/dist/admin-provider-prices-B8Oc86dP.js.map +1 -0
  91. package/dist/{admin-range-picker-C6BtSm2B.js → admin-range-picker-CSWcCYkg.js} +8 -11
  92. package/dist/admin-range-picker-CSWcCYkg.js.map +1 -0
  93. package/dist/admin-records-CWbfqyT8.js +390 -0
  94. package/dist/admin-records-CWbfqyT8.js.map +1 -0
  95. package/dist/{admin-reports-CtPoiceH.js → admin-reports-CAHWO_d6.js} +59 -60
  96. package/dist/admin-reports-CAHWO_d6.js.map +1 -0
  97. package/dist/{admin-select-6Yuh5M1Q.js → admin-select-DSGCZFiZ.js} +3 -4
  98. package/dist/admin-select-DSGCZFiZ.js.map +1 -0
  99. package/dist/{admin-settings-DscHu4ww.js → admin-settings-BrvNTJlM.js} +640 -645
  100. package/dist/admin-settings-BrvNTJlM.js.map +1 -0
  101. package/dist/{admin-shared-BywM-MMp.js → admin-shared-DdN2hyaR.js} +23 -25
  102. package/dist/admin-shared-DdN2hyaR.js.map +1 -0
  103. package/dist/{admin-skeleton-lndmw89u.js → admin-skeleton-DOfsDIu0.js} +3 -4
  104. package/dist/admin-skeleton-DOfsDIu0.js.map +1 -0
  105. package/dist/{admin-status-badge-IL8ofZ_6.js → admin-status-badge-BLEGt2Fw.js} +6 -7
  106. package/dist/{admin-status-badge-IL8ofZ_6.js.map → admin-status-badge-BLEGt2Fw.js.map} +1 -1
  107. package/dist/{admin-subscriptions-Cd5CGrue.js → admin-subscriptions-PL5G3f0O.js} +38 -39
  108. package/dist/admin-subscriptions-PL5G3f0O.js.map +1 -0
  109. package/dist/{admin-switch-DpwQSzEm.js → admin-switch-aOiQQzST.js} +3 -4
  110. package/dist/admin-switch-aOiQQzST.js.map +1 -0
  111. package/dist/{admin-table-D-GdGM1m.js → admin-table-DIKl2rpV.js} +3 -4
  112. package/dist/admin-table-DIKl2rpV.js.map +1 -0
  113. package/dist/{admin-tabs-B--1flzO.js → admin-tabs-DR74xX0-.js} +8 -10
  114. package/dist/admin-tabs-DR74xX0-.js.map +1 -0
  115. package/dist/{admin-textarea-xsp5V9xM.js → admin-textarea-W52-l_0n.js} +3 -4
  116. package/dist/admin-textarea-W52-l_0n.js.map +1 -0
  117. package/dist/{admin-tile-grids-CzGpidd9.js → admin-tile-grids-Gc67MtA6.js} +2 -3
  118. package/dist/admin-tile-grids-Gc67MtA6.js.map +1 -0
  119. package/dist/{admin-typed-confirm-dialog-NiEDwX_0.js → admin-typed-confirm-dialog-B_00EHlT.js} +13 -14
  120. package/dist/admin-typed-confirm-dialog-B_00EHlT.js.map +1 -0
  121. package/dist/{admin-utils-wuPUD0uh.js → admin-utils-CX097OR7.js} +23 -47
  122. package/dist/{admin-utils-wuPUD0uh.js.map → admin-utils-CX097OR7.js.map} +1 -1
  123. package/dist/{admin-widget-viz-kHHVmDEx.js → admin-widget-viz-DVV9aTQp.js} +21 -24
  124. package/dist/admin-widget-viz-DVV9aTQp.js.map +1 -0
  125. package/dist/admin.js +60 -84
  126. package/dist/admin.js.map +1 -1
  127. package/dist/client/generated/wire.d.ts +1 -0
  128. package/dist/{client-ctrbivyN.js → client-DwsFGm4M.js} +6 -11
  129. package/dist/client-DwsFGm4M.js.map +1 -0
  130. package/dist/client.js +1 -2
  131. package/dist/{create-card-BEILS1VB-DeyyfyFD.js → create-card-BEILS1VB-B1MQg0iK.js} +3 -4
  132. package/dist/create-card-BEILS1VB-B1MQg0iK.js.map +1 -0
  133. package/dist/{create-card-display-Dv5pcpzc-BWB6vzo2.js → create-card-display-Dv5pcpzc-DotrmqWH.js} +5 -9
  134. package/dist/create-card-display-Dv5pcpzc-DotrmqWH.js.map +1 -0
  135. package/dist/{create-copy-button-CAYmfugS-qNapojfj.js → create-copy-button-CAYmfugS-CAgco7FO.js} +3 -4
  136. package/dist/create-copy-button-CAYmfugS-CAgco7FO.js.map +1 -0
  137. package/dist/{dist-CslWupfi.js → dist-BPWQ2tCx.js} +6 -7
  138. package/dist/dist-BPWQ2tCx.js.map +1 -0
  139. package/dist/{hooks-KpTetx6F.js → hooks-C-MhXjQh.js} +13 -22
  140. package/dist/hooks-C-MhXjQh.js.map +1 -0
  141. package/dist/{index-rGw83t5v-BE6naeQR.js → index-rGw83t5v-ydBZxXI_.js} +10 -24
  142. package/dist/index-rGw83t5v-ydBZxXI_.js.map +1 -0
  143. package/dist/index.js +67 -124
  144. package/dist/index.js.map +1 -1
  145. package/dist/locales/de.js +1 -2
  146. package/dist/locales/de.js.map +1 -1
  147. package/dist/locales/en.js +1 -2
  148. package/dist/locales/en.js.map +1 -1
  149. package/dist/locales/es.js +1 -2
  150. package/dist/locales/es.js.map +1 -1
  151. package/dist/locales/ja.js +1 -2
  152. package/dist/locales/ja.js.map +1 -1
  153. package/dist/locales/ko.js +1 -2
  154. package/dist/locales/ko.js.map +1 -1
  155. package/dist/locales/zh.js +1 -2
  156. package/dist/locales/zh.js.map +1 -1
  157. package/dist/react.js +1 -2
  158. package/package.json +2 -2
  159. package/dist/admin-attempts-CP5CWyNR.js.map +0 -1
  160. package/dist/admin-auth-DlIOmwPo.js.map +0 -1
  161. package/dist/admin-badge-DR_8AhdC.js.map +0 -1
  162. package/dist/admin-button-DBzTD6By.js.map +0 -1
  163. package/dist/admin-capabilities-CZdT1Pxe.js.map +0 -1
  164. package/dist/admin-card-mZl4-s5d.js.map +0 -1
  165. package/dist/admin-catalog-DpTjS0Yo.js.map +0 -1
  166. package/dist/admin-confirm-katGq0Qo.js.map +0 -1
  167. package/dist/admin-csv-CPoNZj2D.js.map +0 -1
  168. package/dist/admin-cursor-pager-C-KjCIy9.js.map +0 -1
  169. package/dist/admin-customers-BE3N839X.js.map +0 -1
  170. package/dist/admin-dashboard-BxjkV15J.js.map +0 -1
  171. package/dist/admin-data-table-D89AwWz_.js.map +0 -1
  172. package/dist/admin-detail-BKe9xqPd.js +0 -338
  173. package/dist/admin-detail-BKe9xqPd.js.map +0 -1
  174. package/dist/admin-detail-C8lD7U2t.js.map +0 -1
  175. package/dist/admin-detail-D6zD085K.js.map +0 -1
  176. package/dist/admin-detail-Ln56otK0.js.map +0 -1
  177. package/dist/admin-detail-P-UnNvXJ.js +0 -1357
  178. package/dist/admin-dialog-Dn2FRJu4.js.map +0 -1
  179. package/dist/admin-dialog-width-CC7QHT1p.js.map +0 -1
  180. package/dist/admin-dom-C7Y7A6Wa.js.map +0 -1
  181. package/dist/admin-dropdown-menu-DLUn6Uj3.js.map +0 -1
  182. package/dist/admin-dunning-COaHzrmN.js.map +0 -1
  183. package/dist/admin-fact-card-DKvBnUXB.js.map +0 -1
  184. package/dist/admin-form-field-errors-hbUMIriS.js.map +0 -1
  185. package/dist/admin-format-BbiTCqUG.js.map +0 -1
  186. package/dist/admin-health-DmnI4e8K.js.map +0 -1
  187. package/dist/admin-imports-C0aMP6sj.js.map +0 -1
  188. package/dist/admin-input-JKrQIGfD.js.map +0 -1
  189. package/dist/admin-invoice-profile-model-Cgjy3zV8.js.map +0 -1
  190. package/dist/admin-label-CHWsVIZC.js.map +0 -1
  191. package/dist/admin-linked-table-row-BMZYYsuk.js.map +0 -1
  192. package/dist/admin-map-dialog-BHUGdCcv.js.map +0 -1
  193. package/dist/admin-mapping-csv-FtkyTBmk.js.map +0 -1
  194. package/dist/admin-metering-CDqueHUh.js +0 -1721
  195. package/dist/admin-metering-CDqueHUh.js.map +0 -1
  196. package/dist/admin-missing-record-BPFs3MmO.js.map +0 -1
  197. package/dist/admin-ops-CL2kjDwi.js.map +0 -1
  198. package/dist/admin-orders-C1Sf2qhc.js.map +0 -1
  199. package/dist/admin-parked-a0tB5bhG.js.map +0 -1
  200. package/dist/admin-payments-DJcjwRA4.js.map +0 -1
  201. package/dist/admin-price-detail-BOmeWw15.js.map +0 -1
  202. package/dist/admin-price-format-CqOmHrIn.js.map +0 -1
  203. package/dist/admin-price-wizard-B6s5OJeO.js +0 -356
  204. package/dist/admin-price-wizard-B6s5OJeO.js.map +0 -1
  205. package/dist/admin-proposals-DVrl-ym4.js.map +0 -1
  206. package/dist/admin-provider-prices-BVVogH7Q.js.map +0 -1
  207. package/dist/admin-range-picker-C6BtSm2B.js.map +0 -1
  208. package/dist/admin-records-DKtcgN11.js +0 -391
  209. package/dist/admin-records-DKtcgN11.js.map +0 -1
  210. package/dist/admin-reports-CtPoiceH.js.map +0 -1
  211. package/dist/admin-select-6Yuh5M1Q.js.map +0 -1
  212. package/dist/admin-settings-DscHu4ww.js.map +0 -1
  213. package/dist/admin-shared-BywM-MMp.js.map +0 -1
  214. package/dist/admin-skeleton-lndmw89u.js.map +0 -1
  215. package/dist/admin-subscriptions-Cd5CGrue.js.map +0 -1
  216. package/dist/admin-switch-DpwQSzEm.js.map +0 -1
  217. package/dist/admin-table-D-GdGM1m.js.map +0 -1
  218. package/dist/admin-tabs-B--1flzO.js.map +0 -1
  219. package/dist/admin-textarea-xsp5V9xM.js.map +0 -1
  220. package/dist/admin-tile-grids-CzGpidd9.js.map +0 -1
  221. package/dist/admin-typed-confirm-dialog-NiEDwX_0.js.map +0 -1
  222. package/dist/admin-widget-viz-kHHVmDEx.js.map +0 -1
  223. package/dist/client-ctrbivyN.js.map +0 -1
  224. package/dist/create-card-BEILS1VB-DeyyfyFD.js.map +0 -1
  225. package/dist/create-card-display-Dv5pcpzc-BWB6vzo2.js.map +0 -1
  226. package/dist/create-copy-button-CAYmfugS-qNapojfj.js.map +0 -1
  227. package/dist/dist-CslWupfi.js.map +0 -1
  228. package/dist/hooks-KpTetx6F.js.map +0 -1
  229. package/dist/index-rGw83t5v-BE6naeQR.js.map +0 -1
@@ -1,134 +1,134 @@
1
- import { E as e, O as t, p as n, r, w as i } from "./admin-utils-wuPUD0uh.js";
2
- import { t as a } from "./admin-button-DBzTD6By.js";
3
- import { t as o } from "./admin-input-JKrQIGfD.js";
4
- import { t as s } from "./admin-skeleton-lndmw89u.js";
5
- import { c, r as l } from "./admin-capabilities-CZdT1Pxe.js";
6
- import { c as u, d, f, n as p, o as m, s as h } from "./admin-format-BbiTCqUG.js";
7
- import { t as g } from "./admin-badge-DR_8AhdC.js";
8
- import { t as _ } from "./admin-status-badge-IL8ofZ_6.js";
9
- import { t as v } from "./admin-form-field-errors-hbUMIriS.js";
10
- import { a as y, i as b, n as x, r as S, t as C } from "./admin-select-6Yuh5M1Q.js";
11
- import { n as w, t as T } from "./admin-cursor-pager-C-KjCIy9.js";
12
- import { a as E, n as D, o as O, r as k, s as A, t as j } from "./admin-table-D-GdGM1m.js";
13
- import { t as ee } from "./admin-linked-table-row-BMZYYsuk.js";
14
- import { a as M, i as N, n as P, o as F, r as I, s as L, t as R } from "./admin-dialog-Dn2FRJu4.js";
15
- import { t as z } from "./admin-label-CHWsVIZC.js";
16
- import { t as te } from "./admin-switch-DpwQSzEm.js";
17
- import { i as ne, r as B } from "./admin-dialog-width-CC7QHT1p.js";
18
- import { i as V, n as re, r as ie, t as ae } from "./admin-price-format-CqOmHrIn.js";
19
- import { t as oe } from "./admin-textarea-xsp5V9xM.js";
20
- import { r as se, t as ce } from "./admin-card-mZl4-s5d.js";
21
- import { t as le } from "./admin-price-wizard-B6s5OJeO.js";
22
- import * as H from "react";
23
- import { useMutation as U, useQuery as W, useQueryClient as G } from "@tanstack/react-query";
24
- import { Fragment as ue, jsx as K, jsxs as q } from "react/jsx-runtime";
1
+ import { E as e, O as t, p as n, r, w as i } from "./admin-utils-CX097OR7.js";
2
+ import { t as a } from "./admin-form-field-errors-Cuhy38F1.js";
3
+ import { n as o, t as s } from "./admin-cursor-pager-Qo9Sq6lN.js";
4
+ import { t as c } from "./admin-linked-table-row-BFsgc9tz.js";
5
+ import { t as l } from "./admin-status-badge-BLEGt2Fw.js";
6
+ import { t as u } from "./admin-badge-CAlUmS2s.js";
7
+ import { t as d } from "./admin-button-Bn4otsuw.js";
8
+ import { a as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./admin-dialog-CgYGInHi.js";
9
+ import { t as y } from "./admin-input-B_EUzCAE.js";
10
+ import { t as b } from "./admin-label-DQsOkp1p.js";
11
+ import { a as x, i as S, n as C, r as w, t as T } from "./admin-select-DSGCZFiZ.js";
12
+ import { t as E } from "./admin-skeleton-DOfsDIu0.js";
13
+ import { t as D } from "./admin-switch-aOiQQzST.js";
14
+ import { a as O, n as k, o as A, r as j, s as M, t as N } from "./admin-table-DIKl2rpV.js";
15
+ import { i as ee, r as P } from "./admin-dialog-width-C_WFpow0.js";
16
+ import { c as F, d as I, f as L, n as te, o as ne, s as R } from "./admin-format-D9Ablh0P.js";
17
+ import { i as z, n as re, r as ie, t as ae } from "./admin-price-format-C-pus9FL.js";
18
+ import { t as oe } from "./admin-textarea-W52-l_0n.js";
19
+ import { r as se, t as ce } from "./admin-card-BHKW1dfB.js";
20
+ import { c as le, r as ue } from "./admin-capabilities-DS-X-__V.js";
21
+ import { t as B } from "./admin-price-wizard-Cj_Bgh-V.js";
22
+ import * as V from "react";
23
+ import { useMutation as H, useQuery as U, useQueryClient as W } from "@tanstack/react-query";
24
+ import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
25
25
  import { HugeiconsIcon as J } from "@hugeicons/react";
26
26
  import { Add01Icon as de, BubbleChatQuestionIcon as fe, Cancel01Icon as pe, Loading02Icon as me, SparklesIcon as he } from "@hugeicons/core-free-icons";
27
27
  import { useForm as Y } from "@tanstack/react-form";
28
- //#region src/admin/pages/catalog/application-dialog.tsx
28
+ // src/admin/pages/catalog/application-dialog.tsx
29
29
  function ge() {
30
- let { toast: r, toastApiError: o, selectedMerchant: s, adminMutations: c } = n(), { id: l, text: u } = t(), [d, f] = H.useState(!1), [p, m] = H.useState(""), [h, g] = H.useState(!1), [_, v] = H.useState(), [y, b] = H.useState(), [x, S] = H.useState(""), [C, w] = H.useState(!1), [T, E] = H.useState(), D = U(c.applyCatalog(G())), O = () => {
31
- E(s()), m(JSON.stringify({
30
+ let { toast: r, toastApiError: a, selectedMerchant: o, adminMutations: s } = n(), { id: c, text: l } = t(), [u, y] = V.useState(!1), [x, S] = V.useState(""), [C, w] = V.useState(!1), [T, E] = V.useState(), [D, O] = V.useState(), [k, A] = V.useState(""), [j, M] = V.useState(!1), [N, P] = V.useState(), F = H(s.applyCatalog(W())), I = () => {
31
+ P(o()), S(JSON.stringify({
32
32
  schema_version: 1,
33
33
  prune: !1,
34
34
  products: {}
35
- }, null, 2)), v(void 0), b(void 0), g(!1), w(!1), S("");
36
- }, k = async (e = !1) => {
37
- if (s() !== T) {
38
- S("This draft belongs to another selected merchant. Return to that merchant before applying it.");
35
+ }, null, 2)), E(void 0), O(void 0), w(!1), M(!1), A("");
36
+ }, L = async (e = !1) => {
37
+ if (o() !== N) {
38
+ A("This draft belongs to another selected merchant. Return to that merchant before applying it.");
39
39
  return;
40
40
  }
41
- let t = _ ?? p;
42
- v(t), w(!1), S("");
41
+ let t = T ?? x;
42
+ E(t), M(!1), A("");
43
43
  try {
44
- let n = await D.mutateAsync({
44
+ let n = await F.mutateAsync({
45
45
  document: t,
46
46
  force: e
47
47
  });
48
- b(n);
48
+ O(n);
49
49
  let i = n.conflicts?.length ?? 0;
50
- S(n.replayed ? "This batch was already applied. No changes were repeated, and later catalog edits were preserved." : i > 0 ? `Applied everything no edit changed. ${i} ${i === 1 ? "object was" : "objects were"} skipped because an edit set ${i === 1 ? "its" : "their"} fields differently: change the batch to agree, remove those fields, or overwrite the edits.` : "Batch applied. Review the current catalog before preparing another batch."), i > 0 ? r.warning(`Catalog batch applied; ${i} skipped`) : r.success(n.replayed ? "Original batch receipt returned" : "Catalog batch applied");
50
+ A(n.replayed ? "This batch was already applied. No changes were repeated, and later catalog edits were preserved." : i > 0 ? `Applied everything no edit changed. ${i} ${i === 1 ? "object was" : "objects were"} skipped because an edit set ${i === 1 ? "its" : "their"} fields differently: change the batch to agree, remove those fields, or overwrite the edits.` : "Batch applied. Review the current catalog before preparing another batch."), i > 0 ? r.warning(`Catalog batch applied; ${i} skipped`) : r.success(n.replayed ? "Original batch receipt returned" : "Catalog batch applied");
51
51
  } catch (e) {
52
52
  let t = e instanceof i && e.status >= 400 && e.status < 500 && e.status !== 408;
53
- w(t), S(t ? "Batch refused. Review the error and edit the document before trying again." : "The outcome could not be confirmed. Retry this exact document to retrieve its receipt without repeating changes."), o(e, "Apply catalog");
53
+ M(t), A(t ? "Batch refused. Review the error and edit the document before trying again." : "The outcome could not be confirmed. Retry this exact document to retrieve its receipt without repeating changes."), a(e, "Apply catalog");
54
54
  }
55
55
  };
56
- return /* @__PURE__ */ q(R, {
57
- open: d,
56
+ return /* @__PURE__ */ q(v, {
57
+ open: u,
58
58
  onOpenChange: (e) => {
59
- D.isPending || (f(e), e && !p && O());
59
+ F.isPending || (y(e), e && !x && I());
60
60
  },
61
- children: [/* @__PURE__ */ K(L, { render: /* @__PURE__ */ K(a, {
61
+ children: [/* @__PURE__ */ K(_, { render: /* @__PURE__ */ K(d, {
62
62
  variant: "outline",
63
63
  size: "sm",
64
64
  children: /* @__PURE__ */ K(e, { id: "Apply catalog" })
65
- }) }), /* @__PURE__ */ q(P, {
66
- className: ne,
65
+ }) }), /* @__PURE__ */ q(m, {
66
+ className: ee,
67
67
  children: [
68
- /* @__PURE__ */ q(M, { children: [/* @__PURE__ */ K(F, { children: /* @__PURE__ */ K(e, { id: "Apply catalog changes" }) }), /* @__PURE__ */ K(I, { children: /* @__PURE__ */ K(e, { id: "Paste a JSON or YAML catalog batch; products, prices and meters are maps keyed by their key. Each product, price and meter applies whole, unless a field it names was set differently by an edit: it is skipped and listed, and the rest applies. A batch that applied whole is remembered; retries preserve later catalog edits. Omitted records stay unchanged unless prune is true, which archives the omitted ones only batches set." }) })] }),
68
+ /* @__PURE__ */ q(f, { children: [/* @__PURE__ */ K(h, { children: /* @__PURE__ */ K(e, { id: "Apply catalog changes" }) }), /* @__PURE__ */ K(g, { children: /* @__PURE__ */ K(e, { id: "Paste a JSON or YAML catalog batch; products, prices and meters are maps keyed by their key. Each product, price and meter applies whole, unless a field it names was set differently by an edit: it is skipped and listed, and the rest applies. A batch that applied whole is remembered; retries preserve later catalog edits. Omitted records stay unchanged unless prune is true, which archives the omitted ones only batches set." }) })] }),
69
69
  /* @__PURE__ */ q("div", {
70
70
  className: "grid gap-3",
71
71
  children: [
72
- /* @__PURE__ */ K(z, {
73
- htmlFor: l("catalog-application"),
72
+ /* @__PURE__ */ K(b, {
73
+ htmlFor: c("catalog-application"),
74
74
  children: /* @__PURE__ */ K(e, { id: "Catalog document" })
75
75
  }),
76
76
  /* @__PURE__ */ K(oe, {
77
- id: l("catalog-application"),
77
+ id: c("catalog-application"),
78
78
  className: "max-h-80 min-h-48 font-mono text-xs",
79
79
  spellCheck: !1,
80
- value: p,
81
- disabled: _ !== void 0,
80
+ value: x,
81
+ disabled: T !== void 0,
82
82
  onChange: (e) => {
83
- m(e.target.value), g(!1);
83
+ S(e.target.value), w(!1);
84
84
  }
85
85
  }),
86
- h && !_ && /* @__PURE__ */ K("p", {
86
+ C && !T && /* @__PURE__ */ K("p", {
87
87
  className: "text-sm",
88
88
  children: /* @__PURE__ */ K(e, { id: "Review complete. Applying sends this exact document; this is not a database diff." })
89
89
  }),
90
- x && /* @__PURE__ */ K("p", {
90
+ k && /* @__PURE__ */ K("p", {
91
91
  role: "status",
92
92
  className: "text-sm",
93
- children: x
93
+ children: k
94
94
  }),
95
- y && y.conflicts.length > 0 && /* @__PURE__ */ K(_e, { conflicts: y.conflicts }),
96
- y && /* @__PURE__ */ K("pre", {
97
- "aria-label": u("Batch receipt"),
95
+ D && D.conflicts.length > 0 && /* @__PURE__ */ K(_e, { conflicts: D.conflicts }),
96
+ D && /* @__PURE__ */ K("pre", {
97
+ "aria-label": l("Batch receipt"),
98
98
  className: "max-h-48 overflow-auto rounded-md border p-3 text-xs",
99
- children: JSON.stringify(y, null, 2)
99
+ children: JSON.stringify(D, null, 2)
100
100
  })
101
101
  ]
102
102
  }),
103
- /* @__PURE__ */ q(N, { children: [
104
- C && /* @__PURE__ */ K(a, {
103
+ /* @__PURE__ */ q(p, { children: [
104
+ j && /* @__PURE__ */ K(d, {
105
105
  variant: "outline",
106
106
  onClick: () => {
107
- v(void 0), g(!1), w(!1), S("");
107
+ E(void 0), w(!1), M(!1), A("");
108
108
  },
109
109
  children: /* @__PURE__ */ K(e, { id: "Edit batch" })
110
110
  }),
111
- y && y.conflicts.length > 0 && /* @__PURE__ */ K(a, {
111
+ D && D.conflicts.length > 0 && /* @__PURE__ */ K(d, {
112
112
  variant: "destructive",
113
- disabled: D.isPending,
114
- onClick: () => void k(!0),
113
+ disabled: F.isPending,
114
+ onClick: () => void L(!0),
115
115
  children: /* @__PURE__ */ K(e, { id: "Overwrite edits" })
116
116
  }),
117
- y ? /* @__PURE__ */ K(a, {
118
- onClick: () => O(),
117
+ D ? /* @__PURE__ */ K(d, {
118
+ onClick: () => I(),
119
119
  children: /* @__PURE__ */ K(e, { id: "New batch" })
120
- }) : _ === void 0 ? h ? /* @__PURE__ */ K(a, {
121
- disabled: !p.trim(),
122
- onClick: () => void k(),
120
+ }) : T === void 0 ? C ? /* @__PURE__ */ K(d, {
121
+ disabled: !x.trim(),
122
+ onClick: () => void L(),
123
123
  children: /* @__PURE__ */ K(e, { id: "Apply reviewed batch" })
124
- }) : /* @__PURE__ */ K(a, {
125
- disabled: !p.trim(),
126
- onClick: () => g(!0),
124
+ }) : /* @__PURE__ */ K(d, {
125
+ disabled: !x.trim(),
126
+ onClick: () => w(!0),
127
127
  children: /* @__PURE__ */ K(e, { id: "Review batch" })
128
- }) : /* @__PURE__ */ K(a, {
129
- disabled: D.isPending || C,
130
- onClick: () => void k(),
131
- children: D.isPending ? "Applying…" : "Retry exact batch"
128
+ }) : /* @__PURE__ */ K(d, {
129
+ disabled: F.isPending || j,
130
+ onClick: () => void L(),
131
+ children: F.isPending ? "Applying…" : "Retry exact batch"
132
132
  })
133
133
  ] })
134
134
  ]
@@ -162,7 +162,7 @@ function _e({ conflicts: n }) {
162
162
  " (",
163
163
  n.set_by,
164
164
  ", ",
165
- m(n.set_at),
165
+ ne(n.set_at),
166
166
  ")"
167
167
  ] }, n.field))
168
168
  })]
@@ -170,49 +170,48 @@ function _e({ conflicts: n }) {
170
170
  });
171
171
  }
172
172
  function ve(e, t, n) {
173
- return t == null ? "none" : (e.field === "unit_amount" || e.field === "trial_unit_amount") && typeof t == "string" && n ? h(t, n) : e.field.endsWith("_hours") && typeof t == "number" ? ie(t) : JSON.stringify(t);
173
+ return t == null ? "none" : (e.field === "unit_amount" || e.field === "trial_unit_amount") && typeof t == "string" && n ? R(t, n) : e.field.endsWith("_hours") && typeof t == "number" ? ie(t) : JSON.stringify(t);
174
174
  }
175
- //#endregion
176
- //#region src/admin/pages/catalog/copilot-panel.tsx
177
- function ye({ enabled: r, draftingEnabled: s }) {
178
- let { text: c } = t(), { adminMutations: l } = n(), u = U(l.askCatalogCopilot()), d = Y({
175
+ // src/admin/pages/catalog/copilot-panel.tsx
176
+ function ye({ enabled: r, draftingEnabled: a }) {
177
+ let { text: o } = t(), { adminMutations: s } = n(), c = H(s.askCatalogCopilot()), l = Y({
179
178
  defaultValues: { question: "" },
180
179
  onSubmit: async ({ value: e }) => {
181
180
  let t = e.question.trim();
182
181
  if (t) {
183
- u.reset();
182
+ c.reset();
184
183
  try {
185
- await u.mutateAsync(t);
184
+ await c.mutateAsync(t);
186
185
  } catch {}
187
186
  }
188
187
  }
189
- }), f = u.data, p = u.error ? u.error instanceof i ? u.error.message : "ask failed" : null;
188
+ }), u = c.data, f = c.error ? c.error instanceof i ? c.error.message : "ask failed" : null;
190
189
  return r ? /* @__PURE__ */ K(ce, { children: /* @__PURE__ */ q(se, {
191
190
  className: "flex flex-col gap-3",
192
191
  children: [
193
192
  /* @__PURE__ */ q("form", {
194
193
  className: "flex items-center gap-2",
195
194
  onSubmit: (e) => {
196
- e.preventDefault(), e.stopPropagation(), d.handleSubmit();
195
+ e.preventDefault(), e.stopPropagation(), l.handleSubmit();
197
196
  },
198
197
  children: [
199
198
  /* @__PURE__ */ K(J, {
200
199
  icon: fe,
201
200
  className: "size-4 shrink-0 text-muted-foreground"
202
201
  }),
203
- /* @__PURE__ */ K(d.Field, {
202
+ /* @__PURE__ */ K(l.Field, {
204
203
  name: "question",
205
- children: (e) => /* @__PURE__ */ K(o, {
204
+ children: (e) => /* @__PURE__ */ K(y, {
206
205
  value: e.state.value,
207
206
  onBlur: e.handleBlur,
208
207
  onChange: (t) => e.handleChange(t.target.value),
209
- placeholder: s ? "Ask about your catalog, or ask for a change — e.g. \"who is still on the old premium price?\" or \"raise premium to $12\"" : "Ask about your catalog — e.g. \"what do we sell?\" or \"who is still on the old premium price?\"",
208
+ placeholder: a ? "Ask about your catalog, or ask for a change — e.g. \"who is still on the old premium price?\" or \"raise premium to $12\"" : "Ask about your catalog — e.g. \"what do we sell?\" or \"who is still on the old premium price?\"",
210
209
  className: "flex-1"
211
210
  })
212
211
  }),
213
- /* @__PURE__ */ K(d.Subscribe, {
212
+ /* @__PURE__ */ K(l.Subscribe, {
214
213
  selector: (e) => [e.values.question, e.isSubmitting],
215
- children: ([t, n]) => /* @__PURE__ */ q(a, {
214
+ children: ([t, n]) => /* @__PURE__ */ q(d, {
216
215
  type: "submit",
217
216
  size: "sm",
218
217
  disabled: n || !t.trim(),
@@ -224,30 +223,30 @@ function ye({ enabled: r, draftingEnabled: s }) {
224
223
  })
225
224
  ]
226
225
  }),
227
- u.isPending ? /* @__PURE__ */ K("p", {
226
+ c.isPending ? /* @__PURE__ */ K("p", {
228
227
  className: "text-xs text-muted-foreground",
229
228
  children: /* @__PURE__ */ K(e, { id: "Checking your catalog…" })
230
229
  }) : null,
231
- p ? /* @__PURE__ */ K("p", {
230
+ f ? /* @__PURE__ */ K("p", {
232
231
  className: "text-xs whitespace-pre-wrap text-destructive",
233
232
  role: "alert",
234
- children: p
233
+ children: f
235
234
  }) : null,
236
- f ? /* @__PURE__ */ q("div", {
235
+ u ? /* @__PURE__ */ q("div", {
237
236
  className: "flex flex-col gap-3",
238
237
  children: [
239
238
  /* @__PURE__ */ q("div", {
240
239
  className: "flex items-start justify-between gap-2",
241
240
  children: [/* @__PURE__ */ K("p", {
242
241
  className: "text-sm whitespace-pre-wrap",
243
- children: f.answer
244
- }), /* @__PURE__ */ K(a, {
242
+ children: u.answer
243
+ }), /* @__PURE__ */ K(d, {
245
244
  variant: "ghost",
246
245
  size: "icon",
247
246
  className: "size-6 shrink-0",
248
- "aria-label": c("Dismiss answer"),
247
+ "aria-label": o("Dismiss answer"),
249
248
  onClick: () => {
250
- u.reset();
249
+ c.reset();
251
250
  },
252
251
  children: /* @__PURE__ */ K(J, {
253
252
  icon: pe,
@@ -255,9 +254,9 @@ function ye({ enabled: r, draftingEnabled: s }) {
255
254
  })
256
255
  })]
257
256
  }),
258
- f.evidence.length > 0 && /* @__PURE__ */ K("div", {
257
+ u.evidence.length > 0 && /* @__PURE__ */ K("div", {
259
258
  className: "flex flex-col gap-2",
260
- children: f.evidence.map((e, t) => /* @__PURE__ */ q("div", {
259
+ children: u.evidence.map((e, t) => /* @__PURE__ */ q("div", {
261
260
  className: "rounded-lg border bg-muted/30 p-2",
262
261
  children: [/* @__PURE__ */ K("span", {
263
262
  className: "mb-1 block text-xs font-medium text-muted-foreground uppercase",
@@ -268,9 +267,9 @@ function ye({ enabled: r, draftingEnabled: s }) {
268
267
  })]
269
268
  }, t))
270
269
  }),
271
- f.drafts?.map((e, t) => /* @__PURE__ */ K(be, {
270
+ u.drafts?.map((e, t) => /* @__PURE__ */ K(be, {
272
271
  draft: e,
273
- draftingEnabled: s
272
+ draftingEnabled: a
274
273
  }, t))
275
274
  ]
276
275
  }) : null
@@ -278,13 +277,13 @@ function ye({ enabled: r, draftingEnabled: s }) {
278
277
  }) }) : null;
279
278
  }
280
279
  function be({ draft: t, draftingEnabled: n }) {
281
- let r = c() && n;
280
+ let r = le() && n;
282
281
  return t.kind === "refused" && t.refusal ? /* @__PURE__ */ q("div", {
283
282
  className: "rounded-lg border border-dashed p-3 text-xs",
284
283
  children: [
285
284
  /* @__PURE__ */ K("p", {
286
285
  className: "mb-1 flex items-center gap-2 font-medium",
287
- children: /* @__PURE__ */ q(g, {
286
+ children: /* @__PURE__ */ q(u, {
288
287
  variant: "secondary",
289
288
  children: [/* @__PURE__ */ K(e, { id: "refused: " }), t.refusal.code]
290
289
  })
@@ -307,7 +306,7 @@ function be({ draft: t, draftingEnabled: n }) {
307
306
  }) : null;
308
307
  }
309
308
  function xe({ draft: t, canApply: r }) {
310
- let { toastApiError: i, adminMutations: o } = n(), s = U(o.loadCatalogPriceDraft());
309
+ let { toastApiError: i, adminMutations: a } = n(), o = H(a.loadCatalogPriceDraft());
311
310
  return /* @__PURE__ */ q("div", {
312
311
  className: "rounded-lg border bg-muted/30 p-3 text-sm",
313
312
  children: [
@@ -322,7 +321,7 @@ function xe({ draft: t, canApply: r }) {
322
321
  className: "text-xs font-medium text-muted-foreground uppercase",
323
322
  children: /* @__PURE__ */ K(e, { id: "Draft: price change" })
324
323
  }),
325
- /* @__PURE__ */ K(g, {
324
+ /* @__PURE__ */ K(u, {
326
325
  variant: "secondary",
327
326
  children: BigInt(t.new_amount) > BigInt(t.current_amount) ? "increase" : "decrease"
328
327
  })
@@ -332,29 +331,29 @@ function xe({ draft: t, canApply: r }) {
332
331
  /* @__PURE__ */ q("p", {
333
332
  className: "mt-1 text-xs text-muted-foreground",
334
333
  children: [
335
- h(t.current_amount, t.currency),
334
+ R(t.current_amount, t.currency),
336
335
  " →",
337
336
  " ",
338
- h(t.new_amount, t.currency),
337
+ R(t.new_amount, t.currency),
339
338
  " ·",
340
339
  " ",
341
340
  t.affected_count.toLocaleString(),
342
341
  /* @__PURE__ */ K(e, { id: " affected · requires human confirm" })
343
342
  ]
344
343
  }),
345
- r && (s.data ? /* @__PURE__ */ K(le, {
346
- price: s.data.price,
347
- productName: s.data.productName,
348
- productKey: s.data.productKey,
344
+ r && (o.data ? /* @__PURE__ */ K(B, {
345
+ price: o.data.price,
346
+ productName: o.data.productName,
347
+ productKey: o.data.productKey,
349
348
  draft: t,
350
- onDone: () => s.reset()
351
- }) : /* @__PURE__ */ K(a, {
349
+ onDone: () => o.reset()
350
+ }) : /* @__PURE__ */ K(d, {
352
351
  size: "sm",
353
352
  className: "mt-2",
354
- disabled: s.isPending,
353
+ disabled: o.isPending,
355
354
  onClick: async () => {
356
355
  if (r) try {
357
- await s.mutateAsync({
356
+ await o.mutateAsync({
358
357
  productKey: t.product_key,
359
358
  priceKey: t.price_key
360
359
  });
@@ -362,13 +361,13 @@ function xe({ draft: t, canApply: r }) {
362
361
  i(e, "Load draft for review");
363
362
  }
364
363
  },
365
- children: s.isPending ? "Loading…" : "Review in wizard"
364
+ children: o.isPending ? "Loading…" : "Review in wizard"
366
365
  }))
367
366
  ]
368
367
  });
369
368
  }
370
369
  function Se({ draft: t, canApply: r }) {
371
- let { toastApiError: i, adminMutations: o } = n(), s = G(), c = U(o.createCatalogDraftPrice(s));
370
+ let { toastApiError: i, adminMutations: a } = n(), o = W(), s = H(a.createCatalogDraftPrice(o));
372
371
  return /* @__PURE__ */ q("div", {
373
372
  className: "rounded-lg border bg-muted/30 p-3 text-sm",
374
373
  children: [
@@ -390,30 +389,29 @@ function Se({ draft: t, canApply: r }) {
390
389
  t.create_price.key,
391
390
  " ·",
392
391
  " ",
393
- h(t.create_price.unit_amount, t.create_price.currency)
392
+ R(t.create_price.unit_amount, t.create_price.currency)
394
393
  ]
395
394
  }),
396
- r && /* @__PURE__ */ K(a, {
395
+ r && /* @__PURE__ */ K(d, {
397
396
  size: "sm",
398
397
  className: "mt-2",
399
- disabled: c.isPending || c.isSuccess,
398
+ disabled: s.isPending || s.isSuccess,
400
399
  onClick: async () => {
401
400
  if (r) try {
402
- await c.mutateAsync(t.create_price);
401
+ await s.mutateAsync(t.create_price);
403
402
  } catch (e) {
404
403
  i(e, "Create drafted price");
405
404
  }
406
405
  },
407
- children: c.isSuccess ? "Created" : c.isPending ? "Creating…" : "Create this price"
406
+ children: s.isSuccess ? "Created" : s.isPending ? "Creating…" : "Create this price"
408
407
  })
409
408
  ]
410
409
  });
411
410
  }
412
- //#endregion
413
- //#region src/admin/pages/catalog/index.tsx
414
- var X = H.createContext(!1);
415
- function Ce({ title: t, children: n }) {
416
- let r = l()?.assistants, i = c();
411
+ // src/admin/pages/catalog/index.tsx
412
+ var X = V.createContext(!1);
413
+ function Z({ title: t, children: n }) {
414
+ let r = ue()?.assistants, i = le();
417
415
  return /* @__PURE__ */ K(X.Provider, {
418
416
  value: i,
419
417
  children: /* @__PURE__ */ q("div", {
@@ -436,23 +434,23 @@ function Ce({ title: t, children: n }) {
436
434
  })
437
435
  });
438
436
  }
439
- function we() {
437
+ function Ce() {
440
438
  let { text: e } = t();
441
- return /* @__PURE__ */ K(Ce, {
439
+ return /* @__PURE__ */ K(Z, {
442
440
  title: e("Products"),
443
- children: /* @__PURE__ */ K(De, {})
441
+ children: /* @__PURE__ */ K(Ee, {})
444
442
  });
445
443
  }
446
- function Te() {
444
+ function we() {
447
445
  let { text: e } = t();
448
- return /* @__PURE__ */ K(Ce, {
446
+ return /* @__PURE__ */ K(Z, {
449
447
  title: e("Prices"),
450
448
  children: /* @__PURE__ */ K(Ae, {})
451
449
  });
452
450
  }
453
- var Ee = 100;
454
- function De() {
455
- let { adminQueries: t } = n(), r = H.useContext(X), i = w("", Ee), { data: a, isPending: o, isFetching: c } = W(t.products({
451
+ var Te = 100;
452
+ function Ee() {
453
+ let { adminQueries: t } = n(), r = V.useContext(X), i = o("", Te), { data: a, isPending: c, isFetching: l } = U(t.products({
456
454
  limit: i.size,
457
455
  cursor: i.cursor,
458
456
  errorAction: "Load products"
@@ -462,49 +460,49 @@ function De() {
462
460
  children: [
463
461
  /* @__PURE__ */ K("div", {
464
462
  className: "flex justify-end gap-2",
465
- children: r && /* @__PURE__ */ q(ue, { children: [/* @__PURE__ */ K(ge, {}), /* @__PURE__ */ K(ke, {})] })
463
+ children: r && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(ge, {}), /* @__PURE__ */ K(ke, {})] })
466
464
  }),
467
- o ? /* @__PURE__ */ K("div", {
465
+ c ? /* @__PURE__ */ K("div", {
468
466
  className: "flex flex-col gap-3 py-2",
469
- children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ K(s, { className: "h-6 w-full" }, t))
467
+ children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ K(E, { className: "h-6 w-full" }, t))
470
468
  }) : /* @__PURE__ */ K("div", {
471
469
  className: "overflow-x-auto",
472
- children: /* @__PURE__ */ q(j, { children: [/* @__PURE__ */ K(O, { children: /* @__PURE__ */ q(A, {
470
+ children: /* @__PURE__ */ q(N, { children: [/* @__PURE__ */ K(A, { children: /* @__PURE__ */ q(M, {
473
471
  className: "hover:bg-transparent",
474
472
  children: [
475
- /* @__PURE__ */ K(E, {
473
+ /* @__PURE__ */ K(O, {
476
474
  className: "text-muted-foreground",
477
475
  children: /* @__PURE__ */ K(e, { id: "Product" })
478
476
  }),
479
- /* @__PURE__ */ K(E, {
477
+ /* @__PURE__ */ K(O, {
480
478
  className: "text-muted-foreground",
481
479
  children: /* @__PURE__ */ K(e, { id: "Key" })
482
480
  }),
483
- /* @__PURE__ */ K(E, {
481
+ /* @__PURE__ */ K(O, {
484
482
  className: "text-muted-foreground",
485
483
  children: /* @__PURE__ */ K(e, { id: "Tier" })
486
484
  }),
487
- /* @__PURE__ */ K(E, {
485
+ /* @__PURE__ */ K(O, {
488
486
  className: "text-muted-foreground",
489
487
  children: /* @__PURE__ */ K(e, { id: "Entitlements" })
490
488
  }),
491
- /* @__PURE__ */ K(E, {
489
+ /* @__PURE__ */ K(O, {
492
490
  className: "text-muted-foreground",
493
491
  children: /* @__PURE__ */ K(e, { id: "State" })
494
492
  }),
495
- /* @__PURE__ */ K(E, {})
493
+ /* @__PURE__ */ K(O, {})
496
494
  ]
497
- }) }), /* @__PURE__ */ q(D, { children: [(a?.data ?? []).map((e) => /* @__PURE__ */ K(Oe, { product: e }, e.id)), !a?.data?.length && /* @__PURE__ */ K(A, { children: /* @__PURE__ */ K(k, {
495
+ }) }), /* @__PURE__ */ q(k, { children: [(a?.data ?? []).map((e) => /* @__PURE__ */ K(De, { product: e }, e.id)), !a?.data?.length && /* @__PURE__ */ K(M, { children: /* @__PURE__ */ K(j, {
498
496
  colSpan: 6,
499
497
  className: "h-24 text-center text-muted-foreground",
500
498
  children: /* @__PURE__ */ K(e, { id: "No products yet." })
501
499
  }) })] })] })
502
500
  }),
503
- /* @__PURE__ */ K(T, {
501
+ /* @__PURE__ */ K(s, {
504
502
  pages: i,
505
503
  rows: a?.data?.length ?? 0,
506
504
  nextCursor: a?.next_cursor,
507
- busy: c,
505
+ busy: l,
508
506
  sizes: [
509
507
  50,
510
508
  100,
@@ -514,43 +512,43 @@ function De() {
514
512
  ]
515
513
  });
516
514
  }
517
- function Oe({ product: t }) {
518
- let { toast: r, toastApiError: i, adminMutations: o } = n(), s = H.useContext(X), c = G(), l = U(o.setProductActive(c));
519
- return /* @__PURE__ */ q(A, {
515
+ function De({ product: t }) {
516
+ let { toast: r, toastApiError: i, adminMutations: a } = n(), o = V.useContext(X), s = W(), c = H(a.setProductActive(s));
517
+ return /* @__PURE__ */ q(M, {
520
518
  className: t.archived ? "opacity-60" : void 0,
521
519
  children: [
522
- /* @__PURE__ */ K(k, {
520
+ /* @__PURE__ */ K(j, {
523
521
  className: "font-medium",
524
522
  children: t.display_name
525
523
  }),
526
- /* @__PURE__ */ K(k, {
524
+ /* @__PURE__ */ K(j, {
527
525
  className: "text-xs text-muted-foreground",
528
526
  children: t.key
529
527
  }),
530
- /* @__PURE__ */ K(k, { children: t.tier_group ? `${t.tier_group} #${t.tier_rank}` : "—" }),
531
- /* @__PURE__ */ K(k, { children: /* @__PURE__ */ K("span", {
528
+ /* @__PURE__ */ K(j, { children: t.tier_group ? `${t.tier_group} #${t.tier_rank}` : "—" }),
529
+ /* @__PURE__ */ K(j, { children: /* @__PURE__ */ K("span", {
532
530
  className: "flex flex-wrap gap-1",
533
- children: t.entitlements.map((e) => /* @__PURE__ */ K(g, {
531
+ children: t.entitlements.map((e) => /* @__PURE__ */ K(u, {
534
532
  variant: "secondary",
535
533
  className: "text-[10px]",
536
534
  children: e
537
535
  }, e))
538
536
  }) }),
539
- /* @__PURE__ */ K(k, { children: t.archived ? /* @__PURE__ */ K(g, {
537
+ /* @__PURE__ */ K(j, { children: t.archived ? /* @__PURE__ */ K(u, {
540
538
  variant: "secondary",
541
539
  children: /* @__PURE__ */ K(e, { id: "archived" })
542
- }) : /* @__PURE__ */ K(_, { status: "active" }) }),
543
- /* @__PURE__ */ K(k, {
540
+ }) : /* @__PURE__ */ K(l, { status: "active" }) }),
541
+ /* @__PURE__ */ K(j, {
544
542
  className: "text-right",
545
- children: s && /* @__PURE__ */ q("div", {
543
+ children: o && /* @__PURE__ */ q("div", {
546
544
  className: "flex justify-end gap-2",
547
- children: [s && /* @__PURE__ */ K(ke, { product: t }), /* @__PURE__ */ K(a, {
545
+ children: [o && /* @__PURE__ */ K(ke, { product: t }), /* @__PURE__ */ K(d, {
548
546
  variant: "outline",
549
547
  size: "sm",
550
- disabled: !s || l.isPending,
548
+ disabled: !o || c.isPending,
551
549
  onClick: async () => {
552
550
  try {
553
- await l.mutateAsync({
551
+ await c.mutateAsync({
554
552
  id: t.id,
555
553
  active: t.archived,
556
554
  revision: t.revision
@@ -566,7 +564,7 @@ function Oe({ product: t }) {
566
564
  ]
567
565
  });
568
566
  }
569
- function Z(e) {
567
+ function Oe(e) {
570
568
  return {
571
569
  key: e?.key ?? "",
572
570
  name: e?.display_name ?? "",
@@ -577,12 +575,12 @@ function Z(e) {
577
575
  };
578
576
  }
579
577
  function ke({ product: r }) {
580
- let { toast: i, toastApiError: s, adminMutations: c } = n(), { text: l, id: u } = t(), [d, f] = H.useState(!1), p = G(), m = U(c.createProduct(p)), h = U(c.updateProduct(p)), g = Y({
581
- defaultValues: Z(r),
578
+ let { toast: i, toastApiError: o, adminMutations: s } = n(), { text: c, id: l } = t(), [u, b] = V.useState(!1), x = W(), S = H(s.createProduct(x)), C = H(s.updateProduct(x)), w = Y({
579
+ defaultValues: Oe(r),
582
580
  onSubmit: async ({ value: e }) => {
583
581
  let t = e.entitlements.split(",").map((e) => e.trim()).filter(Boolean);
584
582
  try {
585
- r ? (await h.mutateAsync({
583
+ r ? (await C.mutateAsync({
586
584
  id: r.id,
587
585
  product: {
588
586
  display_name: e.name,
@@ -592,84 +590,84 @@ function ke({ product: r }) {
592
590
  entitlements: t,
593
591
  expected_revision: r.revision
594
592
  }
595
- }), i.success("Product updated")) : (await m.mutateAsync({
593
+ }), i.success("Product updated")) : (await S.mutateAsync({
596
594
  key: e.key,
597
595
  display_name: e.name,
598
596
  description: e.description,
599
597
  tier_group: e.tierGroup || void 0,
600
598
  tier_rank: Number(e.tierRank) || 0,
601
599
  entitlements: t
602
- }), i.success("Product created")), g.reset(e), f(!1);
600
+ }), i.success("Product created")), w.reset(e), b(!1);
603
601
  } catch (e) {
604
- s(e, r ? "Update product" : "Create product");
602
+ o(e, r ? "Update product" : "Create product");
605
603
  }
606
604
  }
607
605
  });
608
- return /* @__PURE__ */ q(R, {
609
- open: d,
606
+ return /* @__PURE__ */ q(v, {
607
+ open: u,
610
608
  onOpenChange: (e) => {
611
- e && g.reset(Z(r)), f(e);
609
+ e && w.reset(Oe(r)), b(e);
612
610
  },
613
- children: [/* @__PURE__ */ K(L, { render: r ? /* @__PURE__ */ K(a, {
611
+ children: [/* @__PURE__ */ K(_, { render: r ? /* @__PURE__ */ K(d, {
614
612
  variant: "outline",
615
613
  size: "sm",
616
614
  children: /* @__PURE__ */ K(e, { id: "Edit" })
617
- }) : /* @__PURE__ */ q(a, {
615
+ }) : /* @__PURE__ */ q(d, {
618
616
  size: "sm",
619
617
  children: [/* @__PURE__ */ K(J, {
620
618
  icon: de,
621
619
  className: "size-4"
622
620
  }), /* @__PURE__ */ K(e, { id: " Product" })]
623
- }) }), /* @__PURE__ */ q(P, {
624
- className: B,
625
- children: [/* @__PURE__ */ q(M, { children: [/* @__PURE__ */ K(F, { children: r ? "Edit product" : "New product" }), /* @__PURE__ */ K(I, { children: /* @__PURE__ */ K(e, { id: "A product is the thing a customer gets. You set what it costs afterwards, by adding a price to it." }) })] }), /* @__PURE__ */ q("form", {
621
+ }) }), /* @__PURE__ */ q(m, {
622
+ className: P,
623
+ children: [/* @__PURE__ */ q(f, { children: [/* @__PURE__ */ K(h, { children: r ? "Edit product" : "New product" }), /* @__PURE__ */ K(g, { children: /* @__PURE__ */ K(e, { id: "A product is the thing a customer gets. You set what it costs afterwards, by adding a price to it." }) })] }), /* @__PURE__ */ q("form", {
626
624
  onSubmit: (e) => {
627
- e.preventDefault(), e.stopPropagation(), g.handleSubmit();
625
+ e.preventDefault(), e.stopPropagation(), w.handleSubmit();
628
626
  },
629
627
  className: "grid gap-4",
630
628
  children: [/* @__PURE__ */ q("div", {
631
629
  className: "grid gap-3",
632
630
  children: [
633
- !r && /* @__PURE__ */ K(g.Field, {
631
+ !r && /* @__PURE__ */ K(w.Field, {
634
632
  name: "key",
635
633
  validators: { onBlur: ({ value: e }) => e.trim() ? void 0 : "Enter a product key" },
636
634
  children: (e) => /* @__PURE__ */ q($, {
637
- label: l("Key"),
635
+ label: c("Key"),
638
636
  id: "p-key",
639
637
  hint: "A short name you use in your own code. It cannot be changed later.",
640
- children: [/* @__PURE__ */ K(o, {
641
- id: u("p-key"),
638
+ children: [/* @__PURE__ */ K(y, {
639
+ id: l("p-key"),
642
640
  value: e.state.value,
643
641
  onBlur: e.handleBlur,
644
642
  onChange: (t) => e.handleChange(t.target.value),
645
- placeholder: l("premium-monthly"),
643
+ placeholder: c("premium-monthly"),
646
644
  "aria-invalid": e.state.meta.errors.length > 0
647
- }), /* @__PURE__ */ K(v, { errors: e.state.meta.errors })]
645
+ }), /* @__PURE__ */ K(a, { errors: e.state.meta.errors })]
648
646
  })
649
647
  }),
650
- /* @__PURE__ */ K(g.Field, {
648
+ /* @__PURE__ */ K(w.Field, {
651
649
  name: "name",
652
650
  validators: { onBlur: ({ value: e }) => e.trim() ? void 0 : "Enter a display name" },
653
651
  children: (e) => /* @__PURE__ */ q($, {
654
- label: l("Display name"),
652
+ label: c("Display name"),
655
653
  id: "p-name",
656
654
  hint: "What customers see on purchase and invoices.",
657
- children: [/* @__PURE__ */ K(o, {
658
- id: u("p-name"),
655
+ children: [/* @__PURE__ */ K(y, {
656
+ id: l("p-name"),
659
657
  value: e.state.value,
660
658
  onBlur: e.handleBlur,
661
659
  onChange: (t) => e.handleChange(t.target.value),
662
660
  "aria-invalid": e.state.meta.errors.length > 0
663
- }), /* @__PURE__ */ K(v, { errors: e.state.meta.errors })]
661
+ }), /* @__PURE__ */ K(a, { errors: e.state.meta.errors })]
664
662
  })
665
663
  }),
666
- /* @__PURE__ */ K(g.Field, {
664
+ /* @__PURE__ */ K(w.Field, {
667
665
  name: "description",
668
666
  children: (e) => /* @__PURE__ */ K($, {
669
- label: l("Description"),
667
+ label: c("Description"),
670
668
  id: "p-desc",
671
- children: /* @__PURE__ */ K(o, {
672
- id: u("p-desc"),
669
+ children: /* @__PURE__ */ K(y, {
670
+ id: l("p-desc"),
673
671
  value: e.state.value,
674
672
  onBlur: e.handleBlur,
675
673
  onChange: (t) => e.handleChange(t.target.value)
@@ -678,27 +676,27 @@ function ke({ product: r }) {
678
676
  }),
679
677
  /* @__PURE__ */ q("div", {
680
678
  className: "grid grid-cols-2 gap-3",
681
- children: [/* @__PURE__ */ K(g.Field, {
679
+ children: [/* @__PURE__ */ K(w.Field, {
682
680
  name: "tierGroup",
683
681
  children: (e) => /* @__PURE__ */ K($, {
684
- label: l("Tier group"),
682
+ label: c("Tier group"),
685
683
  id: "p-tg",
686
684
  hint: "Products in one group are upgrades of each other. Leave empty if this stands alone.",
687
- children: /* @__PURE__ */ K(o, {
688
- id: u("p-tg"),
685
+ children: /* @__PURE__ */ K(y, {
686
+ id: l("p-tg"),
689
687
  value: e.state.value,
690
688
  onBlur: e.handleBlur,
691
689
  onChange: (t) => e.handleChange(t.target.value)
692
690
  })
693
691
  })
694
- }), /* @__PURE__ */ K(g.Field, {
692
+ }), /* @__PURE__ */ K(w.Field, {
695
693
  name: "tierRank",
696
694
  children: (e) => /* @__PURE__ */ K($, {
697
- label: l("Tier rank"),
695
+ label: c("Tier rank"),
698
696
  id: "p-tr",
699
697
  hint: "Higher rank means a higher tier in the group.",
700
- children: /* @__PURE__ */ K(o, {
701
- id: u("p-tr"),
698
+ children: /* @__PURE__ */ K(y, {
699
+ id: l("p-tr"),
702
700
  type: "number",
703
701
  value: e.state.value,
704
702
  onBlur: e.handleBlur,
@@ -707,35 +705,35 @@ function ke({ product: r }) {
707
705
  })
708
706
  })]
709
707
  }),
710
- /* @__PURE__ */ K(g.Field, {
708
+ /* @__PURE__ */ K(w.Field, {
711
709
  name: "entitlements",
712
710
  children: (e) => /* @__PURE__ */ K($, {
713
- label: l("Entitlements"),
711
+ label: c("Entitlements"),
714
712
  id: "p-ents",
715
713
  hint: "The access names your product checks. Separate several with commas.",
716
- children: /* @__PURE__ */ K(o, {
717
- id: u("p-ents"),
714
+ children: /* @__PURE__ */ K(y, {
715
+ id: l("p-ents"),
718
716
  value: e.state.value,
719
717
  onBlur: e.handleBlur,
720
718
  onChange: (t) => e.handleChange(t.target.value),
721
- placeholder: l("premium, downloads")
719
+ placeholder: c("premium, downloads")
722
720
  })
723
721
  })
724
722
  })
725
723
  ]
726
- }), /* @__PURE__ */ K(N, { children: /* @__PURE__ */ K(g.Subscribe, {
724
+ }), /* @__PURE__ */ K(p, { children: /* @__PURE__ */ K(w.Subscribe, {
727
725
  selector: (e) => [
728
726
  e.values.key,
729
727
  e.values.name,
730
728
  e.isSubmitting
731
729
  ],
732
- children: ([t, n, i]) => /* @__PURE__ */ q(ue, { children: [/* @__PURE__ */ K(a, {
730
+ children: ([t, n, i]) => /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(d, {
733
731
  type: "button",
734
732
  variant: "outline",
735
733
  disabled: i,
736
- onClick: () => f(!1),
734
+ onClick: () => b(!1),
737
735
  children: /* @__PURE__ */ K(e, { id: "Cancel" })
738
- }), /* @__PURE__ */ K(a, {
736
+ }), /* @__PURE__ */ K(d, {
739
737
  type: "submit",
740
738
  disabled: i || !n.trim() || !r && !t.trim(),
741
739
  children: i ? "Saving…" : "Save product"
@@ -746,7 +744,7 @@ function ke({ product: r }) {
746
744
  });
747
745
  }
748
746
  function Ae() {
749
- let { adminQueries: t } = n(), r = H.useContext(X), i = w("", Ee), { data: a } = W(t.allProducts({ errorAction: "Load products" })), { data: o, isPending: c, isFetching: l } = W(t.prices({
747
+ let { adminQueries: t } = n(), r = V.useContext(X), i = o("", Te), { data: a } = U(t.allProducts({ errorAction: "Load products" })), { data: c, isPending: l, isFetching: u } = U(t.prices({
750
748
  limit: i.size,
751
749
  cursor: i.cursor,
752
750
  errorAction: "Load prices"
@@ -758,54 +756,54 @@ function Ae() {
758
756
  className: "flex justify-end",
759
757
  children: r && /* @__PURE__ */ K(Me, { products: a?.data ?? [] })
760
758
  }),
761
- c ? /* @__PURE__ */ K("div", {
759
+ l ? /* @__PURE__ */ K("div", {
762
760
  className: "flex flex-col gap-3 py-2",
763
- children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ K(s, { className: "h-6 w-full" }, t))
761
+ children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ K(E, { className: "h-6 w-full" }, t))
764
762
  }) : /* @__PURE__ */ K("div", {
765
763
  className: "overflow-x-auto",
766
- children: /* @__PURE__ */ q(j, { children: [/* @__PURE__ */ K(O, { children: /* @__PURE__ */ q(A, {
764
+ children: /* @__PURE__ */ q(N, { children: [/* @__PURE__ */ K(A, { children: /* @__PURE__ */ q(M, {
767
765
  className: "hover:bg-transparent",
768
766
  children: [
769
- /* @__PURE__ */ K(E, {
767
+ /* @__PURE__ */ K(O, {
770
768
  className: "text-muted-foreground",
771
769
  children: /* @__PURE__ */ K(e, { id: "Price" })
772
770
  }),
773
- /* @__PURE__ */ K(E, {
771
+ /* @__PURE__ */ K(O, {
774
772
  className: "text-muted-foreground",
775
773
  children: /* @__PURE__ */ K(e, { id: "Product" })
776
774
  }),
777
- /* @__PURE__ */ K(E, {
775
+ /* @__PURE__ */ K(O, {
778
776
  className: "text-muted-foreground",
779
777
  children: /* @__PURE__ */ K(e, { id: "Amount" })
780
778
  }),
781
- /* @__PURE__ */ K(E, {
779
+ /* @__PURE__ */ K(O, {
782
780
  className: "text-muted-foreground",
783
781
  children: /* @__PURE__ */ K(e, { id: "Renews" })
784
782
  }),
785
- /* @__PURE__ */ K(E, {
783
+ /* @__PURE__ */ K(O, {
786
784
  className: "text-muted-foreground",
787
785
  children: /* @__PURE__ */ K(e, { id: "Providers" })
788
786
  }),
789
- /* @__PURE__ */ K(E, {
787
+ /* @__PURE__ */ K(O, {
790
788
  className: "text-muted-foreground",
791
789
  children: /* @__PURE__ */ K(e, { id: "State" })
792
790
  }),
793
- /* @__PURE__ */ K(E, {})
791
+ /* @__PURE__ */ K(O, {})
794
792
  ]
795
- }) }), /* @__PURE__ */ q(D, { children: [(o?.data ?? []).map((e) => /* @__PURE__ */ K(je, {
793
+ }) }), /* @__PURE__ */ q(k, { children: [(c?.data ?? []).map((e) => /* @__PURE__ */ K(je, {
796
794
  price: e,
797
795
  product: a?.data.find((t) => t.id === e.product_id)
798
- }, e.id)), !o?.data?.length && /* @__PURE__ */ K(A, { children: /* @__PURE__ */ K(k, {
796
+ }, e.id)), !c?.data?.length && /* @__PURE__ */ K(M, { children: /* @__PURE__ */ K(j, {
799
797
  colSpan: 7,
800
798
  className: "h-24 text-center text-muted-foreground",
801
799
  children: /* @__PURE__ */ K(e, { id: "No prices yet." })
802
800
  }) })] })] })
803
801
  }),
804
- /* @__PURE__ */ K(T, {
802
+ /* @__PURE__ */ K(s, {
805
803
  pages: i,
806
- rows: o?.data?.length ?? 0,
807
- nextCursor: o?.next_cursor,
808
- busy: l,
804
+ rows: c?.data?.length ?? 0,
805
+ nextCursor: c?.next_cursor,
806
+ busy: u,
809
807
  sizes: [
810
808
  50,
811
809
  100,
@@ -816,12 +814,12 @@ function Ae() {
816
814
  });
817
815
  }
818
816
  function je({ price: t, product: i }) {
819
- let { toast: o, toastApiError: s, adminMutations: c } = n(), l = i?.display_name ?? d(t.product_id, 13), u = H.useContext(X), f = G(), p = U(c.setPriceActive(f));
820
- return /* @__PURE__ */ q(ee, {
817
+ let { toast: a, toastApiError: o, adminMutations: s } = n(), f = i?.display_name ?? I(t.product_id, 13), p = V.useContext(X), m = W(), h = H(s.setPriceActive(m));
818
+ return /* @__PURE__ */ q(c, {
821
819
  to: `/catalog/prices/${encodeURIComponent(t.id)}`,
822
820
  className: t.archived ? "opacity-60" : void 0,
823
821
  children: [
824
- /* @__PURE__ */ K(k, {
822
+ /* @__PURE__ */ K(j, {
825
823
  className: "text-xs text-muted-foreground",
826
824
  children: /* @__PURE__ */ K(r, {
827
825
  className: "underline-offset-2 hover:underline",
@@ -829,50 +827,50 @@ function je({ price: t, product: i }) {
829
827
  children: t.id
830
828
  })
831
829
  }),
832
- /* @__PURE__ */ K(k, {
830
+ /* @__PURE__ */ K(j, {
833
831
  className: "font-medium",
834
- children: l
832
+ children: f
835
833
  }),
836
- /* @__PURE__ */ K(k, {
834
+ /* @__PURE__ */ K(j, {
837
835
  className: "tabular-nums",
838
836
  children: ae(t)
839
837
  }),
840
- /* @__PURE__ */ K(k, { children: re(t) }),
841
- /* @__PURE__ */ K(k, { children: /* @__PURE__ */ K("span", {
838
+ /* @__PURE__ */ K(j, { children: re(t) }),
839
+ /* @__PURE__ */ K(j, { children: /* @__PURE__ */ K("span", {
842
840
  className: "flex flex-wrap gap-1",
843
- children: t.provider ? /* @__PURE__ */ q(g, {
841
+ children: t.provider ? /* @__PURE__ */ q(u, {
844
842
  variant: "secondary",
845
843
  children: [t.provider.psp, /* @__PURE__ */ K(e, { id: "'s price" })]
846
- }) : (t.sell_via ?? []).map((e) => /* @__PURE__ */ K(g, {
844
+ }) : (t.sell_via ?? []).map((e) => /* @__PURE__ */ K(u, {
847
845
  variant: "secondary",
848
846
  children: e
849
847
  }, e))
850
848
  }) }),
851
- /* @__PURE__ */ K(k, { children: t.archived ? /* @__PURE__ */ K(g, {
849
+ /* @__PURE__ */ K(j, { children: t.archived ? /* @__PURE__ */ K(u, {
852
850
  variant: "secondary",
853
851
  children: /* @__PURE__ */ K(e, { id: "archived" })
854
- }) : /* @__PURE__ */ K(_, { status: "active" }) }),
855
- /* @__PURE__ */ K(k, {
852
+ }) : /* @__PURE__ */ K(l, { status: "active" }) }),
853
+ /* @__PURE__ */ K(j, {
856
854
  className: "text-right",
857
- children: u && /* @__PURE__ */ q("div", {
855
+ children: p && /* @__PURE__ */ q("div", {
858
856
  className: "flex justify-end gap-2",
859
- children: [u && /* @__PURE__ */ K(le, {
857
+ children: [p && /* @__PURE__ */ K(B, {
860
858
  price: t,
861
- productName: l,
859
+ productName: f,
862
860
  productKey: i?.key
863
- }), /* @__PURE__ */ K(a, {
861
+ }), /* @__PURE__ */ K(d, {
864
862
  variant: "outline",
865
863
  size: "sm",
866
- disabled: !u || p.isPending,
864
+ disabled: !p || h.isPending,
867
865
  onClick: async () => {
868
866
  try {
869
- await p.mutateAsync({
867
+ await h.mutateAsync({
870
868
  id: t.id,
871
869
  active: t.archived,
872
870
  revision: t.revision
873
- }), o.success(t.archived ? "Price activated" : "Price deactivated");
871
+ }), a.success(t.archived ? "Price activated" : "Price deactivated");
874
872
  } catch (e) {
875
- s(e, "Toggle price");
873
+ o(e, "Toggle price");
876
874
  }
877
875
  },
878
876
  children: t.archived ? "Activate" : "Deactivate"
@@ -882,9 +880,9 @@ function je({ price: t, product: i }) {
882
880
  ]
883
881
  });
884
882
  }
885
- var Q = ({ value: e }) => !e || V(e) ? void 0 : "Use hours, days or weeks, such as 30 days";
883
+ var Q = ({ value: e }) => !e || z(e) ? void 0 : "Use hours, days or weeks, such as 30 days";
886
884
  function Me({ products: r }) {
887
- let { toast: i, toastApiError: s, adminMutations: c } = n(), { text: l, id: d } = t(), [m, h] = H.useState(!1), g = G(), _ = U(c.createPrice(g)), w = Y({
885
+ let { toast: i, toastApiError: o, adminMutations: s } = n(), { text: c, id: l } = t(), [u, E] = V.useState(!1), O = W(), k = H(s.createPrice(O)), A = Y({
888
886
  defaultValues: {
889
887
  productId: "",
890
888
  amount: "",
@@ -893,60 +891,60 @@ function Me({ products: r }) {
893
891
  billingInterval: ""
894
892
  },
895
893
  onSubmit: async ({ value: e }) => {
896
- let t = u(e.amount, e.currency);
894
+ let t = F(e.amount, e.currency);
897
895
  if (t === null || BigInt(t) <= 0n) return;
898
- let n = V(e.accessDuration), r = V(e.billingInterval);
896
+ let n = z(e.accessDuration), r = z(e.billingInterval);
899
897
  if (!(e.accessDuration && !n || e.billingInterval && !r)) try {
900
- await _.mutateAsync({
898
+ await k.mutateAsync({
901
899
  product_id: e.productId,
902
900
  unit_amount: t,
903
901
  currency: e.currency,
904
902
  ...n ? { access_duration_hours: n } : {},
905
903
  ...r ? { billing_interval_hours: r } : {}
906
- }), w.reset(), i.success("Price created"), h(!1);
904
+ }), A.reset(), i.success("Price created"), E(!1);
907
905
  } catch (e) {
908
- s(e, "Create price");
906
+ o(e, "Create price");
909
907
  }
910
908
  }
911
- }), T = (e) => {
912
- e && w.reset(), h(e);
909
+ }), j = (e) => {
910
+ e && A.reset(), E(e);
913
911
  };
914
- return /* @__PURE__ */ q(R, {
915
- open: m,
916
- onOpenChange: T,
917
- children: [/* @__PURE__ */ K(L, { render: /* @__PURE__ */ q(a, {
912
+ return /* @__PURE__ */ q(v, {
913
+ open: u,
914
+ onOpenChange: j,
915
+ children: [/* @__PURE__ */ K(_, { render: /* @__PURE__ */ q(d, {
918
916
  size: "sm",
919
917
  children: [/* @__PURE__ */ K(J, {
920
918
  icon: de,
921
919
  className: "size-4"
922
920
  }), /* @__PURE__ */ K(e, { id: " Price" })]
923
- }) }), /* @__PURE__ */ q(P, {
924
- className: B,
925
- children: [/* @__PURE__ */ q(M, { children: [/* @__PURE__ */ K(F, { children: /* @__PURE__ */ K(e, { id: "New price" }) }), /* @__PURE__ */ K(I, { children: /* @__PURE__ */ K(e, { id: "These terms cannot be changed later. To charge a different amount, create another price and deactivate this one." }) })] }), /* @__PURE__ */ q("form", {
921
+ }) }), /* @__PURE__ */ q(m, {
922
+ className: P,
923
+ children: [/* @__PURE__ */ q(f, { children: [/* @__PURE__ */ K(h, { children: /* @__PURE__ */ K(e, { id: "New price" }) }), /* @__PURE__ */ K(g, { children: /* @__PURE__ */ K(e, { id: "These terms cannot be changed later. To charge a different amount, create another price and deactivate this one." }) })] }), /* @__PURE__ */ q("form", {
926
924
  onSubmit: (e) => {
927
- e.preventDefault(), e.stopPropagation(), w.handleSubmit();
925
+ e.preventDefault(), e.stopPropagation(), A.handleSubmit();
928
926
  },
929
927
  className: "grid gap-4",
930
928
  children: [/* @__PURE__ */ q("div", {
931
929
  className: "grid gap-3",
932
930
  children: [
933
- /* @__PURE__ */ K(w.Field, {
931
+ /* @__PURE__ */ K(A.Field, {
934
932
  name: "productId",
935
933
  children: (e) => /* @__PURE__ */ K($, {
936
- label: l("Product"),
934
+ label: c("Product"),
937
935
  id: "pr-prod",
938
- children: /* @__PURE__ */ q(C, {
936
+ children: /* @__PURE__ */ q(T, {
939
937
  items: r.map((e) => ({
940
938
  value: e.id,
941
939
  label: `${e.display_name} (${e.key})`
942
940
  })),
943
941
  value: e.state.value || null,
944
942
  onValueChange: (t) => e.handleChange(t ?? ""),
945
- children: [/* @__PURE__ */ K(b, {
946
- id: d("pr-prod"),
943
+ children: [/* @__PURE__ */ K(S, {
944
+ id: l("pr-prod"),
947
945
  className: "w-full",
948
- children: /* @__PURE__ */ K(y, { placeholder: l("Pick a product…") })
949
- }), /* @__PURE__ */ K(x, { children: r.map((e) => /* @__PURE__ */ q(S, {
946
+ children: /* @__PURE__ */ K(x, { placeholder: c("Pick a product…") })
947
+ }), /* @__PURE__ */ K(C, { children: r.map((e) => /* @__PURE__ */ q(w, {
950
948
  value: e.id,
951
949
  children: [
952
950
  e.display_name,
@@ -959,21 +957,21 @@ function Me({ products: r }) {
959
957
  })
960
958
  }),
961
959
  /* @__PURE__ */ K($, {
962
- label: l("Amount"),
960
+ label: c("Amount"),
963
961
  id: "pr-amount",
964
962
  hint: "Enter it the way you would write it, such as 19.90.",
965
963
  children: /* @__PURE__ */ q("div", {
966
964
  className: "flex gap-2",
967
- children: [/* @__PURE__ */ K(w.Field, {
965
+ children: [/* @__PURE__ */ K(A.Field, {
968
966
  name: "amount",
969
967
  validators: {
970
968
  onBlurListenTo: ["currency"],
971
- onBlur: ({ value: e, fieldApi: t }) => BigInt(u(e, t.form.getFieldValue("currency")) ?? "0") > 0n ? void 0 : "Enter an amount greater than zero"
969
+ onBlur: ({ value: e, fieldApi: t }) => BigInt(F(e, t.form.getFieldValue("currency")) ?? "0") > 0n ? void 0 : "Enter an amount greater than zero"
972
970
  },
973
971
  children: (e) => /* @__PURE__ */ q("div", {
974
972
  className: "flex-1",
975
- children: [/* @__PURE__ */ K(o, {
976
- id: d("pr-amount"),
973
+ children: [/* @__PURE__ */ K(y, {
974
+ id: l("pr-amount"),
977
975
  type: "number",
978
976
  step: "any",
979
977
  min: "0",
@@ -981,70 +979,70 @@ function Me({ products: r }) {
981
979
  onBlur: e.handleBlur,
982
980
  onChange: (t) => e.handleChange(t.target.value),
983
981
  "aria-invalid": e.state.meta.errors.length > 0
984
- }), /* @__PURE__ */ K(v, { errors: e.state.meta.errors })]
982
+ }), /* @__PURE__ */ K(a, { errors: e.state.meta.errors })]
985
983
  })
986
- }), /* @__PURE__ */ K(w.Field, {
984
+ }), /* @__PURE__ */ K(A.Field, {
987
985
  name: "currency",
988
- validators: { onChange: ({ value: e }) => p(e) === void 0 ? `Use ${f.join(", ")}` : void 0 },
989
- children: (e) => /* @__PURE__ */ K(o, {
990
- id: d("pr-cur"),
991
- "aria-label": l("Currency"),
986
+ validators: { onChange: ({ value: e }) => te(e) === void 0 ? `Use ${L.join(", ")}` : void 0 },
987
+ children: (e) => /* @__PURE__ */ K(y, {
988
+ id: l("pr-cur"),
989
+ "aria-label": c("Currency"),
992
990
  className: "w-24",
993
991
  value: e.state.value,
994
- maxLength: Math.max(...f.map((e) => e.length)),
992
+ maxLength: Math.max(...L.map((e) => e.length)),
995
993
  autoCapitalize: "characters",
996
994
  spellCheck: !1,
997
- placeholder: l("USD"),
995
+ placeholder: c("USD"),
998
996
  onBlur: e.handleBlur,
999
997
  onChange: (t) => e.handleChange(t.target.value.toUpperCase())
1000
998
  })
1001
999
  })]
1002
1000
  })
1003
1001
  }),
1004
- /* @__PURE__ */ K(w.Field, {
1002
+ /* @__PURE__ */ K(A.Field, {
1005
1003
  name: "accessDuration",
1006
1004
  validators: { onBlur: Q },
1007
1005
  children: (e) => /* @__PURE__ */ q($, {
1008
- label: l("Access duration"),
1006
+ label: c("Access duration"),
1009
1007
  id: "pr-dur",
1010
1008
  hint: "Such as 30 days, 1 week or 12 hours. Leave it empty for access that never expires.",
1011
- children: [/* @__PURE__ */ K(o, {
1012
- id: d("pr-dur"),
1013
- placeholder: l("Never expires"),
1009
+ children: [/* @__PURE__ */ K(y, {
1010
+ id: l("pr-dur"),
1011
+ placeholder: c("Never expires"),
1014
1012
  value: e.state.value,
1015
1013
  onBlur: e.handleBlur,
1016
1014
  onChange: (t) => e.handleChange(t.target.value),
1017
1015
  "aria-invalid": e.state.meta.errors.length > 0
1018
- }), /* @__PURE__ */ K(v, { errors: e.state.meta.errors })]
1016
+ }), /* @__PURE__ */ K(a, { errors: e.state.meta.errors })]
1019
1017
  })
1020
1018
  }),
1021
- /* @__PURE__ */ K(w.Field, {
1019
+ /* @__PURE__ */ K(A.Field, {
1022
1020
  name: "billingInterval",
1023
1021
  validators: { onBlur: Q },
1024
1022
  children: (t) => /* @__PURE__ */ q("div", {
1025
1023
  className: "grid gap-3 rounded-md border p-3",
1026
1024
  children: [/* @__PURE__ */ q("div", {
1027
1025
  className: "flex items-center justify-between gap-4",
1028
- children: [/* @__PURE__ */ K(z, {
1029
- htmlFor: d("pr-renew"),
1026
+ children: [/* @__PURE__ */ K(b, {
1027
+ htmlFor: l("pr-renew"),
1030
1028
  children: /* @__PURE__ */ K(e, { id: "Recurring billing" })
1031
- }), /* @__PURE__ */ K(te, {
1032
- id: d("pr-renew"),
1029
+ }), /* @__PURE__ */ K(D, {
1030
+ id: l("pr-renew"),
1033
1031
  checked: !!t.state.value,
1034
1032
  onCheckedChange: (e) => t.handleChange(e ? "30 days" : "")
1035
1033
  })]
1036
1034
  }), t.state.value ? /* @__PURE__ */ q($, {
1037
- label: l("Billing interval"),
1035
+ label: c("Billing interval"),
1038
1036
  id: "pr-billing",
1039
1037
  hint: "Time between payments, such as 30 days, until the customer cancels.",
1040
- children: [/* @__PURE__ */ K(o, {
1041
- id: d("pr-billing"),
1038
+ children: [/* @__PURE__ */ K(y, {
1039
+ id: l("pr-billing"),
1042
1040
  required: !0,
1043
1041
  value: t.state.value,
1044
1042
  onBlur: t.handleBlur,
1045
1043
  onChange: (e) => t.handleChange(e.target.value),
1046
1044
  "aria-invalid": t.state.meta.errors.length > 0
1047
- }), /* @__PURE__ */ K(v, { errors: t.state.meta.errors })]
1045
+ }), /* @__PURE__ */ K(a, { errors: t.state.meta.errors })]
1048
1046
  }) : /* @__PURE__ */ K("p", {
1049
1047
  className: "text-xs text-muted-foreground",
1050
1048
  children: /* @__PURE__ */ K(e, { id: "One-time payment." })
@@ -1052,12 +1050,12 @@ function Me({ products: r }) {
1052
1050
  })
1053
1051
  })
1054
1052
  ]
1055
- }), /* @__PURE__ */ q(N, { children: [/* @__PURE__ */ K(a, {
1053
+ }), /* @__PURE__ */ q(p, { children: [/* @__PURE__ */ K(d, {
1056
1054
  type: "button",
1057
1055
  variant: "outline",
1058
- onClick: () => T(!1),
1056
+ onClick: () => j(!1),
1059
1057
  children: /* @__PURE__ */ K(e, { id: "Cancel" })
1060
- }), /* @__PURE__ */ K(w.Subscribe, {
1058
+ }), /* @__PURE__ */ K(A.Subscribe, {
1061
1059
  selector: (e) => [
1062
1060
  e.values.productId,
1063
1061
  e.values.amount,
@@ -1066,10 +1064,10 @@ function Me({ products: r }) {
1066
1064
  e.values.billingInterval,
1067
1065
  e.isSubmitting
1068
1066
  ],
1069
- children: ([e, t, n, r, i, o]) => /* @__PURE__ */ K(a, {
1067
+ children: ([e, t, n, r, i, a]) => /* @__PURE__ */ K(d, {
1070
1068
  type: "submit",
1071
- disabled: o || !e || BigInt(u(t, n) ?? "0") <= 0n || Q({ value: r }) !== void 0 || Q({ value: i }) !== void 0,
1072
- children: o ? "Creating…" : "Create price"
1069
+ disabled: a || !e || BigInt(F(t, n) ?? "0") <= 0n || Q({ value: r }) !== void 0 || Q({ value: i }) !== void 0,
1070
+ children: a ? "Creating…" : "Create price"
1073
1071
  })
1074
1072
  })] })]
1075
1073
  })]
@@ -1081,7 +1079,7 @@ function $({ label: e, id: n, hint: r, children: i }) {
1081
1079
  return /* @__PURE__ */ q("div", {
1082
1080
  className: "grid gap-1.5",
1083
1081
  children: [
1084
- /* @__PURE__ */ K(z, {
1082
+ /* @__PURE__ */ K(b, {
1085
1083
  htmlFor: a(n),
1086
1084
  children: e
1087
1085
  }),
@@ -1093,7 +1091,6 @@ function $({ label: e, id: n, hint: r, children: i }) {
1093
1091
  ]
1094
1092
  });
1095
1093
  }
1096
- //#endregion
1097
- export { Te as CatalogPricesPage, we as CatalogProductsPage };
1094
+ export { we as CatalogPricesPage, Ce as CatalogProductsPage };
1098
1095
 
1099
- //# sourceMappingURL=admin-catalog-DpTjS0Yo.js.map
1096
+ //# sourceMappingURL=admin-catalog-BdLDhr8R.js.map