@nextblock-cms/ecom 0.20.1 → 0.21.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 (317) hide show
  1. package/_virtual/_rolldown/runtime.cjs.js +1 -0
  2. package/index.cjs.js +1 -1
  3. package/index.es.js +38 -146
  4. package/lib/CurrencyProvider.cjs.js +1 -1
  5. package/lib/CurrencyProvider.d.ts +1 -1
  6. package/lib/CurrencyProvider.es.js +85 -95
  7. package/lib/PaymentReadinessProvider.cjs.js +1 -1
  8. package/lib/PaymentReadinessProvider.d.ts +1 -1
  9. package/lib/PaymentReadinessProvider.es.js +24 -27
  10. package/lib/cart-store.cjs.js +1 -1
  11. package/lib/cart-store.es.js +109 -121
  12. package/lib/components/AccountNavigationMenu.cjs.js +1 -1
  13. package/lib/components/AccountNavigationMenu.d.ts +1 -1
  14. package/lib/components/AccountNavigationMenu.es.js +36 -50
  15. package/lib/components/AddToCartButton.cjs.js +1 -1
  16. package/lib/components/AddToCartButton.d.ts +1 -1
  17. package/lib/components/AddToCartButton.es.js +94 -89
  18. package/lib/components/Cart.cjs.js +1 -1
  19. package/lib/components/Cart.d.ts +1 -1
  20. package/lib/components/Cart.es.js +261 -180
  21. package/lib/components/CartDrawer.cjs.js +1 -1
  22. package/lib/components/CartDrawer.d.ts +1 -1
  23. package/lib/components/CartDrawer.es.js +218 -148
  24. package/lib/components/CartIcon.cjs.js +1 -1
  25. package/lib/components/CartIcon.d.ts +1 -1
  26. package/lib/components/CartIcon.es.js +33 -35
  27. package/lib/components/Checkout.cjs.js +1 -1
  28. package/lib/components/Checkout.d.ts +1 -1
  29. package/lib/components/Checkout.es.js +1092 -1108
  30. package/lib/components/CouponForm.cjs.js +1 -1
  31. package/lib/components/CouponForm.d.ts +1 -1
  32. package/lib/components/CouponForm.es.js +136 -148
  33. package/lib/components/CurrencySwitcher.cjs.js +1 -1
  34. package/lib/components/CurrencySwitcher.d.ts +1 -1
  35. package/lib/components/CurrencySwitcher.es.js +22 -18
  36. package/lib/components/CustomerProfileForm.cjs.js +1 -1
  37. package/lib/components/CustomerProfileForm.es.js +454 -313
  38. package/lib/components/FeaturedProduct.cjs.js +1 -1
  39. package/lib/components/FeaturedProduct.d.ts +1 -1
  40. package/lib/components/FeaturedProduct.es.js +98 -83
  41. package/lib/components/FreemiusLicensePanel.cjs.js +1 -1
  42. package/lib/components/FreemiusLicensePanel.d.ts +1 -1
  43. package/lib/components/FreemiusLicensePanel.es.js +70 -65
  44. package/lib/components/InvoiceDocument.cjs.js +1 -1
  45. package/lib/components/InvoiceDocument.es.js +256 -192
  46. package/lib/components/InvoiceViewerShell.cjs.js +2 -2
  47. package/lib/components/InvoiceViewerShell.d.ts +1 -1
  48. package/lib/components/InvoiceViewerShell.es.js +75 -106
  49. package/lib/components/ProductCard.cjs.js +1 -1
  50. package/lib/components/ProductCard.d.ts +1 -1
  51. package/lib/components/ProductCard.es.js +186 -171
  52. package/lib/components/ProductDetailsLayout.cjs.js +1 -1
  53. package/lib/components/ProductDetailsLayout.es.js +405 -404
  54. package/lib/components/ProductGallery.cjs.js +1 -1
  55. package/lib/components/ProductGallery.d.ts +1 -1
  56. package/lib/components/ProductGallery.es.js +51 -54
  57. package/lib/components/ProductGrid.cjs.js +1 -1
  58. package/lib/components/ProductGrid.d.ts +1 -1
  59. package/lib/components/ProductGrid.es.js +23 -25
  60. package/lib/components/ShippingEstimator.cjs.js +1 -1
  61. package/lib/components/ShippingEstimator.d.ts +1 -1
  62. package/lib/components/ShippingEstimator.es.js +158 -153
  63. package/lib/components/ShortDescription.cjs.js +1 -1
  64. package/lib/components/ShortDescription.es.js +17 -17
  65. package/lib/components/SimpleTiptapRenderer.cjs.js +1 -1
  66. package/lib/components/SimpleTiptapRenderer.es.js +238 -211
  67. package/lib/components/SubscriptionSelector.cjs.js +1 -1
  68. package/lib/components/SubscriptionSelector.es.js +159 -154
  69. package/lib/countries.cjs.js +1 -1
  70. package/lib/countries.es.js +232 -75
  71. package/lib/coupon-server.cjs.js +1 -1
  72. package/lib/coupon-server.es.js +180 -224
  73. package/lib/coupons.cjs.js +1 -1
  74. package/lib/coupons.es.js +12 -14
  75. package/lib/currency-constants.cjs.js +1 -1
  76. package/lib/currency-constants.es.js +4 -4
  77. package/lib/currency-rest-client.cjs.js +1 -1
  78. package/lib/currency-rest-client.es.js +15 -22
  79. package/lib/currency-store.cjs.js +1 -1
  80. package/lib/currency-store.es.js +20 -27
  81. package/lib/currency-sync.cjs.js +1 -1
  82. package/lib/currency-sync.es.js +124 -170
  83. package/lib/currency.cjs.js +1 -1
  84. package/lib/currency.es.js +242 -310
  85. package/lib/customer-addresses.cjs.js +1 -1
  86. package/lib/customer-addresses.es.js +80 -109
  87. package/lib/customer-orders.cjs.js +1 -1
  88. package/lib/customer-orders.es.js +31 -43
  89. package/lib/customer.cjs.js +1 -1
  90. package/lib/customer.es.js +43 -52
  91. package/lib/export-helpers.cjs.js +1 -1
  92. package/lib/export-helpers.es.js +53 -52
  93. package/lib/factory.cjs.js +1 -1
  94. package/lib/factory.es.js +10 -7
  95. package/lib/freemius-coupons.cjs.js +1 -1
  96. package/lib/freemius-coupons.es.js +245 -262
  97. package/lib/freemius-license-claim.cjs.js +1 -1
  98. package/lib/freemius-license-claim.es.js +87 -71
  99. package/lib/freemius-license.cjs.js +1 -1
  100. package/lib/freemius-license.es.js +32 -39
  101. package/lib/freemius-order-sync.cjs.js +1 -1
  102. package/lib/freemius-order-sync.es.js +226 -290
  103. package/lib/freemius-trial-provision.cjs.js +1 -1
  104. package/lib/freemius-trial-provision.es.js +136 -130
  105. package/lib/inventory-settings.cjs.js +1 -1
  106. package/lib/inventory-settings.es.js +69 -77
  107. package/lib/invoice-server.cjs.js +3 -3
  108. package/lib/invoice-server.es.js +94 -141
  109. package/lib/invoice-ui.cjs.js +1 -1
  110. package/lib/invoice-ui.es.js +50 -66
  111. package/lib/invoice.cjs.js +1 -1
  112. package/lib/invoice.es.js +85 -94
  113. package/lib/order-inventory.cjs.js +25 -25
  114. package/lib/order-inventory.es.js +67 -79
  115. package/lib/order-tax-details.cjs.js +1 -1
  116. package/lib/order-tax-details.es.js +142 -153
  117. package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -1
  118. package/lib/pages/cms/coupons/CouponEditorForm.d.ts +1 -1
  119. package/lib/pages/cms/coupons/CouponEditorForm.es.js +227 -185
  120. package/lib/pages/cms/coupons/CouponsPage.cjs.js +2 -2
  121. package/lib/pages/cms/coupons/CouponsPage.d.ts +1 -1
  122. package/lib/pages/cms/coupons/CouponsPage.es.js +235 -166
  123. package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -1
  124. package/lib/pages/cms/coupons/CreateCouponDialog.d.ts +1 -1
  125. package/lib/pages/cms/coupons/CreateCouponDialog.es.js +35 -34
  126. package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -1
  127. package/lib/pages/cms/coupons/EditCouponPage.d.ts +1 -1
  128. package/lib/pages/cms/coupons/EditCouponPage.es.js +47 -47
  129. package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -1
  130. package/lib/pages/cms/coupons/ProductScopePicker.d.ts +1 -1
  131. package/lib/pages/cms/coupons/ProductScopePicker.es.js +128 -117
  132. package/lib/pages/cms/coupons/actions.cjs.js +1 -1
  133. package/lib/pages/cms/coupons/actions.es.js +112 -115
  134. package/lib/pages/cms/coupons/index.cjs.js +1 -0
  135. package/lib/pages/cms/coupons/index.es.js +3 -0
  136. package/lib/pages/cms/coupons/product-options.cjs.js +1 -1
  137. package/lib/pages/cms/coupons/product-options.es.js +21 -23
  138. package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -1
  139. package/lib/pages/cms/orders/ExportReportsDialog.es.js +135 -129
  140. package/lib/pages/cms/orders/MarkPaidButton.d.ts +1 -1
  141. package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -1
  142. package/lib/pages/cms/orders/OrderDetailPage.d.ts +1 -1
  143. package/lib/pages/cms/orders/OrderDetailPage.es.js +186 -134
  144. package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -1
  145. package/lib/pages/cms/orders/OrderPrintButton.d.ts +1 -1
  146. package/lib/pages/cms/orders/OrderPrintButton.es.js +15 -21
  147. package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -1
  148. package/lib/pages/cms/orders/OrderStatusForm.d.ts +1 -1
  149. package/lib/pages/cms/orders/OrderStatusForm.es.js +85 -69
  150. package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -1
  151. package/lib/pages/cms/orders/OrdersPage.d.ts +1 -1
  152. package/lib/pages/cms/orders/OrdersPage.es.js +170 -102
  153. package/lib/pages/cms/orders/actions.cjs.js +3 -3
  154. package/lib/pages/cms/orders/actions.es.js +53 -69
  155. package/lib/pages/cms/orders/export-actions.cjs.js +1 -1
  156. package/lib/pages/cms/orders/export-actions.es.js +23 -26
  157. package/lib/pages/cms/orders/index.cjs.js +1 -0
  158. package/lib/pages/cms/orders/index.es.js +6 -0
  159. package/lib/pages/cms/orders/server-actions.cjs.js +1 -1
  160. package/lib/pages/cms/orders/server-actions.es.js +60 -51
  161. package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -1
  162. package/lib/pages/cms/payments/PaymentsClient.d.ts +1 -1
  163. package/lib/pages/cms/payments/PaymentsClient.es.js +316 -346
  164. package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -1
  165. package/lib/pages/cms/payments/PaymentsPage.d.ts +1 -1
  166. package/lib/pages/cms/payments/PaymentsPage.es.js +29 -32
  167. package/lib/pages/cms/payments/actions.cjs.js +1 -1
  168. package/lib/pages/cms/payments/actions.es.js +38 -48
  169. package/lib/pages/cms/payments/index.cjs.js +1 -0
  170. package/lib/pages/cms/payments/index.es.js +3 -0
  171. package/lib/pages/cms/payments/queries.cjs.js +1 -1
  172. package/lib/pages/cms/payments/queries.es.js +38 -48
  173. package/lib/pages/cms/products/ProductsPage.cjs.js +1 -1
  174. package/lib/pages/cms/products/ProductsPage.d.ts +1 -1
  175. package/lib/pages/cms/products/ProductsPage.es.js +63 -66
  176. package/lib/pages/cms/products/[id]/edit/EditProductPage.d.ts +1 -1
  177. package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -1
  178. package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +138 -155
  179. package/lib/pages/cms/products/actions.cjs.js +4 -4
  180. package/lib/pages/cms/products/actions.es.js +121 -162
  181. package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -1
  182. package/lib/pages/cms/products/attributes/AttributeManagementPage.d.ts +1 -1
  183. package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +55 -47
  184. package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -1
  185. package/lib/pages/cms/products/attributes/components/AttributeManager.d.ts +1 -1
  186. package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +285 -290
  187. package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -1
  188. package/lib/pages/cms/products/categories/CategoryManagementPage.d.ts +1 -1
  189. package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +43 -35
  190. package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -1
  191. package/lib/pages/cms/products/categories/components/CategoryManager.es.js +315 -262
  192. package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -1
  193. package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +115 -113
  194. package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -1
  195. package/lib/pages/cms/products/components/CurrencyPriceFields.d.ts +1 -1
  196. package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +136 -145
  197. package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -1
  198. package/lib/pages/cms/products/components/DeleteProductButton.d.ts +1 -1
  199. package/lib/pages/cms/products/components/DeleteProductButton.es.js +35 -47
  200. package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -1
  201. package/lib/pages/cms/products/components/FreemiusPricingDashboard.d.ts +1 -1
  202. package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +106 -84
  203. package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -1
  204. package/lib/pages/cms/products/components/ProductCategorySelector.es.js +156 -159
  205. package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -1
  206. package/lib/pages/cms/products/components/ProductForm.es.js +872 -693
  207. package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -1
  208. package/lib/pages/cms/products/components/ProductMediaManager.es.js +106 -103
  209. package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -1
  210. package/lib/pages/cms/products/components/ProductsBulkTable.d.ts +1 -1
  211. package/lib/pages/cms/products/components/ProductsBulkTable.es.js +303 -294
  212. package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -1
  213. package/lib/pages/cms/products/components/SaleScheduleFields.d.ts +1 -1
  214. package/lib/pages/cms/products/components/SaleScheduleFields.es.js +111 -134
  215. package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -1
  216. package/lib/pages/cms/products/components/SyncFreemiusButton.d.ts +1 -1
  217. package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +29 -35
  218. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +2 -2
  219. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.d.ts +1 -1
  220. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +36 -48
  221. package/lib/pages/cms/products/components/SyncProductForm.d.ts +1 -1
  222. package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -1
  223. package/lib/pages/cms/products/components/VariationsEditor.d.ts +1 -1
  224. package/lib/pages/cms/products/components/VariationsEditor.es.js +396 -405
  225. package/lib/pages/cms/products/index.cjs.js +1 -0
  226. package/lib/pages/cms/products/index.es.js +8 -0
  227. package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -1
  228. package/lib/pages/cms/products/inventory/InventoryPage.d.ts +1 -1
  229. package/lib/pages/cms/products/inventory/InventoryPage.es.js +21 -15
  230. package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -2
  231. package/lib/pages/cms/products/inventory/InventoryTableClient.d.ts +1 -1
  232. package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +230 -209
  233. package/lib/pages/cms/products/inventory/actions.cjs.js +3 -3
  234. package/lib/pages/cms/products/inventory/actions.es.js +83 -91
  235. package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -1
  236. package/lib/pages/cms/products/new/NewProductPage.d.ts +1 -1
  237. package/lib/pages/cms/products/new/NewProductPage.es.js +58 -74
  238. package/lib/pages/cms/products/product-price-sync.cjs.js +1 -1
  239. package/lib/pages/cms/products/product-price-sync.es.js +74 -89
  240. package/lib/pages/cms/products/server-actions.cjs.js +1 -1
  241. package/lib/pages/cms/products/server-actions.es.js +250 -233
  242. package/lib/pages/cms/shipping/ShippingPage.cjs.js +2 -2
  243. package/lib/pages/cms/shipping/ShippingPage.es.js +287 -209
  244. package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -1
  245. package/lib/pages/cms/shipping/components/RateForm.d.ts +1 -1
  246. package/lib/pages/cms/shipping/components/RateForm.es.js +439 -436
  247. package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -1
  248. package/lib/pages/cms/shipping/components/ZoneForm.es.js +245 -224
  249. package/lib/pages/cms/shipping/index.cjs.js +1 -0
  250. package/lib/pages/cms/shipping/index.es.js +3 -0
  251. package/lib/pages/cms/shipping/server-actions.cjs.js +1 -1
  252. package/lib/pages/cms/shipping/server-actions.es.js +131 -149
  253. package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -1
  254. package/lib/pages/cms/taxes/TaxesPage.d.ts +1 -1
  255. package/lib/pages/cms/taxes/TaxesPage.es.js +211 -169
  256. package/lib/pages/cms/taxes/actions.cjs.js +1 -1
  257. package/lib/pages/cms/taxes/actions.es.js +41 -53
  258. package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -1
  259. package/lib/pages/cms/taxes/components/TaxRateForm.d.ts +1 -1
  260. package/lib/pages/cms/taxes/components/TaxRateForm.es.js +112 -99
  261. package/lib/pages/cms/taxes/index.cjs.js +1 -0
  262. package/lib/pages/cms/taxes/index.es.js +3 -0
  263. package/lib/payment-config.cjs.js +1 -1
  264. package/lib/payment-config.es.js +110 -126
  265. package/lib/product-actions.cjs.js +4 -4
  266. package/lib/product-actions.es.js +289 -544
  267. package/lib/product-context.cjs.js +1 -1
  268. package/lib/product-context.es.js +13 -15
  269. package/lib/product-schema.cjs.js +1 -1
  270. package/lib/product-schema.es.js +99 -134
  271. package/lib/providers/freemius.cjs.js +1 -5
  272. package/lib/providers/freemius.es.js +446 -530
  273. package/lib/providers/stripe.cjs.js +1 -1
  274. package/lib/providers/stripe.es.js +417 -477
  275. package/lib/server-actions/coupon-actions.cjs.js +1 -1
  276. package/lib/server-actions/coupon-actions.es.js +22 -22
  277. package/lib/server-actions/customer-actions.cjs.js +1 -1
  278. package/lib/server-actions/customer-actions.es.js +26 -28
  279. package/lib/server-actions/product-actions.cjs.js +1 -1
  280. package/lib/server-actions/product-actions.es.js +9 -15
  281. package/lib/server-actions/shipping-actions.cjs.js +1 -1
  282. package/lib/server-actions/shipping-actions.es.js +27 -24
  283. package/lib/server-actions/tax-actions.cjs.js +1 -1
  284. package/lib/server-actions/tax-actions.es.js +33 -39
  285. package/lib/shared-inventory.cjs.js +2 -2
  286. package/lib/shared-inventory.es.js +111 -160
  287. package/lib/shipping/resolver.cjs.js +2 -2
  288. package/lib/shipping/resolver.es.js +44 -61
  289. package/lib/shipping-rate-currency.cjs.js +1 -1
  290. package/lib/shipping-rate-currency.es.js +52 -67
  291. package/lib/states.cjs.js +1 -1
  292. package/lib/states.es.js +333 -154
  293. package/lib/stripe/checkout.cjs.js +1 -1
  294. package/lib/stripe/checkout.es.js +125 -181
  295. package/lib/stripe/client.cjs.js +1 -1
  296. package/lib/stripe/client.es.js +14 -19
  297. package/lib/stripe/order-sync.cjs.js +1 -1
  298. package/lib/stripe/order-sync.es.js +106 -126
  299. package/lib/stripe/webhooks.cjs.js +1 -1
  300. package/lib/stripe/webhooks.es.js +37 -31
  301. package/lib/tax-calculation.cjs.js +1 -1
  302. package/lib/tax-calculation.es.js +84 -98
  303. package/lib/trials.cjs.js +1 -1
  304. package/lib/trials.es.js +24 -30
  305. package/lib/types.cjs.js +1 -1
  306. package/lib/types.es.js +21 -27
  307. package/lib/use-cart.cjs.js +1 -1
  308. package/lib/use-cart.es.js +38 -40
  309. package/lib/use-price-formatter.cjs.js +1 -1
  310. package/lib/use-price-formatter.es.js +10 -11
  311. package/lib/variation-utils.cjs.js +1 -1
  312. package/lib/variation-utils.es.js +199 -261
  313. package/lib/zod-config.cjs.js +1 -1
  314. package/lib/zod-config.es.js +5 -6
  315. package/package.json +16 -16
  316. package/server.cjs.js +1 -1
  317. package/server.es.js +56 -211
