@vtex/faststore 0.0.7 → 0.0.10

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 (498) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/actions.json +194 -1
  3. package/dist/catalog.json +3449 -1612
  4. package/dist/cli/index.d.ts +512 -63
  5. package/dist/cli/index.js +2098 -686
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/server-runtime.js +44 -24
  8. package/dist/cli/server-runtime.js.map +1 -1
  9. package/dist/client.d.ts +5 -1
  10. package/dist/client.js +5 -1
  11. package/dist/components.d.ts +42 -10
  12. package/dist/components.js +47 -15
  13. package/dist/content-types.json +823 -0
  14. package/dist/core/dist/define-component.d.ts +12 -2
  15. package/dist/docs/account-access-gate.md +4 -4
  16. package/dist/docs/account-address-book.md +519 -0
  17. package/dist/docs/account-entry-point.md +5 -5
  18. package/dist/docs/account-menu.md +7 -7
  19. package/dist/docs/account-saved-cards.md +301 -0
  20. package/dist/docs/alert-dialog.md +2 -2
  21. package/dist/docs/billing-address.md +17 -9
  22. package/dist/docs/binding-switcher.md +154 -0
  23. package/dist/docs/card-entry.md +38 -7
  24. package/dist/docs/card-summary.md +175 -0
  25. package/dist/docs/cardholder-document.md +16 -14
  26. package/dist/docs/cart-destination.md +238 -0
  27. package/dist/docs/cart-item.md +22 -4
  28. package/dist/docs/cart-totalizer.md +1 -1
  29. package/dist/docs/cart.md +126 -19
  30. package/dist/docs/client-profile-fieldset.md +7 -5
  31. package/dist/docs/copy-text.md +84 -0
  32. package/dist/docs/document-field.md +8 -8
  33. package/dist/docs/footer-link-group.md +2 -2
  34. package/dist/docs/footer-social.md +1 -1
  35. package/dist/docs/free-shipping-progress.md +13 -9
  36. package/dist/docs/header-root.md +1 -1
  37. package/dist/docs/incentives.md +4 -4
  38. package/dist/docs/logo.md +6 -6
  39. package/dist/docs/my-account-profile.md +4 -4
  40. package/dist/docs/navigation-link-list.md +2 -2
  41. package/dist/docs/navigation-link.md +3 -3
  42. package/dist/docs/order-cancel.md +52 -0
  43. package/dist/docs/order-delivery-address.md +63 -0
  44. package/dist/docs/order-delivery-group.md +83 -0
  45. package/dist/docs/order-details-back.md +41 -0
  46. package/dist/docs/order-details-header.md +48 -0
  47. package/dist/docs/order-list-row.md +46 -0
  48. package/dist/docs/order-list-search.md +101 -0
  49. package/dist/docs/order-list-views.md +97 -0
  50. package/dist/docs/order-list.md +94 -0
  51. package/dist/docs/order-payment.md +94 -0
  52. package/dist/docs/order-placed-date.md +49 -0
  53. package/dist/docs/order-placed-payment-summary.md +13 -15
  54. package/dist/docs/order-placed.md +225 -0
  55. package/dist/docs/order-progress.md +88 -0
  56. package/dist/docs/order-status-badge.md +91 -0
  57. package/dist/docs/order-summary.md +53 -0
  58. package/dist/docs/payment-method-badges.md +16 -5
  59. package/dist/docs/payment-methods.md +1 -1
  60. package/dist/docs/place-order.md +13 -9
  61. package/dist/docs/product-information.md +2 -2
  62. package/dist/docs/product-shelf.md +7 -0
  63. package/dist/docs/saved-cards.md +2 -2
  64. package/dist/docs/select.md +22 -10
  65. package/dist/docs/session.md +1 -1
  66. package/dist/docs/shipping-address.md +1 -1
  67. package/dist/docs/sign-in-redirect.md +7 -7
  68. package/dist/docs/toast.md +35 -13
  69. package/dist/index.d.ts +7 -2
  70. package/dist/index.js +2 -1
  71. package/dist/internal/client.d.ts +9 -1
  72. package/dist/internal/client.js +10 -2
  73. package/dist/internal/server.d.ts +8 -2
  74. package/dist/internal/server.js +8 -2
  75. package/dist/matter/account-access-gate/account-access-gate.d.ts +2 -1
  76. package/dist/matter/account-access-gate/account-access-gate.js +19 -16
  77. package/dist/matter/account-access-gate/account-access-gate.js.map +1 -1
  78. package/dist/matter/account-address-book/account-address-book-delete.d.ts +60 -0
  79. package/dist/matter/account-address-book/account-address-book-delete.js +184 -0
  80. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -0
  81. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +19 -0
  82. package/dist/matter/account-address-book/account-address-book-deliverability.js +50 -0
  83. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -0
  84. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +42 -0
  85. package/dist/matter/account-address-book/account-address-book-form-parts.js +146 -0
  86. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -0
  87. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +25 -0
  88. package/dist/matter/account-address-book/account-address-book-profile-notice.js +72 -0
  89. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -0
  90. package/dist/matter/account-address-book/account-address-book.d.ts +120 -0
  91. package/dist/matter/account-address-book/account-address-book.js +469 -0
  92. package/dist/matter/account-address-book/account-address-book.js.map +1 -0
  93. package/dist/matter/account-address-book/account-address-country-switch.js +59 -0
  94. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -0
  95. package/dist/matter/account-address-book/account-address-country.d.ts +36 -0
  96. package/dist/matter/account-address-book/account-address-country.js +151 -0
  97. package/dist/matter/account-address-book/account-address-country.js.map +1 -0
  98. package/dist/matter/account-address-book/account-address-first-line.js +11 -0
  99. package/dist/matter/account-address-book/account-address-first-line.js.map +1 -0
  100. package/dist/matter/account-address-book/account-address-form-context.d.ts +55 -0
  101. package/dist/matter/account-address-book/account-address-form-context.js +14 -0
  102. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -0
  103. package/dist/matter/account-address-book/account-address-form.d.ts +85 -0
  104. package/dist/matter/account-address-book/account-address-form.js +946 -0
  105. package/dist/matter/account-address-book/account-address-form.js.map +1 -0
  106. package/dist/matter/account-address-book/account-address-postal-autofill.js +189 -0
  107. package/dist/matter/account-address-book/account-address-postal-autofill.js.map +1 -0
  108. package/dist/matter/account-address-book/account-address-record.d.ts +26 -0
  109. package/dist/matter/account-address-book/account-address-record.js +138 -0
  110. package/dist/matter/account-address-book/account-address-record.js.map +1 -0
  111. package/dist/matter/account-entry-point/account-entry-point.js +11 -11
  112. package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
  113. package/dist/matter/account-menu/account-menu.d.ts +7 -3
  114. package/dist/matter/account-menu/account-menu.js +69 -28
  115. package/dist/matter/account-menu/account-menu.js.map +1 -1
  116. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
  117. package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
  118. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
  119. package/dist/matter/billing-address/billing-address.d.ts +30 -17
  120. package/dist/matter/billing-address/billing-address.js +128 -33
  121. package/dist/matter/billing-address/billing-address.js.map +1 -1
  122. package/dist/matter/breadcrumb/breadcrumb.js +2 -2
  123. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  124. package/dist/matter/card-entry/card-capture.js +4 -3
  125. package/dist/matter/card-entry/card-capture.js.map +1 -1
  126. package/dist/matter/card-entry/card-entry.d.ts +5 -3
  127. package/dist/matter/card-entry/card-entry.js +77 -27
  128. package/dist/matter/card-entry/card-entry.js.map +1 -1
  129. package/dist/matter/cardholder-document/cardholder-document.d.ts +10 -9
  130. package/dist/matter/cardholder-document/cardholder-document.js +36 -16
  131. package/dist/matter/cardholder-document/cardholder-document.js.map +1 -1
  132. package/dist/matter/cart/cart-namespace.d.ts +5 -1
  133. package/dist/matter/cart/cart-namespace.js +5 -1
  134. package/dist/matter/cart/cart-namespace.js.map +1 -1
  135. package/dist/matter/cart/cart.d.ts +41 -6
  136. package/dist/matter/cart/cart.js +267 -54
  137. package/dist/matter/cart/cart.js.map +1 -1
  138. package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
  139. package/dist/matter/cart-destination/cart-destination.js +613 -0
  140. package/dist/matter/cart-destination/cart-destination.js.map +1 -0
  141. package/dist/matter/cart-item/cart-item.d.ts +4 -2
  142. package/dist/matter/cart-item/cart-item.js +76 -17
  143. package/dist/matter/cart-item/cart-item.js.map +1 -1
  144. package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
  145. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  146. package/dist/matter/client-preferences/client-preferences-fieldset.js +1 -1
  147. package/dist/matter/client-profile-form/client-profile-fieldset.js +8 -5
  148. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  149. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
  150. package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
  151. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  152. package/dist/matter/identity-edit/identity-edit.js +3 -3
  153. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  154. package/dist/matter/identity-summary/identity-summary.js +2 -2
  155. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  156. package/dist/matter/my-account-profile/my-account-profile.d.ts +3 -3
  157. package/dist/matter/my-account-profile/my-account-profile.js +4 -4
  158. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  159. package/dist/matter/order-cancel/order-cancel.d.ts +110 -0
  160. package/dist/matter/order-cancel/order-cancel.js +344 -0
  161. package/dist/matter/order-cancel/order-cancel.js.map +1 -0
  162. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +73 -0
  163. package/dist/matter/order-delivery-address/order-delivery-address.js +172 -0
  164. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -0
  165. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +128 -0
  166. package/dist/matter/order-delivery-group/order-delivery-group.js +408 -0
  167. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -0
  168. package/dist/matter/order-details-header/order-details-header.d.ts +104 -0
  169. package/dist/matter/order-details-header/order-details-header.js +190 -0
  170. package/dist/matter/order-details-header/order-details-header.js.map +1 -0
  171. package/dist/matter/order-list/customer-orders-filter.d.ts +12 -0
  172. package/dist/matter/order-list/customer-orders-filter.js +30 -0
  173. package/dist/matter/order-list/customer-orders-filter.js.map +1 -0
  174. package/dist/matter/order-list/order-list.d.ts +121 -0
  175. package/dist/matter/order-list/order-list.js +395 -0
  176. package/dist/matter/order-list/order-list.js.map +1 -0
  177. package/dist/matter/order-list-row/order-list-row.d.ts +44 -0
  178. package/dist/matter/order-list-row/order-list-row.js +127 -0
  179. package/dist/matter/order-list-row/order-list-row.js.map +1 -0
  180. package/dist/matter/order-list-search/order-list-search.d.ts +72 -0
  181. package/dist/matter/order-list-search/order-list-search.js +296 -0
  182. package/dist/matter/order-list-search/order-list-search.js.map +1 -0
  183. package/dist/matter/order-list-views/order-list-views.d.ts +65 -0
  184. package/dist/matter/order-list-views/order-list-views.js +154 -0
  185. package/dist/matter/order-list-views/order-list-views.js.map +1 -0
  186. package/dist/matter/order-payment/order-payment.d.ts +83 -0
  187. package/dist/matter/order-payment/order-payment.js +258 -0
  188. package/dist/matter/order-payment/order-payment.js.map +1 -0
  189. package/dist/matter/order-placed/order-placed-deliveries.d.ts +145 -0
  190. package/dist/matter/order-placed/order-placed-deliveries.js +380 -0
  191. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -0
  192. package/dist/matter/order-placed/order-placed.d.ts +122 -0
  193. package/dist/matter/order-placed/order-placed.js +452 -0
  194. package/dist/matter/order-placed/order-placed.js.map +1 -0
  195. package/dist/matter/order-placed-date/order-placed-date.d.ts +45 -0
  196. package/dist/matter/order-placed-date/order-placed-date.js +92 -0
  197. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -0
  198. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +5 -8
  199. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +29 -81
  200. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  201. package/dist/matter/order-progress/order-progress.d.ts +85 -0
  202. package/dist/matter/order-progress/order-progress.js +203 -0
  203. package/dist/matter/order-progress/order-progress.js.map +1 -0
  204. package/dist/matter/order-summary/order-summary.d.ts +81 -0
  205. package/dist/matter/order-summary/order-summary.js +192 -0
  206. package/dist/matter/order-summary/order-summary.js.map +1 -0
  207. package/dist/matter/payment/cardholder-document-rule.d.ts +35 -0
  208. package/dist/matter/payment/cardholder-document-rule.js +35 -0
  209. package/dist/matter/payment/cardholder-document-rule.js.map +1 -0
  210. package/dist/matter/payment/payment-card-capture.js +38 -23
  211. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  212. package/dist/matter/payment/payment-controller.js +11 -0
  213. package/dist/matter/payment/payment-controller.js.map +1 -1
  214. package/dist/matter/payment/payment-method-badges.js +4 -2
  215. package/dist/matter/payment/payment-method-badges.js.map +1 -1
  216. package/dist/matter/payment/payment.js +11 -0
  217. package/dist/matter/payment/payment.js.map +1 -1
  218. package/dist/matter/payment/use-payment-method-selection.d.ts +39 -0
  219. package/dist/matter/payment/use-payment-method-selection.js +30 -2
  220. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  221. package/dist/matter/payment/use-payment-submit-gate.d.ts +16 -2
  222. package/dist/matter/payment/use-payment-submit-gate.js +42 -14
  223. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  224. package/dist/matter/place-order/place-order.d.ts +12 -7
  225. package/dist/matter/place-order/place-order.js +126 -103
  226. package/dist/matter/place-order/place-order.js.map +1 -1
  227. package/dist/matter/pricing/pricing.js +5 -5
  228. package/dist/matter/pricing/pricing.js.map +1 -1
  229. package/dist/matter/product-shelf/product-shelf.d.ts +7 -0
  230. package/dist/matter/product-shelf/product-shelf.js +115 -1
  231. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  232. package/dist/matter/region/region.js +1 -1
  233. package/dist/matter/saved-cards/saved-cards.js +26 -15
  234. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  235. package/dist/matter/session/session.js +2 -2
  236. package/dist/matter/session/session.js.map +1 -1
  237. package/dist/matter/shipping-address/country-descriptors.d.ts +1 -0
  238. package/dist/matter/shipping-address/country-descriptors.js +23 -1
  239. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  240. package/dist/matter/shipping-address/shipping-address.js +62 -14
  241. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  242. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +2 -2
  243. package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
  244. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  245. package/dist/matter/sign-in-redirect/sign-in-redirect.js +48 -10
  246. package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -1
  247. package/dist/matter/variant-selector/variant-selector.js +2 -2
  248. package/dist/matter/variant-selector/variant-selector.js.map +1 -1
  249. package/dist/particles/address-summary/address-summary.js +2 -2
  250. package/dist/particles/address-summary/address-summary.js.map +1 -1
  251. package/dist/particles/alert-dialog/alert-dialog.d.ts +5 -1
  252. package/dist/particles/alert-dialog/alert-dialog.js +5 -2
  253. package/dist/particles/alert-dialog/alert-dialog.js.map +1 -1
  254. package/dist/particles/binding-switcher/binding-switcher.d.ts +38 -0
  255. package/dist/particles/binding-switcher/binding-switcher.js +183 -0
  256. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
  257. package/dist/particles/card-summary/card-network.d.ts +17 -0
  258. package/dist/particles/card-summary/card-network.js +25 -0
  259. package/dist/particles/card-summary/card-network.js.map +1 -0
  260. package/dist/particles/card-summary/card-summary.d.ts +83 -0
  261. package/dist/particles/card-summary/card-summary.js +188 -0
  262. package/dist/particles/card-summary/card-summary.js.map +1 -0
  263. package/dist/particles/copy-text/copy-text.d.ts +28 -0
  264. package/dist/particles/copy-text/copy-text.js +140 -0
  265. package/dist/particles/copy-text/copy-text.js.map +1 -0
  266. package/dist/particles/document-field/document-field.d.ts +34 -5
  267. package/dist/particles/document-field/document-field.js +115 -19
  268. package/dist/particles/document-field/document-field.js.map +1 -1
  269. package/dist/particles/field/field.js +1 -1
  270. package/dist/particles/field/field.js.map +1 -1
  271. package/dist/particles/footer-link-group/footer-link-group.d.ts +6 -2
  272. package/dist/particles/footer-link-group/footer-link-group.js +18 -7
  273. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  274. package/dist/particles/footer-social/footer-social.d.ts +1 -1
  275. package/dist/particles/footer-social/footer-social.js +1 -1
  276. package/dist/particles/footer-social/footer-social.js.map +1 -1
  277. package/dist/particles/incentives/incentives.d.ts +7 -3
  278. package/dist/particles/incentives/incentives.js +8 -3
  279. package/dist/particles/incentives/incentives.js.map +1 -1
  280. package/dist/particles/logo/logo.d.ts +3 -2
  281. package/dist/particles/logo/logo.js +20 -8
  282. package/dist/particles/logo/logo.js.map +1 -1
  283. package/dist/particles/navigation-link/navigation-link.d.ts +2 -3
  284. package/dist/particles/navigation-link/navigation-link.js +4 -4
  285. package/dist/particles/navigation-link/navigation-link.js.map +1 -1
  286. package/dist/particles/navigation-link-list/navigation-link-list.d.ts +6 -2
  287. package/dist/particles/navigation-link-list/navigation-link-list.js +18 -7
  288. package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -1
  289. package/dist/particles/order-details-back/order-details-back.d.ts +28 -0
  290. package/dist/particles/order-details-back/order-details-back.js +52 -0
  291. package/dist/particles/order-details-back/order-details-back.js.map +1 -0
  292. package/dist/particles/order-status-badge/order-status-badge.d.ts +19 -0
  293. package/dist/particles/order-status-badge/order-status-badge.js +50 -0
  294. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -0
  295. package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
  296. package/dist/particles/payment-methods/payment-methods.js +1 -1
  297. package/dist/particles/payment-methods/payment-methods.js.map +1 -1
  298. package/dist/particles/phone-field/phone-field.js +2 -2
  299. package/dist/particles/phone-field/phone-field.js.map +1 -1
  300. package/dist/particles/select/select.js +6 -6
  301. package/dist/particles/select/select.js.map +1 -1
  302. package/dist/particles/toast/toast.d.ts +21 -7
  303. package/dist/particles/toast/toast.js +76 -8
  304. package/dist/particles/toast/toast.js.map +1 -1
  305. package/dist/schema.graphql +1376 -126
  306. package/dist/sdk/actions/address-action-provider.d.ts +16 -0
  307. package/dist/sdk/actions/address-action-provider.js +20 -0
  308. package/dist/sdk/actions/address-action-provider.js.map +1 -0
  309. package/dist/sdk/actions/analytics-action-provider.js +1 -1
  310. package/dist/sdk/actions/index.d.ts +5 -1
  311. package/dist/sdk/actions/index.js +5 -1
  312. package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
  313. package/dist/sdk/actions/locale-action-provider.js +20 -0
  314. package/dist/sdk/actions/locale-action-provider.js.map +1 -0
  315. package/dist/sdk/actions/order-action-provider.d.ts +12 -0
  316. package/dist/sdk/actions/order-action-provider.js +16 -0
  317. package/dist/sdk/actions/order-action-provider.js.map +1 -0
  318. package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
  319. package/dist/sdk/actions/saved-card-action-provider.js +16 -0
  320. package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
  321. package/dist/sdk/actions/types.d.ts +10 -2
  322. package/dist/sdk/address/address-fields.js +38 -0
  323. package/dist/sdk/address/address-fields.js.map +1 -0
  324. package/dist/sdk/address/checkout-readiness.js +17 -0
  325. package/dist/sdk/address/checkout-readiness.js.map +1 -0
  326. package/dist/sdk/address/constants.js +60 -0
  327. package/dist/sdk/address/constants.js.map +1 -0
  328. package/dist/sdk/address/country-display.js +19 -0
  329. package/dist/sdk/address/country-display.js.map +1 -0
  330. package/dist/sdk/address/country-rules.js +30 -0
  331. package/dist/sdk/address/country-rules.js.map +1 -0
  332. package/dist/sdk/address/format-address.js +18 -0
  333. package/dist/sdk/address/format-address.js.map +1 -0
  334. package/dist/sdk/address/iso-countries.js +262 -0
  335. package/dist/sdk/address/iso-countries.js.map +1 -0
  336. package/dist/sdk/address/layouts.js +56 -0
  337. package/dist/sdk/address/layouts.js.map +1 -0
  338. package/dist/sdk/address/messages.js +97 -0
  339. package/dist/sdk/address/messages.js.map +1 -0
  340. package/dist/sdk/address/operations.d.ts +54 -0
  341. package/dist/sdk/address/operations.js +83 -0
  342. package/dist/sdk/address/operations.js.map +1 -0
  343. package/dist/sdk/address/postal-code-lookup-operations.js +23 -0
  344. package/dist/sdk/address/postal-code-lookup-operations.js.map +1 -0
  345. package/dist/sdk/address/postal-code.js +11 -0
  346. package/dist/sdk/address/postal-code.js.map +1 -0
  347. package/dist/sdk/address/schema.js +14 -0
  348. package/dist/sdk/address/schema.js.map +1 -0
  349. package/dist/sdk/address/server-fields.js +25 -0
  350. package/dist/sdk/address/server-fields.js.map +1 -0
  351. package/dist/sdk/address/switch-country.js +57 -0
  352. package/dist/sdk/address/switch-country.js.map +1 -0
  353. package/dist/sdk/address/types.d.ts +26 -0
  354. package/dist/sdk/address/use-address-actions.d.ts +29 -0
  355. package/dist/sdk/address/use-address-actions.js +247 -0
  356. package/dist/sdk/address/use-address-actions.js.map +1 -0
  357. package/dist/sdk/address/use-address-by-postal-code.js +57 -0
  358. package/dist/sdk/address/use-address-by-postal-code.js.map +1 -0
  359. package/dist/sdk/address/validate-address.js +62 -0
  360. package/dist/sdk/address/validate-address.js.map +1 -0
  361. package/dist/sdk/cache/storefront-cache.js +30 -4
  362. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  363. package/dist/sdk/cart/operations.d.ts +2 -1
  364. package/dist/sdk/cart/operations.js +55 -1
  365. package/dist/sdk/cart/operations.js.map +1 -1
  366. package/dist/sdk/cart/optimistic.d.ts +30 -7
  367. package/dist/sdk/cart/optimistic.js +78 -41
  368. package/dist/sdk/cart/optimistic.js.map +1 -1
  369. package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
  370. package/dist/sdk/cart/use-cart-actions.js +61 -15
  371. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  372. package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
  373. package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
  374. package/dist/sdk/client/fetch-page-data.d.ts +11 -0
  375. package/dist/sdk/client/fetch-page-data.js +12 -1
  376. package/dist/sdk/client/fetch-page-data.js.map +1 -1
  377. package/dist/sdk/content/create-content-runtime.js +1 -8
  378. package/dist/sdk/content/create-content-runtime.js.map +1 -1
  379. package/dist/sdk/data/failed-fields.js +23 -0
  380. package/dist/sdk/data/failed-fields.js.map +1 -0
  381. package/dist/sdk/data/index.js +2 -2
  382. package/dist/sdk/data/page-reactive-data-root.d.ts +45 -7
  383. package/dist/sdk/data/page-reactive-data-root.js +88 -12
  384. package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
  385. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  386. package/dist/sdk/generated/fragment-types.js +2 -0
  387. package/dist/sdk/generated/fragment-types.js.map +1 -1
  388. package/dist/sdk/generated/gql.js +17 -11
  389. package/dist/sdk/generated/gql.js.map +1 -1
  390. package/dist/sdk/generated/graphql.d.ts +185 -46
  391. package/dist/sdk/generated/graphql.js +2587 -155
  392. package/dist/sdk/generated/graphql.js.map +1 -1
  393. package/dist/sdk/i18n/messages/en-US.js +157 -1
  394. package/dist/sdk/i18n/messages/en-US.json +157 -1
  395. package/dist/sdk/i18n/messages/en-US.json.d.ts +156 -0
  396. package/dist/sdk/i18n/messages/es-ES.js +157 -1
  397. package/dist/sdk/i18n/messages/es-ES.json +157 -1
  398. package/dist/sdk/i18n/messages/pt-BR.js +157 -1
  399. package/dist/sdk/i18n/messages/pt-BR.json +157 -1
  400. package/dist/sdk/i18n/provider.js +1 -1
  401. package/dist/sdk/i18n/provider.js.map +1 -1
  402. package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
  403. package/dist/sdk/locale/binding-switch-provider.js +20 -0
  404. package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
  405. package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
  406. package/dist/sdk/locale/use-locale-actions.js +70 -0
  407. package/dist/sdk/locale/use-locale-actions.js.map +1 -0
  408. package/dist/sdk/navigation/binding-switch.d.ts +39 -0
  409. package/dist/sdk/navigation/binding-switch.js +129 -0
  410. package/dist/sdk/navigation/binding-switch.js.map +1 -0
  411. package/dist/sdk/navigation/current-page.js +30 -0
  412. package/dist/sdk/navigation/current-page.js.map +1 -0
  413. package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
  414. package/dist/sdk/navigation/decode-route-params.js +32 -0
  415. package/dist/sdk/navigation/decode-route-params.js.map +1 -0
  416. package/dist/sdk/navigation/not-found-log.d.ts +28 -0
  417. package/dist/sdk/navigation/not-found-log.js +133 -0
  418. package/dist/sdk/navigation/not-found-log.js.map +1 -0
  419. package/dist/sdk/navigation/path.js +25 -0
  420. package/dist/sdk/navigation/path.js.map +1 -0
  421. package/dist/sdk/navigation/redirect.d.ts +11 -0
  422. package/dist/sdk/navigation/redirect.js +22 -0
  423. package/dist/sdk/navigation/redirect.js.map +1 -0
  424. package/dist/sdk/navigation/report.js +70 -0
  425. package/dist/sdk/navigation/report.js.map +1 -0
  426. package/dist/sdk/navigation/resolve-storefront-href.d.ts +12 -0
  427. package/dist/sdk/navigation/resolve-storefront-href.js +214 -0
  428. package/dist/sdk/navigation/resolve-storefront-href.js.map +1 -0
  429. package/dist/sdk/navigation/route-identity-provider.d.ts +11 -0
  430. package/dist/sdk/navigation/route-identity-provider.js +20 -0
  431. package/dist/sdk/navigation/route-identity-provider.js.map +1 -0
  432. package/dist/sdk/navigation/route-map-provider.d.ts +19 -0
  433. package/dist/sdk/navigation/route-map-provider.js +29 -0
  434. package/dist/sdk/navigation/route-map-provider.js.map +1 -0
  435. package/dist/sdk/navigation/storefront-link.d.ts +16 -0
  436. package/dist/sdk/navigation/storefront-link.js +66 -0
  437. package/dist/sdk/navigation/storefront-link.js.map +1 -0
  438. package/dist/sdk/navigation/types.d.ts +45 -0
  439. package/dist/sdk/navigation/use-storefront-navigation.d.ts +26 -0
  440. package/dist/sdk/navigation/use-storefront-navigation.js +73 -0
  441. package/dist/sdk/navigation/use-storefront-navigation.js.map +1 -0
  442. package/dist/sdk/navigation/use-storefront-route.d.ts +26 -0
  443. package/dist/sdk/navigation/use-storefront-route.js +87 -0
  444. package/dist/sdk/navigation/use-storefront-route.js.map +1 -0
  445. package/dist/sdk/navigation/use-storefront-search-params.d.ts +11 -0
  446. package/dist/sdk/navigation/use-storefront-search-params.js +16 -0
  447. package/dist/sdk/navigation/use-storefront-search-params.js.map +1 -0
  448. package/dist/sdk/orders/completion-badge.d.ts +8 -0
  449. package/dist/sdk/orders/completion-badge.js +47 -0
  450. package/dist/sdk/orders/completion-badge.js.map +1 -0
  451. package/dist/sdk/orders/order-operations.d.ts +19 -0
  452. package/dist/sdk/orders/order-operations.js +21 -0
  453. package/dist/sdk/orders/order-operations.js.map +1 -0
  454. package/dist/sdk/orders/use-order-actions.d.ts +23 -0
  455. package/dist/sdk/orders/use-order-actions.js +62 -0
  456. package/dist/sdk/orders/use-order-actions.js.map +1 -0
  457. package/dist/sdk/payment/gateway-origin.js +26 -13
  458. package/dist/sdk/payment/gateway-origin.js.map +1 -1
  459. package/dist/sdk/payment/gateway.d.ts +14 -2
  460. package/dist/sdk/payment/gateway.js +32 -14
  461. package/dist/sdk/payment/gateway.js.map +1 -1
  462. package/dist/sdk/payment/operations.js +11 -0
  463. package/dist/sdk/payment/operations.js.map +1 -1
  464. package/dist/sdk/payment/submission-registry.d.ts +2 -1
  465. package/dist/sdk/payment/submission-registry.js +12 -8
  466. package/dist/sdk/payment/submission-registry.js.map +1 -1
  467. package/dist/sdk/payment/use-payment-actions.d.ts +5 -3
  468. package/dist/sdk/payment/use-payment-actions.js +5 -2
  469. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  470. package/dist/sdk/payment/use-place-order.d.ts +6 -3
  471. package/dist/sdk/payment/use-place-order.js +333 -143
  472. package/dist/sdk/payment/use-place-order.js.map +1 -1
  473. package/dist/sdk/saved-cards/operations.d.ts +16 -0
  474. package/dist/sdk/saved-cards/operations.js +41 -0
  475. package/dist/sdk/saved-cards/operations.js.map +1 -0
  476. package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
  477. package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
  478. package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
  479. package/dist/sdk/seo/page-alternates.d.ts +57 -0
  480. package/dist/sdk/seo/page-alternates.js +127 -0
  481. package/dist/sdk/seo/page-alternates.js.map +1 -0
  482. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  483. package/dist/sdk/shipping/shipping-operations.js +13 -0
  484. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  485. package/dist/sdk/state/cart.d.ts +9 -2
  486. package/dist/sdk/state/cart.js +9 -2
  487. package/dist/sdk/state/cart.js.map +1 -1
  488. package/dist/utils/own-value.js +19 -0
  489. package/dist/utils/own-value.js.map +1 -0
  490. package/dist/utils/safe-href.d.ts +4 -4
  491. package/dist/utils/safe-href.js +31 -22
  492. package/dist/utils/safe-href.js.map +1 -1
  493. package/package.json +5 -1
  494. package/skills/storefront-asset/SKILL.md +111 -0
  495. package/skills/storefront-asset/references/api-side.md +153 -0
  496. package/skills/storefront-asset/references/findings.md +40 -0
  497. package/skills/storefront-asset/references/ui-side.md +94 -0
  498. package/src/styles/tailwind.css +28 -2
