@dropins/storefront-checkout 2.1.0-beta3 → 2.2.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/getCompanyCredit/getCompanyCredit.d.ts +4 -0
- package/api/getCompanyCredit/graphql/getCompanyCredit.graphql.d.ts +18 -0
- package/api/getCompanyCredit/graphql/index.d.ts +18 -0
- package/api/getCompanyCredit/index.d.ts +18 -0
- package/api/graphql/PaymentMethodFragment.graphql.d.ts +1 -1
- package/api/index.d.ts +1 -0
- package/api/initialize/initialize.d.ts +6 -2
- package/api.js +2 -2
- package/api.js.map +1 -1
- package/chunks/PaymentOnAccount2.js +4 -0
- package/chunks/PaymentOnAccount2.js.map +1 -0
- package/chunks/PurchaseOrder.js +4 -0
- package/chunks/PurchaseOrder.js.map +1 -0
- package/chunks/classifiers.js +4 -0
- package/chunks/classifiers.js.map +1 -0
- package/chunks/events.js +1 -1
- package/chunks/events.js.map +1 -1
- package/chunks/events2.js +1 -1
- package/chunks/events2.js.map +1 -1
- package/chunks/fetch-graphql.js +1 -1
- package/chunks/getCompanyCredit.js +15 -0
- package/chunks/getCompanyCredit.js.map +1 -0
- package/chunks/guards.js +1 -1
- package/chunks/render.js +10 -0
- package/chunks/render.js.map +1 -0
- package/chunks/setBillingAddress.js +1 -1
- package/chunks/setGuestEmailOnCart.js +1 -1
- package/chunks/setGuestEmailOnCart.js.map +1 -1
- package/chunks/setShippingAddress.js +1 -1
- package/chunks/setShippingMethods.js +2 -2
- package/chunks/synchronizeCheckout.js +6 -6
- package/chunks/synchronizeCheckout.js.map +1 -1
- package/components/PaymentOnAccount/PaymentOnAccount.d.ts +17 -0
- package/components/PaymentOnAccount/PaymentOnAccountSkeleton.d.ts +4 -0
- package/components/PaymentOnAccount/index.d.ts +20 -0
- package/components/PurchaseOrder/PurchaseOrder.d.ts +10 -0
- package/components/PurchaseOrder/index.d.ts +19 -0
- package/components/index.d.ts +3 -1
- package/containers/AddressValidation.js +1 -1
- package/containers/AddressValidation.js.map +1 -1
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/BillToShippingAddress.js.map +1 -1
- package/containers/EstimateShipping.js +1 -1
- package/containers/EstimateShipping.js.map +1 -1
- package/containers/LoginForm.js +1 -1
- package/containers/LoginForm.js.map +1 -1
- package/containers/MergedCartBanner.js +1 -1
- package/containers/MergedCartBanner.js.map +1 -1
- package/containers/OutOfStock.js +1 -1
- package/containers/OutOfStock.js.map +1 -1
- package/containers/PaymentMethods/PaymentMethods.d.ts +8 -6
- package/containers/PaymentMethods/handlers.d.ts +11 -0
- package/containers/PaymentMethods.js +1 -1
- package/containers/PaymentMethods.js.map +1 -1
- package/containers/PaymentOnAccount/PaymentOnAccount.d.ts +10 -0
- package/containers/PaymentOnAccount/index.d.ts +11 -0
- package/containers/PaymentOnAccount.d.ts +3 -0
- package/containers/PaymentOnAccount.js +4 -0
- package/containers/PaymentOnAccount.js.map +1 -0
- package/containers/PlaceOrder.js +1 -1
- package/containers/PlaceOrder.js.map +1 -1
- package/containers/PurchaseOrder/PurchaseOrder.d.ts +10 -0
- package/containers/PurchaseOrder/index.d.ts +19 -0
- package/containers/PurchaseOrder.d.ts +3 -0
- package/containers/PurchaseOrder.js +4 -0
- package/containers/PurchaseOrder.js.map +1 -0
- package/containers/ServerError/ServerError.d.ts +2 -1
- package/containers/ServerError.js +1 -1
- package/containers/ServerError.js.map +1 -1
- package/containers/ShippingMethods.js +1 -1
- package/containers/ShippingMethods.js.map +1 -1
- package/containers/TermsAndConditions.js +1 -1
- package/containers/TermsAndConditions.js.map +1 -1
- package/containers/index.d.ts +2 -0
- package/data/models/company-credit.d.ts +7 -0
- package/data/models/index.d.ts +1 -0
- package/data/models/payment-method.d.ts +2 -0
- package/data/transforms/index.d.ts +1 -0
- package/data/transforms/transform-cart-address.d.ts +2 -0
- package/data/transforms/transform-company-credit.d.ts +7 -0
- package/data/transforms/transform-quote-address.d.ts +2 -0
- package/fragments.js +8 -7
- package/fragments.js.map +1 -1
- package/i18n/en_US.json.d.ts +20 -0
- package/lib/errors/classifiers.d.ts +3 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/render.js +5 -5
- package/render.js.map +1 -1
- package/tests/fixtures/fragments/cart.d.ts +4 -0
- package/tests/fixtures/helpers/session-storage.d.ts +68 -0
- package/tests/fixtures/index.d.ts +1 -0
- package/tests/fixtures/queries/get-company-credit.d.ts +14 -0
- package/tests/fixtures/queries/index.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShippingMethods.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Delivery.svg","/@dropins/storefront-checkout/src/components/ShippingMethods/ShippingMethodsSkeleton.tsx","/@dropins/storefront-checkout/src/components/ShippingMethods/ShippingMethods.tsx","/@dropins/storefront-checkout/src/containers/ShippingMethods/ShippingMethods.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgDelivery = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.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\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M15.1758 5.87573H19.0019L21.0394 10.7636\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.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\" }), /* @__PURE__ */ React.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\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.08792 7.63574H1.69824\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M7.11229 10.3619H1\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.16084 13.0402H1.92773\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.76172 16.7611H15.2809\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M2.38672 16.7611H5.17025\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgDelivery;\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 { FunctionComponent } from 'preact';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport const ShippingMethodsSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"shipping-methods-skeleton\">\n <SkeletonRow size=\"small\" variant=\"heading\" />\n <SkeletonRow size=\"small\" variant=\"empty\" />\n <SkeletonRow fullWidth={true} size=\"medium\" />\n <SkeletonRow fullWidth={true} size=\"medium\" />\n </Skeleton>\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 { WithConditionals } from '@/checkout/components/ConditionalWrapper/ConditionalWrapper';\nimport '@/checkout/components/ShippingMethods/ShippingMethods.css';\nimport { ShippingMethodsSkeleton } from '@/checkout/components/ShippingMethods/ShippingMethodsSkeleton';\nimport { ShippingMethod } from '@/checkout/data/models';\nimport { scrollToElement } from '@/checkout/lib';\nimport { UIComponentType } from '@/checkout/types';\nimport {\n Icon,\n IllustratedMessage,\n InLineAlert,\n Price,\n RadioButton,\n ToggleButton,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Delivery } from '@adobe-commerce/elsie/icons';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useEffect, useRef } from 'preact/hooks';\n\nexport interface ShippingMethodsProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n UIComponentType?: UIComponentType;\n busy?: boolean;\n error?: string | null;\n onDismissError?: () => void;\n onSelectionChange?: (method: ShippingMethod) => void;\n options: ShippingMethod[];\n selection: ShippingMethod | null;\n title?: VNode;\n}\n\nconst ShippingMethodsComponent: FunctionComponent<ShippingMethodsProps> = ({\n className,\n busy = false,\n onSelectionChange = () => {},\n options,\n selection,\n title,\n UIComponentType = 'RadioButton',\n error = null,\n onDismissError = () => {},\n ...props\n}) => {\n const translations = useText({\n EmptyState: 'Checkout.ShippingMethods.emptyState',\n });\n\n const hasError = error !== null;\n const errorRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (hasError && errorRef.current) {\n scrollToElement(errorRef.current);\n }\n }, [hasError]);\n\n const renderShippingMethod = (\n method: ShippingMethod,\n type: UIComponentType\n ) => {\n const commonProps = {\n busy,\n className: 'checkout-shipping-methods__method',\n key: method.value,\n name: 'shipping-method',\n value: method.value,\n onChange: () => onSelectionChange(method),\n };\n\n if (type === 'RadioButton') {\n return (\n <RadioButton\n {...commonProps}\n checked={selection?.value === method.value}\n data-testid=\"shipping-method-radioButton\"\n description={method.title}\n disabled={busy}\n id={method.value}\n label={\n <>\n <Price\n amount={method.amount.value}\n currency={method.amount.currency}\n />\n \n <span>{method.carrier.title}</span>\n </>\n }\n />\n );\n }\n\n return (\n <ToggleButton\n {...commonProps}\n data-testid=\"shipping-method-toggleButton\"\n label={\n <>\n <span>{method.carrier.title}</span>\n <Price\n amount={method.amount.value}\n currency={method.amount.currency}\n />\n </>\n }\n selected={selection?.value === method.value}\n />\n );\n };\n\n return (\n <div\n {...props}\n className={classes(['checkout-shipping-methods', className])}\n data-testid=\"checkout-shipping-methods\"\n >\n {title && (\n <VComponent className=\"checkout-shipping-methods__title\" node={title} />\n )}\n\n <div className={classes(['checkout-shipping-methods__content'])}>\n <div\n className={classes([\n 'checkout-shipping-methods__options',\n ['checkout-shipping-methods__options--busy', busy],\n [\n 'checkout-shipping-methods__options--toggleButton',\n UIComponentType === 'ToggleButton',\n ],\n ])}\n data-testid=\"checkout-shipping-methods-options\"\n >\n {options.length === 0 ? (\n <IllustratedMessage\n data-testid=\"checkout-shipping-methods-empty\"\n icon={<Icon source={Delivery} />}\n message={<p>{translations.EmptyState}</p>}\n />\n ) : (\n options.map((method: ShippingMethod) =>\n renderShippingMethod(method, UIComponentType)\n )\n )}\n </div>\n </div>\n\n {hasError && (\n <div\n ref={errorRef}\n className=\"checkout-shipping-methods__error\"\n data-testid=\"checkout-shipping-methods-alert\"\n >\n <InLineAlert\n heading={error}\n type=\"error\"\n variant=\"primary\"\n onDismiss={onDismissError}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport const ShippingMethods = WithConditionals(\n ShippingMethodsComponent,\n ShippingMethodsSkeleton\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 { config, setShippingMethods } from '@/checkout/api';\nimport { ShippingMethods as ShippingMethodsComponent } from '@/checkout/components/ShippingMethods';\nimport {\n Cart,\n NegotiableQuote,\n ShippingEstimate,\n ShippingMethod,\n ShippingMethodInput,\n} from '@/checkout/data/models';\nimport { transformShippingEstimateShippingMethod } from '@/checkout/data/transforms';\nimport {\n getLatestCheckoutUpdate,\n getValue,\n hasPendingShippingEstimate,\n hasPendingUpdates,\n hasShippingAddress,\n notifyValues,\n} from '@/checkout/lib';\nimport { Filter, TitleProps, UIComponentType } from '@/checkout/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Container, Slot } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useCallback, useEffect, useMemo, useState } from 'preact/hooks';\n\ninterface CartSyncError {\n method: ShippingMethod;\n error: Error;\n}\n\nexport type ShippingOptionsFilter = Filter<ShippingMethod>;\n\nexport interface ShippingMethodsProps\n extends HTMLAttributes<HTMLDivElement>,\n TitleProps {\n UIComponentType?: UIComponentType;\n active?: boolean;\n autoSync?: boolean;\n onCartSyncError?: (error: CartSyncError) => void;\n onSelectionChange?: (method: ShippingMethod) => void;\n}\n\nfunction isMethodAvailable(\n method: ShippingMethod | null,\n options: ShippingMethod[]\n) {\n if (!method) return false;\n return options.some((option) => isEqual(option, method));\n}\n\nfunction isEqual(a: ShippingMethod | null, b: ShippingMethod | null) {\n if (!a || !b) return false;\n if (a.amount.value !== b.amount.value) return false;\n return a.code === b.code && a.carrier.code === b.carrier.code;\n}\n\nexport function emitShippingEstimateEvent(selection: ShippingMethod) {\n const shippingEstimatedEvent = events.lastPayload('shipping/estimate');\n\n if (!shippingEstimatedEvent) return;\n\n events.emit('shipping/estimate', {\n ...shippingEstimatedEvent,\n shippingMethod: transformShippingEstimateShippingMethod(selection),\n });\n}\n\nexport const ShippingMethods: Container<ShippingMethodsProps> = ({\n UIComponentType = 'RadioButton',\n active = true,\n autoSync = true,\n displayTitle = true,\n initialData,\n slots,\n onCartSyncError,\n onSelectionChange,\n ...props\n}) => {\n const [error, setError] = useState<string | null>(null);\n const [isVirtual, setIsVirtual] = useState(false);\n const [options, setOptions] = useState<ShippingMethod[] | undefined>();\n const [selection, setSelection] = useState<ShippingMethod | null>(null);\n\n const hasQueuedUpdates = hasPendingUpdates.value;\n const hasPendingEstimations = hasPendingShippingEstimate.value;\n\n const { cartSyncError, defaultTitle } = useText({\n cartSyncError: 'Checkout.ShippingMethods.cartSyncError',\n defaultTitle: 'Checkout.ShippingMethods.title',\n });\n\n const filterOptions = useCallback(\n (shippingMethods: ShippingMethod[] | undefined) => {\n if (!shippingMethods || shippingMethods.length === 0) return [];\n const { shipping } = config.getConfig();\n if (!shipping?.filterOptions) return shippingMethods;\n return shippingMethods.filter(shipping.filterOptions);\n },\n []\n );\n\n const preselectOption = useCallback((shippingMethods: ShippingMethod[]) => {\n if (shippingMethods.length === 0) return null;\n const { defaults } = config.getConfig();\n return defaults!.selectedShippingMethod!(shippingMethods);\n }, []);\n\n const filteredOptions = useMemo(() => {\n return filterOptions(options);\n }, [options, filterOptions]);\n\n const handleDismissError = useCallback(() => {\n setError(null);\n }, []);\n\n const setUserSelection = useCallback(\n (shippingMethod: ShippingMethod | null) => {\n setError(null);\n setSelection((prev) => {\n if (isEqual(prev, shippingMethod)) return prev;\n notifyValues({ selectedShippingMethod: shippingMethod });\n return shippingMethod;\n });\n },\n []\n );\n\n const setUserSelectionOnCart = useCallback(\n async (selection: ShippingMethod, fallback?: ShippingMethod | null) => {\n if (!autoSync || !hasShippingAddress()) return;\n\n const shippingMethodInput: ShippingMethodInput = {\n carrierCode: selection.carrier.code,\n methodCode: selection.code,\n };\n\n setShippingMethods([shippingMethodInput]).catch((error) => {\n setUserSelection(fallback ?? null);\n onCartSyncError?.({ method: selection, error });\n\n if (!onCartSyncError) {\n setError(cartSyncError);\n }\n });\n },\n [autoSync, setUserSelection, onCartSyncError, cartSyncError]\n );\n\n const handleSelectionChange = useCallback(\n async (selection: ShippingMethod) => {\n const prevSelection = getValue('selectedShippingMethod');\n\n setUserSelection(selection);\n onSelectionChange?.(selection);\n\n if (!hasShippingAddress()) {\n emitShippingEstimateEvent(selection);\n }\n\n await setUserSelectionOnCart(selection, prevSelection);\n },\n [onSelectionChange, setUserSelection, setUserSelectionOnCart]\n );\n\n const handleCheckoutData = useCallback(\n (data: Cart | NegotiableQuote | null) => {\n const isEmptyCart = !data || data.isEmpty;\n const isVirtualCart = Boolean(data?.isVirtual);\n\n if (isEmptyCart || isVirtualCart) {\n setIsVirtual(isVirtualCart);\n setUserSelection(null);\n setOptions([]);\n return;\n }\n\n const primaryAddress = data!.shippingAddresses?.[0];\n\n // If there is no primary address, options are handled by the shipping estimation\n if (!primaryAddress) return;\n\n const availableOptions = primaryAddress.availableShippingMethods ?? [];\n const filteredOptions = filterOptions(availableOptions);\n setOptions(availableOptions);\n\n // If there are no filtered options, reset the user selection\n if (filteredOptions.length === 0) {\n setUserSelection(null);\n return;\n }\n\n const cartSelection = primaryAddress.selectedShippingMethod ?? null;\n\n const userSelection = getValue('selectedShippingMethod');\n const isAvailable = isMethodAvailable(userSelection, filteredOptions);\n const haveSameSelection = isEqual(userSelection, cartSelection);\n\n // Handle user selection that's available but different from cart\n if (userSelection && isAvailable && !haveSameSelection) {\n setUserSelectionOnCart(userSelection, cartSelection);\n return;\n }\n\n // If no user selection or not available, decide what to do based on cart and filtered options\n if ((!userSelection || !isAvailable) && cartSelection) {\n // Check if cart selection is still available after filtering\n const isCartSelectionAvailable = isMethodAvailable(\n cartSelection,\n filteredOptions\n );\n if (isCartSelectionAvailable) {\n setUserSelection(cartSelection);\n return;\n }\n }\n\n if (\n (!userSelection || !isAvailable) &&\n (!cartSelection || !isMethodAvailable(cartSelection, filteredOptions))\n ) {\n const newSelection = preselectOption(filteredOptions);\n setUserSelection(newSelection);\n if (newSelection) setUserSelectionOnCart(newSelection);\n }\n },\n [filterOptions, preselectOption, setUserSelection, setUserSelectionOnCart]\n );\n\n const handleShippingEstimate = useCallback(\n (estimation: ShippingEstimate | undefined) => {\n if (estimation === undefined) return;\n\n const { shippingMethod, availableShippingMethods } = estimation;\n\n const selectedShippingMethod =\n availableShippingMethods?.find(\n (method) =>\n method.code === shippingMethod?.methodCode &&\n method.carrier.code === shippingMethod?.carrierCode\n ) ?? null;\n\n setOptions(availableShippingMethods);\n setUserSelection(selectedShippingMethod);\n },\n [setUserSelection]\n );\n\n useEffect(() => {\n if (!active) return;\n\n const pastUpdate = getLatestCheckoutUpdate();\n\n if (pastUpdate) {\n // When component becomes active, restore key state so handleCheckoutData can work properly\n const userSelection = getValue('selectedShippingMethod');\n if (userSelection) {\n setSelection(userSelection);\n }\n\n handleCheckoutData(pastUpdate);\n return;\n }\n\n const onCheckoutInit = events.on(\n 'checkout/initialized',\n handleCheckoutData,\n { eager: true }\n );\n\n return () => {\n onCheckoutInit?.off();\n };\n }, [active, handleCheckoutData]);\n\n useEffect(() => {\n if (!active) return;\n\n const onCheckoutUpdated = events.on(\n 'checkout/updated',\n handleCheckoutData,\n { eager: false }\n );\n\n return () => {\n onCheckoutUpdated?.off();\n };\n }, [active, handleCheckoutData]);\n\n useEffect(() => {\n if (!active || hasShippingAddress()) return;\n\n const onShippingEstimate = events.on(\n 'shipping/estimate',\n handleShippingEstimate,\n { eager: true }\n );\n\n return () => {\n onShippingEstimate?.off();\n };\n }, [active, handleShippingEstimate]);\n\n const titleContent = useMemo(() => {\n if (!displayTitle) return undefined;\n\n return (\n <Slot name=\"checkout-shipping-methods-title\" slot={slots?.Title}>\n <h3>{defaultTitle}</h3>\n </Slot>\n );\n }, [displayTitle, slots?.Title, defaultTitle]);\n\n return (\n <ShippingMethodsComponent\n {...props}\n UIComponentType={UIComponentType}\n busy={hasQueuedUpdates || hasPendingEstimations}\n error={error}\n initialized={options !== undefined}\n options={filteredOptions}\n selection={selection}\n title={titleContent}\n visible={active && !isVirtual}\n onDismissError={handleDismissError}\n onSelectionChange={handleSelectionChange}\n />\n );\n};\n"],"names":["SvgDelivery","props","React","ShippingMethodsSkeleton","jsxs","Skeleton","jsx","SkeletonRow","ShippingMethodsComponent","className","busy","onSelectionChange","options","selection","title","UIComponentType","error","onDismissError","translations","useText","hasError","errorRef","useRef","useEffect","scrollToElement","renderShippingMethod","method","type","commonProps","RadioButton","Fragment","Price","ToggleButton","classes","VComponent","IllustratedMessage","Icon","Delivery","InLineAlert","ShippingMethods","WithConditionals","isMethodAvailable","option","isEqual","a","b","emitShippingEstimateEvent","shippingEstimatedEvent","events","transformShippingEstimateShippingMethod","active","autoSync","displayTitle","initialData","slots","onCartSyncError","setError","useState","isVirtual","setIsVirtual","setOptions","setSelection","hasQueuedUpdates","hasPendingUpdates","hasPendingEstimations","hasPendingShippingEstimate","cartSyncError","defaultTitle","filterOptions","useCallback","shippingMethods","shipping","config","preselectOption","defaults","filteredOptions","useMemo","handleDismissError","setUserSelection","shippingMethod","prev","notifyValues","setUserSelectionOnCart","fallback","hasShippingAddress","shippingMethodInput","setShippingMethods","handleSelectionChange","prevSelection","getValue","handleCheckoutData","data","isEmptyCart","isVirtualCart","primaryAddress","_a","availableOptions","cartSelection","userSelection","isAvailable","haveSameSelection","newSelection","handleShippingEstimate","estimation","availableShippingMethods","selectedShippingMethod","pastUpdate","getLatestCheckoutUpdate","onCheckoutInit","onCheckoutUpdated","onShippingEstimate","titleContent","Slot"],"mappings":"ysCACA,MAAMA,GAAeC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,GAAyBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,oEAAqE,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAS,CAAA,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,2CAA4C,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAO,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,iQAAkQ,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAS,CAAA,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,kNAAmN,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAO,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,2BAA4B,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAO,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CA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AAQoD,CAAsB,CAAC,EAE7B,MAAAS,GAAenC,EAAQ,IAAM,CAC7B,GAACxB,EAGH,OAAA9C,EAAC0G,GAAK,CAAA,KAAK,kCAAkC,KAAM1D,GAAA,YAAAA,EAAO,MACxD,SAAAhD,EAAC,KAAI,CAAA,SAAA6D,CAAa,CAAA,EACpB,GAED,CAACf,EAAcE,GAAA,YAAAA,EAAO,MAAOa,CAAY,CAAC,EAG3C,OAAA7D,EAACE,GAAA,CACE,GAAGP,EACJ,gBAAiBc,EACjB,KAAM+C,IAAoBE,GAC1B,MAAAhD,EACA,YAAaJ,IAAY,OACzB,QAAS+D,GACT,UAAA9D,EACA,MAAOkG,GACP,QAAS7D,GAAU,CAACQ,EACpB,eAAgBmB,GAChB,kBAAmBU,EAAA,CACrB,CAEJ","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ShippingMethods.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Delivery.svg","/@dropins/storefront-checkout/src/components/ShippingMethods/ShippingMethodsSkeleton.tsx","/@dropins/storefront-checkout/src/components/ShippingMethods/ShippingMethods.tsx","/@dropins/storefront-checkout/src/containers/ShippingMethods/ShippingMethods.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgDelivery = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.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\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M15.1758 5.87573H19.0019L21.0394 10.7636\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.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\" }), /* @__PURE__ */ React.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\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.08792 7.63574H1.69824\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M7.11229 10.3619H1\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.16084 13.0402H1.92773\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.76172 16.7611H15.2809\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M2.38672 16.7611H5.17025\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgDelivery;\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 { FunctionComponent } from 'preact';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport const ShippingMethodsSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"shipping-methods-skeleton\">\n <SkeletonRow size=\"small\" variant=\"heading\" />\n <SkeletonRow size=\"small\" variant=\"empty\" />\n <SkeletonRow fullWidth={true} size=\"medium\" />\n <SkeletonRow fullWidth={true} size=\"medium\" />\n </Skeleton>\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 { WithConditionals } from '@/checkout/components/ConditionalWrapper/ConditionalWrapper';\nimport '@/checkout/components/ShippingMethods/ShippingMethods.css';\nimport { ShippingMethodsSkeleton } from '@/checkout/components/ShippingMethods/ShippingMethodsSkeleton';\nimport { ShippingMethod } from '@/checkout/data/models';\nimport { scrollToElement } from '@/checkout/lib';\nimport { UIComponentType } from '@/checkout/types';\nimport {\n Icon,\n IllustratedMessage,\n InLineAlert,\n Price,\n RadioButton,\n ToggleButton,\n} from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Delivery } from '@adobe-commerce/elsie/icons';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useEffect, useRef } from 'preact/hooks';\n\nexport interface ShippingMethodsProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n UIComponentType?: UIComponentType;\n busy?: boolean;\n error?: string | null;\n onDismissError?: () => void;\n onSelectionChange?: (method: ShippingMethod) => void;\n options: ShippingMethod[];\n selection: ShippingMethod | null;\n title?: VNode;\n}\n\nconst ShippingMethodsComponent: FunctionComponent<ShippingMethodsProps> = ({\n className,\n busy = false,\n onSelectionChange = () => {},\n options,\n selection,\n title,\n UIComponentType = 'RadioButton',\n error = null,\n onDismissError = () => {},\n ...props\n}) => {\n const translations = useText({\n EmptyState: 'Checkout.ShippingMethods.emptyState',\n });\n\n const hasError = error !== null;\n const errorRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (hasError && errorRef.current) {\n scrollToElement(errorRef.current);\n }\n }, [hasError]);\n\n const renderShippingMethod = (\n method: ShippingMethod,\n type: UIComponentType\n ) => {\n const commonProps = {\n busy,\n className: 'checkout-shipping-methods__method',\n key: method.value,\n name: 'shipping-method',\n value: method.value,\n onChange: () => onSelectionChange(method),\n };\n\n if (type === 'RadioButton') {\n return (\n <RadioButton\n {...commonProps}\n checked={selection?.value === method.value}\n data-testid=\"shipping-method-radioButton\"\n description={method.title}\n disabled={busy}\n id={method.value}\n label={\n <>\n <Price\n amount={method.amount.value}\n currency={method.amount.currency}\n />\n \n <span>{method.carrier.title}</span>\n </>\n }\n />\n );\n }\n\n return (\n <ToggleButton\n {...commonProps}\n data-testid=\"shipping-method-toggleButton\"\n label={\n <>\n <span>{method.carrier.title}</span>\n <Price\n amount={method.amount.value}\n currency={method.amount.currency}\n />\n </>\n }\n selected={selection?.value === method.value}\n />\n );\n };\n\n return (\n <div\n {...props}\n className={classes(['checkout-shipping-methods', className])}\n data-testid=\"checkout-shipping-methods\"\n >\n {title && (\n <VComponent className=\"checkout-shipping-methods__title\" node={title} />\n )}\n\n <div className={classes(['checkout-shipping-methods__content'])}>\n <div\n className={classes([\n 'checkout-shipping-methods__options',\n ['checkout-shipping-methods__options--busy', busy],\n [\n 'checkout-shipping-methods__options--toggleButton',\n UIComponentType === 'ToggleButton',\n ],\n ])}\n data-testid=\"checkout-shipping-methods-options\"\n >\n {options.length === 0 ? (\n <IllustratedMessage\n data-testid=\"checkout-shipping-methods-empty\"\n icon={<Icon source={Delivery} />}\n message={<p>{translations.EmptyState}</p>}\n />\n ) : (\n options.map((method: ShippingMethod) =>\n renderShippingMethod(method, UIComponentType)\n )\n )}\n </div>\n </div>\n\n {hasError && (\n <div\n ref={errorRef}\n className=\"checkout-shipping-methods__error\"\n data-testid=\"checkout-shipping-methods-alert\"\n >\n <InLineAlert\n heading={error}\n type=\"error\"\n variant=\"primary\"\n onDismiss={onDismissError}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport const ShippingMethods = WithConditionals(\n ShippingMethodsComponent,\n ShippingMethodsSkeleton\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 { config, setShippingMethods } from '@/checkout/api';\nimport { ShippingMethods as ShippingMethodsComponent } from '@/checkout/components/ShippingMethods';\nimport {\n Cart,\n NegotiableQuote,\n ShippingEstimate,\n ShippingMethod,\n ShippingMethodInput,\n} from '@/checkout/data/models';\nimport { transformShippingEstimateShippingMethod } from '@/checkout/data/transforms';\nimport {\n getLatestCheckoutUpdate,\n getValue,\n hasPendingShippingEstimate,\n hasPendingUpdates,\n hasShippingAddress,\n notifyValues,\n} from '@/checkout/lib';\nimport { Filter, TitleProps, UIComponentType } from '@/checkout/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Container, Slot } from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { HTMLAttributes } from 'preact/compat';\nimport { useCallback, useEffect, useMemo, useState } from 'preact/hooks';\n\ninterface CartSyncError {\n method: ShippingMethod;\n error: Error;\n}\n\nexport type ShippingOptionsFilter = Filter<ShippingMethod>;\n\nexport interface ShippingMethodsProps\n extends HTMLAttributes<HTMLDivElement>,\n TitleProps {\n UIComponentType?: UIComponentType;\n active?: boolean;\n autoSync?: boolean;\n onCartSyncError?: (error: CartSyncError) => void;\n onSelectionChange?: (method: ShippingMethod) => void;\n}\n\nfunction isMethodAvailable(\n method: ShippingMethod | null,\n options: ShippingMethod[]\n) {\n if (!method) return false;\n return options.some((option) => isEqual(option, method));\n}\n\nfunction isEqual(a: ShippingMethod | null, b: ShippingMethod | null) {\n if (!a || !b) return false;\n if (a.amount.value !== b.amount.value) return false;\n return a.code === b.code && a.carrier.code === b.carrier.code;\n}\n\nexport function emitShippingEstimateEvent(selection: ShippingMethod) {\n const shippingEstimatedEvent = events.lastPayload('shipping/estimate');\n\n if (!shippingEstimatedEvent) return;\n\n events.emit('shipping/estimate', {\n ...shippingEstimatedEvent,\n shippingMethod: transformShippingEstimateShippingMethod(selection),\n });\n}\n\nexport const ShippingMethods: Container<ShippingMethodsProps> = ({\n UIComponentType = 'RadioButton',\n active = true,\n autoSync = true,\n displayTitle = true,\n initialData,\n slots,\n onCartSyncError,\n onSelectionChange,\n ...props\n}) => {\n const [error, setError] = useState<string | null>(null);\n const [isVirtual, setIsVirtual] = useState(false);\n const [options, setOptions] = useState<ShippingMethod[] | undefined>();\n const [selection, setSelection] = useState<ShippingMethod | null>(null);\n\n const hasQueuedUpdates = hasPendingUpdates.value;\n const hasPendingEstimations = hasPendingShippingEstimate.value;\n\n const { cartSyncError, defaultTitle } = useText({\n cartSyncError: 'Checkout.ShippingMethods.cartSyncError',\n defaultTitle: 'Checkout.ShippingMethods.title',\n });\n\n const filterOptions = useCallback(\n (shippingMethods: ShippingMethod[] | undefined) => {\n if (!shippingMethods || shippingMethods.length === 0) return [];\n const { shipping } = config.getConfig();\n if (!shipping?.filterOptions) return shippingMethods;\n return shippingMethods.filter(shipping.filterOptions);\n },\n []\n );\n\n const preselectOption = useCallback((shippingMethods: ShippingMethod[]) => {\n if (shippingMethods.length === 0) return null;\n const { defaults } = config.getConfig();\n return defaults!.selectedShippingMethod!(shippingMethods);\n }, []);\n\n const filteredOptions = useMemo(() => {\n return filterOptions(options);\n }, [options, filterOptions]);\n\n const handleDismissError = useCallback(() => {\n setError(null);\n }, []);\n\n const setUserSelection = useCallback(\n (shippingMethod: ShippingMethod | null) => {\n setError(null);\n setSelection((prev) => {\n if (isEqual(prev, shippingMethod)) return prev;\n notifyValues({ selectedShippingMethod: shippingMethod });\n return shippingMethod;\n });\n },\n []\n );\n\n const setUserSelectionOnCart = useCallback(\n async (selection: ShippingMethod, fallback?: ShippingMethod | null) => {\n if (!autoSync || !hasShippingAddress()) return;\n\n const shippingMethodInput: ShippingMethodInput = {\n carrierCode: selection.carrier.code,\n methodCode: selection.code,\n };\n\n setShippingMethods([shippingMethodInput]).catch((error) => {\n setUserSelection(fallback ?? null);\n onCartSyncError?.({ method: selection, error });\n\n if (!onCartSyncError) {\n setError(cartSyncError);\n }\n });\n },\n [autoSync, setUserSelection, onCartSyncError, cartSyncError]\n );\n\n const handleSelectionChange = useCallback(\n async (selection: ShippingMethod) => {\n const prevSelection = getValue('selectedShippingMethod');\n\n setUserSelection(selection);\n onSelectionChange?.(selection);\n\n if (!hasShippingAddress()) {\n emitShippingEstimateEvent(selection);\n }\n\n await setUserSelectionOnCart(selection, prevSelection);\n },\n [onSelectionChange, setUserSelection, setUserSelectionOnCart]\n );\n\n const handleCheckoutData = useCallback(\n (data: Cart | NegotiableQuote | null) => {\n const isEmptyCart = !data || data.isEmpty;\n const isVirtualCart = Boolean(data?.isVirtual);\n\n if (isEmptyCart || isVirtualCart) {\n setIsVirtual(isVirtualCart);\n setUserSelection(null);\n setOptions([]);\n return;\n }\n\n const primaryAddress = data!.shippingAddresses?.[0];\n\n // If there is no primary address, options are handled by the shipping estimation\n if (!primaryAddress) return;\n\n const availableOptions = primaryAddress.availableShippingMethods ?? [];\n const filteredOptions = filterOptions(availableOptions);\n setOptions(availableOptions);\n\n // If there are no filtered options, reset the user selection\n if (filteredOptions.length === 0) {\n setUserSelection(null);\n return;\n }\n\n const cartSelection = primaryAddress.selectedShippingMethod ?? null;\n\n const userSelection = getValue('selectedShippingMethod');\n const isAvailable = isMethodAvailable(userSelection, filteredOptions);\n const haveSameSelection = isEqual(userSelection, cartSelection);\n\n // Handle user selection that's available but different from cart\n if (userSelection && isAvailable && !haveSameSelection) {\n setUserSelectionOnCart(userSelection, cartSelection);\n return;\n }\n\n // If no user selection or not available, decide what to do based on cart and filtered options\n if ((!userSelection || !isAvailable) && cartSelection) {\n // Check if cart selection is still available after filtering\n const isCartSelectionAvailable = isMethodAvailable(\n cartSelection,\n filteredOptions\n );\n if (isCartSelectionAvailable) {\n setUserSelection(cartSelection);\n return;\n }\n }\n\n if (\n (!userSelection || !isAvailable) &&\n (!cartSelection || !isMethodAvailable(cartSelection, filteredOptions))\n ) {\n const newSelection = preselectOption(filteredOptions);\n setUserSelection(newSelection);\n if (newSelection) setUserSelectionOnCart(newSelection);\n }\n },\n [filterOptions, preselectOption, setUserSelection, setUserSelectionOnCart]\n );\n\n const handleShippingEstimate = useCallback(\n (estimation: ShippingEstimate | undefined) => {\n if (estimation === undefined) return;\n\n const { shippingMethod, availableShippingMethods } = estimation;\n\n const selectedShippingMethod =\n availableShippingMethods?.find(\n (method) =>\n method.code === shippingMethod?.methodCode &&\n method.carrier.code === shippingMethod?.carrierCode\n ) ?? null;\n\n setOptions(availableShippingMethods);\n setUserSelection(selectedShippingMethod);\n },\n [setUserSelection]\n );\n\n useEffect(() => {\n if (!active) return;\n\n const pastUpdate = getLatestCheckoutUpdate();\n\n if (pastUpdate) {\n // When component becomes active, restore key state so handleCheckoutData can work properly\n const userSelection = getValue('selectedShippingMethod');\n if (userSelection) {\n setSelection(userSelection);\n }\n\n handleCheckoutData(pastUpdate);\n return;\n }\n\n const onCheckoutInit = events.on(\n 'checkout/initialized',\n handleCheckoutData,\n { eager: true }\n );\n\n return () => {\n onCheckoutInit?.off();\n };\n }, [active, handleCheckoutData]);\n\n useEffect(() => {\n if (!active) return;\n\n const onCheckoutUpdated = events.on(\n 'checkout/updated',\n handleCheckoutData,\n { eager: false }\n );\n\n return () => {\n onCheckoutUpdated?.off();\n };\n }, [active, handleCheckoutData]);\n\n useEffect(() => {\n if (!active || hasShippingAddress()) return;\n\n const onShippingEstimate = events.on(\n 'shipping/estimate',\n handleShippingEstimate,\n { eager: true }\n );\n\n return () => {\n onShippingEstimate?.off();\n };\n }, [active, handleShippingEstimate]);\n\n const titleContent = useMemo(() => {\n if (!displayTitle) return undefined;\n\n return (\n <Slot name=\"checkout-shipping-methods-title\" slot={slots?.Title}>\n <h3>{defaultTitle}</h3>\n </Slot>\n );\n }, [displayTitle, slots?.Title, defaultTitle]);\n\n return (\n <ShippingMethodsComponent\n {...props}\n UIComponentType={UIComponentType}\n busy={hasQueuedUpdates || hasPendingEstimations}\n error={error}\n initialized={options !== undefined}\n options={filteredOptions}\n selection={selection}\n title={titleContent}\n visible={active && !isVirtual}\n onDismissError={handleDismissError}\n onSelectionChange={handleSelectionChange}\n />\n );\n};\n"],"names":["SvgDelivery","props","React","ShippingMethodsSkeleton","jsxs","Skeleton","jsx","SkeletonRow","ShippingMethodsComponent","className","busy","onSelectionChange","options","selection","title","UIComponentType","error","onDismissError","translations","useText","hasError","errorRef","useRef","useEffect","scrollToElement","renderShippingMethod","method","type","commonProps","RadioButton","Fragment","Price","ToggleButton","classes","VComponent","IllustratedMessage","Icon","Delivery","InLineAlert","ShippingMethods","WithConditionals","isMethodAvailable","option","isEqual","a","b","emitShippingEstimateEvent","shippingEstimatedEvent","events","transformShippingEstimateShippingMethod","active","autoSync","displayTitle","initialData","slots","onCartSyncError","setError","useState","isVirtual","setIsVirtual","setOptions","setSelection","hasQueuedUpdates","hasPendingUpdates","hasPendingEstimations","hasPendingShippingEstimate","cartSyncError","defaultTitle","filterOptions","useCallback","shippingMethods","shipping","config","preselectOption","defaults","filteredOptions","useMemo","handleDismissError","setUserSelection","shippingMethod","prev","notifyValues","setUserSelectionOnCart","fallback","hasShippingAddress","shippingMethodInput","setShippingMethods","handleSelectionChange","prevSelection","getValue","handleCheckoutData","data","isEmptyCart","isVirtualCart","primaryAddress","_a","availableOptions","cartSelection","userSelection","isAvailable","haveSameSelection","newSelection","handleShippingEstimate","estimation","availableShippingMethods","selectedShippingMethod","pastUpdate","getLatestCheckoutUpdate","onCheckoutInit","onCheckoutUpdated","onShippingEstimate","titleContent","Slot"],"mappings":"2uCACA,MAAMA,GAAeC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,GAAyBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,oEAAqE,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAS,CAAA,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,2CAA4C,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAO,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,iQAAkQ,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAS,CAAA,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,kNAAmN,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eA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AC2B,GAAUkC,IAAsB,OAErC,MAAM0B,EAAqB9D,EAAO,GAChC,oBACAsD,EACA,CAAE,MAAO,EAAK,CAChB,EAEA,MAAO,IAAM,CACXQ,GAAA,MAAAA,EAAoB,KACtB,CAAA,EACC,CAAC5D,EAAQoD,CAAsB,CAAC,EAE7B,MAAAS,GAAenC,EAAQ,IAAM,CAC7B,GAACxB,EAGH,OAAA9C,EAAC0G,GAAK,CAAA,KAAK,kCAAkC,KAAM1D,GAAA,YAAAA,EAAO,MACxD,SAAAhD,EAAC,KAAI,CAAA,SAAA6D,CAAa,CAAA,EACpB,GAED,CAACf,EAAcE,GAAA,YAAAA,EAAO,MAAOa,CAAY,CAAC,EAG3C,OAAA7D,EAACE,GAAA,CACE,GAAGP,EACJ,gBAAiBc,EACjB,KAAM+C,IAAoBE,GAC1B,MAAAhD,EACA,YAAaJ,IAAY,OACzB,QAAS+D,GACT,UAAA9D,EACA,MAAOkG,GACP,QAAS7D,GAAU,CAACQ,EACpB,eAAgBmB,GAChB,kBAAmBU,EAAA,CACrB,CAEJ","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e,jsxs as M}from"@dropins/tools/preact-jsx-runtime.js";import{p as v}from"../chunks/TermsAndConditions.js";import{classes as f,VComponent as S,Slot as b}from"@dropins/tools/lib.js";import{Skeleton as N,SkeletonRow as U,Checkbox as w}from"@dropins/tools/components.js";/* empty css
|
|
3
|
+
import{jsx as e,jsxs as M}from"@dropins/tools/preact-jsx-runtime.js";import{p as v}from"../chunks/TermsAndConditions.js";import{classes as f,VComponent as S,Slot as b}from"@dropins/tools/lib.js";import{Skeleton as N,SkeletonRow as U,Checkbox as w}from"@dropins/tools/components.js";/* empty css */import{s as E}from"../chunks/fetch-graphql.js";import{A as V}from"../chunks/checkout.js";import{events as W}from"@dropins/tools/event-bus.js";import{a as j}from"../chunks/events2.js";import"@dropins/tools/preact-compat.js";/* empty css *//* empty css *//* empty css */import{useState as g,useEffect as y}from"@dropins/tools/preact-hooks.js";import{W as D}from"../chunks/ConditionalWrapper.js";import{useText as H,MarkupText as L}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const P=({html:n})=>{const t=v.sanitize(n,{ADD_ATTR:["target"]});return t===""?null:e("span",{dangerouslySetInnerHTML:{__html:t}})},R=()=>e(N,{className:"checkout-terms-and-conditions-skeleton","data-testid":"checkout-terms-and-conditions-skeleton",children:e(U,{fullWidth:!0,size:"small",variant:"row"})}),$=({className:n,agreements:t,error:r,...s})=>e("div",{className:"checkout-terms-and-conditions","data-testid":"checkout-terms-and-conditions",children:M("form",{...s,noValidate:!0,className:f(["checkout-terms-and-conditions__form",n]),"data-testid":"checkout-terms-and-conditions-form",name:"checkout-terms-and-conditions__form",children:[t&&e(S,{className:f(["checkout-terms-and-conditions__agreements"]),"data-testid":"checkout-terms-and-conditions-agreements",node:t}),r&&e("div",{className:"checkout-terms-and-conditions__error","data-testid":"checkout-terms-and-conditions-error",children:r})]})}),q=D($,R),de=({active:n=!0,slots:t,...r})=>{var c;const[s,d]=g(!1),[k,m]=g(""),{errorMessage:_}=H({errorMessage:"Checkout.TermsAndConditions.error"}),i=((c=E.config)==null?void 0:c.agreementsEnabled)===!1,A=()=>{m("")},C=()=>{m(_)};return y(()=>{if(!n||i)return;if(j()){d(!0);return}const o=W.on("checkout/initialized",()=>{d(!0)},{eager:!0});return()=>{o==null||o.off()}},[n,i]),e(q,{...r,agreements:e(b,{context:{appendAgreement(l){this._registerMethod((...o)=>{const u=l(...o);if(!u)return;const{mode:T,name:p,text:a,translationId:h}=u;if(!a&&!h){console.warn(`The agreement ${p} is misconfigured. Please provide a text or a translationId.`);return}const x=a?e(P,{html:a}):e(L,{id:h}),z=e(w,{checked:T===V.AUTO,label:x,name:p,required:!0,onChange:A,onInvalid:C});this._setProps(I=>({children:[...I.children||[],z]}))})}},name:"Agreements",slot:t==null?void 0:t.Agreements}),error:k,initialized:s,visible:n&&!i})};export{de as TermsAndConditions,de as default};
|
|
4
4
|
//# sourceMappingURL=TermsAndConditions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermsAndConditions.js","sources":["/@dropins/storefront-checkout/src/components/Markup/Markup.tsx","/@dropins/storefront-checkout/src/components/TermsAndConditions/TermsAndConditionsSkeleton.tsx","/@dropins/storefront-checkout/src/components/TermsAndConditions/TermsAndConditions.tsx","/@dropins/storefront-checkout/src/containers/TermsAndConditions/TermsAndConditions.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 DOMPurify from 'dompurify';\nimport { FunctionComponent } from 'preact';\n\ninterface MarkupProps {\n html: string;\n}\n\nexport const Markup: FunctionComponent<MarkupProps> = ({ html }) => {\n const sanitizedHtml = DOMPurify.sanitize(html, { ADD_ATTR: ['target'] });\n if (sanitizedHtml === '') return null;\n // eslint-disable-next-line react/no-danger\n return <span dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;\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 { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { FunctionComponent } from 'preact';\n\nexport const TermsAndConditionsSkeleton: FunctionComponent = () => {\n return (\n <Skeleton\n className=\"checkout-terms-and-conditions-skeleton\"\n data-testid=\"checkout-terms-and-conditions-skeleton\"\n >\n <SkeletonRow fullWidth={true} size=\"small\" variant=\"row\" />\n </Skeleton>\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 { WithConditionals } from '@/checkout/components';\nimport '@/checkout/components/TermsAndConditions/TermsAndConditions.css';\nimport { TermsAndConditionsSkeleton } from '@/checkout/components/TermsAndConditions/TermsAndConditionsSkeleton';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\n\nexport interface TermsAndConditionsProps\n extends HTMLAttributes<HTMLFormElement> {\n agreements?: VNode;\n error?: string;\n}\n\nconst TermsAndConditionsComponent: FunctionComponent<\n TermsAndConditionsProps\n> = ({ className, agreements, error, ...props }) => {\n return (\n <div\n className=\"checkout-terms-and-conditions\"\n data-testid=\"checkout-terms-and-conditions\"\n >\n <form\n {...props}\n noValidate\n className={classes(['checkout-terms-and-conditions__form', className])}\n data-testid=\"checkout-terms-and-conditions-form\"\n name=\"checkout-terms-and-conditions__form\"\n >\n {agreements && (\n <VComponent\n className={classes(['checkout-terms-and-conditions__agreements'])}\n data-testid=\"checkout-terms-and-conditions-agreements\"\n node={agreements}\n />\n )}\n\n {error && (\n <div\n className=\"checkout-terms-and-conditions__error\"\n data-testid=\"checkout-terms-and-conditions-error\"\n >\n {error}\n </div>\n )}\n </form>\n </div>\n );\n};\n\nexport const TermsAndConditions = WithConditionals(\n TermsAndConditionsComponent,\n TermsAndConditionsSkeleton\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 { Markup } from '@/checkout/components';\nimport { TermsAndConditions as TermsAndConditionsComponent } from '@/checkout/components/TermsAndConditions';\nimport { AgreementMode } from '@/checkout/data/models';\nimport { getLatestCheckoutUpdate, state } from '@/checkout/lib';\nimport { Checkbox } from '@adobe-commerce/elsie/components';\nimport { MarkupText, useText } from '@adobe-commerce/elsie/i18n';\nimport {\n Container,\n Slot,\n SlotMethod,\n SlotProps,\n} from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { useEffect, useState } from 'preact/hooks';\n\nexport interface TermsAndConditionsProps {\n active?: boolean;\n slots?: {\n Agreements?: SlotProps<{\n appendAgreement: SlotMethod<{\n name: string;\n mode: AgreementMode;\n translationId?: string;\n text?: string;\n }>;\n }>;\n };\n}\n\nexport const TermsAndConditions: Container<TermsAndConditionsProps> = ({\n active = true,\n slots,\n ...props\n}) => {\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<string>('');\n\n const { errorMessage } = useText({\n errorMessage: 'Checkout.TermsAndConditions.error',\n });\n\n const disabledViaConfig = state.config?.agreementsEnabled === false;\n\n const handleChange = () => {\n setError('');\n };\n\n const handleInvalid = () => {\n setError(errorMessage);\n };\n\n useEffect(() => {\n if (!active || disabledViaConfig) return;\n\n const pastUpdate = getLatestCheckoutUpdate();\n\n if (pastUpdate) {\n setIsInitialized(true);\n return;\n }\n\n const onCheckoutInit = events.on(\n 'checkout/initialized',\n () => {\n setIsInitialized(true);\n },\n { eager: true }\n );\n return () => {\n onCheckoutInit?.off();\n };\n }, [active, disabledViaConfig]);\n\n return (\n <TermsAndConditionsComponent\n {...props}\n agreements={\n <Slot\n context={{\n appendAgreement(callback) {\n this._registerMethod((...attrs) => {\n const _agreement = callback(...attrs);\n\n if (!_agreement) return;\n\n const { mode, name, text, translationId } = _agreement;\n\n if (!text && !translationId) {\n console.warn(\n `The agreement ${name} is misconfigured. Please provide a text or a translationId.`\n );\n return;\n }\n\n const label = text ? (\n <Markup html={text} />\n ) : (\n <MarkupText id={translationId!} />\n );\n\n const agreement = (\n <Checkbox\n checked={mode === AgreementMode.AUTO}\n label={label}\n name={name}\n required={true}\n onChange={handleChange}\n onInvalid={handleInvalid}\n />\n );\n\n this._setProps((prev: any) => ({\n children: [...(prev.children || []), agreement],\n }));\n });\n },\n }}\n name=\"Agreements\"\n slot={slots?.Agreements}\n />\n }\n error={error}\n initialized={isInitialized}\n visible={active && !disabledViaConfig}\n />\n );\n};\n"],"names":["Markup","html","sanitizedHtml","DOMPurify","TermsAndConditionsSkeleton","jsx","Skeleton","SkeletonRow","TermsAndConditionsComponent","className","agreements","error","props","jsxs","classes","VComponent","TermsAndConditions","WithConditionals","active","slots","isInitialized","setIsInitialized","useState","setError","errorMessage","useText","disabledViaConfig","_a","state","handleChange","handleInvalid","useEffect","getLatestCheckoutUpdate","onCheckoutInit","events","Slot","callback","attrs","_agreement","mode","name","text","translationId","label","MarkupText","agreement","Checkbox","AgreementMode","prev"],"mappings":"o5BAwBO,MAAMA,EAAyC,CAAC,CAAE,KAAAC,KAAW,CAC5D,MAAAC,EAAgBC,EAAU,SAASF,EAAM,CAAE,SAAU,CAAC,QAAQ,EAAG,EACnE,OAAAC,IAAkB,GAAW,OAEzB,OAAK,CAAA,wBAAyB,CAAE,OAAQA,GAAiB,CACnE,ECTaE,EAAgD,IAE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MAAO,IAAM,CACXY,GAAA,MAAAA,EAAgB,KAClB,CAAA,EACC,CAACf,EAAQQ,CAAiB,CAAC,EAG5BrB,EAACG,EAAA,CACE,GAAGI,EACJ,WACEP,EAAC8B,EAAA,CACC,QAAS,CACP,gBAAgBC,EAAU,CACnB,KAAA,gBAAgB,IAAIC,IAAU,CAC3B,MAAAC,EAAaF,EAAS,GAAGC,CAAK,EAEpC,GAAI,CAACC,EAAY,OAEjB,KAAM,CAAE,KAAAC,EAAM,KAAAC,EAAM,KAAAC,EAAM,cAAAC,CAAkB,EAAAJ,EAExC,GAAA,CAACG,GAAQ,CAACC,EAAe,CACnB,QAAA,KACN,iBAAiBF,CAAI,8DACvB,EACA,MAAA,CAGI,MAAAG,EAAQF,EACZpC,EAACL,EAAO,CAAA,KAAMyC,CAAM,CAAA,EAEpBpC,EAACuC,EAAW,CAAA,GAAIF,CAAgB,CAAA,EAG5BG,EACJxC,EAACyC,EAAA,CACC,QAASP,IAASQ,EAAc,KAChC,MAAAJ,EACA,KAAAH,EACA,SAAU,GACV,SAAUX,EACV,UAAWC,CAAA,CACb,EAGG,KAAA,UAAWkB,IAAe,CAC7B,SAAU,CAAC,GAAIA,EAAK,UAAY,GAAKH,CAAS,CAAA,EAC9C,CAAA,CACH,CAAA,CAEL,EACA,KAAK,aACL,KAAM1B,GAAA,YAAAA,EAAO,UAAA,CACf,EAEF,MAAAR,EACA,YAAaS,EACb,QAASF,GAAU,CAACQ,CAAA,CACtB,CAEJ"}
|
|
1
|
+
{"version":3,"file":"TermsAndConditions.js","sources":["/@dropins/storefront-checkout/src/components/Markup/Markup.tsx","/@dropins/storefront-checkout/src/components/TermsAndConditions/TermsAndConditionsSkeleton.tsx","/@dropins/storefront-checkout/src/components/TermsAndConditions/TermsAndConditions.tsx","/@dropins/storefront-checkout/src/containers/TermsAndConditions/TermsAndConditions.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 DOMPurify from 'dompurify';\nimport { FunctionComponent } from 'preact';\n\ninterface MarkupProps {\n html: string;\n}\n\nexport const Markup: FunctionComponent<MarkupProps> = ({ html }) => {\n const sanitizedHtml = DOMPurify.sanitize(html, { ADD_ATTR: ['target'] });\n if (sanitizedHtml === '') return null;\n // eslint-disable-next-line react/no-danger\n return <span dangerouslySetInnerHTML={{ __html: sanitizedHtml }} />;\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 { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { FunctionComponent } from 'preact';\n\nexport const TermsAndConditionsSkeleton: FunctionComponent = () => {\n return (\n <Skeleton\n className=\"checkout-terms-and-conditions-skeleton\"\n data-testid=\"checkout-terms-and-conditions-skeleton\"\n >\n <SkeletonRow fullWidth={true} size=\"small\" variant=\"row\" />\n </Skeleton>\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 { WithConditionals } from '@/checkout/components';\nimport '@/checkout/components/TermsAndConditions/TermsAndConditions.css';\nimport { TermsAndConditionsSkeleton } from '@/checkout/components/TermsAndConditions/TermsAndConditionsSkeleton';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\n\nexport interface TermsAndConditionsProps\n extends HTMLAttributes<HTMLFormElement> {\n agreements?: VNode;\n error?: string;\n}\n\nconst TermsAndConditionsComponent: FunctionComponent<\n TermsAndConditionsProps\n> = ({ className, agreements, error, ...props }) => {\n return (\n <div\n className=\"checkout-terms-and-conditions\"\n data-testid=\"checkout-terms-and-conditions\"\n >\n <form\n {...props}\n noValidate\n className={classes(['checkout-terms-and-conditions__form', className])}\n data-testid=\"checkout-terms-and-conditions-form\"\n name=\"checkout-terms-and-conditions__form\"\n >\n {agreements && (\n <VComponent\n className={classes(['checkout-terms-and-conditions__agreements'])}\n data-testid=\"checkout-terms-and-conditions-agreements\"\n node={agreements}\n />\n )}\n\n {error && (\n <div\n className=\"checkout-terms-and-conditions__error\"\n data-testid=\"checkout-terms-and-conditions-error\"\n >\n {error}\n </div>\n )}\n </form>\n </div>\n );\n};\n\nexport const TermsAndConditions = WithConditionals(\n TermsAndConditionsComponent,\n TermsAndConditionsSkeleton\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 { Markup } from '@/checkout/components';\nimport { TermsAndConditions as TermsAndConditionsComponent } from '@/checkout/components/TermsAndConditions';\nimport { AgreementMode } from '@/checkout/data/models';\nimport { getLatestCheckoutUpdate, state } from '@/checkout/lib';\nimport { Checkbox } from '@adobe-commerce/elsie/components';\nimport { MarkupText, useText } from '@adobe-commerce/elsie/i18n';\nimport {\n Container,\n Slot,\n SlotMethod,\n SlotProps,\n} from '@adobe-commerce/elsie/lib';\nimport { events } from '@adobe-commerce/event-bus';\nimport { useEffect, useState } from 'preact/hooks';\n\nexport interface TermsAndConditionsProps {\n active?: boolean;\n slots?: {\n Agreements?: SlotProps<{\n appendAgreement: SlotMethod<{\n name: string;\n mode: AgreementMode;\n translationId?: string;\n text?: string;\n }>;\n }>;\n };\n}\n\nexport const TermsAndConditions: Container<TermsAndConditionsProps> = ({\n active = true,\n slots,\n ...props\n}) => {\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<string>('');\n\n const { errorMessage } = useText({\n errorMessage: 'Checkout.TermsAndConditions.error',\n });\n\n const disabledViaConfig = state.config?.agreementsEnabled === false;\n\n const handleChange = () => {\n setError('');\n };\n\n const handleInvalid = () => {\n setError(errorMessage);\n };\n\n useEffect(() => {\n if (!active || disabledViaConfig) return;\n\n const pastUpdate = getLatestCheckoutUpdate();\n\n if (pastUpdate) {\n setIsInitialized(true);\n return;\n }\n\n const onCheckoutInit = events.on(\n 'checkout/initialized',\n () => {\n setIsInitialized(true);\n },\n { eager: true }\n );\n return () => {\n onCheckoutInit?.off();\n };\n }, [active, disabledViaConfig]);\n\n return (\n <TermsAndConditionsComponent\n {...props}\n agreements={\n <Slot\n context={{\n appendAgreement(callback) {\n this._registerMethod((...attrs) => {\n const _agreement = callback(...attrs);\n\n if (!_agreement) return;\n\n const { mode, name, text, translationId } = _agreement;\n\n if (!text && !translationId) {\n console.warn(\n `The agreement ${name} is misconfigured. Please provide a text or a translationId.`\n );\n return;\n }\n\n const label = text ? (\n <Markup html={text} />\n ) : (\n <MarkupText id={translationId!} />\n );\n\n const agreement = (\n <Checkbox\n checked={mode === AgreementMode.AUTO}\n label={label}\n name={name}\n required={true}\n onChange={handleChange}\n onInvalid={handleInvalid}\n />\n );\n\n this._setProps((prev: any) => ({\n children: [...(prev.children || []), agreement],\n }));\n });\n },\n }}\n name=\"Agreements\"\n slot={slots?.Agreements}\n />\n }\n error={error}\n initialized={isInitialized}\n visible={active && !disabledViaConfig}\n />\n );\n};\n"],"names":["Markup","html","sanitizedHtml","DOMPurify","TermsAndConditionsSkeleton","jsx","Skeleton","SkeletonRow","TermsAndConditionsComponent","className","agreements","error","props","jsxs","classes","VComponent","TermsAndConditions","WithConditionals","active","slots","isInitialized","setIsInitialized","useState","setError","errorMessage","useText","disabledViaConfig","_a","state","handleChange","handleInvalid","useEffect","getLatestCheckoutUpdate","onCheckoutInit","events","Slot","callback","attrs","_agreement","mode","name","text","translationId","label","MarkupText","agreement","Checkbox","AgreementMode","prev"],"mappings":"u5BAwBO,MAAMA,EAAyC,CAAC,CAAE,KAAAC,KAAW,CAC5D,MAAAC,EAAgBC,EAAU,SAASF,EAAM,CAAE,SAAU,CAAC,QAAQ,EAAG,EACnE,OAAAC,IAAkB,GAAW,OAEzB,OAAK,CAAA,wBAAyB,CAAE,OAAQA,GAAiB,CACnE,ECTaE,EAAgD,IAEzDC,EAACC,EAAA,CACC,UAAU,yCACV,cAAY,yCAEZ,WAACC,EAAY,CAAA,UAAW,GAAM,KAAK,QAAQ,QAAQ,KAAM,CAAA,CAAA,CAC3D,ECGEC,EAEF,CAAC,CAAE,UAAAC,EAAW,WAAAC,EAAY,MAAAC,EAAO,GAAGC,KAEpCP,EAAC,MAAA,CACC,UAAU,gCACV,cAAY,gCAEZ,SAAAQ,EAAC,OAAA,CACE,GAAGD,EACJ,WAAU,GACV,UAAWE,EAAQ,CAAC,sCAAuCL,CAAS,CAAC,EACrE,cAAY,qCACZ,KAAK,sCAEJ,SAAA,CACCC,GAAAL,EAACU,EAAA,CACC,UAAWD,EAAQ,CAAC,2CAA2C,CAAC,EAChE,cAAY,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,EAAQF,EACZpC,EAACL,EAAO,CAAA,KAAMyC,CAAM,CAAA,EAEpBpC,EAACuC,EAAW,CAAA,GAAIF,CAAgB,CAAA,EAG5BG,EACJxC,EAACyC,EAAA,CACC,QAASP,IAASQ,EAAc,KAChC,MAAAJ,EACA,KAAAH,EACA,SAAU,GACV,SAAUX,EACV,UAAWC,CAAA,CACb,EAGG,KAAA,UAAWkB,IAAe,CAC7B,SAAU,CAAC,GAAIA,EAAK,UAAY,GAAKH,CAAS,CAAA,EAC9C,CAAA,CACH,CAAA,CAEL,EACA,KAAK,aACL,KAAM1B,GAAA,YAAAA,EAAO,UAAA,CACf,EAEF,MAAAR,EACA,YAAaS,EACb,QAASF,GAAU,CAACQ,CAAA,CACtB,CAEJ"}
|
package/containers/index.d.ts
CHANGED
|
@@ -22,7 +22,9 @@ export * from './MergedCartBanner';
|
|
|
22
22
|
export * from './OutOfStock';
|
|
23
23
|
export * from './PaymentMethods';
|
|
24
24
|
export * from './PlaceOrder';
|
|
25
|
+
export * from './PurchaseOrder';
|
|
25
26
|
export * from './ServerError';
|
|
26
27
|
export * from './ShippingMethods';
|
|
27
28
|
export * from './TermsAndConditions';
|
|
29
|
+
export * from './PaymentOnAccount';
|
|
28
30
|
//# sourceMappingURL=index.d.ts.map
|
package/data/models/index.d.ts
CHANGED
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
+
export type AdditionalData = Record<string, unknown>;
|
|
17
18
|
export type PaymentMethod = {
|
|
18
19
|
code: string;
|
|
19
20
|
title: string;
|
|
21
|
+
additionalData?: AdditionalData;
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=payment-method.d.ts.map
|
|
@@ -18,6 +18,7 @@ export * from './transform-api';
|
|
|
18
18
|
export * from './transform-custom-attributes';
|
|
19
19
|
export * from './transform-cart';
|
|
20
20
|
export * from './transform-cart-address';
|
|
21
|
+
export * from './transform-company-credit';
|
|
21
22
|
export * from './transform-quote-address';
|
|
22
23
|
export * from './transform-checkout-agreements';
|
|
23
24
|
export * from './transform-country';
|
|
@@ -51,6 +51,8 @@ declare const transformCartShippingAddress: (data: ({
|
|
|
51
51
|
label: string;
|
|
52
52
|
};
|
|
53
53
|
custom_attributes: ({
|
|
54
|
+
__typename?: "AttributeFile" | undefined;
|
|
55
|
+
} | {
|
|
54
56
|
__typename?: "AttributeSelectedOptions" | undefined;
|
|
55
57
|
} | {
|
|
56
58
|
__typename?: "AttributeValue" | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CompanyCredit as CompanyCreditModel } from '../models';
|
|
2
|
+
import { CompanyCredit as CompanyCreditType } from '../../__generated__/types';
|
|
3
|
+
|
|
4
|
+
type OptionalCompanyCredit = CompanyCreditType | null | undefined;
|
|
5
|
+
declare const transformCompanyCredit: (data: OptionalCompanyCredit) => CompanyCreditModel | null;
|
|
6
|
+
export { transformCompanyCredit };
|
|
7
|
+
//# sourceMappingURL=transform-company-credit.d.ts.map
|
|
@@ -49,6 +49,8 @@ declare const transformQuoteShippingAddress: (data: ({
|
|
|
49
49
|
label: string;
|
|
50
50
|
};
|
|
51
51
|
custom_attributes?: ({
|
|
52
|
+
__typename?: "AttributeFile" | undefined;
|
|
53
|
+
} | {
|
|
52
54
|
__typename?: "AttributeSelectedOptions" | undefined;
|
|
53
55
|
} | {
|
|
54
56
|
__typename?: "AttributeValue" | undefined;
|
package/fragments.js
CHANGED
|
@@ -122,8 +122,9 @@ const e=`
|
|
|
122
122
|
fragment SELECTED_PAYMENT_METHOD_FRAGMENT on SelectedPaymentMethod {
|
|
123
123
|
code
|
|
124
124
|
title
|
|
125
|
+
purchase_order_number
|
|
125
126
|
}
|
|
126
|
-
`,
|
|
127
|
+
`,A=`
|
|
127
128
|
fragment CHECKOUT_DATA_FRAGMENT on Cart {
|
|
128
129
|
id
|
|
129
130
|
is_virtual
|
|
@@ -147,13 +148,13 @@ const e=`
|
|
|
147
148
|
${i}
|
|
148
149
|
${_}
|
|
149
150
|
${E}
|
|
150
|
-
`,
|
|
151
|
+
`,r=`
|
|
151
152
|
fragment CUSTOMER_FRAGMENT on Customer {
|
|
152
153
|
firstname
|
|
153
154
|
lastname
|
|
154
155
|
email
|
|
155
156
|
}
|
|
156
|
-
`,
|
|
157
|
+
`,n=`
|
|
157
158
|
fragment NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT on NegotiableQuoteBillingAddress {
|
|
158
159
|
city
|
|
159
160
|
company
|
|
@@ -184,7 +185,7 @@ const e=`
|
|
|
184
185
|
uid
|
|
185
186
|
vat_id
|
|
186
187
|
}
|
|
187
|
-
`,
|
|
188
|
+
`,o=`
|
|
188
189
|
fragment NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT on NegotiableQuoteShippingAddress {
|
|
189
190
|
available_shipping_methods {
|
|
190
191
|
...AVAILABLE_SHIPPING_METHOD_FRAGMENT
|
|
@@ -224,7 +225,7 @@ const e=`
|
|
|
224
225
|
|
|
225
226
|
${e}
|
|
226
227
|
${t}
|
|
227
|
-
`,
|
|
228
|
+
`,T=`
|
|
228
229
|
fragment NEGOTIABLE_QUOTE_FRAGMENT on NegotiableQuote {
|
|
229
230
|
available_payment_methods {
|
|
230
231
|
...AVAILABLE_PAYMENT_METHOD_FRAGMENT
|
|
@@ -246,9 +247,9 @@ const e=`
|
|
|
246
247
|
uid
|
|
247
248
|
}
|
|
248
249
|
|
|
249
|
-
${A}
|
|
250
250
|
${n}
|
|
251
|
+
${o}
|
|
251
252
|
${_}
|
|
252
253
|
${E}
|
|
253
|
-
`;export{_ as AVAILABLE_PAYMENT_METHOD_FRAGMENT,e as AVAILABLE_SHIPPING_METHOD_FRAGMENT,a as BILLING_CART_ADDRESS_FRAGMENT,
|
|
254
|
+
`;export{_ as AVAILABLE_PAYMENT_METHOD_FRAGMENT,e as AVAILABLE_SHIPPING_METHOD_FRAGMENT,a as BILLING_CART_ADDRESS_FRAGMENT,A as CHECKOUT_DATA_FRAGMENT,r as CUSTOMER_FRAGMENT,n as NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT,T as NEGOTIABLE_QUOTE_FRAGMENT,o as NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT,E as SELECTED_PAYMENT_METHOD_FRAGMENT,t as SELECTED_SHIPPING_METHOD_FRAGMENT,i as SHIPPING_CART_ADDRESS_FRAGMENT};
|
|
254
255
|
//# sourceMappingURL=fragments.js.map
|
package/fragments.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragments.js","sources":["/@dropins/storefront-checkout/src/api/graphql/ShippingMethodFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/CartAddressFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/PaymentMethodFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/CheckoutDataFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/CustomerFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/NegotiableQuoteAddressFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/NegotiableQuoteFragment.graphql.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 AVAILABLE_SHIPPING_METHOD_FRAGMENT = /* GraphQL */ `\n fragment AVAILABLE_SHIPPING_METHOD_FRAGMENT on AvailableShippingMethod {\n amount {\n currency\n value\n }\n carrier_code\n carrier_title\n error_message\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n`;\n\nexport const SELECTED_SHIPPING_METHOD_FRAGMENT = /* GraphQL */ `\n fragment SELECTED_SHIPPING_METHOD_FRAGMENT on SelectedShippingMethod {\n amount {\n currency\n value\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\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 {\n AVAILABLE_SHIPPING_METHOD_FRAGMENT,\n SELECTED_SHIPPING_METHOD_FRAGMENT,\n} from './ShippingMethodFragment.graphql';\n\nexport const BILLING_CART_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment BILLING_CART_ADDRESS_FRAGMENT on BillingCartAddress {\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n id\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n`;\n\nexport const SHIPPING_CART_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment SHIPPING_CART_ADDRESS_FRAGMENT on ShippingCartAddress {\n available_shipping_methods {\n ...AVAILABLE_SHIPPING_METHOD_FRAGMENT\n }\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n id\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n same_as_billing\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n\n ${AVAILABLE_SHIPPING_METHOD_FRAGMENT}\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 AVAILABLE_PAYMENT_METHOD_FRAGMENT = /* GraphQL */ `\n fragment AVAILABLE_PAYMENT_METHOD_FRAGMENT on AvailablePaymentMethod {\n code\n title\n }\n`;\n\nexport const SELECTED_PAYMENT_METHOD_FRAGMENT = /* GraphQL */ `\n fragment SELECTED_PAYMENT_METHOD_FRAGMENT on SelectedPaymentMethod {\n code\n title\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 {\n BILLING_CART_ADDRESS_FRAGMENT,\n SHIPPING_CART_ADDRESS_FRAGMENT,\n} from './CartAddressFragment.graphql';\nimport {\n AVAILABLE_PAYMENT_METHOD_FRAGMENT,\n SELECTED_PAYMENT_METHOD_FRAGMENT,\n} from './PaymentMethodFragment.graphql';\n\nexport const CHECKOUT_DATA_FRAGMENT = /* GraphQL */ `\n fragment CHECKOUT_DATA_FRAGMENT on Cart {\n id\n is_virtual\n email\n total_quantity\n billing_address {\n ...BILLING_CART_ADDRESS_FRAGMENT\n }\n shipping_addresses {\n ...SHIPPING_CART_ADDRESS_FRAGMENT\n }\n available_payment_methods {\n ...AVAILABLE_PAYMENT_METHOD_FRAGMENT\n }\n selected_payment_method {\n ...SELECTED_PAYMENT_METHOD_FRAGMENT\n }\n }\n\n ${BILLING_CART_ADDRESS_FRAGMENT}\n ${SHIPPING_CART_ADDRESS_FRAGMENT}\n ${AVAILABLE_PAYMENT_METHOD_FRAGMENT}\n ${SELECTED_PAYMENT_METHOD_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\nexport const CUSTOMER_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMER_FRAGMENT on Customer {\n firstname\n lastname\n email\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 AVAILABLE_SHIPPING_METHOD_FRAGMENT,\n SELECTED_SHIPPING_METHOD_FRAGMENT,\n} from './ShippingMethodFragment.graphql';\n\nexport const NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT on NegotiableQuoteBillingAddress {\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n`;\n\nexport const NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT on NegotiableQuoteShippingAddress {\n available_shipping_methods {\n ...AVAILABLE_SHIPPING_METHOD_FRAGMENT\n }\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n\n ${AVAILABLE_SHIPPING_METHOD_FRAGMENT}\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT,\n NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT,\n} from './NegotiableQuoteAddressFragment.graphql';\n\nimport {\n AVAILABLE_PAYMENT_METHOD_FRAGMENT,\n SELECTED_PAYMENT_METHOD_FRAGMENT,\n} from './PaymentMethodFragment.graphql';\n\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_FRAGMENT on NegotiableQuote {\n available_payment_methods {\n ...AVAILABLE_PAYMENT_METHOD_FRAGMENT\n }\n billing_address {\n ...NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT\n }\n email\n is_virtual\n name\n selected_payment_method {\n ...SELECTED_PAYMENT_METHOD_FRAGMENT\n }\n shipping_addresses {\n ...NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT\n }\n status\n total_quantity\n uid\n }\n\n ${NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT}\n ${NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT}\n ${AVAILABLE_PAYMENT_METHOD_FRAGMENT}\n ${SELECTED_PAYMENT_METHOD_FRAGMENT}\n`;\n"],"names":["AVAILABLE_SHIPPING_METHOD_FRAGMENT","SELECTED_SHIPPING_METHOD_FRAGMENT","BILLING_CART_ADDRESS_FRAGMENT","SHIPPING_CART_ADDRESS_FRAGMENT","AVAILABLE_PAYMENT_METHOD_FRAGMENT","SELECTED_PAYMENT_METHOD_FRAGMENT","CHECKOUT_DATA_FRAGMENT","CUSTOMER_FRAGMENT","NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT","NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT","NEGOTIABLE_QUOTE_FRAGMENT"],"mappings":"AAiBa,MAAAA,EAAmD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBnDC,EAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECjBlDC,EAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAsBnDF,CAAyC;AAAA,IACzCC,CAA0C;AAAA,IAC1CL,CAAiC;AAAA,IACjCC,CAAgC;"}
|
|
1
|
+
{"version":3,"file":"fragments.js","sources":["/@dropins/storefront-checkout/src/api/graphql/ShippingMethodFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/CartAddressFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/PaymentMethodFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/CheckoutDataFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/CustomerFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/NegotiableQuoteAddressFragment.graphql.ts","/@dropins/storefront-checkout/src/api/graphql/NegotiableQuoteFragment.graphql.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 AVAILABLE_SHIPPING_METHOD_FRAGMENT = /* GraphQL */ `\n fragment AVAILABLE_SHIPPING_METHOD_FRAGMENT on AvailableShippingMethod {\n amount {\n currency\n value\n }\n carrier_code\n carrier_title\n error_message\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n`;\n\nexport const SELECTED_SHIPPING_METHOD_FRAGMENT = /* GraphQL */ `\n fragment SELECTED_SHIPPING_METHOD_FRAGMENT on SelectedShippingMethod {\n amount {\n currency\n value\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\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 {\n AVAILABLE_SHIPPING_METHOD_FRAGMENT,\n SELECTED_SHIPPING_METHOD_FRAGMENT,\n} from './ShippingMethodFragment.graphql';\n\nexport const BILLING_CART_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment BILLING_CART_ADDRESS_FRAGMENT on BillingCartAddress {\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n id\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n`;\n\nexport const SHIPPING_CART_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment SHIPPING_CART_ADDRESS_FRAGMENT on ShippingCartAddress {\n available_shipping_methods {\n ...AVAILABLE_SHIPPING_METHOD_FRAGMENT\n }\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n id\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n same_as_billing\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n\n ${AVAILABLE_SHIPPING_METHOD_FRAGMENT}\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 AVAILABLE_PAYMENT_METHOD_FRAGMENT = /* GraphQL */ `\n fragment AVAILABLE_PAYMENT_METHOD_FRAGMENT on AvailablePaymentMethod {\n code\n title\n }\n`;\n\nexport const SELECTED_PAYMENT_METHOD_FRAGMENT = /* GraphQL */ `\n fragment SELECTED_PAYMENT_METHOD_FRAGMENT on SelectedPaymentMethod {\n code\n title\n purchase_order_number\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 {\n BILLING_CART_ADDRESS_FRAGMENT,\n SHIPPING_CART_ADDRESS_FRAGMENT,\n} from './CartAddressFragment.graphql';\nimport {\n AVAILABLE_PAYMENT_METHOD_FRAGMENT,\n SELECTED_PAYMENT_METHOD_FRAGMENT,\n} from './PaymentMethodFragment.graphql';\n\nexport const CHECKOUT_DATA_FRAGMENT = /* GraphQL */ `\n fragment CHECKOUT_DATA_FRAGMENT on Cart {\n id\n is_virtual\n email\n total_quantity\n billing_address {\n ...BILLING_CART_ADDRESS_FRAGMENT\n }\n shipping_addresses {\n ...SHIPPING_CART_ADDRESS_FRAGMENT\n }\n available_payment_methods {\n ...AVAILABLE_PAYMENT_METHOD_FRAGMENT\n }\n selected_payment_method {\n ...SELECTED_PAYMENT_METHOD_FRAGMENT\n }\n }\n\n ${BILLING_CART_ADDRESS_FRAGMENT}\n ${SHIPPING_CART_ADDRESS_FRAGMENT}\n ${AVAILABLE_PAYMENT_METHOD_FRAGMENT}\n ${SELECTED_PAYMENT_METHOD_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\nexport const CUSTOMER_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMER_FRAGMENT on Customer {\n firstname\n lastname\n email\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 AVAILABLE_SHIPPING_METHOD_FRAGMENT,\n SELECTED_SHIPPING_METHOD_FRAGMENT,\n} from './ShippingMethodFragment.graphql';\n\nexport const NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT on NegotiableQuoteBillingAddress {\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n`;\n\nexport const NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT on NegotiableQuoteShippingAddress {\n available_shipping_methods {\n ...AVAILABLE_SHIPPING_METHOD_FRAGMENT\n }\n city\n company\n country {\n code\n label\n }\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n fax\n firstname\n lastname\n middlename\n postcode\n prefix\n region {\n region_id\n code\n label\n }\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n street\n suffix\n telephone\n uid\n vat_id\n }\n\n ${AVAILABLE_SHIPPING_METHOD_FRAGMENT}\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT,\n NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT,\n} from './NegotiableQuoteAddressFragment.graphql';\n\nimport {\n AVAILABLE_PAYMENT_METHOD_FRAGMENT,\n SELECTED_PAYMENT_METHOD_FRAGMENT,\n} from './PaymentMethodFragment.graphql';\n\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_FRAGMENT on NegotiableQuote {\n available_payment_methods {\n ...AVAILABLE_PAYMENT_METHOD_FRAGMENT\n }\n billing_address {\n ...NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT\n }\n email\n is_virtual\n name\n selected_payment_method {\n ...SELECTED_PAYMENT_METHOD_FRAGMENT\n }\n shipping_addresses {\n ...NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT\n }\n status\n total_quantity\n uid\n }\n\n ${NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT}\n ${NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT}\n ${AVAILABLE_PAYMENT_METHOD_FRAGMENT}\n ${SELECTED_PAYMENT_METHOD_FRAGMENT}\n`;\n"],"names":["AVAILABLE_SHIPPING_METHOD_FRAGMENT","SELECTED_SHIPPING_METHOD_FRAGMENT","BILLING_CART_ADDRESS_FRAGMENT","SHIPPING_CART_ADDRESS_FRAGMENT","AVAILABLE_PAYMENT_METHOD_FRAGMENT","SELECTED_PAYMENT_METHOD_FRAGMENT","CHECKOUT_DATA_FRAGMENT","CUSTOMER_FRAGMENT","NEGOTIABLE_QUOTE_BILLING_ADDRESS_FRAGMENT","NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT","NEGOTIABLE_QUOTE_FRAGMENT"],"mappings":"AAiBa,MAAAA,EAAmD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBnDC,EAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECjBlDC,EAA8C;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;AAAA,EAkC9CC,EAA+C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AA0C;AAAA,IAC1CL,CAAiC;AAAA,IACjCC,CAAgC;"}
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -64,6 +64,22 @@ declare const _default: {
|
|
|
64
64
|
"emptyState": "No payment methods available",
|
|
65
65
|
"title": "Payment"
|
|
66
66
|
},
|
|
67
|
+
"PaymentOnAccount": {
|
|
68
|
+
"referenceNumberLabel": "Custom Reference Number",
|
|
69
|
+
"referenceNumberPlaceholder": "Enter custom reference number",
|
|
70
|
+
"referenceNumberHint": "",
|
|
71
|
+
"availableCreditLabel": "Available Credit",
|
|
72
|
+
"exceedLimitWarning": "The credit limit is {{creditLimit}}. It will be exceeded by {{exceededAmount}} with this order.",
|
|
73
|
+
"exceedLimitWarningPrefix": "The credit limit is",
|
|
74
|
+
"exceedLimitWarningMiddle": ". It will be exceeded by",
|
|
75
|
+
"exceedLimitWarningSuffix": "with this order.",
|
|
76
|
+
"exceedLimitError": "Payment On Account cannot be used for this order because your order amount exceeds your credit amount."
|
|
77
|
+
},
|
|
78
|
+
"PurchaseOrder": {
|
|
79
|
+
"referenceNumberLabel": "Custom Reference Number",
|
|
80
|
+
"referenceNumberPlaceholder": "Enter custom reference number",
|
|
81
|
+
"referenceNumberHint": ""
|
|
82
|
+
},
|
|
67
83
|
"PlaceOrder": {
|
|
68
84
|
"button": "Place Order"
|
|
69
85
|
},
|
|
@@ -73,6 +89,10 @@ declare const _default: {
|
|
|
73
89
|
"title": "We were unable to process your order",
|
|
74
90
|
"unexpected": "An unexpected error occurred while processing your order. Please try again later."
|
|
75
91
|
},
|
|
92
|
+
"Quote": {
|
|
93
|
+
"permissionDenied": "You do not have permission to checkout with this quote.",
|
|
94
|
+
"dataError": "We were unable to retrieve the quote data. Please try again later."
|
|
95
|
+
},
|
|
76
96
|
"ShippingMethods": {
|
|
77
97
|
"cartSyncError": "We were unable to save your changes. Please try again later.",
|
|
78
98
|
"emptyState": "This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct.",
|
|
@@ -19,7 +19,9 @@ export declare enum ErrorCodes {
|
|
|
19
19
|
INVALID_INPUT = "INVALID_INPUT",
|
|
20
20
|
SERVER_ERROR = "SERVER_ERROR",
|
|
21
21
|
UNAUTHENTICATED = "UNAUTHENTICATED",
|
|
22
|
-
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
22
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
23
|
+
QUOTE_DATA_ERROR = "QUOTE_DATA_ERROR",
|
|
24
|
+
QUOTE_PERMISSION_DENIED = "QUOTE_PERMISSION_DENIED"
|
|
23
25
|
}
|
|
24
26
|
export interface ErrorClassifier {
|
|
25
27
|
/**
|
package/lib/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import"../chunks/fetch-graphql.js";import{s as l,e as C}from"../chunks/setShippingAddress.js";import{debounce as f}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{s as y}from"../chunks/setBillingAddress.js";import{b as
|
|
3
|
+
import"../chunks/fetch-graphql.js";import{s as l,e as C}from"../chunks/setShippingAddress.js";import{debounce as f}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{s as y}from"../chunks/setBillingAddress.js";import{b as H,c as J,g as K,a as L,i as Q}from"../chunks/events.js";import{s as X}from"../chunks/dom.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/transform-shipping-estimate.js";import"../chunks/transform-shipping-methods.js";import"../chunks/values.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";import"../chunks/classifiers.js";import"../chunks/guards.js";import"../chunks/events2.js";let p=0;function P({type:e="shipping",debounceMs:i=0,placeOrderBtn:o}){const r=e==="shipping"?l:y,t=f(s=>{p+=1,r(s).catch(console.error).finally(()=>{p-=1,p===0&&(o==null||o.setProps(n=>({...n,disabled:!1})))})},i);return({data:s,isDataValid:n})=>{if(!n)return;o==null||o.setProps(m=>({...m,disabled:!0}));const u=A(s);t(u)}}function _({debounceMs:e=0}){let i={},o=!1;const r=f(t=>{var n,u,m,g;if(o)return;const s={country_code:t.countryCode,region_name:String(((n=t.region)==null?void 0:n.regionCode)||""),region_id:String(((u=t.region)==null?void 0:u.regionId)||""),zip:t.postcode};C({criteria:s}),i={countryCode:t.countryCode,regionCode:((m=t.region)==null?void 0:m.regionCode)||"",regionId:((g=t.region)==null?void 0:g.regionId)||"",postcode:t.postcode}},e);return({data:t,isDataValid:s})=>{var n,u;if(s){o=!0;return}i.countryCode===t.countryCode&&i.regionCode===(((n=t.region)==null?void 0:n.regionCode)||"")&&i.regionId===(((u=t.region)==null?void 0:u.regionId)||"")&&i.postcode===t.postcode||r(t)}}function q(e,i){const o=document.forms.namedItem(e);return!o||!(o&&o.offsetParent!==null)?!0:(o.setAttribute("novalidate",""),i&&i.current?i.current.handleValidationSubmit(!1):o.checkValidity())}function D(e){return document.createRange().createContextualFragment(e)}function $(e){return function(i){return e.querySelector(i)}}function c(e,i,o){if(!e||!o)return;const r=document.head.querySelector(`meta[${o}="${e}"]`);if(!i){r==null||r.remove();return}if(r)r.setAttribute("content",i);else{const t=document.createElement("meta");t.setAttribute(o,e),t.setAttribute("content",i),document.head.appendChild(t)}}function z(e){c("title",e,"name"),c("description",e,"name"),c("keywords",e,"name"),c("og:description",e,"property"),c("og:title",e,"property"),c("og:url",window.location.href,"property")}const A=e=>{var r,t,s;if(!(!(e!=null&&e.id)&&!(e!=null&&e.uid)))return{customerAddressId:e.id,customerAddressUid:e.uid};const o=(r=e.customAttributes)==null?void 0:r.map(({code:n,value:u})=>({code:n,value:String(u)}));return{address:{city:e.city,company:e==null?void 0:e.company,countryCode:e.countryCode,customAttributes:o,fax:e.fax,firstName:e.firstName,lastName:e.lastName,middleName:e.middleName,postcode:e.postcode,prefix:e.prefix,region:(t=e==null?void 0:e.region)==null?void 0:t.regionCode,regionId:(s=e==null?void 0:e.region)==null?void 0:s.regionId,street:e.street,suffix:e.suffix,telephone:e.telephone,vatId:e.vatId,saveInAddressBook:e.saveAddressBook}}},U=e=>{var i,o,r;return{city:e.city,company:e==null?void 0:e.company,countryCode:(i=e.country)==null?void 0:i.code,customAttributes:e.customAttributes,fax:e.fax,firstName:e.firstName,lastName:e.lastName,middleName:e.middleName,postcode:e.postCode,prefix:e.prefix,region:{regionCode:(o=e.region)==null?void 0:o.code,regionId:(r=e.region)==null?void 0:r.id},street:e.street,suffix:e.suffix,telephone:e.telephone,vatId:e.vatId}};export{D as createFragment,c as createMetaTag,$ as createScopedSelector,_ as estimateShippingCost,H as getCartAddress,J as getCartPaymentMethod,K as getCartShippingMethod,L as isEmptyCart,Q as isVirtualCart,X as scrollToElement,P as setAddressOnCart,z as setMetaTags,A as transformAddressFormValuesToAddressInput,U as transformCartAddressToFormValues,q as validateForm};
|
|
4
4
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["/@dropins/storefront-checkout/src/lib/utils/api.ts","/@dropins/storefront-checkout/src/lib/utils/forms.ts","/@dropins/storefront-checkout/src/lib/utils/fragments.ts","/@dropins/storefront-checkout/src/lib/utils/meta.ts","/@dropins/storefront-checkout/src/lib/utils/transformers.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 estimateShippingMethods,\n setBillingAddress,\n setShippingAddress,\n} from '@/checkout/api';\nimport {\n BillingAddressInput,\n ShippingAddressInput,\n} from '@/checkout/data/models/api';\nimport { transformAddressFormValuesToAddressInput } from '@/checkout/lib/utils';\nimport { RenderAPI } from '@/checkout/types';\nimport { debounce } from '@adobe-commerce/elsie/lib';\n\ntype AddressFormChange = {\n data: Record<string, any>;\n isDataValid: boolean;\n};\n\nlet ongoingSetAddressCalls = 0;\n\nexport function setAddressOnCart({\n type = 'shipping',\n debounceMs = 0,\n placeOrderBtn,\n}: {\n type?: 'shipping' | 'billing';\n debounceMs?: number;\n placeOrderBtn?: RenderAPI;\n}) {\n const api = type === 'shipping' ? setShippingAddress : setBillingAddress;\n\n const debouncedApi = debounce(\n (address: ShippingAddressInput | BillingAddressInput) => {\n ongoingSetAddressCalls += 1;\n api(address)\n .catch(console.error)\n .finally(() => {\n ongoingSetAddressCalls -= 1;\n if (ongoingSetAddressCalls === 0) {\n placeOrderBtn?.setProps((prev) => ({ ...prev, disabled: false }));\n }\n });\n },\n debounceMs\n );\n\n return ({ data, isDataValid }: AddressFormChange) => {\n if (!isDataValid) return;\n placeOrderBtn?.setProps((prev) => ({ ...prev, disabled: true }));\n const address = transformAddressFormValuesToAddressInput(data);\n debouncedApi(address);\n };\n}\n\nexport function estimateShippingCost({ debounceMs = 0 }) {\n let prevEstimateShippingData: {\n countryCode?: string;\n regionCode?: string;\n regionId?: string;\n postcode?: string;\n } = {};\n\n let shouldCancelDebounce = false;\n\n const debouncedApi = debounce((data: Record<string, any>) => {\n if (shouldCancelDebounce) return;\n\n const estimateShippingInputCriteria = {\n country_code: data.countryCode,\n region_name: String(data.region?.regionCode || ''),\n region_id: String(data.region?.regionId || ''),\n zip: data.postcode,\n };\n\n estimateShippingMethods({ criteria: estimateShippingInputCriteria });\n\n prevEstimateShippingData = {\n countryCode: data.countryCode,\n regionCode: data.region?.regionCode || '',\n regionId: data.region?.regionId || '',\n postcode: data.postcode,\n };\n }, debounceMs);\n\n return ({ data, isDataValid }: AddressFormChange) => {\n if (isDataValid) {\n shouldCancelDebounce = true;\n return;\n }\n\n if (\n prevEstimateShippingData.countryCode === data.countryCode &&\n prevEstimateShippingData.regionCode === (data.region?.regionCode || '') &&\n prevEstimateShippingData.regionId === (data.region?.regionId || '') &&\n prevEstimateShippingData.postcode === data.postcode\n )\n return;\n\n debouncedApi(data);\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 { FormRef } from '@/checkout/types/storefront-account';\nimport { RefObject } from 'preact';\n\nexport function validateForm(\n formName: string,\n formRef: RefObject<FormRef>\n): boolean {\n const formElement = document.forms.namedItem(formName);\n\n if (!formElement) {\n return true;\n }\n\n const isVisible = formElement && formElement.offsetParent !== null;\n if (!isVisible) {\n return true;\n }\n\n formElement.setAttribute('novalidate', '');\n\n if (formRef && formRef.current) {\n return formRef.current.handleValidationSubmit(false);\n }\n\n return formElement.checkValidity();\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 function createFragment(html: string): DocumentFragment {\n return document.createRange().createContextualFragment(html);\n}\n\nexport function createScopedSelector(\n fragment: DocumentFragment\n): (selector: string) => HTMLElement | null {\n return function (selector: string): HTMLElement | null {\n return fragment.querySelector(selector);\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 function createMetaTag(property: string, content: string, type: string) {\n if (!property || !type) {\n return;\n }\n\n const meta = document.head.querySelector<HTMLMetaElement>(\n `meta[${type}=\"${property}\"]`\n );\n\n if (!content) {\n meta?.remove();\n return;\n }\n\n if (meta) {\n meta.setAttribute('content', content);\n } else {\n const newMeta = document.createElement('meta');\n newMeta.setAttribute(type, property);\n newMeta.setAttribute('content', content);\n document.head.appendChild(newMeta);\n }\n}\n\nexport function setMetaTags(dropin: string) {\n createMetaTag('title', dropin, 'name');\n createMetaTag('description', dropin, 'name');\n createMetaTag('keywords', dropin, 'name');\n createMetaTag('og:description', dropin, 'property');\n createMetaTag('og:title', dropin, 'property');\n createMetaTag('og:url', window.location.href, 'property');\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 BillingAddressInput,\n ShippingAddressInput,\n} from '@/checkout/data/models/api';\nimport { CartAddress } from '@/checkout/data/models/cart';\n\nexport const transformAddressFormValuesToAddressInput = (\n data: Record<string, any>\n): ShippingAddressInput | BillingAddressInput => {\n const isNewAddress = !data?.id && !data?.uid;\n\n if (!isNewAddress) {\n return {\n customerAddressId: data.id,\n customerAddressUid: data.uid,\n };\n }\n\n const customAttributes = data.customAttributes?.map(\n ({ code, value }: { code: string; value: unknown }) => ({\n code,\n value: String(value),\n })\n );\n\n return {\n address: {\n city: data.city,\n company: data?.company,\n countryCode: data.countryCode,\n customAttributes,\n fax: data.fax,\n firstName: data.firstName,\n lastName: data.lastName,\n middleName: data.middleName,\n postcode: data.postcode,\n prefix: data.prefix,\n region: data?.region?.regionCode,\n regionId: data?.region?.regionId,\n street: data.street,\n suffix: data.suffix,\n telephone: data.telephone,\n vatId: data.vatId,\n saveInAddressBook: data.saveAddressBook,\n },\n };\n};\n\nexport const transformCartAddressToFormValues = (\n address: CartAddress\n): Record<string, any> => {\n return {\n city: address.city,\n company: address?.company,\n countryCode: address.country?.code,\n customAttributes: address.customAttributes,\n fax: address.fax,\n firstName: address.firstName,\n lastName: address.lastName,\n middleName: address.middleName,\n postcode: address.postCode,\n prefix: address.prefix,\n region: {\n regionCode: address.region?.code,\n regionId: address.region?.id,\n },\n street: address.street,\n suffix: address.suffix,\n telephone: address.telephone,\n vatId: address.vatId,\n };\n};\n"],"names":["ongoingSetAddressCalls","setAddressOnCart","type","debounceMs","placeOrderBtn","api","setShippingAddress","setBillingAddress","debouncedApi","debounce","address","prev","data","isDataValid","transformAddressFormValuesToAddressInput","estimateShippingCost","prevEstimateShippingData","shouldCancelDebounce","estimateShippingInputCriteria","_a","_b","estimateShippingMethods","_c","_d","validateForm","formName","formRef","formElement","createFragment","html","createScopedSelector","fragment","selector","createMetaTag","property","content","meta","newMeta","setMetaTags","dropin","customAttributes","code","value","transformCartAddressToFormValues"],"mappings":"gpBAmCA,IAAIA,EAAyB,EAEtB,SAASC,EAAiB,CAC/B,KAAAC,EAAO,WACP,WAAAC,EAAa,EACb,cAAAC,CACF,EAIG,CACK,MAAAC,EAAMH,IAAS,WAAaI,EAAqBC,EAEjDC,EAAeC,EAClBC,GAAwD,CAC7BV,GAAA,EAC1BK,EAAIK,CAAO,EACR,MAAM,QAAQ,KAAK,EACnB,QAAQ,IAAM,CACaV,GAAA,EACtBA,IAA2B,IACdI,GAAA,MAAAA,EAAA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9C,CAAC,CAAE,KAAAsB,EAAM,MAAAC,MAA+C,CACtD,KAAAD,EACA,MAAO,OAAOC,CAAK,CACrB,IAGK,MAAA,CACL,QAAS,CACP,KAAM9B,EAAK,KACX,QAASA,GAAA,YAAAA,EAAM,QACf,YAAaA,EAAK,YAClB,iBAAA4B,EACA,IAAK5B,EAAK,IACV,UAAWA,EAAK,UAChB,SAAUA,EAAK,SACf,WAAYA,EAAK,WACjB,SAAUA,EAAK,SACf,OAAQA,EAAK,OACb,QAAQQ,EAAAR,GAAA,YAAAA,EAAM,SAAN,YAAAQ,EAAc,WACtB,UAAUE,EAAAV,GAAA,YAAAA,EAAM,SAAN,YAAAU,EAAc,SACxB,OAAQV,EAAK,OACb,OAAQA,EAAK,OACb,UAAWA,EAAK,UAChB,MAAOA,EAAK,MACZ,kBAAmBA,EAAK,eAAA,CAE5B,CACF,EAEa+B,EACXjC,GACwB,WACjB,MAAA,CACL,KAAMA,EAAQ,KACd,QAASA,GAAA,YAAAA,EAAS,QAClB,aAAaS,EAAAT,EAAQ,UAAR,YAAAS,EAAiB,KAC9B,iBAAkBT,EAAQ,iBAC1B,IAAKA,EAAQ,IACb,UAAWA,EAAQ,UACnB,SAAUA,EAAQ,SAClB,WAAYA,EAAQ,WACpB,SAAUA,EAAQ,SAClB,OAAQA,EAAQ,OAChB,OAAQ,CACN,YAAYU,EAAAV,EAAQ,SAAR,YAAAU,EAAgB,KAC5B,UAAUE,EAAAZ,EAAQ,SAAR,YAAAY,EAAgB,EAC5B,EACA,OAAQZ,EAAQ,OAChB,OAAQA,EAAQ,OAChB,UAAWA,EAAQ,UACnB,MAAOA,EAAQ,KACjB,CACF"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["/@dropins/storefront-checkout/src/lib/utils/api.ts","/@dropins/storefront-checkout/src/lib/utils/forms.ts","/@dropins/storefront-checkout/src/lib/utils/fragments.ts","/@dropins/storefront-checkout/src/lib/utils/meta.ts","/@dropins/storefront-checkout/src/lib/utils/transformers.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 estimateShippingMethods,\n setBillingAddress,\n setShippingAddress,\n} from '@/checkout/api';\nimport {\n BillingAddressInput,\n ShippingAddressInput,\n} from '@/checkout/data/models/api';\nimport { transformAddressFormValuesToAddressInput } from '@/checkout/lib/utils';\nimport { RenderAPI } from '@/checkout/types';\nimport { debounce } from '@adobe-commerce/elsie/lib';\n\ntype AddressFormChange = {\n data: Record<string, any>;\n isDataValid: boolean;\n};\n\nlet ongoingSetAddressCalls = 0;\n\nexport function setAddressOnCart({\n type = 'shipping',\n debounceMs = 0,\n placeOrderBtn,\n}: {\n type?: 'shipping' | 'billing';\n debounceMs?: number;\n placeOrderBtn?: RenderAPI;\n}) {\n const api = type === 'shipping' ? setShippingAddress : setBillingAddress;\n\n const debouncedApi = debounce(\n (address: ShippingAddressInput | BillingAddressInput) => {\n ongoingSetAddressCalls += 1;\n api(address)\n .catch(console.error)\n .finally(() => {\n ongoingSetAddressCalls -= 1;\n if (ongoingSetAddressCalls === 0) {\n placeOrderBtn?.setProps((prev) => ({ ...prev, disabled: false }));\n }\n });\n },\n debounceMs\n );\n\n return ({ data, isDataValid }: AddressFormChange) => {\n if (!isDataValid) return;\n placeOrderBtn?.setProps((prev) => ({ ...prev, disabled: true }));\n const address = transformAddressFormValuesToAddressInput(data);\n debouncedApi(address);\n };\n}\n\nexport function estimateShippingCost({ debounceMs = 0 }) {\n let prevEstimateShippingData: {\n countryCode?: string;\n regionCode?: string;\n regionId?: string;\n postcode?: string;\n } = {};\n\n let shouldCancelDebounce = false;\n\n const debouncedApi = debounce((data: Record<string, any>) => {\n if (shouldCancelDebounce) return;\n\n const estimateShippingInputCriteria = {\n country_code: data.countryCode,\n region_name: String(data.region?.regionCode || ''),\n region_id: String(data.region?.regionId || ''),\n zip: data.postcode,\n };\n\n estimateShippingMethods({ criteria: estimateShippingInputCriteria });\n\n prevEstimateShippingData = {\n countryCode: data.countryCode,\n regionCode: data.region?.regionCode || '',\n regionId: data.region?.regionId || '',\n postcode: data.postcode,\n };\n }, debounceMs);\n\n return ({ data, isDataValid }: AddressFormChange) => {\n if (isDataValid) {\n shouldCancelDebounce = true;\n return;\n }\n\n if (\n prevEstimateShippingData.countryCode === data.countryCode &&\n prevEstimateShippingData.regionCode === (data.region?.regionCode || '') &&\n prevEstimateShippingData.regionId === (data.region?.regionId || '') &&\n prevEstimateShippingData.postcode === data.postcode\n )\n return;\n\n debouncedApi(data);\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 { FormRef } from '@/checkout/types/storefront-account';\nimport { RefObject } from 'preact';\n\nexport function validateForm(\n formName: string,\n formRef: RefObject<FormRef>\n): boolean {\n const formElement = document.forms.namedItem(formName);\n\n if (!formElement) {\n return true;\n }\n\n const isVisible = formElement && formElement.offsetParent !== null;\n if (!isVisible) {\n return true;\n }\n\n formElement.setAttribute('novalidate', '');\n\n if (formRef && formRef.current) {\n return formRef.current.handleValidationSubmit(false);\n }\n\n return formElement.checkValidity();\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 function createFragment(html: string): DocumentFragment {\n return document.createRange().createContextualFragment(html);\n}\n\nexport function createScopedSelector(\n fragment: DocumentFragment\n): (selector: string) => HTMLElement | null {\n return function (selector: string): HTMLElement | null {\n return fragment.querySelector(selector);\n };\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 function createMetaTag(property: string, content: string, type: string) {\n if (!property || !type) {\n return;\n }\n\n const meta = document.head.querySelector<HTMLMetaElement>(\n `meta[${type}=\"${property}\"]`\n );\n\n if (!content) {\n meta?.remove();\n return;\n }\n\n if (meta) {\n meta.setAttribute('content', content);\n } else {\n const newMeta = document.createElement('meta');\n newMeta.setAttribute(type, property);\n newMeta.setAttribute('content', content);\n document.head.appendChild(newMeta);\n }\n}\n\nexport function setMetaTags(dropin: string) {\n createMetaTag('title', dropin, 'name');\n createMetaTag('description', dropin, 'name');\n createMetaTag('keywords', dropin, 'name');\n createMetaTag('og:description', dropin, 'property');\n createMetaTag('og:title', dropin, 'property');\n createMetaTag('og:url', window.location.href, 'property');\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 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 BillingAddressInput,\n ShippingAddressInput,\n} from '@/checkout/data/models/api';\nimport { CartAddress } from '@/checkout/data/models/cart';\n\nexport const transformAddressFormValuesToAddressInput = (\n data: Record<string, any>\n): ShippingAddressInput | BillingAddressInput => {\n const isNewAddress = !data?.id && !data?.uid;\n\n if (!isNewAddress) {\n return {\n customerAddressId: data.id,\n customerAddressUid: data.uid,\n };\n }\n\n const customAttributes = data.customAttributes?.map(\n ({ code, value }: { code: string; value: unknown }) => ({\n code,\n value: String(value),\n })\n );\n\n return {\n address: {\n city: data.city,\n company: data?.company,\n countryCode: data.countryCode,\n customAttributes,\n fax: data.fax,\n firstName: data.firstName,\n lastName: data.lastName,\n middleName: data.middleName,\n postcode: data.postcode,\n prefix: data.prefix,\n region: data?.region?.regionCode,\n regionId: data?.region?.regionId,\n street: data.street,\n suffix: data.suffix,\n telephone: data.telephone,\n vatId: data.vatId,\n saveInAddressBook: data.saveAddressBook,\n },\n };\n};\n\nexport const transformCartAddressToFormValues = (\n address: CartAddress\n): Record<string, any> => {\n return {\n city: address.city,\n company: address?.company,\n countryCode: address.country?.code,\n customAttributes: address.customAttributes,\n fax: address.fax,\n firstName: address.firstName,\n lastName: address.lastName,\n middleName: address.middleName,\n postcode: address.postCode,\n prefix: address.prefix,\n region: {\n regionCode: address.region?.code,\n regionId: address.region?.id,\n },\n street: address.street,\n suffix: address.suffix,\n telephone: address.telephone,\n vatId: address.vatId,\n };\n};\n"],"names":["ongoingSetAddressCalls","setAddressOnCart","type","debounceMs","placeOrderBtn","api","setShippingAddress","setBillingAddress","debouncedApi","debounce","address","prev","data","isDataValid","transformAddressFormValuesToAddressInput","estimateShippingCost","prevEstimateShippingData","shouldCancelDebounce","estimateShippingInputCriteria","_a","_b","estimateShippingMethods","_c","_d","validateForm","formName","formRef","formElement","createFragment","html","createScopedSelector","fragment","selector","createMetaTag","property","content","meta","newMeta","setMetaTags","dropin","customAttributes","code","value","transformCartAddressToFormValues"],"mappings":"irBAmCA,IAAIA,EAAyB,EAEtB,SAASC,EAAiB,CAC/B,KAAAC,EAAO,WACP,WAAAC,EAAa,EACb,cAAAC,CACF,EAIG,CACK,MAAAC,EAAMH,IAAS,WAAaI,EAAqBC,EAEjDC,EAAeC,EAClBC,GAAwD,CAC7BV,GAAA,EAC1BK,EAAIK,CAAO,EACR,MAAM,QAAQ,KAAK,EACnB,QAAQ,IAAM,CACaV,GAAA,EACtBA,IAA2B,IACdI,GAAA,MAAAA,EAAA,SAAUO,IAAU,CAAE,GAAGA,EAAM,SAAU,MAC1D,CACD,CACL,EACAR,CACF,EAEA,MAAO,CAAC,CAAE,KAAAS,EAAM,YAAAC,KAAqC,CACnD,GAAI,CAACA,EAAa,OACHT,GAAA,MAAAA,EAAA,SAAUO,IAAU,CAAE,GAAGA,EAAM,SAAU,MAClD,MAAAD,EAAUI,EAAyCF,CAAI,EAC7DJ,EAAaE,CAAO,CACtB,CACF,CAEO,SAASK,EAAqB,CAAE,WAAAZ,EAAa,GAAK,CACvD,IAAIa,EAKA,CAAC,EAEDC,EAAuB,GAErB,MAAAT,EAAeC,EAAUG,GAA8B,aAC3D,GAAIK,EAAsB,OAE1B,MAAMC,EAAgC,CACpC,aAAcN,EAAK,YACnB,YAAa,SAAOO,EAAAP,EAAK,SAAL,YAAAO,EAAa,aAAc,EAAE,EACjD,UAAW,SAAOC,EAAAR,EAAK,SAAL,YAAAQ,EAAa,WAAY,EAAE,EAC7C,IAAKR,EAAK,QACZ,EAEwBS,EAAA,CAAE,SAAUH,EAA+B,EAExCF,EAAA,CACzB,YAAaJ,EAAK,YAClB,aAAYU,EAAAV,EAAK,SAAL,YAAAU,EAAa,aAAc,GACvC,WAAUC,EAAAX,EAAK,SAAL,YAAAW,EAAa,WAAY,GACnC,SAA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