@@ -1,352 +1,322 @@
1
- 'use client';
2
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
3
- import { useTransition as K, useState as I } from "react";
4
- import { useRouter as F } from "next/navigation";
5
- import { Card as g, CardHeader as N, CardTitle as k, CardDescription as C, CardContent as S, Button as w, Checkbox as A, Label as P, Input as D } from "@nextblock-cms/ui";
6
- import { CheckCircle2 as x, AlertCircle as j } from "lucide-react";
7
- import { useFormStatus as R } from "react-dom";
8
- function G({
9
- initialEnabledProviders: s,
10
- configStatus: i,
11
- credentials: t,
12
- saveAction: a,
13
- saveCredentialsAction: c
14
- }) {
15
- const o = F(), [m, u] = K(), n = i.stripe.hasKeys, p = i.freemius.hasKeys, [h, b] = I(() => ({
16
- // Older installs can contain an enabled flag from before providers defaulted off.
17
- // An unconfigured provider cannot be enabled, so never present that stale flag as
18
- // an active checkbox. Saving the form also persists this reconciled false value.
19
- stripe: s.stripe && n,
20
- freemius: s.freemius && p
21
- }));
22
- function _() {
23
- const l = new FormData();
24
- l.set("stripe_enabled", h.stripe ? "true" : "false"), l.set(
25
- "freemius_enabled",
26
- h.freemius ? "true" : "false"
27
- ), u(async () => {
28
- await a(l), o.refresh();
29
- });
30
- }
31
- return /* @__PURE__ */ r("div", { className: "max-w-7xl space-y-4 p-4 sm:p-6", children: [
32
- /* @__PURE__ */ r("div", { className: "space-y-1", children: [
33
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight", children: "Payment Settings" }),
34
- /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Enter your provider API keys, then enable the providers your store needs. Physical products use Stripe and digital products use Freemius." })
35
- ] }),
36
- /* @__PURE__ */ r("div", { className: "grid gap-4 lg:grid-cols-[minmax(0,3fr)_minmax(20rem,2fr)]", children: [
37
- /* @__PURE__ */ e(
38
- B,
39
- {
40
- credentials: t,
41
- saveAction: c
42
- }
43
- ),
44
- /* @__PURE__ */ r(g, { className: "flex h-full flex-col", children: [
45
- /* @__PURE__ */ r(N, { className: "pb-3", children: [
46
- /* @__PURE__ */ e(k, { children: "Payment Providers" }),
47
- /* @__PURE__ */ e(C, { children: "You can run both providers at the same time. Each product picks its provider from its product type." })
48
- ] }),
49
- /* @__PURE__ */ r(S, { className: "flex flex-1 flex-col gap-4", children: [
50
- /* @__PURE__ */ r("div", { className: "space-y-3", children: [
51
- /* @__PURE__ */ e(
52
- y,
53
- {
54
- id: "stripe-enabled",
55
- label: "Stripe for Physical Products",
56
- description: "Use Stripe Checkout for physical merchandise and other shippable goods.",
57
- checked: h.stripe,
58
- disabled: !n,
59
- onCheckedChange: (l) => b((f) => ({
60
- ...f,
61
- stripe: l
62
- })),
63
- ready: n,
64
- children: n ? /* @__PURE__ */ r("div", { className: "mt-2 flex items-center gap-2 text-xs text-green-600", children: [
65
- /* @__PURE__ */ e(x, { className: "h-4 w-4" }),
66
- /* @__PURE__ */ e("span", { children: "Ready for physical product checkout" })
67
- ] }) : /* @__PURE__ */ e(
68
- v,
69
- {
70
- provider: "Stripe",
71
- missingKeys: i.stripe.missing,
72
- docsUrl: "https://dashboard.stripe.com/apikeys",
73
- docsLabel: "Stripe API keys"
74
- }
75
- )
76
- }
77
- ),
78
- /* @__PURE__ */ e(
79
- y,
80
- {
81
- id: "freemius-enabled",
82
- label: "Freemius for Digital Products",
83
- description: "Use Freemius for software licenses, SaaS plans, and other digital products.",
84
- checked: h.freemius,
85
- disabled: !p,
86
- onCheckedChange: (l) => b((f) => ({
87
- ...f,
88
- freemius: l
89
- })),
90
- ready: p,
91
- children: p ? /* @__PURE__ */ r("div", { className: "mt-2 flex items-center gap-2 text-xs text-green-600", children: [
92
- /* @__PURE__ */ e(x, { className: "h-4 w-4" }),
93
- /* @__PURE__ */ e("span", { children: "Ready for digital product checkout" })
94
- ] }) : /* @__PURE__ */ e(
95
- v,
96
- {
97
- provider: "Freemius",
98
- missingKeys: i.freemius.missing,
99
- docsUrl: "https://dashboard.freemius.com/",
100
- docsLabel: "Freemius credentials"
101
- }
102
- )
103
- }
104
- )
105
- ] }),
106
- /* @__PURE__ */ e("div", { className: "mt-auto flex justify-end border-t pt-4", children: /* @__PURE__ */ e(
107
- w,
108
- {
109
- type: "button",
110
- disabled: m,
111
- onClick: _,
112
- children: m ? "Saving..." : "Save Changes"
113
- }
114
- ) })
115
- ] })
116
- ] })
117
- ] })
118
- ] });
1
+ "use client";
2
+ import { useState as e, useTransition as t } from "react";
3
+ import { AlertCircle as n, CheckCircle2 as r } from "lucide-react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { useRouter as o } from "next/navigation";
6
+ import { Button as s, Card as c, CardContent as l, CardDescription as u, CardHeader as d, CardTitle as f, Checkbox as p, Input as m, Label as h } from "@nextblock-cms/ui";
7
+ import { useFormStatus as g } from "react-dom";
8
+ //#region libs/ecommerce/src/lib/pages/cms/payments/PaymentsClient.tsx
9
+ function _({ initialEnabledProviders: n, configStatus: p, credentials: m, saveAction: h, saveCredentialsAction: g }) {
10
+ let _ = o(), [v, y] = t(), C = p.stripe.hasKeys, w = p.freemius.hasKeys, [T, E] = e(() => ({
11
+ stripe: n.stripe && C,
12
+ freemius: n.freemius && w
13
+ }));
14
+ function D() {
15
+ let e = new FormData();
16
+ e.set("stripe_enabled", T.stripe ? "true" : "false"), e.set("freemius_enabled", T.freemius ? "true" : "false"), y(async () => {
17
+ await h(e), _.refresh();
18
+ });
19
+ }
20
+ return /* @__PURE__ */ a("div", {
21
+ className: "max-w-7xl space-y-4 p-4 sm:p-6",
22
+ children: [/* @__PURE__ */ a("div", {
23
+ className: "space-y-1",
24
+ children: [/* @__PURE__ */ i("h1", {
25
+ className: "text-2xl font-bold tracking-tight",
26
+ children: "Payment Settings"
27
+ }), /* @__PURE__ */ i("p", {
28
+ className: "text-sm text-muted-foreground",
29
+ children: "Enter your provider API keys, then enable the providers your store needs. Physical products use Stripe and digital products use Freemius."
30
+ })]
31
+ }), /* @__PURE__ */ a("div", {
32
+ className: "grid gap-4 lg:grid-cols-[minmax(0,3fr)_minmax(20rem,2fr)]",
33
+ children: [/* @__PURE__ */ i(b, {
34
+ credentials: m,
35
+ saveAction: g
36
+ }), /* @__PURE__ */ a(c, {
37
+ className: "flex h-full flex-col",
38
+ children: [/* @__PURE__ */ a(d, {
39
+ className: "pb-3",
40
+ children: [/* @__PURE__ */ i(f, { children: "Payment Providers" }), /* @__PURE__ */ i(u, { children: "You can run both providers at the same time. Each product picks its provider from its product type." })]
41
+ }), /* @__PURE__ */ a(l, {
42
+ className: "flex flex-1 flex-col gap-4",
43
+ children: [/* @__PURE__ */ a("div", {
44
+ className: "space-y-3",
45
+ children: [/* @__PURE__ */ i(x, {
46
+ id: "stripe-enabled",
47
+ label: "Stripe for Physical Products",
48
+ description: "Use Stripe Checkout for physical merchandise and other shippable goods.",
49
+ checked: T.stripe,
50
+ disabled: !C,
51
+ onCheckedChange: (e) => E((t) => ({
52
+ ...t,
53
+ stripe: e
54
+ })),
55
+ ready: C,
56
+ children: C ? /* @__PURE__ */ a("div", {
57
+ className: "mt-2 flex items-center gap-2 text-xs text-green-600",
58
+ children: [/* @__PURE__ */ i(r, { className: "h-4 w-4" }), /* @__PURE__ */ i("span", { children: "Ready for physical product checkout" })]
59
+ }) : /* @__PURE__ */ i(S, {
60
+ provider: "Stripe",
61
+ missingKeys: p.stripe.missing,
62
+ docsUrl: "https://dashboard.stripe.com/apikeys",
63
+ docsLabel: "Stripe API keys"
64
+ })
65
+ }), /* @__PURE__ */ i(x, {
66
+ id: "freemius-enabled",
67
+ label: "Freemius for Digital Products",
68
+ description: "Use Freemius for software licenses, SaaS plans, and other digital products.",
69
+ checked: T.freemius,
70
+ disabled: !w,
71
+ onCheckedChange: (e) => E((t) => ({
72
+ ...t,
73
+ freemius: e
74
+ })),
75
+ ready: w,
76
+ children: w ? /* @__PURE__ */ a("div", {
77
+ className: "mt-2 flex items-center gap-2 text-xs text-green-600",
78
+ children: [/* @__PURE__ */ i(r, { className: "h-4 w-4" }), /* @__PURE__ */ i("span", { children: "Ready for digital product checkout" })]
79
+ }) : /* @__PURE__ */ i(S, {
80
+ provider: "Freemius",
81
+ missingKeys: p.freemius.missing,
82
+ docsUrl: "https://dashboard.freemius.com/",
83
+ docsLabel: "Freemius credentials"
84
+ })
85
+ })]
86
+ }), /* @__PURE__ */ i("div", {
87
+ className: "mt-auto flex justify-end border-t pt-4",
88
+ children: /* @__PURE__ */ i(s, {
89
+ type: "button",
90
+ disabled: v,
91
+ onClick: D,
92
+ children: v ? "Saving..." : "Save Changes"
93
+ })
94
+ })]
95
+ })]
96
+ })]
97
+ })]
98
+ });
119
99
  }
120
- function L() {
121
- const { pending: s } = R();
122
- return /* @__PURE__ */ e(w, { type: "submit", disabled: s, children: s ? "Saving..." : "Save Changes" });
100
+ function v() {
101
+ let { pending: e } = g();
102
+ return /* @__PURE__ */ i(s, {
103
+ type: "submit",
104
+ disabled: e,
105
+ children: e ? "Saving..." : "Save Changes"
106
+ });
123
107
  }
124
- function d({
125
- id: s,
126
- label: i,
127
- type: t = "text",
128
- defaultValue: a,
129
- placeholder: c,
130
- hint: o
131
- }) {
132
- return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
133
- /* @__PURE__ */ e(P, { htmlFor: s, className: "text-xs", children: i }),
134
- /* @__PURE__ */ e(
135
- D,
136
- {
137
- id: s,
138
- name: s,
139
- type: t,
140
- defaultValue: a,
141
- placeholder: c,
142
- autoComplete: t === "password" ? "new-password" : "off"
143
- }
144
- ),
145
- o && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: o })
146
- ] });
108
+ function y({ id: e, label: t, type: n = "text", defaultValue: r, placeholder: o, hint: s }) {
109
+ return /* @__PURE__ */ a("div", {
110
+ className: "space-y-1",
111
+ children: [
112
+ /* @__PURE__ */ i(h, {
113
+ htmlFor: e,
114
+ className: "text-xs",
115
+ children: t
116
+ }),
117
+ /* @__PURE__ */ i(m, {
118
+ id: e,
119
+ name: e,
120
+ type: n,
121
+ defaultValue: r,
122
+ placeholder: o,
123
+ autoComplete: n === "password" ? "new-password" : "off"
124
+ }),
125
+ s && /* @__PURE__ */ i("p", {
126
+ className: "text-xs text-muted-foreground",
127
+ children: s
128
+ })
129
+ ]
130
+ });
147
131
  }
