@dropins/storefront-cart 3.3.0-beta.0 → 3.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"MiniCart.js","sources":["/@dropins/storefront-cart/src/containers/MiniCart/MiniCart.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { CartModel } from '@/cart/data/models';\nimport { getPersistedCartData } from '@/cart/lib/persisted-data';\nimport { events } from '@adobe-commerce/event-bus';\nimport { MiniCart as MiniCartComponent } from '@/cart/components';\nimport { CartSummaryList } from '@/cart/containers';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Button, ImageProps, Price } from '@adobe-commerce/elsie/components';\nimport { updateProductsFromCart } from '@/cart/api';\nimport { publishInitiateCheckoutEvent } from '@/cart/lib/acdl';\nimport { state } from '@/cart/lib/state';\n\n// Delay navigation to allow analytics event to be sent before page unload.\n// 100ms provides a reasonable balance between user experience and event reliability.\nconst ANALYTICS_NAVIGATION_DELAY_MS = 100;\n\nexport interface MiniCartProps extends HTMLAttributes<HTMLDivElement> {\n routeProduct?: (item: CartModel['items'][0]) => string;\n routeCart?: () => string;\n routeCheckout?: () => string;\n routeEmptyCartCTA?: () => string;\n slots?: {\n ProductList?: SlotProps;\n ProductListFooter?: SlotProps;\n PreCheckoutSection?: SlotProps;\n Thumbnail?: SlotProps<{\n item: CartModel['items'][number];\n defaultImageProps: ImageProps;\n }>;\n Heading?: SlotProps;\n EmptyCart?: SlotProps;\n Footer?: SlotProps;\n RowTotalFooter?: SlotProps<{ item: CartModel['items'][number] }>;\n ProductAttributes?: SlotProps;\n CartSummaryFooter?: SlotProps;\n CartItem?: SlotProps; // For backward compatibility\n UndoBanner?: SlotProps<{\n item: CartModel['items'][0];\n loading: boolean;\n error?: string;\n onUndo: () => void;\n onDismiss: () => void;\n }>;\n ConfirmDeleteBanner?: SlotProps<{\n item: CartModel['items'][0];\n loading: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n }>;\n ItemTitle?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemPrice?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemQuantity?: SlotProps<{\n item: CartModel['items'][number];\n enableUpdateItemQuantity: boolean | { removeOnZero?: boolean };\n handleItemQuantityUpdate: (\n item: CartModel['items'][number],\n quantity: number\n ) => void;\n itemsLoading: Set<string>;\n handleItemsError: (uid: string, message?: string) => void;\n handleItemsLoading: (uid: string, state: boolean) => void;\n onItemUpdate?: ({ item }: { item: CartModel['items'][number] }) => void;\n }>;\n ItemTotal?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemSku?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemRemoveAction?: SlotProps<{\n item: CartModel['items'][number];\n enableRemoveItem: boolean;\n handleItemQuantityUpdate: (\n item: CartModel['items'][number],\n quantity: number\n ) => void;\n handleItemsError: (uid: string, message?: string) => void;\n handleItemsLoading: (uid: string, state: boolean) => void;\n onItemUpdate?: ({ item }: { item: CartModel['items'][number] }) => void;\n itemsLoading: Set<string>;\n }>;\n };\n hideFooter?: boolean;\n displayAllItems?: boolean;\n showDiscount?: boolean;\n showSavings?: boolean;\n enableItemRemoval?: boolean;\n enableQuantityUpdate?: boolean | { removeOnZero?: boolean };\n hideHeading?: boolean;\n undo?: boolean;\n confirmBeforeDelete?: boolean;\n}\n\nexport const MiniCart: Container<MiniCartProps, CartModel | null> = ({\n children,\n initialData = null,\n hideFooter = true, // Default to true for MiniCart\n slots,\n routeProduct,\n routeCart,\n routeCheckout,\n routeEmptyCartCTA,\n showDiscount,\n showSavings,\n enableItemRemoval = true, // Default to true for MiniCart\n enableQuantityUpdate = false, // Default to false for MiniCart\n hideHeading = false, // Default to false for MiniCart\n undo = false,\n confirmBeforeDelete = false,\n ...props\n}) => {\n const [data, setData] = useState<CartModel | null>(initialData);\n const cartTaxesConfig = state.config?.shoppingCartDisplaySetting;\n\n useEffect(() => {\n const event = events.on(\n 'cart/data',\n (payload) => {\n setData(payload as CartModel);\n },\n { eager: true }\n );\n\n return () => {\n event?.off();\n };\n }, []);\n\n const dictionary = useText({\n cartLink: 'Cart.MiniCart.cartLink',\n checkoutLink: 'Cart.MiniCart.checkoutLink',\n });\n\n const handleItemQuantityUpdate = (uid: string, quantity: number) => {\n return updateProductsFromCart([{ uid, quantity }]);\n };\n\n const handleItemRemove = (uid: string) => handleItemQuantityUpdate(uid, 0);\n\n const checkoutLinkDisabled = data?.hasOutOfStockItems;\n\n const handleInitiateCheckout = useCallback(\n (e: MouseEvent) => {\n if (data && !checkoutLinkDisabled) {\n e.preventDefault();\n publishInitiateCheckoutEvent(data, state.locale);\n\n setTimeout(() => {\n const checkoutUrl = routeCheckout?.();\n if (checkoutUrl) {\n window.location.href = checkoutUrl;\n }\n }, ANALYTICS_NAVIGATION_DELAY_MS);\n }\n },\n [data, checkoutLinkDisabled, routeCheckout]\n );\n\n const productList = (\n <Slot\n name=\"ProductList\"\n slot={slots?.ProductList}\n context={{\n itemQuantityUpdateHandler: handleItemQuantityUpdate,\n itemRemoveHandler: handleItemRemove,\n totalQuantity: data?.totalQuantity,\n }}\n >\n <CartSummaryList\n data-testid=\"default-cart-summary-list\"\n routeProduct={routeProduct}\n routeEmptyCartCTA={routeEmptyCartCTA}\n initialData={data}\n maxItems={state.config?.miniCartMaxItemsDisplay}\n showMaxItems={!!state.config?.miniCartMaxItemsDisplay}\n hideHeading={hideHeading || !data?.totalQuantity}\n hideFooter={hideFooter}\n enableRemoveItem={enableItemRemoval}\n enableUpdateItemQuantity={enableQuantityUpdate}\n showDiscount={showDiscount}\n showSavings={showSavings}\n undo={undo}\n confirmBeforeDelete={confirmBeforeDelete}\n slots={{\n Thumbnail: slots?.Thumbnail,\n Heading: slots?.Heading,\n EmptyCart: slots?.EmptyCart,\n Footer: slots?.Footer,\n RowTotalFooter: slots?.RowTotalFooter,\n ProductAttributes: slots?.ProductAttributes,\n CartSummaryFooter: slots?.CartSummaryFooter,\n CartItem: slots?.CartItem, // Keep for backward compatibility\n UndoBanner: slots?.UndoBanner,\n ConfirmDeleteBanner: slots?.ConfirmDeleteBanner,\n ItemTitle: slots?.ItemTitle,\n ItemPrice: slots?.ItemPrice,\n ItemQuantity: slots?.ItemQuantity,\n ItemTotal: slots?.ItemTotal,\n ItemSku: slots?.ItemSku,\n ItemRemoveAction: slots?.ItemRemoveAction,\n }}\n />\n </Slot>\n );\n\n const getProductListFooter = (data: CartModel | null) => {\n return (\n <Slot\n name=\"ProductListFooter\"\n slot={slots?.ProductListFooter}\n context={{\n data,\n }}\n />\n );\n };\n\n const getPreCheckoutSection = (data: CartModel | null) => {\n return (\n <Slot\n name=\"PreCheckoutSection\"\n slot={slots?.PreCheckoutSection}\n context={{\n data,\n }}\n />\n );\n };\n\n const getSubtotalPriceProps = () =>\n cartTaxesConfig?.subtotal === 'INCLUDING_TAX' ||\n cartTaxesConfig?.subtotal === 'INCLUDING_EXCLUDING_TAX'\n ? {\n amount: data?.subtotal.includingTax.value,\n currency: data?.subtotal.includingTax.currency,\n 'data-testid': 'subtotal-including-tax',\n style: { font: 'inherit' },\n }\n : {\n amount: data?.subtotal.excludingTax.value,\n currency: data?.subtotal.excludingTax.currency,\n 'data-testid': 'subtotal-excluding-tax',\n style: { font: 'inherit' },\n };\n\n return (\n <MiniCartComponent\n {...props}\n productListFooter={getProductListFooter(data)}\n subtotal={\n !data?.totalQuantity\n ? undefined\n : data?.subtotal && <Price {...getSubtotalPriceProps()} />\n }\n subtotalExcludingTaxes={\n !data?.totalQuantity\n ? undefined\n : data?.subtotal &&\n (cartTaxesConfig?.subtotal === 'INCLUDING_EXCLUDING_TAX' ? (\n <Price\n amount={data?.subtotal.excludingTax.value}\n currency={data?.subtotal.excludingTax.currency}\n data-testid=\"subtotal-including-excluding-tax\"\n style={{ font: 'inherit' }}\n />\n ) : undefined)\n }\n preCheckoutSection={getPreCheckoutSection(data)}\n ctas={\n !data?.totalQuantity ? undefined : (\n <div>\n {routeCheckout && (\n <Button\n data-testid=\"route-checkout-button\"\n variant=\"primary\"\n href={checkoutLinkDisabled ? undefined : routeCheckout()}\n disabled={checkoutLinkDisabled}\n aria-disabled={checkoutLinkDisabled}\n onClick={handleInitiateCheckout}\n >\n {dictionary.checkoutLink}\n </Button>\n )}\n {routeCart && (\n <Button\n data-testid=\"route-cart-button\"\n variant=\"tertiary\"\n href={routeCart()}\n >\n {dictionary.cartLink}\n </Button>\n )}\n </div>\n )\n }\n products={productList}\n />\n );\n};\n\nMiniCart.getInitialData = async function () {\n return getPersistedCartData();\n};\n"],"names":["ANALYTICS_NAVIGATION_DELAY_MS","MiniCart","children","initialData","hideFooter","slots","routeProduct","routeCart","routeCheckout","routeEmptyCartCTA","showDiscount","showSavings","enableItemRemoval","enableQuantityUpdate","hideHeading","undo","confirmBeforeDelete","props","data","setData","useState","cartTaxesConfig","_a","state","useEffect","event","events","payload","dictionary","useText","handleItemQuantityUpdate","uid","quantity","updateProductsFromCart","handleItemRemove","checkoutLinkDisabled","handleInitiateCheckout","useCallback","e","publishInitiateCheckoutEvent","checkoutUrl","productList","jsx","Slot","CartSummaryList","_b","_c","getProductListFooter","getPreCheckoutSection","getSubtotalPriceProps","MiniCartComponent","Price","Button","getPersistedCartData"],"mappings":"uwBAqCA,MAAMA,EAAgC,IA2EzBC,EAAuD,CAAC,CACnE,SAAAC,EACA,YAAAC,EAAc,KACd,WAAAC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Content":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { CartModel } from '@/cart/data/models';\nimport { getPersistedCartData } from '@/cart/lib/persisted-data';\nimport { events } from '@adobe-commerce/event-bus';\nimport { MiniCart as MiniCartComponent } from '@/cart/components';\nimport { CartSummaryList } from '@/cart/containers';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Button, ImageProps, Price } from '@adobe-commerce/elsie/components';\nimport { updateProductsFromCart } from '@/cart/api';\nimport { publishInitiateCheckoutEvent } from '@/cart/lib/acdl';\nimport { state } from '@/cart/lib/state';\n\n// Delay navigation to allow analytics event to be sent before page unload.\n// 100ms provides a reasonable balance between user experience and event reliability.\nconst ANALYTICS_NAVIGATION_DELAY_MS = 100;\n\nexport interface MiniCartProps extends HTMLAttributes<HTMLDivElement> {\n routeProduct?: (item: CartModel['items'][0]) => string;\n routeCart?: () => string;\n routeCheckout?: () => string;\n routeEmptyCartCTA?: () => string;\n slots?: {\n ProductList?: SlotProps;\n ProductListFooter?: SlotProps;\n PreCheckoutSection?: SlotProps;\n Thumbnail?: SlotProps<{\n item: CartModel['items'][number];\n defaultImageProps: ImageProps;\n }>;\n Heading?: SlotProps;\n EmptyCart?: SlotProps;\n Footer?: SlotProps;\n RowTotalFooter?: SlotProps<{ item: CartModel['items'][number] }>;\n ProductAttributes?: SlotProps;\n CartSummaryFooter?: SlotProps;\n CartItem?: SlotProps; // For backward compatibility\n UndoBanner?: SlotProps<{\n item: CartModel['items'][0];\n loading: boolean;\n error?: string;\n onUndo: () => void;\n onDismiss: () => void;\n }>;\n ConfirmDeleteBanner?: SlotProps<{\n item: CartModel['items'][0];\n loading: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n }>;\n ItemTitle?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemPrice?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemQuantity?: SlotProps<{\n item: CartModel['items'][number];\n enableUpdateItemQuantity: boolean | { removeOnZero?: boolean };\n handleItemQuantityUpdate: (\n item: CartModel['items'][number],\n quantity: number\n ) => void;\n itemsLoading: Set<string>;\n handleItemsError: (uid: string, message?: string) => void;\n handleItemsLoading: (uid: string, state: boolean) => void;\n onItemUpdate?: ({ item }: { item: CartModel['items'][number] }) => void;\n }>;\n ItemTotal?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemSku?: SlotProps<{ item: CartModel['items'][number] }>;\n ItemRemoveAction?: SlotProps<{\n item: CartModel['items'][number];\n enableRemoveItem: boolean;\n handleItemQuantityUpdate: (\n item: CartModel['items'][number],\n quantity: number\n ) => void;\n handleItemsError: (uid: string, message?: string) => void;\n handleItemsLoading: (uid: string, state: boolean) => void;\n onItemUpdate?: ({ item }: { item: CartModel['items'][number] }) => void;\n itemsLoading: Set<string>;\n }>;\n };\n hideFooter?: boolean;\n displayAllItems?: boolean;\n showDiscount?: boolean;\n showSavings?: boolean;\n enableItemRemoval?: boolean;\n enableQuantityUpdate?: boolean | { removeOnZero?: boolean };\n hideHeading?: boolean;\n undo?: boolean;\n confirmBeforeDelete?: boolean;\n}\n\nexport const MiniCart: Container<MiniCartProps, CartModel | null> = ({\n children,\n initialData = null,\n hideFooter = true, // Default to true for MiniCart\n slots,\n routeProduct,\n routeCart,\n routeCheckout,\n routeEmptyCartCTA,\n showDiscount,\n showSavings,\n enableItemRemoval = true, // Default to true for MiniCart\n enableQuantityUpdate = false, // Default to false for MiniCart\n hideHeading = false, // Default to false for MiniCart\n undo = false,\n confirmBeforeDelete = false,\n ...props\n}) => {\n const [data, setData] = useState<CartModel | null>(initialData);\n const cartTaxesConfig = state.config?.shoppingCartDisplaySetting;\n\n useEffect(() => {\n const event = events.on(\n 'cart/data',\n (payload) => {\n setData(payload as CartModel);\n },\n { eager: true }\n );\n\n return () => {\n event?.off();\n };\n }, []);\n\n const dictionary = useText({\n cartLink: 'Cart.MiniCart.cartLink',\n checkoutLink: 'Cart.MiniCart.checkoutLink',\n });\n\n const handleItemQuantityUpdate = (uid: string, quantity: number) => {\n return updateProductsFromCart([{ uid, quantity }]);\n };\n\n const handleItemRemove = (uid: string) => handleItemQuantityUpdate(uid, 0);\n\n const checkoutLinkDisabled = data?.hasOutOfStockItems;\n\n const handleInitiateCheckout = useCallback(\n (e: MouseEvent) => {\n if (data && !checkoutLinkDisabled) {\n e.preventDefault();\n publishInitiateCheckoutEvent(data, state.locale);\n\n setTimeout(() => {\n const checkoutUrl = routeCheckout?.();\n if (checkoutUrl) {\n window.location.href = checkoutUrl;\n }\n }, ANALYTICS_NAVIGATION_DELAY_MS);\n }\n },\n [data, checkoutLinkDisabled, routeCheckout]\n );\n\n const productList = (\n <Slot\n name=\"ProductList\"\n slot={slots?.ProductList}\n context={{\n itemQuantityUpdateHandler: handleItemQuantityUpdate,\n itemRemoveHandler: handleItemRemove,\n totalQuantity: data?.totalQuantity,\n }}\n >\n <CartSummaryList\n data-testid=\"default-cart-summary-list\"\n routeProduct={routeProduct}\n routeEmptyCartCTA={routeEmptyCartCTA}\n initialData={data}\n maxItems={state.config?.miniCartMaxItemsDisplay}\n showMaxItems={!!state.config?.miniCartMaxItemsDisplay}\n hideHeading={hideHeading || !data?.totalQuantity}\n hideFooter={hideFooter}\n enableRemoveItem={enableItemRemoval}\n enableUpdateItemQuantity={enableQuantityUpdate}\n showDiscount={showDiscount}\n showSavings={showSavings}\n undo={undo}\n confirmBeforeDelete={confirmBeforeDelete}\n slots={{\n Thumbnail: slots?.Thumbnail,\n Heading: slots?.Heading,\n EmptyCart: slots?.EmptyCart,\n Footer: slots?.Footer,\n RowTotalFooter: slots?.RowTotalFooter,\n ProductAttributes: slots?.ProductAttributes,\n CartSummaryFooter: slots?.CartSummaryFooter,\n CartItem: slots?.CartItem, // Keep for backward compatibility\n UndoBanner: slots?.UndoBanner,\n ConfirmDeleteBanner: slots?.ConfirmDeleteBanner,\n ItemTitle: slots?.ItemTitle,\n ItemPrice: slots?.ItemPrice,\n ItemQuantity: slots?.ItemQuantity,\n ItemTotal: slots?.ItemTotal,\n ItemSku: slots?.ItemSku,\n ItemRemoveAction: slots?.ItemRemoveAction,\n }}\n />\n </Slot>\n );\n\n const getProductListFooter = (data: CartModel | null) => {\n return (\n <Slot\n name=\"ProductListFooter\"\n slot={slots?.ProductListFooter}\n context={{\n data,\n }}\n />\n );\n };\n\n const getPreCheckoutSection = (data: CartModel | null) => {\n return (\n <Slot\n name=\"PreCheckoutSection\"\n slot={slots?.PreCheckoutSection}\n context={{\n data,\n }}\n />\n );\n };\n\n const getSubtotalPriceProps = () =>\n cartTaxesConfig?.subtotal === 'INCLUDING_TAX' ||\n cartTaxesConfig?.subtotal === 'INCLUDING_EXCLUDING_TAX'\n ? {\n amount: data?.subtotal.includingTax.value,\n currency: data?.subtotal.includingTax.currency,\n 'data-testid': 'subtotal-including-tax',\n style: { font: 'inherit' },\n }\n : {\n amount: data?.subtotal.excludingTax.value,\n currency: data?.subtotal.excludingTax.currency,\n 'data-testid': 'subtotal-excluding-tax',\n style: { font: 'inherit' },\n };\n\n return (\n <MiniCartComponent\n {...props}\n productListFooter={getProductListFooter(data)}\n subtotal={\n !data?.totalQuantity\n ? undefined\n : data?.subtotal && <Price {...getSubtotalPriceProps()} />\n }\n subtotalExcludingTaxes={\n !data?.totalQuantity\n ? undefined\n : data?.subtotal &&\n (cartTaxesConfig?.subtotal === 'INCLUDING_EXCLUDING_TAX' ? (\n <Price\n amount={data?.subtotal.excludingTax.value}\n currency={data?.subtotal.excludingTax.currency}\n data-testid=\"subtotal-including-excluding-tax\"\n style={{ font: 'inherit' }}\n />\n ) : undefined)\n }\n preCheckoutSection={getPreCheckoutSection(data)}\n ctas={\n !data?.totalQuantity ? undefined : (\n <div>\n {routeCheckout && (\n <Button\n data-testid=\"route-checkout-button\"\n variant=\"primary\"\n href={checkoutLinkDisabled ? undefined : routeCheckout()}\n disabled={checkoutLinkDisabled}\n aria-disabled={checkoutLinkDisabled}\n onClick={handleInitiateCheckout}\n >\n {dictionary.checkoutLink}\n </Button>\n )}\n {routeCart && (\n <Button\n data-testid=\"route-cart-button\"\n variant=\"tertiary\"\n href={routeCart()}\n >\n {dictionary.cartLink}\n </Button>\n )}\n </div>\n )\n }\n products={productList}\n />\n );\n};\n\nMiniCart.getInitialData = async function () {\n return getPersistedCartData();\n};\n"],"names":["ANALYTICS_NAVIGATION_DELAY_MS","MiniCart","children","initialData","hideFooter","slots","routeProduct","routeCart","routeCheckout","routeEmptyCartCTA","showDiscount","showSavings","enableItemRemoval","enableQuantityUpdate","hideHeading","undo","confirmBeforeDelete","props","data","setData","useState","cartTaxesConfig","_a","state","useEffect","event","events","payload","dictionary","useText","handleItemQuantityUpdate","uid","quantity","updateProductsFromCart","handleItemRemove","checkoutLinkDisabled","handleInitiateCheckout","useCallback","e","publishInitiateCheckoutEvent","checkoutUrl","productList","jsx","Slot","CartSummaryList","_b","_c","getProductListFooter","getPreCheckoutSection","getSubtotalPriceProps","MiniCartComponent","Price","Button","getPersistedCartData"],"mappings":"+xBAqCA,MAAMA,EAAgC,IA2EzBC,EAAuD,CAAC,CACnE,SAAAC,EACA,YAAAC,EAAc,KACd,WAAAC,EAAa,GACb,MAAAC,EACA,aAAAC,EACA,UAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,YAAAC,EACA,kBAAAC,EAAoB,GACpB,qBAAAC,EAAuB,GACvB,YAAAC,EAAc,GACd,KAAAC,EAAO,GACP,oBAAAC,EAAsB,GACtB,GAAGC,CACL,IAAM,WAC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B,EAGJ,OAAAwB,EAACQ,EAAA,CACE,GAAGjC,EACJ,kBAAmB8B,EAAqB7B,CAAI,EAC5C,SACGA,GAAA,MAAAA,EAAM,eAEHA,GAAA,YAAAA,EAAM,WAAawB,EAAAS,EAAA,CAAO,GAAGF,EAAyB,CAAA,CAAA,EADtD,OAGN,uBACG/B,GAAA,MAAAA,EAAM,eAEHA,GAAA,YAAAA,EAAM,aACLG,GAAA,YAAAA,EAAiB,YAAa,0BAC7BqB,EAACS,EAAA,CACC,OAAQjC,GAAA,YAAAA,EAAM,SAAS,aAAa,MACpC,SAAUA,GAAA,YAAAA,EAAM,SAAS,aAAa,SACtC,cAAY,mCACZ,MAAO,CAAE,KAAM,SAAU,CAAA,CAEzB,EAAA,QATJ,OAWN,mBAAoB8B,EAAsB9B,CAAI,EAC9C,KACGA,GAAA,MAAAA,EAAM,gBACJ,MACE,CAAA,SAAA,CACCV,GAAAkC,EAACU,EAAA,CACC,cAAY,wBACZ,QAAQ,UACR,KAAMjB,EAAuB,OAAY3B,EAAc,EACvD,SAAU2B,EACV,gBAAeA,EACf,QAASC,EAER,SAAWR,EAAA,YAAA,CACd,EAEDrB,GACCmC,EAACU,EAAA,CACC,cAAY,oBACZ,QAAQ,WACR,KAAM7C,EAAU,EAEf,SAAWqB,EAAA,QAAA,CAAA,CACd,EAEJ,EAvBqB,OA0BzB,SAAUa,CAAA,CACZ,CAEJ,EAEAxC,EAAS,eAAiB,gBAAkB,CAC1C,OAAOoD,EAAqB,CAC9B"}
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{O as u,O as l}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"../api.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";import"../chunks/components.js";import"@dropins/tools/i18n.js";export{u as OrderSummary,l as default};
3
+ import{O as l,O as x}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"../api.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";import"../chunks/components.js";import"@dropins/tools/i18n.js";export{l as OrderSummary,x as default};
4
4
  //# sourceMappingURL=OrderSummary.js.map
