diff --git a/blocks/commerce-checkout/commerce-checkout.js b/blocks/commerce-checkout/commerce-checkout.js index 7c6405e869..2e030743e9 100644 --- a/blocks/commerce-checkout/commerce-checkout.js +++ b/blocks/commerce-checkout/commerce-checkout.js @@ -33,6 +33,8 @@ import CartSummaryList from '@dropins/storefront-cart/containers/CartSummaryList import Coupons from '@dropins/storefront-cart/containers/Coupons.js'; import EmptyCart from '@dropins/storefront-cart/containers/EmptyCart.js'; import OrderSummary from '@dropins/storefront-cart/containers/OrderSummary.js'; +import GiftCards from '@dropins/storefront-cart/containers/GiftCards.js'; +import GiftOptions from '@dropins/storefront-cart/containers/GiftOptions.js'; import { render as CartProvider } from '@dropins/storefront-cart/render.js'; // Checkout Dropin @@ -46,6 +48,7 @@ import PaymentMethods from '@dropins/storefront-checkout/containers/PaymentMetho import PlaceOrder from '@dropins/storefront-checkout/containers/PlaceOrder.js'; import ServerError from '@dropins/storefront-checkout/containers/ServerError.js'; import ShippingMethods from '@dropins/storefront-checkout/containers/ShippingMethods.js'; +import TermsAndConditions from '@dropins/storefront-checkout/containers/TermsAndConditions.js'; import { render as CheckoutProvider } from '@dropins/storefront-checkout/render.js'; @@ -69,7 +72,6 @@ import { getUserTokenCookie } from '../../scripts/initializers/index.js'; // Block-level import createModal from '../modal/modal.js'; -// Scripts import { estimateShippingCost, getCartAddress, @@ -78,7 +80,14 @@ import { scrollToElement, setAddressOnCart, } from '../../scripts/checkout.js'; -import { authPrivacyPolicyConsentSlot } from '../../scripts/constants.js'; + +import { authPrivacyPolicyConsentSlot, SUPPORT_PATH } from '../../scripts/constants.js'; +import { rootLink } from '../../scripts/scripts.js'; + +// Initializers +import '../../scripts/initializers/account.js'; +import '../../scripts/initializers/checkout.js'; +import '../../scripts/initializers/order.js'; function createMetaTag(property, content, type) { if (!property || !type) { @@ -114,10 +123,6 @@ function setMetaTags(dropin) { } export default async function decorate(block) { - // Initializers - import('../../scripts/initializers/account.js'); - import('../../scripts/initializers/checkout.js'); - setMetaTags('Checkout'); document.title = 'Checkout'; @@ -132,6 +137,7 @@ export default async function decorate(block) { const BILLING_FORM_NAME = 'selectedBillingAddress'; const SHIPPING_ADDRESS_DATA_KEY = `${SHIPPING_FORM_NAME}_addressData`; const BILLING_ADDRESS_DATA_KEY = `${BILLING_FORM_NAME}_addressData`; + const TERMS_AND_CONDITIONS_FORM_NAME = 'checkout-terms-and-conditions__form'; // Define the Layout for the Checkout const checkoutFragment = document.createRange().createContextualFragment(` @@ -150,10 +156,12 @@ export default async function decorate(block) {
+
+
@@ -193,6 +201,10 @@ export default async function decorate(block) { '.checkout__cart-summary', ); const $placeOrder = checkoutFragment.querySelector('.checkout__place-order'); + const $giftOptions = checkoutFragment.querySelector( + '.checkout__gift-options', + ); + const $termsAndConditions = checkoutFragment.querySelector('.checkout__terms-and-conditions'); block.appendChild(checkoutFragment); @@ -203,14 +215,15 @@ export default async function decorate(block) { let loader; let modal; let emptyCart; - const shippingFormRef = { current: null }; - const billingFormRef = { current: null }; - const creditCardFormRef = { current: null }; let shippingForm; let billingForm; let shippingAddresses; let billingAddresses; + const shippingFormRef = { current: null }; + const billingFormRef = { current: null }; + const creditCardFormRef = { current: null }; + // Adobe Commerce GraphQL endpoint const commerceCoreEndpoint = await getConfigValue('commerce-core-endpoint'); @@ -228,6 +241,7 @@ export default async function decorate(block) { billingFormSkeleton, _orderSummary, _cartSummary, + _termsAndConditions, placeOrder, ] = await Promise.all([ CheckoutProvider.render(MergedCartBanner)($mergedCartBanner), @@ -249,7 +263,7 @@ export default async function decorate(block) { })($serverError), CheckoutProvider.render(OutOfStock, { - routeCart: () => '/cart', + routeCart: () => rootLink('/cart'), onCartProductsUpdate: (items) => { cartApi.updateProductsFromCart(items).catch(console.error); }, @@ -360,6 +374,13 @@ export default async function decorate(block) { ctx.appendChild(coupons); }, + GiftCards: (ctx) => { + const giftCards = document.createElement('div'); + + CartProvider.render(GiftCards)(giftCards); + + ctx.appendChild(giftCards); + }, }, })($orderSummary), @@ -383,7 +404,7 @@ export default async function decorate(block) { ); const editCartLink = document.createElement('a'); editCartLink.classList.add('cart-summary-list__edit'); - editCartLink.href = '/cart'; + editCartLink.href = rootLink('/cart'); editCartLink.rel = 'noreferrer'; editCartLink.innerText = 'Edit'; @@ -398,9 +419,36 @@ export default async function decorate(block) { ); }); }, + Footer: (ctx) => { + const giftOptions = document.createElement('div'); + + CartProvider.render(GiftOptions, { + item: ctx.item, + view: 'product', + dataSource: 'cart', + isEditable: false, + handleItemsLoading: ctx.handleItemsLoading, + handleItemsError: ctx.handleItemsError, + onItemUpdate: ctx.onItemUpdate, + })(giftOptions); + + ctx.appendChild(giftOptions); + }, }, })($cartSummary), + CheckoutProvider.render(TermsAndConditions, { + slots: { + Agreements: (ctx) => { + ctx.appendAgreement(() => ({ + name: 'default', + mode: 'manual', + translationId: 'Checkout.TermsAndConditions.label', + })); + }, + }, + })($termsAndConditions), + CheckoutProvider.render(PlaceOrder, { handleValidation: () => { let success = true; @@ -435,6 +483,13 @@ export default async function decorate(block) { success = billingFormRef.current.handleValidationSubmit(false); } + const termsAndConditionsForm = forms[TERMS_AND_CONDITIONS_FORM_NAME]; + + if (success && termsAndConditionsForm) { + success = termsAndConditionsForm.checkValidity(); + if (!success) scrollToElement($termsAndConditions); + } + return success; }, handlePlaceOrder: async ({ cartId, code }) => { @@ -463,6 +518,12 @@ export default async function decorate(block) { } }, })($placeOrder), + + CartProvider.render(GiftOptions, { + view: 'order', + dataSource: 'cart', + isEditable: false, + })($giftOptions), ]); // Dynamic containers and components @@ -481,7 +542,7 @@ export default async function decorate(block) { if (emptyCart) return; emptyCart = await CartProvider.render(EmptyCart, { - routeCTA: () => '/', + routeCTA: () => rootLink('/'), })($emptyCart); $content.classList.add('checkout__content--empty'); @@ -568,8 +629,8 @@ export default async function decorate(block) { }, isOpen: true, onChange: (values) => { - const syncAddress = !isFirstRenderShipping || !hasCartShippingAddress; - if (syncAddress) setShippingAddressOnCart(values); + const canSetShippingAddressOnCart = !isFirstRenderShipping || !hasCartShippingAddress; + if (canSetShippingAddressOnCart) setShippingAddressOnCart(values); if (!hasCartShippingAddress) estimateShippingCostOnCart(values); if (isFirstRenderShipping) isFirstRenderShipping = false; }, @@ -665,6 +726,11 @@ export default async function decorate(block) { placeOrderBtn: placeOrder, }); + const estimateShippingCostOnCart = estimateShippingCost({ + api: checkoutApi.estimateShippingMethods, + debounceMs: DEBOUNCE_TIME, + }); + shippingAddresses = await AccountProvider.render(Addresses, { addressFormTitle: 'Deliver to new address', defaultSelectAddressId: shippingAddressId, @@ -675,6 +741,7 @@ export default async function decorate(block) { onAddressData: (values) => { const canSetShippingAddressOnCart = !isFirstRenderShipping || !hasCartShippingAddress; if (canSetShippingAddressOnCart) setShippingAddressOnCart(values); + if (!hasCartShippingAddress) estimateShippingCostOnCart(values); if (isFirstRenderShipping) isFirstRenderShipping = false; }, selectable: true, @@ -759,6 +826,7 @@ export default async function decorate(block) {
+
@@ -781,6 +849,9 @@ export default async function decorate(block) { const $orderCostSummary = orderConfirmationFragment.querySelector( '.order-confirmation__order-cost-summary', ); + const $orderGiftOptions = orderConfirmationFragment.querySelector( + '.order-confirmation__gift-options', + ); const $orderProductList = orderConfirmationFragment.querySelector( '.order-confirmation__order-product-list', ); @@ -798,8 +869,8 @@ export default async function decorate(block) { }) => { const signUpForm = document.createElement('div'); AuthProvider.render(SignUp, { - routeSignIn: () => '/customer/login', - routeRedirectOnEmailConfirmationClose: () => '/customer/account', + routeSignIn: () => rootLink('/customer/login'), + routeRedirectOnEmailConfirmationClose: () => rootLink('/customer/account'), inputsDefaultValueSet, addressesData, slots: { @@ -822,7 +893,28 @@ export default async function decorate(block) { OrderProvider.render(ShippingStatus)($shippingStatus); OrderProvider.render(CustomerDetails)($customerDetails); OrderProvider.render(OrderCostSummary)($orderCostSummary); - OrderProvider.render(OrderProductList)($orderProductList); + CartProvider.render(GiftOptions, { + view: 'order', + dataSource: 'order', + isEditable: false, + readOnlyFormOrderView: 'secondary', + })($orderGiftOptions); + OrderProvider.render(OrderProductList, { + slots: { + Footer: (ctx) => { + const giftOptions = document.createElement('div'); + + CartProvider.render(GiftOptions, { + item: ctx.item, + view: 'product', + dataSource: 'order', + isEditable: false, + })(giftOptions); + + ctx.appendChild(giftOptions); + }, + }, + })($orderProductList); $orderConfirmationFooter.innerHTML = ` @@ -830,7 +922,7 @@ export default async function decorate(block) {

Need help? {let r=!1;const n=o.cartId||await R().then(s=>(r=!0,s));return d(S,{variables:{cartId:n,cartItems:a.map(({sku:s,parentSku:e,quantity:i,optionsUIDs:t,enteredOptions:c})=>({sku:s,parent_sku:e,quantity:i,selected_options:t,entered_options:c}))}}).then(({errors:s,data:e})=>{var c;const i=[...((c=e==null?void 0:e.addProductsToCart)==null?void 0:c.user_errors)??[],...s??[]];if(i.length>0)return l(i);const t=g(e.addProductsToCart.cart);if(C.emit("cart/updated",t),C.emit("cart/data",t),t){const p=t.items.filter(m=>a.some(({sku:u})=>u===m.topLevelSku));r?A(t,p,o.locale??"en-US"):I(t,p,o.locale??"en-US")}return t})},G=` +`,y=async a=>{let r=!1;const i=o.cartId||await R().then(s=>(r=!0,s));return m(G,{variables:{cartId:i,cartItems:a.map(({sku:s,parentSku:e,quantity:n,optionsUIDs:t,enteredOptions:c})=>({sku:s,parent_sku:e,quantity:n,selected_options:t,entered_options:c}))}}).then(({errors:s,data:e})=>{var c;const n=[...((c=e==null?void 0:e.addProductsToCart)==null?void 0:c.user_errors)??[],...s??[]];if(n.length>0)return l(n);const t=f(e.addProductsToCart.cart);if(C.emit("cart/updated",t),C.emit("cart/data",t),t){const p=t.items.filter(d=>a.some(({sku:u})=>u===d.topLevelSku));r?A(t,p,o.locale??"en-US"):I(t,p,o.locale??"en-US")}return t})},S=` mutation CREATE_GUEST_CART_MUTATION { createGuestCart { cart { @@ -29,4 +29,4 @@ import{s as o,f as d,h as l}from"./chunks/resetCart.js";import{g as $,r as Q,d a } } } -`,R=async()=>{const{disableGuestCart:a}=f.getConfig();if(a)throw new Error("Guest cart is disabled");return await d(G).then(({data:r})=>{const n=r.createGuestCart.cart.id;return o.cartId=n,n})},M=()=>{const a=o.locale??"en-US",r=E();r&&_(r,a)};export{it as ApplyCouponsStrategy,F as addProductsToCart,ct as applyCouponsToCart,f as config,R as createGuestCart,d as fetchGraphQl,j as getCartData,E as getCartDataFromCache,$ as getConfig,rt as getCountries,q as getCustomerCartPayload,at as getEstimateShipping,ot as getEstimatedTotals,B as getGuestCartPayload,et as getRegions,J as getStoreConfig,K as initialize,W as initializeCart,M as publishShoppingCartViewEvent,X as refreshCart,Q as removeFetchGraphQlHeader,H as resetCart,k as setEndpoint,z as setFetchGraphQlHeader,V as setFetchGraphQlHeaders,Z as updateProductsFromCart}; +`,R=async()=>{const{disableGuestCart:a}=g.getConfig();if(a)throw new Error("Guest cart is disabled");return await m(S).then(({data:r})=>{const i=r.createGuestCart.cart.id;return o.cartId=i,i})},F=()=>{const a=o.locale??"en-US",r=E();r&&_(r,a)};export{nt as ApplyCouponsStrategy,y as addProductsToCart,ct as applyCouponsToCart,Ct as applyGiftCardToCart,g as config,R as createGuestCart,m as fetchGraphQl,j as getCartData,E as getCartDataFromCache,$ as getConfig,rt as getCountries,q as getCustomerCartPayload,at as getEstimateShipping,ot as getEstimatedTotals,B as getGuestCartPayload,et as getRegions,J as getStoreConfig,K as initialize,W as initializeCart,F as publishShoppingCartViewEvent,X as refreshCart,Q as removeFetchGraphQlHeader,mt as removeGiftCardFromCart,H as resetCart,k as setEndpoint,z as setFetchGraphQlHeader,V as setFetchGraphQlHeaders,ut as setGiftOptionsOnCart,Z as updateProductsFromCart}; diff --git a/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/applyGiftCardToCart.d.ts b/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/applyGiftCardToCart.d.ts new file mode 100644 index 0000000000..d5da33e224 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/applyGiftCardToCart.d.ts @@ -0,0 +1,4 @@ +import { CartModel } from '../../data/models'; + +export declare const applyGiftCardToCart: (giftCardCode: string) => Promise; +//# sourceMappingURL=applyGiftCardToCart.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/graphql/ApplyGiftCardToCartMutation.d.ts b/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/graphql/ApplyGiftCardToCartMutation.d.ts new file mode 100644 index 0000000000..195ec00121 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/graphql/ApplyGiftCardToCartMutation.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export declare const APPLY_GIFT_CARD_ON_CART_MUTATION: string; +//# sourceMappingURL=ApplyGiftCardToCartMutation.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/index.d.ts b/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/index.d.ts new file mode 100644 index 0000000000..a86465bac8 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/applyGiftCardToCart/index.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './applyGiftCardToCart'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/fragments.d.ts b/scripts/__dropins__/storefront-cart/api/fragments.d.ts index bbff276c6a..d6e059942b 100644 --- a/scripts/__dropins__/storefront-cart/api/fragments.d.ts +++ b/scripts/__dropins__/storefront-cart/api/fragments.d.ts @@ -1,4 +1,5 @@ export { CART_FRAGMENT } from './graphql/CartFragment'; export { CART_ITEM_FRAGMENT } from './graphql/CartItemFragment'; export { DOWNLOADABLE_CART_ITEMS_FRAGMENT } from './graphql/DownloadableCartItemsFragment'; +export { GIFT_MESSAGE_FRAGMENT, GIFT_WRAPPING_FRAGMENT, AVAILABLE_GIFT_WRAPPING_FRAGMENT, APPLIED_GIFT_CARDS_FRAGMENT } from './graphql/GiftFragment'; //# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/getStoreConfig/graphql/StoreConfigQuery.d.ts b/scripts/__dropins__/storefront-cart/api/getStoreConfig/graphql/StoreConfigQuery.d.ts index 18528bdca2..ceeacb9907 100644 --- a/scripts/__dropins__/storefront-cart/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +++ b/scripts/__dropins__/storefront-cart/api/getStoreConfig/graphql/StoreConfigQuery.d.ts @@ -14,5 +14,5 @@ * is strictly forbidden unless prior written permission is obtained * from Adobe. *******************************************************************/ -export declare const STORE_CONFIG_QUERY = "\nquery STORE_CONFIG_QUERY {\n storeConfig {\n minicart_display \n minicart_max_items\n cart_expires_in_days \n cart_summary_display_quantity\n max_items_in_order_summary\n default_country\n category_fixed_product_tax_display_setting\n product_fixed_product_tax_display_setting\n sales_fixed_product_tax_display_setting\n shopping_cart_display_full_summary\n shopping_cart_display_grand_total\n shopping_cart_display_price\n shopping_cart_display_shipping\n shopping_cart_display_subtotal\n shopping_cart_display_tax_gift_wrapping\n shopping_cart_display_zero_tax\n configurable_thumbnail_source\n }\n}\n"; +export declare const STORE_CONFIG_QUERY = "\nquery STORE_CONFIG_QUERY {\n storeConfig {\n minicart_display\n minicart_max_items\n cart_expires_in_days\n cart_summary_display_quantity\n max_items_in_order_summary\n default_country\n category_fixed_product_tax_display_setting\n product_fixed_product_tax_display_setting\n sales_fixed_product_tax_display_setting\n shopping_cart_display_full_summary\n shopping_cart_display_grand_total\n shopping_cart_display_price\n shopping_cart_display_shipping\n shopping_cart_display_subtotal\n shopping_cart_display_tax_gift_wrapping\n shopping_cart_display_zero_tax\n configurable_thumbnail_source\n allow_gift_wrapping_on_order\n allow_gift_wrapping_on_order_items\n allow_order\n allow_items\n allow_gift_receipt\n allow_printed_card\n printed_card_priceV2 {\n currency\n value\n }\n cart_gift_wrapping\n cart_printed_card\n }\n}\n"; //# sourceMappingURL=StoreConfigQuery.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/graphql/GiftFragment.d.ts b/scripts/__dropins__/storefront-cart/api/graphql/GiftFragment.d.ts new file mode 100644 index 0000000000..971a956fe5 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/graphql/GiftFragment.d.ts @@ -0,0 +1,5 @@ +export declare const APPLIED_GIFT_CARDS_FRAGMENT = "\n fragment APPLIED_GIFT_CARDS_FRAGMENT on AppliedGiftCard {\n __typename\n code\n applied_balance {\n value\n currency\n }\n current_balance {\n value\n currency\n }\n expiration_date\n }\n"; +export declare const GIFT_MESSAGE_FRAGMENT = "\n fragment GIFT_MESSAGE_FRAGMENT on GiftMessage {\n __typename\n from\n to\n message\n }\n"; +export declare const GIFT_WRAPPING_FRAGMENT = "\n fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping {\n __typename\n uid\n design\n image {\n url\n }\n price {\n value\n currency\n }\n }\n"; +export declare const AVAILABLE_GIFT_WRAPPING_FRAGMENT = "\n fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping {\n __typename\n uid\n design\n image {\n url\n label\n }\n price {\n currency\n value\n }\n }\n"; +//# sourceMappingURL=GiftFragment.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/index.d.ts b/scripts/__dropins__/storefront-cart/api/index.d.ts index e325a87351..01e0fd2b2c 100644 --- a/scripts/__dropins__/storefront-cart/api/index.d.ts +++ b/scripts/__dropins__/storefront-cart/api/index.d.ts @@ -29,4 +29,7 @@ export * from './refreshCart'; export { getPersistedCartData as getCartDataFromCache } from '../lib/persisted-data'; export * from './applyCouponsToCart'; export * from './publishShoppingCartViewEvent'; +export * from './applyGiftCardToCart'; +export * from './removeGiftCardFromCart'; +export * from './setGiftOptionsOnCart'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/graphql/RemoveGiftCardFromCartMutation.d.ts b/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/graphql/RemoveGiftCardFromCartMutation.d.ts new file mode 100644 index 0000000000..2a1917d24f --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/graphql/RemoveGiftCardFromCartMutation.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export declare const REMOVE_GIFT_CARD_ON_CART_MUTATION: string; +//# sourceMappingURL=RemoveGiftCardFromCartMutation.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/index.d.ts b/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/index.d.ts new file mode 100644 index 0000000000..22b30b2f26 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/index.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './removeGiftCardFromCart'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/removeGiftCardFromCart.d.ts b/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/removeGiftCardFromCart.d.ts new file mode 100644 index 0000000000..1d15346669 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/removeGiftCardFromCart/removeGiftCardFromCart.d.ts @@ -0,0 +1,4 @@ +import { CartModel } from '../../data/models'; + +export declare const removeGiftCardFromCart: (giftCardCode: string) => Promise; +//# sourceMappingURL=removeGiftCardFromCart.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/graphql/UpdateGiftOptionsMutation.d.ts b/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/graphql/UpdateGiftOptionsMutation.d.ts new file mode 100644 index 0000000000..650ea24d45 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/graphql/UpdateGiftOptionsMutation.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export declare const SET_GIFT_OPTIONS_ON_CART_MUTATION: string; +//# sourceMappingURL=UpdateGiftOptionsMutation.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/index.d.ts b/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/index.d.ts new file mode 100644 index 0000000000..5f1513644f --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/index.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './setGiftOptionsOnCart'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/setGiftOptionsOnCart.d.ts b/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/setGiftOptionsOnCart.d.ts new file mode 100644 index 0000000000..7a9ae78e85 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/api/setGiftOptionsOnCart/setGiftOptionsOnCart.d.ts @@ -0,0 +1,5 @@ +import { CartModel } from '../../data/models'; +import { GiftFormDataType } from '../../types'; + +export declare const setGiftOptionsOnCart: (giftForm: GiftFormDataType) => Promise; +//# sourceMappingURL=setGiftOptionsOnCart.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/api/updateProductsFromCart/updateProductsFromCart.d.ts b/scripts/__dropins__/storefront-cart/api/updateProductsFromCart/updateProductsFromCart.d.ts index 258de4bd4d..8db2d4affe 100644 --- a/scripts/__dropins__/storefront-cart/api/updateProductsFromCart/updateProductsFromCart.d.ts +++ b/scripts/__dropins__/storefront-cart/api/updateProductsFromCart/updateProductsFromCart.d.ts @@ -3,6 +3,14 @@ import { CartModel } from '../../data/models'; type UpdateProductsFromCart = Array<{ uid: string; quantity: number; + giftOptions?: { + gift_wrapping_id?: string | null; + gift_message: { + to: string; + from: string; + message: string; + }; + }; }>; export declare const updateProductsFromCart: (items: UpdateProductsFromCart) => Promise; export {}; diff --git a/scripts/__dropins__/storefront-cart/chunks/CartSummaryGrid.js b/scripts/__dropins__/storefront-cart/chunks/CartSummaryGrid.js index 3b578a8696..1547a631d9 100644 --- a/scripts/__dropins__/storefront-cart/chunks/CartSummaryGrid.js +++ b/scripts/__dropins__/storefront-cart/chunks/CartSummaryGrid.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as a,Fragment as l}from"@dropins/tools/preact-jsx-runtime.js";import{useState as y,useEffect as h}from"@dropins/tools/preact-compat.js";import{E as _}from"./EmptyCart.js";import{classes as d,VComponent as C}from"@dropins/tools/lib.js";/* empty css */import{Image as v}from"@dropins/tools/components.js";import{events as N}from"@dropins/tools/event-bus.js";import{g as b}from"./persisted-data.js";const j=({className:m,children:i,emptyCart:n,products:e,...c})=>a("div",{...c,className:d(["cart-cart-summary-grid",m]),children:a(l,{children:a("div",{className:d(["cart-cart-summary-grid__content",["cart-cart-summary-grid__content--empty",!e]]),children:e||a(C,{node:n,className:"cart-cart-summary-grid__empty-cart"})})})}),D=({children:m,initialData:i=null,routeProduct:n,routeEmptyCartCTA:e,...c})=>{const[s,g]=y(i);h(()=>{const r=N.on("cart/data",t=>{g(t)},{eager:!0});return()=>{r==null||r.off()}},[]);const p=(r,t)=>{const f=r.selectedOptions?`${r.name}: ${Object.entries(r.selectedOptions).join("; ")}`:r.name,o=a(v,{"data-testid":"cart-grid-item-image",loading:t<4?"eager":"lazy",src:r.image.src,alt:r.image.alt,"aria-label":f,width:"100%"});return n?a("div",{className:"cart-cart-summary-grid__item-container",children:a("a",{href:n(r),children:o})},t):o},u=s&&a(l,{children:s.items.map((r,t)=>p(r,t))});return a(j,{...c,emptyCart:a(_,{ctaLinkURL:e?e():void 0}),products:u})};D.getInitialData=async function(){return b()};export{D as C}; +import{jsx as t,Fragment as l}from"@dropins/tools/preact-jsx-runtime.js";import{useState as y,useEffect as h}from"@dropins/tools/preact-compat.js";import{E as _}from"./EmptyCart.js";import{classes as d,VComponent as C}from"@dropins/tools/lib.js";/* empty css */import{Image as v}from"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import{events as N}from"@dropins/tools/event-bus.js";import{g as b}from"./persisted-data.js";const j=({className:c,children:i,emptyCart:n,products:e,...m})=>t("div",{...m,className:d(["cart-cart-summary-grid",c]),children:t(l,{children:t("div",{className:d(["cart-cart-summary-grid__content",["cart-cart-summary-grid__content--empty",!e]]),children:e||t(C,{node:n,className:"cart-cart-summary-grid__empty-cart"})})})}),D=({children:c,initialData:i=null,routeProduct:n,routeEmptyCartCTA:e,...m})=>{const[s,g]=y(i);h(()=>{const r=N.on("cart/data",a=>{g(a)},{eager:!0});return()=>{r==null||r.off()}},[]);const p=(r,a)=>{const f=r.selectedOptions?`${r.name}: ${Object.entries(r.selectedOptions).join("; ")}`:r.name,o=t(v,{"data-testid":"cart-grid-item-image",loading:a<4?"eager":"lazy",src:r.image.src,alt:r.image.alt,"aria-label":f,width:"100%"});return n?t("div",{className:"cart-cart-summary-grid__item-container",children:t("a",{href:n(r),children:o})},a):o},u=s&&t(l,{children:s.items.map((r,a)=>p(r,a))});return t(j,{...m,emptyCart:t(_,{ctaLinkURL:e?e():void 0}),products:u})};D.getInitialData=async function(){return b()};export{D as C}; diff --git a/scripts/__dropins__/storefront-cart/chunks/CartSummaryList.js b/scripts/__dropins__/storefront-cart/chunks/CartSummaryList.js index 564ec966c4..4fe8b4f4e9 100644 --- a/scripts/__dropins__/storefront-cart/chunks/CartSummaryList.js +++ b/scripts/__dropins__/storefront-cart/chunks/CartSummaryList.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as n,jsxs as h,Fragment as X}from"@dropins/tools/preact-jsx-runtime.js";import*as o from"@dropins/tools/preact-compat.js";import{useState as N,useCallback as Ft,useEffect as ot}from"@dropins/tools/preact-compat.js";import{classes as L,VComponent as b,Slot as w}from"@dropins/tools/lib.js";import{E as Mt}from"./EmptyCart.js";/* empty css */import{Divider as st,Skeleton as zt,SkeletonRow as Ut,InLineAlert as qt,Icon as z,CartList as lt,Button as U,Accordion as Tt,AccordionSection as Wt,CartItem as Jt,Price as O,Image as Kt}from"@dropins/tools/components.js";import{g as Rt}from"./persisted-data.js";import{events as Yt}from"@dropins/tools/event-bus.js";import{s as Ht}from"./resetCart.js";import{u as ut}from"./updateProductsFromCart.js";import{S as Dt}from"./ChevronDown.js";import{useText as te}from"@dropins/tools/i18n.js";const ee=d=>o.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...d},o.createElement("g",{id:"Large"},o.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),o.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},o.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),dt=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("g",{clipPath:"url(#clip0_4797_15331)"},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.25 20.91L1.5 17.55V6.51996L10.25 9.92996V20.91Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.24023 4.64001L14.9902 8.06001V11.42",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19 13.31L15.5 19.37H22.5L19 13.31Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19.0202 17.11H18.9802L18.9502 15.56H19.0502L19.0202 17.11ZM18.9602 18.29V18.06H19.0502V18.29H18.9602Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19 12.16V6.51996L10.25 9.92996V20.91L14.27 19.37L14.4 19.32",stroke:"currentColor",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.51999L10.25 3.04999L19 6.51999L10.25 9.92999L1.5 6.51999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_4797_15331"},o.createElement("rect",{width:22,height:18.86,fill:"white",transform:"translate(1 2.54999)"})))),ne=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),gt=({className:d,children:q,heading:k,footer:y,emptyCart:_,products:u,outOfStockMessage:v,variant:S="primary",loading:m=!0,...c})=>n("div",{...c,className:L(["cart-cart-summary-list",d,`cart-cart-summary-list__background--${S}`]),children:m?n(re,{}):h(X,{children:[(k||v)&&h("div",{"data-testid":"cart-summary-list-heading-wrapper",className:L(["cart-cart-summary-list__heading",["cart-cart-summary-list__heading--full-width",!u]]),children:[k&&h(X,{children:[n(b,{node:k,className:"cart-cart-summary-list__heading-text"}),n(st,{variant:"primary",className:L(["cart-cart-summary-list__heading-divider"])})]}),v&&n(b,{node:v,className:"cart-cart-summary-list__out-of-stock-message"})]}),n("div",{className:L(["cart-cart-summary-list__content",["cart-cart-summary-list__content--empty",!u]]),children:u||n(b,{node:_,className:"cart-cart-summary-list__empty-cart"})}),y&&h(X,{children:[n(st,{variant:"primary",className:L(["cart-cart-summary-list__footer-divider"])}),n(b,{node:y,className:"cart-cart-summary-list__footer-text"})]})]})}),re=()=>n(zt,{"data-testid":"cart-summary-list-skeleton",className:"cart-cart-summary-list__skeleton",rowGap:"medium",children:n(Ut,{variant:"row",size:"xlarge",fullWidth:!0,lines:3,multilineGap:"small"})}),ae=({initialData:d=null,hideHeading:q,hideFooter:k,routeProduct:y,routeEmptyCartCTA:_,routeCart:u,onItemUpdate:v,onItemRemove:S,maxItems:m,slots:c,attributesToHide:l=[],enableRemoveItem:j,enableUpdateItemQuantity:T,onItemsErrorsChange:$,accordion:ft=!1,variant:Z="primary",isLoading:mt,showMaxItems:W,showDiscount:ht,showSavings:yt,quantityType:vt,dropdownOptions:pt,...J})=>{var rt;const[B,kt]=N(!d),[a,Ct]=N(d),[E,wt]=N(new Set),[A,Lt]=N(new Map),s=(rt=Ht.config)==null?void 0:rt.shoppingCartDisplaySetting,[Q,_t]=N(W?!0:!m&&!W),i=te({file:"Cart.CartItem.file",files:"Cart.CartItem.files",heading:"Cart.Cart.heading",message:"Cart.CartItem.message",recipient:"Cart.CartItem.recipient",regularPrice:"Cart.CartItem.regularPrice",discountedPrice:"Cart.CartItem.discountedPrice",sender:"Cart.CartItem.sender",lowInventory:"Cart.CartItem.lowInventory",insufficientQuantity:"Cart.CartItem.insufficientQuantity",insufficientQuantityGeneral:"Cart.CartItem.insufficientQuantityGeneral",outOfStockHeading:"Cart.OutOfStockMessage.heading",outOfStockDescription:"Cart.OutOfStockMessage.message",outOfStockAlert:"Cart.OutOfStockMessage.alert",removeAction:"Cart.OutOfStockMessage.action",notAvailableMessage:"Cart.CartItem.notAvailableMessage",viewMore:"Cart.Cart.viewMore",viewAll:"Cart.Cart.viewAll",discountPercent:"Cart.CartItem.discountPercentage",savingsAmount:"Cart.CartItem.savingsAmount"}),F=(t,e)=>{wt(r=>(e?r.add(t):r.delete(t),new Set(r)))},K=(t,e)=>{Lt(r=>(e?r.set(t,e):r.delete(t),new Map(r)))},M=(t,e)=>{F(t.uid,!0),K(t.uid),j&&e===0?ut([{uid:t.uid,quantity:e}]).then(()=>{S==null||S({item:t})}).finally(()=>{F(t.uid,!1)}).catch(r=>{console.warn(r)}):T&&ut([{uid:t.uid,quantity:e}]).then(()=>{v==null||v({item:t})}).finally(()=>{F(t.uid,!1)}).catch(r=>{console.warn(r),K(t.uid,r.message)})},St=Ft(()=>{_t(t=>!t)},[]);ot(()=>{const t=Yt.on("cart/data",e=>{Ct(e),kt(!!mt)},{eager:!0});return()=>{t==null||t.off()}},[]),ot(()=>{$&&$(A)},[A,$]);const Et=(t,e)=>{if(l.includes("image"))return;const r=n(Kt,{"data-testid":"cart-list-item-image",loading:e<4?"eager":"lazy",src:t.image.src,alt:t.image.alt,width:"300",height:"300",params:{width:300}});return n(w,{name:"Thumbnail",slot:c==null?void 0:c.Thumbnail,context:{item:t},children:y?n("a",{href:y(t),children:r}):r})},It=t=>{if(!l.includes("name"))return n("span",{"data-testid":"cart-list-item-title",children:y?n("a",{href:y(t),children:t.name}):t.name})},xt=t=>{if(l.includes("configurations"))return;const e={...t.bundleOptions,...t.selectedOptions,...t.customizableOptions,...t.recipient?{[i.recipient]:t.recipient}:null,...t.recipientEmail&&t.recipient?{[i.recipient]:`${t.recipient} (${t.recipientEmail})`}:null,...t.sender?{[i.sender]:t.sender}:null,...t.senderEmail&&t.sender?{[i.sender]:`${t.sender} (${t.senderEmail})`}:{},...t.message?{[i.message]:t.message}:null,...t.links&&t.links.count?t.links.count>1?{[i.files.replace("{count}",t.links.count.toString())]:t.links.result}:{[i.file.replace("{count}",t.links.count.toString())]:t.links.result}:null};if(Object.keys(e).length!==0)return e},Pt=t=>{var e,r,f,g;return(s==null?void 0:s.price)==="INCLUDING_TAX"?t.discounted?{amount:t.regularPrice.value,currency:t.regularPrice.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:(e=t.taxedPrice)==null?void 0:e.value,currency:(r=t.taxedPrice)==null?void 0:r.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:(f=t.regularPrice)==null?void 0:f.value,currency:(g=t.regularPrice)==null?void 0:g.currency,style:{font:"inherit"},"data-testid":"regular-item-price"}},Nt=t=>{var e,r;return{amount:(e=t.savingsAmount)==null?void 0:e.value,currency:(r=t.savingsAmount)==null?void 0:r.currency,style:{font:"inherit"},"data-testid":"item-savings-amount"}},Ot=t=>(s==null?void 0:s.price)==="INCLUDING_EXCLUDING_TAX"?n(O,{amount:t.rowTotal.value,currency:t.rowTotal.currency,"data-testid":"excluding-tax-total","aria-label":i.regularPrice}):void 0,At=t=>{var f,g,p,C,I,x,P,at,it,ct;const e={"aria-label":i.regularPrice},r=t.discounted?{}:null;return["INCLUDING_TAX","INCLUDING_EXCLUDING_TAX"].includes(s==null?void 0:s.price)?(e.amount=(f=t.rowTotalIncludingTax)==null?void 0:f.value,e.currency=(g=t.rowTotalIncludingTax)==null?void 0:g.currency,e.variant=t.discounted?"strikethrough":"default",e["data-testid"]="including-tax-item-total",r&&(e.amount=(p=t.total)==null?void 0:p.value,e.currency=(C=t.total)==null?void 0:C.currency,r.amount=(I=t.rowTotalIncludingTax)==null?void 0:I.value,r.currency=(x=t.rowTotalIncludingTax)==null?void 0:x.currency,r.sale=!0,r["aria-label"]=i.discountedPrice,r["data-testid"]="discount-total")):(e.amount=(P=t.total)==null?void 0:P.value,e.currency=(at=t.total)==null?void 0:at.currency,e.variant=t.discounted?"strikethrough":"default",e["data-testid"]="regular-item-total",r&&(r.amount=(it=t.discountedTotal)==null?void 0:it.value,r.currency=(ct=t.discountedTotal)==null?void 0:ct.currency,r.sale=!0,r["aria-label"]=i.regularPrice,r["data-testid"]="discount-total")),{totalProps:e,discountProps:r}},Qt=t=>{var I,x,P;if(l.includes("warning"))return;const e=A.get(t.uid),r=(I=A.get(t.uid))==null?void 0:I.includes("The requested qty is not available"),f=E.has(t.uid),g=t.insufficientQuantity&&t.stockLevel?t.stockLevel==="noNumber"?i.insufficientQuantityGeneral:i.insufficientQuantity.replace("{inventory}",(x=t.stockLevel)==null?void 0:x.toString()).replace("{count}",t.quantity.toString()):"",p=t.lowInventory&&t.onlyXLeftInStock&&i.lowInventory.replace("{count}",(P=t.onlyXLeftInStock)==null?void 0:P.toString()),C=!t.outOfStock&&e&&r?i.notAvailableMessage:e;return!f&&(e||t.insufficientQuantity||t.lowInventory)?h("span",{"data-testid":"item-warning",children:[n(z,{source:ne,size:"16"}),C||g||p]}):void 0},Gt=t=>l!=null&&l.includes("alert")?void 0:!E.has(t.uid)&&t.outOfStock?h("span",{"data-testid":"item-alert",children:[n(z,{source:dt,size:"16"}),i.outOfStockAlert]}):void 0,Vt=t=>n(w,{name:"ProductAttributes",slot:c==null?void 0:c.ProductAttributes,context:{item:t}}),bt=t=>{if(!l.includes("sku"))return n("span",{"data-testid":"cart-list-item-sku",children:t.sku})},Xt=t=>n(w,{name:"Footer",slot:c==null?void 0:c.Footer,context:{item:t}}),R=t=>a!=null&&a.totalQuantity?a.items.filter(t).map((e,r)=>{var p;const{totalProps:f,discountProps:g}=At(e);return n(Jt,{updating:E==null?void 0:E.has(e.uid),loading:B,"data-testid":`cart-list-item-entry-${e.uid}`,image:Et(e,r),title:It(e),sku:bt(e),price:l.includes("price")?void 0:n(O,{...Pt(e)}),quantity:l.includes("quantity")?void 0:e.quantity,total:h(X,{children:[l.includes("total")?void 0:n(O,{...f}),l.includes("totalDiscount")?void 0:g&&n(O,{...g})]}),attributes:Vt(e),configurations:xt(e),totalExcludingTax:l.includes("totalExcludingTax")?void 0:Ot(e),taxIncluded:(s==null?void 0:s.price)==="INCLUDING_TAX",taxExcluded:!l.includes("totalExcludingTax")&&(s==null?void 0:s.price)==="INCLUDING_EXCLUDING_TAX",warning:Qt(e),alert:Gt(e),quantityType:vt,dropdownOptions:pt,onQuantity:T?C=>{M(e,C)}:void 0,onRemove:j?()=>M(e,0):void 0,discount:ht&&e.discounted&&e.discountPercentage?n("div",{"data-testid":"item-discount-percent",children:i.discountPercent.replace("{discount}",((p=e.discountPercentage)==null?void 0:p.toString())??"")}):void 0,savings:yt&&e.discounted&&e.savingsAmount?h("div",{children:[n("span",{children:n(O,{...Nt(e)})})," ",i.savingsAmount]}):void 0,footer:Xt(e)},e.uid)}):null,Y=n(w,{name:"EmptyCart",slot:c==null?void 0:c.EmptyCart,context:{},children:n(Mt,{"data-testid":"empty-cart",ctaLinkURL:_==null?void 0:_()})}),H=n(w,{name:"Heading",slot:c==null?void 0:c.Heading,context:{count:a==null?void 0:a.totalQuantity},children:n("div",{"data-testid":"default-cart-heading",children:i.heading.replace("({count})",a!=null&&a.totalQuantity?`(${a==null?void 0:a.totalQuantity.toString()})`:"")})}),jt=H.props.children.props.children,$t=()=>{const t=a==null?void 0:a.items.filter(e=>e.outOfStock);t==null||t.forEach(e=>{M(e,0)})},Zt=R(t=>t.outOfStock||t.insufficientQuantity||!1),D=a!=null&&a.hasOutOfStockItems?n(qt,{"data-testid":"cart-out-of-stock-message",icon:n(z,{source:dt,size:"16"}),itemList:n(lt,{"data-testid":"out-of-stock-cart-items",children:Zt}),type:"warning",heading:i.outOfStockHeading,description:i.outOfStockDescription,variant:"primary",actionButtonPosition:"bottom",additionalActions:a!=null&&a.hasFullyOutOfStockItems&&j?[{label:i.removeAction,onClick:$t}]:void 0}):void 0,G=R(t=>!t.outOfStock&&!t.insufficientQuantity),tt=Q?Math.max(m||5,5):Math.min((a==null?void 0:a.totalQuantity)||5,5),et=(a==null?void 0:a.totalQuantity)>tt,Bt=et&&!Q&&tt!=m,V=a!=null&&a.totalQuantity&&G?n(w,{name:"Footer",slot:c==null?void 0:c.CartSummaryFooter,context:{displayMaxItems:Q,routeCart:u},"data-testid":"cart-cart-summary-footer-slot",children:n("div",{"data-testid":"cart-cart-summary-footer",children:et?Bt?n(U,{className:"cart-cart-summary-list-footer__action",onClick:St,"data-testid":"view-more-items-button",variant:"tertiary",children:i.viewMore}):u&&n(U,{className:"cart-cart-summary-list-footer__action",href:u(),variant:"tertiary","data-testid":"view-cart-or-less-items-button",children:i.viewAll}):u&&n(U,{className:"cart-cart-summary-list-footer__action",href:u(),variant:"tertiary","data-testid":"view-cart-button",children:i.viewAll})})}):null,nt=a!=null&&a.totalQuantity?n(lt,{"data-testid":"cart-list",children:G==null?void 0:G.slice(0,Q?Math.max(m||(a==null?void 0:a.totalQuantity),5):Math.min(m??5,5))}):null;return ft?n(Tt,{"data-testid":"cart-summary-list-accordion",className:L(["cart-cart-summary-list-accordion",`cart-cart-summary-list__background--${Z}`]),iconOpen:ee,iconClose:Dt,children:n(Wt,{title:jt,"data-testid":"cart-summary-list-accordion__section",open:!0,renderContentWhenClosed:!0,children:n(gt,{...J,"aria-expanded":!0,"aria-label":"TEST",className:"cart-cart-summary-list-accordion__list",loading:B,footer:k?void 0:V||(u?V:void 0),emptyCart:Y,products:nt,outOfStockMessage:D,variant:Z})})}):n(gt,{...J,heading:q?void 0:H,footer:k?void 0:V||(u?V:void 0),loading:B,emptyCart:Y,products:nt,outOfStockMessage:D,variant:Z})};ae.getInitialData=async function(){return Rt()};export{ae as C}; +import{jsx as n,jsxs as y,Fragment as j}from"@dropins/tools/preact-jsx-runtime.js";import*as o from"@dropins/tools/preact-compat.js";import{useState as N,useCallback as Ft,useEffect as ot}from"@dropins/tools/preact-compat.js";import{classes as L,VComponent as X,Slot as w}from"@dropins/tools/lib.js";import{E as Mt}from"./EmptyCart.js";/* empty css */import{Divider as st,Skeleton as zt,SkeletonRow as qt,InLineAlert as Tt,Icon as q,CartList as lt,Button as T,Accordion as Ut,AccordionSection as Wt,CartItem as Jt,Price as O,Image as Kt}from"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import{g as Rt}from"./persisted-data.js";import{events as Yt}from"@dropins/tools/event-bus.js";import{s as Ht}from"./resetCart.js";import{u as ut}from"./updateProductsFromCart.js";import{S as Dt}from"./ChevronDown.js";import{useText as te}from"@dropins/tools/i18n.js";const ee=d=>o.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...d},o.createElement("g",{id:"Large"},o.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),o.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},o.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),dt=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("g",{clipPath:"url(#clip0_4797_15331)"},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.25 20.91L1.5 17.55V6.51996L10.25 9.92996V20.91Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.24023 4.64001L14.9902 8.06001V11.42",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19 13.31L15.5 19.37H22.5L19 13.31Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19.0202 17.11H18.9802L18.9502 15.56H19.0502L19.0202 17.11ZM18.9602 18.29V18.06H19.0502V18.29H18.9602Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19 12.16V6.51996L10.25 9.92996V20.91L14.27 19.37L14.4 19.32",stroke:"currentColor",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.51999L10.25 3.04999L19 6.51999L10.25 9.92999L1.5 6.51999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_4797_15331"},o.createElement("rect",{width:22,height:18.86,fill:"white",transform:"translate(1 2.54999)"})))),ne=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),gt=({className:d,children:U,heading:k,footer:v,emptyCart:_,products:u,outOfStockMessage:m,variant:S="primary",loading:h=!0,...c})=>n("div",{...c,className:L(["cart-cart-summary-list",d,`cart-cart-summary-list__background--${S}`]),children:h?n(re,{}):y(j,{children:[(k||m)&&y("div",{"data-testid":"cart-summary-list-heading-wrapper",className:L(["cart-cart-summary-list__heading",["cart-cart-summary-list__heading--full-width",!u]]),children:[k&&y(j,{children:[n(X,{node:k,className:"cart-cart-summary-list__heading-text"}),n(st,{variant:"primary",className:L(["cart-cart-summary-list__heading-divider"])})]}),m&&n(X,{node:m,className:"cart-cart-summary-list__out-of-stock-message"})]}),n("div",{className:L(["cart-cart-summary-list__content",["cart-cart-summary-list__content--empty",!u]]),children:u||n(X,{node:_,className:"cart-cart-summary-list__empty-cart"})}),v&&y(j,{children:[n(st,{variant:"primary",className:L(["cart-cart-summary-list__footer-divider"])}),n(X,{node:v,className:"cart-cart-summary-list__footer-text"})]})]})}),re=()=>n(zt,{"data-testid":"cart-summary-list-skeleton",className:"cart-cart-summary-list__skeleton",rowGap:"medium",children:n(qt,{variant:"row",size:"xlarge",fullWidth:!0,lines:3,multilineGap:"small"})}),ae=({initialData:d=null,hideHeading:U,hideFooter:k,routeProduct:v,routeEmptyCartCTA:_,routeCart:u,onItemUpdate:m,onItemRemove:S,maxItems:h,slots:c,attributesToHide:l=[],enableRemoveItem:$,enableUpdateItemQuantity:W,onItemsErrorsChange:Z,accordion:ft=!1,variant:B="primary",isLoading:mt,showMaxItems:J,showDiscount:ht,showSavings:yt,quantityType:vt,dropdownOptions:pt,...K})=>{var rt;const[F,kt]=N(!d),[a,Ct]=N(d),[E,wt]=N(new Set),[A,Lt]=N(new Map),s=(rt=Ht.config)==null?void 0:rt.shoppingCartDisplaySetting,[Q,_t]=N(J?!0:!h&&!J),i=te({file:"Cart.CartItem.file",files:"Cart.CartItem.files",heading:"Cart.Cart.heading",message:"Cart.CartItem.message",recipient:"Cart.CartItem.recipient",regularPrice:"Cart.CartItem.regularPrice",discountedPrice:"Cart.CartItem.discountedPrice",sender:"Cart.CartItem.sender",lowInventory:"Cart.CartItem.lowInventory",insufficientQuantity:"Cart.CartItem.insufficientQuantity",insufficientQuantityGeneral:"Cart.CartItem.insufficientQuantityGeneral",outOfStockHeading:"Cart.OutOfStockMessage.heading",outOfStockDescription:"Cart.OutOfStockMessage.message",outOfStockAlert:"Cart.OutOfStockMessage.alert",removeAction:"Cart.OutOfStockMessage.action",notAvailableMessage:"Cart.CartItem.notAvailableMessage",viewMore:"Cart.Cart.viewMore",viewAll:"Cart.Cart.viewAll",discountPercent:"Cart.CartItem.discountPercentage",savingsAmount:"Cart.CartItem.savingsAmount"}),G=(t,e)=>{wt(r=>(e?r.add(t):r.delete(t),new Set(r)))},M=(t,e)=>{Lt(r=>(e?r.set(t,e):r.delete(t),new Map(r)))},z=(t,e)=>{G(t.uid,!0),M(t.uid),$&&e===0?ut([{uid:t.uid,quantity:e}]).then(()=>{S==null||S({item:t})}).finally(()=>{G(t.uid,!1)}).catch(r=>{console.warn(r)}):W&&ut([{uid:t.uid,quantity:e}]).then(()=>{m==null||m({item:t})}).finally(()=>{G(t.uid,!1)}).catch(r=>{console.warn(r),M(t.uid,r.message)})},St=Ft(()=>{_t(t=>!t)},[]);ot(()=>{const t=Yt.on("cart/data",e=>{Ct(e),kt(!!mt)},{eager:!0});return()=>{t==null||t.off()}},[]),ot(()=>{Z&&Z(A)},[A,Z]);const Et=(t,e)=>{if(l.includes("image"))return;const r=n(Kt,{"data-testid":"cart-list-item-image",loading:e<4?"eager":"lazy",src:t.image.src,alt:t.image.alt,width:"300",height:"300",params:{width:300}});return n(w,{name:"Thumbnail",slot:c==null?void 0:c.Thumbnail,context:{item:t},children:v?n("a",{href:v(t),children:r}):r})},It=t=>{if(!l.includes("name"))return n("span",{"data-testid":"cart-list-item-title",children:v?n("a",{href:v(t),children:t.name}):t.name})},xt=t=>{if(l.includes("configurations"))return;const e={...t.bundleOptions,...t.selectedOptions,...t.customizableOptions,...t.recipient?{[i.recipient]:t.recipient}:null,...t.recipientEmail&&t.recipient?{[i.recipient]:`${t.recipient} (${t.recipientEmail})`}:null,...t.sender?{[i.sender]:t.sender}:null,...t.senderEmail&&t.sender?{[i.sender]:`${t.sender} (${t.senderEmail})`}:{},...t.message?{[i.message]:t.message}:null,...t.links&&t.links.count?t.links.count>1?{[i.files.replace("{count}",t.links.count.toString())]:t.links.result}:{[i.file.replace("{count}",t.links.count.toString())]:t.links.result}:null};if(Object.keys(e).length!==0)return e},Pt=t=>{var e,r,f,g;return(s==null?void 0:s.price)==="INCLUDING_TAX"?t.discounted?{amount:t.regularPrice.value,currency:t.regularPrice.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:(e=t.taxedPrice)==null?void 0:e.value,currency:(r=t.taxedPrice)==null?void 0:r.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:(f=t.regularPrice)==null?void 0:f.value,currency:(g=t.regularPrice)==null?void 0:g.currency,style:{font:"inherit"},"data-testid":"regular-item-price"}},Nt=t=>{var e,r;return{amount:(e=t.savingsAmount)==null?void 0:e.value,currency:(r=t.savingsAmount)==null?void 0:r.currency,style:{font:"inherit"},"data-testid":"item-savings-amount"}},Ot=t=>(s==null?void 0:s.price)==="INCLUDING_EXCLUDING_TAX"?n(O,{amount:t.rowTotal.value,currency:t.rowTotal.currency,"data-testid":"excluding-tax-total","aria-label":i.regularPrice}):void 0,At=t=>{var f,g,p,C,I,x,P,at,it,ct;const e={"aria-label":i.regularPrice},r=t.discounted?{}:null;return["INCLUDING_TAX","INCLUDING_EXCLUDING_TAX"].includes(s==null?void 0:s.price)?(e.amount=(f=t.rowTotalIncludingTax)==null?void 0:f.value,e.currency=(g=t.rowTotalIncludingTax)==null?void 0:g.currency,e.variant=t.discounted?"strikethrough":"default",e["data-testid"]="including-tax-item-total",r&&(e.amount=(p=t.total)==null?void 0:p.value,e.currency=(C=t.total)==null?void 0:C.currency,r.amount=(I=t.rowTotalIncludingTax)==null?void 0:I.value,r.currency=(x=t.rowTotalIncludingTax)==null?void 0:x.currency,r.sale=!0,r["aria-label"]=i.discountedPrice,r["data-testid"]="discount-total")):(e.amount=(P=t.total)==null?void 0:P.value,e.currency=(at=t.total)==null?void 0:at.currency,e.variant=t.discounted?"strikethrough":"default",e["data-testid"]="regular-item-total",r&&(r.amount=(it=t.discountedTotal)==null?void 0:it.value,r.currency=(ct=t.discountedTotal)==null?void 0:ct.currency,r.sale=!0,r["aria-label"]=i.regularPrice,r["data-testid"]="discount-total")),{totalProps:e,discountProps:r}},Qt=t=>{var I,x,P;if(l.includes("warning"))return;const e=A.get(t.uid),r=(I=A.get(t.uid))==null?void 0:I.includes("The requested qty is not available"),f=E.has(t.uid),g=t.insufficientQuantity&&t.stockLevel?t.stockLevel==="noNumber"?i.insufficientQuantityGeneral:i.insufficientQuantity.replace("{inventory}",(x=t.stockLevel)==null?void 0:x.toString()).replace("{count}",t.quantity.toString()):"",p=t.lowInventory&&t.onlyXLeftInStock&&i.lowInventory.replace("{count}",(P=t.onlyXLeftInStock)==null?void 0:P.toString()),C=!t.outOfStock&&e&&r?i.notAvailableMessage:e;return!f&&(e||t.insufficientQuantity||t.lowInventory)?y("span",{"data-testid":"item-warning",children:[n(q,{source:ne,size:"16"}),C||g||p]}):void 0},Gt=t=>l!=null&&l.includes("alert")?void 0:!E.has(t.uid)&&t.outOfStock?y("span",{"data-testid":"item-alert",children:[n(q,{source:dt,size:"16"}),i.outOfStockAlert]}):void 0,Vt=t=>n(w,{name:"ProductAttributes",slot:c==null?void 0:c.ProductAttributes,context:{item:t}}),bt=t=>{if(!l.includes("sku"))return n("span",{"data-testid":"cart-list-item-sku",children:t.sku})},Xt=t=>n(w,{name:"Footer",slot:c==null?void 0:c.Footer,context:{item:t,handleItemsLoading:G,handleItemsError:M,onItemUpdate:m}}),R=t=>a!=null&&a.totalQuantity?a.items.filter(t).map((e,r)=>{var p;const{totalProps:f,discountProps:g}=At(e);return n(Jt,{updating:E==null?void 0:E.has(e.uid),loading:F,"data-testid":`cart-list-item-entry-${e.uid}`,image:Et(e,r),title:It(e),sku:bt(e),price:l.includes("price")?void 0:n(O,{...Pt(e)}),quantity:l.includes("quantity")?void 0:e.quantity,total:y(j,{children:[l.includes("total")?void 0:n(O,{...f}),l.includes("totalDiscount")?void 0:g&&n(O,{...g})]}),attributes:Vt(e),configurations:xt(e),totalExcludingTax:l.includes("totalExcludingTax")?void 0:Ot(e),taxIncluded:(s==null?void 0:s.price)==="INCLUDING_TAX",taxExcluded:!l.includes("totalExcludingTax")&&(s==null?void 0:s.price)==="INCLUDING_EXCLUDING_TAX",warning:Qt(e),alert:Gt(e),quantityType:vt,dropdownOptions:pt,onQuantity:W?C=>{z(e,C)}:void 0,onRemove:$?()=>z(e,0):void 0,discount:ht&&e.discounted&&e.discountPercentage?n("div",{"data-testid":"item-discount-percent",children:i.discountPercent.replace("{discount}",((p=e.discountPercentage)==null?void 0:p.toString())??"")}):void 0,savings:yt&&e.discounted&&e.savingsAmount?y("div",{children:[n("span",{children:n(O,{...Nt(e)})})," ",i.savingsAmount]}):void 0,footer:Xt(e)},e.uid)}):null,Y=n(w,{name:"EmptyCart",slot:c==null?void 0:c.EmptyCart,context:{},children:n(Mt,{"data-testid":"empty-cart",ctaLinkURL:_==null?void 0:_()})}),H=n(w,{name:"Heading",slot:c==null?void 0:c.Heading,context:{count:a==null?void 0:a.totalQuantity},children:n("div",{"data-testid":"default-cart-heading",children:i.heading.replace("({count})",a!=null&&a.totalQuantity?`(${a==null?void 0:a.totalQuantity.toString()})`:"")})}),jt=H.props.children.props.children,$t=()=>{const t=a==null?void 0:a.items.filter(e=>e.outOfStock);t==null||t.forEach(e=>{z(e,0)})},Zt=R(t=>t.outOfStock||t.insufficientQuantity||!1),D=a!=null&&a.hasOutOfStockItems?n(Tt,{"data-testid":"cart-out-of-stock-message",icon:n(q,{source:dt,size:"16"}),itemList:n(lt,{"data-testid":"out-of-stock-cart-items",children:Zt}),type:"warning",heading:i.outOfStockHeading,description:i.outOfStockDescription,variant:"primary",actionButtonPosition:"bottom",additionalActions:a!=null&&a.hasFullyOutOfStockItems&&$?[{label:i.removeAction,onClick:$t}]:void 0}):void 0,V=R(t=>!t.outOfStock&&!t.insufficientQuantity),tt=Q?Math.max(h||5,5):Math.min((a==null?void 0:a.totalQuantity)||5,5),et=(a==null?void 0:a.totalQuantity)>tt,Bt=et&&!Q&&tt!=h,b=a!=null&&a.totalQuantity&&V?n(w,{name:"Footer",slot:c==null?void 0:c.CartSummaryFooter,context:{displayMaxItems:Q,routeCart:u},"data-testid":"cart-cart-summary-footer-slot",children:n("div",{"data-testid":"cart-cart-summary-footer",children:et?Bt?n(T,{className:"cart-cart-summary-list-footer__action",onClick:St,"data-testid":"view-more-items-button",variant:"tertiary",children:i.viewMore}):u&&n(T,{className:"cart-cart-summary-list-footer__action",href:u(),variant:"tertiary","data-testid":"view-cart-or-less-items-button",children:i.viewAll}):u&&n(T,{className:"cart-cart-summary-list-footer__action",href:u(),variant:"tertiary","data-testid":"view-cart-button",children:i.viewAll})})}):null,nt=a!=null&&a.totalQuantity?n(lt,{"data-testid":"cart-list",children:V==null?void 0:V.slice(0,Q?Math.max(h||(a==null?void 0:a.totalQuantity),5):Math.min(h??5,5))}):null;return ft?n(Ut,{"data-testid":"cart-summary-list-accordion",className:L(["cart-cart-summary-list-accordion",`cart-cart-summary-list__background--${B}`]),iconOpen:ee,iconClose:Dt,children:n(Wt,{title:jt,"data-testid":"cart-summary-list-accordion__section",open:!0,renderContentWhenClosed:!0,children:n(gt,{...K,"aria-expanded":!0,"aria-label":"TEST",className:"cart-cart-summary-list-accordion__list",loading:F,footer:k?void 0:b||(u?b:void 0),emptyCart:Y,products:nt,outOfStockMessage:D,variant:B})})}):n(gt,{...K,heading:U?void 0:H,footer:k?void 0:b||(u?b:void 0),loading:F,emptyCart:Y,products:nt,outOfStockMessage:D,variant:B})};ae.getInitialData=async function(){return Rt()};export{ae as C}; diff --git a/scripts/__dropins__/storefront-cart/chunks/ChevronUp.js b/scripts/__dropins__/storefront-cart/chunks/ChevronUp.js new file mode 100644 index 0000000000..dcc687c50e --- /dev/null +++ b/scripts/__dropins__/storefront-cart/chunks/ChevronUp.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import*as e from"@dropins/tools/preact-compat.js";const o=t=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"}));export{o as S}; diff --git a/scripts/__dropins__/storefront-cart/chunks/Coupons.js b/scripts/__dropins__/storefront-cart/chunks/Coupons.js new file mode 100644 index 0000000000..a8648ac180 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/chunks/Coupons.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import*as e from"@dropins/tools/preact-compat.js";import{useRef as k}from"@dropins/tools/preact-compat.js";import{jsx as n,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";import{classes as t,VComponent as r,getFormValues as x}from"@dropins/tools/lib.js";import{Accordion as L,AccordionSection as S}from"@dropins/tools/components.js";/* empty css */import{S as C}from"./Coupon.js";import{useText as N}from"@dropins/tools/i18n.js";const B=o=>e.createElement("svg",{id:"Icon_Add_Base","data-name":"Icon \\u2013 Add \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...o},e.createElement("g",{id:"Large"},e.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),e.createElement("g",{id:"Add_icon","data-name":"Add icon",transform:"translate(9.734 9.737)"},e.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_579","data-name":"Line 579",y2:12.7,transform:"translate(2.216 -4.087)",fill:"none",stroke:"currentColor"}),e.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_580","data-name":"Line 580",x2:12.7,transform:"translate(-4.079 2.263)",fill:"none",stroke:"currentColor"})))),V=o=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),I=o=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},e.createElement("path",{d:"M17.3332 11.75H6.6665",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke",fill:"none",stroke:"currentColor"})),W=({accordionSectionTitle:o,accordionSectionIcon:h,className:g,children:M,couponCodeField:s,applyCouponsButton:i,appliedCoupons:l,error:d,onApplyCoupon:a,...p})=>{const c=k(null),v=N({couponTitle:"Cart.PriceSummary.coupon.title"}),w=_=>{var f;_.preventDefault();const E=x(c.current);a==null||a(E);const m=(f=c==null?void 0:c.current)==null?void 0:f.querySelector("input");m&&(m.value="")};return n("div",{...p,"data-testid":"cart-coupons",className:t(["cart-coupons",g]),children:n(L,{"data-testid":"coupon-code",className:t(["cart-coupons__accordion"]),actionIconPosition:"right",iconOpen:B,iconClose:I,children:u(S,{title:o??v.couponTitle,iconLeft:h??C,showIconLeft:!0,renderContentWhenClosed:!1,"data-testid":"coupon-code-accordion-section",className:t(["cart-coupons__accordion-section"]),children:[n("form",{"data-testid":"coupon-code-form",className:t(["coupon-code-form--edit"]),ref:c,children:u("div",{className:t(["coupon-code-form__action"]),children:[s&&n(r,{node:s,className:t(["coupon-code-form__codes"])}),i&&n(r,{node:i,className:t(["coupon-code-form--button"]),onClick:w,type:"submit"})]})}),d&&n(r,{node:d,className:t(["coupon-code-form__error"])}),l&&n(r,{node:l,className:t(["coupon-code-form__applied"])})]})})})};export{W as C,V as S}; diff --git a/scripts/__dropins__/storefront-cart/chunks/EmptyCart.js b/scripts/__dropins__/storefront-cart/chunks/EmptyCart.js index 91e924c1ea..d29b7bf219 100644 --- a/scripts/__dropins__/storefront-cart/chunks/EmptyCart.js +++ b/scripts/__dropins__/storefront-cart/chunks/EmptyCart.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{classes as o}from"@dropins/tools/lib.js";import{IllustratedMessage as i,Icon as s,Button as m}from"@dropins/tools/components.js";/* empty css */import*as t from"@dropins/tools/preact-compat.js";import{useText as l}from"@dropins/tools/i18n.js";const p=e=>t.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("g",{clipPath:"url(#clip0_102_196)"},t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z",stroke:"currentColor",strokeLinejoin:"round"}),t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.25 6.37L20.89 8.06L20.14 14.8H6.19",stroke:"currentColor",strokeLinejoin:"round"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_102_196"},t.createElement("rect",{vectorEffect:"non-scaling-stroke",width:19.29,height:19.5,fill:"white",transform:"translate(2.3501 2.25)"})))),g=({className:e,children:d,ctaLinkURL:a,...n})=>{const c=l({emptyCart:"Cart.EmptyCart.heading",cta:"Cart.EmptyCart.cta"});return r("div",{...n,className:o(["cart-empty-cart",e]),children:r(i,{className:o(["cart-empty-cart__wrapper",e]),"data-testid":"cart-empty-cart",heading:c.emptyCart,icon:r(s,{className:"cart-empty-cart__icon",source:p}),action:a?r(m,{"data-testid":"cart-empty-cart-button",size:"medium",variant:"primary",type:"submit",href:a,children:c.cta},"routeHome"):void 0})})};export{g as E}; +import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{classes as o}from"@dropins/tools/lib.js";import{IllustratedMessage as i,Icon as s,Button as m}from"@dropins/tools/components.js";/* empty css */import*as t from"@dropins/tools/preact-compat.js";import{useText as l}from"@dropins/tools/i18n.js";const p=e=>t.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("g",{clipPath:"url(#clip0_102_196)"},t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z",stroke:"currentColor",strokeLinejoin:"round"}),t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.25 6.37L20.89 8.06L20.14 14.8H6.19",stroke:"currentColor",strokeLinejoin:"round"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_102_196"},t.createElement("rect",{vectorEffect:"non-scaling-stroke",width:19.29,height:19.5,fill:"white",transform:"translate(2.3501 2.25)"})))),g=({className:e,children:d,ctaLinkURL:a,...n})=>{const c=l({emptyCart:"Cart.EmptyCart.heading",cta:"Cart.EmptyCart.cta"});return r("div",{...n,className:o(["cart-empty-cart",e]),children:r(i,{className:o(["cart-empty-cart__wrapper",e]),"data-testid":"cart-empty-cart",heading:c.emptyCart,icon:r(s,{className:"cart-empty-cart__icon",source:p}),action:a?r(m,{"data-testid":"cart-empty-cart-button",size:"medium",variant:"primary",type:"submit",href:a,children:c.cta},"routeHome"):void 0})})};export{g as E}; diff --git a/scripts/__dropins__/storefront-cart/chunks/GiftCard.js b/scripts/__dropins__/storefront-cart/chunks/GiftCard.js new file mode 100644 index 0000000000..1af193becc --- /dev/null +++ b/scripts/__dropins__/storefront-cart/chunks/GiftCard.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import*as e from"@dropins/tools/preact-compat.js";const C=t=>e.createElement("svg",{width:24,height:16,viewBox:"0 0 24 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M22.5364 9.8598V2.1658C22.5364 1.63583 22.099 1.20996 21.576 1.20996H2.42337C1.89083 1.20996 1.46289 1.64529 1.46289 2.1658V9.8598M22.5364 9.8598H1.46289M22.5364 9.8598V13.844C22.5364 14.3645 22.1085 14.7999 21.576 14.7999H2.42337C1.90034 14.7999 1.46289 14.374 1.46289 13.844V9.8598M3.9164 12.5191L7.5396 9.8598M7.5396 9.8598L11.1628 12.5191M7.5396 9.8598C7.5396 9.8598 6.96902 7.26674 6.40795 6.70838C5.84687 6.15002 4.93394 6.15002 4.37287 6.70838C3.81179 7.26674 3.81179 8.17526 4.37287 8.73362C4.93394 9.29198 7.5396 9.8598 7.5396 9.8598ZM7.5396 9.8598C7.5396 9.8598 10.1643 9.27305 10.7254 8.71469C11.2864 8.15633 11.2864 7.24782 10.7254 6.68946C10.1643 6.1311 9.25135 6.1311 8.69028 6.68946C8.12921 7.24782 7.5396 9.8598 7.5396 9.8598ZM7.5396 14.7904V1.20996",stroke:"currentColor",strokeLinecap:"round"}));export{C as S}; diff --git a/scripts/__dropins__/storefront-cart/chunks/OrderSummary.js b/scripts/__dropins__/storefront-cart/chunks/OrderSummary.js index c1eb65650e..9a503bc8d6 100644 --- a/scripts/__dropins__/storefront-cart/chunks/OrderSummary.js +++ b/scripts/__dropins__/storefront-cart/chunks/OrderSummary.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsxs as E,jsx as r,Fragment as We}from"@dropins/tools/preact-jsx-runtime.js";import*as Ie from"@dropins/tools/preact-compat.js";import{useState as M,useEffect as ae,useCallback as Fe}from"@dropins/tools/preact-compat.js";import{VComponent as B,classes as ke,Slot as we}from"@dropins/tools/lib.js";import{events as Ee}from"@dropins/tools/event-bus.js";import{g as Ge}from"./persisted-data.js";import{s as Oe}from"./resetCart.js";import{g as ze}from"./getEstimatedTotals.js";import{p as Ve}from"./acdl.js";import{Accordion as Ne,AccordionSection as Le,ProgressSpinner as Ze,Divider as je,Price as l,Icon as Ue,Button as Qe}from"@dropins/tools/components.js";/* empty css */import{O as v}from"./OrderSummaryLine.js";import{S as De}from"./ChevronDown.js";import{useText as Ae}from"@dropins/tools/i18n.js";import{S as Xe}from"./Coupon.js";const Be=O=>Ie.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...O},Ie.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),$e=({className:O,children:A,variant:P="primary",heading:s,loading:N=!0,subTotal:g,shipping:m,discounts:_,taxTotal:x,taxesApplied:e,total:p,primaryAction:L,coupons:o,totalSaved:y,updateLineItems:I=T=>T,...t})=>{const[T,D]=M(!1),i=Ae({checkout:"Cart.PriceSummary.checkout",discountedPrice:"Cart.CartItem.discountedPrice",download:"Cart.CartItem.download",heading:"Cart.Cart.heading",message:"Cart.CartItem.message",regularPrice:"Cart.CartItem.regularPrice",recipient:"Cart.CartItem.recipient",sender:"Cart.CartItem.sender",file:"Cart.CartItem.file",files:"Cart.CartItem.files",orderSummary:"Cart.PriceSummary.orderSummary",taxesBreakdownTitle:"Cart.PriceSummary.taxes.breakdown",taxTotal:"Cart.PriceSummary.taxes.total",taxEstimated:"Cart.PriceSummary.taxes.estimated",taxTotalOnly:"Cart.PriceSummary.taxes.totalOnly",showTaxBreakdown:"Cart.PriceSummary.taxes.showBreakdown",hideTaxBreakdown:"Cart.PriceSummary.taxes.hideBreakdown",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",subtotalLabel:"Cart.PriceSummary.subTotal.label",subtotalWithTaxes:"Cart.PriceSummary.subTotal.withTaxes",subtotalWithoutTaxes:"Cart.PriceSummary.subTotal.withoutTaxes",totalEstimated:"Cart.PriceSummary.total.estimated",totalLabel:"Cart.PriceSummary.total.label",totalWithoutTax:"Cart.PriceSummary.total.withoutTax",totalSaved:"Cart.PriceSummary.total.saved",shippingLabel:"Cart.PriceSummary.shipping.label",zipPlaceholder:"Cart.PriceSummary.shipping.zipPlaceholder",editZipAction:"Cart.PriceSummary.shipping.editZipAction",shippingWithTaxes:"Cart.PriceSummary.shipping.withTaxes",shippingWithoutTaxes:"Cart.PriceSummary.shipping.withoutTaxes",shippingEstimated:"Cart.PriceSummary.shipping.estimated",shippingEstimatedByState:"Cart.PriceSummary.shipping.alternateField.state",shippingEstimatedByZip:"Cart.PriceSummary.shipping.alternateField.zip",destinationLinkAriaLabel:"Cart.PriceSummary.shipping.destinationLinkAriaLabel",applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder"}),k=g&&E(v,{label:i.subtotalLabel,price:g.price,classSuffixes:["subTotal"],children:[g.taxIncluded&&r("div",{"data-testid":"sub-total-tax-caption",className:"cart-order-summary__caption",children:r("span",{children:i.subtotalWithTaxes})}),g.taxExcluded?r("div",{"data-testid":"sub-total-tax-caption-excluded",className:"cart-order-summary__caption",children:E("span",{children:[g.priceExcludingTax," ",i.subtotalWithoutTaxes]})}):void 0]}),w=_&&_.length>0&&r(We,{children:_.map(n=>E(v,{label:n.label,price:n.price,classSuffixes:["discount"],children:[n.coupon&&r(B,{node:n.coupon,className:"cart-order-summary__coupon__code"}),n.caption&&r(B,{node:n.caption,className:"cart-order-summary__caption"})]}))}),S=e&&e.length>0?r(Ne,{"data-testid":"tax-breakdown",className:"cart-order-summary__taxes",iconOpen:De,iconClose:Be,children:E(Le,{title:i.taxesBreakdownTitle,secondaryText:!T&&x?r(B,{node:x.price,className:"cart-order-summary__price"}):void 0,renderContentWhenClosed:!1,onStateChange:D,children:[r("div",{className:"cart-order-summary__appliedTaxes",children:e.map(n=>r(v,{label:n.label,price:n.price,classSuffixes:["taxEntry"],labelClassSuffix:"muted"}))}),x&&r(v,{label:i.taxTotal,price:x.price,classSuffixes:["taxTotal"],labelClassSuffix:"muted"})]})}):x&&r(v,{label:x.estimated?i.taxEstimated:i.taxTotalOnly,price:x.price,classSuffixes:["taxTotal"],testId:"tax-total-only"}),d=[{key:"subTotalContent",sortOrder:100,content:k},...m?[{key:"shippingContent",sortOrder:200,content:r(B,{node:m,className:"cart-order-summary__shipping"})}]:[],{key:"discountsContent",sortOrder:300,content:w},{key:"taxContent",sortOrder:400,content:S},...p?[{key:"taxContent",sortOrder:500,content:r(v,{label:p.estimated?i.totalEstimated:i.totalLabel,price:p.price,classSuffixes:["total","total--padded"],testId:"total-content",labelClassSuffix:"bold"})}]:[],...p&&p.priceWithoutTax?[{key:"totalWithoutTaxContent",sortOrder:600,content:r(v,{label:i.totalWithoutTax,price:p.priceWithoutTax,classSuffixes:["totalWithoutTax"],testId:"total-without-tax",labelClassSuffix:"muted"})}]:[],...y?[{key:"totalSavedContent",sortOrder:700,content:r(v,{label:i.totalSaved,price:y,classSuffixes:["saved"],testId:"total-saved",labelClassSuffix:"muted"})}]:[],...L?[{key:"primaryActionContent",sortOrder:800,content:r("div",{className:ke(["cart-order-summary__entry","cart-order-summary__primaryAction"]),children:L})}]:[],...o?[{key:"couponsContent",sortOrder:900,content:r(B,{node:o,className:"cart-order-summary__coupons"})}]:[]],h=I(d).sort((n,C)=>n.sortOrder-C.sortOrder);return E("div",{...t,className:ke(["cart-order-summary",["cart-order-summary--loading",N],[`cart-order-summary__${P}`,P],O]),children:[N&&r(Ze,{className:"cart-order-summary__spinner"}),E("div",{className:"cart-order-summary__heading",children:[s&&r(B,{node:s,className:"cart-order-summary__heading-text"}),r(je,{variant:"primary",className:"cart-order-summary__divider-primary"})]}),r("div",{className:"cart-order-summary__content",children:h.map(n=>Array.isArray(n.content)?r(Ne,{className:n.className,actionIconPosition:"right",iconOpen:De,iconClose:Be,children:r(Le,{defaultOpen:!1,title:n.title,renderContentWhenClosed:!1,children:n.content.map(C=>C.content)})}):n.content)})]})},qe=()=>{const[O,A]=M(!1),[P,s]=M();return{handleEstimateTotals:(g,m)=>{A(!0);const{shippingCountry:_,shippingState:x="",shippingStateId:e,shippingZip:p=""}=g,L={countryCode:_,postcode:p,region:{region:x,id:e},shipping_method:{carrier_code:(m==null?void 0:m.carrier_code)||"",method_code:(m==null?void 0:m.method_code)||""}};ze(L).then(o=>{var y,I,t,T,D,i,k,w,S,d,h,n,C,ee,W,F,G,z,V,Z;o&&s({estimatedTaxTotal:{amount:(y=o.totalTax)==null?void 0:y.value,currency:(I=o.totalTax)==null?void 0:I.currency},estimatedSubTotal:{excludingTax:{amount:(T=(t=o.subtotal)==null?void 0:t.excludingTax)==null?void 0:T.value,currency:(i=(D=o.subtotal)==null?void 0:D.excludingTax)==null?void 0:i.currency},includingTax:{amount:(w=(k=o.subtotal)==null?void 0:k.includingTax)==null?void 0:w.value,currency:(d=(S=o.subtotal)==null?void 0:S.includingTax)==null?void 0:d.currency},includingDiscountOnly:{amount:(n=(h=o.subtotal)==null?void 0:h.includingDiscountOnly)==null?void 0:n.value,currency:(ee=(C=o.subtotal)==null?void 0:C.includingDiscountOnly)==null?void 0:ee.currency}},estimatedGrandTotalPrice:{includingTax:{amount:(W=o.total)==null?void 0:W.includingTax.value,currency:(F=o.total)==null?void 0:F.includingTax.currency},excludingTax:{amount:(G=o.total)==null?void 0:G.excludingTax.value,currency:(z=o.total)==null?void 0:z.excludingTax.currency}},estimatedAppliedTaxes:{taxes:(V=o.appliedTaxes)==null?void 0:V.map(u=>{var b,f;return{label:u.label,amount:{value:(b=u.amount)==null?void 0:b.value,currency:(f=u.amount)==null?void 0:f.currency}}})},estimatedItems:{items:(Z=o.items)==null?void 0:Z.map(u=>{var b,f,j,U,Q,X,$,q,H,R;return{uid:u.uid,price:{amount:(b=u.price)==null?void 0:b.value,currency:(f=u.price)==null?void 0:f.currency},taxedPrice:{amount:(j=u.taxedPrice)==null?void 0:j.value,currency:(U=u.taxedPrice)==null?void 0:U.currency},rowTotal:{amount:(Q=u.rowTotal)==null?void 0:Q.value,currency:(X=u.rowTotal)==null?void 0:X.currency},rowTotalIncludingTax:{amount:($=u.rowTotalIncludingTax)==null?void 0:$.value,currency:(q=u.rowTotalIncludingTax)==null?void 0:q.currency},regularPrice:{amount:(H=u.regularPrice)==null?void 0:H.value,currency:(R=u.regularPrice)==null?void 0:R.currency}}})}})}).finally(()=>{A(!1)})},estimatedTotals:P,setEstimatedTotals:s,loading:O}},He=({children:O,initialData:A=null,routeCheckout:P,slots:s,errors:N,showTotalSaved:g,enableCoupons:m,updateLineItems:_=e=>e,...x})=>{var W,F,G,z,V,Z,u,b,f,j,U,Q,X,$,q,H,R,ie,ne,ce,oe,ue,se,le,me,de,xe,pe,he,ge,ye,Te,Se,Ce,be,fe;const[e,p]=M(A),[L,o]=M(!1),y=e==null?void 0:e.isVirtual;m=m??!0;const{handleEstimateTotals:I,estimatedTotals:t,setEstimatedTotals:T,loading:D}=qe(),i=(W=Oe.config)==null?void 0:W.shoppingCartDisplaySetting,k=(i==null?void 0:i.subtotal)==="INCLUDING_TAX",w=(i==null?void 0:i.subtotal)==="INCLUDING_EXCLUDING_TAX",S=i==null?void 0:i.zeroTax;ae(()=>{const c=Ee.on("cart/data",a=>{var J,K,Y;p(a);const te=(J=a==null?void 0:a.addresses)==null?void 0:J.shipping,re=a==null?void 0:a.isVirtual;(te||re)&&T(null),t==null&&T({estimatedTaxTotal:{amount:(K=a==null?void 0:a.totalTax)==null?void 0:K.value,currency:(Y=a==null?void 0:a.totalTax)==null?void 0:Y.currency}})},{eager:!0});return()=>{c==null||c.off()}},[]),ae(()=>{o(N)},[N]),ae(()=>{const c=Ee.on("shipping/estimate",a=>{var J,K,Y,ve,Pe,_e;const te={shippingCountry:(J=a==null?void 0:a.address)==null?void 0:J.countryCode,shippingState:(K=a==null?void 0:a.address)==null?void 0:K.region,shippingStateId:(Y=a==null?void 0:a.address)==null?void 0:Y.regionId,shippingZip:(ve=a==null?void 0:a.address)==null?void 0:ve.postCode},re={carrier_code:((Pe=a==null?void 0:a.shippingMethod)==null?void 0:Pe.carrierCode)||"",method_code:((_e=a==null?void 0:a.shippingMethod)==null?void 0:_e.methodCode)||""};I(te,re)});return()=>{c==null||c.off()}},[I]);const d=Ae({checkout:"Cart.PriceSummary.checkout",free:"Cart.PriceSummary.total.free",orderSummary:"Cart.PriceSummary.orderSummary",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined"}),h=(e==null?void 0:e.hasOutOfStockItems)||L,n=Fe(()=>{!h&&e&&Ve(e,Oe.locale)},[h,e]),C=!y&&(s!=null&&s.EstimateShipping)?r(we,{name:"EstimateShipping",slot:s.EstimateShipping},"estimateShippingId"):void 0;if(!Object.keys(e??{}).length||(e==null?void 0:e.totalQuantity)===0)return null;const ee=m&&(s!=null&&s.Coupons)?r(we,{name:"Coupons",slot:s.Coupons},"couponsId"):void 0;return r($e,{...x,"data-testid":"cart-order-summary",heading:r("div",{children:d.orderSummary}),shipping:C,coupons:ee,loading:D,updateLineItems:_,subTotal:{taxIncluded:k&&!S,taxExcluded:w,zeroTaxSubtotal:S,priceExcludingTax:(F=t==null?void 0:t.estimatedSubTotal)!=null&&F.excludingTax?r(l,{"data-testid":"subtotal",...(G=t==null?void 0:t.estimatedSubTotal)==null?void 0:G.excludingTax}):r(l,{"data-testid":"subtotal",amount:(V=(z=e==null?void 0:e.subtotal)==null?void 0:z.excludingTax)==null?void 0:V.value,currency:(u=(Z=e==null?void 0:e.subtotal)==null?void 0:Z.excludingTax)==null?void 0:u.currency}),price:!S&&k||!S&&w?(b=t==null?void 0:t.estimatedSubTotal)!=null&&b.includingTax?r(l,{"data-testid":"subtotal",...(f=t==null?void 0:t.estimatedSubTotal)==null?void 0:f.includingTax}):r(l,{"data-testid":"subtotal",amount:(j=e==null?void 0:e.subtotal.includingTax)==null?void 0:j.value,currency:(U=e==null?void 0:e.subtotal.includingTax)==null?void 0:U.currency}):r(l,{"data-testid":"subtotal",amount:(X=(Q=e==null?void 0:e.subtotal)==null?void 0:Q.excludingTax)==null?void 0:X.value,currency:(q=($=e==null?void 0:e.subtotal)==null?void 0:$.excludingTax)==null?void 0:q.currency})},discounts:(H=e==null?void 0:e.appliedDiscounts)==null?void 0:H.map(c=>{var a;return{label:c.label,price:r(l,{"data-testid":"summary-discount-total",amount:-c.amount.value,currency:c.amount.currency,sale:!0}),coupon:c!=null&&c.coupon?E("span",{children:[r(Ue,{source:Xe,size:"16"}),(a=c==null?void 0:c.coupon)==null?void 0:a.code]}):void 0}}),taxTotal:y||t&&t.estimatedTaxTotal==null?{price:r("span",{"data-testid":"tax-total-tbd",children:d.taxToBeDetermined})}:{price:t!=null&&t.estimatedTaxTotal?r(l,{"data-testid":"tax-total-estimated",...t==null?void 0:t.estimatedTaxTotal}):r(l,{"data-testid":"tax-total-actual",amount:(R=e==null?void 0:e.totalTax)==null?void 0:R.value,currency:(ie=e==null?void 0:e.totalTax)==null?void 0:ie.currency}),estimated:(!t||!t.estimatedTaxTotal)&&!((ne=e==null?void 0:e.addresses)!=null&&ne.shipping)},taxesApplied:y?void 0:i!=null&&i.fullSummary?(oe=((ce=t==null?void 0:t.estimatedAppliedTaxes)==null?void 0:ce.taxes)||(e==null?void 0:e.appliedTaxes))==null?void 0:oe.map(c=>({label:c.label,price:r(l,{"data-testid":"applied-taxes",amount:c.amount.value,currency:c.amount.currency})})):void 0,total:{price:t!=null&&t.estimatedGrandTotalPrice?((se=(ue=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:ue.includingTax)==null?void 0:se.amount)===0?r("span",{"data-testid":"total-including-tax",children:d.free}):r(l,{"data-testid":"total-including-tax-estimated",...(le=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:le.includingTax}):((me=e==null?void 0:e.total)==null?void 0:me.includingTax.value)===0?r("span",{"data-testid":"total-including-tax",children:d.free}):r(l,{"data-testid":"total-including-tax-actual",amount:(de=e==null?void 0:e.total)==null?void 0:de.includingTax.value,currency:(xe=e==null?void 0:e.total)==null?void 0:xe.includingTax.currency}),estimated:(!t||!!(t!=null&&t.estimatedTaxTotal))&&!((pe=e==null?void 0:e.addresses)!=null&&pe.shipping),priceWithoutTax:i!=null&&i.grandTotal?t!=null&&t.estimatedAppliedTaxes?((ge=(he=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:he.excludingTax)==null?void 0:ge.amount)===0?r("span",{"data-testid":"total-excluding-tax",children:d.free}):r(l,{"data-testid":"total-excluding-tax",...(ye=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:ye.excludingTax}):((Te=e==null?void 0:e.total)==null?void 0:Te.excludingTax.value)===0?r("span",{"data-testid":"total-excluding-tax",children:d.free}):r(l,{"data-testid":"total-excluding-tax",amount:(Se=e==null?void 0:e.total)==null?void 0:Se.excludingTax.value,currency:(Ce=e==null?void 0:e.total)==null?void 0:Ce.excludingTax.currency}):void 0},primaryAction:P&&r(Qe,{"data-testid":"checkout-button",variant:"primary",disabled:h,"aria-disabled":h,href:h?void 0:P({cartId:e.id}),onClick:n,children:d.checkout}),totalSaved:g?r(l,{amount:(be=e==null?void 0:e.discount)==null?void 0:be.value,currency:(fe=e==null?void 0:e.total)==null?void 0:fe.includingTax.currency}):void 0})};He.getInitialData=async function(){return Ge()};export{He as O}; +import{jsx as r,jsxs as p,Fragment as xr}from"@dropins/tools/preact-jsx-runtime.js";import{useState as te,useEffect as ie,useCallback as pr,Fragment as Tr}from"@dropins/tools/preact-compat.js";import{VComponent as U,classes as ar,Slot as le}from"@dropins/tools/lib.js";import{events as cr}from"@dropins/tools/event-bus.js";import{g as gr}from"./persisted-data.js";import{s as ce}from"./resetCart.js";import{g as hr}from"./getEstimatedTotals.js";import{p as yr}from"./acdl.js";import"@dropins/tools/preact-hooks.js";import{Accordion as ir,AccordionSection as lr,ProgressSpinner as Cr,Divider as Sr,Price as u,Icon as ur,Button as Ir}from"@dropins/tools/components.js";/* empty css */import{O as C}from"./OrderSummaryLine.js";import{S as or}from"./ChevronDown.js";import{S as sr}from"./ChevronUp.js";import{useText as dr,Text as mr}from"@dropins/tools/i18n.js";import{S as br}from"./Coupon.js";import{S as vr}from"./GiftCard.js";const _r=({className:ne,children:$,variant:w="primary",heading:m,loading:X=!0,subTotal:b,shipping:g,discounts:v,taxTotal:S,taxesApplied:A,total:e,primaryAction:z,coupons:o,giftCards:D,totalSaved:_,appliedGiftCards:d,printedCard:t,itemsGiftWrapping:x,orderGiftWrapping:T,updateLineItems:s=f=>f,...W})=>{const[f,P]=te(!1),l=dr({checkout:"Cart.PriceSummary.checkout",discountedPrice:"Cart.CartItem.discountedPrice",download:"Cart.CartItem.download",heading:"Cart.Cart.heading",message:"Cart.CartItem.message",regularPrice:"Cart.CartItem.regularPrice",recipient:"Cart.CartItem.recipient",sender:"Cart.CartItem.sender",file:"Cart.CartItem.file",files:"Cart.CartItem.files",orderSummary:"Cart.PriceSummary.orderSummary",taxesBreakdownTitle:"Cart.PriceSummary.taxes.breakdown",taxTotal:"Cart.PriceSummary.taxes.total",taxEstimated:"Cart.PriceSummary.taxes.estimated",taxTotalOnly:"Cart.PriceSummary.taxes.totalOnly",showTaxBreakdown:"Cart.PriceSummary.taxes.showBreakdown",hideTaxBreakdown:"Cart.PriceSummary.taxes.hideBreakdown",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",subtotalLabel:"Cart.PriceSummary.subTotal.label",subtotalWithTaxes:"Cart.PriceSummary.subTotal.withTaxes",subtotalWithoutTaxes:"Cart.PriceSummary.subTotal.withoutTaxes",totalEstimated:"Cart.PriceSummary.total.estimated",totalLabel:"Cart.PriceSummary.total.label",totalWithoutTax:"Cart.PriceSummary.total.withoutTax",totalSaved:"Cart.PriceSummary.total.saved",shippingLabel:"Cart.PriceSummary.shipping.label",zipPlaceholder:"Cart.PriceSummary.shipping.zipPlaceholder",editZipAction:"Cart.PriceSummary.shipping.editZipAction",shippingWithTaxes:"Cart.PriceSummary.shipping.withTaxes",shippingWithoutTaxes:"Cart.PriceSummary.shipping.withoutTaxes",shippingEstimated:"Cart.PriceSummary.shipping.estimated",shippingEstimatedByState:"Cart.PriceSummary.shipping.alternateField.state",shippingEstimatedByZip:"Cart.PriceSummary.shipping.alternateField.zip",destinationLinkAriaLabel:"Cart.PriceSummary.shipping.destinationLinkAriaLabel",applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder",printedCardTitle:"Cart.PriceSummary.giftOptionsTax.printedCard.title",printedCardInclTax:"Cart.PriceSummary.giftOptionsTax.printedCard.inclTax",printedCardExclTax:"Cart.PriceSummary.giftOptionsTax.printedCard.exclTax",itemGiftWrappingTitle:"Cart.PriceSummary.giftOptionsTax.itemGiftWrapping.title",itemGiftWrappingInclTax:"Cart.PriceSummary.giftOptionsTax.itemGiftWrapping.inclTax",itemGiftWrappingExclTax:"Cart.PriceSummary.giftOptionsTax.itemGiftWrapping.exclTax",orderGiftWrappingTitle:"Cart.PriceSummary.giftOptionsTax.orderGiftWrapping.title",orderGiftWrappingInclTax:"Cart.PriceSummary.giftOptionsTax.orderGiftWrapping.inclTax",orderGiftWrappingExclTax:"Cart.PriceSummary.giftOptionsTax.orderGiftWrapping.exclTax"}),V=d?r(C,{label:d==null?void 0:d.label,price:d==null?void 0:d.price,classSuffixes:["applied-gift-cards"],children:d==null?void 0:d.content}):null,E=b&&p(C,{label:l.subtotalLabel,price:b.price,classSuffixes:["subTotal"],children:[b.taxIncluded&&r("div",{"data-testid":"sub-total-tax-caption",className:"cart-order-summary__caption",children:r("span",{children:l.subtotalWithTaxes})}),b.taxExcluded?r("div",{"data-testid":"sub-total-tax-caption-excluded",className:"cart-order-summary__caption",children:p("span",{children:[b.priceExcludingTax," ",l.subtotalWithoutTaxes]})}):void 0]}),B=v&&v.length>0&&r(xr,{children:v.map(i=>p(C,{label:i.label,price:i.price,classSuffixes:["discount"],children:[i.coupon&&r(U,{node:i.coupon,className:"cart-order-summary__coupon__code"}),i.caption&&r(U,{node:i.caption,className:"cart-order-summary__caption"})]}))}),n=A&&A.length>0?r(ir,{"data-testid":"tax-breakdown",className:"cart-order-summary__taxes",iconOpen:or,iconClose:sr,children:p(lr,{title:l.taxesBreakdownTitle,secondaryText:!f&&S?r(U,{node:S.price,className:"cart-order-summary__price"}):void 0,renderContentWhenClosed:!1,onStateChange:P,children:[r("div",{className:"cart-order-summary__appliedTaxes",children:A.map(i=>r(C,{label:i.label,price:i.price,classSuffixes:["taxEntry"],labelClassSuffix:"muted"}))}),S&&r(C,{label:l.taxTotal,price:S.price,classSuffixes:["taxTotal"],labelClassSuffix:"muted"})]})}):S&&r(C,{label:S.estimated?l.taxEstimated:l.taxTotalOnly,price:S.price,classSuffixes:["taxTotal"],testId:"tax-total-only"}),h=t!=null&&t.renderContent?p(C,{label:l.printedCardTitle,price:t.taxInclAndExcl||t.taxIncluded?t.priceInclTax:t.priceExclTax,classSuffixes:["printedCardContent"],children:[t.taxIncluded&&r("div",{"data-testid":"printed-card-incl",className:"cart-order-summary__caption",children:r("span",{children:l.printedCardInclTax})}),t.taxInclAndExcl?r("div",{"data-testid":"printed-card-incl-excl",className:"cart-order-summary__caption",children:p("span",{children:[t.priceExclTax," ",l.printedCardExclTax]})}):void 0]}):null,I=x!=null&&x.renderContent?p(C,{label:l.itemGiftWrappingTitle,price:x.taxInclAndExcl||x.taxIncluded?x.priceInclTax:x.priceExclTax,classSuffixes:["itemsGiftWrappingContent"],children:[x.taxIncluded?r("div",{"data-testid":"item-gift-wrapping-incl",className:"cart-order-summary__caption",children:r("span",{children:l.itemGiftWrappingInclTax})}):null,x.taxInclAndExcl?r("div",{"data-testid":"item-gift-wrapping-incl-excl",className:"cart-order-summary__caption",children:p("span",{children:[x.priceExclTax," ",l.itemGiftWrappingExclTax]})}):null]}):null,Z=T!=null&&T.renderContent?p(C,{label:l.orderGiftWrappingTitle,price:T.taxInclAndExcl||T.taxIncluded?T.priceInclTax:T.priceExclTax,classSuffixes:["orderGiftWrappingContent"],children:[T.taxIncluded&&r("div",{"data-testid":"order-gift-wrapping-incl",className:"cart-order-summary__caption",children:r("span",{children:l.orderGiftWrappingInclTax})}),T.taxInclAndExcl?r("div",{"data-testid":"order-gift-wrapping-incl-excl",className:"cart-order-summary__caption",children:p("span",{children:[T.priceExclTax," ",l.orderGiftWrappingExclTax]})}):void 0]}):null,j=[{key:"subTotalContent",sortOrder:100,content:E},...g?[{key:"shippingContent",sortOrder:200,content:r(U,{node:g,className:"cart-order-summary__shipping"})}]:[],{key:"printedCard",sortOrder:300,content:h},{key:"itemsGiftWrappingContent",sortOrder:400,content:I},{key:"orderGiftWrappingContent",sortOrder:500,content:Z},{key:"discountsContent",sortOrder:600,content:B},{key:"appliedGiftCardsContent",sortOrder:700,content:V},{key:"taxContent",sortOrder:800,content:n},...e?[{key:"taxContent",sortOrder:900,content:r(C,{label:e.estimated?l.totalEstimated:l.totalLabel,price:e.price,classSuffixes:["total","total--padded"],testId:"total-content",labelClassSuffix:"bold"})}]:[],...e!=null&&e.priceWithoutTax?[{key:"totalWithoutTaxContent",sortOrder:1e3,content:r(C,{label:l.totalWithoutTax,price:e.priceWithoutTax,classSuffixes:["totalWithoutTax"],testId:"total-without-tax",labelClassSuffix:"muted"})}]:[],..._?[{key:"totalSavedContent",sortOrder:1100,content:r(C,{label:l.totalSaved,price:_,classSuffixes:["saved"],testId:"total-saved",labelClassSuffix:"muted"})}]:[],...z?[{key:"primaryActionContent",sortOrder:1200,content:r("div",{className:ar(["cart-order-summary__entry","cart-order-summary__primaryAction"]),children:z})}]:[],...o?[{key:"couponsContent",sortOrder:1300,content:r(U,{node:o,className:"cart-order-summary__coupons"})}]:[],...D?[{key:"giftCardsContent",sortOrder:1400,content:r(U,{node:D,className:"cart-order-summary__gift-cards"})}]:[]],Q=s(j).sort((i,y)=>i.sortOrder-y.sortOrder);return p("div",{...W,className:ar(["cart-order-summary",["cart-order-summary--loading",X],[`cart-order-summary__${w}`,w],ne]),children:[X&&r(Cr,{className:"cart-order-summary__spinner"}),p("div",{className:"cart-order-summary__heading",children:[m&&r(U,{node:m,className:"cart-order-summary__heading-text"}),r(Sr,{variant:"primary",className:"cart-order-summary__divider-primary"})]}),r("div",{className:"cart-order-summary__content",children:Q.map(i=>Array.isArray(i.content)?r(ir,{className:i.className,actionIconPosition:"right",iconOpen:or,iconClose:sr,children:r(lr,{defaultOpen:!1,title:i.title,renderContentWhenClosed:!1,children:i.content.map(y=>y.content)})},i.key):i.content)})]})},fr=()=>{const[ne,$]=te(!1),[w,m]=te();return{handleEstimateTotals:(b,g)=>{$(!0);const{shippingCountry:v,shippingState:S="",shippingStateId:A,shippingZip:e=""}=b,z={countryCode:v,postcode:e,region:{region:S,id:A},shipping_method:{carrier_code:(g==null?void 0:g.carrier_code)||"",method_code:(g==null?void 0:g.method_code)||""}};hr(z).then(o=>{var D,_,d,t,x,T,s,W,f,P,l,V,E,B,n,h,I,Z,j,Q;o&&m({estimatedTaxTotal:{amount:(D=o.totalTax)==null?void 0:D.value,currency:(_=o.totalTax)==null?void 0:_.currency},estimatedSubTotal:{excludingTax:{amount:(t=(d=o.subtotal)==null?void 0:d.excludingTax)==null?void 0:t.value,currency:(T=(x=o.subtotal)==null?void 0:x.excludingTax)==null?void 0:T.currency},includingTax:{amount:(W=(s=o.subtotal)==null?void 0:s.includingTax)==null?void 0:W.value,currency:(P=(f=o.subtotal)==null?void 0:f.includingTax)==null?void 0:P.currency},includingDiscountOnly:{amount:(V=(l=o.subtotal)==null?void 0:l.includingDiscountOnly)==null?void 0:V.value,currency:(B=(E=o.subtotal)==null?void 0:E.includingDiscountOnly)==null?void 0:B.currency}},estimatedGrandTotalPrice:{includingTax:{amount:(n=o.total)==null?void 0:n.includingTax.value,currency:(h=o.total)==null?void 0:h.includingTax.currency},excludingTax:{amount:(I=o.total)==null?void 0:I.excludingTax.value,currency:(Z=o.total)==null?void 0:Z.excludingTax.currency}},estimatedAppliedTaxes:{taxes:(j=o.appliedTaxes)==null?void 0:j.map(i=>{var y,N;return{label:i.label,amount:{value:(y=i.amount)==null?void 0:y.value,currency:(N=i.amount)==null?void 0:N.currency}}})},estimatedItems:{items:(Q=o.items)==null?void 0:Q.map(i=>{var y,N,H,q,J,K,R,Y,G,M;return{uid:i.uid,price:{amount:(y=i.price)==null?void 0:y.value,currency:(N=i.price)==null?void 0:N.currency},taxedPrice:{amount:(H=i.taxedPrice)==null?void 0:H.value,currency:(q=i.taxedPrice)==null?void 0:q.currency},rowTotal:{amount:(J=i.rowTotal)==null?void 0:J.value,currency:(K=i.rowTotal)==null?void 0:K.currency},rowTotalIncludingTax:{amount:(R=i.rowTotalIncludingTax)==null?void 0:R.value,currency:(Y=i.rowTotalIncludingTax)==null?void 0:Y.currency},regularPrice:{amount:(G=i.regularPrice)==null?void 0:G.value,currency:(M=i.regularPrice)==null?void 0:M.currency}}})}})}).finally(()=>{$(!1)})},estimatedTotals:w,setEstimatedTotals:m,loading:ne}},Pr=({children:ne,initialData:$=null,routeCheckout:w,slots:m,errors:X,showTotalSaved:b,enableCoupons:g,enableGiftCards:v,updateLineItems:S=e=>e,...A})=>{var y,N,H,q,J,K,R,Y,G,M,ue,oe,se,me,de,xe,pe,Te,ge,he,ye,Ce,Se,Ie,be,ve,_e,fe,Pe,Ee,Ne,ke,we,Ae,De,We,Be,Le,Fe,Oe,Ue,Xe,ze,Ve,Ze,je,Qe,$e,He,qe,Je,Ke,Re,Ye,Ge,Me,er,rr,tr;const[e,z]=te($),[o,D]=te(!1),_=e==null?void 0:e.isVirtual;g=g??!0,v=v??!0;const{handleEstimateTotals:d,estimatedTotals:t,setEstimatedTotals:x,loading:T}=fr(),s=(y=ce.config)==null?void 0:y.shoppingCartDisplaySetting,W=(s==null?void 0:s.subtotal)==="INCLUDING_TAX",f=(s==null?void 0:s.subtotal)==="INCLUDING_EXCLUDING_TAX",P=s==null?void 0:s.zeroTax,l=()=>(e==null?void 0:e.appliedGiftCards.reduce((a,c)=>a+c.appliedBalance.value,0))??0,V=a=>{var k,ee,re;if(!(a!=null&&a.code))return null;const c=(k=a==null?void 0:a.currentBalance)==null?void 0:k.value,L=(ee=a==null?void 0:a.appliedBalance)==null?void 0:ee.value,F=c-L!==0?c-L:L,O=(re=a==null?void 0:a.currentBalance)==null?void 0:re.currency;return p(Tr,{children:[p("span",{className:"cart-order-summary__coupon__code",children:[r(ur,{source:vr,size:"16"}),r("span",{children:a==null?void 0:a.code})]}),p("span",{className:"cart-order-summary__caption",children:[r(mr,{id:"Cart.PriceSummary.giftCard.appliedGiftCards.remainingBalance"}),r(u,{className:"cart-order-summary__caption",weight:"normal",size:"small",amount:F,currency:O})]})]},a.code)},E=(N=ce.config)==null?void 0:N.cartGiftWrapping,B=(H=ce.config)==null?void 0:H.cartPrintedCard,n=e==null?void 0:e.totalGiftOptions;ie(()=>{const a=cr.on("cart/data",c=>{var F,O,k;z(c);const L=(F=c==null?void 0:c.addresses)==null?void 0:F.shipping,ae=c==null?void 0:c.isVirtual;(L||ae)&&x(null),t==null&&x({estimatedTaxTotal:{amount:(O=c==null?void 0:c.totalTax)==null?void 0:O.value,currency:(k=c==null?void 0:c.totalTax)==null?void 0:k.currency}})},{eager:!0});return()=>{a==null||a.off()}},[]),ie(()=>{D(X)},[X]),ie(()=>{const a=cr.on("shipping/estimate",c=>{var F,O,k,ee,re,nr;const L={shippingCountry:(F=c==null?void 0:c.address)==null?void 0:F.countryCode,shippingState:(O=c==null?void 0:c.address)==null?void 0:O.region,shippingStateId:(k=c==null?void 0:c.address)==null?void 0:k.regionId,shippingZip:(ee=c==null?void 0:c.address)==null?void 0:ee.postCode},ae={carrier_code:((re=c==null?void 0:c.shippingMethod)==null?void 0:re.carrierCode)||"",method_code:((nr=c==null?void 0:c.shippingMethod)==null?void 0:nr.methodCode)||""};d(L,ae)});return()=>{a==null||a.off()}},[d]);const h=dr({checkout:"Cart.PriceSummary.checkout",free:"Cart.PriceSummary.total.free",orderSummary:"Cart.PriceSummary.orderSummary",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined"}),I=(e==null?void 0:e.hasOutOfStockItems)||o,Z=pr(()=>{!I&&e&&yr(e,ce.locale)},[I,e]),j=!_&&(m!=null&&m.EstimateShipping)?r(le,{name:"EstimateShipping",slot:m.EstimateShipping},"estimateShippingId"):void 0;if(!Object.keys(e??{}).length||(e==null?void 0:e.totalQuantity)===0)return null;const Q=g&&(m!=null&&m.Coupons)?r(le,{name:"Coupons",slot:m.Coupons},"couponsId"):void 0,i=v&&(m!=null&&m.GiftCards)?r(le,{name:"GiftCards",slot:m.GiftCards},"giftCardId"):void 0;return r(_r,{...A,"data-testid":"cart-order-summary",heading:r("div",{children:h.orderSummary}),shipping:j,coupons:Q,giftCards:i,loading:T,updateLineItems:S,appliedGiftCards:(q=e==null?void 0:e.appliedGiftCards)!=null&&q.length?{label:r(mr,{id:"Cart.PriceSummary.giftCard.appliedGiftCards.label",plural:(J=e==null?void 0:e.appliedGiftCards)==null?void 0:J.length,fields:{count:(K=e==null?void 0:e.appliedGiftCards)==null?void 0:K.length}}),price:r(u,{className:"cart-order-summary__price",amount:-l(),currency:(Y=(R=e==null?void 0:e.appliedGiftCards)==null?void 0:R[0])==null?void 0:Y.appliedBalance.currency}),content:(G=e==null?void 0:e.appliedGiftCards)==null?void 0:G.map(V).filter(Boolean)}:void 0,printedCard:{renderContent:!!((M=n==null?void 0:n.printedCard)!=null&&M.value),taxIncluded:B==="INCLUDING_TAX",taxInclAndExcl:B==="INCLUDING_EXCLUDING_TAX",priceExclTax:r(u,{"data-testid":"printed-card",amount:(ue=n==null?void 0:n.printedCard)==null?void 0:ue.value,currency:(oe=n==null?void 0:n.printedCard)==null?void 0:oe.currency}),priceInclTax:r(u,{amount:(se=n==null?void 0:n.printedCardInclTax)==null?void 0:se.value,currency:(me=n==null?void 0:n.printedCardInclTax)==null?void 0:me.currency})},itemsGiftWrapping:{renderContent:!!((de=n==null?void 0:n.giftWrappingForItems)!=null&&de.value),taxIncluded:E==="INCLUDING_TAX",taxInclAndExcl:E==="INCLUDING_EXCLUDING_TAX",priceExclTax:r(u,{amount:(xe=n==null?void 0:n.giftWrappingForItems)==null?void 0:xe.value,currency:(pe=n==null?void 0:n.giftWrappingForItems)==null?void 0:pe.currency}),priceInclTax:r(u,{amount:(Te=n==null?void 0:n.giftWrappingForItemsInclTax)==null?void 0:Te.value,currency:(ge=n==null?void 0:n.giftWrappingForItemsInclTax)==null?void 0:ge.currency})},orderGiftWrapping:{renderContent:!!((he=n==null?void 0:n.giftWrappingForOrder)!=null&&he.value),taxIncluded:E==="INCLUDING_TAX",taxInclAndExcl:E==="INCLUDING_EXCLUDING_TAX",priceExclTax:r(u,{amount:(ye=n==null?void 0:n.giftWrappingForOrder)==null?void 0:ye.value,currency:(Ce=n==null?void 0:n.giftWrappingForOrder)==null?void 0:Ce.currency}),priceInclTax:r(u,{amount:(Se=n==null?void 0:n.giftWrappingForOrderInclTax)==null?void 0:Se.value,currency:(Ie=n==null?void 0:n.giftWrappingForOrderInclTax)==null?void 0:Ie.currency})},subTotal:{taxIncluded:W&&!P,taxExcluded:f,zeroTaxSubtotal:P,priceExcludingTax:(be=t==null?void 0:t.estimatedSubTotal)!=null&&be.excludingTax?r(u,{"data-testid":"subtotal",...(ve=t==null?void 0:t.estimatedSubTotal)==null?void 0:ve.excludingTax}):r(u,{"data-testid":"subtotal",amount:(fe=(_e=e==null?void 0:e.subtotal)==null?void 0:_e.excludingTax)==null?void 0:fe.value,currency:(Ee=(Pe=e==null?void 0:e.subtotal)==null?void 0:Pe.excludingTax)==null?void 0:Ee.currency}),price:!P&&W||!P&&f?(Ne=t==null?void 0:t.estimatedSubTotal)!=null&&Ne.includingTax?r(u,{"data-testid":"subtotal",...(ke=t==null?void 0:t.estimatedSubTotal)==null?void 0:ke.includingTax}):r(u,{"data-testid":"subtotal",amount:(we=e==null?void 0:e.subtotal.includingTax)==null?void 0:we.value,currency:(Ae=e==null?void 0:e.subtotal.includingTax)==null?void 0:Ae.currency}):r(u,{"data-testid":"subtotal",amount:(We=(De=e==null?void 0:e.subtotal)==null?void 0:De.excludingTax)==null?void 0:We.value,currency:(Le=(Be=e==null?void 0:e.subtotal)==null?void 0:Be.excludingTax)==null?void 0:Le.currency})},discounts:(Fe=e==null?void 0:e.appliedDiscounts)==null?void 0:Fe.map(a=>{var c;return{label:a.label,price:r(u,{"data-testid":"summary-discount-total",amount:-a.amount.value,currency:a.amount.currency,sale:!0}),coupon:a!=null&&a.coupon?p("span",{children:[r(ur,{source:br,size:"16"}),(c=a==null?void 0:a.coupon)==null?void 0:c.code]}):void 0}}),taxTotal:_||t&&t.estimatedTaxTotal==null?{price:r("span",{"data-testid":"tax-total-tbd",children:h.taxToBeDetermined})}:{price:t!=null&&t.estimatedTaxTotal?r(u,{"data-testid":"tax-total-estimated",...t==null?void 0:t.estimatedTaxTotal}):r(u,{"data-testid":"tax-total-actual",amount:(Oe=e==null?void 0:e.totalTax)==null?void 0:Oe.value,currency:(Ue=e==null?void 0:e.totalTax)==null?void 0:Ue.currency}),estimated:(!t||!t.estimatedTaxTotal)&&!((Xe=e==null?void 0:e.addresses)!=null&&Xe.shipping)},taxesApplied:_?void 0:s!=null&&s.fullSummary?(Ve=((ze=t==null?void 0:t.estimatedAppliedTaxes)==null?void 0:ze.taxes)||(e==null?void 0:e.appliedTaxes))==null?void 0:Ve.map(a=>({label:a.label,price:r(u,{"data-testid":"applied-taxes",amount:a.amount.value,currency:a.amount.currency})})):void 0,total:{price:t!=null&&t.estimatedGrandTotalPrice?((je=(Ze=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:Ze.includingTax)==null?void 0:je.amount)===0?r("span",{"data-testid":"total-including-tax",children:h.free}):r(u,{"data-testid":"total-including-tax-estimated",...(Qe=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:Qe.includingTax}):(($e=e==null?void 0:e.total)==null?void 0:$e.includingTax.value)===0?r("span",{"data-testid":"total-including-tax",children:h.free}):r(u,{"data-testid":"total-including-tax-actual",amount:(He=e==null?void 0:e.total)==null?void 0:He.includingTax.value,currency:(qe=e==null?void 0:e.total)==null?void 0:qe.includingTax.currency}),estimated:(!t||!!(t!=null&&t.estimatedTaxTotal))&&!((Je=e==null?void 0:e.addresses)!=null&&Je.shipping),priceWithoutTax:s!=null&&s.grandTotal?t!=null&&t.estimatedAppliedTaxes?((Re=(Ke=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:Ke.excludingTax)==null?void 0:Re.amount)===0?r("span",{"data-testid":"total-excluding-tax",children:h.free}):r(u,{"data-testid":"total-excluding-tax",...(Ye=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:Ye.excludingTax}):((Ge=e==null?void 0:e.total)==null?void 0:Ge.excludingTax.value)===0?r("span",{"data-testid":"total-excluding-tax",children:h.free}):r(u,{"data-testid":"total-excluding-tax",amount:(Me=e==null?void 0:e.total)==null?void 0:Me.excludingTax.value,currency:(er=e==null?void 0:e.total)==null?void 0:er.excludingTax.currency}):void 0},primaryAction:w&&r(Ir,{"data-testid":"checkout-button",variant:"primary",disabled:I,"aria-disabled":I,href:I?void 0:w({cartId:e.id}),onClick:Z,children:h.checkout}),totalSaved:b?r(u,{amount:(rr=e==null?void 0:e.discount)==null?void 0:rr.value,currency:(tr=e==null?void 0:e.total)==null?void 0:tr.includingTax.currency}):void 0})};Pr.getInitialData=async function(){return gr()};export{Pr as O}; diff --git a/scripts/__dropins__/storefront-cart/chunks/OrderSummaryLine.js b/scripts/__dropins__/storefront-cart/chunks/OrderSummaryLine.js index ff228c6915..906867fae6 100644 --- a/scripts/__dropins__/storefront-cart/chunks/OrderSummaryLine.js +++ b/scripts/__dropins__/storefront-cart/chunks/OrderSummaryLine.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsxs as _,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{classes as c,VComponent as y}from"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";const u=({label:e,price:a,classSuffixes:s=[],labelClassSuffix:r,testId:m,children:o,...t})=>{const d="cart-order-summary__label",p="cart-order-summary__price";return _("div",{...t,...m?{"data-testid":m}:{},className:c(["cart-order-summary__entry",...s.map(i=>"cart-order-summary__"+i)]),children:[n("span",{className:c([d,...r?[d+"--"+r]:[]]),children:e}),n(y,{node:a,className:c([p,...r?[p+"--"+r]:[]])}),o]})},L=({label:e,price:a,classSuffixes:s=[],labelClassSuffix:r,testId:m,children:o,...t})=>n(u,{...t,label:e,price:a,classSuffixes:s,labelClassSuffix:r,testId:m,children:o});export{L as O}; +import{jsxs as _,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{classes as c,VComponent as y}from"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact-hooks.js";const $=({label:e,price:a,classSuffixes:o=[],labelClassSuffix:r,testId:m,children:s,...t})=>{const p="cart-order-summary__label",d="cart-order-summary__price";return _("div",{...t,...m?{"data-testid":m}:{},className:c(["cart-order-summary__entry",...o.map(i=>`cart-order-summary__${i}`)]),children:[n("span",{className:c([p,...r?[`${p}--${r}`]:[]]),children:e}),n(y,{node:a,className:c([d,...r?[`${d}--${r}`]:[]])}),s]})},L=({label:e,price:a,classSuffixes:o=[],labelClassSuffix:r,testId:m,children:s,...t})=>n($,{...t,label:e,price:a,classSuffixes:o,labelClassSuffix:r,testId:m,children:s});export{L as O}; diff --git a/scripts/__dropins__/storefront-cart/chunks/refreshCart.js b/scripts/__dropins__/storefront-cart/chunks/refreshCart.js index cec71fc643..025c3b0a51 100644 --- a/scripts/__dropins__/storefront-cart/chunks/refreshCart.js +++ b/scripts/__dropins__/storefront-cart/chunks/refreshCart.js @@ -1,10 +1,10 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{s as i,d as A,f as g,h as y}from"./resetCart.js";import{events as l}from"@dropins/tools/event-bus.js";import{Initializer as R,merge as w}from"@dropins/tools/lib.js";import{a as G}from"./persisted-data.js";import{CART_FRAGMENT as d}from"../fragments.js";const I=new R({init:async r=>{const t={disableGuestCart:!1,...r};I.config.setConfig(t),f().catch(console.error)},listeners:()=>[l.on("authenticated",r=>{i.authenticated&&!r?l.emit("cart/reset",void 0):r&&!i.authenticated&&(i.authenticated=r,f().catch(console.error))},{eager:!0}),l.on("locale",async r=>{r!==i.locale&&(i.locale=r,f().catch(console.error))}),l.on("cart/reset",()=>{A().catch(console.error),l.emit("cart/data",null)}),l.on("cart/data",r=>{G(r)}),l.on("checkout/updated",r=>{r&&tr().catch(console.error)})]}),S=I.config;function b(r){var n,e,c,u,s,a,o,_,p,h;if(!r)return null;const t={id:r.id,totalQuantity:z(r),totalUniqueItems:r.itemsV2.items.length,errors:D(r==null?void 0:r.itemsV2),items:v(r==null?void 0:r.itemsV2),miniCartMaxItems:v(r==null?void 0:r.itemsV2).slice(0,((n=i.config)==null?void 0:n.miniCartMaxItemsDisplay)??10),total:{includingTax:{value:r.prices.grand_total.value,currency:r.prices.grand_total.currency},excludingTax:{value:r.prices.grand_total_excluding_tax.value,currency:r.prices.grand_total_excluding_tax.currency}},discount:x(r.prices.discounts,r.prices.grand_total.currency),subtotal:{excludingTax:{value:(e=r.prices.subtotal_excluding_tax)==null?void 0:e.value,currency:(c=r.prices.subtotal_excluding_tax)==null?void 0:c.currency},includingTax:{value:(u=r.prices.subtotal_including_tax)==null?void 0:u.value,currency:(s=r.prices.subtotal_including_tax)==null?void 0:s.currency},includingDiscountOnly:{value:(a=r.prices.subtotal_with_discount_excluding_tax)==null?void 0:a.value,currency:(o=r.prices.subtotal_with_discount_excluding_tax)==null?void 0:o.currency}},appliedTaxes:T(r.prices.applied_taxes),totalTax:x(r.prices.applied_taxes,r.prices.grand_total.currency),appliedDiscounts:T(r.prices.discounts),isVirtual:r.is_virtual,addresses:{shipping:r.shipping_addresses&&Q(r)},isGuestCart:!i.authenticated,hasOutOfStockItems:q(r),hasFullyOutOfStockItems:V(r),appliedCoupons:r.applied_coupons};return w(t,(h=(p=(_=S.getConfig().models)==null?void 0:_.CartModel)==null?void 0:p.transformer)==null?void 0:h.call(p,r))}function x(r,t){return r!=null&&r.length?r.reduce((n,e)=>({value:n.value+e.amount.value,currency:e.amount.currency}),{value:0,currency:t}):{value:0,currency:t}}function k(r,t){var n,e,c,u;return{src:r!=null&&r.useConfigurableParentThumbnail?t.product.thumbnail.url:((e=(n=t.configured_variant)==null?void 0:n.thumbnail)==null?void 0:e.url)||t.product.thumbnail.url,alt:r!=null&&r.useConfigurableParentThumbnail?t.product.thumbnail.label:((u=(c=t.configured_variant)==null?void 0:c.thumbnail)==null?void 0:u.label)||t.product.thumbnail.label}}function U(r){var t,n,e,c;return r.__typename==="ConfigurableCartItem"?{value:(n=(t=r.configured_variant)==null?void 0:t.price_range)==null?void 0:n.maximum_price.regular_price.value,currency:(c=(e=r.configured_variant)==null?void 0:e.price_range)==null?void 0:c.maximum_price.regular_price.currency}:r.__typename==="GiftCardCartItem"?{value:r.prices.price.value,currency:r.prices.price.currency}:{value:r.prices.original_item_price.value,currency:r.prices.original_item_price.currency}}function M(r){var t,n,e;return r.__typename==="ConfigurableCartItem"?((n=(t=r.configured_variant)==null?void 0:t.price_range)==null?void 0:n.maximum_price.discount.amount_off)>0:((e=r.product.price_range)==null?void 0:e.maximum_price.discount.amount_off)>0}function v(r){var n;if(!((n=r==null?void 0:r.items)!=null&&n.length))return[];const t=i.config;return r.items.map(e=>{var c,u,s,a;return{itemType:e.__typename,uid:e.uid,url:{urlKey:e.product.url_key,categories:e.product.categories.map(o=>o.url_key)},canonicalUrl:e.product.canonical_url,categories:e.product.categories.map(o=>o.name),quantity:e.quantity,sku:K(e),topLevelSku:e.product.sku,name:e.product.name,image:k(t,e),price:{value:e.prices.price.value,currency:e.prices.price.currency},taxedPrice:{value:e.prices.price_including_tax.value,currency:e.prices.price_including_tax.currency},fixedProductTaxes:e.prices.fixed_product_taxes,rowTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},rowTotalIncludingTax:{value:e.prices.row_total_including_tax.value,currency:e.prices.row_total_including_tax.currency},links:$(e.links),total:{value:(c=e.prices.original_row_total)==null?void 0:c.value,currency:(u=e.prices.original_row_total)==null?void 0:u.currency},discount:{value:e.prices.total_item_discount.value,currency:e.prices.total_item_discount.currency,label:(s=e.prices.discounts)==null?void 0:s.map(o=>o.label)},regularPrice:U(e),discounted:M(e),bundleOptions:e.__typename==="BundleCartItem"?N(e.bundle_options):null,selectedOptions:P(e.configurable_options),customizableOptions:F(e.customizable_options),sender:e.__typename==="GiftCardCartItem"?e.sender_name:null,senderEmail:e.__typename==="GiftCardCartItem"?e.sender_email:null,recipient:e.__typename==="GiftCardCartItem"?e.recipient_name:null,recipientEmail:e.__typename==="GiftCardCartItem"?e.recipient_email:null,message:e.__typename==="GiftCardCartItem"?e.message:null,discountedTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},onlyXLeftInStock:e.__typename==="ConfigurableCartItem"?(a=e.configured_variant)==null?void 0:a.only_x_left_in_stock:e.product.only_x_left_in_stock,lowInventory:e.is_available&&e.product.only_x_left_in_stock!==null,insufficientQuantity:(e.__typename==="ConfigurableCartItem"?e.configured_variant:e.product).stock_status==="IN_STOCK"&&!e.is_available,outOfStock:e.product.stock_status==="OUT_OF_STOCK",stockLevel:L(e),discountPercentage:X(e),savingsAmount:Y(e),productAttributes:j(e)}})}function D(r){var n;const t=(n=r==null?void 0:r.items)==null?void 0:n.reduce((e,c)=>{var u;return(u=c.errors)==null||u.forEach(s=>{e.push({uid:c.uid,text:s.message})}),e},[]);return t!=null&&t.length?t:null}function T(r){return r!=null&&r.length?r.map(t=>({amount:{value:t.amount.value,currency:t.amount.currency},label:t.label,coupon:t.coupon})):[]}function N(r){const t=r==null?void 0:r.map(e=>({uid:e.uid,label:e.label,value:e.values.map(c=>c.label).join(", ")})),n={};return t==null||t.forEach(e=>{n[e.label]=e.value}),Object.keys(n).length>0?n:null}function P(r){const t=r==null?void 0:r.map(e=>({uid:e.configurable_product_option_uid,label:e.option_label,value:e.value_label})),n={};return t==null||t.forEach(e=>{n[e.label]=e.value}),Object.keys(n).length>0?n:null}function F(r){const t=r==null?void 0:r.map(e=>({uid:e.customizable_option_uid,label:e.label,type:e.type,values:e.values.map(c=>({uid:c.customizable_option_value_uid,label:c.label,value:c.value}))})),n={};return t==null||t.forEach(e=>{var c;switch(e.type){case"field":case"area":case"date_time":n[e.label]=e.values[0].value;break;case"radio":case"drop_down":n[e.label]=e.values[0].label;break;case"multiple":case"checkbox":n[e.label]=e.values.reduce((_,p)=>_?`${_}, ${p.label}`:p.label,"");break;case"file":const u=new DOMParser,s=e.values[0].value,o=((c=u.parseFromString(s,"text/html").querySelector("a"))==null?void 0:c.textContent)||"";n[e.label]=o;break}}),n}function z(r){var t,n;return((t=i.config)==null?void 0:t.cartSummaryDisplayTotal)===0?r.itemsV2.items.length:((n=i.config)==null?void 0:n.cartSummaryDisplayTotal)===1?r.total_quantity:r.itemsV2.items.length}function $(r){return(r==null?void 0:r.length)>0?{count:r.length,result:r.map(t=>t.title).join(", ")}:null}function Q(r){var t,n,e,c;return(t=r.shipping_addresses)!=null&&t.length?(n=r.shipping_addresses)==null?void 0:n.map(u=>({countryCode:u.country.code,zipCode:u.postcode,regionCode:u.region.code})):(e=r.addresses)!=null&&e.length?(c=r.addresses)==null?void 0:c.filter(u=>u.default_shipping).map(u=>{var s;return u.default_shipping&&{countryCode:u.country_code,zipCode:u.postcode,regionCode:(s=u.region)==null?void 0:s.region_code}}):null}function q(r){var t,n;return(n=(t=r==null?void 0:r.itemsV2)==null?void 0:t.items)==null?void 0:n.some(e=>{var c;return((c=e==null?void 0:e.product)==null?void 0:c.stock_status)==="OUT_OF_STOCK"||e.product.stock_status==="IN_STOCK"&&!e.is_available})}function L(r){if(!r.not_available_message)return null;const t=r.not_available_message.match(/-?\d+/);return t?parseInt(t[0]):"noNumber"}function V(r){var t,n;return(n=(t=r==null?void 0:r.itemsV2)==null?void 0:t.items)==null?void 0:n.some(e=>{var c;return((c=e==null?void 0:e.product)==null?void 0:c.stock_status)==="OUT_OF_STOCK"})}function X(r){var n,e,c,u,s,a,o,_;let t;if(r.__typename==="ConfigurableCartItem")t=(u=(c=(e=(n=r==null?void 0:r.configured_variant)==null?void 0:n.price_range)==null?void 0:e.maximum_price)==null?void 0:c.discount)==null?void 0:u.percent_off;else{if(r.__typename==="BundleCartItem")return;t=(_=(o=(a=(s=r==null?void 0:r.product)==null?void 0:s.price_range)==null?void 0:a.maximum_price)==null?void 0:o.discount)==null?void 0:_.percent_off}if(t!==0)return Math.round(t)}function K(r){var t;return r.__typename==="ConfigurableCartItem"?r.configured_variant.sku:((t=r.product)==null?void 0:t.variantSku)||r.product.sku}function Y(r){var e,c,u,s,a,o;let t,n;if(t=((c=(e=r==null?void 0:r.prices)==null?void 0:e.original_row_total)==null?void 0:c.value)-((s=(u=r==null?void 0:r.prices)==null?void 0:u.row_total)==null?void 0:s.value),n=(o=(a=r==null?void 0:r.prices)==null?void 0:a.row_total)==null?void 0:o.currency,t!==0)return{value:t,currency:n}}function j(r){var t,n,e;return(e=(n=(t=r==null?void 0:r.product)==null?void 0:t.custom_attributesV2)==null?void 0:n.items)==null?void 0:e.map(c=>{const u=c.code.split("_").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ");return{...c,code:u}})}function B(r){if(!r)return null;const t=n=>{switch(n){case 1:return"EXCLUDING_TAX";case 2:return"INCLUDING_TAX";case 3:return"INCLUDING_EXCLUDING_TAX";default:return"EXCLUDING_TAX"}};return{displayMiniCart:r.minicart_display,miniCartMaxItemsDisplay:r.minicart_max_items,cartExpiresInDays:r.cart_expires_in_days,cartSummaryDisplayTotal:r.cart_summary_display_quantity,cartSummaryMaxItems:r.max_items_in_order_summary,defaultCountry:r.default_country,categoryFixedProductTaxDisplaySetting:r.category_fixed_product_tax_display_setting,productFixedProductTaxDisplaySetting:r.product_fixed_product_tax_display_setting,salesFixedProductTaxDisplaySetting:r.sales_fixed_product_tax_display_setting,shoppingCartDisplaySetting:{zeroTax:r.shopping_cart_display_zero_tax,subtotal:t(r.shopping_cart_display_subtotal),price:t(r.shopping_cart_display_price),shipping:t(r.shopping_cart_display_shipping),fullSummary:r.shopping_cart_display_full_summary,grandTotal:r.shopping_cart_display_grand_total,taxGiftWrapping:r.shopping_cart_display_tax_gift_wrapping},useConfigurableParentThumbnail:r.configurable_thumbnail_source==="parent"}}const C=` +import{s,d as V,f as h,h as x}from"./resetCart.js";import{events as f}from"@dropins/tools/event-bus.js";import{Initializer as W,merge as Q}from"@dropins/tools/lib.js";import{a as q}from"./persisted-data.js";import{CART_FRAGMENT as S}from"../fragments.js";const P=new W({init:async r=>{const n={disableGuestCart:!1,...r};P.config.setConfig(n),b().catch(console.error)},listeners:()=>[f.on("authenticated",r=>{s.authenticated&&!r?f.emit("cart/reset",void 0):r&&!s.authenticated&&(s.authenticated=r,b().catch(console.error))},{eager:!0}),f.on("locale",async r=>{r!==s.locale&&(s.locale=r,b().catch(console.error))}),f.on("cart/reset",()=>{V().catch(console.error),f.emit("cart/data",null)}),f.on("cart/data",r=>{q(r)}),f.on("checkout/updated",r=>{r&&Cr().catch(console.error)})]}),F=P.config;function w(r){var c,e,u,l,t,a,_,p,g,i,y,d,C,v,m,E;if(!r)return null;const n={appliedGiftCards:((c=r==null?void 0:r.applied_gift_cards)==null?void 0:c.map(o=>({code:o.code??"",appliedBalance:{value:o.applied_balance.value??0,currency:o.applied_balance.currency??"USD"},currentBalance:{value:o.current_balance.value??0,currency:o.current_balance.currency??"USD"},expirationDate:o.expiration_date??""})))??[],id:r.id,totalQuantity:er(r),totalUniqueItems:r.itemsV2.items.length,totalGiftOptions:L((e=r==null?void 0:r.prices)==null?void 0:e.gift_options),giftReceiptIncluded:(r==null?void 0:r.gift_receipt_included)??!1,printedCardIncluded:(r==null?void 0:r.printed_card_included)??!1,cartGiftWrapping:((u=r==null?void 0:r.available_gift_wrappings)==null?void 0:u.map(o=>{var I,U,A,D,R;return{design:o.design??"",uid:o.uid,selected:((I=r==null?void 0:r.gift_wrapping)==null?void 0:I.uid)===o.uid,image:{url:((U=o==null?void 0:o.image)==null?void 0:U.url)??"",label:((A=o.image)==null?void 0:A.label)??""},price:{currency:((D=o==null?void 0:o.price)==null?void 0:D.currency)??"USD",value:((R=o==null?void 0:o.price)==null?void 0:R.value)??0}}}))??[],giftMessage:{senderName:((l=r==null?void 0:r.gift_message)==null?void 0:l.from)??"",recipientName:((t=r==null?void 0:r.gift_message)==null?void 0:t.to)??"",message:((a=r==null?void 0:r.gift_message)==null?void 0:a.message)??""},errors:O(r==null?void 0:r.itemsV2),items:N(r==null?void 0:r.itemsV2),miniCartMaxItems:N(r==null?void 0:r.itemsV2).slice(0,((_=s.config)==null?void 0:_.miniCartMaxItemsDisplay)??10),total:{includingTax:{value:r.prices.grand_total.value,currency:r.prices.grand_total.currency},excludingTax:{value:r.prices.grand_total_excluding_tax.value,currency:r.prices.grand_total_excluding_tax.currency}},discount:M(r.prices.discounts,r.prices.grand_total.currency),subtotal:{excludingTax:{value:(p=r.prices.subtotal_excluding_tax)==null?void 0:p.value,currency:(g=r.prices.subtotal_excluding_tax)==null?void 0:g.currency},includingTax:{value:(i=r.prices.subtotal_including_tax)==null?void 0:i.value,currency:(y=r.prices.subtotal_including_tax)==null?void 0:y.currency},includingDiscountOnly:{value:(d=r.prices.subtotal_with_discount_excluding_tax)==null?void 0:d.value,currency:(C=r.prices.subtotal_with_discount_excluding_tax)==null?void 0:C.currency}},appliedTaxes:k(r.prices.applied_taxes),totalTax:M(r.prices.applied_taxes,r.prices.grand_total.currency),appliedDiscounts:k(r.prices.discounts),isVirtual:r.is_virtual,addresses:{shipping:r.shipping_addresses&&cr(r)},isGuestCart:!s.authenticated,hasOutOfStockItems:ur(r),hasFullyOutOfStockItems:ir(r),appliedCoupons:r.applied_coupons};return Q(n,(E=(m=(v=F.getConfig().models)==null?void 0:v.CartModel)==null?void 0:m.transformer)==null?void 0:E.call(m,r))}function L(r){var n,c,e,u,l,t,a,_,p,g,i,y;return{giftWrappingForItems:{value:((n=r==null?void 0:r.gift_wrapping_for_items)==null?void 0:n.value)??0,currency:((c=r==null?void 0:r.gift_wrapping_for_items)==null?void 0:c.currency)??"USD"},giftWrappingForItemsInclTax:{value:((e=r==null?void 0:r.gift_wrapping_for_items_incl_tax)==null?void 0:e.value)??0,currency:((u=r==null?void 0:r.gift_wrapping_for_items_incl_tax)==null?void 0:u.currency)??"USD"},giftWrappingForOrder:{value:((l=r==null?void 0:r.gift_wrapping_for_order)==null?void 0:l.value)??0,currency:((t=r==null?void 0:r.gift_wrapping_for_order)==null?void 0:t.currency)??"USD"},giftWrappingForOrderInclTax:{value:((a=r==null?void 0:r.gift_wrapping_for_order_incl_tax)==null?void 0:a.value)??0,currency:((_=r==null?void 0:r.gift_wrapping_for_order_incl_tax)==null?void 0:_.currency)??"USD"},printedCard:{value:((p=r==null?void 0:r.printed_card)==null?void 0:p.value)??0,currency:((g=r==null?void 0:r.printed_card)==null?void 0:g.currency)??"USD"},printedCardInclTax:{value:((i=r==null?void 0:r.printed_card_incl_tax)==null?void 0:i.value)??0,currency:((y=r==null?void 0:r.printed_card_incl_tax)==null?void 0:y.currency)??"USD"}}}function M(r,n){return r!=null&&r.length?r.reduce((c,e)=>({value:c.value+e.amount.value,currency:e.amount.currency}),{value:0,currency:n}):{value:0,currency:n}}function X(r,n){var c,e,u,l;return{src:r!=null&&r.useConfigurableParentThumbnail?n.product.thumbnail.url:((e=(c=n.configured_variant)==null?void 0:c.thumbnail)==null?void 0:e.url)||n.product.thumbnail.url,alt:r!=null&&r.useConfigurableParentThumbnail?n.product.thumbnail.label:((l=(u=n.configured_variant)==null?void 0:u.thumbnail)==null?void 0:l.label)||n.product.thumbnail.label}}function B(r){var n,c,e,u;return r.__typename==="ConfigurableCartItem"?{value:(c=(n=r.configured_variant)==null?void 0:n.price_range)==null?void 0:c.maximum_price.regular_price.value,currency:(u=(e=r.configured_variant)==null?void 0:e.price_range)==null?void 0:u.maximum_price.regular_price.currency}:r.__typename==="GiftCardCartItem"?{value:r.prices.price.value,currency:r.prices.price.currency}:{value:r.prices.original_item_price.value,currency:r.prices.original_item_price.currency}}function K(r){var n,c,e;return r.__typename==="ConfigurableCartItem"?((c=(n=r.configured_variant)==null?void 0:n.price_range)==null?void 0:c.maximum_price.discount.amount_off)>0:((e=r.product.price_range)==null?void 0:e.maximum_price.discount.amount_off)>0}function Y(r){var n,c,e;return{senderName:((n=r==null?void 0:r.gift_message)==null?void 0:n.from)??"",recipientName:((c=r==null?void 0:r.gift_message)==null?void 0:c.to)??"",message:((e=r==null?void 0:r.gift_message)==null?void 0:e.message)??""}}function j(r){return{currency:(r==null?void 0:r.currency)??"USD",value:(r==null?void 0:r.value)??0}}function N(r){var c;if(!((c=r==null?void 0:r.items)!=null&&c.length))return[];const n=s.config;return r.items.map(e=>{var u,l,t,a,_,p,g;return{giftWrappingAvailable:((u=e==null?void 0:e.product)==null?void 0:u.gift_wrapping_available)??!1,giftWrappingPrice:j((l=e==null?void 0:e.product)==null?void 0:l.gift_wrapping_price),giftMessage:Y(e),productGiftWrapping:((t=e==null?void 0:e.available_gift_wrapping)==null?void 0:t.map(i=>{var y,d,C,v,m;return{design:i.design??"",uid:i.uid,selected:((y=e.gift_wrapping)==null?void 0:y.uid)===i.uid,image:{url:((d=i==null?void 0:i.image)==null?void 0:d.url)??"",label:((C=i.image)==null?void 0:C.label)??""},price:{currency:((v=i==null?void 0:i.price)==null?void 0:v.currency)??"USD",value:((m=i==null?void 0:i.price)==null?void 0:m.value)??0}}}))??[],itemType:e.__typename,uid:e.uid,giftMessageAvailable:H(e.product.gift_message_available),url:{urlKey:e.product.url_key,categories:e.product.categories.map(i=>i.url_key)},canonicalUrl:e.product.canonical_url,categories:e.product.categories.map(i=>i.name),quantity:e.quantity,sku:sr(e),topLevelSku:e.product.sku,name:e.product.name,image:X(n,e),price:{value:e.prices.price.value,currency:e.prices.price.currency},taxedPrice:{value:e.prices.price_including_tax.value,currency:e.prices.price_including_tax.currency},fixedProductTaxes:e.prices.fixed_product_taxes,rowTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},rowTotalIncludingTax:{value:e.prices.row_total_including_tax.value,currency:e.prices.row_total_including_tax.currency},links:nr(e.links),total:{value:(a=e.prices.original_row_total)==null?void 0:a.value,currency:(_=e.prices.original_row_total)==null?void 0:_.currency},discount:{value:e.prices.total_item_discount.value,currency:e.prices.total_item_discount.currency,label:(p=e.prices.discounts)==null?void 0:p.map(i=>i.label)},regularPrice:B(e),discounted:K(e),bundleOptions:e.__typename==="BundleCartItem"?J(e.bundle_options):null,selectedOptions:Z(e.configurable_options),customizableOptions:rr(e.customizable_options),sender:e.__typename==="GiftCardCartItem"?e.sender_name:null,senderEmail:e.__typename==="GiftCardCartItem"?e.sender_email:null,recipient:e.__typename==="GiftCardCartItem"?e.recipient_name:null,recipientEmail:e.__typename==="GiftCardCartItem"?e.recipient_email:null,message:e.__typename==="GiftCardCartItem"?e.message:null,discountedTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},onlyXLeftInStock:e.__typename==="ConfigurableCartItem"?(g=e.configured_variant)==null?void 0:g.only_x_left_in_stock:e.product.only_x_left_in_stock,lowInventory:e.is_available&&e.product.only_x_left_in_stock!==null,insufficientQuantity:(e.__typename==="ConfigurableCartItem"?e.configured_variant:e.product).stock_status==="IN_STOCK"&&!e.is_available,outOfStock:e.product.stock_status==="OUT_OF_STOCK",stockLevel:lr(e),discountPercentage:tr(e),savingsAmount:or(e),productAttributes:_r(e)}})}function H(r){switch(+r){case 0:return!1;case 1:return!0;case 2:return null;default:return!1}}function O(r){var c;const n=(c=r==null?void 0:r.items)==null?void 0:c.reduce((e,u)=>{var l;return(l=u.errors)==null||l.forEach(t=>{e.push({uid:u.uid,text:t.message})}),e},[]);return n!=null&&n.length?n:null}function k(r){return r!=null&&r.length?r.map(n=>({amount:{value:n.amount.value,currency:n.amount.currency},label:n.label,coupon:n.coupon})):[]}function J(r){const n=r==null?void 0:r.map(e=>({uid:e.uid,label:e.label,value:e.values.map(u=>u.label).join(", ")})),c={};return n==null||n.forEach(e=>{c[e.label]=e.value}),Object.keys(c).length>0?c:null}function Z(r){const n=r==null?void 0:r.map(e=>({uid:e.configurable_product_option_uid,label:e.option_label,value:e.value_label})),c={};return n==null||n.forEach(e=>{c[e.label]=e.value}),Object.keys(c).length>0?c:null}function rr(r){const n=r==null?void 0:r.map(e=>({uid:e.customizable_option_uid,label:e.label,type:e.type,values:e.values.map(u=>({uid:u.customizable_option_value_uid,label:u.label,value:u.value}))})),c={};return n==null||n.forEach(e=>{var u;switch(e.type){case"field":case"area":case"date_time":c[e.label]=e.values[0].value;break;case"radio":case"drop_down":c[e.label]=e.values[0].label;break;case"multiple":case"checkbox":c[e.label]=e.values.reduce((p,g)=>p?`${p}, ${g.label}`:g.label,"");break;case"file":const l=new DOMParser,t=e.values[0].value,_=((u=l.parseFromString(t,"text/html").querySelector("a"))==null?void 0:u.textContent)||"";c[e.label]=_;break}}),c}function er(r){var n,c;return((n=s.config)==null?void 0:n.cartSummaryDisplayTotal)===0?r.itemsV2.items.length:((c=s.config)==null?void 0:c.cartSummaryDisplayTotal)===1?r.total_quantity:r.itemsV2.items.length}function nr(r){return(r==null?void 0:r.length)>0?{count:r.length,result:r.map(n=>n.title).join(", ")}:null}function cr(r){var n,c,e,u;return(n=r.shipping_addresses)!=null&&n.length?(c=r.shipping_addresses)==null?void 0:c.map(l=>({countryCode:l.country.code,zipCode:l.postcode,regionCode:l.region.code})):(e=r.addresses)!=null&&e.length?(u=r.addresses)==null?void 0:u.filter(l=>l.default_shipping).map(l=>{var t;return l.default_shipping&&{countryCode:l.country_code,zipCode:l.postcode,regionCode:(t=l.region)==null?void 0:t.region_code}}):null}function ur(r){var n,c;return(c=(n=r==null?void 0:r.itemsV2)==null?void 0:n.items)==null?void 0:c.some(e=>{var u;return((u=e==null?void 0:e.product)==null?void 0:u.stock_status)==="OUT_OF_STOCK"||e.product.stock_status==="IN_STOCK"&&!e.is_available})}function lr(r){if(!r.not_available_message)return null;const n=r.not_available_message.match(/-?\d+/);return n?parseInt(n[0]):"noNumber"}function ir(r){var n,c;return(c=(n=r==null?void 0:r.itemsV2)==null?void 0:n.items)==null?void 0:c.some(e=>{var u;return((u=e==null?void 0:e.product)==null?void 0:u.stock_status)==="OUT_OF_STOCK"})}function tr(r){var c,e,u,l,t,a,_,p;let n;if(r.__typename==="ConfigurableCartItem")n=(l=(u=(e=(c=r==null?void 0:r.configured_variant)==null?void 0:c.price_range)==null?void 0:e.maximum_price)==null?void 0:u.discount)==null?void 0:l.percent_off;else{if(r.__typename==="BundleCartItem")return;n=(p=(_=(a=(t=r==null?void 0:r.product)==null?void 0:t.price_range)==null?void 0:a.maximum_price)==null?void 0:_.discount)==null?void 0:p.percent_off}if(n!==0)return Math.round(n)}function sr(r){var n;return r.__typename==="ConfigurableCartItem"?r.configured_variant.sku:((n=r.product)==null?void 0:n.variantSku)||r.product.sku}function or(r){var e,u,l,t,a,_;let n,c;if(n=((u=(e=r==null?void 0:r.prices)==null?void 0:e.original_row_total)==null?void 0:u.value)-((t=(l=r==null?void 0:r.prices)==null?void 0:l.row_total)==null?void 0:t.value),c=(_=(a=r==null?void 0:r.prices)==null?void 0:a.row_total)==null?void 0:_.currency,n!==0)return{value:n,currency:c}}function _r(r){var n,c,e;return(e=(c=(n=r==null?void 0:r.product)==null?void 0:n.custom_attributesV2)==null?void 0:c.items)==null?void 0:e.map(u=>{const l=u.code.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ");return{...u,code:l}})}function ar(r){var e,u;if(!r)return null;const n=l=>{switch(l){case 1:return"EXCLUDING_TAX";case 2:return"INCLUDING_TAX";case 3:return"INCLUDING_EXCLUDING_TAX";default:return"EXCLUDING_TAX"}},c=l=>{switch(+l){case 0:return!1;case 1:return!0;case 2:return null;default:return!1}};return{displayMiniCart:r.minicart_display,miniCartMaxItemsDisplay:r.minicart_max_items,cartExpiresInDays:r.cart_expires_in_days,cartSummaryDisplayTotal:r.cart_summary_display_quantity,cartSummaryMaxItems:r.max_items_in_order_summary,defaultCountry:r.default_country,categoryFixedProductTaxDisplaySetting:r.category_fixed_product_tax_display_setting,productFixedProductTaxDisplaySetting:r.product_fixed_product_tax_display_setting,salesFixedProductTaxDisplaySetting:r.sales_fixed_product_tax_display_setting,shoppingCartDisplaySetting:{zeroTax:r.shopping_cart_display_zero_tax,subtotal:n(r.shopping_cart_display_subtotal),price:n(r.shopping_cart_display_price),shipping:n(r.shopping_cart_display_shipping),fullSummary:r.shopping_cart_display_full_summary,grandTotal:r.shopping_cart_display_grand_total,taxGiftWrapping:r.shopping_cart_display_tax_gift_wrapping},useConfigurableParentThumbnail:r.configurable_thumbnail_source==="parent",allowGiftWrappingOnOrder:c(r==null?void 0:r.allow_gift_wrapping_on_order),allowGiftWrappingOnOrderItems:c(r==null?void 0:r.allow_gift_wrapping_on_order_items),allowGiftMessageOnOrder:c(r==null?void 0:r.allow_order),allowGiftMessageOnOrderItems:c(r==null?void 0:r.allow_items),allowGiftReceipt:!!+(r==null?void 0:r.allow_gift_receipt),allowPrintedCard:!!+(r==null?void 0:r.allow_printed_card),printedCardPrice:{currency:((e=r==null?void 0:r.printed_card_priceV2)==null?void 0:e.currency)??"",value:((u=r==null?void 0:r.printed_card_priceV2)==null?void 0:u.value)!=null?+r.printed_card_priceV2.value:0},cartGiftWrapping:n(+r.cart_gift_wrapping),cartPrintedCard:n(+r.cart_printed_card)}}const G=` $pageSize: Int! = 100, $currentPage: Int! = 1, $itemsSortInput: QuoteItemsSortInput! = {field: CREATED_AT, order: DESC} -`,H=` +`,pr=` fragment CUSTOMER_FRAGMENT on Customer { addresses { default_shipping @@ -17,10 +17,10 @@ import{s as i,d as A,f as g,h as y}from"./resetCart.js";import{events as l}from" } } } -`,W=` +`,gr=` query GUEST_CART_QUERY( $cartId: String!, - ${C} + ${G} ) { cart(cart_id: $cartId){ @@ -28,10 +28,10 @@ import{s as i,d as A,f as g,h as y}from"./resetCart.js";import{events as l}from" } } - ${d} -`,J=` + ${S} +`,fr=` query CUSTOMER_CART_QUERY( - ${C} + ${G} ) { customer { @@ -43,13 +43,13 @@ import{s as i,d as A,f as g,h as y}from"./resetCart.js";import{events as l}from" } } - ${H} - ${d} -`,m=async()=>{const r=i.authenticated,t=i.cartId;if(r)return g(J,{method:"POST"}).then(({errors:n,data:e})=>{if(n)return y(n);const c={...e.cart,...e.customer};return b(c)});if(!t)throw new Error("No cart ID found");return g(W,{method:"POST",cache:"no-cache",variables:{cartId:t}}).then(({errors:n,data:e})=>n?y(n):b(e.cart))},Z=` + ${pr} + ${S} +`,T=async()=>{const r=s.authenticated,n=s.cartId;if(r)return h(fr,{method:"POST"}).then(({errors:c,data:e})=>{if(c)return x(c);const u={...e.cart,...e.customer};return w(u)});if(!n)throw new Error("No cart ID found");return h(gr,{method:"POST",cache:"no-cache",variables:{cartId:n}}).then(({errors:c,data:e})=>c?x(c):w(e.cart))},yr=` mutation MERGE_CARTS_MUTATION( $guestCartId: String!, $customerCartId: String!, - ${C} + ${G} ) { mergeCarts( source_cart_id: $guestCartId, @@ -59,13 +59,13 @@ import{s as i,d as A,f as g,h as y}from"./resetCart.js";import{events as l}from" } } - ${d} -`,f=async()=>{if(i.initializing)return null;i.initializing=!0,i.config||(i.config=await er());const r=i.authenticated?await E():await O();return l.emit("cart/initialized",r),l.emit("cart/data",r),i.initializing=!1,r};async function E(){const r=i.cartId,t=await m();return t?(i.cartId=t.id,!r||t.id===r?t:await g(Z,{variables:{guestCartId:r,customerCartId:t.id}}).then(()=>m()).then(n=>{const e={oldCartItems:t.items,newCart:n};return l.emit("cart/merged",e),n}).catch(()=>(console.error("Could not merge carts"),t))):null}async function O(){if(S.getConfig().disableGuestCart===!0||!i.cartId)return null;try{return await m()}catch(r){return console.error(r),null}}const rr=` + ${S} +`,b=async()=>{if(s.initializing)return null;s.initializing=!0,s.config||(s.config=await dr());const r=s.authenticated?await z():await $();return f.emit("cart/initialized",r),f.emit("cart/data",r),s.initializing=!1,r};async function z(){const r=s.cartId,n=await T();return n?(s.cartId=n.id,!r||n.id===r?n:await h(yr,{variables:{guestCartId:r,customerCartId:n.id}}).then(()=>T()).then(c=>{const e={oldCartItems:n.items,newCart:c};return f.emit("cart/merged",e),c}).catch(()=>(console.error("Could not merge carts"),n))):null}async function $(){if(F.getConfig().disableGuestCart===!0||!s.cartId)return null;try{return await T()}catch(r){return console.error(r),null}}const mr=` query STORE_CONFIG_QUERY { storeConfig { - minicart_display + minicart_display minicart_max_items - cart_expires_in_days + cart_expires_in_days cart_summary_display_quantity max_items_in_order_summary default_country @@ -80,6 +80,18 @@ query STORE_CONFIG_QUERY { shopping_cart_display_tax_gift_wrapping shopping_cart_display_zero_tax configurable_thumbnail_source + allow_gift_wrapping_on_order + allow_gift_wrapping_on_order_items + allow_order + allow_items + allow_gift_receipt + allow_printed_card + printed_card_priceV2 { + currency + value + } + cart_gift_wrapping + cart_printed_card } } -`,er=async()=>g(rr,{method:"GET",cache:"force-cache"}).then(({errors:r,data:t})=>r?y(r):B(t.storeConfig)),tr=async()=>{const r=i.authenticated?await E():await O();return l.emit("cart/data",r),r};export{C,f as a,E as b,S as c,O as d,er as e,m as g,I as i,tr as r,b as t}; +`,dr=async()=>h(mr,{method:"GET",cache:"force-cache"}).then(({errors:r,data:n})=>r?x(r):ar(n.storeConfig)),Cr=async()=>{const r=s.authenticated?await z():await $();return f.emit("cart/data",r),r};export{G as C,b as a,z as b,F as c,$ as d,dr as e,T as g,P as i,Cr as r,w as t}; diff --git a/scripts/__dropins__/storefront-cart/chunks/removeGiftCardFromCart.js b/scripts/__dropins__/storefront-cart/chunks/removeGiftCardFromCart.js new file mode 100644 index 0000000000..1f78904b20 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/chunks/removeGiftCardFromCart.js @@ -0,0 +1,31 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import{s as i,f as n,h as _}from"./resetCart.js";import{C as d,t as T}from"./refreshCart.js";import{events as C}from"@dropins/tools/event-bus.js";import{a as f}from"./acdl.js";import{CART_FRAGMENT as A}from"../fragments.js";const m=` + mutation APPLY_GIFT_CARD_ON_CART_MUTATION($cartId: String!, $giftCardCode: String!, ${d}) { + applyGiftCardToCart( + input: { + cart_id: $cartId + gift_card_code: $giftCardCode + } + ) { + cart { + ...CART_FRAGMENT + } + } +} +${A} +`,N=async c=>{const a=i.cartId;if(!a)throw Error("Cart ID is not set");return n(m,{variables:{cartId:a,giftCardCode:c}}).then(({errors:s,data:t})=>{var e;const o=[...((e=t==null?void 0:t.applyGiftCardToCart)==null?void 0:e.user_errors)??[],...s??[]];if(o.length>0)return _(o);const r=T(t.applyGiftCardToCart.cart);return C.emit("cart/updated",r),C.emit("cart/data",r),r&&f(r,[],i.locale??"en-US"),r})},p=` + mutation REMOVE_GIFT_CARD_ON_CART_MUTATION($cartId: String!, $giftCardCode: String!, ${d}) { + removeGiftCardFromCart( + input: { + cart_id: $cartId + gift_card_code: $giftCardCode + } + ) { + cart { + ...CART_FRAGMENT + } + } +} +${A} +`,E=async c=>{const a=i.cartId;if(!a)throw Error("Cart ID is not set");return n(p,{variables:{cartId:a,giftCardCode:c}}).then(({errors:s,data:t})=>{var e;const o=[...((e=t==null?void 0:t.addProductsToCart)==null?void 0:e.user_errors)??[],...s??[]];if(o.length>0)return _(o);const r=T(t.removeGiftCardFromCart.cart);return C.emit("cart/updated",r),C.emit("cart/data",r),r&&f(r,[],i.locale??"en-US"),r})};export{N as a,E as r}; diff --git a/scripts/__dropins__/storefront-cart/chunks/setGiftOptionsOnCart.js b/scripts/__dropins__/storefront-cart/chunks/setGiftOptionsOnCart.js new file mode 100644 index 0000000000..2f8d1b7af8 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/chunks/setGiftOptionsOnCart.js @@ -0,0 +1,20 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import{s as a,f as T,h as m}from"./resetCart.js";import{C as u,t as C}from"./refreshCart.js";import{events as s}from"@dropins/tools/event-bus.js";import{a as O}from"./acdl.js";import{CART_FRAGMENT as N}from"../fragments.js";const A=` + mutation SET_GIFT_OPTIONS_ON_CART_MUTATION($cartId: String!, $giftMessage: GiftMessageInput, $giftWrappingId: ID, $giftReceiptIncluded: Boolean!, $printedCardIncluded: Boolean!, ${u}) { + setGiftOptionsOnCart( + input: { + cart_id: $cartId + gift_message: $giftMessage + gift_wrapping_id: $giftWrappingId + gift_receipt_included: $giftReceiptIncluded + printed_card_included: $printedCardIncluded + } + ) { + cart { + ...CART_FRAGMENT + } + } +} +${N} +`,E=async d=>{const e=a.cartId;if(!e)throw Error("Cart ID is not set");const{recipientName:o,senderName:p,message:c,giftReceiptIncluded:f,printedCardIncluded:g,giftWrappingId:I,isGiftWrappingSelected:_}=d;return T(A,{variables:{cartId:e,giftMessage:{from:p,to:o,message:c},giftWrappingId:_?I:null,giftReceiptIncluded:f,printedCardIncluded:g}}).then(({errors:l,data:r})=>{var n;const i=[...((n=r==null?void 0:r.addProductsToCart)==null?void 0:n.user_errors)??[],...l??[]];if(i.length>0)return m(i);const t=C(r.setGiftOptionsOnCart.cart);return s.emit("cart/updated",t),s.emit("cart/data",t),t&&O(t,[],a.locale??"en-US"),t})};export{E as s}; diff --git a/scripts/__dropins__/storefront-cart/chunks/updateProductsFromCart.js b/scripts/__dropins__/storefront-cart/chunks/updateProductsFromCart.js index 1293945268..05a57fe684 100644 --- a/scripts/__dropins__/storefront-cart/chunks/updateProductsFromCart.js +++ b/scripts/__dropins__/storefront-cart/chunks/updateProductsFromCart.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{s as m,f as i,h as T}from"./resetCart.js";import{C as _,t as p}from"./refreshCart.js";import{events as n}from"@dropins/tools/event-bus.js";import{a as I}from"./acdl.js";import{CART_FRAGMENT as u}from"../fragments.js";const C=` +import{s as m,f as i,h as p}from"./resetCart.js";import{C as _,t as I}from"./refreshCart.js";import{events as n}from"@dropins/tools/event-bus.js";import{a as T}from"./acdl.js";import{CART_FRAGMENT as u}from"../fragments.js";const C=` mutation UPDATE_PRODUCTS_FROM_CART_MUTATION( $cartId: String!, $cartItems: [CartItemUpdateInput!]!, @@ -9,7 +9,7 @@ import{s as m,f as i,h as T}from"./resetCart.js";import{C as _,t as p}from"./ref updateCartItems( input: { cart_id: $cartId - cart_items: $cartItems + cart_items: $cartItems } ) { cart { @@ -18,6 +18,6 @@ import{s as m,f as i,h as T}from"./resetCart.js";import{C as _,t as p}from"./ref } } - + ${u} -`,h=async e=>{const s=m.cartId;if(!s)throw Error("Cart ID is not set");return i(C,{variables:{cartId:s,cartItems:e.map(({uid:a,quantity:t})=>({cart_item_uid:a,quantity:t}))}}).then(({errors:a,data:t})=>{var c;const o=[...((c=t==null?void 0:t.addProductsToCart)==null?void 0:c.user_errors)??[],...a??[]];if(o.length>0)return T(o);const r=p(t.updateCartItems.cart);return n.emit("cart/updated",r),n.emit("cart/data",r),r&&I(r,e,m.locale??"en-US"),r})};export{h as u}; +`,h=async s=>{const o=m.cartId;if(!o)throw Error("Cart ID is not set");return i(C,{variables:{cartId:o,cartItems:s.map(({uid:e,quantity:t,giftOptions:a})=>({cart_item_uid:e,quantity:t,...a}))}}).then(({errors:e,data:t})=>{var c;const a=[...((c=t==null?void 0:t.updateCartItems)==null?void 0:c.user_errors)??[],...e??[]];if(a.length>0)return p(a);const r=I(t.updateCartItems.cart);return n.emit("cart/updated",r),n.emit("cart/data",r),r&&T(r,s,m.locale??"en-US"),r})};export{h as u}; diff --git a/scripts/__dropins__/storefront-cart/components/Coupons/Coupons.d.ts b/scripts/__dropins__/storefront-cart/components/Coupons/Coupons.d.ts index 5545aa5f07..0f153fcee6 100644 --- a/scripts/__dropins__/storefront-cart/components/Coupons/Coupons.d.ts +++ b/scripts/__dropins__/storefront-cart/components/Coupons/Coupons.d.ts @@ -2,6 +2,8 @@ import { FunctionComponent, VNode } from 'preact'; import { HTMLAttributes } from 'preact/compat'; export interface CouponsProps extends HTMLAttributes { + accordionSectionTitle?: string; + accordionSectionIcon?: string; couponCodeField?: VNode>; applyCouponsButton?: VNode>; appliedCoupons?: VNode>; diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/CheckboxGroup.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/CheckboxGroup.d.ts new file mode 100644 index 0000000000..8aa586f106 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/CheckboxGroup.d.ts @@ -0,0 +1,20 @@ +import { FunctionComponent } from 'preact'; +import { GiftOptionsViewProps, GiftWrappingConfigProps, GiftFormDataType, ProductGiftOptionsConfig } from '../../../types'; +import { CartModel, Item } from '../../../data/models'; +import { StateUpdater, Dispatch } from 'preact/hooks'; + +interface CheckboxGroupProps { + className: string; + view: GiftOptionsViewProps; + item: Item | ProductGiftOptionsConfig; + giftOptions: GiftFormDataType; + disabled: boolean; + cartData: CartModel | null; + giftWrappingConfig: GiftWrappingConfigProps[] | []; + areGiftOptionsVisible: Record; + setShowModal: Dispatch>; + onInputChange: (event: Event) => void; +} +export declare const CheckboxGroup: FunctionComponent; +export {}; +//# sourceMappingURL=CheckboxGroup.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/FormFields.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/FormFields.d.ts new file mode 100644 index 0000000000..31ec88dbd0 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/FormFields.d.ts @@ -0,0 +1,15 @@ +import { FunctionComponent } from 'preact'; +import { GiftOptionsViewProps, GiftFormDataType } from '../../../types'; + +interface FormFieldsProps { + view: GiftOptionsViewProps; + giftOptions: GiftFormDataType; + disabled: boolean; + errorMessage: Record; + onInputChange: (value: Event) => void; + onBlur: (event: Event) => void; + isGiftMessageVisible: boolean; +} +export declare const FormFields: FunctionComponent; +export {}; +//# sourceMappingURL=FormFields.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/GiftLoader.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/GiftLoader.d.ts new file mode 100644 index 0000000000..883e14f4b8 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/GiftLoader.d.ts @@ -0,0 +1,4 @@ +import { FunctionComponent } from 'preact'; + +export declare const GiftLoader: FunctionComponent; +//# sourceMappingURL=GiftLoader.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/GiftOptionModal.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/GiftOptionModal.d.ts new file mode 100644 index 0000000000..27457df618 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/GiftOptionModal.d.ts @@ -0,0 +1,14 @@ +import { FunctionComponent } from 'preact'; +import { GiftWrappingConfigProps, GiftOptionsViewProps } from '../../../types'; + +interface GiftOptionModalProps { + giftWrappingConfig: GiftWrappingConfigProps[]; + showModal: boolean; + productName: string; + view: GiftOptionsViewProps; + setShowModal: () => void; + updateGiftOptions: (name: string, value?: string | boolean | number, extraGiftOptions?: Record) => void; +} +export declare const GiftOptionModal: FunctionComponent; +export {}; +//# sourceMappingURL=GiftOptionModal.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/ReadOnlyFormView.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/ReadOnlyFormView.d.ts new file mode 100644 index 0000000000..04312ae2f7 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/ReadOnlyFormView.d.ts @@ -0,0 +1,11 @@ +import { FunctionComponent } from 'preact'; +import { GiftFormDataType, GiftWrappingConfigProps, GiftOptionsReadOnlyViewProps, GiftOptionsViewProps } from '../../../types'; + +export interface ReadOnlyFormViewProps { + view: GiftOptionsViewProps; + giftOptions: GiftFormDataType; + readOnlyFormOrderView: GiftOptionsReadOnlyViewProps; + giftWrappingConfig: GiftWrappingConfigProps[] | []; +} +export declare const ReadOnlyFormView: FunctionComponent; +//# sourceMappingURL=ReadOnlyFormView.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/index.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/index.d.ts new file mode 100644 index 0000000000..ac11048437 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/Elements/index.d.ts @@ -0,0 +1,5 @@ +export { GiftLoader } from './GiftLoader'; +export { GiftOptionItem } from './GiftOptionItem'; +export { GiftOptionModal } from './GiftOptionModal'; +export { ReadOnlyFormView } from './ReadOnlyFormView'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/GiftOptions.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/GiftOptions.d.ts new file mode 100644 index 0000000000..12b3833ad9 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/GiftOptions.d.ts @@ -0,0 +1,29 @@ +import { StateUpdater, Dispatch } from 'preact/hooks'; +import { FunctionComponent } from 'preact'; +import { GiftWrappingConfigProps, GiftOptionsViewProps, GiftFormDataType, GiftOptionsReadOnlyViewProps, ProductGiftOptionsConfig } from '../../types'; +import { CartModel, Item } from '../../data/models'; + +export interface GiftOptionsProps { + readOnlyFormOrderView: GiftOptionsReadOnlyViewProps; + cartData: CartModel | null; + errorsField: Record; + isGiftMessageVisible: boolean; + fieldsDisabled: boolean; + loading: boolean; + showModal: boolean; + isEditable: boolean; + isGiftOptionsApplied: boolean; + updateLoading: boolean; + areGiftOptionsVisible: Record; + view: GiftOptionsViewProps; + giftOptions: GiftFormDataType; + item: Item | ProductGiftOptionsConfig; + giftWrappingConfig: GiftWrappingConfigProps[] | []; + updateGiftOptions: (name: string, value?: string | boolean | number, extraGiftOptions?: Record) => void; + setShowModal: Dispatch>; + handleFormMouseLeave: () => void; + onInputChange: (event: Event) => void; + onBlur: (event: Event) => void; +} +export declare const GiftOptions: FunctionComponent; +//# sourceMappingURL=GiftOptions.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/GiftOptions/index.d.ts b/scripts/__dropins__/storefront-cart/components/GiftOptions/index.d.ts new file mode 100644 index 0000000000..1c1235e627 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/components/GiftOptions/index.d.ts @@ -0,0 +1,19 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './GiftOptions'; +export { GiftOptions as default } from '.'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/components/MiniCart/MiniCart.d.ts b/scripts/__dropins__/storefront-cart/components/MiniCart/MiniCart.d.ts index 0fb967cb17..a8dd8955e6 100644 --- a/scripts/__dropins__/storefront-cart/components/MiniCart/MiniCart.d.ts +++ b/scripts/__dropins__/storefront-cart/components/MiniCart/MiniCart.d.ts @@ -3,8 +3,10 @@ import { HTMLAttributes } from 'preact/compat'; export interface MiniCartProps extends HTMLAttributes { products?: VNode; + productListFooter?: VNode; subtotal?: VNode; subtotalExcludingTaxes?: VNode; + preCheckoutSection?: VNode; ctas?: VNode; } export declare const MiniCart: FunctionComponent; diff --git a/scripts/__dropins__/storefront-cart/components/OrderSummary/OrderSummary.d.ts b/scripts/__dropins__/storefront-cart/components/OrderSummary/OrderSummary.d.ts index d2e5c81be4..0deb17e940 100644 --- a/scripts/__dropins__/storefront-cart/components/OrderSummary/OrderSummary.d.ts +++ b/scripts/__dropins__/storefront-cart/components/OrderSummary/OrderSummary.d.ts @@ -40,9 +40,36 @@ export interface OrderSummaryProps extends Omit, estimated?: boolean; priceWithoutTax?: VNode>; }; + printedCard?: { + renderContent: boolean; + taxIncluded: boolean; + taxInclAndExcl: boolean; + priceExclTax: VNode>; + priceInclTax: VNode>; + }; + itemsGiftWrapping?: { + renderContent: boolean; + taxIncluded: boolean; + taxInclAndExcl: boolean; + priceExclTax: VNode>; + priceInclTax: VNode>; + }; + orderGiftWrapping?: { + renderContent: boolean; + taxIncluded: boolean; + taxInclAndExcl: boolean; + priceExclTax: VNode>; + priceInclTax: VNode>; + }; primaryAction?: VNode>; coupons?: VNode>; + giftCards?: VNode>; totalSaved?: VNode>; + appliedGiftCards?: { + label: VNode> | string; + price: VNode>; + content?: VNode[]; + }; updateLineItems?: (lineItems: Array) => Array; } export declare const OrderSummary: FunctionComponent; diff --git a/scripts/__dropins__/storefront-cart/components/OrderSummaryLine/OrderSummaryLine.d.ts b/scripts/__dropins__/storefront-cart/components/OrderSummaryLine/OrderSummaryLine.d.ts index 7fcd5f8b29..3bf933de60 100644 --- a/scripts/__dropins__/storefront-cart/components/OrderSummaryLine/OrderSummaryLine.d.ts +++ b/scripts/__dropins__/storefront-cart/components/OrderSummaryLine/OrderSummaryLine.d.ts @@ -1,8 +1,8 @@ import { HTMLAttributes } from 'preact/compat'; import { FunctionComponent, VNode } from 'preact'; -export interface OrderSummaryLineComponentProps extends HTMLAttributes { - label: string; +export interface OrderSummaryLineComponentProps extends Omit, 'label'> { + label: VNode | string; price: VNode>; classSuffixes?: Array; labelClassSuffix?: string; diff --git a/scripts/__dropins__/storefront-cart/components/index.d.ts b/scripts/__dropins__/storefront-cart/components/index.d.ts index f7b8e06766..ddc675194b 100644 --- a/scripts/__dropins__/storefront-cart/components/index.d.ts +++ b/scripts/__dropins__/storefront-cart/components/index.d.ts @@ -22,4 +22,5 @@ export * from './CartSummaryList'; export * from './OrderSummary'; export * from './Coupons'; export * from './OrderSummaryLine'; +export * from './GiftOptions'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/containers/CartSummaryGrid.js b/scripts/__dropins__/storefront-cart/containers/CartSummaryGrid.js index 959dca7748..ca5168544d 100644 --- a/scripts/__dropins__/storefront-cart/containers/CartSummaryGrid.js +++ b/scripts/__dropins__/storefront-cart/containers/CartSummaryGrid.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{C as s,C as u}from"../chunks/CartSummaryGrid.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"../chunks/EmptyCart.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";export{s as CartSummaryGrid,u as default}; +import{C as u,C as l}from"../chunks/CartSummaryGrid.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"../chunks/EmptyCart.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";export{u as CartSummaryGrid,l as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/CartSummaryList.js b/scripts/__dropins__/storefront-cart/containers/CartSummaryList.js index c79dac202e..2f64a7d857 100644 --- a/scripts/__dropins__/storefront-cart/containers/CartSummaryList.js +++ b/scripts/__dropins__/storefront-cart/containers/CartSummaryList.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{C as b,C as c}from"../chunks/CartSummaryList.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"../chunks/EmptyCart.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/i18n.js";import"../chunks/persisted-data.js";import"@dropins/tools/event-bus.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/updateProductsFromCart.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"../chunks/ChevronDown.js";export{b as CartSummaryList,c as default}; +import{C as c,C as g}from"../chunks/CartSummaryList.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"../chunks/EmptyCart.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";import"../chunks/persisted-data.js";import"@dropins/tools/event-bus.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/updateProductsFromCart.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"../chunks/ChevronDown.js";export{c as CartSummaryList,g as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/Coupons.js b/scripts/__dropins__/storefront-cart/containers/Coupons.js index a00d1157ae..3ad869fa6b 100644 --- a/scripts/__dropins__/storefront-cart/containers/Coupons.js +++ b/scripts/__dropins__/storefront-cart/containers/Coupons.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as o,jsxs as A}from"@dropins/tools/preact-jsx-runtime.js";import*as n from"@dropins/tools/preact-compat.js";import{useRef as P,useState as E,useEffect as y}from"@dropins/tools/preact-compat.js";import{classes as a,VComponent as w,getFormValues as I}from"@dropins/tools/lib.js";import{Accordion as M,AccordionSection as b,Button as k,Icon as R,Input as T}from"@dropins/tools/components.js";/* empty css */import{S as j}from"../chunks/Coupon.js";import{useText as B}from"@dropins/tools/i18n.js";import"../chunks/resetCart.js";import{events as L}from"@dropins/tools/event-bus.js";import{a as x,A as N}from"../chunks/applyCouponsToCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/persisted-data.js";import"../chunks/refreshCart.js";import"../fragments.js";const z=s=>n.createElement("svg",{id:"Icon_Add_Base","data-name":"Icon \\u2013 Add \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...s},n.createElement("g",{id:"Large"},n.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),n.createElement("g",{id:"Add_icon","data-name":"Add icon",transform:"translate(9.734 9.737)"},n.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_579","data-name":"Line 579",y2:12.7,transform:"translate(2.216 -4.087)",fill:"none",stroke:"currentColor"}),n.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_580","data-name":"Line 580",x2:12.7,transform:"translate(-4.079 2.263)",fill:"none",stroke:"currentColor"})))),q=s=>n.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},n.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),n.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),D=s=>n.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},n.createElement("path",{d:"M17.3332 11.75H6.6665",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke",fill:"none",stroke:"currentColor"})),V=({className:s,children:_,couponCodeField:f,applyCouponsButton:p,appliedCoupons:u,error:h,onApplyCoupon:d,...r})=>{const c=P(null),g=B({couponTitle:"Cart.PriceSummary.coupon.title"}),C=v=>{var t;v.preventDefault();const S=I(c.current);d==null||d(S);const e=(t=c==null?void 0:c.current)==null?void 0:t.querySelector("input");e&&(e.value="")};return o("div",{...r,"data-testid":"cart-coupons",className:a(["cart-coupons",s]),children:o(M,{"data-testid":"coupon-code",className:a(["cart-coupons__accordion"]),actionIconPosition:"right",iconOpen:z,iconClose:D,children:A(b,{title:g.couponTitle,iconLeft:j,showIconLeft:!0,renderContentWhenClosed:!1,"data-testid":"coupon-code-accordion-section",className:a(["cart-coupons__accordion-section"]),children:[o("form",{"data-testid":"coupon-code-form",className:a(["coupon-code-form--edit"]),ref:c,children:A("div",{className:a(["coupon-code-form__action"]),children:[f&&o(w,{node:f,className:a(["coupon-code-form__codes"])}),p&&o(w,{node:p,className:a(["coupon-code-form--button"]),onClick:C,type:"submit"})]})}),h&&o(w,{node:h,className:a(["coupon-code-form__error"])}),u&&o(w,{node:u,className:a(["coupon-code-form__applied"])})]})})})},oe=({children:s,..._})=>{const[f,p]=E(new Set),[u,h]=E([]),[d,r]=E(new Set),c=B({applyButton:"Cart.PriceSummary.coupon.applyAction",placeholder:"Cart.PriceSummary.coupon.placeholder"}),g=async e=>{const t=e.coupon,i=new Set(f);i.add(t),r(new Set);const l=Array.from(i);x(l,N.REPLACE).then(m=>{if(m===null)throw new Error("Error adding coupon code");p(i)}).catch(m=>{console.warn(m),r(new Set([m.message]))})},C=e=>{const t=new Set(f);t.delete(e),r(new Set);const i=Array.from(t);x(i,N.REPLACE).then(l=>{if(l===null)throw new Error("Error removing coupon code");p(t)}).catch(l=>{console.warn(l),r(new Set([l.message]))})};y(()=>{const e=L.on("cart/data",t=>{const i=t==null?void 0:t.appliedCoupons;if(!i){h([]),r(new Set);return}const l=i.map(m=>m.code);h(l),r(new Set)},{eager:!0});return()=>{e==null||e.off()}},[]),y(()=>{p(new Set(u))},[u]),y(()=>{const e=L.on("shipping/estimate",()=>{r(new Set)},{eager:!0});return()=>{e==null||e.off()}},[]);const v=u.map(e=>o(k,{variant:"tertiary",icon:o(R,{source:q,size:"24"}),onClick:()=>C(e),children:e},e)),S=d.size>0?o("div",{"data-testid":"coupon-code-error",children:Array.from(d)[0]}):void 0;return o(V,{..._,couponCodeField:o(T,{"aria-label":c.placeholder,type:"text",placeholder:c.placeholder,name:"coupon",variant:"primary",value:"","data-testid":"coupon-code-input",maxLength:50,error:d.size>0}),applyCouponsButton:o(k,{variant:"secondary",children:c.applyButton}),error:S,appliedCoupons:o("div",{children:v}),onApplyCoupon:g})};export{oe as Coupons,oe as default}; +import{jsxs as E,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{useState as l,useEffect as m}from"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import{Tag as b,Icon as x,Input as L,Button as R}from"@dropins/tools/components.js";/* empty css */import{S as P,C as B}from"../chunks/Coupons.js";import"@dropins/tools/preact-hooks.js";import"../chunks/resetCart.js";import{events as S}from"@dropins/tools/event-bus.js";import{a as f,A as h}from"../chunks/applyCouponsToCart.js";import{useText as $}from"@dropins/tools/i18n.js";import"../chunks/Coupon.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/persisted-data.js";import"../chunks/refreshCart.js";import"../fragments.js";const U=({children:z,...w})=>{const[d,c]=l(new Set),[i,C]=l([]),[u,p]=l(new Set),s=$({applyButton:"Cart.PriceSummary.coupon.applyAction",placeholder:"Cart.PriceSummary.coupon.placeholder",ariaLabelRemove:"Cart.PriceSummary.coupon.ariaLabelRemove"}),y=async o=>{const e=o.coupon,r=new Set(d);r.add(e),p(new Set);const n=Array.from(r);f(n,h.REPLACE).then(a=>{if(a===null)throw new Error("Error adding coupon code");c(r)}).catch(a=>{console.warn(a),p(new Set([a.message]))})},A=o=>{const e=new Set(d);e.delete(o),p(new Set);const r=Array.from(e);f(r,h.REPLACE).then(n=>{if(n===null)throw new Error("Error removing coupon code");c(e)}).catch(n=>{console.warn(n),p(new Set([n.message]))})};m(()=>{const o=S.on("cart/data",e=>{const r=e==null?void 0:e.appliedCoupons;if(!r){C([]),p(new Set);return}const n=r.map(a=>a.code);C(n),p(new Set)},{eager:!0});return()=>{o==null||o.off()}},[]),m(()=>{c(new Set(i))},[i]),m(()=>{const o=S.on("shipping/estimate",()=>{p(new Set)},{eager:!0});return()=>{o==null||o.off()}},[]);const g=i.map((o,e)=>E(b,{className:"coupon-code-form__applied-item",children:[t("span",{children:o}),t("button",{"aria-label":`${s.ariaLabelRemove} ${o}`,onClick:()=>A(o),"data-testid":`remove-coupon-${e+1}`,children:t(x,{source:P,size:"16"})})]},o)),v=u.size>0?t("div",{"data-testid":"coupon-code-error",children:Array.from(u)[0]}):void 0;return t(B,{...w,couponCodeField:t(L,{"aria-label":s.placeholder,type:"text",placeholder:s.placeholder,name:"coupon",variant:"primary",value:"","data-testid":"coupon-code-input",maxLength:50,error:u.size>0}),applyCouponsButton:t(R,{variant:"secondary",children:s.applyButton}),error:v,appliedCoupons:t("div",{children:g}),onApplyCoupon:y})};export{U as Coupons,U as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/EmptyCart.js b/scripts/__dropins__/storefront-cart/containers/EmptyCart.js index 1b939fe13c..fc7351b902 100644 --- a/scripts/__dropins__/storefront-cart/containers/EmptyCart.js +++ b/scripts/__dropins__/storefront-cart/containers/EmptyCart.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as m}from"@dropins/tools/preact-jsx-runtime.js";import{E as p}from"../chunks/EmptyCart.js";import"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";/* empty css */import"@dropins/tools/components.js";import"@dropins/tools/i18n.js";const E=({routeCTA:t})=>m(p,{ctaLinkURL:t==null?void 0:t()});export{E as EmptyCart,E as default}; +import{jsx as m}from"@dropins/tools/preact-jsx-runtime.js";import{E as p}from"../chunks/EmptyCart.js";import"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";/* empty css */import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/i18n.js";const c=({routeCTA:t})=>m(p,{ctaLinkURL:t==null?void 0:t()});export{c as EmptyCart,c as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/EstimateShipping.js b/scripts/__dropins__/storefront-cart/containers/EstimateShipping.js index 5953d15d3d..07418b4d69 100644 --- a/scripts/__dropins__/storefront-cart/containers/EstimateShipping.js +++ b/scripts/__dropins__/storefront-cart/containers/EstimateShipping.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsxs as A,jsx as e,Fragment as V}from"@dropins/tools/preact-jsx-runtime.js";import{classes as _,VComponent as Z,getFormValues as $}from"@dropins/tools/lib.js";import{Price as U,Picker as w,Input as G,Button as q}from"@dropins/tools/components.js";/* empty css */import{useRef as H,useState as r,useEffect as P,useCallback as J}from"@dropins/tools/preact-compat.js";import{useText as M,Text as v}from"@dropins/tools/i18n.js";import{s as X}from"../chunks/resetCart.js";import{events as B}from"@dropins/tools/event-bus.js";import{s as j}from"../chunks/persisted-data.js";import{g as O,a as Q,b as W}from"../chunks/getEstimateShipping.js";import"@dropins/tools/fetch-graphql.js";const Y=({countryField:k,destinationText:D,estimateButton:z,estimated:I,loading:N,onEstimate:l,price:f,priceExcludingTax:F,priceIncludingTax:n,stateField:S,taxExcluded:b,taxIncluded:T,zipField:m})=>{const d=H(null),[L,C]=r(!0),[y,i]=r("zip"),p=M({editZipAction:"Cart.EstimateShipping.editZipAction",destinationLinkAriaLabel:"Cart.EstimateShipping.destinationLinkAriaLabel",shippingLabel:"Cart.EstimateShipping.label",zipPlaceholder:"Cart.EstimateShipping.zipPlaceholder"}),x=a=>{a.preventDefault(),C(E=>!E)},t=a=>{a.preventDefault(),C(!0),i(E=>E==="zip"?"state":"zip")},h=a=>{a.preventDefault(),C(!1);const E=$(d.current);l==null||l(E)};return A("div",{"data-testid":"estimate-shipping",className:_(["cart-estimate-shipping",["cart-estimate-shipping--loading",N]]),children:[e("span",{className:"cart-estimate-shipping__label",children:I?D?A(V,{children:[e(v,{id:"Cart.EstimateShipping.estimatedDestination"})," ",e("a",{className:"cart-estimate-shippingLink",role:"button",href:"",onClick:x,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&x(a)},tabIndex:0,"aria-label":p.destinationLinkAriaLabel,"data-testid":"shipping-destination-link",children:D})]}):e(v,{id:"Cart.EstimateShipping.estimated"}):e(v,{id:"Cart.EstimateShipping.label"})}),e(Z,{node:f,className:"cart-estimate-shipping__price"}),I&&A(V,{children:[e("div",{className:_(["cart-estimate-shipping__caption"]),children:e("a",{href:"#",className:"cart-estimate-shipping__link",onClick:t,"data-testid":"shipping-alternate-field-link",children:y==="zip"?e(v,{id:"Cart.EstimateShipping.alternateField.state"}):e(v,{id:"Cart.EstimateShipping.alternateField.zip"})})}),A("form",{className:_(["cart-estimate-shipping--edit",["cart-estimate-shipping--hide",!L]]),ref:d,"data-testid":"shipping-estimate-form",children:[k&&e(Z,{node:k,className:_(["cart-estimate-shipping--country"])}),y==="state"?S&&e(Z,{node:S,className:_(["cart-estimate-shipping--state"])}):m&&e(Z,{node:m,className:_(["cart-estimate-shipping--zip"])}),z&&e(Z,{node:z,className:_(["cart-estimate-shipping--action"]),onClick:h,type:"submit"})]})]}),T&&e("div",{"data-testid":"shipping-tax-included",className:_(["cart-estimate-shipping__caption"]),children:A("span",{children:[n," ",e(v,{id:"Cart.EstimateShipping.withTaxes"})]})}),b?e("div",{"data-testid":"shipping-tax-included-excluded",className:_(["cart-estimate-shipping__caption"]),children:A("span",{children:[F," ",e(v,{id:"Cart.EstimateShipping.withoutTaxes"})]})}):void 0]})},ee=()=>{const[k,D]=r(!1),[z,I]=r([]),[N,l]=r("US"),[f,F]=r(""),[n,S]=r(""),[b,T]=r([]),[m,d]=r(!1),[L,C]=r(),[y,i]=r(),[p,x]=r(""),[t,h]=r(!1),a=()=>{l("US"),F(""),S(""),C(null),i(null),x(""),h(!1)},E=async u=>{const{shippingCountry:s,shippingState:o="",shippingZip:c=""}=u,K={countryCode:s,postcode:c,region:{region:o}};return D(!0),W(K).then(g=>(g&&(C({amount:g.amount.value,currency:g.amount.currency,priceIncludingtax:{amount:g.price_incl_tax.value,currency:g.price_incl_tax.currency},priceExcludingtax:{amount:g.price_excl_tax.value,currency:g.price_excl_tax.currency}}),i({carrier_code:g.carrier_code,method_code:g.method_code}),l(s),F(o),S(c),x(o||c||s),h(!0)),l(s),F(o),S(c),x(o||c||s),g)).finally(()=>{D(!1)})},R=u=>{u.preventDefault(),F(""),S("");const s=u.target.value;l(s)};return P(()=>{O().then(u=>{let s="US";const o=u.map(c=>(c.isDefaultCountry&&(s=c.id),{text:c.label,value:c.id}));I(o),l(s)})},[]),P(()=>{d(!0),Q(N).then(u=>{const s=u.map(o=>({text:o.name,value:o.code}));T(s)}).finally(()=>{d(!1)})},[N,d]),{loading:k,regionsLoading:m,estimatedDestinationText:p,countries:z,selectedCountry:N,selectedRegion:f,selectedZip:n,regions:b,estimatedShippingPrice:L,estimatedShippingMethod:y,shippingEstimated:t,handleEstimateShipping:E,handleCountrySelected:R,resetValues:a,setPriceSummaryLoading:D}},me=({showDefaultEstimatedShippingCost:k})=>{var x;const[D,z]=r(!1),{loading:I,countries:N,regions:l,selectedCountry:f,estimatedDestinationText:F,estimatedShippingPrice:n,handleCountrySelected:S,handleEstimateShipping:b,regionsLoading:T,selectedRegion:m,selectedZip:d,shippingEstimated:L,resetValues:C}=ee(),y=J(t=>{b(t).then(()=>{j(t)})},[b]);P(()=>{const t=B.on("cart/data",h=>{var s,o,c;z((h==null?void 0:h.isVirtual)||!1);const a=(o=(s=h==null?void 0:h.addresses)==null?void 0:s.shipping)==null?void 0:o[0];if(k&&!a&&b({shippingCountry:((c=X.config)==null?void 0:c.defaultCountry)??""}),!a)return;const{countryCode:E,regionCode:R,zipCode:u}=a;y({shippingCountry:E,shippingState:R,shippingZip:u})},{eager:!0});return()=>{t==null||t.off()}},[]),P(()=>{const t=B.on("cart/updated",()=>{L&&b({shippingCountry:f,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,f,m,d]),P(()=>{const t=B.on("cart/reset",()=>{C(),j(null)});return()=>{t==null||t.off()}},[C]),P(()=>{const t=B.on("cart/merged",()=>{L&&y({shippingCountry:f,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,f,m,d,y]);const i=M({applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder"});if(D)return null;const p=(x=X.config)==null?void 0:x.shoppingCartDisplaySetting;return e(Y,{loading:I,taxIncluded:(p==null?void 0:p.shipping)==="INCLUDING_TAX",taxExcluded:(p==null?void 0:p.shipping)==="INCLUDING_EXCLUDING_TAX",price:(n==null?void 0:n.amount)==0?e("span",{"data-testId":"free-shipping",children:i.freeShipping}):(p==null?void 0:p.shipping)==="INCLUDING_TAX"&&n?e(U,{"data-testid":"shipping",...n.priceIncludingtax}):n?e(U,{...n}):e("span",{children:i.taxToBeDetermined}),estimated:!0,priceExcludingTax:n!=null&&n.priceExcludingtax?e(U,{"data-testid":"shipping-excluding-tax",...n.priceExcludingtax}):e("span",{children:i.taxToBeDetermined}),countryField:e(w,{name:"shippingCountry",placeholder:i.countryField,value:f,variant:"primary",options:N,handleSelect:S,"data-testid":"estimate-shipping-country-selector"}),stateField:l.length>0?e(w,{name:"shippingState",placeholder:i.stateField,variant:"primary",options:l,value:m,"data-testid":"estimate-shipping-state-selector",disabled:T}):e(G,{"aria-label":i.stateField,name:"shippingState",placeholder:i.stateField,variant:"primary",value:m,disabled:T,"data-testid":"estimate-shipping-state-input",maxLength:50}),zipField:e(G,{"aria-label":i.zipField,name:"shippingZip",placeholder:i.zipField,variant:"primary","data-testid":"estimate-shipping-zip-input",value:d,maxLength:12}),estimateButton:e(q,{variant:"secondary","data-testid":"estimate-shipping-apply-button","aria-label":i.applyButton,children:i.applyButton}),destinationText:F||i.taxToBeDetermined,onEstimate:y})};export{me as EstimateShipping,me as default}; +import{jsxs as T,jsx as e,Fragment as V}from"@dropins/tools/preact-jsx-runtime.js";import{classes as b,VComponent as B,getFormValues as $}from"@dropins/tools/lib.js";import{Price as U,Picker as w,Input as G,Button as q}from"@dropins/tools/components.js";/* empty css */import{useRef as H,useState as s,useEffect as Z,useCallback as J}from"@dropins/tools/preact-compat.js";import{useText as M,Text as k}from"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";import{s as X}from"../chunks/resetCart.js";import{events as R}from"@dropins/tools/event-bus.js";import{s as j}from"../chunks/persisted-data.js";import{g as O,a as Q,b as W}from"../chunks/getEstimateShipping.js";import"@dropins/tools/fetch-graphql.js";const Y=({countryField:z,destinationText:f,estimateButton:I,estimated:A,loading:N,onEstimate:l,price:S,priceExcludingTax:D,priceIncludingTax:n,stateField:C,taxExcluded:F,taxIncluded:P,zipField:m})=>{const d=H(null),[L,y]=s(!0),[x,i]=s("zip"),r=M({editZipAction:"Cart.EstimateShipping.editZipAction",destinationLinkAriaLabel:"Cart.EstimateShipping.destinationLinkAriaLabel",shippingLabel:"Cart.EstimateShipping.label",zipPlaceholder:"Cart.EstimateShipping.zipPlaceholder"}),E=p=>{p.preventDefault(),y(_=>!_)},t=p=>{p.preventDefault(),y(!0),i(_=>_==="zip"?"state":"zip")},h=p=>{p.preventDefault(),y(!1);const _=$(d.current);l==null||l(_)},v=r.destinationLinkAriaLabel.replace("{destination}",f);return T("div",{"data-testid":"estimate-shipping",className:b(["cart-estimate-shipping",["cart-estimate-shipping--loading",N]]),children:[e("span",{className:"cart-estimate-shipping__label",children:A?f?T(V,{children:[e(k,{id:"Cart.EstimateShipping.estimatedDestination"})," ",e("a",{className:"cart-estimate-shippingLink",role:"button",href:"",onClick:E,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&E(p)},tabIndex:0,"aria-label":v,"data-testid":"shipping-destination-link",children:f})]}):e(k,{id:"Cart.EstimateShipping.estimated"}):e(k,{id:"Cart.EstimateShipping.label"})}),e(B,{node:S,className:"cart-estimate-shipping__price"}),A&&T(V,{children:[e("div",{className:b(["cart-estimate-shipping__caption"]),children:e("a",{href:"#",className:"cart-estimate-shipping__link",onClick:t,"data-testid":"shipping-alternate-field-link",children:x==="zip"?e(k,{id:"Cart.EstimateShipping.alternateField.state"}):e(k,{id:"Cart.EstimateShipping.alternateField.zip"})})}),T("form",{className:b(["cart-estimate-shipping--edit",["cart-estimate-shipping--hide",!L]]),ref:d,"data-testid":"shipping-estimate-form",children:[z&&e(B,{node:z,className:b(["cart-estimate-shipping--country"])}),x==="state"?C&&e(B,{node:C,className:b(["cart-estimate-shipping--state"])}):m&&e(B,{node:m,className:b(["cart-estimate-shipping--zip"])}),I&&e(B,{node:I,className:b(["cart-estimate-shipping--action"]),onClick:h,type:"submit"})]})]}),P&&e("div",{"data-testid":"shipping-tax-included",className:b(["cart-estimate-shipping__caption"]),children:T("span",{children:[n," ",e(k,{id:"Cart.EstimateShipping.withTaxes"})]})}),F?e("div",{"data-testid":"shipping-tax-included-excluded",className:b(["cart-estimate-shipping__caption"]),children:T("span",{children:[D," ",e(k,{id:"Cart.EstimateShipping.withoutTaxes"})]})}):void 0]})},ee=()=>{const[z,f]=s(!1),[I,A]=s([]),[N,l]=s("US"),[S,D]=s(""),[n,C]=s(""),[F,P]=s([]),[m,d]=s(!1),[L,y]=s(),[x,i]=s(),[r,E]=s(""),[t,h]=s(!1),v=()=>{l("US"),D(""),C(""),y(null),i(null),E(""),h(!1)},p=async u=>{const{shippingCountry:a,shippingState:o="",shippingZip:c=""}=u,K={countryCode:a,postcode:c,region:{region:o}};return f(!0),W(K).then(g=>(g&&(y({amount:g.amount.value,currency:g.amount.currency,priceIncludingtax:{amount:g.price_incl_tax.value,currency:g.price_incl_tax.currency},priceExcludingtax:{amount:g.price_excl_tax.value,currency:g.price_excl_tax.currency}}),i({carrier_code:g.carrier_code,method_code:g.method_code}),l(a),D(o),C(c),E(o||c||a),h(!0)),l(a),D(o),C(c),E(o||c||a),g)).finally(()=>{f(!1)})},_=u=>{u.preventDefault(),D(""),C("");const a=u.target.value;l(a)};return Z(()=>{O().then(u=>{let a="US";const o=u.map(c=>(c.isDefaultCountry&&(a=c.id),{text:c.label,value:c.id}));A(o),l(a)})},[]),Z(()=>{d(!0),Q(N).then(u=>{const a=u.map(o=>({text:o.name,value:o.code}));P(a)}).finally(()=>{d(!1)})},[N,d]),{loading:z,regionsLoading:m,estimatedDestinationText:r,countries:I,selectedCountry:N,selectedRegion:S,selectedZip:n,regions:F,estimatedShippingPrice:L,estimatedShippingMethod:x,shippingEstimated:t,handleEstimateShipping:p,handleCountrySelected:_,resetValues:v,setPriceSummaryLoading:f}},he=({showDefaultEstimatedShippingCost:z})=>{var E;const[f,I]=s(!1),{loading:A,countries:N,regions:l,selectedCountry:S,estimatedDestinationText:D,estimatedShippingPrice:n,handleCountrySelected:C,handleEstimateShipping:F,regionsLoading:P,selectedRegion:m,selectedZip:d,shippingEstimated:L,resetValues:y}=ee(),x=J(t=>{F(t).then(()=>{j(t)})},[F]);Z(()=>{const t=R.on("cart/data",h=>{var a,o,c;I((h==null?void 0:h.isVirtual)||!1);const v=(o=(a=h==null?void 0:h.addresses)==null?void 0:a.shipping)==null?void 0:o[0];if(z&&!v&&F({shippingCountry:((c=X.config)==null?void 0:c.defaultCountry)??""}),!v)return;const{countryCode:p,regionCode:_,zipCode:u}=v;x({shippingCountry:p,shippingState:_,shippingZip:u})},{eager:!0});return()=>{t==null||t.off()}},[]),Z(()=>{const t=R.on("cart/updated",()=>{L&&F({shippingCountry:S,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,S,m,d]),Z(()=>{const t=R.on("cart/reset",()=>{y(),j(null)});return()=>{t==null||t.off()}},[y]),Z(()=>{const t=R.on("cart/merged",()=>{L&&x({shippingCountry:S,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,S,m,d,x]);const i=M({applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder"});if(f)return null;const r=(E=X.config)==null?void 0:E.shoppingCartDisplaySetting;return e(Y,{loading:A,taxIncluded:(r==null?void 0:r.shipping)==="INCLUDING_TAX",taxExcluded:(r==null?void 0:r.shipping)==="INCLUDING_EXCLUDING_TAX",price:(n==null?void 0:n.amount)==0?e("span",{"data-testId":"free-shipping",children:i.freeShipping}):(r==null?void 0:r.shipping)==="INCLUDING_TAX"&&n?e(U,{"data-testid":"shipping",...n.priceIncludingtax}):n?e(U,{...n}):e("span",{children:i.taxToBeDetermined}),estimated:!0,priceExcludingTax:n!=null&&n.priceExcludingtax?e(U,{"data-testid":"shipping-excluding-tax",...n.priceExcludingtax}):e("span",{children:i.taxToBeDetermined}),countryField:e(w,{name:"shippingCountry",placeholder:i.countryField,value:S,variant:"primary",options:N,handleSelect:C,"data-testid":"estimate-shipping-country-selector"}),stateField:l.length>0?e(w,{name:"shippingState",placeholder:i.stateField,variant:"primary",options:l,value:m,"data-testid":"estimate-shipping-state-selector",disabled:P}):e(G,{"aria-label":i.stateField,name:"shippingState",placeholder:i.stateField,variant:"primary",value:m,disabled:P,"data-testid":"estimate-shipping-state-input",maxLength:50}),zipField:e(G,{"aria-label":i.zipField,name:"shippingZip",placeholder:i.zipField,variant:"primary","data-testid":"estimate-shipping-zip-input",value:d,maxLength:12}),estimateButton:e(q,{variant:"secondary","data-testid":"estimate-shipping-apply-button","aria-label":i.applyButton,children:i.applyButton}),destinationText:D||i.taxToBeDetermined,onEstimate:x})};export{he as EstimateShipping,he as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/GiftCards.d.ts b/scripts/__dropins__/storefront-cart/containers/GiftCards.d.ts new file mode 100644 index 0000000000..abb456f381 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftCards.d.ts @@ -0,0 +1,3 @@ +export * from './GiftCards/index' +import _default from './GiftCards/index' +export default _default diff --git a/scripts/__dropins__/storefront-cart/containers/GiftCards.js b/scripts/__dropins__/storefront-cart/containers/GiftCards.js new file mode 100644 index 0000000000..98d374b75e --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftCards.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import{jsxs as y,jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{useState as p,useEffect as l}from"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import{Tag as G,Icon as v,Input as b,Button as A}from"@dropins/tools/components.js";/* empty css */import{S as L,C as x}from"../chunks/Coupons.js";import"@dropins/tools/preact-hooks.js";import"../chunks/resetCart.js";import{events as E}from"@dropins/tools/event-bus.js";import{a as P,r as T}from"../chunks/removeGiftCardFromCart.js";import{S as B}from"../chunks/GiftCard.js";import{useText as R}from"@dropins/tools/i18n.js";import"../chunks/Coupon.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/persisted-data.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";const X=({children:z,...C})=>{const[m,d]=p(new Set),[s,f]=p([]),[c,i]=p(new Set),o=R({giftCardTitle:"Cart.PriceSummary.giftCard.title",applyButton:"Cart.PriceSummary.giftCard.applyAction",placeholder:"Cart.PriceSummary.giftCard.placeholder",ariaLabel:"Cart.PriceSummary.giftCard.ariaLabel",ariaLabelRemove:"Cart.PriceSummary.giftCard.ariaLabelRemove",empty:"Cart.PriceSummary.giftCard.errors.empty"}),u=async r=>{const t=r==null?void 0:r.giftCardCode;if(t==="")return i(new Set([o.empty])),!0;const e=new Set(m);e.add(t),i(new Set),P(t).then(n=>{if(n===null)throw new Error("Error adding gift card code");d(e)}).catch(n=>{console.warn(n),i(new Set([n.message]))})},S=r=>{const t=new Set(m);t.delete(r),i(new Set),T(r).then(e=>{if(e===null)throw new Error("Error removing gift card code");d(t)}).catch(e=>{console.warn(e),i(new Set([e.message]))})};l(()=>{const r=E.on("cart/data",t=>{const e=t==null?void 0:t.appliedGiftCards;if(!e){f([]),i(new Set);return}const n=e.map(({code:w})=>w);f(n),i(new Set)},{eager:!0});return()=>{r==null||r.off()}},[]),l(()=>{d(new Set(s))},[s]);const g=s.map((r,t)=>y(G,{className:"coupon-code-form__applied-item",children:[a("span",{children:r}),a("button",{"aria-label":`${o.ariaLabelRemove} ${r}`,onClick:()=>S(r),"data-testid":`remove-giftcard-${t+1}`,children:a(v,{source:L,size:"16"})})]},r)),h=c.size>0?a("div",{"data-testid":"giftcard-code-error",children:Array.from(c)[0]}):void 0;return a(x,{...C,className:"cart-gift-cards",accordionSectionTitle:o.giftCardTitle,accordionSectionIcon:B,couponCodeField:a(b,{"aria-label":o.ariaLabel,type:"text",placeholder:o.placeholder,name:"giftCardCode",variant:"primary",value:"","data-testid":"giftcard-code-input",maxLength:50,error:c.size>0}),applyCouponsButton:a(A,{variant:"secondary",children:o.applyButton}),error:h,appliedCoupons:a("div",{children:g}),onApplyCoupon:u})};export{X as GiftCards,X as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/GiftCards/GiftCards.d.ts b/scripts/__dropins__/storefront-cart/containers/GiftCards/GiftCards.d.ts new file mode 100644 index 0000000000..1dc24392f3 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftCards/GiftCards.d.ts @@ -0,0 +1,7 @@ +import { HTMLAttributes } from 'preact/compat'; +import { Container } from '@dropins/tools/types/elsie/src/lib'; + +export interface GiftCardsProps extends HTMLAttributes { +} +export declare const GiftCards: Container; +//# sourceMappingURL=GiftCards.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/containers/GiftCards/index.d.ts b/scripts/__dropins__/storefront-cart/containers/GiftCards/index.d.ts new file mode 100644 index 0000000000..646ffa9e9c --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftCards/index.d.ts @@ -0,0 +1,19 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './GiftCards'; +export { GiftCards as default } from './GiftCards'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/containers/GiftOptions.d.ts b/scripts/__dropins__/storefront-cart/containers/GiftOptions.d.ts new file mode 100644 index 0000000000..83a72b2ad3 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftOptions.d.ts @@ -0,0 +1,3 @@ +export * from './GiftOptions/index' +import _default from './GiftOptions/index' +export default _default diff --git a/scripts/__dropins__/storefront-cart/containers/GiftOptions.js b/scripts/__dropins__/storefront-cart/containers/GiftOptions.js new file mode 100644 index 0000000000..232797ec17 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftOptions.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import{jsxs as f,Fragment as B,jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{classes as xe}from"@dropins/tools/lib.js";import{Modal as Ze,Price as le,ContentGrid as Xe,ImageSwatch as Je,Button as oe,Skeleton as Qe,SkeletonRow as Ye,Field as Z,Checkbox as ie,Input as ve,TextArea as Ue,Accordion as Pe,AccordionSection as Ne,Icon as J,Card as We,ProgressSpinner as De}from"@dropins/tools/components.js";/* empty css */import*as Q from"@dropins/tools/preact-compat.js";import{useState as P,useEffect as se,useId as Me,useCallback as K,useMemo as ne}from"@dropins/tools/preact-hooks.js";import{useText as X}from"@dropins/tools/i18n.js";import{s as H}from"../chunks/resetCart.js";import{S as Ve}from"../chunks/ChevronUp.js";import{S as $e}from"../chunks/ChevronDown.js";import{events as er}from"@dropins/tools/event-bus.js";import{u as rr}from"../chunks/updateProductsFromCart.js";import{s as tr}from"../chunks/setGiftOptionsOnCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/persisted-data.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";const D=e=>Q.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Q.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),Q.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),de=e=>Q.createElement("svg",{width:20,height:23,viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Q.createElement("path",{d:"M10 6L10 21.5M10 6H12.25C13.4926 6 14.5 4.99264 14.5 3.75C14.5 2.50736 13.4926 1.5 12.25 1.5C11.0074 1.5 10 2.50736 10 3.75M10 6V3.75M10 6H7.75C6.50736 6 5.5 4.99264 5.5 3.75C5.5 2.50736 6.50736 1.5 7.75 1.5C8.99264 1.5 10 2.50736 10 3.75M3.25 10.75H16.75C17.9926 10.75 19 9.74264 19 8.5C19 7.25736 17.9926 6.25 16.75 6.25H3.25C2.00736 6.25 1 7.25736 1 8.5C1 9.74264 2.00736 10.75 3.25 10.75ZM4.75 21.5H15.25C16.4926 21.5 17.5 20.4926 17.5 19.25V13.25C17.5 12.0074 16.4926 11 15.25 11H4.75C3.50736 11 2.5 12.0074 2.5 13.25V19.25C2.5 20.4926 3.50736 21.5 4.75 21.5Z",stroke:"currentColor",strokeWidth:1.5})),ir=({view:e,showModal:o,productName:l,giftWrappingConfig:c,setShowModal:t,updateGiftOptions:p})=>{var O;const u=X({modalTitle:"Cart.GiftOptions.modal.title",defaultTitle:"Cart.GiftOptions.modal.defaultTitle",modalWrappingText:"Cart.GiftOptions.modal.wrappingText",modalWrappingSubText:"Cart.GiftOptions.modal.wrappingSubText",modalConfirmButton:"Cart.GiftOptions.modal.modalConfirmButton",modalCancelButton:"Cart.GiftOptions.modal.modalCancelButton"}),[n,d]=P();if(se(()=>{const i=c.find(N=>N.selected)??c[0];d(i)},[c]),!o||!c.length)return null;const m=l?`${u.modalTitle} ${l}`:u.defaultTitle;return f(Ze,{"data-testid":`gift-option-modal-${e}`,className:"cart-gift-options-view__modal",size:"medium",title:f(B,{children:[r("span",{children:m}),n&&((O=n==null?void 0:n.price)==null?void 0:O.value)>0?r(le,{amount:n.price.value,currency:n.price.currency,weight:"normal"}):null]}),centered:!0,onClose:t,children:[f("div",{className:"cart-gift-options-view__modal-content",children:[r("span",{className:"cart-gift-options-view__modal-text",children:u.modalWrappingText}),r(Xe,{emptyGridContent:r(B,{}),maxColumns:6,columnWidth:"100px",className:"cart-gift-options-view__modal-grid",children:c.map(i=>r(Je,{selected:(n==null?void 0:n.uid)===(i==null?void 0:i.uid),onValue:()=>{d(i)},name:"giftWrappingId",value:i.uid,src:i.image.url,alt:i.image.design,label:i.image.design,"data-testid":`gift-option-modal-image-${i.uid}`,className:"cart-gift-options-view__modal-grid-item"},i.uid))}),r("span",{className:"cart-gift-options-view__modal-sub-text",children:n==null?void 0:n.design})]}),r(oe,{"data-testid":"gift-option-modal-confirm-button",type:"button",onClick:()=>{p("giftWrappingId",n==null?void 0:n.uid,{isGiftWrappingSelected:!0}),t()},children:u.modalConfirmButton}),r(oe,{type:"button",variant:"secondary",onClick:t,"data-testid":"gift-option-modal-cancel-button",children:u.modalCancelButton})]})},nr=()=>r(Qe,{children:r(Ye,{variant:"row",size:"small",fullWidth:!0,lines:1,multilineGap:"small"})}),or=({className:e,view:o,item:l,giftOptions:c,disabled:t,cartData:p,giftWrappingConfig:u,setShowModal:n,onInputChange:d,areGiftOptionsVisible:m})=>{var $,S,z,q;const O=Me(),i=X({customize:`Cart.GiftOptions.${o}.customize`,giftReceiptIncludedTitle:`Cart.GiftOptions.${o}.giftReceiptIncluded.title`,giftReceiptIncludedText:`Cart.GiftOptions.${o}.giftReceiptIncluded.subtitle`,printedCardIncludedTitle:`Cart.GiftOptions.${o}.printedCardIncluded.title`,printedCardIncludedText:`Cart.GiftOptions.${o}.printedCardIncluded.subtitle`,giftOptionsWrapTitle:`Cart.GiftOptions.${o}.giftOptionsWrap.title`,giftOptionsWrapText:`Cart.GiftOptions.${o}.giftOptionsWrap.subtitle`,requiredFieldError:"Cart.GiftOptions.formText.requiredFieldError"}),N=l==null?void 0:l.productGiftWrapping,M=p==null?void 0:p.cartGiftWrapping,b=o==="product"?N:M,G=b==null?void 0:b.find(I=>I.uid===c.giftWrappingId),W=(G==null?void 0:G.design)??"",g=l==null?void 0:l.giftWrappingPrice,T=W?`${i.giftOptionsWrapText} ${W}`:"",_=+(((S=($=H.config)==null?void 0:$.printedCardPrice)==null?void 0:S.value)??0)>0?(z=H.config)==null?void 0:z.printedCardPrice:null;let v=null;g!=null&&g.value?v=g:(q=G==null?void 0:G.price)!=null&&q.value&&(v=G.price);const V=I=>I?f("span",{children:[" (+",r(le,{amount:I.value,currency:I.currency,weight:"normal"}),")"]}):null;return f("div",{className:xe([e,[`${e}--hidden`,!m.isGiftOptionsVisible]]),children:[m.isGiftReceiptVisible?r(Z,{disabled:t,className:"cart-gift-options-view__field-gift-receipt",children:r(ie,{id:`giftReceiptIncluded-${O}`,disabled:t,name:"giftReceiptIncluded",checked:c.giftReceiptIncluded,placeholder:i.giftReceiptIncludedTitle,label:i.giftReceiptIncludedTitle,description:i.giftReceiptIncludedText,onChange:d})}):null,m.isPrintedCartVisible?r(Z,{disabled:t,className:"cart-gift-options-view__field-printed-card",children:r(ie,{id:`printedCardIncluded-${O}`,disabled:t,name:"printedCardIncluded",checked:c.printedCardIncluded,placeholder:i.printedCardIncludedTitle,label:f(B,{children:[i.printedCardIncludedTitle,V(_)]}),description:i.printedCardIncludedText,onChange:d})}):null,m.isGiftWrappingVisible?f(B,{children:[r(Z,{disabled:t,className:"cart-gift-options-view__field-gift-wrap",children:r(ie,{id:`giftOptionsWrap-${O}`,disabled:t,name:"isGiftWrappingSelected",checked:c.isGiftWrappingSelected,placeholder:i.giftOptionsWrapTitle,label:f(B,{children:[i.giftOptionsWrapTitle,V(v)]}),description:T,onChange:d})}),r(oe,{disabled:t||!u.length,type:"button","data-testid":`gift-option-customize-${o}`,variant:"tertiary",onClick:()=>n(!0),children:i.customize})]}):null]})},sr=({view:e,giftOptions:o,disabled:l,errorMessage:c,onInputChange:t,onBlur:p,isGiftMessageVisible:u})=>{const n=Me(),d=X({formTitle:`Cart.GiftOptions.${e}.formContent.formTitle`,formTo:`Cart.GiftOptions.${e}.formContent.formTo`,formFrom:`Cart.GiftOptions.${e}.formContent.formFrom`,giftMessageTitle:`Cart.GiftOptions.${e}.formContent.giftMessageTitle`,formToPlaceholder:`Cart.GiftOptions.${e}.formContent.formToPlaceholder`,formFromPlaceholder:`Cart.GiftOptions.${e}.formContent.formFromPlaceholder`,formMessagePlaceholder:`Cart.GiftOptions.${e}.formContent.formMessagePlaceholder`});return u?f(B,{children:[r("span",{children:d.formTitle}),f("div",{children:[r("span",{children:d.formTo}),r(Z,{disabled:l,error:c.recipientName,children:r(ve,{id:`recipientName-${n}`,disabled:l,type:"text",name:"recipientName",value:o.recipientName,placeholder:d.formToPlaceholder,onChange:t,onBlur:p})})]}),f("div",{children:[r("span",{children:d.formFrom}),r(Z,{disabled:l,error:c.senderName,children:r(ve,{id:`senderName-${n}`,disabled:l,type:"text",name:"senderName",value:o.senderName,placeholder:d.formFromPlaceholder,onChange:t,onBlur:p})})]}),f("div",{children:[r("span",{children:d.giftMessageTitle}),r(Z,{disabled:l,children:r(Ue,{id:`message-${n}`,errorMessage:c.message,disabled:l,name:"message",value:o.message,label:d.formMessagePlaceholder,onChange:t,onBlur:p})})]})]}):null},dr=({view:e,giftOptions:o,giftWrappingConfig:l,readOnlyFormOrderView:c})=>{const t=X({readOnlyProductTitle:"Cart.GiftOptions.product.readOnlyFormView.title",wrapping:"Cart.GiftOptions.product.readOnlyFormView.wrapping",recipient:"Cart.GiftOptions.product.readOnlyFormView.recipient",sender:"Cart.GiftOptions.product.readOnlyFormView.sender",message:"Cart.GiftOptions.product.readOnlyFormView.message",readOnlyOrderTitle:"Cart.GiftOptions.order.readOnlyFormView.title",readOnlyOrderGiftReceiptTitle:"Cart.GiftOptions.order.readOnlyFormView.giftReceipt",readOnlyOrderGiftReceiptText:"Cart.GiftOptions.order.readOnlyFormView.giftReceiptText",readOnlyOrderGiftPrintCardTitle:"Cart.GiftOptions.order.readOnlyFormView.printCard",readOnlyOrderGiftPrintCardText:"Cart.GiftOptions.order.readOnlyFormView.printCardText",readOnlyOrderGiftWrapTitle:"Cart.GiftOptions.order.readOnlyFormView.giftWrap",readOnlyOrderGiftWrapOptionsText:"Cart.GiftOptions.order.readOnlyFormView.giftWrapOptions",readOnlyOrderFormTitle:"Cart.GiftOptions.order.readOnlyFormView.formTitle",readOnlyOrderFormTo:"Cart.GiftOptions.order.readOnlyFormView.formTo",readOnlyOrderFormFrom:"Cart.GiftOptions.order.readOnlyFormView.formFrom",readOnlyOrderFormMessageTitle:"Cart.GiftOptions.order.readOnlyFormView.formMessageTitle"}),{recipientName:p,senderName:u,message:n,giftReceiptIncluded:d,printedCardIncluded:m,isGiftWrappingSelected:O}=o,i=l==null?void 0:l.find(({uid:g})=>g===(o==null?void 0:o.giftWrappingId)),N=!!p||!!u||!!n,M=i==null?void 0:i.design,b=d||m||(i==null?void 0:i.selected),G=[{id:1,title:t.wrapping,message:O?M:""},{id:2,title:t.recipient,message:p},{id:3,title:t.sender,message:u},{id:4,title:t.message,message:n}],W=G.every(({message:g})=>!g);if(e==="product"&&!W)return r(Pe,{"data-testid":"gift-options-product",iconClose:Ve,iconOpen:$e,actionIconPosition:"right",children:r(Ne,{title:t.readOnlyProductTitle,showIconLeft:!0,iconLeft:de,defaultOpen:!1,renderContentWhenClosed:!1,children:r("div",{children:G.filter(g=>g.message).map(g=>f("p",{children:[g.title," ",g.message]},g.id))})})});if(e==="order"&&(N||b)){const g=f("div",{className:"cart-gift-options-readonly__header",children:[r(J,{source:de,size:"24"}),r("span",{children:t.readOnlyOrderTitle})]}),T=f(B,{children:[d?f("div",{className:"cart-gift-options-readonly__checkboxes cart-gift-options-readonly__checkboxes--gift-receipt",children:[r(J,{source:D,size:"16"}),r("p",{children:t.readOnlyOrderGiftReceiptTitle}),r("p",{children:t.readOnlyOrderGiftReceiptText})]}):null,m?f("div",{className:"cart-gift-options-readonly__checkboxes cart-gift-options-readonly__checkboxes--print-card",children:[r(J,{source:D,size:"16"}),r("p",{children:t.readOnlyOrderGiftPrintCardTitle}),r("p",{children:t.readOnlyOrderGiftPrintCardText})]}):null,i!=null&&i.selected?f("div",{className:"cart-gift-options-readonly__checkboxes cart-gift-options-readonly__checkboxes--gift-wrap",children:[r(J,{source:D,size:"16"}),f("p",{children:[t.readOnlyOrderGiftWrapTitle," (+",r(le,{amount:i.price.value,currency:i.price.currency,weight:"normal"}),")"]}),r("p",{children:`${t.readOnlyOrderGiftWrapOptionsText} ${i==null?void 0:i.design}`})]}):null]}),_=N?f("div",{className:"cart-gift-options-readonly__form",children:[r("div",{children:t.readOnlyOrderFormTitle}),f("div",{children:[f("p",{children:[r("span",{children:t.readOnlyOrderFormTo}),r("span",{children:p})]}),f("p",{children:[r("span",{children:t.readOnlyOrderFormFrom}),r("span",{children:u})]})]}),f("div",{children:[r("p",{children:t.readOnlyOrderFormMessageTitle}),r("p",{children:n})]})]}):null;return f(We,{variant:c,children:[g,T,_]})}return null},lr=({item:e,view:o,loading:l,giftOptions:c,showModal:t,isEditable:p,errorsField:u,updateLoading:n,cartData:d,fieldsDisabled:m,isGiftOptionsApplied:O,giftWrappingConfig:i,readOnlyFormOrderView:N,isGiftMessageVisible:M,areGiftOptionsVisible:b,onBlur:G,setShowModal:W,updateGiftOptions:g,onInputChange:T,handleFormMouseLeave:_})=>{const v=X({accordionHeading:`Cart.GiftOptions.${o}.accordionHeading`}),V=K($=>r(Pe,{"data-testid":"gift-options-product",iconClose:Ve,iconOpen:$e,actionIconPosition:"right",children:r(Ne,{title:f("div",{className:"cart-gift-options-view__icon--success",children:[r("span",{children:v.accordionHeading}),O?r(J,{source:D,size:"16"}):null]}),showIconLeft:!0,iconLeft:de,defaultOpen:O||$,renderContentWhenClosed:!1,children:f(B,{children:[r(or,{className:"cart-gift-options-view__top",view:o,item:e,giftOptions:c,disabled:m,onInputChange:T,cartData:d,giftWrappingConfig:i,setShowModal:W,areGiftOptionsVisible:b}),r("form",{className:"cart-gift-options-view__footer",onMouseLeave:_,children:r(sr,{view:o,giftOptions:c,disabled:m,errorMessage:u,onInputChange:T,onBlur:G,isGiftMessageVisible:M})})]})})}),[o,e,d,v,u,c,m,i,b,O,M,G,W,T,_]);return!b.isGiftOptionsVisible&&!M?null:f("div",{id:"cart-gift-options-view",className:xe(["cart-gift-options-view",`cart-gift-options-view--${o}`,["cart-gift-options-view--loading",n]]),children:[n?r(De,{className:"cart-gift-options-view__spinner"}):null,l?r(nr,{}):f(B,{children:[p?null:r("div",{className:"cart-gift-options-view--readonly",children:r(dr,{view:o,giftOptions:c,giftWrappingConfig:i,readOnlyFormOrderView:N})}),r(ir,{view:o,productName:e&&"name"in e?e==null?void 0:e.name:"",showModal:t,giftWrappingConfig:i,setShowModal:()=>W(!1),updateGiftOptions:g}),o==="product"&&p?V(!1):null,o==="order"&&p?r(We,{variant:"secondary",children:V(!0)}):null]})]})},U={recipientName:"",senderName:"",message:""},cr={giftReceiptIncluded:!1,printedCardIncluded:!1,isGiftWrappingSelected:!1},Re=(e,o)=>{var c,t;if(!o)return!!((c=H.config)!=null&&c.allowGiftMessageOnOrder);const l=((t=H.config)==null?void 0:t.allowGiftMessageOnOrderItems)??!1;return typeof(e==null?void 0:e.giftMessageAvailable)=="boolean"?e==null?void 0:e.giftMessageAvailable:l},ar=(e,o)=>{const{allowGiftWrappingOnOrder:l,allowGiftWrappingOnOrderItems:c,allowGiftMessageOnOrder:t,allowGiftMessageOnOrderItems:p,allowGiftReceipt:u,allowPrintedCard:n}=H.config||{},d=!p&&!c&&!Re(o,!0),m=!l&&!t&&!u&&!n;return!!(e==="product"&&d||e==="order"&&m)},fr=({item:e,view:o,dataSource:l,initialLoading:c,handleItemsLoading:t,handleItemsError:p,onItemUpdate:u,onGiftOptionsChange:n})=>{var ae,fe,pe,ue,ge,me;const d=o==="product",m=X({requiredFieldError:"Cart.GiftOptions.formText.requiredFieldError"}),[O,i]=P(()=>c),[N,M]=P({isGiftReceiptVisible:!0,isPrintedCartVisible:!0,isGiftWrappingVisible:!0,isGiftOptionsVisible:!0}),[b,G]=P(!0),[W,g]=P(!1),[T,_]=P(!1),[v,V]=P(!1),[$,S]=P(!1),[z,q]=P(!1),[I,ke]=P([]),[h,Se]=P(null),[Ie,ee]=P(U),[y,ce]=P(()=>({giftWrappingId:"",...U,...cr})),re=((ae=y.recipientName)==null?void 0:ae.trim())&&((fe=y.senderName)==null?void 0:fe.trim())&&((pe=y.message)==null?void 0:pe.trim()),Y=!((ue=y.recipientName)!=null&&ue.trim())&&!((ge=y.senderName)!=null&&ge.trim())&&!((me=y.message)!=null&&me.trim()),k=K(async s=>{switch(g(o==="order"),_(!0),o){case"product":{"uid"in e&&(t==null||t(e.uid,!0),p==null||p(e.uid));const{recipientName:a,senderName:F,message:C,giftWrappingId:x,isGiftWrappingSelected:w}=s,E={gift_message:{to:a??"",from:F??"",message:C??""},gift_wrapping_id:w?x:null};"uid"in e&&"quantity"in e&&await rr([{uid:e.uid,quantity:e.quantity,giftOptions:E}]).then(()=>{u==null||u({item:e})}).finally(()=>{t==null||t(e.uid,!1),_(!1),V(!1),g(!1)}).catch(R=>{console.warn(R)})}break;case"order":await tr(s).finally(()=>{_(!1),V(!1),g(!1)});break;default:console.error('Incorrect "view" prop value provided for GiftOptions container (storefront-cart)');break}},[p,t,e,u,o]),te=K((s,a,F={})=>{ce(C=>{const x=A=>A in C,w=A=>x(A)?C[A]:void 0;if(!(w(s)!==a||Object.keys(F).some(A=>w(A)!==F[A])))return n==null||n(C),C;const R={...C,[s]:a,...F};return!R.recipientName&&!R.senderName&&!R.message&&S(!0),(typeof a=="boolean"||["giftWrappingId","giftReceiptIncluded","printedCardIncluded"].includes(s))&&(typeof n=="function"?n(R):k(R)),V(!0),n==null||n(R),R})},[k,n]),Ae=K(async()=>{T||typeof n!="function"&&(Y&&$&&(ee(U),S(!1),await k(y)),v&&re&&(S(!0),await k(y)))},[k,y,v,Y,$,T,n]),He=K(async s=>{if(T||typeof n=="function")return;const{name:a,value:F}=s.target;ee(C=>({...C,[a]:F.trim()?"":m.requiredFieldError})),Y&&$&&(ee(U),S(!1),await k(y)),v&&re&&await k(y)},[T,Y,$,v,re,m,k,y,n]),Be=K(s=>{const a=s.target,F=a.name,C=a.type==="checkbox"?a.checked:a.value;te(F,C)},[te]);se(()=>{if(d)return;const s=er.on(l==="cart"?"cart/data":"order/data",a=>{var x,w;Se(a);const F=(x=a==null?void 0:a.items)==null?void 0:x.every(({giftWrappingAvailable:E})=>E),C=(w=a==null?void 0:a.cartGiftWrapping)==null?void 0:w.some(E=>E.selected);!F&&C&&k({...y,giftWrappingId:"",isGiftWrappingSelected:!1})},{eager:!0});return()=>{s==null||s.off()}},[k,l,y,d]);const L=ne(()=>{var Ge,ye,Te,Fe,we,be;if(!h&&!e)return null;const s=d?(Ge=e==null?void 0:e.productGiftWrapping)==null?void 0:Ge.map(j=>{var _e;return{...j,price:e!=null&&e.giftWrappingPrice&&((_e=e==null?void 0:e.giftWrappingPrice)==null?void 0:_e.value)>0?e.giftWrappingPrice:j.price}}):(h==null?void 0:h.cartGiftWrapping)||[],a=s==null?void 0:s.find(j=>j.selected),F=(a==null?void 0:a.uid)??((ye=s==null?void 0:s[0])==null?void 0:ye.uid),C=!!a,x=d?e.giftMessage:h==null?void 0:h.giftMessage,w=h==null?void 0:h.printedCardIncluded,E=h==null?void 0:h.giftReceiptIncluded,R=Re(e,d),A=(Te=H.config)==null?void 0:Te.allowGiftWrappingOnOrder,qe=(Fe=H.config)==null?void 0:Fe.allowGiftReceipt,Le=(we=H.config)==null?void 0:we.allowPrintedCard,je=(be=h==null?void 0:h.items)==null?void 0:be.every(j=>j.giftWrappingAvailable),Ke=e==null?void 0:e.giftWrappingAvailable,Oe=d?!1:!!qe,he=d?!1:!!Le,Ce=d?!!Ke&&!!s.length:!!A&&!!s.length&&!!je;return M({isGiftReceiptVisible:Oe,isPrintedCartVisible:he,isGiftWrappingVisible:Ce,isGiftOptionsVisible:!(!Oe&&!he&&!Ce)}),G(R),{...e&&"uid"in e?{itemId:e.uid}:{},...d?{}:{printedCardIncluded:w,giftReceiptIncluded:E},...x,giftWrappingId:F,isGiftWrappingSelected:C,giftWrappingOptions:s}},[h,e,d]);se(()=>{if(!L)return;const{giftWrappingOptions:s}=L;ce(a=>{const F=x=>x in a,C=Object.keys(L).reduce((x,w)=>F(w)&&a[w]!==L[w]?{...x,[w]:L[w]}:x,{});return Object.keys(C).length>0?{...a,...C}:a}),s!=null&&s.length&&ke(s),i(!1)},[L]);const Ee=ne(()=>Object.entries(y).filter(([s])=>s!=="itemId"&&s!=="giftWrappingId").some(([,s])=>!!s),[y]),ze=ne(()=>{var s;return!O&&!!((s=H)!=null&&s.config)&&ar(o,e)},[e,O,o]);return{loading:O,giftOptions:y,showModal:z,errorsField:Ie,updateLoading:W,cartData:h,fieldsDisabled:T,isGiftOptionsApplied:Ee,giftWrappingConfig:I,setFieldsDisabled:_,handleFormMouseLeave:Ae,onInputChange:Be,updateGiftOptions:te,setShowModal:q,handleBlur:He,isGiftMessageVisible:b,areGiftOptionsVisible:N,isGiftOptionsHidden:ze}},Wr=({item:e,view:o="order",readOnlyFormOrderView:l="primary",dataSource:c="cart",isEditable:t=!0,initialLoading:p=!0,handleItemsLoading:u,handleItemsError:n,onItemUpdate:d,onGiftOptionsChange:m})=>{const{isGiftMessageVisible:O,areGiftOptionsVisible:i,loading:N,giftOptions:M,showModal:b,errorsField:G,updateLoading:W,cartData:g,isGiftOptionsApplied:T,fieldsDisabled:_,giftWrappingConfig:v,handleFormMouseLeave:V,updateGiftOptions:$,setShowModal:S,onInputChange:z,handleBlur:q,isGiftOptionsHidden:I}=fr({item:e,view:o,dataSource:c,initialLoading:p,handleItemsLoading:u,handleItemsError:n,onItemUpdate:d,onGiftOptionsChange:m});return I?null:r(lr,{item:e,view:o,loading:N,onBlur:q,giftOptions:M,showModal:b,isEditable:t,errorsField:G,setShowModal:S,updateLoading:W,updateGiftOptions:$,cartData:g,isGiftOptionsApplied:T,fieldsDisabled:_,giftWrappingConfig:v,handleFormMouseLeave:V,readOnlyFormOrderView:l,onInputChange:z,isGiftMessageVisible:O,areGiftOptionsVisible:i})};export{Wr as GiftOptions,Wr as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/GiftOptions/GiftOptions.d.ts b/scripts/__dropins__/storefront-cart/containers/GiftOptions/GiftOptions.d.ts new file mode 100644 index 0000000000..9d8f3fae31 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftOptions/GiftOptions.d.ts @@ -0,0 +1,20 @@ +import { Item } from '../../data/models'; +import { Container } from '@dropins/tools/types/elsie/src/lib'; +import { GiftOptionsViewProps, GiftOptionsDataSourcesProps, GiftFormDataType, ProductGiftOptionsConfig, GiftOptionsReadOnlyViewProps } from '../../types'; + +export interface GiftOptionsProps { + item: Item | ProductGiftOptionsConfig; + view?: GiftOptionsViewProps; + readOnlyFormOrderView: GiftOptionsReadOnlyViewProps; + dataSource?: GiftOptionsDataSourcesProps; + isEditable?: boolean; + initialLoading?: boolean; + handleItemsLoading?: (uid: string, state: boolean) => void; + handleItemsError?: (uid: string, message?: string) => void; + onItemUpdate?: ({ item }: { + item: Item; + }) => void; + onGiftOptionsChange?: (data: GiftFormDataType) => void; +} +export declare const GiftOptions: Container; +//# sourceMappingURL=GiftOptions.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/containers/GiftOptions/index.d.ts b/scripts/__dropins__/storefront-cart/containers/GiftOptions/index.d.ts new file mode 100644 index 0000000000..74fc33341c --- /dev/null +++ b/scripts/__dropins__/storefront-cart/containers/GiftOptions/index.d.ts @@ -0,0 +1,19 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './GiftOptions'; +export { GiftOptions as default } from './GiftOptions'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/containers/MiniCart.js b/scripts/__dropins__/storefront-cart/containers/MiniCart.js index b673db6a4a..eaff7f06d8 100644 --- a/scripts/__dropins__/storefront-cart/containers/MiniCart.js +++ b/scripts/__dropins__/storefront-cart/containers/MiniCart.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as i,jsxs as c,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{useState as G,useEffect as X,useCallback as A}from"@dropins/tools/preact-compat.js";import{classes as v,VComponent as b,Slot as H}from"@dropins/tools/lib.js";import{g as R}from"../chunks/persisted-data.js";import{events as j}from"@dropins/tools/event-bus.js";import{Price as C,Button as I}from"@dropins/tools/components.js";/* empty css */import{useText as k}from"@dropins/tools/i18n.js";import{s as d}from"../chunks/resetCart.js";import{p as w}from"../chunks/acdl.js";import{u as F}from"../chunks/updateProductsFromCart.js";import"../chunks/CartSummaryGrid.js";import{C as O}from"../chunks/CartSummaryList.js";import"../chunks/OrderSummary.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/EmptyCart.js";import"../chunks/ChevronDown.js";import"../chunks/getEstimatedTotals.js";import"../chunks/OrderSummaryLine.js";import"../chunks/Coupon.js";const B=({className:h,products:s,subtotal:u,subtotalExcludingTaxes:a,ctas:l,...m})=>{const o=k({subtotal:"Cart.MiniCart.subtotal",subtotalExcludingTaxes:"Cart.MiniCart.subtotalExcludingTaxes"});return i("div",{...m,className:v(["cart-mini-cart",h]),children:s&&c(S,{children:[i("div",{className:"cart-mini-cart__products","data-testid":"mini-cart-products-wrapper",children:s}),c("div",{className:"cart-mini-cart__footer","data-testid":"mini-cart-subtotals",children:[u&&c("div",{className:"cart-mini-cart__footer__estimated-total","data-testid":"mini-cart-subtotal",children:[o.subtotal,i(b,{node:u})]}),a&&c("div",{className:"cart-mini-cart__footer__estimated-total-excluding-taxes","data-testid":"mini-cart-subtotal-excluding-taxes",children:[o.subtotalExcludingTaxes,i(b,{node:a,className:v(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]}),l&&i(b,{node:l,className:"cart-mini-cart__footer__ctas"})]})]})})},V=({children:h,initialData:s=null,hideFooter:u=!0,slots:a,routeProduct:l,routeCart:m,routeCheckout:o,routeEmptyCartCTA:L,showDiscount:N,showSavings:D,...M})=>{var f,_,g;const[t,Q]=G(s),e=(f=d.config)==null?void 0:f.shoppingCartDisplaySetting;X(()=>{const r=j.on("cart/data",p=>{Q(p)},{eager:!0});return()=>{r==null||r.off()}},[]);const x=k({cartLink:"Cart.MiniCart.cartLink",checkoutLink:"Cart.MiniCart.checkoutLink"}),y=(r,p)=>F([{uid:r,quantity:p}]),T=r=>y(r,0),n=t==null?void 0:t.hasOutOfStockItems,E=A(()=>{t&&!n&&w(t,d.locale)},[t,n]),P=i(H,{name:"ProductList",slot:a==null?void 0:a.ProductList,context:{itemQuantityUpdateHandler:y,itemRemoveHandler:T,totalQuantity:t==null?void 0:t.totalQuantity},children:i(O,{"data-testid":"default-cart-summary-list",routeProduct:l,routeEmptyCartCTA:L,initialData:t,maxItems:(_=d.config)==null?void 0:_.miniCartMaxItemsDisplay,showMaxItems:!!((g=d.config)!=null&&g.miniCartMaxItemsDisplay),hideHeading:!(t!=null&&t.totalQuantity),hideFooter:u,enableRemoveItem:!0,showDiscount:N,showSavings:D})}),U=()=>(e==null?void 0:e.subtotal)==="INCLUDING_TAX"||(e==null?void 0:e.subtotal)==="INCLUDING_EXCLUDING_TAX"?{amount:t==null?void 0:t.subtotal.includingTax.value,currency:t==null?void 0:t.subtotal.includingTax.currency,"data-testid":"subtotal-including-tax",style:{font:"inherit"}}:{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-excluding-tax",style:{font:"inherit"}};return i(B,{...M,subtotal:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&i(C,{...U()}):void 0,subtotalExcludingTaxes:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&((e==null?void 0:e.subtotal)==="INCLUDING_EXCLUDING_TAX"?i(C,{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-including-excluding-tax",style:{font:"inherit"}}):void 0):void 0,ctas:t!=null&&t.totalQuantity?c("div",{children:[o&&i(I,{"data-testid":"route-checkout-button",variant:"primary",href:n?void 0:o(),disabled:n,"aria-disabled":n,onClick:E,children:x.checkoutLink}),m&&i(I,{"data-testid":"route-cart-button",variant:"tertiary",href:m(),children:x.cartLink})]}):void 0,products:P})};V.getInitialData=async function(){return R()};export{V as MiniCart,V as default}; +import{jsx as i,jsxs as s,Fragment as X}from"@dropins/tools/preact-jsx-runtime.js";import{useState as A,useEffect as H,useCallback as R}from"@dropins/tools/preact-compat.js";import{classes as h,VComponent as u,Slot as _}from"@dropins/tools/lib.js";import{g as j}from"../chunks/persisted-data.js";import{events as w}from"@dropins/tools/event-bus.js";import{Price as I,Button as N}from"@dropins/tools/components.js";/* empty css */import{useText as D}from"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";import{s as b}from"../chunks/resetCart.js";import{p as O}from"../chunks/acdl.js";import{u as B}from"../chunks/updateProductsFromCart.js";import"../chunks/CartSummaryGrid.js";import{C as V}from"../chunks/CartSummaryList.js";import"../chunks/OrderSummary.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/EmptyCart.js";import"../chunks/ChevronDown.js";import"../chunks/getEstimatedTotals.js";import"../chunks/OrderSummaryLine.js";import"../chunks/ChevronUp.js";import"../chunks/Coupon.js";import"../chunks/GiftCard.js";const $=({className:f,products:m,productListFooter:l,subtotal:e,subtotalExcludingTaxes:d,preCheckoutSection:o,ctas:n,...x})=>{const p=D({subtotal:"Cart.MiniCart.subtotal",subtotalExcludingTaxes:"Cart.MiniCart.subtotalExcludingTaxes"});return i("div",{...x,className:h(["cart-mini-cart",f]),children:m&&s(X,{children:[i("div",{className:"cart-mini-cart__products","data-testid":"mini-cart-products-wrapper",children:m}),l&&i("div",{className:h(["cart-mini-cart__productListFooter"]),"data-testid":"mini-cart-product-list-footer",children:i(u,{node:l})}),s("div",{className:"cart-mini-cart__footer","data-testid":"mini-cart-subtotals",children:[e&&s("div",{className:"cart-mini-cart__footer__estimated-total","data-testid":"mini-cart-subtotal",children:[p.subtotal,i(u,{node:e})]}),d&&s("div",{className:"cart-mini-cart__footer__estimated-total-excluding-taxes","data-testid":"mini-cart-subtotal-excluding-taxes",children:[p.subtotalExcludingTaxes,i(u,{node:d,className:h(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]}),o&&i("div",{className:h(["cart-mini-cart__preCheckoutSection"]),"data-testid":"mini-cart-pre-checkout-section",children:i(u,{node:o})}),n&&i(u,{node:n,className:"cart-mini-cart__footer__ctas"})]})]})})},q=({children:f,initialData:m=null,hideFooter:l=!0,slots:e,routeProduct:d,routeCart:o,routeCheckout:n,routeEmptyCartCTA:x,showDiscount:p,showSavings:P,...S})=>{var v,k,L;const[t,M]=A(m),a=(v=b.config)==null?void 0:v.shoppingCartDisplaySetting;H(()=>{const r=w.on("cart/data",y=>{M(y)},{eager:!0});return()=>{r==null||r.off()}},[]);const g=D({cartLink:"Cart.MiniCart.cartLink",checkoutLink:"Cart.MiniCart.checkoutLink"}),C=(r,y)=>B([{uid:r,quantity:y}]),Q=r=>C(r,0),c=t==null?void 0:t.hasOutOfStockItems,T=R(()=>{t&&!c&&O(t,b.locale)},[t,c]),E=i(_,{name:"ProductList",slot:e==null?void 0:e.ProductList,context:{itemQuantityUpdateHandler:C,itemRemoveHandler:Q,totalQuantity:t==null?void 0:t.totalQuantity},children:i(V,{"data-testid":"default-cart-summary-list",routeProduct:d,routeEmptyCartCTA:x,initialData:t,maxItems:(k=b.config)==null?void 0:k.miniCartMaxItemsDisplay,showMaxItems:!!((L=b.config)!=null&&L.miniCartMaxItemsDisplay),hideHeading:!(t!=null&&t.totalQuantity),hideFooter:l,enableRemoveItem:!0,showDiscount:p,showSavings:P})}),U=r=>i(_,{name:"ProductListFooter",slot:e==null?void 0:e.ProductListFooter,context:{data:r}}),F=r=>i(_,{name:"PreCheckoutSection",slot:e==null?void 0:e.PreCheckoutSection,context:{data:r}}),G=()=>(a==null?void 0:a.subtotal)==="INCLUDING_TAX"||(a==null?void 0:a.subtotal)==="INCLUDING_EXCLUDING_TAX"?{amount:t==null?void 0:t.subtotal.includingTax.value,currency:t==null?void 0:t.subtotal.includingTax.currency,"data-testid":"subtotal-including-tax",style:{font:"inherit"}}:{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-excluding-tax",style:{font:"inherit"}};return i($,{...S,productListFooter:U(t),subtotal:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&i(I,{...G()}):void 0,subtotalExcludingTaxes:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&((a==null?void 0:a.subtotal)==="INCLUDING_EXCLUDING_TAX"?i(I,{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-including-excluding-tax",style:{font:"inherit"}}):void 0):void 0,preCheckoutSection:F(t),ctas:t!=null&&t.totalQuantity?s("div",{children:[n&&i(N,{"data-testid":"route-checkout-button",variant:"primary",href:c?void 0:n(),disabled:c,"aria-disabled":c,onClick:T,children:g.checkoutLink}),o&&i(N,{"data-testid":"route-cart-button",variant:"tertiary",href:o(),children:g.cartLink})]}):void 0,products:E})};q.getInitialData=async function(){return j()};export{q as MiniCart,q as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/MiniCart/MiniCart.d.ts b/scripts/__dropins__/storefront-cart/containers/MiniCart/MiniCart.d.ts index 917c7d1df8..de98282be9 100644 --- a/scripts/__dropins__/storefront-cart/containers/MiniCart/MiniCart.d.ts +++ b/scripts/__dropins__/storefront-cart/containers/MiniCart/MiniCart.d.ts @@ -9,6 +9,8 @@ export interface MiniCartProps extends HTMLAttributes { routeEmptyCartCTA?: () => string; slots?: { ProductList?: SlotProps; + ProductListFooter?: SlotProps; + PreCheckoutSection?: SlotProps; }; hideFooter?: boolean; displayAllItems?: boolean; diff --git a/scripts/__dropins__/storefront-cart/containers/OrderSummary.js b/scripts/__dropins__/storefront-cart/containers/OrderSummary.js index 658e9aa06d..290828a58e 100644 --- a/scripts/__dropins__/storefront-cart/containers/OrderSummary.js +++ b/scripts/__dropins__/storefront-cart/containers/OrderSummary.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{O as g,O as h}from"../chunks/OrderSummary.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getEstimatedTotals.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"@dropins/tools/components.js";/* empty css */import"../chunks/OrderSummaryLine.js";import"../chunks/ChevronDown.js";import"@dropins/tools/i18n.js";import"../chunks/Coupon.js";export{g as OrderSummary,h as default}; +import{O as k,O as n}from"../chunks/OrderSummary.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getEstimatedTotals.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";/* empty css */import"../chunks/OrderSummaryLine.js";import"../chunks/ChevronDown.js";import"../chunks/ChevronUp.js";import"@dropins/tools/i18n.js";import"../chunks/Coupon.js";import"../chunks/GiftCard.js";export{k as OrderSummary,n as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/OrderSummary/OrderSummary.d.ts b/scripts/__dropins__/storefront-cart/containers/OrderSummary/OrderSummary.d.ts index e0e3403fe0..9fc9a28d9a 100644 --- a/scripts/__dropins__/storefront-cart/containers/OrderSummary/OrderSummary.d.ts +++ b/scripts/__dropins__/storefront-cart/containers/OrderSummary/OrderSummary.d.ts @@ -11,8 +11,10 @@ export interface OrderSummaryProps extends HTMLAttributes { slots?: { EstimateShipping?: SlotProps; Coupons?: SlotProps; + GiftCards?: SlotProps; }; enableCoupons?: boolean; + enableGiftCards?: boolean; errors: boolean; showTotalSaved?: boolean; updateLineItems?: (lineItems: Array) => Array; diff --git a/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine.js b/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine.js index 4a4510c1c8..af5b80fa61 100644 --- a/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine.js +++ b/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{O as e,O}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";export{e as OrderSummaryLine,O as default}; +import{O,O as d}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact-hooks.js";export{O as OrderSummaryLine,d as default}; diff --git a/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine/OrderSummaryLine.d.ts b/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine/OrderSummaryLine.d.ts index 20539fa9d4..9c909de0d0 100644 --- a/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine/OrderSummaryLine.d.ts +++ b/scripts/__dropins__/storefront-cart/containers/OrderSummaryLine/OrderSummaryLine.d.ts @@ -2,8 +2,8 @@ import { HTMLAttributes } from 'preact/compat'; import { Container } from '@dropins/tools/types/elsie/src/lib'; import { VNode } from 'preact'; -export interface OrderSummaryLineProps extends HTMLAttributes { - label: string; +export interface OrderSummaryLineProps extends Omit, 'label'> { + label: VNode | string; price: VNode>; classSuffixes?: Array; labelClassSuffix?: string; diff --git a/scripts/__dropins__/storefront-cart/containers/index.d.ts b/scripts/__dropins__/storefront-cart/containers/index.d.ts index d18c60a0c6..da611c378e 100644 --- a/scripts/__dropins__/storefront-cart/containers/index.d.ts +++ b/scripts/__dropins__/storefront-cart/containers/index.d.ts @@ -22,4 +22,6 @@ export * from './OrderSummary'; export * from './EmptyCart'; export * from './Coupons'; export * from './OrderSummaryLine'; +export * from './GiftCards'; +export * from './GiftOptions'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/data/models/cart-model.d.ts b/scripts/__dropins__/storefront-cart/data/models/cart-model.d.ts index 5a203b8b52..97e50ca151 100644 --- a/scripts/__dropins__/storefront-cart/data/models/cart-model.d.ts +++ b/scripts/__dropins__/storefront-cart/data/models/cart-model.d.ts @@ -15,6 +15,29 @@ * from Adobe. *******************************************************************/ export interface CartModel { + totalGiftOptions: { + giftWrappingForItems: Price; + giftWrappingForItemsInclTax: Price; + giftWrappingForOrder: Price; + giftWrappingForOrderInclTax: Price; + printedCard: Price; + printedCardInclTax: Price; + }; + cartGiftWrapping: { + uid: string; + design: string; + selected: boolean; + image: WrappingImage; + price: Price; + }[]; + giftReceiptIncluded: boolean; + printedCardIncluded: boolean; + giftMessage: { + recipientName: string; + senderName: string; + message: string; + }; + appliedGiftCards: AppliedGiftCardProps[]; id: string; totalQuantity: number; totalUniqueItems: number; @@ -48,6 +71,12 @@ export interface CartModel { hasFullyOutOfStockItems?: boolean; appliedCoupons?: Coupon[]; } +export interface AppliedGiftCardProps { + code: string; + appliedBalance: Price; + currentBalance: Price; + expirationDate: string; +} interface TotalPriceModifier { amount: Price; label: string; @@ -58,6 +87,24 @@ interface FixedProductTax { label: string; } export interface Item { + giftWrappingAvailable: boolean; + giftWrappingPrice: { + currency: string; + value: number; + }; + productGiftWrapping: { + uid: string; + design: string; + selected: boolean; + image: WrappingImage; + price: Price; + }[]; + giftMessage: { + recipientName: string; + senderName: string; + message: string; + }; + giftMessageAvailable: boolean | null; taxedPrice: Price; rowTotal: Price; rowTotalIncludingTax: Price; @@ -135,5 +182,9 @@ interface Attribute { interface Coupon { code: string; } +export interface WrappingImage { + url: string; + design: string; +} export {}; //# sourceMappingURL=cart-model.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/data/models/gift-card-account.d.ts b/scripts/__dropins__/storefront-cart/data/models/gift-card-account.d.ts new file mode 100644 index 0000000000..703f584c6c --- /dev/null +++ b/scripts/__dropins__/storefront-cart/data/models/gift-card-account.d.ts @@ -0,0 +1,8 @@ +import { Price } from './cart-model'; + +export type GiftCardAccountResponse = { + code: string; + balance: Price; + expirationDate: string; +}; +//# sourceMappingURL=gift-card-account.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/data/models/index.d.ts b/scripts/__dropins__/storefront-cart/data/models/index.d.ts index ee523c8c0e..a4f4e33cd9 100644 --- a/scripts/__dropins__/storefront-cart/data/models/index.d.ts +++ b/scripts/__dropins__/storefront-cart/data/models/index.d.ts @@ -17,4 +17,5 @@ export * from './cart-model'; export * from './shipping-models'; export * from './store-models'; +export * from './gift-card-account'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/data/models/store-models.d.ts b/scripts/__dropins__/storefront-cart/data/models/store-models.d.ts index fe9932b556..078479c595 100644 --- a/scripts/__dropins__/storefront-cart/data/models/store-models.d.ts +++ b/scripts/__dropins__/storefront-cart/data/models/store-models.d.ts @@ -1,19 +1,5 @@ -/******************************************************************** - * ADOBE CONFIDENTIAL - * __________________ - * - * Copyright 2024 Adobe - * All Rights Reserved. - * - * NOTICE: All information contained herein is, and remains - * the property of Adobe and its suppliers, if any. The intellectual - * and technical concepts contained herein are proprietary to Adobe - * and its suppliers and are protected by all applicable intellectual - * property laws, including trade secret and copyright laws. - * Dissemination of this information or reproduction of this material - * is strictly forbidden unless prior written permission is obtained - * from Adobe. - *******************************************************************/ +import { Price } from './cart-model'; + export interface StoreConfigModel { displayMiniCart: boolean; miniCartMaxItemsDisplay: number; @@ -34,5 +20,14 @@ export interface StoreConfigModel { zeroTax: boolean; }; useConfigurableParentThumbnail: boolean; + allowGiftWrappingOnOrder: boolean | null; + allowGiftWrappingOnOrderItems: boolean | null; + allowGiftMessageOnOrder: boolean | null; + allowGiftMessageOnOrderItems: boolean | null; + allowGiftReceipt: boolean; + allowPrintedCard: boolean; + printedCardPrice: Price; + cartGiftWrapping: string; + cartPrintedCard: string; } //# sourceMappingURL=store-models.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/cartModel.d.ts b/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/cartModel.d.ts index 11cb8f6f3a..80a02e7c33 100644 --- a/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/cartModel.d.ts +++ b/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/cartModel.d.ts @@ -3,4 +3,18 @@ import { CartModel } from '../../models/cart-model'; export declare const cart: CartModel; export declare const sampleDataCart: CartModel; export declare const sampleDataWithCoupons: CartModel; +export declare const sampleDataWithGiftCodes: CartModel; +export declare const sampleGiftWrappingConfig: { + design: string; + uid: string; + selected: boolean; + image: { + url: string; + label: string; + }; + price: { + currency: string; + value: number; + }; +}[]; //# sourceMappingURL=cartModel.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/productTypesData.d.ts b/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/productTypesData.d.ts index 60ac98bf2f..d7448a6a21 100644 --- a/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/productTypesData.d.ts +++ b/scripts/__dropins__/storefront-cart/data/transforms/__fixtures__/productTypesData.d.ts @@ -28,6 +28,7 @@ declare const bundleOptions: { }[]; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -93,6 +94,7 @@ declare const bundleOptionsEmpty: { bundle_options: never[]; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -160,6 +162,7 @@ declare const giftCardPhysical: { sender_name: string; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -229,6 +232,7 @@ declare const giftCardVirtual: { sender_name: string; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -292,6 +296,7 @@ declare const giftCardVirtual: { declare const simple: { uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -374,6 +379,7 @@ declare const simpleCustomizable: { })[]; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -466,6 +472,7 @@ declare const configurable: { }; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -576,6 +583,7 @@ declare const configurableCustomizable: { }; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -640,6 +648,7 @@ declare const giftCard: { __typename: string; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -708,6 +717,7 @@ declare const downloadbleWithMultipleLinks: { }[]; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -804,6 +814,7 @@ declare const simpleLowInventory: { }; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -876,6 +887,7 @@ declare const complexInsufficientQuantity: { }[]; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -948,6 +960,7 @@ declare const complexInsufficientQuantityGeneralMessage: { }[]; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -1030,6 +1043,7 @@ declare const complexWithProductAttributes: { }[]; uid: string; quantity: number; + gift_message_available: string; errors: null; prices: { price: { @@ -1122,6 +1136,7 @@ declare const simpleWithNoDiscount: { }; uid: string; quantity: number; + gift_message_available: string; errors: null; }; export { bundleOptions, bundleOptionsEmpty, giftCardPhysical, giftCardVirtual, simple, simpleCustomizable, configurable, configurableCustomizable, giftCard, downloadbleWithMultipleLinks, simpleLowInventory, complexInsufficientQuantity, complexInsufficientQuantityGeneralMessage, complexWithProductAttributes, simpleWithNoDiscount, }; diff --git a/scripts/__dropins__/storefront-cart/data/transforms/index.d.ts b/scripts/__dropins__/storefront-cart/data/transforms/index.d.ts index 7a549a6980..340b9436c5 100644 --- a/scripts/__dropins__/storefront-cart/data/transforms/index.d.ts +++ b/scripts/__dropins__/storefront-cart/data/transforms/index.d.ts @@ -16,4 +16,5 @@ *******************************************************************/ export * from './transform-cart'; export * from './transform-store-config'; +export * from './transform-gift-card-account'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/data/transforms/transform-gift-card-account.d.ts b/scripts/__dropins__/storefront-cart/data/transforms/transform-gift-card-account.d.ts new file mode 100644 index 0000000000..d02e82e969 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/data/transforms/transform-gift-card-account.d.ts @@ -0,0 +1,4 @@ +import { GiftCardAccountResponse } from '../models'; + +export declare function transformGiftCardAccount(data: any): GiftCardAccountResponse | null; +//# sourceMappingURL=transform-gift-card-account.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/fragments.js b/scripts/__dropins__/storefront-cart/fragments.js index c41642ee5b..79ea4b064f 100644 --- a/scripts/__dropins__/storefront-cart/fragments.js +++ b/scripts/__dropins__/storefront-cart/fragments.js @@ -29,7 +29,7 @@ const e = ` } } } -`, t = ` +`, _ = ` fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption { type customizable_option_uid @@ -45,7 +45,47 @@ const e = ` } } } -`, a = (``), r = `fragment CART_ITEM_FRAGMENT on CartItemInterface { +`, a = ``, t = `fragment APPLIED_GIFT_CARDS_FRAGMENT on AppliedGiftCard { + __typename + code + applied_balance { + value + currency + } + current_balance { + value + currency + } + expiration_date +}`, r = `fragment GIFT_MESSAGE_FRAGMENT on GiftMessage { + __typename + from + to + message +}`, i = (`fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + } + price { + value + currency + } +}`), n = `fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + label + } + price { + currency + value + } +}`, l = `fragment CART_ITEM_FRAGMENT on CartItemInterface { __typename uid quantity @@ -102,6 +142,12 @@ const e = ` product { name sku + gift_message_available + gift_wrapping_available + gift_wrapping_price { + currency + value + } thumbnail { url label @@ -134,11 +180,29 @@ const e = ` } } ... on SimpleCartItem { + available_gift_wrapping { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } customizable_options { ...CUSTOMIZABLE_OPTIONS_FRAGMENT } } ... on ConfigurableCartItem { + available_gift_wrapping { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } configurable_options { configurable_product_option_uid option_label @@ -162,6 +226,15 @@ const e = ` } } ... on BundleCartItem { + available_gift_wrapping { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } bundle_options { uid label @@ -185,12 +258,55 @@ const e = ` } } ${e} -${t} -${a}`, n = `fragment CART_FRAGMENT on Cart { +${_} +${a} +${i} +${r} +${n}`, c = `fragment CART_FRAGMENT on Cart { id total_quantity is_virtual + applied_gift_cards { + ...APPLIED_GIFT_CARDS_FRAGMENT + } + gift_receipt_included + printed_card_included + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } + available_gift_wrappings { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } prices { + gift_options { + gift_wrapping_for_items { + currency + value + } + gift_wrapping_for_items_incl_tax { + currency + value + } + gift_wrapping_for_order { + currency + value + } + gift_wrapping_for_order_incl_tax { + currency + value + } + printed_card { + currency + value + } + printed_card_incl_tax { + currency + value + } + } subtotal_with_discount_excluding_tax { currency value @@ -248,9 +364,14 @@ ${a}`, n = `fragment CART_FRAGMENT on Cart { postcode } } -${r}`; +${l} +${t}`; export { -n as CART_FRAGMENT, -r as CART_ITEM_FRAGMENT, -a as DOWNLOADABLE_CART_ITEMS_FRAGMENT +t as APPLIED_GIFT_CARDS_FRAGMENT, +n as AVAILABLE_GIFT_WRAPPING_FRAGMENT, +c as CART_FRAGMENT, +l as CART_ITEM_FRAGMENT, +a as DOWNLOADABLE_CART_ITEMS_FRAGMENT, +r as GIFT_MESSAGE_FRAGMENT, +i as GIFT_WRAPPING_FRAGMENT }; \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/fragments.original.js b/scripts/__dropins__/storefront-cart/fragments.original.js index daa8effdcd..ca0fa696dc 100644 --- a/scripts/__dropins__/storefront-cart/fragments.original.js +++ b/scripts/__dropins__/storefront-cart/fragments.original.js @@ -31,7 +31,7 @@ const e=` } } } -`,t=` +`,_=` fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption { type customizable_option_uid @@ -57,7 +57,55 @@ const e=` ...CUSTOMIZABLE_OPTIONS_FRAGMENT } } +`,t=` + fragment APPLIED_GIFT_CARDS_FRAGMENT on AppliedGiftCard { + __typename + code + applied_balance { + value + currency + } + current_balance { + value + currency + } + expiration_date + } `,r=` + fragment GIFT_MESSAGE_FRAGMENT on GiftMessage { + __typename + from + to + message + } +`,i=` + fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + } + price { + value + currency + } + } +`,n=` + fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + label + } + price { + currency + value + } + } +`,l=` fragment CART_ITEM_FRAGMENT on CartItemInterface { __typename uid @@ -117,6 +165,12 @@ const e=` product { name sku + gift_message_available + gift_wrapping_available + gift_wrapping_price { + currency + value + } thumbnail { url label @@ -149,11 +203,29 @@ const e=` } } ... on SimpleCartItem { + available_gift_wrapping { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } customizable_options { ...CUSTOMIZABLE_OPTIONS_FRAGMENT } } ... on ConfigurableCartItem { + available_gift_wrapping { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } configurable_options { configurable_product_option_uid option_label @@ -178,6 +250,15 @@ const e=` } ...DOWNLOADABLE_CART_ITEMS_FRAGMENT ... on BundleCartItem { + available_gift_wrapping { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } bundle_options { uid label @@ -202,14 +283,57 @@ const e=` } ${e} - ${t} + ${_} ${a} -`,n=` + ${i} + ${r} + ${n} +`,c=` fragment CART_FRAGMENT on Cart { id total_quantity is_virtual + applied_gift_cards { + ...APPLIED_GIFT_CARDS_FRAGMENT + } + gift_receipt_included + printed_card_included + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } + available_gift_wrappings { + ...AVAILABLE_GIFT_WRAPPING_FRAGMENT + } prices { + gift_options { + gift_wrapping_for_items { + currency + value + } + gift_wrapping_for_items_incl_tax { + currency + value + } + gift_wrapping_for_order { + currency + value + } + gift_wrapping_for_order_incl_tax { + currency + value + } + printed_card { + currency + value + } + printed_card_incl_tax { + currency + value + } + } subtotal_with_discount_excluding_tax { currency value @@ -272,5 +396,6 @@ const e=` } } - ${r} -`;export{n as CART_FRAGMENT,r as CART_ITEM_FRAGMENT,a as DOWNLOADABLE_CART_ITEMS_FRAGMENT}; + ${l} + ${t} +`;export{t as APPLIED_GIFT_CARDS_FRAGMENT,n as AVAILABLE_GIFT_WRAPPING_FRAGMENT,c as CART_FRAGMENT,l as CART_ITEM_FRAGMENT,a as DOWNLOADABLE_CART_ITEMS_FRAGMENT,r as GIFT_MESSAGE_FRAGMENT,i as GIFT_WRAPPING_FRAGMENT}; diff --git a/scripts/__dropins__/storefront-cart/hooks/index.d.ts b/scripts/__dropins__/storefront-cart/hooks/index.d.ts index 0cb86a53f8..9a46b52deb 100644 --- a/scripts/__dropins__/storefront-cart/hooks/index.d.ts +++ b/scripts/__dropins__/storefront-cart/hooks/index.d.ts @@ -16,4 +16,5 @@ *******************************************************************/ export * from './useEstimatedTotals'; export * from './useEstimatedShipping'; +export * from './useGiftOptions'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/hooks/useGiftOptions.d.ts b/scripts/__dropins__/storefront-cart/hooks/useGiftOptions.d.ts new file mode 100644 index 0000000000..e136fb7f87 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/hooks/useGiftOptions.d.ts @@ -0,0 +1,46 @@ +import { CartModel, Item } from '../data/models'; +import { GiftOptionsDataSourcesProps, GiftOptionsViewProps, GiftWrappingConfigProps, GiftFormDataType, ProductGiftOptionsConfig } from '../types'; + +interface UseGiftOptionsProps { + item: Item | ProductGiftOptionsConfig; + view: GiftOptionsViewProps; + dataSource: GiftOptionsDataSourcesProps; + initialLoading: boolean; + handleItemsLoading?: (uid: string, state: boolean) => void; + handleItemsError?: (uid: string, message?: string) => void; + onItemUpdate?: ({ item }: { + item: Item; + }) => void; + onGiftOptionsChange?: (data: GiftFormDataType) => void; +} +export declare const useGiftOptions: ({ item, view, dataSource, initialLoading, handleItemsLoading, handleItemsError, onItemUpdate, onGiftOptionsChange, }: UseGiftOptionsProps) => { + loading: boolean; + giftOptions: GiftFormDataType; + showModal: boolean; + errorsField: { + recipientName: string; + senderName: string; + message: string; + }; + updateLoading: boolean; + cartData: CartModel | null; + fieldsDisabled: boolean; + isGiftOptionsApplied: boolean; + giftWrappingConfig: [] | GiftWrappingConfigProps[]; + setFieldsDisabled: import('preact/hooks').Dispatch>; + handleFormMouseLeave: () => Promise; + onInputChange: (event: Event) => void; + updateGiftOptions: (name: string, value: string | boolean | number | undefined, extraGiftOptions?: Record) => void; + setShowModal: import('preact/hooks').Dispatch>; + handleBlur: (event: Event) => Promise; + isGiftMessageVisible: boolean; + areGiftOptionsVisible: { + isGiftReceiptVisible: boolean; + isPrintedCartVisible: boolean; + isGiftWrappingVisible: boolean; + isGiftOptionsVisible: boolean; + }; + isGiftOptionsHidden: boolean; +}; +export {}; +//# sourceMappingURL=useGiftOptions.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/i18n/en_US.json.d.ts b/scripts/__dropins__/storefront-cart/i18n/en_US.json.d.ts index e9032dd749..734977a8fc 100644 --- a/scripts/__dropins__/storefront-cart/i18n/en_US.json.d.ts +++ b/scripts/__dropins__/storefront-cart/i18n/en_US.json.d.ts @@ -21,6 +21,38 @@ declare const _default: { "taxToBeDetermined": "TBD", "checkout": "Checkout", "orderSummary": "Order Summary", + "giftCard": { + "label": "Gift Card", + "applyAction": "Apply", + "ariaLabel": "Enter gift card code", + "ariaLabelRemove": "Remove gift card", + "placeholder": "Enter code", + "title": "Gift Card", + "errors": { + "empty": "Please enter a gift card code." + }, + "appliedGiftCards": { + "label": { "singular": "Gift card", "plural": "Gift cards" }, + "remainingBalance": "Remaining balance" + } + }, + "giftOptionsTax": { + "printedCard": { + "title": "Printed card", + "inclTax": "Including taxes", + "exclTax": "excluding taxes" + }, + "itemGiftWrapping": { + "title": "Item gift wrapping", + "inclTax": "Including taxes", + "exclTax": "excluding taxes" + }, + "orderGiftWrapping": { + "title": "Order gift wrapping", + "inclTax": "Including taxes", + "exclTax": "excluding taxes" + } + }, "subTotal": { "label": "Subtotal", "withTaxes": "Including taxes", @@ -73,7 +105,8 @@ declare const _default: { "coupon": { "applyAction": "Apply", "placeholder": "Enter code", - "title": "Discount code" + "title": "Discount code", + "ariaLabelRemove": "Remove coupon" } }, "CartItem": { @@ -97,7 +130,7 @@ declare const _default: { "editZipAction": "Apply", "estimated": "Estimated Shipping", "estimatedDestination": "Estimated Shipping to", - "destinationLinkAriaLabel": "Change destination", + "destinationLinkAriaLabel": "{destination}, Change destination", "zipPlaceholder": "Zip Code", "withTaxes": "Including taxes", "withoutTaxes": "excluding taxes", @@ -111,6 +144,89 @@ declare const _default: { "message": "Please adjust quantities to continue", "alert": "Out of stock", "action": "Remove all out of stock items from cart" + }, + "GiftOptions": { + "formText": { + "requiredFieldError": "This field is required" + }, + "modal": { + "defaultTitle": "Gift wrapping for Cart", + "title": "Gift wrapping for", + "wrappingText": "Wrapping choice", + "wrappingSubText": "", + "modalConfirmButton": "Apply", + "modalCancelButton": "Cancel" + }, + "order": { + "customize": "Customize", + "accordionHeading": "Gift options", + "giftReceiptIncluded": { + "title": "Use gift receipt", + "subtitle": "The receipt and order invoice will not show the price." + }, + "printedCardIncluded": { + "title": "Include printed card", + "subtitle": "" + }, + "giftOptionsWrap": { + "title": "Gift wrap this order", + "subtitle": "Wrapping option:" + }, + "formContent": { + "formTitle": "Add a message to the order (optional)", + "formTo": "To", + "formFrom": "From", + "giftMessageTitle": "Gift message", + "formToPlaceholder": "Recipient’s name", + "formFromPlaceholder": "Sender’s name", + "formMessagePlaceholder": "Gift message" + }, + "readOnlyFormView": { + "title": "Selected gift order options", + "giftWrap": "Gift wrap this order", + "giftWrapOptions": "Wrapping option:", + "giftReceipt": "Use gift receipt", + "giftReceiptText": "The receipt and order invoice will not show the price.", + "printCard": "Use printed card", + "printCardText": "", + "formTitle": "Your gift message", + "formTo": "To", + "formFrom": "From", + "formMessageTitle": "Gift message" + } + }, + "product": { + "customize": "Customize", + "accordionHeading": "Gift options", + "giftReceiptIncluded": { + "title": "Use gift receipt", + "subtitle": "The receipt and order invoice will not show the price." + }, + "printedCardIncluded": { + "title": "Include printed card", + "subtitle": "" + }, + "giftOptionsWrap": { + "title": "Gift wrap this item", + "subtitle": "Wrapping option:" + }, + "formContent": { + "formTitle": "Add a message to the item (optional)", + "formTo": "To", + "formFrom": "From", + "giftMessageTitle": "Gift message", + "formToPlaceholder": "Recipient’s name", + "formFromPlaceholder": "Sender’s name", + "formMessagePlaceholder": "Gift message" + }, + "readOnlyFormView": { + "title": "This item is a gift", + "wrapping": "Wrapping:", + "recipient": "To:", + "sender": "From:", + "message": "Message:" + } + } } } } diff --git a/scripts/__dropins__/storefront-cart/lib/giftOptionsHelper.d.ts b/scripts/__dropins__/storefront-cart/lib/giftOptionsHelper.d.ts new file mode 100644 index 0000000000..9290c0a229 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/lib/giftOptionsHelper.d.ts @@ -0,0 +1,18 @@ +import { CartModel, Item } from '../data/models'; +import { GiftWrappingConfigProps, GiftOptionsViewProps, ProductGiftOptionsConfig } from '../types'; + +export declare const DEFAULT_FORM_STATE: { + recipientName: string; + senderName: string; + message: string; +}; +export declare const DEFAULT_CHECKBOXES_STATE: { + giftReceiptIncluded: boolean; + printedCardIncluded: boolean; + isGiftWrappingSelected: boolean; +}; +export declare const shouldShowGiftMessage: (item: CartModel['items'][0] | ProductGiftOptionsConfig, isProductView: boolean) => boolean; +export declare const getSelectedGiftWrapping: (giftWrappingOptions: GiftWrappingConfigProps[] | [ +]) => GiftWrappingConfigProps | undefined; +export declare const areGiftOptionsDisabled: (view: GiftOptionsViewProps, item: Item | ProductGiftOptionsConfig) => boolean; +//# sourceMappingURL=giftOptionsHelper.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/render.js b/scripts/__dropins__/storefront-cart/render.js index 41eaec6afe..af9e260e21 100644 --- a/scripts/__dropins__/storefront-cart/render.js +++ b/scripts/__dropins__/storefront-cart/render.js @@ -1,4 +1,4 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -(function(i,t){try{if(typeof document<"u"){const a=document.createElement("style"),n=t.styleId;for(const r in t.attributes)a.setAttribute(r,t.attributes[r]);a.setAttribute("data-dropin",n),a.appendChild(document.createTextNode(i));const e=document.querySelector('style[data-dropin="sdk"]');if(e)e.after(a);else{const r=document.querySelector('link[rel="stylesheet"], style');r?r.before(a):document.head.append(a)}}}catch(a){console.error("dropin-styles (injectCodeFunction)",a)}})(".cart-empty-cart{container-type:inline-size;container-name:cart}.cart-empty-cart__wrapper .dropin-card--secondary{display:grid;grid-auto-rows:min-content;justify-content:center;text-align:center}@container cart (width < 737px){.cart-empty-cart__wrapper .dropin-card{border:unset;border-style:hidden}}.cart-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xsmall);align-items:flex-end;color:var(--color-neutral-800)}.cart-estimate-shipping__label,.cart-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-estimate-shipping__price{text-align:right}a.cart-estimate-shippingLink{text-decoration:underline}.cart-estimate-shipping__label--bold,.cart-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.cart-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-estimate-shipping--zip,.cart-estimate-shipping--state{background-color:var(--color-neutral-50)}.cart-estimate-shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small)}a.cart-estimate-shipping__link{text-decoration:underline}.cart-estimate-shipping--hide{display:none!important}.cart-estimate-shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-estimate-shipping--loading{opacity:.4;pointer-events:none}.cart-mini-cart{display:flex;flex-direction:column;height:100%;padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium);box-sizing:border-box}.cart-mini-cart__empty-cart{width:100%;max-width:800px;height:100%;display:flex;flex-direction:column;justify-content:center;align-self:center}.cart-mini-cart__heading{display:grid;row-gap:var(--spacing-xsmall);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing)}.cart-mini-cart__heading-divider{width:100%;margin:var(--spacing-xxsmall) 0 0 0}.cart-mini-cart__products{flex:1;overflow-y:auto;max-height:100%;padding-bottom:var(--spacing-medium)}.cart-mini-cart__products .cart-cart-summary-list__heading{padding:0}.cart-mini-cart__products .dropin-cart-item__configurations li{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cart-mini-cart__footer{display:grid;grid-auto-flow:row;gap:var(--spacing-small);padding-top:var(--spacing-small);row-gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total-excluding-taxes{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall);color:var(--color-neutral-700)}.cart-mini-cart__footer__ctas{display:grid;grid-auto-flow:row;gap:var(--spacing-xsmall);padding-top:var(--spacing-small)}.cart-cart-summary-grid{container-type:inline-size;container-name:cart-summary-grid;max-width:inherit}.cart-cart-summary-grid__content{display:grid;flex-wrap:wrap;gap:var(--spacing-small);grid-template-columns:repeat(6,1fr);margin:auto}.cart-cart-summary-grid__item-container{aspect-ratio:auto 3/4;display:inline-block}.cart-cart-summary-grid__item-container img{height:auto;max-width:100%}.cart-cart-summary-grid__item-container a:focus{display:block}.cart-cart-summary-grid__content--empty{grid-template-columns:repeat(1,1fr)}.cart-cart-summary-grid__empty-cart{align-self:center;justify-self:center;max-width:800px;width:100%}@container cart-summary-grid (width < 360px){.cart-cart-summary-grid__content{grid-template-columns:repeat(4,1fr);gap:var(--spacing-xsmall)}.cart-cart-summary-grid__content--empty{grid-template-columns:repeat(1,1fr)}}.cart-cart-summary-list{container-type:inline-size;container-name:cart-summary-list}.cart-cart-summary-list__background--secondary{background-color:var(--color-neutral-200)}.cart-cart-summary-list__heading{display:grid;row-gap:var(--spacing-xsmall);padding:var(--spacing-medium) 0 0 0;font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.cart-cart-summary-list__heading--full-width{width:100%}.cart-cart-summary-list__heading-divider{width:100%;margin:var(--spacing-xxsmall) 0 var(--spacing-medium) 0}.cart-cart-summary-list__content{display:grid;grid-template-columns:1fr;padding:0}.cart-cart-summary-list__out-of-stock-message{margin:calc(-1 * var(--spacing-xsmall)) 0 var(--spacing-medium) 0}.cart-cart-summary-list__empty-cart{justify-self:center;align-self:center;width:100%;max-width:800px}.cart-cart-summary-list-footer__action,.cart-cart-summary-list-footer__action:focus .cart-cart-summary-list-footer__action:active,.cart-cart-summary-list-footer__action:link{font:var(--type-body-2-strong-font);margin:0 auto;width:auto;margin-top:var(--spacing-medium);margin-bottom:var(--spacing-medium)}.cart-cart-summary-list-footer__action:hover{text-decoration:underline;text-underline-offset:var(--spacing-xxsmall);background:transparent;color:var(--color-brand-700)}.cart-cart-summary-list-footer__action:visited{background-color:none}.cart-cart-summary-list-accordion{border-left:var(--shape-border-width-2) solid var(--color-neutral-400);border-right:var(--shape-border-width-2) solid var(--color-neutral-400)}.cart-cart-summary-list-accordion__section{margin:var(--spacing-medium)}@container cart-summary-list (width >= 768px){.cart-cart-summary-list__out-of-stock-message{margin:calc(-1 * var(--spacing-small)) 0 var(--spacing-xxbig) 0}}@container cart-summary-list (width >= 1024px){.cart-cart-summary-list__content,.cart-cart-summary-list__heading{grid-column:1 / span 8}.cart-cart-summary-list__heading--full-width,.cart-cart-summary-list__content--empty{grid-column:1 / span 12}.cart-cart-summary-list__content{padding:0}}.cart-order-summary{display:grid;position:relative;grid-auto-flow:row;padding:var(--spacing-medium)}.cart-order-summary__primary{background-color:var(--color-neutral-200)}.cart-order-summary__secondary{background-color:var(--color-neutral-50)}.cart-order-summary__content{display:grid;gap:var(--spacing-xsmall);margin-top:var(--spacing-small)}.cart-order-summary__heading{display:grid;font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);color:var(--color-neutral-800);gap:var(--spacing-small)}.cart-order-summary__discount .cart-order-summary__label,.cart-order-summary__discount .cart-order-summary__price{color:var(--color-warning-800)}.cart-order-summary__coupon__code{display:flex;align-items:center;font:var(--type-details-overline-font);letter-spacing:var(--type-details-overline-letter-spacing);color:var(--color-neutral-700);gap:var(--spacing-xsmall);grid-column:span 2}.cart-order-summary__taxes .dropin-divider:last-child{margin-bottom:0}.cart-order-summary__total{margin-top:var(--spacing-medium)}.cart-order-summary__divider-primary,.cart-order-summary__divider-secondary{width:100%;margin:0}.cart-order-summary__divider-secondary{margin:0}.cart-order-summary__taxEntry.cart-order-summary__entry{margin-top:0}.cart-order-summary__entry,.cart-order-summary__taxEntry{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.cart-order-summary__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-order-summary__primaryAction{margin-top:var(--spacing-small);grid-template-columns:1fr}.cart-order-summary__shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small);padding-left:var(--spacing-small)}a.cart-order-summary__shippingLink{text-decoration:underline}.cart-order-summary__shipping--hide{display:none!important}.cart-order-summary__shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-order-summary__shipping--zip,.cart-order-summary__shipping--state{background-color:var(--color-neutral-50)}.cart-order-summary__taxes .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.cart-order-summary--loading{opacity:.4;pointer-events:none}.cart-order-summary__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.coupon-code-form__action{display:flex}.coupon-code-form__action .dropin-input-container{flex-grow:1;margin-right:var(--spacing-small)}.cart-coupons__accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small)}.coupon-code-form__codes{background-color:var(--color-neutral-50)}.coupon-code-form__error{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-alert-500);margin-top:calc(var(--spacing-xsmall) * -1)}.coupon-code-form__applied{display:flex;flex-wrap:wrap;gap:var(--spacing-small)}div.coupon-code-form__applied button{background:var(--color-neutral-400);color:var(--color-neutral-800);display:flex;flex-direction:row-reverse}.cart-order-summary__label,.cart-order-summary__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-order-summary__price{text-align:right;text-transform:uppercase}.cart-order-summary__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-order-summary__label--bold,.cart-order-summary__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}",{styleId:"Cart"}); -import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as c,Render as d}from"@dropins/tools/lib.js";import{useState as u,useEffect as p}from"@dropins/tools/preact-hooks.js";import{UIProvider as m}from"@dropins/tools/components.js";import{events as g}from"@dropins/tools/event-bus.js";import"./chunks/resetCart.js";import{c as h}from"./chunks/refreshCart.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/persisted-data.js";import"./fragments.js";const f={Cart:{heading:"Shopping Cart ({count})",editCart:"Edit",viewAll:"View all in cart",viewMore:"View more"},MiniCart:{heading:"Shopping Cart ({count})",subtotal:"Subtotal",subtotalExcludingTaxes:"Subtotal excluding taxes",cartLink:"View Cart",checkoutLink:"Checkout"},EmptyCart:{heading:"Your cart is empty",cta:"Start shopping"},PriceSummary:{taxToBeDetermined:"TBD",checkout:"Checkout",orderSummary:"Order Summary",subTotal:{label:"Subtotal",withTaxes:"Including taxes",withoutTaxes:"excluding taxes"},shipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},taxes:{total:"Tax Total",totalOnly:"Tax",breakdown:"Taxes",showBreakdown:"Show Tax Breakdown",hideBreakdown:"Hide Tax Breakdown",estimated:"Estimated Tax"},total:{estimated:"Estimated Total",free:"Free",label:"Total",withoutTax:"Total excluding taxes",saved:"Total saved"},estimatedShippingForm:{country:{placeholder:"Country"},state:{placeholder:"State"},zip:{placeholder:"Zip Code"},apply:{label:"Apply"}},freeShipping:"Free",coupon:{applyAction:"Apply",placeholder:"Enter code",title:"Discount code"}},CartItem:{discountedPrice:"Discounted Price",download:"file",message:"Note",recipient:"To",regularPrice:"Regular Price",sender:"From",file:"{count} file",files:"{count} files",lowInventory:"Only {count} left!",insufficientQuantity:"Only {inventory} of {count} in stock",insufficientQuantityGeneral:"Not enough items for sale",notAvailableMessage:"Requested qty. not available",discountPercentage:"{discount}% off",savingsAmount:"Savings"},EstimateShipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},OutOfStockMessage:{heading:"Your cart contains items with limited stock",message:"Please adjust quantities to continue",alert:"Out of stock",action:"Remove all out of stock items from cart"}},x={Cart:f},y={default:x},S=({children:o})=>{var i;const[t,s]=u(),r=(i=h.getConfig())==null?void 0:i.langDefinitions;p(()=>{const e=g.on("locale",a=>{a!==t&&s(a)},{eager:!0});return()=>{e==null||e.off()}},[t]);const l=c(y,r??{});return n(m,{lang:t,langDefinitions:l,children:o})},L=new d(n(S,{}));export{L as render}; +(function(o,a){try{if(typeof document<"u"){const t=document.createElement("style"),e=a.styleId;for(const r in a.attributes)t.setAttribute(r,a.attributes[r]);t.setAttribute("data-dropin",e),t.appendChild(document.createTextNode(o));const i=document.querySelector('style[data-dropin="sdk"]');if(i)i.after(t);else{const r=document.querySelector('link[rel="stylesheet"], style');r?r.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(".cart-empty-cart{container-type:inline-size;container-name:cart}.cart-empty-cart__wrapper .dropin-card--secondary{display:grid;grid-auto-rows:min-content;justify-content:center;text-align:center}@container cart (width < 737px){.cart-empty-cart__wrapper .dropin-card{border:unset;border-style:hidden}}.cart-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xsmall);align-items:flex-end;color:var(--color-neutral-800)}.cart-estimate-shipping__label,.cart-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-estimate-shipping__price{text-align:right}a.cart-estimate-shippingLink{text-decoration:underline}.cart-estimate-shipping__label--bold,.cart-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.cart-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-estimate-shipping--zip,.cart-estimate-shipping--state{background-color:var(--color-neutral-50)}.cart-estimate-shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small)}a.cart-estimate-shipping__link{text-decoration:underline}.cart-estimate-shipping--hide{display:none!important}.cart-estimate-shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-estimate-shipping--loading{opacity:.4;pointer-events:none}.cart-mini-cart{display:flex;flex-direction:column;height:100%;padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium);box-sizing:border-box}.cart-mini-cart__empty-cart{width:100%;max-width:800px;height:100%;display:flex;flex-direction:column;justify-content:center;align-self:center}.cart-mini-cart__heading{display:grid;row-gap:var(--spacing-xsmall);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing)}.cart-mini-cart__heading-divider{width:100%;margin:var(--spacing-xxsmall) 0 0 0}.cart-mini-cart__products{flex:1;overflow-y:auto;max-height:100%;padding-bottom:var(--spacing-medium)}.cart-mini-cart__products .cart-cart-summary-list__heading{padding:0}.cart-mini-cart__products .dropin-cart-item__configurations li{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cart-mini-cart__footer{display:grid;grid-auto-flow:row;gap:var(--spacing-small);padding-top:var(--spacing-small);row-gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total-excluding-taxes{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall);color:var(--color-neutral-700)}.cart-mini-cart__productListFooter,.cart-mini-cart__preCheckoutSection{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-800)}.cart-mini-cart__footer__ctas{display:grid;grid-auto-flow:row;gap:var(--spacing-xsmall);padding-top:var(--spacing-small)}.cart-cart-summary-grid{container-type:inline-size;container-name:cart-summary-grid;max-width:inherit}.cart-cart-summary-grid__content{display:grid;flex-wrap:wrap;gap:var(--spacing-small);grid-template-columns:repeat(6,1fr);margin:auto}.cart-cart-summary-grid__item-container{aspect-ratio:auto 3/4;display:inline-block}.cart-cart-summary-grid__item-container img{height:auto;max-width:100%}.cart-cart-summary-grid__item-container a:focus{display:block}.cart-cart-summary-grid__content--empty{grid-template-columns:repeat(1,1fr)}.cart-cart-summary-grid__empty-cart{align-self:center;justify-self:center;max-width:800px;width:100%}@container cart-summary-grid (width < 360px){.cart-cart-summary-grid__content{grid-template-columns:repeat(4,1fr);gap:var(--spacing-xsmall)}.cart-cart-summary-grid__content--empty{grid-template-columns:repeat(1,1fr)}}.cart-cart-summary-list{container-type:inline-size;container-name:cart-summary-list}.cart-cart-summary-list__background--secondary{background-color:var(--color-neutral-200)}.cart-cart-summary-list__heading{display:grid;row-gap:var(--spacing-xsmall);padding:var(--spacing-medium) 0 0 0;font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.cart-cart-summary-list__heading--full-width{width:100%}.cart-cart-summary-list__heading-divider{width:100%;margin:var(--spacing-xxsmall) 0 var(--spacing-medium) 0}.cart-cart-summary-list__content{display:grid;grid-template-columns:1fr;padding:0}.cart-cart-summary-list__out-of-stock-message{margin:calc(-1 * var(--spacing-xsmall)) 0 var(--spacing-medium) 0}.cart-cart-summary-list__empty-cart{justify-self:center;align-self:center;width:100%;max-width:800px}.cart-cart-summary-list-footer__action,.cart-cart-summary-list-footer__action:focus .cart-cart-summary-list-footer__action:active,.cart-cart-summary-list-footer__action:link{font:var(--type-body-2-strong-font);margin:0 auto;width:auto;margin-top:var(--spacing-medium);margin-bottom:var(--spacing-medium)}.cart-cart-summary-list-footer__action:hover{text-decoration:underline;text-underline-offset:var(--spacing-xxsmall);background:transparent;color:var(--color-brand-700)}.cart-cart-summary-list-footer__action:visited{background-color:none}.cart-cart-summary-list-accordion{border-left:var(--shape-border-width-2) solid var(--color-neutral-400);border-right:var(--shape-border-width-2) solid var(--color-neutral-400)}.cart-cart-summary-list-accordion__section{margin:var(--spacing-medium)}@container cart-summary-list (width >= 768px){.cart-cart-summary-list__out-of-stock-message{margin:calc(-1 * var(--spacing-small)) 0 var(--spacing-xxbig) 0}}@container cart-summary-list (width >= 1024px){.cart-cart-summary-list__content,.cart-cart-summary-list__heading{grid-column:1 / span 8}.cart-cart-summary-list__heading--full-width,.cart-cart-summary-list__content--empty{grid-column:1 / span 12}.cart-cart-summary-list__content{padding:0}}.cart-order-summary{display:grid;position:relative;grid-auto-flow:row;padding:var(--spacing-medium)}.cart-order-summary__primary{background-color:var(--color-neutral-200)}.cart-order-summary__secondary{background-color:var(--color-neutral-50)}.cart-order-summary__content{display:grid;gap:var(--spacing-xsmall);margin-top:var(--spacing-small)}.cart-order-summary__heading{display:grid;font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);color:var(--color-neutral-800);gap:var(--spacing-small)}.cart-order-summary__discount .cart-order-summary__label,.cart-order-summary__discount .cart-order-summary__price,.cart-order-summary__applied-gift-cards .cart-order-summary__price{color:var(--color-warning-800)}.cart-order-summary__coupon__code{display:flex;align-items:center;font:var(--type-details-overline-font);letter-spacing:var(--type-details-overline-letter-spacing);color:var(--color-neutral-700);gap:var(--spacing-xsmall);grid-column:span 2}.cart-order-summary__taxes .dropin-divider:last-child{margin-bottom:0}.cart-order-summary__total{margin-top:var(--spacing-medium)}.cart-order-summary__divider-primary,.cart-order-summary__divider-secondary{width:100%;margin:0}.cart-order-summary__divider-secondary{margin:0}.cart-order-summary__taxEntry.cart-order-summary__entry{margin-top:0}.cart-order-summary__entry,.cart-order-summary__taxEntry{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.cart-order-summary__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-order-summary__primaryAction{margin-top:var(--spacing-small);grid-template-columns:1fr}.cart-order-summary__shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small);padding-left:var(--spacing-small)}a.cart-order-summary__shippingLink{text-decoration:underline}.cart-order-summary__shipping--hide{display:none!important}.cart-order-summary__shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-order-summary__shipping--zip,.cart-order-summary__shipping--state{background-color:var(--color-neutral-50)}.cart-order-summary__taxes .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.cart-order-summary--loading{opacity:.4;pointer-events:none}.cart-order-summary__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.cart-order-summary__content:has(.cart-order-summary__coupons .dropin-accordion):has(.cart-order-summary__gift-cards .dropin-accordion):has(.cart-order-summary__coupons+.cart-order-summary__gift-cards) .cart-order-summary__coupons .dropin-accordion hr:last-child{opacity:0;margin-bottom:0}.cart-order-summary__content:has(.cart-order-summary__coupons .dropin-accordion):has(.cart-order-summary__gift-cards .dropin-accordion):has(.cart-order-summary__coupons+.cart-order-summary__gift-cards) .cart-order-summary__gift-cards .dropin-accordion hr:first-child{margin-top:calc(var(--spacing-xsmall) * -1)}.cart-order-summary__applied-gift-cards .cart-order-summary__coupon__code,.cart-order-summary__applied-gift-cards .cart-order-summary__caption{display:flex;justify-content:flex-start;align-items:end;gap:0 var(--spacing-xsmall)}.coupon-code-form__action{display:flex}.coupon-code-form__action .dropin-input-container{flex-grow:1;margin-right:var(--spacing-small)}.cart-coupons__accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small)}.coupon-code-form__codes{background-color:var(--color-neutral-50)}.coupon-code-form__error{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-alert-500);margin-top:calc(var(--spacing-xsmall) * -1)}.coupon-code-form__applied{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:var(--spacing-small)}.coupon-code-form__applied-item{box-sizing:border-box;display:grid;grid-template-columns:1fr auto;gap:0 var(--spacing-small)}.coupon-code-form__applied-item button{all:unset;margin:0;padding:0;display:flex;justify-content:center;align-items:center;background-color:transparent;border-color:transparent;cursor:pointer}.coupon-code-form__applied .dropin-tag-container{background-color:var(--color-neutral-400);color:var(--color-neutral-800);font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.cart-gift-cards .dropin-accordion-section__title-container svg:first-of-type path{transform-box:fill-box;transform-origin:center;transform:translateY(4px)}.cart-order-summary__label,.cart-order-summary__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-order-summary__price{text-align:right;text-transform:uppercase}.cart-order-summary__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-order-summary__label--bold,.cart-order-summary__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.cart-gift-options-view{position:relative}.cart-gift-options-view textarea{border:var(--shape-border-width-1) solid var(--color-neutral-600)}.cart-gift-options-view.cart-gift-options-view--product .dropin-accordion-section__heading{grid-template-columns:auto 1fr}.cart-gift-options-view.cart-gift-options-view--product .dropin-accordion-section__flex,.cart-gift-options-view.cart-gift-options-view--product .dropin-accordion-section__heading,.cart-gift-options-view.cart-gift-options-view--product .dropin-accordion-section__title-container,.cart-gift-options-view.cart-gift-options-view--product .cart-gift-options-view__icon--success{margin-top:0}.cart-gift-options-view.cart-gift-options-view--order .dropin-accordion-section__title-container,.cart-gift-options-view.cart-gift-options-view--order .dropin-accordion-section__title-container .dropin-accordion-section__title{width:100%}.cart-gift-options-view.cart-gift-options-view--order .dropin-accordion-section__title-container svg{min-width:24px}#cart-gift-options-view.cart-gift-options-view .dropin-accordion-section__content-container{display:block!important;margin-bottom:0;gap:0}.cart-gift-options-view .dropin-accordion-section__heading{align-items:flex-end}.cart-gift-options-view .cart-gift-options-view__top{display:grid;grid-template-columns:1fr;gap:var(--grid-1-gutters) 0;width:100%;align-items:start;margin-top:var(--spacing-small);margin-bottom:var(--spacing-medium)}.cart-gift-options-view .cart-gift-options-view__top.cart-gift-options-view__top--hidden{display:none}.cart-gift-options-view .cart-gift-options-view__field-gift-wrap{margin-top:0;grid-column:1 / -1}.cart-gift-options-view .cart-gift-options-view__top .dropin-field:nth-child(3){grid-column:1 / -1}.cart-gift-options-view .cart-gift-options-view__top .dropin-checkbox__label.dropin-checkbox__label--medium{margin-right:var(--spacing-xsmall)}@media (max-width: 768px){.cart-gift-options-view .cart-gift-options-view__top{display:flex;flex-direction:column}}.cart-gift-options-view .cart-gift-options-view__top .dropin-field:nth-child(2){grid-column:1;margin-top:0}.cart-gift-options-view .cart-gift-options-view__top .dropin-field div{margin-top:0}.cart-gift-options-view .cart-gift-options-view__top button{font:var(--type-body-2-strong-font);padding:0;margin:0;text-decoration:underline;grid-column:2;align-self:start}.cart-gift-options-view .cart-gift-options-view__footer{display:grid;grid-template-columns:1fr 1fr;gap:var(--grid-1-gutters);margin-top:var(--spacing-xsmall)}.cart-gift-options-view .cart-gift-options-view__footer>:first-child{grid-column:span 2;font:var(--type-body-2-strong-font);color:var(--color-neutral-800)}.cart-gift-options-view .cart-gift-options-view__footer>:nth-child(4){grid-column:span 2}.cart-gift-options-view .cart-gift-options-view__footer div>span{font:var(--type-details-caption-1-font);color:var(--color-neutral-800);display:inline-block;margin-bottom:var(--spacing-xsmall)}.cart-gift-options-view .cart-gift-options-view__footer .dropin-textarea__label--floating.dropin-textarea__label--floating--error{padding-top:0;color:var(--color-neutral-700);font:var(--type-body-2-default-font)}.cart-gift-options-view .dropin-textarea__label--floating--text.dropin-textarea__label--floating--error{color:var(--color-alert-800);font:var(--type-details-caption-2-font)}.cart-gift-options-view .dropin-textarea.dropin-textarea--error{border:var(--shape-border-width-2) solid var(--color-alert-500)}.cart-gift-options-view .cart-gift-options-view__modal{width:100%;max-width:735px;margin:auto}.cart-gift-options-view.cart-gift-options-view--product .dropin-modal.dropin-modal--dim{margin:0}.cart-gift-options-view.cart-gift-options-view--product .dropin-modal.dropin-modal--dim .cart-gift-options-view__modal{margin-top:var(--spacing-huge)}.cart-gift-options-view.cart-gift-options-view--product .dropin-modal__header.dropin-modal__header-title{display:grid;grid-template-columns:1fr auto}.cart-gift-options-view__modal .dropin-modal__header-title-content{display:block}.cart-gift-options-view__modal .dropin-modal__header-title-content span{display:block;word-wrap:break-word;overflow-wrap:break-word}.cart-gift-options-view__modal .dropin-modal__header-title-content span:first-child{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing)}.cart-gift-options-view__modal .dropin-modal__header-title-content .dropin-price{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.cart-gift-options-view__modal .dropin-iconButton{text-align:right}.cart-gift-options-view__modal .dropin-modal__content.dropin-modal__body--centered{margin:0}.cart-gift-options-view__modal .cart-gift-options-view__modal-content span{display:block;text-align:left;font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.cart-gift-options-view__modal .cart-gift-options-view__modal-content span:last-child{margin-top:var(--spacing-xsmall);font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing)}.cart-gift-options-view__modal .dropin-content-grid.cart-gift-options-view__modal-grid{margin-top:0;overflow:auto}.cart-gift-options-view__modal .dropin-content-grid__content{margin-top:0;padding:var(--spacing-xsmall);gap:var(--spacing-xsmall)}.cart-gift-options-view__modal .cart-gift-options-view__modal-content{margin-bottom:var(--spacing-big)}.cart-gift-options-view__modal button{width:100%;display:block;text-align:center}.cart-gift-options-view__modal button:nth-child(2){margin-bottom:var(--spacing-xsmall)}.cart-gift-options-view .dropin-divider{display:none}.cart-gift-options-view .cart-gift-options-view__footer div{margin:0}.cart-gift-options-view .cart-gift-options-view__icon--success{display:grid;grid-template-columns:auto 1fr;gap:0 var(--spacing-xsmall);align-items:center}.cart-gift-options-view .cart-gift-options-view__icon--success svg{fill:var(--color-informational-800);margin-left:auto}.cart-gift-options-view .cart-gift-options-view__icon--success svg path:first-of-type{stroke:var(--color-informational-800)}.cart-gift-options-view .cart-gift-options-view__icon--success svg path:last-of-type{stroke:var(--color-neutral-50)}.cart-gift-options-view .dropin-textarea{padding:var(--spacing-xxsmall) var(--spacing-small);min-height:40px;height:40px}.cart-gift-options-view textarea:focus::placeholder{color:transparent}.dropin-textarea:not(:placeholder-shown)+.dropin-textarea__label--floating,.dropin-textarea:focus+.dropin-textarea__label--floating{display:none;opacity:0;z-index:-1}.cart-gift-options-view .dropin-textarea__label--floating{top:10px}.cart-gift-options-view__spinner{position:absolute;margin:0 auto;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.cart-gift-options-view--loading{opacity:.4;pointer-events:none}.cart-gift-options-view .cart-gift-options-view--readonly .dropin-card.dropin-card--primary{border-radius:0}.cart-gift-options-view .cart-gift-options-view--readonly .cart-gift-options-readonly__header>span{color:var(--color-neutral-800);font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);cursor:pointer}.cart-gift-options-view.cart-gift-options-view--product .cart-gift-options-view--readonly p{margin:var(--spacing-xxsmall) 0;font:var(--type-body-2-strong-font);color:var(--color-neutral-800)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .dropin-card__content{gap:var(--spacing-small)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__header{display:flex;align-items:center;gap:var(--spacing-xsmall)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__checkboxes{display:grid;grid-template-columns:auto 1fr;gap:0 var(--spacing-xsmall);align-items:center}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly p{margin:0;padding:0}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__checkboxes svg{grid-column:1;grid-row:1;fill:var(--color-positive-800);color:var(--color-neutral-50)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__checkboxes svg>path:first-of-type{stroke:var(--color-positive-800)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__checkboxes p{grid-column:2;grid-row:1;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__checkboxes p:last-child{grid-column:2;grid-row:2;color:var(--color-neutral-700);font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__form{display:flex;flex-direction:column;gap:var(--spacing-small) 0;font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);color:var(--color-neutral-800)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__form div:nth-child(2){display:grid;grid-template-columns:repeat(2,1fr);gap:var(--grid-1-gutters);justify-content:start}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__form div:nth-child(2) p span{display:block;margin-bottom:var(--spacing-xsmall)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__form div:nth-child(2) p span:first-child{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.cart-gift-options-view.cart-gift-options-view--order .cart-gift-options-view--readonly .cart-gift-options-readonly__form div:last-child p:first-child{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);margin-bottom:var(--spacing-xsmall)}",{styleId:"Cart"}); +import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as d,Render as p}from"@dropins/tools/lib.js";import{useState as c,useEffect as m}from"@dropins/tools/preact-hooks.js";import{UIProvider as g}from"@dropins/tools/components.js";import{events as f}from"@dropins/tools/event-bus.js";import"./chunks/resetCart.js";import{c as u}from"./chunks/refreshCart.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/persisted-data.js";import"./fragments.js";const h={Cart:{heading:"Shopping Cart ({count})",editCart:"Edit",viewAll:"View all in cart",viewMore:"View more"},MiniCart:{heading:"Shopping Cart ({count})",subtotal:"Subtotal",subtotalExcludingTaxes:"Subtotal excluding taxes",cartLink:"View Cart",checkoutLink:"Checkout"},EmptyCart:{heading:"Your cart is empty",cta:"Start shopping"},PriceSummary:{taxToBeDetermined:"TBD",checkout:"Checkout",orderSummary:"Order Summary",giftCard:{label:"Gift Card",applyAction:"Apply",ariaLabel:"Enter gift card code",ariaLabelRemove:"Remove gift card",placeholder:"Enter code",title:"Gift Card",errors:{empty:"Please enter a gift card code."},appliedGiftCards:{label:{singular:"Gift card",plural:"Gift cards"},remainingBalance:"Remaining balance"}},giftOptionsTax:{printedCard:{title:"Printed card",inclTax:"Including taxes",exclTax:"excluding taxes"},itemGiftWrapping:{title:"Item gift wrapping",inclTax:"Including taxes",exclTax:"excluding taxes"},orderGiftWrapping:{title:"Order gift wrapping",inclTax:"Including taxes",exclTax:"excluding taxes"}},subTotal:{label:"Subtotal",withTaxes:"Including taxes",withoutTaxes:"excluding taxes"},shipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},taxes:{total:"Tax Total",totalOnly:"Tax",breakdown:"Taxes",showBreakdown:"Show Tax Breakdown",hideBreakdown:"Hide Tax Breakdown",estimated:"Estimated Tax"},total:{estimated:"Estimated Total",free:"Free",label:"Total",withoutTax:"Total excluding taxes",saved:"Total saved"},estimatedShippingForm:{country:{placeholder:"Country"},state:{placeholder:"State"},zip:{placeholder:"Zip Code"},apply:{label:"Apply"}},freeShipping:"Free",coupon:{applyAction:"Apply",placeholder:"Enter code",title:"Discount code",ariaLabelRemove:"Remove coupon"}},CartItem:{discountedPrice:"Discounted Price",download:"file",message:"Note",recipient:"To",regularPrice:"Regular Price",sender:"From",file:"{count} file",files:"{count} files",lowInventory:"Only {count} left!",insufficientQuantity:"Only {inventory} of {count} in stock",insufficientQuantityGeneral:"Not enough items for sale",notAvailableMessage:"Requested qty. not available",discountPercentage:"{discount}% off",savingsAmount:"Savings"},EstimateShipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to",destinationLinkAriaLabel:"{destination}, Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},OutOfStockMessage:{heading:"Your cart contains items with limited stock",message:"Please adjust quantities to continue",alert:"Out of stock",action:"Remove all out of stock items from cart"},GiftOptions:{formText:{requiredFieldError:"This field is required"},modal:{defaultTitle:"Gift wrapping for Cart",title:"Gift wrapping for",wrappingText:"Wrapping choice",wrappingSubText:"",modalConfirmButton:"Apply",modalCancelButton:"Cancel"},order:{customize:"Customize",accordionHeading:"Gift options",giftReceiptIncluded:{title:"Use gift receipt",subtitle:"The receipt and order invoice will not show the price."},printedCardIncluded:{title:"Include printed card",subtitle:""},giftOptionsWrap:{title:"Gift wrap this order",subtitle:"Wrapping option:"},formContent:{formTitle:"Add a message to the order (optional)",formTo:"To",formFrom:"From",giftMessageTitle:"Gift message",formToPlaceholder:"Recipient’s name",formFromPlaceholder:"Sender’s name",formMessagePlaceholder:"Gift message"},readOnlyFormView:{title:"Selected gift order options",giftWrap:"Gift wrap this order",giftWrapOptions:"Wrapping option:",giftReceipt:"Use gift receipt",giftReceiptText:"The receipt and order invoice will not show the price.",printCard:"Use printed card",printCardText:"",formTitle:"Your gift message",formTo:"To",formFrom:"From",formMessageTitle:"Gift message"}},product:{customize:"Customize",accordionHeading:"Gift options",giftReceiptIncluded:{title:"Use gift receipt",subtitle:"The receipt and order invoice will not show the price."},printedCardIncluded:{title:"Include printed card",subtitle:""},giftOptionsWrap:{title:"Gift wrap this item",subtitle:"Wrapping option:"},formContent:{formTitle:"Add a message to the item (optional)",formTo:"To",formFrom:"From",giftMessageTitle:"Gift message",formToPlaceholder:"Recipient’s name",formFromPlaceholder:"Sender’s name",formMessagePlaceholder:"Gift message"},readOnlyFormView:{title:"This item is a gift",wrapping:"Wrapping:",recipient:"To:",sender:"From:",message:"Message:"}}}},x={Cart:h},T={default:x},w=({children:r})=>{var i;const[e,n]=c(),s=(i=u.getConfig())==null?void 0:i.langDefinitions;m(()=>{const t=f.on("locale",a=>{a!==e&&n(a)},{eager:!0});return()=>{t==null||t.off()}},[e]);const l=d(T,s??{});return o(g,{lang:e,langDefinitions:l,children:r})},A=new p(o(w,{}));export{A as render}; diff --git a/scripts/__dropins__/storefront-cart/types/giftOptions.types.d.ts b/scripts/__dropins__/storefront-cart/types/giftOptions.types.d.ts new file mode 100644 index 0000000000..35899df7d0 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/types/giftOptions.types.d.ts @@ -0,0 +1,35 @@ +import { WrappingImage, Price } from '../data/models'; + +export type GiftOptionsReadOnlyViewProps = 'primary' | 'secondary'; +export type GiftOptionsViewProps = 'product' | 'order'; +export type GiftOptionsDataSourcesProps = 'cart' | 'order'; +export type GiftWrappingConfigProps = { + uid: string; + design: string; + selected: boolean; + image: WrappingImage; + price: Price; +}; +export type GiftFormDataType = { + giftReceiptIncluded?: boolean; + printedCardIncluded?: boolean; + isGiftWrappingSelected?: boolean; + recipientName?: string; + senderName?: string; + message?: string; + giftWrappingId?: string; + itemId?: string; + giftWrappingOptions?: GiftWrappingConfigProps[]; +}; +export type ProductGiftOptionsConfig = { + giftWrappingAvailable: boolean; + giftMessageAvailable: boolean; + giftWrappingPrice?: Price; + giftMessage?: { + recipientName?: string; + senderName?: string; + message?: string; + }; + productGiftWrapping: GiftWrappingConfigProps[]; +}; +//# sourceMappingURL=giftOptions.types.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-cart/types/index.d.ts b/scripts/__dropins__/storefront-cart/types/index.d.ts new file mode 100644 index 0000000000..b37e362c65 --- /dev/null +++ b/scripts/__dropins__/storefront-cart/types/index.d.ts @@ -0,0 +1,2 @@ +export * from './giftOptions.types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/api.js b/scripts/__dropins__/storefront-checkout/api.js index ec06011dc2..c80173fc1d 100644 --- a/scripts/__dropins__/storefront-checkout/api.js +++ b/scripts/__dropins__/storefront-checkout/api.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{d as l,t as M,a as T,b as E}from"./chunks/synchronizeCheckout.js";import{e as Y,c as J,g as V,f as W,i as X,h as Z,r as tt,s as st}from"./chunks/synchronizeCheckout.js";import{M as A,a as y,b as O}from"./chunks/errors.js";import{F as it,I as rt,e as at,c as nt,d as ot,U as pt}from"./chunks/errors.js";import{s as d}from"./chunks/store-config.js";import{g as ct}from"./chunks/store-config.js";import{s as $,i as _}from"./chunks/transform-store-config.js";import{D as ht,S as mt,j as ut,k as _t,l as lt,r as At,f as St,g as ft,h as Ct}from"./chunks/transform-store-config.js";import"@dropins/tools/lib.js";import{a as v,t as N}from"./chunks/setShippingMethods.js";import{s as Mt}from"./chunks/setShippingMethods.js";import{events as x}from"@dropins/tools/event-bus.js";import{i as Et,s as yt}from"./chunks/setGuestEmailOnCart.js";import{s as $t}from"./chunks/setBillingAddress.js";import{s as Nt}from"./chunks/setPaymentMethod.js";import{CHECKOUT_DATA_FRAGMENT as S}from"./fragments.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const U=` +import{d as l,t as I,a as T,b as M}from"./chunks/synchronizeCheckout.js";import{e as it,c as rt,g as nt,f as at,i as ot,h as dt,r as pt,s as ct}from"./chunks/synchronizeCheckout.js";import{M as A,a as y,b as O}from"./chunks/errors.js";import{F as gt,I as mt,e as ut,c as _t,d as lt,U as At}from"./chunks/errors.js";import{s as p}from"./chunks/state.js";import{g as ft}from"./chunks/state.js";import{s as x,g as G,i as _}from"./chunks/transform-store-config.js";import{D as Et,S as It,l as Tt,m as Mt,r as yt,h as Ot,j as xt,k as Gt}from"./chunks/transform-store-config.js";import"@dropins/tools/lib.js";import{a as N,t as v}from"./chunks/setShippingMethods.js";import{s as vt}from"./chunks/setShippingMethods.js";import{events as U}from"@dropins/tools/event-bus.js";import{A as $}from"./chunks/checkout.js";import{h as D}from"./chunks/setGuestEmailOnCart.js";import{i as $t,s as Dt}from"./chunks/setGuestEmailOnCart.js";import{s as Rt}from"./chunks/setBillingAddress.js";import{s as wt}from"./chunks/setPaymentMethod.js";import{CHECKOUT_DATA_FRAGMENT as S}from"./fragments.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/store-config.js";import"@dropins/tools/signals.js";const F=` mutation estimateShippingMethods( $cartId: String! $address: EstimateAddressInput! @@ -26,7 +26,19 @@ import{d as l,t as M,a as T,b as E}from"./chunks/synchronizeCheckout.js";import{ error_message } } -`,q=async r=>{var h,m,u;const s=d.cartId,{criteria:a}=r||{},{country_code:n,region_id:t,region_name:e,zip:o}=a||{},p=n||((h=d.config)==null?void 0:h.defaultCountry);if(!s)throw new A;if(!p)throw new y;const c=typeof t=="string"?parseInt(t,10):t,g=t||e?{...c&&{region_id:c},...e&&{region_code:e}}:void 0,i={country_code:p,...o&&{postcode:o},...g&&{region:g}},f={country_id:i.country_code,region:(m=i.region)==null?void 0:m.region_code,region_id:(u=i.region)==null?void 0:u.region_id,postcode:i.postcode},C=await l({type:"mutation",query:U,options:{variables:{cartId:s,address:i}},path:"estimateShippingMethods",signalType:"estimateShippingMethods",transformer:M});return setTimeout(()=>{const I={address:v(f),shippingMethod:N($.value)};x.emit("shipping/estimate",I)},0),C},D=` +`,R=e=>e?e.filter(t=>!!t).map(t=>({id:t.agreement_id,name:t.name,mode:$[t.mode],text:t.checkbox_text,content:{value:t.content,html:t.is_html,height:t.content_height??null}})):[],X=async e=>{var g,m,u;const t=p.cartId,{criteria:n}=e||{},{country_code:a,region_id:s,region_name:i,zip:o}=n||{},d=a||((g=p.config)==null?void 0:g.defaultCountry);if(!t)throw new A;if(!d)throw new y;const c=typeof s=="string"?parseInt(s,10):s,h=s||i?{...c&&{region_id:c},...i&&{region_code:i}}:void 0,r={country_code:d,...o&&{postcode:o},...h&&{region:h}},f={country_id:r.country_code,region:(m=r.region)==null?void 0:m.region_code,region_id:(u=r.region)==null?void 0:u.region_id,postcode:r.postcode},C=await l({type:"mutation",query:F,options:{variables:{cartId:t,address:r}},path:"estimateShippingMethods",signalType:"estimateShippingMethods",transformer:I});return setTimeout(()=>{const E={address:N(f),shippingMethod:v(x.value)};U.emit("shipping/estimate",E)},0),C},k=` + query GET_CHECKOUT_AGREEMENTS { + checkoutAgreements { + agreement_id + checkbox_text + content + content_height + is_html + mode + name + } + } +`,Z=async()=>G(k,{method:"GET",cache:"no-cache"}).then(({errors:e,data:t})=>(e&&D(e),R(t.checkoutAgreements))),w=` mutation SET_SHIPPING_ADDRESS_ON_CART_MUTATION( $cartId: String! $shippingAddressInput: ShippingAddressInput! @@ -41,7 +53,7 @@ import{d as l,t as M,a as T,b as E}from"./chunks/synchronizeCheckout.js";import{ } ${S} -`,G=` +`,H=` mutation SET_SHIPPING_ADDRESS_ON_CART_AND_USE_AS_BILLING_MUTATION( $cartId: String! $shippingAddressInput: ShippingAddressInput! @@ -64,4 +76,4 @@ import{d as l,t as M,a as T,b as E}from"./chunks/synchronizeCheckout.js";import{ } ${S} -`,K=async({address:r,customerAddressId:s,pickupLocationCode:a})=>{const n=d.cartId;if(!n)throw new A;const t=()=>{if(s)return{customer_address_id:s};if(a)return{pickup_location_code:a};if(!r)throw new O;return{address:T(r)}},e=_.value?G:D,o=_.value?"setBillingAddressOnCart.cart":"setShippingAddressesOnCart.cart",p={cartId:n,shippingAddressInput:t()};return await l({type:"mutation",query:e,options:{variables:p},path:o,queueName:"cartUpdate",signalType:"cart",transformer:E})};export{ht as DEFAULT_COUNTRY,it as FetchError,rt as InvalidArgument,at as MissingBillingAddress,A as MissingCart,y as MissingCountry,nt as MissingEmail,ot as MissingPaymentMethod,O as MissingShippinghAddress,mt as STORE_CONFIG_DEFAULTS,pt as UnexpectedError,Y as authenticateCustomer,J as config,q as estimateShippingMethods,ut as fetchGraphQl,V as getCart,_t as getConfig,W as getCustomer,lt as getStoreConfig,ct as getStoreConfigCache,X as initialize,Z as initializeCheckout,Et as isEmailAvailable,At as removeFetchGraphQlHeader,tt as resetCheckout,$t as setBillingAddress,St as setEndpoint,ft as setFetchGraphQlHeader,Ct as setFetchGraphQlHeaders,yt as setGuestEmailOnCart,Nt as setPaymentMethod,K as setShippingAddress,Mt as setShippingMethodsOnCart,st as synchronizeCheckout}; +`,tt=async({address:e,customerAddressId:t,pickupLocationCode:n})=>{const a=p.cartId;if(!a)throw new A;const s=()=>{if(t)return{customer_address_id:t};if(n)return{pickup_location_code:n};if(!e)throw new O;return{address:T(e)}},i=_.value?H:w,o=_.value?"setBillingAddressOnCart.cart":"setShippingAddressesOnCart.cart",d={cartId:a,shippingAddressInput:s()};return await l({type:"mutation",query:i,options:{variables:d},path:o,queueName:"cartUpdate",signalType:"cart",transformer:M})};export{Et as DEFAULT_COUNTRY,gt as FetchError,mt as InvalidArgument,ut as MissingBillingAddress,A as MissingCart,y as MissingCountry,_t as MissingEmail,lt as MissingPaymentMethod,O as MissingShippinghAddress,It as STORE_CONFIG_DEFAULTS,At as UnexpectedError,it as authenticateCustomer,rt as config,X as estimateShippingMethods,G as fetchGraphQl,nt as getCart,Z as getCheckoutAgreements,Tt as getConfig,at as getCustomer,Mt as getStoreConfig,ft as getStoreConfigCache,ot as initialize,dt as initializeCheckout,$t as isEmailAvailable,yt as removeFetchGraphQlHeader,pt as resetCheckout,Rt as setBillingAddress,Ot as setEndpoint,xt as setFetchGraphQlHeader,Gt as setFetchGraphQlHeaders,Dt as setGuestEmailOnCart,wt as setPaymentMethod,tt as setShippingAddress,vt as setShippingMethodsOnCart,ct as synchronizeCheckout}; diff --git a/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/getCheckoutAgreements.d.ts b/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/getCheckoutAgreements.d.ts new file mode 100644 index 0000000000..511dd3ebcf --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/getCheckoutAgreements.d.ts @@ -0,0 +1,4 @@ +import { CheckoutAgreement } from '../../data/models'; + +export declare const getCheckoutAgreements: () => Promise; +//# sourceMappingURL=getCheckoutAgreements.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts b/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts new file mode 100644 index 0000000000..6639d63c6a --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export declare const GET_CHECKOUT_AGREEMENTS = "\n query GET_CHECKOUT_AGREEMENTS {\n checkoutAgreements {\n agreement_id\n checkbox_text\n content\n content_height\n is_html \n mode\n name\n }\n }\n"; +//# sourceMappingURL=getCheckoutAgreements.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/index.d.ts b/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/index.d.ts new file mode 100644 index 0000000000..e3060787ed --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/api/getCheckoutAgreements/index.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL: + * __________________ + * + * Copyright 2025 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './getCheckoutAgreements'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts b/scripts/__dropins__/storefront-checkout/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts index 07c412c0d5..e0ad770fab 100644 --- a/scripts/__dropins__/storefront-checkout/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +++ b/scripts/__dropins__/storefront-checkout/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts @@ -14,5 +14,5 @@ * is strictly forbidden unless prior written permission is obtained * from Adobe. *******************************************************************/ -export declare const getStoreConfigQuery = "\n query getStoreConfig {\n storeConfig {\n default_country\n is_guest_checkout_enabled\n is_one_page_checkout_enabled\n shopping_cart_display_shipping\n }\n }\n"; +export declare const getStoreConfigQuery = "\n query getStoreConfig {\n storeConfig {\n default_country\n is_checkout_agreements_enabled\n is_guest_checkout_enabled\n is_one_page_checkout_enabled\n shopping_cart_display_shipping\n }\n }\n"; //# sourceMappingURL=getStoreConfig.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/api/index.d.ts b/scripts/__dropins__/storefront-checkout/api/index.d.ts index 31550f6939..5ca7c12633 100644 --- a/scripts/__dropins__/storefront-checkout/api/index.d.ts +++ b/scripts/__dropins__/storefront-checkout/api/index.d.ts @@ -19,6 +19,7 @@ export * from './errors'; export * from './estimateShippingMethods'; export * from './fetch-graphql'; export * from './getCart'; +export * from './getCheckoutAgreements'; export * from './getCustomer'; export * from './getStoreConfig'; export * from './initialize'; diff --git a/scripts/__dropins__/storefront-checkout/chunks/TermsAndConditions.js b/scripts/__dropins__/storefront-checkout/chunks/TermsAndConditions.js new file mode 100644 index 0000000000..08be3461fd --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/chunks/TermsAndConditions.js @@ -0,0 +1,4 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:dt,setPrototypeOf:at,isFrozen:Wt,getPrototypeOf:Bt,getOwnPropertyDescriptor:Yt}=Object;let{freeze:S,seal:O,create:Tt}=Object,{apply:Ce,construct:we}=typeof Reflect<"u"&&Reflect;S||(S=function(o){return o});O||(O=function(o){return o});Ce||(Ce=function(o,l,s){return o.apply(l,s)});we||(we=function(o,l){return new o(...l)});const se=R(Array.prototype.forEach),Xt=R(Array.prototype.lastIndexOf),rt=R(Array.prototype.pop),V=R(Array.prototype.push),jt=R(Array.prototype.splice),ce=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),st=R(String.prototype.match),$=R(String.prototype.replace),Vt=R(String.prototype.indexOf),$t=R(String.prototype.trim),L=R(Object.prototype.hasOwnProperty),A=R(RegExp.prototype.test),q=qt(TypeError);function R(r){return function(o){for(var l=arguments.length,s=new Array(l>1?l-1:0),T=1;T2&&arguments[2]!==void 0?arguments[2]:ce;at&&at(r,null);let s=o.length;for(;s--;){let T=o[s];if(typeof T=="string"){const b=l(T);b!==T&&(Wt(o)||(o[s]=b),T=b)}r[T]=!0}return r}function Kt(r){for(let o=0;o/gm),tn=O(/\$\{[\w\W]*/gm),nn=O(/^data-[\-\w.\u00B7-\uFFFF]+$/),on=O(/^aria-[\-\w]+$/),_t=O(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),an=O(/^(?:\w+script|data):/i),rn=O(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Et=O(/^html$/i),sn=O(/^[a-z][.\w]*(-[.\w]+)+$/i);var mt=Object.freeze({__proto__:null,ARIA_ATTR:on,ATTR_WHITESPACE:rn,CUSTOM_ELEMENT:sn,DATA_ATTR:nn,DOCTYPE_NAME:Et,ERB_EXPR:en,IS_ALLOWED_URI:_t,IS_SCRIPT_OR_DATA:an,MUSTACHE_EXPR:Qt,TMPLIT_EXPR:tn});const Z={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ln=function(){return typeof window>"u"?null:window},cn=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let s=null;const T="data-tt-policy-suffix";l&&l.hasAttribute(T)&&(s=l.getAttribute(T));const b="dompurify"+(s?"#"+s:"");try{return o.createPolicy(b,{createHTML(x){return x},createScriptURL(x){return x}})}catch{return console.warn("TrustedTypes policy "+b+" could not be created."),null}},pt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gt(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ln();const o=i=>gt(i);if(o.version="3.2.4",o.removed=[],!r||!r.document||r.document.nodeType!==Z.document||!r.Element)return o.isSupported=!1,o;let{document:l}=r;const s=l,T=s.currentScript,{DocumentFragment:b,HTMLTemplateElement:x,Node:fe,Element:xe,NodeFilter:z,NamedNodeMap:ht=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:At,DOMParser:St,trustedTypes:J}=r,G=xe.prototype,Rt=K(G,"cloneNode"),yt=K(G,"remove"),Ot=K(G,"nextSibling"),Lt=K(G,"childNodes"),Q=K(G,"parentNode");if(typeof x=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let E,W="";const{implementation:ue,createNodeIterator:Nt,createDocumentFragment:Dt,getElementsByTagName:bt}=l,{importNode:It}=s;let g=pt();o.isSupported=typeof dt=="function"&&typeof Q=="function"&&ue&&ue.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:me,ERB_EXPR:pe,TMPLIT_EXPR:de,DATA_ATTR:Mt,ARIA_ATTR:Ct,IS_SCRIPT_OR_DATA:wt,ATTR_WHITESPACE:Pe,CUSTOM_ELEMENT:xt}=mt;let{IS_ALLOWED_URI:ve}=mt,u=null;const ke=a({},[...lt,...De,...be,...Ie,...ct]);let p=null;const Ue=a({},[...ft,...Me,...ut,...le]);let f=Object.seal(Tt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,Te=null,Fe=!0,_e=!0,He=!1,ze=!0,P=!1,Ee=!0,C=!1,ge=!1,he=!1,v=!1,ee=!1,te=!1,Ge=!0,We=!1;const Pt="user-content-";let Ae=!0,Y=!1,k={},U=null;const Be=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Xe=a({},["audio","video","img","source","image","track"]);let Se=null;const je=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ne="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xhtml";let F=I,Re=!1,ye=null;const vt=a({},[ne,oe,I],Ne);let ie=a({},["mi","mo","mn","ms","mtext"]),ae=a({},["annotation-xml"]);const kt=a({},["title","style","font","a","script"]);let X=null;const Ut=["application/xhtml+xml","text/html"],Ft="text/html";let m=null,H=null;const Ht=l.createElement("form"),Ve=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=w(e),X=Ut.indexOf(e.PARSER_MEDIA_TYPE)===-1?Ft:e.PARSER_MEDIA_TYPE,m=X==="application/xhtml+xml"?Ne:ce,u=L(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,m):ke,p=L(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,m):Ue,ye=L(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,Ne):vt,Se=L(e,"ADD_URI_SAFE_ATTR")?a(w(je),e.ADD_URI_SAFE_ATTR,m):je,Ye=L(e,"ADD_DATA_URI_TAGS")?a(w(Xe),e.ADD_DATA_URI_TAGS,m):Xe,U=L(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,m):Be,B=L(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,m):{},Te=L(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,m):{},k=L(e,"USE_PROFILES")?e.USE_PROFILES:!1,Fe=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,He=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,C=e.WHOLE_DOCUMENT||!1,v=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Ge=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ae=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,ve=e.ALLOWED_URI_REGEXP||_t,F=e.NAMESPACE||I,ie=e.MATHML_TEXT_INTEGRATION_POINTS||ie,ae=e.HTML_INTEGRATION_POINTS||ae,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),ee&&(v=!0),k&&(u=a({},ct),p=[],k.html===!0&&(a(u,lt),a(p,ft)),k.svg===!0&&(a(u,De),a(p,Me),a(p,le)),k.svgFilters===!0&&(a(u,be),a(p,Me),a(p,le)),k.mathMl===!0&&(a(u,Ie),a(p,ut),a(p,le))),e.ADD_TAGS&&(u===ke&&(u=w(u)),a(u,e.ADD_TAGS,m)),e.ADD_ATTR&&(p===Ue&&(p=w(p)),a(p,e.ADD_ATTR,m)),e.ADD_URI_SAFE_ATTR&&a(Se,e.ADD_URI_SAFE_ATTR,m),e.FORBID_CONTENTS&&(U===Be&&(U=w(U)),a(U,e.FORBID_CONTENTS,m)),Ae&&(u["#text"]=!0),C&&a(u,["html","head","body"]),u.table&&(a(u,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=e.TRUSTED_TYPES_POLICY,W=E.createHTML("")}else E===void 0&&(E=cn(J,T)),E!==null&&typeof W=="string"&&(W=E.createHTML(""));S&&S(e),H=e}},$e=a({},[...De,...be,...Zt]),qe=a({},[...Ie,...Jt]),zt=function(e){let t=Q(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const n=ce(e.tagName),c=ce(t.tagName);return ye[e.namespaceURI]?e.namespaceURI===oe?t.namespaceURI===I?n==="svg":t.namespaceURI===ne?n==="svg"&&(c==="annotation-xml"||ie[c]):!!$e[n]:e.namespaceURI===ne?t.namespaceURI===I?n==="math":t.namespaceURI===oe?n==="math"&&ae[c]:!!qe[n]:e.namespaceURI===I?t.namespaceURI===oe&&!ae[c]||t.namespaceURI===ne&&!ie[c]?!1:!qe[n]&&(kt[n]||!$e[n]):!!(X==="application/xhtml+xml"&&ye[e.namespaceURI]):!1},N=function(e){V(o.removed,{element:e});try{Q(e).removeChild(e)}catch{yt(e)}},re=function(e,t){try{V(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(v||ee)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},Ke=function(e){let t=null,n=null;if(he)e=""+e;else{const d=st(e,/^[\r\n\t ]+/);n=d&&d[0]}X==="application/xhtml+xml"&&F===I&&(e=''+e+"");const c=E?E.createHTML(e):e;if(F===I)try{t=new St().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=ue.createDocument(F,"template",null);try{t.documentElement.innerHTML=Re?W:c}catch{}}const _=t.body||t.documentElement;return e&&n&&_.insertBefore(l.createTextNode(n),_.childNodes[0]||null),F===I?bt.call(t,C?"html":"body")[0]:C?t.documentElement:_},Ze=function(e){return Nt.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof At&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof ht)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Je=function(e){return typeof fe=="function"&&e instanceof fe};function M(i,e,t){se(i,n=>{n.call(o,e,t,H)})}const Qe=function(e){let t=null;if(M(g.beforeSanitizeElements,e,null),Le(e))return N(e),!0;const n=m(e.nodeName);if(M(g.uponSanitizeElement,e,{tagName:n,allowedTags:u}),e.hasChildNodes()&&!Je(e.firstElementChild)&&A(/<[/\w]/g,e.innerHTML)&&A(/<[/\w]/g,e.textContent)||e.nodeType===Z.progressingInstruction||Ee&&e.nodeType===Z.comment&&A(/<[/\w]/g,e.data))return N(e),!0;if(!u[n]||B[n]){if(!B[n]&&tt(n)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(Ae&&!U[n]){const c=Q(e)||e.parentNode,_=Lt(e)||e.childNodes;if(_&&c){const d=_.length;for(let y=d-1;y>=0;--y){const D=Rt(_[y],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,Ot(e))}}}return N(e),!0}return e instanceof xe&&!zt(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,se([me,pe,de],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(o.removed,{element:e.cloneNode()}),e.textContent=t)),M(g.afterSanitizeElements,e,null),!1)},et=function(e,t,n){if(Ge&&(t==="id"||t==="name")&&(n in l||n in Ht))return!1;if(!(_e&&!Te[t]&&A(Mt,t))){if(!(Fe&&A(Ct,t))){if(!p[t]||Te[t]){if(!(tt(e)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&A(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Se[t]){if(!A(ve,$(n,Pe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Vt(n,"data:")===0&&Ye[e])){if(!(He&&!A(wt,$(n,Pe,"")))){if(n)return!1}}}}}}return!0},tt=function(e){return e!=="annotation-xml"&&st(e,xt)},nt=function(e){M(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:p,forceKeepAttr:void 0};let c=t.length;for(;c--;){const _=t[c],{name:d,namespaceURI:y,value:D}=_,j=m(d);let h=d==="value"?D:$t(D);if(n.attrName=j,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,M(g.uponSanitizeAttribute,e,n),h=n.attrValue,We&&(j==="id"||j==="name")&&(re(d,e),h=Pt+h),Ee&&A(/((--!?|])>)|<\/(style|title)/i,h)){re(d,e);continue}if(n.forceKeepAttr||(re(d,e),!n.keepAttr))continue;if(!ze&&A(/\/>/i,h)){re(d,e);continue}P&&se([me,pe,de],it=>{h=$(h,it," ")});const ot=m(e.nodeName);if(et(ot,j,h)){if(E&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!y)switch(J.getAttributeType(ot,j)){case"TrustedHTML":{h=E.createHTML(h);break}case"TrustedScriptURL":{h=E.createScriptURL(h);break}}try{y?e.setAttributeNS(y,d,h):e.setAttribute(d,h),Le(e)?N(e):rt(o.removed)}catch{}}}M(g.afterSanitizeAttributes,e,null)},Gt=function i(e){let t=null;const n=Ze(e);for(M(g.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)M(g.uponSanitizeShadowNode,t,null),Qe(t),nt(t),t.content instanceof b&&i(t.content);M(g.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,c=null,_=null;if(Re=!i,Re&&(i=""),typeof i!="string"&&!Je(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!o.isSupported)return i;if(ge||Oe(e),o.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=m(i.nodeName);if(!u[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof fe)t=Ke(""),n=t.ownerDocument.importNode(i,!0),n.nodeType===Z.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!v&&!P&&!C&&i.indexOf("<")===-1)return E&&te?E.createHTML(i):i;if(t=Ke(i),!t)return v?null:te?W:""}t&&he&&N(t.firstChild);const d=Ze(Y?i:t);for(;c=d.nextNode();)Qe(c),nt(c),c.content instanceof b&&Gt(c.content);if(Y)return i;if(v){if(ee)for(_=Dt.call(t.ownerDocument);t.firstChild;)_.appendChild(t.firstChild);else _=t;return(p.shadowroot||p.shadowrootmode)&&(_=It.call(s,_,!0)),_}let y=C?t.outerHTML:t.innerHTML;return C&&u["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(Et,t.ownerDocument.doctype.name)&&(y=" +`+y),P&&se([me,pe,de],D=>{y=$(y,D," ")}),E&&te?E.createHTML(y):y},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Oe(i),ge=!0},o.clearConfig=function(){H=null,ge=!1},o.isValidAttribute=function(i,e,t){H||Oe({});const n=m(i),c=m(e);return et(n,c,t)},o.addHook=function(i,e){typeof e=="function"&&V(g[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=Xt(g[i],e);return t===-1?void 0:jt(g[i],t,1)[0]}return rt(g[i])},o.removeHooks=function(i){g[i]=[]},o.removeAllHooks=function(){g=pt()},o}var fn=gt();export{fn as p}; diff --git a/scripts/__dropins__/storefront-checkout/chunks/checkout.js b/scripts/__dropins__/storefront-checkout/chunks/checkout.js new file mode 100644 index 0000000000..a4682301a6 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/chunks/checkout.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +var r=(a=>(a.MANUAL="manual",a.AUTO="auto",a))(r||{});export{r as A}; diff --git a/scripts/__dropins__/storefront-checkout/chunks/setBillingAddress.js b/scripts/__dropins__/storefront-checkout/chunks/setBillingAddress.js index 1077672ab0..5a220bad60 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/setBillingAddress.js +++ b/scripts/__dropins__/storefront-checkout/chunks/setBillingAddress.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{M as e,e as o}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as d}from"../fragments.js";import{a as l,d as p,b as u}from"./synchronizeCheckout.js";import{s as c}from"./store-config.js";import"./transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const m=` +import{M as e,e as o}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as d}from"../fragments.js";import{a as l,d as p,b as u}from"./synchronizeCheckout.js";import{s as c}from"./state.js";import"./transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const m=` mutation setBillingAddress($input: SetBillingAddressOnCartInput!) { setBillingAddressOnCart(input: $input) { cart { diff --git a/scripts/__dropins__/storefront-checkout/chunks/setGuestEmailOnCart.js b/scripts/__dropins__/storefront-checkout/chunks/setGuestEmailOnCart.js index ba7bb7db2e..992040d759 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/setGuestEmailOnCart.js +++ b/scripts/__dropins__/storefront-checkout/chunks/setGuestEmailOnCart.js @@ -1,12 +1,12 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{s as r}from"./store-config.js";import{j as e}from"./transform-store-config.js";import{c as s,M as l}from"./errors.js";import{j as o,d as m,b as n}from"./synchronizeCheckout.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as c}from"../fragments.js";const u=a=>!!(a!=null&&a.is_email_available),p=` +import{s as r}from"./state.js";import{g as e}from"./transform-store-config.js";import{c as s,M as l}from"./errors.js";import{j as o,d as m,b as n}from"./synchronizeCheckout.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as c}from"../fragments.js";const u=a=>!!(a!=null&&a.is_email_available),p=a=>{if(!(!a||a.length===0))throw Error(a.map(t=>t.message).join(" "))},E=` query isEmailAvailable($email: String!) { isEmailAvailable(email: $email) { is_email_available } } -`,E=a=>{if(!(!a||a.length===0))throw Error(a.map(t=>t.message).join(" "))},_=async a=>{if(!a)throw new s;const{data:t,errors:i}=await e(p,{method:"GET",cache:"no-cache",variables:{email:a}}).catch(o);return i&&E(i),u(t.isEmailAvailable)},h=` +`,G=async a=>{if(!a)throw new s;const{data:t,errors:i}=await e(E,{method:"GET",cache:"no-cache",variables:{email:a}}).catch(o);return i&&p(i),u(t.isEmailAvailable)},h=` mutation setGuestEmail($cartId: String!, $email: String!) { setGuestEmailOnCart(input: { cart_id: $cartId, email: $email }) { cart { @@ -16,4 +16,4 @@ import{s as r}from"./store-config.js";import{j as e}from"./transform-store-confi } ${c} -`,g=async a=>{const t=r.cartId;if(!t)throw new l;return await m({options:{variables:{cartId:t,email:a}},path:"setGuestEmailOnCart.cart",query:h,queueName:"cartUpdate",signalType:"cart",transformer:n,type:"mutation"})};export{_ as i,g as s}; +`,_=async a=>{const t=r.cartId;if(!t)throw new l;return await m({options:{variables:{cartId:t,email:a}},path:"setGuestEmailOnCart.cart",query:h,queueName:"cartUpdate",signalType:"cart",transformer:n,type:"mutation"})};export{p as h,G as i,_ as s}; diff --git a/scripts/__dropins__/storefront-checkout/chunks/setPaymentMethod.js b/scripts/__dropins__/storefront-checkout/chunks/setPaymentMethod.js index fdfc25421a..82c9f952ef 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/setPaymentMethod.js +++ b/scripts/__dropins__/storefront-checkout/chunks/setPaymentMethod.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{M as e,d as r}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as o}from"../fragments.js";import{d as n,b as s}from"./synchronizeCheckout.js";import{s as m}from"./store-config.js";import"./transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const i=` +import{M as e,d as r}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as o}from"../fragments.js";import{d as n,b as s}from"./synchronizeCheckout.js";import{s as m}from"./state.js";import"./transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const i=` mutation setPaymentMethod( $cartId: String! $paymentMethod: PaymentMethodInput! diff --git a/scripts/__dropins__/storefront-checkout/chunks/setShippingMethods.js b/scripts/__dropins__/storefront-checkout/chunks/setShippingMethods.js index 2512e577c3..27a803ba2b 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/setShippingMethods.js +++ b/scripts/__dropins__/storefront-checkout/chunks/setShippingMethods.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{s as r}from"./store-config.js";import"./transform-store-config.js";import{M as i}from"./errors.js";import{d as n,b as e}from"./synchronizeCheckout.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as s}from"../fragments.js";const M=t=>({countryCode:t.country_id,postCode:t.postcode||"",...t.region_id?{regionId:Number(t.region_id)}:{...t.region?{region:t.region}:{}}}),T=t=>({carrierCode:t.carrier.code||"",methodCode:t.code||"",amount:t.amount,amountExclTax:t.amountExclTax,amountInclTax:t.amountInclTax}),a=` +import{s as r}from"./state.js";import"./transform-store-config.js";import{M as i}from"./errors.js";import{d as n,b as e}from"./synchronizeCheckout.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as s}from"../fragments.js";const M=t=>({countryCode:t.country_id,postCode:t.postcode||"",...t.region_id?{regionId:Number(t.region_id)}:{...t.region?{region:t.region}:{}}}),T=t=>({carrierCode:t.carrier.code||"",methodCode:t.code||"",amount:t.amount,amountExclTax:t.amountExclTax,amountInclTax:t.amountInclTax}),a=` mutation setShippingMethods( $cartId: String! $shippingMethods: [ShippingMethodInput]! diff --git a/scripts/__dropins__/storefront-checkout/chunks/state.js b/scripts/__dropins__/storefront-checkout/chunks/state.js new file mode 100644 index 0000000000..a5d1307678 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/chunks/state.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +const a={authenticated:!1,cartId:null,initialized:!1,config:null},s=new Proxy(a,{set(t,e,n){return t[e]=n,!0},get(t,e){return t[e]}}),o=()=>s.config;export{o as g,s}; diff --git a/scripts/__dropins__/storefront-checkout/chunks/store-config.js b/scripts/__dropins__/storefront-checkout/chunks/store-config.js index ebdc3b9b99..e96dc6a27d 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/store-config.js +++ b/scripts/__dropins__/storefront-checkout/chunks/store-config.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -const I={authenticated:!1,cartId:null,initialized:!1,config:null},N=new Proxy(I,{set(t,e,n){return t[e]=n,!0},get(t,e){return t[e]}}),s=()=>N.config;var r=(t=>(t.EXCLUDING_TAX="EXCLUDING_TAX",t.INCLUDING_EXCLUDING_TAX="INCLUDING_AND_EXCLUDING_TAX",t.INCLUDING_TAX="INCLUDING_TAX",t))(r||{});export{r as T,s as g,N as s}; +var I=(N=>(N.EXCLUDING_TAX="EXCLUDING_TAX",N.INCLUDING_EXCLUDING_TAX="INCLUDING_AND_EXCLUDING_TAX",N.INCLUDING_TAX="INCLUDING_TAX",N))(I||{});export{I as T}; diff --git a/scripts/__dropins__/storefront-checkout/chunks/synchronizeCheckout.js b/scripts/__dropins__/storefront-checkout/chunks/synchronizeCheckout.js index 2cb14a7cea..d86c99f082 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/synchronizeCheckout.js +++ b/scripts/__dropins__/storefront-checkout/chunks/synchronizeCheckout.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{s as i}from"./store-config.js";import{d as C,j as y,c as m,e as R,l as z}from"./transform-store-config.js";import{events as c}from"@dropins/tools/event-bus.js";import{merge as A,Initializer as G}from"@dropins/tools/lib.js";import{CHECKOUT_DATA_FRAGMENT as b,CUSTOMER_FRAGMENT as O}from"../fragments.js";import{F as $,M as U}from"./errors.js";const D=async(e=!1)=>{i.authenticated=e,e?await me():C.value={pending:!1,data:null}},x={cartUpdate:{requests:[]},default:{requests:[]}};function F(e,t="default"){const r=x[t];return new Promise((n,o)=>{r.requests.push(e);const a=()=>{r.requests[0]===e?e().then(n).catch(o).finally(()=>{var l;r.requests.shift(),r.requests.length===0?(l=r.onComplete)==null||l.call(r):a()}):setTimeout(a,100)};a()})}function Q(e,t){const r=x[e];r.onComplete=t}const V=["sender_email","recipient_email"];function B(e){return e.filter(t=>!t.path||!V.some(r=>{var n;return((n=t.path)==null?void 0:n.at(-1))===r}))}const v=e=>{throw e instanceof DOMException&&e.name==="AbortError"||c.emit("error",{source:"checkout",type:"network",error:e}),e},H={cart:m,customer:C,estimateShippingMethods:R};function K(e,t){return t.split(".").reduce((r,n)=>r&&r[n]!==void 0?r[n]:void 0,e)}const _={cart:null,customer:null,estimateShippingMethods:null};async function E(e){const{defaultValueOnFail:t,options:r,path:n,query:o,queueName:a,signalType:l,transformer:p,type:P}=e,s=H[l],d=Symbol();_[l]=d,s.value={...s.value,pending:!0};try{const{data:f,errors:h}=await(P==="mutation"?F(()=>y(o,r).catch(v),a):y(o,{method:"GET",cache:"no-cache",...r}).catch(v));if(h){const g=B(h);if(g.length>0)throw new $(g)}let u=K(f,n);if(u===void 0)throw new Error(`No data found at path: ${n}`);return p&&(u=p(u)),s.value={...s.value,data:u},setTimeout(()=>{s.value={...s.value,pending:_[l]===d?!1:s.value.pending}},0),u}catch(f){if(t)return s.value={pending:!1,data:t},t;if(f.name==="AbortError")return;throw s.value={...s.value,pending:!1},f}}const j=e=>e==null,L=(e,t)=>e.amount.value-t.amount.value,M=e=>!(!e||!e.method_code||!e.method_title||j(e.amount.value)||!e.amount.currency),T=e=>({amount:{value:e.amount.value,currency:e.amount.currency},title:e.method_title,code:e.method_code,carrier:{code:e.carrier_code,title:e.carrier_title},value:`${e.carrier_code} - ${e.method_code}`,...e.price_excl_tax&&{amountExclTax:{value:e.price_excl_tax.value,currency:e.price_excl_tax.currency}},...e.price_incl_tax&&{amountInclTax:{value:e.price_incl_tax.value,currency:e.price_incl_tax.currency}}}),J=e=>{if(M(e))return T(e)},W=e=>{if(e)return e.filter(M).map(t=>T(t)).sort(L)},X=e=>e?!!e.code&&!!e.label:!1,Y=e=>{if(!X(e))return;const{code:t,label:r,region_id:n}=e;return n?{code:t,name:r,id:n}:{code:t,name:r}},Z=e=>{const{code:t,label:r}=e;return{value:t,label:r}},ee=e=>e?"code"in e&&"value"in e:!1,te=e=>e.filter(ee).map(t=>{const{code:r,value:n}=t;return{code:r,value:n}}),S=e=>{const t=e.street.filter(Boolean);return{id:(e==null?void 0:e.id)||void 0,city:e.city,company:e.company||void 0,country:Z(e.country),customAttributes:te(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:Y(e.region),street:t,telephone:e.telephone||void 0,vatId:e.vat_id||void 0,prefix:e.prefix||void 0,suffix:e.suffix||void 0,middleName:e.middlename||void 0,fax:e.fax||void 0}},re=e=>{if(e)return S(e)},ne=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:r,selected_shipping_method:n,same_as_billing:o,...a}=t;return{...S(a),availableShippingMethods:W(r),selectedShippingMethod:J(n),sameAsBilling:o}}),Ce=e=>({city:e.city,company:e.company,country_code:e.countryCode,custom_attributes:e.customAttributes.map(t=>({attribute_code:t.code,value:t.value})),firstname:e.firstName,lastname:e.lastName,postcode:e.postcode,region:e.region,region_id:e.regionId,save_in_address_book:e.saveInAddressBook??!0,street:e.street,telephone:e.telephone,vat_id:e.vatId,prefix:e.prefix,suffix:e.suffix,middlename:e.middleName,fax:e.fax}),ie=e=>{if(e)return{code:e.code,title:e.title}},oe=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:r,title:n}=t;return{code:r,title:n}})},se=e=>{var r,n,o;if(!e)return;const t={availablePaymentMethods:oe(e.available_payment_methods),billingAddress:re(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:ie(e.selected_payment_method),shippingAddresses:ne(e.shipping_addresses),isGuest:!i.authenticated};return A(t,(o=(n=(r=N.getConfig().models)==null?void 0:r.CartModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},ce=e=>{var r,n,o;if(!e)return;const t={firstName:e.firstname||"",lastName:e.lastname||"",email:e.email||""};return A(t,(o=(n=(r=N.getConfig().models)==null?void 0:r.CustomerModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},ae=` +import{s as i}from"./state.js";import{f as C,g as y,c as m,e as R,m as z}from"./transform-store-config.js";import{events as c}from"@dropins/tools/event-bus.js";import{merge as A,Initializer as G}from"@dropins/tools/lib.js";import{CHECKOUT_DATA_FRAGMENT as b,CUSTOMER_FRAGMENT as O}from"../fragments.js";import{F as $,M as U}from"./errors.js";const D=async(e=!1)=>{i.authenticated=e,e?await me():C.value={pending:!1,data:null}},x={cartUpdate:{requests:[]},default:{requests:[]}};function F(e,t="default"){const r=x[t];return new Promise((n,o)=>{r.requests.push(e);const a=()=>{r.requests[0]===e?e().then(n).catch(o).finally(()=>{var l;r.requests.shift(),r.requests.length===0?(l=r.onComplete)==null||l.call(r):a()}):setTimeout(a,100)};a()})}function Q(e,t){const r=x[e];r.onComplete=t}const V=["sender_email","recipient_email"];function B(e){return e.filter(t=>!t.path||!V.some(r=>{var n;return((n=t.path)==null?void 0:n.at(-1))===r}))}const v=e=>{throw e instanceof DOMException&&e.name==="AbortError"||c.emit("error",{source:"checkout",type:"network",error:e}),e},H={cart:m,customer:C,estimateShippingMethods:R};function K(e,t){return t.split(".").reduce((r,n)=>r&&r[n]!==void 0?r[n]:void 0,e)}const _={cart:null,customer:null,estimateShippingMethods:null};async function E(e){const{defaultValueOnFail:t,options:r,path:n,query:o,queueName:a,signalType:l,transformer:p,type:P}=e,s=H[l],d=Symbol();_[l]=d,s.value={...s.value,pending:!0};try{const{data:f,errors:h}=await(P==="mutation"?F(()=>y(o,r).catch(v),a):y(o,{method:"GET",cache:"no-cache",...r}).catch(v));if(h){const g=B(h);if(g.length>0)throw new $(g)}let u=K(f,n);if(u===void 0)throw new Error(`No data found at path: ${n}`);return p&&(u=p(u)),s.value={...s.value,data:u},setTimeout(()=>{s.value={...s.value,pending:_[l]===d?!1:s.value.pending}},0),u}catch(f){if(t)return s.value={pending:!1,data:t},t;if(f.name==="AbortError")return;throw s.value={...s.value,pending:!1},f}}const j=e=>e==null,L=(e,t)=>e.amount.value-t.amount.value,M=e=>!(!e||!e.method_code||!e.method_title||j(e.amount.value)||!e.amount.currency),T=e=>({amount:{value:e.amount.value,currency:e.amount.currency},title:e.method_title,code:e.method_code,carrier:{code:e.carrier_code,title:e.carrier_title},value:`${e.carrier_code} - ${e.method_code}`,...e.price_excl_tax&&{amountExclTax:{value:e.price_excl_tax.value,currency:e.price_excl_tax.currency}},...e.price_incl_tax&&{amountInclTax:{value:e.price_incl_tax.value,currency:e.price_incl_tax.currency}}}),J=e=>{if(M(e))return T(e)},W=e=>{if(e)return e.filter(M).map(t=>T(t)).sort(L)},X=e=>e?!!e.code&&!!e.label:!1,Y=e=>{if(!X(e))return;const{code:t,label:r,region_id:n}=e;return n?{code:t,name:r,id:n}:{code:t,name:r}},Z=e=>{const{code:t,label:r}=e;return{value:t,label:r}},ee=e=>e?"code"in e&&"value"in e:!1,te=e=>e.filter(ee).map(t=>{const{code:r,value:n}=t;return{code:r,value:n}}),S=e=>{const t=e.street.filter(Boolean);return{id:(e==null?void 0:e.id)||void 0,city:e.city,company:e.company||void 0,country:Z(e.country),customAttributes:te(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:Y(e.region),street:t,telephone:e.telephone||void 0,vatId:e.vat_id||void 0,prefix:e.prefix||void 0,suffix:e.suffix||void 0,middleName:e.middlename||void 0,fax:e.fax||void 0}},re=e=>{if(e)return S(e)},ne=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:r,selected_shipping_method:n,same_as_billing:o,...a}=t;return{...S(a),availableShippingMethods:W(r),selectedShippingMethod:J(n),sameAsBilling:o}}),Ce=e=>({city:e.city,company:e.company,country_code:e.countryCode,custom_attributes:e.customAttributes.map(t=>({attribute_code:t.code,value:t.value})),firstname:e.firstName,lastname:e.lastName,postcode:e.postcode,region:e.region,region_id:e.regionId,save_in_address_book:e.saveInAddressBook??!0,street:e.street,telephone:e.telephone,vat_id:e.vatId,prefix:e.prefix,suffix:e.suffix,middlename:e.middleName,fax:e.fax}),ie=e=>{if(e)return{code:e.code,title:e.title}},oe=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:r,title:n}=t;return{code:r,title:n}})},se=e=>{var r,n,o;if(!e)return;const t={availablePaymentMethods:oe(e.available_payment_methods),billingAddress:re(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:ie(e.selected_payment_method),shippingAddresses:ne(e.shipping_addresses),isGuest:!i.authenticated};return A(t,(o=(n=(r=N.getConfig().models)==null?void 0:r.CartModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},ce=e=>{var r,n,o;if(!e)return;const t={firstName:e.firstname||"",lastName:e.lastname||"",email:e.email||""};return A(t,(o=(n=(r=N.getConfig().models)==null?void 0:r.CustomerModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},ae=` query getCart($cartId: String!) { cart(cart_id: $cartId) { ...CHECKOUT_DATA_FRAGMENT diff --git a/scripts/__dropins__/storefront-checkout/chunks/transform-store-config.js b/scripts/__dropins__/storefront-checkout/chunks/transform-store-config.js index e9e8898d03..e9eab31426 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/transform-store-config.js +++ b/scripts/__dropins__/storefront-checkout/chunks/transform-store-config.js @@ -1,12 +1,13 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{T as a}from"./store-config.js";import{signal as t,effect as c}from"@dropins/tools/signals.js";import"@dropins/tools/event-bus.js";import{FetchGraphQL as l}from"@dropins/tools/fetch-graphql.js";import"@dropins/tools/lib.js";const p=t(!0),g=t({pending:!1,data:void 0});c(()=>{var e;(e=g.value.data)!=null&&e.isVirtual&&(p.value=!1)});const y=t({pending:!1,data:void 0}),T=t({pending:!1,data:void 0}),D=t(),b=t(void 0),k=t(),u=` +import{FetchGraphQL as l}from"@dropins/tools/fetch-graphql.js";import{T as a}from"./store-config.js";import"./state.js";import{signal as t,effect as u}from"@dropins/tools/signals.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const g=t(!0),p=t({pending:!1,data:void 0});u(()=>{var e;(e=p.value.data)!=null&&e.isVirtual&&(g.value=!1)});const y=t({pending:!1,data:void 0}),T=t({available:!0,error:"",initialized:!1,pending:!1,value:""}),D=t({pending:!1,data:void 0}),v=t(),N=t(void 0),U=t(),{setEndpoint:A,setFetchGraphQlHeader:I,removeFetchGraphQlHeader:L,setFetchGraphQlHeaders:X,fetchGraphQl:d,getConfig:F}=new l().getMethods(),h=` query getStoreConfig { storeConfig { default_country + is_checkout_agreements_enabled is_guest_checkout_enabled is_one_page_checkout_enabled shopping_cart_display_shipping } } -`,{setEndpoint:N,setFetchGraphQlHeader:U,removeFetchGraphQlHeader:I,setFetchGraphQlHeaders:L,fetchGraphQl:h,getConfig:X}=new l().getMethods(),d="US",n={defaultCountry:d,isGuestCheckoutEnabled:!1,isOnePageCheckoutEnabled:!1,shoppingCartDisplaySetting:{shipping:a.EXCLUDING_TAX}},v=async()=>h(u,{method:"GET",cache:"no-cache"}).then(({errors:e,data:s})=>e?n:_(s.storeConfig));function f(e){switch(e){case 1:return a.EXCLUDING_TAX;case 2:return a.INCLUDING_TAX;case 3:return a.INCLUDING_EXCLUDING_TAX;default:return a.EXCLUDING_TAX}}function _(e){if(!e)return n;const{default_country:s,is_guest_checkout_enabled:i,is_one_page_checkout_enabled:o,shopping_cart_display_shipping:r}=e;return{defaultCountry:s||n.defaultCountry,isGuestCheckoutEnabled:i||n.isGuestCheckoutEnabled,isOnePageCheckoutEnabled:o||n.isOnePageCheckoutEnabled,shoppingCartDisplaySetting:{shipping:f(r)}}}export{d as D,n as S,k as a,D as b,g as c,y as d,T as e,N as f,U as g,L as h,p as i,h as j,X as k,v as l,I as r,b as s}; +`,_="US",n={defaultCountry:_,isCheckoutAgreementsEnabled:!0,isGuestCheckoutEnabled:!1,isOnePageCheckoutEnabled:!1,shoppingCartDisplaySetting:{shipping:a.EXCLUDING_TAX}},O=async()=>d(h,{method:"GET",cache:"no-cache"}).then(({errors:e,data:s})=>e?n:C(s.storeConfig));function f(e){switch(e){case 1:return a.EXCLUDING_TAX;case 2:return a.INCLUDING_TAX;case 3:return a.INCLUDING_EXCLUDING_TAX;default:return a.EXCLUDING_TAX}}function C(e){if(!e)return n;const{default_country:s,is_checkout_agreements_enabled:i,is_guest_checkout_enabled:o,is_one_page_checkout_enabled:r,shopping_cart_display_shipping:c}=e;return{defaultCountry:s||n.defaultCountry,isCheckoutAgreementsEnabled:i,isGuestCheckoutEnabled:o||n.isGuestCheckoutEnabled,isOnePageCheckoutEnabled:r||n.isOnePageCheckoutEnabled,shoppingCartDisplaySetting:{shipping:f(c)}}}export{_ as D,n as S,U as a,T as b,p as c,v as d,D as e,y as f,d as g,A as h,g as i,I as j,X as k,F as l,O as m,L as r,N as s}; diff --git a/scripts/__dropins__/storefront-checkout/chunks/withConditionalRendering.js b/scripts/__dropins__/storefront-checkout/chunks/withConditionalRendering.js index 065a248808..8bf80fcccd 100644 --- a/scripts/__dropins__/storefront-checkout/chunks/withConditionalRendering.js +++ b/scripts/__dropins__/storefront-checkout/chunks/withConditionalRendering.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{c as p}from"./transform-store-config.js";import"./store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";function u(i){return i.displayName||i.name||"Component"}const g=i=>{const o=u(i),a=({hideOnEmptyCart:s=!0,hideOnVirtualCart:r=!1,...e})=>{const t=p.value.data,l=t!==void 0&&(t===null||t.isEmpty),m=!!(t!=null&&t.isVirtual),c=s&&l||r&&m,d=`conditional-${o.toLowerCase()}`;return n("div",{className:d,children:!c&&n(i,{...e})})};return a.displayName=`Conditional(${o})`,a};export{g as w}; +import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{c as p}from"./transform-store-config.js";import"./state.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";function u(i){return i.displayName||i.name||"Component"}const g=i=>{const o=u(i),a=({hideOnEmptyCart:s=!0,hideOnVirtualCart:r=!1,...e})=>{const t=p.value.data,l=t!==void 0&&(t===null||t.isEmpty),m=!!(t!=null&&t.isVirtual),c=s&&l||r&&m,d=`conditional-${o.toLowerCase()}`;return n("div",{className:d,children:!c&&n(i,{...e})})};return a.displayName=`Conditional(${o})`,a};export{g as w}; diff --git a/scripts/__dropins__/storefront-checkout/components/Markup/Markup.d.ts b/scripts/__dropins__/storefront-checkout/components/Markup/Markup.d.ts new file mode 100644 index 0000000000..07e9e004cd --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/components/Markup/Markup.d.ts @@ -0,0 +1,8 @@ +import { FunctionComponent } from 'preact'; + +interface MarkupProps { + html: string; +} +export declare const Markup: FunctionComponent; +export {}; +//# sourceMappingURL=Markup.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/components/Markup/index.d.ts b/scripts/__dropins__/storefront-checkout/components/Markup/index.d.ts new file mode 100644 index 0000000000..64c82b2957 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/components/Markup/index.d.ts @@ -0,0 +1,18 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './Markup'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/TermsAndConditions.d.ts b/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/TermsAndConditions.d.ts new file mode 100644 index 0000000000..288e672603 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/TermsAndConditions.d.ts @@ -0,0 +1,10 @@ +import { FunctionComponent, VNode } from 'preact'; +import { HTMLAttributes } from 'preact/compat'; + +export interface TermsAndConditionsProps extends HTMLAttributes { + agreements?: VNode; + error?: string; + isInitialized?: boolean; +} +export declare const TermsAndConditions: FunctionComponent; +//# sourceMappingURL=TermsAndConditions.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/TermsAndConditionsSkeleton.d.ts b/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/TermsAndConditionsSkeleton.d.ts new file mode 100644 index 0000000000..8bff301cc0 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/TermsAndConditionsSkeleton.d.ts @@ -0,0 +1,4 @@ +import { FunctionComponent } from 'preact'; + +export declare const TermsAndConditionsSkeleton: FunctionComponent; +//# sourceMappingURL=TermsAndConditionsSkeleton.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/index.d.ts b/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/index.d.ts new file mode 100644 index 0000000000..c4812369e4 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/components/TermsAndConditions/index.d.ts @@ -0,0 +1,20 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './TermsAndConditions'; +export * from './TermsAndConditionsSkeleton'; +export { TermsAndConditions as default } from './TermsAndConditions'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/components/index.d.ts b/scripts/__dropins__/storefront-checkout/components/index.d.ts index fd81759e16..24c198bf23 100644 --- a/scripts/__dropins__/storefront-checkout/components/index.d.ts +++ b/scripts/__dropins__/storefront-checkout/components/index.d.ts @@ -17,9 +17,11 @@ export * from './BillToShippingAddress'; export * from './EstimateShipping'; export * from './LoginForm'; +export * from './Markup'; export * from './OutOfStock'; export * from './PaymentMethods'; export * from './PlaceOrder'; export * from './ServerError'; export * from './ShippingMethods'; +export * from './TermsAndConditions'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress.js b/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress.js index ae09454b82..f47afebc9a 100644 --- a/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress.js +++ b/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/store-config.js";import{i as d,c as u}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";import{s as S}from"../chunks/setBillingAddress.js";/* empty css */import{Checkbox as b,Skeleton as f,SkeletonRow as A}from"@dropins/tools/components.js";import{c as B}from"../chunks/classes.js";import{useText as x}from"@dropins/tools/i18n.js";import{w as T}from"../chunks/withConditionalRendering.js";import{useState as v,useEffect as _}from"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/errors.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const w=({className:i,checked:e,loading:r,disabled:n,onChange:s})=>{const c=x({title:"Checkout.BillToShippingAddress.title"});return r?t(y,{}):t("div",{className:"checkout-bill-to-shipping-address",children:t(b,{checked:e,className:B(["checkout-bill-to-shipping-address__checkbox",i]),"data-testid":"bill-to-shipping-checkbox",disabled:n,label:c.title,name:"checkout-bill-to-shipping-address__checkbox",onChange:s})})},y=()=>t(f,{className:"bill-to-shipping-address__skeleton",children:t(A,{variant:"row",size:"small"})}),k=({onChange:i})=>{var g;const[e,r]=v(!0),n=d.value,s=u.value.data,c=u.value.pending,p=!!s,m=!!(s==null?void 0:s.billingAddress),l=(g=s==null?void 0:s.shippingAddresses)==null?void 0:g[0],h=l==null?void 0:l.sameAsBilling;return _(()=>{if(!e||!p)return;r(!1);const o=h??!m;d.value=o,i==null||i(o)},[p,m,h,e,i]),t(w,{checked:n,disabled:c,loading:e,onChange:async o=>{const a=o.target.checked;d.value=a,i==null||i(a),!e&&l&&a&&await S({sameAsShipping:!0}).catch(console.error)}})};k.displayName="BillToShippingAddressContainer";const U=T(k);export{U as BillToShippingAddress,U as default}; +import{jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/state.js";import{i as d,c as u}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";import{s as S}from"../chunks/setBillingAddress.js";/* empty css */import{Checkbox as b,Skeleton as f,SkeletonRow as A}from"@dropins/tools/components.js";import{c as B}from"../chunks/classes.js";import{useText as x}from"@dropins/tools/i18n.js";import{w as T}from"../chunks/withConditionalRendering.js";import{useState as v,useEffect as _}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const w=({className:i,checked:e,loading:r,disabled:n,onChange:s})=>{const c=x({title:"Checkout.BillToShippingAddress.title"});return r?t(y,{}):t("div",{className:"checkout-bill-to-shipping-address",children:t(b,{checked:e,className:B(["checkout-bill-to-shipping-address__checkbox",i]),"data-testid":"bill-to-shipping-checkbox",disabled:n,label:c.title,name:"checkout-bill-to-shipping-address__checkbox",onChange:s})})},y=()=>t(f,{className:"bill-to-shipping-address__skeleton",children:t(A,{variant:"row",size:"small"})}),k=({onChange:i})=>{var g;const[e,r]=v(!0),n=d.value,s=u.value.data,c=u.value.pending,p=!!s,m=!!(s==null?void 0:s.billingAddress),l=(g=s==null?void 0:s.shippingAddresses)==null?void 0:g[0],h=l==null?void 0:l.sameAsBilling;return _(()=>{if(!e||!p)return;r(!1);const o=h??!m;d.value=o,i==null||i(o)},[p,m,h,e,i]),t(w,{checked:n,disabled:c,loading:e,onChange:async o=>{const a=o.target.checked;d.value=a,i==null||i(a),!e&&l&&a&&await S({sameAsShipping:!0}).catch(console.error)}})};k.displayName="BillToShippingAddressContainer";const V=T(k);export{V as BillToShippingAddress,V as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress/BillToShippingAddress.d.ts b/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress/BillToShippingAddress.d.ts index 7bf875bad1..fd06908cd3 100644 --- a/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress/BillToShippingAddress.d.ts +++ b/scripts/__dropins__/storefront-checkout/containers/BillToShippingAddress/BillToShippingAddress.d.ts @@ -18,7 +18,7 @@ export interface BillToShippingAddressProps { onChange?: (checked: boolean) => void; } export declare const BillToShippingAddress: { - ({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & BillToShippingAddressProps): import("preact/compat").JSX.Element; + ({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & BillToShippingAddressProps): import("preact").JSX.Element; displayName: string; }; //# sourceMappingURL=BillToShippingAddress.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner.d.ts b/scripts/__dropins__/storefront-checkout/containers/ErrorBanner.d.ts deleted file mode 100644 index f03447426a..0000000000 --- a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ErrorBanner/index' -import _default from './ErrorBanner/index' -export default _default diff --git a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner.js b/scripts/__dropins__/storefront-checkout/containers/ErrorBanner.js deleted file mode 100644 index 179ea1285d..0000000000 --- a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as m,Icon as f}from"@dropins/tools/components.js";import{events as u}from"@dropins/tools/event-bus.js";import*as i from"@dropins/tools/preact-compat.js";import{useState as g,useEffect as p}from"@dropins/tools/preact-compat.js";import{useText as h}from"@dropins/tools/i18n.js";const v=o=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},i.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),B=({initialData:o,...l})=>{const[c,s]=g(!1),t=h({message:"Checkout.ErrorBanner.genericMessage"});p(()=>{const r=u.on("error",e=>{(e==null?void 0:e.source)==="checkout"&&(e==null?void 0:e.type)==="network"&&s(!0)});return()=>{r==null||r.off()}},[]);const a=()=>{s(!1)};return c?n(m,{...l,className:"checkout__banner","data-testid":"error-banner",icon:n(f,{source:v}),message:n("span",{children:t.message}),"aria-label":t.message,onDismiss:a,variant:"warning"}):null};export{B as ErrorBanner,B as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner/ErrorBanner.d.ts b/scripts/__dropins__/storefront-checkout/containers/ErrorBanner/ErrorBanner.d.ts deleted file mode 100644 index dad165a095..0000000000 --- a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner/ErrorBanner.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { AlertBannerProps } from '@dropins/tools/types/elsie/src/components'; -import { Container } from '@dropins/tools/types/elsie/src/src/lib/types'; - -export declare const ErrorBanner: Container; -//# sourceMappingURL=ErrorBanner.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner/index.d.ts b/scripts/__dropins__/storefront-checkout/containers/ErrorBanner/index.d.ts deleted file mode 100644 index ce2a684946..0000000000 --- a/scripts/__dropins__/storefront-checkout/containers/ErrorBanner/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************** -* ADOBE CONFIDENTIAL -* __________________ -* -* Copyright 2024 Adobe -* All Rights Reserved. -* -* NOTICE: All information contained herein is, and remains -* the property of Adobe and its suppliers, if any. The intellectual -* and technical concepts contained herein are proprietary to Adobe -* and its suppliers and are protected by all applicable intellectual -* property laws, including trade secret and copyright laws. -* Dissemination of this information or reproduction of this material -* is strictly forbidden unless prior written permission is obtained -* from Adobe. -*******************************************************************/ -export * from './ErrorBanner'; -export { ErrorBanner as default } from './ErrorBanner'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/containers/EstimateShipping.js b/scripts/__dropins__/storefront-checkout/containers/EstimateShipping.js index b0c8de0def..ec09ddb08b 100644 --- a/scripts/__dropins__/storefront-checkout/containers/EstimateShipping.js +++ b/scripts/__dropins__/storefront-checkout/containers/EstimateShipping.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsxs as k,Fragment as y,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as v,SkeletonRow as M,Price as x}from"@dropins/tools/components.js";/* empty css */import{VComponent as A,classes as I}from"@dropins/tools/lib.js";import{Text as l,useText as w}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{s as z,T as C}from"../chunks/store-config.js";import{events as g}from"@dropins/tools/event-bus.js";import{useState as B,useEffect as f}from"@dropins/tools/preact-hooks.js";const G=({estimated:e=!1,price:a,priceExclTax:d,taxExcluded:o=!1,taxIncluded:p=!1})=>k(y,{children:[t("span",{className:"checkout-estimate-shipping__label",children:e?t(l,{id:"Checkout.EstimateShipping.estimated"}):t(l,{id:"Checkout.EstimateShipping.label"})}),t(A,{node:a,className:"checkout-estimate-shipping__price"}),p&&t("span",{"data-testid":"shipping-tax-included",className:I(["checkout-estimate-shipping__caption"]),children:t(l,{id:"Checkout.EstimateShipping.withTaxes"})}),o&&k("span",{"data-testid":"shipping-tax-included-excluded",className:I(["checkout-estimate-shipping__caption"]),children:[d," ",t(l,{id:"Checkout.EstimateShipping.withoutTaxes"})]})]}),L=()=>t(v,{"data-testid":"estimate-shipping-skeleton",children:t(M,{size:"xsmall"})}),O=()=>{const[e,a]=B(),d=e!==void 0,o=(e==null?void 0:e.amount.value)===0,p=z.config,T=p==null?void 0:p.shoppingCartDisplaySetting.shipping,_=T===C.INCLUDING_EXCLUDING_TAX,E=T===C.INCLUDING_TAX,S=w({freeShipping:"Checkout.EstimateShipping.freeShipping",taxToBeDetermined:"Checkout.EstimateShipping.taxToBeDetermined"});f(()=>{const i=g.on("shipping/estimate",n=>{const s=n.shippingMethod,{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!0,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=g.on("checkout/initialized",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=g.on("checkout/updated",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]);const D=()=>o?t("span",{"data-testId":"free-shipping",children:S.freeShipping}):E&&(e!=null&&e.amountInclTax)?t(x,{"data-testid":"shipping",amount:e.amountInclTax.value,currency:e.amountInclTax.currency}):t(x,{"data-testid":"shipping",amount:e==null?void 0:e.amount.value,currency:e==null?void 0:e.amount.currency}),N=()=>e!=null&&e.amountExclTax?t(x,{"data-testid":"shipping-excluding-tax",amount:e.amountExclTax.value,currency:e.amountExclTax.currency}):t("span",{children:S.taxToBeDetermined});return t("div",{"data-testid":"estimate-shipping",className:"checkout-estimate-shipping",children:d?t(G,{estimated:e.estimated,price:D(),taxExcluded:_&&!o,taxIncluded:E&&!o,priceExclTax:N()}):t(L,{})})};export{O as EstimateShipping,O as default}; +import{jsxs as k,Fragment as y,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as v,SkeletonRow as M,Price as x}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{VComponent as A,classes as I}from"@dropins/tools/lib.js";import{Text as l,useText as w}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{T as C}from"../chunks/store-config.js";import{s as z}from"../chunks/state.js";import{events as g}from"@dropins/tools/event-bus.js";import{useState as B,useEffect as f}from"@dropins/tools/preact-hooks.js";const G=({estimated:e=!1,price:a,priceExclTax:d,taxExcluded:o=!1,taxIncluded:p=!1})=>k(y,{children:[t("span",{className:"checkout-estimate-shipping__label",children:e?t(l,{id:"Checkout.EstimateShipping.estimated"}):t(l,{id:"Checkout.EstimateShipping.label"})}),t(A,{node:a,className:"checkout-estimate-shipping__price"}),p&&t("span",{"data-testid":"shipping-tax-included",className:I(["checkout-estimate-shipping__caption"]),children:t(l,{id:"Checkout.EstimateShipping.withTaxes"})}),o&&k("span",{"data-testid":"shipping-tax-included-excluded",className:I(["checkout-estimate-shipping__caption"]),children:[d," ",t(l,{id:"Checkout.EstimateShipping.withoutTaxes"})]})]}),L=()=>t(v,{"data-testid":"estimate-shipping-skeleton",children:t(M,{size:"xsmall"})}),Q=()=>{const[e,a]=B(),d=e!==void 0,o=(e==null?void 0:e.amount.value)===0,p=z.config,T=p==null?void 0:p.shoppingCartDisplaySetting.shipping,_=T===C.INCLUDING_EXCLUDING_TAX,E=T===C.INCLUDING_TAX,S=w({freeShipping:"Checkout.EstimateShipping.freeShipping",taxToBeDetermined:"Checkout.EstimateShipping.taxToBeDetermined"});f(()=>{const i=g.on("shipping/estimate",n=>{const s=n.shippingMethod,{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!0,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=g.on("checkout/initialized",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=g.on("checkout/updated",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]);const D=()=>o?t("span",{"data-testId":"free-shipping",children:S.freeShipping}):E&&(e!=null&&e.amountInclTax)?t(x,{"data-testid":"shipping",amount:e.amountInclTax.value,currency:e.amountInclTax.currency}):t(x,{"data-testid":"shipping",amount:e==null?void 0:e.amount.value,currency:e==null?void 0:e.amount.currency}),N=()=>e!=null&&e.amountExclTax?t(x,{"data-testid":"shipping-excluding-tax",amount:e.amountExclTax.value,currency:e.amountExclTax.currency}):t("span",{children:S.taxToBeDetermined});return t("div",{"data-testid":"estimate-shipping",className:"checkout-estimate-shipping",children:d?t(G,{estimated:e.estimated,price:D(),taxExcluded:_&&!o,taxIncluded:E&&!o,priceExclTax:N()}):t(L,{})})};export{Q as EstimateShipping,Q as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/LoginForm.js b/scripts/__dropins__/storefront-checkout/containers/LoginForm.js index a83d2d2b06..6c775787f1 100644 --- a/scripts/__dropins__/storefront-checkout/containers/LoginForm.js +++ b/scripts/__dropins__/storefront-checkout/containers/LoginForm.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as e,jsxs as s,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{s as H}from"../chunks/store-config.js";import{c as R,d as V}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import{classes as j}from"@dropins/tools/lib.js";import{i as q,s as D}from"../chunks/setGuestEmailOnCart.js";import{Field as W,Input as G,Skeleton as U,SkeletonRow as x}from"@dropins/tools/components.js";/* empty css *//* empty css */import{useText as b,Text as _}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{w as J}from"../chunks/withConditionalRendering.js";import{useState as v,useRef as K,useEffect as C}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/errors.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const O=({value:t,error:i,hint:g,onChange:h,onBlur:o,onInvalid:u})=>{const m=b({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return e(W,{size:"medium",error:i,hint:g,children:e(G,{"aria-label":m.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:m.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",onBlur:o,onChange:h,onInvalid:u,placeholder:m.LoginFormPlaceholder,required:!0,type:"email",value:t})})},Q=({onClick:t})=>s("div",{className:"checkout-login-form__sign-in",children:[e(_,{id:"Checkout.LoginForm.account"}),e("a",{"data-testid":"sign-in-link",className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:t,children:e(_,{id:"Checkout.LoginForm.signIn"})})]}),X=({className:t,customerDetails:i,email:g,error:h,hint:o,loading:u=!1,name:m,onEmailBlur:f,onEmailChange:k,onEmailInvalid:E,onSignInClick:a,onSignOutClick:F,...L})=>{const l=b({Title:"Checkout.LoginForm.title"});return u?e(Y,{}):s("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[s("div",{className:"checkout-login-form__heading",children:[e("h2",{className:"checkout-login-form__title",children:l.Title}),i?e(Z,{onClick:d=>{d.preventDefault(),F==null||F()}}):e(Q,{onClick:d=>{d.preventDefault(),a==null||a(g)}})]}),i?s("div",{className:"checkout-login-form__customer-details",children:[e("div",{className:"checkout-login-form__customer-name",children:`${i.firstName} ${i.lastName}`}),e("div",{className:"checkout-login-form__customer-email",children:i.email})]}):e("div",{className:"checkout-login-form__content",children:s("form",{...L,className:j(["dropin-login-form__form",t]),name:m,noValidate:!0,children:[e("button",{type:"submit",disabled:!0,style:"display: none","aria-hidden":"true"}),e(O,{value:g,error:h,hint:o,onChange:k,onBlur:f,onInvalid:E})]})})]})},Y=()=>s(U,{"data-testid":"login-form-skeleton",children:[e(x,{variant:"heading",fullWidth:!0}),e(x,{size:"medium",fullWidth:!0})]}),Z=({onClick:t})=>s("p",{className:"checkout-login-form__sign-out",children:[e(_,{id:"Checkout.LoginForm.switch"}),e("a",{className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:t,children:e(_,{id:"Checkout.LoginForm.signOut"})})]}),S={EMAIL:/^[a-z0-9,!#$%&'*+/=?^_`{|}~-]+(\.[a-z0-9,!#$%&'*+/=?^_`{|}~-]+)*@([a-z0-9-]+\.)+[a-z]{2,}$/i},N=t=>S.EMAIL.test(t),ee=1e3,y=({onSignInClick:t,onSignOutClick:i,initialData:g,...h})=>{const[o,u]=v(""),[m,f]=v(""),[k,E]=v(!0),[a,F]=v(!0),L=K(""),l=R.value.data,d=(l==null?void 0:l.email)||"",p=V.value.data,c=b({LoginFormInvalidEmailError:"Checkout.LoginForm.invalidEmailError",LoginFormMissingEmailError:"Checkout.LoginForm.missingEmailError",LoginFormEmailExistsAlreadyHaveAccount:"Checkout.LoginForm.emailExists.alreadyHaveAccount",LoginFormEmailExistsSignInButton:"Checkout.LoginForm.emailExists.signInButton",LoginFormEmailExistsForFasterCheckout:"Checkout.LoginForm.emailExists.forFasterCheckout"}),A=r=>r.valid?"":r.valueMissing?c.LoginFormMissingEmailError:c.LoginFormInvalidEmailError,B=r=>N(r)?"":r===""?c.LoginFormMissingEmailError:c.LoginFormInvalidEmailError,M=r=>{const n=r.target;u(n.value),f(""),E(!0)},T=r=>{const n=r.target;f(B(n.value))},z=r=>{const n=r.target;f(A(n.validity))};C(()=>{!a||!l||(F(!1),u(l.email||""))},[l,a]),C(()=>{if(a||H.authenticated)return;const r=setTimeout(()=>{!N(o)||o===L.current||(L.current=o,q(o).then(n=>{E(n),d!==o&&D(o).catch(console.error)}).catch(n=>{console.error(n),E(!0)}))},ee);return()=>{r&&clearTimeout(r)}},[d,o,a]);const I=k?"":s(w,{children:[c.LoginFormEmailExistsAlreadyHaveAccount," ",e("a",{href:"#",onClick:r=>{r.preventDefault(),t==null||t(o)},children:c.LoginFormEmailExistsSignInButton})," ",c.LoginFormEmailExistsForFasterCheckout]}),$=r=>{t==null||t(N(r)?r:"")},P=p?{firstName:p.firstName,lastName:p.lastName,email:p.email}:void 0;return e(X,{...h,customerDetails:P,email:o,error:m,hint:I,loading:a,onEmailBlur:T,onEmailChange:M,onEmailInvalid:z,onSignInClick:$,onSignOutClick:i})};y.displayName="LoginFormContainer";const _e=J(y);export{_e as LoginForm,_e as default}; +import{jsx as e,jsxs as m,Fragment as B}from"@dropins/tools/preact-jsx-runtime.js";import{s as M}from"../chunks/state.js";import{b as t,c as T,f as $}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import{classes as w}from"@dropins/tools/lib.js";import{i as I,s as V}from"../chunks/setGuestEmailOnCart.js";import{Field as H,Input as P,Skeleton as R,SkeletonRow as b}from"@dropins/tools/components.js";/* empty css */import"../chunks/TermsAndConditions.js";import{useText as N,Text as L}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{w as j}from"../chunks/withConditionalRendering.js";import{useRef as q,useEffect as x}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const D={EMAIL:/^[a-z0-9,!#$%&'*+/=?^_`{|}~-]+(\.[a-z0-9,!#$%&'*+/=?^_`{|}~-]+)*@([a-z0-9-]+\.)+[a-z]{2,}$/i},k=o=>D.EMAIL.test(o),W=({value:o,error:n,hint:d,onChange:g,onBlur:u,onInvalid:r})=>{const i=N({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return e(H,{error:n,hint:d,children:e(P,{"aria-label":i.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:i.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",onBlur:u,onChange:g,onInvalid:r,placeholder:i.LoginFormPlaceholder,required:!0,type:"email",value:o})})},G=({onClick:o})=>m("div",{className:"checkout-login-form__sign-in",children:[e(L,{id:"Checkout.LoginForm.account"}),e("a",{"data-testid":"sign-in-link",className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:o,children:e(L,{id:"Checkout.LoginForm.signIn"})})]}),U=({className:o,customerDetails:n,email:d,error:g,hint:u,loading:r=!1,name:i,onEmailBlur:F,onEmailChange:c,onEmailInvalid:s,onSignInClick:h,onSignOutClick:v,...p})=>{const _=N({Title:"Checkout.LoginForm.title"});return r?e(J,{}):m("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[m("div",{className:"checkout-login-form__heading",children:[e("h2",{className:"checkout-login-form__title",children:_.Title}),n?e(K,{onClick:f=>{f.preventDefault(),v==null||v()}}):e(G,{onClick:f=>{f.preventDefault(),h==null||h(d)}})]}),n?m("div",{className:"checkout-login-form__customer-details",children:[e("div",{className:"checkout-login-form__customer-name",children:`${n.firstName} ${n.lastName}`}),e("div",{className:"checkout-login-form__customer-email",children:n.email})]}):e("div",{className:"checkout-login-form__content",children:m("form",{...p,className:w(["dropin-login-form__form",o]),name:i,noValidate:!0,children:[e("button",{type:"submit",disabled:!0,style:"display: none","aria-hidden":"true"}),e(W,{value:d,error:g,hint:u,onChange:c,onBlur:F,onInvalid:s})]})})]})},J=()=>m(R,{"data-testid":"login-form-skeleton",children:[e(b,{variant:"heading",fullWidth:!0}),e(b,{size:"medium",fullWidth:!0})]}),K=({onClick:o})=>m("p",{className:"checkout-login-form__sign-out",children:[e(L,{id:"Checkout.LoginForm.switch"}),e("a",{className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:o,children:e(L,{id:"Checkout.LoginForm.signOut"})})]}),O=1e3,C=({onSignInClick:o,onSignOutClick:n,initialData:d,...g})=>{const u=q(""),r=t.value,i=T.value.data,F=(i==null?void 0:i.email)||"",c=$.value.data,s=N({LoginFormInvalidEmailError:"Checkout.LoginForm.invalidEmailError",LoginFormMissingEmailError:"Checkout.LoginForm.missingEmailError",LoginFormEmailExistsAlreadyHaveAccount:"Checkout.LoginForm.emailExists.alreadyHaveAccount",LoginFormEmailExistsSignInButton:"Checkout.LoginForm.emailExists.signInButton",LoginFormEmailExistsForFasterCheckout:"Checkout.LoginForm.emailExists.forFasterCheckout"}),h=a=>a.valid?"":a.valueMissing?s.LoginFormMissingEmailError:s.LoginFormInvalidEmailError,v=a=>k(a)?"":a===""?s.LoginFormMissingEmailError:s.LoginFormInvalidEmailError,p=a=>{const l=a.target;t.value={...t.value,available:!0,error:"",pending:!0,value:l.value}},_=a=>{const l=a.target,E=v(l.value);l.setCustomValidity(E),t.value={...t.value,error:E}},f=a=>{const l=a.target;t.value={...t.value,error:h(l.validity)}};x(()=>{!i||r.initialized||(t.value={available:!0,error:"",initialized:!0,pending:!1,value:i.email??""})},[i,r]),x(()=>{if(!r.initialized||M.authenticated)return;const a=setTimeout(()=>{if(!k(r.value)||r.value===u.current){t.value={...t.value,pending:!1};return}u.current=r.value,I(r.value).then(l=>{const E=F!==r.value;t.value={...t.value,available:l,pending:E},E&&V(r.value).catch(console.error).finally(()=>{t.value={...t.value,pending:!1}})}).catch(l=>{console.error(l),t.value={...t.value,available:!0,pending:!1}})},O);return()=>{a&&clearTimeout(a)}},[F,r]);const y=r.available?"":m(B,{children:[s.LoginFormEmailExistsAlreadyHaveAccount," ",e("a",{href:"#",onClick:a=>{a.preventDefault(),o==null||o(r.value)},children:s.LoginFormEmailExistsSignInButton})," ",s.LoginFormEmailExistsForFasterCheckout]}),z=a=>{o==null||o(k(a)?a:"")},A=c?{firstName:c.firstName,lastName:c.lastName,email:c.email}:void 0;return e(U,{...g,customerDetails:A,email:r.value,error:r.error,hint:y,loading:r.initialized===!1,onEmailBlur:_,onEmailChange:p,onEmailInvalid:f,onSignInClick:z,onSignOutClick:n})};C.displayName="LoginFormContainer";const fe=j(C);export{fe as LoginForm,fe as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner.js b/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner.js index 15d28b58fb..ca9849fd6c 100644 --- a/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner.js +++ b/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as g,Icon as u}from"@dropins/tools/components.js";import{c as h}from"../chunks/classes.js";import{events as B}from"@dropins/tools/event-bus.js";import*as l from"@dropins/tools/preact-compat.js";import{useState as I,useEffect as M}from"@dropins/tools/preact-compat.js";import{w as v}from"../chunks/withConditionalRendering.js";import{useText as w,Text as x}from"@dropins/tools/i18n.js";import"../chunks/transform-store-config.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/lib.js";const H=t=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),C=({className:t,initialData:V,...c})=>{const[r,a]=I(0),s=w({mergedCartBannerItems:e(x,{id:"Checkout.MergedCartBanner.items",fields:{count:r},plural:r})});M(()=>{const n=B.on("cart/merged",o=>{var m;const i=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((f,p)=>f+p.quantity,0);i>0&&a(i)});return()=>{n==null||n.off()}},[]);const d=()=>{a(0)};return r?e(g,{...c,"aria-label":s.mergedCartBannerItems,className:h(["checkout__banner",t]),"data-testid":"merged-cart-banner",icon:e(u,{source:H}),message:e("span",{children:s.mergedCartBannerItems}),onDismiss:d,variant:"neutral"}):null};C.displayName="MergedCartBannerContainer";const q=v(C);export{q as MergedCartBanner,q as default}; +import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as g,Icon as u}from"@dropins/tools/components.js";import{c as h}from"../chunks/classes.js";import{events as B}from"@dropins/tools/event-bus.js";import{useState as I,useEffect as M}from"@dropins/tools/preact-hooks.js";import{w as v}from"../chunks/withConditionalRendering.js";import*as l from"@dropins/tools/preact-compat.js";import{useText as w,Text as x}from"@dropins/tools/i18n.js";import"../chunks/transform-store-config.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"../chunks/state.js";import"@dropins/tools/signals.js";import"@dropins/tools/lib.js";const H=t=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),C=({className:t,initialData:V,...c})=>{const[r,a]=I(0),i=w({mergedCartBannerItems:e(x,{id:"Checkout.MergedCartBanner.items",fields:{count:r},plural:r})});M(()=>{const n=B.on("cart/merged",o=>{var m;const s=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((f,p)=>f+p.quantity,0);s>0&&a(s)});return()=>{n==null||n.off()}},[]);const d=()=>{a(0)};return r?e(g,{...c,"aria-label":i.mergedCartBannerItems,className:h(["checkout__banner",t]),"data-testid":"merged-cart-banner",icon:e(u,{source:H}),message:e("span",{children:i.mergedCartBannerItems}),onDismiss:d,variant:"neutral"}):null};C.displayName="MergedCartBannerContainer";const A=v(C);export{A as MergedCartBanner,A as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner/MergedCartBanner.d.ts b/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner/MergedCartBanner.d.ts index a8e6efdc4e..664ba60b6a 100644 --- a/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner/MergedCartBanner.d.ts +++ b/scripts/__dropins__/storefront-checkout/containers/MergedCartBanner/MergedCartBanner.d.ts @@ -1,7 +1,7 @@ import { AlertBannerProps } from '@dropins/tools/types/elsie/src/components'; export declare const MergedCartBanner: { - ({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs').ConditionalProps & AlertBannerProps): import("preact/compat").JSX.Element; + ({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs').ConditionalProps & AlertBannerProps): import("preact").JSX.Element; displayName: string; }; //# sourceMappingURL=MergedCartBanner.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/containers/OutOfStock.js b/scripts/__dropins__/storefront-checkout/containers/OutOfStock.js index 4dc345a8e7..7664aa8d44 100644 --- a/scripts/__dropins__/storefront-checkout/containers/OutOfStock.js +++ b/scripts/__dropins__/storefront-checkout/containers/OutOfStock.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Card as k,Icon as l,Image as h}from"@dropins/tools/components.js";/* empty css */import{classes as O}from"@dropins/tools/lib.js";import{S as d}from"../chunks/OrderError.js";import{useText as p}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{events as S}from"@dropins/tools/event-bus.js";import{useState as v,useCallback as _,useEffect as g}from"@dropins/tools/preact-compat.js";const N=({className:i,items:r,onRemoveOutOfStock:o,routeCart:a,...m})=>{const s=p({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return n(k,{className:O(["checkout-out-of-stock",i]),"data-testid":"checkout-out-of-stock",variant:"secondary",...m,children:[n("h4",{className:"checkout-out-of-stock__title",children:[e(l,{source:d,size:"16",stroke:"1"}),s.title]}),e("p",{className:"checkout-out-of-stock__message",children:s.message}),e("ol",{className:"checkout-out-of-stock__items",children:r.map(u=>e("li",{"data-testid":"out-of-stock-item",className:"checkout-out-of-stock__item",children:e(h,{loading:"eager",src:u.image.src,alt:u.image.alt,width:"100",height:"100",params:{width:100}})},u.sku))}),n("div",{className:"checkout-out-of-stock__actions",children:[a&&e("a",{"data-testid":"review-cart",className:"checkout-out-of-stock__action",href:a,children:s.reviewCart}),o&&e("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:o,children:s.removeOutOfStock})]})]})},T=({onCartProductsUpdate:i,routeCart:r})=>{const[o,a]=v([]),m=t=>t.outOfStock||t.insufficientQuantity,s=_(()=>{if(!i)return;const t=o.filter(c=>c.outOfStock).map(c=>({uid:c.uid,quantity:0}));i(t)},[o,i]);if(g(()=>{const t=S.on("cart/data",c=>{const f=(c==null?void 0:c.items)||[];a(f.filter(m))},{eager:!0});return()=>{t==null||t.off()}},[]),o.length===0)return null;const u=!o.some(t=>t.insufficientQuantity);return e(N,{items:o,onRemoveOutOfStock:u?s:void 0,routeCart:r==null?void 0:r()})};export{T as OutOfStock,T as default}; +import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Card as k,Icon as l,Image as h}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{classes as O}from"@dropins/tools/lib.js";import{S as d}from"../chunks/OrderError.js";import{useText as p}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{events as S}from"@dropins/tools/event-bus.js";import{useState as v,useCallback as _,useEffect as g}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";const N=({className:i,items:r,onRemoveOutOfStock:o,routeCart:a,...m})=>{const s=p({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return n(k,{className:O(["checkout-out-of-stock",i]),"data-testid":"checkout-out-of-stock",variant:"secondary",...m,children:[n("h4",{className:"checkout-out-of-stock__title",children:[e(l,{source:d,size:"16",stroke:"1"}),s.title]}),e("p",{className:"checkout-out-of-stock__message",children:s.message}),e("ol",{className:"checkout-out-of-stock__items",children:r.map(u=>e("li",{"data-testid":"out-of-stock-item",className:"checkout-out-of-stock__item",children:e(h,{loading:"eager",src:u.image.src,alt:u.image.alt,width:"100",height:"100",params:{width:100}})},u.sku))}),n("div",{className:"checkout-out-of-stock__actions",children:[a&&e("a",{"data-testid":"review-cart",className:"checkout-out-of-stock__action",href:a,children:s.reviewCart}),o&&e("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:o,children:s.removeOutOfStock})]})]})},$=({onCartProductsUpdate:i,routeCart:r})=>{const[o,a]=v([]),m=t=>t.outOfStock||t.insufficientQuantity,s=_(()=>{if(!i)return;const t=o.filter(c=>c.outOfStock).map(c=>({uid:c.uid,quantity:0}));i(t)},[o,i]);if(g(()=>{const t=S.on("cart/data",c=>{const f=(c==null?void 0:c.items)||[];a(f.filter(m))},{eager:!0});return()=>{t==null||t.off()}},[]),o.length===0)return null;const u=!o.some(t=>t.insufficientQuantity);return e(N,{items:o,onRemoveOutOfStock:u?s:void 0,routeCart:r==null?void 0:r()})};export{$ as OutOfStock,$ as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/PaymentMethods.js b/scripts/__dropins__/storefront-checkout/containers/PaymentMethods.js index b16cb36005..eaaec55af6 100644 --- a/scripts/__dropins__/storefront-checkout/containers/PaymentMethods.js +++ b/scripts/__dropins__/storefront-checkout/containers/PaymentMethods.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as n,jsxs as w}from"@dropins/tools/preact-jsx-runtime.js";import{s as z}from"../chunks/store-config.js";import{c as M,b as m}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import{classes as P,Slot as I}from"@dropins/tools/lib.js";import{s as R}from"../chunks/setPaymentMethod.js";/* empty css */import{IllustratedMessage as B,Icon as N,ProgressSpinner as U,ToggleButton as Z,Skeleton as D,SkeletonRow as f}from"@dropins/tools/components.js";import*as y from"@dropins/tools/preact-compat.js";import{useState as $,useEffect as L,useCallback as q}from"@dropins/tools/preact-compat.js";import{useText as F}from"@dropins/tools/i18n.js";import{w as G}from"../chunks/withConditionalRendering.js";import{useRef as J}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/errors.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const K=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Q=({code:e,loading:c,selected:s,onChange:r,title:a,icon:o})=>n(Z,{className:"checkout-payment-methods__method",label:a,name:"payment-method",value:e,selected:s,onChange:r,busy:c,icon:o?n(N,{source:o}):void 0}),X=({className:e,paymentMethodContent:c,loading:s=!1,initializing:r=!1,onChange:a=()=>{},options:o,selection:v})=>{const u=F({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return r?n(Y,{}):w("div",{className:P(["checkout-payment-methods",e]),children:[n("h2",{className:"checkout-payment-methods__title",children:u.Title}),!s&&o.length===0&&n(B,{icon:n(N,{source:K}),message:n("p",{children:u.EmptyState})}),w("div",{className:P(["checkout-payment-methods__wrapper",["checkout-payment-methods__wrapper--loading",s]]),children:[s&&n(U,{className:"checkout-payment-methods__spinner"}),n("div",{className:P(["checkout-payment-methods__methods",["checkout-payment-methods--full-width",o.length%2!==0]]),children:o==null?void 0:o.map(d=>n(Q,{code:d.code,onChange:a,selected:d.code===v,title:d.displayLabel??!0?d.title:"",icon:d.icon},d.code))}),c&&n("div",{className:"checkout-payment-methods__content",children:c})]})]})},Y=()=>w(D,{"data-testid":"payment-methods-skeleton",children:[n(f,{variant:"heading",size:"medium"}),n(f,{variant:"empty",size:"medium"}),n(f,{size:"xlarge",fullWidth:!0}),n(f,{size:"xlarge",fullWidth:!0})]}),ee=(e,c)=>{const s=J(e);return c(s.current,e)||(s.current=e),s.current},O=({slots:e,setOnChange:c={}})=>{var b,_,H,E,x;const[s]=$(c),r=e==null?void 0:e.Methods;L(()=>{e!=null&&e.Handlers&&console.warn("The `slots.Handlers` prop is deprecated and will be removed in future versions. Use the `Methods` object instead."),c&&console.warn("The `setOnChange` prop is deprecated and will be removed in future versions. Use the `Methods` object instead.")},[]);const a=M.value.data,o=!!M.value.data,v=M.value.pending,u=(a==null?void 0:a.isVirtual)??!1,d=(b=a==null?void 0:a.shippingAddresses)==null?void 0:b[0],V=(a==null?void 0:a.availablePaymentMethods)||[],p=(_=a==null?void 0:a.selectedPaymentMethod)==null?void 0:_.code,S=u?!0:!!d,l=ee(V.filter(t=>{var i;return((i=r==null?void 0:r[t.code])==null?void 0:i.enabled)!==!1}),(t,i)=>t.length!==i.length?!1:t.every((h,C)=>h.code===i[C].code)),g=q(t=>{var i;m.value=t,!(!t||!S)&&t!==p&&(s[t]===!1||((i=r==null?void 0:r[t])==null?void 0:i.setOnChange)===!1||R({code:t}).catch(console.error))},[S,r,p,s]);L(()=>{if(!o||!!!(l!=null&&l.length))return;const i=l[0].code,h=p||m.value,C=h?l.some(W=>W.code===h):!1;g(C?h:i)},[l,o,g,p]);const j=t=>{g(t)},k=m.value?((E=(H=e==null?void 0:e.Methods)==null?void 0:H[m.value])==null?void 0:E.render)||((x=e==null?void 0:e.Handlers)==null?void 0:x[m.value]):null,A=k?n(I,{name:"PaymentMethodContent",slot:k,context:{cartId:z.cartId||"",replaceHTML(t){this.replaceWith(t)}}},k):void 0,T=l.map(t=>{const i=(r==null?void 0:r[t.code])||{};return{...t,...i}});return n(X,{initializing:o===!1,loading:o&&v,onChange:j,options:T,paymentMethodContent:A,selection:m.value})};O.displayName="PaymentMethodsContainer";const ge=G(O);export{ge as PaymentMethods,ge as default}; +import{jsx as n,jsxs as w}from"@dropins/tools/preact-jsx-runtime.js";import{s as z}from"../chunks/state.js";import{c as M,d as m}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import{classes as P,Slot as I}from"@dropins/tools/lib.js";import{s as R}from"../chunks/setPaymentMethod.js";/* empty css */import{IllustratedMessage as B,Icon as N,ProgressSpinner as U,ToggleButton as Z,Skeleton as D,SkeletonRow as f}from"@dropins/tools/components.js";import*as y from"@dropins/tools/preact-compat.js";import{useText as $}from"@dropins/tools/i18n.js";import{w as q}from"../chunks/withConditionalRendering.js";import{useRef as F,useState as G,useEffect as L,useCallback as J}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const K=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Q=({code:e,loading:c,selected:s,onChange:r,title:a,icon:o})=>n(Z,{className:"checkout-payment-methods__method",label:a,name:"payment-method",value:e,selected:s,onChange:r,busy:c,icon:o?n(N,{source:o}):void 0}),X=({className:e,paymentMethodContent:c,loading:s=!1,initializing:r=!1,onChange:a=()=>{},options:o,selection:v})=>{const u=$({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return r?n(Y,{}):w("div",{className:P(["checkout-payment-methods",e]),children:[n("h2",{className:"checkout-payment-methods__title",children:u.Title}),!s&&o.length===0&&n(B,{icon:n(N,{source:K}),message:n("p",{children:u.EmptyState})}),w("div",{className:P(["checkout-payment-methods__wrapper",["checkout-payment-methods__wrapper--loading",s]]),children:[s&&n(U,{className:"checkout-payment-methods__spinner"}),n("div",{className:P(["checkout-payment-methods__methods",["checkout-payment-methods--full-width",o.length%2!==0]]),children:o==null?void 0:o.map(d=>n(Q,{code:d.code,onChange:a,selected:d.code===v,title:d.displayLabel??!0?d.title:"",icon:d.icon},d.code))}),c&&n("div",{className:"checkout-payment-methods__content",children:c})]})]})},Y=()=>w(D,{"data-testid":"payment-methods-skeleton",children:[n(f,{variant:"heading",size:"medium"}),n(f,{variant:"empty",size:"medium"}),n(f,{size:"xlarge",fullWidth:!0}),n(f,{size:"xlarge",fullWidth:!0})]}),ee=(e,c)=>{const s=F(e);return c(s.current,e)||(s.current=e),s.current},O=({slots:e,setOnChange:c={}})=>{var b,_,H,E,x;const[s]=G(c),r=e==null?void 0:e.Methods;L(()=>{e!=null&&e.Handlers&&console.warn("The `slots.Handlers` prop is deprecated and will be removed in future versions. Use the `Methods` object instead."),c&&console.warn("The `setOnChange` prop is deprecated and will be removed in future versions. Use the `Methods` object instead.")},[]);const a=M.value.data,o=!!M.value.data,v=M.value.pending,u=(a==null?void 0:a.isVirtual)??!1,d=(b=a==null?void 0:a.shippingAddresses)==null?void 0:b[0],V=(a==null?void 0:a.availablePaymentMethods)||[],p=(_=a==null?void 0:a.selectedPaymentMethod)==null?void 0:_.code,S=u?!0:!!d,l=ee(V.filter(t=>{var i;return((i=r==null?void 0:r[t.code])==null?void 0:i.enabled)!==!1}),(t,i)=>t.length!==i.length?!1:t.every((h,C)=>h.code===i[C].code)),g=J(t=>{var i;m.value=t,!(!t||!S)&&t!==p&&(s[t]===!1||((i=r==null?void 0:r[t])==null?void 0:i.setOnChange)===!1||R({code:t}).catch(console.error))},[S,r,p,s]);L(()=>{if(!o||!!!(l!=null&&l.length))return;const i=l[0].code,h=p||m.value,C=h?l.some(W=>W.code===h):!1;g(C?h:i)},[l,o,g,p]);const j=t=>{g(t)},k=m.value?((E=(H=e==null?void 0:e.Methods)==null?void 0:H[m.value])==null?void 0:E.render)||((x=e==null?void 0:e.Handlers)==null?void 0:x[m.value]):null,A=k?n(I,{name:"PaymentMethodContent",slot:k,context:{cartId:z.cartId||"",replaceHTML(t){this.replaceWith(t)}}},k):void 0,T=l.map(t=>{const i=(r==null?void 0:r[t.code])||{};return{...t,...i}});return n(X,{initializing:o===!1,loading:o&&v,onChange:j,options:T,paymentMethodContent:A,selection:m.value})};O.displayName="PaymentMethodsContainer";const ge=q(O);export{ge as PaymentMethods,ge as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/PlaceOrder.js b/scripts/__dropins__/storefront-checkout/containers/PlaceOrder.js index 43b8adadcd..f860f98bf8 100644 --- a/scripts/__dropins__/storefront-checkout/containers/PlaceOrder.js +++ b/scripts/__dropins__/storefront-checkout/containers/PlaceOrder.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as a}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Button as E}from"@dropins/tools/components.js";import{classes as S,Slot as g}from"@dropins/tools/lib.js";import{w as y}from"../chunks/withConditionalRendering.js";import{s as P}from"../chunks/store-config.js";import{c as b,a as U,b as u}from"../chunks/transform-store-config.js";import{U as I}from"../chunks/errors.js";import{events as w}from"@dropins/tools/event-bus.js";import{useState as N,useCallback as d,useEffect as T}from"@dropins/tools/preact-compat.js";import{useText as z,Text as D}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const H=t=>t instanceof TypeError||t instanceof I,_=({children:t,className:o,disabled:c=!1,onClick:r})=>a("div",{className:S(["checkout-place-order",o]),children:a(E,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:c,onClick:r,size:"medium",type:"submit",variant:"primary",children:t},"placeOrder")}),l=({disabled:t=!1,handleValidation:o,handlePlaceOrder:c,slots:r,...p})=>{const[f,C]=N(!1),{data:O,pending:k}=b.value,h=!!O,s=z({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),i=d(e=>{U.value=H(e)?s.CheckoutUnexpectedError:e.message},[s]),x=d(async()=>{try{if(!(o?o():!0))return;await c({cartId:P.cartId||"",code:u.value||""})}catch(e){i(e)}},[o,c,i]);return T(()=>{const e=w.on("cart/initialized",n=>{const v=(n==null?void 0:n.items)||[];C(v.some(m=>m.outOfStock||m.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[]),a(_,{...p,onClick:x,disabled:t||!h||k||f,children:r!=null&&r.Content?a(g,{name:"Content",slot:r.Content,context:{code:u.value||""}}):a(D,{id:"Checkout.PlaceOrder.button"})})};l.displayName="PlaceOrderContainer";const W=y(l);export{W as PlaceOrder,W as default}; +import{jsx as a}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Button as E}from"@dropins/tools/components.js";import{classes as S,Slot as P}from"@dropins/tools/lib.js";import{w as y}from"../chunks/withConditionalRendering.js";import{s as b}from"../chunks/state.js";import{c as U,b as I,a as w,d}from"../chunks/transform-store-config.js";import{U as N}from"../chunks/errors.js";import{events as T}from"@dropins/tools/event-bus.js";import{useState as z,useCallback as l,useEffect as D}from"@dropins/tools/preact-hooks.js";import{useText as H,Text as _}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";const j=({children:t,className:o,disabled:n=!1,onClick:r})=>a("div",{className:S(["checkout-place-order",o]),children:a(E,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:n,onClick:r,size:"medium",type:"submit",variant:"primary",children:t},"placeOrder")}),B=t=>t instanceof TypeError||t instanceof N,u=({disabled:t=!1,handleValidation:o,handlePlaceOrder:n,slots:r,...p})=>{const[f,C]=z(!1),{data:O,pending:k}=U.value,g=I.value.pending,h=!!O,s=H({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),i=l(e=>{w.value=B(e)?s.CheckoutUnexpectedError:e.message},[s]),v=l(async()=>{try{if(!(o?o():!0))return;await n({cartId:b.cartId||"",code:d.value||""})}catch(e){i(e)}},[o,n,i]);return D(()=>{const e=T.on("cart/initialized",c=>{const x=(c==null?void 0:c.items)||[];C(x.some(m=>m.outOfStock||m.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[]),a(j,{...p,onClick:v,disabled:t||!h||k||f||g,children:r!=null&&r.Content?a(P,{name:"Content",slot:r.Content,context:{code:d.value||""}}):a(_,{id:"Checkout.PlaceOrder.button"})})};u.displayName="PlaceOrderContainer";const Z=y(u);export{Z as PlaceOrder,Z as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/ServerError.js b/scripts/__dropins__/storefront-checkout/containers/ServerError.js index 53b2722e59..47d9f8a153 100644 --- a/scripts/__dropins__/storefront-checkout/containers/ServerError.js +++ b/scripts/__dropins__/storefront-checkout/containers/ServerError.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as s,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as l,Icon as p,Button as f}from"@dropins/tools/components.js";/* empty css */import{classes as a}from"@dropins/tools/lib.js";/* empty css *//* empty css */import{S as h}from"../chunks/OrderError.js";import{useText as d}from"@dropins/tools/i18n.js";/* empty css */import{a as u}from"../chunks/transform-store-config.js";import"../chunks/store-config.js";import"@dropins/tools/event-bus.js";import{useRef as v,useEffect as m}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";function g(e){e.scrollIntoView({behavior:"smooth"}),e.focus()}const k=({className:e,contactSupport:t,errorMessage:i,onClick:c,errorMessageRef:r})=>{const o=d({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return s(l,{"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:a(["checkout-server-error",e]),"data-testid":"checkout-server-error",heading:i??o.Title,message:n("p",{"data-testid":"checkout-server-error-message",ref:r,id:a(["checkout-server-error__message"]),children:[o.Message,s("br",{}),s("span",{children:t??o.ContactSupport})]}),icon:s(p,{className:a(["checkout-server-error__icon"]),source:h}),action:s(f,{className:a(["checkout-server-error__button"]),onClick:c,children:o.Button})})},z=({onRetry:e,onServerError:t,autoScroll:i=!1})=>{const c=v(null),r=u.value,o=async()=>{e==null||e(),u.value=void 0};return m(()=>{r&&(t==null||t(r))},[r,t]),m(()=>{!i||!r||!c.current||g(c.current)},[r,i]),r?s(k,{errorMessageRef:c,errorMessage:r,onClick:o}):null};export{z as ServerError,z as default}; +import{jsx as s,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as l,Icon as p,Button as f}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{classes as a}from"@dropins/tools/lib.js";/* empty css *//* empty css */import{S as h}from"../chunks/OrderError.js";import{useText as d}from"@dropins/tools/i18n.js";/* empty css */import{a as u}from"../chunks/transform-store-config.js";import"../chunks/state.js";import"@dropins/tools/event-bus.js";import{useRef as v,useEffect as m}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";const g=({className:e,contactSupport:t,errorMessage:i,onClick:c,errorMessageRef:r})=>{const o=d({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return s(l,{"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:a(["checkout-server-error",e]),"data-testid":"checkout-server-error",heading:i??o.Title,message:n("p",{"data-testid":"checkout-server-error-message",ref:r,id:a(["checkout-server-error__message"]),children:[o.Message,s("br",{}),s("span",{children:t??o.ContactSupport})]}),icon:s(p,{className:a(["checkout-server-error__icon"]),source:h}),action:s(f,{className:a(["checkout-server-error__button"]),onClick:c,children:o.Button})})};function k(e){e.scrollIntoView({behavior:"smooth"}),e.focus()}const A=({onRetry:e,onServerError:t,autoScroll:i=!1})=>{const c=v(null),r=u.value,o=async()=>{e==null||e(),u.value=void 0};return m(()=>{r&&(t==null||t(r))},[r,t]),m(()=>{!i||!r||!c.current||k(c.current)},[r,i]),r?s(g,{errorMessageRef:c,errorMessage:r,onClick:o}):null};export{A as ServerError,A as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/ShippingMethods.js b/scripts/__dropins__/storefront-checkout/containers/ShippingMethods.js index d3144b7b62..35765d91e3 100644 --- a/scripts/__dropins__/storefront-checkout/containers/ShippingMethods.js +++ b/scripts/__dropins__/storefront-checkout/containers/ShippingMethods.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as n,jsxs as g,Fragment as b}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/store-config.js";import{c as S,e as w,s as C}from"../chunks/transform-store-config.js";import{events as H}from"@dropins/tools/event-bus.js";import{classes as E,Slot as z}from"@dropins/tools/lib.js";import{t as R,s as T}from"../chunks/setShippingMethods.js";/* empty css */import{IllustratedMessage as O,Icon as P,ProgressSpinner as B,RadioButton as D,Price as I,Skeleton as V,SkeletonRow as f}from"@dropins/tools/components.js";import*as r from"@dropins/tools/preact-compat.js";import{useCallback as Z,useMemo as q,useEffect as F}from"@dropins/tools/preact-compat.js";import{useText as $}from"@dropins/tools/i18n.js";import{w as A}from"../chunks/withConditionalRendering.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/errors.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const G=e=>r.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),J=({className:e,isLoading:t=!1,onSelectionChange:s=()=>{},options:d,selection:u,...h})=>{const i=$({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return d===void 0?n(K,{}):g("div",{...h,className:E(["checkout-shipping-methods",e]),children:[n("h3",{className:"checkout-shipping-methods__title",children:i.Title}),!t&&d.length===0&&n(O,{icon:n(P,{source:G}),message:n("p",{children:i.EmptyState})}),g("div",{className:E(["checkout-shipping-methods__content"]),children:[t&&n(B,{className:"checkout-shipping-methods__spinner"}),n("div",{className:E(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:d.map(o=>n(D,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:o.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:g(b,{children:[n(I,{amount:o.amount.value,currency:o.amount.currency})," ",n("span",{children:o.carrier.title})]}),description:o.title,value:o.value,checked:(u==null?void 0:u.value)===o.value,onChange:()=>s(o)},o.value))})]})]})},K=()=>g(V,{"data-testid":"shipping-methods-skeleton",children:[n(f,{variant:"heading",size:"small"}),n(f,{variant:"empty",size:"small"}),n(f,{size:"medium",fullWidth:!0}),n(f,{size:"medium",fullWidth:!0})]}),L=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code;function Q(e){const t=H.lastPayload("shipping/estimate");if(!(t!=null&&t.address))return;const s={address:t.address,shippingMethod:R(e)};H.emit("shipping/estimate",s)}function U({preSelectedMethod:e,onShippingMethodSelect:t}){const s=S.value.data,d=S.value.pending,u=w.value.data,h=w.value.pending,i=C.value,o=s==null?void 0:s.shippingAddresses,a=o==null?void 0:o[0],v=!!a,N=a==null?void 0:a.availableShippingMethods,m=a==null?void 0:a.selectedShippingMethod,l=N||u,_=Z(c=>{if(!v)return;const k={method_code:c.code,carrier_code:c.carrier.code};T([k]).catch(j=>{console.error("Setting shipping methods on cart failed:",j)})},[v]),x=c=>{C.value=c,t==null||t(c),v||Q(c)},p=q(()=>{if(!(l!=null&&l.length))return;const c=l[0],k=i||m;return k?l.some(M=>L(M,k))?k:c:l.find(W=>W.carrier.code===(e==null?void 0:e.carrierCode)&&W.code===(e==null?void 0:e.methodCode))||c},[i,m,l,e]);return F(()=>{p&&((!i||!L(p,i))&&(C.value=p,t==null||t(p)),(!m||!L(p,m))&&_(p))},[p,i,m,_,t]),{isLoading:d||h,options:l,selection:p,onSelectionChange:x}}const y=({preSelectedMethod:e,shippingMethodsSlot:t,onShippingMethodSelect:s,initialData:d,...u})=>{const{isLoading:h,options:i,selection:o,onSelectionChange:a}=U({preSelectedMethod:e,onShippingMethodSelect:s});return g(b,{children:[n(J,{...u,isLoading:h,onSelectionChange:a,options:i,selection:o}),!h&&t&&n(z,{name:"ShippingMethods",slot:t})]})};y.displayName="ShippingMethodsContainer";const mt=A(y);export{mt as ShippingMethods,mt as default}; +import{jsx as n,jsxs as g,Fragment as b}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/state.js";import{c as S,e as w,s as C}from"../chunks/transform-store-config.js";import{events as H}from"@dropins/tools/event-bus.js";import{classes as E,Slot as z}from"@dropins/tools/lib.js";import{t as R,s as T}from"../chunks/setShippingMethods.js";/* empty css */import{IllustratedMessage as O,Icon as P,ProgressSpinner as B,RadioButton as D,Price as I,Skeleton as V,SkeletonRow as f}from"@dropins/tools/components.js";import*as r from"@dropins/tools/preact-compat.js";import{useText as Z}from"@dropins/tools/i18n.js";import{w as q}from"../chunks/withConditionalRendering.js";import{useCallback as F,useMemo as $,useEffect as A}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const G=e=>r.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),J=({className:e,isLoading:t=!1,onSelectionChange:s=()=>{},options:d,selection:u,...h})=>{const i=Z({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return d===void 0?n(K,{}):g("div",{...h,className:E(["checkout-shipping-methods",e]),children:[n("h3",{className:"checkout-shipping-methods__title",children:i.Title}),!t&&d.length===0&&n(O,{icon:n(P,{source:G}),message:n("p",{children:i.EmptyState})}),g("div",{className:E(["checkout-shipping-methods__content"]),children:[t&&n(B,{className:"checkout-shipping-methods__spinner"}),n("div",{className:E(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:d.map(o=>n(D,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:o.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:g(b,{children:[n(I,{amount:o.amount.value,currency:o.amount.currency})," ",n("span",{children:o.carrier.title})]}),description:o.title,value:o.value,checked:(u==null?void 0:u.value)===o.value,onChange:()=>s(o)},o.value))})]})]})},K=()=>g(V,{"data-testid":"shipping-methods-skeleton",children:[n(f,{variant:"heading",size:"small"}),n(f,{variant:"empty",size:"small"}),n(f,{size:"medium",fullWidth:!0}),n(f,{size:"medium",fullWidth:!0})]}),L=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code;function Q(e){const t=H.lastPayload("shipping/estimate");if(!(t!=null&&t.address))return;const s={address:t.address,shippingMethod:R(e)};H.emit("shipping/estimate",s)}function U({preSelectedMethod:e,onShippingMethodSelect:t}){const s=S.value.data,d=S.value.pending,u=w.value.data,h=w.value.pending,i=C.value,o=s==null?void 0:s.shippingAddresses,a=o==null?void 0:o[0],v=!!a,N=a==null?void 0:a.availableShippingMethods,m=a==null?void 0:a.selectedShippingMethod,l=N||u,_=F(c=>{if(!v)return;const k={method_code:c.code,carrier_code:c.carrier.code};T([k]).catch(j=>{console.error("Setting shipping methods on cart failed:",j)})},[v]),x=c=>{C.value=c,t==null||t(c),v||Q(c)},p=$(()=>{if(!(l!=null&&l.length))return;const c=l[0],k=i||m;return k?l.some(M=>L(M,k))?k:c:l.find(W=>W.carrier.code===(e==null?void 0:e.carrierCode)&&W.code===(e==null?void 0:e.methodCode))||c},[i,m,l,e]);return A(()=>{p&&((!i||!L(p,i))&&(C.value=p,t==null||t(p)),(!m||!L(p,m))&&_(p))},[p,i,m,_,t]),{isLoading:d||h,options:l,selection:p,onSelectionChange:x}}const y=({preSelectedMethod:e,shippingMethodsSlot:t,onShippingMethodSelect:s,initialData:d,...u})=>{const{isLoading:h,options:i,selection:o,onSelectionChange:a}=U({preSelectedMethod:e,onShippingMethodSelect:s});return g(b,{children:[n(J,{...u,isLoading:h,onSelectionChange:a,options:i,selection:o}),!h&&t&&n(z,{name:"ShippingMethods",slot:t})]})};y.displayName="ShippingMethodsContainer";const kt=q(y);export{kt as ShippingMethods,kt as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions.d.ts b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions.d.ts new file mode 100644 index 0000000000..24b179060d --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions.d.ts @@ -0,0 +1,3 @@ +export * from './TermsAndConditions/index' +import _default from './TermsAndConditions/index' +export default _default diff --git a/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions.js b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions.js new file mode 100644 index 0000000000..f6069f394d --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions.js @@ -0,0 +1,3 @@ +/*! Copyright 2025 Adobe +All Rights Reserved. */ +import{jsx as e,jsxs as E}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as N,SkeletonRow as w,Checkbox as j}from"@dropins/tools/components.js";import{p as y}from"../chunks/TermsAndConditions.js";import{classes as k,VComponent as D,Slot as H}from"@dropins/tools/lib.js";/* empty css *//* empty css *//* empty css */import{A as P}from"../chunks/checkout.js";import{events as p}from"@dropins/tools/event-bus.js";import{s as R}from"../chunks/state.js";import{useState as i,useCallback as g,useEffect as A}from"@dropins/tools/preact-hooks.js";import{useText as V,MarkupText as $}from"@dropins/tools/i18n.js";const q=({html:n})=>{const r=y.sanitize(n,{ADD_ATTR:["target"]});return r===""?null:e("span",{dangerouslySetInnerHTML:{__html:r}})},L=({className:n,agreements:r,error:s,isInitialized:a=!1,...c})=>a?e("div",{className:"checkout-terms-and-conditions","data-testid":"checkout-terms-and-conditions",children:E("form",{...c,className:k(["checkout-terms-and-conditions__form",n]),name:"checkout-terms-and-conditions__form","data-testid":"checkout-terms-and-conditions-form",noValidate:!0,children:[r&&e(D,{node:r,className:k(["checkout-terms-and-conditions__agreements"]),"data-testid":"checkout-terms-and-conditions-agreements"}),s&&e("div",{className:"checkout-terms-and-conditions__error","data-testid":"checkout-terms-and-conditions-error",children:s})]})}):e(O,{}),O=()=>e(N,{"data-testid":"checkout-terms-and-conditions-skeleton",className:"checkout-terms-and-conditions-skeleton",children:e(w,{variant:"row",size:"small",fullWidth:!0})}),ne=({slots:n,...r})=>{const[s,a]=i(!0),[c,_]=i(!1),[C,T]=i(!1),[x,m]=i(""),{errorMessage:l}=V({errorMessage:"Checkout.TermsAndConditions.error"}),I=g(()=>{m("")},[]),v=g(()=>{m(l)},[l]);return A(()=>{const t=p.on("checkout/initialized",()=>{var o;_(!0),a(((o=R.config)==null?void 0:o.isCheckoutAgreementsEnabled)??!0)},{eager:!0});return()=>{t==null||t.off()}},[]),A(()=>{const t=p.on("authenticated",o=>{T(o)},{eager:!0});return()=>{t==null||t.off()}},[]),!s||C?null:e(L,{...r,error:x,isInitialized:c,agreements:e(H,{name:"Agreements",slot:n==null?void 0:n.Agreements,context:{appendAgreement(t){this._registerMethod((...o)=>{const u=t(...o);if(!u)return;const{mode:M,name:h,text:d,translationId:f}=u;if(!d&&!f){console.warn(`The agreement ${h} is misconfigured. Please provide a text or a translationId.`);return}const b=d?e(q,{html:d}):e($,{id:f}),S=e(j,{checked:M===P.AUTO,label:b,name:h,required:!0,onChange:I,onInvalid:v});this._setProps(z=>({children:[...z.children||[],S]}))})}}})})};export{ne as TermsAndConditions,ne as default}; diff --git a/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions/TermsAndConditions.d.ts b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions/TermsAndConditions.d.ts new file mode 100644 index 0000000000..f5538eb5bd --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions/TermsAndConditions.d.ts @@ -0,0 +1,17 @@ +import { AgreementMode } from '../../data/models'; +import { Container, SlotMethod, SlotProps } from '@dropins/tools/types/elsie/src/lib'; + +export interface TermsAndConditionsProps { + slots?: { + Agreements?: SlotProps<{ + appendAgreement: SlotMethod<{ + name: string; + mode: AgreementMode; + translationId?: string; + text?: string; + }>; + }>; + }; +} +export declare const TermsAndConditions: Container; +//# sourceMappingURL=TermsAndConditions.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions/index.d.ts b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions/index.d.ts new file mode 100644 index 0000000000..a4a9c8b93a --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/containers/TermsAndConditions/index.d.ts @@ -0,0 +1,19 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export * from './TermsAndConditions'; +export { TermsAndConditions as default } from './TermsAndConditions'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/containers/index.d.ts b/scripts/__dropins__/storefront-checkout/containers/index.d.ts index b708a0bb91..b7791b1f66 100644 --- a/scripts/__dropins__/storefront-checkout/containers/index.d.ts +++ b/scripts/__dropins__/storefront-checkout/containers/index.d.ts @@ -15,7 +15,6 @@ * from Adobe. *******************************************************************/ export * from './BillToShippingAddress'; -export * from './ErrorBanner'; export * from './EstimateShipping'; export * from './LoginForm'; export * from './MergedCartBanner'; @@ -24,4 +23,5 @@ export * from './PaymentMethods'; export * from './PlaceOrder'; export * from './ServerError'; export * from './ShippingMethods'; +export * from './TermsAndConditions'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/data/models/checkout.d.ts b/scripts/__dropins__/storefront-checkout/data/models/checkout.d.ts new file mode 100644 index 0000000000..b6d6f950c6 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/data/models/checkout.d.ts @@ -0,0 +1,34 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2025 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export declare enum AgreementMode { + MANUAL = "manual", + AUTO = "auto" +} +type AgreementContent = { + value: string; + html: boolean; + height: string | null; +}; +export interface CheckoutAgreement { + content: AgreementContent; + id: number; + mode: AgreementMode; + name: string; + text: string; +} +export {}; +//# sourceMappingURL=checkout.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/data/models/index.d.ts b/scripts/__dropins__/storefront-checkout/data/models/index.d.ts index 4fc4b05c46..922bde7611 100644 --- a/scripts/__dropins__/storefront-checkout/data/models/index.d.ts +++ b/scripts/__dropins__/storefront-checkout/data/models/index.d.ts @@ -17,6 +17,7 @@ export * from './address'; export * from './api'; export * from './cart'; +export * from './checkout'; export * from './country'; export * from './custom-attribute'; export * from './customer'; diff --git a/scripts/__dropins__/storefront-checkout/data/models/store-config.d.ts b/scripts/__dropins__/storefront-checkout/data/models/store-config.d.ts index b369789b6d..a34f9eb9a0 100644 --- a/scripts/__dropins__/storefront-checkout/data/models/store-config.d.ts +++ b/scripts/__dropins__/storefront-checkout/data/models/store-config.d.ts @@ -1,19 +1,19 @@ /******************************************************************** -* ADOBE CONFIDENTIAL -* __________________ -* -* Copyright 2024 Adobe -* All Rights Reserved. -* -* NOTICE: All information contained herein is, and remains -* the property of Adobe and its suppliers, if any. The intellectual -* and technical concepts contained herein are proprietary to Adobe -* and its suppliers and are protected by all applicable intellectual -* property laws, including trade secret and copyright laws. -* Dissemination of this information or reproduction of this material -* is strictly forbidden unless prior written permission is obtained -* from Adobe. -*******************************************************************/ + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ export declare enum TaxDisplay { EXCLUDING_TAX = "EXCLUDING_TAX", INCLUDING_EXCLUDING_TAX = "INCLUDING_AND_EXCLUDING_TAX", @@ -21,6 +21,7 @@ export declare enum TaxDisplay { } export interface StoreConfig { defaultCountry: string; + isCheckoutAgreementsEnabled: boolean; isGuestCheckoutEnabled: boolean; isOnePageCheckoutEnabled: boolean; shoppingCartDisplaySetting: { diff --git a/scripts/__dropins__/storefront-checkout/data/transforms/index.d.ts b/scripts/__dropins__/storefront-checkout/data/transforms/index.d.ts index 7d7258d6cc..ebf0d12ebe 100644 --- a/scripts/__dropins__/storefront-checkout/data/transforms/index.d.ts +++ b/scripts/__dropins__/storefront-checkout/data/transforms/index.d.ts @@ -16,6 +16,7 @@ *******************************************************************/ export * from './transform-address'; export * from './transform-cart'; +export * from './transform-checkout-agreements'; export * from './transform-customer'; export * from './transform-email-availability'; export * from './transform-shipping-estimate'; diff --git a/scripts/__dropins__/storefront-checkout/data/transforms/transform-checkout-agreements.d.ts b/scripts/__dropins__/storefront-checkout/data/transforms/transform-checkout-agreements.d.ts new file mode 100644 index 0000000000..0af5ba3d20 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/data/transforms/transform-checkout-agreements.d.ts @@ -0,0 +1,7 @@ +import { Get_Checkout_AgreementsQuery } from '../../__generated__/types'; +import { CheckoutAgreement as CheckoutAgreementModel } from '../models'; + +type CheckoutAgreements = Get_Checkout_AgreementsQuery['checkoutAgreements']; +export declare const transformCheckoutAgreements: (data: CheckoutAgreements) => CheckoutAgreementModel[]; +export {}; +//# sourceMappingURL=transform-checkout-agreements.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/hooks/index.d.ts b/scripts/__dropins__/storefront-checkout/hooks/index.d.ts index 0c29a5e3fe..25dbb711ab 100644 --- a/scripts/__dropins__/storefront-checkout/hooks/index.d.ts +++ b/scripts/__dropins__/storefront-checkout/hooks/index.d.ts @@ -15,6 +15,5 @@ * from Adobe. *******************************************************************/ export * from './useBreakpoint'; -export * from './useLockScroll'; export * from './useStableList'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/hooks/useLockScroll/index.d.ts b/scripts/__dropins__/storefront-checkout/hooks/useLockScroll/index.d.ts deleted file mode 100644 index b201b5ad77..0000000000 --- a/scripts/__dropins__/storefront-checkout/hooks/useLockScroll/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************** -* ADOBE CONFIDENTIAL -* __________________ -* -* Copyright 2024 Adobe -* All Rights Reserved. -* -* NOTICE: All information contained herein is, and remains -* the property of Adobe and its suppliers, if any. The intellectual -* and technical concepts contained herein are proprietary to Adobe -* and its suppliers and are protected by all applicable intellectual -* property laws, including trade secret and copyright laws. -* Dissemination of this information or reproduction of this material -* is strictly forbidden unless prior written permission is obtained -* from Adobe. -*******************************************************************/ -export * from './useLockScroll'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/hooks/useLockScroll/useLockScroll.d.ts b/scripts/__dropins__/storefront-checkout/hooks/useLockScroll/useLockScroll.d.ts deleted file mode 100644 index f2c0dbff0c..0000000000 --- a/scripts/__dropins__/storefront-checkout/hooks/useLockScroll/useLockScroll.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************** -* ADOBE CONFIDENTIAL -* __________________ -* -* Copyright 2024 Adobe -* All Rights Reserved. -* -* NOTICE: All information contained herein is, and remains -* the property of Adobe and its suppliers, if any. The intellectual -* and technical concepts contained herein are proprietary to Adobe -* and its suppliers and are protected by all applicable intellectual -* property laws, including trade secret and copyright laws. -* Dissemination of this information or reproduction of this material -* is strictly forbidden unless prior written permission is obtained -* from Adobe. -*******************************************************************/ -export declare const useScrollLock: () => { - lockScroll: () => void; - unlockScroll: () => void; -}; -//# sourceMappingURL=useLockScroll.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/i18n/en_US.json.d.ts b/scripts/__dropins__/storefront-checkout/i18n/en_US.json.d.ts index 0026bed482..68a8e3257a 100644 --- a/scripts/__dropins__/storefront-checkout/i18n/en_US.json.d.ts +++ b/scripts/__dropins__/storefront-checkout/i18n/en_US.json.d.ts @@ -55,9 +55,6 @@ declare const _default: { "title": "Your cart is empty", "button": "Start shopping" }, - "ErrorBanner": { - "genericMessage": "Server error detected. Please check your connection and try again." - }, "MergedCartBanner": { "items": { "one": "1 item from a previous session was added to your cart. Please review your new subtotal.", @@ -71,6 +68,10 @@ declare const _default: { "taxToBeDetermined": "TBD", "withTaxes": "Including taxes", "withoutTaxes": "Excluding taxes" + }, + "TermsAndConditions": { + "label": "I have read, understand, and accept our Terms of Use, Terms of Sales, Privacy Policy, and Return Policy.", + "error": "Please accept the Terms and Conditions to continue." } } } diff --git a/scripts/__dropins__/storefront-checkout/render.js b/scripts/__dropins__/storefront-checkout/render.js index be177134aa..9c1b75d58a 100644 --- a/scripts/__dropins__/storefront-checkout/render.js +++ b/scripts/__dropins__/storefront-checkout/render.js @@ -1,9 +1,9 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ (function(n,o){try{if(typeof document<"u"){const t=document.createElement("style"),r=o.styleId;for(const e in o.attributes)t.setAttribute(e,o.attributes[e]);t.setAttribute("data-dropin",r),t.appendChild(document.createTextNode(n));const a=document.querySelector('style[data-dropin="sdk"]');if(a)a.after(t);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(`.checkout__banner{margin-bottom:var(--spacing-xlarge)} -.checkout-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.checkout-estimate-shipping__label,.checkout-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-estimate-shipping__price{text-align:right}.checkout-estimate-shipping__label--bold,.checkout-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.checkout-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__shipping .dropin-skeleton{grid-template-columns:1fr}.checkout-login-form__heading{display:grid;grid-template-columns:1fr max-content;grid-auto-rows:max-content}.checkout-login-form__content{grid-auto-rows:max-content}.checkout-login-form__content .dropin-field__hint a{font-weight:400}.checkout-login-form__customer-details{display:grid;grid-auto-flow:row;gap:var(--spacing-xxsmall)}.checkout-login-form__customer-name{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-login-form__customer-email{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-login-form__title{grid-column-start:1;color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);justify-self:flex-end;margin-top:var(--spacing-xxsmall)}a.checkout-login-form__link{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-left:var(--spacing-xxsmall)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-login-form__heading{grid-template-columns:repeat(1,1fr [col-start]);grid-template-rows:1fr}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:0;margin-bottom:var(--spacing-medium)}}.checkout-out-of-stock.dropin-card{border-color:var(--color-warning-500)}.checkout-out-of-stock .dropin-card__content{gap:var(--spacing-small);padding:var(--spacing-small)}.checkout-out-of-stock__title{color:var(--color-neutral-900);font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin:0;display:flex;gap:var(--spacing-xxsmall);align-items:center;justify-content:left;text-align:center}.checkout-out-of-stock__message{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0}.checkout-out-of-stock__items{display:grid;grid-template-columns:repeat(5,100px);grid-gap:var(--spacing-small);list-style:none;padding:0;margin:0}.checkout-out-of-stock__item img{width:100%;height:auto}.checkout-out-of-stock__actions{display:flex;gap:var(--spacing-small);justify-content:flex-end}a.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);background:none;border:none;padding:0;cursor:pointer}.checkout-out-of-stock__action:hover{--textColor: var(--color-brand-700);text-decoration:solid underline var(--textColor);text-underline-offset:6px}@media only screen and (width >= 320px) and (width <= 768px){.checkout-out-of-stock__items{grid-template-columns:repeat(3,100px)}}.checkout-server-error{position:relative;text-align:center}.checkout-server-error__icon .error-icon{color:var(--color-alert-500)}.checkout-server-error a{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing)} +.checkout-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.checkout-estimate-shipping__label,.checkout-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-estimate-shipping__price{text-align:right}.checkout-estimate-shipping__label--bold,.checkout-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.checkout-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__shipping .dropin-skeleton{grid-template-columns:1fr}.checkout-login-form__heading{display:grid;grid-template-columns:1fr max-content;grid-auto-rows:max-content}.checkout-login-form__content{grid-auto-rows:max-content}.checkout-login-form__content .dropin-field__hint a{font-weight:400}.checkout-login-form__customer-details{display:grid;grid-auto-flow:row;gap:var(--spacing-xxsmall)}.checkout-login-form__customer-name{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-login-form__customer-email{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-login-form__title{grid-column-start:1;color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);justify-self:flex-end;margin-top:var(--spacing-xxsmall)}a.checkout-login-form__link{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-left:var(--spacing-xxsmall)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-login-form__heading{grid-template-columns:repeat(1,1fr [col-start]);grid-template-rows:1fr}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:0;margin-bottom:var(--spacing-medium)}}.checkout-out-of-stock.dropin-card{border-color:var(--color-warning-500)}.checkout-out-of-stock .dropin-card__content{gap:var(--spacing-small);padding:var(--spacing-small)}.checkout-out-of-stock__title{color:var(--color-neutral-900);font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin:0;display:flex;gap:var(--spacing-xxsmall);align-items:center;justify-content:left;text-align:center}.checkout-out-of-stock__message{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0}.checkout-out-of-stock__items{display:grid;grid-template-columns:repeat(5,100px);grid-gap:var(--spacing-small);list-style:none;padding:0;margin:0}.checkout-out-of-stock__item img{width:100%;height:auto}.checkout-out-of-stock__actions{display:flex;gap:var(--spacing-small);justify-content:flex-end}a.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);background:none;border:none;padding:0;cursor:pointer}.checkout-out-of-stock__action:hover{--textColor: var(--color-brand-700);text-decoration:solid underline var(--textColor);text-underline-offset:6px}@media only screen and (width >= 320px) and (width <= 768px){.checkout-out-of-stock__items{grid-template-columns:repeat(3,100px)}}.checkout-server-error{position:relative;text-align:center}.checkout-server-error__icon .error-icon{color:var(--color-alert-500)}.checkout-server-error a{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing)}.checkout-terms-and-conditions{display:grid}.checkout-terms-and-conditions__error{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-alert-800);text-align:left;margin-top:var(--spacing-xsmall)}.checkout-terms-and-conditions__error:empty{display:none} .checkout-shipping-methods__title{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-shipping-methods__content{position:relative;display:block}.checkout-shipping-methods__method{margin-bottom:var(--spacing-medium);width:fit-content;cursor:pointer;font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-shipping-methods__method:last-child{margin-bottom:0}.dropin-radio-button__label .dropin-price{color:var(--color-neutral-800);font-weight:400}.checkout-shipping-methods__options--loading{opacity:.4;pointer-events:none}.checkout-shipping-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0} .checkout-place-order{display:grid;padding-bottom:var(--spacing-big)}.checkout-place-order__button{align-self:flex-end;justify-self:flex-end}@media only screen and (min-width:320px) and (max-width: 768px){.checkout-place-order{background-color:var(--color-neutral-200);padding:var(--spacing-medium) var(--spacing-medium) var(--spacing-big) var(--spacing-medium)}.checkout-place-order__button{align-self:center;justify-self:stretch}} .checkout-payment-methods__title{color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-payment-methods__wrapper{position:relative;display:grid}.checkout-payment-methods__wrapper--loading{opacity:.4;pointer-events:none}.checkout-payment-methods__methods{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-payment-methods__content{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:var(--spacing-xbig)}.checkout-payment-methods__content>div[data-slot=PaymentMethodSlot]:not(:empty){margin-top:var(--spacing-medium)}.checkout-payment-methods--full-width{grid-template-columns:1fr}.checkout-payment-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.checkout__content [data-slot=PaymentMethods]:empty{display:none}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-payment-methods__methods{grid-template-columns:1fr}} .checkout-bill-to-shipping-address label{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);gap:0}`,{styleId:"checkout"}); -import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/store-config.js";import"./chunks/transform-store-config.js";import{events as p}from"@dropins/tools/event-bus.js";import{c as g}from"./chunks/synchronizeCheckout.js";import{UIProvider as y}from"@dropins/tools/components.js";import{useState as b,useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"./fragments.js";import"./chunks/errors.js";function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S=function(r){return E(r)&&!w(r)};function E(e){return!!e&&typeof e=="object"}function w(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||M(e)}var v=typeof Symbol=="function"&&Symbol.for,j=v?Symbol.for("react.element"):60103;function M(e){return e.$$typeof===j}function A(e){return Array.isArray(e)?[]:{}}function i(e,r){return r.clone!==!1&&r.isMergeableObject(e)?a(A(e),e,r):e}function P(e,r,t){return e.concat(r).map(function(o){return i(o,t)})}function I(e,r){if(!r.customMerge)return a;var t=r.customMerge(e);return typeof t=="function"?t:a}function T(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function l(e){return Object.keys(e).concat(T(e))}function m(e,r){try{return r in e}catch{return!1}}function C(e,r){return m(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function x(e,r,t){var o={};return t.isMergeableObject(e)&&l(e).forEach(function(n){o[n]=i(e[n],t)}),l(r).forEach(function(n){C(e,n)||(m(e,n)&&t.isMergeableObject(r[n])?o[n]=I(n,t)(e[n],r[n],t):o[n]=i(r[n],t))}),o}function a(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||P,t.isMergeableObject=t.isMergeableObject||S,t.cloneUnlessOtherwiseSpecified=i;var o=Array.isArray(r),n=Array.isArray(e),c=o===n;return c?o?t.arrayMerge(e,r,t):x(e,r,t):i(r,t)}a.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(o,n){return a(o,n,t)},{})};var D=a,B=D;const L=O(B),_={title:"Checkout",LoginForm:{title:"Contact details",account:"Already have an account?",ariaLabel:"Email",invalidEmailError:"Please enter a valid email address.",missingEmailError:"Enter an email address.",emailExists:{alreadyHaveAccount:"It looks like you already have an account.",signInButton:"Sign in",forFasterCheckout:"for a faster checkout."},floatingLabel:"Email *",placeholder:"Enter your email address",signIn:"Sign In",switch:"Do you want to switch account?",signOut:"Sign Out"},ShippingMethods:{title:"Shipping options",emptyState:"This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."},BillToShippingAddress:{title:"Bill to shipping address"},PaymentMethods:{title:"Payment",emptyState:"No payment methods available"},OutOfStock:{title:"Your cart contains items that are out of stock",message:"The following items are out of stock:",actions:{reviewCart:"Review cart",removeOutOfStock:"Remove out of stock items"},lowInventory:{one:"Last item!",many:"Only {{count}} left!"},alert:"Out of stock!"},PlaceOrder:{button:"Place Order"},ServerError:{title:"We were unable to process your order",contactSupport:"If you continue to have issues, please contact support.",unexpected:"An unexpected error occurred while processing your order. Please try again later.",button:"Try again"},EmptyCart:{title:"Your cart is empty",button:"Start shopping"},ErrorBanner:{genericMessage:"Server error detected. Please check your connection and try again."},MergedCartBanner:{items:{one:"1 item from a previous session was added to your cart. Please review your new subtotal.",many:"{{count}} items from a previous session were added to your cart. Please review your new subtotal."}},EstimateShipping:{estimated:"Estimated Shipping",freeShipping:"Free",label:"Shipping",taxToBeDetermined:"TBD",withTaxes:"Including taxes",withoutTaxes:"Excluding taxes"}},R={Checkout:_},U={default:R},k=({children:e})=>{var c;const[r,t]=b(),o=(c=g.getConfig())==null?void 0:c.langDefinitions;h(()=>{const s=p.on("locale",u=>{u!==r&&t(u)},{eager:!0});return()=>{s==null||s.off()}},[r]);const n=L(U,o??{});return f(y,{lang:r,langDefinitions:n,children:e})},Q=new d(f(k,{}));export{k as Provider,Q as render}; +import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/state.js";import"./chunks/transform-store-config.js";import{events as p}from"@dropins/tools/event-bus.js";import{c as g}from"./chunks/synchronizeCheckout.js";import{UIProvider as y}from"@dropins/tools/components.js";import{useState as b,useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/store-config.js";import"@dropins/tools/signals.js";import"./fragments.js";import"./chunks/errors.js";function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w=function(t){return S(t)&&!v(t)};function S(e){return!!e&&typeof e=="object"}function v(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||M(e)}var E=typeof Symbol=="function"&&Symbol.for,j=E?Symbol.for("react.element"):60103;function M(e){return e.$$typeof===j}function P(e){return Array.isArray(e)?[]:{}}function i(e,t){return t.clone!==!1&&t.isMergeableObject(e)?o(P(e),e,t):e}function A(e,t,r){return e.concat(t).map(function(a){return i(a,r)})}function T(e,t){if(!t.customMerge)return o;var r=t.customMerge(e);return typeof r=="function"?r:o}function I(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function u(e){return Object.keys(e).concat(I(e))}function m(e,t){try{return t in e}catch{return!1}}function C(e,t){return m(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function x(e,t,r){var a={};return r.isMergeableObject(e)&&u(e).forEach(function(n){a[n]=i(e[n],r)}),u(t).forEach(function(n){C(e,n)||(m(e,n)&&r.isMergeableObject(t[n])?a[n]=T(n,r)(e[n],t[n],r):a[n]=i(t[n],r))}),a}function o(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||A,r.isMergeableObject=r.isMergeableObject||w,r.cloneUnlessOtherwiseSpecified=i;var a=Array.isArray(t),n=Array.isArray(e),s=a===n;return s?a?r.arrayMerge(e,t,r):x(e,t,r):i(t,r)}o.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(a,n){return o(a,n,r)},{})};var D=o,_=D;const L=O(_),R={title:"Checkout",LoginForm:{title:"Contact details",account:"Already have an account?",ariaLabel:"Email",invalidEmailError:"Please enter a valid email address.",missingEmailError:"Enter an email address.",emailExists:{alreadyHaveAccount:"It looks like you already have an account.",signInButton:"Sign in",forFasterCheckout:"for a faster checkout."},floatingLabel:"Email *",placeholder:"Enter your email address",signIn:"Sign In",switch:"Do you want to switch account?",signOut:"Sign Out"},ShippingMethods:{title:"Shipping options",emptyState:"This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."},BillToShippingAddress:{title:"Bill to shipping address"},PaymentMethods:{title:"Payment",emptyState:"No payment methods available"},OutOfStock:{title:"Your cart contains items that are out of stock",message:"The following items are out of stock:",actions:{reviewCart:"Review cart",removeOutOfStock:"Remove out of stock items"},lowInventory:{one:"Last item!",many:"Only {{count}} left!"},alert:"Out of stock!"},PlaceOrder:{button:"Place Order"},ServerError:{title:"We were unable to process your order",contactSupport:"If you continue to have issues, please contact support.",unexpected:"An unexpected error occurred while processing your order. Please try again later.",button:"Try again"},EmptyCart:{title:"Your cart is empty",button:"Start shopping"},MergedCartBanner:{items:{one:"1 item from a previous session was added to your cart. Please review your new subtotal.",many:"{{count}} items from a previous session were added to your cart. Please review your new subtotal."}},EstimateShipping:{estimated:"Estimated Shipping",freeShipping:"Free",label:"Shipping",taxToBeDetermined:"TBD",withTaxes:"Including taxes",withoutTaxes:"Excluding taxes"},TermsAndConditions:{label:"I have read, understand, and accept our Terms of Use, Terms of Sales, Privacy Policy, and Return Policy.",error:"Please accept the Terms and Conditions to continue."}},U={Checkout:R},B={default:U},k=({children:e})=>{var s;const[t,r]=b(),a=(s=g.getConfig())==null?void 0:s.langDefinitions;h(()=>{const c=p.on("locale",l=>{l!==t&&r(l)},{eager:!0});return()=>{c==null||c.off()}},[t]);const n=L(B,a??{});return f(y,{lang:t,langDefinitions:n,children:e})},X=new d(f(k,{}));export{k as Provider,X as render}; diff --git a/scripts/__dropins__/storefront-checkout/signals/EmailSignal.d.ts b/scripts/__dropins__/storefront-checkout/signals/EmailSignal.d.ts new file mode 100644 index 0000000000..331aeb3f94 --- /dev/null +++ b/scripts/__dropins__/storefront-checkout/signals/EmailSignal.d.ts @@ -0,0 +1,26 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * __________________ + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +interface Email { + available: boolean; + error: string; + initialized: boolean; + pending: boolean; + value: string; +} +export declare const emailSignal: import('@preact/signals-core').Signal; +export {}; +//# sourceMappingURL=EmailSignal.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-checkout/signals/index.d.ts b/scripts/__dropins__/storefront-checkout/signals/index.d.ts index 60215f145e..a96d3250a2 100644 --- a/scripts/__dropins__/storefront-checkout/signals/index.d.ts +++ b/scripts/__dropins__/storefront-checkout/signals/index.d.ts @@ -16,6 +16,7 @@ *******************************************************************/ export * from './CartSignal'; export * from './CustomerSignal'; +export * from './EmailSignal'; export * from './EstimateShippingMethodsSignal'; export * from './IsBillToShippingSignal'; export * from './SelectedPaymentMethodSignal'; diff --git a/scripts/__dropins__/storefront-order/api.js b/scripts/__dropins__/storefront-order/api.js index 8b21222ac9..9313aa7653 100644 --- a/scripts/__dropins__/storefront-order/api.js +++ b/scripts/__dropins__/storefront-order/api.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{c as z,r as J}from"./chunks/requestGuestOrderCancel.js";import{f as _,h as g}from"./chunks/fetch-graphql.js";import{g as W,r as Z,s as ee,a as re,b as te}from"./chunks/fetch-graphql.js";import{g as oe}from"./chunks/getAttributesForm.js";import{g as se,a as ce,r as ue}from"./chunks/requestGuestReturn.js";import{g as le,a as pe}from"./chunks/getGuestOrder.js";import{g as me}from"./chunks/getCustomerOrdersReturn.js";import{a as h}from"./chunks/initialize.js";import{d as Te,g as Re,c as _e,i as ge}from"./chunks/initialize.js";import{g as Ae}from"./chunks/getStoreConfig.js";import{h as A}from"./chunks/network-error.js";import{events as d}from"@dropins/tools/event-bus.js";import{PRODUCT_DETAILS_FRAGMENT as O,PRICE_DETAILS_FRAGMENT as D,GIFT_CARD_DETAILS_FRAGMENT as x,ORDER_ITEM_DETAILS_FRAGMENT as f,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as C,ORDER_SUMMARY_FRAGMENT as b,ADDRESS_FRAGMENT as M,ORDER_ITEM_FRAGMENT as v}from"./fragments.js";import{a as De,c as xe,r as fe}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const T=(r,t)=>r+t.amount.value,y=(r,t)=>({id:r,totalQuantity:t.totalQuantity,possibleOnepageCheckout:!0,items:t.items.map(e=>{var a,o,n,s,c,u,i,l;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:(a=e.product)==null?void 0:a.canonicalUrl,mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((c=e.product)==null?void 0:c.sku)??"",topLevelSku:(u=e.product)==null?void 0:u.sku},prices:{price:{value:e.price.value,currency:e.price.currency,regularPrice:((i=e.regularPrice)==null?void 0:i.value)??e.price.value}},configurableOptions:((l=e.selectedOptions)==null?void 0:l.map(p=>({optionLabel:p.label,valueLabel:p.value})))||[]}}),prices:{subtotalExcludingTax:{value:t.subtotalExclTax.value,currency:t.subtotalExclTax.currency},subtotalIncludingTax:{value:t.subtotalInclTax.value,currency:t.subtotalInclTax.currency}},discountAmount:t.discounts.reduce(T,0)}),G=r=>{var a,o,n;const t=r.coupons[0],e=(a=r.payments)==null?void 0:a[0];return{appliedCouponCode:(t==null?void 0:t.code)??"",email:r.email,grandTotal:r.grandTotal.value,orderId:r.number,orderType:"checkout",otherTax:0,salesTax:r.totalTax.value,shipping:{shippingMethod:((o=r.shipping)==null?void 0:o.code)??"",shippingAmount:((n=r.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:r.subtotalExclTax.value,subtotalIncludingTax:r.subtotalInclTax.value,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:r.grandTotal.value,orderId:r.number}]:[],discountAmount:r.discounts.reduce(T,0),taxAmount:r.totalTax.value}},N=r=>{var e,a;const t=(a=(e=r==null?void 0:r.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return t?h(t):null},m={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},L={PLACE_ORDER:"place-order"};function R(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function E(r,t){const e=R();e.push({[r]:null}),e.push({[r]:t})}function S(r){R().push(e=>{const a=e.getState?e.getState():{};e.push({event:r,eventInfo:{...a}})})}function F(r,t){const e=G(t),a=y(r,t);E(m.ORDER_CONTEXT,{...e}),E(m.SHOPPING_CART_CONTEXT,{...a}),S(L.PLACE_ORDER)}class I extends Error{constructor(t){super(t),this.name="PlaceOrderError"}}const P=r=>{const t=r.map(e=>e.message).join(" ");throw new I(t)},k=` +import{c as K,r as Z}from"./chunks/requestGuestOrderCancel.js";import{f as R,h as g}from"./chunks/fetch-graphql.js";import{g as re,r as te,s as ae,a as oe,b as ne}from"./chunks/fetch-graphql.js";import{g as ce}from"./chunks/getAttributesForm.js";import{g as ie,a as le,r as pe}from"./chunks/requestGuestReturn.js";import{g as Ee,a as Te}from"./chunks/getGuestOrder.js";import{g as me}from"./chunks/getCustomerOrdersReturn.js";import{a as A}from"./chunks/initialize.js";import{d as ge,g as Ae,c as De,i as he}from"./chunks/initialize.js";import{g as Ge}from"./chunks/getStoreConfig.js";import{h as D}from"./chunks/network-error.js";import{events as d}from"@dropins/tools/event-bus.js";import{PRODUCT_DETAILS_FRAGMENT as h,PRICE_DETAILS_FRAGMENT as O,GIFT_CARD_DETAILS_FRAGMENT as G,ORDER_ITEM_DETAILS_FRAGMENT as f,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as x,ORDER_SUMMARY_FRAGMENT as M,ADDRESS_FRAGMENT as C,ORDER_ITEM_FRAGMENT as N,GIFT_WRAPPING_FRAGMENT as b,GIFT_MESSAGE_FRAGMENT as F,APPLIED_GIFT_CARDS_FRAGMENT as I}from"./fragments.js";import{a as xe,c as Me,r as Ce}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const _=(r,t)=>r+t.amount.value,S=(r,t)=>({id:r,totalQuantity:t.totalQuantity,possibleOnepageCheckout:!0,items:t.items.map(e=>{var a,o,n,s,c,u,i,l;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:(a=e.product)==null?void 0:a.canonicalUrl,mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((c=e.product)==null?void 0:c.sku)??"",topLevelSku:(u=e.product)==null?void 0:u.sku},prices:{price:{value:e.price.value,currency:e.price.currency,regularPrice:((i=e.regularPrice)==null?void 0:i.value)??e.price.value}},configurableOptions:((l=e.selectedOptions)==null?void 0:l.map(p=>({optionLabel:p.label,valueLabel:p.value})))||[]}}),prices:{subtotalExcludingTax:{value:t.subtotalExclTax.value,currency:t.subtotalExclTax.currency},subtotalIncludingTax:{value:t.subtotalInclTax.value,currency:t.subtotalInclTax.currency}},discountAmount:t.discounts.reduce(_,0)}),v=r=>{var a,o,n;const t=r.coupons[0],e=(a=r.payments)==null?void 0:a[0];return{appliedCouponCode:(t==null?void 0:t.code)??"",email:r.email,grandTotal:r.grandTotal.value,orderId:r.number,orderType:"checkout",otherTax:0,salesTax:r.totalTax.value,shipping:{shippingMethod:((o=r.shipping)==null?void 0:o.code)??"",shippingAmount:((n=r.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:r.subtotalExclTax.value,subtotalIncludingTax:r.subtotalInclTax.value,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:r.grandTotal.value,orderId:r.number}]:[],discountAmount:r.discounts.reduce(_,0),taxAmount:r.totalTax.value}},y=r=>{var e,a;const t=(a=(e=r==null?void 0:r.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return t?A(t):null},E={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},L={PLACE_ORDER:"place-order"};function m(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function T(r,t){const e=m();e.push({[r]:null}),e.push({[r]:t})}function P(r){m().push(e=>{const a=e.getState?e.getState():{};e.push({event:r,eventInfo:{...a}})})}function $(r,t){const e=v(t),a=S(r,t);T(E.ORDER_CONTEXT,{...e}),T(E.SHOPPING_CART_CONTEXT,{...a}),P(L.PLACE_ORDER)}class w extends Error{constructor(t){super(t),this.name="PlaceOrderError"}}const k=r=>{const t=r.map(e=>e.message).join(" ");throw new w(t)},U=` mutation PLACE_ORDER_MUTATION($cartId: String!) { placeOrder(input: { cart_id: $cartId }) { errors { @@ -8,6 +8,17 @@ import{c as z,r as J}from"./chunks/requestGuestOrderCancel.js";import{f as _,h a message } orderV2 { + printed_card_included + gift_receipt_included + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + applied_gift_cards { + ...APPLIED_GIFT_CARDS_FRAGMENT + } email available_actions status @@ -67,12 +78,15 @@ import{c as z,r as J}from"./chunks/requestGuestOrderCancel.js";import{f as _,h a } } } + ${h} ${O} - ${D} - ${x} + ${G} ${f} + ${x} + ${M} ${C} + ${N} ${b} - ${M} - ${v} -`,V=async r=>{if(!r)throw new Error("No cart ID found");return _(k,{variables:{cartId:r}}).then(t=>{var a,o,n,s,c;(a=t.errors)!=null&&a.length&&g(t.errors),(s=(n=(o=t.data)==null?void 0:o.placeOrder)==null?void 0:n.errors)!=null&&s.length&&P((c=t.data.placeOrder)==null?void 0:c.errors);const e=N(t);return e&&(d.emit("order/placed",e),d.emit("cart/reset",void 0),F(r,e)),e}).catch(A)};export{z as cancelOrder,Te as config,De as confirmCancelOrder,xe as confirmGuestReturn,_ as fetchGraphQl,oe as getAttributesForm,se as getAttributesList,W as getConfig,le as getCustomer,me as getCustomerOrdersReturn,pe as getGuestOrder,Re as getOrderDetailsById,Ae as getStoreConfig,_e as guestOrderByToken,ge as initialize,V as placeOrder,Z as removeFetchGraphQlHeader,fe as reorderItems,J as requestGuestOrderCancel,ce as requestGuestReturn,ue as requestReturn,ee as setEndpoint,re as setFetchGraphQlHeader,te as setFetchGraphQlHeaders}; + ${F} + ${I} +`,j=async r=>{if(!r)throw new Error("No cart ID found");return R(U,{variables:{cartId:r}}).then(t=>{var a,o,n,s,c;(a=t.errors)!=null&&a.length&&g(t.errors),(s=(n=(o=t.data)==null?void 0:o.placeOrder)==null?void 0:n.errors)!=null&&s.length&&k((c=t.data.placeOrder)==null?void 0:c.errors);const e=y(t);return e&&(d.emit("order/placed",e),d.emit("cart/reset",void 0),$(r,e)),e}).catch(D)};export{K as cancelOrder,ge as config,xe as confirmCancelOrder,Me as confirmGuestReturn,R as fetchGraphQl,ce as getAttributesForm,ie as getAttributesList,re as getConfig,Ee as getCustomer,me as getCustomerOrdersReturn,Te as getGuestOrder,Ae as getOrderDetailsById,Ge as getStoreConfig,De as guestOrderByToken,he as initialize,j as placeOrder,te as removeFetchGraphQlHeader,Ce as reorderItems,Z as requestGuestOrderCancel,le as requestGuestReturn,pe as requestReturn,ae as setEndpoint,oe as setFetchGraphQlHeader,ne as setFetchGraphQlHeaders}; diff --git a/scripts/__dropins__/storefront-order/api/fragments.d.ts b/scripts/__dropins__/storefront-order/api/fragments.d.ts index 6ec94d6140..efde93ad93 100644 --- a/scripts/__dropins__/storefront-order/api/fragments.d.ts +++ b/scripts/__dropins__/storefront-order/api/fragments.d.ts @@ -18,5 +18,6 @@ export { ADDRESS_FRAGMENT } from './graphql/CustomerAddressFragment.graphql'; export { PRODUCT_DETAILS_FRAGMENT, PRICE_DETAILS_FRAGMENT, GIFT_CARD_DETAILS_FRAGMENT, ORDER_ITEM_FRAGMENT, ORDER_ITEM_DETAILS_FRAGMENT, BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT, DOWNLOADABLE_ORDER_ITEMS_FRAGMENT, } from './graphql/OrderItemsFragment.graphql'; export { ORDER_SUMMARY_FRAGMENT } from './graphql/OrderSummaryFragment.graphql'; export { RETURNS_FRAGMENT } from './graphql/ReturnsFragment.graphql'; +export { AVAILABLE_GIFT_WRAPPING_FRAGMENT, APPLIED_GIFT_CARDS_FRAGMENT, GIFT_WRAPPING_FRAGMENT, GIFT_MESSAGE_FRAGMENT, } from './graphql/GiftFragment.graphql'; export { GUEST_ORDER_FRAGMENT } from './graphql/GuestOrderFragment.graphql'; //# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/api/getStoreConfig/graphql/StoreConfigQuery.d.ts b/scripts/__dropins__/storefront-order/api/getStoreConfig/graphql/StoreConfigQuery.d.ts index 0fc47013ac..4306e1c81a 100644 --- a/scripts/__dropins__/storefront-order/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +++ b/scripts/__dropins__/storefront-order/api/getStoreConfig/graphql/StoreConfigQuery.d.ts @@ -13,5 +13,5 @@ * is strictly forbidden unless prior written permission is obtained * from Adobe. *******************************************************************/ -export declare const STORE_CONFIG_QUERY = "\n query STORE_CONFIG_QUERY {\n storeConfig {\n order_cancellation_enabled\n order_cancellation_reasons {\n description\n }\n base_media_url\n orders_invoices_credit_memos_display_price\n orders_invoices_credit_memos_display_shipping_amount\n orders_invoices_credit_memos_display_subtotal\n orders_invoices_credit_memos_display_grandtotal\n orders_invoices_credit_memos_display_full_summary\n orders_invoices_credit_memos_display_zero_tax\n }\n }\n"; +export declare const STORE_CONFIG_QUERY = "\n query STORE_CONFIG_QUERY {\n storeConfig {\n order_cancellation_enabled\n order_cancellation_reasons {\n description\n }\n base_media_url\n orders_invoices_credit_memos_display_price\n orders_invoices_credit_memos_display_shipping_amount\n orders_invoices_credit_memos_display_subtotal\n orders_invoices_credit_memos_display_grandtotal\n orders_invoices_credit_memos_display_full_summary\n orders_invoices_credit_memos_display_zero_tax\n sales_printed_card\n sales_gift_wrapping\n }\n }\n"; //# sourceMappingURL=StoreConfigQuery.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/api/graphql/GiftFragment.graphql.d.ts b/scripts/__dropins__/storefront-order/api/graphql/GiftFragment.graphql.d.ts new file mode 100644 index 0000000000..4340faea6e --- /dev/null +++ b/scripts/__dropins__/storefront-order/api/graphql/GiftFragment.graphql.d.ts @@ -0,0 +1,5 @@ +export declare const APPLIED_GIFT_CARDS_FRAGMENT = "\n fragment APPLIED_GIFT_CARDS_FRAGMENT on ApplyGiftCardToOrder {\n __typename\n code\n applied_balance {\n value\n currency\n }\n }\n"; +export declare const GIFT_MESSAGE_FRAGMENT = "\n fragment GIFT_MESSAGE_FRAGMENT on GiftMessage {\n __typename\n from\n to\n message\n }\n"; +export declare const GIFT_WRAPPING_FRAGMENT = "\n fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping {\n __typename\n uid\n design\n image {\n url\n }\n price {\n value\n currency\n }\n }\n"; +export declare const AVAILABLE_GIFT_WRAPPING_FRAGMENT = "\n fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping {\n __typename\n uid\n design\n image {\n url\n label\n }\n price {\n currency\n value\n }\n }\n"; +//# sourceMappingURL=GiftFragment.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/api/graphql/OrderItemsFragment.graphql.d.ts b/scripts/__dropins__/storefront-order/api/graphql/OrderItemsFragment.graphql.d.ts index 12f1c13677..f92757b530 100644 --- a/scripts/__dropins__/storefront-order/api/graphql/OrderItemsFragment.graphql.d.ts +++ b/scripts/__dropins__/storefront-order/api/graphql/OrderItemsFragment.graphql.d.ts @@ -13,10 +13,10 @@ * is strictly forbidden unless prior written permission is obtained * from Adobe. *******************************************************************/ -export declare const PRODUCT_DETAILS_FRAGMENT = "\n fragment PRODUCT_DETAILS_FRAGMENT on ProductInterface {\n __typename\n canonical_url\n url_key\n uid\n name\n sku\n only_x_left_in_stock\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n maximum_price {\n regular_price {\n currency\n value\n }\n }\n }\n }\n"; +export declare const PRODUCT_DETAILS_FRAGMENT = "\n fragment PRODUCT_DETAILS_FRAGMENT on ProductInterface {\n __typename\n canonical_url\n url_key\n uid\n name\n sku\n only_x_left_in_stock\n gift_wrapping_price {\n currency\n value\n }\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n maximum_price {\n regular_price {\n currency\n value\n }\n }\n }\n }\n"; export declare const PRICE_DETAILS_FRAGMENT = "\n fragment PRICE_DETAILS_FRAGMENT on OrderItemInterface {\n prices {\n price_including_tax {\n value\n currency\n }\n original_price {\n value\n currency\n }\n original_price_including_tax {\n value\n currency\n }\n price {\n value\n currency\n }\n }\n }\n"; -export declare const GIFT_CARD_DETAILS_FRAGMENT = "\n fragment GIFT_CARD_DETAILS_FRAGMENT on GiftCardOrderItem {\n ...PRICE_DETAILS_FRAGMENT\n gift_message {\n message\n }\n gift_card {\n recipient_name\n recipient_email\n sender_name\n sender_email\n message\n }\n }\n"; -export declare const ORDER_ITEM_DETAILS_FRAGMENT = "\n fragment ORDER_ITEM_DETAILS_FRAGMENT on OrderItemInterface {\n __typename\n status\n product_sku\n eligible_for_return\n product_name\n product_url_key\n id\n quantity_ordered\n quantity_shipped\n quantity_canceled\n quantity_invoiced\n quantity_refunded\n quantity_return_requested\n product_sale_price {\n value\n currency\n }\n selected_options {\n label\n value\n }\n product {\n ...PRODUCT_DETAILS_FRAGMENT\n }\n ...PRICE_DETAILS_FRAGMENT\n }\n"; +export declare const GIFT_CARD_DETAILS_FRAGMENT = "\n fragment GIFT_CARD_DETAILS_FRAGMENT on GiftCardOrderItem {\n ...PRICE_DETAILS_FRAGMENT\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_card {\n recipient_name\n recipient_email\n sender_name\n sender_email\n message\n }\n }\n"; +export declare const ORDER_ITEM_DETAILS_FRAGMENT = "\n fragment ORDER_ITEM_DETAILS_FRAGMENT on OrderItemInterface {\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n __typename\n status\n product_sku\n eligible_for_return\n product_name\n product_url_key\n id\n quantity_ordered\n quantity_shipped\n quantity_canceled\n quantity_invoiced\n quantity_refunded\n quantity_return_requested\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n product_sale_price {\n value\n currency\n }\n selected_options {\n label\n value\n }\n product {\n ...PRODUCT_DETAILS_FRAGMENT\n }\n ...PRICE_DETAILS_FRAGMENT\n }\n"; export declare const BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT = "\n fragment BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT on BundleOrderItem {\n ...PRICE_DETAILS_FRAGMENT\n bundle_options {\n uid\n label\n values {\n uid\n product_name\n }\n }\n }\n"; export declare const DOWNLOADABLE_ORDER_ITEMS_FRAGMENT = "\n fragment DOWNLOADABLE_ORDER_ITEMS_FRAGMENT on DownloadableOrderItem {\n product_name\n downloadable_links {\n sort_order\n title\n }\n }\n"; export declare const ORDER_ITEM_FRAGMENT: string; diff --git a/scripts/__dropins__/storefront-order/api/graphql/OrderSummaryFragment.graphql.d.ts b/scripts/__dropins__/storefront-order/api/graphql/OrderSummaryFragment.graphql.d.ts index b7650ed67b..8943aa0ae5 100644 --- a/scripts/__dropins__/storefront-order/api/graphql/OrderSummaryFragment.graphql.d.ts +++ b/scripts/__dropins__/storefront-order/api/graphql/OrderSummaryFragment.graphql.d.ts @@ -13,5 +13,5 @@ * is strictly forbidden unless prior written permission is obtained * from Adobe. *******************************************************************/ -export declare const ORDER_SUMMARY_FRAGMENT = "\n fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {\n grand_total {\n value\n currency\n }\n total_giftcard {\n currency\n value\n }\n subtotal_excl_tax {\n currency\n value\n }\n subtotal_incl_tax {\n currency\n value\n }\n taxes {\n amount {\n currency\n value\n }\n rate\n title\n }\n total_tax {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n }\n"; +export declare const ORDER_SUMMARY_FRAGMENT = "\n fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {\n gift_options {\n gift_wrapping_for_items {\n currency\n value\n }\n gift_wrapping_for_items_incl_tax {\n currency\n value\n }\n gift_wrapping_for_order {\n currency\n value\n }\n gift_wrapping_for_order_incl_tax {\n currency\n value\n }\n printed_card {\n currency\n value\n }\n printed_card_incl_tax {\n currency\n value\n }\n }\n grand_total {\n value\n currency\n }\n total_giftcard {\n currency\n value\n }\n subtotal_excl_tax {\n currency\n value\n }\n subtotal_incl_tax {\n currency\n value\n }\n taxes {\n amount {\n currency\n value\n }\n rate\n title\n }\n total_tax {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n }\n"; //# sourceMappingURL=OrderSummaryFragment.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js b/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js index d3dd6df9ab..c235eaf7cc 100644 --- a/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js +++ b/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as l,jsxs as y,Fragment as E}from"@dropins/tools/preact-jsx-runtime.js";import{Price as z,Image as A,CartItem as B,Icon as F,Incrementer as K}from"@dropins/tools/components.js";import{useCallback as V}from"@dropins/tools/preact-hooks.js";import{classes as H}from"@dropins/tools/lib.js";import{O as Q}from"./OrderLoaders.js";import*as O from"@dropins/tools/preact-compat.js";const R=o=>O.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},O.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),O.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),C=({placeholderImage:o="",loading:M,product:e,itemType:Z,taxConfig:j,translations:g,disabledIncrementer:q,onQuantity:b,showConfigurableOptions:k,routeProductDetails:v})=>{var S,_,D,f,L;const{taxExcluded:w,taxIncluded:I}=j,a=V((i,t,s)=>l(z,{amount:i,currency:t,weight:"normal",...s}),[]),T=V(i=>{var s,x;const t=(s=i==null?void 0:i.product)!=null&&s.thumbnail.url.length?(x=i==null?void 0:i.product)==null?void 0:x.thumbnail.url:o;return l(A,{src:t,alt:i==null?void 0:i.productName,loading:"lazy",width:"90",height:"120"})},[o]);if(!e)return l(Q,{});let P={};const N=Z==="cancelled",W=(_=(S=e==null?void 0:e.product)==null?void 0:S.stockStatus)==null?void 0:_.includes("IN_STOCK"),n=e==null?void 0:e.giftCard,$=e.totalQuantity>1?{quantity:e.totalQuantity}:{},u=e.discounted,{includeAndExcludeTax:c,includeTax:h,excludeTax:r}=e.taxCalculations,m=e==null?void 0:e.totalQuantity,d={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...n!=null&&n.senderName?{[g.sender]:n==null?void 0:n.senderName}:{},...n!=null&&n.senderEmail?{[g.sender]:n==null?void 0:n.senderEmail}:{},...n!=null&&n.senderName?{[g.sender]:n==null?void 0:n.senderName}:{},...n!=null&&n.recipientEmail?{[g.recipient]:n==null?void 0:n.recipientEmail}:{},...n!=null&&n.message?{[g.message]:n==null?void 0:n.message}:{},...e!=null&&e.downloadableLinks?{[`${(D=e==null?void 0:e.downloadableLinks)==null?void 0:D.count} ${g.downloadableCount}`]:(f=e==null?void 0:e.downloadableLinks)==null?void 0:f.result}:{}};if(I&&w){const i=a(c.originalPrice.value,c.originalPrice.currency),t=a(c.baseOriginalPrice.value*m,c.baseOriginalPrice.currency,{variant:e.discounted?"strikethrough":"default",weight:"bold"}),s=a(c.baseDiscountedPrice.value*m,c.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),x=a(c.baseExcludingTax.value*m,c.baseExcludingTax.currency,{weight:"bold"});P={taxExcluded:!0,taxIncluded:void 0,price:i,total:y(E,{children:[t,e.discounted?s:null]}),totalExcludingTax:x}}else if(!I&&w){const i=a(r.originalPrice.value,r.originalPrice.currency),t=a(r.baseOriginalPrice.value*m,r.baseOriginalPrice.currency,{variant:u?"strikethrough":"default",weight:"bold"}),s=a(r.baseDiscountedPrice.value*m,r.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),x=a(r.baseExcludingTax.value*m,r.baseExcludingTax.currency,{weight:"bold"});P={taxExcluded:void 0,taxIncluded:void 0,price:i,total:y(E,{children:[t,u?s:null]}),totalExcludingTax:x}}else if(I&&!w){const i=a(h.singleItemPrice.value,h.singleItemPrice.currency),t=a(h.baseOriginalPrice.value*m,h.baseOriginalPrice.currency,{variant:u?"strikethrough":"default",weight:"bold"}),s=a(h.baseDiscountedPrice.value*m,h.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});P={taxExcluded:void 0,taxIncluded:!0,price:i,total:y(E,{children:[t,u?s:null]})}}return l(B,{loading:M,alert:N&&W?y("span",{children:[l(F,{source:R}),g.outOfStock]}):l(E,{}),configurations:(k==null?void 0:k(d))??d,title:v?l("a",{"data-testid":"product-name",className:H(["cart-summary-item__title",["cart-summary-item__title--strikethrough",N]]),href:v(e),children:e==null?void 0:e.productName}):l("div",{"data-testid":"product-name",className:H(["cart-summary-item__title",["cart-summary-item__title--strikethrough",N]]),children:e==null?void 0:e.productName}),sku:l("div",{children:(L=e==null?void 0:e.product)==null?void 0:L.sku}),...$,image:v?l("a",{href:v(e),children:T(e)}):T(e),...P,footer:b&&!q?l(K,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:i=>b==null?void 0:b(Number(i)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0})};export{C,R as S}; +import{jsx as a,jsxs as b,Fragment as v}from"@dropins/tools/preact-jsx-runtime.js";import{Price as z,Image as A,CartItem as B,Icon as K,Incrementer as Q}from"@dropins/tools/components.js";import{useCallback as F}from"@dropins/tools/preact-hooks.js";import{classes as H,Slot as R}from"@dropins/tools/lib.js";import{O as U}from"./OrderLoaders.js";import*as N from"@dropins/tools/preact-compat.js";const G=o=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},N.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),N.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),ee=({slots:o,placeholderImage:O="",loading:M,product:e,itemType:Z,taxConfig:j,translations:h,disabledIncrementer:q,onQuantity:P,showConfigurableOptions:k,routeProductDetails:u})=>{var _,D,f,L,V;const{taxExcluded:w,taxIncluded:I}=j,l=F((i,s,t)=>a(z,{amount:i,currency:s,weight:"normal",...t}),[]),S=F(i=>{var t,x;const s=(t=i==null?void 0:i.product)!=null&&t.thumbnail.url.length?(x=i==null?void 0:i.product)==null?void 0:x.thumbnail.url:O;return a(A,{src:s,alt:i==null?void 0:i.productName,loading:"lazy",width:"90",height:"120"})},[O]);if(!e)return a(U,{});let y={};const d=Z==="cancelled",W=(D=(_=e==null?void 0:e.product)==null?void 0:_.stockStatus)==null?void 0:D.includes("IN_STOCK"),n=e==null?void 0:e.giftCard,$=e.totalQuantity>1?{quantity:e.totalQuantity}:{},E=e.discounted,{includeAndExcludeTax:c,includeTax:g,excludeTax:r}=e.taxCalculations,m=e==null?void 0:e.totalQuantity,T={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...n!=null&&n.senderName?{[h.sender]:n==null?void 0:n.senderName}:{},...n!=null&&n.senderEmail?{[h.sender]:n==null?void 0:n.senderEmail}:{},...n!=null&&n.senderName?{[h.sender]:n==null?void 0:n.senderName}:{},...n!=null&&n.recipientEmail?{[h.recipient]:n==null?void 0:n.recipientEmail}:{},...n!=null&&n.message?{[h.message]:n==null?void 0:n.message}:{},...e!=null&&e.downloadableLinks?{[`${(f=e==null?void 0:e.downloadableLinks)==null?void 0:f.count} ${h.downloadableCount}`]:(L=e==null?void 0:e.downloadableLinks)==null?void 0:L.result}:{}};if(I&&w){const i=l(c.originalPrice.value,c.originalPrice.currency),s=l(c.baseOriginalPrice.value*m,c.baseOriginalPrice.currency,{variant:e.discounted?"strikethrough":"default",weight:"bold"}),t=l(c.baseDiscountedPrice.value*m,c.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),x=l(c.baseExcludingTax.value*m,c.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:!0,taxIncluded:void 0,price:i,total:b(v,{children:[s,e.discounted?t:null]}),totalExcludingTax:x}}else if(!I&&w){const i=l(r.originalPrice.value,r.originalPrice.currency),s=l(r.baseOriginalPrice.value*m,r.baseOriginalPrice.currency,{variant:E?"strikethrough":"default",weight:"bold"}),t=l(r.baseDiscountedPrice.value*m,r.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),x=l(r.baseExcludingTax.value*m,r.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:void 0,taxIncluded:void 0,price:i,total:b(v,{children:[s,E?t:null]}),totalExcludingTax:x}}else if(I&&!w){const i=l(g.singleItemPrice.value,g.singleItemPrice.currency),s=l(g.baseOriginalPrice.value*m,g.baseOriginalPrice.currency,{variant:E?"strikethrough":"default",weight:"bold"}),t=l(g.baseDiscountedPrice.value*m,g.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});y={taxExcluded:void 0,taxIncluded:!0,price:i,total:b(v,{children:[s,E?t:null]})}}return a(B,{loading:M,alert:d&&W?b("span",{children:[a(K,{source:G}),h.outOfStock]}):a(v,{}),configurations:(k==null?void 0:k(T))??T,title:u?a("a",{"data-testid":"product-name",className:H(["cart-summary-item__title",["cart-summary-item__title--strikethrough",d]]),href:u(e),children:e==null?void 0:e.productName}):a("div",{"data-testid":"product-name",className:H(["cart-summary-item__title",["cart-summary-item__title--strikethrough",d]]),children:e==null?void 0:e.productName}),sku:a("div",{children:(V=e==null?void 0:e.product)==null?void 0:V.sku}),...$,image:u?a("a",{href:u(e),children:S(e)}):S(e),...y,footer:b(v,{children:[P&&!q?a(Q,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:i=>P==null?void 0:P(Number(i)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0,a(R,{"data-testid":"Footer",name:"Footer",slot:o==null?void 0:o.Footer,context:{item:e}})]})})};export{ee as C,G as S}; diff --git a/scripts/__dropins__/storefront-order/chunks/getStoreConfig.js b/scripts/__dropins__/storefront-order/chunks/getStoreConfig.js index 4337058dc4..b3a305f5d4 100644 --- a/scripts/__dropins__/storefront-order/chunks/getStoreConfig.js +++ b/scripts/__dropins__/storefront-order/chunks/getStoreConfig.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{f as s,h as i}from"./fetch-graphql.js";function o(e){return e?{baseMediaUrl:e.base_media_url,orderCancellationEnabled:e.order_cancellation_enabled,orderCancellationReasons:e.order_cancellation_reasons,shoppingOrderDisplayPrice:e.orders_invoices_credit_memos_display_price,shoppingOrdersDisplaySubtotal:e.orders_invoices_credit_memos_display_subtotal,shoppingOrdersDisplayShipping:e.orders_invoices_credit_memos_display_shipping_amount,shoppingOrdersDisplayGrandTotal:e.orders_invoices_credit_memos_display_grandtotal,shoppingOrdersDisplayFullSummary:e.orders_invoices_credit_memos_display_full_summary,shoppingOrdersDisplayZeroTax:e.orders_invoices_credit_memos_display_zero_tax}:null}const _=` +import{f as s,h as i}from"./fetch-graphql.js";function _(e){return e?{baseMediaUrl:e.base_media_url,orderCancellationEnabled:e.order_cancellation_enabled,orderCancellationReasons:e.order_cancellation_reasons,shoppingOrderDisplayPrice:e.orders_invoices_credit_memos_display_price,shoppingOrdersDisplaySubtotal:e.orders_invoices_credit_memos_display_subtotal,shoppingOrdersDisplayShipping:e.orders_invoices_credit_memos_display_shipping_amount,shoppingOrdersDisplayGrandTotal:e.orders_invoices_credit_memos_display_grandtotal,shoppingOrdersDisplayFullSummary:e.orders_invoices_credit_memos_display_full_summary,shoppingOrdersDisplayZeroTax:e.orders_invoices_credit_memos_display_zero_tax,salesPrintedCard:+e.sales_printed_card,salesGiftWrapping:+e.sales_gift_wrapping}:null}const o=` query STORE_CONFIG_QUERY { storeConfig { order_cancellation_enabled @@ -14,6 +14,8 @@ import{f as s,h as i}from"./fetch-graphql.js";function o(e){return e?{baseMediaU orders_invoices_credit_memos_display_grandtotal orders_invoices_credit_memos_display_full_summary orders_invoices_credit_memos_display_zero_tax + sales_printed_card + sales_gift_wrapping } } -`,l=async()=>s(_,{method:"GET",cache:"force-cache"}).then(({errors:e,data:r})=>e?i(e):o(r.storeConfig));export{l as g}; +`,a=async()=>s(o,{method:"GET",cache:"force-cache"}).then(({errors:e,data:r})=>e?i(e):_(r.storeConfig));export{a as g}; diff --git a/scripts/__dropins__/storefront-order/chunks/initialize.js b/scripts/__dropins__/storefront-order/chunks/initialize.js index 0600a8efbf..4ca610f880 100644 --- a/scripts/__dropins__/storefront-order/chunks/initialize.js +++ b/scripts/__dropins__/storefront-order/chunks/initialize.js @@ -1,10 +1,21 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{merge as z,Initializer as o}from"@dropins/tools/lib.js";import{events as U}from"@dropins/tools/event-bus.js";import{h as Y}from"./network-error.js";import{PRODUCT_DETAILS_FRAGMENT as Q,PRICE_DETAILS_FRAGMENT as K,GIFT_CARD_DETAILS_FRAGMENT as j,ORDER_ITEM_DETAILS_FRAGMENT as V,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as X,ORDER_SUMMARY_FRAGMENT as H,ADDRESS_FRAGMENT as J,RETURNS_FRAGMENT as P,ORDER_ITEM_FRAGMENT as W}from"../fragments.js";import{f as Z,h as r}from"./fetch-graphql.js";const I=n=>n||0,d=n=>{var i,u,_,c,l,t,E,R,g;return{__typename:(n==null?void 0:n.__typename)||"",uid:(n==null?void 0:n.uid)||"",onlyXLeftInStock:(n==null?void 0:n.only_x_left_in_stock)??0,stockStatus:(n==null?void 0:n.stock_status)??"",priceRange:{maximumPrice:{regularPrice:{currency:((_=(u=(i=n==null?void 0:n.price_range)==null?void 0:i.maximum_price)==null?void 0:u.regular_price)==null?void 0:_.currency)??"",value:((t=(l=(c=n==null?void 0:n.price_range)==null?void 0:c.maximum_price)==null?void 0:l.regular_price)==null?void 0:t.value)??0}}},canonicalUrl:(n==null?void 0:n.canonical_url)??"",urlKey:(n==null?void 0:n.url_key)||"",id:(n==null?void 0:n.uid)??"",name:(n==null?void 0:n.name)||"",sku:(n==null?void 0:n.sku)||"",image:((E=n==null?void 0:n.image)==null?void 0:E.url)||"",productType:(n==null?void 0:n.__typename)||"",thumbnail:{label:((R=n==null?void 0:n.thumbnail)==null?void 0:R.label)||"",url:((g=n==null?void 0:n.thumbnail)==null?void 0:g.url)||""}}},nn=n=>{if(!n||!("selected_options"in n))return;const i={};for(const u of n.selected_options)i[u.label]=u.value;return i},un=n=>{const i=n==null?void 0:n.map(_=>({uid:_.uid,label:_.label,values:_.values.map(c=>c.product_name).join(", ")})),u={};return i==null||i.forEach(_=>{u[_.label]=_.values}),Object.keys(u).length>0?u:null},_n=n=>(n==null?void 0:n.length)>0?{count:n.length,result:n.map(i=>i.title).join(", ")}:null,cn=n=>({quantityCanceled:(n==null?void 0:n.quantity_canceled)??0,quantityInvoiced:(n==null?void 0:n.quantity_invoiced)??0,quantityOrdered:(n==null?void 0:n.quantity_ordered)??0,quantityRefunded:(n==null?void 0:n.quantity_refunded)??0,quantityReturned:(n==null?void 0:n.quantity_returned)??0,quantityShipped:(n==null?void 0:n.quantity_shipped)??0,quantityReturnRequested:(n==null?void 0:n.quantity_return_requested)??0}),ln=n=>({firstName:(n==null?void 0:n.firstname)??"",lastName:(n==null?void 0:n.lastname)??"",middleName:(n==null?void 0:n.middlename)??""}),L=n=>{const{firstName:i,lastName:u,middleName:_}=ln(n);return{firstName:i,lastName:u,middleName:_,city:(n==null?void 0:n.city)??"",company:(n==null?void 0:n.company)??"",country:(n==null?void 0:n.country)??"",countryCode:(n==null?void 0:n.country_code)??"",fax:(n==null?void 0:n.fax)??"",postCode:(n==null?void 0:n.postcode)??"",prefix:(n==null?void 0:n.prefix)??"",region:(n==null?void 0:n.region)??"",regionId:(n==null?void 0:n.region_id)??"",street:(n==null?void 0:n.street)??[],suffix:(n==null?void 0:n.suffix)??"",telephone:(n==null?void 0:n.telephone)??"",vatId:(n==null?void 0:n.vat_id)??"",customAttributes:(n==null?void 0:n.custom_attributes)??[]}},an=n=>{const i={value:0,currency:"USD"};return{grandTotal:(n==null?void 0:n.grand_total)??i,totalGiftcard:(n==null?void 0:n.total_giftcard)??i,subtotalExclTax:(n==null?void 0:n.subtotal_excl_tax)??i,subtotalInclTax:(n==null?void 0:n.subtotal_incl_tax)??i,taxes:(n==null?void 0:n.taxes)??[],totalTax:(n==null?void 0:n.total_tax)??i,totalShipping:(n==null?void 0:n.total_shipping)??i,discounts:(n==null?void 0:n.discounts)??[]}},w=n=>{const i={value:0,currency:"USD"},u=(n==null?void 0:n.prices)??{};return{price:(u==null?void 0:u.price)??i,priceIncludingTax:(u==null?void 0:u.price_including_tax)??i,originalPrice:(u==null?void 0:u.original_price)??i,originalPriceIncludingTax:(u==null?void 0:u.original_price_including_tax)??i,discounts:(u==null?void 0:u.discounts)??[]}},sn=(n,i,u)=>{const _=n==null?void 0:n.price,c=n==null?void 0:n.priceIncludingTax,l=n==null?void 0:n.originalPrice,t=u?l==null?void 0:l.value:c==null?void 0:c.value,E={originalPrice:l,baseOriginalPrice:{value:t,currency:l==null?void 0:l.currency},baseDiscountedPrice:{value:c==null?void 0:c.value,currency:c==null?void 0:c.currency},baseExcludingTax:{value:_==null?void 0:_.value,currency:_==null?void 0:_.currency}},R={originalPrice:l,baseOriginalPrice:{value:l==null?void 0:l.value,currency:c==null?void 0:c.currency},baseDiscountedPrice:{value:i==null?void 0:i.value,currency:_==null?void 0:_.currency},baseExcludingTax:{value:_==null?void 0:_.value,currency:_==null?void 0:_.currency}},g={singleItemPrice:{value:u?l.value:c.value,currency:c.currency},baseOriginalPrice:{value:t,currency:c.currency},baseDiscountedPrice:{value:c.value,currency:c.currency}};return{includeAndExcludeTax:E,excludeTax:R,includeTax:g}},tn=n=>{var i,u,_,c,l;return{senderName:((i=n.gift_card)==null?void 0:i.sender_name)||"",senderEmail:((u=n.gift_card)==null?void 0:u.sender_email)||"",recipientEmail:((_=n.gift_card)==null?void 0:_.recipient_email)||"",recipientName:((c=n.gift_card)==null?void 0:c.recipient_name)||"",message:((l=n.gift_card)==null?void 0:l.message)||""}},yn=n=>{var i,u,_,c;return{label:((u=(i=n==null?void 0:n.product)==null?void 0:i.thumbnail)==null?void 0:u.label)||"",url:((c=(_=n==null?void 0:n.product)==null?void 0:_.thumbnail)==null?void 0:c.url)||""}},D=n=>{var q,x,G,k,F,v,A,s,h,f,O,N,S,M,p,C,b,T;const{quantityCanceled:i,quantityInvoiced:u,quantityOrdered:_,quantityRefunded:c,quantityReturned:l,quantityShipped:t,quantityReturnRequested:E}=cn(n),R=w(n),g=((q=n==null?void 0:n.prices)==null?void 0:q.original_price.value)*(n==null?void 0:n.quantity_ordered)>((x=n==null?void 0:n.prices)==null?void 0:x.price.value)*(n==null?void 0:n.quantity_ordered),a=I(n==null?void 0:n.quantity_ordered),y={value:((G=n==null?void 0:n.product_sale_price)==null?void 0:G.value)||0,currency:(k=n==null?void 0:n.product_sale_price)==null?void 0:k.currency};return{selectedOptions:(n==null?void 0:n.selected_options)??[],productSalePrice:n==null?void 0:n.product_sale_price,status:(n==null?void 0:n.status)??"",type:n==null?void 0:n.__typename,eligibleForReturn:(n==null?void 0:n.eligible_for_return)??!1,productSku:(n==null?void 0:n.product_sku)??"",productName:(n==null?void 0:n.product_name)??"",productUrlKey:(n==null?void 0:n.product_url_key)??"",quantityCanceled:i,quantityInvoiced:u,quantityOrdered:_,quantityRefunded:c,quantityReturned:l,quantityShipped:t,quantityReturnRequested:E,id:n==null?void 0:n.id,discounted:g,total:{value:((F=n==null?void 0:n.product_sale_price)==null?void 0:F.value)*(n==null?void 0:n.quantity_ordered)||0,currency:((v=n==null?void 0:n.product_sale_price)==null?void 0:v.currency)||""},totalInclTax:{value:((A=n==null?void 0:n.product_sale_price)==null?void 0:A.value)*(n==null?void 0:n.quantity_ordered)||0,currency:(s=n==null?void 0:n.product_sale_price)==null?void 0:s.currency},price:y,prices:w(n),itemPrices:R,taxCalculations:sn(R,y,g),priceInclTax:{value:((h=n==null?void 0:n.product_sale_price)==null?void 0:h.value)??0,currency:(f=n==null?void 0:n.product_sale_price)==null?void 0:f.currency},totalQuantity:a,regularPrice:{value:(M=(S=(N=(O=n==null?void 0:n.product)==null?void 0:O.price_range)==null?void 0:N.maximum_price)==null?void 0:S.regular_price)==null?void 0:M.value,currency:(T=(b=(C=(p=n==null?void 0:n.product)==null?void 0:p.price_range)==null?void 0:C.maximum_price)==null?void 0:b.regular_price)==null?void 0:T.currency},product:d(n==null?void 0:n.product),thumbnail:yn(n),giftCard:(n==null?void 0:n.__typename)==="GiftCardOrderItem"?tn(n):void 0,configurableOptions:nn(n),bundleOptions:n.__typename==="BundleOrderItem"?un(n.bundle_options):null,downloadableLinks:n.__typename==="DownloadableOrderItem"?_n(n==null?void 0:n.downloadable_links):null}},e=n=>n==null?void 0:n.filter(i=>i.__typename).map(i=>D(i)),Rn=n=>({token:(n==null?void 0:n.token)??"",email:(n==null?void 0:n.email)??"",status:(n==null?void 0:n.status)??"",number:(n==null?void 0:n.number)??"",id:(n==null?void 0:n.id)??"",carrier:n.carrier??"",coupons:(n==null?void 0:n.applied_coupons)??[],orderDate:(n==null?void 0:n.order_date)??"",isVirtual:(n==null?void 0:n.is_virtual)??!1,availableActions:(n==null?void 0:n.available_actions)??[],orderStatusChangeDate:(n==null?void 0:n.order_status_change_date)??"",shippingMethod:(n==null?void 0:n.shipping_method)??""}),B=(n,i)=>{var s,h,f,O,N,S,M,p,C;const u=Rn(n),_=L(n==null?void 0:n.billing_address),c=L(n==null?void 0:n.shipping_address),l=(s=n.shipments)==null?void 0:s.map(b=>({...b,items:b.items.map(T=>({id:T.id,productName:T.product_name,productSku:T.product_sku,quantityShipped:T.quantity_shipped,orderItem:D(T.order_item)}))})),t=e(n.items),E=((h=gn(n==null?void 0:n.returns))==null?void 0:h.ordersReturn)??[],R=i?E.filter(b=>b.returnNumber===i):E,g=e(n.items_eligible_for_return),a=an(n==null?void 0:n.total),y=(f=n==null?void 0:n.payment_methods)==null?void 0:f[0],q=n==null?void 0:n.shipping_method,x=t==null?void 0:t.reduce((b,T)=>b+(T==null?void 0:T.totalQuantity),0),G={amount:((O=a==null?void 0:a.totalShipping)==null?void 0:O.value)??0,currency:((N=a==null?void 0:a.totalShipping)==null?void 0:N.currency)||"",code:(u==null?void 0:u.shippingMethod)??""},k=[{code:(y==null?void 0:y.type)??"",name:(y==null?void 0:y.name)??""}],F=a==null?void 0:a.subtotalExclTax,v=a==null?void 0:a.subtotalInclTax,A={...u,...a,subtotalExclTax:F,subtotalInclTax:v,billingAddress:_,shippingAddress:c,shipments:l,items:t,returns:R,itemsEligibleForReturn:g,totalQuantity:x,shippingMethod:q,shipping:G,payments:k};return z(A,(C=(p=(M=(S=$==null?void 0:$.getConfig())==null?void 0:S.models)==null?void 0:M.OrderDataModel)==null?void 0:p.transformer)==null?void 0:C.call(p,n))},En=(n,i,u)=>{var _,c,l,t,E,R,g;if((t=(l=(c=(_=i==null?void 0:i.data)==null?void 0:_.customer)==null?void 0:c.orders)==null?void 0:l.items)!=null&&t.length&&n==="orderData"){const a=(g=(R=(E=i==null?void 0:i.data)==null?void 0:E.customer)==null?void 0:R.orders)==null?void 0:g.items[0];return B(a,u)}return null},gn=n=>{var l,t,E,R,g;if(!((l=n==null?void 0:n.items)!=null&&l.length))return null;const i=n==null?void 0:n.items,u=n==null?void 0:n.page_info,c={ordersReturn:[...i].sort((a,y)=>+y.number-+a.number).map(a=>{var v,A;const{order:y,status:q,number:x,created_at:G}=a,k=((A=(v=a==null?void 0:a.shipping)==null?void 0:v.tracking)==null?void 0:A.map(s=>{const{status:h,carrier:f,tracking_number:O}=s;return{status:h,carrier:f,trackingNumber:O}}))??[],F=a.items.map(s=>{var p;const h=s==null?void 0:s.quantity,f=s==null?void 0:s.status,O=s==null?void 0:s.request_quantity,N=s==null?void 0:s.uid,S=s==null?void 0:s.order_item,M=((p=e([S]))==null?void 0:p.reduce((C,b)=>b,{}))??{};return{uid:N,quantity:h,status:f,requestQuantity:O,...M}});return{createdReturnAt:G,returnStatus:q,token:y==null?void 0:y.token,orderNumber:y==null?void 0:y.number,returnNumber:x,items:F,tracking:k}}),...u?{pageInfo:{pageSize:u.page_size,totalPages:u.total_pages,currentPage:u.current_page}}:{}};return z(c,(g=(R=(E=(t=$==null?void 0:$.getConfig())==null?void 0:t.models)==null?void 0:E.CustomerOrdersReturnModel)==null?void 0:R.transformer)==null?void 0:g.call(R,{...i,...u}))},xn=(n,i)=>{var _,c;if(!((_=n==null?void 0:n.data)!=null&&_.guestOrder))return null;const u=(c=n==null?void 0:n.data)==null?void 0:c.guestOrder;return B(u,i)},Tn=(n,i)=>{var _,c;if(!((_=n==null?void 0:n.data)!=null&&_.guestOrderByToken))return null;const u=(c=n==null?void 0:n.data)==null?void 0:c.guestOrderByToken;return B(u,i)},bn=` +import{merge as j,Initializer as gn}from"@dropins/tools/lib.js";import{events as B}from"@dropins/tools/event-bus.js";import{h as V}from"./network-error.js";import{PRODUCT_DETAILS_FRAGMENT as X,PRICE_DETAILS_FRAGMENT as H,GIFT_CARD_DETAILS_FRAGMENT as J,ORDER_ITEM_DETAILS_FRAGMENT as Z,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as m,ORDER_SUMMARY_FRAGMENT as D,ADDRESS_FRAGMENT as r,RETURNS_FRAGMENT as o,ORDER_ITEM_FRAGMENT as I,GIFT_WRAPPING_FRAGMENT as d,GIFT_MESSAGE_FRAGMENT as nn,APPLIED_GIFT_CARDS_FRAGMENT as un}from"../fragments.js";import{f as _n,h as yn}from"./fetch-graphql.js";const Rn=n=>n||0,En=n=>{var i,u,_,c,l,p,y,g,E;return{__typename:(n==null?void 0:n.__typename)||"",uid:(n==null?void 0:n.uid)||"",onlyXLeftInStock:(n==null?void 0:n.only_x_left_in_stock)??0,stockStatus:(n==null?void 0:n.stock_status)??"",priceRange:{maximumPrice:{regularPrice:{currency:((_=(u=(i=n==null?void 0:n.price_range)==null?void 0:i.maximum_price)==null?void 0:u.regular_price)==null?void 0:_.currency)??"",value:((p=(l=(c=n==null?void 0:n.price_range)==null?void 0:c.maximum_price)==null?void 0:l.regular_price)==null?void 0:p.value)??0}}},canonicalUrl:(n==null?void 0:n.canonical_url)??"",urlKey:(n==null?void 0:n.url_key)||"",id:(n==null?void 0:n.uid)??"",name:(n==null?void 0:n.name)||"",sku:(n==null?void 0:n.sku)||"",image:((y=n==null?void 0:n.image)==null?void 0:y.url)||"",productType:(n==null?void 0:n.__typename)||"",thumbnail:{label:((g=n==null?void 0:n.thumbnail)==null?void 0:g.label)||"",url:((E=n==null?void 0:n.thumbnail)==null?void 0:E.url)||""}}},tn=n=>{if(!n||!("selected_options"in n))return;const i={};for(const u of n.selected_options)i[u.label]=u.value;return i},Tn=n=>{const i=n==null?void 0:n.map(_=>({uid:_.uid,label:_.label,values:_.values.map(c=>c.product_name).join(", ")})),u={};return i==null||i.forEach(_=>{u[_.label]=_.values}),Object.keys(u).length>0?u:null},en=n=>(n==null?void 0:n.length)>0?{count:n.length,result:n.map(i=>i.title).join(", ")}:null,fn=n=>({quantityCanceled:(n==null?void 0:n.quantity_canceled)??0,quantityInvoiced:(n==null?void 0:n.quantity_invoiced)??0,quantityOrdered:(n==null?void 0:n.quantity_ordered)??0,quantityRefunded:(n==null?void 0:n.quantity_refunded)??0,quantityReturned:(n==null?void 0:n.quantity_returned)??0,quantityShipped:(n==null?void 0:n.quantity_shipped)??0,quantityReturnRequested:(n==null?void 0:n.quantity_return_requested)??0}),an=n=>({firstName:(n==null?void 0:n.firstname)??"",lastName:(n==null?void 0:n.lastname)??"",middleName:(n==null?void 0:n.middlename)??""}),Q=n=>{const{firstName:i,lastName:u,middleName:_}=an(n);return{firstName:i,lastName:u,middleName:_,city:(n==null?void 0:n.city)??"",company:(n==null?void 0:n.company)??"",country:(n==null?void 0:n.country)??"",countryCode:(n==null?void 0:n.country_code)??"",fax:(n==null?void 0:n.fax)??"",postCode:(n==null?void 0:n.postcode)??"",prefix:(n==null?void 0:n.prefix)??"",region:(n==null?void 0:n.region)??"",regionId:(n==null?void 0:n.region_id)??"",street:(n==null?void 0:n.street)??[],suffix:(n==null?void 0:n.suffix)??"",telephone:(n==null?void 0:n.telephone)??"",vatId:(n==null?void 0:n.vat_id)??"",customAttributes:(n==null?void 0:n.custom_attributes)??[]}},bn=n=>{const i={value:0,currency:"USD"};return{grandTotal:(n==null?void 0:n.grand_total)??i,totalGiftCard:(n==null?void 0:n.total_giftcard)??i,subtotalExclTax:(n==null?void 0:n.subtotal_excl_tax)??i,subtotalInclTax:(n==null?void 0:n.subtotal_incl_tax)??i,taxes:(n==null?void 0:n.taxes)??[],totalTax:(n==null?void 0:n.total_tax)??i,totalShipping:(n==null?void 0:n.total_shipping)??i,discounts:(n==null?void 0:n.discounts)??[]}},K=n=>{const i={value:0,currency:"USD"},u=(n==null?void 0:n.prices)??{};return{price:(u==null?void 0:u.price)??i,priceIncludingTax:(u==null?void 0:u.price_including_tax)??i,originalPrice:(u==null?void 0:u.original_price)??i,originalPriceIncludingTax:(u==null?void 0:u.original_price_including_tax)??i,discounts:(u==null?void 0:u.discounts)??[]}},An=(n,i,u)=>{const _=n==null?void 0:n.price,c=n==null?void 0:n.priceIncludingTax,l=n==null?void 0:n.originalPrice,p=u?l==null?void 0:l.value:c==null?void 0:c.value,y={originalPrice:l,baseOriginalPrice:{value:p,currency:l==null?void 0:l.currency},baseDiscountedPrice:{value:c==null?void 0:c.value,currency:c==null?void 0:c.currency},baseExcludingTax:{value:_==null?void 0:_.value,currency:_==null?void 0:_.currency}},g={originalPrice:l,baseOriginalPrice:{value:l==null?void 0:l.value,currency:c==null?void 0:c.currency},baseDiscountedPrice:{value:i==null?void 0:i.value,currency:_==null?void 0:_.currency},baseExcludingTax:{value:_==null?void 0:_.value,currency:_==null?void 0:_.currency}},E={singleItemPrice:{value:u?l.value:c.value,currency:c.currency},baseOriginalPrice:{value:p,currency:c.currency},baseDiscountedPrice:{value:c.value,currency:c.currency}};return{includeAndExcludeTax:y,excludeTax:g,includeTax:E}},vn=n=>{var i,u,_,c,l;return{senderName:((i=n.gift_card)==null?void 0:i.sender_name)||"",senderEmail:((u=n.gift_card)==null?void 0:u.sender_email)||"",recipientEmail:((_=n.gift_card)==null?void 0:_.recipient_email)||"",recipientName:((c=n.gift_card)==null?void 0:c.recipient_name)||"",message:((l=n.gift_card)==null?void 0:l.message)||""}},hn=n=>{var i,u,_,c;return{label:((u=(i=n==null?void 0:n.product)==null?void 0:i.thumbnail)==null?void 0:u.label)||"",url:((c=(_=n==null?void 0:n.product)==null?void 0:_.thumbnail)==null?void 0:c.url)||""}};function Nn(n){return{currency:(n==null?void 0:n.currency)??"USD",value:(n==null?void 0:n.value)??0}}function cn(n){var i,u,_;return{senderName:((i=n==null?void 0:n.gift_message)==null?void 0:i.from)??"",recipientName:((u=n==null?void 0:n.gift_message)==null?void 0:u.to)??"",message:((_=n==null?void 0:n.gift_message)==null?void 0:_.message)??""}}function ln(n){var i,u,_,c,l,p,y,g,E,t,s;return{design:((i=n==null?void 0:n.gift_wrapping)==null?void 0:i.design)??"",uid:(u=n==null?void 0:n.gift_wrapping)==null?void 0:u.uid,selected:!!((_=n==null?void 0:n.gift_wrapping)!=null&&_.uid),image:{url:((l=(c=n==null?void 0:n.gift_wrapping)==null?void 0:c.image)==null?void 0:l.url)??"",label:((y=(p=n==null?void 0:n.gift_wrapping)==null?void 0:p.image)==null?void 0:y.label)??""},price:{currency:((E=(g=n==null?void 0:n.gift_wrapping)==null?void 0:g.price)==null?void 0:E.currency)??"USD",value:((s=(t=n==null?void 0:n.gift_wrapping)==null?void 0:t.price)==null?void 0:s.value)??0}}}const sn=n=>{var T,e,f,F,x,N,S,R,b,A,v,q,O,G,h,k,M,U,C;const{quantityCanceled:i,quantityInvoiced:u,quantityOrdered:_,quantityRefunded:c,quantityReturned:l,quantityShipped:p,quantityReturnRequested:y}=fn(n),g=K(n),E=((T=n==null?void 0:n.prices)==null?void 0:T.original_price.value)*(n==null?void 0:n.quantity_ordered)>((e=n==null?void 0:n.prices)==null?void 0:e.price.value)*(n==null?void 0:n.quantity_ordered),t=Rn(n==null?void 0:n.quantity_ordered),s={value:((f=n==null?void 0:n.product_sale_price)==null?void 0:f.value)||0,currency:(F=n==null?void 0:n.product_sale_price)==null?void 0:F.currency};return{giftMessage:cn(n),giftWrappingPrice:Nn((x=n==null?void 0:n.product)==null?void 0:x.gift_wrapping_price),productGiftWrapping:[ln(n)],selectedOptions:(n==null?void 0:n.selected_options)??[],productSalePrice:n==null?void 0:n.product_sale_price,status:(n==null?void 0:n.status)??"",type:n==null?void 0:n.__typename,eligibleForReturn:(n==null?void 0:n.eligible_for_return)??!1,productSku:(n==null?void 0:n.product_sku)??"",productName:(n==null?void 0:n.product_name)??"",productUrlKey:(n==null?void 0:n.product_url_key)??"",quantityCanceled:i,quantityInvoiced:u,quantityOrdered:_,quantityRefunded:c,quantityReturned:l,quantityShipped:p,quantityReturnRequested:y,id:n==null?void 0:n.id,discounted:E,total:{value:((N=n==null?void 0:n.product_sale_price)==null?void 0:N.value)*(n==null?void 0:n.quantity_ordered)||0,currency:((S=n==null?void 0:n.product_sale_price)==null?void 0:S.currency)||""},totalInclTax:{value:((R=n==null?void 0:n.product_sale_price)==null?void 0:R.value)*(n==null?void 0:n.quantity_ordered)||0,currency:(b=n==null?void 0:n.product_sale_price)==null?void 0:b.currency},price:s,prices:K(n),itemPrices:g,taxCalculations:An(g,s,E),priceInclTax:{value:((A=n==null?void 0:n.product_sale_price)==null?void 0:A.value)??0,currency:(v=n==null?void 0:n.product_sale_price)==null?void 0:v.currency},totalQuantity:t,regularPrice:{value:(h=(G=(O=(q=n==null?void 0:n.product)==null?void 0:q.price_range)==null?void 0:O.maximum_price)==null?void 0:G.regular_price)==null?void 0:h.value,currency:(C=(U=(M=(k=n==null?void 0:n.product)==null?void 0:k.price_range)==null?void 0:M.maximum_price)==null?void 0:U.regular_price)==null?void 0:C.currency},product:En(n==null?void 0:n.product),thumbnail:hn(n),giftCard:(n==null?void 0:n.__typename)==="GiftCardOrderItem"?vn(n):void 0,configurableOptions:tn(n),bundleOptions:n.__typename==="BundleOrderItem"?Tn(n.bundle_options):null,downloadableLinks:n.__typename==="DownloadableOrderItem"?en(n==null?void 0:n.downloadable_links):null}},P=n=>n==null?void 0:n.filter(i=>i.__typename).map(i=>sn(i)),Sn=n=>{var i,u,_,c,l;return{token:(n==null?void 0:n.token)??"",email:(n==null?void 0:n.email)??"",status:(n==null?void 0:n.status)??"",number:(n==null?void 0:n.number)??"",id:(n==null?void 0:n.id)??"",carrier:n.carrier??"",coupons:(n==null?void 0:n.applied_coupons)??[],orderDate:(n==null?void 0:n.order_date)??"",isVirtual:(n==null?void 0:n.is_virtual)??!1,availableActions:(n==null?void 0:n.available_actions)??[],orderStatusChangeDate:(n==null?void 0:n.order_status_change_date)??"",shippingMethod:(n==null?void 0:n.shipping_method)??"",giftWrappingOrder:{price:{value:((u=(i=n==null?void 0:n.gift_wrapping)==null?void 0:i.price)==null?void 0:u.value)??0,currency:((c=(_=n==null?void 0:n.gift_wrapping)==null?void 0:_.price)==null?void 0:c.currency)??"USD"},uid:((l=n==null?void 0:n.gift_wrapping)==null?void 0:l.uid)??""}}},Gn=n=>{var u,_,c,l,p,y,g,E,t,s,T,e,f;const i=(u=n==null?void 0:n.total)==null?void 0:u.gift_options;return{giftWrappingForItems:{value:((_=i==null?void 0:i.gift_wrapping_for_items)==null?void 0:_.value)??0,currency:((c=i==null?void 0:i.gift_wrapping_for_items)==null?void 0:c.currency)??"USD"},giftWrappingForItemsInclTax:{value:((l=i==null?void 0:i.gift_wrapping_for_items_incl_tax)==null?void 0:l.value)??0,currency:((p=i==null?void 0:i.gift_wrapping_for_items_incl_tax)==null?void 0:p.currency)??"USD"},giftWrappingForOrder:{value:((y=i==null?void 0:i.gift_wrapping_for_order)==null?void 0:y.value)??0,currency:((g=i==null?void 0:i.gift_wrapping_for_order)==null?void 0:g.currency)??"USD"},giftWrappingForOrderInclTax:{value:((E=i==null?void 0:i.gift_wrapping_for_order_incl_tax)==null?void 0:E.value)??0,currency:((t=i==null?void 0:i.gift_wrapping_for_order_incl_tax)==null?void 0:t.currency)??"USD"},printedCard:{value:((s=i==null?void 0:i.printed_card)==null?void 0:s.value)??0,currency:((T=i==null?void 0:i.printed_card)==null?void 0:T.currency)??"USD"},printedCardInclTax:{value:((e=i==null?void 0:i.printed_card_incl_tax)==null?void 0:e.value)??0,currency:((f=i==null?void 0:i.printed_card_incl_tax)==null?void 0:f.currency)??"USD"}}},Mn=(n=[])=>n?n==null?void 0:n.map(i=>{var u,_;return{code:(i==null?void 0:i.code)??"",appliedBalance:{value:((u=i.applied_balance)==null?void 0:u.value)??0,currency:((_=i.applied_balance)==null?void 0:_.currency)??"USD"}}}):[],W=(n,i)=>{var G,h,k,M,U,C,z,L,Y;const u=Sn(n),_=Q(n==null?void 0:n.billing_address),c=Q(n==null?void 0:n.shipping_address),l=(G=n.shipments)==null?void 0:G.map(w=>({...w,items:w.items.map(a=>({id:a.id,productName:a.product_name,productSku:a.product_sku,quantityShipped:a.quantity_shipped,orderItem:sn(a.order_item)}))})),p=Mn(n==null?void 0:n.applied_gift_cards),y=P(n.items),g=((h=xn(n==null?void 0:n.returns))==null?void 0:h.ordersReturn)??[],E=i?g.filter(w=>w.returnNumber===i):g,t=P(n.items_eligible_for_return),s=bn(n==null?void 0:n.total),T=(k=n==null?void 0:n.payment_methods)==null?void 0:k[0],e=n==null?void 0:n.shipping_method,f=y==null?void 0:y.reduce((w,a)=>w+(a==null?void 0:a.totalQuantity),0),F={amount:((M=s==null?void 0:s.totalShipping)==null?void 0:M.value)??0,currency:((U=s==null?void 0:s.totalShipping)==null?void 0:U.currency)||"",code:(u==null?void 0:u.shippingMethod)??""},x=[{code:(T==null?void 0:T.type)??"",name:(T==null?void 0:T.name)??""}],N=s==null?void 0:s.subtotalExclTax,S=s==null?void 0:s.subtotalInclTax,R=Gn(n),b=cn(n),A=[ln(n)],v=(n==null?void 0:n.printed_card_included)??!1,q=(n==null?void 0:n.gift_receipt_included)??!1,O={...u,...s,giftMessage:b,cartGiftWrapping:A,printedCardIncluded:v,giftReceiptIncluded:q,appliedGiftCards:p,totalGiftOptions:R,subtotalExclTax:N,subtotalInclTax:S,billingAddress:_,shippingAddress:c,shipments:l,items:y,returns:E,itemsEligibleForReturn:t,totalQuantity:f,shippingMethod:e,shipping:F,payments:x};return j(O,(Y=(L=(z=(C=$==null?void 0:$.getConfig())==null?void 0:C.models)==null?void 0:z.OrderDataModel)==null?void 0:L.transformer)==null?void 0:Y.call(L,n))},Fn=(n,i,u)=>{var _,c,l,p,y,g,E;if((p=(l=(c=(_=i==null?void 0:i.data)==null?void 0:_.customer)==null?void 0:c.orders)==null?void 0:l.items)!=null&&p.length&&n==="orderData"){const t=(E=(g=(y=i==null?void 0:i.data)==null?void 0:y.customer)==null?void 0:g.orders)==null?void 0:E.items[0];return W(t,u)}return null},xn=n=>{var l,p,y,g,E;if(!((l=n==null?void 0:n.items)!=null&&l.length))return null;const i=n==null?void 0:n.items,u=n==null?void 0:n.page_info,c={ordersReturn:[...i].sort((t,s)=>+s.number-+t.number).map(t=>{var N,S;const{order:s,status:T,number:e,created_at:f}=t,F=((S=(N=t==null?void 0:t.shipping)==null?void 0:N.tracking)==null?void 0:S.map(R=>{const{status:b,carrier:A,tracking_number:v}=R;return{status:b,carrier:A,trackingNumber:v}}))??[],x=t.items.map(R=>{var h;const b=R==null?void 0:R.quantity,A=R==null?void 0:R.status,v=R==null?void 0:R.request_quantity,q=R==null?void 0:R.uid,O=R==null?void 0:R.order_item,G=((h=P([O]))==null?void 0:h.reduce((k,M)=>M,{}))??{};return{uid:q,quantity:b,status:A,requestQuantity:v,...G}});return{createdReturnAt:f,returnStatus:T,token:s==null?void 0:s.token,orderNumber:s==null?void 0:s.number,returnNumber:e,items:x,tracking:F}}),...u?{pageInfo:{pageSize:u.page_size,totalPages:u.total_pages,currentPage:u.current_page}}:{}};return j(c,(E=(g=(y=(p=$==null?void 0:$.getConfig())==null?void 0:p.models)==null?void 0:y.CustomerOrdersReturnModel)==null?void 0:g.transformer)==null?void 0:E.call(g,{...i,...u}))},Yn=(n,i)=>{var _,c;if(!((_=n==null?void 0:n.data)!=null&&_.guestOrder))return null;const u=(c=n==null?void 0:n.data)==null?void 0:c.guestOrder;return W(u,i)},qn=(n,i)=>{var _,c;if(!((_=n==null?void 0:n.data)!=null&&_.guestOrderByToken))return null;const u=(c=n==null?void 0:n.data)==null?void 0:c.guestOrderByToken;return W(u,i)},On=` query ORDER_BY_NUMBER($orderNumber: String!, $pageSize: Int) { customer { orders(filter: { number: { eq: $orderNumber } }) { items { + gift_receipt_included + printed_card_included + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + applied_gift_cards { + ...APPLIED_GIFT_CARDS_FRAGMENT + } email available_actions status @@ -72,18 +83,32 @@ import{merge as z,Initializer as o}from"@dropins/tools/lib.js";import{events as } } } - ${Q} - ${K} - ${j} - ${V} ${X} ${H} ${J} - ${P} - ${W} -`,pn=async({orderId:n,returnRef:i,queryType:u,returnsPageSize:_=50})=>await Z(bn,{method:"GET",cache:"force-cache",variables:{orderNumber:n,pageSize:_}}).then(c=>En(u??"orderData",c,i)).catch(Y),hn=` + ${Z} + ${m} + ${D} + ${r} + ${o} + ${I} + ${d} + ${nn} + ${un} +`,kn=async({orderId:n,returnRef:i,queryType:u,returnsPageSize:_=50})=>await _n(On,{method:"GET",cache:"force-cache",variables:{orderNumber:n,pageSize:_}}).then(c=>Fn(u??"orderData",c,i)).catch(V),wn=` query ORDER_BY_TOKEN($token: String!) { guestOrderByToken(input: { token: $token }) { + printed_card_included + gift_receipt_included + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + applied_gift_cards { + ...APPLIED_GIFT_CARDS_FRAGMENT + } email id number @@ -93,8 +118,7 @@ import{merge as z,Initializer as o}from"@dropins/tools/lib.js";import{events as token carrier shipping_method - printed_card_included - gift_receipt_included + available_actions is_virtual items_eligible_for_return { @@ -154,13 +178,16 @@ import{merge as z,Initializer as o}from"@dropins/tools/lib.js";import{events as } } } - ${Q} - ${K} - ${j} - ${V} ${X} ${H} ${J} - ${P} - ${W} -`,fn=async(n,i)=>await Z(hn,{method:"GET",cache:"no-cache",variables:{token:n}}).then(u=>{var _;return(_=u.errors)!=null&&_.length&&u.errors[0].message==="Please login to view the order."?r(u.errors):Tn(u,i)}).catch(Y),On="orderData",vn=async n=>{var t;const i=typeof(n==null?void 0:n.orderRef)=="string"?n==null?void 0:n.orderRef:"",u=typeof(n==null?void 0:n.returnRef)=="string"?n==null?void 0:n.returnRef:"",_=i&&typeof(n==null?void 0:n.orderRef)=="string"&&((t=n==null?void 0:n.orderRef)==null?void 0:t.length)>20,c=(n==null?void 0:n.orderData)??null;if(c){U.emit("order/data",{...c,returnNumber:u});return}if(!i)return;const l=_?await fn(i,u):await pn({orderId:i,returnRef:u,queryType:On});l?U.emit("order/data",{...l,returnNumber:u}):U.emit("order/error",{source:"order",type:"network",error:"The data was not received."})},m=new o({init:async n=>{const i={};m.config.setConfig({...i,...n}),vn(n??{}).catch(console.error)},listeners:()=>[]}),$=m.config;export{B as a,xn as b,fn as c,$ as d,pn as g,m as i,gn as t}; + ${Z} + ${m} + ${D} + ${r} + ${o} + ${I} + ${d} + ${nn} + ${un} +`,$n=async(n,i)=>await _n(wn,{method:"GET",cache:"no-cache",variables:{token:n}}).then(u=>{var _;return(_=u.errors)!=null&&_.length&&u.errors[0].message==="Please login to view the order."?yn(u.errors):qn(u,i)}).catch(V),Un="orderData",Cn=async n=>{var p;const i=typeof(n==null?void 0:n.orderRef)=="string"?n==null?void 0:n.orderRef:"",u=typeof(n==null?void 0:n.returnRef)=="string"?n==null?void 0:n.returnRef:"",_=i&&typeof(n==null?void 0:n.orderRef)=="string"&&((p=n==null?void 0:n.orderRef)==null?void 0:p.length)>20,c=(n==null?void 0:n.orderData)??null;if(c){B.emit("order/data",{...c,returnNumber:u});return}if(!i)return;const l=_?await $n(i,u):await kn({orderId:i,returnRef:u,queryType:Un});l?B.emit("order/data",{...l,returnNumber:u}):B.emit("order/error",{source:"order",type:"network",error:"The data was not received."})},pn=new gn({init:async n=>{const i={};pn.config.setConfig({...i,...n}),Cn(n??{}).catch(console.error)},listeners:()=>[]}),$=pn.config;export{W as a,Yn as b,$n as c,$ as d,kn as g,pn as i,xn as t}; diff --git a/scripts/__dropins__/storefront-order/chunks/requestGuestOrderCancel.js b/scripts/__dropins__/storefront-order/chunks/requestGuestOrderCancel.js index f98da52770..2873a62879 100644 --- a/scripts/__dropins__/storefront-order/chunks/requestGuestOrderCancel.js +++ b/scripts/__dropins__/storefront-order/chunks/requestGuestOrderCancel.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{PRODUCT_DETAILS_FRAGMENT as T,PRICE_DETAILS_FRAGMENT as i,GIFT_CARD_DETAILS_FRAGMENT as d,ORDER_ITEM_DETAILS_FRAGMENT as A,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as c,ORDER_SUMMARY_FRAGMENT as D,ADDRESS_FRAGMENT as u,ORDER_ITEM_FRAGMENT as M,GUEST_ORDER_FRAGMENT as N}from"../fragments.js";import{f as a,h as R}from"./fetch-graphql.js";import{a as s}from"./initialize.js";const G=` +import{PRODUCT_DETAILS_FRAGMENT as s,PRICE_DETAILS_FRAGMENT as i,GIFT_CARD_DETAILS_FRAGMENT as A,ORDER_ITEM_DETAILS_FRAGMENT as d,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as c,ORDER_SUMMARY_FRAGMENT as D,ADDRESS_FRAGMENT as G,ORDER_ITEM_FRAGMENT as u,GIFT_WRAPPING_FRAGMENT as M,GIFT_MESSAGE_FRAGMENT as N,GUEST_ORDER_FRAGMENT as O}from"../fragments.js";import{f as R,h as a}from"./fetch-graphql.js";import{a as T}from"./initialize.js";const m=` mutation CANCEL_ORDER_MUTATION($orderId: ID!, $reason: String!) { cancelOrder(input: { order_id: $orderId, reason: $reason }) { error @@ -63,15 +63,17 @@ import{PRODUCT_DETAILS_FRAGMENT as T,PRICE_DETAILS_FRAGMENT as i,GIFT_CARD_DETAI } } } - ${T} + ${s} ${i} - ${d} ${A} + ${d} ${c} ${D} + ${G} ${u} ${M} -`,I=async(r,e,E,t)=>{if(!r)throw new Error("No order ID found");if(!e)throw new Error("No reason found");return a(G,{variables:{orderId:r,reason:e}}).then(({errors:n,data:o})=>{if(n)return R(n);if(o.cancelOrder.error!=null){t();return}const _=s(o.cancelOrder.order);E(_)}).catch(()=>t())},O=` + ${N} +`,p=async(r,e,n,t)=>{if(!r)throw new Error("No order ID found");if(!e)throw new Error("No reason found");return R(m,{variables:{orderId:r,reason:e}}).then(({errors:E,data:_})=>{if(E)return a(E);if(_.cancelOrder.error!=null){t();return}const o=T(_.cancelOrder.order);n(o)}).catch(()=>t())},I=` mutation REQUEST_GUEST_ORDER_CANCEL_MUTATION( $token: String! $reason: String! @@ -83,5 +85,5 @@ import{PRODUCT_DETAILS_FRAGMENT as T,PRICE_DETAILS_FRAGMENT as i,GIFT_CARD_DETAI } } } - ${N} -`,p=async(r,e,E,t)=>{if(!r)throw new Error("No order token found");if(!e)throw new Error("No reason found");return a(O,{variables:{token:r,reason:e}}).then(({errors:n,data:o})=>{if(n)return R(n);o.requestGuestOrderCancel.error!=null&&t();const _=s(o.requestGuestOrderCancel.order);E(_)}).catch(()=>t())};export{I as c,p as r}; + ${O} +`,f=async(r,e,n,t)=>{if(!r)throw new Error("No order token found");if(!e)throw new Error("No reason found");return R(I,{variables:{token:r,reason:e}}).then(({errors:E,data:_})=>{if(E)return a(E);_.requestGuestOrderCancel.error!=null&&t();const o=T(_.requestGuestOrderCancel.order);n(o)}).catch(()=>t())};export{p as c,f as r}; diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks.d.ts deleted file mode 100644 index 1c01bb58dd..0000000000 --- a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { OrderDataModel } from '../../data/models'; -import { TaxTypes } from '../../types'; - -type translationsTypes = Record; -export declare const Subtotal: ({ translations, order, subtotalInclTax, subtotalExclTax, shoppingOrdersDisplaySubtotal, }: { - translations: translationsTypes; - order?: OrderDataModel | undefined; - subtotalInclTax: number; - subtotalExclTax: number; - shoppingOrdersDisplaySubtotal: TaxTypes; -}) => import("preact").JSX.Element; -export declare const Shipping: ({ translations, shoppingOrdersDisplayShipping, order, totalShipping, }: { - totalShipping: number; - shoppingOrdersDisplayShipping: TaxTypes; - order: OrderDataModel; - translations: translationsTypes; -}) => import("preact").JSX.Element | null; -export declare const Discounts: ({ translations, order, totalGiftcardValue, totalGiftcardCurrency, }: { - totalGiftcardValue: number; - totalGiftcardCurrency: string; - order: OrderDataModel; - translations: translationsTypes; -}) => import("preact").JSX.Element | null; -export declare const Coupons: ({ order }: { - order: OrderDataModel; -}) => import("preact").JSX.Element; -export declare const AccordionTax: ({ translations, renderTaxAccordion, totalAccordionTaxValue, order, }: { - translations: translationsTypes; - order: OrderDataModel; - renderTaxAccordion: boolean; - totalAccordionTaxValue: number; -}) => import("preact").JSX.Element; -export declare const Total: ({ translations, shoppingOrdersDisplaySubtotal, order, }: { - translations: translationsTypes; - order?: OrderDataModel | undefined; - shoppingOrdersDisplaySubtotal: TaxTypes; -}) => import("preact").JSX.Element; -export {}; -//# sourceMappingURL=Blocks.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Discounts.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Discounts.d.ts new file mode 100644 index 0000000000..dc6e72341c --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Discounts.d.ts @@ -0,0 +1,9 @@ +import { OrderDataModel } from '../../../data/models'; + +type translationsTypes = Record; +export declare const Discounts: ({ translations, order, }: { + order: OrderDataModel; + translations: translationsTypes; +}) => import("preact").JSX.Element | null; +export {}; +//# sourceMappingURL=Discounts.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/GiftCards.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/GiftCards.d.ts new file mode 100644 index 0000000000..f236889f9b --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/GiftCards.d.ts @@ -0,0 +1,8 @@ +import { OrderDataModel } from '../../../data/models'; + +export declare const GiftCards: ({ totalGiftCardValue, totalGiftCardCurrency, order, }: { + order: OrderDataModel; + totalGiftCardValue: number; + totalGiftCardCurrency: string; +}) => import("preact").JSX.Element | null; +//# sourceMappingURL=GiftCards.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/GiftWrapping.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/GiftWrapping.d.ts new file mode 100644 index 0000000000..66535650dd --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/GiftWrapping.d.ts @@ -0,0 +1,11 @@ +import { MoneyProps, TaxTypes } from '../../../types'; + +export declare const GiftWrapping: ({ salesGiftWrapping, giftWrappingPrice, giftWrappingPriceInclTax, giftWrappingTitle, giftWrappingExclTaxText, giftWrappingInclTaxText, }: { + salesGiftWrapping?: TaxTypes | undefined; + giftWrappingPrice: MoneyProps; + giftWrappingPriceInclTax: MoneyProps; + giftWrappingTitle: string; + giftWrappingExclTaxText: string; + giftWrappingInclTaxText: string; +}) => import("preact").JSX.Element | null; +//# sourceMappingURL=GiftWrapping.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/PrintedCard.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/PrintedCard.d.ts new file mode 100644 index 0000000000..751b7dbd38 --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/PrintedCard.d.ts @@ -0,0 +1,11 @@ +import { OrderDataModel } from '../../../data/models'; +import { TaxTypes } from '../../../types'; + +type translationsTypes = Record; +export declare const PrintedCard: ({ translations, order, salesPrintedCard, }: { + translations: translationsTypes; + order?: OrderDataModel | undefined; + salesPrintedCard?: TaxTypes | undefined; +}) => import("preact").JSX.Element | null; +export {}; +//# sourceMappingURL=PrintedCard.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Shipping.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Shipping.d.ts new file mode 100644 index 0000000000..68e28b3b3c --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Shipping.d.ts @@ -0,0 +1,12 @@ +import { OrderDataModel } from '../../../data/models'; +import { TaxTypes } from '../../../types'; + +type translationsTypes = Record; +export declare const Shipping: ({ translations, shoppingOrdersDisplayShipping, order, totalShipping, }: { + totalShipping: number; + shoppingOrdersDisplayShipping: TaxTypes; + order: OrderDataModel; + translations: translationsTypes; +}) => import("preact").JSX.Element | null; +export {}; +//# sourceMappingURL=Shipping.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Subtotal.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Subtotal.d.ts new file mode 100644 index 0000000000..fdde14c9c4 --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Subtotal.d.ts @@ -0,0 +1,13 @@ +import { OrderDataModel } from '../../../data/models'; +import { TaxTypes } from '../../../types'; + +type translationsTypes = Record; +export declare const Subtotal: ({ translations, order, subtotalInclTax, subtotalExclTax, shoppingOrdersDisplaySubtotal, }: { + translations: translationsTypes; + order?: OrderDataModel | undefined; + subtotalInclTax: number; + subtotalExclTax: number; + shoppingOrdersDisplaySubtotal: TaxTypes; +}) => import("preact").JSX.Element; +export {}; +//# sourceMappingURL=Subtotal.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Tax.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Tax.d.ts new file mode 100644 index 0000000000..1f05c21b02 --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Tax.d.ts @@ -0,0 +1,11 @@ +import { OrderDataModel } from '../../../data/models'; + +type translationsTypes = Record; +export declare const Tax: ({ translations, renderTaxAccordion, totalAccordionTaxValue, order, }: { + translations: translationsTypes; + order: OrderDataModel; + renderTaxAccordion: boolean; + totalAccordionTaxValue: number; +}) => import("preact").JSX.Element; +export {}; +//# sourceMappingURL=Tax.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Total.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Total.d.ts new file mode 100644 index 0000000000..6facf6823a --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/Total.d.ts @@ -0,0 +1,11 @@ +import { OrderDataModel } from '../../../data/models'; +import { TaxTypes } from '../../../types'; + +type translationsTypes = Record; +export declare const Total: ({ translations, shoppingOrdersDisplaySubtotal, order, }: { + translations: translationsTypes; + order?: OrderDataModel | undefined; + shoppingOrdersDisplaySubtotal: TaxTypes; +}) => import("preact").JSX.Element; +export {}; +//# sourceMappingURL=Total.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/index.d.ts b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/index.d.ts new file mode 100644 index 0000000000..13d0002053 --- /dev/null +++ b/scripts/__dropins__/storefront-order/components/OrderCostSummaryContent/Blocks/index.d.ts @@ -0,0 +1,24 @@ +/******************************************************************** + * ADOBE CONFIDENTIAL + * + * Copyright 2024 Adobe + * All Rights Reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of Adobe and its suppliers, if any. The intellectual + * and technical concepts contained herein are proprietary to Adobe + * and its suppliers and are protected by all applicable intellectual + * property laws, including trade secret and copyright laws. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from Adobe. + *******************************************************************/ +export { GiftWrapping } from './GiftWrapping'; +export { PrintedCard } from './PrintedCard'; +export { Subtotal } from './Subtotal'; +export { Shipping } from './Shipping'; +export { Discounts } from './Discounts'; +export { Total } from './Total'; +export { Tax } from './Tax'; +export { GiftCards } from './GiftCards'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/configs/mock.config.d.ts b/scripts/__dropins__/storefront-order/configs/mock.config.d.ts index 0b5533f63e..962c55def6 100644 --- a/scripts/__dropins__/storefront-order/configs/mock.config.d.ts +++ b/scripts/__dropins__/storefront-order/configs/mock.config.d.ts @@ -13,6 +13,58 @@ * is strictly forbidden unless prior written permission is obtained * from Adobe. *******************************************************************/ +export declare const totalGiftOptions: { + giftWrappingForItems: { + value: number; + currency: string; + }; + giftWrappingForItemsInclTax: { + value: number; + currency: string; + }; + giftWrappingForOrder: { + value: number; + currency: string; + }; + giftWrappingForOrderInclTax: { + value: number; + currency: string; + }; + printedCard: { + value: number; + currency: string; + }; + printedCardInclTax: { + value: number; + currency: string; + }; +}; +export declare const gift_options: { + gift_wrapping_for_items: { + currency: string; + value: number; + }; + gift_wrapping_for_items_incl_tax: { + currency: string; + value: number; + }; + gift_wrapping_for_order: { + currency: string; + value: number; + }; + gift_wrapping_for_order_incl_tax: { + currency: string; + value: number; + }; + printed_card: { + currency: string; + value: number; + }; + printed_card_incl_tax: { + currency: string; + value: number; + }; +}; export declare const taxCalculations: { includeAndExcludeTax: { originalPrice: { @@ -468,6 +520,32 @@ export declare const transformMockOrderInput: { gift_card?: undefined; })[]; total: { + gift_options: { + gift_wrapping_for_items: { + currency: string; + value: number; + }; + gift_wrapping_for_items_incl_tax: { + currency: string; + value: number; + }; + gift_wrapping_for_order: { + currency: string; + value: number; + }; + gift_wrapping_for_order_incl_tax: { + currency: string; + value: number; + }; + printed_card: { + currency: string; + value: number; + }; + printed_card_incl_tax: { + currency: string; + value: number; + }; + }; grand_total: { value: number; currency: string; @@ -1192,6 +1270,13 @@ export declare const orderCostSummaryMockup: { totalQuantity: number; shippingMethod: string; carrier: string; + appliedGiftCards: { + appliedBalance: { + currency: string; + value: number; + }; + code: string; + }[]; discounts: { amount: { value: number; @@ -1313,7 +1398,33 @@ export declare const orderCostSummaryMockup: { quantityReturned: number; quantityShipped: number; }[]; - totalGiftcard: { + totalGiftOptions: { + giftWrappingForItems: { + value: number; + currency: string; + }; + giftWrappingForItemsInclTax: { + value: number; + currency: string; + }; + giftWrappingForOrder: { + value: number; + currency: string; + }; + giftWrappingForOrderInclTax: { + value: number; + currency: string; + }; + printedCard: { + value: number; + currency: string; + }; + printedCardInclTax: { + value: number; + currency: string; + }; + }; + totalGiftCard: { value: number; currency: string; }; @@ -1986,7 +2097,7 @@ export declare const createReturnOrderMock: { value: number; currency: string; }; - totalGiftcard: { + totalGiftCard: { currency: string; value: number; }; @@ -3887,7 +3998,7 @@ export declare const customerReturnDetailsFullMock: { value: number; currency: string; }; - totalGiftcard: { + totalGiftCard: { currency: string; value: number; }; @@ -4576,6 +4687,13 @@ export declare const placeOrderMockData: { label: string; }[]; email: string; + giftWrappingOrder: { + price: { + currency: string; + value: number; + }; + uid: string; + }; grandTotal: { currency: string; value: number; @@ -4647,6 +4765,13 @@ export declare const placeOrderMockData: { senderEmail: string; senderName: string; }; + productGiftWrapping: { + price: { + currency: string; + value: number; + }; + uid: string; + }; id: undefined; price: { currency: undefined; @@ -5174,5 +5299,31 @@ export declare const placeOrderMockData: { currency: string; value: number; }; + totalGiftOptions: { + giftWrappingForItems: { + value: number; + currency: string; + }; + giftWrappingForItemsInclTax: { + value: number; + currency: string; + }; + giftWrappingForOrder: { + value: number; + currency: string; + }; + giftWrappingForOrderInclTax: { + value: number; + currency: string; + }; + printedCard: { + value: number; + currency: string; + }; + printedCardInclTax: { + value: number; + currency: string; + }; + }; }; //# sourceMappingURL=mock.config.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/containers/OrderCostSummary.js b/scripts/__dropins__/storefront-order/containers/OrderCostSummary.js index 2626e839c5..022bf0f107 100644 --- a/scripts/__dropins__/storefront-order/containers/OrderCostSummary.js +++ b/scripts/__dropins__/storefront-order/containers/OrderCostSummary.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as c,jsxs as i,Fragment as v}from"@dropins/tools/preact-jsx-runtime.js";import{classes as Z}from"@dropins/tools/lib.js";import{useState as g,useEffect as V}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as b}from"@dropins/tools/event-bus.js";import{s as S}from"../chunks/setTaxStatus.js";import{Price as d,Icon as E,Accordion as f,AccordionSection as I,Card as k,Header as D}from"@dropins/tools/components.js";import{u as z}from"../chunks/useGetStoreConfig.js";import"../chunks/ShippingStatusCard.js";import*as _ from"@dropins/tools/preact-compat.js";import{O as A}from"../chunks/OrderLoaders.js";import{useText as $}from"@dropins/tools/i18n.js";import"../chunks/getStoreConfig.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const j=s=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},_.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),B=s=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},_.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),P=s=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},_.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"currentColor"})),W=({orderData:s,config:e})=>{const[t,n]=g(!0),[u,r]=g(s),[l,m]=g(null);return V(()=>{if(e){const{shoppingOrderDisplayPrice:o,shoppingOrdersDisplayShipping:a,shoppingOrdersDisplaySubtotal:h,...y}=e;m(p=>({...p,...y,shoppingOrderDisplayPrice:S(o),shoppingOrdersDisplayShipping:S(a),shoppingOrdersDisplaySubtotal:S(h)})),n(!1)}},[e]),V(()=>{const o=b.on("order/data",a=>{r(a)},{eager:!0});return()=>{o==null||o.off()}},[]),{loading:t,storeConfig:l,order:u}},mt=({withHeader:s,orderData:e,children:t,className:n,...u})=>{const r=z(),{loading:l,storeConfig:m,order:o}=W({orderData:e,config:r}),a=$({subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes",headerText:"Order.OrderCostSummary.headerText"});return c("div",{...u,className:Z(["order-cost-summary",n]),children:c(K,{order:o,withHeader:s,loading:l,storeConfig:m,translations:a})})},q=({translations:s,order:e,subtotalInclTax:t,subtotalExclTax:n,shoppingOrdersDisplaySubtotal:u})=>{var h,y,p,x;const r=u.taxIncluded,l=u.taxExcluded,m=r&&!l?i(v,{children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:s.subtotal}),c(d,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(h=e==null?void 0:e.subtotalInclTax)==null?void 0:h.currency,amount:t})]}),c("div",{className:"order-cost-summary-content__description--subheader",children:c("span",{children:s.incl})})]}):null,o=l&&!r?i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:s.subtotal}),c(d,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(y=e==null?void 0:e.subtotalExclTax)==null?void 0:y.currency,amount:n})]}):null,a=l&&r?i(v,{children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:s.subtotal}),c(d,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(p=e==null?void 0:e.subtotalInclTax)==null?void 0:p.currency,amount:t})]}),i("div",{className:"order-cost-summary-content__description--subheader",children:[c(d,{currency:(x=e==null?void 0:e.subtotalExclTax)==null?void 0:x.currency,amount:n,size:"small",weight:"bold"})," ",c("span",{children:s.excl})]})]}):null;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[m,o,a]})},F=({translations:s,shoppingOrdersDisplayShipping:e,order:t,totalShipping:n})=>{var u,r,l,m;return t!=null&&t.isVirtual?null:i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:s.shipping}),(u=t==null?void 0:t.totalShipping)!=null&&u.value?c(d,{weight:"normal",currency:(r=t==null?void 0:t.totalShipping)==null?void 0:r.currency,amount:n}):c("span",{children:s.freeShipping})]}),i("div",{className:"order-cost-summary-content__description--subheader",children:[e.taxIncluded&&e.taxExcluded?i(v,{children:[c(d,{weight:"normal",currency:(l=t==null?void 0:t.totalShipping)==null?void 0:l.currency,amount:(m=t==null?void 0:t.totalShipping)==null?void 0:m.value,size:"small"}),i("span",{children:[" ",s.excl]})]}):null,e.taxIncluded&&!e.taxExcluded?c("span",{children:s.incl}):null]})]})},U=({translations:s,order:e,totalGiftcardValue:t,totalGiftcardCurrency:n})=>{var r,l,m,o;const u=(r=e==null?void 0:e.discounts)==null?void 0:r.every(a=>a.amount.value===0);return!((l=e==null?void 0:e.discounts)!=null&&l.length)&&(u||!t||t<1)||(m=e==null?void 0:e.discounts)!=null&&m.length&&u?null:i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:s.discount}),c("span",{children:(o=e==null?void 0:e.discounts)==null?void 0:o.map(({amount:a},h)=>{const p=((a==null?void 0:a.value)??0)+t;return p===0?null:c(d,{weight:"normal",sale:!0,currency:a==null?void 0:a.currency,amount:-p},`${a==null?void 0:a.value}${h}`)})})]}),t>0?i("div",{className:"order-cost-summary-content__description--subheader",children:[i("span",{children:[c(E,{source:P,size:"16"}),c("span",{children:s.discountSubtitle.toLocaleUpperCase()})]}),c(d,{weight:"normal",sale:!0,currency:n,amount:-t})]}):null]})},G=({order:s})=>{var e;return c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--coupon",children:(e=s==null?void 0:s.coupons)==null?void 0:e.map((t,n)=>c("div",{className:"order-cost-summary-content__description--header",children:c("span",{children:t.code})},`${t==null?void 0:t.code}${n}`))})},R=({translations:s,renderTaxAccordion:e,totalAccordionTaxValue:t,order:n})=>{var l,m,o;const[u,r]=g(!1);return e?c(f,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:j,iconClose:B,children:i(I,{onStateChange:r,title:s.accordionTitle,secondaryText:c(v,{children:u?null:c(d,{weight:"normal",amount:t,currency:(m=n==null?void 0:n.totalTax)==null?void 0:m.currency})}),renderContentWhenClosed:!1,children:[(o=n==null?void 0:n.taxes)==null?void 0:o.map((a,h)=>{var y,p,x;return i("div",{className:"order-cost-summary-content__accordion-row",children:[c("p",{children:a==null?void 0:a.title}),c("p",{children:c(d,{weight:"normal",amount:(y=a==null?void 0:a.amount)==null?void 0:y.value,currency:(p=a==null?void 0:a.amount)==null?void 0:p.currency})})]},`${(x=a==null?void 0:a.amount)==null?void 0:x.value}${h}`)}),i("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[c("p",{children:s.accordionTotalTax}),c("p",{children:c(d,{weight:"normal",amount:t,currency:n.totalTax.currency,size:"medium"})})]})]})}):c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:s.tax}),c(d,{currency:(l=n==null?void 0:n.totalTax)==null?void 0:l.currency,amount:n==null?void 0:n.totalTax.value,weight:"normal",size:"small"})]})})},J=({translations:s,shoppingOrdersDisplaySubtotal:e,order:t})=>{var n,u,r,l;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:s.total}),c(d,{currency:(n=t==null?void 0:t.grandTotal)==null?void 0:n.currency,amount:(u=t==null?void 0:t.grandTotal)==null?void 0:u.value,weight:"bold",size:"medium"})]}),e.taxExcluded&&e.taxIncluded?i("div",{className:"order-cost-summary-content__description--subheader",children:[c("span",{children:s.totalExcludingTaxes}),c(d,{currency:(r=t==null?void 0:t.grandTotal)==null?void 0:r.currency,amount:((l=t==null?void 0:t.grandTotal)==null?void 0:l.value)-(t==null?void 0:t.totalTax.value),weight:"normal",size:"small"})]}):null]})},K=({translations:s,loading:e,storeConfig:t,order:n,withHeader:u=!0})=>{var p,x,O,w,T,L,M;if(e||!n)return c(A,{});const r=((p=n==null?void 0:n.totalGiftcard)==null?void 0:p.value)??0,l=((x=n.totalGiftcard)==null?void 0:x.currency)??"",m=((O=n.subtotalInclTax)==null?void 0:O.value)??0,o=((w=n.subtotalExclTax)==null?void 0:w.value)??0,a=((T=n.totalShipping)==null?void 0:T.value)??0,h=!!((L=n==null?void 0:n.taxes)!=null&&L.length)&&(t==null?void 0:t.shoppingOrdersDisplayFullSummary),y=h?(M=n==null?void 0:n.taxes)==null?void 0:M.reduce((N,C)=>{var H;return+((H=C==null?void 0:C.amount)==null?void 0:H.value)+N},0):0;return i(k,{variant:"secondary",className:Z(["order-cost-summary-content"]),children:[u?c(D,{title:s.headerText}):null,i("div",{className:"order-cost-summary-content__wrapper",children:[c(q,{translations:s,order:n,subtotalInclTax:m,subtotalExclTax:o,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal}),c(F,{translations:s,order:n,totalShipping:a,shoppingOrdersDisplayShipping:t==null?void 0:t.shoppingOrdersDisplayShipping}),c(U,{translations:s,order:n,totalGiftcardValue:r,totalGiftcardCurrency:l}),c(G,{order:n}),c(R,{order:n,translations:s,renderTaxAccordion:h,totalAccordionTaxValue:y}),c(J,{translations:s,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal,order:n})]})]})};export{mt as OrderCostSummary,mt as default}; +import{jsx as e,jsxs as r,Fragment as _}from"@dropins/tools/preact-jsx-runtime.js";import{classes as b}from"@dropins/tools/lib.js";import{useState as v,useEffect as E}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as Z}from"@dropins/tools/event-bus.js";import{s as T}from"../chunks/setTaxStatus.js";import{Price as m,Icon as H,Accordion as I,AccordionSection as G,Card as W,Header as k}from"@dropins/tools/components.js";import{u as z}from"../chunks/useGetStoreConfig.js";import"../chunks/ShippingStatusCard.js";import*as g from"@dropins/tools/preact-compat.js";import{O as D}from"../chunks/OrderLoaders.js";import{useText as F,Text as A}from"@dropins/tools/i18n.js";import"../chunks/getStoreConfig.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const j=c=>g.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c},g.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),B=c=>g.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c},g.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),q=c=>g.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c},g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"currentColor"})),$=c=>g.createElement("svg",{width:24,height:16,viewBox:"0 0 24 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c},g.createElement("path",{d:"M22.5364 9.8598V2.1658C22.5364 1.63583 22.099 1.20996 21.576 1.20996H2.42337C1.89083 1.20996 1.46289 1.64529 1.46289 2.1658V9.8598M22.5364 9.8598H1.46289M22.5364 9.8598V13.844C22.5364 14.3645 22.1085 14.7999 21.576 14.7999H2.42337C1.90034 14.7999 1.46289 14.374 1.46289 13.844V9.8598M3.9164 12.5191L7.5396 9.8598M7.5396 9.8598L11.1628 12.5191M7.5396 9.8598C7.5396 9.8598 6.96902 7.26674 6.40795 6.70838C5.84687 6.15002 4.93394 6.15002 4.37287 6.70838C3.81179 7.26674 3.81179 8.17526 4.37287 8.73362C4.93394 9.29198 7.5396 9.8598 7.5396 9.8598ZM7.5396 9.8598C7.5396 9.8598 10.1643 9.27305 10.7254 8.71469C11.2864 8.15633 11.2864 7.24782 10.7254 6.68946C10.1643 6.1311 9.25135 6.1311 8.69028 6.68946C8.12921 7.24782 7.5396 9.8598 7.5396 9.8598ZM7.5396 14.7904V1.20996",stroke:"currentColor",strokeLinecap:"round"})),R=({orderData:c,config:a})=>{const[t,n]=v(!0),[i,s]=v(c),[l,o]=v(null);return E(()=>{if(a){const{shoppingOrderDisplayPrice:u,shoppingOrdersDisplayShipping:d,shoppingOrdersDisplaySubtotal:p,...x}=a;o(h=>({...h,...x,shoppingOrderDisplayPrice:T(u),shoppingOrdersDisplayShipping:T(d),shoppingOrdersDisplaySubtotal:T(p),salesPrintedCard:T(a.salesPrintedCard),salesGiftWrapping:T(a.salesGiftWrapping)})),n(!1)}},[a]),E(()=>{const u=Z.on("order/data",d=>{s(d)},{eager:!0});return()=>{u==null||u.off()}},[]),{loading:t,storeConfig:l,order:i}},xt=({withHeader:c,orderData:a,children:t,className:n,...i})=>{const s=z(),{loading:l,storeConfig:o,order:u}=R({orderData:a,config:s}),d=F({subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",totalFree:"Order.OrderCostSummary.totalFree",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes",headerText:"Order.OrderCostSummary.headerText",printedCardTitle:"Order.OrderCostSummary.giftOptionsTax.printedCard.title",printedCardTitleInclTax:"Order.OrderCostSummary.giftOptionsTax.printedCard.inclTax",printedCardTitleExclTax:"Order.OrderCostSummary.giftOptionsTax.printedCard.exclTax",itemGiftWrappingTitle:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.title",itemGiftWrappingInclTax:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.inclTax",itemGiftWrappingExclTax:"Order.OrderCostSummary.giftOptionsTax.itemGiftWrapping.exclTax",orderGiftWrappingTitle:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.title",orderGiftWrappingInclTax:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.inclTax",orderGiftWrappingExclTax:"Order.OrderCostSummary.giftOptionsTax.orderGiftWrapping.exclTax"});return e("div",{...i,className:b(["order-cost-summary",n]),children:e(tt,{order:u,withHeader:c,loading:l,storeConfig:o,translations:d})})},M=({salesGiftWrapping:c,giftWrappingPrice:a,giftWrappingPriceInclTax:t,giftWrappingTitle:n,giftWrappingExclTaxText:i,giftWrappingInclTaxText:s})=>{const l=c==null?void 0:c.taxIncluded,o=c==null?void 0:c.taxExcluded,u=l&&!o,d=o&&!l,p=o&&l;if(a.value===0||t.value===0)return null;const x=u?r(_,{children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:s}),e(m,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:t.currency,amount:t.value})]}),e("div",{className:"order-cost-summary-content__description--subheader",children:e("span",{children:s})})]}):null,h=d?r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:n}),e("span",{children:e(m,{weight:"normal",currency:a.currency,amount:a.value})})]}):null,y=p?r(_,{children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:n}),e("span",{children:e(m,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:t.currency,amount:t.value})})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:[e(m,{currency:a.currency,amount:a.value,size:"small",weight:"bold"})," ",e("span",{children:i})]})]}):null;return r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--gift-wrapping",children:[x,h,y]})},U=({translations:c,order:a,salesPrintedCard:t})=>{const n=a==null?void 0:a.totalGiftOptions,{printedCard:i,printedCardInclTax:s}=n,l=t==null?void 0:t.taxIncluded,o=t==null?void 0:t.taxExcluded;if(i.value===0||s.value===0)return null;const u=l&&!o?r(_,{children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.printedCardTitle}),e("span",{children:e(m,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:s.currency,amount:s.value})})]}),e("div",{className:"order-cost-summary-content__description--subheader",children:e("span",{children:e("span",{children:c.printedCardTitleInclTax})})})]}):null,d=o&&!l?r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.printedCardTitle}),e("span",{children:e(m,{weight:"normal",currency:i.currency,amount:i.value})})]}):null,p=o&&l?r(_,{children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.printedCardTitle}),e("span",{children:e(m,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:s.currency,amount:s.value})})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:[e(m,{currency:i.currency,amount:i.value,size:"small",weight:"bold"})," ",e("span",{children:c.printedCardTitleExclTax})]})]}):null;return r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--printed-card",children:[u,d,p]})},J=({translations:c,order:a,subtotalInclTax:t,subtotalExclTax:n,shoppingOrdersDisplaySubtotal:i})=>{var p,x,h,y;const s=i.taxIncluded,l=i.taxExcluded,o=s&&!l?r(_,{children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.subtotal}),e(m,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(p=a==null?void 0:a.subtotalInclTax)==null?void 0:p.currency,amount:t})]}),e("div",{className:"order-cost-summary-content__description--subheader",children:e("span",{children:c.incl})})]}):null,u=l&&!s?r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.subtotal}),e(m,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(x=a==null?void 0:a.subtotalExclTax)==null?void 0:x.currency,amount:n})]}):null,d=l&&s?r(_,{children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.subtotal}),e(m,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(h=a==null?void 0:a.subtotalInclTax)==null?void 0:h.currency,amount:t})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:[e(m,{currency:(y=a==null?void 0:a.subtotalExclTax)==null?void 0:y.currency,amount:n,size:"small",weight:"bold"})," ",e("span",{children:c.excl})]})]}):null;return r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[o,u,d]})},K=({translations:c,shoppingOrdersDisplayShipping:a,order:t,totalShipping:n})=>{var i,s,l,o;return t!=null&&t.isVirtual?null:r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.shipping}),(i=t==null?void 0:t.totalShipping)!=null&&i.value?e(m,{weight:"normal",currency:(s=t==null?void 0:t.totalShipping)==null?void 0:s.currency,amount:n}):e("span",{children:c.freeShipping})]}),r("div",{className:"order-cost-summary-content__description--subheader",children:[a.taxIncluded&&a.taxExcluded?r(_,{children:[e(m,{weight:"normal",currency:(l=t==null?void 0:t.totalShipping)==null?void 0:l.currency,amount:(o=t==null?void 0:t.totalShipping)==null?void 0:o.value,size:"small"}),r("span",{children:[" ",c.excl]})]}):null,a.taxIncluded&&!a.taxExcluded?e("span",{children:c.incl}):null]})]})},Q=({translations:c,order:a})=>{var s,l;const t=a==null?void 0:a.coupons,n=a==null?void 0:a.discounts,i=(n==null?void 0:n.reduce((o,u)=>o+(u.amount.value??0),0))||0;return!((s=a==null?void 0:a.discounts)!=null&&s.length)&&i===0?null:r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.discount}),e("span",{children:e(m,{weight:"normal",sale:!0,currency:(l=n[0])==null?void 0:l.amount.currency,amount:-i})})]}),t.map(o=>e("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:[e(H,{source:q,size:"16",className:"order-cost-summary-content__description--coupon-icon"}),e("span",{children:o.code})]})},o.code))]})},X=({translations:c,shoppingOrdersDisplaySubtotal:a,order:t})=>{var i,s,l,o,u;const n=((i=t==null?void 0:t.grandTotal)==null?void 0:i.value)===0;return r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.total}),n?e("span",{className:"order-cost-summary-content__description--total-free",children:c.totalFree}):e(m,{currency:(s=t==null?void 0:t.grandTotal)==null?void 0:s.currency,amount:(l=t==null?void 0:t.grandTotal)==null?void 0:l.value,weight:"bold",size:"medium"})]}),a.taxExcluded&&a.taxIncluded?r("div",{className:"order-cost-summary-content__description--subheader",children:[e("span",{children:c.totalExcludingTaxes}),e(m,{currency:(o=t==null?void 0:t.grandTotal)==null?void 0:o.currency,amount:((u=t==null?void 0:t.grandTotal)==null?void 0:u.value)-(t==null?void 0:t.totalTax.value),weight:"normal",size:"small"})]}):null]})},Y=({translations:c,renderTaxAccordion:a,totalAccordionTaxValue:t,order:n})=>{var l,o,u;const[i,s]=v(!1);return a?e(I,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:j,iconClose:B,children:r(G,{onStateChange:s,title:c.accordionTitle,secondaryText:e(_,{children:i?null:e(m,{weight:"normal",amount:t,currency:(o=n==null?void 0:n.totalTax)==null?void 0:o.currency})}),renderContentWhenClosed:!1,children:[(u=n==null?void 0:n.taxes)==null?void 0:u.map((d,p)=>{var x,h,y;return r("div",{className:"order-cost-summary-content__accordion-row",children:[e("p",{children:d==null?void 0:d.title}),e("p",{children:e(m,{weight:"normal",amount:(x=d==null?void 0:d.amount)==null?void 0:x.value,currency:(h=d==null?void 0:d.amount)==null?void 0:h.currency})})]},`${(y=d==null?void 0:d.amount)==null?void 0:y.value}${p}`)}),r("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[e("p",{children:c.accordionTotalTax}),e("p",{children:e(m,{weight:"normal",amount:t,currency:n.totalTax.currency,size:"medium"})})]})]})}):e("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:c.tax}),e(m,{currency:(l=n==null?void 0:n.totalTax)==null?void 0:l.currency,amount:n==null?void 0:n.totalTax.value,weight:"normal",size:"small"})]})})},P=({totalGiftCardValue:c,totalGiftCardCurrency:a,order:t})=>{const n=t==null?void 0:t.appliedGiftCards;return c?r("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[r("div",{className:"order-cost-summary-content__description--header",children:[e("span",{children:e(A,{id:"Order.OrderCostSummary.appliedGiftCards.label",plural:n==null?void 0:n.length,fields:{count:n==null?void 0:n.length}})}),e("span",{children:e(m,{weight:"normal",sale:!0,currency:a,amount:-c})})]}),n.map(i=>e("div",{className:"order-cost-summary-content__description--subheader",children:r("span",{children:[e(H,{source:$,size:"16",className:"order-cost-summary-content__description--giftcard-icon"}),e("span",{children:i.code})]})},i.code))]}):null},tt=({translations:c,loading:a,storeConfig:t,order:n,withHeader:i=!0})=>{var h,y,C,w,S,f,N;if(a||!n)return e(D,{});const s=((h=n==null?void 0:n.totalGiftCard)==null?void 0:h.value)??0,l=((y=n.totalGiftCard)==null?void 0:y.currency)??"",o=((C=n.subtotalInclTax)==null?void 0:C.value)??0,u=((w=n.subtotalExclTax)==null?void 0:w.value)??0,d=((S=n.totalShipping)==null?void 0:S.value)??0,p=!!((f=n==null?void 0:n.taxes)!=null&&f.length)&&(t==null?void 0:t.shoppingOrdersDisplayFullSummary),x=p?(N=n==null?void 0:n.taxes)==null?void 0:N.reduce((L,O)=>{var V;return+((V=O==null?void 0:O.amount)==null?void 0:V.value)+L},0):0;return r(W,{variant:"secondary",className:b(["order-cost-summary-content"]),children:[i?e(k,{title:c.headerText}):null,r("div",{className:"order-cost-summary-content__wrapper",children:[e(J,{translations:c,order:n,subtotalInclTax:o,subtotalExclTax:u,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal}),e(K,{translations:c,order:n,totalShipping:d,shoppingOrdersDisplayShipping:t==null?void 0:t.shoppingOrdersDisplayShipping}),e(U,{order:n,translations:c,salesPrintedCard:t==null?void 0:t.salesPrintedCard}),e(M,{salesGiftWrapping:t==null?void 0:t.salesGiftWrapping,giftWrappingPrice:n.totalGiftOptions.giftWrappingForItems,giftWrappingPriceInclTax:n.totalGiftOptions.giftWrappingForItemsInclTax,giftWrappingTitle:c.itemGiftWrappingTitle,giftWrappingExclTaxText:c.itemGiftWrappingExclTax,giftWrappingInclTaxText:c.itemGiftWrappingInclTax}),e(M,{salesGiftWrapping:t==null?void 0:t.salesGiftWrapping,giftWrappingPrice:n.totalGiftOptions.giftWrappingForOrder,giftWrappingPriceInclTax:n.totalGiftOptions.giftWrappingForOrderInclTax,giftWrappingTitle:c.orderGiftWrappingTitle,giftWrappingExclTaxText:c.orderGiftWrappingExclTax,giftWrappingInclTaxText:c.orderGiftWrappingInclTax}),e(Q,{translations:c,order:n}),e(P,{order:n,totalGiftCardValue:s,totalGiftCardCurrency:l}),e(Y,{order:n,translations:c,renderTaxAccordion:p,totalAccordionTaxValue:x}),e(X,{translations:c,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal,order:n})]})]})};export{xt as OrderCostSummary,xt as default}; diff --git a/scripts/__dropins__/storefront-order/containers/OrderHeader.js b/scripts/__dropins__/storefront-order/containers/OrderHeader.js index 09e053c519..873dd82bc4 100644 --- a/scripts/__dropins__/storefront-order/containers/OrderHeader.js +++ b/scripts/__dropins__/storefront-order/containers/OrderHeader.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as l,jsxs as k}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import{Icon as O,Header as d,Button as H}from"@dropins/tools/components.js";import{useState as f,useEffect as p}from"@dropins/tools/preact-hooks.js";import"../chunks/ShippingStatusCard.js";import*as c from"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{events as _}from"@dropins/tools/event-bus.js";import{b}from"../chunks/OrderLoaders.js";import{useText as w,Text as L}from"@dropins/tools/i18n.js";const V=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_4797_15077)"},c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.15 20.85L1.5 17.53V6.63L10.15 10V20.85Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.63001L10.15 3.20001L18.8 6.63001L10.15 10L1.5 6.63001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.17969 4.77002L14.8297 8.15002V11.47",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.7896 12.64V6.63L10.1396 10V20.85L14.8296 19.05",stroke:"currentColor",strokeLinejoin:"round"}),c.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M15.71 17.26C15.71 15.38 17.23 13.86 19.11 13.86C20.99 13.86 22.51 15.38 22.51 17.26C22.51 19.14 20.99 20.66 19.11 20.66C17.23 20.66 15.71 19.14 15.71 17.26Z",stroke:"currentColor"}),c.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M17.4805 17.49L18.5605 18.41L20.7205 16.33",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round"})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_4797_15077"},c.createElement("rect",{width:22,height:18.65,fill:"white",transform:"translate(1 2.70001)"}))));function s(e){var r;return{region:{region_id:e!=null&&e.regionId?Number(e==null?void 0:e.regionId):null,region:e==null?void 0:e.region},city:e==null?void 0:e.city,company:e==null?void 0:e.company,country_code:e==null?void 0:e.country,firstname:e==null?void 0:e.firstName,lastname:e==null?void 0:e.lastName,middlename:e==null?void 0:e.middleName,postcode:e==null?void 0:e.postCode,street:e==null?void 0:e.street,telephone:e==null?void 0:e.telephone,custom_attributesV2:((r=e==null?void 0:e.customAttributes)==null?void 0:r.map(i=>({attribute_code:i.code,value:i.value})))||[]}}const M=({orderData:e,handleEmailAvailability:r,handleSignUpClick:i})=>{const[t,v]=f(e),[u,N]=f(),[C,h]=f(r?void 0:!0),a=t==null?void 0:t.email,E=i&&t!==void 0&&u===!1&&C===!0?()=>{const o=t.shippingAddress,n=t.billingAddress,A=[{code:"email",defaultValue:t.email},{code:"firstname",defaultValue:(n==null?void 0:n.firstName)??""},{code:"lastname",defaultValue:(n==null?void 0:n.lastName)??""}];let m=[];if(o){const g={...s(o),default_shipping:!0};m=[{...s(n),default_billing:!0},g]}else m=[{...s(n),default_billing:!0,default_shipping:!0}];i({inputsDefaultValueSet:A,addressesData:m})}:void 0;return p(()=>{const o=_.on("authenticated",n=>{N(n)},{eager:!0});return()=>{o==null||o.off()}},[]),p(()=>{const o=_.on("order/data",n=>{v(n)},{eager:!0});return()=>{o==null||o.off()}},[]),p(()=>{r&&u!==void 0&&(u||!a||r(a).then(o=>h(o)).catch(()=>h(!0)))},[u,r,a]),{order:t,onSignUpClickHandler:E}},R=e=>{var t;const{order:r,onSignUpClickHandler:i}=M(e);return l("div",{children:r?l(j,{customerName:(t=r.billingAddress)==null?void 0:t.firstName,onSignUpClick:i,orderNumber:r.number}):l(b,{})})},j=({customerName:e,orderNumber:r,onSignUpClick:i})=>{const t=w({title:l(L,{id:"Order.OrderHeader.title",fields:{name:e}}),defaultTitle:"Order.OrderHeader.defaultTitle",order:l(L,{id:"Order.OrderHeader.order",fields:{order:r}}),createAccountMessage:"Order.OrderHeader.CreateAccount.message",createAccountButton:"Order.OrderHeader.CreateAccount.button"});return k("div",{"data-testid":"order-header",className:"order-header order-header__card",children:[l(O,{source:V,size:"64",className:"order-header__icon"}),l(d,{className:"order-header__title",title:t.title,size:"large",divider:!1,children:e?t.title:t.defaultTitle}),l("p",{className:"order-header__order",children:t.order}),i&&k("div",{className:"order-header-create-account",children:[l("p",{className:"order-header-create-account__message",children:t.createAccountMessage}),l(H,{"data-testid":"create-account-button",className:"order-header-create-account__button",size:"medium",variant:"secondary",type:"submit",onClick:i,children:t.createAccountButton})]})]})};export{R as OrderHeader,R as default}; +import{jsx as l,jsxs as k}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import{Icon as O,Header as d,Button as H}from"@dropins/tools/components.js";import{useState as f,useEffect as p}from"@dropins/tools/preact-hooks.js";import"../chunks/ShippingStatusCard.js";import*as c from"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{events as _}from"@dropins/tools/event-bus.js";import{b}from"../chunks/OrderLoaders.js";import{useText as w,Text as L}from"@dropins/tools/i18n.js";const V=e=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},c.createElement("g",{clipPath:"url(#clip0_4797_15077)"},c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.15 20.85L1.5 17.53V6.63L10.15 10V20.85Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.63001L10.15 3.20001L18.8 6.63001L10.15 10L1.5 6.63001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.17969 4.77002L14.8297 8.15002V11.47",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.7896 12.64V6.63L10.1396 10V20.85L14.8296 19.05",stroke:"currentColor",strokeLinejoin:"round"}),c.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M15.71 17.26C15.71 15.38 17.23 13.86 19.11 13.86C20.99 13.86 22.51 15.38 22.51 17.26C22.51 19.14 20.99 20.66 19.11 20.66C17.23 20.66 15.71 19.14 15.71 17.26Z",stroke:"currentColor"}),c.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M17.4805 17.49L18.5605 18.41L20.7205 16.33",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round"})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_4797_15077"},c.createElement("rect",{width:22,height:18.65,fill:"white",transform:"translate(1 2.70001)"}))));function s(e){var r;return{region:{region_id:e!=null&&e.regionId?Number(e==null?void 0:e.regionId):null,region:e==null?void 0:e.region},city:e==null?void 0:e.city,company:e==null?void 0:e.company,country_code:e==null?void 0:e.countryCode,firstname:e==null?void 0:e.firstName,lastname:e==null?void 0:e.lastName,middlename:e==null?void 0:e.middleName,postcode:e==null?void 0:e.postCode,street:e==null?void 0:e.street,telephone:e==null?void 0:e.telephone,custom_attributesV2:((r=e==null?void 0:e.customAttributes)==null?void 0:r.map(i=>({attribute_code:i.code,value:i.value})))||[]}}const M=({orderData:e,handleEmailAvailability:r,handleSignUpClick:i})=>{const[t,v]=f(e),[u,C]=f(),[N,h]=f(r?void 0:!0),a=t==null?void 0:t.email,E=i&&t!==void 0&&u===!1&&N===!0?()=>{const o=t.shippingAddress,n=t.billingAddress,A=[{code:"email",defaultValue:t.email},{code:"firstname",defaultValue:(n==null?void 0:n.firstName)??""},{code:"lastname",defaultValue:(n==null?void 0:n.lastName)??""}];let m=[];if(o){const g={...s(o),default_shipping:!0};m=[{...s(n),default_billing:!0},g]}else m=[{...s(n),default_billing:!0,default_shipping:!0}];i({inputsDefaultValueSet:A,addressesData:m})}:void 0;return p(()=>{const o=_.on("authenticated",n=>{C(n)},{eager:!0});return()=>{o==null||o.off()}},[]),p(()=>{const o=_.on("order/data",n=>{v(n)},{eager:!0});return()=>{o==null||o.off()}},[]),p(()=>{r&&u!==void 0&&(u||!a||r(a).then(o=>h(o)).catch(()=>h(!0)))},[u,r,a]),{order:t,onSignUpClickHandler:E}},R=e=>{var t;const{order:r,onSignUpClickHandler:i}=M(e);return l("div",{children:r?l(j,{customerName:(t=r.billingAddress)==null?void 0:t.firstName,onSignUpClick:i,orderNumber:r.number}):l(b,{})})},j=({customerName:e,orderNumber:r,onSignUpClick:i})=>{const t=w({title:l(L,{id:"Order.OrderHeader.title",fields:{name:e}}),defaultTitle:"Order.OrderHeader.defaultTitle",order:l(L,{id:"Order.OrderHeader.order",fields:{order:r}}),createAccountMessage:"Order.OrderHeader.CreateAccount.message",createAccountButton:"Order.OrderHeader.CreateAccount.button"});return k("div",{"data-testid":"order-header",className:"order-header order-header__card",children:[l(O,{source:V,size:"64",className:"order-header__icon"}),l(d,{className:"order-header__title",title:t.title,size:"large",divider:!1,children:e?t.title:t.defaultTitle}),l("p",{className:"order-header__order",children:t.order}),i&&k("div",{className:"order-header-create-account",children:[l("p",{className:"order-header-create-account__message",children:t.createAccountMessage}),l(H,{"data-testid":"create-account-button",className:"order-header-create-account__button",size:"medium",variant:"secondary",type:"submit",onClick:i,children:t.createAccountButton})]})]})};export{R as OrderHeader,R as default}; diff --git a/scripts/__dropins__/storefront-order/containers/OrderProductList.js b/scripts/__dropins__/storefront-order/containers/OrderProductList.js index 15e12060fb..0dbf5ad724 100644 --- a/scripts/__dropins__/storefront-order/containers/OrderProductList.js +++ b/scripts/__dropins__/storefront-order/containers/OrderProductList.js @@ -1,3 +1,3 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -import{jsx as d,jsxs as g}from"@dropins/tools/preact-jsx-runtime.js";import{classes as h}from"@dropins/tools/lib.js";import{Card as q,Header as R}from"@dropins/tools/components.js";import{useState as P,useEffect as S,useMemo as T}from"@dropins/tools/preact-hooks.js";import"../chunks/ShippingStatusCard.js";import"@dropins/tools/preact-compat.js";import{u as b}from"../chunks/useGetStoreConfig.js";import{Fragment as x}from"@dropins/tools/preact.js";import{events as N}from"@dropins/tools/event-bus.js";import{s as Q}from"../chunks/setTaxStatus.js";import{a as k}from"../chunks/OrderLoaders.js";import{C as G}from"../chunks/CartSummaryItem.js";import{useText as M}from"@dropins/tools/i18n.js";import"../chunks/getStoreConfig.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const v=({orderData:s})=>{const[i,o]=P(!0),[e,r]=P(s);return S(()=>{const t=N.on("order/data",l=>{r(l),o(!1)},{eager:!0});return()=>{t==null||t.off()}},[]),{loading:i,order:e}},Y=({className:s,orderData:i,withHeader:o,showConfigurableOptions:e,routeProductDetails:r})=>{const t=b(),{loading:l,order:a}=v({orderData:i});return d("div",{className:h(["order-order-product-list",s]),children:d(I,{loading:l,placeholderImage:(t==null?void 0:t.baseMediaUrl)??"",taxConfig:Q((t==null?void 0:t.shoppingOrderDisplayPrice)??0),order:a,withHeader:o,showConfigurableOptions:e,routeProductDetails:r})})},w=s=>{const i=(s==null?void 0:s.items)??[],o=i.filter(t=>(t==null?void 0:t.eligibleForReturn)&&(t==null?void 0:t.quantityReturnRequested)).map(t=>({...t,totalQuantity:t.quantityReturnRequested})),e=new Map(o.map(t=>[t.id,t])),r=i.map(t=>{const l=e.get(t==null?void 0:t.id);if(l){const a=t.totalQuantity-l.quantityReturnRequested;return a===0?null:{...t,totalQuantity:a}}return t}).filter(t=>t!==null);return{returnedList:o,canceledItems:r==null?void 0:r.filter(t=>t.quantityCanceled),nonCanceledItems:r==null?void 0:r.filter(t=>!t.quantityCanceled)}},I=({placeholderImage:s,loading:i,taxConfig:o,order:e=null,withHeader:r=!0,showConfigurableOptions:t,routeProductDetails:l})=>{const a=!!(e!=null&&e.returnNumber),m=M({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",returned:"Order.OrderProductListContent.returnedTitle",refunded:"Order.OrderProductListContent.refundedTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),L=T(()=>{var p,f;if(!e)return[];if(!a){const{returnedList:u,canceledItems:n,nonCanceledItems:O}=w(e);return[{type:"returned",list:u,title:m.returned},{type:"cancelled",list:n,title:m.cancelled},{type:"allItems",list:O,title:m.allOrders}].filter(C=>{var y;return((y=C==null?void 0:C.list)==null?void 0:y.length)>0})}return[{type:"returned",list:((f=(p=e.returns.find(u=>u.returnNumber===(e==null?void 0:e.returnNumber)))==null?void 0:p.items)==null?void 0:f.map(u=>({...u,totalQuantity:u.requestQuantity})))??[],title:m.returned}]},[e,a,m]);return e?L.every(c=>c.list.length===0)?null:d(q,{variant:"secondary",className:"order-order-product-list-content",children:L.map((c,p)=>{var u;const f=c.list.filter(n=>n!==null).reduce((n,{totalQuantity:O})=>O+n,0);return g(x,{children:[r?d(R,{title:`${c.title} (${f})`}):null,d("ul",{className:"order-order-product-list-content__items",children:(u=c.list)==null?void 0:u.filter(n=>n!==null).map(n=>d("li",{"data-testid":"order-product-list-content-item",children:d(G,{placeholderImage:s,loading:i,product:n,itemType:c.type,taxConfig:o,translations:m,showConfigurableOptions:t,routeProductDetails:l})},n.id))})]},p)})}):d(k,{})};export{Y as OrderProductList,Y as default}; +import{jsx as l,jsxs as h}from"@dropins/tools/preact-jsx-runtime.js";import{classes as q}from"@dropins/tools/lib.js";import{Card as R,Header as S}from"@dropins/tools/components.js";import{useState as g,useEffect as T,useMemo as b}from"@dropins/tools/preact-hooks.js";import"../chunks/ShippingStatusCard.js";import"@dropins/tools/preact-compat.js";import{u as x}from"../chunks/useGetStoreConfig.js";import{Fragment as N}from"@dropins/tools/preact.js";import{events as Q}from"@dropins/tools/event-bus.js";import{s as k}from"../chunks/setTaxStatus.js";import{a as G}from"../chunks/OrderLoaders.js";import{C as M}from"../chunks/CartSummaryItem.js";import{useText as v}from"@dropins/tools/i18n.js";import"../chunks/getStoreConfig.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const w=({orderData:s})=>{const[i,o]=g(!0),[d,e]=g(s);return T(()=>{const t=Q.on("order/data",r=>{e(r),o(!1)},{eager:!0});return()=>{t==null||t.off()}},[]),{loading:i,order:d}},Z=({slots:s,className:i,orderData:o,withHeader:d,showConfigurableOptions:e,routeProductDetails:t})=>{const r=x(),{loading:c,order:p}=w({orderData:o});return l("div",{className:q(["order-order-product-list",i]),children:l(j,{slots:s,loading:c,placeholderImage:(r==null?void 0:r.baseMediaUrl)??"",taxConfig:k((r==null?void 0:r.shoppingOrderDisplayPrice)??0),order:p,withHeader:d,showConfigurableOptions:e,routeProductDetails:t})})},I=s=>{const i=(s==null?void 0:s.items)??[],o=i.filter(t=>(t==null?void 0:t.eligibleForReturn)&&(t==null?void 0:t.quantityReturnRequested)).map(t=>({...t,totalQuantity:t.quantityReturnRequested})),d=new Map(o.map(t=>[t.id,t])),e=i.map(t=>{const r=d.get(t==null?void 0:t.id);if(r){const c=t.totalQuantity-r.quantityReturnRequested;return c===0?null:{...t,totalQuantity:c}}return t}).filter(t=>t!==null);return{returnedList:o,canceledItems:e==null?void 0:e.filter(t=>t.quantityCanceled),nonCanceledItems:e==null?void 0:e.filter(t=>!t.quantityCanceled)}},j=({slots:s,placeholderImage:i,loading:o,taxConfig:d,order:e=null,withHeader:t=!0,showConfigurableOptions:r,routeProductDetails:c})=>{const p=!!(e!=null&&e.returnNumber),m=v({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",returned:"Order.OrderProductListContent.returnedTitle",refunded:"Order.OrderProductListContent.refundedTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),y=b(()=>{var f,O;if(!e)return[];if(!p){const{returnedList:u,canceledItems:n,nonCanceledItems:C}=I(e);return[{type:"returned",list:u,title:m.returned},{type:"cancelled",list:n,title:m.cancelled},{type:"allItems",list:C,title:m.allOrders}].filter(L=>{var P;return((P=L==null?void 0:L.list)==null?void 0:P.length)>0})}return[{type:"returned",list:((O=(f=e.returns.find(u=>u.returnNumber===(e==null?void 0:e.returnNumber)))==null?void 0:f.items)==null?void 0:O.map(u=>({...u,totalQuantity:u.requestQuantity})))??[],title:m.returned}]},[e,p,m]);return e?y.every(a=>a.list.length===0)?null:l(R,{variant:"secondary",className:"order-order-product-list-content",children:y.map((a,f)=>{var u;const O=a.list.filter(n=>n!==null).reduce((n,{totalQuantity:C})=>C+n,0);return h(N,{children:[t?l(S,{title:`${a.title} (${O})`}):null,l("ul",{className:"order-order-product-list-content__items",children:(u=a.list)==null?void 0:u.filter(n=>n!==null).map(n=>l("li",{"data-testid":"order-product-list-content-item",children:l(M,{slots:s,placeholderImage:i,loading:o,product:n,itemType:a.type,taxConfig:d,translations:m,showConfigurableOptions:r,routeProductDetails:c})},n.id))})]},f)})}):l(G,{})};export{Z as OrderProductList,Z as default}; diff --git a/scripts/__dropins__/storefront-order/data/models/order-details.d.ts b/scripts/__dropins__/storefront-order/data/models/order-details.d.ts index 3495783f8f..1ced5eb299 100644 --- a/scripts/__dropins__/storefront-order/data/models/order-details.d.ts +++ b/scripts/__dropins__/storefront-order/data/models/order-details.d.ts @@ -4,7 +4,7 @@ import { OrdersReturnPropsModel } from './customer-orders-return'; export type OrderAddressModel = { city: string; company: string; - country: string; + countryCode: string; firstName: string; middleName: string; lastName: string; @@ -42,6 +42,22 @@ export type OrderItemProductModel = { }; }; export type OrderItemModel = { + giftMessage: { + senderName: string; + recipientName: string; + message: string; + }; + giftWrappingPrice: MoneyProps; + productGiftWrapping: { + uid: string; + design: string; + selected: boolean; + image: { + url: string; + label: string; + }; + price: MoneyProps; + }[]; taxCalculations: { includeAndExcludeTax: { originalPrice: MoneyProps; @@ -160,6 +176,12 @@ export type ShipmentsModel = { items: ShipmentItemsModel[]; }; export type OrderDataModel = { + giftReceiptIncluded: boolean; + printedCardIncluded: boolean; + giftWrappingOrder: { + price: MoneyProps; + uid: string; + }; placeholderImage?: string; returnNumber?: string; id: string; @@ -192,13 +214,21 @@ export type OrderDataModel = { }; shipments: ShipmentsModel[]; items: OrderItemModel[]; - totalGiftcard: MoneyProps; + totalGiftCard: MoneyProps; grandTotal: MoneyProps; totalShipping?: MoneyProps; subtotalExclTax: MoneyProps; subtotalInclTax: MoneyProps; totalTax: MoneyProps; shippingAddress: OrderAddressModel; + totalGiftOptions: { + giftWrappingForItems: MoneyProps; + giftWrappingForItemsInclTax: MoneyProps; + giftWrappingForOrder: MoneyProps; + giftWrappingForOrderInclTax: MoneyProps; + printedCard: MoneyProps; + printedCardInclTax: MoneyProps; + }; billingAddress: OrderAddressModel; availableActions: AvailableActionsProps[]; taxes: { @@ -206,6 +236,10 @@ export type OrderDataModel = { rate: number; title: string; }[]; + appliedGiftCards: { + code: string; + appliedBalance: MoneyProps; + }[]; }; export type TransformedData = T extends 'orderData' ? OrderDataModel : null; //# sourceMappingURL=order-details.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/data/models/store-config.d.ts b/scripts/__dropins__/storefront-order/data/models/store-config.d.ts index 91917cd120..a2e694540e 100644 --- a/scripts/__dropins__/storefront-order/data/models/store-config.d.ts +++ b/scripts/__dropins__/storefront-order/data/models/store-config.d.ts @@ -24,6 +24,8 @@ export interface StoreConfigModel { shoppingOrdersDisplayFullSummary: boolean; shoppingOrdersDisplayGrandTotal: boolean; shoppingOrdersDisplayZeroTax: boolean; + salesPrintedCard: number; + salesGiftWrapping: number; } export interface OrderCancellationReason { description: string; diff --git a/scripts/__dropins__/storefront-order/data/transforms/transform-order-details.d.ts b/scripts/__dropins__/storefront-order/data/transforms/transform-order-details.d.ts index 643f5ddade..2bc7a31683 100644 --- a/scripts/__dropins__/storefront-order/data/transforms/transform-order-details.d.ts +++ b/scripts/__dropins__/storefront-order/data/transforms/transform-order-details.d.ts @@ -12,6 +12,13 @@ export declare const transformLinks: (links: { result: string; } | null; export declare const transformOrderItems: (items: OrderItemProps[]) => OrderItemModel[]; +export declare const transformAppliedGiftCards: (appliedGiftCards?: any[]) => { + code: any; + appliedBalance: { + value: any; + currency: any; + }; +}[]; export declare const transformOrderData: (orderData: OrderProps, returnRef?: string) => OrderDataModel; export declare const transformOrderDetails: (queryType: QueryType, response: ResponseData, returnRef?: string) => TransformedData; //# sourceMappingURL=transform-order-details.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/fragments.js b/scripts/__dropins__/storefront-order/fragments.js index e6663b7267..4bcac0862f 100644 --- a/scripts/__dropins__/storefront-order/fragments.js +++ b/scripts/__dropins__/storefront-order/fragments.js @@ -1,4 +1,4 @@ -const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { +const o = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { __typename uid status @@ -28,6 +28,10 @@ const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { name sku only_x_left_in_stock + gift_wrapping_price { + currency + value + } stock_status thumbnail { label @@ -41,7 +45,7 @@ const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { } } } -}`, t = `fragment PRICE_DETAILS_FRAGMENT on OrderItemInterface { +}`, r = `fragment PRICE_DETAILS_FRAGMENT on OrderItemInterface { prices { price_including_tax { value @@ -60,10 +64,10 @@ const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { currency } } -}`, r = `fragment GIFT_CARD_DETAILS_FRAGMENT on GiftCardOrderItem { +}`, t = `fragment GIFT_CARD_DETAILS_FRAGMENT on GiftCardOrderItem { ...PRICE_DETAILS_FRAGMENT gift_message { - message + ...GIFT_MESSAGE_FRAGMENT } gift_card { recipient_name @@ -73,6 +77,9 @@ const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { message } }`, n = `fragment ORDER_ITEM_DETAILS_FRAGMENT on OrderItemInterface { + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } __typename status product_sku @@ -86,6 +93,9 @@ const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { quantity_invoiced quantity_refunded quantity_return_requested + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } product_sale_price { value currency @@ -108,7 +118,7 @@ const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { product_name } } -}`, E = ``, R = `fragment ORDER_ITEM_FRAGMENT on OrderItemInterface { +}`, E = ``, i = `fragment ORDER_ITEM_FRAGMENT on OrderItemInterface { ...ORDER_ITEM_DETAILS_FRAGMENT ... on BundleOrderItem { ...BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT @@ -120,7 +130,33 @@ const T = `fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { } } } -${E}`, i = `fragment ORDER_SUMMARY_FRAGMENT on OrderTotal { +${E}`, R = `fragment ORDER_SUMMARY_FRAGMENT on OrderTotal { + gift_options { + gift_wrapping_for_items { + currency + value + } + gift_wrapping_for_items_incl_tax { + currency + value + } + gift_wrapping_for_order { + currency + value + } + gift_wrapping_for_order_incl_tax { + currency + value + } + printed_card { + currency + value + } + printed_card_incl_tax { + currency + value + } + } grand_total { value currency @@ -160,7 +196,7 @@ ${E}`, i = `fragment ORDER_SUMMARY_FRAGMENT on OrderTotal { } label } -}`, u = (`fragment RETURNS_FRAGMENT on Returns { +}`, c = (`fragment RETURNS_FRAGMENT on Returns { __typename items { number @@ -199,7 +235,56 @@ ${E}`, i = `fragment ORDER_SUMMARY_FRAGMENT on OrderTotal { } } } -}`), c = `fragment GUEST_ORDER_FRAGMENT on CustomerOrder { +}`), T = `fragment APPLIED_GIFT_CARDS_FRAGMENT on ApplyGiftCardToOrder { + __typename + code + applied_balance { + value + currency + } +}`, u = `fragment GIFT_MESSAGE_FRAGMENT on GiftMessage { + __typename + from + to + message +}`, A = `fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + } + price { + value + currency + } +}`, d = `fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + label + } + price { + currency + value + } +}`, s = `fragment GUEST_ORDER_FRAGMENT on CustomerOrder { + printed_card_included + gift_receipt_included + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + applied_gift_cards { + ...APPLIED_GIFT_CARDS_FRAGMENT + } + items_eligible_for_return { + ...ORDER_ITEM_DETAILS_FRAGMENT + } email id number @@ -209,13 +294,8 @@ ${E}`, i = `fragment ORDER_SUMMARY_FRAGMENT on OrderTotal { token carrier shipping_method - printed_card_included - gift_receipt_included available_actions is_virtual - items_eligible_for_return { - ...ORDER_ITEM_DETAILS_FRAGMENT - } returns { ...RETURNS_FRAGMENT } @@ -271,25 +351,32 @@ ${E}`, i = `fragment ORDER_SUMMARY_FRAGMENT on OrderTotal { } } ${_} -${t} ${r} +${t} ${n} ${a} -${i} +${R} ${e} +${c} +${i} +${A} ${u} -${R}`; +${T}`; export { e as ADDRESS_FRAGMENT, +T as APPLIED_GIFT_CARDS_FRAGMENT, +d as AVAILABLE_GIFT_WRAPPING_FRAGMENT, a as BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT, E as DOWNLOADABLE_ORDER_ITEMS_FRAGMENT, -r as GIFT_CARD_DETAILS_FRAGMENT, -c as GUEST_ORDER_FRAGMENT, +t as GIFT_CARD_DETAILS_FRAGMENT, +u as GIFT_MESSAGE_FRAGMENT, +A as GIFT_WRAPPING_FRAGMENT, +s as GUEST_ORDER_FRAGMENT, n as ORDER_ITEM_DETAILS_FRAGMENT, -R as ORDER_ITEM_FRAGMENT, -i as ORDER_SUMMARY_FRAGMENT, -t as PRICE_DETAILS_FRAGMENT, +i as ORDER_ITEM_FRAGMENT, +R as ORDER_SUMMARY_FRAGMENT, +r as PRICE_DETAILS_FRAGMENT, _ as PRODUCT_DETAILS_FRAGMENT, -T as REQUEST_RETURN_ORDER_FRAGMENT, -u as RETURNS_FRAGMENT +o as REQUEST_RETURN_ORDER_FRAGMENT, +c as RETURNS_FRAGMENT }; \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/fragments.original.js b/scripts/__dropins__/storefront-order/fragments.original.js index 8adeee2205..a6cef78b03 100644 --- a/scripts/__dropins__/storefront-order/fragments.original.js +++ b/scripts/__dropins__/storefront-order/fragments.original.js @@ -1,6 +1,6 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ -const T=` +const o=` fragment REQUEST_RETURN_ORDER_FRAGMENT on Return { __typename uid @@ -35,6 +35,10 @@ const T=` name sku only_x_left_in_stock + gift_wrapping_price { + currency + value + } stock_status thumbnail { label @@ -49,7 +53,7 @@ const T=` } } } -`,t=` +`,r=` fragment PRICE_DETAILS_FRAGMENT on OrderItemInterface { prices { price_including_tax { @@ -70,11 +74,11 @@ const T=` } } } -`,r=` +`,t=` fragment GIFT_CARD_DETAILS_FRAGMENT on GiftCardOrderItem { ...PRICE_DETAILS_FRAGMENT gift_message { - message + ...GIFT_MESSAGE_FRAGMENT } gift_card { recipient_name @@ -86,6 +90,9 @@ const T=` } `,n=` fragment ORDER_ITEM_DETAILS_FRAGMENT on OrderItemInterface { + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } __typename status product_sku @@ -99,6 +106,9 @@ const T=` quantity_invoiced quantity_refunded quantity_return_requested + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } product_sale_price { value currency @@ -132,7 +142,7 @@ const T=` title } } -`,R=` +`,i=` fragment ORDER_ITEM_FRAGMENT on OrderItemInterface { ...ORDER_ITEM_DETAILS_FRAGMENT ... on BundleOrderItem { @@ -148,8 +158,34 @@ const T=` } ${E} -`,i=` +`,R=` fragment ORDER_SUMMARY_FRAGMENT on OrderTotal { + gift_options { + gift_wrapping_for_items { + currency + value + } + gift_wrapping_for_items_incl_tax { + currency + value + } + gift_wrapping_for_order { + currency + value + } + gift_wrapping_for_order_incl_tax { + currency + value + } + printed_card { + currency + value + } + printed_card_incl_tax { + currency + value + } + } grand_total { value currency @@ -190,7 +226,7 @@ const T=` label } } -`,u=` +`,c=` fragment RETURNS_FRAGMENT on Returns { __typename items { @@ -231,8 +267,65 @@ const T=` } } } -`,c=` +`,T=` + fragment APPLIED_GIFT_CARDS_FRAGMENT on ApplyGiftCardToOrder { + __typename + code + applied_balance { + value + currency + } + } +`,u=` + fragment GIFT_MESSAGE_FRAGMENT on GiftMessage { + __typename + from + to + message + } +`,A=` + fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + } + price { + value + currency + } + } +`,d=` + fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping { + __typename + uid + design + image { + url + label + } + price { + currency + value + } + } +`,s=` fragment GUEST_ORDER_FRAGMENT on CustomerOrder { + printed_card_included + gift_receipt_included + gift_wrapping { + ...GIFT_WRAPPING_FRAGMENT + } + gift_message { + ...GIFT_MESSAGE_FRAGMENT + } + applied_gift_cards { + ...APPLIED_GIFT_CARDS_FRAGMENT + } + items_eligible_for_return { + ...ORDER_ITEM_DETAILS_FRAGMENT + } email id number @@ -242,13 +335,8 @@ const T=` token carrier shipping_method - printed_card_included - gift_receipt_included available_actions is_virtual - items_eligible_for_return { - ...ORDER_ITEM_DETAILS_FRAGMENT - } returns { ...RETURNS_FRAGMENT } @@ -304,12 +392,15 @@ const T=` } } ${_} - ${t} ${r} + ${t} ${n} ${a} - ${i} + ${R} ${e} + ${c} + ${i} + ${A} ${u} - ${R} -`;export{e as ADDRESS_FRAGMENT,a as BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT,E as DOWNLOADABLE_ORDER_ITEMS_FRAGMENT,r as GIFT_CARD_DETAILS_FRAGMENT,c as GUEST_ORDER_FRAGMENT,n as ORDER_ITEM_DETAILS_FRAGMENT,R as ORDER_ITEM_FRAGMENT,i as ORDER_SUMMARY_FRAGMENT,t as PRICE_DETAILS_FRAGMENT,_ as PRODUCT_DETAILS_FRAGMENT,T as REQUEST_RETURN_ORDER_FRAGMENT,u as RETURNS_FRAGMENT}; + ${T} +`;export{e as ADDRESS_FRAGMENT,T as APPLIED_GIFT_CARDS_FRAGMENT,d as AVAILABLE_GIFT_WRAPPING_FRAGMENT,a as BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT,E as DOWNLOADABLE_ORDER_ITEMS_FRAGMENT,t as GIFT_CARD_DETAILS_FRAGMENT,u as GIFT_MESSAGE_FRAGMENT,A as GIFT_WRAPPING_FRAGMENT,s as GUEST_ORDER_FRAGMENT,n as ORDER_ITEM_DETAILS_FRAGMENT,i as ORDER_ITEM_FRAGMENT,R as ORDER_SUMMARY_FRAGMENT,r as PRICE_DETAILS_FRAGMENT,_ as PRODUCT_DETAILS_FRAGMENT,o as REQUEST_RETURN_ORDER_FRAGMENT,c as RETURNS_FRAGMENT}; diff --git a/scripts/__dropins__/storefront-order/hooks/containers/useCreateReturn.d.ts b/scripts/__dropins__/storefront-order/hooks/containers/useCreateReturn.d.ts index 2c174c4258..80c5ca6eda 100644 --- a/scripts/__dropins__/storefront-order/hooks/containers/useCreateReturn.d.ts +++ b/scripts/__dropins__/storefront-order/hooks/containers/useCreateReturn.d.ts @@ -4,6 +4,12 @@ import { RefObject } from 'preact'; export declare const useCreateReturn: ({ onSuccess, onError, handleSetInLineAlert, orderData, }: UseCreateReturn) => { order: { + giftReceiptIncluded?: boolean | undefined; + printedCardIncluded?: boolean | undefined; + giftWrappingOrder?: { + price: import('../../types').MoneyProps; + uid: string; + } | undefined; placeholderImage?: string | undefined; returnNumber?: string | undefined; id: string; @@ -36,13 +42,21 @@ export declare const useCreateReturn: ({ onSuccess, onError, handleSetInLineAler } | undefined; shipments?: import('../../data/models').ShipmentsModel[] | undefined; items?: OrderItemModel[] | undefined; - totalGiftcard?: import('../../types').MoneyProps | undefined; + totalGiftCard?: import('../../types').MoneyProps | undefined; grandTotal?: import('../../types').MoneyProps | undefined; totalShipping?: import('../../types').MoneyProps | undefined; subtotalExclTax?: import('../../types').MoneyProps | undefined; subtotalInclTax?: import('../../types').MoneyProps | undefined; totalTax?: import('../../types').MoneyProps | undefined; shippingAddress?: import('../../data/models').OrderAddressModel | undefined; + totalGiftOptions?: { + giftWrappingForItems: import('../../types').MoneyProps; + giftWrappingForItemsInclTax: import('../../types').MoneyProps; + giftWrappingForOrder: import('../../types').MoneyProps; + giftWrappingForOrderInclTax: import('../../types').MoneyProps; + printedCard: import('../../types').MoneyProps; + printedCardInclTax: import('../../types').MoneyProps; + } | undefined; billingAddress?: import('../../data/models').OrderAddressModel | undefined; availableActions?: import('../../types').AvailableActionsProps[] | undefined; taxes?: { @@ -50,6 +64,10 @@ export declare const useCreateReturn: ({ onSuccess, onError, handleSetInLineAler rate: number; title: string; }[] | undefined; + appliedGiftCards?: { + code: string; + appliedBalance: import('../../types').MoneyProps; + }[] | undefined; }; steps: StepsTypes; loading: boolean; diff --git a/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts b/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts index 130bf4e825..5556f45db1 100644 --- a/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts +++ b/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts @@ -30,6 +30,7 @@ declare const _default: { "OrderCostSummary": { "headerText": "Order summary", "headerReturnText": "Return summary", + "totalFree": "Free", "subtotal": { "title": "Subtotal" }, @@ -37,6 +38,26 @@ declare const _default: { "title": "Shipping", "freeShipping": "Free shipping" }, + "appliedGiftCards": { + "label": { "singular": "Gift card", "plural": "Gift cards" } + }, + "giftOptionsTax": { + "printedCard": { + "title": "Printer card", + "inclTax": "Including taxes", + "exclTax": "Excluding taxes" + }, + "itemGiftWrapping": { + "title": "Item gift wrapping", + "inclTax": "Including taxes", + "exclTax": "Excluding taxes" + }, + "orderGiftWrapping": { + "title": "Order gift wrapping", + "inclTax": "Including taxes", + "exclTax": "Excluding taxes" + } + }, "tax": { "accordionTitle": "Taxes", "accordionTotalTax": "Tax Total", diff --git a/scripts/__dropins__/storefront-order/lib/categorizeProducts.d.ts b/scripts/__dropins__/storefront-order/lib/categorizeProducts.d.ts index 7a11a1baff..9b201b33c8 100644 --- a/scripts/__dropins__/storefront-order/lib/categorizeProducts.d.ts +++ b/scripts/__dropins__/storefront-order/lib/categorizeProducts.d.ts @@ -3,6 +3,22 @@ import { OrderDataModel, OrderItemModel } from '../data/models'; export declare const categorizeProducts: (order: OrderDataModel) => { returnedList: { totalQuantity: number; + giftMessage: { + senderName: string; + recipientName: string; + message: string; + }; + giftWrappingPrice: import('../types/index').MoneyProps; + productGiftWrapping: { + uid: string; + design: string; + selected: boolean; + image: { + url: string; + label: string; + }; + price: import('../types/index').MoneyProps; + }[]; taxCalculations: { includeAndExcludeTax: { originalPrice: import('../types/index').MoneyProps; diff --git a/scripts/__dropins__/storefront-order/render.js b/scripts/__dropins__/storefront-order/render.js index 1e426fe67d..9a25f866e4 100644 --- a/scripts/__dropins__/storefront-order/render.js +++ b/scripts/__dropins__/storefront-order/render.js @@ -1,5 +1,5 @@ /*! Copyright 2025 Adobe All Rights Reserved. */ (function(n,e){try{if(typeof document<"u"){const r=document.createElement("style"),a=e.styleId;for(const t in e.attributes)r.setAttribute(t,e.attributes[t]);r.setAttribute("data-dropin",a),r.appendChild(document.createTextNode(n));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})(`.dropin-button,.dropin-iconButton{border:0 none;cursor:pointer;white-space:normal}.dropin-button{border-radius:var(--shape-border-radius-3);font-size:var(--type-button-1-font);font-weight:var(--type-button-1-font);padding:var(--spacing-xsmall) var(--spacing-medium);display:flex;justify-content:center;align-items:center;text-align:left;word-wrap:break-word}.dropin-iconButton{height:var(--spacing-xbig);width:var(--spacing-xbig);padding:var(--spacing-xsmall)}.dropin-button:disabled,.dropin-iconButton:disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button:not(:disabled),.dropin-iconButton:not(:disabled){cursor:pointer}.dropin-button:focus,.dropin-iconButton:focus{outline:none}.dropin-button:focus-visible,.dropin-iconButton:focus-visible{outline:var(--spacing-xxsmall) solid var(--color-button-focus)}.dropin-button--primary,a.dropin-button--primary,.dropin-iconButton--primary{border:none;background:var(--color-brand-500) 0 0% no-repeat padding-box;color:var(--color-neutral-50);text-align:left;margin-right:0}.dropin-iconButton--primary{border-radius:var(--spacing-xbig);min-height:var(--spacing-xbig);min-width:var(--spacing-xbig);padding:var(--spacing-xsmall)}.dropin-button--primary--disabled,a.dropin-button--primary--disabled,.dropin-iconButton--primary--disabled{background:var(--color-neutral-300) 0 0% no-repeat padding-box;color:var(--color-neutral-500);fill:var(--color-neutral-300);pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button--primary:hover,a.dropin-button--primary:hover,.dropin-iconButton--primary:hover,.dropin-button--primary:focus:hover,.dropin-iconButton--primary:focus:hover{background-color:var(--color-button-hover);text-decoration:none}.dropin-button--primary:focus,.dropin-iconButton--primary:focus{background-color:var(--color-brand-500)}.dropin-button--primary:hover:active,.dropin-iconButton--primary:hover:active{background-color:var(--color-button-active)}.dropin-button--secondary,a.dropin-button--secondary,.dropin-iconButton--secondary{border:var(--shape-border-width-2) solid var(--color-brand-500);background:none 0 0% no-repeat padding-box;color:var(--color-brand-500);padding-top:calc(var(--spacing-xsmall) - var(--shape-border-width-2));padding-left:calc(var(--spacing-medium) - var(--shape-border-width-2))}.dropin-iconButton--secondary{border-radius:var(--spacing-xbig);min-height:var(--spacing-xbig);min-width:var(--spacing-xbig);padding:var(--spacing-xsmall);padding-top:calc(var(--spacing-xsmall) - var(--shape-border-width-2));padding-left:calc(var(--spacing-xsmall) - var(--shape-border-width-2))}.dropin-button--secondary--disabled,a.dropin-button--secondary--disabled,.dropin-iconButton--secondary--disabled{border:var(--shape-border-width-2) solid var(--color-neutral-300);background:none 0 0% no-repeat padding-box;color:var(--color-neutral-500);fill:var(--color-neutral-300);pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button--secondary:hover,a.dropin-button--secondary:hover,.dropin-iconButton--secondary:hover{border:var(--shape-border-width-2) solid var(--color-button-hover);color:var(--color-button-hover);text-decoration:none}.dropin-button--secondary:active,.dropin-iconButton--secondary:active{border:var(--shape-border-width-2) solid var(--color-button-active);color:var(--color-button-active)}.dropin-button--tertiary,a.dropin-button--tertiary,.dropin-iconButton--tertiary{border:none;background:none 0 0% no-repeat padding-box;color:var(--color-brand-500)}.dropin-iconButton--tertiary{border:none;border-radius:var(--spacing-xbig);min-height:var(--spacing-xbig);min-width:var(--spacing-xbig);padding:var(--spacing-xsmall)}.dropin-button--tertiary--disabled,a.dropin-button--tertiary--disabled,.dropin-iconButton--tertiary--disabled{border:none;color:var(--color-neutral-500);pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button--tertiary:hover,a.dropin-button--tertiary:hover,.dropin-iconButton--tertiary:hover{color:var(--color-button-hover);text-decoration:none}.dropin-button--tertiary:active,.dropin-iconButton--tertiary:active{color:var(--color-button-active)}.dropin-button--tertiary:focus-visible,.dropin-iconButton--tertiary:focus-visible{-webkit-box-shadow:inset 0 0 0 2px var(--color-neutral-800);-moz-box-shadow:inset 0 0 0 2px var(--color-neutral-800);box-shadow:inset 0 0 0 2px var(--color-neutral-800)}.dropin-button--large{font:var(--type-button-1-font);letter-spacing:var(--type-button-1-letter-spacing)}.dropin-button--medium{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.dropin-button-icon{height:24px}.dropin-button--with-icon{column-gap:var(--spacing-xsmall);row-gap:var(--spacing-xsmall)} -.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:block;flex-direction:column}.order-customer-details-content__container-shipping_address,.order-customer-details-content__container-billing_address{margin:var(--spacing-medium) 0}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container--no-margin p{margin-bottom:0}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address,.order-customer-details-content__container-return-information{grid-area:2 / 2 / 3 / 3;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address--fullwidth{grid-area:2 / 1 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}.order-customer-details-content__container-payment_methods--fullwidth{grid-area:3 / 1 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-customer-details-content__container-return-information .order-customer-details-content__container-description p{float:none;display:block}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing);cursor:pointer}.order-order-actions__wrapper--empty{display:none}.order-order-cancel-reasons-form__text{text-align:left;color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}.order-order-cancel__modal{margin:auto}.order-order-cancel__modal .dropin-modal__header{display:grid;grid-template-columns:1fr auto}.order-order-cancel__title{color:var(--color-neutral-900);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-order-cancel__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel__modal .dropin-modal__header-close-button{align-self:center}.order-order-cancel__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}@media only screen and (min-width: 768px){.dropin-modal__body--medium.order-order-cancel__modal>.dropin-modal__header-title{margin:0 var(--spacing-xxbig) var(--spacing-medium)}}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font);font-weight:700}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-header{text-align:center;padding:var(--spacing-xxbig)}.order-header__icon{margin-bottom:var(--spacing-small)}.order-header__title{color:var(--color-neutral-800);font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);justify-content:center;margin:0}.order-header__title:first-letter{text-transform:uppercase}.order-header__order{color:var(--color-neutral-700);font:var(--type-details-overline-font);letter-spacing:var(--type-details-overline-letter-spacing);margin:var(--spacing-xxsmall) 0 0 0}.order-header .success-icon{color:var(--color-positive-500)}.order-header-create-account{display:grid;gap:var(--spacing-small);margin-top:var(--spacing-large)}.order-header-create-account__message{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-header-create-account__button{display:flex;margin:0 auto;text-align:center}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0 0 var(--spacing-medium) 0;padding:0}.order-order-product-list-content .dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "lastname" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--lastname{grid-area:lastname}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email lastname" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper .order-order-status-content__wrapper-description p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-order-status-content__wrapper-description--actions-slot{margin-bottom:0}.order-return-order-message p{margin:0;padding:0}.order-return-order-message a{max-width:162px;padding:var(--spacing-xsmall)}.order-return-order-message .order-return-order-message__title{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800);margin-bottom:var(--spacing-small)}.order-return-order-message .order-return-order-message__subtitle{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-bottom:var(--spacing-xlarge)}.order-create-return .order-create-return_notification{margin-bottom:var(--spacing-medium)}.order-return-order-product-list{list-style:none;margin:0;padding:0}.order-return-order-product-list .order-return-order-product-list__item{display:grid;grid-template-columns:auto 1fr;align-items:start;margin-bottom:var(--spacing-medium);position:relative}.order-return-order-product-list__item--blur:before{content:"";position:absolute;width:100%;height:100%;background-color:var(--color-opacity-24);z-index:1}.order-return-order-product-list>.order-return-order-product-list__item:last-child{display:flex;justify-content:flex-end}.order-return-order-product-list>.order-return-order-product-list__item .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-return-order-product-list>.order-return-order-product-list__item .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-create-return .dropin-cart-item__footer .dropin-incrementer.dropin-incrementer--medium{max-width:160px}.order-return-order-product-list .dropin-incrementer__button-container{margin:0}@media only screen and (min-width: 320px) and (max-width: 768px){.order-return-order-product-list>.order-return-order-product-list__item{margin-bottom:var(--spacing-medium)}}.order-return-reason-form .dropin-cart-item,.order-return-reason-form form .dropin-field{margin-bottom:var(--spacing-medium)}.order-return-reason-form .order-return-reason-form__actions{display:flex;gap:0 var(--spacing-medium);justify-content:flex-end;margin-bottom:0}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content a.order-returns-list-content__actions{display:inline-block;width:100%}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images,.order-returns-list-content .dropin-content-grid{overflow:auto}.order-returns-list-content hr.dropin-divider.dropin-divider--secondary:last-child{display:none}.order-returns-list-content .dropin-accordion-section__content-container{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:85px;height:114px}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card .dropin-content-grid{overflow:auto}.order-shipping-status-card hr.dropin-divider.dropin-divider--secondary:last-child{display:none}.order-shipping-status-card .dropin-accordion-section__content-container{margin-bottom:var(--spacing-small)}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p,.order-shipping-status-card--return-order p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card--return-order p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-shipping-status-card--return-order p a:hover{text-decoration:none;color:var(--color-brand-800)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-shipping-status-card.order-shipping-status-card--return-order .dropin-content-grid.order-shipping-status-card__images{overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}`,{styleId:"order"}); -import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as i}from"@dropins/tools/lib.js";import{useState as n,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as l}from"@dropins/tools/components.js";import{events as c}from"@dropins/tools/event-bus.js";const u={CreateReturn:{headerText:"Return items",downloadableCount:"Files",returnedItems:"Returned items:",configurationsList:{quantity:"Quantity"},stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},giftCard:{sender:"Sender",recipient:"Recipient",message:"Note"},success:{title:"Return submitted",message:"Your return request has been successfully submitted."},buttons:{nextStep:"Continue",backStep:"Back",submit:"Submit return",backStore:"Back to order"}},OrderCostSummary:{headerText:"Order summary",headerReturnText:"Return summary",subtotal:{title:"Subtotal"},shipping:{title:"Shipping",freeShipping:"Free shipping"},tax:{accordionTitle:"Taxes",accordionTotalTax:"Tax Total",totalExcludingTaxes:"Total excluding taxes",title:"Tax",incl:"Including taxes",excl:"Excluding taxes"},discount:{title:"Discount",subtitle:"discounted"},total:{title:"Total"}},Returns:{minifiedView:{returnsList:{viewAllOrdersButton:"View all returns",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Recent returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}},fullSizeView:{returnsList:{viewAllOrdersButton:"View all orders",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}}},OrderProductListContent:{cancelledTitle:"Cancelled",allOrdersTitle:"Your order",returnedTitle:"Returned",refundedTitle:"Your refunded",downloadableCount:"Files",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},GiftCard:{sender:"Sender",recipient:"Recipient",message:"Note"}},OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",lastname:"Last Name",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{orderNumber:"Order number:",returnNumber:"Return number:",itemText:{none:"",one:"Package contents ({{count}} item)",many:"Package contents ({{count}} items)"},trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",returnOrderCardTitle:"Package details",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping information",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:{singular:"Package contents ({{count}} item)",plural:"Package contents ({{count}} items)"}},OrderStatusContent:{noInfoTitle:"Check back later for more details.",returnMessage:"The order was placed on {ORDER_CREATE_DATE} and your return process started on {RETURN_CREATE_DATE}",returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"},actions:{cancel:"Cancel order",confirmGuestReturn:"Return request confirmed",confirmGuestReturnMessage:"Your return request has been successfully confirmed.",createReturn:"Return or replace",createAnotherReturn:"Start another return",reorder:"Reorder"},orderPlaceholder:{title:"",message:"Your order has been in its current status since {DATE}.",messageWithoutDate:"Your order has been in its current status for some time."},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days.",messageWithoutDate:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"Cancellation requested",message:"The cancellation has been requested on {DATE}. Check your email for further instructions.",messageWithoutDate:"The cancellation has been requested. Check your email for further instructions."},orderPendingPayment:{title:"Pending Payment",message:"The order was successfully placed on {DATE}, but it is awaiting payment. Please complete the payment so we can start processing your order.",messageWithoutDate:"Your order is awaiting payment. Please complete the payment so we can start processing your order."},orderRejected:{title:"Rejected",message:"Your order was rejected on {DATE}. Please contact us for more information.",messageWithoutDate:"Your order was rejected. Please contact us for more information."},orderAuthorized:{title:"Authorized",message:"Your order was successfully authorized on {DATE}. We will begin processing your order shortly.",messageWithoutDate:"Your order was successfully authorized. We will begin processing your order shortly."},orderPaypalCanceledReversal:{title:"PayPal Canceled Reversal",message:"The PayPal transaction reversal was canceled on {DATE}. Please check your order details for more information.",messageWithoutDate:"The PayPal transaction reversal was canceled. Please check your order details for more information."},orderPendingPaypal:{title:"Pending PayPal",message:"Your order is awaiting PayPal payment confirmation since {DATE}. Please check your PayPal account for the payment status.",messageWithoutDate:"Your order is awaiting PayPal payment confirmation. Please check your PayPal account for the payment status."},orderPaypalReversed:{title:"PayPal Reversed",message:"The PayPal payment was reversed on {DATE}. Please contact us for further details.",messageWithoutDate:"The PayPal payment was reversed. Please contact us for further details."},orderClosed:{title:"Closed",message:"The order placed on {DATE} has been closed. For any further assistance, please contact support.",messageWithoutDate:"Your order has been closed. For any further assistance, please contact support."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",orderReturnLabels:{createdReturnAt:"Return requested on: ",returnStatusLabel:"Return status: ",orderNumberLabel:"Order number: "},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"},email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},paymentMethods:{title:"Payment method"},returnInformation:{title:"Return details"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},OrderCancelForm:{title:"Cancel order",description:"Select a reason for canceling the order",label:"Reason for cancel",button:"Submit Cancellation",errorHeading:"Error",errorDescription:"There was an error processing your order cancellation."},OrderHeader:{title:"{{name}}, thank you for your order!",defaultTitle:"Thank you for your order!",order:"ORDER #{{order}}",CreateAccount:{message:"Save your information for faster checkout next time.",button:"Create an account"}}},p={Order:u},m={default:p},h=({children:t})=>{const[o,a]=n("en_US");return d(()=>{const e=c.on("locale",s=>{a(s)},{eager:!0});return()=>{e==null||e.off()}},[]),r(l,{lang:o,langDefinitions:m,children:t})},T=new i(r(h,{}));export{T as render}; +.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:block;flex-direction:column}.order-customer-details-content__container-shipping_address,.order-customer-details-content__container-billing_address{margin:var(--spacing-medium) 0}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container--no-margin p{margin-bottom:0}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address,.order-customer-details-content__container-return-information{grid-area:2 / 2 / 3 / 3;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address--fullwidth{grid-area:2 / 1 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}.order-customer-details-content__container-payment_methods--fullwidth{grid-area:3 / 1 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-customer-details-content__container-return-information .order-customer-details-content__container-description p{float:none;display:block}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing);cursor:pointer}.order-order-actions__wrapper--empty{display:none}.order-order-cancel-reasons-form__text{text-align:left;color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}.order-order-cancel__modal{margin:auto}.order-order-cancel__modal .dropin-modal__header{display:grid;grid-template-columns:1fr auto}.order-order-cancel__title{color:var(--color-neutral-900);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-order-cancel__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel__modal .dropin-modal__header-close-button{align-self:center}.order-order-cancel__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}@media only screen and (min-width: 768px){.dropin-modal__body--medium.order-order-cancel__modal>.dropin-modal__header-title{margin:0 var(--spacing-xxbig) var(--spacing-medium)}}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--printed-card .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--gift-wrapping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--printed-card .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--gift-wrapping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font);font-weight:700}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader svg{color:var(--color-neutral-800)}.order-cost-summary-content__description--total-free{text-transform:uppercase;font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-header{text-align:center;padding:var(--spacing-xxbig)}.order-header__icon{margin-bottom:var(--spacing-small)}.order-header__title{color:var(--color-neutral-800);font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);justify-content:center;margin:0}.order-header__title:first-letter{text-transform:uppercase}.order-header__order{color:var(--color-neutral-700);font:var(--type-details-overline-font);letter-spacing:var(--type-details-overline-letter-spacing);margin:var(--spacing-xxsmall) 0 0 0}.order-header .success-icon{color:var(--color-positive-500)}.order-header-create-account{display:grid;gap:var(--spacing-small);margin-top:var(--spacing-large)}.order-header-create-account__message{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-header-create-account__button{display:flex;margin:0 auto;text-align:center}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0 0 var(--spacing-medium) 0;padding:0}.order-order-product-list-content .dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "lastname" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--lastname{grid-area:lastname}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email lastname" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper .order-order-status-content__wrapper-description p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-order-status-content__wrapper-description--actions-slot{margin-bottom:0}.order-return-order-message p{margin:0;padding:0}.order-return-order-message a{max-width:162px;padding:var(--spacing-xsmall)}.order-return-order-message .order-return-order-message__title{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800);margin-bottom:var(--spacing-small)}.order-return-order-message .order-return-order-message__subtitle{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-bottom:var(--spacing-xlarge)}.order-create-return .order-create-return_notification{margin-bottom:var(--spacing-medium)}.order-return-order-product-list{list-style:none;margin:0;padding:0}.order-return-order-product-list .order-return-order-product-list__item{display:grid;grid-template-columns:auto 1fr;align-items:start;margin-bottom:var(--spacing-medium);position:relative}.order-return-order-product-list__item--blur:before{content:"";position:absolute;width:100%;height:100%;background-color:var(--color-opacity-24);z-index:1}.order-return-order-product-list>.order-return-order-product-list__item:last-child{display:flex;justify-content:flex-end}.order-return-order-product-list>.order-return-order-product-list__item .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-return-order-product-list>.order-return-order-product-list__item .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-create-return .dropin-cart-item__footer .dropin-incrementer.dropin-incrementer--medium{max-width:160px}.order-return-order-product-list .dropin-incrementer__button-container{margin:0}@media only screen and (min-width: 320px) and (max-width: 768px){.order-return-order-product-list>.order-return-order-product-list__item{margin-bottom:var(--spacing-medium)}}.order-return-reason-form .dropin-cart-item,.order-return-reason-form form .dropin-field{margin-bottom:var(--spacing-medium)}.order-return-reason-form .order-return-reason-form__actions{display:flex;gap:0 var(--spacing-medium);justify-content:flex-end;margin-bottom:0}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content a.order-returns-list-content__actions{display:inline-block;width:100%}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images,.order-returns-list-content .dropin-content-grid{overflow:auto}.order-returns-list-content hr.dropin-divider.dropin-divider--secondary:last-child{display:none}.order-returns-list-content .dropin-accordion-section__content-container{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:85px;height:114px}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card .dropin-content-grid{overflow:auto}.order-shipping-status-card hr.dropin-divider.dropin-divider--secondary:last-child{display:none}.order-shipping-status-card .dropin-accordion-section__content-container{margin-bottom:var(--spacing-small)}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p,.order-shipping-status-card--return-order p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card--return-order p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-shipping-status-card--return-order p a:hover{text-decoration:none;color:var(--color-brand-800)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-shipping-status-card.order-shipping-status-card--return-order .dropin-content-grid.order-shipping-status-card__images{overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}`,{styleId:"order"}); +import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as s}from"@dropins/tools/lib.js";import{useState as n,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as l}from"@dropins/tools/components.js";import{events as c}from"@dropins/tools/event-bus.js";const u={CreateReturn:{headerText:"Return items",downloadableCount:"Files",returnedItems:"Returned items:",configurationsList:{quantity:"Quantity"},stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},giftCard:{sender:"Sender",recipient:"Recipient",message:"Note"},success:{title:"Return submitted",message:"Your return request has been successfully submitted."},buttons:{nextStep:"Continue",backStep:"Back",submit:"Submit return",backStore:"Back to order"}},OrderCostSummary:{headerText:"Order summary",headerReturnText:"Return summary",totalFree:"Free",subtotal:{title:"Subtotal"},shipping:{title:"Shipping",freeShipping:"Free shipping"},appliedGiftCards:{label:{singular:"Gift card",plural:"Gift cards"}},giftOptionsTax:{printedCard:{title:"Printer card",inclTax:"Including taxes",exclTax:"Excluding taxes"},itemGiftWrapping:{title:"Item gift wrapping",inclTax:"Including taxes",exclTax:"Excluding taxes"},orderGiftWrapping:{title:"Order gift wrapping",inclTax:"Including taxes",exclTax:"Excluding taxes"}},tax:{accordionTitle:"Taxes",accordionTotalTax:"Tax Total",totalExcludingTaxes:"Total excluding taxes",title:"Tax",incl:"Including taxes",excl:"Excluding taxes"},discount:{title:"Discount",subtitle:"discounted"},total:{title:"Total"}},Returns:{minifiedView:{returnsList:{viewAllOrdersButton:"View all returns",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Recent returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}},fullSizeView:{returnsList:{viewAllOrdersButton:"View all orders",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}}},OrderProductListContent:{cancelledTitle:"Cancelled",allOrdersTitle:"Your order",returnedTitle:"Returned",refundedTitle:"Your refunded",downloadableCount:"Files",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},GiftCard:{sender:"Sender",recipient:"Recipient",message:"Note"}},OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",lastname:"Last Name",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{orderNumber:"Order number:",returnNumber:"Return number:",itemText:{none:"",one:"Package contents ({{count}} item)",many:"Package contents ({{count}} items)"},trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",returnOrderCardTitle:"Package details",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping information",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:{singular:"Package contents ({{count}} item)",plural:"Package contents ({{count}} items)"}},OrderStatusContent:{noInfoTitle:"Check back later for more details.",returnMessage:"The order was placed on {ORDER_CREATE_DATE} and your return process started on {RETURN_CREATE_DATE}",returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"},actions:{cancel:"Cancel order",confirmGuestReturn:"Return request confirmed",confirmGuestReturnMessage:"Your return request has been successfully confirmed.",createReturn:"Return or replace",createAnotherReturn:"Start another return",reorder:"Reorder"},orderPlaceholder:{title:"",message:"Your order has been in its current status since {DATE}.",messageWithoutDate:"Your order has been in its current status for some time."},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days.",messageWithoutDate:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"Cancellation requested",message:"The cancellation has been requested on {DATE}. Check your email for further instructions.",messageWithoutDate:"The cancellation has been requested. Check your email for further instructions."},orderPendingPayment:{title:"Pending Payment",message:"The order was successfully placed on {DATE}, but it is awaiting payment. Please complete the payment so we can start processing your order.",messageWithoutDate:"Your order is awaiting payment. Please complete the payment so we can start processing your order."},orderRejected:{title:"Rejected",message:"Your order was rejected on {DATE}. Please contact us for more information.",messageWithoutDate:"Your order was rejected. Please contact us for more information."},orderAuthorized:{title:"Authorized",message:"Your order was successfully authorized on {DATE}. We will begin processing your order shortly.",messageWithoutDate:"Your order was successfully authorized. We will begin processing your order shortly."},orderPaypalCanceledReversal:{title:"PayPal Canceled Reversal",message:"The PayPal transaction reversal was canceled on {DATE}. Please check your order details for more information.",messageWithoutDate:"The PayPal transaction reversal was canceled. Please check your order details for more information."},orderPendingPaypal:{title:"Pending PayPal",message:"Your order is awaiting PayPal payment confirmation since {DATE}. Please check your PayPal account for the payment status.",messageWithoutDate:"Your order is awaiting PayPal payment confirmation. Please check your PayPal account for the payment status."},orderPaypalReversed:{title:"PayPal Reversed",message:"The PayPal payment was reversed on {DATE}. Please contact us for further details.",messageWithoutDate:"The PayPal payment was reversed. Please contact us for further details."},orderClosed:{title:"Closed",message:"The order placed on {DATE} has been closed. For any further assistance, please contact support.",messageWithoutDate:"Your order has been closed. For any further assistance, please contact support."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",orderReturnLabels:{createdReturnAt:"Return requested on: ",returnStatusLabel:"Return status: ",orderNumberLabel:"Order number: "},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"},email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},paymentMethods:{title:"Payment method"},returnInformation:{title:"Return details"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},OrderCancelForm:{title:"Cancel order",description:"Select a reason for canceling the order",label:"Reason for cancel",button:"Submit Cancellation",errorHeading:"Error",errorDescription:"There was an error processing your order cancellation."},OrderHeader:{title:"{{name}}, thank you for your order!",defaultTitle:"Thank you for your order!",order:"ORDER #{{order}}",CreateAccount:{message:"Save your information for faster checkout next time.",button:"Create an account"}}},p={Order:u},m={default:p},h=({children:t})=>{const[a,o]=n("en_US");return d(()=>{const e=c.on("locale",i=>{o(i)},{eager:!0});return()=>{e==null||e.off()}},[]),r(l,{lang:a,langDefinitions:m,children:t})},b=new s(r(h,{}));export{b as render}; diff --git a/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts b/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts index e921da8cae..f3872bdb6b 100644 --- a/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts +++ b/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts @@ -76,6 +76,14 @@ export interface DiscountProps { amount: MoneyProps; label: string; } +export interface TotalGiftOptionsProps { + gift_wrapping_for_items: MoneyProps; + gift_wrapping_for_items_incl_tax: MoneyProps; + gift_wrapping_for_order_incl_tax: MoneyProps; + gift_wrapping_for_order: MoneyProps; + printed_card: MoneyProps; + printed_card_incl_tax: MoneyProps; +} export interface TotalProps { total_giftcard?: MoneyProps; grand_total?: GrandTotalProps; @@ -84,6 +92,7 @@ export interface TotalProps { total_tax?: TotalTaxProps; total_shipping?: TotalShippingProps; discounts?: DiscountProps[]; + gift_options: TotalGiftOptionsProps; } interface InvoiceItemInterface { } @@ -103,14 +112,12 @@ export interface GiftMessageProps { to: string; } export interface GiftWrappingProps { - gift_wrapping: { - design: string; - price: MoneyProps; - uid: string; - image: { - url: string; - label: string; - }; + design: string; + price: MoneyProps; + uid: string; + image: { + url: string; + label: string; }; } export interface giftCardProps { @@ -262,6 +269,10 @@ export interface OrderProps { shipping_address: UserAddressesProps; billing_address: UserAddressesProps; total?: TotalProps; + applied_gift_cards: { + code: string; + applied_balance: MoneyProps; + }[]; } export interface ErrorProps { errors?: { diff --git a/scripts/__dropins__/storefront-order/types/orderCostSummary.types.d.ts b/scripts/__dropins__/storefront-order/types/orderCostSummary.types.d.ts index 24adb6b759..0fbceceba5 100644 --- a/scripts/__dropins__/storefront-order/types/orderCostSummary.types.d.ts +++ b/scripts/__dropins__/storefront-order/types/orderCostSummary.types.d.ts @@ -9,6 +9,8 @@ export interface StoreConfigProps extends Omit { orderData?: OrderDataModel; diff --git a/scripts/__dropins__/storefront-order/types/orderProductList.types.d.ts b/scripts/__dropins__/storefront-order/types/orderProductList.types.d.ts index 027355ea02..5bc979f00c 100644 --- a/scripts/__dropins__/storefront-order/types/orderProductList.types.d.ts +++ b/scripts/__dropins__/storefront-order/types/orderProductList.types.d.ts @@ -1,3 +1,4 @@ +import { SlotProps } from '@dropins/tools/types/elsie/src/lib'; import { OrderDataModel, OrderItemModel } from '../data/models'; type options = Record; @@ -6,6 +7,9 @@ export type TaxTypes = { taxExcluded: boolean; }; export interface OrderProductListProps { + slots?: { + Footer: SlotProps; + }; orderData?: OrderDataModel; className?: string; withHeader?: boolean; @@ -19,6 +23,9 @@ export interface OrderProductListContentProps extends Omit options; routeProductDetails?: (product: any) => string; } -export interface UseOrderProductListProps extends Omit { +export interface UseOrderProductListProps extends Omit { } export {}; //# sourceMappingURL=orderProductList.types.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/__generated__/types.d.ts b/scripts/__dropins__/storefront-search/__generated__/types.d.ts deleted file mode 100644 index 1bc701caae..0000000000 --- a/scripts/__dropins__/storefront-search/__generated__/types.d.ts +++ /dev/null @@ -1,2249 +0,0 @@ -export type Maybe = T | null; -export type InputMaybe = Maybe; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = Omit & { - [SubKey in K]?: Maybe; -}; -export type MakeMaybe = Omit & { - [SubKey in K]: Maybe; -}; -export type MakeEmpty = { - [_ in K]?: never; -}; -export type Incremental = T | { - [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; -}; -/** All built-in and custom scalars, mapped to their actual values */ -export type Scalars = { - ID: { - input: string; - output: string; - }; - String: { - input: string; - output: string; - }; - Boolean: { - input: boolean; - output: boolean; - }; - Int: { - input: number; - output: number; - }; - Float: { - input: number; - output: number; - }; - DateTime: { - input: any; - output: any; - }; - JSON: { - input: any; - output: any; - }; -}; -/** A bucket that contains information for each filterable option */ -export type Aggregation = { - __typename?: "Aggregation"; - /** The attribute code of the filter item */ - attribute: Scalars["String"]["output"]; - /** A container that divides the data into manageable groups. For example, attributes that can have numeric values might have buckets that define price ranges */ - buckets: Array>; - /** The filter name displayed in layered navigation */ - title: Scalars["String"]["output"]; - /** Identifies the data type of the aggregation */ - type?: Maybe; -}; -/** Identifies the data type of the aggregation */ -export declare enum AggregationType { - Intelligent = "INTELLIGENT", - Pinned = "PINNED", - Popular = "POPULAR" -} -/** The rule that was applied to this product */ -export type AppliedQueryRule = { - __typename?: "AppliedQueryRule"; - /** An enum that defines the type of rule that was applied */ - action_type?: Maybe; - /** The ID assigned to the rule */ - rule_id?: Maybe; - /** The name of the applied rule */ - rule_name?: Maybe; -}; -/** The type of rule that was applied to a product during search (optional) */ -export declare enum AppliedQueryRuleActionType { - Boost = "BOOST", - Bury = "BURY", - Pin = "PIN" -} -/** Contains the output of the `attributeMetadata` query */ -export type AttributeMetadataResponse = { - __typename?: "AttributeMetadataResponse"; - /** An array of product attributes that can be used for filtering in a `productSearch` query */ - filterableInSearch?: Maybe>; - /** An array of product attributes that can be used for sorting in a `productSearch` query */ - sortable?: Maybe>; -}; -/** An interface for bucket contents */ -export type Bucket = { - /** A human-readable name of a bucket */ - title: Scalars["String"]["output"]; -}; -/** Defines features of a bundle product */ -export type BundleProduct = PhysicalProductInterface & ProductInterface & { - __typename?: "BundleProduct"; - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** Relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - /** An array of custom product attributes */ - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; - /** The weight of the item, in units defined by the store */ - weight?: Maybe; -}; -/** Category view bucket for federation */ -export type CategoryView = Bucket & CategoryViewInterface & { - __typename?: "CategoryView"; - availableSortBy?: Maybe>>; - children?: Maybe>; - count: Scalars["Int"]["output"]; - defaultSortBy?: Maybe; - id: Scalars["ID"]["output"]; - level?: Maybe; - name?: Maybe; - parentId: Scalars["String"]["output"]; - path?: Maybe; - roles: Array; - title: Scalars["String"]["output"]; - urlKey?: Maybe; - urlPath?: Maybe; -}; -export type CategoryViewInterface = { - availableSortBy?: Maybe>>; - defaultSortBy?: Maybe; - id: Scalars["ID"]["output"]; - level?: Maybe; - name?: Maybe; - path?: Maybe; - roles?: Maybe>>; - urlKey?: Maybe; - urlPath?: Maybe; -}; -/** Represents all product types, except simple products. Complex product prices are returned as a price range, because price values can vary based on selected options. */ -export type ComplexProductView = ProductView & { - __typename?: "ComplexProductView"; - /** A flag stating if the product can be added to cart */ - addToCartAllowed?: Maybe; - /** A list of merchant-defined attributes designated for the storefront. */ - attributes?: Maybe>>; - /** - * List of categories to which the product belongs - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - categories?: Maybe>>; - /** The detailed description of the product. */ - description?: Maybe; - /** External Id */ - externalId?: Maybe; - /** The product ID, generated as a composite key, unique per locale. */ - id: Scalars["ID"]["output"]; - /** A list of images defined for the product. */ - images?: Maybe>>; - /** A flag stating if the product is in stock */ - inStock?: Maybe; - /** A list of input options. */ - inputOptions?: Maybe>>; - /** Date and time when the product was last updated. */ - lastModifiedAt?: Maybe; - /** A list of product links */ - links?: Maybe>>; - /** A flag stating if the product stock is low */ - lowStock?: Maybe; - /** A brief overview of the product for search results listings. */ - metaDescription?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines. */ - metaKeyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists. */ - metaTitle?: Maybe; - /** Product name. */ - name?: Maybe; - /** A list of selectable options. */ - options?: Maybe>>; - /** A range of possible prices for a complex product. */ - priceRange?: Maybe; - /** Indicates if the product was retrieved from the primary or the backup query */ - queryType?: Maybe; - /** - * Rank given to a product - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - rank?: Maybe; - /** - * Score indicating relevance of the product to the recommendation type - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - score?: Maybe; - /** A summary of the product. */ - shortDescription?: Maybe; - /** Product SKU. */ - sku?: Maybe; - /** Canonical URL of the product. */ - url?: Maybe; - /** The URL key of the product. */ - urlKey?: Maybe; - /** A list of videos defined for the product. */ - videos?: Maybe>>; - /** Visibility setting of the product */ - visibility?: Maybe; -}; -/** Represents all product types, except simple products. Complex product prices are returned as a price range, because price values can vary based on selected options. */ -export type ComplexProductViewAttributesArgs = { - roles?: InputMaybe>>; -}; -/** Represents all product types, except simple products. Complex product prices are returned as a price range, because price values can vary based on selected options. */ -export type ComplexProductViewImagesArgs = { - roles?: InputMaybe>>; -}; -/** Represents all product types, except simple products. Complex product prices are returned as a price range, because price values can vary based on selected options. */ -export type ComplexProductViewLinksArgs = { - linkTypes?: InputMaybe>; -}; -/** Text that can contain HTML tags */ -export type ComplexTextValue = { - __typename?: "ComplexTextValue"; - /** Text that can contain HTML tags */ - html: Scalars["String"]["output"]; -}; -/** Basic features of a configurable product and its simple product variants */ -export type ConfigurableProduct = PhysicalProductInterface & ProductInterface & { - __typename?: "ConfigurableProduct"; - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** A relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - /** An array of custom product attributes */ - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; - /** The weight of the item, in units defined by the store */ - weight?: Maybe; -}; -export declare enum CurrencyEnum { - Aed = "AED", - Afn = "AFN", - All = "ALL", - Amd = "AMD", - Ang = "ANG", - Aoa = "AOA", - Ars = "ARS", - Aud = "AUD", - Awg = "AWG", - Azm = "AZM", - Azn = "AZN", - Bam = "BAM", - Bbd = "BBD", - Bdt = "BDT", - Bgn = "BGN", - Bhd = "BHD", - Bif = "BIF", - Bmd = "BMD", - Bnd = "BND", - Bob = "BOB", - Brl = "BRL", - Bsd = "BSD", - Btn = "BTN", - Buk = "BUK", - Bwp = "BWP", - Byn = "BYN", - Bzd = "BZD", - Cad = "CAD", - Cdf = "CDF", - Che = "CHE", - Chf = "CHF", - Chw = "CHW", - Clp = "CLP", - Cny = "CNY", - Cop = "COP", - Crc = "CRC", - Cup = "CUP", - Cve = "CVE", - Czk = "CZK", - Djf = "DJF", - Dkk = "DKK", - Dop = "DOP", - Dzd = "DZD", - Eek = "EEK", - Egp = "EGP", - Ern = "ERN", - Etb = "ETB", - Eur = "EUR", - Fjd = "FJD", - Fkp = "FKP", - Gbp = "GBP", - Gek = "GEK", - Gel = "GEL", - Ghs = "GHS", - Gip = "GIP", - Gmd = "GMD", - Gnf = "GNF", - Gqe = "GQE", - Gtq = "GTQ", - Gyd = "GYD", - Hkd = "HKD", - Hnl = "HNL", - Hrk = "HRK", - Htg = "HTG", - Huf = "HUF", - Idr = "IDR", - Ils = "ILS", - Inr = "INR", - Iqd = "IQD", - Irr = "IRR", - Isk = "ISK", - Jmd = "JMD", - Jod = "JOD", - Jpy = "JPY", - Kes = "KES", - Kgs = "KGS", - Khr = "KHR", - Kmf = "KMF", - Kpw = "KPW", - Krw = "KRW", - Kwd = "KWD", - Kyd = "KYD", - Kzt = "KZT", - Lak = "LAK", - Lbp = "LBP", - Lkr = "LKR", - Lrd = "LRD", - Lsl = "LSL", - Lsm = "LSM", - Ltl = "LTL", - Lvl = "LVL", - Lyd = "LYD", - Mad = "MAD", - Mdl = "MDL", - Mga = "MGA", - Mkd = "MKD", - Mmk = "MMK", - Mnt = "MNT", - Mop = "MOP", - Mro = "MRO", - Mur = "MUR", - Mvr = "MVR", - Mwk = "MWK", - Mxn = "MXN", - Myr = "MYR", - Mzn = "MZN", - Nad = "NAD", - Ngn = "NGN", - Nic = "NIC", - Nok = "NOK", - Npr = "NPR", - Nzd = "NZD", - Omr = "OMR", - Pab = "PAB", - Pen = "PEN", - Pgk = "PGK", - Php = "PHP", - Pkr = "PKR", - Pln = "PLN", - Pyg = "PYG", - Qar = "QAR", - Rhd = "RHD", - Rol = "ROL", - Ron = "RON", - Rsd = "RSD", - Rub = "RUB", - Rwf = "RWF", - Sar = "SAR", - Sbd = "SBD", - Scr = "SCR", - Sdg = "SDG", - Sek = "SEK", - Sgd = "SGD", - Shp = "SHP", - Skk = "SKK", - Sll = "SLL", - Sos = "SOS", - Srd = "SRD", - Std = "STD", - Svc = "SVC", - Syp = "SYP", - Szl = "SZL", - Thb = "THB", - Tjs = "TJS", - Tmm = "TMM", - Tnd = "TND", - Top = "TOP", - Trl = "TRL", - Try = "TRY", - Ttd = "TTD", - Twd = "TWD", - Tzs = "TZS", - Uah = "UAH", - Ugx = "UGX", - Usd = "USD", - Uyu = "UYU", - Uzs = "UZS", - Veb = "VEB", - Vef = "VEF", - Vnd = "VND", - Vuv = "VUV", - Wst = "WST", - Xcd = "XCD", - Xof = "XOF", - Xpf = "XPF", - Yer = "YER", - Zar = "ZAR", - Zmk = "ZMK", - Zwd = "ZWD" -} -/** A product attribute defined by the merchant */ -export type CustomAttribute = { - __typename?: "CustomAttribute"; - /** The unique identifier for an attribute code */ - code: Scalars["String"]["output"]; - /** The value assigned to the custom attribute */ - value: Scalars["String"]["output"]; -}; -/** A product that the shopper downloads */ -export type DownloadableProduct = ProductInterface & { - __typename?: "DownloadableProduct"; - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** A relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - /** An array of custom product attributes */ - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available. */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects. */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; -}; -/** Contains product attributes that can be used for filtering in a `productSearch` query */ -export type FilterableInSearchAttribute = { - __typename?: "FilterableInSearchAttribute"; - /** The unique identifier for an attribute code. This value should be in lowercase letters and without spaces */ - attribute: Scalars["String"]["output"]; - /** Indicates how field rendered on storefront */ - frontendInput?: Maybe; - /** The display name assigned to the attribute */ - label?: Maybe; - /** Indicates whether this attribute has a numeric value, such as a price or integer */ - numeric?: Maybe; -}; -/** A single FPT that can be applied to a product price */ -export type FixedProductTax = { - __typename?: "FixedProductTax"; - /** Amount of the FPT as a money object */ - amount?: Maybe; - /** The label assigned to the FPT to be displayed on the frontend */ - label?: Maybe; -}; -/** Defines properties of a gift card, including the minimum and maximum values and an array that contains the current and past values on the specific gift card */ -export type GiftCardProduct = PhysicalProductInterface & ProductInterface & { - __typename?: "GiftCardProduct"; - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** Relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - /** An array of custom product attributes */ - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; - /** The weight of the item, in units defined by the store */ - weight?: Maybe; -}; -/** Consists of simple standalone products that are presented as a group */ -export type GroupedProduct = PhysicalProductInterface & ProductInterface & { - __typename?: "GroupedProduct"; - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** Relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - /** An array of custom product attributes */ - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; - /** The weight of the item, in units defined by the store */ - weight?: Maybe; -}; -/** An object that provides highlighted text for matched words */ -export type Highlight = { - __typename?: "Highlight"; - /** The product attribute that contains a match for the search phrase */ - attribute: Scalars["String"]["output"]; - /** An array of strings */ - matched_words: Array>; - /** The matched text, enclosed within emphasis tags */ - value: Scalars["String"]["output"]; -}; -/** Contains basic information about a product image or video */ -export type MediaGalleryInterface = { - /** Whether the image is hidden from PDP gallery */ - disabled?: Maybe; - /** The label of the product image or video */ - label?: Maybe; - /** The media item's position after it has been sorted */ - position?: Maybe; - /** The URL of the product image or video */ - url?: Maybe; -}; -/** A monetary value, including a numeric value and a currency code */ -export type Money = { - __typename?: "Money"; - /** A three-letter currency code, such as USD or EUR */ - currency?: Maybe; - /** A number expressing a monetary value */ - value?: Maybe; -}; -/** Type of page on which recommendations are requested */ -export declare enum PageType { - Cms = "CMS", - Cart = "Cart", - Category = "Category", - Checkout = "Checkout", - PageBuilder = "PageBuilder", - Product = "Product" -} -/** Contains attributes specific to tangible products */ -export type PhysicalProductInterface = { - /** The weight of the item, in units defined by the store */ - weight?: Maybe; -}; -/** Defines the price of a simple product or a part of a price range for a complex product. It can include a list of price adjustments. */ -export type Price = { - __typename?: "Price"; - /** A list of price adjustments. */ - adjustments?: Maybe>>; - /** Contains the monetary value and currency code of a product. */ - amount?: Maybe; -}; -/** Specifies the amount and type of price adjustment. */ -export type PriceAdjustment = { - __typename?: "PriceAdjustment"; - /** The amount of the price adjustment. */ - amount?: Maybe; - /** Identifies the type of price adjustment. */ - code?: Maybe; -}; -/** Price range for a product. If the product has a single price, the minimum and maximum price will be the same */ -export type PriceRange = { - __typename?: "PriceRange"; - /** The highest possible price for the product */ - maximum_price?: Maybe; - /** The lowest possible price for the product */ - minimum_price: ProductPrice; -}; -/** A discount applied to a product price */ -export type ProductDiscount = { - __typename?: "ProductDiscount"; - /** The actual value of the discount */ - amount_off?: Maybe; - /** The discount expressed a percentage */ - percent_off?: Maybe; -}; -/** Product image information. Contains the image URL and label */ -export type ProductImage = MediaGalleryInterface & { - __typename?: "ProductImage"; - /** Whether the image is hidden from PDP gallery */ - disabled?: Maybe; - /** The label of the product image or video */ - label?: Maybe; - /** The media item's position after it has been sorted */ - position?: Maybe; - /** The URL of the product image or video */ - url?: Maybe; -}; -/** Contains attributes that are common to all types of products */ -export type ProductInterface = { - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** A relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - /** An array of custom product attributes */ - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; -}; -/** Product price */ -export type ProductPrice = { - __typename?: "ProductPrice"; - /** The price discount. Represents the difference between the regular and final price */ - discount?: Maybe; - /** The final price of the product after discounts applied */ - final_price: Money; - /** The multiple FPTs that can be applied to a product price */ - fixed_product_taxes?: Maybe>>; - /** The regular price of the product */ - regular_price: Money; -}; -/** A single product returned by the query */ -export type ProductSearchItem = { - __typename?: "ProductSearchItem"; - /** The query rule type that was applied to this product, if any (in preview mode only, returns null otherwise) */ - applied_query_rule?: Maybe; - /** An object that provides highlighted text for matched words */ - highlights?: Maybe>>; - /** Contains details about the product */ - product: ProductInterface; - /** Contains a product view */ - productView?: Maybe; -}; -/** Contains the output of a `productSearch` query */ -export type ProductSearchResponse = { - __typename?: "ProductSearchResponse"; - /** Details about the static and dynamic facets relevant to the search */ - facets?: Maybe>>; - /** An array of products returned by the query */ - items?: Maybe>>; - /** Information for rendering pages of search results */ - page_info?: Maybe; - /** An array of strings that might include merchant-defined synonyms */ - related_terms?: Maybe>>; - /** An array of strings that include the names of products and categories that exist in the catalog that are similar to the search query */ - suggestions?: Maybe>>; - /** The total number of products returned that matched the query */ - total_count?: Maybe; -}; -/** The product attribute to sort on */ -export type ProductSearchSortInput = { - /** The attribute code of a product attribute */ - attribute: Scalars["String"]["input"]; - /** ASC (ascending) or DESC (descending) */ - direction: SortEnum; -}; -/** Defines the product fields available to the SimpleProductView and ComplexProductView types. */ -export type ProductView = { - /** A flag stating if the product can be added to cart */ - addToCartAllowed?: Maybe; - /** A list of merchant-defined attributes designated for the storefront. */ - attributes?: Maybe>>; - /** - * List of categories to which the product belongs - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - categories?: Maybe>>; - /** The detailed description of the product. */ - description?: Maybe; - /** External Id */ - externalId?: Maybe; - /** The product ID, generated as a composite key, unique per locale. */ - id: Scalars["ID"]["output"]; - /** A list of images defined for the product. */ - images?: Maybe>>; - /** A flag stating if the product is in stock */ - inStock?: Maybe; - /** A list of input options. */ - inputOptions?: Maybe>>; - /** Date and time when the product was last updated. */ - lastModifiedAt?: Maybe; - /** A list of product links. */ - links?: Maybe>>; - /** A flag stating if the product stock is low */ - lowStock?: Maybe; - /** A brief overview of the product for search results listings. */ - metaDescription?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines. */ - metaKeyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists. */ - metaTitle?: Maybe; - /** Product name. */ - name?: Maybe; - /** Indicates if the product was retrieved from the primary or the backup query */ - queryType?: Maybe; - /** - * Rank given to a product - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - rank?: Maybe; - /** - * Score indicating relevance of the product to the recommendation type - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - score?: Maybe; - /** A summary of the product. */ - shortDescription?: Maybe; - /** Product SKU. */ - sku?: Maybe; - /** Canonical URL of the product. */ - url?: Maybe; - /** The URL key of the product. */ - urlKey?: Maybe; - /** A list of videos defined for the product. */ - videos?: Maybe>>; - /** Visibility setting of the product */ - visibility?: Maybe; -}; -/** Defines the product fields available to the SimpleProductView and ComplexProductView types. */ -export type ProductViewAttributesArgs = { - roles?: InputMaybe>>; -}; -/** Defines the product fields available to the SimpleProductView and ComplexProductView types. */ -export type ProductViewImagesArgs = { - roles?: InputMaybe>>; -}; -/** Defines the product fields available to the SimpleProductView and ComplexProductView types. */ -export type ProductViewLinksArgs = { - linkTypes?: InputMaybe>; -}; -/** A container for customer-defined attributes that are displayed the storefront. */ -export type ProductViewAttribute = { - __typename?: "ProductViewAttribute"; - /** Label of the attribute. */ - label?: Maybe; - /** Name of an attribute code. */ - name: Scalars["String"]["output"]; - /** Roles designated for an attribute on the storefront, such as "Show on PLP", "Show in PDP", or "Show in Search". */ - roles?: Maybe>>; - /** Attribute value, arbitrary of type. */ - value?: Maybe; -}; -/** The list of supported currency codes. */ -export declare enum ProductViewCurrency { - Aed = "AED", - Afn = "AFN", - All = "ALL", - Amd = "AMD", - Ang = "ANG", - Aoa = "AOA", - Ars = "ARS", - Aud = "AUD", - Awg = "AWG", - Azm = "AZM", - Azn = "AZN", - Bam = "BAM", - Bbd = "BBD", - Bdt = "BDT", - Bgn = "BGN", - Bhd = "BHD", - Bif = "BIF", - Bmd = "BMD", - Bnd = "BND", - Bob = "BOB", - Brl = "BRL", - Bsd = "BSD", - Btn = "BTN", - Buk = "BUK", - Bwp = "BWP", - Byn = "BYN", - Bzd = "BZD", - Cad = "CAD", - Cdf = "CDF", - Che = "CHE", - Chf = "CHF", - Chw = "CHW", - Clp = "CLP", - Cny = "CNY", - Cop = "COP", - Crc = "CRC", - Cup = "CUP", - Cve = "CVE", - Czk = "CZK", - Djf = "DJF", - Dkk = "DKK", - Dop = "DOP", - Dzd = "DZD", - Eek = "EEK", - Egp = "EGP", - Ern = "ERN", - Etb = "ETB", - Eur = "EUR", - Fjd = "FJD", - Fkp = "FKP", - Gbp = "GBP", - Gek = "GEK", - Gel = "GEL", - Ghs = "GHS", - Gip = "GIP", - Gmd = "GMD", - Gnf = "GNF", - Gqe = "GQE", - Gtq = "GTQ", - Gyd = "GYD", - Hkd = "HKD", - Hnl = "HNL", - Hrk = "HRK", - Htg = "HTG", - Huf = "HUF", - Idr = "IDR", - Ils = "ILS", - Inr = "INR", - Iqd = "IQD", - Irr = "IRR", - Isk = "ISK", - Jmd = "JMD", - Jod = "JOD", - Jpy = "JPY", - Kes = "KES", - Kgs = "KGS", - Khr = "KHR", - Kmf = "KMF", - Kpw = "KPW", - Krw = "KRW", - Kwd = "KWD", - Kyd = "KYD", - Kzt = "KZT", - Lak = "LAK", - Lbp = "LBP", - Lkr = "LKR", - Lrd = "LRD", - Lsl = "LSL", - Lsm = "LSM", - Ltl = "LTL", - Lvl = "LVL", - Lyd = "LYD", - Mad = "MAD", - Mdl = "MDL", - Mga = "MGA", - Mkd = "MKD", - Mmk = "MMK", - Mnt = "MNT", - Mop = "MOP", - Mro = "MRO", - Mur = "MUR", - Mvr = "MVR", - Mwk = "MWK", - Mxn = "MXN", - Myr = "MYR", - Mzn = "MZN", - Nad = "NAD", - Ngn = "NGN", - Nic = "NIC", - Nok = "NOK", - None = "NONE", - Npr = "NPR", - Nzd = "NZD", - Omr = "OMR", - Pab = "PAB", - Pen = "PEN", - Pgk = "PGK", - Php = "PHP", - Pkr = "PKR", - Pln = "PLN", - Pyg = "PYG", - Qar = "QAR", - Rhd = "RHD", - Rol = "ROL", - Ron = "RON", - Rsd = "RSD", - Rub = "RUB", - Rwf = "RWF", - Sar = "SAR", - Sbd = "SBD", - Scr = "SCR", - Sdg = "SDG", - Sek = "SEK", - Sgd = "SGD", - Shp = "SHP", - Skk = "SKK", - Sll = "SLL", - Sos = "SOS", - Srd = "SRD", - Std = "STD", - Svc = "SVC", - Syp = "SYP", - Szl = "SZL", - Thb = "THB", - Tjs = "TJS", - Tmm = "TMM", - Tnd = "TND", - Top = "TOP", - Trl = "TRL", - Try = "TRY", - Ttd = "TTD", - Twd = "TWD", - Tzs = "TZS", - Uah = "UAH", - Ugx = "UGX", - Usd = "USD", - Uyu = "UYU", - Uzs = "UZS", - Veb = "VEB", - Vef = "VEF", - Vnd = "VND", - Vuv = "VUV", - Wst = "WST", - Xcd = "XCD", - Xof = "XOF", - Xpf = "XPF", - Yer = "YER", - Zar = "ZAR", - Zmk = "ZMK", - Zwd = "ZWD" -} -/** Contains details about a product image. */ -export type ProductViewImage = { - __typename?: "ProductViewImage"; - /** The display label of the product image. */ - label?: Maybe; - /** A list that describes how the image is used. Can be image, small_image, or thumbnail. */ - roles?: Maybe>>; - /** The URL to the product image. */ - url: Scalars["String"]["output"]; -}; -/** Product options provide a way to configure products by making selections of particular option values. Selecting one or many options will point to a simple product. */ -export type ProductViewInputOption = { - __typename?: "ProductViewInputOption"; - fileExtensions?: Maybe; - /** The ID of an option value */ - id?: Maybe; - imageSize?: Maybe; - /** Price markup or markdown */ - markupAmount?: Maybe; - range?: Maybe; - /** Wether this option is required or not */ - required?: Maybe; - /** Sort order */ - sortOrder?: Maybe; - /** SKU suffix to add to the product */ - suffix?: Maybe; - /** The display name of the option value */ - title?: Maybe; - /** The type of data entry */ - type?: Maybe; -}; -export type ProductViewInputOptionImageSize = { - __typename?: "ProductViewInputOptionImageSize"; - height?: Maybe; - width?: Maybe; -}; -export type ProductViewInputOptionRange = { - __typename?: "ProductViewInputOptionRange"; - from?: Maybe; - to?: Maybe; -}; -/** The product link type. */ -export type ProductViewLink = { - __typename?: "ProductViewLink"; - /** Stores the types of the links with this product. */ - linkTypes: Array; - /** Contains the details of the product found in the link. */ - product: ProductView; -}; -/** Defines a monetary value, including a numeric value and a currency code. */ -export type ProductViewMoney = { - __typename?: "ProductViewMoney"; - /** A three-letter currency code, such as USD or EUR. */ - currency?: Maybe; - /** A number expressing a monetary value. */ - value?: Maybe; -}; -/** Product options provide a way to configure products by making selections of particular option values. Selecting one or many options will point to a simple product. */ -export type ProductViewOption = { - __typename?: "ProductViewOption"; - /** The ID of the option. */ - id?: Maybe; - /** Indicates whether the option allows multiple choices. */ - multi?: Maybe; - /** Indicates whether the option must be selected. */ - required?: Maybe; - /** The display name of the option. */ - title?: Maybe; - /** List of available option values. */ - values?: Maybe>; -}; -/** Defines the product fields available to the ProductViewOptionValueProduct and ProductViewOptionValueConfiguration types. */ -export type ProductViewOptionValue = { - /** The ID of an option value. */ - id?: Maybe; - /** Indicates if the option is in stock. */ - inStock?: Maybe; - /** The display name of the option value. */ - title?: Maybe; -}; -/** An implementation of ProductViewOptionValue for configuration values. */ -export type ProductViewOptionValueConfiguration = ProductViewOptionValue & { - __typename?: "ProductViewOptionValueConfiguration"; - /** The ID of an option value. */ - id?: Maybe; - /** Indicates if the option is in stock. */ - inStock?: Maybe; - /** The display name of the option value. */ - title?: Maybe; -}; -/** An implementation of ProductViewOptionValue that adds details about a simple product. */ -export type ProductViewOptionValueProduct = ProductViewOptionValue & { - __typename?: "ProductViewOptionValueProduct"; - /** The ID of an option value. */ - id?: Maybe; - /** Indicates if the option is in stock. */ - inStock?: Maybe; - /** States if the option value is default or not. */ - isDefault?: Maybe; - /** Details about a simple product. */ - product?: Maybe; - /** Default quantity of an option value. */ - quantity?: Maybe; - /** The display name of the option value. */ - title?: Maybe; -}; -/** An implementation of ProductViewOptionValueSwatch for swatches. */ -export type ProductViewOptionValueSwatch = ProductViewOptionValue & { - __typename?: "ProductViewOptionValueSwatch"; - /** The ID of an option value. */ - id?: Maybe; - /** Indicates if the option is in stock. */ - inStock?: Maybe; - /** The display name of the option value. */ - title?: Maybe; - /** Indicates the type of the swatch. */ - type?: Maybe; - /** The value of the swatch depending on the type of the swatch. */ - value?: Maybe; -}; -/** Base product price view, inherent for simple products. */ -export type ProductViewPrice = { - __typename?: "ProductViewPrice"; - /** Price value after discounts, excluding personalized promotions. */ - final?: Maybe; - /** Base product price specified by the merchant. */ - regular?: Maybe; - /** Price roles, stating if the price should be visible or hidden. */ - roles?: Maybe>>; -}; -/** The minimum and maximum price of a complex product. */ -export type ProductViewPriceRange = { - __typename?: "ProductViewPriceRange"; - /** Maximum price. */ - maximum?: Maybe; - /** Minimum price. */ - minimum?: Maybe; -}; -export type ProductViewVariant = { - __typename?: "ProductViewVariant"; - /** Product corresponding to the variant. */ - product?: Maybe; - /** List of option values that make up the variant. */ - selections?: Maybe>; -}; -export type ProductViewVariantResults = { - __typename?: "ProductViewVariantResults"; - /** Pagination cursor */ - cursor?: Maybe; - /** List of product variants. */ - variants: Array>; -}; -/** Contains details about a product video */ -export type ProductViewVideo = { - __typename?: "ProductViewVideo"; - /** Description of the product video. */ - description?: Maybe; - /** Preview image for the video */ - preview?: Maybe; - /** The title of the product video. */ - title?: Maybe; - /** The URL to the product video. */ - url: Scalars["String"]["output"]; -}; -/** User purchase history */ -export type PurchaseHistory = { - date?: InputMaybe; - items: Array>; -}; -export type Query = { - __typename?: "Query"; - /** Return a list of product attribute codes that can be used for sorting or filtering in a `productSearch` query */ - attributeMetadata: AttributeMetadataResponse; - categories?: Maybe>>; - /** Search products using Live Search */ - productSearch: ProductSearchResponse; - /** Search for products that match the specified SKU values. */ - products?: Maybe>>; - /** Get Recommendations */ - recommendations?: Maybe; - refineProduct?: Maybe; - variants?: Maybe; -}; -export type QueryCategoriesArgs = { - ids?: InputMaybe>; - roles?: InputMaybe>; - subtree?: InputMaybe; -}; -export type QueryProductSearchArgs = { - context?: InputMaybe; - current_page?: InputMaybe; - filter?: InputMaybe>; - page_size?: InputMaybe; - phrase: Scalars["String"]["input"]; - sort?: InputMaybe>; -}; -export type QueryProductsArgs = { - skus?: InputMaybe>>; -}; -export type QueryRecommendationsArgs = { - cartSkus?: InputMaybe>>; - category?: InputMaybe; - currentSku?: InputMaybe; - pageType?: InputMaybe; - userPurchaseHistory?: InputMaybe>>; - userViewHistory?: InputMaybe>>; -}; -export type QueryRefineProductArgs = { - optionIds: Array; - sku: Scalars["String"]["input"]; -}; -export type QueryVariantsArgs = { - cursor?: InputMaybe; - optionIds?: InputMaybe>; - pageSize?: InputMaybe; - sku: Scalars["String"]["input"]; -}; -export type QueryContextInput = { - /** - * The customer group code. Field reserved for future use. - * Currently, passing this field will have no impact on search results, that is, the search - * results will be for "Not logged in" customer - */ - customerGroup: Scalars["String"]["input"]; - /** User view history with timestamp */ - userViewHistory?: InputMaybe>; -}; -/** For use on numeric product fields */ -export type RangeBucket = Bucket & { - __typename?: "RangeBucket"; - /** The number of items in the bucket */ - count: Scalars["Int"]["output"]; - /** The minimum amount in a price range */ - from: Scalars["Float"]["output"]; - /** The display text defining the price range */ - title: Scalars["String"]["output"]; - /** The maximum amount in a price range */ - to?: Maybe; -}; -/** Recommendation Unit containing product and other details */ -export type RecommendationUnit = { - __typename?: "RecommendationUnit"; - /** Order in which recommendation units are displayed */ - displayOrder?: Maybe; - /** Page type */ - pageType?: Maybe; - /** List of product view */ - productsView?: Maybe>>; - /** Storefront label to be displayed on the storefront */ - storefrontLabel?: Maybe; - /** Total products returned in recommedations */ - totalProducts?: Maybe; - /** Type of recommendation */ - typeId?: Maybe; - /** Id of the preconfigured unit */ - unitId?: Maybe; - /** Name of the preconfigured unit */ - unitName?: Maybe; -}; -/** Recommendations response */ -export type Recommendations = { - __typename?: "Recommendations"; - /** List of rec units with products recommended */ - results?: Maybe>>; - /** total number of rec units for which recommendations are returned */ - totalResults?: Maybe; -}; -/** For use on string and other scalar product fields */ -export type ScalarBucket = Bucket & { - __typename?: "ScalarBucket"; - /** The number of items in the bucket */ - count: Scalars["Int"]["output"]; - /** An identifier that can be used for filtering. It may contain non-human readable data */ - id: Scalars["ID"]["output"]; - /** The display text for the scalar value */ - title: Scalars["String"]["output"]; -}; -/** A product attribute to filter on */ -export type SearchClauseInput = { - /** The attribute code of a product attribute */ - attribute: Scalars["String"]["input"]; - /** Attribute value should contain the specified string */ - contains?: InputMaybe; - /** A string value to filter on */ - eq?: InputMaybe; - /** An array of string values to filter on */ - in?: InputMaybe>>; - /** A range of numeric values to filter on */ - range?: InputMaybe; - /** Attribute value should start with the specified string */ - startsWith?: InputMaybe; -}; -/** A range of numeric values for use in a search */ -export type SearchRangeInput = { - /** The minimum value to filter on. If not specified, the value of `0` is applied */ - from?: InputMaybe; - /** The maximum value to filter on */ - to?: InputMaybe; -}; -/** Provides navigation for the query response */ -export type SearchResultPageInfo = { - __typename?: "SearchResultPageInfo"; - /** Specifies which page of results to return */ - current_page?: Maybe; - /** Specifies the maximum number of items to return */ - page_size?: Maybe; - /** Specifies the total number of pages returned */ - total_pages?: Maybe; -}; -/** A simple product is tangible and is usually sold in single units or in fixed quantities */ -export type SimpleProduct = PhysicalProductInterface & ProductInterface & { - __typename?: "SimpleProduct"; - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** A relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; - /** The weight of the item, in units defined by the store */ - weight?: Maybe; -}; -/** Represents simple products. Simple product prices do not contain price ranges. */ -export type SimpleProductView = ProductView & { - __typename?: "SimpleProductView"; - /** A flag stating if the product can be added to cart */ - addToCartAllowed?: Maybe; - /** A list of merchant-defined attributes designated for the storefront. */ - attributes?: Maybe>>; - /** - * List of categories to which the product belongs - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - categories?: Maybe>>; - /** The detailed description of the product. */ - description?: Maybe; - /** External Id */ - externalId?: Maybe; - /** The product ID, generated as a composite key, unique per locale. */ - id: Scalars["ID"]["output"]; - /** A list of images defined for the product. */ - images?: Maybe>>; - /** A flag stating if the product is in stock */ - inStock?: Maybe; - /** A list of input options. */ - inputOptions?: Maybe>>; - /** Date and time when the product was last updated. */ - lastModifiedAt?: Maybe; - /** A list of product links */ - links?: Maybe>>; - /** A flag stating if the product stock is low */ - lowStock?: Maybe; - /** A brief overview of the product for search results listings. */ - metaDescription?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines. */ - metaKeyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists. */ - metaTitle?: Maybe; - /** Product name. */ - name?: Maybe; - /** Base product price view. */ - price?: Maybe; - /** Indicates if the product was retrieved from the primary or the backup query */ - queryType?: Maybe; - /** - * Rank given to a product - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - rank?: Maybe; - /** - * Score indicating relevance of the product to the recommendation type - * @deprecated This field is deprecated and will be removed after Feb 1, 2024. - */ - score?: Maybe; - /** A summary of the product. */ - shortDescription?: Maybe; - /** Product SKU. */ - sku?: Maybe; - /** Canonical URL of the product. */ - url?: Maybe; - /** The URL key of the product. */ - urlKey?: Maybe; - /** A list of videos defined for the product. */ - videos?: Maybe>>; - /** Visibility setting of the product */ - visibility?: Maybe; -}; -/** Represents simple products. Simple product prices do not contain price ranges. */ -export type SimpleProductViewAttributesArgs = { - roles?: InputMaybe>>; -}; -/** Represents simple products. Simple product prices do not contain price ranges. */ -export type SimpleProductViewImagesArgs = { - roles?: InputMaybe>>; -}; -/** Represents simple products. Simple product prices do not contain price ranges. */ -export type SimpleProductViewLinksArgs = { - linkTypes?: InputMaybe>; -}; -/** This enumeration indicates whether to return results in ascending or descending order */ -export declare enum SortEnum { - Asc = "ASC", - Desc = "DESC" -} -/** Contains product attributes that be used for sorting in a `productSearch` query */ -export type SortableAttribute = { - __typename?: "SortableAttribute"; - /** The unique identifier for an attribute code. This value should be in lowercase letters and without space */ - attribute: Scalars["String"]["output"]; - /** Indicates how field rendered on storefront */ - frontendInput?: Maybe; - /** The display name assigned to the attribute */ - label?: Maybe; - /** Indicates whether this attribute has a numeric value, such as a price or integer */ - numeric?: Maybe; -}; -/** For retrieving statistics across multiple buckets */ -export type StatsBucket = Bucket & { - __typename?: "StatsBucket"; - /** The maximum value */ - max: Scalars["Float"]["output"]; - /** The minimum value */ - min: Scalars["Float"]["output"]; - /** The display text for the bucket */ - title: Scalars["String"]["output"]; -}; -export type Subtree = { - depth: Scalars["Int"]["input"]; - startLevel: Scalars["Int"]["input"]; -}; -export declare enum SwatchType { - ColorHex = "COLOR_HEX", - Custom = "CUSTOM", - Image = "IMAGE", - Text = "TEXT" -} -/** User view history */ -export type ViewHistory = { - date?: InputMaybe; - sku: Scalars["String"]["input"]; -}; -/** User view history */ -export type ViewHistoryInput = { - dateTime?: InputMaybe; - sku: Scalars["String"]["input"]; -}; -/** A non-tangible product that does not require shipping and is not kept in inventory */ -export type VirtualProduct = ProductInterface & { - __typename?: "VirtualProduct"; - /** - * Boolean indicating whether a product can be added to cart. Field reserved for future use. - * Currently, will default to true - */ - add_to_cart_allowed?: Maybe; - /** The attribute set assigned to the product */ - attribute_set_id?: Maybe; - /** Relative canonical URL */ - canonical_url?: Maybe; - /** Timestamp indicating when the product was created */ - created_at?: Maybe; - /** An array of custom product attributes */ - custom_attributes?: Maybe>>; - /** Detailed information about the product. The value can include simple HTML tags */ - description?: Maybe; - /** Indicates whether a gift message is available */ - gift_message_available?: Maybe; - /** - * id - * @deprecated Magento 2.4 has not yet deprecated the `ProductInterface.id` field - */ - id?: Maybe; - /** The relative path to the main image on the product page */ - image?: Maybe; - /** An array of Media Gallery objects */ - media_gallery?: Maybe>>; - /** A brief overview of the product for search results listings, maximum 255 characters */ - meta_description?: Maybe; - /** A comma-separated list of keywords that are visible only to search engines */ - meta_keyword?: Maybe; - /** A string that is displayed in the title bar and tab of the browser and in search results lists */ - meta_title?: Maybe; - /** The product name. Customers use this name to identify the product */ - name?: Maybe; - /** The beginning date for new product listings, and determines if the product is featured as a new product */ - new_from_date?: Maybe; - /** The end date for new product listings */ - new_to_date?: Maybe; - /** A PriceRange object, indicating the range of prices for the product */ - price_range: PriceRange; - /** A short description of the product. Its use depends on the theme */ - short_description?: Maybe; - /** A number or code assigned to a product to identify the product, options, price, and manufacturer */ - sku?: Maybe; - /** The relative path to the small image, which is used on catalog pages */ - small_image?: Maybe; - /** The relative path to the product's thumbnail image */ - thumbnail?: Maybe; - /** The unique ID for a `ProductInterface` object */ - uid: Scalars["ID"]["output"]; - /** Timestamp indicating when the product was updated */ - updated_at?: Maybe; -}; -export type ProductSearchQueryVariables = Exact<{ - phrase: Scalars["String"]["input"]; - size?: InputMaybe; - current?: InputMaybe; - filter?: InputMaybe | SearchClauseInput>; - sort?: InputMaybe | ProductSearchSortInput>; -}>; -export type ProductSearchQuery = { - __typename?: "Query"; - productSearch: { - __typename?: "ProductSearchResponse"; - page_info?: { - __typename?: "SearchResultPageInfo"; - current_page?: number | null; - page_size?: number | null; - total_pages?: number | null; - } | null; - items?: Array<{ - __typename?: "ProductSearchItem"; - product: { - __typename?: "BundleProduct"; - uid: string; - sku?: string | null; - name?: string | null; - canonical_url?: string | null; - small_image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - thumbnail?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - price_range: { - __typename?: "PriceRange"; - minimum_price: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - }; - maximum_price?: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - } | null; - }; - } | { - __typename?: "ConfigurableProduct"; - uid: string; - sku?: string | null; - name?: string | null; - canonical_url?: string | null; - small_image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - thumbnail?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - price_range: { - __typename?: "PriceRange"; - minimum_price: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - }; - maximum_price?: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - } | null; - }; - } | { - __typename?: "DownloadableProduct"; - uid: string; - sku?: string | null; - name?: string | null; - canonical_url?: string | null; - small_image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - thumbnail?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - price_range: { - __typename?: "PriceRange"; - minimum_price: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - }; - maximum_price?: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - } | null; - }; - } | { - __typename?: "GiftCardProduct"; - uid: string; - sku?: string | null; - name?: string | null; - canonical_url?: string | null; - small_image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - thumbnail?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - price_range: { - __typename?: "PriceRange"; - minimum_price: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - }; - maximum_price?: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - } | null; - }; - } | { - __typename?: "GroupedProduct"; - uid: string; - sku?: string | null; - name?: string | null; - canonical_url?: string | null; - small_image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - thumbnail?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - price_range: { - __typename?: "PriceRange"; - minimum_price: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - }; - maximum_price?: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - } | null; - }; - } | { - __typename?: "SimpleProduct"; - uid: string; - sku?: string | null; - name?: string | null; - canonical_url?: string | null; - small_image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - thumbnail?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - price_range: { - __typename?: "PriceRange"; - minimum_price: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - }; - maximum_price?: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - } | null; - }; - } | { - __typename?: "VirtualProduct"; - uid: string; - sku?: string | null; - name?: string | null; - canonical_url?: string | null; - small_image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - image?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - thumbnail?: { - __typename?: "ProductImage"; - url?: string | null; - } | null; - price_range: { - __typename?: "PriceRange"; - minimum_price: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - }; - maximum_price?: { - __typename?: "ProductPrice"; - fixed_product_taxes?: Array<{ - __typename?: "FixedProductTax"; - label?: string | null; - amount?: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - } | null; - } | null> | null; - regular_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - final_price: { - __typename?: "Money"; - value?: number | null; - currency?: CurrencyEnum | null; - }; - discount?: { - __typename?: "ProductDiscount"; - percent_off?: number | null; - amount_off?: number | null; - } | null; - } | null; - }; - }; - productView?: { - __typename?: "ComplexProductView"; - urlKey?: string | null; - } | { - __typename?: "SimpleProductView"; - urlKey?: string | null; - } | null; - } | null> | null; - }; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api.d.ts b/scripts/__dropins__/storefront-search/api.d.ts deleted file mode 100644 index 30939a827b..0000000000 --- a/scripts/__dropins__/storefront-search/api.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './api/index' diff --git a/scripts/__dropins__/storefront-search/api.js b/scripts/__dropins__/storefront-search/api.js deleted file mode 100644 index b23a0b0873..0000000000 --- a/scripts/__dropins__/storefront-search/api.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -import{f as p,g as h,r as g,s as l,a as d,b as m,c as G}from"./chunks/searchProducts.js";import{Initializer as a}from"@dropins/tools/lib.js";import"./chunks/currency-symbol-map.js";import"@dropins/tools/fetch-graphql.js";const e=new a({init:async t=>{const s={};e.config.setConfig({...s,...t})},listeners:()=>[]}),n=e.config;export{n as config,p as fetchGraphQl,h as getConfig,e as initialize,g as removeFetchGraphQlHeader,l as searchProducts,d as setEndpoint,m as setFetchGraphQlHeader,G as setFetchGraphQlHeaders}; diff --git a/scripts/__dropins__/storefront-search/api/fetch-graphql/fetch-graphql.d.ts b/scripts/__dropins__/storefront-search/api/fetch-graphql/fetch-graphql.d.ts deleted file mode 100644 index c1cc3ef7c6..0000000000 --- a/scripts/__dropins__/storefront-search/api/fetch-graphql/fetch-graphql.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe/fetch-graphql').Header) => void, fetchGraphQl: (query: string, options?: import('@adobe/fetch-graphql').FetchOptions | undefined) => Promise<{ - errors?: import('@adobe/fetch-graphql').FetchQueryError | undefined; - data: T; -}>, getConfig: () => { - endpoint: string | undefined; - fetchGraphQlHeaders: import('@adobe/fetch-graphql').Header | undefined; -}; -//# sourceMappingURL=fetch-graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/fetch-graphql/index.d.ts b/scripts/__dropins__/storefront-search/api/fetch-graphql/index.d.ts deleted file mode 100644 index ea5ac123d4..0000000000 --- a/scripts/__dropins__/storefront-search/api/fetch-graphql/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './fetch-graphql'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/graphql/index.d.ts b/scripts/__dropins__/storefront-search/api/graphql/index.d.ts deleted file mode 100644 index 9f171c9120..0000000000 --- a/scripts/__dropins__/storefront-search/api/graphql/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './queries.graphql'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/graphql/queries.graphql.d.ts b/scripts/__dropins__/storefront-search/api/graphql/queries.graphql.d.ts deleted file mode 100644 index 7f04903996..0000000000 --- a/scripts/__dropins__/storefront-search/api/graphql/queries.graphql.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const PRODUCT_SEARCH = "\n query productSearch($phrase: String!, $size: Int = 5) {\n productSearch(phrase: $phrase, page_size: $size, filter: [], sort: []) {\n items {\n productView {\n sku\n name\n description\n url\n urlKey\n images {\n label\n url\n roles\n }\n ... on SimpleProductView {\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n }\n }\n }\n }\n }\n }\n"; -//# sourceMappingURL=queries.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/index.d.ts b/scripts/__dropins__/storefront-search/api/index.d.ts deleted file mode 100644 index 68c140b6c5..0000000000 --- a/scripts/__dropins__/storefront-search/api/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './initialize'; -export * from './fetch-graphql'; -export * from './searchProducts'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/initialize/index.d.ts b/scripts/__dropins__/storefront-search/api/initialize/index.d.ts deleted file mode 100644 index 66c241dc2d..0000000000 --- a/scripts/__dropins__/storefront-search/api/initialize/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './initialize'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/initialize/initialize.d.ts b/scripts/__dropins__/storefront-search/api/initialize/initialize.d.ts deleted file mode 100644 index d32b8e6e8b..0000000000 --- a/scripts/__dropins__/storefront-search/api/initialize/initialize.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Initializer } from '@dropins/tools/types/elsie/src/lib'; -import { Lang } from '@dropins/tools/types/elsie/src/i18n'; - -type ConfigProps = { - langDefinitions?: Lang; - storefront?: any; - search?: any; -}; -export declare const initialize: Initializer; -export declare const config: import('@dropins/tools/types/elsie/src/lib').Config; -export {}; -//# sourceMappingURL=initialize.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/searchProducts/index.d.ts b/scripts/__dropins__/storefront-search/api/searchProducts/index.d.ts deleted file mode 100644 index d953f4585b..0000000000 --- a/scripts/__dropins__/storefront-search/api/searchProducts/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './searchProducts'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/api/searchProducts/searchProducts.d.ts b/scripts/__dropins__/storefront-search/api/searchProducts/searchProducts.d.ts deleted file mode 100644 index b3e7f2da4f..0000000000 --- a/scripts/__dropins__/storefront-search/api/searchProducts/searchProducts.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProductDataModel } from '../../data/models/product'; - -export declare const searchProducts: (searchPhrase?: string, size?: number) => Promise<{ - pageInfo: import('../../data/models/page-info').PageInfoDataModel; - products: ProductDataModel[]; -}>; -//# sourceMappingURL=searchProducts.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/chunks/currency-symbol-map.js b/scripts/__dropins__/storefront-search/chunks/currency-symbol-map.js deleted file mode 100644 index 0d3470a346..0000000000 --- a/scripts/__dropins__/storefront-search/chunks/currency-symbol-map.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -var t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var r={exports:{}},R={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};const e=R;r.exports=function(S){if(typeof S!="string")return;const M=S.toUpperCase();if(Object.prototype.hasOwnProperty.call(e,M))return e[M]};r.exports.currencySymbolMap=e;var $=r.exports;const B=o($);export{B as a,t as c,o as g}; diff --git a/scripts/__dropins__/storefront-search/chunks/searchProducts.js b/scripts/__dropins__/storefront-search/chunks/searchProducts.js deleted file mode 100644 index 602a3bd869..0000000000 --- a/scripts/__dropins__/storefront-search/chunks/searchProducts.js +++ /dev/null @@ -1,38 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -import{a as F}from"./currency-symbol-map.js";import{FetchGraphQL as v}from"@dropins/tools/fetch-graphql.js";const y=e=>new DOMParser().parseFromString(e,"text/html").documentElement.textContent||"",z=(e,s,r)=>{const{currency:a,value:t}=e,c=t??0,n=s||F(a)||"",u=r?c*parseFloat(r):c;return`${n}${u.toFixed(2)}`},{setEndpoint:b,setFetchGraphQlHeader:x,removeFetchGraphQlHeader:A,setFetchGraphQlHeaders:H,fetchGraphQl:C,getConfig:k}=new v().getMethods(),P=e=>{const s=(e==null?void 0:e.current_page)??0,r=(e==null?void 0:e.page_size)??0,a=(e==null?void 0:e.total_pages)??0;return{current:s,size:r,total:a}};function _(e,s,r="",a="1"){var g,h,i,d;const t=(e==null?void 0:e.uid)||"",c=e.sku||"",n=y(e.name||""),u=y(e.description||""),o=((h=(g=e.price)==null?void 0:g.regular)==null?void 0:h.amount)||{value:0,currency:""},m=z(o,r,a),p=e.url||"",l=e.urlKey||"",S=((d=(i=e.images)==null?void 0:i[0])==null?void 0:d.url)||"";return{uid:t,sku:c,name:n,description:u,price:m,urlKey:l,url:p,imageUrl:S,rank:s}}const $=` - query productSearch($phrase: String!, $size: Int = 5) { - productSearch(phrase: $phrase, page_size: $size, filter: [], sort: []) { - items { - productView { - sku - name - description - url - urlKey - images { - label - url - roles - } - ... on SimpleProductView { - price { - final { - amount { - value - currency - } - } - regular { - amount { - value - currency - } - } - } - } - } - } - } - } -`,D=async(e="",s=4)=>{let r=P(),a=[];try{const{data:t}=await C($,{variables:{phrase:e,size:s}}),{items:c=[],page_info:n}=(t==null?void 0:t.productSearch)||{};a=(c??[]).reduce((o,m,p)=>{const{productView:l}=m;return l&&o.push(_(l,p)),o},[]),n&&(r=P(n))}catch(t){console.error("searchProducts error:",t)}return{pageInfo:r,products:a}};export{b as a,x as b,H as c,C as f,k as g,A as r,D as s}; diff --git a/scripts/__dropins__/storefront-search/chunks/tokens.js b/scripts/__dropins__/storefront-search/chunks/tokens.js deleted file mode 100644 index 24936c9cee..0000000000 --- a/scripts/__dropins__/storefront-search/chunks/tokens.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -import{jsx as p}from"@dropins/tools/preact-jsx-runtime.js";import{createContext as P,useContext as b}from"@dropins/tools/preact-compat.js";import{createContext as E}from"@dropins/tools/preact.js";import{useMemo as F,useContext as R,useState as k,useEffect as w}from"@dropins/tools/preact-hooks.js";var c,T=new Uint8Array(16);function I(){if(!c&&(c=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(T)}const x=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function N(e){return typeof e=="string"&&x.test(e)}var r=[];for(var u=0;u<256;++u)r.push((u+256).toString(16).substr(1));function M(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(r[e[t+0]]+r[e[t+1]]+r[e[t+2]]+r[e[t+3]]+"-"+r[e[t+4]]+r[e[t+5]]+"-"+r[e[t+6]]+r[e[t+7]]+"-"+r[e[t+8]]+r[e[t+9]]+"-"+r[e[t+10]]+r[e[t+11]]+r[e[t+12]]+r[e[t+13]]+r[e[t+14]]+r[e[t+15]]).toLowerCase();if(!N(o))throw TypeError("Stringified UUID is invalid");return o}function fe(e,t,o){e=e||{};var i=e.random||(e.rng||I)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,M(i)}const ve=24,ye="12,24,36",Be=3,n={desktop:4,tablet:3,mobile:2},ze=[{attribute:"relevance",direction:"DESC"}],Ee=[{attribute:"position",direction:"ASC"}],Fe="livesearch-plp",Re="yes",Te="no",L=E({environmentId:"",environmentType:"",websiteCode:"",storeCode:"",storeViewCode:"",apiUrl:"",apiKey:"",config:{},context:{},route:void 0,searchQuery:"q",defaultHeaders:{}}),Ie=({children:e,environmentId:t,environmentType:o,websiteCode:i,storeCode:l,storeViewCode:a,config:A,context:s,apiUrl:f,apiKey:v,route:y,searchQuery:B,defaultHeaders:h})=>{const z={...F(()=>({environmentId:t,environmentType:o,websiteCode:i,storeCode:l,storeViewCode:a,config:A,context:{customerGroup:(s==null?void 0:s.customerGroup)??"",userViewHistory:(s==null?void 0:s.userViewHistory)??[]},apiUrl:f,apiKey:v,route:y,searchQuery:B,defaultHeaders:h}),[t,i,l,a,h])};return p(L.Provider,{value:z,children:e})},D=()=>R(L),O={Filter:{title:"Филтри",showTitle:"Показване на филтри",hideTitle:"Скриване на филтри",clearAll:"Изчистване на всичко"},InputButtonGroup:{title:"Категории",price:"Цена",customPrice:"Персонализирана цена",priceIncluded:"да",priceExcluded:"не",priceExcludedMessage:"Не {title}",priceRange:" и по-висока",showmore:"Показване на повече"},Loading:{title:"Зареждане"},NoResults:{heading:"Няма резултати за вашето търсене.",subheading:"Моля, опитайте отново..."},SortDropdown:{title:"Сортиране по",option:"Сортиране по: {selectedOption}",relevanceLabel:"Най-подходящи",positionLabel:"Позиция"},CategoryFilters:{results:"резултати за {phrase}",products:"{totalCount} продукта"},ProductCard:{asLowAs:"Само {discountPrice}",startingAt:"От {productPrice}",bundlePrice:"От {fromBundlePrice} до {toBundlePrice}",from:"От {productPrice}"},ProductContainers:{minquery:"Вашата дума за търсене {variables.phrase} не достига минимума от {minQueryLength} знака.",noresults:"Вашето търсене не даде резултати.",pagePicker:"Показване на {pageSize} на страница",showAll:"всички"},SearchBar:{placeholder:"Търсене..."}},_={Filter:{title:"Filtres",showTitle:"Mostra els filtres",hideTitle:"Amaga els filtres",clearAll:"Esborra-ho tot"},InputButtonGroup:{title:"Categories",price:"Preu",customPrice:"Preu personalitzat",priceIncluded:"sí",priceExcluded:"no",priceExcludedMessage:"No {title}",priceRange:" i superior",showmore:"Mostra més"},Loading:{title:"Carregant"},NoResults:{heading:"No hi ha resultats per a la vostra cerca.",subheading:"Siusplau torna-ho a provar..."},SortDropdown:{title:"Ordenar per",option:"Ordena per: {selectedOption}",relevanceLabel:"El més rellevant",positionLabel:"Posició"},CategoryFilters:{results:"Resultats per a {phrase}",products:"{totalCount}productes"},ProductCard:{asLowAs:"Mínim de {discountPrice}",startingAt:"A partir de {productPrice}",bundlePrice:"Des de {fromBundlePrice} A {toBundlePrice}",from:"Des de {productPrice}"},ProductContainers:{minquery:"El vostre terme de cerca {variables.phrase} no ha arribat al mínim de {minQueryLength} caràcters.",noresults:"La vostra cerca no ha retornat cap resultat.",pagePicker:"Mostra {pageSize} per pàgina",showAll:"tots"},SearchBar:{placeholder:"Cerca..."}},j={Filter:{title:"Filtry",showTitle:"Zobrazit filtry",hideTitle:"Skrýt filtry",clearAll:"Vymazat vše"},InputButtonGroup:{title:"Kategorie",price:"Cena",customPrice:"Vlastní cena",priceIncluded:"ano",priceExcluded:"ne",priceExcludedMessage:"Ne {title}",priceRange:" a výše",showmore:"Zobrazit více"},Loading:{title:"Načítá se"},NoResults:{heading:"Nebyly nalezeny žádné výsledky.",subheading:"Zkuste to znovu..."},SortDropdown:{title:"Seřadit podle",option:"Seřadit podle: {selectedOption}",relevanceLabel:"Nejrelevantnější",positionLabel:"Umístění"},CategoryFilters:{results:"výsledky pro {phrase}",products:"Produkty: {totalCount}"},ProductCard:{asLowAs:"Pouze za {discountPrice}",startingAt:"Cena od {productPrice}",bundlePrice:"Z {fromBundlePrice} na {toBundlePrice}",from:"Z {productPrice}"},ProductContainers:{minquery:"Hledaný výraz {variables.phrase} nedosáhl minima počtu znaků ({minQueryLength}).",noresults:"Při hledání nebyly nalezeny žádné výsledky.",pagePicker:"Zobrazit {pageSize} na stránku",showAll:"vše"},SearchBar:{placeholder:"Hledat..."}},G={Filter:{title:"Filtre",showTitle:"Vis filtre",hideTitle:"Skjul filtre",clearAll:"Ryd alt"},InputButtonGroup:{title:"Kategorier",price:"Pris",customPrice:"Brugerdefineret pris",priceIncluded:"ja",priceExcluded:"nej",priceExcludedMessage:"Ikke {title}",priceRange:" og over",showmore:"Vis mere"},Loading:{title:"Indlæser"},NoResults:{heading:"Ingen søgeresultater for din søgning",subheading:"Prøv igen..."},SortDropdown:{title:"Sortér efter",option:"Sortér efter: {selectedOption}",relevanceLabel:"Mest relevant",positionLabel:"Position"},CategoryFilters:{results:"resultater for {phrase}",products:"{totalCount} produkter"},ProductCard:{asLowAs:"Så lav som {discountPrice}",startingAt:"Fra {productPrice}",bundlePrice:"Fra {fromBundlePrice} til {toBundlePrice}",from:"Fra {productPrice}"},ProductContainers:{minquery:"Dit søgeord {variables.phrase} har ikke minimum på {minQueryLength} tegn.",noresults:"Din søgning gav ingen resultater.",pagePicker:"Vis {pageSize} pr. side",showAll:"alle"},SearchBar:{placeholder:"Søg..."}},q={Filter:{title:"Filter",showTitle:"Filter einblenden",hideTitle:"Filter ausblenden",clearAll:"Alle löschen"},InputButtonGroup:{title:"Kategorien",price:"Preis",customPrice:"Benutzerdefinierter Preis",priceIncluded:"ja",priceExcluded:"nein",priceExcludedMessage:"Nicht {title}",priceRange:" und höher",showmore:"Mehr anzeigen"},Loading:{title:"Ladevorgang läuft"},NoResults:{heading:"Keine Ergebnisse zu Ihrer Suche.",subheading:"Versuchen Sie es erneut..."},SortDropdown:{title:"Sortieren nach",option:"Sortieren nach: {selectedOption}",relevanceLabel:"Höchste Relevanz",positionLabel:"Position"},CategoryFilters:{results:"Ergebnisse für {phrase}",products:"{totalCount} Produkte"},ProductCard:{asLowAs:"Schon ab {discountPrice}",startingAt:"Ab {productPrice}",bundlePrice:"Aus {fromBundlePrice} zu {toBundlePrice}",from:"Ab {productPrice}"},ProductContainers:{minquery:"Ihr Suchbegriff {variables.phrase} ist kürzer als das Minimum von {minQueryLength} Zeichen.",noresults:"Zu Ihrer Suche wurden keine Ergebnisse zurückgegeben.",pagePicker:"{pageSize} pro Seite anzeigen",showAll:"alle"},SearchBar:{placeholder:"Suchen..."}},Q={Filter:{title:"Φίλτρα",showTitle:"Εμφάνιση φίλτρων",hideTitle:"Απόκρυψη φίλτρων",clearAll:"Απαλοιφή όλων"},InputButtonGroup:{title:"Κατηγορίες",price:"Τιμή",customPrice:"Προσαρμοσμένη τιμή",priceIncluded:"ναι",priceExcluded:"όχι",priceExcludedMessage:"Όχι {title}",priceRange:" και παραπάνω",showmore:"Εμφάνιση περισσότερων"},Loading:{title:"Γίνεται φόρτωση"},NoResults:{heading:"Δεν υπάρχουν αποτελέσματα για την αναζήτησή σας.",subheading:"Προσπαθήστε ξανά..."},SortDropdown:{title:"Ταξινόμηση κατά",option:"Ταξινόμηση κατά: {selectedOption}",relevanceLabel:"Το πιο σχετικό",positionLabel:"Θέση"},CategoryFilters:{results:"αποτελέσματα για {phrase}",products:"{totalCount} προϊόντα"},ProductCard:{asLowAs:"Τόσο χαμηλά όσο {discountPrice}",startingAt:"Έναρξη από {productPrice}",bundlePrice:"Από {fromBundlePrice} Προς {toBundlePrice}",from:"Από {productPrice}"},ProductContainers:{minquery:"Ο όρος αναζήτησής σας {variables.phrase} δεν έχει φτάσει στο ελάχιστο {minQueryLength} χαρακτήρες.",noresults:"Η αναζήτηση δεν επέστρεψε κανένα αποτέλεσμα.",pagePicker:"Προβολή {pageSize} ανά σελίδα",showAll:"όλα"},SearchBar:{placeholder:"Αναζήτηση..."}},K={Filter:{title:"Filters",showTitle:"Show filters",hideTitle:"Hide filters",clearAll:"Clear all"},InputButtonGroup:{title:"Categories",price:"Price",customPrice:"Custom Price",priceIncluded:"yes",priceExcluded:"no",priceExcludedMessage:"Not {title}",priceRange:" and above",showmore:"Show more"},Loading:{title:"Loading"},NoResults:{heading:"No results for your search.",subheading:"Please try again..."},SortDropdown:{title:"Sort by",option:"Sort by: {selectedOption}",relevanceLabel:"Most Relevant",positionLabel:"Position"},CategoryFilters:{results:"results for {phrase}",products:"{totalCount} products"},ProductCard:{asLowAs:"As low as {discountPrice}",startingAt:"Starting at {productPrice}",bundlePrice:"From {fromBundlePrice} To {toBundlePrice}",from:"From {productPrice}"},ProductContainers:{minquery:"Your search term {variables.phrase} has not reached the minimum of {minQueryLength} characters.",noresults:"Your search returned no results.",pagePicker:"Show {pageSize} per page",showAll:"all"},SearchBar:{placeholder:"Search..."}},m={Filter:{title:"Filters",showTitle:"Show filters",hideTitle:"Hide filters",clearAll:"Clear all"},InputButtonGroup:{title:"Categories",price:"Price",customPrice:"Custom Price",priceIncluded:"yes",priceExcluded:"no",priceExcludedMessage:"Not {title}",priceRange:" and above",showmore:"Show more"},Loading:{title:"Loading"},NoResults:{heading:"No results for your search.",subheading:"Please try again..."},SortDropdown:{title:"Sort by",option:"Sort by: {selectedOption}",relevanceLabel:"Most Relevant",positionLabel:"Position",sortAttributeASC:"{label}: Low to High",sortAttributeDESC:"{label}: High to Low",sortASC:"Price: Low to High",sortDESC:"Price: High to Low",productName:"Product Name",productInStock:"In Stock",productLowStock:"Low Stock"},CategoryFilters:{results:"results for {phrase}",products:"{totalCount} products"},ProductCard:{asLowAs:"As low as {discountPrice}",startingAt:"Starting at {productPrice}",bundlePrice:"From {fromBundlePrice} To {toBundlePrice}",from:"From {productPrice}"},ProductContainers:{minquery:"Your search term {variables.phrase} has not reached the minimum of {minQueryLength} characters.",noresults:"Your search returned no results.",pagePicker:"Show {pageSize} per page",showAll:"all"},SearchBar:{placeholder:"Search..."},ListView:{viewDetails:"View details"}},V={Filter:{title:"Filtros",showTitle:"Mostrar filtros",hideTitle:"Ocultar filtros",clearAll:"Borrar todo"},InputButtonGroup:{title:"Categorías",price:"Precio",customPrice:"Precio personalizado",priceIncluded:"sí",priceExcluded:"no",priceExcludedMessage:"No es {title}",priceRange:" y más",showmore:"Mostrar más"},Loading:{title:"Cargando"},NoResults:{heading:"No hay resultados para tu búsqueda.",subheading:"Inténtalo de nuevo..."},SortDropdown:{title:"Ordenar por",option:"Ordenar por: {selectedOption}",relevanceLabel:"Más relevantes",positionLabel:"Posición"},CategoryFilters:{results:"resultados de {phrase}",products:"{totalCount} productos"},ProductCard:{asLowAs:"Por solo {discountPrice}",startingAt:"A partir de {productPrice}",bundlePrice:"Desde {fromBundlePrice} hasta {toBundlePrice}",from:"Desde {productPrice}"},ProductContainers:{minquery:"El término de búsqueda {variables.phrase} no llega al mínimo de {minQueryLength} caracteres.",noresults:"Tu búsqueda no ha dado resultados.",pagePicker:"Mostrar {pageSize} por página",showAll:"todo"},SearchBar:{placeholder:"Buscar..."}},H={Filter:{title:"Filtrid",showTitle:"Kuva filtrid",hideTitle:"Peida filtrid",clearAll:"Tühjenda kõik"},InputButtonGroup:{title:"Kategooriad",price:"Hind",customPrice:"Kohandatud hind",priceIncluded:"jah",priceExcluded:"ei",priceExcludedMessage:"Mitte {title}",priceRange:" ja üleval",showmore:"Kuva rohkem"},Loading:{title:"Laadimine"},NoResults:{heading:"Teie otsingule pole tulemusi.",subheading:"Proovige uuesti…"},SortDropdown:{title:"Sortimisjärjekord",option:"Sortimisjärjekord: {selectedOption}",relevanceLabel:"Kõige asjakohasem",positionLabel:"Asukoht"},CategoryFilters:{results:"{phrase} tulemused",products:"{totalCount} toodet"},ProductCard:{asLowAs:"Ainult {discountPrice}",startingAt:"Alates {productPrice}",bundlePrice:"Alates {fromBundlePrice} kuni {toBundlePrice}",from:"Alates {productPrice}"},ProductContainers:{minquery:"Teie otsingutermin {variables.phrase} ei sisalda vähemalt {minQueryLength} tähemärki.",noresults:"Teie otsing ei andnud tulemusi.",pagePicker:"Näita {pageSize} lehekülje kohta",showAll:"kõik"},SearchBar:{placeholder:"Otsi…"}},U={Filter:{title:"Iragazkiak",showTitle:"Erakutsi iragazkiak",hideTitle:"Ezkutatu iragazkiak",clearAll:"Garbitu dena"},InputButtonGroup:{title:"Kategoriak",price:"Prezioa",customPrice:"Prezio pertsonalizatua",priceIncluded:"bai",priceExcluded:"ez",priceExcludedMessage:"Ez da {title}",priceRange:" eta gorago",showmore:"Erakutsi gehiago"},Loading:{title:"Kargatzen"},NoResults:{heading:"Ez dago emaitzarik zure bilaketarako.",subheading:"Saiatu berriro mesedez..."},SortDropdown:{title:"Ordenatu",option:"Ordenatu honen arabera: {selectedOption}",relevanceLabel:"Garrantzitsuena",positionLabel:"Posizioa"},CategoryFilters:{results:"{phrase} bilaketaren emaitzak",products:"{totalCount} produktu"},ProductCard:{asLowAs:"{discountPrice} bezain baxua",startingAt:"{productPrice}-tatik hasita",bundlePrice:"{fromBundlePrice} eta {toBundlePrice} artean",from:"{productPrice}-tatik hasita"},ProductContainers:{minquery:"Zure bilaketa-terminoa ({variables.phrase}) ez da iritsi gutxieneko {minQueryLength} karakteretara.",noresults:"Zure bilaketak ez du emaitzarik eman.",pagePicker:"Erakutsi {pageSize} orriko",showAll:"guztiak"},SearchBar:{placeholder:"Bilatu..."}},Z={Filter:{title:"فیلترها",showTitle:"نمایش فیلترها",hideTitle:"محو فیلترها",clearAll:"پاک کردن همه"},InputButtonGroup:{title:"دسته‌ها",price:"قیمت",customPrice:"قیمت سفارشی",priceIncluded:"بله",priceExcluded:"خیر",priceExcludedMessage:"نه {title}",priceRange:" و بالاتر",showmore:"نمایش بیشتر"},Loading:{title:"درحال بارگیری"},NoResults:{heading:"جستجوی شما نتیجه‌ای دربر نداشت.",subheading:"لطفاً دوباره امتحان کنید..."},SortDropdown:{title:"مرتب‌سازی براساس",option:"مرتب‌سازی براساس: {selectedOption}",relevanceLabel:"مرتبط‌ترین",positionLabel:"موقعیت"},CategoryFilters:{results:"نتایج برای {phrase}",products:"{totalCount} محصولات"},ProductCard:{asLowAs:"برابر با {discountPrice}",startingAt:"شروع از {productPrice}",bundlePrice:"از {fromBundlePrice} تا {toBundlePrice}",from:"از {productPrice}"},ProductContainers:{minquery:"عبارت جستجوی شما {variables.phrase} به حداقل تعداد کاراکترهای لازم یعنی {minQueryLength} کاراکتر نرسیده است.",noresults:"جستجوی شما نتیجه‌ای را حاصل نکرد.",pagePicker:"نمایش {pageSize} در هر صفحه",showAll:"همه"},SearchBar:{placeholder:"جستجو..."}},Y={Filter:{title:"Suodattimet",showTitle:"Näytä suodattimet",hideTitle:"Piilota suodattimet",clearAll:"Poista kaikki"},InputButtonGroup:{title:"Luokat",price:"Hinta",customPrice:"Mukautettu hinta",priceIncluded:"kyllä",priceExcluded:"ei",priceExcludedMessage:"Ei {title}",priceRange:" ja enemmän",showmore:"Näytä enemmän"},Loading:{title:"Ladataan"},NoResults:{heading:"Haullasi ei löytynyt tuloksia.",subheading:"Yritä uudelleen..."},SortDropdown:{title:"Lajitteluperuste",option:"Lajitteluperuste: {selectedOption}",relevanceLabel:"Olennaisimmat",positionLabel:"Sijainti"},CategoryFilters:{results:"tulosta ilmaukselle {phrase}",products:"{totalCount} tuotetta"},ProductCard:{asLowAs:"Parhaimmillaan {discountPrice}",startingAt:"Alkaen {productPrice}",bundlePrice:"{fromBundlePrice} alkaen {toBundlePrice} asti",from:"{productPrice} alkaen"},ProductContainers:{minquery:"Hakusanasi {variables.phrase} ei ole saavuttanut {minQueryLength} merkin vähimmäismäärää.",noresults:"Hakusi ei palauttanut tuloksia.",pagePicker:"Näytä {pageSize} sivua kohti",showAll:"kaikki"},SearchBar:{placeholder:"Hae..."}},J={Filter:{title:"Filtres",showTitle:"Afficher les filtres",hideTitle:"Masquer les filtres",clearAll:"Tout effacer"},InputButtonGroup:{title:"Catégories",price:"Prix",customPrice:"Prix personnalisé",priceIncluded:"oui",priceExcluded:"non",priceExcludedMessage:"Exclure {title}",priceRange:" et plus",showmore:"Plus"},Loading:{title:"Chargement"},NoResults:{heading:"Votre recherche n’a renvoyé aucun résultat",subheading:"Veuillez réessayer…"},SortDropdown:{title:"Trier par",option:"Trier par : {selectedOption}",relevanceLabel:"Pertinence",positionLabel:"Position"},CategoryFilters:{results:"résultats trouvés pour {phrase}",products:"{totalCount} produits"},ProductCard:{asLowAs:"Prix descendant jusqu’à {discountPrice}",startingAt:"À partir de {productPrice}",bundlePrice:"De {fromBundlePrice} à {toBundlePrice}",from:"De {productPrice}"},ProductContainers:{minquery:"Votre terme de recherche « {variables.phrase} » est en dessous de la limite minimale de {minQueryLength} caractères.",noresults:"Votre recherche n’a renvoyé aucun résultat.",pagePicker:"Affichage : {pageSize} par page",showAll:"tout"},SearchBar:{placeholder:"Rechercher…"}},$={Filter:{title:"Filtros",showTitle:"Mostrar filtros",hideTitle:"Ocultar filtros",clearAll:"Borrar todo"},InputButtonGroup:{title:"Categorías",price:"Prezo",customPrice:"Prezo personalizado",priceIncluded:"si",priceExcluded:"non",priceExcludedMessage:"Non {title}",priceRange:" e superior",showmore:"Mostrar máis"},Loading:{title:"Cargando"},NoResults:{heading:"Non hai resultados para a súa busca.",subheading:"Ténteo de novo..."},SortDropdown:{title:"Ordenar por",option:"Ordenar por: {selectedOption}",relevanceLabel:"Máis relevante",positionLabel:"Posición"},CategoryFilters:{results:"resultados para {phrase}",products:"{totalCount} produtos"},ProductCard:{asLowAs:"A partir de só {discountPrice}",startingAt:"A partir de {productPrice}",bundlePrice:"Desde {fromBundlePrice} ata {toBundlePrice}",from:"Desde {productPrice}"},ProductContainers:{minquery:"O seu termo de busca {variables.phrase} non alcanzou o mínimo de {minQueryLength} caracteres.",noresults:"A súa busca non obtivo resultados.",pagePicker:"Mostrar {pageSize} por páxina",showAll:"todos"},SearchBar:{placeholder:"Buscar..."}},W={Filter:{title:"फिल्टर",showTitle:"फ़िल्टर दिखाएं",hideTitle:"फ़िल्टर छुपाएं",clearAll:"सभी साफ करें"},InputButtonGroup:{title:"श्रेणियाँ",price:"कीमत",customPrice:"कस्टम कीमत",priceIncluded:"हां",priceExcluded:"नहीं",priceExcludedMessage:"नहीं {title}",priceRange:" और ऊपर",showmore:"और दिखाएं"},Loading:{title:"लोड हो रहा है"},NoResults:{heading:"आपकी खोज के लिए कोई परिणाम नहीं.",subheading:"कृपया फिर कोशिश करें..."},SortDropdown:{title:"इसके अनुसार क्रमबद्ध करें",option:"इसके अनुसार क्रमबद्ध करें: {selectedOption}",relevanceLabel:"सबसे अधिक प्रासंगिक",positionLabel:"पद"},CategoryFilters:{results:"{phrase} के लिए परिणाम",products:"{totalCount} प्रोडक्ट्स"},ProductCard:{asLowAs:"{discountPrice} जितना कम ",startingAt:"{productPrice} से शुरू",bundlePrice:"{fromBundlePrice} से {toBundlePrice} तक",from:"{productPrice} से "},ProductContainers:{minquery:"आपका खोज शब्द {variables.phrase} न्यूनतम {minQueryLength} वर्ण तक नहीं पहुंच पाया है।",noresults:"आपकी खोज का कोई परिणाम नहीं निकला।",pagePicker:"प्रति पृष्ठ {pageSize}दिखाओ",showAll:"सब"},SearchBar:{placeholder:"खोज..."}},X={Filter:{title:"Szűrők",showTitle:"Szűrők megjelenítése",hideTitle:"Szűrők elrejtése",clearAll:"Összes törlése"},InputButtonGroup:{title:"Kategóriák",price:"Ár",customPrice:"Egyedi ár",priceIncluded:"igen",priceExcluded:"nem",priceExcludedMessage:"Nem {title}",priceRange:" és fölötte",showmore:"További információk megjelenítése"},Loading:{title:"Betöltés"},NoResults:{heading:"Nincs találat a keresésre.",subheading:"Kérjük, próbálja meg újra..."},SortDropdown:{title:"Rendezési szempont",option:"Rendezési szempont: {selectedOption}",relevanceLabel:"Legrelevánsabb",positionLabel:"Pozíció"},CategoryFilters:{results:"eredmények a következőre: {phrase}",products:"{totalCount} termék"},ProductCard:{asLowAs:"Ennyire alacsony: {discountPrice}",startingAt:"Kezdő ár: {productPrice}",bundlePrice:"Ettől: {fromBundlePrice} Eddig: {toBundlePrice}",from:"Ettől: {productPrice}"},ProductContainers:{minquery:"A keresett kifejezés: {variables.phrase} nem érte el a minimum {minQueryLength} karaktert.",noresults:"A keresés nem hozott eredményt.",pagePicker:"{pageSize} megjelenítése oldalanként",showAll:"összes"},SearchBar:{placeholder:"Keresés..."}},ee={Filter:{title:"Filter",showTitle:"Tampilkan filter",hideTitle:"Sembunyikan filter",clearAll:"Bersihkan semua"},InputButtonGroup:{title:"Kategori",price:"Harga",customPrice:"Harga Kustom",priceIncluded:"ya",priceExcluded:"tidak",priceExcludedMessage:"Bukan {title}",priceRange:" ke atas",showmore:"Tampilkan lainnya"},Loading:{title:"Memuat"},NoResults:{heading:"Tidak ada hasil untuk pencarian Anda.",subheading:"Coba lagi..."},SortDropdown:{title:"Urut berdasarkan",option:"Urut berdasarkan: {selectedOption}",relevanceLabel:"Paling Relevan",positionLabel:"Posisi"},CategoryFilters:{results:"hasil untuk {phrase}",products:"{totalCount} produk"},ProductCard:{asLowAs:"Paling rendah {discountPrice}",startingAt:"Mulai dari {productPrice}",bundlePrice:"Mulai {fromBundlePrice} hingga {toBundlePrice}",from:"Mulai {productPrice}"},ProductContainers:{minquery:"Istilah pencarian {variables.phrase} belum mencapai batas minimum {minQueryLength} karakter.",noresults:"Pencarian Anda tidak memberikan hasil.",pagePicker:"Menampilkan {pageSize} per halaman",showAll:"semua"},SearchBar:{placeholder:"Cari..."}},te={Filter:{title:"Filtri",showTitle:"Mostra filtri",hideTitle:"Nascondi filtri",clearAll:"Cancella tutto"},InputButtonGroup:{title:"Categorie",price:"Prezzo",customPrice:"Prezzo personalizzato",priceIncluded:"sì",priceExcluded:"no",priceExcludedMessage:"Non {title}",priceRange:" e superiore",showmore:"Mostra altro"},Loading:{title:"Caricamento"},NoResults:{heading:"Nessun risultato per la ricerca.",subheading:"Riprova..."},SortDropdown:{title:"Ordina per",option:"Ordina per: {selectedOption}",relevanceLabel:"Più rilevante",positionLabel:"Posizione"},CategoryFilters:{results:"risultati per {phrase}",products:"{totalCount} prodotti"},ProductCard:{asLowAs:"A partire da {discountPrice}",startingAt:"A partire da {productPrice}",bundlePrice:"Da {fromBundlePrice} a {toBundlePrice}",from:"Da {productPrice}"},ProductContainers:{minquery:"Il termine di ricerca {variables.phrase} non ha raggiunto il minimo di {minQueryLength} caratteri.",noresults:"La ricerca non ha prodotto risultati.",pagePicker:"Mostra {pageSize} per pagina",showAll:"tutto"},SearchBar:{placeholder:"Cerca..."}},re={Filter:{title:"フィルター",showTitle:"フィルターを表示",hideTitle:"フィルターを隠す",clearAll:"すべて消去"},InputButtonGroup:{title:"カテゴリ",price:"価格",customPrice:"カスタム価格",priceIncluded:"はい",priceExcluded:"いいえ",priceExcludedMessage:"{title}ではない",priceRange:" 以上",showmore:"すべてを表示"},Loading:{title:"読み込み中"},NoResults:{heading:"検索結果はありません。",subheading:"再試行してください"},SortDropdown:{title:"並べ替え条件",option:"{selectedOption}に並べ替え",relevanceLabel:"最も関連性が高い",positionLabel:"配置"},CategoryFilters:{results:"{phrase}の検索結果",products:"{totalCount}製品"},ProductCard:{asLowAs:"割引料金 : {discountPrice}",startingAt:"初年度価格 : {productPrice}",bundlePrice:"{fromBundlePrice} から {toBundlePrice}",from:"{productPrice} から"},ProductContainers:{minquery:"ご入力の検索語{variables.phrase}は、最低文字数 {minQueryLength} 文字に達していません。",noresults:"検索結果はありませんでした。",pagePicker:"1 ページあたり {pageSize} を表示",showAll:"すべて"},SearchBar:{placeholder:"検索"}},ie={Filter:{title:"필터",showTitle:"필터 표시",hideTitle:"필터 숨기기",clearAll:"모두 지우기"},InputButtonGroup:{title:"범주",price:"가격",customPrice:"맞춤 가격",priceIncluded:"예",priceExcluded:"아니요",priceExcludedMessage:"{title} 아님",priceRange:" 이상",showmore:"자세히 표시"},Loading:{title:"로드 중"},NoResults:{heading:"현재 검색에 대한 결과가 없습니다.",subheading:"다시 시도해 주십시오."},SortDropdown:{title:"정렬 기준",option:"정렬 기준: {selectedOption}",relevanceLabel:"관련성 가장 높음",positionLabel:"위치"},CategoryFilters:{results:"{phrase}에 대한 검색 결과",products:"{totalCount}개 제품"},ProductCard:{asLowAs:"최저 {discountPrice}",startingAt:"최저가: {productPrice}",bundlePrice:"{fromBundlePrice} ~ {toBundlePrice}",from:"{productPrice}부터"},ProductContainers:{minquery:"검색어 “{variables.phrase}”이(가) 최소 문자 길이인 {minQueryLength}자 미만입니다.",noresults:"검색 결과가 없습니다.",pagePicker:"페이지당 {pageSize}개 표시",showAll:"모두"},SearchBar:{placeholder:"검색..."}},oe={Filter:{title:"Filtrai",showTitle:"Rodyti filtrus",hideTitle:"Slėpti filtrus",clearAll:"Išvalyti viską"},InputButtonGroup:{title:"Kategorijos",price:"Kaina",customPrice:"Individualizuota kaina",priceIncluded:"taip",priceExcluded:"ne",priceExcludedMessage:"Ne {title}",priceRange:" ir aukščiau",showmore:"Rodyti daugiau"},Loading:{title:"Įkeliama"},NoResults:{heading:"Nėra jūsų ieškos rezultatų.",subheading:"Bandykite dar kartą..."},SortDropdown:{title:"Rikiuoti pagal",option:"Rikiuoti pagal: {selectedOption}",relevanceLabel:"Svarbiausias",positionLabel:"Padėtis"},CategoryFilters:{results:"rezultatai {phrase}",products:"Produktų: {totalCount}"},ProductCard:{asLowAs:"Žema kaip {discountPrice}",startingAt:"Pradedant nuo {productPrice}",bundlePrice:"Nuo {fromBundlePrice} iki {toBundlePrice}",from:"Nuo {productPrice}"},ProductContainers:{minquery:"Jūsų ieškos sąlyga {variables.phrase} nesiekia minimalaus skaičiaus simbolių: {minQueryLength}.",noresults:"Jūsų ieška nedavė jokių rezultatų.",pagePicker:"Rodyti {pageSize} psl.",showAll:"viskas"},SearchBar:{placeholder:"Ieška..."}},ae={Filter:{title:"Filtri",showTitle:"Rādīt filtrus",hideTitle:"Slēpt filtrus",clearAll:"Notīrīt visus"},InputButtonGroup:{title:"Kategorijas",price:"Cena",customPrice:"Pielāgot cenu",priceIncluded:"jā",priceExcluded:"nē",priceExcludedMessage:"Nav {title}",priceRange:" un augstāk",showmore:"Rādīt vairāk"},Loading:{title:"Notiek ielāde"},NoResults:{heading:"Jūsu meklēšanai nav rezultātu.",subheading:"Mēģiniet vēlreiz…"},SortDropdown:{title:"Kārtot pēc",option:"Kārtot pēc: {selectedOption}",relevanceLabel:"Visatbilstošākais",positionLabel:"Pozīcija"},CategoryFilters:{results:"{phrase} rezultāti",products:"{totalCount} produkti"},ProductCard:{asLowAs:"Tik zemu kā {discountPrice}",startingAt:"Sākot no {productPrice}",bundlePrice:"No {fromBundlePrice} uz{toBundlePrice}",from:"No {productPrice}"},ProductContainers:{minquery:"Jūsu meklēšanas vienums {variables.phrase} nav sasniedzis minimumu {minQueryLength} rakstzīmes.",noresults:"Jūsu meklēšana nedeva nekādus rezultātus.",pagePicker:"Rādīt {pageSize} vienā lapā",showAll:"viss"},SearchBar:{placeholder:"Meklēt…"}},se={Filter:{title:"Filtre",showTitle:"Vis filtre",hideTitle:"Skjul filtre",clearAll:"Fjern alle"},InputButtonGroup:{title:"Kategorier",price:"Pris",customPrice:"Egendefinert pris",priceIncluded:"ja",priceExcluded:"nei",priceExcludedMessage:"Ikke {title}",priceRange:" og over",showmore:"Vis mer"},Loading:{title:"Laster inn"},NoResults:{heading:"Finner ingen resultater for søket.",subheading:"Prøv igjen."},SortDropdown:{title:"Sorter etter",option:"Sorter etter: {selectedOption}",relevanceLabel:"Mest aktuelle",positionLabel:"Plassering"},CategoryFilters:{results:"resultater for {phrase}",products:"{totalCount} produkter"},ProductCard:{asLowAs:"Så lavt som {discountPrice}",startingAt:"Fra {productPrice}",bundlePrice:"Fra {fromBundlePrice} til {toBundlePrice}",from:"Fra {productPrice}"},ProductContainers:{minquery:"Søkeordet {variables.phrase} har ikke de påkrevde {minQueryLength} tegnene.",noresults:"Søket ditt ga ingen resultater.",pagePicker:"Vis {pageSize} per side",showAll:"alle"},SearchBar:{placeholder:"Søk …"}},le={Filter:{title:"Filters",showTitle:"Filters weergeven",hideTitle:"Filters verbergen",clearAll:"Alles wissen"},InputButtonGroup:{title:"Categorieën",price:"Prijs",customPrice:"Aangepaste prijs",priceIncluded:"ja",priceExcluded:"nee",priceExcludedMessage:"Niet {title}",priceRange:" en meer",showmore:"Meer tonen"},Loading:{title:"Laden"},NoResults:{heading:"Geen resultaten voor je zoekopdracht.",subheading:"Probeer het opnieuw..."},SortDropdown:{title:"Sorteren op",option:"Sorteren op: {selectedOption}",relevanceLabel:"Meest relevant",positionLabel:"Positie"},CategoryFilters:{results:"resultaten voor {phrase}",products:"{totalCount} producten"},ProductCard:{asLowAs:"Slechts {discountPrice}",startingAt:"Vanaf {productPrice}",bundlePrice:"Van {fromBundlePrice} tot {toBundlePrice}",from:"Vanaf {productPrice}"},ProductContainers:{minquery:"Je zoekterm {variables.phrase} bevat niet het minimumaantal van {minQueryLength} tekens.",noresults:"Geen resultaten gevonden voor je zoekopdracht.",pagePicker:"{pageSize} weergeven per pagina",showAll:"alles"},SearchBar:{placeholder:"Zoeken..."}},ne={Filter:{title:"Filtros",showTitle:"Mostrar filtros",hideTitle:"Ocultar filtros",clearAll:"Limpar tudo"},InputButtonGroup:{title:"Categorias",price:"Preço",customPrice:"Preço personalizado",priceIncluded:"sim",priceExcluded:"não",priceExcludedMessage:"Não {title}",priceRange:" e acima",showmore:"Mostrar mais"},Loading:{title:"Carregando"},NoResults:{heading:"Nenhum resultado para sua busca.",subheading:"Tente novamente..."},SortDropdown:{title:"Classificar por",option:"Classificar por: {selectedOption}",relevanceLabel:"Mais relevantes",positionLabel:"Posição"},CategoryFilters:{results:"resultados para {phrase}",products:"{totalCount} produtos"},ProductCard:{asLowAs:"Por apenas {discountPrice}",startingAt:"A partir de {productPrice}",bundlePrice:"De {fromBundlePrice} por {toBundlePrice}",from:"De {productPrice}"},ProductContainers:{minquery:"Seu termo de pesquisa {variables.phrase} não atingiu o mínimo de {minQueryLength} caracteres.",noresults:"Sua busca não retornou resultados.",pagePicker:"Mostrar {pageSize} por página",showAll:"tudo"},SearchBar:{placeholder:"Pesquisar..."}},ce={Filter:{title:"Filtros",showTitle:"Mostrar filtros",hideTitle:"Ocultar filtros",clearAll:"Limpar tudo"},InputButtonGroup:{title:"Categorias",price:"Preço",customPrice:"Preço Personalizado",priceIncluded:"sim",priceExcluded:"não",priceExcludedMessage:"Não {title}",priceRange:" e acima",showmore:"Mostrar mais"},Loading:{title:"A carregar"},NoResults:{heading:"Não existem resultados para a sua pesquisa.",subheading:"Tente novamente..."},SortDropdown:{title:"Ordenar por",option:"Ordenar por: {selectedOption}",relevanceLabel:"Mais Relevantes",positionLabel:"Posição"},CategoryFilters:{results:"resultados para {phrase}",products:"{totalCount} produtos"},ProductCard:{asLowAs:"A partir de {discountPrice}",startingAt:"A partir de {productPrice}",bundlePrice:"De {fromBundlePrice} a {toBundlePrice}",from:"A partir de {productPrice}"},ProductContainers:{minquery:"O seu termo de pesquisa {variables.phrase} não atingiu o mínimo de {minQueryLength} carateres.",noresults:"A sua pesquisa não devolveu resultados.",pagePicker:"Mostrar {pageSize} por página",showAll:"tudo"},SearchBar:{placeholder:"Procurar..."}},ue={Filter:{title:"Filtre",showTitle:"Afișați filtrele",hideTitle:"Ascundeți filtrele",clearAll:"Ștergeți tot"},InputButtonGroup:{title:"Categorii",price:"Preț",customPrice:"Preț personalizat",priceIncluded:"da",priceExcluded:"nu",priceExcludedMessage:"Fără {title}",priceRange:" și mai mult",showmore:"Afișați mai multe"},Loading:{title:"Se încarcă"},NoResults:{heading:"Niciun rezultat pentru căutarea dvs.",subheading:"Încercați din nou..."},SortDropdown:{title:"Sortați după",option:"Sortați după: {selectedOption}",relevanceLabel:"Cele mai relevante",positionLabel:"Poziție"},CategoryFilters:{results:"rezultate pentru {phrase}",products:"{totalCount} produse"},ProductCard:{asLowAs:"Preț redus până la {discountPrice}",startingAt:"Începând de la {productPrice}",bundlePrice:"De la {fromBundlePrice} la {toBundlePrice}",from:"De la {productPrice}"},ProductContainers:{minquery:"Termenul căutat {variables.phrase} nu a atins numărul minim de {minQueryLength} caractere.",noresults:"Nu există rezultate pentru căutarea dvs.",pagePicker:"Afișați {pageSize} per pagină",showAll:"toate"},SearchBar:{placeholder:"Căutare..."}},de={Filter:{title:"Фильтры",showTitle:"Показать фильтры",hideTitle:"Скрыть фильтры",clearAll:"Очистить все"},InputButtonGroup:{title:"Категории",price:"Цена",customPrice:"Индивидуальная цена",priceIncluded:"да",priceExcluded:"нет",priceExcludedMessage:"Нет {title}",priceRange:" и выше",showmore:"Показать еще"},Loading:{title:"Загрузка"},NoResults:{heading:"Нет результатов по вашему поисковому запросу.",subheading:"Повторите попытку..."},SortDropdown:{title:"Сортировка по",option:"Сортировать по: {selectedOption}",relevanceLabel:"Самые подходящие",positionLabel:"Положение"},CategoryFilters:{results:"Результаты по запросу «{phrase}»",products:"Продукты: {totalCount}"},ProductCard:{asLowAs:"Всего за {discountPrice}",startingAt:"От {productPrice}",bundlePrice:"От {fromBundlePrice} до {toBundlePrice}",from:"От {productPrice}"},ProductContainers:{minquery:"Поисковый запрос «{variables.phrase}» содержит меньше {minQueryLength} символов.",noresults:"Нет результатов по вашему запросу.",pagePicker:"Показывать {pageSize} на странице",showAll:"все"},SearchBar:{placeholder:"Поиск..."}},pe={Filter:{title:"Filter",showTitle:"Visa filter",hideTitle:"Dölj filter",clearAll:"Rensa allt"},InputButtonGroup:{title:"Kategorier",price:"Pris",customPrice:"Anpassat pris",priceIncluded:"ja",priceExcluded:"nej",priceExcludedMessage:"Inte {title}",priceRange:" eller mer",showmore:"Visa mer"},Loading:{title:"Läser in"},NoResults:{heading:"Inga sökresultat.",subheading:"Försök igen …"},SortDropdown:{title:"Sortera på",option:"Sortera på: {selectedOption}",relevanceLabel:"Mest relevant",positionLabel:"Position"},CategoryFilters:{results:"resultat för {phrase}",products:"{totalCount} produkter"},ProductCard:{asLowAs:"Så lite som {discountPrice}",startingAt:"Från {productPrice}",bundlePrice:"Från {fromBundlePrice} till {toBundlePrice}",from:"Från {productPrice}"},ProductContainers:{minquery:"Din sökterm {variables.phrase} har inte nått upp till minimiantalet tecken, {minQueryLength}.",noresults:"Sökningen gav inget resultat.",pagePicker:"Visa {pageSize} per sida",showAll:"alla"},SearchBar:{placeholder:"Sök …"}},ge={Filter:{title:"ตัวกรอง",showTitle:"แสดงตัวกรอง",hideTitle:"ซ่อนตัวกรอง",clearAll:"ล้างทั้งหมด"},InputButtonGroup:{title:"หมวดหมู่",price:"ราคา",customPrice:"ปรับแต่งราคา",priceIncluded:"ใช่",priceExcluded:"ไม่",priceExcludedMessage:"ไม่ใช่ {title}",priceRange:" และสูงกว่า",showmore:"แสดงมากขึ้น"},Loading:{title:"กำลังโหลด"},NoResults:{heading:"ไม่มีผลลัพธ์สำหรับการค้นหาของคุณ",subheading:"โปรดลองอีกครั้ง..."},SortDropdown:{title:"เรียงตาม",option:"เรียงตาม: {selectedOption}",relevanceLabel:"เกี่ยวข้องมากที่สุด",positionLabel:"ตำแหน่ง"},CategoryFilters:{results:"ผลลัพธ์สำหรับ {phrase}",products:"{totalCount} ผลิตภัณฑ์"},ProductCard:{asLowAs:"ต่ำสุดที่ {discountPrice}",startingAt:"เริ่มต้นที่ {productPrice}",bundlePrice:"ตั้งแต่ {fromBundlePrice} ถึง {toBundlePrice}",from:"ตั้งแต่ {productPrice}"},ProductContainers:{minquery:"คำว่า {variables.phrase} ที่คุณใช้ค้นหายังมีจำนวนอักขระไม่ถึงจำนวนขั้นต่ำ {minQueryLength} อักขระ",noresults:"การค้นหาของคุณไม่มีผลลัพธ์",pagePicker:"แสดง {pageSize} ต่อหน้า",showAll:"ทั้งหมด"},SearchBar:{placeholder:"ค้นหา..."}},he={Filter:{title:"Filtreler",showTitle:"Filtreleri göster",hideTitle:"Filtreleri gizle",clearAll:"Tümünü temizle"},InputButtonGroup:{title:"Kategoriler",price:"Fiyat",customPrice:"Özel Fiyat",priceIncluded:"evet",priceExcluded:"hayır",priceExcludedMessage:"Hariç: {title}",priceRange:" ve üzeri",showmore:"Diğerlerini göster"},Loading:{title:"Yükleniyor"},NoResults:{heading:"Aramanız hiç sonuç döndürmedi",subheading:"Lütfen tekrar deneyin..."},SortDropdown:{title:"Sırala",option:"Sıralama ölçütü: {selectedOption}",relevanceLabel:"En Çok İlişkili",positionLabel:"Konum"},CategoryFilters:{results:"{phrase} için sonuçlar",products:"{totalCount} ürün"},ProductCard:{asLowAs:"En düşük: {discountPrice}",startingAt:"Başlangıç fiyatı: {productPrice}",bundlePrice:"{fromBundlePrice} - {toBundlePrice} arası",from:"Başlangıç: {productPrice}"},ProductContainers:{minquery:"Arama teriminiz ({variables.phrase}) minimum {minQueryLength} karakter sınırlamasından daha kısa.",noresults:"Aramanız hiç sonuç döndürmedi.",pagePicker:"Sayfa başına {pageSize} göster",showAll:"tümü"},SearchBar:{placeholder:"Ara..."}},me={Filter:{title:"筛选条件",showTitle:"显示筛选条件",hideTitle:"隐藏筛选条件",clearAll:"全部清除"},InputButtonGroup:{title:"类别",price:"价格",customPrice:"自定义价格",priceIncluded:"是",priceExcluded:"否",priceExcludedMessage:"不是 {title}",priceRange:" 及以上",showmore:"显示更多"},Loading:{title:"正在加载"},NoResults:{heading:"无搜索结果。",subheading:"请重试..."},SortDropdown:{title:"排序依据",option:"排序依据:{selectedOption}",relevanceLabel:"最相关",positionLabel:"位置"},CategoryFilters:{results:"{phrase} 的结果",products:"{totalCount} 个产品"},ProductCard:{asLowAs:"低至 {discountPrice}",startingAt:"起价为 {productPrice}",bundlePrice:"从 {fromBundlePrice} 到 {toBundlePrice}",from:"从 {productPrice} 起"},ProductContainers:{minquery:"您的搜索词 {variables.phrase} 尚未达到最少 {minQueryLength} 个字符这一要求。",noresults:"您的搜索未返回任何结果。",pagePicker:"每页显示 {pageSize} 项",showAll:"全部"},SearchBar:{placeholder:"搜索..."}},Pe={Filter:{title:"篩選器",showTitle:"顯示篩選器",hideTitle:"隱藏篩選器",clearAll:"全部清除"},InputButtonGroup:{title:"類別",price:"價格",customPrice:"自訂價格",priceIncluded:"是",priceExcluded:"否",priceExcludedMessage:"不是 {title}",priceRange:" 以上",showmore:"顯示更多"},Loading:{title:"載入中"},NoResults:{heading:"沒有符合搜尋的結果。",subheading:"請再試一次…"},SortDropdown:{title:"排序依據",option:"排序方式:{selectedOption}",relevanceLabel:"最相關",positionLabel:"位置"},CategoryFilters:{results:"{phrase} 的結果",products:"{totalCount} 個產品"},ProductCard:{asLowAs:"低至 {discountPrice}",startingAt:"起價為 {productPrice}",bundlePrice:"從 {fromBundlePrice} 到 {toBundlePrice}",from:"起價為 {productPrice}"},ProductContainers:{minquery:"您的搜尋字詞 {variables.phrase} 未達到最少 {minQueryLength} 個字元。",noresults:"您的搜尋未傳回任何結果。",pagePicker:"顯示每頁 {pageSize}",showAll:"全部"},SearchBar:{placeholder:"搜尋…"}},g={default:m,bg_BG:O,ca_ES:_,cs_CZ:j,da_DK:G,de_DE:q,el_GR:Q,en_GB:K,en_US:m,es_ES:V,et_EE:H,eu_ES:U,fa_IR:Z,fi_FI:Y,fr_FR:J,gl_ES:$,hi_IN:W,hu_HU:X,id_ID:ee,it_IT:te,ja_JP:re,ko_KR:ie,lt_LT:oe,lv_LV:ae,nb_NO:se,nl_NL:le,pt_BR:ne,pt_PT:ce,ro_RO:ue,ru_RU:de,sv_SE:pe,th_TH:ge,tr_TR:he,zh_Hans_CN:me,zh_Hant_TW:Pe},S=P(g.default),xe=()=>b(S),be=e=>Object.keys(g).includes(e)?e:"default",Ne=({children:e})=>{var i;const t=D(),o=be(((i=t==null?void 0:t.config)==null?void 0:i.locale)??"");return p(S.Provider,{value:g[o],children:e})},d={mobile:!1,tablet:!1,desktop:!1,columns:n.desktop},Me=()=>{const{screenSize:e}=b(C),[t,o]=k(d);return w(()=>{o(e||d)},[e]),{screenSize:t}},C=P({}),ke=e=>e.desktop?n.desktop:e.tablet?n.tablet:e.mobile?n.mobile:n.desktop,De=({children:e})=>{const t=()=>{const a=d;return a.mobile=window.matchMedia("screen and (max-width: 767px)").matches,a.tablet=window.matchMedia("screen and (min-width: 768px) and (max-width: 960px)").matches,a.desktop=window.matchMedia("screen and (min-width: 961px)").matches,a.columns=ke(a),a},[o,i]=k(t());w(()=>(window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}));const l=()=>{i({...o,...t()})};return p(C.Provider,{value:{screenSize:o},children:e})};export{Re as B,Ee as C,ve as D,De as R,Fe as S,S as T,ze as a,Be as b,xe as c,ye as d,Me as e,Te as f,Ie as g,Ne as h,D as u,fe as v}; diff --git a/scripts/__dropins__/storefront-search/components/NoImageSvg/NoImage.d.ts b/scripts/__dropins__/storefront-search/components/NoImageSvg/NoImage.d.ts deleted file mode 100644 index 0ca0d03705..0000000000 --- a/scripts/__dropins__/storefront-search/components/NoImageSvg/NoImage.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function NoImage(): import("preact").JSX.Element; -//# sourceMappingURL=NoImage.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/components/PopoverRoot/PopoverRoot.d.ts b/scripts/__dropins__/storefront-search/components/PopoverRoot/PopoverRoot.d.ts deleted file mode 100644 index 3cb4effe0a..0000000000 --- a/scripts/__dropins__/storefront-search/components/PopoverRoot/PopoverRoot.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { HTMLAttributes } from 'preact/compat'; - -export interface PopoverRootProps extends HTMLAttributes { -} -export declare function PopoverRoot(): import("preact/compat").JSX.Element; -//# sourceMappingURL=PopoverRoot.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/components/PopoverRoot/index.d.ts b/scripts/__dropins__/storefront-search/components/PopoverRoot/index.d.ts deleted file mode 100644 index 16be6093fa..0000000000 --- a/scripts/__dropins__/storefront-search/components/PopoverRoot/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './PopoverRoot'; -export { PopoverRoot as default } from './PopoverRoot'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/components/PopoverViewAll/PopoverViewAll.d.ts b/scripts/__dropins__/storefront-search/components/PopoverViewAll/PopoverViewAll.d.ts deleted file mode 100644 index 2afe5cb9a6..0000000000 --- a/scripts/__dropins__/storefront-search/components/PopoverViewAll/PopoverViewAll.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { HTMLAttributes } from 'preact/compat'; - -export interface PopoverViewAllProps extends HTMLAttributes { - className?: string; -} -export declare function PopoverViewAll({ className, ...props }: PopoverViewAllProps): import("preact/compat").JSX.Element | null; -//# sourceMappingURL=PopoverViewAll.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/components/PopoverViewAll/index.d.ts b/scripts/__dropins__/storefront-search/components/PopoverViewAll/index.d.ts deleted file mode 100644 index 98d36cb28d..0000000000 --- a/scripts/__dropins__/storefront-search/components/PopoverViewAll/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './PopoverViewAll'; -export { PopoverViewAll as default } from './PopoverViewAll'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/components/index.d.ts b/scripts/__dropins__/storefront-search/components/index.d.ts deleted file mode 100644 index 282773ec8a..0000000000 --- a/scripts/__dropins__/storefront-search/components/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './PopoverRoot'; -export * from './PopoverViewAll'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/containers/ProductListingPage.d.ts b/scripts/__dropins__/storefront-search/containers/ProductListingPage.d.ts deleted file mode 100644 index ba031e939f..0000000000 --- a/scripts/__dropins__/storefront-search/containers/ProductListingPage.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ProductListingPage/index' -import _default from './ProductListingPage/index' -export default _default diff --git a/scripts/__dropins__/storefront-search/containers/ProductListingPage.js b/scripts/__dropins__/storefront-search/containers/ProductListingPage.js deleted file mode 100644 index bb5567fa79..0000000000 --- a/scripts/__dropins__/storefront-search/containers/ProductListingPage.js +++ /dev/null @@ -1,290 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -import{jsx as r,jsxs as h,Fragment as j}from"@dropins/tools/preact-jsx-runtime.js";import{createContext as Ke}from"@dropins/tools/preact.js";import{useState as w,useEffect as Z,useContext as De,useMemo as Ye,useRef as Ie,useCallback as Tt}from"@dropins/tools/preact-hooks.js";import{D as We,v as Ht,S as me,u as oe,a as bt,b as Ge,c as le,d as At,C as Ot,e as Be,B as Ut,f as Rt,T as zt,g as Vt,R as Dt,h as Bt}from"../chunks/tokens.js";import*as b from"@dropins/tools/preact-compat.js";import{createContext as jt,useEffect as Re,useContext as Zt,useState as fe,useMemo as qt,useRef as Qt}from"@dropins/tools/preact-compat.js";import{a as Gt}from"../chunks/currency-symbol-map.js";import{events as Kt}from"@dropins/tools/event-bus.js";const Wt=()=>{window.scrollTo({top:0})},Xt=(...e)=>e.filter(Boolean).join(" "),Je=(e,n=3,t)=>{var o;const a=[],i=new URL(window.location.href).protocol;for(const c of e){const d=(o=c.url)==null?void 0:o.replace(/^https?:\/\//,"");d&&a.push(`${i}//${d}`)}if(t){const c=`${i}//${t.replace(/^https?:\/\//,"")}`,d=c.indexOf(c);d>-1&&a.splice(d,1),a.unshift(c)}return a.slice(0,n)},et=(e,n)=>{const[t,a]=e.split("?"),s=new URLSearchParams(a);return Object.entries(n).forEach(([i,o])=>{o!=null&&s.set(i,String(o))}),`${t}?${s.toString()}`},Yt=(e,n)=>{const t={fit:"cover",crop:!1,dpi:1},a=[];for(const s of e){const i=et(s,{...t,width:n}),c=[1,2,3].map(d=>`${et(s,{...t,auto:"webp",quality:80,width:n*d})} ${d}x`);a.push({src:i,srcset:c})}return a},ae=(e,n,t,a=!1,s=!1)=>{var u,l;let i,o;"productView"in e&&(i=(u=e.productView)==null?void 0:u.price,o=i.regular,s&&(o=i.final));let c=(o==null?void 0:o.amount.currency)??"USD";n?c=n:c=Gt(c)??"$";const d=t?((l=o==null?void 0:o.amount)==null?void 0:l.value)??0*parseFloat(t):o==null?void 0:o.amount.value;return d?`${c}${d.toFixed(2)}`:""},Jt=()=>{const e=localStorage!=null&&localStorage.getItem("ds-view-history-time-decay")?JSON.parse(localStorage.getItem("ds-view-history-time-decay")):null;return e&&Array.isArray(e)?e.slice(-200).map(n=>({sku:n.sku,dateTime:n.date})):[]},yt={search:"q",search_query:"search_query",pagination:"p",sort:"product_list_order",page_size:"page_size"},tt=e=>{const n=new URL(window.location.href),t=new URLSearchParams(n.searchParams),a=e.attribute;if(e.range){const s=e.range;pe(a)?(t.delete(a),t.append(a,`${s.from}--${s.to}`)):t.append(a,`${s.from}--${s.to}`)}else{const s=e.in||[],i=t.getAll(a);s.map(o=>{i.includes(o)||t.append(a,o)})}he(n.pathname,t)},rt=(e,n)=>{const t=new URL(window.location.href),a=new URLSearchParams(t.searchParams),s=t.searchParams.getAll(e);a.delete(e),n&&(s.splice(s.indexOf(n),1),s.forEach(i=>a.append(e,i))),he(t.pathname,a)},er=()=>{const e=new URL(window.location.href),n=new URLSearchParams(e.searchParams);for(const t of e.searchParams.keys())Object.values(yt).includes(t)||n.delete(t);he(e.pathname,n)},tr=e=>{const n=new URL(window.location.href),t=new URLSearchParams(n.searchParams);t.set("product_list_order",e),he(n.pathname,t)},rr=e=>{const n=new URL(window.location.href),t=new URLSearchParams(n.searchParams);t.set("view_type",e),he(n.pathname,t)},nr=e=>{const n=new URL(window.location.href),t=new URLSearchParams(n.searchParams);e===We?t.delete("page_size"):t.set("page_size",e.toString()),he(n.pathname,t)},wt=e=>{const n=new URL(window.location.href),t=new URLSearchParams(n.searchParams);e===1?t.delete("p"):t.set("p",e.toString()),he(n.pathname,t)},sr=e=>{var a;const n=_t(),t=[];for(const[s,i]of n.entries())if(e.includes(s)&&!Object.values(yt).includes(s))if(i.includes("--")){const o=i.split("--"),c={attribute:s,range:{from:Number(o[0]),to:Number(o[1])}};t.push(c)}else{const o=t.findIndex(c=>c.attribute==s);if(o!==-1)(a=t[o].in)==null||a.push(i);else{const c={attribute:s,in:[i]};t.push(c)}}return t},pe=e=>{const t=_t().get(e);return t||""},_t=()=>{const e=window.location.search;return new URLSearchParams(e)},he=(e,n)=>{n.toString()===""?window.history.pushState({},"",`${e}`):window.history.pushState({},"",`${e}?${n.toString()}`)},je=e=>new DOMParser().parseFromString(e,"text/html").documentElement.textContent,ar=()=>[{label:"Most Relevant",value:"relevance_DESC"},{label:"Price: Low to High",value:"price_ASC"},{label:"Price: High to Low",value:"price_DESC"}],or=(e,n,t,a)=>{const s=a?[{label:e.SortDropdown.positionLabel,value:"position_ASC"}]:[{label:e.SortDropdown.relevanceLabel,value:"relevance_DESC"}],i=t!="1";return n&&n.length>0&&n.forEach(o=>{!o.attribute.includes("relevance")&&!(o.attribute.includes("inStock")&&i)&&!o.attribute.includes("position")&&(o.numeric&&o.attribute.includes("price")?(s.push({label:`${o.label}: Low to High`,value:`${o.attribute}_ASC`}),s.push({label:`${o.label}: High to Low`,value:`${o.attribute}_DESC`})):s.push({label:`${o.label}`,value:`${o.attribute}_DESC`}))}),s},Ct=e=>{if(!e)return;const n=e.lastIndexOf("_");return[{attribute:e.substring(0,n),direction:e.substring(n+1)==="ASC"?"ASC":"DESC"}]},lr=(e,n)=>{const{rootMargin:t}=n,[a,s]=w(null);return Z(()=>{if(!(e!=null&&e.current))return;const i=new IntersectionObserver(([o])=>{s(o),o.isIntersecting&&i.unobserve(o.target)},{rootMargin:t});return i.observe(e.current),()=>{i.disconnect()}},[e,t]),a},ir=["environmentId","environmentType","websiteCode","storeCode","storeViewCode","config","context","apiUrl","apiKey","route","searchQuery","customerGroup","type","defaultHeaders"],cr=e=>e!=="apiUrl"?e:typeof e=="string"?(e=e.replace(/[^a-z0-9áéíóúñü \.,_-]/gim,""),e.trim()):e,nt=e=>(Object.keys(e).forEach(n=>{if(!ir.includes(n)){console.error(`Invalid key ${n} in StoreDetailsProps`),delete e[n];return}e[n]=cr(e[n])}),e),dr=` - fragment Facet on Aggregation { - title - attribute - buckets { - title - __typename - ... on CategoryView { - name - count - path - } - ... on ScalarBucket { - count - } - ... on RangeBucket { - from - to - count - } - ... on StatsBucket { - min - max - } - } - } -`,ur=` - fragment ProductView on ProductSearchItem { - productView { - __typename - sku - name - inStock - url - urlKey - images { - label - url - roles - } - ... on ComplexProductView { - priceRange { - maximum { - final { - amount { - value - currency - } - } - regular { - amount { - value - currency - } - } - } - minimum { - final { - amount { - value - currency - } - } - regular { - amount { - value - currency - } - } - } - } - options { - id - title - values { - title - ... on ProductViewOptionValueSwatch { - id - inStock - type - value - } - } - } - } - ... on SimpleProductView { - price { - final { - amount { - value - currency - } - } - regular { - amount { - value - currency - } - } - } - } - } - highlights { - attribute - value - matched_words - } - } -`,mr=` - query attributeMetadata { - attributeMetadata { - sortable { - label - attribute - numeric - } - filterableInSearch { - label - attribute - numeric - } - } - } -`,pr=` - query productSearch( - $phrase: String! - $pageSize: Int - $currentPage: Int = 1 - $filter: [SearchClauseInput!] - $sort: [ProductSearchSortInput!] - $context: QueryContextInput - ) { - productSearch( - phrase: $phrase - page_size: $pageSize - current_page: $currentPage - filter: $filter - sort: $sort - context: $context - ) { - total_count - items { - ...ProductView - } - facets { - ...Facet - } - page_info { - current_page - page_size - total_pages - } - } - attributeMetadata { - sortable { - label - attribute - numeric - } - } - } - ${ur} - ${dr} -`,hr=` - query refineProduct( - $optionIds: [String!]! - $sku: String! - ) { - refineProduct( - optionIds: $optionIds - sku: $sku - ) { - __typename - id - sku - name - inStock - url - urlKey - images { - label - url - roles - } - ... on SimpleProductView { - price { - final { - amount { - value - } - } - regular { - amount { - value - } - } - } - } - ... on ComplexProductView { - options { - id - title - required - values { - id - title - } - } - priceRange { - maximum { - final { - amount { - value - } - } - regular { - amount { - value - } - } - } - minimum { - final { - amount { - value - } - } - regular { - amount { - value - } - } - } - } - } - } - } -`,fr=` - query customerCart { - customerCart { - id - items { - id - product { - name - sku - } - quantity - } - } - } -`,gr=async({apiUrl:e,phrase:n,pageSize:t=24,displayOutOfStock:a,currentPage:s=1,filter:i=[],sort:o=[],context:c,categorySearch:d=!1,headers:u})=>{var N,k;const l={phrase:n,pageSize:t,currentPage:s,filter:i,sort:o,context:c};let p="Search";d&&(p="Catalog");const x={attribute:"visibility",in:[p,"Catalog, Search"]};l.filter.push(x);const f=a!="1",g={attribute:"inStock",eq:"true"};f&&l.filter.push(g);const v=Ht();_r(me,v,n,i,t,s,o);const m=(N=window.magentoStorefrontEvents)==null?void 0:N.publish;m!=null&&m.searchRequestSent&&m.searchRequestSent(me);const C=await(await fetch(e,{method:"POST",headers:u,body:JSON.stringify({query:pr,variables:{...l}})})).json();return Cr(me,v,(k=C==null?void 0:C.data)==null?void 0:k.productSearch),m!=null&&m.searchResponseReceived&&m.searchResponseReceived(me),d?m!=null&&m.categoryResultsView&&m.categoryResultsView(me):m!=null&&m.searchResultsView&&m.searchResultsView(me),C==null?void 0:C.data},vr=async({apiUrl:e,headers:n})=>{const a=await(await fetch(e,{method:"POST",headers:n,body:JSON.stringify({query:mr})})).json();return a==null?void 0:a.data},xr=async({apiUrl:e,optionIds:n,sku:t,headers:a})=>{const o=await(await fetch(e,{method:"POST",headers:a,body:JSON.stringify({query:hr,variables:{...{optionIds:n,sku:t}}})})).json();return o==null?void 0:o.data},Nt=Ke({sortable:[],filterableInSearch:[]}),br=({children:e})=>{const[n,t]=w({sortable:[],filterableInSearch:null}),a=oe();Z(()=>{(async()=>{const o=await vr({headers:a.defaultHeaders,apiUrl:a.apiUrl});o!=null&&o.attributeMetadata&&t({sortable:o.attributeMetadata.sortable,filterableInSearch:o.attributeMetadata.filterableInSearch.map(c=>c.attribute)})})()},[]);const s={...n};return r(Nt.Provider,{value:s,children:e})},kt=()=>De(Nt),St=jt({}),yr=({children:e})=>{const n=oe(),t=pe(n.searchQuery||"q"),a=pe("product_list_order"),s=Ct(a),i=s||bt,[o,c]=w(t),[d,u]=w(""),[l,p]=w([]),[x,f]=w([]),[g,v]=w(i),[m,_]=w(0),C=L=>{const E=[...l,L];p(E),tt(L)},N=L=>{const E=[...l],D=E.findIndex(H=>H.attribute===L.attribute);E[D]=L,p(E),tt(L)},k=(L,E)=>{const D=[...l].filter(H=>H.attribute!==L);p(D),rt(L,E)},$=()=>{er(),p([])},I=(L,E)=>{var q;const D=[...l].filter(B=>B.attribute!==L.attribute),H=(q=L.in)==null?void 0:q.filter(B=>B!==E);D.push({attribute:L.attribute,in:H}),H!=null&&H.length?(p(D),rt(L.attribute,E)):k(L.attribute,E)},y=L=>{let E=0;return L.forEach(D=>{D.in?E+=D.in.length:E+=1}),E};Re(()=>{const L=y(l);_(L)},[l]);const V={phrase:o,categoryPath:d,filters:l,sort:g,categoryNames:x,filterCount:m,setPhrase:c,setCategoryPath:u,setFilters:p,setCategoryNames:f,setSort:v,createFilter:C,updateFilter:N,updateFilterOptions:I,removeFilter:k,clearFilters:$};return r(St.Provider,{value:V,children:e})},de=()=>Zt(St),Pt=Ke({variables:{phrase:"",headers:{}},loading:!1,items:[],setItems:()=>{},currentPage:1,setCurrentPage:()=>{},pageSize:We,setPageSize:()=>{},totalCount:0,setTotalCount:()=>{},totalPages:0,setTotalPages:()=>{},facets:[],setFacets:()=>{},categoryName:"",setCategoryName:()=>{},currencySymbol:"",setCurrencySymbol:()=>{},currencyRate:"",setCurrencyRate:()=>{},minQueryLength:Ge,minQueryLengthReached:!1,setMinQueryLengthReached:()=>{},pageSizeOptions:[],setRoute:void 0,refineProduct:()=>{},pageLoading:!1,setPageLoading:()=>{},categoryPath:void 0,viewType:"",setViewType:()=>{},listViewType:"",setListViewType:()=>{},resolveCartId:()=>Promise.resolve(""),refreshCart:()=>{},addToCart:()=>Promise.resolve(),searchHeaders:{},setSearchHeaders:()=>{}}),wr=({children:e})=>{var be,ye,we,_e,Ce,Ne,ke;const n=pe("p"),t=n?Number(n):1,a=de(),s=oe(),i=kt(),o=pe("page_size"),c=Number((ye=(be=s==null?void 0:s.config)==null?void 0:be.perPageConfig)==null?void 0:ye.defaultPageSizeOption)||We,d=o?Number(o):c,l=le().ProductContainers.showAll,[p,x]=w((we=s==null?void 0:s.config)!=null&&we.searchHeaders?s.config.searchHeaders:{}),[f,g]=w(!0),[v,m]=w(!0),[_,C]=w([]),[N,k]=w(t),[$,I]=w(d),[y,V]=w(0),[L,E]=w(0),[D,H]=w([]),[q,B]=w(((_e=s==null?void 0:s.config)==null?void 0:_e.categoryName)??""),[ee,te]=w([]),[T,P]=w(((Ce=s==null?void 0:s.config)==null?void 0:Ce.currencySymbol)??""),[M,U]=w(((Ne=s==null?void 0:s.config)==null?void 0:Ne.currencyRate)??""),[A,R]=w(!1),ue=Ye(()=>{var F;return((F=s==null?void 0:s.config)==null?void 0:F.minQueryLength)||Ge},[s==null?void 0:s.config.minQueryLength]),re=(ke=s.config)==null?void 0:ke.currentCategoryUrlPath,ge=pe("view_type"),[ne,K]=w(ge||"gridView"),[ve,$e]=w("default"),se=Ye(()=>({phrase:a.phrase,filter:a.filters,sort:a.sort,context:s.context,pageSize:$,displayOutOfStock:s.config.displayOutOfStock,currentPage:N}),[a.phrase,a.filters,a.sort,s.context,s.config.displayOutOfStock,$,N]),Ee=async(F,O)=>{const W={...s.defaultHeaders,...p};return await xr({...s,optionIds:F,sku:O,headers:W})},Fe={variables:se,loading:f,items:_,setItems:C,currentPage:N,setCurrentPage:k,pageSize:$,setPageSize:I,totalCount:y,setTotalCount:V,totalPages:L,setTotalPages:E,facets:D,setFacets:H,categoryName:q,setCategoryName:B,currencySymbol:T,setCurrencySymbol:P,currencyRate:M,setCurrencyRate:U,minQueryLength:ue,minQueryLengthReached:A,setMinQueryLengthReached:R,pageSizeOptions:ee,setRoute:s.route,refineProduct:Ee,pageLoading:v,setPageLoading:m,categoryPath:re,viewType:ne,setViewType:K,listViewType:ve,setListViewType:$e,cartId:s.config.resolveCartId,refreshCart:s.config.refreshCart,resolveCartId:s.config.resolveCartId,addToCart:s.config.addToCart,searchHeaders:p,setSearchHeaders:x},xe=async(F={})=>{var O,W,X,Y,Q,ie,ce,Se,Pe,z;try{if(g(!0),Wt(),Me()){const J=[...se.filter];Ae(re,J);const S=await gr({...se,...s,apiUrl:s.apiUrl,filter:J,categorySearch:!!re,headers:F});C(((O=S==null?void 0:S.productSearch)==null?void 0:O.items)||[]),H(((W=S==null?void 0:S.productSearch)==null?void 0:W.facets)||[]),V(((X=S==null?void 0:S.productSearch)==null?void 0:X.total_count)||0),E(((Q=(Y=S==null?void 0:S.productSearch)==null?void 0:Y.page_info)==null?void 0:Q.total_pages)||1),Oe(((ie=S==null?void 0:S.productSearch)==null?void 0:ie.facets)||[]),Te((ce=S==null?void 0:S.productSearch)==null?void 0:ce.total_count),He((Se=S==null?void 0:S.productSearch)==null?void 0:Se.total_count,(z=(Pe=S==null?void 0:S.productSearch)==null?void 0:Pe.page_info)==null?void 0:z.total_pages)}g(!1),m(!1)}catch(J){console.error(J),g(!1),m(!1)}},Me=()=>{var F;return!((F=s.config)!=null&&F.currentCategoryUrlPath)&&a.phrase.trim().length<(Number(s.config.minQueryLength)||Ge)?(C([]),H([]),V(0),E(1),R(!1),!1):(R(!0),!0)},Te=F=>{var Y,Q,ie;const O=[];(((Q=(Y=s==null?void 0:s.config)==null?void 0:Y.perPageConfig)==null?void 0:Q.pageSizeOptions)||At).split(",").forEach(ce=>{O.push({label:ce,value:parseInt(ce,10)})}),((ie=s==null?void 0:s.config)==null?void 0:ie.allowAllProducts)=="1"&&O.push({label:l,value:F!==null?F>500?500:F:0}),te(O)},He=(F,O)=>{F&&F>0&&O===1&&(k(1),wt(1))},Ae=(F,O)=>{if(F){const W={attribute:"categoryPath",eq:F};O.push(W),(se.sort.length<1||se.sort===bt)&&(se.sort=Ot)}},Oe=F=>{F.map(O=>{var X;if(((X=O==null?void 0:O.buckets[0])==null?void 0:X.__typename)==="CategoryView"){const Y=O.buckets.map(Q=>{if(Q.__typename==="CategoryView")return{name:Q.name,value:Q.title,attribute:O.attribute}});a.setCategoryNames(Y)}})};return Z(()=>{i.filterableInSearch&&xe({...s.defaultHeaders,...p})},[a.filters]),Z(()=>{if(i.filterableInSearch){const F=sr(i.filterableInSearch);a.setFilters(F)}},[i.filterableInSearch]),Z(()=>{f||xe({...s.defaultHeaders,...p})},[a.phrase,a.sort,N,$,p]),r(Pt.Provider,{value:Fe,children:e})},G=()=>De(Pt),_r=(e,n,t,a,s,i,o)=>{const c=window.magentoStorefrontEvents;if(!c)return;const d=c.context.getSearchInput()??{units:[]},u={searchUnitId:e,searchRequestId:n,queryTypes:["products","suggestions"],phrase:t,pageSize:s,currentPage:i,filter:a,sort:o},l=d.units.findIndex(p=>p.searchUnitId===e);l<0?d.units.push(u):d.units[l]=u,c.context.setSearchInput(d)},Cr=(e,n,t)=>{var c,d;const a=window.magentoStorefrontEvents;if(!a)return;const s=a.context.getSearchResults()??{units:[]},i=s.units.findIndex(u=>u.searchUnitId===e),o={searchUnitId:e,searchRequestId:n,products:Nr(t.items),categories:[],suggestions:kr(t.suggestions),page:((c=t==null?void 0:t.page_info)==null?void 0:c.current_page)||1,perPage:((d=t==null?void 0:t.page_info)==null?void 0:d.page_size)||20,facets:Sr(t.facets)};i<0?s.units.push(o):s.units[i]=o,a.context.setSearchResults(s)},Nr=e=>e?e.map((t,a)=>{var s,i,o,c,d,u,l,p,x,f;return{name:(s=t==null?void 0:t.product)==null?void 0:s.name,sku:(i=t==null?void 0:t.product)==null?void 0:i.sku,url:((o=t==null?void 0:t.product)==null?void 0:o.canonical_url)??"",imageUrl:(d=(c=t==null?void 0:t.productView)==null?void 0:c.images)!=null&&d.length?((u=t==null?void 0:t.productView)==null?void 0:u.images[0].url)??"":"",price:(f=(x=(p=(l=t.productView)==null?void 0:l.price)==null?void 0:p.final)==null?void 0:x.amount)==null?void 0:f.value,rank:a}}):[],kr=e=>e?e.map((t,a)=>({suggestion:t,rank:a})):[],Sr=e=>e?e.map(t=>({attribute:t==null?void 0:t.attribute,title:t==null?void 0:t.title,type:(t==null?void 0:t.type)||"PINNED",buckets:t==null?void 0:t.buckets.map(a=>a)})):[];async function st(e="",n={},t="",a=""){const s=a?`${a}/graphql`:`${window.origin}/graphql`;return await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Store:t},body:JSON.stringify({query:e,variables:n})}).then(o=>o.json())}const Pr=` - mutation addProductsToCart( - $cartId: String! - $cartItems: [CartItemInput!]! - ) { - addProductsToCart( - cartId: $cartId - cartItems: $cartItems - ) { - cart { - items { - product { - name - sku - } - quantity - } - } - user_errors { - code - message - } - } - } -`,Lt=Ke({}),Lr=()=>De(Lt),Ir=({children:e})=>{const[n,t]=w({cartId:""}),{refreshCart:a,resolveCartId:s}=G(),{storeViewCode:i,config:o}=oe(),c=async()=>{var p;let l="";if(s)l=await s()??"";else{const x=await st(fr,{},i,o==null?void 0:o.baseUrl);l=((p=x==null?void 0:x.data.customerCart)==null?void 0:p.id)??""}return t({...n,cartId:l}),l},u={cart:n,initializeCustomerCart:c,addToCartGraphQL:async l=>{let p=n.cartId;return p||(p=await c()),await st(Pr,{cartId:p,cartItems:[{quantity:1,sku:l}]},i,o==null?void 0:o.baseUrl)},refreshCart:a};return r(Lt.Provider,{value:u,children:e})},$r=e=>b.createElement("svg",{className:"w-6 h-6 mr-1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"black",...e},b.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75"})),Er=e=>b.createElement("svg",{width:23,height:22,viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("path",{d:"M17.9002 18.2899H18.6502V16.7899H17.9002V18.2899ZM6.13016 17.5399L5.38475 17.6228C5.42698 18.0026 5.74801 18.2899 6.13016 18.2899V17.5399ZM4.34016 1.43994L5.08556 1.35707C5.04334 0.977265 4.7223 0.689941 4.34016 0.689941V1.43994ZM1.66016 0.689941H0.910156V2.18994H1.66016V0.689941ZM21.3402 6.80996L22.0856 6.89324C22.1077 6.69506 22.05 6.49622 21.9253 6.34067C21.8005 6.18512 21.6189 6.08566 21.4206 6.06428L21.3402 6.80996ZM20.5402 13.97V14.72C20.9222 14.72 21.2432 14.4329 21.2856 14.0532L20.5402 13.97ZM6.30029 19.0499C6.30029 19.4641 5.96451 19.7999 5.55029 19.7999V21.2999C6.79293 21.2999 7.80029 20.2926 7.80029 19.0499H6.30029ZM5.55029 19.7999C5.13608 19.7999 4.80029 19.4641 4.80029 19.0499H3.30029C3.30029 20.2926 4.30765 21.2999 5.55029 21.2999V19.7999ZM4.80029 19.0499C4.80029 18.6357 5.13608 18.2999 5.55029 18.2999V16.7999C4.30765 16.7999 3.30029 17.8073 3.30029 19.0499H4.80029ZM5.55029 18.2999C5.96451 18.2999 6.30029 18.6357 6.30029 19.0499H7.80029C7.80029 17.8073 6.79293 16.7999 5.55029 16.7999V18.2999ZM19.3003 19.0499C19.3003 19.4641 18.9645 19.7999 18.5503 19.7999V21.2999C19.7929 21.2999 20.8003 20.2926 20.8003 19.0499H19.3003ZM18.5503 19.7999C18.1361 19.7999 17.8003 19.4641 17.8003 19.0499H16.3003C16.3003 20.2926 17.3077 21.2999 18.5503 21.2999V19.7999ZM17.8003 19.0499C17.8003 18.6357 18.1361 18.2999 18.5503 18.2999V16.7999C17.3077 16.7999 16.3003 17.8073 16.3003 19.0499H17.8003ZM18.5503 18.2999C18.9645 18.2999 19.3003 18.6357 19.3003 19.0499H20.8003C20.8003 17.8073 19.7929 16.7999 18.5503 16.7999V18.2999ZM17.9002 16.7899H6.13016V18.2899H17.9002V16.7899ZM6.87556 17.4571L5.08556 1.35707L3.59475 1.52282L5.38475 17.6228L6.87556 17.4571ZM4.34016 0.689941H1.66016V2.18994H4.34016V0.689941ZM4.65983 5.76564L21.2598 7.55564L21.4206 6.06428L4.82064 4.27428L4.65983 5.76564ZM20.5949 6.72668L19.7949 13.8867L21.2856 14.0532L22.0856 6.89324L20.5949 6.72668ZM20.5402 13.22H5.74023V14.72H20.5402V13.22Z",fill:"white"})),Fr=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-check-circle-fill",viewBox:"0 0 16 16",...e},b.createElement("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"})),ze=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 8.122 5.121",stroke:"currentColor",...e},b.createElement("path",{id:"chevron",d:"M199.75,367.5l3,3,3-3",transform:"translate(-198.689 -366.435)",fill:"none"})),Mr=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-exclamation-circle-fill",viewBox:"0 0 16 16",...e},b.createElement("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"})),Tr=e=>b.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("path",{d:"M3.75 1.25H2.25C1.69772 1.25 1.25 1.69772 1.25 2.25V3.75C1.25 4.30228 1.69772 4.75 2.25 4.75H3.75C4.30228 4.75 4.75 4.30228 4.75 3.75V2.25C4.75 1.69772 4.30228 1.25 3.75 1.25Z",fill:"#222222"}),b.createElement("path",{d:"M9.75 1.25H8.25C7.69772 1.25 7.25 1.69772 7.25 2.25V3.75C7.25 4.30228 7.69772 4.75 8.25 4.75H9.75C10.3023 4.75 10.75 4.30228 10.75 3.75V2.25C10.75 1.69772 10.3023 1.25 9.75 1.25Z",fill:"#222222"}),b.createElement("path",{d:"M15.75 1.25H14.25C13.6977 1.25 13.25 1.69772 13.25 2.25V3.75C13.25 4.30228 13.6977 4.75 14.25 4.75H15.75C16.3023 4.75 16.75 4.30228 16.75 3.75V2.25C16.75 1.69772 16.3023 1.25 15.75 1.25Z",fill:"#222222"}),b.createElement("path",{d:"M3.75 7.25H2.25C1.69772 7.25 1.25 7.69772 1.25 8.25V9.75C1.25 10.3023 1.69772 10.75 2.25 10.75H3.75C4.30228 10.75 4.75 10.3023 4.75 9.75V8.25C4.75 7.69772 4.30228 7.25 3.75 7.25Z",fill:"#222222"}),b.createElement("path",{d:"M9.75 7.25H8.25C7.69772 7.25 7.25 7.69772 7.25 8.25V9.75C7.25 10.3023 7.69772 10.75 8.25 10.75H9.75C10.3023 10.75 10.75 10.3023 10.75 9.75V8.25C10.75 7.69772 10.3023 7.25 9.75 7.25Z",fill:"#222222"}),b.createElement("path",{d:"M15.75 7.25H14.25C13.6977 7.25 13.25 7.69772 13.25 8.25V9.75C13.25 10.3023 13.6977 10.75 14.25 10.75H15.75C16.3023 10.75 16.75 10.3023 16.75 9.75V8.25C16.75 7.69772 16.3023 7.25 15.75 7.25Z",fill:"#222222"}),b.createElement("path",{d:"M3.75 13.25H2.25C1.69772 13.25 1.25 13.6977 1.25 14.25V15.75C1.25 16.3023 1.69772 16.75 2.25 16.75H3.75C4.30228 16.75 4.75 16.3023 4.75 15.75V14.25C4.75 13.6977 4.30228 13.25 3.75 13.25Z",fill:"#222222"}),b.createElement("path",{d:"M9.75 13.25H8.25C7.69772 13.25 7.25 13.6977 7.25 14.25V15.75C7.25 16.3023 7.69772 16.75 8.25 16.75H9.75C10.3023 16.75 10.75 16.3023 10.75 15.75V14.25C10.75 13.6977 10.3023 13.25 9.75 13.25Z",fill:"#222222"}),b.createElement("path",{d:"M15.75 13.25H14.25C13.6977 13.25 13.25 13.6977 13.25 14.25V15.75C13.25 16.3023 13.6977 16.75 14.25 16.75H15.75C16.3023 16.75 16.75 16.3023 16.75 15.75V14.25C16.75 13.6977 16.3023 13.25 15.75 13.25Z",fill:"#222222"})),Hr=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-info-circle-fill",viewBox:"0 0 16 16",...e},b.createElement("path",{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"})),Ar=e=>b.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("path",{d:"M14.5 4H3.5C3.22386 4 3 4.22386 3 4.5V5.5C3 5.77614 3.22386 6 3.5 6H14.5C14.7761 6 15 5.77614 15 5.5V4.5C15 4.22386 14.7761 4 14.5 4Z",fill:"#222222"}),b.createElement("path",{d:"M14.5 8H3.5C3.22386 8 3 8.22386 3 8.5V9.5C3 9.77614 3.22386 10 3.5 10H14.5C14.7761 10 15 9.77614 15 9.5V8.5C15 8.22386 14.7761 8 14.5 8Z",fill:"#222222"}),b.createElement("path",{d:"M14.5 12H3.5C3.22386 12 3 12.2239 3 12.5V13.5C3 13.7761 3.22386 14 3.5 14H14.5C14.7761 14 15 13.7761 15 13.5V12.5C15 12.2239 14.7761 12 14.5 12Z",fill:"#222222"})),Or=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...e},b.createElement("circle",{className:"opacity-50",cx:12,cy:12,r:10,fill:"white",stroke:"white",strokeWidth:4}),b.createElement("path",{d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),at=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 74",...e},b.createElement("path",{d:"M26,85H70a8.009,8.009,0,0,0,8-8V29.941a7.947,7.947,0,0,0-2.343-5.657L64.716,13.343A7.946,7.946,0,0,0,59.059,11H26a8.009,8.009,0,0,0-8,8V77a8.009,8.009,0,0,0,8,8ZM20,19a6.007,6.007,0,0,1,6-6H59.059A5.96,5.96,0,0,1,63.3,14.757L74.242,25.7A5.96,5.96,0,0,1,76,29.941V77a6.007,6.007,0,0,1-6,6H26a6.007,6.007,0,0,1-6-6Zm6.614,51.06h0L68,69.98a.75.75,0,0,0,.545-1.263L57.67,57.129a1.99,1.99,0,0,0-2.808-.028L51.6,60.467l-.024.026-7.087-7.543a1.73,1.73,0,0,0-1.229-.535,1.765,1.765,0,0,0-1.249.5L26.084,68.778a.75.75,0,0,0,.529,1.281Zm26.061-8.548,3.252-3.354a.333.333,0,0,1,.332-.123.463.463,0,0,1,.324.126L66.27,68.484l-7.177.014-6.5-6.916a.735.735,0,0,0,.078-.071Zm-9.611-7.526a.235.235,0,0,1,.168-.069.212.212,0,0,1,.168.068L57.039,68.5l-28.606.055Zm20.05-.43h.079a5.087,5.087,0,0,0,3.583-1.47,5.146,5.146,0,1,0-7.279-.109,5.089,5.089,0,0,0,3.617,1.579Zm-2.456-7.839a3.6,3.6,0,0,1,2.534-1.042h.056a3.7,3.7,0,0,1,2.478,6.34,3.51,3.51,0,0,1-2.589,1.041,3.6,3.6,0,0,1-2.557-1.118,3.715,3.715,0,0,1,.079-5.221Z",transform:"translate(-18 -11)",fill:"#8e8e8e"})),It=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",...e},b.createElement("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})),Ur=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16.158 16",stroke:"currentColor",...e},b.createElement("g",{id:"icon-mini-sort",transform:"translate(-4 -8)"},b.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:16,height:16,transform:"translate(4 8)",opacity:.004}),b.createElement("g",{id:"icon",transform:"translate(-290.537 -358.082)"},b.createElement("path",{id:"Path_38562","data-name":"Path 38562",d:"M309.634,376.594l-1.5,1.5-1.5-1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),b.createElement("line",{id:"Line_510","data-name":"Line 510",x2:6.833,transform:"translate(295.537 373.59)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),b.createElement("line",{id:"Line_511","data-name":"Line 511",x2:8.121,transform:"translate(295.537 369.726)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),b.createElement("line",{id:"Line_511-2","data-name":"Line 511",y2:9.017,transform:"translate(308.13 369.082)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),b.createElement("line",{id:"Line_512","data-name":"Line 512",x2:5.545,transform:"translate(295.537 377.455)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})))),Rr=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-exclamation-triangle-fill",viewBox:"0 0 16 16",...e},b.createElement("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})),zr=e=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",className:"bi bi-x",viewBox:"0 0 16 16",...e},b.createElement("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})),Xe=({displayFilter:e,type:n,title:t})=>{const a=le();return n=="mobile"?r("div",{className:"ds-sdk-filter-button",children:h("button",{className:"flex items-center bg-gray-100 ring-black ring-opacity-5 rounded-md p-sm outline outline-gray-200 hover:outline-gray-800 h-[32px]",onClick:e,children:[r($r,{className:"w-md"}),a.Filter.title]})}):r("div",{className:"ds-sdk-filter-button-desktop",children:r("button",{className:"flex items-center bg-gray-100 ring-black ring-opacity-5 rounded-md p-sm text-sm h-[32px]",onClick:e,children:t})})},Vr=({label:e})=>{const n=window.matchMedia("only screen and (max-width: 768px)").matches;return r("div",{className:`ds-sdk-loading flex h-screen justify-center items-center ${n?"loading-spinner-on-mobile":""}`,children:h("div",{className:"ds-sdk-loading__spinner bg-gray-100 rounded-full p-xs flex w-fit my-lg outline-gray-200",children:[r(Or,{className:"inline-block mr-xs ml-xs w-md animate-spin fill-primary"}),r("span",{className:"ds-sdk-loading__spinner-label p-xs",children:e})]})})},ot=()=>r(j,{children:r("div",{className:"ds-plp-facets ds-plp-facets--loading",children:r("div",{className:"ds-plp-facets__button shimmer-animation-button"})})}),Dr=()=>h(j,{children:[r("div",{className:"ds-sdk-input ds-sdk-input--loading",children:h("div",{className:"ds-sdk-input__content",children:[r("div",{className:"ds-sdk-input__header",children:r("div",{className:"ds-sdk-input__title shimmer-animation-facet"})}),h("div",{className:"ds-sdk-input__list",children:[r("div",{className:"ds-sdk-input__item shimmer-animation-facet"}),r("div",{className:"ds-sdk-input__item shimmer-animation-facet"}),r("div",{className:"ds-sdk-input__item shimmer-animation-facet"}),r("div",{className:"ds-sdk-input__item shimmer-animation-facet"})]})]})}),r("div",{className:"ds-sdk-input__border border-t mt-md border-gray-200"})]}),$t=()=>h("div",{className:"ds-sdk-product-item ds-sdk-product-item--shimmer",children:[r("div",{className:"ds-sdk-product-item__banner shimmer-animation-card"}),h("div",{className:"ds-sdk-product-item__content",children:[r("div",{className:"ds-sdk-product-item__header",children:r("div",{className:"ds-sdk-product-item__title shimmer-animation-card"})}),r("div",{className:"ds-sdk-product-item__list shimmer-animation-card"}),r("div",{className:"ds-sdk-product-item__info shimmer-animation-card"})]})]}),Br=()=>{const e=Array.from({length:8}),n=Array.from({length:4}),{screenSize:t}=Be(),a=t.columns;return r("div",{className:"ds-widgets bg-body py-2",children:h("div",{className:"flex",children:[h("div",{className:"sm:flex ds-widgets-_actions relative max-w-[21rem] w-full h-full px-2 flex-col overflow-y-auto",children:[r("div",{className:"ds-widgets_actions_header flex justify-between items-center mb-md"}),r("div",{className:"flex pb-4 w-full h-full",children:r("div",{className:"ds-sdk-filter-button-desktop",children:r("button",{className:"flex items-center bg-gray-100 ring-black ring-opacity-5 rounded-md p-sm text-sm h-[32px]",children:r(ot,{})})})}),r("div",{className:"ds-plp-facets flex flex-col",children:r("form",{className:"ds-plp-facets__list border-t border-gray-200",children:n.map((s,i)=>r(Dr,{},i))})})]}),h("div",{className:"ds-widgets_results flex flex-col items-center pt-16 w-full h-full",children:[r("div",{className:"flex flex-col max-w-5xl lg:max-w-7xl ml-auto w-full h-full",children:r("div",{className:"flex justify-end mb-[1px]",children:r(ot,{})})}),r("div",{className:"ds-sdk-product-list__grid mt-md grid-cols-1 gap-y-8 gap-x-md sm:grid-cols-2 md:grid-cols-3 xl:gap-x-4 pl-8",style:{display:"grid",gridTemplateColumns:` repeat(${a}, minmax(0, 1fr))`},children:e.map((s,i)=>r($t,{},i))})]})]})})},jr=({attribute:e})=>{const n=de();return{onChange:(a,s)=>{var c;const i=(c=n==null?void 0:n.filters)==null?void 0:c.find(d=>d.attribute===e);if(!i){const d={attribute:e,range:{from:a,to:s}};n.createFilter(d);return}const o={...i,range:{from:a,to:s}};n.updateFilter(o)}}},Zr=({filterData:e})=>{var _,C,N,k,$,I;const n=G(),t=de(),a=e.buckets[0].from,s=e.buckets[e.buckets.length-1].to,i=(N=(C=(_=n.variables.filter)==null?void 0:_.find(y=>y.attribute==="price"))==null?void 0:C.range)==null?void 0:N.to,o=(I=($=(k=n.variables.filter)==null?void 0:k.find(y=>y.attribute==="price"))==null?void 0:$.range)==null?void 0:I.from,[c,d]=fe(o||a),[u,l]=fe(i||s),{onChange:p}=jr(e),x=`fromSlider_${e.attribute}`,f=`toSlider_${e.attribute}`,g=`fromInput_${e.attribute}`,v=`toInput_${e.attribute}`;Re(()=>{var y,V;(((y=t==null?void 0:t.filters)==null?void 0:y.length)===0||!((V=t==null?void 0:t.filters)!=null&&V.find(L=>L.attribute===e.attribute)))&&(d(a),l(s))},[t]),Re(()=>{const y=(T,P,M,U)=>{const[A,R]=D(P,M);H(P,M,"#C6C6C6","#383838",U),A>R?(T.value=R,P.value=R):T.value=A},V=(T,P,M,U)=>{const[A,R]=D(P,M);H(P,M,"#C6C6C6","#383838",U),A<=R?(T.value=R,M.value=R):M.value=A},L=(T,P,M)=>{const[U,A]=D(T,P);H(T,P,"#C6C6C6","#383838",P),U>A?(d(A),T.value=A,M.value=A):M.value=U},E=(T,P,M)=>{const[U,A]=D(T,P);H(T,P,"#C6C6C6","#383838",P),U<=A?(P.value=A,M.value=A):(l(U),M.value=U,P.value=U)},D=(T,P)=>{const M=parseInt(T.value,10),U=parseInt(P.value,10);return[M,U]},H=(T,P,M,U,A)=>{const R=P.max-P.min,ue=T.value-P.min,re=P.value-P.min;A.style.background=`linear-gradient( - to right, - ${M} 0%, - ${M} ${ue/R*100}%, - ${U} ${ue/R*100}%, - ${U} ${re/R*100}%, - ${M} ${re/R*100}%, - ${M} 100%)`},q=document.querySelector(`#${x}`),B=document.querySelector(`#${f}`),ee=document.querySelector(`#${g}`),te=document.querySelector(`#${v}`);H(q,B,"#C6C6C6","#383838",B),q.oninput=()=>L(q,B,ee),B.oninput=()=>E(q,B,te),ee.oninput=()=>y(q,ee,te,B),te.oninput=()=>V(B,ee,te,B)},[c,u]);const m=y=>{const V=n.currencyRate?n.currencyRate:"1";return`${n.currencySymbol?n.currencySymbol:"$"}${y&&parseFloat(V)*parseInt(y.toFixed(0),10)?(parseFloat(V)*parseInt(y.toFixed(0),10)).toFixed(2):0}`};return h("div",{className:"ds-sdk-input pt-md",children:[r("label",{className:"ds-sdk-input__label text-base font-normal text-gray-900",children:e.title}),h("div",{class:"ds-sdk-slider range_container",children:[h("div",{class:"sliders_control",children:[r("input",{className:"ds-sdk-slider__from fromSlider",id:x,type:"range",value:c,min:a,max:s,onInput:({target:y})=>{y instanceof HTMLInputElement&&d(Math.round(Number(y.value)))},onMouseUp:()=>{p(c,u)},onTouchEnd:()=>{p(c,u)},onKeyUp:()=>{p(c,u)}}),r("input",{className:"ds-sdk-slider__to toSlider",id:f,type:"range",value:u,min:a,max:s,onInput:({target:y})=>{y instanceof HTMLInputElement&&l(Math.round(Number(y.value)))},onMouseUp:()=>{p(c,u)},onTouchEnd:()=>{p(c,u)},onKeyUp:()=>{p(c,u)}})]}),h("div",{class:"form_control",children:[h("div",{class:"form_control_container",children:[r("div",{class:"form_control_container__time",children:"Min"}),r("input",{class:"form_control_container__time__input",type:"number",id:g,value:c,min:a,max:s,onInput:({target:y})=>{y instanceof HTMLInputElement&&d(Math.round(Number(y.value)))},onMouseUp:()=>{p(c,u)},onTouchEnd:()=>{p(c,u)},onKeyUp:()=>{p(c,u)}})]}),h("div",{class:"form_control_container",children:[r("div",{class:"form_control_container__time",children:"Max"}),r("input",{class:"form_control_container__time__input",type:"number",id:v,value:u,min:a,max:s,onInput:({target:y})=>{y instanceof HTMLInputElement&&l(Math.round(Number(y.value)))},onMouseUp:()=>{p(c,u)},onTouchEnd:()=>{p(c,u)},onKeyUp:()=>{p(c,u)}})]})]})]}),r("div",{className:`price-range-display__${e.attribute} pb-3`,children:h("span",{className:"ml-sm block-display text-sm font-light text-gray-700",children:["Between ",r("span",{className:"min-price text-gray-900 font-semibold",children:m(c)})," and"," ",r("span",{className:"max-price text-gray-900 font-semibold",children:m(u)})]})}),r("div",{className:"ds-sdk-input__border border-t mt-md border-gray-200"})]})},qr=({attribute:e,buckets:n})=>{var c;const t={};n.forEach(d=>t[d.title]={from:d.from,to:d.to});const a=de(),s=(c=a==null?void 0:a.filters)==null?void 0:c.find(d=>d.attribute===e);return{isSelected:d=>{var l,p;return s?t[d].from===((l=s.range)==null?void 0:l.from)&&t[d].to===((p=s.range)==null?void 0:p.to):!1},onChange:d=>{if(!s){const l={attribute:e,range:{from:t[d].from,to:t[d].to}};a.createFilter(l);return}const u={...s,range:{from:t[d].from,to:t[d].to}};a.updateFilter(u)}}},Qr=({type:e,checked:n,onChange:t,name:a,label:s,attribute:i,value:o,count:c})=>h("div",{className:"ds-sdk-labelled-input flex items-center",children:[r("input",{id:a,name:e==="checkbox"?`checkbox-group-${i}`:`radio-group-${i}`,type:e,className:"ds-sdk-labelled-input__input focus:ring-0 h-md w-md border-0 cursor-pointer accent-gray-600 min-w-[16px]",checked:n,"aria-checked":n,onInput:t,value:o}),h("label",{htmlFor:a,className:"ds-sdk-labelled-input__label ml-sm block-display text-sm font-light text-gray-700 cursor-pointer",children:[s,c&&r("span",{className:"text-[12px] font-light text-gray-700 ml-1",children:`(${c})`})]})]}),Ze=5,Et=({title:e,attribute:n,buckets:t,isSelected:a,onChange:s,type:i,inputGroupTitleSlot:o})=>{const c=le(),d=G(),[u,l]=fe(t.length{var m;s({value:g,selected:(m=v==null?void 0:v.target)==null?void 0:m.checked})},f=(g,v)=>{if(v.__typename==="RangeBucket"){const m=d.currencyRate?d.currencyRate:"1",_=d.currencySymbol?d.currencySymbol:"$";return`${_}${v!=null&&v.from&&parseFloat(m)*parseInt(v.from.toFixed(0),10)?(parseFloat(m)*parseInt(v.from.toFixed(0),10)).toFixed(2):0}${v!=null&&v.to&&parseFloat(m)*parseInt(v.to.toFixed(0),10)?` - ${_}${(parseFloat(m)*parseInt(v.to.toFixed(0),10)).toFixed(2)}`:c.InputButtonGroup.priceRange}`}else{if(v.__typename==="CategoryView")return d.categoryPath?v.name??v.title:v.title;if(v.title===Ut)return g;if(v.title===Rt)return c.InputButtonGroup.priceExcludedMessage.replace("{title}",`${g}`)}return v.title};return h("div",{className:"ds-sdk-input pt-md",children:[o?o(e):r("label",{className:"ds-sdk-input__label text-base font-normal text-gray-900",children:e}),r("fieldset",{className:"ds-sdk-input__options mt-md",children:h("div",{className:"space-y-4",children:[t.slice(0,p).map(g=>{if(!g.title)return null;const v=a(g.title),m=g.__typename==="RangeBucket";return r(Qr,{name:`${g.title}-${n}`,attribute:n,label:f(e,g),checked:!!v,value:g.title,count:m?null:g.count,onChange:_=>x(g.title,_),type:i},f(e,g))}),!u&&t.length>Ze&&h("div",{className:"ds-sdk-input__fieldset__show-more flex items-center text-gray-700 cursor-pointer",onClick:()=>l(!0),children:[r(It,{className:"h-md w-md fill-gray-500"}),r("button",{type:"button",className:"ml-sm font-light cursor-pointer border-none bg-transparent hover:border-none hover:bg-transparent focus:border-none focus:bg-transparent active:border-none active:bg-transparent active:shadow-none text-sm",children:c.InputButtonGroup.showmore})]})]})}),r("div",{className:"ds-sdk-input__border border-t mt-md border-gray-200"})]})},Gr=({filterData:e})=>{const{isSelected:n,onChange:t}=qr(e);return r(Et,{title:e.title,attribute:e.attribute,buckets:e.buckets,type:"radio",isSelected:n,onChange:a=>{t(a.value)}})},Kr=e=>{var i;const n=de(),t=(i=n==null?void 0:n.filters)==null?void 0:i.find(o=>o.attribute===e.attribute);return{isSelected:o=>{var d;return t?(d=t.in)==null?void 0:d.includes(o):!1},onChange:(o,c)=>{var p,x,f,g;if(!t){const v={attribute:e.attribute,in:[o]};n.createFilter(v);return}const d={...t},u=t.in?t.in:[];d.in=c?[...u,o]:(p=t.in)==null?void 0:p.filter(v=>v!==o);const l=(x=t.in)==null?void 0:x.filter(v=>{var m;return!((m=d.in)!=null&&m.includes(v))});if((f=d.in)!=null&&f.length){l!=null&&l.length&&n.removeFilter(e.attribute,l[0]),n.updateFilter(d);return}if(!((g=d.in)!=null&&g.length)){n.removeFilter(e.attribute);return}}}},lt=({filterData:e})=>{const{isSelected:n,onChange:t}=Kr(e);return r(Et,{title:e.title,attribute:e.attribute,buckets:e.buckets,type:"checkbox",isSelected:n,onChange:a=>t(a.value,a.selected)})},Ft=({searchFacets:e})=>{const{config:{priceSlider:n}}=oe();return r("div",{className:"ds-plp-facets flex flex-col",children:r("form",{className:"ds-plp-facets__list border-t border-gray-200",children:e==null?void 0:e.map(t=>{var s;switch((s=t==null?void 0:t.buckets[0])==null?void 0:s.__typename){case"ScalarBucket":return r(lt,{filterData:t},t.attribute);case"RangeBucket":return n?r(Zr,{filterData:t}):r(Gr,{filterData:t},t.attribute);case"CategoryView":return r(lt,{filterData:t},t.attribute);default:return null}})})})},Wr=r(It,{className:"h-[12px] w-[12px] rotate-45 inline-block ml-sm cursor-pointer fill-gray-700"}),it=({label:e,onClick:n,CTA:t=Wr,type:a})=>a==="transparent"?h("div",{className:"ds-sdk-pill inline-flex justify-content items-center rounded-full w-fit min-h-[32px] px-4 py-1",children:[r("span",{className:"ds-sdk-pill__label font-normal text-sm",children:e}),r("span",{className:"ds-sdk-pill__cta",onClick:n,children:t})]},e):h("div",{className:"ds-sdk-pill inline-flex justify-content items-center bg-gray-100 rounded-full w-fit outline outline-gray-200 min-h-[32px] px-4 py-1",children:[r("span",{className:"ds-sdk-pill__label font-normal text-sm",children:e}),r("span",{className:"ds-sdk-pill__cta",onClick:n,children:t})]},e),Xr=(e,n,t)=>{var c;const a=e.range,s=n||"1",i=t||"$";return`${i}${a!=null&&a.from&&parseFloat(s)*parseInt(a.from.toFixed(0),10)?(parseFloat(s)*parseInt((c=a.from)==null?void 0:c.toFixed(0),10)).toFixed(2):0}${a!=null&&a.to&&parseFloat(s)*parseInt(a.to.toFixed(0),10)?` - ${i}${(parseFloat(s)*parseInt(a.to.toFixed(0),10)).toFixed(2)}`:" and above"}`},ct=(e,n,t,a)=>{var i;if(a&&t){const o=t.find(c=>c.attribute===e.attribute&&c.value===n);if(o!=null&&o.name)return o.name}const s=(i=e.attribute)==null?void 0:i.split("_");return n==="yes"?s.join(" "):n==="no"?`not ${s.join(" ")}`:n},dt=({})=>{var a;const e=de(),n=G(),t=le();return r("div",{className:"w-full h-full",children:((a=e.filters)==null?void 0:a.length)>0&&h("div",{className:"ds-plp-facets__pills pb-6 sm:pb-6 flex flex-wrap mt-8 justify-start",children:[e.filters.map(s=>{var i;return h("div",{children:[(i=s.in)==null?void 0:i.map(o=>r(it,{label:ct(s,o,e.categoryNames,n.categoryPath),type:"transparent",onClick:()=>e.updateFilterOptions(s,o)},ct(s,o,e.categoryNames,n.categoryPath))),s.range&&r(it,{label:Xr(s,n.currencyRate,n.currencySymbol),type:"transparent",onClick:()=>{e.removeFilter(s.attribute)}})]},s.attribute)}),r("div",{className:"py-1",children:r("button",{className:`ds-plp-facets__header__clear-all border-none bg-transparent hover:border-none hover:bg-transparent - focus:border-none focus:bg-transparent active:border-none active:bg-transparent active:shadow-none text-sm px-4`,onClick:()=>e.clearFilters(),children:t.Filter.clearAll})})]})})},Yr=({loading:e,pageLoading:n,totalCount:t,facets:a,categoryName:s,phrase:i,setShowFilters:o,filterCount:c})=>{const d=le();let u=s||"";i&&(u=d.CategoryFilters.results.replace("{phrase}",`"${i}"`));const p=d.CategoryFilters.products.replace("{totalCount}",`${t}`);return h("div",{class:"sm:flex ds-widgets-_actions relative max-w-[21rem] w-full h-full px-2 flex-col overflow-y-auto",children:[h("div",{className:"ds-widgets_actions_header flex justify-between items-center mb-md",children:[u&&h("span",{children:[" ",u]}),!e&&r("span",{className:"text-primary text-sm",children:p})]}),!n&&a.length>0&&h(j,{children:[r("div",{className:"flex pb-4 w-full h-full",children:r(Xe,{displayFilter:()=>o(!1),type:"desktop",title:`${d.Filter.hideTitle}${c>0?` (${c})`:""}`})}),r(Ft,{searchFacets:a})]})]})},Ve=({title:e,type:n,description:t,url:a,onClick:s})=>r("div",{className:"mx-auto max-w-8xl",children:(()=>{switch(n){case"error":return r("div",{className:"rounded-md bg-red-50 p-4",children:h("div",{className:"flex items-center",children:[r("div",{className:"flex-shrink-0 p-1",children:r(Mr,{className:"h-5 w-5 text-red-400","aria-hidden":"true"})}),h("div",{className:"ml-3",children:[r("h3",{className:"text-sm font-medium text-red-800",children:e}),t.length>0&&r("div",{className:"mt-2 text-sm text-red-700",children:r("p",{children:t})})]})]})});case"warning":return r("div",{className:"rounded-md bg-yellow-50 p-4",children:h("div",{className:"flex items-center",children:[r("div",{className:"flex-shrink-0 p-1",children:r(Rr,{className:"h-5 w-5 text-yellow-400","aria-hidden":"true"})}),h("div",{className:"ml-3",children:[r("h3",{className:"text-sm font-medium text-yellow-800",children:e}),t.length>0&&r("div",{className:"mt-2 text-sm text-yellow-700",children:r("p",{children:t})})]})]})});case"info":return r("div",{className:"rounded-md bg-blue-50 p-4",children:h("div",{className:"flex items-center",children:[r("div",{className:"flex-shrink-0 p-1",children:r(Hr,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"})}),h("div",{className:"ml-3 flex-1 md:flex md:justify-between",children:[h("div",{children:[r("h3",{className:"text-sm font-medium text-blue-800",children:e}),t.length>0&&r("div",{className:"mt-2 text-sm text-blue-700",children:r("p",{children:t})})]}),r("div",{className:"mt-4 text-sm md:ml-6",children:h("a",{href:a,className:"whitespace-nowrap font-medium text-blue-700 hover:text-blue-600",children:["Details",r("span",{"aria-hidden":"true",children:"→"})]})})]})]})});case"success":return r("div",{className:"rounded-md bg-green-50 p-4",children:h("div",{className:"flex items-center",children:[r("div",{className:"flex-shrink-0 p-1",children:r(Fr,{className:"h-5 w-5 text-green-400","aria-hidden":"true"})}),h("div",{className:"ml-3",children:[r("h3",{className:"text-sm font-medium text-green-800",children:e}),t.length>0&&r("div",{className:"mt-2 text-sm text-green-700",children:r("p",{children:t})})]}),r("div",{className:"ml-auto",children:r("div",{className:"md:ml-6",children:h("button",{type:"button",className:"inline-flex rounded-md bg-green-50 p-1.5 text-green-500 ring-off hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50",children:[r("span",{className:"sr-only",children:"Dismiss"}),r(zr,{className:"h-5 w-5","aria-hidden":"true",onClick:s})]})})})]})})}})()}),Le="...",Ue=(e,n)=>{const t=n-e+1;return Array.from({length:t},(a,s)=>e+s)},Jr=({currentPage:e,totalPages:n,siblingCount:t=1})=>qt(()=>{const i=n,o=t+5,c=Math.max(e-t,1),d=Math.min(e+t,n),u=c>2,l=d{const a=G(),s=Jr({currentPage:t,totalPages:n});Z(()=>{const{currentPage:c,totalPages:d}=a;return c>d&&e(d),()=>{}},[a,e]);const i=()=>{t>1&&e(t-1)},o=()=>{tc===Le?r("li",{className:"ds-plp-pagination__dots text-gray-500 mx-sm my-auto",children:"..."},c):r("li",{className:`ds-plp-pagination__item flex items-center cursor-pointer text-center text-gray-500 my-auto mx-sm ${t===c?"ds-plp-pagination__item--current text-black font-medium underline underline-offset-4 decoration-black":""}`,onClick:()=>e(c),children:c},c)),r(ze,{className:`h-sm w-sm transform -rotate-90 ${t===n?"stroke-gray-400 cursor-not-allowed":"stroke-gray-600 cursor-pointer"}`,onClick:o})]})},tn=({options:e,activeIndex:n,setActiveIndex:t,select:a})=>{const s=e.length,i=o=>{switch(o.preventDefault(),o.key){case"Up":case"ArrowUp":o.preventDefault(),t(n<=0?s-1:n-1);return;case"Down":case"ArrowDown":o.preventDefault(),t(n+1===s?0:n+1);return;case"Enter":case" ":o.preventDefault(),a(e[n].value);return;case"Esc":case"Escape":o.preventDefault(),a(null);return;case"PageUp":case"Home":o.preventDefault(),t(0);return;case"PageDown":case"End":o.preventDefault(),t(e.length-1);return}};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},rn=({setIsDropdownOpen:e})=>{const n=t=>{switch(t.key){case"Up":case"ArrowUp":case"Down":case"ArrowDown":case" ":case"Enter":t.preventDefault(),e(!0)}};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},ut=()=>{const e=navigator.userAgent.indexOf("Chrome")>-1;return navigator.userAgent.indexOf("Safari")>-1&&!e},Mt=({options:e,value:n,onChange:t})=>{const[a,s]=w(!1),i=Ie(null),[o,c]=w(0),[d,u]=w(!1),l=x=>{x&&t&&t(x),p(!1),u(!1)},p=x=>{if(x){const f=e==null?void 0:e.findIndex(g=>g.value===n);c(f<0?0:f),i.current&&ut()&&requestAnimationFrame(()=>{var g;(g=i==null?void 0:i.current)==null||g.focus()})}else i.current&&ut()&&requestAnimationFrame(()=>{var f,g;(g=(f=i==null?void 0:i.current)==null?void 0:f.previousSibling)==null||g.focus()});s(x)};return Z(()=>{if(a)return tn({activeIndex:o,setActiveIndex:c,options:e,select:l});if(d)return rn({setIsDropdownOpen:p})},[a,o,d]),{isDropdownOpen:a,setIsDropdownOpen:p,activeIndex:o,setActiveIndex:c,select:l,setIsFocus:u,listRef:i}},nn=({value:e,pageSizeOptions:n,onChange:t})=>{const a=Ie(null),s=Ie(null),i=n.find(f=>f.value===e),{isDropdownOpen:o,setIsDropdownOpen:c,activeIndex:d,setActiveIndex:u,select:l,setIsFocus:p,listRef:x}=Mt({options:n,value:e,onChange:t});return Z(()=>{const f=s.current,g=()=>{p(!1),c(!1)},v=()=>{var m;((m=f==null?void 0:f.parentElement)==null?void 0:m.querySelector(":hover"))!==f&&(p(!1),c(!1))};return f==null||f.addEventListener("blur",g),f==null||f.addEventListener("focusin",v),f==null||f.addEventListener("focusout",v),()=>{f==null||f.removeEventListener("blur",g),f==null||f.removeEventListener("focusin",v),f==null||f.removeEventListener("focusout",v)}},[s]),r(j,{children:h("div",{ref:s,className:"ds-sdk-per-page-picker ml-2 mr-2 relative inline-block text-left bg-gray-100 rounded-md outline outline-1 outline-gray-200 hover:outline-gray-600 h-[32px]",children:[h("button",{className:"group flex justify-center items-center font-normal text-sm text-gray-700 rounded-md hover:cursor-pointer border-none bg-transparent hover:border-none hover:bg-transparent focus:border-none focus:bg-transparent active:border-none active:bg-transparent active:shadow-none h-full w-full px-sm",ref:a,onClick:()=>c(!o),onFocus:()=>p(!1),onBlur:()=>p(!1),children:[i?`${i.label}`:"24",r(ze,{className:`flex-shrink-0 m-auto ml-sm h-md w-md stroke-1 stroke-gray-600 ${o?"":"rotate-180"}`})]}),o&&r("ul",{ref:x,className:"ds-sdk-per-page-picker__items origin-top-right absolute hover:cursor-pointer right-0 w-full rounded-md shadow-2xl bg-white ring-1 ring-black ring-opacity-5 focus:outline-none mt-2 z-20",children:n.map((f,g)=>r("li",{"aria-selected":f.value===(i==null?void 0:i.value),onMouseOver:()=>u(g),className:`py-xs hover:bg-gray-100 hover:text-gray-900 ${g===d?"bg-gray-100 text-gray-900":""}}`,children:r("a",{className:`ds-sdk-per-page-picker__items--item block-display px-md py-sm text-sm mb-0 - no-underline active:no-underline focus:no-underline hover:no-underline - hover:text-gray-900 ${f.value===(i==null?void 0:i.value)?"ds-sdk-per-page-picker__items--item-selected font-semibold text-gray-900":"font-normal text-gray-800"}`,onClick:()=>l(f.value),children:f.label})},g))})]})})},qe=({onClick:e})=>r("div",{className:"ds-sdk-add-to-cart-button",children:h("button",{className:"flex items-center justify-center text-white text-sm rounded-full h-[32px] w-full p-sm",style:{"background-color":"#464646"},onClick:e,children:[r(Er,{className:"w-[24px] pr-4"}),"Add To Cart"]})}),sn=({image:e,alt:n,carouselIndex:t,index:a})=>{const s=Qt(null),[i,o]=fe(""),[c,d]=fe(!1),u=lr(s,{rootMargin:"200px"});return Re(()=>{var l;u&&u!=null&&u.isIntersecting&&a===t&&(d(!0),o(((l=u==null?void 0:u.target)==null?void 0:l.dataset.src)||""))},[u,t,a,e]),r("img",{className:`aspect-auto w-100 h-auto ${c?"visible":"invisible"}`,ref:s,src:i,"data-src":typeof e=="object"?e.src:e,srcset:typeof e=="object"?e.srcset:null,alt:n})},mt=({images:e,productName:n,carouselIndex:t,setCarouselIndex:a})=>{const[s,i]=fe(0),o=u=>{a(u)},c=()=>{a(t===0?0:u=>u-1)},d=()=>{t===e.length-1?a(0):a(u=>u+1)};return r(j,{children:h("div",{class:"ds-sdk-product-image-carousel max-h-[250px] max-w-2xl m-auto",children:[r("div",{className:"flex flex-nowrap overflow-hidden relative rounded-lg w-full h-full",onTouchStart:u=>i(u.touches[0].clientX),onTouchEnd:u=>{const l=u.changedTouches[0].clientX;s>l?d():sr(sn,{image:u,carouselIndex:t,index:l,alt:n},l))})})}),e.length>1&&r("div",{className:"absolute z-1 flex space-x-3 -translate-x-1/2 bottom-0 left-1/2 pb-2 ",children:e.map((u,l)=>r("span",{style:t===l?{width:"12px",height:"12px","border-radius":"50%",border:"1px solid black",cursor:"pointer","background-color":"#252525"}:{width:"12px",height:"12px","border-radius":"50%",border:"1px solid silver",cursor:"pointer","background-color":"silver"},onClick:p=>{p.preventDefault(),o(l)}},l))})]})})},Qe=({id:e,value:n,type:t,checked:a,onClick:s})=>{const i=a?"border-black":t==="COLOR_HEX"?"border-transparent":"border-gray";if(t==="COLOR_HEX"){const c=n.toLowerCase(),d=`min-w-[32px] rounded-full p-sm border border-[1.5px] ${i} h-[32px] outline-transparent`,u=c==="#ffffff"||c==="#fff";return r("div",{className:`ds-sdk-swatch-button_${e}`,children:r("button",{className:d,style:{backgroundColor:c,border:!a&&u?"1px solid #ccc":void 0},onClick:s,checked:a},e)})}if(t==="IMAGE"&&n){const c=`object-cover object-center min-w-[32px] rounded-full p-sm border border-[1.5px] ${i} h-[32px] outline-transparent`,d=`background: url(${n}) no-repeat center; background-size: initial`;return r("div",{className:`ds-sdk-swatch-button_${n}`,children:r("button",{className:c,style:d,onClick:s,checked:a},e)})}const o=`flex items-center bg-white rounded-full p-sm border border-[1.5px]h-[32px] ${i} outline-transparent`;return r("div",{className:`ds-sdk-swatch-button_${n}`,children:r("button",{className:o,onClick:s,checked:a,children:n},e)})},pt=5,ht=({isSelected:e,swatches:n,showMore:t,productUrl:a,onClick:s,sku:i})=>{const o=n.length>pt,c=o?pt-1:n.length;return r("div",{className:"ds-sdk-product-item__product-swatch-group flex column items-center space-x-2",children:o?h("div",{className:"flex",children:[n.slice(0,c).map(d=>{const u=e(d.id);return d&&d.type=="COLOR_HEX"&&r("div",{className:"ds-sdk-product-item__product-swatch-item mr-2 text-sm text-primary",children:r(Qe,{id:d.id,value:d.value,type:d.type,checked:!!u,onClick:()=>s([d.id],i)})})}),r("a",{href:a,className:"hover:no-underline",children:r("div",{className:"ds-sdk-product-item__product-swatch-item text-sm text-primary",children:r(Qe,{id:"show-more",value:`+${n.length-c}`,type:"TEXT",checked:!1,onClick:t})})})]}):n.slice(0,c).map(d=>{const u=e(d.id);return d&&d.type=="COLOR_HEX"&&r("div",{className:"ds-sdk-product-item__product-swatch-item text-sm text-primary",children:r(Qe,{id:d.id,value:d.value,type:d.type,checked:!!u,onClick:()=>s([d.id],i)})})})})},ft=({isComplexProductView:e,item:n,isBundle:t,isGrouped:a,isGiftCard:s,isConfigurable:i,discount:o,currencySymbol:c,currencyRate:d})=>{var g,v,m;const u=De(zt);let l=(m=(v=(g=n.productView)==null?void 0:g.price)==null?void 0:v.final)==null?void 0:m.amount;const p=(_,C,N)=>u.ProductCard.bundlePrice.split(" ").map(($,I)=>$==="{fromBundlePrice}"?`${ae(_,C,N,!1,!0)} `:$==="{toBundlePrice}"?ae(_,C,N,!0,!0):r("span",{className:"text-gray-500 text-xs font-normal mr-xs",children:$},I)),x=(_,C,N,k)=>(k?u.ProductCard.from:u.ProductCard.startingAt).split("{productPrice}").map((y,V)=>y===""?ae(_,C,N,!1,!0):r("span",{className:"text-gray-500 text-xs font-normal mr-xs",children:y},V)),f=_=>{const C=_?h(j,{children:[r("span",{className:"line-through pr-2",children:ae(n,c,d,!1,!1)}),r("span",{className:"text-secondary",children:ae(n,c,d,!1,!0)})]}):ae(n,c,d,!1,!0);return u.ProductCard.asLowAs.split("{discountPrice}").map(($,I)=>$===""?C:r("span",{className:"text-gray-500 text-xs font-normal mr-xs",children:$},I))};return r(j,{children:l&&h("div",{className:"ds-sdk-product-price",children:[!t&&!a&&!i&&!e&&o&&h("p",{className:"ds-sdk-product-price--discount mt-xs text-sm font-medium text-gray-900 my-auto",children:[r("span",{className:"line-through pr-2",children:ae(n,c,d,!1,!1)}),r("span",{className:"text-secondary",children:ae(n,c,d,!1,!0)})]}),!t&&!a&&!s&&!i&&!e&&!o&&r("p",{className:"ds-sdk-product-price--no-discount mt-xs text-sm font-medium text-gray-900 my-auto",children:ae(n,c,d,!1,!0)}),t&&r("div",{className:"ds-sdk-product-price--bundle",children:r("p",{className:"mt-xs text-sm font-medium text-gray-900 my-auto",children:p(n,c,d)})}),a&&r("p",{className:"ds-sdk-product-price--grouped mt-xs text-sm font-medium text-gray-900 my-auto",children:x(n,c,d,!1)}),s&&r("p",{className:"ds-sdk-product-price--gift-card mt-xs text-sm font-medium text-gray-900 my-auto",children:x(n,c,d,!0)}),!a&&!t&&(i||e)&&r("p",{className:"ds-sdk-product-price--configurable mt-xs text-sm font-medium text-gray-900 my-auto",children:f(o)})]})})},gt=({item:e,currencySymbol:n,currencyRate:t,setRoute:a,refineProduct:s,setCartUpdated:i,setItemAdded:o,setError:c,addToCart:d})=>{var $e,se,Ee,Fe,xe,Me,Te,He,Ae,Oe,be,ye,we,_e,Ce,Ne,ke,F,O,W,X,Y,Q,ie,ce,Se,Pe;const{product:u,productView:l}=e,[p,x]=w(0),[f,g]=w(""),[v,m]=w(),[_,C]=w(),[N,k]=w(!1),{addToCartGraphQL:$,refreshCart:I}=Lr(),{viewType:y}=G(),{config:{optimizeImages:V,imageBaseWidth:L,imageCarousel:E,listview:D}}=oe(),{screenSize:H}=Be(),q=()=>{k(!0)},B=()=>{k(!1)},ee=async(z,J)=>{const S=await s(z,J);g(z[0]),m(S.refineProduct.images),C(S),x(0)},te=z=>f?f===z:!1,T=v?Je(v??[],E?3:1):Je(l.images??[],E?3:1,(($e=u==null?void 0:u.image)==null?void 0:$e.url)??void 0);let P=[];V&&(P=Yt(T,L??200));const M=_?((Me=(xe=(Fe=(Ee=(se=_.refineProduct)==null?void 0:se.priceRange)==null?void 0:Ee.minimum)==null?void 0:Fe.regular)==null?void 0:xe.amount)==null?void 0:Me.value)>((be=(Oe=(Ae=(He=(Te=_.refineProduct)==null?void 0:Te.priceRange)==null?void 0:He.minimum)==null?void 0:Ae.final)==null?void 0:Oe.amount)==null?void 0:be.value):((_e=(we=(ye=u==null?void 0:u.price_range)==null?void 0:ye.minimum_price)==null?void 0:we.regular_price)==null?void 0:_e.value)>((ke=(Ne=(Ce=u==null?void 0:u.price_range)==null?void 0:Ce.minimum_price)==null?void 0:Ne.final_price)==null?void 0:ke.value)||((W=(O=(F=l==null?void 0:l.price)==null?void 0:F.regular)==null?void 0:O.amount)==null?void 0:W.value)>((Q=(Y=(X=l==null?void 0:l.price)==null?void 0:X.final)==null?void 0:Y.amount)==null?void 0:Q.value),U=(u==null?void 0:u.__typename)==="SimpleProduct",A=(l==null?void 0:l.__typename)==="ComplexProductView",R=(u==null?void 0:u.__typename)==="BundleProduct",ue=(u==null?void 0:u.__typename)==="GroupedProduct",re=(u==null?void 0:u.__typename)==="GiftCardProduct",ge=(u==null?void 0:u.__typename)==="ConfigurableProduct",ne=()=>{var z;(z=window.magentoStorefrontEvents)==null||z.publish.searchProductClick(me,u==null?void 0:u.sku)},K=a?a({sku:l==null?void 0:l.sku,urlKey:l==null?void 0:l.urlKey}):u==null?void 0:u.canonical_url,ve=async()=>{var z,J;if(c(!1),U)if(d)await d(l.sku,[],1);else{const S=await $(l.sku);if(S!=null&&S.errors||((J=(z=S==null?void 0:S.data)==null?void 0:z.addProductsToCart)==null?void 0:J.user_errors.length)>0){c(!0);return}o(l==null?void 0:l.name),I==null||I(),i(!0)}else K&&window.open(K,"_self")};return D&&y==="listview"?r(j,{children:h("div",{className:"grid-container",children:[r("div",{className:"product-image ds-sdk-product-item__image relative rounded-md overflow-hidden}",children:r("a",{href:K,onClick:ne,className:"!text-primary hover:no-underline hover:text-primary",children:T.length?r(mt,{images:P.length?P:T,productName:l.name,carouselIndex:p,setCarouselIndex:x}):r(at,{className:"max-h-[250px] max-w-[200px] pr-5 m-auto object-cover object-center lg:w-full"})})}),r("div",{className:"product-details",children:h("div",{className:"flex flex-col w-1/3",children:[h("a",{href:K,onClick:ne,className:"!text-primary hover:no-underline hover:text-primary",children:[r("div",{className:"ds-sdk-product-item__product-name mt-xs text-sm text-primary",children:(l==null?void 0:l.name)!==null&&je(l==null?void 0:l.name)}),h("div",{className:"ds-sdk-product-item__product-sku mt-xs text-sm text-primary",children:["SKU:",(l==null?void 0:l.sku)!==null&&je(l==null?void 0:l.sku)]})]}),r("div",{className:"ds-sdk-product-item__product-swatch flex flex-row mt-sm text-sm text-primary pb-6",children:(ie=l==null?void 0:l.options)==null?void 0:ie.map(z=>z.id==="color"&&r(ht,{isSelected:te,swatches:z.values??[],showMore:ne,productUrl:K,onClick:ee,sku:l==null?void 0:l.sku},l==null?void 0:l.sku))})]})}),r("div",{className:"product-price",children:r("a",{href:K,onClick:ne,className:"!text-primary hover:no-underline hover:text-primary",children:r(ft,{item:_??e,isBundle:R,isGrouped:ue,isGiftCard:re,isConfigurable:ge,isComplexProductView:A,discount:M,currencySymbol:n,currencyRate:t})})}),r("div",{className:"product-description text-sm text-primary mt-xs",children:r("a",{href:K,onClick:ne,className:"!text-primary hover:no-underline hover:text-primary",children:(ce=l==null?void 0:l.short_description)!=null&&ce.html?r(j,{children:r("span",{dangerouslySetInnerHTML:{__html:l==null?void 0:l.short_description.html}})}):r("span",{})})}),r("div",{className:"product-ratings"}),r("div",{className:"product-add-to-cart",children:r("div",{className:"pb-4 h-[38px] w-96",children:r(qe,{onClick:ve})})})]})}):h("div",{className:"ds-sdk-product-item group relative flex flex-col max-w-sm justify-between h-full hover:border-[1.5px] border-solid hover:shadow-lg border-offset-2 p-2",style:{"border-color":"#D5D5D5"},onMouseEnter:q,onMouseLeave:B,children:[r("a",{href:K,onClick:ne,className:"!text-primary hover:no-underline hover:text-primary",children:h("div",{className:"ds-sdk-product-item__main relative flex flex-col justify-between h-full",children:[r("div",{className:"ds-sdk-product-item__image relative w-full h-full rounded-md overflow-hidden",children:T.length?r(mt,{images:P.length?P:T,productName:l==null?void 0:l.name,carouselIndex:p,setCarouselIndex:x}):r(at,{className:"max-h-[45rem] w-full object-cover object-center lg:w-full"})}),r("div",{className:"flex flex-row",children:h("div",{className:"flex flex-col",children:[r("div",{className:"ds-sdk-product-item__product-name mt-md text-sm text-primary",children:(l==null?void 0:l.name)!==null&&je(l==null?void 0:l.name)}),r(ft,{item:_??e,isBundle:R,isGrouped:ue,isGiftCard:re,isConfigurable:ge,isComplexProductView:A,discount:M,currencySymbol:n,currencyRate:t})]})})]})}),(l==null?void 0:l.options)&&((Se=l.options)==null?void 0:Se.length)>0&&r("div",{className:"ds-sdk-product-item__product-swatch flex flex-row mt-sm text-sm text-primary",children:(Pe=l==null?void 0:l.options)==null?void 0:Pe.map(z=>z.id=="color"&&r(ht,{isSelected:te,swatches:z.values??[],showMore:ne,productUrl:K,onClick:ee,sku:l==null?void 0:l.sku},l==null?void 0:l.sku))}),h("div",{className:"pb-4 mt-sm",children:[H.mobile&&r(qe,{onClick:ve}),N&&H.desktop&&r(qe,{onClick:ve})]})]})},an=({products:e,numberOfColumns:n,showFilters:t})=>{const a=G(),{currencySymbol:s,currencyRate:i,setRoute:o,refineProduct:c,refreshCart:d,addToCart:u}=a,[l,p]=w(!1),[x,f]=w(""),{viewType:g}=G(),[v,m]=w(!1),{config:{listview:_}}=oe(),C=t?"ds-sdk-product-list bg-body max-w-full pl-3 pb-2xl sm:pb-24":"ds-sdk-product-list bg-body w-full mx-auto pb-2xl sm:pb-24";return Z(()=>{d&&d()},[x]),h("div",{className:Xt("ds-sdk-product-list bg-body pb-2xl sm:pb-24",C),children:[l&&r("div",{className:"mt-8",children:r(Ve,{title:`You added ${x} to your shopping cart.`,type:"success",description:"",onClick:()=>p(!1)})}),v&&r("div",{className:"mt-8",children:r(Ve,{title:"Something went wrong trying to add an item to your cart.",type:"error",description:"",onClick:()=>m(!1)})}),_&&g==="listview"?r("div",{className:"w-full",children:r("div",{className:"ds-sdk-product-list__list-view-default mt-md grid grid-cols-none pt-[15px] w-full gap-[10px]",children:e==null?void 0:e.map(N=>{var k;return r(gt,{item:N,setError:m,currencySymbol:s,currencyRate:i,setRoute:o,refineProduct:c,setCartUpdated:p,setItemAdded:f,addToCart:u},(k=N==null?void 0:N.productView)==null?void 0:k.id)})})}):r("div",{style:{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`},className:"ds-sdk-product-list__grid mt-md grid gap-y-8 gap-x-2xl xl:gap-x-8",children:e==null?void 0:e.map(N=>{var k;return r(gt,{item:N,setError:m,currencySymbol:s,currencyRate:i,setRoute:o,refineProduct:c,setCartUpdated:p,setItemAdded:f,addToCart:u},(k=N==null?void 0:N.productView)==null?void 0:k.id)})})]})},vt=({showFilters:e})=>{const n=G(),{screenSize:t}=Be(),{variables:a,items:s,setCurrentPage:i,currentPage:o,setPageSize:c,pageSize:d,totalPages:u,totalCount:l,minQueryLength:p,minQueryLengthReached:x,pageSizeOptions:f,loading:g}=n;Z(()=>{o<1&&m(1)},[]);const v=Array.from({length:8}),m=k=>{typeof k=="number"&&(i(k),wt(k))},_=k=>{c(k),nr(k)},C=le(),N=(k,$,I)=>C.ProductContainers.pagePicker.split(" ").map((L,E)=>L==="{pageSize}"?r(I,{pageSizeOptions:$,value:k,onChange:_},E):`${L} `);if(!x){const $=C.ProductContainers.minquery.replace("{variables.phrase}",a.phrase).replace("{minQueryLength}",p);return r("div",{className:"ds-sdk-min-query__page mx-auto max-w-8xl py-12 px-4 sm:px-6 lg:px-8",children:r(Ve,{title:$,type:"warning",description:""})})}return l?h(j,{children:[g?h("div",{style:{gridTemplateColumns:`repeat(${t.columns}, minmax(0, 1fr))`},className:"ds-sdk-product-list__grid mt-md grid grid-cols-1 gap-y-8 gap-x-md sm:grid-cols-2 md:grid-cols-3 xl:gap-x-4 pl-8",children:[" ",v.map((k,$)=>r($t,{},$))]}):r(an,{products:s,numberOfColumns:t.columns,showFilters:e}),h("div",{className:`flex flex-row justify-between max-w-full ${e?"mx-auto":"mr-auto"} w-full h-full`,children:[r("div",{children:N(d,f,nn)}),u>1&&r(en,{currentPage:o,totalPages:u,onPageChange:m})]})]}):r("div",{className:"ds-sdk-no-results__page mx-auto max-w-8xl py-12 px-4 sm:px-6 lg:px-8",children:r(Ve,{title:C.ProductContainers.noresults,type:"warning",description:""})})},on=({phrase:e,onKeyPress:n,placeholder:t})=>r("div",{className:"relative ds-sdk-search-bar",children:r("input",{id:"search",type:"text",value:e,onKeyPress:n,className:"border border-gray-300 text-gray-800 text-sm block-display p-xs pr-lg ds-sdk-search-bar__input",placeholder:t,autocomplete:"off"})}),ln=({value:e,sortOptions:n,onChange:t})=>{const a=Ie(null),s=Ie(null),i=n.find(m=>m.value===e),o=le(),d=o.SortDropdown.option.replace("{selectedOption}",`${i==null?void 0:i.label}`),{isDropdownOpen:u,setIsDropdownOpen:l,activeIndex:p,setActiveIndex:x,select:f,setIsFocus:g,listRef:v}=Mt({options:n,value:e,onChange:t});return Z(()=>{const m=s.current,_=()=>{g(!1),l(!1)},C=()=>{var N;((N=m==null?void 0:m.parentElement)==null?void 0:N.querySelector(":hover"))!==m&&(g(!1),l(!1))};return m==null||m.addEventListener("blur",_),m==null||m.addEventListener("focusin",C),m==null||m.addEventListener("focusout",C),()=>{m==null||m.removeEventListener("blur",_),m==null||m.removeEventListener("focusin",C),m==null||m.removeEventListener("focusout",C)}},[s]),r(j,{children:h("div",{ref:s,class:"ds-sdk-sort-dropdown relative inline-block text-left bg-gray-100 rounded-md outline outline-1 outline-gray-200 hover:outline-gray-600 h-[32px] z-9",children:[h("button",{className:"group flex justify-center items-center font-normal text-sm text-gray-700 rounded-md hover:cursor-pointer border-none bg-transparent hover:border-none hover:bg-transparent focus:border-none focus:bg-transparent active:border-none active:bg-transparent active:shadow-none h-full w-full px-sm",ref:a,onClick:()=>l(!u),onFocus:()=>g(!1),onBlur:()=>g(!1),children:[r(Ur,{className:"h-md w-md mr-sm stroke-gray-600 m-auto"}),i?d:o.SortDropdown.title,r(ze,{className:`flex-shrink-0 m-auto ml-sm h-md w-md stroke-1 stroke-gray-600 ${u?"":"rotate-180"}`})]}),u&&r("ul",{ref:v,tabIndex:-1,className:"ds-sdk-sort-dropdown__items origin-top-right absolute hover:cursor-pointer right-0 w-full rounded-md shadow-2xl bg-white ring-1 ring-black ring-opacity-5 focus:outline-none mt-2 z-20",children:n.map((m,_)=>r("li",{"aria-selected":m.value===(i==null?void 0:i.value),onMouseOver:()=>x(_),className:`py-xs hover:bg-gray-100 hover:text-gray-900 ${_===p?"bg-gray-100 text-gray-900":""}}`,children:r("a",{className:`ds-sdk-sort-dropdown__items--item block-display px-md py-sm text-sm mb-0 - no-underline active:no-underline focus:no-underline hover:no-underline - hover:text-gray-900 ${m.value===(i==null?void 0:i.value)?"ds-sdk-sort-dropdown__items--item-selected font-semibold text-gray-900":"font-normal text-gray-800"}`,onClick:()=>f(m.value),children:m.label})},_))})]})})},cn=()=>{const{viewType:e,setViewType:n}=G(),t=a=>{rr(a),n(a)};return h("div",{className:"flex justify-between",children:[r("button",{className:`flex items-center ${e==="gridview"?"bg-gray-100":""} ring-black ring-opacity-5 p-sm text-sm h-[32px] border border-gray-300`,onClick:()=>t("gridview"),children:r(Tr,{className:"h-[20px] w-[20px]"})}),r("button",{className:`flex items-center ${e==="listview"?"bg-gray-100":""} ring-black ring-opacity-5 p-sm text-sm h-[32px] border border-gray-300`,onClick:()=>t("listview"),children:r(Ar,{className:"h-[20px] w-[20px]"})})]})},xt=({facets:e,totalCount:n,screenSize:t})=>{var N,k,$;const a=de(),s=oe(),i=kt(),o=G(),c=le(),[d,u]=w(!!((N=o.variables.filter)!=null&&N.length)),[l,p]=w(ar()),x=Tt(()=>{var I,y;p(or(c,i==null?void 0:i.sortable,(I=s==null?void 0:s.config)==null?void 0:I.displayOutOfStock,(y=s==null?void 0:s.config)==null?void 0:y.currentCategoryUrlPath))},[s,c,i]);Z(()=>{x()},[x]);const f=(k=s.config)!=null&&k.currentCategoryUrlPath?"position_ASC":"relevance_DESC",g=pe("product_list_order"),v=g||f,[m,_]=w(v),C=I=>{_(I),a.setSort(Ct(I)),tr(I)};return h("div",{className:"flex flex-col max-w-5xl lg:max-w-full ml-auto w-full h-full",children:[h("div",{className:`flex gap-x-2.5 mb-[1px] ${t.mobile?"justify-between":"justify-end"}`,children:[r("div",{children:t.mobile?n>0&&r("div",{className:"pb-4",children:r(Xe,{displayFilter:()=>u(!d),type:"mobile"})}):s.config.displaySearchBox&&r(on,{phrase:a.phrase,onKeyPress:I=>{var y;I.key==="Enter"&&a.setPhrase((y=I==null?void 0:I.target)==null?void 0:y.value)},onClear:()=>a.setPhrase(""),placeholder:c.SearchBar.placeholder})}),n>0&&h(j,{children:[(($=s==null?void 0:s.config)==null?void 0:$.listview)&&r(cn,{}),r(ln,{sortOptions:l,value:m,onChange:C})]})]}),t.mobile&&d&&r(Ft,{searchFacets:e})]})},dn=()=>{const e=de(),n=G(),{screenSize:t}=Be(),a=le(),{displayMode:s}=oe().config,[i,o]=w(!0),c=a.Loading.title;let d=n.categoryName||"";n.variables.phrase&&(d=a.CategoryFilters.results.replace("{phrase}",`"${n.variables.phrase??""}"`));const u=l=>a.CategoryFilters.products.replace("{totalCount}",`${l}`);return Z(()=>{const l=Kt.on("search/event",p=>{n.setSearchHeaders(p)});return()=>{l==null||l.off()}}),r(j,{children:s!=="PAGE"&&(!t.mobile&&i&&n.facets.length>0?r("div",{className:"ds-widgets bg-body py-2",children:h("div",{className:"flex",children:[r(Yr,{loading:n.loading,pageLoading:n.pageLoading,facets:n.facets,totalCount:n.totalCount,categoryName:n.categoryName??"",phrase:n.variables.phrase??"",showFilters:i,setShowFilters:o,filterCount:e.filterCount}),h("div",{className:`ds-widgets_results flex flex-col items-center ${n.categoryName?"pt-16":"pt-28"} w-full h-full`,children:[r(xt,{facets:n.facets,totalCount:n.totalCount,screenSize:t}),r(dt,{}),r(vt,{showFilters:i})]})]})}):r("div",{className:"ds-widgets bg-body py-2",children:h("div",{className:"flex flex-col",children:[r("div",{className:"flex flex-col items-center w-full h-full",children:r("div",{className:"justify-start w-full h-full",children:r("div",{class:"hidden sm:flex ds-widgets-_actions relative max-w-[21rem] w-full h-full px-2 flex-col overflow-y-auto",children:h("div",{className:"ds-widgets_actions_header flex justify-between items-center mb-md",children:[d&&h("span",{children:[" ",d]}),!n.loading&&r("span",{className:"text-primary text-sm",children:u(n.totalCount)})]})})})}),h("div",{className:"ds-widgets_results flex flex-col items-center w-full h-full",children:[r("div",{className:"flex w-full h-full",children:!t.mobile&&!n.loading&&n.facets.length>0&&r("div",{className:"flex w-full h-full",children:r(Xe,{displayFilter:()=>o(!0),type:"desktop",title:`${a.Filter.showTitle}${e.filterCount>0?` (${e.filterCount})`:""}`})})}),n.loading?t.mobile?r(Vr,{label:c}):r(Br,{}):h(j,{children:[r("div",{className:"flex w-full h-full",children:r(xt,{facets:n.facets,totalCount:n.totalCount,screenSize:t})}),r(dt,{}),r(vt,{showFilters:i&&n.facets.length>0})]})]})]})}))})},xn=({children:e,storeConfig:n})=>{const t=Jt(),a=nt({...n,context:{...n.context,userViewHistory:t}});return r(Vt,{...nt(a),children:r(br,{children:r(yr,{children:r(Dt,{children:r(Bt,{children:r(wr,{children:r(Ir,{children:r(dn,{})})})})})})})})};export{xn as ProductListingPage,xn as default}; diff --git a/scripts/__dropins__/storefront-search/containers/ProductListingPage/ProductListingPage.d.ts b/scripts/__dropins__/storefront-search/containers/ProductListingPage/ProductListingPage.d.ts deleted file mode 100644 index 7de2016d96..0000000000 --- a/scripts/__dropins__/storefront-search/containers/ProductListingPage/ProductListingPage.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { StoreDetails } from '../../widgets/plp/types'; -import { PropsWithChildren } from 'preact/compat'; -import { Container } from '@dropins/tools/types/elsie/src/lib'; - -/** The initial props passed into the dropin */ -export type ProductListPageProps = PropsWithChildren<{ - storeConfig: StoreDetails; -}>; -export declare const ProductListingPage: Container; -//# sourceMappingURL=ProductListingPage.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/containers/ProductListingPage/index.d.ts b/scripts/__dropins__/storefront-search/containers/ProductListingPage/index.d.ts deleted file mode 100644 index 747efdd801..0000000000 --- a/scripts/__dropins__/storefront-search/containers/ProductListingPage/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ProductListingPage'; -export { ProductListingPage as default } from './ProductListingPage'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/containers/SearchPopover.d.ts b/scripts/__dropins__/storefront-search/containers/SearchPopover.d.ts deleted file mode 100644 index 99bd60aa76..0000000000 --- a/scripts/__dropins__/storefront-search/containers/SearchPopover.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SearchPopover/index' -import _default from './SearchPopover/index' -export default _default diff --git a/scripts/__dropins__/storefront-search/containers/SearchPopover.js b/scripts/__dropins__/storefront-search/containers/SearchPopover.js deleted file mode 100644 index 8c2d66ea22..0000000000 --- a/scripts/__dropins__/storefront-search/containers/SearchPopover.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -import{jsx as f,jsxs as L,Fragment as X}from"@dropins/tools/preact-jsx-runtime.js";import{useContext as Z,useRef as v,useEffect as x,useMemo as W,useState as F,useReducer as Q,createContext as G}from"@dropins/tools/preact-compat.js";import{g as J,c as _}from"../chunks/currency-symbol-map.js";import{s as Y}from"../chunks/searchProducts.js";import{v as ee}from"../chunks/tokens.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/preact.js";const N={SEARCH_INPUT_CONTEXT:"searchInputContext",SEARCH_RESULTS_CONTEXT:"searchResultsContext"},T={SEARCH_PRODUCT_CLICK:"search-product-click",SEARCH_SUGGESTION_CLICK:"search-suggestion-click",SEARCH_REQUEST_SENT:"search-request-sent",SEARCH_RESPONSE_RECEIVED:"search-response-received",SEARCH_RESULTS_VIEW:"search-results-view"},P=()=>(window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer);function $(e,t){P().push({[e]:t})}function y(e,t){P().push(r=>{var o;const c=((o=r.getState)==null?void 0:o.call(r))??{};r.push({event:e,eventInfo:{...c,...t}})})}const E="livesearch-popover-dropin",te=()=>({publishSearchProductClick:o=>{y(T.SEARCH_PRODUCT_CLICK,{searchUnitId:E,sku:o})},updateSearchInputContext:()=>{},searchRequestSent:()=>{},searchResponseReceived:()=>{},searchResultsView:()=>{}});function K(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var c=e.length;for(t=0;t{const e=Z(q);if(e===null){const t=new Error("Missing component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,w),t}return e};function re({className:e,...t}){const{products:n}=w();return n.length===0?null:L("button",{...t,type:"submit",className:M("search-popover-view-all",e),children:["View All (",n.length,")"]})}function ce(){const{products:e,route:t}=w(),{publishSearchProductClick:n}=te(),r=(c,o)=>{c.preventDefault();const s=c.currentTarget;n(o.sku),y(T.SEARCH_PRODUCT_CLICK),window.location.href=s.href};return f("div",{className:M("search-popover-root"),children:e.length>0&&L(X,{children:[f("div",{className:"search-popover-content",children:e.map(c=>L("div",{className:"search-popover-item",children:[f("div",{className:"popover-image-container",children:f(oe,{product:c})}),f("div",{className:"popover-details-container",children:L("a",{href:t==null?void 0:t({sku:c.sku,urlKey:c.urlKey??""}),onClick:o=>r(o,c),className:"product-link",children:[f("p",{className:"product-name",children:c.name}),f("p",{className:"product-price",children:c.price})]})})]},c.uid))}),f(re,{})]})})}function oe({product:e}){return e.imageUrl?f("img",{alt:"",src:e.imageUrl,className:"product-image"}):f(ne,{})}var se="Expected a function",H=NaN,ae="[object Symbol]",ie=/^\s+|\s+$/g,ue=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,fe=/^0o[0-7]+$/i,de=parseInt,pe=typeof _=="object"&&_&&_.Object===Object&&_,he=typeof self=="object"&&self&&self.Object===Object&&self,me=pe||he||Function("return this")(),Se=Object.prototype,ge=Se.toString,Ee=Math.max,ve=Math.min,O=function(){return me.Date.now()};function Ce(e,t,n){var r,c,o,s,a,i,d=0,p=!1,S=!1,C=!0;if(typeof e!="function")throw new TypeError(se);t=j(t)||0,k(n)&&(p=!!n.leading,S="maxWait"in n,o=S?Ee(j(n.maxWait)||0,t):o,C="trailing"in n?!!n.trailing:C);function b(u){var m=r,I=c;return r=c=void 0,d=u,s=e.apply(I,m),s}function R(u){return d=u,a=setTimeout(g,t),p?b(u):s}function h(u){var m=u-i,I=u-d,D=t-m;return S?ve(D,o-I):D}function l(u){var m=u-i,I=u-d;return i===void 0||m>=t||m<0||S&&I>=o}function g(){var u=O();if(l(u))return U(u);a=setTimeout(g,h(u))}function U(u){return a=void 0,C&&r?b(u):(r=c=void 0,s)}function z(){a!==void 0&&clearTimeout(a),d=0,r=i=c=a=void 0}function B(){return a===void 0?s:U(O())}function A(){var u=O(),m=l(u);if(r=arguments,c=this,i=u,m){if(a===void 0)return R(i);if(S)return a=setTimeout(g,t),b(i)}return a===void 0&&(a=setTimeout(g,t)),s}return A.cancel=z,A.flush=B,A}function k(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function be(e){return!!e&&typeof e=="object"}function Re(e){return typeof e=="symbol"||be(e)&&ge.call(e)==ae}function j(e){if(typeof e=="number")return e;if(Re(e))return H;if(k(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=k(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ie,"");var n=le.test(e);return n||fe.test(e)?de(e.slice(2),n?2:8):ue.test(e)?H:+e}var Ie=Ce;const V=J(Ie);function Te(e){const t=v(e);t.current=e,x(()=>()=>{t.current()},[])}function ye(e,t=500,n){const r=v();Te(()=>{r.current&&r.current.cancel()});const c=W(()=>{const o=V(e,t,n),s=(...a)=>o(...a);return s.cancel=()=>{o.cancel()},s.isPending=()=>!!r.current,s.flush=()=>o.flush(),s},[e,t,n]);return x(()=>{r.current=V(e,t,n)},[e,t,n]),c}function _e(e,t,n){const r=(d,p)=>d===p,c=e instanceof Function?e():e,[o,s]=F(c),a=v(c),i=ye(s,t,n);return r(a.current,c)||(i(c),a.current=c),[o,i]}const Le=(e,t,n,r,c)=>{var d;const s=P().getState(N.SEARCH_INPUT_CONTEXT)??{units:[]},a={searchUnitId:e,searchRequestId:t,queryTypes:["products","suggestions"],phrase:n,pageSize:c,currentPage:1,filter:r,sort:[]},i=(d=s.units)==null?void 0:d.findIndex(p=>(p==null?void 0:p.searchUnitId)===e);i===void 0||i<0?s.units.push(a):s.units[i]=a,$(N.SEARCH_INPUT_CONTEXT,s)},xe=(e,t,n)=>{var a;const c=P().getState(N.SEARCH_RESULTS_CONTEXT)??{units:[]},o=(a=c==null?void 0:c.units)==null?void 0:a.findIndex(i=>(i==null?void 0:i.searchUnitId)===e),s={searchUnitId:e,searchRequestId:t,products:(n==null?void 0:n.products.map(i=>({...i,price:Number(i.price)})))??[],categories:[],suggestions:[],page:(n==null?void 0:n.pageInfo.current)||1,perPage:(n==null?void 0:n.pageInfo.size)||6,facets:[]};o===void 0||o<0?c.units.push(s):c.units[o]=s,$(N.SEARCH_RESULTS_CONTEXT,c)},Ne={filters:[{attribute:"visibility",in:["Search","Catalog, Search"]},{attribute:"inStock",eq:"false"}],sort:[]};function Pe(e,t){switch(t.type){case"SET_IN_STOCK_FILTER":{const n=e.filters.map(r=>r.attribute==="inStock"?{...r,eq:String(t.value)}:r);return{...e,filters:n}}default:throw new Error(`Unknown action: ${t.type}`)}}const Ae=e=>{const[t,n]=Q(Pe,Ne);return{search:async o=>{const s=ee();Le(E,s,o,t.filters,e.pageSize),y(T.SEARCH_REQUEST_SENT,{searchUnitId:E});const a=await Y(o,e.pageSize);return xe(E,s,a),y(T.SEARCH_RESPONSE_RECEIVED,{searchUnitId:E}),y(T.SEARCH_RESULTS_VIEW,{searchUnitId:E}),a},setInStockFilter:o=>{n({type:"SET_IN_STOCK_FILTER",value:o})},filters:t.filters,sort:t.sort}},Oe={products:[],config:{pageSize:8,perPageConfig:{pageSizeOptions:[12,24,36],defaultPageSizeOption:24},minQueryLength:2,currencySymbol:"$",currencyRate:1,displayOutOfStock:!0,allowAllProducts:!1},route:({sku:e,urlKey:t})=>`/products/${t}/${e}`},q=G(Oe),Ke=({children:e,storefrontDetails:t})=>{const{config:r,route:c}=t,{search:o}=Ae(r),[s,a]=_e("",500),[i,d]=F([]),p=v(null),S=v(null),C=v(null),b={products:i,config:r,route:c},R=h=>{const l=h.currentTarget.value||"";a(l)};return x(()=>{const h=document.getElementById("search_mini_form"),l=document.getElementById("search"),g=document.getElementById("search_autocomplete");return p.current=h,S.current=l,C.current=g,l==null||l.addEventListener("input",R),l==null||l.addEventListener("input",R),()=>{l==null||l.removeEventListener("input",R)}},[]),x(()=>{(async()=>{if(s.length>+r.minQueryLength){const h=await o(s);d((h==null?void 0:h.products)??[])}})()},[s,r.minQueryLength,r.pageSize]),f(q.Provider,{value:b,children:f(ce,{})})};export{q as PopoverContext,Ke as SearchPopover,Ke as default,w as usePopover}; diff --git a/scripts/__dropins__/storefront-search/containers/SearchPopover/SearchPopover.d.ts b/scripts/__dropins__/storefront-search/containers/SearchPopover/SearchPopover.d.ts deleted file mode 100644 index 008794c23f..0000000000 --- a/scripts/__dropins__/storefront-search/containers/SearchPopover/SearchPopover.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PropsWithChildren } from 'preact/compat'; -import { ProductDataModel } from '../../data/models/product'; -import { StorefrontConfig, StorefrontDetails, StorefrontRouteParams } from '../../types/storefront'; -import { Container } from '@dropins/tools/types/elsie/src/lib'; - -export type PopoverContextState = { - products: ProductDataModel[]; - config: StorefrontConfig; - route(params: StorefrontRouteParams): string; -}; -export declare const PopoverContext: import('preact').Context; -/** The initial props passed into the dropin */ -export type SearchPopoverProps = PropsWithChildren<{ - storefrontDetails: StorefrontDetails; -}>; -export declare const SearchPopover: Container; -//# sourceMappingURL=SearchPopover.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/containers/SearchPopover/index.d.ts b/scripts/__dropins__/storefront-search/containers/SearchPopover/index.d.ts deleted file mode 100644 index 0ce50c5d46..0000000000 --- a/scripts/__dropins__/storefront-search/containers/SearchPopover/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './SearchPopover'; -export { SearchPopover as default } from './SearchPopover'; -export * from './use-popover'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/containers/SearchPopover/use-popover.d.ts b/scripts/__dropins__/storefront-search/containers/SearchPopover/use-popover.d.ts deleted file mode 100644 index c658936787..0000000000 --- a/scripts/__dropins__/storefront-search/containers/SearchPopover/use-popover.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const usePopover: () => import('./SearchPopover').PopoverContextState; -//# sourceMappingURL=use-popover.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/containers/index.d.ts b/scripts/__dropins__/storefront-search/containers/index.d.ts deleted file mode 100644 index 06c077b5f8..0000000000 --- a/scripts/__dropins__/storefront-search/containers/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SearchPopover'; -export * from './ProductListingPage'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/contexts/StorefrontContext/StorefrontContext.d.ts b/scripts/__dropins__/storefront-search/contexts/StorefrontContext/StorefrontContext.d.ts deleted file mode 100644 index be7a88568a..0000000000 --- a/scripts/__dropins__/storefront-search/contexts/StorefrontContext/StorefrontContext.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { StorefrontConfig, StorefrontDetails } from '../../types/storefront'; -import { PropsWithChildren } from 'preact/compat'; - -export type StorefrontContextState = { - details?: StorefrontDetails; - config: StorefrontConfig; -}; -export declare const StorefrontContext: import('preact').Context; -export type StorefrontProviderProps = PropsWithChildren<{ - details?: StorefrontDetails; -}>; -/** The StorefrontProvider provides a configuration, validates the storeconfig if given, and configures the fetch-graphql url */ -export declare function StorefrontProvider({ children, details }: StorefrontProviderProps): import("preact/compat").JSX.Element; -//# sourceMappingURL=StorefrontContext.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/contexts/StorefrontContext/index.d.ts b/scripts/__dropins__/storefront-search/contexts/StorefrontContext/index.d.ts deleted file mode 100644 index 9ab91b9d59..0000000000 --- a/scripts/__dropins__/storefront-search/contexts/StorefrontContext/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './use-storefront'; -export { StorefrontProvider } from './StorefrontContext'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/contexts/StorefrontContext/use-storefront.d.ts b/scripts/__dropins__/storefront-search/contexts/StorefrontContext/use-storefront.d.ts deleted file mode 100644 index 52ae1124e4..0000000000 --- a/scripts/__dropins__/storefront-search/contexts/StorefrontContext/use-storefront.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const useStorefront: () => import('./StorefrontContext').StorefrontContextState; -//# sourceMappingURL=use-storefront.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/contexts/index.d.ts b/scripts/__dropins__/storefront-search/contexts/index.d.ts deleted file mode 100644 index 897551af41..0000000000 --- a/scripts/__dropins__/storefront-search/contexts/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './StorefrontContext'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/models/facet.d.ts b/scripts/__dropins__/storefront-search/data/models/facet.d.ts deleted file mode 100644 index 4a30817ec4..0000000000 --- a/scripts/__dropins__/storefront-search/data/models/facet.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { SearchBucket } from '@adobe/magento-storefront-events-sdk/dist/types/types/schemas'; - -export type FacetDataModel = { - attribute: string; - title: string; - type: string; - buckets: SearchBucket[]; - rank: number; -}; -//# sourceMappingURL=facet.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/models/index.d.ts b/scripts/__dropins__/storefront-search/data/models/index.d.ts deleted file mode 100644 index d20a5e4445..0000000000 --- a/scripts/__dropins__/storefront-search/data/models/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './facet'; -export * from './page-info'; -export * from './product'; -export * from './suggestion'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/models/page-info.d.ts b/scripts/__dropins__/storefront-search/data/models/page-info.d.ts deleted file mode 100644 index ef9ef05ac0..0000000000 --- a/scripts/__dropins__/storefront-search/data/models/page-info.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type PageInfoDataModel = { - current: number; - size: number; - total: number; -}; -//# sourceMappingURL=page-info.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/models/product.d.ts b/scripts/__dropins__/storefront-search/data/models/product.d.ts deleted file mode 100644 index 7e2d88ec21..0000000000 --- a/scripts/__dropins__/storefront-search/data/models/product.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type ProductDataModel = { - uid: string; - sku: string; - imageUrl: string; - name: string; - price: string; - urlKey?: string; - description?: string; - rank: number; - url: string; -}; -//# sourceMappingURL=product.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/models/suggestion.d.ts b/scripts/__dropins__/storefront-search/data/models/suggestion.d.ts deleted file mode 100644 index 145c533246..0000000000 --- a/scripts/__dropins__/storefront-search/data/models/suggestion.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type SuggestionDataModel = { - suggestion: string; - rank: number; -}; -//# sourceMappingURL=suggestion.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/transforms/index.d.ts b/scripts/__dropins__/storefront-search/data/transforms/index.d.ts deleted file mode 100644 index 81b7965f75..0000000000 --- a/scripts/__dropins__/storefront-search/data/transforms/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './transform-product'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/transforms/transform-facets.d.ts b/scripts/__dropins__/storefront-search/data/transforms/transform-facets.d.ts deleted file mode 100644 index c43a26c5ab..0000000000 --- a/scripts/__dropins__/storefront-search/data/transforms/transform-facets.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Aggregation } from '../../__generated__/types'; -import { FacetDataModel } from '../models'; - -export declare const transformFacets: (facets?: Aggregation[]) => FacetDataModel[]; -//# sourceMappingURL=transform-facets.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/transforms/transform-page-info.d.ts b/scripts/__dropins__/storefront-search/data/transforms/transform-page-info.d.ts deleted file mode 100644 index 20c84f9519..0000000000 --- a/scripts/__dropins__/storefront-search/data/transforms/transform-page-info.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { SearchResultPageInfo } from '../../__generated__/types'; -import { PageInfoDataModel } from '../models/page-info'; - -export declare const transformPageInfo: (info?: SearchResultPageInfo) => PageInfoDataModel; -//# sourceMappingURL=transform-page-info.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/transforms/transform-product.d.ts b/scripts/__dropins__/storefront-search/data/transforms/transform-product.d.ts deleted file mode 100644 index 51d40346e8..0000000000 --- a/scripts/__dropins__/storefront-search/data/transforms/transform-product.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ProductView } from '../../__generated__/types'; -import { ProductDataModel } from '../models/product'; - -interface ExtendedProductView extends Omit { - uid: string; - price: { - regular: { - amount: { - value: number; - currency: string; - }; - }; - final?: { - amount: { - value: number; - currency: string; - }; - }; - }; -} -export declare function transformProduct(productView: ExtendedProductView, rank: number, currencySymbol?: string, currencyRate?: string): ProductDataModel; -export declare function transformProducts(products: ExtendedProductView[], currencySymbol?: string, currencyRate?: string): ProductDataModel[]; -export {}; -//# sourceMappingURL=transform-product.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/data/transforms/transform-suggestions.d.ts b/scripts/__dropins__/storefront-search/data/transforms/transform-suggestions.d.ts deleted file mode 100644 index aa956ccd93..0000000000 --- a/scripts/__dropins__/storefront-search/data/transforms/transform-suggestions.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { SuggestionDataModel } from '../models'; - -export declare const transformSuggestions: (suggestions?: string[]) => SuggestionDataModel[]; -//# sourceMappingURL=transform-suggestions.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/hooks/use-analytics.d.ts b/scripts/__dropins__/storefront-search/hooks/use-analytics.d.ts deleted file mode 100644 index 09445a455b..0000000000 --- a/scripts/__dropins__/storefront-search/hooks/use-analytics.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare const useAnalytics: () => { - publishSearchProductClick: (sku: string) => void; - updateSearchInputContext: () => void; - searchRequestSent: () => void; - searchResponseReceived: () => void; - searchResultsView: () => void; -}; -//# sourceMappingURL=use-analytics.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/hooks/use-debounce-callback.d.ts b/scripts/__dropins__/storefront-search/hooks/use-debounce-callback.d.ts deleted file mode 100644 index 5791bd0d1d..0000000000 --- a/scripts/__dropins__/storefront-search/hooks/use-debounce-callback.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -type DebounceOptions = { - leading?: boolean; - trailing?: boolean; - maxWait?: number; -}; -type ControlFunctions = { - cancel: () => void; - flush: () => void; - isPending: () => boolean; -}; -export type DebouncedState ReturnType> = ((...args: Parameters) => ReturnType | undefined) & ControlFunctions; -export declare function useDebounceCallback ReturnType>(func: T, delay?: number, options?: DebounceOptions): DebouncedState; -export {}; -//# sourceMappingURL=use-debounce-callback.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/hooks/use-debounce-value.d.ts b/scripts/__dropins__/storefront-search/hooks/use-debounce-value.d.ts deleted file mode 100644 index 1cfb7443ad..0000000000 --- a/scripts/__dropins__/storefront-search/hooks/use-debounce-value.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { DebouncedState } from './use-debounce-callback'; - -type UseDebounceValueOptions = { - leading?: boolean; - trailing?: boolean; - maxWait?: number; - equalityFn?: (left: T, right: T) => boolean; -}; -export declare function useDebounceValue(initialValue: T | (() => T), delay: number, options?: UseDebounceValueOptions): [T, DebouncedState<(value: T) => void>]; -export {}; -//# sourceMappingURL=use-debounce-value.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/hooks/use-search.d.ts b/scripts/__dropins__/storefront-search/hooks/use-search.d.ts deleted file mode 100644 index 33c1c63033..0000000000 --- a/scripts/__dropins__/storefront-search/hooks/use-search.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { SearchFilter, SearchSort } from '@adobe/magento-storefront-events-sdk/dist/types/types/schemas'; -import { StorefrontConfig } from '../types/storefront'; - -export interface SearchContextState { - filters: SearchFilter[]; - sort: SearchSort[]; -} -/** - * useSearch isolates all search functionality into its own hook, - * making it easier to share between search and PLP containers - */ -export declare const useSearch: (config: StorefrontConfig) => { - search: (query: string) => Promise<{ - pageInfo: import('../data/models/page-info').PageInfoDataModel; - products: import('../data/models/product').ProductDataModel[]; - }>; - setInStockFilter: (value: boolean) => void; - filters: SearchFilter[]; - sort: SearchSort[]; -}; -//# sourceMappingURL=use-search.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/hooks/use-unmount.d.ts b/scripts/__dropins__/storefront-search/hooks/use-unmount.d.ts deleted file mode 100644 index d15cae23ce..0000000000 --- a/scripts/__dropins__/storefront-search/hooks/use-unmount.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function useUnmount(func: () => void): void; -//# sourceMappingURL=use-unmount.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/i18n/en_US.json.d.ts b/scripts/__dropins__/storefront-search/i18n/en_US.json.d.ts deleted file mode 100644 index fb56cc0384..0000000000 --- a/scripts/__dropins__/storefront-search/i18n/en_US.json.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare const _default: { - "": {} -}; - -export default _default; diff --git a/scripts/__dropins__/storefront-search/render.d.ts b/scripts/__dropins__/storefront-search/render.d.ts deleted file mode 100644 index f519303f5e..0000000000 --- a/scripts/__dropins__/storefront-search/render.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './render/index' diff --git a/scripts/__dropins__/storefront-search/render.js b/scripts/__dropins__/storefront-search/render.js deleted file mode 100644 index b6e9367bf7..0000000000 --- a/scripts/__dropins__/storefront-search/render.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! Copyright 2025 Adobe -All Rights Reserved. */ -(function(o,r){try{if(typeof document<"u"){const t=document.createElement("style"),d=r.styleId;for(const e in r.attributes)t.setAttribute(e,r.attributes[e]);t.setAttribute("data-dropin",d),t.appendChild(document.createTextNode(o));const i=document.querySelector('style[data-dropin="sdk"]');if(i)i.after(t);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(`.search-popover-view-all:hover{cursor:pointer}.search-popover-root{display:flex;flex-direction:column;gap:1rem;max-height:50vh}.search-popover-content{flex:1;margin-bottom:.3125rem;margin-top:.3125rem;overflow-y:auto}.search-popover-item{align-items:center;background-color:#fff;border:.0625rem solid #d1d5db;border-radius:.5rem;box-shadow:0 .0625rem .125rem #0000000d;display:flex;margin:.3125rem 0;padding:1.25rem 1.5rem;position:relative;transition:border-color .2s}.search-popover-item:hover{border-color:#9ca3af}.popover-image-container{flex-shrink:0;margin-right:1rem}.product-link{outline:none;text-decoration:none}.product-name{color:#1f2937;font-weight:500}.product-price{color:#6b7280;margin-top:1rem}.product-image{max-height:4.625rem} -@keyframes placeholderShimmer{0%{background-position:calc(100vw + 40px)}to{background-position:calc(100vw - 40px)}}.shimmer-animation-button{animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:placeholderShimmer;animation-timing-function:linear;background-color:#f6f7f8;background-image:linear-gradient(90deg,#f6f7f8 0,#edeef1,#f6f7f8 40%,#f6f7f8);background-repeat:no-repeat;background-size:100vw 4rem}.ds-plp-facets__button{height:3rem;width:160px}.shimmer-animation-facet{animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:placeholderShimmer;animation-timing-function:linear;background-color:#f6f7f8;background-image:linear-gradient(90deg,#f6f7f8 0,#edeef1,#f6f7f8 40%,#f6f7f8);background-repeat:no-repeat;background-size:100vw 4rem}.ds-sdk-input__header{display:flex;justify-content:space-between;margin-bottom:1rem;margin-top:.75rem}.ds-sdk-input__title{flex:0 0 auto;height:2.5rem;width:50%}.ds-sdk-input__item{height:2rem;margin-bottom:.3125rem;width:80%}.ds-sdk-input__item:last-child{margin-bottom:0}.ds-sdk-product-item--shimmer{box-shadow:0 .5rem 1.5rem #969ea633;margin:.625rem auto;padding:1.25rem;width:22rem}@keyframes placeholderShimmer{0%{background-position:calc(-100vw + 40px)}to{background-position:calc(100vw - 40px)}}.shimmer-animation-card{animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:placeholderShimmer;animation-timing-function:linear;background-color:#f6f7f8;background-image:linear-gradient(90deg,#f6f7f8 0,#edeef1,#f6f7f8 40%,#f6f7f8);background-repeat:no-repeat;background-size:100vw 4rem}.ds-sdk-product-item__banner{background-size:100vw 22rem;border-radius:.3125rem;height:22rem;margin-bottom:.75rem}.ds-sdk-product-item__header{display:flex;justify-content:space-between;margin-bottom:.3125rem}.ds-sdk-product-item__title{flex:0 0 auto;height:2.5rem;width:5vw}.ds-sdk-product-item__list{height:2rem;margin-bottom:.3125rem;width:6vw}.ds-sdk-product-item__list:last-child{margin-bottom:0}.ds-sdk-product-item__info{height:2rem;margin-bottom:.3125rem;width:7vw}.ds-sdk-product-item__info:last-child{margin-bottom:0}.range_container{display:flex;flex-direction:column;margin-bottom:20px;margin-top:10px;width:auto}.sliders_control{position:relative}.form_control{display:none}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background-color:#383838;border-radius:50%;box-shadow:0 0 0 1px #c6c6c6;cursor:pointer;height:12px;pointer-events:all;width:12px}input[type=range]::-moz-range-thumb{-webkit-appearance:none;background-color:#383838;border-radius:50%;box-shadow:0 0 0 1px #c6c6c6;cursor:pointer;height:12px;pointer-events:all;width:12px}input[type=range]::-webkit-slider-thumb:hover{background:#383838}input[type=number]{border:none;color:#8a8383;font-size:20px;height:30px;width:50px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{opacity:1}input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#c6c6c6;height:2px;pointer-events:none;position:absolute;width:100%}.fromSlider{height:0;z-index:1}.toSlider{z-index:2}.price-range-display{font-size:.8em;text-wrap:nowrap}.fromSlider,.toSlider{box-shadow:none!important}.grid-container{border-top:2px solid #e5e7eb;display:grid;gap:1px;grid-template-areas:"product-image product-details product-price" "product-image product-description product-description" "product-image product-ratings product-add-to-cart";grid-template-columns:auto 1fr 1fr;height:auto;padding:10px}.product-image{grid-area:product-image;width:-moz-fit-content;width:fit-content}.product-details{grid-area:product-details;white-space:nowrap}.product-price{display:grid;grid-area:product-price;height:100%;justify-content:end;width:100%}.product-description{grid-area:product-description}.product-description:hover{text-decoration:underline}.product-ratings{grid-area:product-ratings}.product-add-to-cart{display:grid;grid-area:product-add-to-cart;justify-content:end}@media screen and (max-width:767px){.grid-container{border-top:2px solid #e5e7eb;display:grid;gap:10px;grid-template-areas:"product-image product-image product-image" "product-details product-details product-details" "product-price product-price product-price" "product-description product-description product-description" "product-ratings product-ratings product-ratings" "product-add-to-cart product-add-to-cart product-add-to-cart";height:auto;padding:10px}.product-image{align-items:center;display:flex;justify-content:center;width:auto}.product-price{justify-content:start}.product-add-to-cart,.product-details{justify-content:center}} -.ds-widgets{@keyframes spin{to{transform:rotate(1turn)}}font-size:1.6rem;--color-body:#fff;--color-on-body:#222;--color-surface:#e6e6e6;--color-on-surface:#222;--color-primary:#222;--color-on-primary:#fff;--color-secondary:red;--color-on-secondary:#fff;--color-gray-1:#f3f4f6;--color-gray-2:#e5e7eb;--color-gray-3:#d1d5db;--color-gray-4:#9ca3af;--color-gray-5:#6b7280;--color-gray-6:#4b5563;--color-gray-7:#374151;--color-gray-8:#1f2937;--color-gray-9:#111827;--spacing-xxs:.15625em;--spacing-xs:.3125em;--spacing-sm:.625em;--spacing-md:1.25em;--spacing-lg:2.5em;--spacing-xl:3.75em;--spacing-2xl:4.25em;--spacing-3xl:4.75em;--font-body:sans-serif;--font-xs:.75em;--font-sm:.875em;--font-md:1em;--font-lg:1.125em;--font-xl:1.25em;--font-2xl:1.5em;--font-3xl:1.875em;--font-4xl:2.25em;--font-5xl:3em;--font-thin:100;--font-extralight:200;--font-light:300;--font-normal:400;--font-medium:500;--font-semibold:600;--font-bold:700;--font-extrabold:800;--font-black:900;--leading-none:1;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--leading-3:".75em";--leading-4:"1em";--leading-5:"1.25em";--leading-6:"1.5em";--leading-7:"1.75em";--leading-8:"2em";--leading-9:"2.25em";--leading-10:"2.5em"}.ds-widgets *,.ds-widgets :after,.ds-widgets :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.ds-widgets ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.ds-widgets .\\!container{width:100%!important}.ds-widgets .container{width:100%}@media (min-width:640px){.ds-widgets .\\!container{max-width:640px!important}.ds-widgets .container{max-width:640px}}@media (min-width:768px){.ds-widgets .\\!container{max-width:768px!important}.ds-widgets .container{max-width:768px}}@media (min-width:1024px){.ds-widgets .\\!container{max-width:1024px!important}.ds-widgets .container{max-width:1024px}}@media (min-width:1280px){.ds-widgets .\\!container{max-width:1280px!important}.ds-widgets .container{max-width:1280px}}@media (min-width:1536px){.ds-widgets .\\!container{max-width:1536px!important}.ds-widgets .container{max-width:1536px}}.ds-widgets .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.ds-widgets .visible{visibility:visible}.ds-widgets .invisible{visibility:hidden}.ds-widgets .static{position:static}.ds-widgets .fixed{position:fixed}.ds-widgets .absolute{position:absolute}.ds-widgets .relative{position:relative}.ds-widgets .bottom-0{bottom:0}.ds-widgets .left-1\\/2{left:50%}.ds-widgets .right-0{right:0}.ds-widgets .top-0{top:0}.ds-widgets .z-20{z-index:20}.ds-widgets .m-auto{margin:auto}.ds-widgets .mx-auto{margin-left:auto;margin-right:auto}.ds-widgets .mx-sm{margin-left:var(--spacing-sm);margin-right:var(--spacing-sm)}.ds-widgets .my-0{margin-bottom:0;margin-top:0}.ds-widgets .my-auto{margin-bottom:auto;margin-top:auto}.ds-widgets .my-lg{margin-bottom:var(--spacing-lg);margin-top:var(--spacing-lg)}.ds-widgets .mb-0{margin-bottom:0}.ds-widgets .mb-0\\.5{margin-bottom:.125rem}.ds-widgets .mb-6{margin-bottom:1.5rem}.ds-widgets .mb-\\[1px\\]{margin-bottom:1px}.ds-widgets .mb-md{margin-bottom:var(--spacing-md)}.ds-widgets .ml-1{margin-left:.25rem}.ds-widgets .ml-2{margin-left:.5rem}.ds-widgets .ml-3{margin-left:.75rem}.ds-widgets .ml-auto{margin-left:auto}.ds-widgets .ml-sm{margin-left:var(--spacing-sm)}.ds-widgets .ml-xs{margin-left:var(--spacing-xs)}.ds-widgets .mr-2{margin-right:.5rem}.ds-widgets .mr-auto{margin-right:auto}.ds-widgets .mr-sm{margin-right:var(--spacing-sm)}.ds-widgets .mr-xs{margin-right:var(--spacing-xs)}.ds-widgets .mt-2{margin-top:.5rem}.ds-widgets .mt-4{margin-top:1rem}.ds-widgets .mt-8{margin-top:2rem}.ds-widgets .mt-\\[-2px\\]{margin-top:-2px}.ds-widgets .mt-md{margin-top:var(--spacing-md)}.ds-widgets .mt-sm{margin-top:var(--spacing-sm)}.ds-widgets .mt-xs{margin-top:var(--spacing-xs)}.ds-widgets .inline-block{display:inline-block}.ds-widgets .inline{display:inline}.ds-widgets .flex{display:flex}.ds-widgets .inline-flex{display:inline-flex}.ds-widgets .table{display:table}.ds-widgets .grid{display:grid}.ds-widgets .contents{display:contents}.ds-widgets .hidden{display:none}.ds-widgets .aspect-auto{aspect-ratio:auto}.ds-widgets .h-28{height:7rem}.ds-widgets .h-3{height:.75rem}.ds-widgets .h-5{height:1.25rem}.ds-widgets .h-\\[12px\\]{height:12px}.ds-widgets .h-\\[20px\\]{height:20px}.ds-widgets .h-\\[32px\\]{height:32px}.ds-widgets .h-\\[38px\\]{height:38px}.ds-widgets .h-auto{height:auto}.ds-widgets .h-full{height:100%}.ds-widgets .h-md{height:var(--spacing-md)}.ds-widgets .h-screen{height:100vh}.ds-widgets .h-sm{height:var(--spacing-sm)}.ds-widgets .max-h-\\[250px\\]{max-height:250px}.ds-widgets .max-h-\\[45rem\\]{max-height:45rem}.ds-widgets .min-h-\\[32px\\]{min-height:32px}.ds-widgets .w-1\\/3{width:33.333333%}.ds-widgets .w-28{width:7rem}.ds-widgets .w-5{width:1.25rem}.ds-widgets .w-96{width:24rem}.ds-widgets .w-\\[12px\\]{width:12px}.ds-widgets .w-\\[20px\\]{width:20px}.ds-widgets .w-\\[24px\\]{width:24px}.ds-widgets .w-\\[30px\\]{width:30px}.ds-widgets .w-fit{width:-moz-fit-content;width:fit-content}.ds-widgets .w-full{width:100%}.ds-widgets .w-md{width:var(--spacing-md)}.ds-widgets .w-sm{width:var(--spacing-sm)}.ds-widgets .min-w-\\[16px\\]{min-width:16px}.ds-widgets .min-w-\\[32px\\]{min-width:32px}.ds-widgets .max-w-2xl{max-width:42rem}.ds-widgets .max-w-5xl{max-width:64rem}.ds-widgets .max-w-96{max-width:24rem}.ds-widgets .max-w-\\[200px\\]{max-width:200px}.ds-widgets .max-w-\\[21rem\\]{max-width:21rem}.ds-widgets .max-w-full{max-width:100%}.ds-widgets .max-w-sm{max-width:24rem}.ds-widgets .flex-1{flex:1 1 0%}.ds-widgets .flex-shrink-0{flex-shrink:0}.ds-widgets .origin-top-right{transform-origin:top right}.ds-widgets .-translate-x-1\\/2{--tw-translate-x:-50%}.ds-widgets .-rotate-90,.ds-widgets .-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ds-widgets .-rotate-90{--tw-rotate:-90deg}.ds-widgets .rotate-180{--tw-rotate:180deg}.ds-widgets .rotate-180,.ds-widgets .rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ds-widgets .rotate-45{--tw-rotate:45deg}.ds-widgets .rotate-90{--tw-rotate:90deg}.ds-widgets .rotate-90,.ds-widgets .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.ds-widgets .animate-spin{animation:spin 1s linear infinite}.ds-widgets .cursor-not-allowed{cursor:not-allowed}.ds-widgets .cursor-pointer{cursor:pointer}.ds-widgets .resize{resize:both}.ds-widgets .list-none{list-style-type:none}.ds-widgets .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.ds-widgets .grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.ds-widgets .grid-cols-none{grid-template-columns:none}.ds-widgets .flex-row{flex-direction:row}.ds-widgets .flex-col{flex-direction:column}.ds-widgets .flex-wrap{flex-wrap:wrap}.ds-widgets .flex-nowrap{flex-wrap:nowrap}.ds-widgets .items-center{align-items:center}.ds-widgets .justify-start{justify-content:flex-start}.ds-widgets .justify-end{justify-content:flex-end}.ds-widgets .justify-center{justify-content:center}.ds-widgets .justify-between{justify-content:space-between}.ds-widgets .gap-\\[10px\\]{gap:10px}.ds-widgets .gap-x-2\\.5{-moz-column-gap:.625rem;column-gap:.625rem}.ds-widgets .gap-x-2xl{-moz-column-gap:var(--spacing-2xl);column-gap:var(--spacing-2xl)}.ds-widgets .gap-x-md{-moz-column-gap:var(--spacing-md);column-gap:var(--spacing-md)}.ds-widgets .gap-y-8{row-gap:2rem}.ds-widgets .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.ds-widgets .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.ds-widgets .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.ds-widgets .overflow-hidden{overflow:hidden}.ds-widgets .overflow-y-auto{overflow-y:auto}.ds-widgets .whitespace-nowrap{white-space:nowrap}.ds-widgets .rounded-full{border-radius:9999px}.ds-widgets .rounded-lg{border-radius:.5rem}.ds-widgets .rounded-md{border-radius:.375rem}.ds-widgets .border{border-width:1px}.ds-widgets .border-0{border-width:0}.ds-widgets .border-\\[1\\.5px\\]{border-width:1.5px}.ds-widgets .border-t{border-top-width:1px}.ds-widgets .border-solid{border-style:solid}.ds-widgets .border-none{border-style:none}.ds-widgets .border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity,1))}.ds-widgets .border-gray-200{border-color:var(--color-gray-2)}.ds-widgets .border-gray-300{border-color:var(--color-gray-3)}.ds-widgets .border-transparent{border-color:transparent}.ds-widgets .bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.ds-widgets .bg-body{background-color:var(--color-body)}.ds-widgets .bg-gray-100{background-color:var(--color-gray-1)}.ds-widgets .bg-gray-200{background-color:var(--color-gray-2)}.ds-widgets .bg-green-50{background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.ds-widgets .bg-green-50,.ds-widgets .bg-red-50{--tw-bg-opacity:1}.ds-widgets .bg-red-50{background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.ds-widgets .bg-transparent{background-color:transparent}.ds-widgets .bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.ds-widgets .bg-white,.ds-widgets .bg-yellow-50{--tw-bg-opacity:1}.ds-widgets .bg-yellow-50{background-color:rgb(254 252 232/var(--tw-bg-opacity,1))}.ds-widgets .fill-gray-500{fill:var(--color-gray-5)}.ds-widgets .fill-gray-700{fill:var(--color-gray-7)}.ds-widgets .fill-primary{fill:var(--color-primary)}.ds-widgets .stroke-gray-400{stroke:var(--color-gray-4)}.ds-widgets .stroke-gray-600{stroke:var(--color-gray-6)}.ds-widgets .stroke-1{stroke-width:1}.ds-widgets .object-cover{-o-object-fit:cover;object-fit:cover}.ds-widgets .object-center{-o-object-position:center;object-position:center}.ds-widgets .p-1{padding:.25rem}.ds-widgets .p-1\\.5{padding:.375rem}.ds-widgets .p-2{padding:.5rem}.ds-widgets .p-4{padding:1rem}.ds-widgets .p-sm{padding:var(--spacing-sm)}.ds-widgets .p-xs{padding:var(--spacing-xs)}.ds-widgets .px-2{padding-left:.5rem;padding-right:.5rem}.ds-widgets .px-4{padding-left:1rem;padding-right:1rem}.ds-widgets .px-md{padding-left:var(--spacing-md);padding-right:var(--spacing-md)}.ds-widgets .px-sm{padding-left:var(--spacing-sm);padding-right:var(--spacing-sm)}.ds-widgets .py-1{padding-bottom:.25rem;padding-top:.25rem}.ds-widgets .py-12{padding-bottom:3rem;padding-top:3rem}.ds-widgets .py-2{padding-bottom:.5rem;padding-top:.5rem}.ds-widgets .py-sm{padding-bottom:var(--spacing-sm);padding-top:var(--spacing-sm)}.ds-widgets .py-xs{padding-bottom:var(--spacing-xs);padding-top:var(--spacing-xs)}.ds-widgets .pb-2{padding-bottom:.5rem}.ds-widgets .pb-2xl{padding-bottom:var(--spacing-2xl)}.ds-widgets .pb-3{padding-bottom:.75rem}.ds-widgets .pb-4{padding-bottom:1rem}.ds-widgets .pb-6{padding-bottom:1.5rem}.ds-widgets .pl-3{padding-left:.75rem}.ds-widgets .pl-8{padding-left:2rem}.ds-widgets .pr-2{padding-right:.5rem}.ds-widgets .pr-4{padding-right:1rem}.ds-widgets .pr-5{padding-right:1.25rem}.ds-widgets .pr-lg{padding-right:var(--spacing-lg)}.ds-widgets .pt-16{padding-top:4rem}.ds-widgets .pt-28{padding-top:7rem}.ds-widgets .pt-\\[15px\\]{padding-top:15px}.ds-widgets .pt-md{padding-top:var(--spacing-md)}.ds-widgets .text-left{text-align:left}.ds-widgets .text-center{text-align:center}.ds-widgets .text-2xl{font-size:var(--font-2xl);line-height:var(--leading-loose)}.ds-widgets .text-\\[12px\\]{font-size:12px}.ds-widgets .text-base{font-size:var(--font-md);line-height:var(--leading-snug)}.ds-widgets .text-lg{font-size:var(--font-lg);line-height:var(--leading-normal)}.ds-widgets .text-sm{font-size:var(--font-sm);line-height:var(--leading-tight)}.ds-widgets .text-xs{font-size:var(--font-xs);line-height:var(--leading-none)}.ds-widgets .font-light{font-weight:var(--font-light)}.ds-widgets .font-medium{font-weight:var(--font-medium)}.ds-widgets .font-normal{font-weight:var(--font-normal)}.ds-widgets .font-semibold{font-weight:var(--font-semibold)}.ds-widgets .lowercase{text-transform:lowercase}.ds-widgets .\\!text-primary{color:var(--color-primary)!important}.ds-widgets .text-black{color:rgb(0 0 0/var(--tw-text-opacity,1))}.ds-widgets .text-black,.ds-widgets .text-blue-400{--tw-text-opacity:1}.ds-widgets .text-blue-400{color:rgb(96 165 250/var(--tw-text-opacity,1))}.ds-widgets .text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.ds-widgets .text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.ds-widgets .text-gray-500{color:var(--color-gray-5)}.ds-widgets .text-gray-600{color:var(--color-gray-6)}.ds-widgets .text-gray-700{color:var(--color-gray-7)}.ds-widgets .text-gray-800{color:var(--color-gray-8)}.ds-widgets .text-gray-900{color:var(--color-gray-9)}.ds-widgets .text-green-400{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.ds-widgets .text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.ds-widgets .text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.ds-widgets .text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.ds-widgets .text-primary{color:var(--color-primary)}.ds-widgets .text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.ds-widgets .text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.ds-widgets .text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.ds-widgets .text-secondary{color:var(--color-secondary)}.ds-widgets .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.ds-widgets .text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.ds-widgets .text-yellow-700{--tw-text-opacity:1;color:rgb(161 98 7/var(--tw-text-opacity,1))}.ds-widgets .text-yellow-800{--tw-text-opacity:1;color:rgb(133 77 14/var(--tw-text-opacity,1))}.ds-widgets .underline{text-decoration-line:underline}.ds-widgets .line-through{text-decoration-line:line-through}.ds-widgets .no-underline{text-decoration-line:none}.ds-widgets .decoration-black{text-decoration-color:#000}.ds-widgets .underline-offset-4{text-underline-offset:4px}.ds-widgets .accent-gray-600{accent-color:var(--color-gray-6)}.ds-widgets .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.ds-widgets .outline{outline-style:solid}.ds-widgets .outline-1{outline-width:1px}.ds-widgets .outline-gray-200{outline-color:var(--color-gray-2)}.ds-widgets .outline-transparent{outline-color:transparent}.ds-widgets .ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ds-widgets .ring-black{--tw-ring-opacity:1;--tw-ring-color:rgb(0 0 0/var(--tw-ring-opacity,1))}.ds-widgets .ring-opacity-5{--tw-ring-opacity:.05}.ds-widgets .blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.ds-widgets .\\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.ds-widgets .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.ds-widgets .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ds-widgets .ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ds-widgets input[type=checkbox]{font-size:80%;margin:0;top:0}.block-display{display:block}.loading-spinner-on-mobile{left:50%;position:fixed;top:50%;transform:translate(-50%,-50%)}.first\\:ml-0:first-child{margin-left:0}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:border-\\[1\\.5px\\]:hover{border-width:1.5px}.hover\\:border-none:hover{border-style:none}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-1)}.hover\\:bg-green-100:hover{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.hover\\:bg-transparent:hover{background-color:transparent}.hover\\:text-blue-600:hover{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.hover\\:text-gray-900:hover{color:var(--color-gray-9)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:outline-gray-600:hover{outline-color:var(--color-gray-6)}.hover\\:outline-gray-800:hover{outline-color:var(--color-gray-8)}.focus\\:border-none:focus{border-style:none}.focus\\:bg-transparent:focus{background-color:transparent}.focus\\:no-underline:focus{text-decoration-line:none}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\\:ring-0:focus,.focus\\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\\:ring-green-600:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(22 163 74/var(--tw-ring-opacity,1))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus\\:ring-offset-green-50:focus{--tw-ring-offset-color:#f0fdf4}.active\\:border-none:active{border-style:none}.active\\:bg-transparent:active{background-color:transparent}.active\\:no-underline:active{text-decoration-line:none}.active\\:shadow-none:active{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (min-width:640px){.sm\\:flex{display:flex}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:pb-24{padding-bottom:6rem}.sm\\:pb-6{padding-bottom:1.5rem}}@media (min-width:768px){.md\\:ml-6{margin-left:1.5rem}.md\\:flex{display:flex}.md\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\\:justify-between{justify-content:space-between}}@media (min-width:1024px){.lg\\:w-full{width:100%}.lg\\:max-w-7xl{max-width:80rem}.lg\\:max-w-full{max-width:100%}.lg\\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width:1280px){.xl\\:gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.xl\\:gap-x-8{-moz-column-gap:2rem;column-gap:2rem}}@media (prefers-color-scheme:dark){.dark\\:bg-gray-700{background-color:var(--color-gray-7)}}`,{styleId:"storefront-search"}); -import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{Render as f}from"@dropins/tools/lib.js";import{useState as i,useEffect as m}from"@dropins/tools/preact-hooks.js";import{UIProvider as c}from"@dropins/tools/components.js";import{events as a}from"@dropins/tools/event-bus.js";const p={"":{}},u={default:p},d=({children:o})=>{const[t,n]=i("en_US");return m(()=>{const r=a.on("locale",s=>{n(s)},{eager:!0});return()=>{r==null||r.off()}},[]),e(c,{lang:t,langDefinitions:u,children:o})},x=new f(e(d,{}));export{x as render}; diff --git a/scripts/__dropins__/storefront-search/render/Provider.d.ts b/scripts/__dropins__/storefront-search/render/Provider.d.ts deleted file mode 100644 index f0074a7252..0000000000 --- a/scripts/__dropins__/storefront-search/render/Provider.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { PropsWithChildren } from 'preact/compat'; - -export declare const Provider: FunctionComponent; -//# sourceMappingURL=Provider.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/render/index.d.ts b/scripts/__dropins__/storefront-search/render/index.d.ts deleted file mode 100644 index b758d268a3..0000000000 --- a/scripts/__dropins__/storefront-search/render/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './render'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/render/render.d.ts b/scripts/__dropins__/storefront-search/render/render.d.ts deleted file mode 100644 index ca9b931956..0000000000 --- a/scripts/__dropins__/storefront-search/render/render.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Render } from '@dropins/tools/types/elsie/src/lib'; - -export declare const render: Render; -//# sourceMappingURL=render.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/types/acdl.d.ts b/scripts/__dropins__/storefront-search/types/acdl.d.ts deleted file mode 100644 index 76f2cb5603..0000000000 --- a/scripts/__dropins__/storefront-search/types/acdl.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * using the acdl enhancer and collector together can create an infinate loop, we can provide a source on the event - * so that we can filter out any events that are coming from each event generator - */ -export declare const enum AceEventSource { - ACDL = "acdl", - Collector = "collector" -} -export declare const enum AcdlEventType { - /** Triggered when data is pushed to the data layer. */ - Event = "adobeDataLayer:event", - /** Triggered when an event is pushed to the data layer. */ - Change = "adobeDataLayer:change" -} -export declare const enum FilterScope { - /** - * The listener is triggered for both past and future events - * @default - */ - All = "all", - /** The listener is triggered for past events only */ - Past = "past", - /** The listener is triggered for future events only */ - Future = "future" -} -type AddEventListenerOptions = { - path?: string; - scope?: FilterScope; -}; -export interface AdobeClientDataLayer { - push(...items: (object | Function)[]): number; - getState>(reference: string): T; - addEventListener(type: string, callback: Function, options?: AddEventListenerOptions): void; - removeEventListener(type: string, listener: Function): void; -} -export {}; -//# sourceMappingURL=acdl.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/types/analytics.d.ts b/scripts/__dropins__/storefront-search/types/analytics.d.ts deleted file mode 100644 index 457ab3d454..0000000000 --- a/scripts/__dropins__/storefront-search/types/analytics.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export type SearchProductClick = { - type: "search-product-click"; - searchUnitId: string; - name: string; -}; -export type SearchSuggestionClick = { - type: "search-suggestion-click"; - searchUnitId: string; - suggestion: string; -}; -export type SearchRequestSent = { - type: "search-request-sent"; - searchUnitId: string; -}; -export type SearchResponseReceived = { - type: "search-response-received"; - searchUnitId: string; -}; -export type SearchResultsView = { - type: "search-results-view"; - searchUnitId: string; -}; -//# sourceMappingURL=analytics.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/types/storefront.d.ts b/scripts/__dropins__/storefront-search/types/storefront.d.ts deleted file mode 100644 index e293a6401b..0000000000 --- a/scripts/__dropins__/storefront-search/types/storefront.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -export type StorefrontDetails = { - appType: "eds" | "legacy"; - environmentId: string; - environmentType: "testing" | "sandbox" | "production"; - apiKey: string; - apiUrl: string; - websiteCode: string; - storeCode: string; - storeViewCode: string; - config: StorefrontConfig; - context?: StorefrontContext; - route: (params: StorefrontRouteParams) => string; - searchRoute?: SearchRoute; -}; -export type StorefrontConfig = { - pageSize: number; - perPageConfig: PerPageConfig; - minQueryLength: number; - currencySymbol: string; - currencyRate: number; - displayOutOfStock: boolean; - allowAllProducts: boolean; -}; -export type PerPageConfig = { - pageSizeOptions: number[]; - defaultPageSizeOption: number; -}; -export type StorefrontContext = { - customerGroup: string; -}; -export type StorefrontRouteParams = { - sku: string; - urlKey: string; -}; -export type SearchRoute = { - route: string; - query: string; -}; -//# sourceMappingURL=storefront.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/utils/acdl.d.ts b/scripts/__dropins__/storefront-search/utils/acdl.d.ts deleted file mode 100644 index e773bfb1a9..0000000000 --- a/scripts/__dropins__/storefront-search/utils/acdl.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * See: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/contexts.ts#L24 - */ -export declare const contexts: { - readonly SEARCH_INPUT_CONTEXT: "searchInputContext"; - readonly SEARCH_RESULTS_CONTEXT: "searchResultsContext"; -}; -/** - * See: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/events.ts - */ -export declare const events: { - readonly SEARCH_PRODUCT_CLICK: "search-product-click"; - readonly SEARCH_SUGGESTION_CLICK: "search-suggestion-click"; - readonly SEARCH_REQUEST_SENT: "search-request-sent"; - readonly SEARCH_RESPONSE_RECEIVED: "search-response-received"; - readonly SEARCH_RESULTS_VIEW: "search-results-view"; -}; -export declare const getAdobeDataLayer: () => import('../types/acdl').AdobeClientDataLayer; -/** - * Sets a context in the Adobe Client Data Layer (ACDL) - * Logic based on: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/Base.ts#L6 - */ -export declare function setContext>(name: string, data: T): void; -/** - * Pushes an event to the Adobe Client Data Layer (ACDL) - * Logic based on: https://github.com/adobe/commerce-events/blob/1973d0ce28471ef190fa06dad6359ffa0ab51db6/packages/storefront-events-sdk/src/Base.ts#L34 - */ -export declare function pushEvent(event: string, context?: Record): void; -//# sourceMappingURL=acdl.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/utils/constants.d.ts b/scripts/__dropins__/storefront-search/utils/constants.d.ts deleted file mode 100644 index 503ea81d23..0000000000 --- a/scripts/__dropins__/storefront-search/utils/constants.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -declare const searchUnitId = "livesearch-popover-dropin"; -declare const stylingIds: { - popover: string; - product: string; - products: string; - productName: string; - productPrice: string; - suggestion: string; - suggestions: string; - suggestionsHeader: string; - viewAll: string; -}; -declare const activeClass = "active"; -export { activeClass, searchUnitId, stylingIds }; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/utils/context.d.ts b/scripts/__dropins__/storefront-search/utils/context.d.ts deleted file mode 100644 index 9d78c7ebf0..0000000000 --- a/scripts/__dropins__/storefront-search/utils/context.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SearchFilter } from '@adobe/magento-storefront-events-sdk/dist/types/types/schemas'; -import { searchProducts } from '../api'; - -export declare const updateSearchInputCtx: (searchUnitId: string, searchRequestId: string, phrase: string, filters: SearchFilter[], pageSize: number) => void; -export declare const updateSearchResultsCtx: (searchUnitId: string, searchRequestId: string, results: Awaited>) => void; -/** Create a Product record for analytics events */ -//# sourceMappingURL=context.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/utils/index.d.ts b/scripts/__dropins__/storefront-search/utils/index.d.ts deleted file mode 100644 index d313fcec1d..0000000000 --- a/scripts/__dropins__/storefront-search/utils/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './acdl'; -export * from './product'; -export * from './constants'; -export * from './mobile'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/utils/mobile.d.ts b/scripts/__dropins__/storefront-search/utils/mobile.d.ts deleted file mode 100644 index 7bcb592bb0..0000000000 --- a/scripts/__dropins__/storefront-search/utils/mobile.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare const isMobile: boolean; -declare const handleMobileDisplay: (target: HTMLLabelElement) => void; -/** - * Commerce uses the class "active" to show/hide the search bar when on mobile. - * That class changes the style of .label to { position: static }, - * same goal could also be achieved by manually adjusting that style. But we - * are trying to find the less intrusive approach and leverage OOTB behavior. - */ -declare const toggleActiveClass: (target: HTMLLabelElement) => void; -export { isMobile, handleMobileDisplay, toggleActiveClass }; -//# sourceMappingURL=mobile.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/utils/product.d.ts b/scripts/__dropins__/storefront-search/utils/product.d.ts deleted file mode 100644 index 6d1a39946d..0000000000 --- a/scripts/__dropins__/storefront-search/utils/product.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const htmlStringDecode: (input: string) => string; -export declare const getProductPrice: (amount: { - currency: string; - value: number; -}, currencySymbol?: string, currencyRate?: string) => string; -//# sourceMappingURL=product.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/api/fragments.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/api/fragments.d.ts deleted file mode 100644 index e007be2230..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/api/fragments.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare const Facet = "\n fragment Facet on Aggregation {\n title\n attribute\n buckets {\n title\n __typename\n ... on CategoryView {\n name\n count\n path\n }\n ... on ScalarBucket {\n count\n }\n ... on RangeBucket {\n from\n to\n count\n }\n ... on StatsBucket {\n min\n max\n }\n }\n }\n"; -declare const ProductView = "\n fragment ProductView on ProductSearchItem {\n productView {\n __typename\n sku\n name\n inStock\n url\n urlKey\n images {\n label\n url\n roles\n }\n ... on ComplexProductView {\n priceRange {\n maximum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n }\n minimum {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n }\n }\n options {\n id\n title\n values {\n title\n ... on ProductViewOptionValueSwatch {\n id\n inStock\n type\n value\n }\n }\n }\n }\n ... on SimpleProductView {\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n }\n }\n }\n highlights {\n attribute\n value\n matched_words\n }\n }\n"; -declare const Product = "\n fragment Product on ProductSearchItem {\n product {\n __typename\n sku\n description {\n html\n }\n short_description{\n html\n }\n name\n canonical_url\n small_image {\n url\n }\n image {\n url\n }\n thumbnail {\n url\n }\n price_range {\n minimum_price {\n fixed_product_taxes {\n amount {\n value\n currency\n }\n label\n }\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n fixed_product_taxes {\n amount {\n value\n currency\n }\n label\n }\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n }\n }\n"; -export { Facet, Product, ProductView }; -//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/api/graphql.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/api/graphql.d.ts deleted file mode 100644 index 0b08407d2c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/api/graphql.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function getGraphQL(query?: string, variables?: {}, store?: string, baseUrl?: string): Promise; -export { getGraphQL }; -//# sourceMappingURL=graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/api/mutations.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/api/mutations.d.ts deleted file mode 100644 index 07ef689fcf..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/api/mutations.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare const CREATE_EMPTY_CART = "\n mutation createEmptyCart($input: createEmptyCartInput) {\n createEmptyCart(input: $input)\n }\n"; -declare const ADD_TO_CART = "\n mutation addProductsToCart(\n $cartId: String!\n $cartItems: [CartItemInput!]!\n ) {\n addProductsToCart(\n cartId: $cartId\n cartItems: $cartItems\n ) {\n cart {\n items {\n product {\n name\n sku\n }\n quantity\n }\n }\n user_errors {\n code\n message\n }\n }\n }\n"; -declare const ADD_TO_WISHLIST = "\n mutation addProductsToWishlist(\n $wishlistId: ID!\n $wishlistItems: [WishlistItemInput!]!\n ) {\n addProductsToWishlist(\n wishlistId: $wishlistId\n wishlistItems: $wishlistItems\n ) {\n wishlist {\n id\n name\n items_count\n items_v2 {\n items {\n id\n product {\n uid\n name\n sku\n }\n }\n }\n }\n }\n }\n"; -declare const REMOVE_FROM_WISHLIST = "\n mutation removeProductsFromWishlist (\n $wishlistId: ID!\n $wishlistItemsIds: [ID!]!\n ) {\n removeProductsFromWishlist(\n wishlistId: $wishlistId\n wishlistItemsIds: $wishlistItemsIds\n ) {\n wishlist {\n id\n name\n items_count\n items_v2 {\n items {\n id\n product {\n uid\n name\n sku\n }\n }\n }\n }\n }\n }\n"; -export { CREATE_EMPTY_CART, ADD_TO_CART, ADD_TO_WISHLIST, REMOVE_FROM_WISHLIST }; -//# sourceMappingURL=mutations.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/api/queries.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/api/queries.d.ts deleted file mode 100644 index 922b37c532..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/api/queries.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare const ATTRIBUTE_METADATA_QUERY = "\n query attributeMetadata {\n attributeMetadata {\n sortable {\n label\n attribute\n numeric\n }\n filterableInSearch {\n label\n attribute\n numeric\n }\n }\n }\n"; -declare const QUICK_SEARCH_QUERY: string; -declare const PRODUCT_SEARCH_QUERY: string; -declare const REFINE_PRODUCT_QUERY = "\n query refineProduct(\n $optionIds: [String!]!\n $sku: String!\n ) {\n refineProduct(\n optionIds: $optionIds\n sku: $sku\n ) {\n __typename\n id\n sku\n name\n inStock\n url\n urlKey\n images {\n label\n url\n roles\n }\n ... on SimpleProductView {\n price {\n final {\n amount {\n value\n }\n }\n regular {\n amount {\n value\n }\n }\n }\n }\n ... on ComplexProductView {\n options {\n id\n title\n required\n values {\n id\n title\n }\n }\n priceRange {\n maximum {\n final {\n amount {\n value\n }\n }\n regular {\n amount {\n value\n }\n }\n }\n minimum {\n final {\n amount {\n value\n }\n }\n regular {\n amount {\n value\n }\n }\n }\n }\n }\n }\n }\n"; -declare const GET_CUSTOMER_CART = "\n query customerCart {\n customerCart {\n id\n items {\n id\n product {\n name\n sku\n }\n quantity\n }\n }\n }\n"; -declare const GET_CUSTOMER_WISHLISTS = "\n query customer {\n customer {\n wishlists {\n id\n name\n items_count\n items_v2 {\n items {\n id\n product {\n uid\n name\n sku\n }\n }\n }\n }\n }\n }\n"; -export { ATTRIBUTE_METADATA_QUERY, PRODUCT_SEARCH_QUERY, QUICK_SEARCH_QUERY, REFINE_PRODUCT_QUERY, GET_CUSTOMER_CART, GET_CUSTOMER_WISHLISTS, }; -//# sourceMappingURL=queries.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/api/search.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/api/search.d.ts deleted file mode 100644 index 4465992298..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/api/search.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AttributeMetadataResponse, ClientProps, ProductSearchQuery, ProductSearchResponse, RefinedProduct, RefineProductQuery } from '../types'; - -declare const getProductSearch: ({ apiUrl, phrase, pageSize, displayOutOfStock, currentPage, filter, sort, context, categorySearch, headers, }: ProductSearchQuery & ClientProps) => Promise; -declare const getAttributeMetadata: ({ apiUrl, headers, }: ClientProps) => Promise; -declare const refineProductSearch: ({ apiUrl, optionIds, sku, headers, }: RefineProductQuery & ClientProps) => Promise; -export { getAttributeMetadata, getProductSearch, refineProductSearch }; -//# sourceMappingURL=search.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/AddToCartButton/AddToCartButton.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/AddToCartButton/AddToCartButton.d.ts deleted file mode 100644 index 34d6765beb..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/AddToCartButton/AddToCartButton.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export interface AddToCartButtonProps { - onClick: (e: any) => any; -} -export declare const AddToCartButton: FunctionComponent; -//# sourceMappingURL=AddToCartButton.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/AddToCartButton/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/AddToCartButton/index.d.ts deleted file mode 100644 index 7ac72401c2..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/AddToCartButton/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './AddToCartButton'; -export { AddToCartButton as default } from './AddToCartButton'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Alert/Alert.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Alert/Alert.d.ts deleted file mode 100644 index aec01f6f3d..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Alert/Alert.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export interface AlertProps { - title: string; - type: "error" | "warning" | "info" | "success"; - description: string; - url?: string; - onClick?: (e: any) => any; -} -export declare const Alert: FunctionComponent; -//# sourceMappingURL=Alert.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Alert/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Alert/index.d.ts deleted file mode 100644 index 9c7d93d565..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Alert/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Alert'; -export { Alert as default } from './Alert'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/Breadcrumbs.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/Breadcrumbs.d.ts deleted file mode 100644 index 8cec12bc95..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/Breadcrumbs.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export interface PageProps { - name: string; - href: string; - current: boolean; -} -export interface BreadcrumbsProps { - pages: PageProps[]; -} -export declare const Breadcrumbs: FunctionComponent; -export default Breadcrumbs; -//# sourceMappingURL=Breadcrumbs.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/MockPages.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/MockPages.d.ts deleted file mode 100644 index ac0cd7a62c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/MockPages.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const pages: { - name: string; - href: string; - current: boolean; -}[]; -//# sourceMappingURL=MockPages.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/index.d.ts deleted file mode 100644 index f815fac7c1..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Breadcrumbs/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Breadcrumbs'; -export { Breadcrumbs as default } from './Breadcrumbs'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ButtonShimmer/ButtonShimmer.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ButtonShimmer/ButtonShimmer.d.ts deleted file mode 100644 index a933d009cc..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ButtonShimmer/ButtonShimmer.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export declare const ButtonShimmer: FunctionComponent; -export default ButtonShimmer; -//# sourceMappingURL=ButtonShimmer.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ButtonShimmer/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ButtonShimmer/index.d.ts deleted file mode 100644 index ab81ee7347..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ButtonShimmer/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ButtonShimmer'; -export { ButtonShimmer as default } from './ButtonShimmer'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/CategoryFilters/CategoryFilters.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/CategoryFilters/CategoryFilters.d.ts deleted file mode 100644 index ebcafaea71..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/CategoryFilters/CategoryFilters.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { Facet } from '../../types/interface'; - -interface CategoryFiltersProps { - loading: boolean; - pageLoading: boolean; - totalCount: number; - facets: Facet[]; - categoryName: string; - phrase: string; - showFilters: boolean; - setShowFilters: (showFilters: boolean) => void; - filterCount: number; -} -export declare const CategoryFilters: FunctionComponent; -export {}; -//# sourceMappingURL=CategoryFilters.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/CategoryFilters/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/CategoryFilters/index.d.ts deleted file mode 100644 index 1976f150fa..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/CategoryFilters/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './CategoryFilters'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Facets.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Facets.d.ts deleted file mode 100644 index 930c23bffa..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Facets.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { Facet as FacetType } from '../../types/interface'; - -interface FacetsProps { - searchFacets: FacetType[]; -} -export declare const Facets: FunctionComponent; -export {}; -//# sourceMappingURL=Facets.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Range/RangeFacet.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Range/RangeFacet.d.ts deleted file mode 100644 index bae4be3b17..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Range/RangeFacet.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { PriceFacet } from '../../../types/interface'; - -interface RangeFacetProps { - filterData: PriceFacet; -} -export declare const RangeFacet: FunctionComponent; -export {}; -//# sourceMappingURL=RangeFacet.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Scalar/ScalarFacet.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Scalar/ScalarFacet.d.ts deleted file mode 100644 index 56308e50db..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/Scalar/ScalarFacet.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { Facet as FacetType, PriceFacet } from '../../../types/interface'; - -interface ScalarFacetProps { - filterData: FacetType | PriceFacet; -} -export declare const ScalarFacet: FunctionComponent; -export {}; -//# sourceMappingURL=ScalarFacet.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/SelectedFilters.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/SelectedFilters.d.ts deleted file mode 100644 index 9cad29be6f..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/SelectedFilters.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export declare const SelectedFilters: FunctionComponent; -//# sourceMappingURL=SelectedFilters.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/format.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/format.d.ts deleted file mode 100644 index 2ad0bb58bc..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/format.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FacetFilter } from '../../types/interface'; - -declare const formatRangeLabel: (filter: FacetFilter, currencyRate: string, currencySymbol: string) => string; -declare const formatBinaryLabel: (filter: FacetFilter, option: string, categoryNames?: { - value: string; - name: string; - attribute: string; -}[], categoryPath?: string) => string; -export { formatBinaryLabel, formatRangeLabel }; -//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/index.d.ts deleted file mode 100644 index 46c5350739..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './Facets'; -export * from './SelectedFilters'; -export * from './Range/RangeFacet'; -export * from './Scalar/ScalarFacet'; -export { Facets as default } from './Facets'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/mocks.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/mocks.d.ts deleted file mode 100644 index 7c856854f7..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Facets/mocks.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Facet, PriceFacet } from '../../types/interface'; - -export declare const mockFilters: Facet[]; -export declare const mockColorFilter: Facet; -export declare const mockPriceFilter: PriceFacet; -//# sourceMappingURL=mocks.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/FacetsShimmer/FacetsShimmer.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/FacetsShimmer/FacetsShimmer.d.ts deleted file mode 100644 index f750c9cb23..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/FacetsShimmer/FacetsShimmer.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export declare const FacetsShimmer: FunctionComponent; -export default FacetsShimmer; -//# sourceMappingURL=FacetsShimmer.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/FacetsShimmer/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/FacetsShimmer/index.d.ts deleted file mode 100644 index 717b1ec906..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/FacetsShimmer/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './FacetsShimmer'; -export { FacetsShimmer as default } from './FacetsShimmer'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/FilterButton/FilterButton.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/FilterButton/FilterButton.d.ts deleted file mode 100644 index 4e8cf8cb02..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/FilterButton/FilterButton.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export interface FilterButtonProps { - displayFilter: () => void; - type: string; - title?: string; -} -export declare const FilterButton: FunctionComponent; -//# sourceMappingURL=FilterButton.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/FilterButton/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/FilterButton/index.d.ts deleted file mode 100644 index 43c9a1097f..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/FilterButton/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './FilterButton'; -export { FilterButton as default } from './FilterButton'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/Image.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/Image.d.ts deleted file mode 100644 index d65abacc6e..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/Image.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export declare const Image: ({ image, alt, carouselIndex, index, }: { - image: { - src: string; - srcset: any; - } | string; - alt: string; - carouselIndex: number; - index: number; -}) => import("preact/compat").JSX.Element; -//# sourceMappingURL=Image.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/ImageCarousel.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/ImageCarousel.d.ts deleted file mode 100644 index 0e51669a31..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/ImageCarousel.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { SetStateAction } from '../../../../../preact/compat'; - -export interface ImageCarouselProps { - images: string[] | { - src: string; - srcset: any; - }[]; - productName: string; - carouselIndex: number; - setCarouselIndex: (carouselIndex: number | SetStateAction) => void; -} -export declare const ImageCarousel: FunctionComponent; -//# sourceMappingURL=ImageCarousel.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/index.d.ts deleted file mode 100644 index cf56e426db..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ImageCarousel/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ImageCarousel'; -export { ImageCarousel as default } from './ImageCarousel'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/InputButtonGroup/InputButtonGroup.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/InputButtonGroup/InputButtonGroup.d.ts deleted file mode 100644 index 592535bbee..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/InputButtonGroup/InputButtonGroup.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export type InputButtonGroupOnChangeProps = { - value: string; - selected?: boolean; -}; -export type InputButtonGroupOnChange = (arg0: InputButtonGroupOnChangeProps) => void; -export type InputButtonGroupTitleSlot = (label: string) => FunctionComponent; -export type Bucket = { - title: string; - id?: string; - count: number; - to?: number; - from?: number; - name?: string; - __typename: "ScalarBucket" | "RangeBucket" | "CategoryView"; -}; -export interface InputButtonGroupProps { - title: string; - attribute: string; - buckets: Bucket[]; - isSelected: (title: string) => boolean | undefined; - onChange: InputButtonGroupOnChange; - type: "radio" | "checkbox"; - inputGroupTitleSlot?: InputButtonGroupTitleSlot; -} -export declare const InputButtonGroup: FunctionComponent; -//# sourceMappingURL=InputButtonGroup.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/InputButtonGroup/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/InputButtonGroup/index.d.ts deleted file mode 100644 index 026b511d87..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/InputButtonGroup/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './InputButtonGroup'; -export { InputButtonGroup as default } from './InputButtonGroup'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/LabelledInput/LabelledInput.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/LabelledInput/LabelledInput.d.ts deleted file mode 100644 index 3cad949438..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/LabelledInput/LabelledInput.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { ChangeEvent } from 'preact/compat'; - -export interface LabelledInputProps { - checked: boolean; - name: string; - attribute: string; - type: "checkbox" | "radio"; - onChange: (e: ChangeEvent) => void; - label: string; - value: string; - count?: number | null; -} -export declare const LabelledInput: FunctionComponent; -//# sourceMappingURL=LabelledInput.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/LabelledInput/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/LabelledInput/index.d.ts deleted file mode 100644 index f901e06273..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/LabelledInput/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './LabelledInput'; -export { LabelledInput as default } from './LabelledInput'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Loading/Loading.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Loading/Loading.d.ts deleted file mode 100644 index a31c530008..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Loading/Loading.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FunctionComponent } from 'preact'; - -interface LoadingProps { - label: string; -} -export declare const Loading: FunctionComponent; -export default Loading; -//# sourceMappingURL=Loading.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Loading/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Loading/index.d.ts deleted file mode 100644 index b40c9fcfb6..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Loading/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Loading'; -export { Loading as default } from './Loading'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/NoResults/NoResults.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/NoResults/NoResults.d.ts deleted file mode 100644 index 34e598bb9c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/NoResults/NoResults.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export interface NoResultsProps { - heading: string; - subheading: string; - isError: boolean; -} -export declare const NoResults: FunctionComponent; -//# sourceMappingURL=NoResults.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/NoResults/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/NoResults/index.d.ts deleted file mode 100644 index 6fc39cb68d..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/NoResults/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './NoResults'; -export { NoResults as default } from './NoResults'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Pagination/Pagination.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Pagination/Pagination.d.ts deleted file mode 100644 index af070601b7..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Pagination/Pagination.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FunctionComponent } from 'preact'; - -interface PaginationProps { - onPageChange: (page: number | string) => void; - totalPages: number; - currentPage: number; -} -export declare const Pagination: FunctionComponent; -export default Pagination; -//# sourceMappingURL=Pagination.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Pagination/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Pagination/index.d.ts deleted file mode 100644 index 6e2243fbba..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Pagination/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './Pagination'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/PerPagePicker/PerPagePicker.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/PerPagePicker/PerPagePicker.d.ts deleted file mode 100644 index 2f9b754b07..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/PerPagePicker/PerPagePicker.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FunctionalComponent } from 'preact'; -import { PageSizeOption } from '../../types/interface'; - -export interface PerPagePickerProps { - value: number; - pageSizeOptions: PageSizeOption[]; - onChange: (pageSize: number) => void; -} -export declare const PerPagePicker: FunctionalComponent; -//# sourceMappingURL=PerPagePicker.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/PerPagePicker/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/PerPagePicker/index.d.ts deleted file mode 100644 index bc9d9f4a37..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/PerPagePicker/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './PerPagePicker'; -export { PerPagePicker as default } from './PerPagePicker'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/Pill.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/Pill.d.ts deleted file mode 100644 index 14f5907a51..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/Pill.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ComponentChild, FunctionComponent } from 'preact'; - -export interface PillProps { - label: string; - onClick: () => void; - CTA?: ComponentChild; - classes?: string; - type?: string; -} -export declare const Pill: FunctionComponent; -//# sourceMappingURL=Pill.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/index.d.ts deleted file mode 100644 index 1e38532166..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Pill'; -export { Pill as default } from './Pill'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/mock.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/mock.d.ts deleted file mode 100644 index a7ed405e34..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Pill/mock.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const CTA: import("preact").JSX.Element; -//# sourceMappingURL=mock.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductCardShimmer/ProductCardShimmer.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductCardShimmer/ProductCardShimmer.d.ts deleted file mode 100644 index ce9985855f..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductCardShimmer/ProductCardShimmer.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export declare const ProductCardShimmer: FunctionComponent; -export default ProductCardShimmer; -//# sourceMappingURL=ProductCardShimmer.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductCardShimmer/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductCardShimmer/index.d.ts deleted file mode 100644 index de53222db0..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductCardShimmer/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ProductCardShimmer'; -export { ProductCardShimmer as default } from './ProductCardShimmer'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/MockData.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/MockData.d.ts deleted file mode 100644 index a082c4a172..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/MockData.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Product } from '../../types/interface'; - -export declare const sampleProductNoImage: Product; -export declare const sampleProductDiscounted: Product; -export declare const sampleProductNotDiscounted: Product; -//# sourceMappingURL=MockData.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/ProductItem.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/ProductItem.d.ts deleted file mode 100644 index 21e4d04ac9..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/ProductItem.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { Product, RedirectRouteFunc } from '../../types/interface'; - -export interface ProductProps { - item: Product; - currencySymbol: string; - currencyRate?: string; - setRoute?: RedirectRouteFunc | undefined; - refineProduct: (optionIds: string[], sku: string) => any; - setCartUpdated: (cartUpdated: boolean) => void; - setItemAdded: (itemAdded: string) => void; - setError: (error: boolean) => void; - addToCart?: (sku: string, options: [], quantity: number) => Promise; -} -export declare const ProductItem: FunctionComponent; -export default ProductItem; -//# sourceMappingURL=ProductItem.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/ProductPrice.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/ProductPrice.d.ts deleted file mode 100644 index a8328aedb1..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/ProductPrice.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { Product, RefinedProduct } from '../../types/interface'; - -export interface ProductPriceProps { - isComplexProductView: boolean; - item: Product | RefinedProduct; - isBundle: boolean; - isGrouped: boolean; - isGiftCard: boolean; - isConfigurable: boolean; - discount: boolean | undefined; - currencySymbol: string; - currencyRate?: string; -} -export declare const ProductPrice: FunctionComponent; -export default ProductPrice; -//# sourceMappingURL=ProductPrice.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/index.d.ts deleted file mode 100644 index c41c5274ad..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductItem/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ProductItem'; -export { ProductItem as default } from './ProductItem'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/MockData.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/MockData.d.ts deleted file mode 100644 index 04f035030c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/MockData.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -export declare const products: ({ - product: { - sku: string; - name: string; - canonical_url: string; - }; - productView: { - __typename: string; - sku: string; - name: string; - url: string; - urlKey: string; - images: { - label: string; - url: string; - }[]; - price: { - final: { - amount: { - value: number; - currency: string; - }; - }; - regular: { - amount: { - value: number; - currency: string; - }; - }; - }; - }; - highlights: { - attribute: string; - value: string; - matched_words: never[]; - }[]; -} | { - product: { - sku: string; - name: string; - canonical_url: string; - }; - productView: { - __typename: string; - sku: string; - name: string; - url: string; - urlKey: string; - images: { - label: string; - url: string; - }[]; - priceRange: { - maximum: { - final: { - amount: { - value: number; - currency: string; - }; - }; - regular: { - amount: { - value: number; - currency: string; - }; - }; - }; - minimum: { - final: { - amount: { - value: number; - currency: string; - }; - }; - regular: { - amount: { - value: number; - currency: string; - }; - }; - }; - }; - options: { - id: string; - title: string; - values: { - title: string; - id: string; - type: string; - value: string; - }[]; - }[]; - }; - highlights: { - attribute: string; - value: string; - matched_words: never[]; - }[]; -})[]; -//# sourceMappingURL=MockData.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/ProductList.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/ProductList.d.ts deleted file mode 100644 index 326fd5b71c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/ProductList.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { HTMLAttributes } from 'preact/compat'; -import { Product } from '../../types/interface'; - -export interface ProductListProps extends HTMLAttributes { - products: Array | null | undefined; - numberOfColumns: number; - showFilters: boolean; -} -export declare const ProductList: FunctionComponent; -//# sourceMappingURL=ProductList.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/index.d.ts deleted file mode 100644 index a83147a6f4..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ProductList/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ProductList'; -export { ProductList as default } from './ProductList'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SearchBar/SearchBar.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SearchBar/SearchBar.d.ts deleted file mode 100644 index 69a43b71b9..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SearchBar/SearchBar.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { ChangeEvent, HTMLAttributes } from 'preact/compat'; - -export interface SearchBarProps extends HTMLAttributes { - phrase: string; - onKeyPress: (event: ChangeEvent) => void; - onClear: () => void; - placeholder?: string; -} -export declare const SearchBar: FunctionComponent; -//# sourceMappingURL=SearchBar.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SearchBar/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SearchBar/index.d.ts deleted file mode 100644 index 4913e825d5..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SearchBar/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SearchBar'; -export { SearchBar as default } from './SearchBar'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Shimmer/Shimmer.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Shimmer/Shimmer.d.ts deleted file mode 100644 index 75e6286284..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Shimmer/Shimmer.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export declare const Shimmer: FunctionComponent; -export default Shimmer; -//# sourceMappingURL=Shimmer.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Shimmer/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Shimmer/index.d.ts deleted file mode 100644 index a09819e362..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Shimmer/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Shimmer'; -export { Shimmer as default } from './Shimmer'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Slider/Slider.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Slider/Slider.d.ts deleted file mode 100644 index f4788b32a6..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Slider/Slider.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { HTMLAttributes } from 'preact/compat'; -import { PriceFacet } from '../../types/interface'; - -export interface SliderProps extends HTMLAttributes { - filterData: PriceFacet; -} -export type Bucket = { - title: string; - id?: string; - count: number; - to?: number; - from?: number; - name?: string; - __typename: "ScalarBucket" | "RangeBucket" | "CategoryView"; -}; -export declare const Slider: FunctionComponent; -//# sourceMappingURL=Slider.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/Slider/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/Slider/index.d.ts deleted file mode 100644 index ee2aa6256c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/Slider/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Slider'; -export { Slider as default } from './Slider'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SliderDoubleControl/SliderDoubleControl.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SliderDoubleControl/SliderDoubleControl.d.ts deleted file mode 100644 index 1ba8612feb..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SliderDoubleControl/SliderDoubleControl.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { HTMLAttributes } from 'preact/compat'; -import { PriceFacet } from '../../types/interface'; - -export interface SliderProps extends HTMLAttributes { - filterData: PriceFacet; -} -export type Bucket = { - title: string; - id?: string; - count: number; - to?: number; - from?: number; - name?: string; - __typename: "ScalarBucket" | "RangeBucket" | "CategoryView"; -}; -export declare const SliderDoubleControl: FunctionComponent; -//# sourceMappingURL=SliderDoubleControl.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SliderDoubleControl/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SliderDoubleControl/index.d.ts deleted file mode 100644 index 3809bf8eed..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SliderDoubleControl/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SliderDoubleControl'; -export { SliderDoubleControl as default } from './SliderDoubleControl'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SortDropdown/SortDropdown.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SortDropdown/SortDropdown.d.ts deleted file mode 100644 index 01b1ca3090..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SortDropdown/SortDropdown.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { SortOption } from '../../types/interface'; - -export interface SortDropdownProps { - value: string; - sortOptions: SortOption[]; - onChange: (sortBy: string) => void; -} -export declare const SortDropdown: FunctionComponent; -//# sourceMappingURL=SortDropdown.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SortDropdown/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SortDropdown/index.d.ts deleted file mode 100644 index 83b0969f25..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SortDropdown/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SortDropdown'; -export { SortDropdown as default } from './SortDropdown'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButton/SwatchButton.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButton/SwatchButton.d.ts deleted file mode 100644 index 3dee42dc9e..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButton/SwatchButton.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export interface SwatchButtonProps { - id: string; - value: string; - type: "COLOR_HEX" | "IMAGE" | "TEXT"; - checked: boolean; - onClick: (e: any) => any; -} -export declare const SwatchButton: FunctionComponent; -//# sourceMappingURL=SwatchButton.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButton/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButton/index.d.ts deleted file mode 100644 index 7ecdd81d42..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButton/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SwatchButton'; -export { SwatchButton as default } from './SwatchButton'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButtonGroup/SwatchButtonGroup.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButtonGroup/SwatchButtonGroup.d.ts deleted file mode 100644 index a9aec49df4..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButtonGroup/SwatchButtonGroup.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { SwatchValues } from '../../types/interface'; - -export interface SwatchButtonGroupProps { - isSelected: (id: string) => boolean | undefined; - swatches: SwatchValues[]; - showMore: () => any; - productUrl: string; - onClick: (optionIds: string[], sku: string) => any; - sku: string; -} -export declare const SwatchButtonGroup: FunctionComponent; -//# sourceMappingURL=SwatchButtonGroup.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButtonGroup/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButtonGroup/index.d.ts deleted file mode 100644 index e87538c2e2..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/SwatchButtonGroup/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SwatchButtonGroup'; -export { SwatchButtonGroup as default } from './SwatchButtonGroup'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ViewSwitcher/ViewSwitcher.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ViewSwitcher/ViewSwitcher.d.ts deleted file mode 100644 index 3ffa66d008..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ViewSwitcher/ViewSwitcher.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export declare const ViewSwitcher: FunctionComponent; -//# sourceMappingURL=ViewSwitcher.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/ViewSwitcher/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/ViewSwitcher/index.d.ts deleted file mode 100644 index c3b82572ab..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/ViewSwitcher/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './ViewSwitcher'; -export { ViewSwitcher as default } from './ViewSwitcher'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/WishlistButton/WishlistButton.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/WishlistButton/WishlistButton.d.ts deleted file mode 100644 index 2fa58ca887..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/WishlistButton/WishlistButton.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { AddToWishlistPlacement } from '../../types/widget'; - -export interface WishlistButtonProps { - type: AddToWishlistPlacement; - productSku: string; -} -export declare const WishlistButton: FunctionComponent; -//# sourceMappingURL=WishlistButton.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/WishlistButton/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/WishlistButton/index.d.ts deleted file mode 100644 index 46fafbd355..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/WishlistButton/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './WishlistButton'; -export { WishlistButton as default } from './WishlistButton'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/index.d.ts deleted file mode 100644 index c42ef2451e..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './CategoryFilters'; -export * from './Facets'; -export * from './Pagination'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/components/mocks.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/components/mocks.d.ts deleted file mode 100644 index fe562a914e..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/components/mocks.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Facet, PriceFacet } from '../types/interface'; - -export declare const mockFilters: Facet[]; -export declare const mockColorFilter: Facet; -export declare const mockPriceFilter: PriceFacet; -//# sourceMappingURL=mocks.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/containers/App.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/containers/App.d.ts deleted file mode 100644 index d535f3e3fc..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/containers/App.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export declare const App: FunctionComponent; -export default App; -//# sourceMappingURL=App.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/containers/ProductsContainer.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/containers/ProductsContainer.d.ts deleted file mode 100644 index 7ff0a9b6d7..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/containers/ProductsContainer.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FunctionComponent } from 'preact'; - -interface Props { - showFilters: boolean; -} -export declare const ProductsContainer: FunctionComponent; -export {}; -//# sourceMappingURL=ProductsContainer.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/containers/ProductsHeader.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/containers/ProductsHeader.d.ts deleted file mode 100644 index 7c8f833c02..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/containers/ProductsHeader.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { Facet } from '../types/interface'; - -interface Props { - facets: Facet[]; - totalCount: number; - screenSize: { - mobile: boolean; - tablet: boolean; - desktop: boolean; - columns: number; - }; -} -export declare const ProductsHeader: FunctionComponent; -export {}; -//# sourceMappingURL=ProductsHeader.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/attributeMetadata.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/attributeMetadata.d.ts deleted file mode 100644 index a5573b1b81..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/attributeMetadata.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { AttributeMetadata } from '../types'; - -interface WithChildrenProps { - children?: any; -} -export interface AttributeMetaDataProps extends WithChildrenProps { - sortable: AttributeMetadata[]; - filterableInSearch: string[] | null; -} -declare const AttributeMetadataProvider: FunctionComponent; -declare const useAttributeMetadata: () => AttributeMetaDataProps; -export { AttributeMetadataProvider, useAttributeMetadata }; -//# sourceMappingURL=attributeMetadata.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/cart.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/cart.d.ts deleted file mode 100644 index 1583e4eb23..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/cart.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { FunctionComponent } from 'preact'; - -export interface CartAttributesContext { - cart: CartProps; - initializeCustomerCart: () => Promise; - addToCartGraphQL: (sku: string) => Promise; - refreshCart?: () => void; -} -interface CartProps { - cartId: string; -} -declare const useCart: () => CartAttributesContext; -declare const CartProvider: FunctionComponent; -export { CartProvider, useCart }; -//# sourceMappingURL=cart.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/displayChange.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/displayChange.d.ts deleted file mode 100644 index 28d87082db..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/displayChange.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FunctionComponent } from 'preact/compat'; - -interface DisplayChange { - mobile: boolean; - tablet: boolean; - desktop: boolean; - columns: number; -} -interface DisplayChangeContext { - screenSize: DisplayChange | null; -} -declare const useSensor: () => { - screenSize: DisplayChange; -}; -export declare const ResizeChangeContext: import('preact').Context; -declare const Resize: FunctionComponent; -export default Resize; -export { useSensor }; -//# sourceMappingURL=displayChange.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/events.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/events.d.ts deleted file mode 100644 index 733eae0f8e..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/events.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProductSearchResponse } from '../types'; -import { SearchFilter, SearchSort } from '@adobe/magento-storefront-events-sdk/dist/types/types/schemas'; - -declare const updateSearchInputCtx: (searchUnitId: string, searchRequestId: string, phrase: string, filters: Array, pageSize: number, currentPage: number, sort: Array) => void; -declare const updateSearchResultsCtx: (searchUnitId: string, searchRequestId: string, results: ProductSearchResponse["data"]["productSearch"]) => void; -export { updateSearchInputCtx, updateSearchResultsCtx }; -//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/index.d.ts deleted file mode 100644 index 547edbe7ff..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './attributeMetadata'; -export * from './store'; -export * from './widgetConfig'; -export * from './search'; -export * from './products'; -export * from './displayChange'; -export * from './events'; -export * from './translation'; -export * from './cart'; -export * from './wishlist'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/products.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/products.d.ts deleted file mode 100644 index 34f302faf0..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/products.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Facet, PageSizeOption, Product, ProductSearchQuery, RedirectRouteFunc } from '../types/interface'; - -interface WithChildrenProps { - children?: any; -} -declare const ProductsContextProvider: ({ children }: WithChildrenProps) => import("preact").JSX.Element; -declare const useProducts: () => { - variables: ProductSearchQuery; - loading: boolean; - items: Product[]; - setItems: (items: Product[]) => void; - currentPage: number; - setCurrentPage: (page: number) => void; - pageSize: number; - setPageSize: (size: number) => void; - totalCount: number; - setTotalCount: (count: number) => void; - totalPages: number; - setTotalPages: (pages: number) => void; - facets: Facet[]; - setFacets: (facets: Facet[]) => void; - categoryName: string; - setCategoryName: (categoryName: string) => void; - currencySymbol: string; - setCurrencySymbol: (currencySymbol: string) => void; - currencyRate: string; - setCurrencyRate: (currencyRate: string) => void; - minQueryLength: string | number; - minQueryLengthReached: boolean; - setMinQueryLengthReached: (minQueryLengthReached: boolean) => void; - pageSizeOptions: PageSizeOption[]; - setRoute: RedirectRouteFunc | undefined; - refineProduct: (optionIds: string[], sku: string) => any; - pageLoading: boolean; - setPageLoading: (loading: boolean) => void; - categoryPath: string | undefined; - viewType: string; - setViewType: (viewType: string) => void; - listViewType: string; - setListViewType: (viewType: string) => void; - resolveCartId?: (() => Promise) | undefined; - refreshCart?: (() => void) | undefined; - addToCart?: ((sku: string, options: [], quantity: number) => Promise) | undefined; - searchHeaders: any; - setSearchHeaders: (ccdmContext: any) => void; -}; -export { ProductsContextProvider, useProducts }; -//# sourceMappingURL=products.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/search.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/search.d.ts deleted file mode 100644 index 150079c982..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/search.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { FunctionComponent } from 'preact/compat'; -import { FacetFilter, ProductSearchSortInput } from '../types'; - -interface SearchContextProps { - phrase: string; - categoryPath: string; - filters: FacetFilter[]; - sort: ProductSearchSortInput[]; - setPhrase: any; - setCategoryPath: any; - setFilters: any; - setSort: any; - setCategoryNames: any; - filterCount: number; - categoryNames: { - name: string; - value: string; - attribute: string; - }[]; - createFilter: (filter: FacetFilter) => void; - updateFilter: (filter: FacetFilter) => void; - updateFilterOptions(filter: FacetFilter, option: string): void; - removeFilter: (name: string, option?: string) => void; - clearFilters: () => void; -} -export declare const SearchContext: import('preact').Context; -declare const SearchProvider: FunctionComponent; -declare const useSearch: () => SearchContextProps; -export { SearchProvider, useSearch }; -//# sourceMappingURL=search.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/store.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/store.d.ts deleted file mode 100644 index 2ee0eca7ac..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/store.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PropsWithChildren } from 'preact/compat'; -import { StoreDetails } from '../types'; - -export type StoreDetailsProps = PropsWithChildren; -declare const StoreContextProvider: ({ children, environmentId, environmentType, websiteCode, storeCode, storeViewCode, config, context, apiUrl, apiKey, route, searchQuery, defaultHeaders, }: StoreDetailsProps) => import("preact").JSX.Element; -declare const useStore: () => StoreDetailsProps; -export { StoreContextProvider, useStore }; -//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/translation.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/translation.d.ts deleted file mode 100644 index 07fbb1b669..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/translation.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { FunctionComponent } from 'preact/compat'; - -export type Language = { - [key: string]: any; -}; -export type Languages = { - [key: string]: Language; -}; -export declare const languages: Languages; -export declare const TranslationContext: import('preact').Context; -declare const useTranslation: () => Language; -declare const getCurrLanguage: (languageDetected: string) => string; -declare const Translation: FunctionComponent; -export default Translation; -export { getCurrLanguage, useTranslation }; -//# sourceMappingURL=translation.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/widgetConfig.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/widgetConfig.d.ts deleted file mode 100644 index 7b68d8598b..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/widgetConfig.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { WidgetConfigOptions } from '../types'; - -interface WidgetConfigProps extends WidgetConfigOptions { -} -declare const WidgetConfigContextProvider: ({ children }: { - children?: any; -}) => import("preact").JSX.Element; -declare const useWidgetConfig: () => WidgetConfigProps; -export { WidgetConfigContextProvider, useWidgetConfig }; -//# sourceMappingURL=widgetConfig.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/context/wishlist.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/context/wishlist.d.ts deleted file mode 100644 index 32e4c0cc0b..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/context/wishlist.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { FunctionComponent } from 'preact'; -import { Wishlist, WishlistAddItemInput } from '../types/interface'; - -export interface WishlistAttributesContext { - isAuthorized: boolean; - wishlist: Wishlist | undefined; - allWishlist: Wishlist[] | []; - addItemToWishlist: (wishlistId: string, wishlistItem: WishlistAddItemInput) => void; - removeItemFromWishlist: (wishlistId: string, wishlistItemIds: string) => void; -} -declare const useWishlist: () => WishlistAttributesContext; -declare const WishlistProvider: FunctionComponent; -export { useWishlist, WishlistProvider }; -//# sourceMappingURL=wishlist.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useAccessibleDropdown.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/hooks/useAccessibleDropdown.d.ts deleted file mode 100644 index 28c34ac0b1..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useAccessibleDropdown.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PageSizeOption, SortOption } from '../types'; - -export declare const useAccessibleDropdown: ({ options, value, onChange, }: { - options: SortOption[] | PageSizeOption[]; - value: string | number; - onChange: (value: any) => void; -}) => { - isDropdownOpen: boolean; - setIsDropdownOpen: (v: boolean) => void; - activeIndex: number; - setActiveIndex: import('preact/hooks').Dispatch>; - select: (value: any) => void; - setIsFocus: import('preact/hooks').Dispatch>; - listRef: import('preact').RefObject; -}; -//# sourceMappingURL=useAccessibleDropdown.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/hooks/usePagination.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/hooks/usePagination.d.ts deleted file mode 100644 index fa5684ff90..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/hooks/usePagination.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare const ELLIPSIS = "..."; -type PaginationType = { - currentPage: number; - totalPages: number; - siblingCount?: number; -}; -export declare const usePagination: ({ currentPage, totalPages, siblingCount }: PaginationType) => (string | number)[] | undefined; -export {}; -//# sourceMappingURL=usePagination.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useRangeFacet.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/hooks/useRangeFacet.d.ts deleted file mode 100644 index 2f5038204c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useRangeFacet.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PriceFacet } from '../types'; - -declare const useRangeFacet: ({ attribute, buckets }: PriceFacet) => { - isSelected: (title: string) => boolean; - onChange: (value: string) => void; -}; -export default useRangeFacet; -//# sourceMappingURL=useRangeFacet.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useScalarFacet.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/hooks/useScalarFacet.d.ts deleted file mode 100644 index 282204527b..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useScalarFacet.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Facet as FacetType, PriceFacet } from '../types'; - -export declare const useScalarFacet: (facet: FacetType | PriceFacet) => { - isSelected: (attribute: string) => boolean | undefined; - onChange: (value: string, selected?: boolean) => void; -}; -export default useScalarFacet; -//# sourceMappingURL=useScalarFacet.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useSliderFacet.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/hooks/useSliderFacet.d.ts deleted file mode 100644 index 1969576c5f..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/hooks/useSliderFacet.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PriceFacet } from '../types/interface'; - -declare const useSliderFacet: ({ attribute }: PriceFacet) => { - onChange: (from: number, to: number) => void; -}; -export default useSliderFacet; -//# sourceMappingURL=useSliderFacet.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/Sorani.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/Sorani.d.ts deleted file mode 100644 index 99e2d8a8a4..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/Sorani.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const Sorani: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=Sorani.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ar_AE.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/ar_AE.d.ts deleted file mode 100644 index 10383efd77..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ar_AE.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const ar_AE: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=ar_AE.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/bg_BG.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/bg_BG.d.ts deleted file mode 100644 index f15e07de42..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/bg_BG.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const bg_BG: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=bg_BG.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/bn_IN.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/bn_IN.d.ts deleted file mode 100644 index 168733ec76..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/bn_IN.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const bn_IN: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=bn_IN.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ca_ES.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/ca_ES.d.ts deleted file mode 100644 index d668649563..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ca_ES.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const ca_ES: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=ca_ES.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/cs_CZ.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/cs_CZ.d.ts deleted file mode 100644 index 758a1b7239..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/cs_CZ.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const cs_CZ: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=cs_CZ.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/da_DK.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/da_DK.d.ts deleted file mode 100644 index 408d4a9b7a..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/da_DK.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const da_DK: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=da_DK.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/de_DE.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/de_DE.d.ts deleted file mode 100644 index b7549b1692..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/de_DE.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const de_DE: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=de_DE.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/el_GR.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/el_GR.d.ts deleted file mode 100644 index 0f5f6f00b5..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/el_GR.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const el_GR: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=el_GR.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_GA.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_GA.d.ts deleted file mode 100644 index e94d010e3d..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_GA.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const en_GA: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=en_GA.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_GB.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_GB.d.ts deleted file mode 100644 index e7990569e1..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_GB.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const en_GB: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=en_GB.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_US.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_US.d.ts deleted file mode 100644 index f495255d00..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/en_US.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -export declare const en_US: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - sortAttributeASC: string; - sortAttributeDESC: string; - sortASC: string; - sortDESC: string; - productName: string; - productInStock: string; - productLowStock: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; - ListView: { - viewDetails: string; - }; -}; -//# sourceMappingURL=en_US.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/es_ES.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/es_ES.d.ts deleted file mode 100644 index 3c0daa0056..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/es_ES.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const es_ES: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=es_ES.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/et_EE.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/et_EE.d.ts deleted file mode 100644 index 64fba24d45..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/et_EE.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const et_EE: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=et_EE.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/eu_ES.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/eu_ES.d.ts deleted file mode 100644 index 77121c65b1..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/eu_ES.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const eu_ES: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=eu_ES.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/fa_IR.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/fa_IR.d.ts deleted file mode 100644 index e2d556d966..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/fa_IR.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const fa_IR: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=fa_IR.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/fi_FI.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/fi_FI.d.ts deleted file mode 100644 index 981bde415f..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/fi_FI.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const fi_FI: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=fi_FI.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/fr_FR.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/fr_FR.d.ts deleted file mode 100644 index fc03bbfea5..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/fr_FR.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const fr_FR: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=fr_FR.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/gl_ES.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/gl_ES.d.ts deleted file mode 100644 index 915582ab33..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/gl_ES.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const gl_ES: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=gl_ES.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/hi_IN.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/hi_IN.d.ts deleted file mode 100644 index 8c2fe96fe5..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/hi_IN.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const hi_IN: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=hi_IN.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/hu_HU.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/hu_HU.d.ts deleted file mode 100644 index 1719386927..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/hu_HU.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const hu_HU: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=hu_HU.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/hy_AM.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/hy_AM.d.ts deleted file mode 100644 index 9da28a6bb9..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/hy_AM.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const hy_AM: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=hy_AM.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/id_ID.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/id_ID.d.ts deleted file mode 100644 index 6487b0ad99..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/id_ID.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const id_ID: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=id_ID.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/index.d.ts deleted file mode 100644 index 53d28c6870..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { ar_AE } from './ar_AE'; -import { bg_BG } from './bg_BG'; -import { bn_IN } from './bn_IN'; -import { ca_ES } from './ca_ES'; -import { cs_CZ } from './cs_CZ'; -import { da_DK } from './da_DK'; -import { de_DE } from './de_DE'; -import { el_GR } from './el_GR'; -import { en_GA } from './en_GA'; -import { en_GB } from './en_GB'; -import { en_US } from './en_US'; -import { es_ES } from './es_ES'; -import { et_EE } from './et_EE'; -import { eu_ES } from './eu_ES'; -import { fa_IR } from './fa_IR'; -import { fi_FI } from './fi_FI'; -import { fr_FR } from './fr_FR'; -import { gl_ES } from './gl_ES'; -import { hi_IN } from './hi_IN'; -import { hu_HU } from './hu_HU'; -import { hy_AM } from './hy_AM'; -import { id_ID } from './id_ID'; -import { it_IT } from './it_IT'; -import { ja_JP } from './ja_JP'; -import { ko_KR } from './ko_KR'; -import { lt_LT } from './lt_LT'; -import { lv_LV } from './lv_LV'; -import { nb_NO } from './nb_NO'; -import { nl_NL } from './nl_NL'; -import { pt_BR } from './pt_BR'; -import { pt_PT } from './pt_PT'; -import { ro_RO } from './ro_RO'; -import { ru_RU } from './ru_RU'; -import { Sorani } from './Sorani'; -import { sv_SE } from './sv_SE'; -import { th_TH } from './th_TH'; -import { tr_TR } from './tr_TR'; -import { zh_Hans_CN } from './zh_Hans_CN'; -import { zh_Hant_TW } from './zh_Hant_TW'; - -export { ar_AE, bg_BG, bn_IN, ca_ES, cs_CZ, da_DK, de_DE, el_GR, en_GA, en_GB, en_US, es_ES, et_EE, eu_ES, fa_IR, fi_FI, fr_FR, gl_ES, hi_IN, hu_HU, hy_AM, id_ID, it_IT, ja_JP, ko_KR, lt_LT, lv_LV, nb_NO, nl_NL, pt_BR, pt_PT, ro_RO, ru_RU, Sorani, sv_SE, th_TH, tr_TR, zh_Hans_CN, zh_Hant_TW, }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/it_IT.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/it_IT.d.ts deleted file mode 100644 index f88ba7b78a..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/it_IT.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const it_IT: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=it_IT.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ja_JP.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/ja_JP.d.ts deleted file mode 100644 index eda1af255e..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ja_JP.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const ja_JP: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=ja_JP.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ko_KR.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/ko_KR.d.ts deleted file mode 100644 index 13bf75a5ad..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ko_KR.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const ko_KR: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=ko_KR.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/lt_LT.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/lt_LT.d.ts deleted file mode 100644 index 7506226c18..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/lt_LT.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const lt_LT: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=lt_LT.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/lv_LV.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/lv_LV.d.ts deleted file mode 100644 index 54436fe199..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/lv_LV.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const lv_LV: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=lv_LV.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/nb_NO.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/nb_NO.d.ts deleted file mode 100644 index b79cd43fa6..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/nb_NO.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const nb_NO: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=nb_NO.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/nl_NL.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/nl_NL.d.ts deleted file mode 100644 index 7e95a9ecaf..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/nl_NL.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const nl_NL: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=nl_NL.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/pt_BR.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/pt_BR.d.ts deleted file mode 100644 index 788586f8fd..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/pt_BR.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const pt_BR: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=pt_BR.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/pt_PT.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/pt_PT.d.ts deleted file mode 100644 index b5219b9995..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/pt_PT.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const pt_PT: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=pt_PT.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ro_RO.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/ro_RO.d.ts deleted file mode 100644 index 7130f48e87..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ro_RO.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const ro_RO: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=ro_RO.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ru_RU.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/ru_RU.d.ts deleted file mode 100644 index 94c4f1e232..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/ru_RU.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const ru_RU: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=ru_RU.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/sv_SE.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/sv_SE.d.ts deleted file mode 100644 index 863afad29d..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/sv_SE.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const sv_SE: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=sv_SE.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/th_TH.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/th_TH.d.ts deleted file mode 100644 index 1cb9b4ba7e..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/th_TH.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const th_TH: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=th_TH.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/tr_TR.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/tr_TR.d.ts deleted file mode 100644 index 67e14741ef..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/tr_TR.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const tr_TR: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=tr_TR.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/zh_Hans_CN.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/zh_Hans_CN.d.ts deleted file mode 100644 index 218b597980..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/zh_Hans_CN.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const zh_Hans_CN: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=zh_Hans_CN.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/i18n/zh_Hant_TW.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/i18n/zh_Hant_TW.d.ts deleted file mode 100644 index 554d689c86..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/i18n/zh_Hant_TW.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export declare const zh_Hant_TW: { - Filter: { - title: string; - showTitle: string; - hideTitle: string; - clearAll: string; - }; - InputButtonGroup: { - title: string; - price: string; - customPrice: string; - priceIncluded: string; - priceExcluded: string; - priceExcludedMessage: string; - priceRange: string; - showmore: string; - }; - Loading: { - title: string; - }; - NoResults: { - heading: string; - subheading: string; - }; - SortDropdown: { - title: string; - option: string; - relevanceLabel: string; - positionLabel: string; - }; - CategoryFilters: { - results: string; - products: string; - }; - ProductCard: { - asLowAs: string; - startingAt: string; - bundlePrice: string; - from: string; - }; - ProductContainers: { - minquery: string; - noresults: string; - pagePicker: string; - showAll: string; - }; - SearchBar: { - placeholder: string; - }; -}; -//# sourceMappingURL=zh_Hant_TW.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/icons/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/icons/index.d.ts deleted file mode 100644 index 571a55eaa9..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/icons/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { default as Adjustments } from './adjustments.svg'; -import { default as Cart } from './cart.svg'; -import { default as Checkmark } from './checkmark.svg'; -import { default as Chevron } from './chevron.svg'; -import { default as EmptyHeart } from './emptyHeart.svg'; -import { default as Error } from './error.svg'; -import { default as FilledHeart } from './filledHeart.svg'; -import { default as Filter } from './filter.svg'; -import { default as GridView } from './gridView.svg'; -import { default as Info } from './info.svg'; -import { default as ListView } from './listView.svg'; -import { default as Loading } from './loading.svg'; -import { default as NoImage } from './NoImage.svg'; -import { default as Plus } from './plus.svg'; -import { default as Sort } from './sort.svg'; -import { default as Warning } from './warning.svg'; -import { default as X } from './x.svg'; - -export { Adjustments, Cart, Checkmark, Chevron, EmptyHeart, Error, FilledHeart, Filter, GridView, Info, ListView, Loading, NoImage, Plus, Sort, Warning, X, }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/index.d.ts deleted file mode 100644 index 6e017c23e4..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { StoreDetails } from './types'; - -type LiveSearchPlpProps = { - storeDetails: StoreDetails; - root: HTMLElement; -}; -export declare function LiveSearchPLP({ storeDetails, root }: LiveSearchPlpProps): void; -export {}; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/types/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/types/index.d.ts deleted file mode 100644 index 9047dee2b8..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './interface'; -export * from './store'; -export * from './widget'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/types/interface.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/types/interface.d.ts deleted file mode 100644 index 7a57a16d6a..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/types/interface.d.ts +++ /dev/null @@ -1,418 +0,0 @@ -export interface RequestError { - message: string; - locations: Array<{ - line: number; - column: number; - }>; - path: Array; - extensions: { - errorMessage: string; - classification: string; - }; -} -export interface ClientProps { - apiUrl: string; - environmentId?: string; - websiteCode?: string; - storeCode?: string; - storeViewCode?: string; - apiKey?: string; - xRequestId?: string; - headers?: any; -} -export interface StoreDetailsConfig { - allowAllProducts?: string | boolean; - perPageConfig?: { - pageSizeOptions?: string; - defaultPageSizeOption?: string; - }; - minQueryLength?: string | number; - pageSize?: number; - currencySymbol?: string; - currencyRate?: string; - currentCategoryUrlPath?: string; - categoryName?: string; - displaySearchBox?: boolean; - displayOutOfStock?: string | boolean; - displayMode?: string; - locale?: string; - priceSlider?: boolean; - imageCarousel?: boolean; - listview?: boolean; - optimizeImages?: boolean; - imageBaseWidth?: number; - resolveCartId?: () => Promise; - refreshCart?: () => void; - baseUrl?: string; - addToCart?: (sku: string, options: [], quantity: number) => Promise; - defaultHeaders?: any; - searchHeaders?: any; -} -export type BucketTypename = "ScalarBucket" | "RangeBucket" | "StatsBucket" | "CategoryView"; -export type RedirectRouteFunc = ({ sku, urlKey }: { - sku: string; - urlKey: null | string; -}) => string; -export interface MagentoHeaders { - environmentId: string; - websiteCode: string; - storeCode: string; - storeViewCode: string; - apiKey: string; - xRequestId: string; - customerGroup: string; -} -export interface ProductSearchQuery { - phrase: string; - pageSize?: number; - currentPage?: number; - displayOutOfStock?: string | boolean; - filter?: SearchClauseInput[]; - sort?: ProductSearchSortInput[]; - xRequestId?: string; - context?: QueryContextInput; - data?: QueryData; - categorySearch?: boolean; - headers: { - [key: string]: string; - }; -} -export interface RefineProductQuery { - optionIds: string[]; - sku: string; - context?: QueryContextInput; -} -export type QueryResponse = Promise; -export interface SearchClauseInput { - attribute: string; - in?: string[]; - eq?: string; - range?: { - from: number; - to: number; - }; -} -export interface ProductSearchSortInput { - attribute: string; - direction: "ASC" | "DESC"; -} -export interface QueryContextInput { - customerGroup?: string; - userViewHistory?: { - sku: string; - dateTime: string; - }[]; -} -export interface QueryData { - products: boolean; - facets: boolean; - suggestions: boolean; -} -export type ProductSearchPromise = QueryResponse; -export type AttributeMetadata = { - attribute: string; - label: string; - numeric: boolean; -}; -export interface ProductSearchResponse { - extensions: { - "request-id": string; - }; - data: { - productSearch: { - total_count: null | number; - items: null | Array; - facets: null | Array; - suggestions?: null | Array; - related_terms?: null | Array; - page_info: null | PageInfo; - }; - attributeMetadata: { - sortable: AttributeMetadata[]; - }; - }; - errors: Array; -} -export interface AttributeMetadataResponse { - extensions: { - "request-id": string; - }; - data: { - attributeMetadata: { - sortable: AttributeMetadata[]; - filterableInSearch: AttributeMetadata[]; - }; - }; -} -export interface Product { - product: { - __typename: string; - id: number; - uid: string; - name: string; - sku: string; - description: null | ComplexTextValue; - short_description: null | ComplexTextValue; - attribute_set_id: null | number; - meta_title: null | string; - meta_keyword: null | string; - meta_description: null | string; - image: null | ProductMedia; - small_image: null | ProductMedia; - thumbnail: null | ProductMedia; - new_from_date: null | string; - new_to_date: null | string; - created_at: null | string; - updated_at: null | string; - price_range: { - minimum_price: ProductPrice; - maximum_price: ProductPrice; - }; - gift_message_available: null | string; - canonical_url: null | string; - media_gallery: null | ProductMedia; - custom_attributes: null | CustomAttribute; - add_to_cart_allowed: null | boolean; - }; - productView: { - __typename: string; - id: number; - uid: string; - name: string; - sku: string; - description: null | ComplexTextValue; - short_description: null | ComplexTextValue; - attribute_set_id: null | number; - meta_title: null | string; - meta_keyword: null | string; - meta_description: null | string; - images: null | ProductViewMedia[]; - new_from_date: null | string; - new_to_date: null | string; - created_at: null | string; - updated_at: null | string; - price: { - final: ProductViewPrice; - regular: ProductViewPrice; - }; - priceRange: { - minimum: { - final: ProductViewPrice; - regular: ProductViewPrice; - }; - maximum: { - final: ProductViewPrice; - regular: ProductViewPrice; - }; - }; - gift_message_available: null | string; - url: null | string; - urlKey: null | string; - media_gallery: null | ProductViewMedia; - custom_attributes: null | CustomAttribute; - add_to_cart_allowed: null | boolean; - options: null | { - id: null | string; - title: null | string; - values: null | SwatchValues[]; - }[]; - }; - highlights: Array; -} -export interface RefinedProduct { - refineProduct: { - __typename: string; - id: number; - uid: string; - name: string; - sku: string; - description: null | ComplexTextValue; - short_description: null | ComplexTextValue; - attribute_set_id: null | number; - meta_title: null | string; - meta_keyword: null | string; - meta_description: null | string; - images: null | ProductViewMedia[]; - new_from_date: null | string; - new_to_date: null | string; - created_at: null | string; - updated_at: null | string; - price: { - final: ProductViewPrice; - regular: ProductViewPrice; - }; - priceRange: { - minimum: { - final: ProductViewPrice; - regular: ProductViewPrice; - }; - maximum: { - final: ProductViewPrice; - regular: ProductViewPrice; - }; - }; - gift_message_available: null | string; - url: null | string; - media_gallery: null | ProductViewMedia; - custom_attributes: null | CustomAttribute; - add_to_cart_allowed: null | boolean; - options: null | { - id: null | string; - title: null | string; - values: null | SwatchValues[]; - }[]; - }; - highlights: Array; -} -export interface ComplexTextValue { - html: string; -} -export interface Money { - value: number; - currency: string; -} -export interface ProductPrice { - fixed_product_taxes: null | { - amount: Money; - label: string; - }; - regular_price: Money; - final_price: Money; - discount: null | { - percent_off: number; - amount_off: number; - }; -} -export interface ProductViewPrice { - adjustments: null | { - amount: number; - code: string; - }; - amount: Money; -} -type ImageRoles = "image" | "small_image" | "thumbnail" | "swatch_image"; -export interface ProductMedia { - url: null | string; - label: null | string; - position: null | number; - disabled: null | boolean; -} -export interface ProductViewMedia { - url: null | string; - label: null | string; - position: null | number; - disabled: null | boolean; - roles: ImageRoles[]; -} -export interface SwatchValues { - title: string; - id: string; - type: string; - value: string; -} -export interface CustomAttribute { - code: string; - value: string; -} -export interface Highlights { - attribute: string; - value: string; - matched_words: Array; -} -export interface PageInfo { - current_page: number; - page_size: number; - total_pages: number; -} -export interface Facet { - __typename?: BucketTypename; - title: string; - attribute: string; - type?: "PINNED" | "INTELLIGENT" | "POPULAR"; - buckets: Array; -} -export interface RangeBucket { - __typename: "RangeBucket"; - title: string; - from: number; - to: number; - count: number; -} -export interface ScalarBucket { - __typename: "ScalarBucket"; - title: string; - id?: string; - count: number; -} -export interface StatsBucket { - __typename: "StatsBucket"; - title: string; - min: number; - max: number; -} -export interface CategoryView { - __typename: "CategoryView"; - title: string; - name: string; - path: string; - count: number; -} -export interface PriceFacet extends Facet { - buckets: RangeBucket[]; -} -export interface FacetFilter { - attribute: string; - in?: string[]; - eq?: string; - range?: { - from: number; - to: number; - }; -} -export interface FeatureFlags { - [key: string]: boolean; -} -export interface PageSizeOption { - label: string; - value: number; -} -export interface SortMetadata { - label: string; - attribute: string; - numeric: boolean; -} -export interface SortOption { - label: string; - value: string; -} -export interface GQLSortInput { - direction: "ASC" | "DESC"; - attribute: string; -} -export interface WishlistItem { - id: string; - product: { - uid: string; - name: string; - sku: string; - }; -} -export interface Wishlist { - id: string; - name: string; - items_count: number; - items_v2: { - items: WishlistItem[]; - }; -} -export interface WishlistResponse { - wishlists: Array; -} -export interface WishlistAddItemInput { - quantity: number; - sku: string; - parent_sku?: string; - selected_options?: string[]; -} -export {}; -//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/types/store.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/types/store.d.ts deleted file mode 100644 index 85aa9068dc..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/types/store.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { QueryContextInput, RedirectRouteFunc, StoreDetailsConfig } from './interface'; - -export interface StoreDetails { - environmentId: string; - environmentType: string; - websiteCode: string; - storeCode: string; - storeViewCode: string; - config: StoreDetailsConfig; - context?: QueryContextInput; - apiUrl: string; - apiKey: string; - route?: RedirectRouteFunc; - searchQuery?: string; - customerGroup?: string; - type?: string; - defaultHeaders?: any; - searchHeaders?: any; -} -//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/types/widget.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/types/widget.d.ts deleted file mode 100644 index 2027b82f70..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/types/widget.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -export interface WidgetConfigOptions { - badge: Badge; - price: Price; - attributeSlot: AttributeSlot; - addToWishlist: AddToWishlist; - layout: Layout; - addToCart: AddToCart; - stockStatusFilterLook: StockStatusFilterLook; - swatches: Swatches; - multipleImages: MultipleImages; - compare: Compare; -} -type Badge = { - enabled: boolean; - label: string; - attributeCode: string; - backgroundColor: string; -}; -type Price = { - showNoPrice: boolean; - showRange: boolean; - showRegularPrice: boolean; - showStrikethruPrice: boolean; -}; -type AttributeSlot = { - enabled: boolean; - attributeCode: string; - backgroundColor: string; -}; -type AddToWishlist = { - enabled: boolean; - placement: AddToWishlistPlacement; -}; -export type AddToWishlistPlacement = "inLineWithName" | "onCard"; -type Layout = { - defaultLayout: LayoutType; - allowedLayouts: LayoutType[]; - showToggle: boolean; -}; -type LayoutType = "grid" | "list"; -type AddToCart = { - enabled: boolean; -}; -type StockStatusFilterLook = "radio" | "checkbox" | "toggle"; -type Swatches = { - enabled: boolean; - swatchAttributes: SwatchAttribute[]; - swatchesOnPage: number; -}; -type SwatchAttribute = { - attributeCode: string; - swatchType: SwatchAttributeType; -}; -type SwatchAttributeType = "color" | "size"; -type MultipleImages = { - enabled: boolean; - limit: number; -}; -type Compare = { - enabled: boolean; -}; -type SearchEvent = any; -declare module '@adobe/event-bus' { - interface Events { - 'search/event': SearchEvent; - } -} -export {}; -//# sourceMappingURL=widget.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/constants.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/constants.d.ts deleted file mode 100644 index 9ac71aa96f..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/constants.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ProductSearchSortInput } from '../types'; - -export declare const DEFAULT_PAGE_SIZE = 24; -export declare const DEFAULT_PAGE_SIZE_OPTIONS = "12,24,36"; -export declare const DEFAULT_MIN_QUERY_LENGTH = 3; -export declare const PRODUCT_COLUMNS: { - desktop: number; - tablet: number; - mobile: number; -}; -export declare const SEARCH_SORT_DEFAULT: ProductSearchSortInput[]; -export declare const CATEGORY_SORT_DEFAULT: ProductSearchSortInput[]; -export declare const SEARCH_UNIT_ID = "livesearch-plp"; -export declare const BOOLEAN_YES = "yes"; -export declare const BOOLEAN_NO = "no"; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/decodeHtmlString.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/decodeHtmlString.d.ts deleted file mode 100644 index ff9c736913..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/decodeHtmlString.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const decodeHtmlString: (input: string) => string | null; -export { decodeHtmlString }; -//# sourceMappingURL=decodeHtmlString.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/dom.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/dom.d.ts deleted file mode 100644 index e7c20566ce..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/dom.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const moveToTop: () => void; -export declare const classNames: (...classes: string[]) => string; -//# sourceMappingURL=dom.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/getProductImage.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/getProductImage.d.ts deleted file mode 100644 index 690ae26f4d..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/getProductImage.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ProductViewMedia } from '../types'; - -declare const getProductImageURLs: (images: ProductViewMedia[], amount?: number, topImageUrl?: string) => string[]; -export interface ResolveImageUrlOptions { - width: number; - height?: number; - auto?: string; - quality?: number; - crop?: boolean; - fit?: string; -} -declare const generateOptimizedImages: (imageUrls: string[], baseImageWidth: number) => { - src: string; - srcset: any; -}[]; -export { generateOptimizedImages, getProductImageURLs }; -//# sourceMappingURL=getProductImage.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/getProductPrice.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/getProductPrice.d.ts deleted file mode 100644 index 0284f44d78..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/getProductPrice.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Product, RefinedProduct } from '../types'; - -declare const getProductPrice: (product: Product | RefinedProduct, currencySymbol: string, currencyRate: string | undefined, useMaximum?: boolean, useFinal?: boolean) => string; -export { getProductPrice }; -//# sourceMappingURL=getProductPrice.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/getUserViewHistory.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/getUserViewHistory.d.ts deleted file mode 100644 index 363c21bb7c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/getUserViewHistory.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -type UserViewHistory = { - sku: string; - dateTime: string; -}; -declare const getUserViewHistory: () => UserViewHistory[]; -export { getUserViewHistory }; -//# sourceMappingURL=getUserViewHistory.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/handleUrlFilters.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/handleUrlFilters.d.ts deleted file mode 100644 index 0e5a4fc38c..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/handleUrlFilters.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { SearchClauseInput } from '../types'; - -declare const addUrlFilter: (filter: SearchClauseInput) => void; -declare const removeUrlFilter: (name: string, option?: string) => void; -declare const removeAllUrlFilters: () => void; -declare const handleUrlSort: (sortOption: string) => void; -declare const handleViewType: (viewType: string) => void; -declare const handleUrlPageSize: (pageSizeOption: number) => void; -declare const handleUrlPagination: (pageNumber: number) => void; -declare const getFiltersFromUrl: (filterableAttributes: string[]) => SearchClauseInput[]; -declare const getValueFromUrl: (param: string) => string; -export { addUrlFilter, getFiltersFromUrl, getValueFromUrl, handleUrlPageSize, handleUrlPagination, handleUrlSort, handleViewType, removeAllUrlFilters, removeUrlFilter, }; -//# sourceMappingURL=handleUrlFilters.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/htmlStringDecode.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/htmlStringDecode.d.ts deleted file mode 100644 index 6cb39fd2c5..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/htmlStringDecode.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const htmlStringDecode: (input: string) => string | null; -export { htmlStringDecode }; -//# sourceMappingURL=htmlStringDecode.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/index.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/index.d.ts deleted file mode 100644 index 67065a179b..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './constants'; -export * from './decodeHtmlString'; -export * from './dom'; -export * from './getProductImage'; -export * from './getProductPrice'; -export * from './getUserViewHistory'; -export * from './handleUrlFilters'; -export * from './htmlStringDecode'; -export * from './sort'; -export * from './useIntersectionObserver'; -export * from './validateStoreDetails'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/sort.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/sort.d.ts deleted file mode 100644 index 11ce8be4cc..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/sort.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Language } from '../context/translation'; -import { GQLSortInput, SortMetadata, SortOption } from '../types'; - -declare const defaultSortOptions: () => SortOption[]; -declare const getSortOptionsfromMetadata: (translation: Language, sortMetadata: SortMetadata[], displayOutOfStock?: string | boolean, categoryPath?: string) => SortOption[]; -declare const generateGQLSortInput: (sortOption: string) => GQLSortInput[] | undefined; -export { defaultSortOptions, generateGQLSortInput, getSortOptionsfromMetadata }; -//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/useIntersectionObserver.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/useIntersectionObserver.d.ts deleted file mode 100644 index 924b246e4b..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/useIntersectionObserver.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const useIntersectionObserver: (ref: any, options: any) => IntersectionObserverEntry | null; -//# sourceMappingURL=useIntersectionObserver.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-search/widgets/plp/utils/validateStoreDetails.d.ts b/scripts/__dropins__/storefront-search/widgets/plp/utils/validateStoreDetails.d.ts deleted file mode 100644 index 42c012938a..0000000000 --- a/scripts/__dropins__/storefront-search/widgets/plp/utils/validateStoreDetails.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { StoreDetails } from '../types'; - -export declare const sanitizeString: (value: string) => string; -export declare const validateStoreDetailsKeys: (storeDetails: StoreDetails) => StoreDetails; -//# sourceMappingURL=validateStoreDetails.d.ts.map \ No newline at end of file diff --git a/scripts/api/hashtags/api.js b/scripts/api/hashtags/api.js new file mode 100644 index 0000000000..24a8b7b0ec --- /dev/null +++ b/scripts/api/hashtags/api.js @@ -0,0 +1,80 @@ +import { + parseUrlHashTags, + hideLink, + showLink, + removeLink, +} from './parser.js'; +import { getActiveRules } from '../personalization/api.js'; + +const isDesktop = window.matchMedia('(min-width: 900px)'); + +/** + * This method contains default logic for built-in namespace/tag combination(s). + * + * @param {HTMLAnchorElement} el target DOM element to apply conditions + * @param {string} namespace hash tags namespace + * @param {string} value hash tag value + */ +const defaultConditionApply = (el, namespace, value, activeRules) => { + if (namespace === 'display_for_') { + if (value === 'desktop_only' && !isDesktop.matches) { + removeLink(el); + } + + if (value === 'mobile_only' && isDesktop.matches) { + removeLink(el); + } + + if (value.startsWith('segment')) { + const segments = activeRules.customerSegments.map((s) => s.name.toLowerCase()); + const [_prefix, segment] = [...value.split('_')]; + if (!segments.includes(segment.toLowerCase())) { + hideLink(el); + } else { + showLink(el); + } + } + + if (value.startsWith('group')) { + const [_prefix, group] = [...value.split('_')]; + if (group.toLowerCase() !== activeRules.customerGroup?.toLowerCase()) { + hideLink(el); + } else { + showLink(el); + } + } + + if (value.startsWith('cartrule')) { + const rules = activeRules.cart.map((s) => s.name.toLowerCase()); + const [_prefix, rule] = [...value.split('_')]; + if (!rules.includes(rule.toLowerCase())) { + hideLink(el); + } else { + showLink(el); + } + } + + if (value.startsWith('catalogrule')) { + const rules = activeRules.catalogPriceRules.map((s) => s.name.toLowerCase()); + const [_prefix, rule] = [...value.split('_')]; + if (!rules.includes(rule.toLowerCase())) { + hideLink(el); + } else { + showLink(el); + } + } + } +}; + +/** + * Executes links personalization for domElement + * + * @param {HTMLElement} domElement - root DOM element for parser + * @param {function} conditionApply - an optional callback with conditions to execute + */ +async function applyHashTagsForDomElement(domElement, conditionApply = null) { + const activeRules = await getActiveRules(); + parseUrlHashTags(domElement, conditionApply || defaultConditionApply, activeRules); +} + +export default applyHashTagsForDomElement; diff --git a/scripts/api/hashtags/parser.js b/scripts/api/hashtags/parser.js new file mode 100644 index 0000000000..596b6b9fac --- /dev/null +++ b/scripts/api/hashtags/parser.js @@ -0,0 +1,164 @@ +const namespaces = [ + 'display_for_', +]; + +/** + * The maximum length of hash in url is not specified in RFC; + * it depends on the browser how long hash string + * can become (eg. for Chrome maximum total lenght of URL is set to 2MB). + * In order to avoid processing malicious hash strings (eg. to cause browser tab to crash) + * we do not accept hashes longer than 2048 characters. + * + * @type {number} maximum length of hash string which parser will process + */ +const MAX_HASH_LENGTH = 2048; + +/** + * Change link's parent DOM element visibility to hidden + * + * @param {HTMLAnchorElement} aElement + */ +function hideLink(aElement) { + if (aElement.nodeType === Node.ELEMENT_NODE) { + aElement.parentNode.hidden = true; + } +} + +/** + * Change link's parent DOM element visibility to visible + * + * @param {HTMLAnchorElement} aElement + */ +function showLink(aElement) { + if (aElement.nodeType === Node.ELEMENT_NODE) { + aElement.parentNode.hidden = false; + } +} + +/** + * Removes link from DOM tree + * + * @param {HTMLAnchorElement} aElement + */ +function removeLink(aElement) { + if (aElement.nodeType === Node.ELEMENT_NODE && aElement.parentNode !== null) { + let child = aElement; + let parent = aElement.parentNode; + if (parent.nodeName === 'LI') { + // remove entire

  • node from