148
- function B({
149
- credentials: s,
150
- saveAction: i
151
- }) {
152
- const t = "•••••••• (stored — leave blank to keep)";
153
- return /* @__PURE__ */ r(g, { className: "flex h-full flex-col", children: [
154
- /* @__PURE__ */ r(N, { className: "pb-3", children: [
155
- /* @__PURE__ */ e(k, { children: "Provider API Keys" }),
156
- /* @__PURE__ */ r(C, { children: [
157
- "Keys are encrypted at rest and used DB-first (these override any",
158
- " ",
159
- /* @__PURE__ */ e("code", { children: ".env" }),
160
- " values). Leave a secret blank to keep the stored value."
161
- ] })
162
- ] }),
163
- /* @__PURE__ */ e(S, { className: "flex flex-1 flex-col", children: /* @__PURE__ */ r("form", { action: i, className: "flex flex-1 flex-col gap-4", children: [
164
- /* @__PURE__ */ r("div", { className: "space-y-3", children: [
165
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Stripe (physical products)" }),
166
- /* @__PURE__ */ r("details", { className: "rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground", children: [
167
- /* @__PURE__ */ e("summary", { className: "cursor-pointer font-medium text-foreground", children: "Stripe webhook setup" }),
168
- /* @__PURE__ */ r("div", { className: "mt-2 space-y-1.5", children: [
169
- /* @__PURE__ */ r("p", { children: [
170
- "In Stripe, add",
171
- " ",
172
- /* @__PURE__ */ e("code", { children: "https://your-domain/api/webhooks/stripe" }),
173
- " as a webhook endpoint and paste its ",
174
- /* @__PURE__ */ e("code", { children: "whsec_…" }),
175
- " signing secret below."
176
- ] }),
177
- /* @__PURE__ */ r("p", { children: [
178
- "Locally, run",
179
- " ",
180
- /* @__PURE__ */ e("code", { children: "stripe listen --forward-to localhost:4200/api/webhooks/stripe" }),
181
- " ",
182
- "or ",
183
- /* @__PURE__ */ e("code", { children: "npm run stripe" }),
184
- "."
185
- ] })
186
- ] })
187
- ] }),
188
- /* @__PURE__ */ r("div", { className: "grid gap-3 sm:grid-cols-3", children: [
189
- /* @__PURE__ */ e(
190
- d,
191
- {
192
- id: "stripe_publishableKey",
193
- label: "Publishable key",
194
- defaultValue: s.stripe.publishableKey,
195
- placeholder: "pk_live_…"
196
- }
197
- ),
198
- /* @__PURE__ */ e(
199
- d,
200
- {
201
- id: "stripe_secretKey",
202
- label: "Secret key",
203
- type: "password",
204
- placeholder: s.stripe.hasSecretKey ? t : "sk_live_…"
205
- }
206
- ),
207
- /* @__PURE__ */ e(
208
- d,
209
- {
210
- id: "stripe_webhookSecret",
211
- label: "Webhook signing secret",
212
- type: "password",
213
- placeholder: s.stripe.hasWebhookSecret ? t : "whsec_…"
214
- }
215
- )
216
- ] })
217
- ] }),
218
- /* @__PURE__ */ r("div", { className: "space-y-3", children: [
219
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Freemius (digital products)" }),
220
- /* @__PURE__ */ r("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: [
221
- /* @__PURE__ */ e(
222
- d,
223
- {
224
- id: "freemius_developerId",
225
- label: "Developer ID",
226
- defaultValue: s.freemius.developerId
227
- }
228
- ),
229
- /* @__PURE__ */ e(
230
- d,
231
- {
232
- id: "freemius_productId",
233
- label: "Product ID",
234
- defaultValue: s.freemius.productId
235
- }
236
- ),
237
- /* @__PURE__ */ e(
238
- d,
239
- {
240
- id: "freemius_publicKey",
241
- label: "Public key",
242
- defaultValue: s.freemius.publicKey,
243
- placeholder: "pk_…"
244
- }
245
- ),
246
- /* @__PURE__ */ e(
247
- d,
248
- {
249
- id: "freemius_secretKey",
250
- label: "Secret key",
251
- type: "password",
252
- placeholder: s.freemius.hasSecretKey ? t : "sk_…"
253
- }
254
- ),
255
- /* @__PURE__ */ e(
256
- d,
257
- {
258
- id: "freemius_apiKey",
259
- label: "API key",
260
- type: "password",
261
- placeholder: s.freemius.hasApiKey ? t : "API key"
262
- }
263
- )
264
- ] })
265
- ] }),
266
- s.envFallbackActive && /* @__PURE__ */ e("p", { className: "text-xs text-amber-700", children: "Stripe keys are currently read from environment variables. Saving here moves them into the database and takes precedence." }),
267
- /* @__PURE__ */ e("div", { className: "mt-auto flex justify-end border-t pt-4", children: /* @__PURE__ */ e(L, {}) })
268
- ] }) })
269
- ] });
132
+ function b({ credentials: e, saveAction: t }) {
133
+ let n = "•••••••• (stored — leave blank to keep)";
134
+ return /* @__PURE__ */ a(c, {
135
+ className: "flex h-full flex-col",
136
+ children: [/* @__PURE__ */ a(d, {
137
+ className: "pb-3",
138
+ children: [/* @__PURE__ */ i(f, { children: "Provider API Keys" }), /* @__PURE__ */ a(u, { children: [
139
+ "Keys are encrypted at rest and used DB-first (these override any",
140
+ " ",
141
+ /* @__PURE__ */ i("code", { children: ".env" }),
142
+ " values). Leave a secret blank to keep the stored value."
143
+ ] })]
144
+ }), /* @__PURE__ */ i(l, {
145
+ className: "flex flex-1 flex-col",
146
+ children: /* @__PURE__ */ a("form", {
147
+ action: t,
148
+ className: "flex flex-1 flex-col gap-4",
149
+ children: [
150
+ /* @__PURE__ */ a("div", {
151
+ className: "space-y-3",
152
+ children: [
153
+ /* @__PURE__ */ i("h3", {
154
+ className: "text-sm font-semibold",
155
+ children: "Stripe (physical products)"
156
+ }),
157
+ /* @__PURE__ */ a("details", {
158
+ className: "rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground",
159
+ children: [/* @__PURE__ */ i("summary", {
160
+ className: "cursor-pointer font-medium text-foreground",
161
+ children: "Stripe webhook setup"
162
+ }), /* @__PURE__ */ a("div", {
163
+ className: "mt-2 space-y-1.5",
164
+ children: [/* @__PURE__ */ a("p", { children: [
165
+ "In Stripe, add",
166
+ " ",
167
+ /* @__PURE__ */ i("code", { children: "https://your-domain/api/webhooks/stripe" }),
168
+ " as a webhook endpoint and paste its ",
169
+ /* @__PURE__ */ i("code", { children: "whsec_…" }),
170
+ " signing secret below."
171
+ ] }), /* @__PURE__ */ a("p", { children: [
172
+ "Locally, run",
173
+ " ",
174
+ /* @__PURE__ */ i("code", { children: "stripe listen --forward-to localhost:4200/api/webhooks/stripe" }),
175
+ " ",
176
+ "or ",
177
+ /* @__PURE__ */ i("code", { children: "npm run stripe" }),
178
+ "."
179
+ ] })]
180
+ })]
181
+ }),
182
+ /* @__PURE__ */ a("div", {
183
+ className: "grid gap-3 sm:grid-cols-3",
184
+ children: [
185
+ /* @__PURE__ */ i(y, {
186
+ id: "stripe_publishableKey",
187
+ label: "Publishable key",
188
+ defaultValue: e.stripe.publishableKey,
189
+ placeholder: "pk_live_…"
190
+ }),
191
+ /* @__PURE__ */ i(y, {
192
+ id: "stripe_secretKey",
193
+ label: "Secret key",
194
+ type: "password",
195
+ placeholder: e.stripe.hasSecretKey ? n : "sk_live_…"
196
+ }),
197
+ /* @__PURE__ */ i(y, {
198
+ id: "stripe_webhookSecret",
199
+ label: "Webhook signing secret",
200
+ type: "password",
201
+ placeholder: e.stripe.hasWebhookSecret ? n : "whsec_…"
202
+ })
203
+ ]
204
+ })
205
+ ]
206
+ }),
207
+ /* @__PURE__ */ a("div", {
208
+ className: "space-y-3",
209
+ children: [/* @__PURE__ */ i("h3", {
210
+ className: "text-sm font-semibold",
211
+ children: "Freemius (digital products)"
212
+ }), /* @__PURE__ */ a("div", {
213
+ className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
214
+ children: [
215
+ /* @__PURE__ */ i(y, {
216
+ id: "freemius_developerId",
217
+ label: "Developer ID",
218
+ defaultValue: e.freemius.developerId
219
+ }),
220
+ /* @__PURE__ */ i(y, {
221
+ id: "freemius_productId",
222
+ label: "Product ID",
223
+ defaultValue: e.freemius.productId
224
+ }),
225
+ /* @__PURE__ */ i(y, {
226
+ id: "freemius_publicKey",
227
+ label: "Public key",
228
+ defaultValue: e.freemius.publicKey,
229
+ placeholder: "pk_…"
230
+ }),
231
+ /* @__PURE__ */ i(y, {
232
+ id: "freemius_secretKey",
233
+ label: "Secret key",
234
+ type: "password",
235
+ placeholder: e.freemius.hasSecretKey ? n : "sk_…"
236
+ }),
237
+ /* @__PURE__ */ i(y, {
238
+ id: "freemius_apiKey",
239
+ label: "API key",
240
+ type: "password",
241
+ placeholder: e.freemius.hasApiKey ? n : "API key"
242
+ })
243
+ ]
244
+ })]
245
+ }),
246
+ e.envFallbackActive && /* @__PURE__ */ i("p", {
247
+ className: "text-xs text-amber-700",
248
+ children: "Stripe keys are currently read from environment variables. Saving here moves them into the database and takes precedence."
249
+ }),
250
+ /* @__PURE__ */ i("div", {
251
+ className: "mt-auto flex justify-end border-t pt-4",
252
+ children: /* @__PURE__ */ i(v, {})
253
+ })
254
+ ]
255
+ })
256
+ })]
257
+ });
270
258
  }