@@ -1,5 +1,6 @@
1
1
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
2
  import "../../core/dist/index.js";
3
+ import { PageRef } from "../../sdk/navigation/types.js";
3
4
  import "../../sdk/payment/operations.js";
4
5
  import { ComponentActions } from "../../sdk/actions/types.js";
5
6
  import { PlaceOrderData } from "../../sdk/payment/use-place-order.js";
@@ -10,6 +11,8 @@ export type PlaceOrderProps = ComponentPropsWithRef<'div'> & {
10
11
  label?: string;
11
12
  /** CTA label while the three-call sequence is in flight. */
12
13
  placingLabel?: string;
14
+ /** Status message shown beside the button for as long as the order is being placed. Absent or blank renders nothing. */
15
+ placingMessage?: string;
13
16
  /**
14
17
  * CTA label while a surviving attempt (T29) offers a resume — the card already left the browser
15
18
  * (`sent`) or its fate is unknown (`unresolved`), and the next click finalizes it rather than running
@@ -41,6 +44,8 @@ export type PlaceOrderProps = ComponentPropsWithRef<'div'> & {
41
44
  unsavedBillingAddressMessage?: string;
42
45
  /** Shown when the new-card draft itself fails validation before ever reaching the gateway. */
43
46
  invalidCardDataMessage?: string;
47
+ /** Shown when the typed card number is well-formed but no payment network the store accepts claims it (T47). */
48
+ unsupportedNetworkMessage?: string;
44
49
  /** Shown when a saved-card submission is refused for a missing or invalid CVV. */
45
50
  invalidSecurityCodeMessage?: string;
46
51
  /** Shown when the payment gateway itself refuses the submitted card. */
@@ -56,19 +61,19 @@ export type PlaceOrderProps = ComponentPropsWithRef<'div'> & {
56
61
  */
57
62
  unconfirmedMessage?: string;
58
63
  /**
59
- * Route template navigated to after a successful placement. The literal `{orderGroup}` is
60
- * replaced by the placed order's group, percent-encoded. Absent ⇒ no navigation. Must resolve to
61
- * the current page's origin — an absolute, protocol-relative, or non-http(s) template is refused
62
- * rather than navigated to (fail closed, dev-only warn; fix pass, finding S1).
63
- * e.g. "/reserva/checkout/order-placed/{orderGroup}"
64
+ * Where the shopper lands after a successful placement. A page reference gets the placed order's
65
+ * group as its `orderGroup` param. A string is a logical path of this store, navigated as written;
66
+ * an absolute, protocol-relative, or non-http(s) value, or a `{orderGroup}` template, is refused
67
+ * rather than navigated to (fail closed, dev-only warn).
68
+ * e.g. `{ standard: 'order-placed' }`
64
69
  */
65
- successHref?: string;
70
+ successHref?: PageRef | string;
66
71
  /** `Payment` slice forwarded by the reactive runtime (arity-1, ADR-0015) — `null` until it resolves. */
67
72
  $data?: PlaceOrderData;
68
73
  /** Compiler-injected action surface; carries `payment.startTransaction`, `payment.gatewayCallback`, `analytics.track`. */
69
74
  $actions?: ComponentActions;
70
75
  };
71
76
  export declare const PlaceOrderDefinition: ComponentDefinition<PlaceOrderProps>;
72
- export declare function PlaceOrder({ label, placingLabel, resumeLabel, successMessage, missingSubmissionMessage, missingMethodMessage, invalidTransactionMessage, networkErrorMessage, missingDocumentMessage, invalidDocumentMessage, unavailableMethodMessage, unsavedBillingAddressMessage, invalidCardDataMessage, invalidSecurityCodeMessage, gatewayErrorMessage, inFlightMessage, unconfirmedMessage, successHref, $data: $dataProp, $actions: $actionsProp, className, ...props }: PlaceOrderProps): import("react/jsx-runtime").JSX.Element;
77
+ export declare function PlaceOrder({ label, placingLabel, placingMessage, resumeLabel, successMessage, missingSubmissionMessage, missingMethodMessage, invalidTransactionMessage, networkErrorMessage, missingDocumentMessage, invalidDocumentMessage, unavailableMethodMessage, unsavedBillingAddressMessage, invalidCardDataMessage, unsupportedNetworkMessage, invalidSecurityCodeMessage, gatewayErrorMessage, inFlightMessage, unconfirmedMessage, successHref, $data: $dataProp, $actions: $actionsProp, className, ...props }: PlaceOrderProps): import("react/jsx-runtime").JSX.Element;
73
78
  //#endregion
74
79
  //# sourceMappingURL=place-order.d.ts.map
@@ -1,15 +1,16 @@
1
1
  "use client";
2
2
  import { defineComponent } from "../../core/dist/define-component.js";
3
3
  import "../../core/dist/index.js";
4
+ import { resolveSiteRelativeHref } from "../../utils/safe-href.js";
5
+ import { useStorefrontNavigation } from "../../sdk/navigation/use-storefront-navigation.js";
4
6
  import { useActionsOverride } from "../../sdk/actions/actions-override-context.js";
5
7
  import { useDataOverride } from "../../sdk/data/data-override-context.js";
6
- import { usePayment } from "../payment/payment.js";
7
8
  import { Button } from "../../particles/button/button.js";
8
- import { usePaymentSubmitGate } from "../payment/use-payment-submit-gate.js";
9
+ import { usePayment } from "../payment/payment.js";
10
+ import { refusalTargetOf, usePaymentSubmitGate } from "../payment/use-payment-submit-gate.js";
9
11
  import { usePlaceOrder } from "../../sdk/payment/use-place-order.js";
10
12
  import { useEffect, useId, useLayoutEffect, useState } from "react";
11
- import { jsx, jsxs } from "react/jsx-runtime";
12
- import { useRouter } from "next/navigation";
13
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
14
  const PlaceOrderDefinition = defineComponent({
14
15
  name: "PlaceOrder",
15
16
  importPath: "@vtex/faststore/components",
@@ -58,6 +59,10 @@ const PlaceOrderDefinition = defineComponent({
58
59
  default: "Placing order...",
59
60
  label: "Button label while placing"
60
61
  },
62
+ placingMessage: {
63
+ type: "string",
64
+ label: "Message shown while placing the order"
65
+ },
61
66
  resumeLabel: {
62
67
  type: "string",
63
68
  default: "Complete your order",
@@ -113,6 +118,11 @@ const PlaceOrderDefinition = defineComponent({
113
118
  default: "Enter valid card details before placing the order.",
114
119
  label: "Invalid card data message"
115
120
  },
121
+ unsupportedNetworkMessage: {
122
+ type: "string",
123
+ default: "This card is not from a network the store accepts. Use another card or choose another payment method.",
124
+ label: "Unsupported card network message"
125
+ },
116
126
  invalidSecurityCodeMessage: {
117
127
  type: "string",
118
128
  default: "Enter a valid security code before placing the order.",
@@ -134,103 +144,80 @@ const PlaceOrderDefinition = defineComponent({
134
144
  label: "Unconfirmed order message"
135
145
  },
136
146
  successHref: {
137
- type: "string",
138
- label: "Confirmation route template ({orderGroup} token)"
147
+ type: "link",
148
+ default: { standard: "order-placed" },
149
+ fills: ["orderGroup"],
150
+ label: "Confirmation Page"
139
151
  }
140
152
  },
141
- guideline: "The place-order CTA: invokes usePlaceOrder's three-call sequence (start transaction, the registered submission's own direct-to-gateway leg, then the gateway callback) and blocks interaction while it runs. Compose it as a sibling — never a child — of every other payment-entry leaf under the same PaymentSectionRoot or PaymentSectionController, so the one CTA serves every entry path. Renders one inline outcome after settling: the first userError's message, or successMessage on a clean settle. This component reaches no payment-sensitive input. Must be inside a payment root. See place-order.md."
153
+ guideline: "The place-order CTA: invokes usePlaceOrder's three-call sequence (start transaction, the registered submission's own direct-to-gateway leg, then the gateway callback) and blocks interaction while it runs. Compose it as a sibling — never a child — of every other payment-entry leaf under the same PaymentSectionRoot or PaymentSectionController, so the one CTA serves every entry path. Renders one inline outcome after settling: the first userError's message, or successMessage on a clean settle. While the order is being placed it renders nothing but the button, unless placingMessage is set: then a status message shows beside the button, and the rest of the payment form is blocked for as long as it shows. This component reaches no payment-sensitive input. Must be inside a payment root. See place-order.md."
142
154
  });
155
+ /** The default confirmation page. */
156
+ const ORDER_PLACED_PAGE = { standard: "order-placed" };
143
157
  /**
144
- * OQ-6 (2026-08-12 spec gate, `specs/navigate-the-shopper-to-the-order.md`): a `successHref` missing
145
- * the `{orderGroup}` placeholder is a store-authoring mistake — every order would land on the same
146
- * literal URL, which then renders unresolved. Fail closed instead of navigating there, and warn in
147
- * development only, mirroring `variant-selector.tsx`'s `warnUnresolvedAxis`.
148
- *
149
- * Named and worded around "token" rather than the spec's own word for this: that word contains
150
- * `holder` as a substring (the same reason `cardholder` matches), which trips `CARD_FIELD_PATTERN`
151
- * (`card-field-pattern.ts`) — the pattern `place-order.test.tsx`'s "card-data boundary" suite asserts
152
- * never matches this file's source text.
158
+ * Fail-closed warning for a string `successHref` that is not a path of this store. Nothing upstream
159
+ * validates a string prop's shape, and an absolute or protocol-relative value would turn this CTA into
160
+ * an open redirect that fires right after a real purchase, carrying the shopper's own order group to
161
+ * another origin. Dev-only, like every other authoring warning in this component.
153
162
  */
154
- function warnMissingOrderGroupToken(successHref) {
163
+ function warnUnsafeSuccessHref(successHref, reason) {
155
164
  if (process.env.NODE_ENV === "production") return;
156
- console.warn(`[PlaceOrder] successHref "${successHref}" has no {orderGroup} token; refusing to navigate there rather than sending every order to the same URL.`);
165
+ console.warn(`[PlaceOrder] successHref "${successHref}" is not a path of this store (${reason}); refusing to navigate there rather than sending the shopper off-site right after a purchase.`);
157
166
  }
158
167
  /**
159
- * Fix pass, finding S1 (High, CWE-601 open redirect): nothing upstream validates `successHref`'s
160
- * shape — the schema field is a bare `{type: 'string'}` with no pattern/format/enum, sukima never
161
- * inspects prop values, and this runtime's only prior check was the `{orderGroup}` substring test
162
- * above, which an absolute or protocol-relative template still satisfies
163
- * (`"https://evil.example/{orderGroup}"`, `"//evil.example/{orderGroup}"`). Left unchecked, a store
164
- * schema can turn this CTA into an open redirect that fires immediately after a real purchase,
165
- * carrying the shopper's own order group to an attacker-controlled origin.
166
- *
167
- * Resolves the template against the current origin with the same parser Next.js's own router applies
168
- * internally to decide "external" (`dispatchNavigateAction` -> `new URL(href, location.href)` ->
169
- * `isExternalURL`), rather than a `startsWith('/')` string check: a prefix check alone is bypassed by
170
- * a leading backslash or an embedded control character — `new URL('/\\evil.example', origin)` and
171
- * `new URL('/\t/evil.example', origin)` both resolve to the `evil.example` origin under the WHATWG URL
172
- * parser (the same parser the browser itself applies before navigating) while starting with a single
173
- * `/` and not `//`. Asking the parser the same question it is asked again downstream is what makes
174
- * this bypass-proof; it also rejects `javascript:` and other non-http(s) schemes for free, since their
175
- * `.origin` is the literal string `"null"`, which never equals a real page origin (finding S2).
168
+ * Fail-closed warning for a string `successHref` that still carries a `{token}`, the template form this
169
+ * prop took before page references. Nothing fills the token any more, so navigating would land the
170
+ * shopper on a literal `%7BorderGroup%7D` 404 right after paying. Dev-only.
176
171
  */
177
- function isSameOriginTemplate(successHref) {
178
- try {
179
- return new URL(successHref, window.location.origin).origin === window.location.origin;
180
- } catch {
181
- return false;
182
- }
183
- }
184
- /** Fail-closed counterpart of `warnMissingOrderGroupToken`, for a `successHref` that resolves off the
185
- * current origin (finding S1) — same dev-only, non-production channel. */
186
- function warnUnsafeSuccessHref(successHref) {
172
+ function warnTemplateSuccessHref(successHref) {
187
173
  if (process.env.NODE_ENV === "production") return;
188
- console.warn(`[PlaceOrder] successHref "${successHref}" resolves to a different origin than the current page; refusing to navigate there rather than sending the shopper off-site right after a purchase.`);
174
+ console.warn(`[PlaceOrder] successHref "${successHref}" is a route template; refusing to navigate there. Reference the confirmation page instead: { standard: 'order-placed' }.`);
189
175
  }
190
176
  /**
191
- * Fix pass, finding R1 (High): `useRouter()` requires an App Router context, and `PlaceOrder` used to
192
- * call it unconditionally — so the component could not render at all outside one, even for every
193
- * composition that never sets `successHref` (`place-order.stories.tsx`'s four stories, which mount
194
- * under no such context, were the concrete in-repo victim). Splitting the hook into its own child,
195
- * rendered only while `successHref` is set (see the call site below), means `useRouter()` — and the
196
- * App Router requirement that comes with it — is invoked only once a store has actually opted into the
197
- * navigation. This restores INV-4 / NFR-1 / US-3 AC1: with `successHref` absent, `PlaceOrder` neither
198
- * renders this child nor calls `useRouter()` at all.
177
+ * Navigates once `orderId` transitions to a non-empty value — not on `succeeded` (Decision 4) — so a
178
+ * null or empty order group and every failure path never navigate. `userErrors` is also consulted
179
+ * directly (INV-1): this component does not own `usePlaceOrder`, so it does not rely on that hook never
180
+ * settling an order id beside an error.
199
181
  *
200
- * The effect is otherwise T43's original: navigates once `orderId` transitions to a non-empty value —
201
- * not on `succeeded` (Decision 4) — so a null or empty order group (fix pass, finding R4) and every
202
- * failure path never navigate. `userErrors` is also consulted directly (fix pass, finding R3 / INV-1):
203
- * today's real `usePlaceOrder` never settles a non-empty `orderId` alongside a non-empty `userErrors`,
204
- * but this component does not own that hook and should not rely on an invariant of it that T29 is
205
- * about to rework (spec Decision 1) — checking both fields here keeps INV-1 true by this component's
206
- * own construction, not by inheritance from a hook it does not control.
182
+ * The call site passes `displayOrderId` (`orderId ?? the surviving attempt's own orderId`), not the
183
+ * mount-local `orderId` this type is named for: a remounted CTA whose own `usePlaceOrder()` never ran
184
+ * has an empty local `orderId` forever, and would otherwise leave the shopper on the payment page.
207
185
  *
208
- * Fix pass (Low finding, T29): the call site below passes `displayOrderId` (`orderId ?? the surviving
209
- * attempt's own orderId`), not the mount-local `orderId` this type is named for — a remounted CTA
210
- * whose own `usePlaceOrder()` never itself ran (it read an already-`settled` attempt straight from
211
- * `usePayment()`) has an empty local `orderId` forever, so passing the local value here left a store
212
- * whose only confirmation surface is `successHref` stuck on the payment page after exactly the remount
213
- * this task exists to make safe: `succeeded` rendered (from the shared attempt) but `router.replace`
214
- * never fired (from the mount-local, always-null `orderId`).
186
+ * The effect keys on the serialized `successHref`, not on its identity: a reference authored in a
187
+ * schema arrives as a new object on every server render, and keying on it would navigate again on a
188
+ * `router.refresh()`.
215
189
  */
216
190
  function PlaceOrderNavigateOnSuccess({ successHref, orderId, userErrors }) {
217
- const router = useRouter();
191
+ const { replace } = useStorefrontNavigation();
192
+ const successKey = JSON.stringify(successHref);
218
193
  useEffect(() => {
219
194
  if (!orderId || userErrors.length > 0) return;
220
- if (!isSameOriginTemplate(successHref)) {
221
- warnUnsafeSuccessHref(successHref);
195
+ const authored = JSON.parse(successKey);
196
+ if (typeof authored !== "string") {
197
+ replace({
198
+ ...authored,
199
+ params: {
200
+ ...authored.params,
201
+ orderGroup: orderId
202
+ }
203
+ });
204
+ return;
205
+ }
206
+ const destination = resolveSiteRelativeHref(authored);
207
+ if (!destination.safe) {
208
+ warnUnsafeSuccessHref(authored, destination.reason);
222
209
  return;
223
210
  }
224
- if (!successHref.includes("{orderGroup}")) {
225
- warnMissingOrderGroupToken(successHref);
211
+ if (destination.href.includes("{")) {
212
+ warnTemplateSuccessHref(authored);
226
213
  return;
227
214
  }
228
- router.replace(successHref.replaceAll("{orderGroup}", encodeURIComponent(orderId)));
215
+ replace(destination.href);
229
216
  }, [
230
217
  orderId,
231
- successHref,
218
+ successKey,
232
219
  userErrors,
233
- router
220
+ replace
234
221
  ]);
235
222
  return null;
236
223
  }
@@ -254,6 +241,7 @@ function buildAuthoredErrorMessages(messages) {
254
241
  INVALID_CARDHOLDER_DOCUMENT: messages.invalidDocumentMessage,
255
242
  UNSAVED_BILLING_ADDRESS: messages.unsavedBillingAddressMessage,
256
243
  INVALID_CARD_DATA: messages.invalidCardDataMessage,
244
+ UNSUPPORTED_CARD_NETWORK: messages.unsupportedNetworkMessage,
257
245
  INVALID_SECURITY_CODE: messages.invalidSecurityCodeMessage,
258
246
  GATEWAY_ERROR: messages.gatewayErrorMessage,
259
247
  PLACE_ORDER_IN_FLIGHT: messages.inFlightMessage,
@@ -278,11 +266,52 @@ function buildAuthoredErrorMessages(messages) {
278
266
  function resolveErrorMessage(error, authored) {
279
267
  return authored[error.code] || error.message;
280
268
  }
281
- function PlaceOrder({ label = "Place order", placingLabel = "Placing order...", resumeLabel = "Complete your order", successMessage = "Order placed successfully.", missingSubmissionMessage = "Enter your payment details before placing the order.", missingMethodMessage = "Choose a payment method before placing the order.", invalidTransactionMessage = "Unable to start the payment. Please try again.", networkErrorMessage = "Unable to complete the request. Please try again.", missingDocumentMessage = "Enter your document before placing the order.", invalidDocumentMessage = "Enter a valid document before placing the order.", unavailableMethodMessage = "Choose another payment method before placing the order.", unsavedBillingAddressMessage = "Save your billing address before placing the order.", invalidCardDataMessage = "Enter valid card details before placing the order.", invalidSecurityCodeMessage = "Enter a valid security code before placing the order.", gatewayErrorMessage = "Unable to complete the payment. Please try again.", inFlightMessage = "This order is already being placed. Please wait.", unconfirmedMessage = "We could not confirm your order yet. Your payment may still be processing, so please do not pay again.", successHref, $data: $dataProp, $actions: $actionsProp, className, ...props }) {
269
+ /**
270
+ * The CTA's feedback nodes: the authored placing message, the alert for a refusal, the status notice for
271
+ * an order that could not be confirmed (T176), and the success line. Rendered as the CTA's own children,
272
+ * so none of them adds a wrapper.
273
+ */
274
+ function PlaceOrderFeedback({ placing, placingMessage, firstError, unconfirmed, succeeded, successMessage, displayOrderId, authoredErrorMessages }) {
275
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
276
+ placing && placingMessage?.trim() ? /* @__PURE__ */ jsx("output", {
277
+ "data-fs-place-order-placing": "",
278
+ children: placingMessage
279
+ }) : null,
280
+ firstError && !unconfirmed ? /* @__PURE__ */ jsx("div", {
281
+ role: "alert",
282
+ "data-fs-place-order-error": "",
283
+ children: resolveErrorMessage(firstError, authoredErrorMessages)
284
+ }) : null,
285
+ firstError && unconfirmed && !succeeded ? /* @__PURE__ */ jsx("output", {
286
+ "data-fs-place-order-unconfirmed": "",
287
+ children: resolveErrorMessage(firstError, authoredErrorMessages)
288
+ }) : null,
289
+ succeeded ? /* @__PURE__ */ jsxs("output", {
290
+ "data-fs-place-order-success": "",
291
+ children: [/* @__PURE__ */ jsx("span", {
292
+ "data-fs-place-order-success-message": "",
293
+ children: successMessage
294
+ }), displayOrderId ? /* @__PURE__ */ jsx("span", {
295
+ "data-fs-place-order-success-order-id": "",
296
+ children: displayOrderId
297
+ }) : null]
298
+ }) : null
299
+ ] });
300
+ }
301
+ /**
302
+ * T212: where focus moves after a refusal. Only a refusal raised before anything left the browser
303
+ * (`reachedGateway === false`) that names an element the shopper must fix has a target; a result the
304
+ * gateway returned never does, whatever its code.
305
+ */
306
+ function refusalFocusTarget(refusals, reachedGateway) {
307
+ const [refusal] = refusals;
308
+ return reachedGateway === false && refusal ? refusalTargetOf(refusal) : null;
309
+ }
310
+ function PlaceOrder({ label = "Place order", placingLabel = "Placing order...", placingMessage, resumeLabel = "Complete your order", successMessage = "Order placed successfully.", missingSubmissionMessage = "Enter your payment details before placing the order.", missingMethodMessage = "Choose a payment method before placing the order.", invalidTransactionMessage = "Unable to start the payment. Please try again.", networkErrorMessage = "Unable to complete the request. Please try again.", missingDocumentMessage = "Enter your document before placing the order.", invalidDocumentMessage = "Enter a valid document before placing the order.", unavailableMethodMessage = "Choose another payment method before placing the order.", unsavedBillingAddressMessage = "Save your billing address before placing the order.", invalidCardDataMessage = "Enter valid card details before placing the order.", unsupportedNetworkMessage = "This card is not from a network the store accepts. Use another card or choose another payment method.", invalidSecurityCodeMessage = "Enter a valid security code before placing the order.", gatewayErrorMessage = "Unable to complete the payment. Please try again.", inFlightMessage = "This order is already being placed. Please wait.", unconfirmedMessage = "We could not confirm your order yet. Your payment may still be processing, so please do not pay again.", successHref = ORDER_PLACED_PAGE, $data: $dataProp, $actions: $actionsProp, className, ...props }) {
282
311
  const $data = useDataOverride($dataProp);
283
312
  const $actions = useActionsOverride($actionsProp);
284
313
  const instanceKey = useId();
285
- const { draft, placing: sectionPlacing, setPlacing, attempt, setAttempt } = usePayment();
314
+ const { draft, placing: sectionPlacing, setPlacing, attempt, setAttempt, focusRefusal } = usePayment();
286
315
  const submitGate = usePaymentSubmitGate();
287
316
  const { placeOrder, placing, userErrors, orderId } = usePlaceOrder({
288
317
  $data,
@@ -301,6 +330,7 @@ function PlaceOrder({ label = "Place order", placingLabel = "Placing order...",
301
330
  invalidDocumentMessage,
302
331
  unsavedBillingAddressMessage,
303
332
  invalidCardDataMessage,
333
+ unsupportedNetworkMessage,
304
334
  invalidSecurityCodeMessage,
305
335
  gatewayErrorMessage,
306
336
  inFlightMessage,
@@ -320,7 +350,7 @@ function PlaceOrder({ label = "Place order", placingLabel = "Placing order...",
320
350
  setPlacing
321
351
  ]);
322
352
  const [firstError] = userErrors;
323
- const settledAttemptOrderId = attempt && attempt.phase === "settled" ? attempt.orderId : null;
353
+ const settledAttemptOrderId = attempt?.phase === "settled" ? attempt.orderId : null;
324
354
  const succeeded = attempted && !placing && userErrors.length === 0 || attempt?.phase === "settled";
325
355
  const resumable = attempt?.phase === "sent" || attempt?.phase === "unresolved";
326
356
  const displayOrderId = orderId ?? settledAttemptOrderId;
@@ -328,7 +358,11 @@ function PlaceOrder({ label = "Place order", placingLabel = "Placing order...",
328
358
  const blockedByOtherInstance = sectionPlacing && !resumable;
329
359
  function handleClick() {
330
360
  setAttempted(false);
331
- placeOrder().then(() => setAttempted(true));
361
+ placeOrder().then(({ userErrors: refusals, reachedGateway }) => {
362
+ setAttempted(true);
363
+ const target = refusalFocusTarget(refusals, reachedGateway);
364
+ if (target) focusRefusal(target);
365
+ });
332
366
  }
333
367
  return /* @__PURE__ */ jsxs("div", {
334
368
  ...props,
@@ -344,32 +378,21 @@ function PlaceOrder({ label = "Place order", placingLabel = "Placing order...",
344
378
  ...placing ? { "data-fs-place-order-button-pending": "" } : {},
345
379
  children: placing ? placingLabel : resumable ? resumeLabel : label
346
380
  }),
347
- firstError && !unconfirmed ? /* @__PURE__ */ jsx("div", {
348
- role: "alert",
349
- "data-fs-place-order-error": "",
350
- children: resolveErrorMessage(firstError, authoredErrorMessages)
351
- }) : null,
352
- firstError && unconfirmed && !succeeded ? /* @__PURE__ */ jsx("div", {
353
- role: "status",
354
- "data-fs-place-order-unconfirmed": "",
355
- children: resolveErrorMessage(firstError, authoredErrorMessages)
356
- }) : null,
357
- succeeded ? /* @__PURE__ */ jsxs("div", {
358
- role: "status",
359
- "data-fs-place-order-success": "",
360
- children: [/* @__PURE__ */ jsx("span", {
361
- "data-fs-place-order-success-message": "",
362
- children: successMessage
363
- }), displayOrderId ? /* @__PURE__ */ jsx("span", {
364
- "data-fs-place-order-success-order-id": "",
365
- children: displayOrderId
366
- }) : null]
367
- }) : null,
368
- successHref != null ? /* @__PURE__ */ jsx(PlaceOrderNavigateOnSuccess, {
381
+ /* @__PURE__ */ jsx(PlaceOrderFeedback, {
382
+ placing,
383
+ placingMessage,
384
+ firstError,
385
+ unconfirmed,
386
+ succeeded,
387
+ successMessage,
388
+ displayOrderId,
389
+ authoredErrorMessages
390
+ }),
391
+ /* @__PURE__ */ jsx(PlaceOrderNavigateOnSuccess, {
369
392
  successHref,
370
393
  orderId: displayOrderId,
371
394
  userErrors
372
- }) : null
395
+ })
373
396
  ]
374
397
  });
375
398
  }