@aglyn/plugins-commerce 1.0.0-beta.230 → 1.0.0-beta.232

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 (609) hide show
  1. package/package.json +13 -13
  2. package/src/index.d.ts +0 -1
  3. package/src/index.js +0 -1
  4. package/src/index.js.map +1 -1
  5. package/src/lib/barcode/barcode-decode.d.ts +71 -0
  6. package/src/lib/barcode/barcode-decode.js +498 -0
  7. package/src/lib/barcode/barcode-decode.js.map +1 -0
  8. package/src/lib/barcode/barcode-encode.d.ts +44 -0
  9. package/src/lib/barcode/barcode-encode.js +138 -0
  10. package/src/lib/barcode/barcode-encode.js.map +1 -0
  11. package/src/lib/barcode/barcode-scanner.component.d.ts +23 -0
  12. package/src/lib/barcode/barcode-scanner.component.js +260 -0
  13. package/src/lib/barcode/barcode-scanner.component.js.map +1 -0
  14. package/src/lib/barcode/scan-button.component.d.ts +10 -0
  15. package/src/lib/barcode/scan-button.component.js +62 -0
  16. package/src/lib/barcode/scan-button.component.js.map +1 -0
  17. package/src/lib/barcode/scanner-wedge.d.ts +35 -0
  18. package/src/lib/barcode/scanner-wedge.js +108 -0
  19. package/src/lib/barcode/scanner-wedge.js.map +1 -0
  20. package/src/lib/components/account.js +10 -1
  21. package/src/lib/components/account.js.map +1 -1
  22. package/src/lib/components/cart-extras.d.ts +45 -0
  23. package/src/lib/components/cart-extras.js +127 -0
  24. package/src/lib/components/cart-extras.js.map +1 -0
  25. package/src/lib/components/cart.js +82 -15
  26. package/src/lib/components/cart.js.map +1 -1
  27. package/src/lib/components/checkout-return-notice.d.ts +26 -0
  28. package/src/lib/components/checkout-return-notice.js +48 -0
  29. package/src/lib/components/checkout-return-notice.js.map +1 -0
  30. package/src/lib/components/commerce-console-page.js +124 -0
  31. package/src/lib/components/commerce-console-page.js.map +1 -1
  32. package/src/lib/components/commerce-console-sections.d.ts +1 -1
  33. package/src/lib/components/commerce-console-sections.js +4 -0
  34. package/src/lib/components/commerce-console-sections.js.map +1 -1
  35. package/src/lib/components/console/bulk-fulfill.d.ts +44 -0
  36. package/src/lib/components/console/bulk-fulfill.js +84 -0
  37. package/src/lib/components/console/bulk-fulfill.js.map +1 -0
  38. package/src/lib/components/console/catalog-organization-card.component.js +1 -0
  39. package/src/lib/components/console/catalog-organization-card.component.js.map +1 -1
  40. package/src/lib/components/console/customer-notifications-card.component.d.ts +19 -0
  41. package/src/lib/components/console/customer-notifications-card.component.js +149 -0
  42. package/src/lib/components/console/customer-notifications-card.component.js.map +1 -0
  43. package/src/lib/components/console/host-orders-card.component.js +88 -6
  44. package/src/lib/components/console/host-orders-card.component.js.map +1 -1
  45. package/src/lib/components/console/locations-card.component.js +164 -57
  46. package/src/lib/components/console/locations-card.component.js.map +1 -1
  47. package/src/lib/components/console/order-detail-dialog.component.js +209 -61
  48. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
  49. package/src/lib/components/console/order-fulfillment-panel.component.d.ts +48 -0
  50. package/src/lib/components/console/order-fulfillment-panel.component.js +542 -0
  51. package/src/lib/components/console/order-fulfillment-panel.component.js.map +1 -0
  52. package/src/lib/components/console/order-invoice.component.d.ts +33 -0
  53. package/src/lib/components/console/order-invoice.component.js +81 -0
  54. package/src/lib/components/console/order-invoice.component.js.map +1 -0
  55. package/src/lib/components/console/order-receipt-resend.component.d.ts +21 -0
  56. package/src/lib/components/console/order-receipt-resend.component.js +203 -0
  57. package/src/lib/components/console/order-receipt-resend.component.js.map +1 -0
  58. package/src/lib/components/console/order-returns.component.d.ts +36 -0
  59. package/src/lib/components/console/order-returns.component.js +142 -0
  60. package/src/lib/components/console/order-returns.component.js.map +1 -0
  61. package/src/lib/components/console/order-shipping-actions.component.d.ts +54 -0
  62. package/src/lib/components/console/order-shipping-actions.component.js +149 -0
  63. package/src/lib/components/console/order-shipping-actions.component.js.map +1 -0
  64. package/src/lib/components/console/order-webhooks-card.component.d.ts +50 -0
  65. package/src/lib/components/console/order-webhooks-card.component.js +623 -0
  66. package/src/lib/components/console/order-webhooks-card.component.js.map +1 -0
  67. package/src/lib/components/console/order-zones.d.ts +155 -0
  68. package/src/lib/components/console/order-zones.js +40 -0
  69. package/src/lib/components/console/order-zones.js.map +1 -0
  70. package/src/lib/components/console/payment-methods-card.component.d.ts +67 -0
  71. package/src/lib/components/console/payment-methods-card.component.js +395 -0
  72. package/src/lib/components/console/payment-methods-card.component.js.map +1 -0
  73. package/src/lib/components/console/pos/pos-api.d.ts +124 -0
  74. package/src/lib/components/console/pos/pos-api.js +101 -0
  75. package/src/lib/components/console/pos/pos-api.js.map +1 -0
  76. package/src/lib/components/console/pos/pos-cart-panel.component.d.ts +36 -0
  77. package/src/lib/components/console/pos/pos-cart-panel.component.js +160 -0
  78. package/src/lib/components/console/pos/pos-cart-panel.component.js.map +1 -0
  79. package/src/lib/components/console/pos/pos-item-dialog.component.d.ts +39 -0
  80. package/src/lib/components/console/pos/pos-item-dialog.component.js +352 -0
  81. package/src/lib/components/console/pos/pos-item-dialog.component.js.map +1 -0
  82. package/src/lib/components/console/pos/pos-product-grid.component.d.ts +47 -0
  83. package/src/lib/components/console/pos/pos-product-grid.component.js +272 -0
  84. package/src/lib/components/console/pos/pos-product-grid.component.js.map +1 -0
  85. package/src/lib/components/console/pos/pos-receipt-panel.component.d.ts +27 -0
  86. package/src/lib/components/console/pos/pos-receipt-panel.component.js +282 -0
  87. package/src/lib/components/console/pos/pos-receipt-panel.component.js.map +1 -0
  88. package/src/lib/components/console/pos/pos-tender-dialogs.component.d.ts +53 -0
  89. package/src/lib/components/console/pos/pos-tender-dialogs.component.js +445 -0
  90. package/src/lib/components/console/pos/pos-tender-dialogs.component.js.map +1 -0
  91. package/src/lib/components/console/pos/pos-tender-panel.component.d.ts +31 -0
  92. package/src/lib/components/console/pos/pos-tender-panel.component.js +640 -0
  93. package/src/lib/components/console/pos/pos-tender-panel.component.js.map +1 -0
  94. package/src/lib/components/console/pos/use-pos-display.d.ts +43 -0
  95. package/src/lib/components/console/pos/use-pos-display.js +161 -0
  96. package/src/lib/components/console/pos/use-pos-display.js.map +1 -0
  97. package/src/lib/components/console/pos-devices-card.component.d.ts +14 -0
  98. package/src/lib/components/console/pos-devices-card.component.js +546 -0
  99. package/src/lib/components/console/pos-devices-card.component.js.map +1 -0
  100. package/src/lib/components/console/pos-display/brand-screen.d.ts +33 -0
  101. package/src/lib/components/console/pos-display/brand-screen.js +85 -0
  102. package/src/lib/components/console/pos-display/brand-screen.js.map +1 -0
  103. package/src/lib/components/console/pos-display/cart-screen.d.ts +29 -0
  104. package/src/lib/components/console/pos-display/cart-screen.js +166 -0
  105. package/src/lib/components/console/pos-display/cart-screen.js.map +1 -0
  106. package/src/lib/components/console/pos-display/pairing-screen.d.ts +24 -0
  107. package/src/lib/components/console/pos-display/pairing-screen.js +127 -0
  108. package/src/lib/components/console/pos-display/pairing-screen.js.map +1 -0
  109. package/src/lib/components/console/pos-display/pos-display-api.d.ts +90 -0
  110. package/src/lib/components/console/pos-display/pos-display-api.js +140 -0
  111. package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -0
  112. package/src/lib/components/console/pos-display/receipt-screen.d.ts +35 -0
  113. package/src/lib/components/console/pos-display/receipt-screen.js +200 -0
  114. package/src/lib/components/console/pos-display/receipt-screen.js.map +1 -0
  115. package/src/lib/components/console/pos-display/tip-screen.d.ts +36 -0
  116. package/src/lib/components/console/pos-display/tip-screen.js +211 -0
  117. package/src/lib/components/console/pos-display/tip-screen.js.map +1 -0
  118. package/src/lib/components/console/pos-display-page.component.d.ts +16 -0
  119. package/src/lib/components/console/pos-display-page.component.js +407 -0
  120. package/src/lib/components/console/pos-display-page.component.js.map +1 -0
  121. package/src/lib/components/console/pos-ops/pos-customer-lookup.component.d.ts +40 -0
  122. package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js +289 -0
  123. package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js.map +1 -0
  124. package/src/lib/components/console/pos-ops/pos-last-receipt.component.d.ts +34 -0
  125. package/src/lib/components/console/pos-ops/pos-last-receipt.component.js +61 -0
  126. package/src/lib/components/console/pos-ops/pos-last-receipt.component.js.map +1 -0
  127. package/src/lib/components/console/pos-ops/pos-operations-bar.component.d.ts +38 -0
  128. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js +129 -0
  129. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js.map +1 -0
  130. package/src/lib/components/console/pos-ops/pos-ops-api.d.ts +37 -0
  131. package/src/lib/components/console/pos-ops/pos-ops-api.js +60 -0
  132. package/src/lib/components/console/pos-ops/pos-ops-api.js.map +1 -0
  133. package/src/lib/components/console/pos-ops/pos-pin-pad.component.d.ts +48 -0
  134. package/src/lib/components/console/pos-ops/pos-pin-pad.component.js +220 -0
  135. package/src/lib/components/console/pos-ops/pos-pin-pad.component.js.map +1 -0
  136. package/src/lib/components/console/pos-ops/pos-receipt-actions.component.d.ts +63 -0
  137. package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js +186 -0
  138. package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js.map +1 -0
  139. package/src/lib/components/console/pos-ops/pos-receipt.d.ts +39 -0
  140. package/src/lib/components/console/pos-ops/pos-receipt.js +182 -0
  141. package/src/lib/components/console/pos-ops/pos-receipt.js.map +1 -0
  142. package/src/lib/components/console/pos-ops/pos-return-dialog.component.d.ts +40 -0
  143. package/src/lib/components/console/pos-ops/pos-return-dialog.component.js +465 -0
  144. package/src/lib/components/console/pos-ops/pos-return-dialog.component.js.map +1 -0
  145. package/src/lib/components/console/pos-ops/pos-shift-history-card.component.d.ts +29 -0
  146. package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js +253 -0
  147. package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js.map +1 -0
  148. package/src/lib/components/console/pos-ops/pos-shift-panel.component.d.ts +34 -0
  149. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js +494 -0
  150. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js.map +1 -0
  151. package/src/lib/components/console/pos-ops/pos-shift-report.component.d.ts +37 -0
  152. package/src/lib/components/console/pos-ops/pos-shift-report.component.js +102 -0
  153. package/src/lib/components/console/pos-ops/pos-shift-report.component.js.map +1 -0
  154. package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.d.ts +30 -0
  155. package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js +277 -0
  156. package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js.map +1 -0
  157. package/src/lib/components/console/pos-ops/register-ops.d.ts +28 -0
  158. package/src/lib/components/console/pos-ops/register-ops.js +28 -0
  159. package/src/lib/components/console/pos-ops/register-ops.js.map +1 -0
  160. package/src/lib/components/console/pos-ops/use-pos-cashier.d.ts +46 -0
  161. package/src/lib/components/console/pos-ops/use-pos-cashier.js +128 -0
  162. package/src/lib/components/console/pos-ops/use-pos-cashier.js.map +1 -0
  163. package/src/lib/components/console/pos-ops/use-pos-sale-receipt.d.ts +36 -0
  164. package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js +64 -0
  165. package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js.map +1 -0
  166. package/src/lib/components/console/pos-page.component.d.ts +13 -5
  167. package/src/lib/components/console/pos-page.component.js +756 -654
  168. package/src/lib/components/console/pos-page.component.js.map +1 -1
  169. package/src/lib/components/console/pos-zones.d.ts +23 -0
  170. package/src/lib/components/console/pos-zones.js +31 -0
  171. package/src/lib/components/console/pos-zones.js.map +1 -0
  172. package/src/lib/components/console/product-editor-dialog.component.js +61 -71
  173. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
  174. package/src/lib/components/console/product-labels-dialog.component.d.ts +13 -0
  175. package/src/lib/components/console/product-labels-dialog.component.js +197 -0
  176. package/src/lib/components/console/product-labels-dialog.component.js.map +1 -0
  177. package/src/lib/components/console/product-register-fields.component.d.ts +19 -0
  178. package/src/lib/components/console/product-register-fields.component.js +241 -0
  179. package/src/lib/components/console/product-register-fields.component.js.map +1 -0
  180. package/src/lib/components/console/product-zones.d.ts +44 -0
  181. package/src/lib/components/console/product-zones.js.map +1 -1
  182. package/src/lib/components/console/products-hub-card.component.js +23 -20
  183. package/src/lib/components/console/products-hub-card.component.js.map +1 -1
  184. package/src/lib/components/console/register-hardware-card.component.d.ts +33 -0
  185. package/src/lib/components/console/register-hardware-card.component.js +826 -0
  186. package/src/lib/components/console/register-hardware-card.component.js.map +1 -0
  187. package/src/lib/components/console/registers-card.component.js +24 -5
  188. package/src/lib/components/console/registers-card.component.js.map +1 -1
  189. package/src/lib/components/console/return-actions.d.ts +38 -0
  190. package/src/lib/components/console/return-actions.js +76 -0
  191. package/src/lib/components/console/return-actions.js.map +1 -0
  192. package/src/lib/components/console/return-detail-dialog.component.d.ts +34 -0
  193. package/src/lib/components/console/return-detail-dialog.component.js +718 -0
  194. package/src/lib/components/console/return-detail-dialog.component.js.map +1 -0
  195. package/src/lib/components/console/return-settings-card.component.d.ts +34 -0
  196. package/src/lib/components/console/return-settings-card.component.js +195 -0
  197. package/src/lib/components/console/return-settings-card.component.js.map +1 -0
  198. package/src/lib/components/console/return-zones.d.ts +87 -0
  199. package/src/lib/components/console/return-zones.js +31 -0
  200. package/src/lib/components/console/return-zones.js.map +1 -0
  201. package/src/lib/components/console/returns-card.component.d.ts +45 -0
  202. package/src/lib/components/console/returns-card.component.js +159 -0
  203. package/src/lib/components/console/returns-card.component.js.map +1 -0
  204. package/src/lib/components/console/shipping-settings-card.component.js +161 -5
  205. package/src/lib/components/console/shipping-settings-card.component.js.map +1 -1
  206. package/src/lib/components/console/shippingeasy-card.component.d.ts +59 -0
  207. package/src/lib/components/console/shippingeasy-card.component.js +378 -0
  208. package/src/lib/components/console/shippingeasy-card.component.js.map +1 -0
  209. package/src/lib/components/console/shipstation-card.component.d.ts +35 -0
  210. package/src/lib/components/console/shipstation-card.component.js +345 -0
  211. package/src/lib/components/console/shipstation-card.component.js.map +1 -0
  212. package/src/lib/components/console/start-return-dialog.component.d.ts +40 -0
  213. package/src/lib/components/console/start-return-dialog.component.js +243 -0
  214. package/src/lib/components/console/start-return-dialog.component.js.map +1 -0
  215. package/src/lib/components/console/stock-movements-card.component.js +2 -1
  216. package/src/lib/components/console/stock-movements-card.component.js.map +1 -1
  217. package/src/lib/components/console/store-settings-card.component.js +2 -66
  218. package/src/lib/components/console/store-settings-card.component.js.map +1 -1
  219. package/src/lib/components/console/store-zones.d.ts +42 -0
  220. package/src/lib/components/console/store-zones.js +39 -0
  221. package/src/lib/components/console/store-zones.js.map +1 -0
  222. package/src/lib/components/console/storefront-tax-summary-card.component.js +1 -0
  223. package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -1
  224. package/src/lib/components/order-status.d.ts +36 -0
  225. package/src/lib/components/order-status.js +502 -0
  226. package/src/lib/components/order-status.js.map +1 -0
  227. package/src/lib/components/product-detail.js +41 -2
  228. package/src/lib/components/product-detail.js.map +1 -1
  229. package/src/lib/components/return-request.d.ts +32 -0
  230. package/src/lib/components/return-request.js +576 -0
  231. package/src/lib/components/return-request.js.map +1 -0
  232. package/src/lib/components/storefront-payment-appearance.d.ts +32 -0
  233. package/src/lib/components/storefront-payment-appearance.js +114 -0
  234. package/src/lib/components/storefront-payment-appearance.js.map +1 -0
  235. package/src/lib/components/storefront-payment-element.d.ts +57 -1
  236. package/src/lib/components/storefront-payment-element.js +332 -33
  237. package/src/lib/components/storefront-payment-element.js.map +1 -1
  238. package/src/lib/constants/order-status.d.ts +22 -0
  239. package/src/lib/constants/order-status.js +22 -0
  240. package/src/lib/constants/order-status.js.map +1 -0
  241. package/src/lib/constants/return-request.d.ts +27 -0
  242. package/src/lib/constants/return-request.js +32 -0
  243. package/src/lib/constants/return-request.js.map +1 -0
  244. package/src/lib/constants/stock-movement-query.js +2 -1
  245. package/src/lib/constants/stock-movement-query.js.map +1 -1
  246. package/src/lib/declarations.console-server.js +9 -0
  247. package/src/lib/declarations.console-server.js.map +1 -1
  248. package/src/lib/declarations.server.d.ts +2 -1
  249. package/src/lib/declarations.server.js +68 -1
  250. package/src/lib/declarations.server.js.map +1 -1
  251. package/src/lib/model/buyer-notifications.d.ts +59 -0
  252. package/src/lib/model/buyer-notifications.js +97 -0
  253. package/src/lib/model/buyer-notifications.js.map +1 -0
  254. package/src/lib/model/commerce-orders.d.ts +171 -2
  255. package/src/lib/model/commerce-orders.js +26 -16
  256. package/src/lib/model/commerce-orders.js.map +1 -1
  257. package/src/lib/model/commerce-payment-methods.d.ts +146 -0
  258. package/src/lib/model/commerce-payment-methods.js +247 -0
  259. package/src/lib/model/commerce-payment-methods.js.map +1 -0
  260. package/src/lib/model/commerce-pos-ops.d.ts +437 -0
  261. package/src/lib/model/commerce-pos-ops.js +721 -0
  262. package/src/lib/model/commerce-pos-ops.js.map +1 -0
  263. package/src/lib/model/commerce-pos.d.ts +263 -0
  264. package/src/lib/model/commerce-pos.js +375 -0
  265. package/src/lib/model/commerce-pos.js.map +1 -0
  266. package/src/lib/model/commerce-printers.d.ts +211 -0
  267. package/src/lib/model/commerce-printers.js +181 -0
  268. package/src/lib/model/commerce-printers.js.map +1 -0
  269. package/src/lib/model/commerce-receipt.d.ts +97 -0
  270. package/src/lib/model/commerce-receipt.js +180 -0
  271. package/src/lib/model/commerce-receipt.js.map +1 -0
  272. package/src/lib/model/commerce-returns.d.ts +207 -0
  273. package/src/lib/model/commerce-returns.js +300 -0
  274. package/src/lib/model/commerce-returns.js.map +1 -0
  275. package/src/lib/model/commerce-shipping.d.ts +44 -1
  276. package/src/lib/model/commerce-shipping.js +53 -9
  277. package/src/lib/model/commerce-shipping.js.map +1 -1
  278. package/src/lib/model/commerce-tax-engine.d.ts +90 -0
  279. package/src/lib/model/commerce-tax-engine.js +129 -0
  280. package/src/lib/model/commerce-tax-engine.js.map +1 -0
  281. package/src/lib/model/commerce.d.ts +91 -2
  282. package/src/lib/model/commerce.js +89 -1
  283. package/src/lib/model/commerce.js.map +1 -1
  284. package/src/lib/model/index.d.ts +16 -0
  285. package/src/lib/model/index.js +16 -0
  286. package/src/lib/model/index.js.map +1 -1
  287. package/src/lib/model/order-events.d.ts +154 -0
  288. package/src/lib/model/order-events.js +153 -0
  289. package/src/lib/model/order-events.js.map +1 -0
  290. package/src/lib/model/order-fulfillment.d.ts +117 -0
  291. package/src/lib/model/order-fulfillment.js +217 -0
  292. package/src/lib/model/order-fulfillment.js.map +1 -0
  293. package/src/lib/model/order-history.d.ts +58 -0
  294. package/src/lib/model/order-history.js +22 -0
  295. package/src/lib/model/order-history.js.map +1 -0
  296. package/src/lib/model/order-list-fields.d.ts +9 -1
  297. package/src/lib/model/order-list-fields.js +7 -1
  298. package/src/lib/model/order-list-fields.js.map +1 -1
  299. package/src/lib/model/order-shipping-export.d.ts +91 -0
  300. package/src/lib/model/order-shipping-export.js +192 -0
  301. package/src/lib/model/order-shipping-export.js.map +1 -0
  302. package/src/lib/model/order-status-view.d.ts +103 -0
  303. package/src/lib/model/order-status-view.js +156 -0
  304. package/src/lib/model/order-status-view.js.map +1 -0
  305. package/src/lib/model/order-webhooks.d.ts +142 -0
  306. package/src/lib/model/order-webhooks.js +91 -0
  307. package/src/lib/model/order-webhooks.js.map +1 -0
  308. package/src/lib/model/product-channel.d.ts +56 -0
  309. package/src/lib/model/product-channel.js +86 -0
  310. package/src/lib/model/product-channel.js.map +1 -0
  311. package/src/lib/model/product-modifiers.d.ts +80 -0
  312. package/src/lib/model/product-modifiers.js +140 -0
  313. package/src/lib/model/product-modifiers.js.map +1 -0
  314. package/src/lib/model/product-write.d.ts +186 -0
  315. package/src/lib/model/product-write.js +116 -0
  316. package/src/lib/model/product-write.js.map +1 -0
  317. package/src/lib/model/shippingeasy.d.ts +94 -0
  318. package/src/lib/model/shippingeasy.js +267 -0
  319. package/src/lib/model/shippingeasy.js.map +1 -0
  320. package/src/lib/model/shipstation.d.ts +125 -0
  321. package/src/lib/model/shipstation.js +399 -0
  322. package/src/lib/model/shipstation.js.map +1 -0
  323. package/src/lib/model/smart-collection-reads.d.ts +32 -0
  324. package/src/lib/model/smart-collection-reads.js +63 -0
  325. package/src/lib/model/smart-collection-reads.js.map +1 -0
  326. package/src/lib/model/tracking-url.d.ts +74 -0
  327. package/src/lib/model/tracking-url.js +159 -0
  328. package/src/lib/model/tracking-url.js.map +1 -0
  329. package/src/lib/plugin-config.d.ts +13 -0
  330. package/src/lib/plugin-config.js +77 -5
  331. package/src/lib/plugin-config.js.map +1 -1
  332. package/src/lib/plugin.js +26 -0
  333. package/src/lib/plugin.js.map +1 -1
  334. package/src/lib/pos-ops-config.d.ts +39 -0
  335. package/src/lib/pos-ops-config.js +88 -0
  336. package/src/lib/pos-ops-config.js.map +1 -0
  337. package/src/lib/printing/print-document.d.ts +106 -0
  338. package/src/lib/printing/print-document.js +464 -0
  339. package/src/lib/printing/print-document.js.map +1 -0
  340. package/src/lib/printing/product-labels.d.ts +58 -0
  341. package/src/lib/printing/product-labels.js +116 -0
  342. package/src/lib/printing/product-labels.js.map +1 -0
  343. package/src/lib/printing/render-epson.d.ts +57 -0
  344. package/src/lib/printing/render-epson.js +135 -0
  345. package/src/lib/printing/render-epson.js.map +1 -0
  346. package/src/lib/printing/render-star.d.ts +45 -0
  347. package/src/lib/printing/render-star.js +100 -0
  348. package/src/lib/printing/render-star.js.map +1 -0
  349. package/src/lib/printing/render-text.d.ts +25 -0
  350. package/src/lib/printing/render-text.js +53 -0
  351. package/src/lib/printing/render-text.js.map +1 -0
  352. package/src/lib/server/api-v1/openapi.js +27 -4
  353. package/src/lib/server/api-v1/openapi.js.map +1 -1
  354. package/src/lib/server/api-v1/order-view.d.ts +67 -0
  355. package/src/lib/server/api-v1/order-view.js +120 -0
  356. package/src/lib/server/api-v1/order-view.js.map +1 -0
  357. package/src/lib/server/api-v1/orders-and-products.js +58 -65
  358. package/src/lib/server/api-v1/orders-and-products.js.map +1 -1
  359. package/src/lib/server/billing-webhook.js +135 -28
  360. package/src/lib/server/billing-webhook.js.map +1 -1
  361. package/src/lib/server/cancel-order.js +29 -0
  362. package/src/lib/server/cancel-order.js.map +1 -1
  363. package/src/lib/server/carrier-rates-availability.d.ts +26 -0
  364. package/src/lib/server/carrier-rates-availability.js +76 -0
  365. package/src/lib/server/carrier-rates-availability.js.map +1 -0
  366. package/src/lib/server/carrier-shipping.d.ts +84 -0
  367. package/src/lib/server/carrier-shipping.js +135 -0
  368. package/src/lib/server/carrier-shipping.js.map +1 -0
  369. package/src/lib/server/cart-checkout.d.ts +2 -0
  370. package/src/lib/server/cart-checkout.js +226 -22
  371. package/src/lib/server/cart-checkout.js.map +1 -1
  372. package/src/lib/server/channel-order-updates.d.ts +50 -0
  373. package/src/lib/server/channel-order-updates.js +290 -0
  374. package/src/lib/server/channel-order-updates.js.map +1 -0
  375. package/src/lib/server/channel-orders.d.ts +85 -0
  376. package/src/lib/server/channel-orders.js +543 -0
  377. package/src/lib/server/channel-orders.js.map +1 -0
  378. package/src/lib/server/checkout-extras.d.ts +64 -0
  379. package/src/lib/server/checkout-extras.js +157 -0
  380. package/src/lib/server/checkout-extras.js.map +1 -0
  381. package/src/lib/server/{feed.d.ts → checkout-status.d.ts} +2 -7
  382. package/src/lib/server/checkout-status.js +111 -0
  383. package/src/lib/server/checkout-status.js.map +1 -0
  384. package/src/lib/server/checkout.js +86 -9
  385. package/src/lib/server/checkout.js.map +1 -1
  386. package/src/lib/server/draft-order.js +34 -5
  387. package/src/lib/server/draft-order.js.map +1 -1
  388. package/src/lib/server/fulfill-order.d.ts +127 -10
  389. package/src/lib/server/fulfill-order.js +451 -49
  390. package/src/lib/server/fulfill-order.js.map +1 -1
  391. package/src/lib/server/legacy-feed.d.ts +28 -0
  392. package/src/lib/server/legacy-feed.js +52 -0
  393. package/src/lib/server/legacy-feed.js.map +1 -0
  394. package/src/lib/server/native-checkout.d.ts +34 -15
  395. package/src/lib/server/native-checkout.js +32 -17
  396. package/src/lib/server/native-checkout.js.map +1 -1
  397. package/src/lib/server/order-event-host-emit.d.ts +23 -0
  398. package/src/lib/server/order-event-host-emit.js +30 -0
  399. package/src/lib/server/order-event-host-emit.js.map +1 -0
  400. package/src/lib/server/order-event-triggers.d.ts +37 -0
  401. package/src/lib/server/order-event-triggers.js +119 -0
  402. package/src/lib/server/order-event-triggers.js.map +1 -0
  403. package/src/lib/server/order-events.d.ts +62 -0
  404. package/src/lib/server/order-events.js +109 -0
  405. package/src/lib/server/order-events.js.map +1 -0
  406. package/src/lib/server/order-history.d.ts +23 -0
  407. package/src/lib/server/order-history.js +65 -0
  408. package/src/lib/server/order-history.js.map +1 -0
  409. package/src/lib/server/order-notifications.d.ts +185 -0
  410. package/src/lib/server/order-notifications.js +567 -0
  411. package/src/lib/server/order-notifications.js.map +1 -0
  412. package/src/lib/server/order-receipt-send.d.ts +39 -0
  413. package/src/lib/server/order-receipt-send.js +151 -0
  414. package/src/lib/server/order-receipt-send.js.map +1 -0
  415. package/src/lib/server/order-status-token.d.ts +31 -0
  416. package/src/lib/server/order-status-token.js +75 -0
  417. package/src/lib/server/order-status-token.js.map +1 -0
  418. package/src/lib/server/order-status.d.ts +58 -0
  419. package/src/lib/server/order-status.js +141 -0
  420. package/src/lib/server/order-status.js.map +1 -0
  421. package/src/lib/server/order-webhooks.d.ts +108 -0
  422. package/src/lib/server/order-webhooks.js +622 -0
  423. package/src/lib/server/order-webhooks.js.map +1 -0
  424. package/src/lib/server/orders-shipping-prepare.d.ts +26 -0
  425. package/src/lib/server/orders-shipping-prepare.js +121 -0
  426. package/src/lib/server/orders-shipping-prepare.js.map +1 -0
  427. package/src/lib/server/payment-method-domains.d.ts +209 -0
  428. package/src/lib/server/payment-method-domains.js +444 -0
  429. package/src/lib/server/payment-method-domains.js.map +1 -0
  430. package/src/lib/server/payment-methods.d.ts +77 -0
  431. package/src/lib/server/payment-methods.js +284 -0
  432. package/src/lib/server/payment-methods.js.map +1 -0
  433. package/src/lib/server/pos-auth.d.ts +50 -0
  434. package/src/lib/server/pos-auth.js +121 -0
  435. package/src/lib/server/pos-auth.js.map +1 -0
  436. package/src/lib/server/pos-customer.d.ts +49 -0
  437. package/src/lib/server/pos-customer.js +257 -0
  438. package/src/lib/server/pos-customer.js.map +1 -0
  439. package/src/lib/server/pos-display.d.ts +57 -0
  440. package/src/lib/server/pos-display.js +419 -0
  441. package/src/lib/server/pos-display.js.map +1 -0
  442. package/src/lib/server/pos-fee-month.d.ts +34 -0
  443. package/src/lib/server/pos-fee-month.js +36 -0
  444. package/src/lib/server/pos-fee-month.js.map +1 -0
  445. package/src/lib/server/pos-ops-gate.d.ts +161 -0
  446. package/src/lib/server/pos-ops-gate.js +295 -0
  447. package/src/lib/server/pos-ops-gate.js.map +1 -0
  448. package/src/lib/server/pos-ops-routes.d.ts +22 -0
  449. package/src/lib/server/pos-ops-routes.js +36 -0
  450. package/src/lib/server/pos-ops-routes.js.map +1 -0
  451. package/src/lib/server/pos-order.d.ts +1 -18
  452. package/src/lib/server/pos-order.js +222 -42
  453. package/src/lib/server/pos-order.js.map +1 -1
  454. package/src/lib/server/pos-payment.d.ts +39 -0
  455. package/src/lib/server/pos-payment.js +922 -0
  456. package/src/lib/server/pos-payment.js.map +1 -0
  457. package/src/lib/server/pos-print.d.ts +82 -0
  458. package/src/lib/server/pos-print.js +193 -0
  459. package/src/lib/server/pos-print.js.map +1 -0
  460. package/src/lib/server/pos-readers.d.ts +27 -0
  461. package/src/lib/server/pos-readers.js +276 -0
  462. package/src/lib/server/pos-readers.js.map +1 -0
  463. package/src/lib/server/pos-refund-authority.d.ts +60 -0
  464. package/src/lib/server/pos-refund-authority.js +72 -0
  465. package/src/lib/server/pos-refund-authority.js.map +1 -0
  466. package/src/lib/server/pos-return.d.ts +58 -0
  467. package/src/lib/server/pos-return.js +891 -0
  468. package/src/lib/server/pos-return.js.map +1 -0
  469. package/src/lib/server/pos-sale-stamp.d.ts +66 -0
  470. package/src/lib/server/pos-sale-stamp.js +84 -0
  471. package/src/lib/server/pos-sale-stamp.js.map +1 -0
  472. package/src/lib/server/pos-sale.d.ts +170 -0
  473. package/src/lib/server/pos-sale.js +461 -0
  474. package/src/lib/server/pos-sale.js.map +1 -0
  475. package/src/lib/server/pos-shift.d.ts +45 -0
  476. package/src/lib/server/pos-shift.js +484 -0
  477. package/src/lib/server/pos-shift.js.map +1 -0
  478. package/src/lib/server/pos-staff-pin.d.ts +26 -0
  479. package/src/lib/server/pos-staff-pin.js +339 -0
  480. package/src/lib/server/pos-staff-pin.js.map +1 -0
  481. package/src/lib/server/pos-stripe.d.ts +91 -0
  482. package/src/lib/server/pos-stripe.js +129 -0
  483. package/src/lib/server/pos-stripe.js.map +1 -0
  484. package/src/lib/server/pos-terminal-connection-token.d.ts +48 -0
  485. package/src/lib/server/pos-terminal-connection-token.js +166 -0
  486. package/src/lib/server/pos-terminal-connection-token.js.map +1 -0
  487. package/src/lib/server/pos-terminal.d.ts +218 -0
  488. package/src/lib/server/pos-terminal.js +1014 -0
  489. package/src/lib/server/pos-terminal.js.map +1 -0
  490. package/src/lib/server/print-queue.d.ts +124 -0
  491. package/src/lib/server/print-queue.js +301 -0
  492. package/src/lib/server/print-queue.js.map +1 -0
  493. package/src/lib/server/printer-poll.d.ts +75 -0
  494. package/src/lib/server/printer-poll.js +325 -0
  495. package/src/lib/server/printer-poll.js.map +1 -0
  496. package/src/lib/server/printer-secret.d.ts +39 -0
  497. package/src/lib/server/printer-secret.js +56 -0
  498. package/src/lib/server/printer-secret.js.map +1 -0
  499. package/src/lib/server/printers.d.ts +114 -0
  500. package/src/lib/server/printers.js +546 -0
  501. package/src/lib/server/printers.js.map +1 -0
  502. package/src/lib/server/product-catalog.d.ts +42 -0
  503. package/src/lib/server/product-catalog.js +309 -0
  504. package/src/lib/server/product-catalog.js.map +1 -0
  505. package/src/lib/server/product-drafts.d.ts +5 -1
  506. package/src/lib/server/product-drafts.js +3 -3
  507. package/src/lib/server/product-drafts.js.map +1 -1
  508. package/src/lib/server/product-writer.d.ts +19 -0
  509. package/src/lib/server/product-writer.js +261 -0
  510. package/src/lib/server/product-writer.js.map +1 -0
  511. package/src/lib/server/products-write.d.ts +61 -0
  512. package/src/lib/server/products-write.js +375 -0
  513. package/src/lib/server/products-write.js.map +1 -0
  514. package/src/lib/server/refund.js +110 -45
  515. package/src/lib/server/refund.js.map +1 -1
  516. package/src/lib/server/reserve.js +2 -0
  517. package/src/lib/server/reserve.js.map +1 -1
  518. package/src/lib/server/return-status-action.d.ts +37 -0
  519. package/src/lib/server/return-status-action.js +57 -0
  520. package/src/lib/server/return-status-action.js.map +1 -0
  521. package/src/lib/server/returns.d.ts +119 -0
  522. package/src/lib/server/returns.js +938 -0
  523. package/src/lib/server/returns.js.map +1 -0
  524. package/src/lib/server/shipment-records.d.ts +36 -0
  525. package/src/lib/server/shipment-records.js +289 -0
  526. package/src/lib/server/shipment-records.js.map +1 -0
  527. package/src/lib/server/shipping-connector-gates.d.ts +40 -0
  528. package/src/lib/server/shipping-connector-gates.js +97 -0
  529. package/src/lib/server/shipping-connector-gates.js.map +1 -0
  530. package/src/lib/server/shipping-connectors.d.ts +29 -0
  531. package/src/lib/server/shipping-connectors.js +236 -0
  532. package/src/lib/server/shipping-connectors.js.map +1 -0
  533. package/src/lib/server/shippingeasy.d.ts +238 -0
  534. package/src/lib/server/shippingeasy.js +787 -0
  535. package/src/lib/server/shippingeasy.js.map +1 -0
  536. package/src/lib/server/shipstation.d.ts +129 -0
  537. package/src/lib/server/shipstation.js +483 -0
  538. package/src/lib/server/shipstation.js.map +1 -0
  539. package/src/lib/server/site-page-resolver.d.ts +5 -0
  540. package/src/lib/server/site-page-resolver.js +156 -1
  541. package/src/lib/server/site-page-resolver.js.map +1 -1
  542. package/src/lib/server/stock-levels.d.ts +21 -0
  543. package/src/lib/server/stock-levels.js +263 -0
  544. package/src/lib/server/stock-levels.js.map +1 -0
  545. package/src/lib/server/stripe-refund.d.ts +47 -0
  546. package/src/lib/server/stripe-refund.js +87 -0
  547. package/src/lib/server/stripe-refund.js.map +1 -0
  548. package/src/lib/server/supplier-update.js +46 -5
  549. package/src/lib/server/supplier-update.js.map +1 -1
  550. package/src/lib/server/tax-engine-quote.d.ts +47 -0
  551. package/src/lib/server/tax-engine-quote.js +105 -0
  552. package/src/lib/server/tax-engine-quote.js.map +1 -0
  553. package/src/lib/server.js +143 -2
  554. package/src/lib/server.js.map +1 -1
  555. package/src/lib/site.js +12 -0
  556. package/src/lib/site.js.map +1 -1
  557. package/src/lib/subprocessors.d.ts +26 -0
  558. package/src/lib/subprocessors.js +50 -0
  559. package/src/lib/subprocessors.js.map +1 -0
  560. package/src/lib/tenant-emails.js +461 -3
  561. package/src/lib/tenant-emails.js.map +1 -1
  562. package/src/lib/testing/fake-firestore.d.ts +45 -0
  563. package/src/lib/testing/fake-firestore.js +189 -0
  564. package/src/lib/testing/fake-firestore.js.map +1 -0
  565. package/src/lib/testing/memory-firestore.d.ts +136 -0
  566. package/src/lib/testing/memory-firestore.js +282 -0
  567. package/src/lib/testing/memory-firestore.js.map +1 -0
  568. package/src/lib/testing/pos-ops-harness.d.ts +50 -0
  569. package/src/lib/testing/pos-ops-harness.js +184 -0
  570. package/src/lib/testing/pos-ops-harness.js.map +1 -0
  571. package/src/lib/testing/pos-ops-memory-firestore.d.ts +55 -0
  572. package/src/lib/testing/pos-ops-memory-firestore.js +376 -0
  573. package/src/lib/testing/pos-ops-memory-firestore.js.map +1 -0
  574. package/src/lib/transfer/products.server.d.ts +5 -0
  575. package/src/lib/transfer/products.server.js +2 -2
  576. package/src/lib/transfer/products.server.js.map +1 -1
  577. package/src/lib/transfer/records-transfer.d.ts +11 -1
  578. package/src/lib/transfer/records-transfer.js +127 -5
  579. package/src/lib/transfer/records-transfer.js.map +1 -1
  580. package/src/lib/transfer/records.server.d.ts +9 -2
  581. package/src/lib/transfer/records.server.js +58 -7
  582. package/src/lib/transfer/records.server.js.map +1 -1
  583. package/src/lib/transfer/register-transfer-resources.js +40 -1
  584. package/src/lib/transfer/register-transfer-resources.js.map +1 -1
  585. package/src/lib/transfer/register-transfer-ui.js +4 -1
  586. package/src/lib/transfer/register-transfer-ui.js.map +1 -1
  587. package/src/lib/transfer/shipping-presets.d.ts +23 -0
  588. package/src/lib/transfer/shipping-presets.js +156 -0
  589. package/src/lib/transfer/shipping-presets.js.map +1 -0
  590. package/src/lib/transfer/tracking-transfer.d.ts +101 -0
  591. package/src/lib/transfer/tracking-transfer.js +546 -0
  592. package/src/lib/transfer/tracking-transfer.js.map +1 -0
  593. package/src/lib/transfer/tracking.server.d.ts +37 -0
  594. package/src/lib/transfer/tracking.server.js +393 -0
  595. package/src/lib/transfer/tracking.server.js.map +1 -0
  596. package/src/lib/transfer/transfer-keys.d.ts +2 -1
  597. package/src/lib/transfer/transfer-keys.js +6 -2
  598. package/src/lib/transfer/transfer-keys.js.map +1 -1
  599. package/src/lib/utils/code128.d.ts +37 -0
  600. package/src/lib/utils/code128.js +199 -0
  601. package/src/lib/utils/code128.js.map +1 -0
  602. package/src/lib/utils/order-invoice.d.ts +55 -0
  603. package/src/lib/utils/order-invoice.js +127 -0
  604. package/src/lib/utils/order-invoice.js.map +1 -0
  605. package/src/lib/utils/use-checkout-return-notice.d.ts +34 -0
  606. package/src/lib/utils/use-checkout-return-notice.js +78 -0
  607. package/src/lib/utils/use-checkout-return-notice.js.map +1 -0
  608. package/src/lib/server/feed.js +0 -69
  609. package/src/lib/server/feed.js.map +0 -1