@@ -1,4 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{O as s,O as u}from"../chunks/components.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"../api.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";export{s as OrderSummaryLine,u as default};
3
+ import{O as u,O as l}from"../chunks/components.js";import"@dropins/tools/lib.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"../api.js";import"@dropins/tools/event-bus.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";export{u as OrderSummaryLine,l as default};
4
4
  //# sourceMappingURL=OrderSummaryLine.js.map
package/fragments.js CHANGED
@@ -1,4 +1,424 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{c as R,A as F,C as I,a as M,D as N,G as a,b as s}from"./api.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";import"@dropins/tools/fetch-graphql.js";export{R as APPLIED_GIFT_CARDS_FRAGMENT,F as AVAILABLE_GIFT_WRAPPING_FRAGMENT,I as CART_FRAGMENT,M as CART_ITEM_FRAGMENT,N as DOWNLOADABLE_CART_ITEMS_FRAGMENT,a as GIFT_MESSAGE_FRAGMENT,s as GIFT_WRAPPING_FRAGMENT};
3
+ const e=`
4
+ fragment PRICE_RANGE_FRAGMENT on PriceRange {
5
+ minimum_price {
6
+ regular_price {
7
+ value
8
+ currency
9
+ }
10
+ final_price {
11
+ value
12
+ currency
13
+ }
14
+ discount {
15
+ percent_off
16
+ amount_off
17
+ }
18
+ }
19
+ maximum_price {
20
+ regular_price {
21
+ value
22
+ currency
23
+ }
24
+ final_price {
25
+ value
26
+ currency
27
+ }
28
+ discount {
29
+ percent_off
30
+ amount_off
31
+ }
32
+ }
33
+ }
34
+ `,_=`
35
+ fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption {
36
+ type
37
+ customizable_option_uid
38
+ label
39
+ is_required
40
+ values {
41
+ label
42
+ value
43
+ price {
44
+ type
45
+ units
46
+ value
47
+ }
48
+ }
49
+ }
50
+ `,a=`
51
+ fragment DOWNLOADABLE_CART_ITEMS_FRAGMENT on DownloadableCartItem {
52
+ links {
53
+ sort_order
54
+ title
55
+ }
56
+ customizable_options {
57
+ ...CUSTOMIZABLE_OPTIONS_FRAGMENT
58
+ }
59
+ }
60
+ `,t=`
61
+ fragment APPLIED_GIFT_CARDS_FRAGMENT on AppliedGiftCard {
62
+ __typename
63
+ code
64
+ applied_balance {
65
+ value
66
+ currency
67
+ }
68
+ current_balance {
69
+ value
70
+ currency
71
+ }
72
+ expiration_date
73
+ }
74
+ `,i=`
75
+ fragment GIFT_MESSAGE_FRAGMENT on GiftMessage {
76
+ __typename
77
+ from
78
+ to
79
+ message
80
+ }
81
+ `,r=`
82
+ fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping {
83
+ __typename
84
+ uid
85
+ design
86
+ image {
87
+ url
88
+ }
89
+ price {
90
+ value
91
+ currency
92
+ }
93
+ }
94
+ `,n=`
95
+ fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping {
96
+ __typename
97
+ uid
98
+ design
99
+ image {
100
+ url
101
+ label
102
+ }
103
+ price {
104
+ currency
105
+ value
106
+ }
107
+ }
108
+ `,u=`
109
+ fragment CART_ITEM_FRAGMENT on CartItemInterface {
110
+ __typename
111
+ uid
112
+ quantity
113
+ is_available
114
+ not_available_message
115
+ errors {
116
+ code
117
+ message
118
+ }
119
+
120
+ prices {
121
+ price {
122
+ value
123
+ currency
124
+ }
125
+ discounts {
126
+ amount {
127
+ value
128
+ currency
129
+ }
130
+ label
131
+ }
132
+ total_item_discount {
133
+ value
134
+ currency
135
+ }
136
+ row_total {
137
+ value
138
+ currency
139
+ }
140
+ row_total_including_tax {
141
+ value
142
+ currency
143
+ }
144
+ price_including_tax {
145
+ value
146
+ currency
147
+ }
148
+ fixed_product_taxes {
149
+ amount {
150
+ value
151
+ currency
152
+ }
153
+ label
154
+ }
155
+ original_item_price {
156
+ value
157
+ currency
158
+ }
159
+ original_row_total {
160
+ value
161
+ currency
162
+ }
163
+ }
164
+
165
+ product {
166
+ name
167
+ sku
168
+ price_tiers {
169
+ quantity
170
+ final_price {
171
+ value
172
+ }
173
+ discount {
174
+ amount_off
175
+ percent_off
176
+ }
177
+ }
178
+ quantity
179
+ gift_message_available
180
+ gift_wrapping_available
181
+ gift_wrapping_price {
182
+ currency
183
+ value
184
+ }
185
+ thumbnail {
186
+ url
187
+ label
188
+ }
189
+ url_key
190
+ canonical_url
191
+ categories {
192
+ url_path
193
+ url_key
194
+ name
195
+ }
196
+ custom_attributesV2(filters: { is_visible_on_front: true }) {
197
+ items {
198
+ code
199
+ ... on AttributeValue {
200
+ value
201
+ }
202
+ ... on AttributeSelectedOptions {
203
+ selected_options {
204
+ value
205
+ label
206
+ }
207
+ }
208
+ }
209
+ }
210
+ only_x_left_in_stock
211
+ stock_status
212
+ price_range {
213
+ ...PRICE_RANGE_FRAGMENT
214
+ }
215
+ }
216
+ ... on SimpleCartItem {
217
+ available_gift_wrapping {
218
+ ...AVAILABLE_GIFT_WRAPPING_FRAGMENT
219
+ }
220
+ gift_message {
221
+ ...GIFT_MESSAGE_FRAGMENT
222
+ }
223
+ gift_wrapping {
224
+ ...GIFT_WRAPPING_FRAGMENT
225
+ }
226
+ customizable_options {
227
+ ...CUSTOMIZABLE_OPTIONS_FRAGMENT
228
+ }
229
+ }
230
+ ... on ConfigurableCartItem {
231
+ available_gift_wrapping {
232
+ ...AVAILABLE_GIFT_WRAPPING_FRAGMENT
233
+ }
234
+ gift_message {
235
+ ...GIFT_MESSAGE_FRAGMENT
236
+ }
237
+ gift_wrapping {
238
+ ...GIFT_WRAPPING_FRAGMENT
239
+ }
240
+ configurable_options {
241
+ configurable_product_option_uid
242
+ option_label
243
+ value_label
244
+ configurable_product_option_value_uid
245
+ }
246
+ configured_variant {
247
+ uid
248
+ sku
249
+ only_x_left_in_stock
250
+ stock_status
251
+ thumbnail {
252
+ label
253
+ url
254
+ }
255
+ price_range {
256
+ ...PRICE_RANGE_FRAGMENT
257
+ }
258
+ price_tiers {
259
+ quantity
260
+ final_price {
261
+ value
262
+ }
263
+ discount {
264
+ amount_off
265
+ percent_off
266
+ }
267
+ }
268
+ }
269
+ customizable_options {
270
+ ...CUSTOMIZABLE_OPTIONS_FRAGMENT
271
+ }
272
+ }
273
+ ...DOWNLOADABLE_CART_ITEMS_FRAGMENT
274
+ ... on BundleCartItem {
275
+ available_gift_wrapping {
276
+ ...AVAILABLE_GIFT_WRAPPING_FRAGMENT
277
+ }
278
+ gift_message {
279
+ ...GIFT_MESSAGE_FRAGMENT
280
+ }
281
+ gift_wrapping {
282
+ ...GIFT_WRAPPING_FRAGMENT
283
+ }
284
+ bundle_options {
285
+ uid
286
+ label
287
+ values {
288
+ uid
289
+ label
290
+ }
291
+ }
292
+ }
293
+ ... on GiftCardCartItem {
294
+ message
295
+ recipient_email
296
+ recipient_name
297
+ sender_email
298
+ sender_name
299
+ amount {
300
+ currency
301
+ value
302
+ }
303
+ is_available
304
+ }
305
+ }
306
+
307
+ ${e}
308
+ ${_}
309
+ ${a}
310
+ ${r}
311
+ ${i}
312
+ ${n}
313
+ `,c=`
314
+ fragment CART_FRAGMENT on Cart {
315
+ id
316
+ total_quantity
317
+ is_virtual
318
+ applied_gift_cards {
319
+ ...APPLIED_GIFT_CARDS_FRAGMENT
320
+ }
321
+ gift_receipt_included
322
+ printed_card_included
323
+ gift_message {
324
+ ...GIFT_MESSAGE_FRAGMENT
325
+ }
326
+ gift_wrapping {
327
+ ...GIFT_WRAPPING_FRAGMENT
328
+ }
329
+ available_gift_wrappings {
330
+ ...AVAILABLE_GIFT_WRAPPING_FRAGMENT
331
+ }
332
+ prices {
333
+ gift_options {
334
+ gift_wrapping_for_items {
335
+ currency
336
+ value
337
+ }
338
+ gift_wrapping_for_items_incl_tax {
339
+ currency
340
+ value
341
+ }
342
+ gift_wrapping_for_order {
343
+ currency
344
+ value
345
+ }
346
+ gift_wrapping_for_order_incl_tax {
347
+ currency
348
+ value
349
+ }
350
+ printed_card {
351
+ currency
352
+ value
353
+ }
354
+ printed_card_incl_tax {
355
+ currency
356
+ value
357
+ }
358
+ }
359
+ subtotal_with_discount_excluding_tax {
360
+ currency
361
+ value
362
+ }
363
+ subtotal_including_tax {
364
+ currency
365
+ value
366
+ }
367
+ subtotal_excluding_tax {
368
+ currency
369
+ value
370
+ }
371
+ grand_total {
372
+ currency
373
+ value
374
+ }
375
+ grand_total_excluding_tax {
376
+ currency
377
+ value
378
+ }
379
+ applied_taxes {
380
+ label
381
+ amount {
382
+ value
383
+ currency
384
+ }
385
+ }
386
+ discounts {
387
+ amount {
388
+ value
389
+ currency
390
+ }
391
+ label
392
+ coupon {
393
+ code
394
+ }
395
+ applied_to
396
+ }
397
+ }
398
+ applied_coupons {
399
+ code
400
+ }
401
+ itemsV2(
402
+ pageSize: $pageSize
403
+ currentPage: $currentPage
404
+ sort: $itemsSortInput
405
+ ) {
406
+ items {
407
+ ...CART_ITEM_FRAGMENT
408
+ }
409
+ }
410
+ shipping_addresses {
411
+ country {
412
+ code
413
+ }
414
+ region {
415
+ code
416
+ }
417
+ postcode
418
+ }
419
+ }
420
+
421
+ ${u}
422
+ ${t}
423
+ `;export{t as APPLIED_GIFT_CARDS_FRAGMENT,n as AVAILABLE_GIFT_WRAPPING_FRAGMENT,c as CART_FRAGMENT,u as CART_ITEM_FRAGMENT,a as DOWNLOADABLE_CART_ITEMS_FRAGMENT,i as GIFT_MESSAGE_FRAGMENT,r as GIFT_WRAPPING_FRAGMENT};
4
424
  //# sourceMappingURL=fragments.js.map