271
- function y({
272
- id: s,
273
- label: i,
274
- description: t,
275
- checked: a,
276
- disabled: c,
277
- ready: o,
278
- onCheckedChange: m,
279
- children: u
280
- }) {
281
- return /* @__PURE__ */ e("div", { className: "rounded-md border p-3", children: /* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
282
- /* @__PURE__ */ e(
283
- A,
284
- {
285
- id: s,
286
- checked: a,
287
- disabled: c,
288
- onCheckedChange: (n) => m(!!n),
289
- className: "mt-1"
290
- }
291
- ),
292
- /* @__PURE__ */ r("div", { className: "grid gap-1.5 leading-none w-full", children: [
293
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [
294
- /* @__PURE__ */ e(
295
- P,
296
- {
297
- htmlFor: s,
298
- className: "font-semibold text-base cursor-pointer",
299
- children: i
300
- }
301
- ),
302
- /* @__PURE__ */ e(
303
- "span",
304
- {
305
- className: `text-xs font-medium ${a ? "text-foreground" : "text-muted-foreground"}`,
306
- children: a ? "Enabled" : "Disabled"
307
- }
308
- )
309
- ] }),
310
- /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t }),
311
- !o && /* @__PURE__ */ e("p", { className: "text-xs text-amber-700", children: "Add all required credentials before enabling this provider." }),
312
- u
313
- ] })
314
- ] }) });
259
+ function x({ id: e, label: t, description: n, checked: r, disabled: o, ready: s, onCheckedChange: c, children: l }) {
260
+ return /* @__PURE__ */ i("div", {
261
+ className: "rounded-md border p-3",
262
+ children: /* @__PURE__ */ a("div", {
263
+ className: "flex items-start gap-3",
264
+ children: [/* @__PURE__ */ i(p, {
265
+ id: e,
266
+ checked: r,
267
+ disabled: o,
268
+ onCheckedChange: (e) => c(!!e),
269
+ className: "mt-1"
270
+ }), /* @__PURE__ */ a("div", {
271
+ className: "grid gap-1.5 leading-none w-full",
272
+ children: [
273
+ /* @__PURE__ */ a("div", {
274
+ className: "flex items-center justify-between gap-3 flex-wrap",
275
+ children: [/* @__PURE__ */ i(h, {
276
+ htmlFor: e,
277
+ className: "font-semibold text-base cursor-pointer",
278
+ children: t
279
+ }), /* @__PURE__ */ i("span", {
280
+ className: `text-xs font-medium ${r ? "text-foreground" : "text-muted-foreground"}`,
281
+ children: r ? "Enabled" : "Disabled"
282
+ })]
283
+ }),
284
+ /* @__PURE__ */ i("p", {
285
+ className: "text-sm text-muted-foreground",
286
+ children: n
287
+ }),
288
+ !s && /* @__PURE__ */ i("p", {
289
+ className: "text-xs text-amber-700",
290
+ children: "Add all required credentials before enabling this provider."
291
+ }),
292
+ l
293
+ ]
294
+ })]
295
+ })
296
+ });
315
297
  }
