@dropins/storefront-quote-management 0.0.1-alpha21 → 0.0.1-alpha23
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/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +10 -0
- package/api/{getCustomerData → getStoreConfig}/index.d.ts +1 -1
- package/api/index.d.ts +1 -1
- package/api.js +29 -40
- package/api.js.map +1 -1
- package/chunks/ChevronDown.js +4 -0
- package/chunks/ChevronDown.js.map +1 -0
- package/chunks/NegotiableQuoteFragment.js +129 -0
- package/chunks/NegotiableQuoteFragment.js.map +1 -1
- package/chunks/QuoteHistoryLog.js +1 -1
- package/chunks/QuoteHistoryLog.js.map +1 -1
- package/chunks/dateUtils.js +4 -0
- package/chunks/dateUtils.js.map +1 -0
- package/chunks/fetch-graphql.js +1 -1
- package/chunks/fetch-graphql.js.map +1 -1
- package/chunks/getQuoteTemplates.js +1 -1
- package/chunks/negotiableQuotes.js +1 -1
- package/chunks/renameNegotiableQuote.js +1 -1
- package/chunks/state.js +1 -1
- package/chunks/state.js.map +1 -1
- package/chunks/updateQuantities.js +2 -2
- package/chunks/uploadFile.js +3 -3
- package/containers/ManageNegotiableQuote.js +1 -1
- package/containers/ManageNegotiableQuote.js.map +1 -1
- package/containers/OrderSummary.js +1 -1
- package/containers/OrderSummary.js.map +1 -1
- package/containers/QuoteHistoryLog.js +1 -1
- package/containers/QuoteSummaryList/QuoteSummaryList.d.ts +51 -0
- package/{data/transforms/__fixtures__/customerData.d.ts → containers/QuoteSummaryList/index.d.ts} +3 -2
- package/containers/QuoteSummaryList.d.ts +3 -0
- package/containers/QuoteSummaryList.js +4 -0
- package/containers/QuoteSummaryList.js.map +1 -0
- package/containers/QuoteTemplatesListTable.js +1 -1
- package/containers/QuoteTemplatesListTable.js.map +1 -1
- package/containers/RequestNegotiableQuoteForm.js +1 -1
- package/containers/index.d.ts +1 -0
- package/data/models/__fixtures__/negotiableQuoteModel.d.ts +1 -0
- package/data/models/__fixtures__/storeConfigModel.d.ts +5 -0
- package/data/models/index.d.ts +0 -1
- package/data/models/negotiable-quote-model.d.ts +33 -5
- package/data/models/store-config-model.d.ts +5 -2
- package/data/transforms/__fixtures__/negotiableQuoteData.d.ts +216 -0
- package/data/transforms/__fixtures__/storeConfigData.d.ts +31 -0
- package/data/transforms/index.d.ts +1 -1
- package/data/transforms/transform-store-config.d.ts +4 -0
- package/hooks/useQuoteSummaryData.d.ts +10 -0
- package/i18n/en_US.json.d.ts +12 -0
- package/lib/configurationTransformers.d.ts +27 -0
- package/lib/itemFormatters.d.ts +47 -0
- package/lib/priceCalculators.d.ts +41 -0
- package/lib/state.d.ts +3 -0
- package/package.json +1 -1
- package/render.js +1 -1
- package/render.js.map +1 -1
- package/types/state.types.d.ts +6 -0
- package/utils/dateUtils.d.ts +6 -0
- package/utils/mapAuthPermissions.d.ts +39 -0
- package/api/getCustomerData/getCustomerData.d.ts +0 -10
- package/api/getCustomerData/graphql/CustomerQuery.d.ts +0 -2
- package/api/graphql/CustomerFragment.d.ts +0 -2
- package/data/models/__fixtures__/customerModel.d.ts +0 -4
- package/data/models/customer-model.d.ts +0 -18
- package/data/transforms/transform-customer.d.ts +0 -15
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/CustomerFragment.ts","/@dropins/storefront-quote-management/src/api/getCustomerData/graphql/CustomerQuery.ts","/@dropins/storefront-quote-management/src/data/transforms/transform-customer.ts","/@dropins/storefront-quote-management/src/api/getCustomerData/getCustomerData.ts","/@dropins/storefront-quote-management/src/api/initialize/initialize.ts","/@dropins/storefront-quote-management/src/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.ts","/@dropins/storefront-quote-management/src/api/setShippingAddress/setShippingAddress.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteTemplateFragment.ts","/@dropins/storefront-quote-management/src/api/getQuoteTemplateData/graphql/getQuoteTemplateData.ts","/@dropins/storefront-quote-management/src/api/getQuoteTemplateData/getQuoteTemplateData.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/graphql/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.ts","/@dropins/storefront-quote-management/src/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.ts","/@dropins/storefront-quote-management/src/api/acceptQuoteTemplate/graphql/acceptQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/acceptQuoteTemplate/acceptQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/cancelQuoteTemplate/cancelQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/deleteQuoteTemplate/deleteQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/openQuoteTemplate/graphql/openQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/openQuoteTemplate/openQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.ts","/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.ts","/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/removeQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.ts","/@dropins/storefront-quote-management/src/api/generateQuoteFromTemplate/generateQuoteFromTemplate.ts"],"sourcesContent":["export const CUSTOMER_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMER_FRAGMENT on Customer {\n role {\n permissions {\n text\n children {\n text\n children {\n text\n children {\n text\n }\n }\n }\n }\n }\n }\n`","import { CUSTOMER_FRAGMENT } from '@/quote-management/api/graphql/CustomerFragment';\n\nexport const CUSTOMER_QUERY = `\n query CUSTOMER_QUERY {\n customer {\n ...CUSTOMER_FRAGMENT\n }\n }\n\n ${CUSTOMER_FRAGMENT}\n`","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { DEFAULT_PERMISSIONS } from \"@/quote-management/lib/state\";\nimport { CustomerModel } from \"../models\";\n\ntype PermissionsSchema = {\n text: string;\n children: PermissionsSchema[];\n}\n\nconst CAN_REQUEST_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_EDIT_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_DELETE_QUOTE_PERMISSION = 'All/Quotes/View/Request, Edit, Delete';\nconst CAN_CHECKOUT_QUOTE_PERMISSION = 'All/Quotes/View/Checkout with quote';\n\n/**\n * Flatten the permissions into a list of strings\n * @param permissions - The permissions to flatten\n * @returns A list of strings representing the flattened permissions\n */\nexport const flattenPermissions = (permissions: PermissionsSchema[]): string[] => {\n const result: string[] = [];\n \n // Recursively traverse the permissions and build the path\n const traverse = (nodes: PermissionsSchema[], path: string[] = []) => {\n for (const node of nodes) {\n const currentPath = [...path, node.text];\n \n if (node.children && node.children.length > 0) {\n traverse(node.children, currentPath);\n } else {\n result.push(currentPath.join('/'));\n }\n }\n };\n \n traverse(permissions);\n return result;\n}\n\nexport function transformCustomer(customerData: any): CustomerModel {\n const { role } = customerData;\n\n if (!role) {\n return {\n permissions: {\n canRequestQuote: DEFAULT_PERMISSIONS.requestQuote,\n canEditQuote: DEFAULT_PERMISSIONS.editQuote,\n canDeleteQuote: DEFAULT_PERMISSIONS.deleteQuote,\n canCheckoutQuote: DEFAULT_PERMISSIONS.checkoutQuote,\n },\n };\n }\n\n const { permissions } = role;\n\n const flattenedPermissions = flattenPermissions(permissions);\n return {\n permissions: {\n canRequestQuote: flattenedPermissions.includes(CAN_REQUEST_QUOTE_PERMISSION),\n canEditQuote: flattenedPermissions.includes(CAN_EDIT_QUOTE_PERMISSION),\n canDeleteQuote: flattenedPermissions.includes(CAN_DELETE_QUOTE_PERMISSION),\n canCheckoutQuote: flattenedPermissions.includes(CAN_CHECKOUT_QUOTE_PERMISSION),\n }\n }\n}","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api/';\nimport { CUSTOMER_QUERY } from './graphql/CustomerQuery';\nimport { transformCustomer } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\n\nexport const getCustomerData = async () => { \n if (!state.authenticated) {\n return Promise.reject(new Error('Unauthorized'));\n }\n\n try {\n const results: any = await fetchGraphQl(CUSTOMER_QUERY);\n \n if (!results?.data?.customer) {\n throw new Error('No customer data received');\n }\n \n return transformCustomer(results.data.customer);\n } catch (error) {\n return Promise.reject(error);\n }\n}\n","import { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state, DEFAULT_PERMISSIONS } from '@/quote-management/lib/state';\nimport { getCustomerData } from '@/quote-management/api/getCustomerData';\nimport { getQuoteData } from '@/quote-management/api/getQuoteData';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n quoteId?: string;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', async (authenticated) => {\n state.authenticated = !!authenticated;\n\n if (authenticated) {\n getCustomerData().then((customerData) => {\n state.permissions = {\n requestQuote: customerData.permissions.canRequestQuote,\n editQuote: customerData.permissions.canEditQuote,\n deleteQuote: customerData.permissions.canDeleteQuote,\n checkoutQuote: customerData.permissions.canCheckoutQuote,\n };\n events.emit('quote-management/permissions', state.permissions);\n })\n .catch((error) => {\n console.error(error);\n state.permissions = DEFAULT_PERMISSIONS;\n events.emit('quote-management/permissions', DEFAULT_PERMISSIONS);\n });\n } else {\n state.permissions = DEFAULT_PERMISSIONS;\n events.emit('quote-management/permissions', DEFAULT_PERMISSIONS);\n }\n }, {\n eager: true,\n }),\n events.on('quote-management/permissions', async (permissions) => {\n const quoteId = initialize.config.getConfig().quoteId;\n if (!quoteId) {\n return;\n }\n\n if (permissions.editQuote) {\n getQuoteData(quoteId).then((quoteData) => {\n events.emit('quote-management/quote-data/initialized', {\n quote: quoteData,\n permissions,\n }, {});\n }).catch((error) => {\n events.emit('quote-management/quote-data/error', {\n error,\n });\n });\n }\n }, {\n eager: true,\n }),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION = `\n mutation SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION(\n $quoteUid: ID!\n $addressId: ID\n $addressData: NegotiableQuoteAddressInput\n ) {\n setNegotiableQuoteShippingAddress(\n input: {\n quote_uid: $quoteUid\n shipping_addresses: {\n customer_address_uid: $addressId\n address: $addressData\n }\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION } from './graphql/SetNegotiableQuoteShippingAddressMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface AddressInput {\n /** City name */\n city: string;\n /** Optional company name */\n company?: string;\n /** Two-letter country code (e.g., 'US') */\n countryCode: string;\n /** First name */\n firstname: string;\n /** Last name */\n lastname: string;\n /** Postal/ZIP code */\n postcode: string;\n /** Optional state/province name */\n region?: string;\n /** Optional state/province ID */\n regionId?: number;\n /** Whether to save this address to the customer's address book */\n saveInAddressBook?: boolean;\n /** Street address lines (array) */\n street: string[];\n /** Phone number */\n telephone: string;\n /** \n * Additional input (optional custom fields for the address).\n * These fields will be merged into the address data sent to GraphQL.\n * Standard fields take precedence over additional fields to prevent\n * accidental override of required address attributes.\n * \n * @example\n * ```ts\n * additionalInput: {\n * vat_id: 'GB123456789',\n * custom_attribute: 'value',\n * delivery_instructions: 'Leave at door'\n * }\n * ```\n */\n additionalInput?: Record<string, any>;\n}\n\nexport interface SetShippingAddressInput {\n /** The unique ID of the negotiable quote */\n quoteUid: string;\n /** The ID of a saved customer address (use this OR addressData, not both) */\n addressId?: number;\n /** New address data (use this OR addressId, not both) */\n addressData?: AddressInput;\n}\n\n/**\n * Transform camelCase address data to snake_case for GraphQL mutation.\n * Additional fields from additionalInput are spread into the result, with\n * standard fields taking precedence (defensive flexibility approach).\n */\nfunction transformAddressToSnakeCase(address: AddressInput) {\n const { additionalInput, ...standardFields } = address;\n \n // Build the standard transformed fields\n const transformedStandardFields = {\n city: standardFields.city,\n company: standardFields.company,\n country_code: standardFields.countryCode,\n firstname: standardFields.firstname,\n lastname: standardFields.lastname,\n postcode: standardFields.postcode,\n region: standardFields.region,\n region_id: standardFields.regionId,\n save_in_address_book: standardFields.saveInAddressBook,\n street: standardFields.street,\n telephone: standardFields.telephone,\n };\n \n // Spread additional input first, then standard fields take precedence\n // This provides defensive flexibility: allows custom fields while protecting core fields\n return {\n ...(additionalInput || {}),\n ...transformedStandardFields,\n };\n}\n\n/**\n * Sets or updates the shipping address for a negotiable quote.\n * \n * @param input - The input parameters for setting the shipping address\n * @param input.quoteUid - The unique ID of the negotiable quote\n * @param input.addressId - Optional ID of a saved customer address (use this OR addressData)\n * @param input.addressData - Optional new address data (use this OR addressId)\n * @param input.addressData.additionalInput - Optional additional address fields to pass through to GraphQL\n * @returns Promise that resolves to the updated quote model with shipping addresses including uid field\n * @throws Error if validation fails or GraphQL operation fails\n * \n * @example\n * ```ts\n * // Using a saved address\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressId: 5\n * });\n * \n * // Using new address data\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressData: {\n * firstname: 'John',\n * lastname: 'Doe',\n * street: ['123 Main St'],\n * city: 'San Francisco',\n * countryCode: 'US',\n * postcode: '94103',\n * telephone: '555-1234'\n * }\n * });\n * \n * // Using address data with additional custom fields\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressData: {\n * firstname: 'John',\n * lastname: 'Doe',\n * street: ['123 Main St'],\n * city: 'San Francisco',\n * countryCode: 'US',\n * postcode: '94103',\n * telephone: '555-1234',\n * additionalInput: {\n * vat_id: 'GB123456789',\n * custom_attribute_1: 'value1',\n * delivery_instructions: 'Leave at door'\n * }\n * }\n * });\n * \n * // Access address identifier\n * if (quote?.shippingAddresses?.[0]) {\n * console.log('Address UID:', quote.shippingAddresses[0].uid);\n * }\n * ```\n */\nexport const setShippingAddress = async (\n input: SetShippingAddressInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, addressId, addressData } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n // Validate that exactly one of addressId or addressData is provided\n if (addressId === undefined && !addressData) {\n throw new Error('Either addressId or addressData must be provided');\n }\n\n if (addressId !== undefined && addressData) {\n throw new Error('Cannot provide both addressId and addressData');\n }\n\n // Transform addressData to snake_case if provided\n const transformedAddressData = addressData\n ? transformAddressToSnakeCase(addressData)\n : null;\n\n return fetchGraphQl(SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION, {\n variables: {\n quoteUid,\n addressId: addressId || null,\n addressData: transformedAddressData,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to set shipping address: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.setNegotiableQuoteShippingAddress?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/shipping-address-set', {\n quote: quoteData,\n input: { quoteUid, addressId, addressData },\n });\n\n return quoteData;\n });\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {\n # uid\n name\n # created_at\n # updated_at\n status\n # sales_rep_name\n expiration_date\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n items {\n uid\n product {\n name\n sku\n uid\n stock_status\n }\n prices {\n price {\n currency\n value\n }\n original_item_price {\n currency\n value\n }\n row_total {\n currency\n value\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n note_from_buyer {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const GET_QUOTE_TEMPLATE_DATA = /* GraphQL */ `\n query QUOTE_TEMPLATE_DATA_QUERY($templateId: ID!) {\n negotiableQuoteTemplate(templateId: $templateId) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { GET_QUOTE_TEMPLATE_DATA } from './graphql/getQuoteTemplateData';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getQuoteTemplateData = async (templateId: string): Promise<NegotiableQuoteTemplateModel | null> => {\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n if (!templateId) {\n throw new Error('Template ID is required');\n }\n\n try {\n const results: any = await fetchGraphQl(GET_QUOTE_TEMPLATE_DATA, {\n variables: { templateId },\n });\n\n\n if (!results?.data?.negotiableQuoteTemplate) {\n throw new Error('Quote template not found');\n }\n\n const transformedData = transformQuoteTemplate(results.data.negotiableQuoteTemplate);\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from \"../../graphql/NegotiableQuoteTemplateFragment\";\n\nexport const CREATE_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation CREATE_QUOTE_TEMPLATE_MUTATION($cartId: ID!) {\n requestNegotiableQuoteTemplateFromQuote(input: { cart_id: $cartId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { events } from '@adobe-commerce/event-bus';\nimport { fetchGraphQl } from '@/quote-management/api/';\nimport { CREATE_QUOTE_TEMPLATE_MUTATION } from './graphql/createQuoteTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\n\nexport const createQuoteTemplate = async (\n quoteId: string\n): Promise<NegotiableQuoteTemplateModel | null> => {\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n if (!quoteId) {\n throw new Error('Cart ID is required');\n }\n\n try {\n const results: any = await fetchGraphQl(CREATE_QUOTE_TEMPLATE_MUTATION, {\n variables: {\n cartId: quoteId,\n },\n });\n\n if (!results?.data?.requestNegotiableQuoteTemplateFromQuote) {\n throw new Error('Failed to create quote template');\n }\n\n const transformedQuoteTemplate = transformQuoteTemplate(\n results.data.requestNegotiableQuoteTemplateFromQuote\n );\n\n if (!transformedQuoteTemplate) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedQuoteTemplate,\n permissions: state.permissions,\n });\n\n return transformedQuoteTemplate;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION = /* GraphQL */ `\n mutation SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION(\n $templateId: ID!\n $comment: String\n $name: String\n ) {\n submitNegotiableQuoteTemplateForReview(input: { template_id: $templateId, name: $name, comment: $comment }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION } from './graphql/sendQuoteTemplateForReview';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface SendQuoteTemplateForReviewParams {\n templateId: string;\n name?: string;\n comment?: string;\n}\n\nexport const sendQuoteTemplateForReview = async (\n params: SendQuoteTemplateForReviewParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION,\n {\n variables: {\n templateId: params.templateId,\n name: params.name,\n comment: params.comment,\n },\n }\n );\n\n if (!results?.data?.submitNegotiableQuoteTemplateForReview) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.submitNegotiableQuoteTemplateForReview\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const ACCEPT_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation ACCEPT_QUOTE_TEMPLATE_MUTATION($templateId: ID!) {\n acceptNegotiableQuoteTemplate(input: { template_id: $templateId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n \n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { ACCEPT_QUOTE_TEMPLATE_MUTATION } from './graphql/acceptQuoteTemplate';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AcceptQuoteTemplateParams {\n templateId: string;\n}\n\nexport const acceptQuoteTemplate = async (\n params: AcceptQuoteTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(ACCEPT_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId },\n });\n\n if (!results?.data?.acceptNegotiableQuoteTemplate) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.acceptNegotiableQuoteTemplate\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const CANCEL_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation CANCEL_QUOTE_TEMPLATE_MUTATION(\n $templateId: ID!\n $comment: String\n ) {\n cancelNegotiableQuoteTemplate(\n input: {\n template_id: $templateId\n cancellation_comment: $comment\n }\n ) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { CANCEL_QUOTE_TEMPLATE_MUTATION } from './graphql/cancelQuoteTemplate';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface CancelQuoteTemplateParams {\n templateId: string;\n comment?: string;\n}\n\nexport const cancelQuoteTemplate = async (\n params: CancelQuoteTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(CANCEL_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId, comment: params.comment },\n });\n\n if (!results?.data?.cancelNegotiableQuoteTemplate) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.cancelNegotiableQuoteTemplate\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const DELETE_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation DELETE_QUOTE_TEMPLATE_MUTATION($templateId: ID!) {\n deleteNegotiableQuoteTemplate(input: { template_id: $templateId })\n }\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { DELETE_QUOTE_TEMPLATE_MUTATION } from './graphql/deleteQuoteTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface DeleteQuoteTemplateParams {\n templateId: string;\n}\n\nexport const deleteQuoteTemplate = async (\n params: DeleteQuoteTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(DELETE_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId },\n });\n\n if (results?.errors && results.errors.length > 0) {\n const errorMessages = results.errors\n .map((e: any) => e?.message)\n .filter(Boolean)\n .join('; ');\n throw new Error(errorMessages || 'Failed to delete quote template');\n }\n\n const deleted = results?.data?.deleteNegotiableQuoteTemplate;\n\n if (!deleted) {\n throw new Error('Failed to delete quote template');\n }\n\n events.emit('quote-management/quote-template-deleted', {\n templateId: params.templateId,\n });\n\n return { templateId: params.templateId };\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const OPEN_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation OPEN_QUOTE_TEMPLATE_MUTATION($templateId: ID!) {\n openNegotiableQuoteTemplate(input: { template_id: $templateId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { OPEN_QUOTE_TEMPLATE_MUTATION } from './graphql/openQuoteTemplate';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface OpenQuoteTemplateParams {\n templateId: string;\n}\n\nexport const openQuoteTemplate = async (params: OpenQuoteTemplateParams) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(OPEN_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId },\n });\n\n if (!results?.data?.openNegotiableQuoteTemplate) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.openNegotiableQuoteTemplate\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION = /* GraphQL */ `\n mutation SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION(\n $templateId: ID!\n $shippingAddress: NegotiableQuoteTemplateShippingAddressInput!\n ) {\n setNegotiableQuoteTemplateShippingAddress(\n input: {\n template_id: $templateId\n shipping_address: $shippingAddress\n }\n ) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n \n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION } from './graphql/setNegotiableQuoteTemplateShippingAddress';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface NegotiableQuoteAddressInput {\n city: string;\n company?: string;\n countryCode: string;\n fax?: string;\n firstname: string;\n lastname: string;\n middlename?: string;\n postcode?: string;\n prefix?: string;\n region?: string;\n regionId?: number;\n saveInAddressBook?: boolean;\n street: string[];\n suffix?: string;\n telephone?: string;\n vatId?: string;\n}\n\nexport interface NegotiableQuoteTemplateShippingAddressInput {\n address?: NegotiableQuoteAddressInput;\n customerAddressUid?: string;\n customerNotes?: string;\n}\n\nexport interface AddQuoteTemplateShippingAddressParams {\n templateId: string;\n shippingAddress: NegotiableQuoteTemplateShippingAddressInput;\n}\n\nexport const addQuoteTemplateShippingAddress = async (\n params: AddQuoteTemplateShippingAddressParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.shippingAddress) {\n throw new Error('Shipping address is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n // Validate that at least one of address or customerAddressUid is provided\n if (\n !params.shippingAddress.address &&\n !params.shippingAddress.customerAddressUid\n ) {\n throw new Error('Either address or customerAddressUid must be provided');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION,\n {\n variables: {\n templateId: params.templateId,\n shippingAddress: {\n address: params.shippingAddress.address\n ? {\n city: params.shippingAddress.address.city,\n company: params.shippingAddress.address.company,\n country_code: params.shippingAddress.address.countryCode,\n fax: params.shippingAddress.address.fax,\n firstname: params.shippingAddress.address.firstname,\n lastname: params.shippingAddress.address.lastname,\n middlename: params.shippingAddress.address.middlename,\n postcode: params.shippingAddress.address.postcode,\n prefix: params.shippingAddress.address.prefix,\n region: params.shippingAddress.address.region,\n region_id: params.shippingAddress.address.regionId,\n save_in_address_book:\n params.shippingAddress.address.saveInAddressBook,\n street: params.shippingAddress.address.street,\n suffix: params.shippingAddress.address.suffix,\n telephone: params.shippingAddress.address.telephone,\n vat_id: params.shippingAddress.address.vatId,\n }\n : undefined,\n customer_address_uid: params.shippingAddress.customerAddressUid,\n customer_notes: params.shippingAddress.customerNotes,\n },\n },\n }\n );\n\n if (!results?.data?.setNegotiableQuoteTemplateShippingAddress) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setNegotiableQuoteTemplateShippingAddress\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION = /* GraphQL */ `\n mutation UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION(\n $input: UpdateNegotiableQuoteTemplateQuantitiesInput!\n ) {\n updateNegotiableQuoteTemplateQuantities(input: $input) {\n quote_template {\n ...NegotiableQuoteTemplateFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION } from './graphql/updateNegotiableQuoteTemplateQuantities';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface NegotiableQuoteTemplateItemQuantityInput {\n itemId: string;\n quantity: number;\n minQty?: number;\n maxQty?: number;\n}\n\nexport interface UpdateQuoteTemplateItemQuantitiesParams {\n templateId: string;\n items: NegotiableQuoteTemplateItemQuantityInput[];\n}\n\nexport const updateQuoteTemplateItemQuantities = async (\n params: UpdateQuoteTemplateItemQuantitiesParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.items || params.items.length === 0) {\n throw new Error('Items array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n items: params.items.map((item) => ({\n item_id: item.itemId,\n quantity: item.quantity,\n min_qty: item.minQty,\n max_qty: item.maxQty,\n })),\n },\n },\n }\n );\n\n if (\n !results?.data?.updateNegotiableQuoteTemplateQuantities?.quote_template\n ) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.updateNegotiableQuoteTemplateQuantities.quote_template\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION = /* GraphQL */ `\n mutation REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION(\n $input: RemoveNegotiableQuoteTemplateItemsInput!\n ) {\n removeNegotiableQuoteTemplateItems(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION } from './graphql/removeNegotiableQuoteTemplateItems';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface RemoveQuoteTemplateItemsParams {\n templateId: string;\n itemUids: string[];\n}\n\nexport const removeQuoteTemplateItems = async (\n params: RemoveQuoteTemplateItemsParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemUids || params.itemUids.length === 0) {\n throw new Error('Item UIDs array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n item_uids: params.itemUids,\n },\n },\n }\n );\n\n if (!results?.data?.removeNegotiableQuoteTemplateItems) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.removeNegotiableQuoteTemplateItems\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION = /* GraphQL */ `\n mutation SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION(\n $input: QuoteTemplateLineItemNoteInput!\n ) {\n setQuoteTemplateLineItemNote(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION } from './graphql/setQuoteTemplateLineItemNote';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AddQuoteTemplateLineItemNoteParams {\n templateId: string;\n itemId: string;\n note?: string;\n}\n\nexport const addQuoteTemplateLineItemNote = async (\n params: AddQuoteTemplateLineItemNoteParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemId) {\n throw new Error('Item ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION,\n {\n variables: {\n input: {\n templateId: params.templateId,\n item_id: params.itemId,\n note: params.note,\n },\n },\n }\n );\n\n if (!results?.data?.setQuoteTemplateLineItemNote) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setQuoteTemplateLineItemNote\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION(\n $input: GenerateNegotiableQuoteFromTemplateInput!\n ) {\n generateNegotiableQuoteFromTemplate(input: $input) {\n negotiable_quote_uid\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION } from './graphql/generateNegotiableQuoteFromTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface GenerateQuoteFromTemplateParams {\n templateId: string;\n}\n\nexport const generateQuoteFromTemplate = async (\n params: GenerateQuoteFromTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n },\n },\n }\n );\n\n if (\n !results?.data?.generateNegotiableQuoteFromTemplate?.negotiable_quote_uid\n ) {\n throw new Error('No quote UID received');\n }\n\n const quoteId =\n results.data.generateNegotiableQuoteFromTemplate.negotiable_quote_uid;\n\n events.emit('quote-management/quote-template-generated', {\n quoteId,\n });\n\n return { quoteId };\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["CUSTOMER_FRAGMENT","CUSTOMER_QUERY","CAN_REQUEST_QUOTE_PERMISSION","CAN_EDIT_QUOTE_PERMISSION","CAN_DELETE_QUOTE_PERMISSION","CAN_CHECKOUT_QUOTE_PERMISSION","flattenPermissions","permissions","result","traverse","nodes","path","node","currentPath","transformCustomer","customerData","role","DEFAULT_PERMISSIONS","flattenedPermissions","getCustomerData","state","results","fetchGraphQl","_a","error","initialize","Initializer","config","defaultConfig","events","authenticated","quoteId","getQuoteData","quoteData","SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION","NEGOTIABLE_QUOTE_FRAGMENT","transformAddressToSnakeCase","address","additionalInput","standardFields","transformedStandardFields","setShippingAddress","input","quoteUid","addressId","addressData","transformedAddressData","response","errors","errorMessages","transformQuote","_b","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","GET_QUOTE_TEMPLATE_DATA","getQuoteTemplateData","templateId","transformedData","transformQuoteTemplate","CREATE_QUOTE_TEMPLATE_MUTATION","createQuoteTemplate","transformedQuoteTemplate","SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION","sendQuoteTemplateForReview","params","ACCEPT_QUOTE_TEMPLATE_MUTATION","acceptQuoteTemplate","CANCEL_QUOTE_TEMPLATE_MUTATION","cancelQuoteTemplate","DELETE_QUOTE_TEMPLATE_MUTATION","deleteQuoteTemplate","e","OPEN_QUOTE_TEMPLATE_MUTATION","openQuoteTemplate","SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION","addQuoteTemplateShippingAddress","UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION","updateQuoteTemplateItemQuantities","item","REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION","removeQuoteTemplateItems","SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION","addQuoteTemplateLineItemNote","GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION","generateQuoteFromTemplate"],"mappings":"4yBAAO,MAAMA,EAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECElCC,EAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAMA,EAAO,IAAA,CACf,CACF,CACF,EAGF,GAAI,GAACxC,EAAAF,GAAA,YAAAA,EAAS,OAAT,MAAAE,EAAe,8BAClB,MAAM,IAAI,MAAM,iCAAiC,EAGnD,MAAMiC,EAAkBC,EACtBpC,EAAQ,KAAK,4BAAA,EAGf,GAAI,CAACmC,EACH,MAAM,IAAI,MAAM,yCAAyC,EAG3D,OAAA3B,EAAO,KAAK,uCAAwC,CAClD,cAAe2B,EACf,YAAapC,EAAM,WAAA,CACpB,EAEMoC,CACT,OAAShC,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF,EC9Da0D,EAAiE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECSjEC,GAA4B,MACvCpB,GACG,SACH,GAAI,CAACA,EAAO,WACV,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CAAC3C,EAAM,cACT,MAAM,IAAI,MAAM,cAAc,EAGhC,GAAI,CACF,MAAMC,EAAe,MAAMC,EACzB4D,EACA,CACE,UAAW,CACT,MAAO,CACL,YAAanB,EAAO,UAAA,CACtB,CACF,CACF,EAGF,GACE,GAACZ,GAAA5B,EAAAF,GAAA,YAAAA,EAAS,OAAT,YAAAE,EAAe,sCAAf,MAAA4B,EAAoD,sBAErD,MAAM,IAAI,MAAM,uBAAuB,EAGzC,MAAMpB,EACJV,EAAQ,KAAK,oCAAoC,qBAEnD,OAAAQ,EAAO,KAAK,4CAA6C,CACvD,QAAAE,CAAA,CACD,EAEM,CAAE,QAAAA,CAAA,CACX,OAASP,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-quote-management/src/data/transforms/transform-store-config.ts","/@dropins/storefront-quote-management/src/utils/mapAuthPermissions.ts","/@dropins/storefront-quote-management/src/api/initialize/initialize.ts","/@dropins/storefront-quote-management/src/api/getStoreConfig/graphql/StoreConfigQuery.ts","/@dropins/storefront-quote-management/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-quote-management/src/api/setShippingAddress/graphql/SetNegotiableQuoteShippingAddressMutation.ts","/@dropins/storefront-quote-management/src/api/setShippingAddress/setShippingAddress.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteTemplateFragment.ts","/@dropins/storefront-quote-management/src/api/getQuoteTemplateData/graphql/getQuoteTemplateData.ts","/@dropins/storefront-quote-management/src/api/getQuoteTemplateData/getQuoteTemplateData.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/graphql/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/createQuoteTemplate/createQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/sendQuoteTemplateForReview/graphql/sendQuoteTemplateForReview.ts","/@dropins/storefront-quote-management/src/api/sendQuoteTemplateForReview/sendQuoteTemplateForReview.ts","/@dropins/storefront-quote-management/src/api/acceptQuoteTemplate/graphql/acceptQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/acceptQuoteTemplate/acceptQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/cancelQuoteTemplate/graphql/cancelQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/cancelQuoteTemplate/cancelQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/deleteQuoteTemplate/graphql/deleteQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/deleteQuoteTemplate/deleteQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/openQuoteTemplate/graphql/openQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/openQuoteTemplate/openQuoteTemplate.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateShippingAddress/graphql/setNegotiableQuoteTemplateShippingAddress.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateShippingAddress/addQuoteTemplateShippingAddress.ts","/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/graphql/updateNegotiableQuoteTemplateQuantities.ts","/@dropins/storefront-quote-management/src/api/updateQuoteTemplateItemQuantities/updateQuoteTemplateItemQuantities.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/graphql/removeNegotiableQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/removeQuoteTemplateItems/removeQuoteTemplateItems.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/graphql/setQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/addQuoteTemplateLineItemNote/addQuoteTemplateLineItemNote.ts","/@dropins/storefront-quote-management/src/api/generateQuoteFromTemplate/graphql/generateNegotiableQuoteFromTemplate.ts","/@dropins/storefront-quote-management/src/api/generateQuoteFromTemplate/generateQuoteFromTemplate.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport {\n QuoteDisplayAmount,\n StoreConfigModel,\n} from '@/quote-management/data/models';\nimport { DEFAULT_CONFIG } from '@/quote-management/lib/state';\n\nexport function transformStoreConfig(data: any): StoreConfigModel {\n if (!data) return DEFAULT_CONFIG;\n\n const transformQuoteDisplayAmountSetting = (\n quoteDisplayAmountSetting: number\n ) => {\n if (\n [\n QuoteDisplayAmount.TAX_EXCLUDED,\n QuoteDisplayAmount.TAX_INCLUDED,\n QuoteDisplayAmount.TAX_INCLUDED_AND_EXCLUDED,\n ].includes(quoteDisplayAmountSetting)\n ) {\n return quoteDisplayAmountSetting;\n }\n\n return QuoteDisplayAmount.TAX_EXCLUDED;\n };\n\n return {\n quoteSummaryDisplayTotal: data.cart_summary_display_quantity,\n quoteSummaryMaxItems: data.max_items_in_order_summary,\n quoteDisplaySettings: {\n zeroTax: data.shopping_cart_display_zero_tax,\n subtotal: transformQuoteDisplayAmountSetting(\n data.shopping_cart_display_subtotal\n ),\n price: transformQuoteDisplayAmountSetting(\n data.shopping_cart_display_price\n ),\n shipping: transformQuoteDisplayAmountSetting(\n data.shopping_cart_display_shipping\n ),\n fullSummary: data.shopping_cart_display_full_summary,\n grandTotal: data.shopping_cart_display_grand_total,\n },\n useConfigurableParentThumbnail:\n data.configurable_thumbnail_source === 'parent',\n };\n}\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { State } from '@/quote-management/types/state.types';\n\n/**\n * Type definition for the auth/permissions event payload\n * Contains flat Adobe Commerce permission keys with boolean values\n */\nexport type AuthPermissionsPayload = {\n all?: boolean;\n 'Magento_NegotiableQuote::all'?: boolean;\n 'Magento_NegotiableQuote::manage'?: boolean;\n 'Magento_NegotiableQuote::checkout'?: boolean;\n 'Magento_NegotiableQuoteTemplate::all'?: boolean;\n 'Magento_NegotiableQuoteTemplate::view_template'?: boolean;\n 'Magento_NegotiableQuoteTemplate::manage'?: boolean;\n 'Magento_NegotiableQuoteTemplate::generate_quote'?: boolean;\n [key: string]: boolean | undefined;\n};\n\n/**\n * Maps the auth/permissions event payload to internal permissions structure.\n * \n * Implements hierarchical permission checking:\n * 1. Top-level \"all\": If true, grants all permissions\n * 2. Module-level \"::all\": Grants all permissions for that module\n * 3. Specific permissions: Maps individual keys to internal flags\n * \n * @param payload - The raw auth/permissions event payload\n * @returns Typed permissions object matching the state structure\n * \n * @example\n * ```typescript\n * const permissions = mapAuthPermissions({\n * \"Magento_NegotiableQuote::manage\": true,\n * \"Magento_NegotiableQuote::checkout\": true\n * });\n * // Returns: { requestQuote: true, editQuote: true, deleteQuote: true, checkoutQuote: true, ... }\n * ```\n */\nexport function mapAuthPermissions(\n payload: AuthPermissionsPayload | null | undefined\n): State['permissions'] {\n // Handle null/undefined payload - return all false\n if (!payload || typeof payload !== 'object') {\n return {\n requestQuote: false,\n editQuote: false,\n deleteQuote: false,\n checkoutQuote: false,\n viewQuoteTemplates: false,\n manageQuoteTemplates: false,\n generateQuoteFromTemplate: false,\n };\n }\n\n // If top-level \"all\" is true, grant all permissions\n if (payload.all === true) {\n return {\n requestQuote: true,\n editQuote: true,\n deleteQuote: true,\n checkoutQuote: true,\n viewQuoteTemplates: true,\n manageQuoteTemplates: true,\n generateQuoteFromTemplate: true,\n };\n }\n\n // Check module-level \"all\" permissions\n const hasAllQuotePermissions = payload['Magento_NegotiableQuote::all'] === true;\n const hasAllTemplatePermissions = payload['Magento_NegotiableQuoteTemplate::all'] === true;\n\n // Map specific permissions with fallback to module-level \"all\"\n const hasManagePermission = \n hasAllQuotePermissions || payload['Magento_NegotiableQuote::manage'] === true;\n\n return {\n // Magento_NegotiableQuote::manage maps to request, edit, and delete\n requestQuote: hasManagePermission,\n editQuote: hasManagePermission,\n deleteQuote: hasManagePermission,\n \n // Magento_NegotiableQuote::checkout maps to checkoutQuote\n checkoutQuote: \n hasAllQuotePermissions || payload['Magento_NegotiableQuote::checkout'] === true,\n \n // Template permissions\n viewQuoteTemplates: \n hasAllTemplatePermissions || payload['Magento_NegotiableQuoteTemplate::view_template'] === true,\n manageQuoteTemplates: \n hasAllTemplatePermissions || payload['Magento_NegotiableQuoteTemplate::manage'] === true,\n generateQuoteFromTemplate: \n hasAllTemplatePermissions || payload['Magento_NegotiableQuoteTemplate::generate_quote'] === true,\n };\n}\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport {\n state,\n DEFAULT_CONFIG,\n DEFAULT_PERMISSIONS,\n} from '@/quote-management/lib/state';\nimport { getQuoteData } from '@/quote-management/api/getQuoteData';\nimport { getStoreConfig } from '@/quote-management/api';\nimport { mapAuthPermissions, AuthPermissionsPayload } from '@/quote-management/utils/mapAuthPermissions';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n quoteId?: string;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // Set config\n initialize.config.setConfig({ ...defaultConfig, ...config });\n\n // Fetch store config\n await getStoreConfig()\n .then((config) => {\n state.config = config;\n })\n .catch((error) => {\n console.error('Failed to fetch store config: ', error);\n state.config = DEFAULT_CONFIG;\n });\n },\n\n listeners: () => [\n events.on(\n 'authenticated',\n async (authenticated) => {\n state.authenticated = !!authenticated;\n\n // Defensive: reset permissions if user logs out\n // This ensures permissions are cleared even if auth/permissions event doesn't fire\n if (!authenticated) {\n state.permissions = DEFAULT_PERMISSIONS;\n events.emit('quote-management/permissions', DEFAULT_PERMISSIONS);\n }\n },\n {\n eager: true,\n }\n ),\n events.on('auth/permissions', async (payload: AuthPermissionsPayload) => {\n // Map the auth permissions payload to internal permissions structure\n const permissions = mapAuthPermissions(payload);\n \n state.permissions = permissions;\n events.emit('quote-management/permissions', state.permissions);\n }, {\n eager: true,\n }),\n\n events.on(\n 'quote-management/permissions',\n async (permissions) => {\n const quoteId = initialize.config.getConfig().quoteId;\n if (!quoteId) {\n return;\n }\n\n if (permissions.editQuote) {\n getQuoteData(quoteId)\n .then((quoteData) => {\n events.emit(\n 'quote-management/quote-data/initialized',\n {\n quote: quoteData,\n permissions,\n },\n {}\n );\n })\n .catch((error) => {\n events.emit('quote-management/quote-data/error', {\n error,\n });\n });\n }\n },\n {\n eager: true,\n }\n ),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = /* GraphQL */ `\n query STORE_CONFIG_QUERY {\n storeConfig {\n cart_summary_display_quantity\n max_items_in_order_summary\n shopping_cart_display_full_summary\n shopping_cart_display_grand_total\n shopping_cart_display_price\n shopping_cart_display_shipping\n shopping_cart_display_subtotal\n shopping_cart_display_zero_tax\n configurable_thumbnail_source\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { StoreConfigModel } from '@/quote-management/data/models';\nimport { transformStoreConfig } from '@/quote-management/data/transforms';\nimport { STORE_CONFIG_QUERY } from './graphql/StoreConfigQuery';\n\nexport const getStoreConfig = async (): Promise<StoreConfigModel> => {\n return fetchGraphQl(STORE_CONFIG_QUERY, {\n method: 'GET',\n cache: 'force-cache',\n }).then(({ errors, data }) => {\n if (errors) {\n const errorMessage = errors.map((e: any) => e.message).join(', ');\n throw new Error(`Failed to get store config: ${errorMessage}`);\n }\n\n return transformStoreConfig(data.storeConfig);\n });\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteFragment';\n\nexport const SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION = `\n mutation SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION(\n $quoteUid: ID!\n $addressId: ID\n $addressData: NegotiableQuoteAddressInput\n ) {\n setNegotiableQuoteShippingAddress(\n input: {\n quote_uid: $quoteUid\n shipping_addresses: {\n customer_address_uid: $addressId\n address: $addressData\n }\n }\n ) {\n quote {\n ...NegotiableQuoteFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION } from './graphql/SetNegotiableQuoteShippingAddressMutation';\nimport { NegotiableQuoteModel } from '@/quote-management/data/models/negotiable-quote-model';\nimport { transformQuote } from '@/quote-management/data/transforms';\n\nexport interface AddressInput {\n /** City name */\n city: string;\n /** Optional company name */\n company?: string;\n /** Two-letter country code (e.g., 'US') */\n countryCode: string;\n /** First name */\n firstname: string;\n /** Last name */\n lastname: string;\n /** Postal/ZIP code */\n postcode: string;\n /** Optional state/province name */\n region?: string;\n /** Optional state/province ID */\n regionId?: number;\n /** Whether to save this address to the customer's address book */\n saveInAddressBook?: boolean;\n /** Street address lines (array) */\n street: string[];\n /** Phone number */\n telephone: string;\n /** \n * Additional input (optional custom fields for the address).\n * These fields will be merged into the address data sent to GraphQL.\n * Standard fields take precedence over additional fields to prevent\n * accidental override of required address attributes.\n * \n * @example\n * ```ts\n * additionalInput: {\n * vat_id: 'GB123456789',\n * custom_attribute: 'value',\n * delivery_instructions: 'Leave at door'\n * }\n * ```\n */\n additionalInput?: Record<string, any>;\n}\n\nexport interface SetShippingAddressInput {\n /** The unique ID of the negotiable quote */\n quoteUid: string;\n /** The ID of a saved customer address (use this OR addressData, not both) */\n addressId?: number;\n /** New address data (use this OR addressId, not both) */\n addressData?: AddressInput;\n}\n\n/**\n * Transform camelCase address data to snake_case for GraphQL mutation.\n * Additional fields from additionalInput are spread into the result, with\n * standard fields taking precedence (defensive flexibility approach).\n */\nfunction transformAddressToSnakeCase(address: AddressInput) {\n const { additionalInput, ...standardFields } = address;\n \n // Build the standard transformed fields\n const transformedStandardFields = {\n city: standardFields.city,\n company: standardFields.company,\n country_code: standardFields.countryCode,\n firstname: standardFields.firstname,\n lastname: standardFields.lastname,\n postcode: standardFields.postcode,\n region: standardFields.region,\n region_id: standardFields.regionId,\n save_in_address_book: standardFields.saveInAddressBook,\n street: standardFields.street,\n telephone: standardFields.telephone,\n };\n \n // Spread additional input first, then standard fields take precedence\n // This provides defensive flexibility: allows custom fields while protecting core fields\n return {\n ...(additionalInput || {}),\n ...transformedStandardFields,\n };\n}\n\n/**\n * Sets or updates the shipping address for a negotiable quote.\n * \n * @param input - The input parameters for setting the shipping address\n * @param input.quoteUid - The unique ID of the negotiable quote\n * @param input.addressId - Optional ID of a saved customer address (use this OR addressData)\n * @param input.addressData - Optional new address data (use this OR addressId)\n * @param input.addressData.additionalInput - Optional additional address fields to pass through to GraphQL\n * @returns Promise that resolves to the updated quote model with shipping addresses including uid field\n * @throws Error if validation fails or GraphQL operation fails\n * \n * @example\n * ```ts\n * // Using a saved address\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressId: 5\n * });\n * \n * // Using new address data\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressData: {\n * firstname: 'John',\n * lastname: 'Doe',\n * street: ['123 Main St'],\n * city: 'San Francisco',\n * countryCode: 'US',\n * postcode: '94103',\n * telephone: '555-1234'\n * }\n * });\n * \n * // Using address data with additional custom fields\n * const quote = await setShippingAddress({\n * quoteUid: 'quote-123',\n * addressData: {\n * firstname: 'John',\n * lastname: 'Doe',\n * street: ['123 Main St'],\n * city: 'San Francisco',\n * countryCode: 'US',\n * postcode: '94103',\n * telephone: '555-1234',\n * additionalInput: {\n * vat_id: 'GB123456789',\n * custom_attribute_1: 'value1',\n * delivery_instructions: 'Leave at door'\n * }\n * }\n * });\n * \n * // Access address identifier\n * if (quote?.shippingAddresses?.[0]) {\n * console.log('Address UID:', quote.shippingAddresses[0].uid);\n * }\n * ```\n */\nexport const setShippingAddress = async (\n input: SetShippingAddressInput\n): Promise<NegotiableQuoteModel | null> => {\n const { quoteUid, addressId, addressData } = input;\n\n if (!quoteUid) {\n throw new Error('Quote UID is required');\n }\n\n // Validate that exactly one of addressId or addressData is provided\n if (addressId === undefined && !addressData) {\n throw new Error('Either addressId or addressData must be provided');\n }\n\n if (addressId !== undefined && addressData) {\n throw new Error('Cannot provide both addressId and addressData');\n }\n\n // Transform addressData to snake_case if provided\n const transformedAddressData = addressData\n ? transformAddressToSnakeCase(addressData)\n : null;\n\n return fetchGraphQl(SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION, {\n variables: {\n quoteUid,\n addressId: addressId || null,\n addressData: transformedAddressData,\n },\n }).then((response) => {\n const { errors } = response;\n\n if (errors) {\n // Provide more detailed error information\n const errorMessages = errors.map((error) => error.message).join('; ');\n throw new Error(`Failed to set shipping address: ${errorMessages}`);\n }\n\n // Transform the quote data\n const quoteData = transformQuote(\n response.data?.setNegotiableQuoteShippingAddress?.quote\n );\n\n if (!quoteData) {\n throw new Error(\n 'Failed to transform quote data: Invalid response structure'\n );\n }\n\n // Emit event with transformed quote data on success\n events.emit('quote-management/shipping-address-set', {\n quote: quoteData,\n input: { quoteUid, addressId, addressData },\n });\n\n return quoteData;\n });\n};\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteTemplateFragment on NegotiableQuoteTemplate {\n # uid\n name\n # created_at\n # updated_at\n status\n # sales_rep_name\n expiration_date\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n items {\n uid\n product {\n name\n sku\n uid\n stock_status\n }\n prices {\n price {\n currency\n value\n }\n original_item_price {\n currency\n value\n }\n row_total {\n currency\n value\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n note_from_buyer {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n # negotiable_quote_template_item_uid\n note\n note_uid\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n }\n }\n prices {\n subtotal_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n applied_taxes {\n amount {\n currency\n value\n }\n label\n }\n grand_total {\n currency\n value\n }\n }\n shipping_addresses {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const GET_QUOTE_TEMPLATE_DATA = /* GraphQL */ `\n query QUOTE_TEMPLATE_DATA_QUERY($templateId: ID!) {\n negotiableQuoteTemplate(templateId: $templateId) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { GET_QUOTE_TEMPLATE_DATA } from './graphql/getQuoteTemplateData';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getQuoteTemplateData = async (templateId: string): Promise<NegotiableQuoteTemplateModel | null> => {\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n if (!templateId) {\n throw new Error('Template ID is required');\n }\n\n try {\n const results: any = await fetchGraphQl(GET_QUOTE_TEMPLATE_DATA, {\n variables: { templateId },\n });\n\n\n if (!results?.data?.negotiableQuoteTemplate) {\n throw new Error('Quote template not found');\n }\n\n const transformedData = transformQuoteTemplate(results.data.negotiableQuoteTemplate);\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from \"../../graphql/NegotiableQuoteTemplateFragment\";\n\nexport const CREATE_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation CREATE_QUOTE_TEMPLATE_MUTATION($cartId: ID!) {\n requestNegotiableQuoteTemplateFromQuote(input: { cart_id: $cartId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { events } from '@adobe-commerce/event-bus';\nimport { fetchGraphQl } from '@/quote-management/api/';\nimport { CREATE_QUOTE_TEMPLATE_MUTATION } from './graphql/createQuoteTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { NegotiableQuoteTemplateModel } from '@/quote-management/data/models/negotiable-quote-template-model';\n\nexport const createQuoteTemplate = async (\n quoteId: string\n): Promise<NegotiableQuoteTemplateModel | null> => {\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n if (!quoteId) {\n throw new Error('Cart ID is required');\n }\n\n try {\n const results: any = await fetchGraphQl(CREATE_QUOTE_TEMPLATE_MUTATION, {\n variables: {\n cartId: quoteId,\n },\n });\n\n if (!results?.data?.requestNegotiableQuoteTemplateFromQuote) {\n throw new Error('Failed to create quote template');\n }\n\n const transformedQuoteTemplate = transformQuoteTemplate(\n results.data.requestNegotiableQuoteTemplateFromQuote\n );\n\n if (!transformedQuoteTemplate) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedQuoteTemplate,\n permissions: state.permissions,\n });\n\n return transformedQuoteTemplate;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION = /* GraphQL */ `\n mutation SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION(\n $templateId: ID!\n $comment: String\n $name: String\n ) {\n submitNegotiableQuoteTemplateForReview(input: { template_id: $templateId, name: $name, comment: $comment }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION } from './graphql/sendQuoteTemplateForReview';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface SendQuoteTemplateForReviewParams {\n templateId: string;\n name?: string;\n comment?: string;\n}\n\nexport const sendQuoteTemplateForReview = async (\n params: SendQuoteTemplateForReviewParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION,\n {\n variables: {\n templateId: params.templateId,\n name: params.name,\n comment: params.comment,\n },\n }\n );\n\n if (!results?.data?.submitNegotiableQuoteTemplateForReview) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.submitNegotiableQuoteTemplateForReview\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const ACCEPT_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation ACCEPT_QUOTE_TEMPLATE_MUTATION($templateId: ID!) {\n acceptNegotiableQuoteTemplate(input: { template_id: $templateId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n \n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { ACCEPT_QUOTE_TEMPLATE_MUTATION } from './graphql/acceptQuoteTemplate';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AcceptQuoteTemplateParams {\n templateId: string;\n}\n\nexport const acceptQuoteTemplate = async (\n params: AcceptQuoteTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(ACCEPT_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId },\n });\n\n if (!results?.data?.acceptNegotiableQuoteTemplate) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.acceptNegotiableQuoteTemplate\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const CANCEL_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation CANCEL_QUOTE_TEMPLATE_MUTATION(\n $templateId: ID!\n $comment: String\n ) {\n cancelNegotiableQuoteTemplate(\n input: {\n template_id: $templateId\n cancellation_comment: $comment\n }\n ) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { CANCEL_QUOTE_TEMPLATE_MUTATION } from './graphql/cancelQuoteTemplate';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface CancelQuoteTemplateParams {\n templateId: string;\n comment?: string;\n}\n\nexport const cancelQuoteTemplate = async (\n params: CancelQuoteTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(CANCEL_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId, comment: params.comment },\n });\n\n if (!results?.data?.cancelNegotiableQuoteTemplate) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.cancelNegotiableQuoteTemplate\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const DELETE_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation DELETE_QUOTE_TEMPLATE_MUTATION($templateId: ID!) {\n deleteNegotiableQuoteTemplate(input: { template_id: $templateId })\n }\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { DELETE_QUOTE_TEMPLATE_MUTATION } from './graphql/deleteQuoteTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface DeleteQuoteTemplateParams {\n templateId: string;\n}\n\nexport const deleteQuoteTemplate = async (\n params: DeleteQuoteTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(DELETE_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId },\n });\n\n if (results?.errors && results.errors.length > 0) {\n const errorMessages = results.errors\n .map((e: any) => e?.message)\n .filter(Boolean)\n .join('; ');\n throw new Error(errorMessages || 'Failed to delete quote template');\n }\n\n const deleted = results?.data?.deleteNegotiableQuoteTemplate;\n\n if (!deleted) {\n throw new Error('Failed to delete quote template');\n }\n\n events.emit('quote-management/quote-template-deleted', {\n templateId: params.templateId,\n });\n\n return { templateId: params.templateId };\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const OPEN_QUOTE_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation OPEN_QUOTE_TEMPLATE_MUTATION($templateId: ID!) {\n openNegotiableQuoteTemplate(input: { template_id: $templateId }) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { OPEN_QUOTE_TEMPLATE_MUTATION } from './graphql/openQuoteTemplate';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface OpenQuoteTemplateParams {\n templateId: string;\n}\n\nexport const openQuoteTemplate = async (params: OpenQuoteTemplateParams) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(OPEN_QUOTE_TEMPLATE_MUTATION, {\n variables: { templateId: params.templateId },\n });\n\n if (!results?.data?.openNegotiableQuoteTemplate) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.openNegotiableQuoteTemplate\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION = /* GraphQL */ `\n mutation SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION(\n $templateId: ID!\n $shippingAddress: NegotiableQuoteTemplateShippingAddressInput!\n ) {\n setNegotiableQuoteTemplateShippingAddress(\n input: {\n template_id: $templateId\n shipping_address: $shippingAddress\n }\n ) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n \n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION } from './graphql/setNegotiableQuoteTemplateShippingAddress';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface NegotiableQuoteAddressInput {\n city: string;\n company?: string;\n countryCode: string;\n fax?: string;\n firstname: string;\n lastname: string;\n middlename?: string;\n postcode?: string;\n prefix?: string;\n region?: string;\n regionId?: number;\n saveInAddressBook?: boolean;\n street: string[];\n suffix?: string;\n telephone?: string;\n vatId?: string;\n}\n\nexport interface NegotiableQuoteTemplateShippingAddressInput {\n address?: NegotiableQuoteAddressInput;\n customerAddressUid?: string;\n customerNotes?: string;\n}\n\nexport interface AddQuoteTemplateShippingAddressParams {\n templateId: string;\n shippingAddress: NegotiableQuoteTemplateShippingAddressInput;\n}\n\nexport const addQuoteTemplateShippingAddress = async (\n params: AddQuoteTemplateShippingAddressParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.shippingAddress) {\n throw new Error('Shipping address is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n // Validate that at least one of address or customerAddressUid is provided\n if (\n !params.shippingAddress.address &&\n !params.shippingAddress.customerAddressUid\n ) {\n throw new Error('Either address or customerAddressUid must be provided');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION,\n {\n variables: {\n templateId: params.templateId,\n shippingAddress: {\n address: params.shippingAddress.address\n ? {\n city: params.shippingAddress.address.city,\n company: params.shippingAddress.address.company,\n country_code: params.shippingAddress.address.countryCode,\n fax: params.shippingAddress.address.fax,\n firstname: params.shippingAddress.address.firstname,\n lastname: params.shippingAddress.address.lastname,\n middlename: params.shippingAddress.address.middlename,\n postcode: params.shippingAddress.address.postcode,\n prefix: params.shippingAddress.address.prefix,\n region: params.shippingAddress.address.region,\n region_id: params.shippingAddress.address.regionId,\n save_in_address_book:\n params.shippingAddress.address.saveInAddressBook,\n street: params.shippingAddress.address.street,\n suffix: params.shippingAddress.address.suffix,\n telephone: params.shippingAddress.address.telephone,\n vat_id: params.shippingAddress.address.vatId,\n }\n : undefined,\n customer_address_uid: params.shippingAddress.customerAddressUid,\n customer_notes: params.shippingAddress.customerNotes,\n },\n },\n }\n );\n\n if (!results?.data?.setNegotiableQuoteTemplateShippingAddress) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setNegotiableQuoteTemplateShippingAddress\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION = /* GraphQL */ `\n mutation UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION(\n $input: UpdateNegotiableQuoteTemplateQuantitiesInput!\n ) {\n updateNegotiableQuoteTemplateQuantities(input: $input) {\n quote_template {\n ...NegotiableQuoteTemplateFragment\n }\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION } from './graphql/updateNegotiableQuoteTemplateQuantities';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface NegotiableQuoteTemplateItemQuantityInput {\n itemId: string;\n quantity: number;\n minQty?: number;\n maxQty?: number;\n}\n\nexport interface UpdateQuoteTemplateItemQuantitiesParams {\n templateId: string;\n items: NegotiableQuoteTemplateItemQuantityInput[];\n}\n\nexport const updateQuoteTemplateItemQuantities = async (\n params: UpdateQuoteTemplateItemQuantitiesParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.items || params.items.length === 0) {\n throw new Error('Items array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n items: params.items.map((item) => ({\n item_id: item.itemId,\n quantity: item.quantity,\n min_qty: item.minQty,\n max_qty: item.maxQty,\n })),\n },\n },\n }\n );\n\n if (\n !results?.data?.updateNegotiableQuoteTemplateQuantities?.quote_template\n ) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.updateNegotiableQuoteTemplateQuantities.quote_template\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION = /* GraphQL */ `\n mutation REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION(\n $input: RemoveNegotiableQuoteTemplateItemsInput!\n ) {\n removeNegotiableQuoteTemplateItems(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION } from './graphql/removeNegotiableQuoteTemplateItems';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface RemoveQuoteTemplateItemsParams {\n templateId: string;\n itemUids: string[];\n}\n\nexport const removeQuoteTemplateItems = async (\n params: RemoveQuoteTemplateItemsParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemUids || params.itemUids.length === 0) {\n throw new Error('Item UIDs array is required and must not be empty');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n item_uids: params.itemUids,\n },\n },\n }\n );\n\n if (!results?.data?.removeNegotiableQuoteTemplateItems) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.removeNegotiableQuoteTemplateItems\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT } from '@/quote-management/api/graphql/NegotiableQuoteTemplateFragment';\n\nexport const SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION = /* GraphQL */ `\n mutation SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION(\n $input: QuoteTemplateLineItemNoteInput!\n ) {\n setQuoteTemplateLineItemNote(input: $input) {\n ...NegotiableQuoteTemplateFragment\n }\n }\n ${NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT}\n`;\n\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION } from './graphql/setQuoteTemplateLineItemNote';\nimport { transformQuoteTemplate } from '@/quote-management/data/transforms';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface AddQuoteTemplateLineItemNoteParams {\n templateId: string;\n itemId: string;\n note?: string;\n}\n\nexport const addQuoteTemplateLineItemNote = async (\n params: AddQuoteTemplateLineItemNoteParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!params.itemId) {\n throw new Error('Item ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION,\n {\n variables: {\n input: {\n templateId: params.templateId,\n item_id: params.itemId,\n note: params.note,\n },\n },\n }\n );\n\n if (!results?.data?.setQuoteTemplateLineItemNote) {\n throw new Error('No quote template data received');\n }\n\n const transformedData = transformQuoteTemplate(\n results.data.setQuoteTemplateLineItemNote\n );\n\n if (!transformedData) {\n throw new Error('Failed to transform quote template data');\n }\n\n events.emit('quote-management/quote-template-data', {\n quoteTemplate: transformedData,\n permissions: state.permissions,\n });\n\n return transformedData;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nexport const GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION = /* GraphQL */ `\n mutation GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION(\n $input: GenerateNegotiableQuoteFromTemplateInput!\n ) {\n generateNegotiableQuoteFromTemplate(input: $input) {\n negotiable_quote_uid\n }\n }\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/quote-management/api';\nimport { GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION } from './graphql/generateNegotiableQuoteFromTemplate';\nimport { state } from '@/quote-management/lib/state';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface GenerateQuoteFromTemplateParams {\n templateId: string;\n}\n\nexport const generateQuoteFromTemplate = async (\n params: GenerateQuoteFromTemplateParams\n) => {\n if (!params.templateId) {\n throw new Error('Template ID is required');\n }\n\n if (!state.authenticated) {\n throw new Error('Unauthorized');\n }\n\n try {\n const results: any = await fetchGraphQl(\n GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION,\n {\n variables: {\n input: {\n template_id: params.templateId,\n },\n },\n }\n );\n\n if (\n !results?.data?.generateNegotiableQuoteFromTemplate?.negotiable_quote_uid\n ) {\n throw new Error('No quote UID received');\n }\n\n const quoteId =\n results.data.generateNegotiableQuoteFromTemplate.negotiable_quote_uid;\n\n events.emit('quote-management/quote-template-generated', {\n quoteId,\n });\n\n return { quoteId };\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"names":["transformStoreConfig","data","DEFAULT_CONFIG","transformQuoteDisplayAmountSetting","quoteDisplayAmountSetting","QuoteDisplayAmount","mapAuthPermissions","payload","hasAllQuotePermissions","hasAllTemplatePermissions","hasManagePermission","initialize","Initializer","config","defaultConfig","getStoreConfig","state","error","events","authenticated","DEFAULT_PERMISSIONS","permissions","quoteId","getQuoteData","quoteData","STORE_CONFIG_QUERY","fetchGraphQl","errors","errorMessage","e","SET_NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_MUTATION","NEGOTIABLE_QUOTE_FRAGMENT","transformAddressToSnakeCase","address","additionalInput","standardFields","transformedStandardFields","setShippingAddress","input","quoteUid","addressId","addressData","transformedAddressData","response","errorMessages","transformQuote","_b","_a","NEGOTIABLE_QUOTE_TEMPLATE_FRAGMENT","GET_QUOTE_TEMPLATE_DATA","getQuoteTemplateData","templateId","results","transformedData","transformQuoteTemplate","CREATE_QUOTE_TEMPLATE_MUTATION","createQuoteTemplate","transformedQuoteTemplate","SEND_QUOTE_TEMPLATE_FOR_REVIEW_MUTATION","sendQuoteTemplateForReview","params","ACCEPT_QUOTE_TEMPLATE_MUTATION","acceptQuoteTemplate","CANCEL_QUOTE_TEMPLATE_MUTATION","cancelQuoteTemplate","DELETE_QUOTE_TEMPLATE_MUTATION","deleteQuoteTemplate","OPEN_QUOTE_TEMPLATE_MUTATION","openQuoteTemplate","SET_NEGOTIABLE_QUOTE_TEMPLATE_SHIPPING_ADDRESS_MUTATION","addQuoteTemplateShippingAddress","UPDATE_NEGOTIABLE_QUOTE_TEMPLATE_QUANTITIES_MUTATION","updateQuoteTemplateItemQuantities","item","REMOVE_NEGOTIABLE_QUOTE_TEMPLATE_ITEMS_MUTATION","removeQuoteTemplateItems","SET_QUOTE_TEMPLATE_LINE_ITEM_NOTE_MUTATION","addQuoteTemplateLineItemNote","GENERATE_NEGOTIABLE_QUOTE_FROM_TEMPLATE_MUTATION","generateQuoteFromTemplate"],"mappings":"qzBAeO,SAASA,EAAqBC,EAA6B,CAChE,GAAI,CAACA,EAAM,OAAOC,EAElB,MAAMC,EACJC,GAGE,CACEC,EAAmB,aACnBA,EAAmB,aACnBA,EAAmB,yBAAA,EACnB,SAASD,CAAyB,EAE7BA,EAGFC,EAAmB,aAG5B,MAAO,CACL,yBAA0BJ,EAAK,8BAC/B,qBAAsBA,EAAK,2BAC3B,qBAAsB,CACpB,QAASA,EAAK,+BACd,SAAUE,EACRF,EAAK,8BAAA,EAEP,MAAOE,EACLF,EAAK,2BAAA,EAEP,SAAUE,EACRF,EAAK,8BAAA,EAEP,YAAaA,EAAK,mCAClB,WAAYA,EAAK,iCAAA,EAEnB,+BACEA,EAAK,gCAAkC,QAAA,CAE7C,CCPO,SAASK,EACdC,EACsB,CAEtB,GAAI,CAACA,GAAW,OAAOA,GAAY,SACjC,MAAO,CACL,aAAc,GACd,UAAW,GACX,Y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O,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF,EC9Da6D,EAAiE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECSjEC,GAA4B,MACvCnB,GACG,SACH,GAAI,CAACA,EAAO,WACV,MAAM,IAAI,MAAM,yBAAyB,EAG3C,GAAI,CAAC5C,EAAM,cACT,MAAM,IAAI,MAAM,cAAc,EAGhC,GAAI,CACF,MAAMoC,EAAe,MAAM1B,EACzBoD,EACA,CACE,UAAW,CACT,MAAO,CACL,YAAalB,EAAO,UAAA,CACtB,CACF,CACF,EAGF,GACE,GAACd,GAAAC,EAAAK,GAAA,YAAAA,EAAS,OAAT,YAAAL,EAAe,sCAAf,MAAAD,EAAoD,sBAErD,MAAM,IAAI,MAAM,uBAAuB,EAGzC,MAAMxB,EACJ8B,EAAQ,KAAK,oCAAoC,qBAEnD,OAAAlC,EAAO,KAAK,4CAA6C,CACvD,QAAAI,CAAA,CACD,EAEM,CAAE,QAAAA,CAAA,CACX,OAASL,EAAO,CACd,OAAO,QAAQ,OAAOA,CAAK,CAC7B,CACF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import*as e from"@dropins/tools/preact-compat.js";const o=t=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"}));export{o as S};
|
|
4
|
+
//# sourceMappingURL=ChevronDown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChevronDown.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/ChevronDown.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgChevronDown = (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\", { d: \"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"square\", strokeLinejoin: \"round\" }));\nexport default SvgChevronDown;\n"],"names":["SvgChevronDown","props","React"],"mappings":"kDACK,MAACA,EAAkBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,EAAG,kDAAmD,OAAQ,eAAgB,YAAa,IAAK,cAAe,SAAU,eAAgB,QAAS,CAAC","x_google_ignoreList":[0]}
|
|
@@ -74,7 +74,9 @@ const e=`
|
|
|
74
74
|
}
|
|
75
75
|
template_id
|
|
76
76
|
template_name
|
|
77
|
+
total_quantity
|
|
77
78
|
items {
|
|
79
|
+
__typename
|
|
78
80
|
uid
|
|
79
81
|
product {
|
|
80
82
|
name
|
|
@@ -82,11 +84,48 @@ const e=`
|
|
|
82
84
|
uid
|
|
83
85
|
stock_status
|
|
84
86
|
quantity
|
|
87
|
+
thumbnail {
|
|
88
|
+
label
|
|
89
|
+
url
|
|
90
|
+
}
|
|
85
91
|
price_range {
|
|
92
|
+
minimum_price {
|
|
93
|
+
regular_price {
|
|
94
|
+
value
|
|
95
|
+
currency
|
|
96
|
+
}
|
|
97
|
+
final_price {
|
|
98
|
+
value
|
|
99
|
+
currency
|
|
100
|
+
}
|
|
101
|
+
discount {
|
|
102
|
+
percent_off
|
|
103
|
+
amount_off
|
|
104
|
+
}
|
|
105
|
+
}
|
|
86
106
|
maximum_price {
|
|
87
107
|
regular_price {
|
|
88
108
|
value
|
|
109
|
+
currency
|
|
110
|
+
}
|
|
111
|
+
final_price {
|
|
112
|
+
value
|
|
113
|
+
currency
|
|
89
114
|
}
|
|
115
|
+
discount {
|
|
116
|
+
percent_off
|
|
117
|
+
amount_off
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
price_tiers {
|
|
122
|
+
quantity
|
|
123
|
+
final_price {
|
|
124
|
+
value
|
|
125
|
+
}
|
|
126
|
+
discount {
|
|
127
|
+
amount_off
|
|
128
|
+
percent_off
|
|
90
129
|
}
|
|
91
130
|
}
|
|
92
131
|
}
|
|
@@ -95,6 +134,10 @@ const e=`
|
|
|
95
134
|
currency
|
|
96
135
|
value
|
|
97
136
|
}
|
|
137
|
+
price_including_tax {
|
|
138
|
+
value
|
|
139
|
+
currency
|
|
140
|
+
}
|
|
98
141
|
original_item_price {
|
|
99
142
|
currency
|
|
100
143
|
value
|
|
@@ -107,6 +150,10 @@ const e=`
|
|
|
107
150
|
currency
|
|
108
151
|
value
|
|
109
152
|
}
|
|
153
|
+
row_total_including_tax {
|
|
154
|
+
value
|
|
155
|
+
currency
|
|
156
|
+
}
|
|
110
157
|
catalog_discount {
|
|
111
158
|
amount_off
|
|
112
159
|
percent_off
|
|
@@ -121,6 +168,7 @@ const e=`
|
|
|
121
168
|
}
|
|
122
169
|
}
|
|
123
170
|
quantity
|
|
171
|
+
is_available
|
|
124
172
|
note_from_buyer {
|
|
125
173
|
created_at
|
|
126
174
|
creator_id
|
|
@@ -139,11 +187,78 @@ const e=`
|
|
|
139
187
|
note_uid
|
|
140
188
|
__typename
|
|
141
189
|
}
|
|
190
|
+
... on SimpleCartItem {
|
|
191
|
+
customizable_options {
|
|
192
|
+
type
|
|
193
|
+
label
|
|
194
|
+
values {
|
|
195
|
+
label
|
|
196
|
+
value
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
142
200
|
... on ConfigurableCartItem {
|
|
143
201
|
configurable_options {
|
|
144
202
|
option_label
|
|
145
203
|
value_label
|
|
146
204
|
}
|
|
205
|
+
configured_variant {
|
|
206
|
+
uid
|
|
207
|
+
sku
|
|
208
|
+
stock_status
|
|
209
|
+
thumbnail {
|
|
210
|
+
label
|
|
211
|
+
url
|
|
212
|
+
}
|
|
213
|
+
price_range {
|
|
214
|
+
minimum_price {
|
|
215
|
+
regular_price {
|
|
216
|
+
value
|
|
217
|
+
currency
|
|
218
|
+
}
|
|
219
|
+
final_price {
|
|
220
|
+
value
|
|
221
|
+
currency
|
|
222
|
+
}
|
|
223
|
+
discount {
|
|
224
|
+
percent_off
|
|
225
|
+
amount_off
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
maximum_price {
|
|
229
|
+
regular_price {
|
|
230
|
+
value
|
|
231
|
+
currency
|
|
232
|
+
}
|
|
233
|
+
final_price {
|
|
234
|
+
value
|
|
235
|
+
currency
|
|
236
|
+
}
|
|
237
|
+
discount {
|
|
238
|
+
percent_off
|
|
239
|
+
amount_off
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
price_tiers {
|
|
244
|
+
quantity
|
|
245
|
+
final_price {
|
|
246
|
+
value
|
|
247
|
+
}
|
|
248
|
+
discount {
|
|
249
|
+
amount_off
|
|
250
|
+
percent_off
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
customizable_options {
|
|
255
|
+
type
|
|
256
|
+
label
|
|
257
|
+
values {
|
|
258
|
+
label
|
|
259
|
+
value
|
|
260
|
+
}
|
|
261
|
+
}
|
|
147
262
|
}
|
|
148
263
|
... on BundleCartItem {
|
|
149
264
|
bundle_options {
|
|
@@ -162,6 +277,20 @@ const e=`
|
|
|
162
277
|
}
|
|
163
278
|
}
|
|
164
279
|
}
|
|
280
|
+
... on DownloadableCartItem {
|
|
281
|
+
links {
|
|
282
|
+
sort_order
|
|
283
|
+
title
|
|
284
|
+
}
|
|
285
|
+
customizable_options {
|
|
286
|
+
type
|
|
287
|
+
label
|
|
288
|
+
values {
|
|
289
|
+
label
|
|
290
|
+
value
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
165
294
|
}
|
|
166
295
|
history {
|
|
167
296
|
uid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NegotiableQuoteFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/ShippingMethodFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteAddressFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteFragment.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\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 * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { SELECTED_SHIPPING_METHOD_FRAGMENT } from './ShippingMethodFragment';\n\nexport const NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT on NegotiableQuoteShippingAddress {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n }\n\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT } from './NegotiableQuoteAddressFragment';\n\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n is_virtual\n status\n sales_rep_name\n expiration_date\n updated_at\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n template_id\n template_name\n items {\n uid\n product {\n name\n sku\n uid\n stock_status\n quantity\n price_range {\n maximum_price {\n regular_price {\n value\n }\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n note_from_buyer {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n products_removed {\n products_removed_from_catalog\n products_removed_from_quote {\n uid\n name\n sku\n quantity\n }\n }\n }\n }\n prices {\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_excluding_tax {\n currency\n value\n }\n grand_total {\n currency\n value\n }\n grand_total_excluding_tax {\n currency\n value\n }\n applied_taxes {\n label\n amount {\n value\n currency\n }\n }\n discounts {\n amount {\n value\n currency\n }\n label\n coupon {\n code\n }\n applied_to\n }\n }\n\n shipping_addresses {\n ...NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT\n }\n }\n\n ${NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT}\n`;\n"],"names":["SELECTED_SHIPPING_METHOD_FRAGMENT","NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT","NEGOTIABLE_QUOTE_FRAGMENT"],"mappings":"AASO,MAAMA,EAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECElDC,EAA2D;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,IAyBpED,CAAiC;AAAA,ECzBxBE,EAA0C;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;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;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;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;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;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAoNnDD,CAA0C;"}
|
|
1
|
+
{"version":3,"file":"NegotiableQuoteFragment.js","sources":["/@dropins/storefront-quote-management/src/api/graphql/ShippingMethodFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteAddressFragment.ts","/@dropins/storefront-quote-management/src/api/graphql/NegotiableQuoteFragment.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\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 * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { SELECTED_SHIPPING_METHOD_FRAGMENT } from './ShippingMethodFragment';\n\nexport const NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT = /* GraphQL */ `\n fragment NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT on NegotiableQuoteShippingAddress {\n uid\n firstname\n lastname\n company\n street\n city\n region {\n code\n label\n region_id\n }\n postcode\n country {\n code\n label\n }\n telephone\n\n selected_shipping_method {\n ...SELECTED_SHIPPING_METHOD_FRAGMENT\n }\n }\n\n ${SELECTED_SHIPPING_METHOD_FRAGMENT}\n`;\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT } from './NegotiableQuoteAddressFragment';\n\nexport const NEGOTIABLE_QUOTE_FRAGMENT = /* GraphQL */ `\n fragment NegotiableQuoteFragment on NegotiableQuote {\n uid\n name\n created_at\n is_virtual\n status\n sales_rep_name\n expiration_date\n updated_at\n buyer {\n firstname\n lastname\n }\n comments {\n uid\n created_at\n author {\n firstname\n lastname\n }\n text\n attachments {\n name\n url\n }\n }\n template_id\n template_name\n total_quantity\n items {\n __typename\n uid\n product {\n name\n sku\n uid\n stock_status\n quantity\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n prices {\n price {\n currency\n value\n }\n price_including_tax {\n value\n currency\n }\n original_item_price {\n currency\n value\n }\n original_row_total {\n currency\n value\n }\n row_total {\n currency\n value\n }\n row_total_including_tax {\n value\n currency\n }\n catalog_discount {\n amount_off\n percent_off\n }\n discounts {\n label\n value\n amount {\n currency\n value\n }\n }\n }\n quantity\n is_available\n note_from_buyer {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n note_from_seller {\n created_at\n creator_id\n creator_type\n negotiable_quote_item_uid\n note\n note_uid\n __typename\n }\n ... on SimpleCartItem {\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n configured_variant {\n uid\n sku\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n price_tiers {\n quantity\n final_price {\n value\n }\n discount {\n amount_off\n percent_off\n }\n }\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n ... on BundleCartItem {\n bundle_options {\n label\n values {\n label\n quantity\n original_price {\n currency\n value\n }\n priceV2 {\n currency\n value\n }\n }\n }\n }\n ... on DownloadableCartItem {\n links {\n sort_order\n title\n }\n customizable_options {\n type\n label\n values {\n label\n value\n }\n }\n }\n }\n history {\n uid\n created_at\n author {\n firstname\n lastname\n }\n change_type\n changes {\n comment_added {\n comment\n }\n custom_changes {\n new_value\n old_value\n title\n }\n statuses {\n changes {\n new_status\n old_status\n }\n }\n expiration {\n new_expiration\n old_expiration\n }\n total {\n new_price {\n currency\n value\n }\n old_price {\n currency\n value\n }\n }\n products_removed {\n products_removed_from_catalog\n products_removed_from_quote {\n uid\n name\n sku\n quantity\n }\n }\n }\n }\n prices {\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_excluding_tax {\n currency\n value\n }\n grand_total {\n currency\n value\n }\n grand_total_excluding_tax {\n currency\n value\n }\n applied_taxes {\n label\n amount {\n value\n currency\n }\n }\n discounts {\n amount {\n value\n currency\n }\n label\n coupon {\n code\n }\n applied_to\n }\n }\n\n shipping_addresses {\n ...NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT\n }\n }\n\n ${NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT}\n`;\n"],"names":["SELECTED_SHIPPING_METHOD_FRAGMENT","NEGOTIABLE_QUOTE_SHIPPING_ADDRESS_FRAGMENT","NEGOTIABLE_QUOTE_FRAGMENT"],"mappings":"AASO,MAAMA,EAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECElDC,EAA2D;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,IAyBpED,CAAiC;AAAA,ECzBxBE,EAA0C;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;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;AAA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