@vtex/faststore 0.0.10 → 0.0.11
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.
- package/CHANGELOG.md +42 -0
- package/README.md +0 -1
- package/dist/actions.json +6 -1
- package/dist/catalog.json +789 -1701
- package/dist/cli/index.d.ts +66 -28
- package/dist/cli/index.js +7371 -512
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/server-runtime.js +41 -60
- package/dist/cli/server-runtime.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/components.d.ts +63 -57
- package/dist/components.js +60 -54
- package/dist/content-types.json +5785 -754
- package/dist/core/dist/define-component.d.ts +1 -1
- package/dist/core/dist/define-content-type.d.ts +50 -2
- package/dist/core/dist/define-content-type.js +107 -3
- package/dist/core/dist/define-content-type.js.map +1 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/access-code-field.md +1 -1
- package/dist/docs/access-code-sign-in.md +126 -77
- package/dist/docs/account-address-book.md +210 -95
- package/dist/docs/account-menu.md +14 -15
- package/dist/docs/account-saved-cards.md +44 -39
- package/dist/docs/alert-dialog.md +3 -1
- package/dist/docs/avatar.md +4 -2
- package/dist/docs/billing-address.md +99 -30
- package/dist/docs/binding-switcher.md +5 -2
- package/dist/docs/buy-button.md +7 -8
- package/dist/docs/card-entry.md +39 -26
- package/dist/docs/card-summary.md +18 -8
- package/dist/docs/cardholder-document.md +5 -3
- package/dist/docs/carousel.md +5 -4
- package/dist/docs/cart-destination.md +39 -26
- package/dist/docs/cart-item.md +29 -14
- package/dist/docs/cart-totalizer.md +7 -5
- package/dist/docs/cart.md +135 -41
- package/dist/docs/challenge-return.md +135 -0
- package/dist/docs/client-preferences-fieldset.md +10 -5
- package/dist/docs/client-preferences.md +31 -8
- package/dist/docs/client-profile-fieldset.md +20 -6
- package/dist/docs/client-profile.md +12 -3
- package/dist/docs/copy-text.md +9 -7
- package/dist/docs/document-field.md +1 -1
- package/dist/docs/email-field.md +2 -1
- package/dist/docs/email-identification.md +12 -2
- package/dist/docs/footer-copyright.md +4 -2
- package/dist/docs/form.md +54 -18
- package/dist/docs/free-shipping-progress.md +6 -5
- package/dist/docs/identity-edit.md +8 -2
- package/dist/docs/identity-summary.md +18 -5
- package/dist/docs/installments.md +46 -32
- package/dist/docs/my-account-profile.md +16 -11
- package/dist/docs/navigation-link.md +5 -3
- package/dist/docs/order-cancel.md +3 -1
- package/dist/docs/order-delivery-address.md +7 -5
- package/dist/docs/order-delivery-group.md +1 -3
- package/dist/docs/order-details-back.md +1 -1
- package/dist/docs/order-details-header.md +1 -4
- package/dist/docs/order-invoice-download.md +60 -0
- package/dist/docs/order-list-row.md +1 -1
- package/dist/docs/order-list-search.md +13 -20
- package/dist/docs/order-list-views.md +11 -17
- package/dist/docs/order-list.md +12 -5
- package/dist/docs/order-payment.md +9 -7
- package/dist/docs/order-placed-date.md +1 -1
- package/dist/docs/order-placed-payment-summary.md +28 -15
- package/dist/docs/order-placed.md +49 -14
- package/dist/docs/order-progress.md +1 -1
- package/dist/docs/order-status-badge.md +20 -9
- package/dist/docs/order-summary.md +2 -2
- package/dist/docs/order-tracking-link.md +58 -0
- package/dist/docs/payment-method-badges.md +30 -4
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/payment.md +36 -17
- package/dist/docs/phone-field.md +4 -4
- package/dist/docs/place-order.md +84 -36
- package/dist/docs/postal-code-field.md +3 -1
- package/dist/docs/pricing.md +21 -23
- package/dist/docs/product-gallery.md +19 -20
- package/dist/docs/product-information.md +13 -9
- package/dist/docs/product-list.md +7 -6
- package/dist/docs/product-shelf.md +0 -1
- package/dist/docs/promotion.md +4 -2
- package/dist/docs/region.md +23 -15
- package/dist/docs/save-card.md +7 -6
- package/dist/docs/saved-cards.md +65 -36
- package/dist/docs/shipping-address.md +57 -21
- package/dist/docs/shipping-simulator.md +53 -15
- package/dist/docs/sign-in-disclosure.md +176 -0
- package/dist/docs/sign-in-form.md +78 -47
- package/dist/docs/sign-in-redirect.md +4 -2
- package/dist/docs/sign-in.md +173 -0
- package/dist/docs/toast.md +15 -4
- package/dist/docs/variant-selector.md +15 -11
- package/dist/graphql/types.d.ts +4 -14
- package/dist/index.d.ts +2 -2
- package/dist/internal/client.d.ts +1 -3
- package/dist/internal/client.js +1 -1
- package/dist/internal/server.d.ts +7 -4
- package/dist/internal/server.js +7 -4
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
- package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
- package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
- package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
- package/dist/matter/account-address-book/account-address-book.js +74 -33
- package/dist/matter/account-address-book/account-address-book.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
- package/dist/matter/account-address-book/account-address-country.js +83 -49
- package/dist/matter/account-address-book/account-address-country.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
- package/dist/matter/account-address-book/account-address-form.js +518 -155
- package/dist/matter/account-address-book/account-address-form.js.map +1 -1
- package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-record.js +32 -17
- package/dist/matter/account-address-book/account-address-record.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +34 -17
- package/dist/matter/account-menu/account-menu.js +46 -54
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
- package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
- package/dist/matter/billing-address/billing-address.d.ts +156 -74
- package/dist/matter/billing-address/billing-address.js +227 -156
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
- package/dist/matter/breadcrumb/breadcrumb.js +24 -9
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/buy-button/buy-button.d.ts +8 -11
- package/dist/matter/buy-button/buy-button.js +10 -19
- package/dist/matter/buy-button/buy-button.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +12 -4
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +123 -32
- package/dist/matter/card-entry/card-entry.js +348 -221
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +7 -1
- package/dist/matter/cart/cart-namespace.js +7 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +402 -61
- package/dist/matter/cart/cart.js +624 -153
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
- package/dist/matter/cart-destination/cart-destination.js +160 -70
- package/dist/matter/cart-destination/cart-destination.js.map +1 -1
- package/dist/matter/cart-item/cart-item.d.ts +144 -17
- package/dist/matter/cart-item/cart-item.js +166 -49
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
- package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
- package/dist/matter/challenge-return/challenge-return.js +241 -0
- package/dist/matter/challenge-return/challenge-return.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
- package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
- package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
- package/dist/matter/client-preferences/client-preferences.js +84 -15
- package/dist/matter/client-preferences/client-preferences.js.map +1 -1
- package/dist/matter/client-profile/client-profile.d.ts +44 -9
- package/dist/matter/client-profile/client-profile.js +64 -24
- package/dist/matter/client-profile/client-profile.js.map +1 -1
- package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
- package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
- package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
- package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
- package/dist/matter/delivery-options/delivery-options.js +75 -12
- package/dist/matter/delivery-options/delivery-options.js.map +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
- package/dist/matter/email-identification/email-identification.d.ts +25 -3
- package/dist/matter/email-identification/email-identification.js +49 -12
- package/dist/matter/email-identification/email-identification.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
- package/dist/matter/identity-edit/identity-edit.js +47 -19
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
- package/dist/matter/identity-summary/identity-summary.js +95 -45
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/installments/installments-select.d.ts +98 -16
- package/dist/matter/installments/installments-select.js +156 -48
- package/dist/matter/installments/installments-select.js.map +1 -1
- package/dist/matter/installments/installments.d.ts +96 -16
- package/dist/matter/installments/installments.js +115 -40
- package/dist/matter/installments/installments.js.map +1 -1
- package/dist/matter/installments/use-installments-selection.d.ts +1 -0
- package/dist/matter/installments/use-installments-selection.js +8 -3
- package/dist/matter/installments/use-installments-selection.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
- package/dist/matter/my-account-profile/my-account-profile.js +370 -174
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
- package/dist/matter/order-cancel/order-cancel.js +118 -51
- package/dist/matter/order-cancel/order-cancel.js.map +1 -1
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
- package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
- package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
- package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
- package/dist/matter/order-details-header/order-details-header.js +66 -58
- package/dist/matter/order-details-header/order-details-header.js.map +1 -1
- package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +164 -19
- package/dist/matter/order-list/order-list.js +229 -87
- package/dist/matter/order-list/order-list.js.map +1 -1
- package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
- package/dist/matter/order-list-row/order-list-row.js +3 -2
- package/dist/matter/order-list-row/order-list-row.js.map +1 -1
- package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
- package/dist/matter/order-list-search/order-list-search.js +30 -69
- package/dist/matter/order-list-search/order-list-search.js.map +1 -1
- package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
- package/dist/matter/order-list-views/order-list-views.js +22 -68
- package/dist/matter/order-list-views/order-list-views.js.map +1 -1
- package/dist/matter/order-payment/order-payment.d.ts +33 -10
- package/dist/matter/order-payment/order-payment.js +44 -39
- package/dist/matter/order-payment/order-payment.js.map +1 -1
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
- package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
- package/dist/matter/order-placed/order-placed.d.ts +198 -31
- package/dist/matter/order-placed/order-placed.js +230 -139
- package/dist/matter/order-placed/order-placed.js.map +1 -1
- package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
- package/dist/matter/order-placed-date/order-placed-date.js +7 -8
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +19 -8
- package/dist/matter/order-progress/order-progress.js +37 -45
- package/dist/matter/order-progress/order-progress.js.map +1 -1
- package/dist/matter/order-summary/order-summary.d.ts +19 -9
- package/dist/matter/order-summary/order-summary.js +38 -44
- package/dist/matter/order-summary/order-summary.js.map +1 -1
- package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +17 -10
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.d.ts +4 -2
- package/dist/matter/payment/payment-controller.js +30 -9
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +1 -1
- package/dist/matter/payment/payment.d.ts +69 -19
- package/dist/matter/payment/payment.js +101 -35
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
- package/dist/matter/payment/use-payment-method-selection.js +94 -32
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
- package/dist/matter/payment/use-payment-submit-gate.js +47 -8
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +171 -57
- package/dist/matter/place-order/place-order.js +376 -185
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.d.ts +152 -13
- package/dist/matter/pricing/pricing.js +153 -52
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-information/product-information.d.ts +27 -4
- package/dist/matter/product-information/product-information.js +32 -15
- package/dist/matter/product-information/product-information.js.map +1 -1
- package/dist/matter/product-list/product-list.d.ts +24 -6
- package/dist/matter/product-list/product-list.js +32 -26
- package/dist/matter/product-list/product-list.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
- package/dist/matter/product-shelf/product-shelf.js +2 -15
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.d.ts +33 -16
- package/dist/matter/region/region.js +59 -52
- package/dist/matter/region/region.js.map +1 -1
- package/dist/matter/save-card/save-card.d.ts +43 -8
- package/dist/matter/save-card/save-card.js +61 -23
- package/dist/matter/save-card/save-card.js.map +1 -1
- package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
- package/dist/matter/saved-cards/saved-cards.js +349 -77
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/shipping-address/address-payload.js +25 -0
- package/dist/matter/shipping-address/address-payload.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +71 -71
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
- package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
- package/dist/matter/shipping-address/shipping-address.js +443 -188
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
- package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in/sign-in.d.ts +108 -0
- package/dist/matter/sign-in/sign-in.js +285 -0
- package/dist/matter/sign-in/sign-in.js.map +1 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
- package/dist/matter/sign-in-form/sign-in-form.js +134 -144
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
- package/dist/particles/binding-switcher/binding-switcher.js +37 -26
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
- package/dist/particles/card-summary/card-summary.d.ts +38 -8
- package/dist/particles/card-summary/card-summary.js +55 -22
- package/dist/particles/card-summary/card-summary.js.map +1 -1
- package/dist/particles/carousel/carousel.d.ts +99 -11
- package/dist/particles/carousel/carousel.js +103 -35
- package/dist/particles/carousel/carousel.js.map +1 -1
- package/dist/particles/copy-text/copy-text.js +5 -15
- package/dist/particles/copy-text/copy-text.js.map +1 -1
- package/dist/particles/dialog/dialog.d.ts +14 -6
- package/dist/particles/dialog/dialog.js +6 -3
- package/dist/particles/dialog/dialog.js.map +1 -1
- package/dist/particles/drawer/drawer.js +1 -1
- package/dist/particles/drawer/drawer.js.map +1 -1
- package/dist/particles/email-field/email-field.d.ts +2 -1
- package/dist/particles/email-field/email-field.js +2 -1
- package/dist/particles/email-field/email-field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.js +1 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/form/form.d.ts +85 -13
- package/dist/particles/form/form.js +91 -42
- package/dist/particles/form/form.js.map +1 -1
- package/dist/particles/gallery/gallery.d.ts +129 -12
- package/dist/particles/gallery/gallery.js +121 -34
- package/dist/particles/gallery/gallery.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
- package/dist/particles/order-details-back/order-details-back.js +8 -10
- package/dist/particles/order-details-back/order-details-back.js.map +1 -1
- package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
- package/dist/particles/order-status-badge/order-status-badge.js +4 -20
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
- package/dist/particles/password-field/password-field.d.ts +1 -1
- package/dist/particles/password-field/password-field.js +2 -4
- package/dist/particles/password-field/password-field.js.map +1 -1
- package/dist/particles/phone-field/phone-field.d.ts +4 -4
- package/dist/particles/phone-field/phone-field.js +8 -11
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/spinner/spinner.d.ts +24 -4
- package/dist/particles/spinner/spinner.js +25 -9
- package/dist/particles/spinner/spinner.js.map +1 -1
- package/dist/particles/switch/switch.d.ts +4 -1
- package/dist/particles/switch/switch.js +3 -1
- package/dist/particles/switch/switch.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +29 -3
- package/dist/particles/toast/toast.js +34 -10
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +164 -56
- package/dist/sdk/address/address-fields.js +4 -4
- package/dist/sdk/address/address-fields.js.map +1 -1
- package/dist/sdk/address/constants.js +1 -6
- package/dist/sdk/address/constants.js.map +1 -1
- package/dist/sdk/address/messages.js +44 -44
- package/dist/sdk/address/messages.js.map +1 -1
- package/dist/sdk/address/postal-code.js +15 -2
- package/dist/sdk/address/postal-code.js.map +1 -1
- package/dist/sdk/address/types.d.ts +5 -3
- package/dist/sdk/address/validate-address.js +3 -3
- package/dist/sdk/address/validate-address.js.map +1 -1
- package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/data/index.js +2 -2
- package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
- package/dist/sdk/generated/gql.js +1 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +20 -5
- package/dist/sdk/generated/graphql.js +6 -0
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/format-error-code.js +23 -0
- package/dist/sdk/i18n/format-error-code.js.map +1 -0
- package/dist/sdk/i18n/message-formatter.d.ts +22 -0
- package/dist/sdk/i18n/message-formatter.js +140 -0
- package/dist/sdk/i18n/message-formatter.js.map +1 -0
- package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
- package/dist/sdk/i18n/use-message-formatter.js +18 -0
- package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/navigation/redirect.d.ts +2 -0
- package/dist/sdk/navigation/redirect.js +19 -1
- package/dist/sdk/navigation/redirect.js.map +1 -1
- package/dist/sdk/navigation/types.d.ts +13 -0
- package/dist/sdk/payment/bin-format.js +20 -0
- package/dist/sdk/payment/bin-format.js.map +1 -0
- package/dist/sdk/payment/challenge-return.js +37 -0
- package/dist/sdk/payment/challenge-return.js.map +1 -0
- package/dist/sdk/payment/confirmation-last-four.js +39 -0
- package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
- package/dist/sdk/payment/gateway.d.ts +1 -1
- package/dist/sdk/payment/gateway.js +8 -2
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.d.ts +1 -0
- package/dist/sdk/payment/operations.js +28 -6
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
- package/dist/sdk/payment/resumed-purchase.js +119 -0
- package/dist/sdk/payment/resumed-purchase.js.map +1 -0
- package/dist/sdk/payment/security-code-mask.js +16 -23
- package/dist/sdk/payment/security-code-mask.js.map +1 -1
- package/dist/sdk/payment/submission-registry.js +6 -2
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
- package/dist/sdk/payment/use-payment-actions.js +23 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +10 -2
- package/dist/sdk/payment/use-place-order.js +138 -76
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/provider/storefront-provider.d.ts +1 -7
- package/dist/sdk/provider/storefront-provider.js +4 -11
- package/dist/sdk/provider/storefront-provider.js.map +1 -1
- package/dist/sdk/seo/entity-landing.d.ts +24 -0
- package/dist/sdk/seo/entity-landing.js +30 -0
- package/dist/sdk/seo/entity-landing.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +3 -2
- package/dist/sdk/seo/page-alternates.js +4 -2
- package/dist/sdk/seo/page-alternates.js.map +1 -1
- package/dist/sdk/seo/search-landing.d.ts +42 -0
- package/dist/sdk/seo/search-landing.js +85 -0
- package/dist/sdk/seo/search-landing.js.map +1 -0
- package/dist/sdk/session/mock-session.d.ts +9 -0
- package/dist/sdk/session/mock-session.js +31 -0
- package/dist/sdk/session/mock-session.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +3 -0
- package/dist/sdk/session/read-server-session.js +5 -0
- package/dist/sdk/session/read-server-session.js.map +1 -1
- package/dist/sdk/session/return-path-segment.d.ts +10 -0
- package/dist/sdk/session/return-path-segment.js +15 -0
- package/dist/sdk/session/return-path-segment.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
- package/dist/utils/safe-href.d.ts +2 -0
- package/package.json +4 -3
- package/skills/storefront-asset/SKILL.md +2 -2
- package/skills/storefront-asset/references/api-side.md +27 -14
- package/skills/storefront-asset/references/findings.md +5 -2
- package/src/styles/tailwind.css +8 -0
- package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
- package/dist/message-locales.json +0 -7
- package/dist/sdk/i18n/client.d.ts +0 -4
- package/dist/sdk/i18n/client.js +0 -4
- package/dist/sdk/i18n/locales.d.ts +0 -8
- package/dist/sdk/i18n/locales.js +0 -57
- package/dist/sdk/i18n/locales.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.js +0 -183
- package/dist/sdk/i18n/messages/en-US.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.json +0 -178
- package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
- package/dist/sdk/i18n/messages/es-ES.js +0 -183
- package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
- package/dist/sdk/i18n/messages/es-ES.json +0 -178
- package/dist/sdk/i18n/messages/pt-BR.js +0 -183
- package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
- package/dist/sdk/i18n/messages/pt-BR.json +0 -178
- package/dist/sdk/i18n/provider.d.ts +0 -1
- package/dist/sdk/i18n/provider.js +0 -30
- package/dist/sdk/i18n/provider.js.map +0 -1
- package/dist/sdk/i18n/server.d.ts +0 -28
- package/dist/sdk/i18n/server.js +0 -59
- package/dist/sdk/i18n/server.js.map +0 -1
- package/dist/utils/resolve-authored-copy.js +0 -18
- package/dist/utils/resolve-authored-copy.js.map +0 -1
- package/dist/utils/substitute-template.js +0 -33
- package/dist/utils/substitute-template.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipping-address.js","names":[],"sources":["../../../src/matter/shipping-address/shipping-address.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\nimport {\n Field,\n FieldBinding,\n type FieldOption,\n type FieldRule,\n type FieldRuleConstraint,\n FieldsetFieldContext,\n readBaseline,\n useFieldsetField,\n useFieldsetFieldNames,\n useNoAncestorFieldset,\n} from '../../particles/field/field.js';\nimport { Fieldset } from '../../particles/fieldset/fieldset.js';\nimport { type FieldsetRegistration, type FormUserError, useFormRegistry } from '../../particles/form/form.js';\nimport { FieldSelect } from '../../particles/select/field-select.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { useEntityDataResolved } from '../../sdk/data/entity-resolution-context.js';\nimport { useReactiveDataSettled } from '../../sdk/data/use-reactive-data-settled.js';\nimport type { ShippingAddressInput } from '../../sdk/shipping/shipping-operations.js';\nimport { resolveAuthoredCopy } from '../../utils/resolve-authored-copy.js';\nimport type { CountryDescriptor, FieldDescriptor } from './country-descriptors.js';\nimport { getAvailableCountries, getCountryDescriptor } from './country-descriptors.js';\n\n/**\n * Shipping address step (T2 — Enter and save the delivery address).\n * Single-file matter per ADR-0001; batches form state and writes once via shipping.setAddress.\n * Controls are thin context-bound components that read/write draft state (docs/storefront-core/reference-cart.md § Delivery).\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment\n// ---------------------------------------------------------------------------\n\n/**\n * The fieldset's own fragment. Drops `savedAddresses` — the fieldset has no saved-address UI of\n * its own (Decision 1 of specs/shipping-address-fieldset.md).\n *\n * `clientProfile` selects `id` even though nothing renders it. The reactive runtime resolves each\n * root field to a cache reference through `cache.identify`, which needs `__typename` and `id`; with\n * no `id` in the composed page query the profile never normalises, `useReactiveEntity` keeps\n * returning the server's `fallbackData`, and a page composing this fieldset without\n * `ClientProfileFieldset` would show a logged-in shopper a blank recipient name instead of the one\n * US-4 fills in from their profile.\n */\nconst fieldsetFragment = /* GraphQL */ `\n fragment ShippingAddressFieldsetData on Query {\n shipping {\n __typename\n id\n address {\n __typename\n id\n recipientName\n postalCode\n country\n street\n number\n complement\n neighborhood\n city\n state\n }\n }\n clientProfile {\n __typename\n id\n firstName\n lastName\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * The `$data` slice forwarded to `ShippingAddressFieldset` by the reactive runtime. Selects two\n * root fields (`shipping`, `clientProfile`), so the compiler composes them via\n * `MultipleReactiveDataProvider`, which keys each entity's resolved slice by its own root field —\n * `$data` is `{ shipping: {...}, clientProfile: {...} }`, not a flat/unwrapped shape (that unwrapped\n * shape only applies to single-root-field fragments, e.g. CartTotalizerRoot's `$data.totalizers`).\n * Carries no `savedAddresses` — the fieldset has no saved-address UI of its own (Decision 1).\n */\nexport type ShippingAddressFieldsetData = {\n shipping?: {\n address?: {\n id?: string | null;\n recipientName?: string | null;\n postalCode?: string | null;\n country?: string | null;\n street?: string | null;\n number?: string | null;\n complement?: string | null;\n neighborhood?: string | null;\n city?: string | null;\n state?: string | null;\n } | null;\n } | null;\n clientProfile?: {\n firstName?: string | null;\n lastName?: string | null;\n } | null;\n} | null;\n\n/** The batched draft state, keyed by canonical field name (Decision 1). */\ntype AddressDraft = {\n recipientName: string;\n postalCode: string;\n country: string;\n street: string;\n number: string;\n complement: string;\n neighborhood: string;\n city: string;\n state: string;\n};\n\n// ---------------------------------------------------------------------------\n// Fieldset context\n// ---------------------------------------------------------------------------\n\n/** The react-hook-form namespace every field of this entity registers under. */\nconst SHIPPING_ADDRESS_NAMESPACE = 'shippingAddress';\n\n/** Canonical field keys, matching AddressDraft's keys and the descriptors' `name` values. */\nexport type ShippingAddressFieldKey = keyof AddressDraft;\n\n/** What a bound Control needs from its fieldset. Carries no live value. */\ntype ShippingAddressFieldsetContextValue = Readonly<{\n namespace: string;\n /** The active country's descriptor, or undefined when the country has none. */\n descriptor: CountryDescriptor | undefined;\n /** The descriptor entry for a key, or undefined when this country does not have the field. */\n fieldFor: (key: ShippingAddressFieldKey) => FieldDescriptor | undefined;\n /** The value this field registers with as react-hook-form's field-level defaultValue. */\n seedFor: (key: ShippingAddressFieldKey) => string;\n /**\n * The rule for a rendered field. `label` is the already-resolved label (authored, or the descriptor's\n * own when the authored one is blank): the same string the field shows on screen, so the generated\n * required-message copy renames the field exactly as the screen does. The caller resolves it once.\n * Never called for a field with no descriptor entry.\n */\n ruleFor: (key: ShippingAddressFieldKey, label: string) => FieldRule | undefined;\n /** Only for `country`: the platform's option list, contract-shaped. */\n countryOptions: readonly FieldOption[];\n}>;\n\nconst ShippingAddressFieldsetContext = createContext<ShippingAddressFieldsetContextValue | null>(null);\n\n/**\n * Read before any field hook (Decision 4): a control calls this before looking up its own\n * descriptor entry, so a field the active descriptor does not declare never calls\n * `useFieldsetField`/`useController` and so never registers with react-hook-form at all. Throws\n * when rendered with no `ShippingAddressFieldset` above it (Decision 2), naming the required\n * composition.\n */\nfunction useShippingAddressFieldsetContext(): ShippingAddressFieldsetContextValue {\n const ctx = useContext(ShippingAddressFieldsetContext);\n if (!ctx) {\n throw new Error('ShippingAddress*Control components must be used inside ShippingAddressFieldset.');\n }\n return ctx;\n}\n\n/**\n * Rows `ShippingAddressFieldsetSkeleton` draws when nobody says otherwise: one per Control in the\n * full anatomy, the nine of them. It is a default and not a derivation — the skeleton renders before\n * any address has resolved, so it cannot read the live descriptor, and the composed Controls are\n * opaque children. A page that composes fewer than nine sets `skeletonCount` to what it composed,\n * or the form jumps by the difference when the Controls take the skeleton's place.\n */\nconst SHIPPING_ADDRESS_SKELETON_ROWS = 9;\n\n/** `autoComplete` tokens per field (US-3, WCAG 2.1 SC 1.3.5). `number` has no standard token. */\nconst FIELD_AUTOCOMPLETE: Readonly<Record<ShippingAddressFieldKey, string | undefined>> = {\n recipientName: 'name',\n postalCode: 'postal-code',\n country: 'country',\n street: 'address-line1',\n number: undefined,\n complement: 'address-line2',\n neighborhood: 'address-level3',\n city: 'address-level2',\n state: 'address-level1',\n};\n\n/**\n * Merges the descriptor's own `rule` under a generated `required`, which is this fieldset's whole\n * declaration of the baseline. The blank check it used to hand-write alongside lives in\n * `resolveRequiredness` now, installed for every bound control rather than only for this one.\n */\nfunction buildRule(field: FieldDescriptor, label: string, requiredSuffix: string): FieldRule | undefined {\n if (!field.required) return field.rule;\n return { ...field.rule, required: `${label} ${requiredSuffix}` };\n}\n\n/** Keeps only the AddressDraft keys `values` actually defines — a field no control composed is absent, not `undefined`. */\nfunction pickDefinedAddressFields(values: Record<string, unknown>): Partial<AddressDraft> {\n const result: Partial<AddressDraft> = {};\n for (const key of Object.keys(values) as ShippingAddressFieldKey[]) {\n const value = values[key];\n if (value !== undefined) result[key] = value as string;\n }\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Props Types\n// ---------------------------------------------------------------------------\n\nexport type ShippingAddressFieldsetProps = {\n /** Country used when the stored address has none. */\n defaultCountry?: string;\n /** Placeholder rows the loading skeleton draws. Set it to the number of Controls composed here. */\n skeletonCount?: number;\n /** Announced politely while the address resolves. Blank means no announcement. */\n loadingLabel?: string;\n /** Announced politely once the Controls mount. Blank means no announcement. */\n loadedLabel?: string;\n /** Accessible name of the `<fieldset>` group. Blank means no name is exposed. */\n groupLabel?: string;\n className?: string;\n children?: ReactNode;\n /** `ShippingAddressFieldsetData` forwarded by the reactive runtime. */\n $data?: ShippingAddressFieldsetData;\n /** Compiler-injected action surface; carries `shipping.setAddress`. */\n $actions?: ComponentActions;\n};\n\nexport type ShippingAddressStreetControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressNumberControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressCityControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressStateControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressPostalCodeControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressComplementControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressNeighborhoodControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressCountryControlProps = {\n className?: string;\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, FieldSelect.Root, Field.Error. */\n children?: ReactNode;\n};\n\nexport type ShippingAddressRecipientNameControlProps = {\n className?: string;\n /** Overrides the descriptor's label. Absence means the platform's value. */\n label?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n};\n\n// ---------------------------------------------------------------------------\n// Root Definition\n// ---------------------------------------------------------------------------\n\nexport const ShippingAddressFieldsetDefinition = defineComponent<ShippingAddressFieldsetProps>({\n name: 'ShippingAddressFieldset',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressFieldset,\n fragment: fieldsetFragment,\n fetchStrategy: 'reactive',\n skeleton: ShippingAddressFieldsetSkeleton,\n actions: { shipping: ['setAddress'] },\n requiresContext: 'form',\n providesContext: 'shipping-address',\n editor: { label: 'Shipping Address Fieldset', category: 'commerce' },\n schema: {\n defaultCountry: { type: 'string', default: 'BRA', label: 'Default country (ISO-3)' },\n skeletonCount: { type: 'number', default: 9, label: 'Skeleton rows' },\n loadingLabel: { type: 'string', default: 'Loading your delivery address', label: 'Loading announcement' },\n loadedLabel: { type: 'string', default: 'Your delivery address is ready', label: 'Loaded announcement' },\n groupLabel: { type: 'string', default: 'Your delivery address', label: 'Accessible group name' },\n },\n guideline:\n 'Composable delivery-address entity: registers under \"shippingAddress\" with the enclosing FormRoot and dispatches shipping.setAddress only when the shopper changed something. Compose the nine ShippingAddress*Control parts inside it; place FormSubmit/FormEnterSubmit/FormError as siblings of the fieldset, not inside it — this fieldset renders no submit or error part of its own. The Controls mount only once the address has resolved, with skeletonCount placeholder rows in their place until then — set it to the number of Controls composed, or the form jumps by the difference. Style the announcement sr-only. groupLabel names the group as its accessible name; blank emits no aria-label, and a composed FieldsetLegend wins over it. See shipping-address.md.',\n});\n\n// Control Definitions\n// Shared by all eight text Controls below (RFC:503): states the requiresContext and the\n// recomposable anatomy every one of them shares.\nconst ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX =\n 'Must be a descendant of ShippingAddressFieldset, which provides the shipping-address context this control requires. Recomposable: compose Field.Label, Field.Control and Field.Error as children, in any order, to reorder or extend the anatomy; a childless composition keeps the default label-control-error order.';\n\nexport const ShippingAddressRecipientNameControlDefinition = defineComponent<ShippingAddressRecipientNameControlProps>({\n name: 'ShippingAddressRecipientNameControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressRecipientNameControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Recipient Name Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Recipient-name input field; required for submit. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressStreetControlDefinition = defineComponent<ShippingAddressStreetControlProps>({\n name: 'ShippingAddressStreetControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressStreetControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Street Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Street name input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressNumberControlDefinition = defineComponent<ShippingAddressNumberControlProps>({\n name: 'ShippingAddressNumberControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressNumberControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Number Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Street number input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressCityControlDefinition = defineComponent<ShippingAddressCityControlProps>({\n name: 'ShippingAddressCityControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressCityControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'City Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `City name input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressStateControlDefinition = defineComponent<ShippingAddressStateControlProps>({\n name: 'ShippingAddressStateControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressStateControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'State Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `State/province input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressPostalCodeControlDefinition = defineComponent<ShippingAddressPostalCodeControlProps>({\n name: 'ShippingAddressPostalCodeControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressPostalCodeControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Postal Code Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Postal code input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressComplementControlDefinition = defineComponent<ShippingAddressComplementControlProps>({\n name: 'ShippingAddressComplementControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressComplementControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Complement Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Complement (apartment, suite, etc.) input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressNeighborhoodControlDefinition = defineComponent<ShippingAddressNeighborhoodControlProps>({\n name: 'ShippingAddressNeighborhoodControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressNeighborhoodControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Neighborhood Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value, applied at render time by\n // the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Neighborhood (bairro) input field; shown only for countries that have this field (BR in v1). ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressCountryControlDefinition = defineComponent<ShippingAddressCountryControlProps>({\n name: 'ShippingAddressCountryControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressCountryControl,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Country Control', category: 'action' },\n schema: {\n // No default (Decision 11): absence means the platform's value (the active country descriptor's\n // `countryLabel`), applied at render time by the control itself, not baked into the schema.\n label: { type: 'string', label: 'Field label' },\n },\n guideline:\n 'Country selector; lists only countries with an implemented descriptor. Must be a descendant of ShippingAddressFieldset, which provides the shipping-address context this control requires. Recomposable: compose Field.Label, FieldSelect.Root and Field.Error as children, in any order; a childless composition keeps the default label-select-error order.',\n});\n\n// ---------------------------------------------------------------------------\n// Fieldset Component\n// ---------------------------------------------------------------------------\n\n/** The message a constrained rule member carries; a bare value (or a bare `RegExp`) carries none. */\nfunction messageOf(constraint: number | string | RegExp | FieldRuleConstraint<unknown> | undefined): string {\n return typeof constraint === 'object' && !(constraint instanceof RegExp) ? constraint.message : '';\n}\n\n/**\n * Every static message a rule carries, in a fixed order: the `required` copy in any of its three shapes,\n * then the message of each constrained member. A `validate` record has no static copy, so it adds none.\n */\nfunction messagesOf(rule: FieldRule | undefined): string[] {\n return [\n readBaseline(rule).message ?? '',\n messageOf(rule?.pattern),\n messageOf(rule?.min),\n messageOf(rule?.max),\n messageOf(rule?.minLength),\n messageOf(rule?.maxLength),\n ];\n}\n\n/**\n * An error already on screen keeps the message of the rule that raised it, so a country switch would\n * leave \"é obrigatório\" under a USA form until the shopper edits or submits again. A bound control\n * therefore revalidates itself when the copy of its own rule changes while it carries an error: that\n * re-words it from the new rule without newly flagging a field the shopper has not reached.\n *\n * It runs inside the control, as an effect of the component that renders the field's own subtree, so it\n * always fires after that field's registration — `useController` re-registers `rules` during render, and\n * descendants' effects precede their parent's — and never validates against the previous rule, whichever\n * of the two the registration becomes. The first run counts as a change too: a field that remounts after\n * a country without it keeps its error across the unmount (`shouldUnregister` being false) and comes\n * back carrying the old wording.\n */\nfunction useRewordErroredField(name: string, rule: FieldRule | undefined) {\n const { getFieldState, trigger } = useFormContext();\n const copy = messagesOf(rule).join('\\n');\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: `copy` is the trigger, not an input — the effect revalidates when the rule's wording changes.\n useEffect(() => {\n if (getFieldState(name).error) void trigger(name);\n }, [copy, name, getFieldState, trigger]);\n}\n\n/**\n * ShippingAddressFieldset — this entity's root: same data, same action as a page-level submit\n * would use, dispatched at form-submit time instead of through a button of its own. Registers one\n * `FieldsetRegistration` with the enclosing `FormRoot` under the `shippingAddress` namespace,\n * derives the active country descriptor from react-hook-form (Decision 2), and publishes each\n * field's seed/rule/label through its own context so a bound Control never writes a validation\n * expression. Renders no button and holds no draft of its own.\n *\n * Its controls mount only once the entity has resolved; until then the `Fieldset.Root` carries\n * `-pending` and renders `ShippingAddressFieldsetSkeleton`. \"Resolved\" is two conditions, because\n * `$data` alone cannot answer it: under the reactive runtime the slice is defined from the first\n * render — `useReactiveEntity` hands down `fallbackData` while the cache read is incomplete — so an\n * empty server answer looks exactly like a resolved one, and every control would mount seeded `''`\n * before the shopper's stored address arrives. Each seed reaches react-hook-form as a field-level\n * `defaultValue`; `useSeedAdoption` re-seeds a clean field with it on every render, but once the\n * field turns dirty no later seed ever reaches it again (Decision 12). Mounting before the answer\n * arrives would seed `''`: a shopper who starts typing before the real value lands makes the field\n * dirty on that empty seed, permanently locking their saved address out of it, and even a shopper who\n * does not type sees the field flash from `''` to the real data. `useReactiveDataSettled` supplies\n * the missing half: the page query's own in-flight state, latched so it only ever goes pending →\n * settled. The `$data === undefined` half still carries\n * trees with no reactive root above them, where the slice arrives as a plain prop.\n *\n * Both ends of that wait are spoken: the fieldset carries `aria-busy` while it lasts and holds a\n * polite live region that announces `loadingLabel` and then `loadedLabel`. Style the region\n * `sr-only` — it is text meant for a screen reader, not for the page.\n */\nexport function ShippingAddressFieldset({\n defaultCountry = 'BRA',\n skeletonCount = SHIPPING_ADDRESS_SKELETON_ROWS,\n loadingLabel = 'Loading your delivery address',\n loadedLabel = 'Your delivery address is ready',\n groupLabel = 'Your delivery address',\n className,\n children,\n $data: $dataProp,\n $actions: $actionsProp,\n}: ShippingAddressFieldsetProps): ReactNode {\n // First hook called: throws the named registry error when no FormRoot is above (US-1, 5th\n // criterion), before any react-hook-form hook below has a chance to run against a missing context.\n const { registerFieldset } = useFormRegistry();\n\n // Guards runtime registry integrity the same way FormRoot's namespace-collision throw does:\n // useFieldsetField resolves the *nearest* FieldsetFieldContext, not the fieldset that owns a\n // given namespace, so a fieldset nested inside another one would register its controls' names\n // into the ancestor's name set instead of its own — FormClear, FormReset and post-dispatch\n // reconciliation would then act on the wrong fields. Nesting fieldsets has no legitimate use,\n // so this throws at mount rather than silently misrouting names.\n useNoAncestorFieldset('ShippingAddressFieldset');\n\n const $data = useDataOverride($dataProp);\n\n const $actions = useActionsOverride($actionsProp);\n // Three conditions, not two. `useReactiveDataSettled` latches one way and never re-arms, so on its\n // own it answers \"has this page ever resolved\", not \"is what I am holding right now the server's\n // answer\" — after the page query's entity ref moves to one this cache never stored, or its root is\n // skipped for want of a variable, the slice silently regresses to `fallbackData` while the latch\n // still reads settled. `useEntityDataResolved` is the per-entity half: unlatched, so it follows the\n // slice back down and returns this fieldset to its skeleton instead of leaving live controls seeded\n // from a placeholder.\n const settled = useReactiveDataSettled();\n const sliceResolved = useEntityDataResolved();\n const resolved = settled && sliceResolved && $data !== undefined;\n const currentAddress = $data?.shipping?.address;\n const clientProfile = $data?.clientProfile;\n const joinedProfileName = [clientProfile?.firstName, clientProfile?.lastName].filter(Boolean).join(' ');\n\n // The one seed record every field registers with as react-hook-form's own defaultValue (Decision\n // 12) — resolved fresh from $data on every render and re-applied to every already-mounted field\n // that is still clean; a field the shopper has started editing turns dirty and locks this out.\n const seed = useMemo<AddressDraft>(\n () => ({\n recipientName: currentAddress?.recipientName ?? joinedProfileName,\n postalCode: currentAddress?.postalCode ?? '',\n country: currentAddress?.country ?? defaultCountry,\n street: currentAddress?.street ?? '',\n number: currentAddress?.number ?? '',\n complement: currentAddress?.complement ?? '',\n neighborhood: currentAddress?.neighborhood ?? '',\n city: currentAddress?.city ?? '',\n state: currentAddress?.state ?? '',\n }),\n [currentAddress, joinedProfileName, defaultCountry],\n );\n\n // Decision 2: the descriptor is derived from react-hook-form, not from a draft of our own, so a\n // country change reshapes the form with one subscription and no re-seeding effect. `FormClear`\n // can drive the live value to '' (the select itself never offers an empty option); falling back\n // to the seeded country there keeps every field — including the required recipient name — mounted\n // and focusable instead of vanishing the moment the form is cleared.\n const watchedCountry = useWatch({ name: `${SHIPPING_ADDRESS_NAMESPACE}.country`, defaultValue: seed.country });\n const activeCountry = (typeof watchedCountry === 'string' && watchedCountry) || seed.country;\n const descriptor = getCountryDescriptor(activeCountry);\n\n // The suffix of the descriptor every field below came from; unused when there is no descriptor, since\n // then no field is found and `ruleFor` is never called.\n const requiredSuffix = descriptor?.requiredSuffix ?? '';\n\n const fieldFor = useCallback(\n (key: ShippingAddressFieldKey) => descriptor?.fields.find((f) => f.name === key),\n [descriptor],\n );\n const seedFor = useCallback((key: ShippingAddressFieldKey) => seed[key], [seed]);\n const ruleFor = useCallback(\n (key: ShippingAddressFieldKey, label: string) => {\n const field = fieldFor(key);\n return field ? buildRule(field, label, requiredSuffix) : undefined;\n },\n [fieldFor, requiredSuffix],\n );\n const countryOptions = useMemo<readonly FieldOption[]>(\n () => getAvailableCountries().map((iso) => ({ value: iso, label: getCountryDescriptor(iso)?.label ?? iso })),\n [],\n );\n\n const fieldsetContextValue = useMemo<ShippingAddressFieldsetContextValue>(\n () => ({ namespace: SHIPPING_ADDRESS_NAMESPACE, descriptor, fieldFor, seedFor, ruleFor, countryOptions }),\n [descriptor, fieldFor, seedFor, ruleFor, countryOptions],\n );\n\n // Collects the field names this fieldset's own controls currently have mounted (FR 3), over the\n // seam `particles/field/field.tsx` exports for exactly this purpose.\n const { registry: fieldRegistryValue, getFieldNames } = useFieldsetFieldNames(SHIPPING_ADDRESS_NAMESPACE);\n\n // Deliberately NOT dirty-only (T21 Decision 4), unlike ClientProfileFieldset/ClientPreferencesFieldset:\n // `ShippingAddressUpdateInput` declares `postalCode` and `country` non-null (`recipientName` is optional;\n // core.graphql:2795-2807), so a payload carrying only the changed keys can omit the non-null fields.\n // Sending the whole active-country address, seed-merged with the live values, is the correct shape\n // for this mutation's contract — not an oversight to \"fix\" into dirty-only.\n const toPayload = useCallback(\n (values: Record<string, unknown>): Record<string, unknown> => {\n const merged = { ...seed, ...pickDefinedAddressFields(values) } as AddressDraft;\n const country = String(merged.country || seed.country);\n const active = getCountryDescriptor(country);\n const isActive = (key: ShippingAddressFieldKey) => active?.fields.some((f) => f.name === key) ?? false;\n\n return {\n country,\n ...(isActive('recipientName') ? { recipientName: String(merged.recipientName ?? '').trim() } : {}),\n ...(isActive('postalCode') ? { postalCode: merged.postalCode } : {}),\n ...(isActive('street') ? { street: merged.street } : {}),\n ...(isActive('number') ? { number: merged.number } : {}),\n ...(isActive('complement') ? { complement: merged.complement } : {}),\n ...(isActive('neighborhood') ? { neighborhood: merged.neighborhood } : {}),\n ...(isActive('city') ? { city: merged.city } : {}),\n ...(isActive('state') ? { state: merged.state } : {}),\n };\n },\n [seed],\n );\n\n const dispatch = useCallback(\n async (payload: Record<string, unknown>): Promise<readonly FormUserError[]> => {\n if (!$actions?.shipping?.setAddress) {\n // The form reports a failure rather than silently succeeding (FR 13).\n throw new Error('ShippingAddressFieldset requires $actions.shipping.setAddress.');\n }\n return $actions.shipping.setAddress(payload as ShippingAddressInput);\n },\n [$actions],\n );\n\n const registration = useMemo<FieldsetRegistration>(\n () => ({\n namespace: SHIPPING_ADDRESS_NAMESPACE,\n getFieldNames,\n dispatch,\n toPayload,\n // Decision 1: the register is a machine identifier, the kebab-case ASCII rendering of this\n // registration's own `namespace` (`shippingAddress` → `shipping-address`) — not authored per\n // page (Decision 2).\n label: 'shipping-address',\n }),\n [getFieldNames, dispatch, toPayload],\n );\n\n // Registered from the mount commit, like the other two fieldsets, because `FormRoot` takes a\n // fieldset's dispatch slot from its first registration: deferring it until the entity resolves\n // would put this fieldset after every sibling that registered at mount, whatever their order in\n // the document.\n //\n // Registering early cannot send an unresolved seed. `toPayload` is whole-entity here\n // (`ShippingAddressUpdateInput` declares three fields non-null, so the payload is\n // `{ ...seed, ...liveValues }`), which makes a placeholder seed sendable, but the Controls mount only\n // once the entity has resolved. Until then `getFieldNames()` is empty and `FormRoot` finds nothing of\n // this fieldset that could be dirty — including a field the shopper edited before the slice regressed.\n useEffect(() => registerFieldset(registration), [registerFieldset, registration]);\n\n // Assistive technology only reports a change inside a region that was already in the tree, so a\n // region mounted together with its text announces nothing. The region therefore sits in both\n // branches and starts empty, with the wait written on the pass after mount and replaced — not\n // cleared — once the Controls are up: the skeleton is `aria-hidden`, so without this second\n // message the form would materialise in silence (WCAG 2.1 SC 4.1.3).\n const [announcement, setAnnouncement] = useState('');\n const announced = resolved ? loadedLabel : loadingLabel;\n useEffect(() => {\n setAnnouncement(announced);\n }, [announced]);\n\n return (\n <Fieldset.Root\n className={className}\n aria-busy={resolved ? undefined : true}\n // FR-12: blank (or whitespace-only) means no name is exposed, mirroring the loadingLabel/\n // loadedLabel convention. On the root itself (FR-13), so it is identical whether the fieldset\n // is pending or resolved; a page-composed FieldsetLegend still wins via aria-labelledby.\n {...(groupLabel?.trim() ? { 'aria-label': groupLabel } : {})}\n data-fs-shipping-address-fieldset=\"\"\n {...(resolved ? {} : { 'data-fs-shipping-address-fieldset-pending': '' })}\n >\n <ShippingAddressFieldsetContext.Provider value={fieldsetContextValue}>\n <FieldsetFieldContext.Provider value={fieldRegistryValue}>\n {resolved ? children : <ShippingAddressFieldsetSkeleton count={skeletonCount} />}\n </FieldsetFieldContext.Provider>\n </ShippingAddressFieldsetContext.Provider>\n <output aria-live=\"polite\" data-fs-shipping-address-fieldset-announcement=\"\">\n {announcement}\n </output>\n </Fieldset.Root>\n );\n}\n\n/**\n * The loading state of the fieldset, rendered in place of the Controls until the entity resolves and\n * declared as the definition's `skeleton`. Purely visual: the wait is spoken by the fieldset's own\n * live region, so this is hidden from assistive technology rather than announced twice.\n */\nexport function ShippingAddressFieldsetSkeleton({\n count = SHIPPING_ADDRESS_SKELETON_ROWS,\n className,\n ...props\n}: ComponentPropsWithRef<'div'> & { count?: number }) {\n return (\n <div {...props} className={className} data-fs-shipping-address-fieldset-skeleton=\"\" aria-hidden=\"true\">\n {Array.from({ length: count }, (_, i) => (\n <span key={i} data-fs-shipping-address-fieldset-skeleton-field=\"\" />\n ))}\n </div>\n );\n}\n\nShippingAddressFieldset.Skeleton = ShippingAddressFieldsetSkeleton;\n\n// ---------------------------------------------------------------------------\n// Control Components (thin, context-bound, reuse particles)\n//\n// Each control reads the fieldset context and finds its descriptor entry *before* calling any\n// field hook, so a field the active descriptor does not declare never calls\n// `useFieldsetField`/`useController` and so never registers with react-hook-form at all\n// (Decision 4).\n// ---------------------------------------------------------------------------\n\n/** The eight text fields' shared anatomy (Decision 6): `FieldBinding > Field.Root > (Field.Label, Field.Control, Field.Error)`. */\ntype BoundAddressTextFieldProps = {\n fieldKey: Exclude<ShippingAddressFieldKey, 'country'>;\n slug: string;\n className?: string;\n label?: string;\n placeholder?: string;\n children?: ReactNode;\n fieldsetCtx: ShippingAddressFieldsetContextValue;\n fieldDescriptor: FieldDescriptor;\n};\n\nfunction BoundAddressTextField({\n fieldKey,\n slug,\n className,\n label,\n placeholder,\n children,\n fieldsetCtx,\n fieldDescriptor,\n}: BoundAddressTextFieldProps) {\n const name = useFieldsetField(SHIPPING_ADDRESS_NAMESPACE, fieldKey);\n // The rule gets the same resolved label the field shows, so it renames the field in its own\n // required-message copy too (spec 806-809), not just on screen.\n const resolvedLabel = resolveAuthoredCopy(label, fieldDescriptor.label);\n const rule = fieldsetCtx.ruleFor(fieldKey, resolvedLabel);\n useRewordErroredField(name, rule);\n\n return (\n <FieldBinding\n name={name}\n label={resolvedLabel}\n placeholder={placeholder}\n defaultValue={fieldsetCtx.seedFor(fieldKey)}\n rule={rule}\n autoComplete={FIELD_AUTOCOMPLETE[fieldKey]}\n >\n <Field.Root className={className} data-fs-shipping-address-field={slug}>\n {children ?? (\n <>\n <Field.Label />\n <Field.Control />\n <Field.Error />\n </>\n )}\n </Field.Root>\n </FieldBinding>\n );\n}\n\n/**\n * RecipientNameControl — the only required field (US-4, US-6); the postal code is client-validated\n * too, against the active country's format.\n * Pre-filled from clientProfile, editable, required.\n */\nexport function ShippingAddressRecipientNameControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressRecipientNameControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('recipientName');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"recipientName\"\n slug=\"recipient-name\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** StreetControl */\nexport function ShippingAddressStreetControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressStreetControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('street');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"street\"\n slug=\"street\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** NumberControl */\nexport function ShippingAddressNumberControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressNumberControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('number');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"number\"\n slug=\"number\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** CityControl */\nexport function ShippingAddressCityControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressCityControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('city');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"city\"\n slug=\"city\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** StateControl */\nexport function ShippingAddressStateControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressStateControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('state');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"state\"\n slug=\"state\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** PostalCodeControl */\nexport function ShippingAddressPostalCodeControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressPostalCodeControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('postalCode');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"postalCode\"\n slug=\"postal-code\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** ComplementControl */\nexport function ShippingAddressComplementControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressComplementControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('complement');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"complement\"\n slug=\"complement\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** NeighborhoodControl (BR-specific in v1) */\nexport function ShippingAddressNeighborhoodControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressNeighborhoodControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const fieldDescriptor = fieldsetCtx.fieldFor('neighborhood');\n if (!fieldDescriptor) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"neighborhood\"\n slug=\"neighborhood\"\n className={className}\n label={label}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n fieldDescriptor={fieldDescriptor}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/**\n * CountryControl — moves onto `FieldSelect` (Decision 8): the trigger resolves a country name from\n * the field contract's `options`. Gated on `descriptor`, not on a per-field entry (country has\n * none): a country with no descriptor renders no controls at all (Decision 3/4's \"no entry, no\n * control\" applied to the field that selects the entry itself).\n */\nexport function ShippingAddressCountryControl({\n className,\n label,\n placeholder,\n children,\n}: ShippingAddressCountryControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n if (!fieldsetCtx.descriptor) return null;\n return (\n <BoundShippingAddressCountryControl\n className={className}\n label={label}\n defaultLabel={fieldsetCtx.descriptor.countryLabel}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundShippingAddressCountryControl>\n );\n}\n\ntype BoundShippingAddressCountryControlProps = {\n className?: string;\n label?: string;\n /** The active descriptor's `countryLabel`, used when no `label` is authored. */\n defaultLabel: string;\n placeholder?: string;\n children?: ReactNode;\n fieldsetCtx: ShippingAddressFieldsetContextValue;\n};\n\nfunction BoundShippingAddressCountryControl({\n className,\n label,\n defaultLabel,\n placeholder,\n children,\n fieldsetCtx,\n}: Readonly<BoundShippingAddressCountryControlProps>) {\n const name = useFieldsetField(SHIPPING_ADDRESS_NAMESPACE, 'country');\n\n return (\n <FieldBinding\n name={name}\n label={resolveAuthoredCopy(label, defaultLabel)}\n // Falls back to the active descriptor's label (already the FormClear-safe activeCountry,\n // not the raw watched value — Decision 2) so the trigger shows the country that will\n // actually be sent even when react-hook-form's own value is '' (e.g. right after\n // FormClear), instead of resolveOptionLabel('') rendering nothing at all.\n placeholder={placeholder ?? fieldsetCtx.descriptor?.label}\n defaultValue={fieldsetCtx.seedFor('country')}\n options={fieldsetCtx.countryOptions}\n autoComplete={FIELD_AUTOCOMPLETE.country}\n >\n <Field.Root className={className} data-fs-shipping-address-field=\"country\">\n {children ?? (\n <>\n <Field.Label />\n <FieldSelect.Root />\n <Field.Error />\n </>\n )}\n </Field.Root>\n </FieldBinding>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace Export\n// ---------------------------------------------------------------------------\n\nexport const ShippingAddress = {\n Fieldset: ShippingAddressFieldset,\n FieldsetDefinition: ShippingAddressFieldsetDefinition,\n FieldsetSkeleton: ShippingAddressFieldsetSkeleton,\n RecipientNameControl: ShippingAddressRecipientNameControl,\n RecipientNameControlDefinition: ShippingAddressRecipientNameControlDefinition,\n StreetControl: ShippingAddressStreetControl,\n StreetControlDefinition: ShippingAddressStreetControlDefinition,\n NumberControl: ShippingAddressNumberControl,\n NumberControlDefinition: ShippingAddressNumberControlDefinition,\n CityControl: ShippingAddressCityControl,\n CityControlDefinition: ShippingAddressCityControlDefinition,\n StateControl: ShippingAddressStateControl,\n StateControlDefinition: ShippingAddressStateControlDefinition,\n PostalCodeControl: ShippingAddressPostalCodeControl,\n PostalCodeControlDefinition: ShippingAddressPostalCodeControlDefinition,\n ComplementControl: ShippingAddressComplementControl,\n ComplementControlDefinition: ShippingAddressComplementControlDefinition,\n NeighborhoodControl: ShippingAddressNeighborhoodControl,\n NeighborhoodControlDefinition: ShippingAddressNeighborhoodControlDefinition,\n CountryControl: ShippingAddressCountryControl,\n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A4B,SAAS;CAEnE,OACE,oBAAC,cAAD;EACQ;EACN,OAAO,oBAAoB,OAAO,YAAY;EAK9C,aAAa,eAAe,YAAY,YAAY;EACpD,cAAc,YAAY,QAAQ,SAAS;EAC3C,SAAS,YAAY;EACrB,cAAc,mBAAmB;EAEjC,UAAA,oBAAC,MAAM,MAAP;GAAuB;GAAW,kCAA+B;GAC9D,UAAA,YACC,qBAAA,YAAA,EAAA,UAAA;IACE,oBAAC,MAAM,OAAP,CAAc,CAAA;IACd,oBAAC,YAAY,MAAb,CAAmB,CAAA;IACnB,oBAAC,MAAM,OAAP,CAAc,CAAA;GACd,EAAA,CAAA;EAEM,CAAA;CACA,CAAA;AAElB;AAMA,MAAa,kBAAkB;CAC7B,UAAU;CACV,oBAAoB;CACpB,kBAAkB;CAClB,sBAAsB;CACtB,gCAAgC;CAChC,eAAe;CACf,yBAAyB;CACzB,eAAe;CACf,yBAAyB;CACzB,aAAa;CACb,uBAAuB;CACvB,cAAc;CACd,wBAAwB;CACxB,mBAAmB;CACnB,6BAA6B;CAC7B,mBAAmB;CACnB,6BAA6B;CAC7B,qBAAqB;CACrB,+BAA+B;CAC/B,gBAAgB;CAChB,0BAA0B;AAC5B"}
|
|
1
|
+
{"version":3,"file":"shipping-address.js","names":[],"sources":["../../../src/matter/shipping-address/shipping-address.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentValue,\n defineComponent,\n defineContentType,\n type MessageFieldName,\n type MessageLocaleProp,\n} from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\nimport {\n Field,\n FieldBinding,\n type FieldOption,\n type FieldRule,\n type FieldRuleConstraint,\n FieldsetFieldContext,\n readBaseline,\n useFieldsetField,\n useFieldsetFieldNames,\n useNoAncestorFieldset,\n} from '../../particles/field/field.js';\nimport { Fieldset } from '../../particles/fieldset/fieldset.js';\nimport { type FieldsetRegistration, type FormUserError, useFormRegistry } from '../../particles/form/form.js';\nimport { FieldSelect } from '../../particles/select/field-select.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { countryDisplayName } from '../../sdk/address/country-display.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { useEntityDataResolved } from '../../sdk/data/entity-resolution-context.js';\nimport { useReactiveDataSettled } from '../../sdk/data/use-reactive-data-settled.js';\nimport { useStorefrontFormatters } from '../../sdk/format/client.js';\nimport type { ShippingAddressUpdateErrorCode } from '../../sdk/generated/graphql.js';\nimport { formatErrorCode } from '../../sdk/i18n/format-error-code.js';\nimport type { MessageFormatter } from '../../sdk/i18n/message-formatter.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport type { ShippingAddressInput, ShippingAddressUpdateErrorEntity } from '../../sdk/shipping/shipping-operations.js';\nimport { normalizeAddressField, pickActiveTextFields } from './address-payload.js';\nimport type { CountryDescriptor, FieldDescriptor } from './country-descriptors.js';\nimport { getAvailableCountries, getCountryDescriptor } from './country-descriptors.js';\nimport { LIBRARY_COUNTRIES, useLibraryCountryDescriptors } from './library-country-descriptors.js';\n\n/**\n * Shipping address step (T2 — Enter and save the delivery address).\n * Single-file matter per ADR-0001; batches form state and writes once via shipping.setAddress.\n * Controls are thin context-bound components that read/write draft state (docs/storefront-core/reference-cart.md § Delivery).\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment\n// ---------------------------------------------------------------------------\n\n/**\n * The fieldset's own fragment. Drops `savedAddresses` — the fieldset has no saved-address UI of\n * its own (Decision 1 of specs/shipping-address-fieldset.md).\n *\n * `clientProfile` selects `id` even though nothing renders it. The reactive runtime resolves each\n * root field to a cache reference through `cache.identify`, which needs `__typename` and `id`; with\n * no `id` in the composed page query the profile never normalises, `useReactiveEntity` keeps\n * returning the server's `fallbackData`, and a page composing this fieldset without\n * `ClientProfileFieldset` would show a logged-in shopper a blank recipient name instead of the one\n * US-4 fills in from their profile.\n */\nconst fieldsetFragment = /* GraphQL */ `\n fragment ShippingAddressFieldsetData on Query {\n shipping {\n __typename\n id\n address {\n __typename\n id\n recipientName\n postalCode\n country\n street\n number\n complement\n neighborhood\n city\n state\n }\n }\n clientProfile {\n __typename\n id\n firstName\n lastName\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * The `$data` slice forwarded to `ShippingAddressFieldset` by the reactive runtime. Selects two\n * root fields (`shipping`, `clientProfile`), so the compiler composes them via\n * `MultipleReactiveDataProvider`, which keys each entity's resolved slice by its own root field —\n * `$data` is `{ shipping: {...}, clientProfile: {...} }`, not a flat/unwrapped shape (that unwrapped\n * shape only applies to single-root-field fragments, e.g. CartTotalizerRoot's `$data.totalizers`).\n * Carries no `savedAddresses` — the fieldset has no saved-address UI of its own (Decision 1).\n */\nexport type ShippingAddressFieldsetData = {\n shipping?: {\n address?: {\n id?: string | null;\n recipientName?: string | null;\n postalCode?: string | null;\n country?: string | null;\n street?: string | null;\n number?: string | null;\n complement?: string | null;\n neighborhood?: string | null;\n city?: string | null;\n state?: string | null;\n } | null;\n } | null;\n clientProfile?: {\n firstName?: string | null;\n lastName?: string | null;\n } | null;\n} | null;\n\n/** The batched draft state, keyed by canonical field name (Decision 1). */\ntype AddressDraft = {\n recipientName: string;\n postalCode: string;\n country: string;\n street: string;\n number: string;\n complement: string;\n neighborhood: string;\n city: string;\n state: string;\n};\n\n// ---------------------------------------------------------------------------\n// Fieldset context\n// ---------------------------------------------------------------------------\n\n/** The react-hook-form namespace every field of this entity registers under. */\nconst SHIPPING_ADDRESS_NAMESPACE = 'shippingAddress';\n\n/** Canonical field keys, matching AddressDraft's keys and the descriptors' `name` values. */\nexport type ShippingAddressFieldKey = keyof AddressDraft;\n\n/**\n * The `country` argument of a country-worded message: the ISO codes of the descriptors. A country outside\n * them reads the message's `other` case.\n */\ntype MessageCountry = 'BRA' | 'USA' | 'CAN' | 'MEX';\n\n/** What a bound Control needs from its fieldset. Carries no live value. */\ntype ShippingAddressFieldsetContextValue = Readonly<{\n namespace: string;\n /** The active country's descriptor, or undefined when the country has none. */\n descriptor: CountryDescriptor | undefined;\n /** The active country, as the `country` argument of a country-worded message. */\n country: MessageCountry;\n /** The descriptor entry for a key, or undefined when this country does not have the field. */\n fieldFor: (key: ShippingAddressFieldKey) => FieldDescriptor | undefined;\n /** The value this field registers with as react-hook-form's field-level defaultValue. */\n seedFor: (key: ShippingAddressFieldKey) => string;\n /**\n * The rule for a rendered field. `label` is the control's formatted label: the same string the field\n * shows on screen, so the fieldset's `requiredMessage` names the field exactly as the screen does.\n * `invalidMessage` is what a value failing the descriptor's format shows. Never called for a field with\n * no descriptor entry.\n */\n ruleFor: (key: ShippingAddressFieldKey, label: string, invalidMessage: string) => FieldRule | undefined;\n /** Only for `country`: the platform's option list, contract-shaped. */\n countryOptions: readonly FieldOption[];\n}>;\n\nconst ShippingAddressFieldsetContext = createContext<ShippingAddressFieldsetContextValue | null>(null);\n\n/**\n * Read before any field hook (Decision 4): a control calls this before looking up its own\n * descriptor entry, so a field the active descriptor does not declare never calls\n * `useFieldsetField`/`useController` and so never registers with react-hook-form at all. Throws\n * when rendered with no `ShippingAddressFieldset` above it (Decision 2), naming the required\n * composition.\n */\nfunction useShippingAddressFieldsetContext(): ShippingAddressFieldsetContextValue {\n const ctx = useContext(ShippingAddressFieldsetContext);\n if (!ctx) {\n throw new Error('ShippingAddress*Control components must be used inside ShippingAddressFieldset.');\n }\n return ctx;\n}\n\n/**\n * Rows `ShippingAddressFieldsetSkeleton` draws when nobody says otherwise: one per Control in the\n * full anatomy, the nine of them. It is a default and not a derivation — the skeleton renders before\n * any address has resolved, so it cannot read the live descriptor, and the composed Controls are\n * opaque children. A page that composes fewer than nine sets `skeletonCount` to what it composed,\n * or the form jumps by the difference when the Controls take the skeleton's place.\n */\nconst SHIPPING_ADDRESS_SKELETON_ROWS = 9;\n\n/** `autoComplete` tokens per field (US-3, WCAG 2.1 SC 1.3.5). `number` has no standard token. */\nconst FIELD_AUTOCOMPLETE: Readonly<Record<ShippingAddressFieldKey, string | undefined>> = {\n recipientName: 'name',\n postalCode: 'postal-code',\n country: 'country',\n street: 'address-line1',\n number: undefined,\n complement: 'address-line2',\n neighborhood: 'address-level3',\n city: 'address-level2',\n state: 'address-level1',\n};\n\n/**\n * Words the descriptor's structural `rule` with the form's messages, under a generated `required`, which is\n * this fieldset's whole declaration of the baseline. The blank check it used to hand-write alongside lives\n * in `resolveRequiredness` now, installed for every bound control rather than only for this one.\n */\nfunction textOf(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\nfunction buildRule(field: FieldDescriptor, requiredMessage: string, invalidMessage: string): FieldRule {\n const pattern = field.rule?.pattern;\n const validate = field.rule?.validate;\n // The three members a country's rule can differ in are always present, `undefined` when this country\n // leaves them out: react-hook-form merges a re-registered rule over the one it holds, so a member left\n // out would keep the previous country's `pattern`, `validate` or `required` on a field both countries have.\n return {\n pattern: pattern ? { value: pattern, message: invalidMessage } : undefined,\n validate: validate ? (value: unknown) => validate(textOf(value)) || invalidMessage || false : undefined,\n required: field.required ? requiredMessage : undefined,\n };\n}\n\n/** Keeps only the AddressDraft keys `values` actually defines — a field no control composed is absent, not `undefined`. */\nfunction pickDefinedAddressFields(values: Record<string, unknown>): Partial<AddressDraft> {\n const result: Partial<AddressDraft> = {};\n for (const key of Object.keys(values) as ShippingAddressFieldKey[]) {\n const value = values[key];\n if (value !== undefined) result[key] = value as string;\n }\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Props Types\n// ---------------------------------------------------------------------------\n\nexport type ShippingAddressFieldsetProps = MessageLocaleProp & {\n /** Country used when the stored address has none. */\n defaultCountry?: string;\n /** Placeholder rows the loading skeleton draws. Set it to the number of Controls composed here. */\n skeletonCount?: number;\n className?: string;\n children?: ReactNode;\n /** `ShippingAddressFieldsetData` forwarded by the reactive runtime. */\n $data?: ShippingAddressFieldsetData;\n /** Compiler-injected action surface; carries `shipping.setAddress`. */\n $actions?: ComponentActions;\n /** The two announcements, the group's accessible name and the required-field message. */\n $content?: ContentValue<typeof ShippingAddressFieldsetContent>;\n};\n\nexport type ShippingAddressStreetControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressStreetContent>;\n};\n\nexport type ShippingAddressNumberControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressNumberContent>;\n};\n\nexport type ShippingAddressCityControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressCityContent>;\n};\n\nexport type ShippingAddressStateControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressStateContent>;\n};\n\nexport type ShippingAddressPostalCodeControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressPostalCodeContent>;\n};\n\nexport type ShippingAddressComplementControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressComplementContent>;\n};\n\nexport type ShippingAddressNeighborhoodControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressNeighborhoodContent>;\n};\n\nexport type ShippingAddressCountryControlProps = MessageLocaleProp & {\n className?: string;\n /** Shown when the field has no value. Absence shows the active country's name. */\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, FieldSelect.Root, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressCountryContent>;\n};\n\nexport type ShippingAddressRecipientNameControlProps = MessageLocaleProp & {\n className?: string;\n placeholder?: string;\n /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */\n children?: ReactNode;\n $content?: ContentValue<typeof ShippingAddressRecipientNameContent>;\n};\n\n// ---------------------------------------------------------------------------\n// Content Types\n// ---------------------------------------------------------------------------\n\nexport const ShippingAddressFieldsetContent = defineContentType({\n id: 'shipping-address-fieldset',\n title: 'Shipping Address Fieldset',\n description: 'Announcements and accessible name of the delivery address group, and its required-field message.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n loadingLabel: {\n type: 'string',\n title: 'Loading announcement',\n description: 'Announced politely while the address resolves.',\n format: 'icu-message',\n messageSource: 'Loading your delivery address',\n },\n loadedLabel: {\n type: 'string',\n title: 'Loaded announcement',\n description: 'Announced politely once the fields mount.',\n format: 'icu-message',\n messageSource: 'Your delivery address is ready',\n },\n groupLabel: {\n type: 'string',\n title: 'Accessible group name',\n description: 'A composed FieldsetLegend wins over it.',\n format: 'icu-message',\n messageSource: 'Your delivery address',\n messageOptional: true,\n },\n requiredMessage: {\n type: 'string',\n title: 'Required field message',\n description: \"Shown under a required field left blank; label is that field's label.\",\n format: 'icu-message',\n messageSource: '{label} is required',\n messageArguments: { type: 'object', properties: { label: { type: 'string' } } },\n messageExample: { label: 'recipient name' },\n },\n missingRecipientNameMessage: {\n type: 'string',\n title: 'Missing recipient name message',\n description: 'Shown by FormError when the server refuses a blank recipient name.',\n format: 'icu-message',\n messageSource: \"Enter the recipient's name.\",\n },\n invalidPostalCodeMessage: {\n type: 'string',\n title: 'Invalid postal code message',\n description: 'Shown by FormError when the server refuses the postal code.',\n format: 'icu-message',\n messageSource: 'Enter a valid postal code.',\n },\n invalidAddressMessage: {\n type: 'string',\n title: 'Invalid address message',\n description: 'Shown by FormError when the server refuses the address.',\n format: 'icu-message',\n messageSource: 'Check the address and try again.',\n },\n genericErrorMessage: {\n type: 'string',\n title: 'Generic error message',\n description: 'Shown by FormError for a network failure or a refusal the shopper cannot fix.',\n format: 'icu-message',\n messageSource: 'Unable to save your delivery address. Please try again.',\n },\n },\n },\n});\n\n/**\n * The message for each refusal of the address write: every `ShippingAddressUpdateErrorCode` plus the\n * client-minted transport failure. `dispatch` hands `FormError` this copy, never the server's English\n * `message`: a code this map does not know shows genericErrorMessage.\n */\nexport const SHIPPING_ADDRESS_FIELDSET_ERROR_FIELDS = {\n MISSING_RECIPIENT_NAME: 'missingRecipientNameMessage',\n INVALID_POSTAL_CODE: 'invalidPostalCodeMessage',\n INVALID_ADDRESS: 'invalidAddressMessage',\n MISSING_CART_CONTEXT: 'genericErrorMessage',\n CART_NOT_FOUND: 'genericErrorMessage',\n INVALID_SAVED_ADDRESS_ID: 'genericErrorMessage',\n INVALID_COUNTRY_CODE: 'genericErrorMessage',\n NETWORK_ERROR: 'genericErrorMessage',\n} as const satisfies Record<\n ShippingAddressUpdateErrorCode | 'NETWORK_ERROR',\n MessageFieldName<typeof ShippingAddressFieldsetContent>\n>;\n\nfunction wordShippingAddressError(\n error: ShippingAddressUpdateErrorEntity,\n { format }: MessageFormatter<typeof ShippingAddressFieldsetContent>,\n): FormUserError {\n return {\n code: error.code,\n message: formatErrorCode(\n ShippingAddressFieldsetContent,\n SHIPPING_ADDRESS_FIELDSET_ERROR_FIELDS,\n error,\n format,\n 'genericErrorMessage',\n ),\n };\n}\n\nexport const ShippingAddressRecipientNameContent = defineContentType({\n id: 'shipping-address-recipient-name',\n title: 'Shipping Address Recipient Name',\n description: 'Label of the recipient name field of the delivery address.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Field label', format: 'icu-message', messageSource: 'recipient name' },\n },\n },\n});\n\nexport const ShippingAddressStreetContent = defineContentType({\n id: 'shipping-address-street',\n title: 'Shipping Address Street',\n description: 'Label of the street field of the delivery address.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Field label', format: 'icu-message', messageSource: 'street' },\n },\n },\n});\n\nexport const ShippingAddressNumberContent = defineContentType({\n id: 'shipping-address-number',\n title: 'Shipping Address Number',\n description: 'Label of the number field of the delivery address.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Field label', format: 'icu-message', messageSource: 'number' },\n },\n },\n});\n\nexport const ShippingAddressComplementContent = defineContentType({\n id: 'shipping-address-complement',\n title: 'Shipping Address Complement',\n description: 'Label of the complement field of the delivery address.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: {\n type: 'string',\n title: 'Field label',\n format: 'icu-message',\n messageSource: 'apartment, suite, etc. (optional)',\n },\n },\n },\n});\n\nexport const ShippingAddressNeighborhoodContent = defineContentType({\n id: 'shipping-address-neighborhood',\n title: 'Shipping Address Neighborhood',\n description: 'Label of the neighborhood field of the delivery address.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Field label', format: 'icu-message', messageSource: 'neighborhood' },\n },\n },\n});\n\nexport const ShippingAddressCityContent = defineContentType({\n id: 'shipping-address-city',\n title: 'Shipping Address City',\n description: 'Label of the city field of the delivery address.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Field label', format: 'icu-message', messageSource: 'city' },\n },\n },\n});\n\nexport const ShippingAddressStateContent = defineContentType({\n id: 'shipping-address-state',\n title: 'Shipping Address State',\n description: 'Label of the state field of the delivery address, worded per country.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: {\n type: 'string',\n title: 'Field label',\n description: 'country is the active country (ISO 3166-1 alpha-3).',\n format: 'icu-message',\n messageSource: '{country, select, CAN {province} other {state}}',\n messageArguments: {\n type: 'object',\n properties: { country: { type: 'string', enum: ['BRA', 'USA', 'CAN', 'MEX'] } },\n },\n messageExample: { country: 'CAN' },\n },\n },\n },\n});\n\nexport const ShippingAddressPostalCodeContent = defineContentType({\n id: 'shipping-address-postal-code',\n title: 'Shipping Address Postal Code',\n description: 'Label of the postal code field of the delivery address and its format message, worded per country.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: {\n type: 'string',\n title: 'Field label',\n description: 'country is the active country (ISO 3166-1 alpha-3).',\n format: 'icu-message',\n messageSource: '{country, select, USA {zip code} other {postal code}}',\n messageArguments: {\n type: 'object',\n properties: { country: { type: 'string', enum: ['BRA', 'USA', 'CAN', 'MEX'] } },\n },\n messageExample: { country: 'USA' },\n },\n invalidMessage: {\n type: 'string',\n title: 'Invalid postal code message',\n description: \"Shown under a postal code not in the active country's format. Never contains the typed value.\",\n format: 'icu-message',\n messageSource: '{country, select, USA {invalid zip code} other {invalid postal code}}',\n messageArguments: {\n type: 'object',\n properties: { country: { type: 'string', enum: ['BRA', 'USA', 'CAN', 'MEX'] } },\n },\n messageExample: { country: 'USA' },\n },\n },\n },\n});\n\nexport const ShippingAddressCountryContent = defineContentType({\n id: 'shipping-address-country',\n title: 'Shipping Address Country',\n description: 'Label of the country selector of the delivery address.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Field label', format: 'icu-message', messageSource: 'country' },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Root Definition\n// ---------------------------------------------------------------------------\n\nexport const ShippingAddressFieldsetDefinition = defineComponent<ShippingAddressFieldsetProps>({\n name: 'ShippingAddressFieldset',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressFieldset,\n fragment: fieldsetFragment,\n fetchStrategy: 'reactive',\n skeleton: ShippingAddressFieldsetSkeleton,\n actions: { shipping: ['setAddress'] },\n requiresContext: 'form',\n providesContext: 'shipping-address',\n content: ShippingAddressFieldsetContent,\n editor: { label: 'Shipping Address Fieldset', category: 'commerce' },\n schema: {\n defaultCountry: { type: 'string', default: 'BRA', label: 'Default country (ISO-3)' },\n skeletonCount: { type: 'number', default: 9, label: 'Skeleton rows' },\n },\n guideline:\n 'Composable delivery-address entity: registers under \"shippingAddress\" with the enclosing FormRoot and dispatches shipping.setAddress only when the shopper changed something. Compose the nine ShippingAddress*Control parts inside it; place FormSubmit/FormEnterSubmit/FormError as siblings of the fieldset, not inside it — this fieldset renders no submit or error part of its own. The Controls mount only once the address has resolved, with skeletonCount placeholder rows in their place until then — set it to the number of Controls composed, or the form jumps by the difference. Style the announcement sr-only; its two messages are the $content fields loadingLabel and loadedLabel. The $content field groupLabel names the group as its accessible name; blank emits no aria-label, and a composed FieldsetLegend wins over it. A required field left blank shows the $content field requiredMessage, whose label argument is the label of that field. See shipping-address.md.',\n});\n\n// Control Definitions\n// Shared by all eight text Controls below (RFC:503): states the requiresContext and the\n// recomposable anatomy every one of them shares.\nconst ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX =\n 'Its label is the $content field label. Must be a descendant of ShippingAddressFieldset, which provides the shipping-address context this control requires. Recomposable: compose Field.Label, Field.Control and Field.Error as children, in any order, to reorder or extend the anatomy; a childless composition keeps the default label-control-error order.';\n\nexport const ShippingAddressRecipientNameControlDefinition = defineComponent<ShippingAddressRecipientNameControlProps>({\n name: 'ShippingAddressRecipientNameControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressRecipientNameControl,\n content: ShippingAddressRecipientNameContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Recipient Name Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Recipient-name input field; required for submit. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressStreetControlDefinition = defineComponent<ShippingAddressStreetControlProps>({\n name: 'ShippingAddressStreetControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressStreetControl,\n content: ShippingAddressStreetContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Street Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Street name input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressNumberControlDefinition = defineComponent<ShippingAddressNumberControlProps>({\n name: 'ShippingAddressNumberControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressNumberControl,\n content: ShippingAddressNumberContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Number Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Street number input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressCityControlDefinition = defineComponent<ShippingAddressCityControlProps>({\n name: 'ShippingAddressCityControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressCityControl,\n content: ShippingAddressCityContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'City Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `City name input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressStateControlDefinition = defineComponent<ShippingAddressStateControlProps>({\n name: 'ShippingAddressStateControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressStateControl,\n content: ShippingAddressStateContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'State Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `State/province input field; its label takes the active country as the country select argument. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressPostalCodeControlDefinition = defineComponent<ShippingAddressPostalCodeControlProps>({\n name: 'ShippingAddressPostalCodeControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressPostalCodeControl,\n content: ShippingAddressPostalCodeContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Postal Code Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Postal code input field; its label and invalidMessage take the active country as the country select argument. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressComplementControlDefinition = defineComponent<ShippingAddressComplementControlProps>({\n name: 'ShippingAddressComplementControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressComplementControl,\n content: ShippingAddressComplementContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Complement Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Complement (apartment, suite, etc.) input field. ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressNeighborhoodControlDefinition = defineComponent<ShippingAddressNeighborhoodControlProps>({\n name: 'ShippingAddressNeighborhoodControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressNeighborhoodControl,\n content: ShippingAddressNeighborhoodContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Neighborhood Control', category: 'action' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n },\n guideline: `Neighborhood (bairro) input field; shown only for countries that have this field (BR in v1). ${ADDRESS_TEXT_CONTROL_GUIDELINE_SUFFIX}`,\n});\n\nexport const ShippingAddressCountryControlDefinition = defineComponent<ShippingAddressCountryControlProps>({\n name: 'ShippingAddressCountryControl',\n importPath: '@vtex/faststore/components',\n component: ShippingAddressCountryControl,\n content: ShippingAddressCountryContent,\n requiresContext: 'shipping-address',\n providesContext: 'field',\n editor: { label: 'Country Control', category: 'action' },\n schema: {},\n guideline:\n 'Country selector; lists only countries with an implemented descriptor, each named in the store locale. Its label is the $content field label. Must be a descendant of ShippingAddressFieldset, which provides the shipping-address context this control requires. Recomposable: compose Field.Label, FieldSelect.Root and Field.Error as children, in any order; a childless composition keeps the default label-select-error order.',\n});\n\n// ---------------------------------------------------------------------------\n// Fieldset Component\n// ---------------------------------------------------------------------------\n\n/** The message a constrained rule member carries; a bare value (or a bare `RegExp`) carries none. */\nfunction messageOf(constraint: number | string | RegExp | FieldRuleConstraint<unknown> | undefined): string {\n return typeof constraint === 'object' && !(constraint instanceof RegExp) ? constraint.message : '';\n}\n\n/**\n * Every static message a rule carries, in a fixed order: the `required` copy in any of its three shapes,\n * then the message of each constrained member. A `validate` record has no static copy, so it adds none.\n */\nfunction messagesOf(rule: FieldRule | undefined): string[] {\n return [\n readBaseline(rule).message ?? '',\n messageOf(rule?.pattern),\n messageOf(rule?.min),\n messageOf(rule?.max),\n messageOf(rule?.minLength),\n messageOf(rule?.maxLength),\n ];\n}\n\n/**\n * An error already on screen keeps the message of the rule that raised it, so a country switch would\n * leave \"é obrigatório\" under a USA form until the shopper edits or submits again. A bound control\n * therefore revalidates itself when the copy of its own rule changes while it carries an error: that\n * re-words it from the new rule without newly flagging a field the shopper has not reached.\n *\n * It runs inside the control, as an effect of the component that renders the field's own subtree, so it\n * always fires after that field's registration — `useController` re-registers `rules` during render, and\n * descendants' effects precede their parent's — and never validates against the previous rule, whichever\n * of the two the registration becomes. The first run counts as a change too: a field that remounts after\n * a country without it keeps its error across the unmount (`shouldUnregister` being false) and comes\n * back carrying the old wording.\n */\nfunction useRewordErroredField(name: string, rule: FieldRule | undefined) {\n const { getFieldState, trigger } = useFormContext();\n const copy = messagesOf(rule).join('\\n');\n // Two countries can share a rule's wording and differ only in its `validate` (the `CAN` and `MEX` postal\n // codes), so the validator's identity is a trigger too. A descriptor holds its validator for good, so this\n // changes only when the country does.\n const validate = rule?.validate;\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: `copy` and `validate` are the triggers, not inputs — the effect revalidates when the rule's wording or validator changes.\n useEffect(() => {\n if (getFieldState(name).error) void trigger(name);\n }, [copy, validate, name, getFieldState, trigger]);\n}\n\n/**\n * ShippingAddressFieldset — this entity's root: same data, same action as a page-level submit\n * would use, dispatched at form-submit time instead of through a button of its own. Registers one\n * `FieldsetRegistration` with the enclosing `FormRoot` under the `shippingAddress` namespace,\n * derives the active country descriptor from react-hook-form (Decision 2), and publishes each\n * field's seed/rule/label through its own context so a bound Control never writes a validation\n * expression. Renders no button and holds no draft of its own.\n *\n * Its controls mount only once the entity has resolved; until then the `Fieldset.Root` carries\n * `-pending` and renders `ShippingAddressFieldsetSkeleton`. \"Resolved\" is two conditions, because\n * `$data` alone cannot answer it: under the reactive runtime the slice is defined from the first\n * render — `useReactiveEntity` hands down `fallbackData` while the cache read is incomplete — so an\n * empty server answer looks exactly like a resolved one, and every control would mount seeded `''`\n * before the shopper's stored address arrives. Each seed reaches react-hook-form as a field-level\n * `defaultValue`; `useSeedAdoption` re-seeds a clean field with it on every render, but once the\n * field turns dirty no later seed ever reaches it again (Decision 12). Mounting before the answer\n * arrives would seed `''`: a shopper who starts typing before the real value lands makes the field\n * dirty on that empty seed, permanently locking their saved address out of it, and even a shopper who\n * does not type sees the field flash from `''` to the real data. `useReactiveDataSettled` supplies\n * the missing half: the page query's own in-flight state, latched so it only ever goes pending →\n * settled. The `$data === undefined` half still carries\n * trees with no reactive root above them, where the slice arrives as a plain prop.\n *\n * Both ends of that wait are spoken: the fieldset carries `aria-busy` while it lasts and holds a\n * polite live region that announces `loadingLabel` and then `loadedLabel`. Style the region\n * `sr-only` — it is text meant for a screen reader, not for the page.\n */\nexport function ShippingAddressFieldset({\n defaultCountry = 'BRA',\n skeletonCount = SHIPPING_ADDRESS_SKELETON_ROWS,\n className,\n children,\n $data: $dataProp,\n $actions: $actionsProp,\n $content,\n}: ShippingAddressFieldsetProps): ReactNode {\n // First hook called: throws the named registry error when no FormRoot is above (US-1, 5th\n // criterion), before any react-hook-form hook below has a chance to run against a missing context.\n const { registerFieldset } = useFormRegistry();\n\n // Guards runtime registry integrity the same way FormRoot's namespace-collision throw does:\n // useFieldsetField resolves the *nearest* FieldsetFieldContext, not the fieldset that owns a\n // given namespace, so a fieldset nested inside another one would register its controls' names\n // into the ancestor's name set instead of its own — FormClear, FormReset and post-dispatch\n // reconciliation would then act on the wrong fields. Nesting fieldsets has no legitimate use,\n // so this throws at mount rather than silently misrouting names.\n useNoAncestorFieldset('ShippingAddressFieldset');\n\n const $data = useDataOverride($dataProp);\n\n const $actions = useActionsOverride($actionsProp);\n const messages = useMessageFormatter(ShippingAddressFieldsetContent, $content);\n const { format } = messages;\n // Read at dispatch time, so a content change words the next refusal without re-registering.\n const messagesRef = useRef(messages);\n useEffect(() => {\n messagesRef.current = messages;\n }, [messages]);\n const { displayName } = useStorefrontFormatters();\n // Three conditions, not two. `useReactiveDataSettled` latches one way and never re-arms, so on its\n // own it answers \"has this page ever resolved\", not \"is what I am holding right now the server's\n // answer\" — after the page query's entity ref moves to one this cache never stored, or its root is\n // skipped for want of a variable, the slice silently regresses to `fallbackData` while the latch\n // still reads settled. `useEntityDataResolved` is the per-entity half: unlatched, so it follows the\n // slice back down and returns this fieldset to its skeleton instead of leaving live controls seeded\n // from a placeholder.\n const settled = useReactiveDataSettled();\n const sliceResolved = useEntityDataResolved();\n // Starts the load of the library-backed countries (`CAN`, `MEX`) and re-renders this fieldset as each\n // one arrives. `loaded` is what the country options below depend on.\n const { loaded: loadedLibraryCountries, settled: libraryCountriesSettled } = useLibraryCountryDescriptors();\n const currentAddress = $data?.shipping?.address;\n const clientProfile = $data?.clientProfile;\n const joinedProfileName = [clientProfile?.firstName, clientProfile?.lastName].filter(Boolean).join(' ');\n\n // The one seed record every field registers with as react-hook-form's own defaultValue (Decision\n // 12) — resolved fresh from $data on every render and re-applied to every already-mounted field\n // that is still clean; a field the shopper has started editing turns dirty and locks this out.\n const seed = useMemo<AddressDraft>(\n () => ({\n recipientName: currentAddress?.recipientName ?? joinedProfileName,\n postalCode: currentAddress?.postalCode ?? '',\n country: currentAddress?.country ?? defaultCountry,\n street: currentAddress?.street ?? '',\n number: currentAddress?.number ?? '',\n complement: currentAddress?.complement ?? '',\n neighborhood: currentAddress?.neighborhood ?? '',\n city: currentAddress?.city ?? '',\n state: currentAddress?.state ?? '',\n }),\n [currentAddress, joinedProfileName, defaultCountry],\n );\n\n // Decision 2: the descriptor is derived from react-hook-form, not from a draft of our own, so a\n // country change reshapes the form with one subscription and no re-seeding effect. `FormClear`\n // can drive the live value to '' (the select itself never offers an empty option); falling back\n // to the seeded country there keeps every field — including the required recipient name — mounted\n // and focusable instead of vanishing the moment the form is cleared.\n const watchedCountry = useWatch({ name: `${SHIPPING_ADDRESS_NAMESPACE}.country`, defaultValue: seed.country });\n const activeCountry = (typeof watchedCountry === 'string' && watchedCountry) || seed.country;\n // A library-backed country counts as present only once the hook reports it loaded. The module cache may\n // already hold it while this tree hydrates (another component's effect filled it), but the hook's server\n // snapshot says nothing is loaded, so reading the cache here would render controls over the server's skeleton.\n const descriptor =\n LIBRARY_COUNTRIES.includes(activeCountry) && !loadedLibraryCountries.includes(activeCountry)\n ? undefined\n : getCountryDescriptor(activeCountry);\n\n // A stored or default country the library backs has no descriptor until its chunk arrives, and mounting\n // the controls without one would seed a form with no fields. So the fieldset also waits until the active\n // country has a descriptor or every library load has settled; a country that never loads is then the\n // existing country-with-no-descriptor state.\n const resolved =\n settled && sliceResolved && $data !== undefined && (descriptor !== undefined || libraryCountriesSettled);\n\n const fieldFor = useCallback(\n (key: ShippingAddressFieldKey) => descriptor?.fields.find((f) => f.name === key),\n [descriptor],\n );\n const seedFor = useCallback((key: ShippingAddressFieldKey) => seed[key], [seed]);\n const ruleFor = useCallback(\n (key: ShippingAddressFieldKey, label: string, invalidMessage: string) => {\n const field = fieldFor(key);\n if (!field) return undefined;\n return buildRule(field, field.required ? format('requiredMessage', { label }) : '', invalidMessage);\n },\n [fieldFor, format],\n );\n const countryOptions = useMemo<readonly FieldOption[]>(() => {\n const libraryCountries = new Set(LIBRARY_COUNTRIES);\n const loaded = new Set(loadedLibraryCountries);\n const options: FieldOption[] = [];\n\n for (const iso of getAvailableCountries()) {\n if (libraryCountries.has(iso) && !loaded.has(iso)) continue;\n options.push({ value: iso, label: countryDisplayName(iso, displayName) ?? iso });\n }\n\n return options;\n }, [loadedLibraryCountries, displayName]);\n\n // A country outside the descriptors' codes reads a message's `other` case, so the cast only names it.\n const country = activeCountry as MessageCountry;\n const fieldsetContextValue = useMemo<ShippingAddressFieldsetContextValue>(\n () => ({ namespace: SHIPPING_ADDRESS_NAMESPACE, descriptor, country, fieldFor, seedFor, ruleFor, countryOptions }),\n [descriptor, country, fieldFor, seedFor, ruleFor, countryOptions],\n );\n\n // Collects the field names this fieldset's own controls currently have mounted (FR 3), over the\n // seam `particles/field/field.tsx` exports for exactly this purpose.\n const { registry: fieldRegistryValue, getFieldNames } = useFieldsetFieldNames(SHIPPING_ADDRESS_NAMESPACE);\n\n // Deliberately NOT dirty-only (T21 Decision 4), unlike ClientProfileFieldset/ClientPreferencesFieldset:\n // `ShippingAddressUpdateInput` declares `postalCode` and `country` non-null (`recipientName` is optional;\n // core.graphql:2795-2807), so a payload carrying only the changed keys can omit the non-null fields.\n // Sending the whole active-country address, seed-merged with the live values, is the correct shape\n // for this mutation's contract — not an oversight to \"fix\" into dirty-only.\n const toPayload = useCallback(\n (values: Record<string, unknown>): Record<string, unknown> => {\n const merged = { ...seed, ...pickDefinedAddressFields(values) } as AddressDraft;\n const country = String(merged.country || seed.country);\n const active = getCountryDescriptor(country);\n const isActive = (key: ShippingAddressFieldKey) => active?.fields.some((f) => f.name === key) ?? false;\n\n return {\n country,\n ...(isActive('recipientName') ? { recipientName: String(merged.recipientName ?? '').trim() } : {}),\n ...(isActive('postalCode')\n ? { postalCode: normalizeAddressField(active?.fields ?? [], 'postalCode', merged.postalCode) }\n : {}),\n ...pickActiveTextFields(active?.fields ?? [], merged),\n };\n },\n [seed],\n );\n\n const dispatch = useCallback(\n async (payload: Record<string, unknown>): Promise<readonly FormUserError[]> => {\n if (!$actions?.shipping?.setAddress) {\n // The form reports a failure rather than silently succeeding (FR 13).\n throw new Error('ShippingAddressFieldset requires $actions.shipping.setAddress.');\n }\n const userErrors = await $actions.shipping.setAddress(payload as ShippingAddressInput);\n return userErrors.map((error) => wordShippingAddressError(error, messagesRef.current));\n },\n [$actions],\n );\n\n const registration = useMemo<FieldsetRegistration>(\n () => ({\n namespace: SHIPPING_ADDRESS_NAMESPACE,\n getFieldNames,\n dispatch,\n toPayload,\n // Decision 1: the register is a machine identifier, the kebab-case ASCII rendering of this\n // registration's own `namespace` (`shippingAddress` → `shipping-address`) — not authored per\n // page (Decision 2).\n label: 'shipping-address',\n }),\n [getFieldNames, dispatch, toPayload],\n );\n\n // Registered from the mount commit, like the other two fieldsets, because `FormRoot` takes a\n // fieldset's dispatch slot from its first registration: deferring it until the entity resolves\n // would put this fieldset after every sibling that registered at mount, whatever their order in\n // the document.\n //\n // Registering early cannot send an unresolved seed. `toPayload` is whole-entity here\n // (`ShippingAddressUpdateInput` declares three fields non-null, so the payload is\n // `{ ...seed, ...liveValues }`), which makes a placeholder seed sendable, but the Controls mount only\n // once the entity has resolved. Until then `getFieldNames()` is empty and `FormRoot` finds nothing of\n // this fieldset that could be dirty — including a field the shopper edited before the slice regressed.\n useEffect(() => registerFieldset(registration), [registerFieldset, registration]);\n\n // Assistive technology only reports a change inside a region that was already in the tree, so a\n // region mounted together with its text announces nothing. The region therefore sits in both\n // branches and starts empty, with the wait written on the pass after mount and replaced — not\n // cleared — once the Controls are up: the skeleton is `aria-hidden`, so without this second\n // message the form would materialise in silence (WCAG 2.1 SC 4.1.3).\n const [announcement, setAnnouncement] = useState('');\n const announced = format(resolved ? 'loadedLabel' : 'loadingLabel');\n const groupLabel = format('groupLabel');\n useEffect(() => {\n setAnnouncement(announced);\n }, [announced]);\n\n return (\n <Fieldset.Root\n className={className}\n aria-busy={resolved ? undefined : true}\n // FR-12: a blank (or missing) message means no name is exposed, mirroring the two announcements.\n // On the root itself (FR-13), so it is identical whether the fieldset is pending or resolved; a\n // page-composed FieldsetLegend still wins via aria-labelledby.\n {...(groupLabel.trim() ? { 'aria-label': groupLabel } : {})}\n data-fs-shipping-address-fieldset=\"\"\n {...(resolved ? {} : { 'data-fs-shipping-address-fieldset-pending': '' })}\n >\n <ShippingAddressFieldsetContext.Provider value={fieldsetContextValue}>\n <FieldsetFieldContext.Provider value={fieldRegistryValue}>\n {resolved ? children : <ShippingAddressFieldsetSkeleton count={skeletonCount} />}\n </FieldsetFieldContext.Provider>\n </ShippingAddressFieldsetContext.Provider>\n <output aria-live=\"polite\" data-fs-shipping-address-fieldset-announcement=\"\">\n {announcement}\n </output>\n </Fieldset.Root>\n );\n}\n\n/**\n * The loading state of the fieldset, rendered in place of the Controls until the entity resolves and\n * declared as the definition's `skeleton`. Purely visual: the wait is spoken by the fieldset's own\n * live region, so this is hidden from assistive technology rather than announced twice.\n */\nexport function ShippingAddressFieldsetSkeleton({\n count = SHIPPING_ADDRESS_SKELETON_ROWS,\n className,\n ...props\n}: ComponentPropsWithRef<'div'> & { count?: number }) {\n return (\n <div {...props} className={className} data-fs-shipping-address-fieldset-skeleton=\"\" aria-hidden=\"true\">\n {Array.from({ length: count }, (_, i) => (\n <span key={i} data-fs-shipping-address-fieldset-skeleton-field=\"\" />\n ))}\n </div>\n );\n}\n\nShippingAddressFieldset.Skeleton = ShippingAddressFieldsetSkeleton;\n\n// ---------------------------------------------------------------------------\n// Control Components (thin, context-bound, reuse particles)\n//\n// Each control reads the fieldset context and finds its descriptor entry *before* calling any\n// field hook, so a field the active descriptor does not declare never calls\n// `useFieldsetField`/`useController` and so never registers with react-hook-form at all\n// (Decision 4).\n// ---------------------------------------------------------------------------\n\n/** The eight text fields' shared anatomy (Decision 6): `FieldBinding > Field.Root > (Field.Label, Field.Control, Field.Error)`. */\ntype BoundAddressTextFieldProps = {\n fieldKey: Exclude<ShippingAddressFieldKey, 'country'>;\n slug: string;\n className?: string;\n /** The control's formatted label. */\n label: string;\n /** What a value failing the descriptor's format shows; only the postal code has a format. */\n invalidMessage?: string;\n placeholder?: string;\n children?: ReactNode;\n fieldsetCtx: ShippingAddressFieldsetContextValue;\n};\n\nfunction BoundAddressTextField({\n fieldKey,\n slug,\n className,\n label,\n invalidMessage = '',\n placeholder,\n children,\n fieldsetCtx,\n}: Readonly<BoundAddressTextFieldProps>) {\n const name = useFieldsetField(SHIPPING_ADDRESS_NAMESPACE, fieldKey);\n // The rule gets the same label the field shows, so the required message names the field as the screen\n // does (spec 806-809). Memoised on its inputs: a new `validate` on every render would re-word an errored\n // field on every render.\n const { ruleFor } = fieldsetCtx;\n const rule = useMemo(() => ruleFor(fieldKey, label, invalidMessage), [ruleFor, fieldKey, label, invalidMessage]);\n useRewordErroredField(name, rule);\n\n return (\n <FieldBinding\n name={name}\n label={label}\n placeholder={placeholder}\n defaultValue={fieldsetCtx.seedFor(fieldKey)}\n rule={rule}\n autoComplete={FIELD_AUTOCOMPLETE[fieldKey]}\n >\n <Field.Root className={className} data-fs-shipping-address-field={slug}>\n {children ?? (\n <>\n <Field.Label />\n <Field.Control />\n <Field.Error />\n </>\n )}\n </Field.Root>\n </FieldBinding>\n );\n}\n\n/**\n * RecipientNameControl — the only required field (US-4, US-6); the postal code is client-validated\n * too, against the active country's format.\n * Pre-filled from clientProfile, editable, required.\n */\nexport function ShippingAddressRecipientNameControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressRecipientNameControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressRecipientNameContent, $content);\n if (!fieldsetCtx.fieldFor('recipientName')) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"recipientName\"\n slug=\"recipient-name\"\n className={className}\n label={format('label')}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** StreetControl */\nexport function ShippingAddressStreetControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressStreetControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressStreetContent, $content);\n if (!fieldsetCtx.fieldFor('street')) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"street\"\n slug=\"street\"\n className={className}\n label={format('label')}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** NumberControl */\nexport function ShippingAddressNumberControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressNumberControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressNumberContent, $content);\n if (!fieldsetCtx.fieldFor('number')) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"number\"\n slug=\"number\"\n className={className}\n label={format('label')}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** CityControl */\nexport function ShippingAddressCityControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressCityControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressCityContent, $content);\n if (!fieldsetCtx.fieldFor('city')) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"city\"\n slug=\"city\"\n className={className}\n label={format('label')}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** StateControl — its label is worded per country (`state`, `province`). */\nexport function ShippingAddressStateControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressStateControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressStateContent, $content);\n if (!fieldsetCtx.fieldFor('state')) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"state\"\n slug=\"state\"\n className={className}\n label={format('label', { country: fieldsetCtx.country })}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** PostalCodeControl — its label and format message are worded per country. */\nexport function ShippingAddressPostalCodeControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressPostalCodeControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressPostalCodeContent, $content);\n if (!fieldsetCtx.fieldFor('postalCode')) return null;\n const country = fieldsetCtx.country;\n return (\n <BoundAddressTextField\n fieldKey=\"postalCode\"\n slug=\"postal-code\"\n className={className}\n label={format('label', { country })}\n invalidMessage={format('invalidMessage', { country })}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** ComplementControl */\nexport function ShippingAddressComplementControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressComplementControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressComplementContent, $content);\n if (!fieldsetCtx.fieldFor('complement')) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"complement\"\n slug=\"complement\"\n className={className}\n label={format('label')}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/** NeighborhoodControl (BR-specific in v1) */\nexport function ShippingAddressNeighborhoodControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressNeighborhoodControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressNeighborhoodContent, $content);\n if (!fieldsetCtx.fieldFor('neighborhood')) return null;\n return (\n <BoundAddressTextField\n fieldKey=\"neighborhood\"\n slug=\"neighborhood\"\n className={className}\n label={format('label')}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundAddressTextField>\n );\n}\n\n/**\n * CountryControl — moves onto `FieldSelect` (Decision 8): the trigger resolves a country name from\n * the field contract's `options`. Gated on `descriptor`, not on a per-field entry (country has\n * none): a country with no descriptor renders no controls at all (Decision 3/4's \"no entry, no\n * control\" applied to the field that selects the entry itself).\n */\nexport function ShippingAddressCountryControl({\n className,\n placeholder,\n children,\n $content,\n}: ShippingAddressCountryControlProps): ReactNode {\n const fieldsetCtx = useShippingAddressFieldsetContext();\n const { format } = useMessageFormatter(ShippingAddressCountryContent, $content);\n if (!fieldsetCtx.descriptor) return null;\n return (\n <BoundShippingAddressCountryControl\n className={className}\n label={format('label')}\n placeholder={placeholder}\n fieldsetCtx={fieldsetCtx}\n >\n {children}\n </BoundShippingAddressCountryControl>\n );\n}\n\ntype BoundShippingAddressCountryControlProps = {\n className?: string;\n /** The control's formatted label. */\n label: string;\n placeholder?: string;\n children?: ReactNode;\n fieldsetCtx: ShippingAddressFieldsetContextValue;\n};\n\nfunction BoundShippingAddressCountryControl({\n className,\n label,\n placeholder,\n children,\n fieldsetCtx,\n}: Readonly<BoundShippingAddressCountryControlProps>) {\n const name = useFieldsetField(SHIPPING_ADDRESS_NAMESPACE, 'country');\n const { displayName } = useStorefrontFormatters();\n\n return (\n <FieldBinding\n name={name}\n label={label}\n // Falls back to the active country's name (already the FormClear-safe activeCountry, not the raw\n // watched value — Decision 2) so the trigger shows the country that will actually be sent even\n // when react-hook-form's own value is '' (e.g. right after FormClear), instead of\n // resolveOptionLabel('') rendering nothing at all.\n placeholder={placeholder ?? countryDisplayName(fieldsetCtx.descriptor?.iso, displayName) ?? undefined}\n defaultValue={fieldsetCtx.seedFor('country')}\n options={fieldsetCtx.countryOptions}\n autoComplete={FIELD_AUTOCOMPLETE.country}\n >\n <Field.Root className={className} data-fs-shipping-address-field=\"country\">\n {children ?? (\n <>\n <Field.Label />\n <FieldSelect.Root />\n <Field.Error />\n </>\n )}\n </Field.Root>\n </FieldBinding>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace Export\n// ---------------------------------------------------------------------------\n\nexport const ShippingAddress = {\n Fieldset: ShippingAddressFieldset,\n FieldsetDefinition: ShippingAddressFieldsetDefinition,\n FieldsetSkeleton: ShippingAddressFieldsetSkeleton,\n RecipientNameControl: ShippingAddressRecipientNameControl,\n RecipientNameControlDefinition: ShippingAddressRecipientNameControlDefinition,\n StreetControl: ShippingAddressStreetControl,\n StreetControlDefinition: ShippingAddressStreetControlDefinition,\n NumberControl: ShippingAddressNumberControl,\n NumberControlDefinition: ShippingAddressNumberControlDefinition,\n CityControl: ShippingAddressCityControl,\n CityControlDefinition: ShippingAddressCityControlDefinition,\n StateControl: ShippingAddressStateControl,\n StateControlDefinition: ShippingAddressStateControlDefinition,\n PostalCodeControl: ShippingAddressPostalCodeControl,\n PostalCodeControlDefinition: ShippingAddressPostalCodeControlDefinition,\n ComplementControl: ShippingAddressComplementControl,\n ComplementControlDefinition: ShippingAddressComplementControlDefinition,\n NeighborhoodControl: ShippingAddressNeighborhoodControl,\n NeighborhoodControlDefinition: ShippingAddressNeighborhoodControlDefinition,\n CountryControl: ShippingAddressCountryControl,\n CountryControlDefinition: ShippingAddressCountryControlDefinition,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,mBAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EvC,MAAM,6BAA6B;AAiCnC,MAAM,iCAAiC,cAA0D,IAAI;;;;;;;;AASrG,SAAS,oCAAyE;CAChF,MAAM,MAAM,WAAW,8BAA8B;CACrD,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,iFAAiF;CAEnG,OAAO;AACT;;;;;;;;AASA,MAAM,iCAAiC;;AAGvC,MAAM,qBAAoF;CACxF,eAAe;CACf,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,QAAQ,KAAA;CACR,YAAY;CACZ,cAAc;CACd,MAAM;CACN,OAAO;AACT;;;;;;AAOA,SAAS,OAAO,OAAwB;CACtC,OAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;AAEA,SAAS,UAAU,OAAwB,iBAAyB,gBAAmC;CACrG,MAAM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