@@ -19,7 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  // Checkout Sessions provider, its hook and its own `PaymentElement` there, and
20
20
  // the main entry's `PaymentElement` is the Elements one, which does not mount
21
21
  // under a Checkout provider.
22
- import { CheckoutElementsProvider, PaymentElement, useCheckoutElements } from "@stripe/react-stripe-js/checkout";
22
+ import { CheckoutElementsProvider, PaymentElement, ShippingAddressElement, useCheckoutElements } from "@stripe/react-stripe-js/checkout";
23
23
  // `/pure` deliberately, not the bare entry (AGL-2486). The bare entry ends
24
24
  // with a module-scope `Promise.resolve().then(() => getStripePromise())`,
25
25
  // so merely EVALUATING it injects the js.stripe.com/v3 script tag —
@@ -30,7 +30,16 @@ import { loadStripe } from "@stripe/stripe-js/pure";
30
30
  import Alert from "@mui/material/Alert";
31
31
  import Box from "@mui/material/Box";
32
32
  import Button from "@mui/material/Button";
33
- import { useCallback, useMemo, useState } from "react";
33
+ import CircularProgress from "@mui/material/CircularProgress";
34
+ import Divider from "@mui/material/Divider";
35
+ import FormControlLabel from "@mui/material/FormControlLabel";
36
+ import Radio from "@mui/material/Radio";
37
+ import RadioGroup from "@mui/material/RadioGroup";
38
+ import TextField from "@mui/material/TextField";
39
+ import Typography from "@mui/material/Typography";
40
+ import { useTheme } from "@mui/material/styles";
41
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
42
+ import { storefrontPaymentAppearance, storefrontPaymentFonts } from "./storefront-payment-appearance.js";
34
43
  /**
35
44
  * `loadStripe` injects a script tag, so it is memoized per key rather than
36
45
  * called per render. Keyed because a page could in principle mount this for
@@ -48,13 +57,167 @@ function getStripe(publishableKey) {
48
57
  /** Test seam: `loadStripe` caches per key across a file's tests otherwise. */ export function __resetStripePromises() {
49
58
  stripePromises.clear();
50
59
  }
