@nextblock-cms/ecom 0.8.6 → 0.8.7

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 (277) hide show
  1. package/index.cjs.js +1 -1
  2. package/index.es.js +136 -533
  3. package/lib/CurrencyProvider.cjs.js +1 -0
  4. package/lib/CurrencyProvider.es.js +99 -0
  5. package/lib/cart-store.cjs.js +1 -0
  6. package/{cart-store.es.js → lib/cart-store.es.js} +13 -13
  7. package/lib/components/AccountNavigationMenu.cjs.js +1 -0
  8. package/lib/components/AccountNavigationMenu.es.js +44 -0
  9. package/lib/components/AddToCartButton.cjs.js +1 -0
  10. package/{AddToCartButton-ffE0DhHu.js → lib/components/AddToCartButton.es.js} +14 -13
  11. package/lib/components/Cart.cjs.js +1 -0
  12. package/lib/components/Cart.es.js +148 -0
  13. package/lib/components/CartDrawer.cjs.js +1 -0
  14. package/{components → lib/components}/CartDrawer.es.js +15 -14
  15. package/{components → lib/components}/CartIcon.cjs.js +1 -1
  16. package/{components → lib/components}/CartIcon.es.js +1 -0
  17. package/lib/components/Checkout.cjs.js +1 -0
  18. package/{components → lib/components}/Checkout.es.js +330 -363
  19. package/lib/components/CouponForm.cjs.js +1 -0
  20. package/lib/components/CouponForm.es.js +136 -0
  21. package/lib/components/CurrencySwitcher.cjs.js +1 -0
  22. package/{components → lib/components}/CurrencySwitcher.es.js +5 -4
  23. package/lib/components/CustomerProfileForm.cjs.js +1 -0
  24. package/lib/components/CustomerProfileForm.es.js +355 -0
  25. package/lib/components/FeaturedProduct.cjs.js +1 -0
  26. package/{components → lib/components}/FeaturedProduct.es.js +9 -8
  27. package/lib/components/InvoiceDocument.cjs.js +1 -0
  28. package/lib/components/InvoiceDocument.es.js +196 -0
  29. package/lib/components/InvoiceViewerShell.cjs.js +29 -0
  30. package/lib/components/InvoiceViewerShell.es.js +100 -0
  31. package/lib/components/ProductCard.cjs.js +1 -0
  32. package/lib/components/ProductCard.es.js +119 -0
  33. package/lib/components/ProductDetailsLayout.cjs.js +1 -0
  34. package/lib/components/ProductDetailsLayout.es.js +361 -0
  35. package/lib/components/ProductGallery.cjs.js +1 -0
  36. package/lib/components/ProductGallery.es.js +41 -0
  37. package/lib/components/ProductGrid.cjs.js +1 -0
  38. package/lib/components/ProductGrid.es.js +19 -0
  39. package/lib/components/ShippingEstimator.cjs.js +1 -0
  40. package/lib/components/ShippingEstimator.es.js +125 -0
  41. package/lib/components/SubscriptionSelector.cjs.js +1 -0
  42. package/lib/components/SubscriptionSelector.es.js +140 -0
  43. package/lib/countries.cjs.js +1 -0
  44. package/lib/countries.es.js +77 -0
  45. package/lib/coupon-server.cjs.js +1 -0
  46. package/{coupon-server-DUKVtyYs.js → lib/coupon-server.es.js} +68 -82
  47. package/lib/coupons.cjs.js +1 -0
  48. package/lib/coupons.es.js +17 -0
  49. package/lib/currency-store.cjs.js +1 -0
  50. package/lib/currency-store.es.js +27 -0
  51. package/lib/currency-sync.cjs.js +1 -0
  52. package/lib/currency-sync.es.js +180 -0
  53. package/lib/customer-addresses.cjs.js +1 -0
  54. package/lib/customer-addresses.es.js +116 -0
  55. package/lib/customer-orders.cjs.js +1 -0
  56. package/lib/customer-orders.es.js +45 -0
  57. package/lib/customer.cjs.js +1 -0
  58. package/{customer-C3xccjUg.js → lib/customer.es.js} +15 -14
  59. package/lib/export-helpers.cjs.js +1 -0
  60. package/lib/export-helpers.es.js +56 -0
  61. package/lib/factory.cjs.js +1 -0
  62. package/lib/factory.es.js +8 -0
  63. package/lib/freemius-coupons.cjs.js +1 -0
  64. package/lib/freemius-coupons.es.js +272 -0
  65. package/lib/freemius-order-sync.cjs.js +1 -0
  66. package/lib/freemius-order-sync.es.js +284 -0
  67. package/lib/inventory-settings.cjs.js +1 -0
  68. package/lib/inventory-settings.es.js +86 -0
  69. package/lib/invoice-server.cjs.js +33 -0
  70. package/lib/invoice-server.es.js +141 -0
  71. package/lib/invoice-ui.cjs.js +1 -0
  72. package/lib/invoice-ui.es.js +71 -0
  73. package/lib/invoice.cjs.js +1 -0
  74. package/lib/invoice.es.js +102 -0
  75. package/lib/order-inventory.cjs.js +61 -0
  76. package/lib/order-inventory.es.js +128 -0
  77. package/lib/order-tax-details.cjs.js +1 -0
  78. package/lib/order-tax-details.es.js +164 -0
  79. package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -0
  80. package/lib/pages/cms/coupons/CouponEditorForm.es.js +189 -0
  81. package/lib/pages/cms/coupons/CouponsPage.cjs.js +5 -0
  82. package/lib/pages/cms/coupons/CouponsPage.es.js +171 -0
  83. package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -0
  84. package/lib/pages/cms/coupons/CreateCouponDialog.es.js +35 -0
  85. package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -0
  86. package/lib/pages/cms/coupons/EditCouponPage.es.js +48 -0
  87. package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -0
  88. package/lib/pages/cms/coupons/ProductScopePicker.es.js +120 -0
  89. package/lib/pages/cms/coupons/actions.cjs.js +1 -0
  90. package/lib/pages/cms/coupons/actions.es.js +128 -0
  91. package/lib/pages/cms/coupons/product-options.cjs.js +1 -0
  92. package/lib/pages/cms/coupons/product-options.es.js +27 -0
  93. package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -0
  94. package/lib/pages/cms/orders/ExportReportsDialog.es.js +130 -0
  95. package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -0
  96. package/lib/pages/cms/orders/OrderDetailPage.es.js +137 -0
  97. package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -0
  98. package/lib/pages/cms/orders/OrderPrintButton.es.js +22 -0
  99. package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -0
  100. package/lib/pages/cms/orders/OrderStatusForm.es.js +71 -0
  101. package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -0
  102. package/lib/pages/cms/orders/OrdersPage.es.js +104 -0
  103. package/lib/pages/cms/orders/actions.cjs.js +7 -0
  104. package/lib/pages/cms/orders/actions.es.js +71 -0
  105. package/lib/pages/cms/orders/export-actions.cjs.js +1 -0
  106. package/lib/pages/cms/orders/export-actions.es.js +27 -0
  107. package/lib/pages/cms/orders/server-actions.cjs.js +1 -0
  108. package/lib/pages/cms/orders/server-actions.es.js +55 -0
  109. package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -0
  110. package/lib/pages/cms/payments/PaymentsClient.es.js +188 -0
  111. package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -0
  112. package/lib/pages/cms/payments/PaymentsPage.es.js +29 -0
  113. package/lib/pages/cms/payments/actions.cjs.js +1 -0
  114. package/lib/pages/cms/payments/actions.es.js +23 -0
  115. package/lib/pages/cms/payments/queries.cjs.js +1 -0
  116. package/lib/pages/cms/payments/queries.es.js +30 -0
  117. package/lib/pages/cms/products/ProductsPage.cjs.js +1 -0
  118. package/lib/pages/cms/products/ProductsPage.es.js +46 -0
  119. package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -0
  120. package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +156 -0
  121. package/lib/pages/cms/products/actions.cjs.js +44 -0
  122. package/lib/pages/cms/products/actions.es.js +175 -0
  123. package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -0
  124. package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +48 -0
  125. package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -0
  126. package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +291 -0
  127. package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -0
  128. package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +36 -0
  129. package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -0
  130. package/lib/pages/cms/products/categories/components/CategoryManager.es.js +263 -0
  131. package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -0
  132. package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +114 -0
  133. package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -0
  134. package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +107 -0
  135. package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -0
  136. package/lib/pages/cms/products/components/DeleteProductButton.es.js +48 -0
  137. package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -0
  138. package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +86 -0
  139. package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -0
  140. package/lib/pages/cms/products/components/ProductCategorySelector.es.js +160 -0
  141. package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -0
  142. package/lib/pages/cms/products/components/ProductForm.es.js +702 -0
  143. package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -0
  144. package/lib/pages/cms/products/components/ProductMediaManager.es.js +104 -0
  145. package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -0
  146. package/lib/pages/cms/products/components/ProductsBulkTable.es.js +228 -0
  147. package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -0
  148. package/lib/pages/cms/products/components/SaleScheduleFields.es.js +137 -0
  149. package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -0
  150. package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +36 -0
  151. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +1 -0
  152. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +40 -0
  153. package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -0
  154. package/lib/pages/cms/products/components/VariationsEditor.es.js +408 -0
  155. package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -0
  156. package/lib/pages/cms/products/inventory/InventoryPage.es.js +16 -0
  157. package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -0
  158. package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +214 -0
  159. package/lib/pages/cms/products/inventory/actions.cjs.js +3 -0
  160. package/lib/pages/cms/products/inventory/actions.es.js +95 -0
  161. package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -0
  162. package/lib/pages/cms/products/new/NewProductPage.es.js +76 -0
  163. package/lib/pages/cms/products/product-price-sync.cjs.js +1 -0
  164. package/lib/pages/cms/products/product-price-sync.es.js +98 -0
  165. package/lib/pages/cms/products/server-actions.cjs.js +1 -0
  166. package/lib/pages/cms/products/server-actions.es.js +193 -0
  167. package/lib/pages/cms/shipping/ShippingPage.cjs.js +5 -0
  168. package/lib/pages/cms/shipping/ShippingPage.es.js +211 -0
  169. package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -0
  170. package/lib/pages/cms/shipping/components/RateForm.es.js +441 -0
  171. package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -0
  172. package/lib/pages/cms/shipping/components/ZoneForm.es.js +228 -0
  173. package/lib/pages/cms/shipping/server-actions.cjs.js +1 -0
  174. package/lib/pages/cms/shipping/server-actions.es.js +159 -0
  175. package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -0
  176. package/lib/pages/cms/taxes/TaxesPage.es.js +172 -0
  177. package/lib/pages/cms/taxes/actions.cjs.js +1 -0
  178. package/lib/pages/cms/taxes/actions.es.js +57 -0
  179. package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -0
  180. package/lib/pages/cms/taxes/components/TaxRateForm.es.js +100 -0
  181. package/lib/product-actions.cjs.js +237 -0
  182. package/lib/product-actions.es.js +524 -0
  183. package/lib/product-context.cjs.js +1 -0
  184. package/lib/product-context.es.js +16 -0
  185. package/lib/product-schema.cjs.js +1 -0
  186. package/lib/product-schema.es.js +134 -0
  187. package/lib/providers/freemius.cjs.js +5 -0
  188. package/lib/providers/freemius.es.js +538 -0
  189. package/lib/providers/stripe.cjs.js +1 -0
  190. package/lib/providers/stripe.es.js +473 -0
  191. package/lib/server-actions/coupon-actions.cjs.js +1 -0
  192. package/lib/server-actions/coupon-actions.es.js +23 -0
  193. package/lib/server-actions/customer-actions.cjs.js +1 -0
  194. package/lib/server-actions/customer-actions.es.js +30 -0
  195. package/lib/server-actions/product-actions.cjs.js +1 -0
  196. package/{server-actions → lib/server-actions}/product-actions.es.js +5 -4
  197. package/lib/server-actions/shipping-actions.cjs.js +1 -0
  198. package/{shipping-actions-BnHjlo2q.js → lib/server-actions/shipping-actions.es.js} +9 -7
  199. package/lib/server-actions/tax-actions.cjs.js +1 -0
  200. package/lib/server-actions/tax-actions.es.js +40 -0
  201. package/lib/shared-inventory.cjs.js +15 -0
  202. package/lib/shared-inventory.es.js +171 -0
  203. package/lib/shipping/resolver.cjs.js +7 -0
  204. package/lib/shipping/resolver.es.js +62 -0
  205. package/lib/shipping-rate-currency.cjs.js +1 -0
  206. package/lib/shipping-rate-currency.es.js +72 -0
  207. package/lib/states.cjs.js +1 -0
  208. package/{states-DlHJezQ1.js → lib/states.es.js} +27 -100
  209. package/lib/stripe/checkout.cjs.js +1 -0
  210. package/lib/stripe/checkout.es.js +182 -0
  211. package/lib/stripe/client.cjs.js +1 -0
  212. package/lib/stripe/client.es.js +7 -0
  213. package/lib/stripe/order-sync.cjs.js +1 -0
  214. package/lib/stripe/order-sync.es.js +130 -0
  215. package/lib/stripe/webhooks.cjs.js +1 -0
  216. package/lib/stripe/webhooks.es.js +30 -0
  217. package/lib/tax-calculation.cjs.js +1 -0
  218. package/lib/tax-calculation.es.js +101 -0
  219. package/lib/trials.cjs.js +1 -0
  220. package/{trials-RDcRAZKx.js → lib/trials.es.js} +9 -9
  221. package/{use-cart.es.js → lib/use-cart.es.js} +1 -0
  222. package/lib/zod-config.cjs.js +1 -0
  223. package/lib/zod-config.es.js +6 -0
  224. package/package.json +4 -4
  225. package/server.cjs.js +1 -110
  226. package/server.es.js +178 -6052
  227. package/AddToCartButton-DsSEH9yp.cjs +0 -1
  228. package/CouponForm-BI_5SBHQ.js +0 -152
  229. package/CouponForm-D_uu2bLP.cjs +0 -1
  230. package/CurrencyProvider-Cg-Q6ucj.cjs +0 -1
  231. package/CurrencyProvider-OzlRN96V.js +0 -120
  232. package/CurrencyProvider.cjs.js +0 -1
  233. package/CurrencyProvider.es.js +0 -10
  234. package/ProductDetailsLayout-BxJH_BxR.cjs +0 -1
  235. package/ProductDetailsLayout-Dg8dRTYp.js +0 -530
  236. package/ProductGrid-BdL7iglO.cjs +0 -1
  237. package/ProductGrid-D3AWM8sr.js +0 -130
  238. package/actions-AHmBrS5e.cjs +0 -48
  239. package/actions-j5fuSZX-.js +0 -820
  240. package/cart-store.cjs.js +0 -1
  241. package/components/Cart.cjs.js +0 -1
  242. package/components/Cart.es.js +0 -259
  243. package/components/CartDrawer.cjs.js +0 -1
  244. package/components/Checkout.cjs.js +0 -1
  245. package/components/CurrencySwitcher.cjs.js +0 -1
  246. package/components/FeaturedProduct.cjs.js +0 -1
  247. package/components/ProductDetailsLayout.cjs.js +0 -1
  248. package/components/ProductDetailsLayout.es.js +0 -19
  249. package/components/ProductGrid.cjs.js +0 -1
  250. package/components/ProductGrid.es.js +0 -6
  251. package/coupon-server-C9ySm3I5.cjs +0 -1
  252. package/customer-C-UPvrYN.cjs +0 -1
  253. package/invoice-ui-CAnJPu6n.cjs +0 -29
  254. package/invoice-ui-DtpbTJE1.js +0 -2886
  255. package/product-actions-CONBF8i6.cjs +0 -251
  256. package/product-actions-DjlIWCMH.js +0 -691
  257. package/resolver-Fz_FKsfX.cjs +0 -7
  258. package/resolver-cfrCaHpE.js +0 -128
  259. package/server-actions/product-actions.cjs.js +0 -1
  260. package/shipping-actions-D6zt20gg.cjs +0 -1
  261. package/states-CWYRxV4B.cjs +0 -1
  262. package/tax-calculation-Dab89aHd.js +0 -181
  263. package/tax-calculation-MkDKOEkL.cjs +0 -1
  264. package/trials-DvZaOtNy.cjs +0 -1
  265. /package/{components → lib/components}/SimpleTiptapRenderer.cjs.js +0 -0
  266. /package/{components → lib/components}/SimpleTiptapRenderer.es.js +0 -0
  267. /package/{currency-constants.cjs.js → lib/currency-constants.cjs.js} +0 -0
  268. /package/{currency-constants.es.js → lib/currency-constants.es.js} +0 -0
  269. /package/{currency-rest-client-uolJxUkL.cjs → lib/currency-rest-client.cjs.js} +0 -0
  270. /package/{currency-rest-client-CwoqdgAP.js → lib/currency-rest-client.es.js} +0 -0
  271. /package/{currency.cjs.js → lib/currency.cjs.js} +0 -0
  272. /package/{currency.es.js → lib/currency.es.js} +0 -0
  273. /package/{types.cjs.js → lib/types.cjs.js} +0 -0
  274. /package/{types.es.js → lib/types.es.js} +0 -0
  275. /package/{use-cart.cjs.js → lib/use-cart.cjs.js} +0 -0
  276. /package/{variation-utils.cjs.js → lib/variation-utils.cjs.js} +0 -0
  277. /package/{variation-utils.es.js → lib/variation-utils.es.js} +0 -0