316
- function v({
317
- provider: s,
318
- missingKeys: i,
319
- docsUrl: t,
320
- docsLabel: a
321
- }) {
322
- return /* @__PURE__ */ r("div", { className: "mt-2 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-xs text-foreground", children: [
323
- /* @__PURE__ */ r("div", { className: "mb-1.5 flex items-center gap-2 font-semibold text-destructive", children: [
324
- /* @__PURE__ */ e(j, { className: "h-4 w-4" }),
325
- /* @__PURE__ */ e("span", { children: "Configuration Required" })
326
- ] }),
327
- /* @__PURE__ */ r("p", { children: [
328
- s,
329
- " needs ",
330
- /* @__PURE__ */ e("strong", { children: i.join(", ") }),
331
- ". Add them in Provider API Keys, save, then enable the provider.",
332
- " ",
333
- /* @__PURE__ */ r(
334
- "a",
335
- {
336
- href: t,
337
- target: "_blank",
338
- rel: "noopener noreferrer",
339
- className: "font-medium underline hover:text-destructive/80",
340
- children: [
341
- "Open ",
342
- a
343
- ]
344
- }
345
- ),
346
- "."
347
- ] })
348
- ] });
298
+ function S({ provider: e, missingKeys: t, docsUrl: r, docsLabel: o }) {
299
+ return /* @__PURE__ */ a("div", {
300
+ className: "mt-2 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-xs text-foreground",
301
+ children: [/* @__PURE__ */ a("div", {
302
+ className: "mb-1.5 flex items-center gap-2 font-semibold text-destructive",
303
+ children: [/* @__PURE__ */ i(n, { className: "h-4 w-4" }), /* @__PURE__ */ i("span", { children: "Configuration Required" })]
304
+ }), /* @__PURE__ */ a("p", { children: [
305
+ e,
306
+ " needs ",
307
+ /* @__PURE__ */ i("strong", { children: t.join(", ") }),
308
+ ". Add them in Provider API Keys, save, then enable the provider.",
309
+ " ",
310
+ /* @__PURE__ */ a("a", {
311
+ href: r,
312
+ target: "_blank",
313
+ rel: "noopener noreferrer",
314
+ className: "font-medium underline hover:text-destructive/80",
315
+ children: ["Open ", o]
316
+ }),
317
+ "."
318
+ ] })]
319
+ });
349
320
  }
350
- export {
351
- G as PaymentsClient
352
- };
321
+ //#endregion
322
+ export { _ as PaymentsClient };