51
- function PaymentForm({ payLabel, onCancel }) {
60
+ const GENERIC_FAILURE = 'That payment could not be completed. Try another card.';
61
+ /** How long the address must sit still before the session re-prices on it. */ const ADDRESS_SETTLE_MS = 400;
62
+ function SummaryRow({ label, value, strong }) {
63
+ return /*#__PURE__*/ _jsxs(Box, {
64
+ sx: {
65
+ display: 'flex',
66
+ justifyContent: 'space-between',
67
+ gap: 2
68
+ },
69
+ children: [
70
+ /*#__PURE__*/ _jsx(Typography, {
71
+ variant: strong ? 'subtitle1' : 'body2',
72
+ color: strong ? 'text.primary' : 'text.secondary',
73
+ children: label
74
+ }),
75
+ /*#__PURE__*/ _jsx(Typography, {
76
+ variant: strong ? 'subtitle1' : 'body2',
77
+ children: value
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ function SessionNotice({ message, onCancel, onRestart }) {
83
+ return /*#__PURE__*/ _jsxs(Box, {
84
+ sx: {
85
+ display: 'flex',
86
+ flexDirection: 'column',
87
+ gap: 2
88
+ },
89
+ children: [
90
+ /*#__PURE__*/ _jsx(Alert, {
91
+ severity: "error",
92
+ role: "alert",
93
+ children: message
94
+ }),
95
+ /*#__PURE__*/ _jsxs(Box, {
96
+ sx: {
97
+ display: 'flex',
98
+ gap: 1
99
+ },
100
+ children: [
101
+ onRestart ? /*#__PURE__*/ _jsx(Button, {
102
+ variant: "contained",
103
+ onClick: onRestart,
104
+ children: 'Start checkout again'
105
+ }) : null,
106
+ onCancel ? /*#__PURE__*/ _jsx(Button, {
107
+ variant: "text",
108
+ onClick: onCancel,
109
+ children: 'Back to the store'
110
+ }) : null
111
+ ]
112
+ })
113
+ ]
114
+ });
115
+ }
116
+ function PaymentForm({ payLabel, defaultEmail, onCancel, onRestart, wallets }) {
117
+ var _ref, _ref1, _ref2;
118
+ var _checkout_shipping_shippingOption, _checkout_shipping, _checkout_status, _checkout_status1, _total_discount, _total_taxExclusive, _checkout_tax;
52
119
  // A `{ type: 'loading' | 'success' | 'error' }` union since react-stripe-js
53
120
  // v6: the session is not usable until Stripe.js has booted against it.
54
121
  const checkoutState = useCheckoutElements();
55
122
  const checkout = checkoutState.type === 'success' ? checkoutState.checkout : null;
56
123
  const [status, setStatus] = useState('idle');
57
124
  const [message, setMessage] = useState('');
125
+ const [email, setEmail] = useState(defaultEmail != null ? defaultEmail : '');
126
+ const [emailError, setEmailError] = useState('');
127
+ const [shippingBusy, setShippingBusy] = useState(false);
128
+ /**
129
+ * The email the SERVER put on the session, latched at first load. Stripe
130
+ * refuses `updateEmail` on such a session, so it is shown, not edited. Read
131
+ * once rather than live because the session's email also becomes set the
132
+ * moment THIS form calls `updateEmail` — which must not turn the field the
133
+ * shopper is typing in into read-only text.
134
+ */ const serverEmail = useRef(undefined);
135
+ if (checkout && serverEmail.current === undefined) {
136
+ serverEmail.current = checkout.email ? String(checkout.email) : null;
137
+ }
138
+ const emailLocked = Boolean(serverEmail.current);
139
+ const sessionShippingOptions = checkout == null ? void 0 : checkout.shippingOptions;
140
+ const shippingOptions = useMemo(()=>sessionShippingOptions != null ? sessionShippingOptions : [], [
141
+ sessionShippingOptions
142
+ ]);
143
+ const collectsShipping = shippingOptions.length > 0;
144
+ const selectedShippingId = (_ref = checkout == null ? void 0 : (_checkout_shipping = checkout.shipping) == null ? void 0 : (_checkout_shipping_shippingOption = _checkout_shipping.shippingOption) == null ? void 0 : _checkout_shipping_shippingOption.id) != null ? _ref : '';
145
+ // The hosted page pre-selects the first rate, so the in-page one does too:
146
+ // a session with options and no selection cannot be confirmed, and making
147
+ // the shopper discover that at the pay button is a decline they did not
148
+ // cause. Once per session — a later deselect is not something Stripe does.
149
+ const autoSelected = useRef(false);
150
+ useEffect(()=>{
151
+ if (!checkout || !collectsShipping || selectedShippingId) return;
152
+ if (autoSelected.current) return;
153
+ autoSelected.current = true;
154
+ void checkout.updateShippingOption(shippingOptions[0].id);
155
+ }, [
156
+ checkout,
157
+ collectsShipping,
158
+ selectedShippingId,
159
+ shippingOptions
160
+ ]);
161
+ const chooseShipping = useCallback(async (id)=>{
162
+ if (!checkout || id === selectedShippingId) return;
163
+ setShippingBusy(true);
164
+ try {
165
+ const result = await checkout.updateShippingOption(id);
166
+ if ((result == null ? void 0 : result.type) === 'error') {
167
+ var _ref;
168
+ var _result_error;
169
+ setMessage(String((_ref = (_result_error = result.error) == null ? void 0 : _result_error.message) != null ? _ref : '') || 'That shipping option could not be selected.');
170
+ }
171
+ } finally{
172
+ setShippingBusy(false);
173
+ }
174
+ }, [
175
+ checkout,
176
+ selectedShippingId
177
+ ]);
178
+ // Re-price on the address once it is complete and has stopped changing:
179
+ // the Address Element fires per keystroke, and under Stripe Tax every
180
+ // update is a tax calculation. Confirm sends the element's value anyway, so
181
+ // this exists for the TOTAL — the shopper sees tax before they pay.
182
+ const addressTimer = useRef(null);
183
+ useEffect(()=>()=>{
184
+ if (addressTimer.current) clearTimeout(addressTimer.current);
185
+ }, []);
186
+ const onShippingAddressChange = useCallback((event)=>{
187
+ if (!checkout || !event.complete) return;
188
+ if (addressTimer.current) clearTimeout(addressTimer.current);
189
+ const { name, address } = event.value;
190
+ addressTimer.current = setTimeout(()=>{
191
+ void checkout.updateShippingAddress({
192
+ name,
193
+ address
194
+ }).catch(()=>undefined);
195
+ }, ADDRESS_SETTLE_MS);
196
+ }, [
197
+ checkout
198
+ ]);
199
+ const commitEmail = useCallback(async ()=>{
200
+ if (!checkout || emailLocked) return true;
201
+ const trimmed = email.trim();
202
+ if (!trimmed) {
203
+ setEmailError('Enter your email for the receipt.');
204
+ return false;
205
+ }
206
+ if (checkout.email === trimmed) return true;
207
+ const result = await checkout.updateEmail(trimmed);
208
+ if ((result == null ? void 0 : result.type) === 'error') {
209
+ var _ref;
210
+ var _result_error;
211
+ setEmailError(String((_ref = (_result_error = result.error) == null ? void 0 : _result_error.message) != null ? _ref : '') || 'Enter a valid email address.');
212
+ return false;
213
+ }
214
+ setEmailError('');
215
+ return true;
216
+ }, [
217
+ checkout,
218
+ email,
219
+ emailLocked
220
+ ]);
58
221
  const handlePay = useCallback(async ()=>{
59
222
  // Guarded rather than merely disabled: a disabled button is a rendering
60
223
  // fact, and a keyboard or a slow re-render can still land a second call
@@ -63,13 +226,18 @@ function PaymentForm({ payLabel, onCancel }) {
63
226
  setStatus('confirming');
64
227
  setMessage('');
65
228
  try {
229
+ if (!await commitEmail()) {
230
+ setStatus('idle');
231
+ return;
232
+ }
66
233
  const result = await checkout.confirm();
67
234
  if ((result == null ? void 0 : result.type) === 'error') {
68
235
  var _ref;
69
236
  var _result_error;
70
- // A decline, an expired card, an incomplete field. Recoverable: the
71
- // form stays mounted with everything the shopper typed still in it.
72
- setMessage(String((_ref = (_result_error = result.error) == null ? void 0 : _result_error.message) != null ? _ref : '') || 'That payment could not be completed. Try another card.');
237
+ // A decline, an expired card, an incomplete field, a failed 3DS
238
+ // challenge. Recoverable: the form stays mounted with everything the
239
+ // shopper typed still in it.
240
+ setMessage(String((_ref = (_result_error = result.error) == null ? void 0 : _result_error.message) != null ? _ref : '') || GENERIC_FAILURE);
73
241
  setStatus('error');
74
242
  return;
75
243
  }
@@ -78,37 +246,60 @@ function PaymentForm({ payLabel, onCancel }) {
78
246
  // has not by the time this resolves, the confirm is still in flight and
79
247
  // the button stays disabled rather than inviting a second attempt.
80
248
  } catch (unused) {
81
- setMessage('That payment could not be completed. Try another card.');
249
+ // A throw is an integration error on Stripe's side of the contract, not
250
+ // something the shopper did; its text is not written for them.
251
+ setMessage(GENERIC_FAILURE);
82
252
  setStatus('error');
83
253
  }
84
254
  }, [
85
255
  checkout,
256
+ commitEmail,
86
257
  status
87
258
  ]);
88
259
  if (checkoutState.type === 'error') {
89
260
  // The session could not be loaded — expired, or already completed in
90
- // another tab. Nothing typed here could be charged, so say so and offer
91
- // the way back rather than a form that cannot submit.
92
- return /*#__PURE__*/ _jsxs(Box, {
261
+ // another tab. Nothing typed here could be charged, so say so and offer a
262
+ // fresh session or the way back rather than a form that cannot submit.
263
+ return /*#__PURE__*/ _jsx(SessionNotice, {
264
+ message: "This checkout could not be loaded. Start again, or return to the store.",
265
+ onCancel: onCancel,
266
+ onRestart: onRestart
267
+ });
268
+ }
269
+ if (!checkout) {
270
+ return /*#__PURE__*/ _jsx(Box, {
93
271
  sx: {
94
272
  display: 'flex',
95
- flexDirection: 'column',
96
- gap: 2
273
+ justifyContent: 'center',
274
+ py: 3
97
275
  },
98
- children: [
99
- /*#__PURE__*/ _jsx(Alert, {
100
- severity: "error",
101
- role: "alert",
102
- children: 'This checkout could not be loaded. Return to the store and try again.'
103
- }),
104
- onCancel ? /*#__PURE__*/ _jsx(Button, {
105
- variant: "text",
106
- onClick: onCancel,
107
- children: 'Back to the store'
108
- }) : null
109
- ]
276
+ children: /*#__PURE__*/ _jsx(CircularProgress, {
277
+ size: 28,
278
+ "aria-label": "Loading checkout"
279
+ })
280
+ });
281
+ }
282
+ if (((_checkout_status = checkout.status) == null ? void 0 : _checkout_status.type) === 'expired') {
283
+ return /*#__PURE__*/ _jsx(SessionNotice, {
284
+ message: "This checkout expired before it was paid. Nothing was charged.",
285
+ onCancel: onCancel,
286
+ onRestart: onRestart
287
+ });
288
+ }
289
+ if (((_checkout_status1 = checkout.status) == null ? void 0 : _checkout_status1.type) === 'complete') {
290
+ // Paid in another tab, or the return redirect is already under way.
291
+ // Offering a restart here would be offering to charge twice.
292
+ return /*#__PURE__*/ _jsx(Alert, {
293
+ severity: "success",
294
+ role: "status",
295
+ children: 'This order is already paid.'
110
296
  });
111
297
  }
298
+ const total = checkout.total;
299
+ const busy = status === 'confirming';
300
+ const discount = (_ref1 = total == null ? void 0 : (_total_discount = total.discount) == null ? void 0 : _total_discount.minorUnitsAmount) != null ? _ref1 : 0;
301
+ const tax = (_ref2 = total == null ? void 0 : (_total_taxExclusive = total.taxExclusive) == null ? void 0 : _total_taxExclusive.minorUnitsAmount) != null ? _ref2 : 0;
302
+ const taxPending = ((_checkout_tax = checkout.tax) == null ? void 0 : _checkout_tax.status) && checkout.tax.status !== 'ready';
112
303
  return /*#__PURE__*/ _jsxs(Box, {
113
304
  sx: {
114
305
  display: 'flex',
@@ -116,7 +307,97 @@ function PaymentForm({ payLabel, onCancel }) {
116
307
  gap: 2
117
308
  },
118
309
  children: [
119
- /*#__PURE__*/ _jsx(PaymentElement, {}),
310
+ emailLocked ? /*#__PURE__*/ _jsx(Typography, {
311
+ variant: "body2",
312
+ color: "text.secondary",
313
+ children: `Receipt to ${serverEmail.current}`
314
+ }) : /*#__PURE__*/ _jsx(TextField, {
315
+ type: "email",
316
+ label: "Email",
317
+ required: true,
318
+ fullWidth: true,
319
+ autoComplete: "email",
320
+ value: email,
321
+ onChange: (event)=>{
322
+ setEmail(event.target.value);
323
+ if (emailError) setEmailError('');
324
+ },
325
+ onBlur: ()=>{
326
+ if (email.trim()) void commitEmail();
327
+ },
328
+ error: Boolean(emailError),
329
+ helperText: emailError || 'Your receipt is sent here.',
330
+ disabled: busy
331
+ }),
332
+ collectsShipping ? /*#__PURE__*/ _jsxs(Box, {
333
+ sx: {
334
+ display: 'flex',
335
+ flexDirection: 'column',
336
+ gap: 1
337
+ },
338
+ "data-testid": "storefront-shipping",
339
+ children: [
340
+ /*#__PURE__*/ _jsx(Typography, {
341
+ variant: "subtitle2",
342
+ children: 'Shipping address'
343
+ }),
344
+ /*#__PURE__*/ _jsx(ShippingAddressElement, {
345
+ onChange: onShippingAddressChange
346
+ }),
347
+ /*#__PURE__*/ _jsx(Typography, {
348
+ variant: "subtitle2",
349
+ children: 'Shipping method'
350
+ }),
351
+ /*#__PURE__*/ _jsx(RadioGroup, {
352
+ "aria-label": "Shipping method",
353
+ value: selectedShippingId,
354
+ onChange: (event)=>void chooseShipping(event.target.value),
355
+ children: shippingOptions.map((option)=>/*#__PURE__*/ _jsx(FormControlLabel, {
356
+ value: option.id,
357
+ disabled: busy || shippingBusy,
358
+ control: /*#__PURE__*/ _jsx(Radio, {}),
359
+ label: `${option.displayName || 'Shipping'} — ${option.amount}`
360
+ }, option.id))
361
+ })
362
+ ]
363
+ }) : null,
364
+ /*#__PURE__*/ _jsx(PaymentElement, {
365
+ options: wallets ? {
366
+ wallets
367
+ } : undefined
368
+ }),
369
+ total ? /*#__PURE__*/ _jsxs(Box, {
370
+ sx: {
371
+ display: 'flex',
372
+ flexDirection: 'column',
373
+ gap: 0.5
374
+ },
375
+ "data-testid": "storefront-checkout-total",
376
+ children: [
377
+ /*#__PURE__*/ _jsx(SummaryRow, {
378
+ label: "Subtotal",
379
+ value: total.subtotal.amount
380
+ }),
381
+ discount ? /*#__PURE__*/ _jsx(SummaryRow, {
382
+ label: "Discount",
383
+ value: `−${total.discount.amount}`
384
+ }) : null,
385
+ collectsShipping ? /*#__PURE__*/ _jsx(SummaryRow, {
386
+ label: "Shipping",
387
+ value: selectedShippingId ? total.shippingRate.amount : '—'
388
+ }) : null,
389
+ tax || taxPending ? /*#__PURE__*/ _jsx(SummaryRow, {
390
+ label: "Tax",
391
+ value: taxPending ? 'Calculated from your address' : total.taxExclusive.amount
392
+ }) : null,
393
+ /*#__PURE__*/ _jsx(Divider, {}),
394
+ /*#__PURE__*/ _jsx(SummaryRow, {
395
+ label: "Total",
396
+ value: total.total.amount,
397
+ strong: true
398
+ })
399
+ ]
400
+ }) : null,
120
401
  message ? // `error` severity is right here and wrong for a lockdown pause — this
121
402
  // really is "your payment did not go through", which is the one thing
122
403
  // a shopper must be told plainly.
@@ -134,14 +415,14 @@ function PaymentForm({ payLabel, onCancel }) {
134
415
  /*#__PURE__*/ _jsx(Button, {
135
416
  variant: "contained",
136
417
  onClick: handlePay,
137
- disabled: status === 'confirming' || !checkout,
418
+ disabled: busy || shippingBusy,
138
419
  fullWidth: true,
139
- children: status === 'confirming' ? 'Paying…' : payLabel || 'Pay now'
420
+ children: busy ? 'Paying…' : payLabel || 'Pay now'
140
421
  }),
141
422
  onCancel ? /*#__PURE__*/ _jsx(Button, {
142
423
  variant: "text",
143
424
  onClick: onCancel,
144
- disabled: status === 'confirming',
425
+ disabled: busy,
145
426
  children: 'Cancel'
146
427
  }) : null
147
428
  ]
@@ -149,19 +430,34 @@ function PaymentForm({ payLabel, onCancel }) {
149
430
  ]
150
431
  });
151
432
  }
152
- export function StorefrontPaymentElement({ clientSecret, publishableKey, payLabel, onCancel }) {
433
+ export function StorefrontPaymentElement({ clientSecret, publishableKey, payLabel, defaultEmail, onCancel, onRestart, wallets }) {
153
434
  const stripe = useMemo(()=>getStripe(publishableKey), [
154
435
  publishableKey
155
436
  ]);
437
+ const theme = useTheme();
438
+ // Built once per session: the provider reads its options at mount and
439
+ // ignores later changes, so a memo keyed on the theme as well would only
440
+ // suggest a re-theme that never happens.
441
+ const options = useMemo(()=>{
442
+ var _theme_typography;
443
+ return {
444
+ clientSecret,
445
+ elementsOptions: {
446
+ appearance: storefrontPaymentAppearance(theme),
447
+ fonts: storefrontPaymentFonts(typeof ((_theme_typography = theme.typography) == null ? void 0 : _theme_typography.fontFamily) === 'string' ? theme.typography.fontFamily : undefined)
448
+ }
449
+ };
450
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
451
+ [
452
+ clientSecret
453
+ ]);
156
454
  // Belt and braces with the server's own gate, which already refuses native
157
455
  // mode without a publishable key: rendering nothing beats rendering an empty
158
456
  // white box that looks like a broken payment form.
159
457
  if (!clientSecret || !stripe) return null;
160
458
  return /*#__PURE__*/ _jsx(CheckoutElementsProvider, {
161
459
  stripe: stripe,
162
- options: {
163
- clientSecret
164
- },
460
+ options: options,
165
461
  children: /*#__PURE__*/ _jsx(Box, {
166
462
  sx: {
167
463
  py: 2
@@ -169,7 +465,10 @@ export function StorefrontPaymentElement({ clientSecret, publishableKey, payLabe
169
465
  "data-testid": "storefront-payment-element",
170
466
  children: /*#__PURE__*/ _jsx(PaymentForm, {
171
467
  payLabel: payLabel,
172
- onCancel: onCancel
468
+ defaultEmail: defaultEmail,
469
+ onCancel: onCancel,
470
+ onRestart: onRestart,
471
+ wallets: wallets
173
472
  })
174
473
  })
175
474
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/storefront-payment-element.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use client'\n\n// The `/checkout` entry, not the main one: react-stripe-js v6 moved the\n// Checkout Sessions provider, its hook and its own `PaymentElement` there, and\n// the main entry's `PaymentElement` is the Elements one, which does not mount\n// under a Checkout provider.\nimport {\n CheckoutElementsProvider,\n PaymentElement,\n useCheckoutElements,\n} from '@stripe/react-stripe-js/checkout'\n// `/pure` deliberately, not the bare entry (AGL-2486). The bare entry ends\n// with a module-scope `Promise.resolve().then(() => getStripePromise())`,\n// so merely EVALUATING it injects the js.stripe.com/v3 script tag —\n// 249 KB gzipped — on any page that reaches this module, whether or not\n// `loadStripe` is ever called. `/pure` is the same API without that\n// statement, so the script is fetched when we ask for it and not before.\nimport { loadStripe } from '@stripe/stripe-js/pure'\n// The TYPE only, and from the bare entry because `/pure` does not re-export\n// it. `import type` is erased entirely at compile time, so this adds no\n// runtime import and cannot re-introduce the script injection above.\nimport type { Stripe } from '@stripe/stripe-js'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport { useCallback, useMemo, useState } from 'react'\n\n/**\n * The storefront Payment Element (AGL-1944) — the shopper pays on the\n * merchant's own domain instead of being sent to `checkout.stripe.com`.\n *\n * ## THIS COMPONENT DOES NOT FULFIL ANYTHING\n *\n * It has no success callback, and that absence is the design rather than an\n * omission. `libs/plugins/commerce/src/lib/server/billing-webhook.ts` creates\n * the order on `checkout.session.completed` and is the only thing that ever\n * does. An in-page flow makes trusting the browser far more tempting than a\n * redirect does — the form is right there, `confirm()` resolves in hand, and\n * posting \"done, please fulfil\" is one line away — and the browser is the one\n * participant in a payment that can lie about having paid.\n *\n * It is also the participant that can VANISH. A shopper who confirms and\n * closes the tab never runs a callback, so a flow that fulfils here loses the\n * order outright while keeping the money; a shopper who refreshes the return\n * page runs it twice. Neither is reachable from a design with no callback in\n * it. What happens after a successful confirm is a redirect to `return_url`,\n * carrying the `session_id` the server put there — so the page can SHOW the\n * shopper a result by looking the order up, without being TOLD the outcome by\n * this code.\n *\n * ## Declines and 3DS\n *\n * Both were handled for us by the redirect and now have to be handled here.\n *\n * A decline resolves as `{ type: 'error' }` and is rendered inline WITHOUT\n * unmounting the form: the shopper's basket, address and chosen method are all\n * still on screen and they can try another card. That is the whole difference\n * between a recoverable decline and a dead end, and it is why the error state\n * below sits beside the element rather than replacing it.\n *\n * A 3DS challenge is Stripe's own: `confirm()` presents the challenge and, for\n * redirect-based methods, sends the browser to `return_url` and back. Nothing\n * here has to model it — but the button must stay disabled across the whole\n * await, because a second `confirm()` during a challenge is exactly the\n * double-submit the server's idempotency claim exists to survive and there is\n * no reason to make it lean on that.\n */\n\nexport interface StorefrontPaymentElementProps {\n /** Stripe's instruction to the browser. Not a claim that money moved. */\n clientSecret: string\n publishableKey: string\n /** Shown on the pay button, so the merchant's own total reads through. */\n payLabel?: string\n /** Abandon the in-page form and return to the store. */\n onCancel?: () => void\n}\n\n/**\n * `loadStripe` injects a script tag, so it is memoized per key rather than\n * called per render. Keyed because a page could in principle mount this for\n * two different merchants; in practice it is one, and the map costs nothing.\n */\nconst stripePromises = new Map<string, Promise<Stripe | null>>()\nfunction getStripe(publishableKey: string): Promise<Stripe | null> | null {\n if (!publishableKey) return null\n let promise = stripePromises.get(publishableKey)\n if (!promise) {\n promise = loadStripe(publishableKey)\n stripePromises.set(publishableKey, promise)\n }\n return promise\n}\n\n/** Test seam: `loadStripe` caches per key across a file's tests otherwise. */\nexport function __resetStripePromises(): void {\n stripePromises.clear()\n}\n\nfunction PaymentForm({\n payLabel,\n onCancel,\n}: Pick<StorefrontPaymentElementProps, 'payLabel' | 'onCancel'>) {\n // A `{ type: 'loading' | 'success' | 'error' }` union since react-stripe-js\n // v6: the session is not usable until Stripe.js has booted against it.\n const checkoutState = useCheckoutElements()\n const checkout =\n checkoutState.type === 'success' ? checkoutState.checkout : null\n const [status, setStatus] = useState<'idle' | 'confirming' | 'error'>('idle')\n const [message, setMessage] = useState('')\n\n const handlePay = useCallback(async () => {\n // Guarded rather than merely disabled: a disabled button is a rendering\n // fact, and a keyboard or a slow re-render can still land a second call\n // during a 3DS challenge.\n if (status === 'confirming' || !checkout) return\n setStatus('confirming')\n setMessage('')\n try {\n const result = await checkout.confirm()\n if (result?.type === 'error') {\n // A decline, an expired card, an incomplete field. Recoverable: the\n // form stays mounted with everything the shopper typed still in it.\n setMessage(\n String(result.error?.message ?? '') ||\n 'That payment could not be completed. Try another card.',\n )\n setStatus('error')\n return\n }\n // Success does NOT mean fulfilled, and nothing is reported to our server\n // here. Stripe redirects to the `return_url` the session carries; if it\n // has not by the time this resolves, the confirm is still in flight and\n // the button stays disabled rather than inviting a second attempt.\n } catch {\n setMessage('That payment could not be completed. Try another card.')\n setStatus('error')\n }\n }, [checkout, status])\n\n if (checkoutState.type === 'error') {\n // The session could not be loaded — expired, or already completed in\n // another tab. Nothing typed here could be charged, so say so and offer\n // the way back rather than a form that cannot submit.\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n <Alert severity=\"error\" role=\"alert\">\n {'This checkout could not be loaded. Return to the store and try again.'}\n </Alert>\n {onCancel ? (\n <Button variant=\"text\" onClick={onCancel}>\n {'Back to the store'}\n </Button>\n ) : null}\n </Box>\n )\n }\n\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n <PaymentElement />\n {message ? (\n // `error` severity is right here and wrong for a lockdown pause — this\n // really is \"your payment did not go through\", which is the one thing\n // a shopper must be told plainly.\n <Alert severity=\"error\" role=\"alert\">\n {message}\n </Alert>\n ) : null}\n <Box sx={{ display: 'flex', gap: 1 }}>\n <Button\n variant=\"contained\"\n onClick={handlePay}\n disabled={status === 'confirming' || !checkout}\n fullWidth\n >\n {status === 'confirming' ? 'Paying…' : payLabel || 'Pay now'}\n </Button>\n {onCancel ? (\n <Button\n variant=\"text\"\n onClick={onCancel}\n disabled={status === 'confirming'}\n >\n {'Cancel'}\n </Button>\n ) : null}\n </Box>\n </Box>\n )\n}\n\nexport function StorefrontPaymentElement({\n clientSecret,\n publishableKey,\n payLabel,\n onCancel,\n}: StorefrontPaymentElementProps) {\n const stripe = useMemo(() => getStripe(publishableKey), [publishableKey])\n // Belt and braces with the server's own gate, which already refuses native\n // mode without a publishable key: rendering nothing beats rendering an empty\n // white box that looks like a broken payment form.\n if (!clientSecret || !stripe) return null\n return (\n <CheckoutElementsProvider stripe={stripe} options={{ clientSecret }}>\n <Box sx={{ py: 2 }} data-testid=\"storefront-payment-element\">\n <PaymentForm payLabel={payLabel} onCancel={onCancel} />\n </Box>\n </CheckoutElementsProvider>\n )\n}\n\n/**\n * Re-exported so the old import path still resolves, but the definition now\n * lives in its own module (AGL-2486): a fallback imported FROM the lazily\n * loaded module drags that module into the eager bundle and cancels the\n * `lazy()`. Callers must import it from `./storefront-payment-element-fallback`\n * — importing it from here is exactly the bug, and re-exporting it does not\n * make that safe.\n */\nexport { StorefrontPaymentElementFallback } from './storefront-payment-element-fallback'\n\nexport default StorefrontPaymentElement\n"],"names":["CheckoutElementsProvider","PaymentElement","useCheckoutElements","loadStripe","Alert","Box","Button","useCallback","useMemo","useState","stripePromises","Map","getStripe","publishableKey","promise","get","set","__resetStripePromises","clear","PaymentForm","payLabel","onCancel","checkoutState","checkout","type","status","setStatus","message","setMessage","handlePay","result","confirm","String","error","sx","display","flexDirection","gap","severity","role","variant","onClick","disabled","fullWidth","StorefrontPaymentElement","clientSecret","stripe","options","py","data-testid","StorefrontPaymentElementFallback"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;AAEA,wEAAwE;AACxE,+EAA+E;AAC/E,8EAA8E;AAC9E,6BAA6B;AAC7B,SACEA,wBAAwB,EACxBC,cAAc,EACdC,mBAAmB,QACd,mCAAkC;AACzC,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,wEAAwE;AACxE,oEAAoE;AACpE,yEAAyE;AACzE,SAASC,UAAU,QAAQ,yBAAwB;AAKnD,OAAOC,WAAW,sBAAqB;AACvC,OAAOC,SAAS,oBAAmB;AACnC,OAAOC,YAAY,uBAAsB;AACzC,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AAqDtD;;;;CAIC,GACD,MAAMC,iBAAiB,IAAIC;AAC3B,SAASC,UAAUC,cAAsB;IACvC,IAAI,CAACA,gBAAgB,OAAO;IAC5B,IAAIC,UAAUJ,eAAeK,GAAG,CAACF;IACjC,IAAI,CAACC,SAAS;QACZA,UAAUX,WAAWU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QAAI6B,IAAI;YAAEC,SAAS;YAAQC,eAAe;YAAUC,KAAK;QAAE;;0BAC1D,KAACpC;YACA0B,UACC,uEAAuE;YACvE,sEAAsE;YACtE,kCAAkC;0BAClC,KAACvB;gBAAMkC,UAAS;gBAAQC,MAAK;0BAC1BZ;iBAED;0BACJ,MAACtB;gBAAI6B,IAAI;oBAAEC,SAAS;oBAAQE,KAAK;gBAAE;;kCACjC,KAAC/B;wBACCkC,SAAQ;wBACRC,SAASZ;wBACTa,UAAUjB,WAAW,gBAAgB,CAACF;wBACtCoB,SAAS;kCAERlB,WAAW,eAAe,YAAYL,YAAY;;oBAEpDC,yBACC,KAACf;wBACCkC,SAAQ;wBACRC,SAASpB;wBACTqB,UAAUjB,WAAW;kCAEpB;yBAED;;;;;AAIZ;AAEA,OAAO,SAASmB,yBAAyB,EACvCC,YAAY,EACZhC,cAAc,EACdO,QAAQ,EACRC,QAAQ,EACsB;IAC9B,MAAMyB,SAAStC,QAAQ,IAAMI,UAAUC,iBAAiB;QAACA;KAAe;IACxE,2EAA2E;IAC3E,6EAA6E;IAC7E,mDAAmD;IACnD,IAAI,CAACgC,gBAAgB,CAACC,QAAQ,OAAO;IACrC,qBACE,KAAC9C;QAAyB8C,QAAQA;QAAQC,SAAS;YAAEF;QAAa;kBAChE,cAAA,KAACxC;YAAI6B,IAAI;gBAAEc,IAAI;YAAE;YAAGC,eAAY;sBAC9B,cAAA,KAAC9B;gBAAYC,UAAUA;gBAAUC,UAAUA;;;;AAInD;AAEA;;;;;;;CAOC,GACD,SAAS6B,gCAAgC,QAAQ,2CAAuC;AAExF,eAAeN,yBAAwB"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/storefront-payment-element.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use client'\n\n// The `/checkout` entry, not the main one: react-stripe-js v6 moved the\n// Checkout Sessions provider, its hook and its own `PaymentElement` there, and\n// the main entry's `PaymentElement` is the Elements one, which does not mount\n// under a Checkout provider.\nimport {\n CheckoutElementsProvider,\n PaymentElement,\n ShippingAddressElement,\n useCheckoutElements,\n} from '@stripe/react-stripe-js/checkout'\n// `/pure` deliberately, not the bare entry (AGL-2486). The bare entry ends\n// with a module-scope `Promise.resolve().then(() => getStripePromise())`,\n// so merely EVALUATING it injects the js.stripe.com/v3 script tag —\n// 249 KB gzipped — on any page that reaches this module, whether or not\n// `loadStripe` is ever called. `/pure` is the same API without that\n// statement, so the script is fetched when we ask for it and not before.\nimport { loadStripe } from '@stripe/stripe-js/pure'\n// The TYPE only, and from the bare entry because `/pure` does not re-export\n// it. `import type` is erased entirely at compile time, so this adds no\n// runtime import and cannot re-introduce the script injection above.\nimport type {\n Stripe,\n StripeAddressElementChangeEvent,\n StripeCheckoutElementsSdkOptions,\n} from '@stripe/stripe-js'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport CircularProgress from '@mui/material/CircularProgress'\nimport Divider from '@mui/material/Divider'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport Radio from '@mui/material/Radio'\nimport RadioGroup from '@mui/material/RadioGroup'\nimport TextField from '@mui/material/TextField'\nimport Typography from '@mui/material/Typography'\nimport { useTheme } from '@mui/material/styles'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport {\n storefrontPaymentAppearance,\n storefrontPaymentFonts,\n} from './storefront-payment-appearance'\nimport type { StorefrontCheckoutWallets } from '../model/commerce-payment-methods'\n\n/**\n * The storefront Payment Element (AGL-1944) — the shopper pays on the\n * merchant's own domain instead of being sent to `checkout.stripe.com`.\n *\n * ## THIS COMPONENT DOES NOT FULFIL ANYTHING\n *\n * It has no success callback, and that absence is the design rather than an\n * omission. `libs/plugins/commerce/src/lib/server/billing-webhook.ts` creates\n * the order on `checkout.session.completed` and is the only thing that ever\n * does. An in-page flow makes trusting the browser far more tempting than a\n * redirect does — the form is right there, `confirm()` resolves in hand, and\n * posting \"done, please fulfil\" is one line away — and the browser is the one\n * participant in a payment that can lie about having paid.\n *\n * It is also the participant that can VANISH. A shopper who confirms and\n * closes the tab never runs a callback, so a flow that fulfils here loses the\n * order outright while keeping the money; a shopper who refreshes the return\n * page runs it twice. Neither is reachable from a design with no callback in\n * it. What happens after a successful confirm is a redirect to `return_url`,\n * carrying the `session_id` the server put there — so the page can SHOW the\n * shopper a result by looking the order up, without being TOLD the outcome by\n * this code.\n *\n * ## Declines and 3DS\n *\n * Both were handled for us by the redirect and now have to be handled here.\n *\n * A decline resolves as `{ type: 'error' }` and is rendered inline WITHOUT\n * unmounting the form: the shopper's basket, address and chosen method are all\n * still on screen and they can try another card. That is the whole difference\n * between a recoverable decline and a dead end, and it is why the error state\n * below sits beside the element rather than replacing it.\n *\n * A 3DS challenge is Stripe's own: `confirm()` presents the challenge and, for\n * redirect-based methods, sends the browser to `return_url` and back. Nothing\n * here has to model it — but the button must stay disabled across the whole\n * await, because a second `confirm()` during a challenge is exactly the\n * double-submit the server's idempotency claim exists to survive and there is\n * no reason to make it lean on that.\n *\n * ## Everything the hosted page collected, collected here (AGL-3606)\n *\n * The hosted page asked for an email, a shipping address and a shipping\n * method, and showed a running total. A `ui_mode: 'elements'` session asks\n * for none of that on its own — the Payment Element is only the payment\n * method — so each is mounted here, read off the SESSION rather than off\n * anything the storefront believes:\n *\n * - **Email.** A session created with `customer_email` (the cart's email\n * field) already has one and Stripe refuses `updateEmail` on it, so it is\n * shown read-only. Otherwise a required field, sent with `updateEmail`\n * before `confirm()` — the receipt and the order's customer both come from\n * it, and a sale without one is an order nobody can be told about.\n * - **Shipping.** Only when the session carries shipping options, which the\n * server attaches only when the store ships to the destination. The\n * Shipping Address Element collects the address (and, under Stripe Tax,\n * is where the tax is computed from); the picker lists the session's own\n * options and selects through `updateShippingOption`.\n * - **Tax address without shipping.** Left to the Payment Element, which\n * collects the country and postal code Stripe Tax needs when the session\n * has `automatic_tax` and no shipping address. A Billing Address Element\n * there would make `updateBillingAddress` conflict with it.\n * - **The total.** Rendered from `session.total`, which Stripe recomputes on\n * every address and option change — tax and shipping included — so the\n * number on the button is the number charged.\n * - **The look.** `elementsOptions.appearance` and `fonts` come from the site\n * theme (`storefront-payment-appearance.ts`), so Stripe's frames wear the\n * merchant's palette, radius and typeface.\n *\n * ## Expired and redirect-returned sessions\n *\n * A session that expired, or that cannot be loaded, offers a fresh one through\n * `onRestart` (a NEW attempt key, so the server does not replay the dead\n * session). A redirect-based method that fails comes back to `return_url`\n * with the session still open; `use-checkout-return-notice.ts` reads that on\n * the return page and says nothing was charged.\n */\n\nexport interface StorefrontPaymentElementProps {\n /** Stripe's instruction to the browser. Not a claim that money moved. */\n clientSecret: string\n publishableKey: string\n /** Shown on the pay button, so the merchant's own total reads through. */\n payLabel?: string\n /**\n * An email the storefront already knows but did not put on the session\n * (it prefills the field; the shopper can still change it). A session the\n * server created WITH an email shows that one read-only instead.\n */\n defaultEmail?: string\n /** Abandon the in-page form and return to the store. */\n onCancel?: () => void\n /**\n * Open a fresh session after this one expired or could not be loaded. The\n * caller must mint a NEW attempt key first, or the server replays the dead\n * session for the old one.\n */\n onRestart?: () => void\n /**\n * The wallets the merchant hid (AGL-3629). Stripe cannot exclude Apple Pay,\n * Google Pay or Link on the session, so the Payment Element is told instead.\n * Absent means every wallet the device supports shows.\n */\n wallets?: StorefrontCheckoutWallets\n}\n\n/**\n * `loadStripe` injects a script tag, so it is memoized per key rather than\n * called per render. Keyed because a page could in principle mount this for\n * two different merchants; in practice it is one, and the map costs nothing.\n */\nconst stripePromises = new Map<string, Promise<Stripe | null>>()\nfunction getStripe(publishableKey: string): Promise<Stripe | null> | null {\n if (!publishableKey) return null\n let promise = stripePromises.get(publishableKey)\n if (!promise) {\n promise = loadStripe(publishableKey)\n stripePromises.set(publishableKey, promise)\n }\n return promise\n}\n\n/** Test seam: `loadStripe` caches per key across a file's tests otherwise. */\nexport function __resetStripePromises(): void {\n stripePromises.clear()\n}\n\nconst GENERIC_FAILURE = 'That payment could not be completed. Try another card.'\n\n/** How long the address must sit still before the session re-prices on it. */\nconst ADDRESS_SETTLE_MS = 400\n\nfunction SummaryRow({\n label,\n value,\n strong,\n}: {\n label: string\n value: string\n strong?: boolean\n}) {\n return (\n <Box sx={{ display: 'flex', justifyContent: 'space-between', gap: 2 }}>\n <Typography\n variant={strong ? 'subtitle1' : 'body2'}\n color={strong ? 'text.primary' : 'text.secondary'}\n >\n {label}\n </Typography>\n <Typography variant={strong ? 'subtitle1' : 'body2'}>{value}</Typography>\n </Box>\n )\n}\n\nfunction SessionNotice({\n message,\n onCancel,\n onRestart,\n}: {\n message: string\n onCancel?: () => void\n onRestart?: () => void\n}) {\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n <Alert severity=\"error\" role=\"alert\">\n {message}\n </Alert>\n <Box sx={{ display: 'flex', gap: 1 }}>\n {onRestart ? (\n <Button variant=\"contained\" onClick={onRestart}>\n {'Start checkout again'}\n </Button>\n ) : null}\n {onCancel ? (\n <Button variant=\"text\" onClick={onCancel}>\n {'Back to the store'}\n </Button>\n ) : null}\n </Box>\n </Box>\n )\n}\n\nfunction PaymentForm({\n payLabel,\n defaultEmail,\n onCancel,\n onRestart,\n wallets,\n}: Pick<\n StorefrontPaymentElementProps,\n 'payLabel' | 'defaultEmail' | 'onCancel' | 'onRestart' | 'wallets'\n>) {\n // A `{ type: 'loading' | 'success' | 'error' }` union since react-stripe-js\n // v6: the session is not usable until Stripe.js has booted against it.\n const checkoutState = useCheckoutElements()\n const checkout =\n checkoutState.type === 'success' ? checkoutState.checkout : null\n const [status, setStatus] = useState<'idle' | 'confirming' | 'error'>('idle')\n const [message, setMessage] = useState('')\n const [email, setEmail] = useState(defaultEmail ?? '')\n const [emailError, setEmailError] = useState('')\n const [shippingBusy, setShippingBusy] = useState(false)\n\n /**\n * The email the SERVER put on the session, latched at first load. Stripe\n * refuses `updateEmail` on such a session, so it is shown, not edited. Read\n * once rather than live because the session's email also becomes set the\n * moment THIS form calls `updateEmail` — which must not turn the field the\n * shopper is typing in into read-only text.\n */\n const serverEmail = useRef<string | null | undefined>(undefined)\n if (checkout && serverEmail.current === undefined) {\n serverEmail.current = checkout.email ? String(checkout.email) : null\n }\n const emailLocked = Boolean(serverEmail.current)\n\n const sessionShippingOptions = checkout?.shippingOptions\n const shippingOptions = useMemo(\n () => sessionShippingOptions ?? [],\n [sessionShippingOptions],\n )\n const collectsShipping = shippingOptions.length > 0\n const selectedShippingId = checkout?.shipping?.shippingOption?.id ?? ''\n\n // The hosted page pre-selects the first rate, so the in-page one does too:\n // a session with options and no selection cannot be confirmed, and making\n // the shopper discover that at the pay button is a decline they did not\n // cause. Once per session — a later deselect is not something Stripe does.\n const autoSelected = useRef(false)\n useEffect(() => {\n if (!checkout || !collectsShipping || selectedShippingId) return\n if (autoSelected.current) return\n autoSelected.current = true\n void checkout.updateShippingOption(shippingOptions[0].id)\n }, [checkout, collectsShipping, selectedShippingId, shippingOptions])\n\n const chooseShipping = useCallback(\n async (id: string) => {\n if (!checkout || id === selectedShippingId) return\n setShippingBusy(true)\n try {\n const result = await checkout.updateShippingOption(id)\n if (result?.type === 'error') {\n setMessage(\n String(result.error?.message ?? '') ||\n 'That shipping option could not be selected.',\n )\n }\n } finally {\n setShippingBusy(false)\n }\n },\n [checkout, selectedShippingId],\n )\n\n // Re-price on the address once it is complete and has stopped changing:\n // the Address Element fires per keystroke, and under Stripe Tax every\n // update is a tax calculation. Confirm sends the element's value anyway, so\n // this exists for the TOTAL — the shopper sees tax before they pay.\n const addressTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n useEffect(\n () => () => {\n if (addressTimer.current) clearTimeout(addressTimer.current)\n },\n [],\n )\n const onShippingAddressChange = useCallback(\n (event: StripeAddressElementChangeEvent) => {\n if (!checkout || !event.complete) return\n if (addressTimer.current) clearTimeout(addressTimer.current)\n const { name, address } = event.value\n addressTimer.current = setTimeout(() => {\n void checkout\n .updateShippingAddress({ name, address })\n .catch(() => undefined)\n }, ADDRESS_SETTLE_MS)\n },\n [checkout],\n )\n\n const commitEmail = useCallback(async (): Promise<boolean> => {\n if (!checkout || emailLocked) return true\n const trimmed = email.trim()\n if (!trimmed) {\n setEmailError('Enter your email for the receipt.')\n return false\n }\n if (checkout.email === trimmed) return true\n const result = await checkout.updateEmail(trimmed)\n if (result?.type === 'error') {\n setEmailError(\n String(result.error?.message ?? '') || 'Enter a valid email address.',\n )\n return false\n }\n setEmailError('')\n return true\n }, [checkout, email, emailLocked])\n\n const handlePay = useCallback(async () => {\n // Guarded rather than merely disabled: a disabled button is a rendering\n // fact, and a keyboard or a slow re-render can still land a second call\n // during a 3DS challenge.\n if (status === 'confirming' || !checkout) return\n setStatus('confirming')\n setMessage('')\n try {\n if (!(await commitEmail())) {\n setStatus('idle')\n return\n }\n const result = await checkout.confirm()\n if (result?.type === 'error') {\n // A decline, an expired card, an incomplete field, a failed 3DS\n // challenge. Recoverable: the form stays mounted with everything the\n // shopper typed still in it.\n setMessage(String(result.error?.message ?? '') || GENERIC_FAILURE)\n setStatus('error')\n return\n }\n // Success does NOT mean fulfilled, and nothing is reported to our server\n // here. Stripe redirects to the `return_url` the session carries; if it\n // has not by the time this resolves, the confirm is still in flight and\n // the button stays disabled rather than inviting a second attempt.\n } catch {\n // A throw is an integration error on Stripe's side of the contract, not\n // something the shopper did; its text is not written for them.\n setMessage(GENERIC_FAILURE)\n setStatus('error')\n }\n }, [checkout, commitEmail, status])\n\n if (checkoutState.type === 'error') {\n // The session could not be loaded — expired, or already completed in\n // another tab. Nothing typed here could be charged, so say so and offer a\n // fresh session or the way back rather than a form that cannot submit.\n return (\n <SessionNotice\n message=\"This checkout could not be loaded. Start again, or return to the store.\"\n onCancel={onCancel}\n onRestart={onRestart}\n />\n )\n }\n\n if (!checkout) {\n return (\n <Box sx={{ display: 'flex', justifyContent: 'center', py: 3 }}>\n <CircularProgress size={28} aria-label=\"Loading checkout\" />\n </Box>\n )\n }\n\n if (checkout.status?.type === 'expired') {\n return (\n <SessionNotice\n message=\"This checkout expired before it was paid. Nothing was charged.\"\n onCancel={onCancel}\n onRestart={onRestart}\n />\n )\n }\n\n if (checkout.status?.type === 'complete') {\n // Paid in another tab, or the return redirect is already under way.\n // Offering a restart here would be offering to charge twice.\n return (\n <Alert severity=\"success\" role=\"status\">\n {'This order is already paid.'}\n </Alert>\n )\n }\n\n const total = checkout.total\n const busy = status === 'confirming'\n const discount = total?.discount?.minorUnitsAmount ?? 0\n const tax = total?.taxExclusive?.minorUnitsAmount ?? 0\n const taxPending = checkout.tax?.status && checkout.tax.status !== 'ready'\n\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n {emailLocked ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`Receipt to ${serverEmail.current}`}\n </Typography>\n ) : (\n <TextField\n type=\"email\"\n label=\"Email\"\n required\n fullWidth\n autoComplete=\"email\"\n value={email}\n onChange={(event) => {\n setEmail(event.target.value)\n if (emailError) setEmailError('')\n }}\n onBlur={() => {\n if (email.trim()) void commitEmail()\n }}\n error={Boolean(emailError)}\n helperText={emailError || 'Your receipt is sent here.'}\n disabled={busy}\n />\n )}\n {collectsShipping ? (\n <Box\n sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}\n data-testid=\"storefront-shipping\"\n >\n <Typography variant=\"subtitle2\">{'Shipping address'}</Typography>\n <ShippingAddressElement onChange={onShippingAddressChange} />\n <Typography variant=\"subtitle2\">{'Shipping method'}</Typography>\n <RadioGroup\n aria-label=\"Shipping method\"\n value={selectedShippingId}\n onChange={(event) => void chooseShipping(event.target.value)}\n >\n {shippingOptions.map((option) => (\n <FormControlLabel\n key={option.id}\n value={option.id}\n disabled={busy || shippingBusy}\n control={<Radio />}\n label={`${option.displayName || 'Shipping'} — ${option.amount}`}\n />\n ))}\n </RadioGroup>\n </Box>\n ) : null}\n <PaymentElement options={wallets ? { wallets } : undefined} />\n {total ? (\n <Box\n sx={{ display: 'flex', flexDirection: 'column', gap: 0.5 }}\n data-testid=\"storefront-checkout-total\"\n >\n <SummaryRow label=\"Subtotal\" value={total.subtotal.amount} />\n {discount ? (\n <SummaryRow label=\"Discount\" value={`−${total.discount.amount}`} />\n ) : null}\n {collectsShipping ? (\n <SummaryRow\n label=\"Shipping\"\n value={selectedShippingId ? total.shippingRate.amount : '—'}\n />\n ) : null}\n {tax || taxPending ? (\n <SummaryRow\n label=\"Tax\"\n value={taxPending ? 'Calculated from your address' : total.taxExclusive.amount}\n />\n ) : null}\n <Divider />\n <SummaryRow label=\"Total\" value={total.total.amount} strong />\n </Box>\n ) : null}\n {message ? (\n // `error` severity is right here and wrong for a lockdown pause — this\n // really is \"your payment did not go through\", which is the one thing\n // a shopper must be told plainly.\n <Alert severity=\"error\" role=\"alert\">\n {message}\n </Alert>\n ) : null}\n <Box sx={{ display: 'flex', gap: 1 }}>\n <Button\n variant=\"contained\"\n onClick={handlePay}\n disabled={busy || shippingBusy}\n fullWidth\n >\n {busy ? 'Paying…' : payLabel || 'Pay now'}\n </Button>\n {onCancel ? (\n <Button variant=\"text\" onClick={onCancel} disabled={busy}>\n {'Cancel'}\n </Button>\n ) : null}\n </Box>\n </Box>\n )\n}\n\nexport function StorefrontPaymentElement({\n clientSecret,\n publishableKey,\n payLabel,\n defaultEmail,\n onCancel,\n onRestart,\n wallets,\n}: StorefrontPaymentElementProps) {\n const stripe = useMemo(() => getStripe(publishableKey), [publishableKey])\n const theme = useTheme()\n // Built once per session: the provider reads its options at mount and\n // ignores later changes, so a memo keyed on the theme as well would only\n // suggest a re-theme that never happens.\n const options = useMemo<StripeCheckoutElementsSdkOptions>(\n () => ({\n clientSecret,\n elementsOptions: {\n appearance: storefrontPaymentAppearance(theme),\n fonts: storefrontPaymentFonts(\n typeof theme.typography?.fontFamily === 'string'\n ? theme.typography.fontFamily\n : undefined,\n ),\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [clientSecret],\n )\n // Belt and braces with the server's own gate, which already refuses native\n // mode without a publishable key: rendering nothing beats rendering an empty\n // white box that looks like a broken payment form.\n if (!clientSecret || !stripe) return null\n return (\n <CheckoutElementsProvider stripe={stripe} options={options}>\n <Box sx={{ py: 2 }} data-testid=\"storefront-payment-element\">\n <PaymentForm\n payLabel={payLabel}\n defaultEmail={defaultEmail}\n onCancel={onCancel}\n onRestart={onRestart}\n wallets={wallets}\n />\n </Box>\n </CheckoutElementsProvider>\n )\n}\n\n/**\n * Re-exported so the old import path still resolves, but the definition now\n * lives in its own module (AGL-2486): a fallback imported FROM the lazily\n * loaded module drags that module into the eager bundle and cancels the\n * `lazy()`. Callers must import it from `./storefront-payment-element-fallback`\n * — importing it from here is exactly the bug, and re-exporting it does not\n * make that safe.\n */\nexport { StorefrontPaymentElementFallback } from './storefront-payment-element-fallback'\n\nexport default StorefrontPaymentElement\n"],"names":["CheckoutElementsProvider","PaymentElement","ShippingAddressElement","useCheckoutElements","loadStripe","Alert","Box","Button","CircularProgress","Divider","FormControlLabel","Radio","RadioGroup","TextField","Typography","useTheme","useCallback","useEffect","useMemo","useRef","useState","storefrontPaymentAppearance","storefrontPaymentFonts","stripePromises","Map","getStripe","publishableKey","promise","get","set","__resetStripePromises","clear","GENERIC_FAILURE","ADDRESS_SETTLE_MS","SummaryRow","label","value","strong","sx","display","justifyContent","gap","variant","color","SessionNotice","message","onCancel","onRestart","flexDirection","severity","role","onClick","PaymentForm","payLabel","defaultEmail","wallets","checkout","total","checkoutState","type","status","setStatus","setMessage","email","setEmail","emailError","setEmailError","shippingBusy","setShippingBusy","serverEmail","undefined","current","String","emailLocked","Boolean","sessionShippingOptions","shippingOptions","collectsShipping","length","selectedShippingId","shipping","shippingOption","id","autoSelected","updateShippingOption","chooseShipping","result","error","addressTimer","clearTimeout","onShippingAddressChange","event","complete","name","address","setTimeout","updateShippingAddress","catch","commitEmail","trimmed","trim","updateEmail","handlePay","confirm","py","size","aria-label","busy","discount","minorUnitsAmount","tax","taxExclusive","taxPending","required","fullWidth","autoComplete","onChange","target","onBlur","helperText","disabled","data-testid","map","option","control","displayName","amount","options","subtotal","shippingRate","StorefrontPaymentElement","clientSecret","stripe","theme","elementsOptions","appearance","fonts","typography","fontFamily","StorefrontPaymentElementFallback"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;AAEA,wEAAwE;AACxE,+EAA+E;AAC/E,8EAA8E;AAC9E,6BAA6B;AAC7B,SACEA,wBAAwB,EACxBC,cAAc,EACdC,sBAAsB,EACtBC,mBAAmB,QACd,mCAAkC;AACzC,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,wEAAwE;AACxE,oEAAoE;AACpE,yEAAyE;AACzE,SAASC,UAAU,QAAQ,yBAAwB;AASnD,OAAOC,WAAW,sBAAqB;AACvC,OAAOC,SAAS,oBAAmB;AACnC,OAAOC,YAAY,uBAAsB;AACzC,OAAOC,sBAAsB,iCAAgC;AAC7D,OAAOC,aAAa,wBAAuB;AAC3C,OAAOC,sBAAsB,iCAAgC;AAC7D,OAAOC,WAAW,sBAAqB;AACvC,OAAOC,gBAAgB,2BAA0B;AACjD,OAAOC,eAAe,0BAAyB;AAC/C,OAAOC,gBAAgB,2BAA0B;AACjD,SAASC,QAAQ,QAAQ,uBAAsB;AAC/C,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AACzE,SACEC,2BAA2B,EAC3BC,sBAAsB,QACjB,qCAAiC;AA6GxC;;;;CAIC,GACD,MAAMC,iBAAiB,IAAIC;AAC3B,SAASC,UAAUC,cAAsB;IACvC,IAAI,CAACA,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version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * The order-status block's component id (AGL-3610). Persisted in screen
19
+ * documents; never rename. Here rather than in the component so the server's
20
+ * page resolver can place the block without importing client code.
21
+ */
22
+ export declare const ORDER_STATUS_COMPONENT_ID = "order-status";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * The order-status block's component id (AGL-3610). Persisted in screen
18
+ * documents; never rename. Here rather than in the component so the server's
19
+ * page resolver can place the block without importing client code.
20
+ */ export const ORDER_STATUS_COMPONENT_ID = 'order-status';
21
+
22
+ //# sourceMappingURL=order-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/constants/order-status.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The order-status block's component id (AGL-3610). Persisted in screen\n * documents; never rename. Here rather than in the component so the server's\n * page resolver can place the block without importing client code.\n */\nexport const ORDER_STATUS_COMPONENT_ID = 'order-status'\n"],"names":["ORDER_STATUS_COMPONENT_ID"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;CAIC,GACD,OAAO,MAAMA,4BAA4B,eAAc"}