package/index.es.js CHANGED
@@ -1,535 +1,138 @@
1
- import { CartDrawer as ar } from "./components/CartDrawer.es.js";
2
- import { Cart as sr } from "./components/Cart.es.js";
3
- import { Checkout as ir } from "./components/Checkout.es.js";
4
- import { CartIcon as or } from "./components/CartIcon.es.js";
5
- import { C as dr } from "./CouponForm-BI_5SBHQ.js";
6
- import { CurrencySwitcher as ur } from "./components/CurrencySwitcher.es.js";
7
- import { A as hr } from "./AddToCartButton-ffE0DhHu.js";
8
- import { P as _r, a as fr } from "./ProductGrid-D3AWM8sr.js";
9
- import { P as yr, a as vr, b as Nr, S as xr, u as Cr } from "./ProductDetailsLayout-Dg8dRTYp.js";
10
- import { FeaturedProduct as Sr } from "./components/FeaturedProduct.es.js";
11
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
12
- import E, { useState as C } from "react";
13
- import { useForm as te } from "react-hook-form";
14
- import se from "next/link";
15
- import { usePathname as le } from "next/navigation";
16
- import { KeyRound as ie, Package2 as ne, User as V, Upload as oe, Github as F, Phone as ce, Globe as de, Mail as me } from "lucide-react";
17
- import { useTranslations as T, cn as z } from "@nextblock-cms/utils";
18
- import { Avatar as ue, AvatarImage as pe, AvatarFallback as he } from "@nextblock-cms/ui/avatar";
19
- import { Badge as ge } from "@nextblock-cms/ui/badge";
20
- import { Button as G } from "@nextblock-cms/ui/button";
21
- import { Card as B, CardHeader as M, CardTitle as j, CardContent as D, CardFooter as _e } from "@nextblock-cms/ui/card";
22
- import { Checkbox as fe } from "@nextblock-cms/ui/checkbox";
23
- import { Input as m } from "@nextblock-cms/ui/input";
24
- import { Label as c } from "@nextblock-cms/ui/label";
25
- import { Select as be, SelectTrigger as ye, SelectValue as ve, SelectContent as Ne, SelectItem as I } from "@nextblock-cms/ui/select";
26
- import { Separator as xe } from "@nextblock-cms/ui/separator";
27
- import { createClient as Ce } from "@nextblock-cms/db/server";
28
- import { revalidatePath as H } from "next/cache";
29
- import { n as S, a as K, e as we } from "./customer-C3xccjUg.js";
30
- import { i as Er, b as Fr } from "./customer-C3xccjUg.js";
31
- import { u as Se } from "./actions-j5fuSZX-.js";
32
- import { createClient as W } from "@nextblock-cms/db";
33
- import { n as Pe, c as Ee } from "./states-DlHJezQ1.js";
34
- import { D as Tr, I as Ar, a as Rr, b as $r, P as Lr, c as Ur, d as kr, e as Or, f as Vr, g as zr, h as Gr, i as Br, j as Mr, k as jr, l as Dr, m as Hr, n as Kr, o as Wr, p as qr, q as Xr, r as Yr, s as Jr, t as Qr, u as Zr } from "./invoice-ui-DtpbTJE1.js";
35
- import { SimpleTiptapRenderer as ra } from "./components/SimpleTiptapRenderer.es.js";
36
- import { getCartItemActivePrice as ta, useCartStore as sa, useCartSubtotal as la, useCartTotalItems as ia } from "./cart-store.es.js";
37
- import { e as oa, g as ca, n as da } from "./coupon-server-DUKVtyYs.js";
38
- import { C as ua, u as pa, a as ha } from "./CurrencyProvider-OzlRN96V.js";
39
- import { CURRENCY_ROUNDING_MODES as _a, applyCurrencyRounding as fa, convertMinorUnitAmount as ba, describeCurrencyRoundingRule as ya, getCurrencyLookup as va, getDefaultCurrency as Na, getExchangeRateForCurrency as xa, inferCurrencyCodeFromLocale as Ca, isSaleWindowActive as wa, isScheduledPriceDue as Sa, normalizeCurrencyRecord as Pa, normalizeCurrencyRoundingMode as Ea, normalizePriceMap as Fa, normalizeSalePriceMap as Ia, resolveEffectivePriceForCurrency as Ta, resolvePriceForCurrency as Aa, resolvePriceRangeForCurrency as Ra, sortCurrencies as $a } from "./currency.es.js";
40
- import { useCart as Ua, useIsCartHydrated as ka } from "./use-cart.es.js";
41
- import { DEFAULT_ENABLED_PAYMENT_PROVIDERS as Va, derivePaymentProviderFromProductType as za, getProductPaymentProvider as Ga, isDigitalItem as Ba, isDigitalProduct as Ma, normalizeEnabledPaymentProviders as ja } from "./types.es.js";
42
- import { g as Ha, a as Ka, b as Wa, c as qa, d as Xa } from "./trials-RDcRAZKx.js";
43
- import { buildCombinationKey as Ja, buildVariantLabel as Qa, chooseInitialVariantSelections as Za, extractSelectedTermsByAttribute as et, findMatchingVariant as rt, generateVariantDrafts as at, getAvailableTermIdsForAttribute as tt, getVariantEffectivePriceRange as st, mapRawVariantRelations as lt, normalizeSelectionsToAvailableVariants as it, resolveAttributeName as nt, resolveTermValue as ot, resolveTranslatedText as ct } from "./variation-utils.es.js";
44
- function q(e, d, l) {
45
- const s = e(d);
46
- return s === d ? l : s;
47
- }
48
- function Fe(e) {
49
- return e === "password" ? ie : ne;
50
- }
51
- function Ie({
52
- links: e,
53
- title: d,
54
- className: l
55
- }) {
56
- const s = le(), { t: h } = T();
57
- return e.length ? /* @__PURE__ */ a("div", { className: z("w-full space-y-3", l), children: [
58
- /* @__PURE__ */ r("div", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: d || q(h, "account_navigation", "Account") }),
59
- /* @__PURE__ */ r("div", { className: "space-y-2", children: e.map((i) => {
60
- const u = Fe(i.icon), t = s === i.href || s.startsWith(`${i.href}/`);
61
- return /* @__PURE__ */ a(
62
- se,
63
- {
64
- href: i.href,
65
- className: z(
66
- "flex items-center gap-3 rounded-xl border px-3 py-2.5 text-sm font-medium transition-colors",
67
- t ? "border-slate-900 bg-slate-900 text-white" : "border-border bg-background hover:bg-muted/40"
68
- ),
69
- children: [
70
- /* @__PURE__ */ r(u, { className: "h-4 w-4 shrink-0" }),
71
- /* @__PURE__ */ r("span", { children: q(h, i.labelKey, i.fallbackLabel) })
72
- ]
73
- },
74
- i.href
75
- );
76
- }) })
77
- ] }) : null;
78
- }
79
- async function Te(e) {
80
- const d = Ce(), { data: { user: l }, error: s } = await d.auth.getUser();
81
- if (s || !l)
82
- throw new Error("Unauthorized");
83
- const h = {
84
- full_name: e.full_name || null,
85
- avatar_url: e.avatar_url || null,
86
- website: e.website || null,
87
- github_username: e.github_username || null,
88
- phone: e.phone || null,
89
- updated_at: (/* @__PURE__ */ new Date()).toISOString()
90
- }, { error: i } = await d.from("profiles").update(h).eq("id", l.id);
91
- if (i)
92
- throw console.error("Error updating profile:", i), new Error("Failed to update profile");
93
- const u = S(e.billing_address), t = e.use_billing_for_shipping ? u : S(e.shipping_address);
94
- return await Se({
95
- userId: l.id,
96
- billingAddress: u,
97
- shippingAddress: t,
98
- client: d
99
- }), H("/profile"), H("/checkout"), { success: !0 };
100
- }
101
- function w(e) {
102
- return {
103
- company_name: e?.company_name || "",
104
- recipient_name: e?.recipient_name || "",
105
- line1: e?.line1 || "",
106
- line2: e?.line2 || "",
107
- city: e?.city || "",
108
- state: e?.state || "",
109
- postal_code: e?.postal_code || "",
110
- country_code: Pe(e?.country_code) || "CA"
111
- };
112
- }
113
- function X({
114
- prefix: e,
115
- title: d,
116
- register: l
117
- }) {
118
- const { t: s } = T(), h = s("company_name") === "company_name" ? "Company name" : s("company_name");
119
- return /* @__PURE__ */ a("div", { className: "space-y-4 rounded-xl border p-4", children: [
120
- /* @__PURE__ */ a("div", { children: [
121
- /* @__PURE__ */ r("h3", { className: "text-lg font-medium", children: d }),
122
- /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: s("profile_address_defaults_help") })
123
- ] }),
124
- /* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-3", children: [
125
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
126
- /* @__PURE__ */ r(c, { htmlFor: `${e}-company_name`, children: h }),
127
- /* @__PURE__ */ r(m, { id: `${e}-company_name`, ...l(`${e}.company_name`) })
128
- ] }),
129
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
130
- /* @__PURE__ */ r(c, { htmlFor: `${e}-recipient_name`, children: s("full_name") }),
131
- /* @__PURE__ */ r(m, { id: `${e}-recipient_name`, ...l(`${e}.recipient_name`) })
132
- ] }),
133
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
134
- /* @__PURE__ */ r(c, { htmlFor: `${e}-country_code`, children: s("country") }),
135
- /* @__PURE__ */ r(
136
- "select",
137
- {
138
- id: `${e}-country_code`,
139
- className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
140
- ...l(`${e}.country_code`),
141
- children: Ee.map((i) => /* @__PURE__ */ r("option", { value: i.code, children: i.name }, i.code))
142
- }
143
- )
144
- ] })
145
- ] }),
146
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
147
- /* @__PURE__ */ r(c, { htmlFor: `${e}-line1`, children: s("address_line_1") }),
148
- /* @__PURE__ */ r(m, { id: `${e}-line1`, ...l(`${e}.line1`) })
149
- ] }),
150
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
151
- /* @__PURE__ */ r(c, { htmlFor: `${e}-line2`, children: s("address_line_2") }),
152
- /* @__PURE__ */ r(m, { id: `${e}-line2`, ...l(`${e}.line2`) })
153
- ] }),
154
- /* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-3", children: [
155
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
156
- /* @__PURE__ */ r(c, { htmlFor: `${e}-city`, children: s("city") }),
157
- /* @__PURE__ */ r(m, { id: `${e}-city`, ...l(`${e}.city`) })
158
- ] }),
159
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
160
- /* @__PURE__ */ r(c, { htmlFor: `${e}-state`, children: s("state_province") }),
161
- /* @__PURE__ */ r(m, { id: `${e}-state`, ...l(`${e}.state`) })
162
- ] }),
163
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
164
- /* @__PURE__ */ r(c, { htmlFor: `${e}-postal_code`, children: s("postal_zip_code") }),
165
- /* @__PURE__ */ r(m, { id: `${e}-postal_code`, ...l(`${e}.postal_code`) })
166
- ] })
167
- ] })
168
- ] });
169
- }
170
- function Ze({
171
- initialData: e,
172
- MediaPickerComponent: d,
173
- isAdmin: l,
174
- email: s,
175
- accountLinks: h,
176
- onAction: i,
177
- initialSuccessMessage: u
178
- }) {
179
- const { t } = T(), [A, R] = C(!1), [P, y] = C(
180
- u ? { type: "success", text: u } : null
181
- ), [$, Y] = C(!1), [L, J] = C(null), Q = e?.use_billing_for_shipping ?? (!e?.shipping_address || K(e?.billing_address, e?.shipping_address)), {
182
- register: _,
183
- handleSubmit: Z,
184
- setValue: g,
185
- getValues: x,
186
- watch: v,
187
- reset: U
188
- } = te({
189
- defaultValues: {
190
- full_name: e?.full_name || "",
191
- avatar_url: e?.avatar_url || "",
192
- website: e?.website || "",
193
- github_username: e?.github_username || "",
194
- phone: e?.phone || "",
195
- role: e?.role,
196
- use_billing_for_shipping: Q,
197
- billing_address: w(e?.billing_address),
198
- shipping_address: w(e?.shipping_address)
199
- }
200
- });
201
- E.useEffect(() => {
202
- e && U({
203
- full_name: e.full_name || "",
204
- avatar_url: e.avatar_url || "",
205
- website: e.website || "",
206
- github_username: e.github_username || "",
207
- phone: e.phone || "",
208
- role: e.role,
209
- use_billing_for_shipping: e.use_billing_for_shipping ?? (!e.shipping_address || K(e.billing_address, e.shipping_address)),
210
- billing_address: w(e.billing_address),
211
- shipping_address: w(e.shipping_address)
212
- });
213
- }, [e, U]), E.useEffect(() => {
214
- u && y({ type: "success", text: u });
215
- }, [u]), E.useEffect(() => {
216
- const n = W();
217
- (async () => {
218
- const {
219
- data: { user: p }
220
- } = await n.auth.getUser();
221
- if (!p)
222
- return;
223
- const o = p.identities?.find((b) => b.provider === "github");
224
- if (o) {
225
- Y(!0);
226
- const b = o.identity_data?.email || (p.app_metadata.provider === "github" ? p.email : null);
227
- if (J(b), !x("website")) {
228
- const N = o.identity_data?.custom_claims?.blog || o.identity_data?.blog || o.identity_data?.html_url;
229
- N && g("website", N);
230
- }
231
- if (!x("avatar_url")) {
232
- const N = o.identity_data?.avatar_url;
233
- N && g("avatar_url", N);
234
- }
235
- const O = o.identity_data?.user_name || o.identity_data?.preferred_username;
236
- O && g("github_username", O);
237
- }
238
- !x("full_name") && p.user_metadata?.full_name && g("full_name", p.user_metadata.full_name);
239
- })();
240
- }, [x, g]);
241
- const ee = async () => {
242
- const n = W(), { error: f } = await n.auth.linkIdentity({ provider: "github" });
243
- f && (console.error("Error linking GitHub:", f), y({
244
- type: "error",
245
- text: t("github_link_failed") || "Failed to link GitHub account"
246
- }));
247
- }, re = (n) => {
248
- const p = `${process.env.NEXT_PUBLIC_R2_BASE_URL || "https://assets.nextblock.com"}/${n.object_key}`;
249
- g("avatar_url", p);
250
- }, ae = async (n) => {
251
- R(!0), y(null);
252
- const f = S(n.billing_address) ?? we(), p = n.use_billing_for_shipping ? f : S(n.shipping_address);
253
- try {
254
- const o = {
255
- ...n,
256
- billing_address: f,
257
- shipping_address: p
258
- };
259
- if (i) {
260
- const b = await i(o);
261
- if (b?.error)
262
- throw new Error(b.error);
263
- } else
264
- await Te(o);
265
- y({ type: "success", text: t("profile_updated_success") });
266
- } catch (o) {
267
- if (o.message === "NEXT_REDIRECT" || o.message?.includes("NEXT_REDIRECT"))
268
- return;
269
- console.error(o), y({ type: "error", text: o.message || t("profile_update_failed") });
270
- } finally {
271
- R(!1);
272
- }
273
- }, k = v("use_billing_for_shipping");
274
- return /* @__PURE__ */ a("div", { className: "grid gap-6 md:grid-cols-12 max-w-5xl mx-auto", children: [
275
- /* @__PURE__ */ a(B, { className: "md:col-span-4 h-fit", children: [
276
- /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(j, { className: "text-xl", children: t("public_profile") }) }),
277
- /* @__PURE__ */ a(D, { className: "flex flex-col items-center text-center space-y-4", children: [
278
- /* @__PURE__ */ a("div", { className: "relative group", children: [
279
- /* @__PURE__ */ a(ue, { className: "h-32 w-32 border-4 border-muted", children: [
280
- /* @__PURE__ */ r(pe, { src: v("avatar_url") || void 0, className: "object-cover" }),
281
- /* @__PURE__ */ r(he, { className: "text-4xl bg-secondary", children: v("full_name")?.charAt(0)?.toUpperCase() || /* @__PURE__ */ r(V, { className: "h-12 w-12" }) })
282
- ] }),
283
- d && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/40 rounded-full cursor-pointer", children: /* @__PURE__ */ r(
284
- d,
285
- {
286
- triggerLabel: /* @__PURE__ */ r(oe, { className: "h-6 w-6 text-white" }),
287
- triggerVariant: "ghost",
288
- title: t("customer_profile"),
289
- onSelect: re,
290
- accept: (n) => n.file_type.startsWith("image/"),
291
- hideTrigger: !1
292
- }
293
- ) })
294
- ] }),
295
- !d && /* @__PURE__ */ a("div", { className: "w-full", children: [
296
- /* @__PURE__ */ r(c, { htmlFor: "avatar_url", className: "sr-only", children: t("avatar_url") }),
297
- /* @__PURE__ */ r(m, { id: "avatar_url", ..._("avatar_url"), placeholder: "https://...", className: "mt-2" })
298
- ] }),
299
- /* @__PURE__ */ a("div", { className: "w-full space-y-1 text-left mt-4", children: [
300
- /* @__PURE__ */ r("div", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: t("identity") }),
301
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ r("span", { className: "font-semibold text-lg", children: v("full_name") || t("full_name") }) }),
302
- $ && /* @__PURE__ */ a(ge, { variant: "secondary", className: "mt-2 w-fit gap-1", children: [
303
- /* @__PURE__ */ r(F, { className: "h-3 w-3" }),
304
- " ",
305
- t("github_connected") || "GitHub Connected"
306
- ] })
307
- ] }),
308
- h?.length ? /* @__PURE__ */ r(
309
- Ie,
310
- {
311
- links: h,
312
- className: "mt-2 text-left"
313
- }
314
- ) : null
315
- ] })
316
- ] }),
317
- /* @__PURE__ */ r(B, { className: "md:col-span-8", children: /* @__PURE__ */ a("form", { onSubmit: Z(ae), children: [
318
- /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(j, { children: t("details") }) }),
319
- /* @__PURE__ */ a(D, { className: "space-y-6", children: [
320
- s && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
321
- /* @__PURE__ */ a(c, { htmlFor: "email", children: [
322
- t("email") || "Email",
323
- " (Read-only)"
324
- ] }),
325
- /* @__PURE__ */ r(m, { id: "email", value: s, readOnly: !0, disabled: !0, className: "bg-muted/50" })
326
- ] }),
327
- /* @__PURE__ */ r("div", { className: "rounded-xl border bg-muted/20 p-4 text-sm text-muted-foreground", children: t("profile_basic_info_help") }),
328
- /* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-2", children: [
329
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
330
- /* @__PURE__ */ a(c, { htmlFor: "full_name", className: "flex items-center gap-2", children: [
331
- /* @__PURE__ */ r(V, { className: "h-4 w-4" }),
332
- " ",
333
- t("full_name")
334
- ] }),
335
- /* @__PURE__ */ r(m, { id: "full_name", ..._("full_name") })
336
- ] }),
337
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
338
- /* @__PURE__ */ a(c, { htmlFor: "phone", className: "flex items-center gap-2", children: [
339
- /* @__PURE__ */ r(ce, { className: "h-4 w-4" }),
340
- " ",
341
- t("phone_number")
342
- ] }),
343
- /* @__PURE__ */ r(m, { id: "phone", ..._("phone") })
344
- ] })
345
- ] }),
346
- /* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-2", children: [
347
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
348
- /* @__PURE__ */ a(c, { htmlFor: "website", className: "flex items-center gap-2", children: [
349
- /* @__PURE__ */ r(de, { className: "h-4 w-4" }),
350
- " ",
351
- t("website")
352
- ] }),
353
- /* @__PURE__ */ r(m, { id: "website", ..._("website"), placeholder: "https://example.com" })
354
- ] }),
355
- /* @__PURE__ */ a("div", { className: "space-y-2", children: [
356
- /* @__PURE__ */ a(c, { htmlFor: "github_username", className: "flex items-center gap-2", children: [
357
- /* @__PURE__ */ r(F, { className: "h-4 w-4" }),
358
- " ",
359
- t("github_username")
360
- ] }),
361
- $ ? /* @__PURE__ */ a("div", { className: "space-y-2", children: [
362
- /* @__PURE__ */ r(m, { id: "github_username", ..._("github_username"), disabled: !0, className: "bg-muted" }),
363
- L && /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
364
- /* @__PURE__ */ r(me, { className: "h-3 w-3" }),
365
- " ",
366
- t("linked_to") || "Linked to",
367
- " ",
368
- L
369
- ] })
370
- ] }) : /* @__PURE__ */ a(G, { type: "button", variant: "outline", className: "w-full", onClick: ee, children: [
371
- /* @__PURE__ */ r(F, { className: "mr-2 h-4 w-4" }),
372
- t("connect_github")
373
- ] })
374
- ] })
375
- ] }),
376
- /* @__PURE__ */ r(xe, { className: "my-2" }),
377
- /* @__PURE__ */ r(X, { prefix: "billing_address", title: t("billing_address"), register: _ }),
378
- /* @__PURE__ */ a("div", { className: "flex items-center space-x-3 rounded-lg border p-4", children: [
379
- /* @__PURE__ */ r(
380
- fe,
381
- {
382
- id: "use_billing_for_shipping",
383
- checked: !!k,
384
- onCheckedChange: (n) => g("use_billing_for_shipping", !!n, { shouldDirty: !0 })
385
- }
386
- ),
387
- /* @__PURE__ */ a("div", { className: "space-y-1", children: [
388
- /* @__PURE__ */ r(c, { htmlFor: "use_billing_for_shipping", className: "cursor-pointer", children: t("use_billing_for_shipping") }),
389
- /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: t("profile_use_billing_for_shipping_help") })
390
- ] })
391
- ] }),
392
- !k && /* @__PURE__ */ r(
393
- X,
394
- {
395
- prefix: "shipping_address",
396
- title: t("shipping_address"),
397
- register: _
398
- }
399
- ),
400
- P && /* @__PURE__ */ r(
401
- "div",
402
- {
403
- className: `mt-4 rounded-xl border p-4 text-sm ${P.type === "success" ? "border-emerald-200 bg-emerald-50 text-emerald-700" : "border-red-200 bg-red-50 text-red-700"}`,
404
- children: P.text
405
- }
406
- ),
407
- l && /* @__PURE__ */ a("div", { className: "border-t pt-4 mt-4", children: [
408
- /* @__PURE__ */ r("h3", { className: "text-sm font-medium mb-3", children: "Admin Settings" }),
409
- /* @__PURE__ */ a("div", { className: "grid gap-2", children: [
410
- /* @__PURE__ */ r(c, { htmlFor: "role", children: "Role" }),
411
- /* @__PURE__ */ a(
412
- be,
413
- {
414
- value: v("role") || "USER",
415
- onValueChange: (n) => g("role", n),
416
- children: [
417
- /* @__PURE__ */ r(ye, { children: /* @__PURE__ */ r(ve, { placeholder: "Select role" }) }),
418
- /* @__PURE__ */ a(Ne, { children: [
419
- /* @__PURE__ */ r(I, { value: "USER", children: "User" }),
420
- /* @__PURE__ */ r(I, { value: "WRITER", children: "Writer" }),
421
- /* @__PURE__ */ r(I, { value: "ADMIN", children: "Admin" })
422
- ] })
423
- ]
424
- }
425
- )
426
- ] })
427
- ] })
428
- ] }),
429
- /* @__PURE__ */ r(_e, { className: "flex justify-end", children: /* @__PURE__ */ r(G, { type: "submit", disabled: A, size: "lg", children: t(A ? "saving" : "save_changes") }) })
430
- ] }) })
431
- ] });
432
- }
1
+ import { CartDrawer as o } from "./lib/components/CartDrawer.es.js";
2
+ import { Cart as a } from "./lib/components/Cart.es.js";
3
+ import { Checkout as n } from "./lib/components/Checkout.es.js";
4
+ import { CartIcon as m } from "./lib/components/CartIcon.es.js";
5
+ import { CouponForm as l } from "./lib/components/CouponForm.es.js";
6
+ import { CurrencySwitcher as d } from "./lib/components/CurrencySwitcher.es.js";
7
+ import { AddToCartButton as C } from "./lib/components/AddToCartButton.es.js";
8
+ import { ProductCard as x } from "./lib/components/ProductCard.es.js";
9
+ import { ProductGrid as g } from "./lib/components/ProductGrid.es.js";
10
+ import { ProductGallery as v } from "./lib/components/ProductGallery.es.js";
11
+ import { FeaturedProduct as S } from "./lib/components/FeaturedProduct.es.js";
12
+ import { CustomerProfileForm as D } from "./lib/components/CustomerProfileForm.es.js";
13
+ import { SubscriptionSelector as R } from "./lib/components/SubscriptionSelector.es.js";
14
+ import { InvoiceDocument as E } from "./lib/components/InvoiceDocument.es.js";
15
+ import { InvoiceViewerShell as L } from "./lib/components/InvoiceViewerShell.es.js";
16
+ import { AccountNavigationMenu as z } from "./lib/components/AccountNavigationMenu.es.js";
17
+ import { SimpleTiptapRenderer as N } from "./lib/components/SimpleTiptapRenderer.es.js";
18
+ import { ProductForm as M } from "./lib/pages/cms/products/components/ProductForm.es.js";
19
+ import { ProductCategorySelector as w } from "./lib/pages/cms/products/components/ProductCategorySelector.es.js";
20
+ import { getCartItemActivePrice as U, useCartStore as k, useCartSubtotal as B, useCartTotalItems as K } from "./lib/cart-store.es.js";
21
+ import { emptyProviderDiscounts as q, getCartLineCouponKey as H, normalizeCouponCode as J } from "./lib/coupons.es.js";
22
+ import { CurrencyProvider as j, useCurrency as Q } from "./lib/CurrencyProvider.es.js";
23
+ import { CURRENCY_ROUNDING_MODES as Z, applyCurrencyRounding as $, convertMinorUnitAmount as ee, describeCurrencyRoundingRule as re, getCurrencyLookup as oe, getDefaultCurrency as te, getExchangeRateForCurrency as ae, inferCurrencyCodeFromLocale as ie, isSaleWindowActive as ne, isScheduledPriceDue as ce, normalizeCurrencyRecord as me, normalizeCurrencyRoundingMode as ue, normalizePriceMap as le, normalizeSalePriceMap as se, resolveEffectivePriceForCurrency as de, resolvePriceForCurrency as pe, resolvePriceRangeForCurrency as Ce, sortCurrencies as fe } from "./lib/currency.es.js";
24
+ import { useCurrencyPreferenceStore as Pe } from "./lib/currency-store.es.js";
25
+ import { useCart as ye, useIsCartHydrated as ve } from "./lib/use-cart.es.js";
26
+ import { addressesMatch as Se, emptyCustomerAddress as Ie, isCustomerAddressComplete as De, normalizeCustomerAddress as be, normalizeOrderCustomerDetails as Re } from "./lib/customer.es.js";
27
+ import { DEFAULT_ENABLED_PAYMENT_PROVIDERS as Ee, derivePaymentProviderFromProductType as Fe, getProductPaymentProvider as Le, isDigitalItem as Oe, isDigitalProduct as ze, normalizeEnabledPaymentProviders as Ve } from "./lib/types.es.js";
28
+ import { getTrialCheckoutMode as he, getTrialLabel as Me, getTrialPaymentRequirementLabel as _e, getTrialPeriodDays as we, getTrialSummary as Ge } from "./lib/trials.es.js";
29
+ import { aggregateOrderTaxLines as ke, buildOrderTaxDetailsFromCalculation as Be, buildOrderTaxDetailsFromStripeSession as Ke, getOrderTaxRateJurisdiction as Ye, getOrderTaxRateLabel as qe, getOrderTaxRatePercentage as He, normalizeOrderTaxDetails as Je } from "./lib/order-tax-details.es.js";
30
+ import { DEFAULT_INVOICE_SETTINGS as je, INVOICE_SETTINGS_KEY as Qe, formatInvoiceCurrency as Xe, formatInvoiceDate as Ze, getInvoiceAddressLines as $e, normalizeInvoiceSettings as er, serializeInvoiceSettings as rr } from "./lib/invoice.es.js";
31
+ import { buildInvoiceDocumentLabels as tr, getInvoiceLocale as ar, localizeInvoicePresentationData as ir, translateOrFallback as nr, translateOrderStatus as cr } from "./lib/invoice-ui.es.js";
32
+ import { productSchema as ur } from "./lib/product-schema.es.js";
33
+ import { ProductProvider as sr, useProduct as dr } from "./lib/product-context.es.js";
34
+ import { ProductDetailsLayout as Cr } from "./lib/components/ProductDetailsLayout.es.js";
35
+ import { buildCombinationKey as xr, buildVariantLabel as Pr, chooseInitialVariantSelections as gr, extractSelectedTermsByAttribute as yr, findMatchingVariant as vr, generateVariantDrafts as Tr, getAvailableTermIdsForAttribute as Sr, getVariantEffectivePriceRange as Ir, mapRawVariantRelations as Dr, normalizeSelectionsToAvailableVariants as br, resolveAttributeName as Rr, resolveTermValue as Ar, resolveTranslatedText as Er } from "./lib/variation-utils.es.js";
433
36
  export {
434
- Ie as AccountNavigationMenu,
435
- hr as AddToCartButton,
436
- _a as CURRENCY_ROUNDING_MODES,
437
- sr as Cart,
438
- ar as CartDrawer,
439
- or as CartIcon,
440
- ir as Checkout,
441
- dr as CouponForm,
442
- ua as CurrencyProvider,
443
- ur as CurrencySwitcher,
444
- Ze as CustomerProfileForm,
445
- Va as DEFAULT_ENABLED_PAYMENT_PROVIDERS,
446
- Tr as DEFAULT_INVOICE_SETTINGS,
447
- Sr as FeaturedProduct,
448
- Ar as INVOICE_SETTINGS_KEY,
449
- Rr as InvoiceDocument,
450
- $r as InvoiceViewerShell,
451
- _r as ProductCard,
452
- Lr as ProductCategorySelector,
453
- yr as ProductDetailsLayout,
454
- Ur as ProductForm,
455
- vr as ProductGallery,
456
- fr as ProductGrid,
457
- Nr as ProductProvider,
458
- ra as SimpleTiptapRenderer,
459
- xr as SubscriptionSelector,
460
- K as addressesMatch,
461
- kr as aggregateOrderTaxLines,
462
- fa as applyCurrencyRounding,
463
- Ja as buildCombinationKey,
464
- Or as buildInvoiceDocumentLabels,
465
- Vr as buildOrderTaxDetailsFromCalculation,
466
- zr as buildOrderTaxDetailsFromStripeSession,
467
- Qa as buildVariantLabel,
468
- Za as chooseInitialVariantSelections,
469
- ba as convertMinorUnitAmount,
470
- za as derivePaymentProviderFromProductType,
471
- ya as describeCurrencyRoundingRule,
472
- we as emptyCustomerAddress,
473
- oa as emptyProviderDiscounts,
474
- et as extractSelectedTermsByAttribute,
475
- rt as findMatchingVariant,
476
- Gr as formatInvoiceCurrency,
477
- Br as formatInvoiceDate,
478
- at as generateVariantDrafts,
479
- tt as getAvailableTermIdsForAttribute,
480
- ta as getCartItemActivePrice,
481
- ca as getCartLineCouponKey,
482
- va as getCurrencyLookup,
483
- Na as getDefaultCurrency,
484
- xa as getExchangeRateForCurrency,
485
- Mr as getInvoiceAddressLines,
486
- jr as getInvoiceLocale,
487
- Dr as getOrderTaxRateJurisdiction,
488
- Hr as getOrderTaxRateLabel,
489
- Kr as getOrderTaxRatePercentage,
490
- Ga as getProductPaymentProvider,
491
- Ha as getTrialCheckoutMode,
492
- Ka as getTrialLabel,
493
- Wa as getTrialPaymentRequirementLabel,
494
- qa as getTrialPeriodDays,
495
- Xa as getTrialSummary,
496
- st as getVariantEffectivePriceRange,
497
- Ca as inferCurrencyCodeFromLocale,
498
- Er as isCustomerAddressComplete,
499
- Ba as isDigitalItem,
500
- Ma as isDigitalProduct,
501
- wa as isSaleWindowActive,
502
- Sa as isScheduledPriceDue,
503
- Wr as localizeInvoicePresentationData,
504
- lt as mapRawVariantRelations,
505
- da as normalizeCouponCode,
506
- Pa as normalizeCurrencyRecord,
507
- Ea as normalizeCurrencyRoundingMode,
508
- S as normalizeCustomerAddress,
509
- ja as normalizeEnabledPaymentProviders,
510
- qr as normalizeInvoiceSettings,
511
- Fr as normalizeOrderCustomerDetails,
512
- Xr as normalizeOrderTaxDetails,
513
- Fa as normalizePriceMap,
514
- Ia as normalizeSalePriceMap,
515
- it as normalizeSelectionsToAvailableVariants,
516
- Yr as productSchema,
517
- nt as resolveAttributeName,
518
- Ta as resolveEffectivePriceForCurrency,
519
- Aa as resolvePriceForCurrency,
520
- Ra as resolvePriceRangeForCurrency,
521
- ot as resolveTermValue,
522
- ct as resolveTranslatedText,
523
- Jr as serializeInvoiceSettings,
524
- $a as sortCurrencies,
525
- Qr as translateOrFallback,
526
- Zr as translateOrderStatus,
527
- Ua as useCart,
528
- sa as useCartStore,
529
- la as useCartSubtotal,
530
- ia as useCartTotalItems,
531
- pa as useCurrency,
532
- ha as useCurrencyPreferenceStore,
533
- ka as useIsCartHydrated,
534
- Cr as useProduct
37
+ z as AccountNavigationMenu,
38
+ C as AddToCartButton,
39
+ Z as CURRENCY_ROUNDING_MODES,
40
+ a as Cart,
41
+ o as CartDrawer,
42
+ m as CartIcon,
43
+ n as Checkout,
44
+ l as CouponForm,
45
+ j as CurrencyProvider,
46
+ d as CurrencySwitcher,
47
+ D as CustomerProfileForm,
48
+ Ee as DEFAULT_ENABLED_PAYMENT_PROVIDERS,
49
+ je as DEFAULT_INVOICE_SETTINGS,
50
+ S as FeaturedProduct,
51
+ Qe as INVOICE_SETTINGS_KEY,
52
+ E as InvoiceDocument,
53
+ L as InvoiceViewerShell,
54
+ x as ProductCard,
55
+ w as ProductCategorySelector,
56
+ Cr as ProductDetailsLayout,
57
+ M as ProductForm,
58
+ v as ProductGallery,
59
+ g as ProductGrid,
60
+ sr as ProductProvider,
61
+ N as SimpleTiptapRenderer,
62
+ R as SubscriptionSelector,
63
+ Se as addressesMatch,
64
+ ke as aggregateOrderTaxLines,
65
+ $ as applyCurrencyRounding,
66
+ xr as buildCombinationKey,
67
+ tr as buildInvoiceDocumentLabels,
68
+ Be as buildOrderTaxDetailsFromCalculation,
69
+ Ke as buildOrderTaxDetailsFromStripeSession,
70
+ Pr as buildVariantLabel,
71
+ gr as chooseInitialVariantSelections,
72
+ ee as convertMinorUnitAmount,
73
+ Fe as derivePaymentProviderFromProductType,
74
+ re as describeCurrencyRoundingRule,
75
+ Ie as emptyCustomerAddress,
76
+ q as emptyProviderDiscounts,
77
+ yr as extractSelectedTermsByAttribute,
78
+ vr as findMatchingVariant,
79
+ Xe as formatInvoiceCurrency,
80
+ Ze as formatInvoiceDate,
81
+ Tr as generateVariantDrafts,
82
+ Sr as getAvailableTermIdsForAttribute,
83
+ U as getCartItemActivePrice,
84
+ H as getCartLineCouponKey,
85
+ oe as getCurrencyLookup,
86
+ te as getDefaultCurrency,
87
+ ae as getExchangeRateForCurrency,
88
+ $e as getInvoiceAddressLines,
89
+ ar as getInvoiceLocale,
90
+ Ye as getOrderTaxRateJurisdiction,
91
+ qe as getOrderTaxRateLabel,
92
+ He as getOrderTaxRatePercentage,
93
+ Le as getProductPaymentProvider,
94
+ he as getTrialCheckoutMode,
95
+ Me as getTrialLabel,
96
+ _e as getTrialPaymentRequirementLabel,
97
+ we as getTrialPeriodDays,
98
+ Ge as getTrialSummary,
99
+ Ir as getVariantEffectivePriceRange,
100
+ ie as inferCurrencyCodeFromLocale,
101
+ De as isCustomerAddressComplete,
102
+ Oe as isDigitalItem,
103
+ ze as isDigitalProduct,
104
+ ne as isSaleWindowActive,
105
+ ce as isScheduledPriceDue,
106
+ ir as localizeInvoicePresentationData,
107
+ Dr as mapRawVariantRelations,
108
+ J as normalizeCouponCode,
109
+ me as normalizeCurrencyRecord,
110
+ ue as normalizeCurrencyRoundingMode,
111
+ be as normalizeCustomerAddress,
112
+ Ve as normalizeEnabledPaymentProviders,
113
+ er as normalizeInvoiceSettings,
114
+ Re as normalizeOrderCustomerDetails,
115
+ Je as normalizeOrderTaxDetails,
116
+ le as normalizePriceMap,
117
+ se as normalizeSalePriceMap,
118
+ br as normalizeSelectionsToAvailableVariants,
119
+ ur as productSchema,
120
+ Rr as resolveAttributeName,
121
+ de as resolveEffectivePriceForCurrency,
122
+ pe as resolvePriceForCurrency,
123
+ Ce as resolvePriceRangeForCurrency,
124
+ Ar as resolveTermValue,
125
+ Er as resolveTranslatedText,
126
+ rr as serializeInvoiceSettings,
127
+ fe as sortCurrencies,
128
+ nr as translateOrFallback,
129
+ cr as translateOrderStatus,
130
+ ye as useCart,
131
+ k as useCartStore,
132
+ B as useCartSubtotal,
133
+ K as useCartTotalItems,
134
+ Q as useCurrency,
135
+ Pe as useCurrencyPreferenceStore,
136
+ ve as useIsCartHydrated,
137
+ dr as useProduct
535
138
  };