package/fragments.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"fragments.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"fragments.js","sources":["/@dropins/storefront-cart/src/api/graphql/PriceRangeFragment.ts","/@dropins/storefront-cart/src/api/graphql/CustomizableOptionsFragment.ts","/@dropins/storefront-cart/src/api/graphql/DownloadableCartItemsFragment.ts","/@dropins/storefront-cart/src/api/graphql/GiftFragment.ts","/@dropins/storefront-cart/src/api/graphql/CartItemFragment.ts","/@dropins/storefront-cart/src/api/graphql/CartFragment.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const PRICE_RANGE_FRAGMENT = /* GraphQL */ `\n fragment PRICE_RANGE_FRAGMENT on PriceRange {\n minimum_price {\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 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 * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CUSTOMIZABLE_OPTIONS_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption {\n type\n customizable_option_uid\n label\n is_required\n values {\n label\n value\n price {\n type\n units\n value\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const DOWNLOADABLE_CART_ITEMS_FRAGMENT = /* GraphQL */ `\n fragment DOWNLOADABLE_CART_ITEMS_FRAGMENT on DownloadableCartItem {\n links {\n sort_order\n title\n }\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n`;\n","export 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`;\n\nexport const GIFT_MESSAGE_FRAGMENT = `\n fragment GIFT_MESSAGE_FRAGMENT on GiftMessage {\n __typename\n from\n to\n message\n }\n`;\n\nexport 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`;\n\nexport 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`;\n\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PRICE_RANGE_FRAGMENT } from './PriceRangeFragment';\nimport { CUSTOMIZABLE_OPTIONS_FRAGMENT } from './CustomizableOptionsFragment';\nimport { DOWNLOADABLE_CART_ITEMS_FRAGMENT } from './DownloadableCartItemsFragment';\nimport {\n GIFT_MESSAGE_FRAGMENT,\n GIFT_WRAPPING_FRAGMENT,\n AVAILABLE_GIFT_WRAPPING_FRAGMENT,\n} from './GiftFragment';\n\nexport const CART_ITEM_FRAGMENT = /* GraphQL */ `\n fragment CART_ITEM_FRAGMENT on CartItemInterface {\n __typename\n uid\n quantity\n is_available\n not_available_message\n errors {\n code\n message\n }\n\n prices {\n price {\n value\n currency\n }\n discounts {\n amount {\n value\n currency\n }\n label\n }\n total_item_discount {\n value\n currency\n }\n row_total {\n value\n currency\n }\n row_total_including_tax {\n value\n currency\n }\n price_including_tax {\n value\n currency\n }\n fixed_product_taxes {\n amount {\n value\n currency\n }\n label\n }\n original_item_price {\n value\n currency\n }\n original_row_total {\n value\n currency\n }\n }\n\n product {\n name\n sku\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n quantity\n gift_message_available\n gift_wrapping_available\n gift_wrapping_price {\n currency\n value\n }\n thumbnail {\n url\n label\n }\n url_key\n canonical_url\n categories {\n url_path\n url_key\n name\n }\n custom_attributesV2(filters: { is_visible_on_front: true }) {\n items {\n code\n ... on AttributeValue {\n value\n }\n ... on AttributeSelectedOptions {\n selected_options {\n value\n label\n }\n }\n }\n }\n only_x_left_in_stock\n stock_status\n price_range {\n ...PRICE_RANGE_FRAGMENT\n }\n }\n ... on SimpleCartItem {\n available_gift_wrapping {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n ... on ConfigurableCartItem {\n available_gift_wrapping {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n configurable_options {\n configurable_product_option_uid\n option_label\n value_label\n configurable_product_option_value_uid\n }\n configured_variant {\n uid\n sku\n only_x_left_in_stock\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n ...PRICE_RANGE_FRAGMENT\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n ...DOWNLOADABLE_CART_ITEMS_FRAGMENT\n ... on BundleCartItem {\n available_gift_wrapping {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n bundle_options {\n uid\n label\n values {\n uid\n label\n }\n }\n }\n ... on GiftCardCartItem {\n message\n recipient_email\n recipient_name\n sender_email\n sender_name\n amount {\n currency\n value\n }\n is_available\n }\n }\n\n ${PRICE_RANGE_FRAGMENT}\n ${CUSTOMIZABLE_OPTIONS_FRAGMENT}\n ${DOWNLOADABLE_CART_ITEMS_FRAGMENT}\n ${GIFT_WRAPPING_FRAGMENT}\n ${GIFT_MESSAGE_FRAGMENT}\n ${AVAILABLE_GIFT_WRAPPING_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CART_ITEM_FRAGMENT } from './CartItemFragment';\nimport { APPLIED_GIFT_CARDS_FRAGMENT } from '../fragments';\n\nexport const CART_FRAGMENT = /* GraphQL */ `\n fragment CART_FRAGMENT on Cart {\n id\n total_quantity\n is_virtual\n applied_gift_cards {\n ...APPLIED_GIFT_CARDS_FRAGMENT\n }\n gift_receipt_included\n printed_card_included\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n available_gift_wrappings {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n prices {\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 subtotal_with_discount_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_excluding_tax {\n currency\n value\n }\n grand_total {\n currency\n value\n }\n grand_total_excluding_tax {\n currency\n value\n }\n applied_taxes {\n label\n amount {\n value\n currency\n }\n }\n discounts {\n amount {\n value\n currency\n }\n label\n coupon {\n code\n }\n applied_to\n }\n }\n applied_coupons {\n code\n }\n itemsV2(\n pageSize: $pageSize\n currentPage: $currentPage\n sort: $itemsSortInput\n ) {\n items {\n ...CART_ITEM_FRAGMENT\n }\n }\n shipping_addresses {\n country {\n code\n }\n region {\n code\n }\n postcode\n }\n }\n\n ${CART_ITEM_FRAGMENT}\n ${APPLIED_GIFT_CARDS_FRAGMENT}\n`;\n"],"names":["PRICE_RANGE_FRAGMENT","CUSTOMIZABLE_OPTIONS_FRAGMENT","DOWNLOADABLE_CART_ITEMS_FRAGMENT","APPLIED_GIFT_CARDS_FRAGMENT","GIFT_MESSAGE_FRAGMENT","GIFT_WRAPPING_FRAGMENT","AVAILABLE_GIFT_WRAPPING_FRAGMENT","CART_ITEM_FRAGMENT","CART_FRAGMENT"],"mappings":"AAiBa,MAAAA,EAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECArCC,EAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECA9CC,EAAiD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECjBjDC,EAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgB9BC,EAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASxBC,EAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAezBC,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECdnCC,EAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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