@dropins/storefront-requisition-list 1.4.0-beta.0 → 1.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sources":["/@dropins/storefront-requisition-list/src/lib/state.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/graphql/storeConfigQuery.ts","/@dropins/storefront-requisition-list/src/lib/fetch-error.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts","/@dropins/storefront-requisition-list/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListItemsFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/graphql/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/data/transforms/transform-requisition-list.ts","/@dropins/storefront-requisition-list/src/lib/validate-uid.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/graphql/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/graphql/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/graphql/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/graphql/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/graphql/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/graphql/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/addProductsToRequisitionList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport type StoreConfig = {\n is_requisition_list_active?: string;\n company_enabled?: boolean;\n requisition_list_sharing_enabled?: boolean | string;\n requisition_list_share_max_recipients?: string | number | null;\n requisition_list_share_storefront_path?: string | null;\n [key: string]: any; // Allow additional config properties\n};\n\ntype State = {\n authenticated: boolean;\n config: StoreConfig | undefined;\n isCompanyUser: boolean;\n requisitionLists: RequisitionList[];\n requisitionListsLoading: boolean;\n requisitionListsVersion: number;\n};\n\nconst _state: State = (() => {\n return {\n authenticated: false,\n config: undefined,\n isCompanyUser: false,\n requisitionLists: [],\n requisitionListsLoading: false,\n requisitionListsVersion: 0,\n };\n})();\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n return Reflect.set(target, key, value);\n },\n get(target, key) {\n return target[key as keyof State];\n },\n});\n\n// Helper functions for managing requisition lists\nexport const setRequisitionLists = (lists: RequisitionList[]) => {\n state.requisitionLists = lists;\n state.requisitionListsVersion++;\n};\n\nexport const addRequisitionList = (list: RequisitionList) => {\n state.requisitionLists = [...state.requisitionLists, list];\n state.requisitionListsVersion++;\n};\n\nexport const updateRequisitionList = (list: RequisitionList) => {\n const exists = state.requisitionLists.some(\n (l: RequisitionList) => l.uid === list.uid\n );\n\n if (exists) {\n state.requisitionLists = state.requisitionLists.map((l: RequisitionList) =>\n l.uid === list.uid ? list : l\n );\n } else {\n state.requisitionLists = [...state.requisitionLists, list];\n }\n state.requisitionListsVersion++;\n};\n\nexport const getRequisitionListsFromState = () => {\n return state.requisitionLists;\n};\n\nexport const setRequisitionListsLoading = (loading: boolean) => {\n state.requisitionListsLoading = loading;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n is_requisition_list_active\n company_enabled\n requisition_list_sharing_enabled\n requisition_list_share_max_recipients\n requisition_list_share_storefront_path\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\n\nimport { STORE_CONFIG_QUERY } from './graphql/storeConfigQuery';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { StoreConfig } from '@/requisitionList/lib/state';\n\nexport const getStoreConfig = async (): Promise<any> => {\n try {\n const { errors, data } = await fetchGraphQl(STORE_CONFIG_QUERY, {\n cache: 'force-cache',\n });\n\n if (errors) {\n const missingField = errors.some(\n (error) =>\n (error.message &&\n error.message.includes(\n 'Cannot query field \"is_requisition_list_active\"'\n )) ||\n error.message.includes('Cannot query field \"company_enabled\"')\n );\n if (missingField) {\n return false;\n }\n const missingShareConfig = errors.some((error) =>\n error.message.includes(\n 'Cannot query field \"requisition_list_sharing_enabled\"'\n )\n );\n const missingShareMaxRecipientsConfig = errors.some((error) =>\n error.message.includes(\n 'Cannot query field \"requisition_list_share_max_recipients\"'\n )\n );\n const missingShareStorefrontPathConfig = errors.some((error) =>\n error.message.includes(\n 'Cannot query field \"requisition_list_share_storefront_path\"'\n )\n );\n\n if (missingShareConfig || missingShareMaxRecipientsConfig || missingShareStorefrontPathConfig) {\n return {\n ...data?.storeConfig,\n ...(missingShareConfig\n ? { requisition_list_sharing_enabled: false }\n : {}),\n ...(missingShareMaxRecipientsConfig\n ? { requisition_list_share_max_recipients: null }\n : {}),\n ...(missingShareStorefrontPathConfig\n ? { requisition_list_share_storefront_path: null }\n : {}),\n } as StoreConfig;\n }\n return handleFetchError(errors);\n }\n\n return data?.storeConfig;\n } catch {\n return {\n is_requisition_list_active: '0',\n company_enabled: false,\n requisition_list_sharing_enabled: false,\n requisition_list_share_max_recipients: null,\n requisition_list_share_storefront_path: null,\n } as StoreConfig;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/requisitionList/lib/state';\nimport { getStoreConfig } from '@/requisitionList/api/getStoreConfig';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n // Emit event to notify listeners that requisition list has been initialized\n events.emit('requisitionList/initialized', state.config);\n }\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', (authenticated) => {\n state.authenticated = authenticated;\n if (!authenticated) {\n state.isCompanyUser = false;\n }\n }),\n\n events.on(\n 'auth/permissions',\n (payload) => {\n // The `auth/permissions` event payload from storefront-auth is a\n // PermissionsModel: { all: true, admin?: true, [magentoPermId]: boolean }.\n // Non-company (guest/individual) users receive only `{ all: true }`.\n // Company users always have at least one additional truthy key —\n // either `admin: true` or a Magento B2B permission ID such as\n // `Magento_Company::view_company`. Therefore any truthy key beyond\n // `all` reliably identifies a company user.\n state.isCompanyUser =\n payload != null &&\n typeof payload === 'object' &&\n Object.entries(payload).some(\n ([key, value]) => value === true && key !== 'all'\n );\n },\n { eager: true }\n ),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_FRAGMENT = `\nfragment REQUISITION_LIST_FRAGMENT on RequisitionList {\n uid\n name\n description\n items_count\n updated_at\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_ITEMS_FRAGMENT = `\nfragment REQUISITION_LIST_ITEMS_FRAGMENT on RequistionListItems {\n items {\n uid\n quantity\n product {\n sku\n stock_status\n only_x_left_in_stock\n }\n customizable_options {\n customizable_option_uid\n is_required\n label\n sort_order\n type\n values {\n customizable_option_value_uid\n label\n value\n price {\n type\n units\n value\n }\n }\n }\n ... on ConfigurableRequisitionListItem {\n configurable_options {\n configurable_product_option_uid\n configurable_product_option_value_uid\n option_label\n value_label\n }\n }\n ... on DownloadableRequisitionListItem {\n links {\n price\n sample_url\n sort_order\n title\n uid\n }\n samples {\n sample_url\n sort_order\n title\n }\n }\n ... on BundleRequisitionListItem {\n bundle_options {\n uid\n type\n label\n values {\n uid\n label\n quantity\n priceV2 {\n value\n currency\n }\n original_price {\n value\n currency\n }\n }\n }\n }\n ... on GiftCardRequisitionListItem {\n gift_card_options {\n amount {\n currency\n value\n }\n custom_giftcard_amount {\n currency\n value\n }\n message\n recipient_email\n recipient_name\n sender_name\n sender_email\n }\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_REQUISITION_LIST_QUERY = `\n query GET_REQUISITION_LIST_QUERY(\n $requisitionListUid: String,\n $currentPage: Int = 1,\n $pageSize: Int = 10,\n ) {\n customer {\n requisition_lists (\n filter: {\n uids: {\n eq: $requisitionListUid\n }\n }\n ){\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\n/**\n * Nested list line items use pagination. Default listItemsPageSize is 100 per page;\n * getRequisitionLists fetches further pages per list when page_info.total_pages > 1\n * so PDP \"active\" / membership checks are not limited to the first page only.\n */\nexport const GET_REQUISITION_LISTS_QUERY = `\n query GET_REQUISITION_LISTS_QUERY(\n $currentPage: Int = 1\n $pageSize: Int = 10,\n $listItemsPageSize: Int = 100,\n $listItemsCurrentPage: Int = 1,\n ) {\n customer {\n requisition_lists(pageSize: $pageSize, currentPage: $currentPage) {\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $listItemsPageSize, currentPage: $listItemsCurrentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { RequisitionList } from '../models/requisitionList';\nimport {\n Item,\n ConfiguredProduct,\n Link,\n Sample,\n BundleOption,\n ConfigurableOption,\n RawCustomizableOption,\n GiftCardOption,\n} from '@/requisitionList/data/models/item';\n\n// Interface for raw API response data for a requisition list\nexport interface RawRequisitionListData {\n name: string;\n description: string;\n uid: string;\n updated_at: string;\n items_count: number;\n items: {\n items: RawItemData[];\n page_info: {\n total_pages: number;\n current_page: number;\n page_size: number;\n };\n };\n}\n\nexport function transformRequisitionList(\n data: RawRequisitionListData\n): RequisitionList | null {\n if (!data) {\n return null;\n }\n\n return {\n uid: data.uid,\n name: data.name,\n description: data.description,\n updated_at: data.updated_at,\n items_count: data.items_count,\n items: transformItems(data.items?.items),\n page_info: data.items?.page_info,\n };\n}\n\n// Interface for raw item data\ninterface RawItemData {\n uid: string;\n product: {\n sku: string;\n stock_status?: string;\n only_x_left_in_stock?: number | null;\n };\n quantity: number;\n customizable_options?: RawCustomizableOption[];\n bundle_options?: BundleOption[];\n configurable_options?: ConfigurableOption[];\n configured_product?: ConfiguredProduct;\n links?: Link[];\n samples?: Sample[];\n gift_card_options?: GiftCardOption;\n}\n\nfunction transformItems(items: RawItemData[]): Item[] {\n if (!items?.length) return [];\n\n return items.map((item: RawItemData) => {\n const transformedItem = {\n uid: item.uid,\n sku: item.product?.sku,\n quantity: item.quantity,\n stock_status: (item.product?.stock_status || 'IN_STOCK') as\n | 'IN_STOCK'\n | 'OUT_OF_STOCK',\n only_x_left_in_stock: item.product?.only_x_left_in_stock ?? null,\n customizable_options: item.customizable_options\n ? item.customizable_options.map((option) => ({\n uid: option.customizable_option_uid,\n is_required: option.is_required,\n label: option.label,\n sort_order: option.sort_order,\n type: option.type,\n values: option.values.map(\n (value: RawCustomizableOption['values'][number]) => ({\n uid: value.customizable_option_value_uid,\n label: value.label,\n price: value.price,\n value: value.value,\n })\n ),\n }))\n : [],\n bundle_options: item.bundle_options || [],\n configurable_options: item.configurable_options\n ? item.configurable_options.map((option) => ({\n option_uid: option.configurable_product_option_uid,\n option_label: option.option_label,\n value_uid: option.configurable_product_option_value_uid,\n value_label: option.value_label,\n }))\n : [],\n samples: item.samples\n ? item.samples.map((sample) => ({\n url: sample.sample_url,\n sort_order: sample.sort_order,\n title: sample.title,\n }))\n : [],\n gift_card_options: item.gift_card_options || {},\n };\n\n if (item.configured_product?.name) {\n return {\n ...transformedItem,\n configured_product: item.configured_product,\n };\n }\n return transformedItem;\n });\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Validates if a string is a valid base64-encoded UID\n * Adobe Commerce/Magento UIDs are base64 encoded\n *\n * @param uid - The UID to validate\n * @returns true if the UID appears to be valid base64 encoding\n */\nexport function isValidBase64Uid(uid: string | undefined | null): boolean {\n if (!uid || typeof uid !== 'string' || uid.length < 2) {\n return false;\n }\n\n // Base64 pattern: alphanumeric, +, /\n // Valid base64 can end with 0, 1, or 2 '=' padding characters\n // But the length must be a multiple of 4 when padded\n const base64Pattern = /^[A-Za-z0-9+/]+(==|=)?$/;\n\n if (!base64Pattern.test(uid)) {\n return false;\n }\n\n // Check that the total length is a multiple of 4 (valid base64 requirement)\n return uid.length % 4 === 0;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { GET_REQUISITION_LISTS_QUERY } from '@/requisitionList/api/getRequisitionLists/graphql/getRequisitionLists';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nasync function mergeRemainingListItemPages(\n list: RequisitionList,\n listItemsPageSize: number\n): Promise<RequisitionList> {\n const pi = list.page_info;\n if (!pi || pi.total_pages <= 1 || pi.current_page >= pi.total_pages) {\n return list;\n }\n\n const uid = String(list.uid);\n if (!isValidBase64Uid(uid)) {\n return list;\n }\n\n const mergedItems: Item[] = [...(list.items ?? [])];\n\n for (let page = pi.current_page + 1; page <= pi.total_pages; page += 1) {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: uid,\n currentPage: page,\n pageSize: listItemsPageSize,\n },\n });\n\n if (errors) {\n handleFetchError(errors);\n }\n\n const raw = data?.customer?.requisition_lists?.items?.[0];\n if (!raw) {\n break;\n }\n\n const chunk = transformRequisitionList(raw);\n if (chunk?.items?.length) {\n mergedItems.push(...chunk.items);\n }\n }\n\n return {\n ...list,\n items: mergedItems,\n page_info: {\n current_page: 1,\n total_pages: 1,\n page_size: mergedItems.length,\n },\n };\n}\n\nexport const getRequisitionLists = async (\n currentPage?: number,\n pageSize?: number,\n listItemsPageSize: number = 100\n): Promise<RequisitionList[] | null> => {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LISTS_QUERY, {\n variables: {\n currentPage,\n pageSize,\n listItemsPageSize,\n listItemsCurrentPage: 1,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists) {\n return null;\n }\n\n let reqLists = data.customer.requisition_lists.items.map(\n (requisitionList: any) => transformRequisitionList(requisitionList)\n );\n\n reqLists = await Promise.all(\n reqLists.map((list) =>\n list == null\n ? Promise.resolve(list)\n : mergeRemainingListItemPages(list, listItemsPageSize)\n )\n );\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.customer?.requisition_lists?.page_info,\n total_count: data.customer?.requisition_lists?.total_count,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getRequisitionList = async (\n requisitionListID: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n // Validate UID format before making API call\n if (!isValidBase64Uid(requisitionListID)) {\n console.error('Invalid requisition list UID format:', requisitionListID);\n return null;\n }\n\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: requisitionListID,\n currentPage,\n pageSize,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists?.items?.[0]) {\n return null;\n }\n\n const rawList = data.customer.requisition_lists.items[0];\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n $name: String!,\n $description: String,\n $pageSize: Int,\n $currentPage: Int\n ) {\n updateRequisitionList(\n requisitionListUid: $requisitionListUid\n input: {\n name: $name\n description: $description\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/updateRequisitionList/graphql/updateRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionList = async (\n requisitionListUid: string,\n name: string,\n description?: string,\n pageSize?: number,\n currentPage?: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(UPDATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListUid,\n name,\n description,\n pageSize,\n currentPage,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionList?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionList.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_MUTATION = `\n mutation DELETE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n ) {\n deleteRequisitionList(\n requisitionListUid: $requisitionListUid\n ) {\n status\n requisition_lists {\n items {\n ...REQUISITION_LIST_FRAGMENT\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { DELETE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/deleteRequisitionList/graphql/deleteRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionList = async (\n requisitionListUid: string\n): Promise<{\n items: RequisitionList[];\n page_info: any;\n status: any;\n} | null> => {\n return fetchGraphQl(DELETE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListUid,\n },\n }).then(({ errors, data }) => {\n if (!requisitionListUid) return null;\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionList?.requisition_lists) {\n return null;\n }\n\n const reqLists =\n data.deleteRequisitionList.requisition_lists?.items?.map(\n (requisitionList: any) => transformRequisitionList(requisitionList)\n ) || [];\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.deleteRequisitionList?.requisition_lists?.page_info,\n status: data.deleteRequisitionList?.status,\n };\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [UpdateRequisitionListItemsInput!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n updateRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/updateRequisitionListItems/graphql/updateRequisitionListItems';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionListItems = async (\n requisitionListUid: string,\n requisitionListItems: Array<UpdateRequisitionListItemsInput>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n UPDATE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems,\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n\ntype UpdateRequisitionListItemsInput = {\n item_id: string;\n quantity?: number;\n entered_options?: Array<{ uid: string; value: string }>;\n selected_options?: Array<string>;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation DELETE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n deleteRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { DELETE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionListItems = async (\n requisitionListUid: string,\n items: Array<string>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n DELETE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItemUids: items,\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.deleteRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!\n ) {\n addRequisitionListItemsToCart(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n status\n add_requisition_list_items_to_cart_user_errors {\n message\n type\n }\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n is_available\n }\n total_count\n }\n email\n total_quantity\n is_virtual\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart';\n\nexport interface AddToCartError {\n type: string;\n message: string;\n}\n\nexport const addRequisitionListItemsToCart = async (\n requisitionListUid: string,\n requisitionListItemUids: Array<string>\n): Promise<Array<AddToCartError> | null> => {\n return fetchGraphQl(ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (\n data.addRequisitionListItemsToCart\n .add_requisition_list_items_to_cart_user_errors?.length\n ) {\n return data.addRequisitionListItemsToCart.add_requisition_list_items_to_cart_user_errors.map(\n (e: any) => ({\n type: e.type,\n message: e.message || '',\n })\n );\n }\n return null;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: MoveItemsBetweenRequisitionListsInput,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n moveItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n source_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n destination_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface MoveItemsResult {\n sourceList: RequisitionList | null;\n destinationList: RequisitionList | null;\n}\n\nexport const moveItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[],\n pageSize: number,\n currentPage: number\n): Promise<MoveItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.moveItemsBetweenRequisitionLists) {\n return null;\n }\n\n const { source_requisition_list, destination_requisition_list } =\n data.moveItemsBetweenRequisitionLists;\n\n const sourceList = source_requisition_list\n ? transformRequisitionList(source_requisition_list)\n : null;\n\n const destinationList = destination_requisition_list\n ? transformRequisitionList(destination_requisition_list)\n : null;\n\n if (sourceList) {\n events.emit('requisitionList/data', sourceList);\n }\n\n return { sourceList, destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: CopyItemsBetweenRequisitionListsInput\n ) {\n copyItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface CopyItemsResult {\n destinationList: RequisitionList | null;\n}\n\nexport const copyItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[]\n): Promise<CopyItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.copyItemsBetweenRequisitionLists?.requisition_list) {\n return null;\n }\n\n const destinationList = transformRequisitionList(\n data.copyItemsBetweenRequisitionLists.requisition_list\n );\n\n return { destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_COMPANY_USERS_QUERY = `\n query GET_COMPANY_USERS_QUERY(\n $pageSize: Int = 100\n $currentPage: Int = 1\n ) {\n company {\n users(\n filter: { status: ACTIVE }\n pageSize: $pageSize\n currentPage: $currentPage\n ) {\n items {\n id\n firstname\n lastname\n email\n }\n page_info {\n total_pages\n current_page\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { GET_COMPANY_USERS_QUERY } from '@/requisitionList/api/getCompanyUsers/graphql/getCompanyUsers';\n\nexport interface CompanyUser {\n id: string;\n firstname: string;\n lastname: string;\n email: string;\n}\n\nconst PAGE_SIZE = 100;\n\nconst fetchPage = async (\n currentPage: number\n): Promise<{ items: CompanyUser[]; totalPages: number } | null> => {\n const { errors, data } = await fetchGraphQl(GET_COMPANY_USERS_QUERY, {\n variables: { pageSize: PAGE_SIZE, currentPage },\n });\n if (errors) return null;\n const users = data?.company?.users;\n if (!users?.items?.length) return null;\n return {\n items: users.items,\n totalPages: users.page_info?.total_pages ?? 1,\n };\n};\n\nexport const getCompanyUsers = async (): Promise<CompanyUser[]> => {\n const firstPage = await fetchPage(1);\n if (!firstPage) return [];\n\n const { items, totalPages } = firstPage;\n if (totalPages <= 1) return items;\n\n const remainingPages = await Promise.all(\n Array.from({ length: totalPages - 1 }, (_, i) => fetchPage(i + 2))\n );\n\n return [\n ...items,\n ...remainingPages.flatMap((page) => page?.items ?? []),\n ];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION(\n $requisitionListUid: ID!\n $customerUids: [ID!]!\n ) {\n shareRequisitionListByEmail(\n input: {\n requisitionListUid: $requisitionListUid\n customerUids: $customerUids\n }\n ) {\n sent_count\n user_errors {\n message\n code\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION } from '@/requisitionList/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail';\n\nexport interface ShareRequisitionListByEmailError {\n message: string;\n code: string;\n}\n\nexport const shareRequisitionListByEmail = async (\n requisitionListUid: string,\n customerUids: string[]\n): Promise<Array<ShareRequisitionListByEmailError> | null> => {\n return fetchGraphQl(SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION, {\n variables: { requisitionListUid, customerUids },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n const shareResult = data?.shareRequisitionListByEmail;\n\n if ((shareResult?.sent_count ?? 0) > 0) {\n return null;\n }\n\n if (shareResult?.user_errors?.length) {\n return shareResult.user_errors.map((e: ShareRequisitionListByEmailError) => ({\n message: e.message,\n code: e.code,\n }));\n }\n return [\n { code: 'SHARE_FAILED', message: 'Unable to share requisition list.' },\n ];\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION(\n $requisitionListUid: ID!\n ) {\n shareRequisitionListByToken(\n requisitionListUid: $requisitionListUid\n ) {\n token\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION } from '@/requisitionList/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken';\n\nexport interface ShareRequisitionListByTokenResult {\n token: string | null;\n errorMessage: string | null;\n}\n\nexport const shareRequisitionListByToken = async (\n requisitionListUid: string\n): Promise<ShareRequisitionListByTokenResult> => {\n try {\n const { errors, data } = await fetchGraphQl(\n SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION,\n { variables: { requisitionListUid } }\n );\n\n if (errors?.length) {\n return {\n token: null,\n errorMessage: errors[0]?.message ?? null,\n };\n }\n\n return {\n token: data?.shareRequisitionListByToken?.token ?? null,\n errorMessage: null,\n };\n } catch (error) {\n return {\n token: null,\n errorMessage:\n error instanceof Error\n ? error.message\n : 'Unable to generate share link.',\n };\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_SHARED_REQUISITION_LIST_QUERY = `\n query GET_SHARED_REQUISITION_LIST_QUERY(\n $token: String!\n $currentPage: Int = 1\n $pageSize: Int = 10\n ) {\n sharedRequisitionList(token: $token) {\n sender_name\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_SHARED_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getSharedRequisitionList/graphql/getSharedRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface SharedRequisitionListResult {\n senderName: string;\n requisitionList: RequisitionList;\n}\n\nexport const getSharedRequisitionList = async (\n token: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<SharedRequisitionListResult | null> => {\n const { errors, data } = await fetchGraphQl(GET_SHARED_REQUISITION_LIST_QUERY, {\n variables: { token, currentPage, pageSize },\n });\n\n if (errors) return handleFetchError(errors);\n\n const raw = data?.sharedRequisitionList;\n if (!raw?.requisition_list) {\n return null;\n }\n\n let requisitionList = transformRequisitionList(raw.requisition_list);\n if (!requisitionList) {\n return null;\n }\n\n if (requisitionList.items?.length && enrichConfigurableProducts) {\n requisitionList = {\n ...requisitionList,\n items: await enrichConfigurableProducts(requisitionList.items),\n };\n }\n\n return {\n senderName: raw.sender_name,\n requisitionList,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const IMPORT_SHARED_REQUISITION_LIST_MUTATION = `\n mutation IMPORT_SHARED_REQUISITION_LIST_MUTATION($token: String!) {\n importSharedRequisitionList(token: $token) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n user_errors {\n message\n code\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { IMPORT_SHARED_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/importSharedRequisitionList/graphql/importSharedRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface ImportSharedRequisitionListUserError {\n message: string;\n code: string;\n}\n\nexport interface ImportSharedRequisitionListResult {\n requisitionList: RequisitionList | null;\n userErrors: ImportSharedRequisitionListUserError[];\n}\n\nexport const importSharedRequisitionList = async (\n token: string\n): Promise<ImportSharedRequisitionListResult> => {\n const { errors, data } = await fetchGraphQl(\n IMPORT_SHARED_REQUISITION_LIST_MUTATION,\n { variables: { token } }\n );\n\n if (errors) return handleFetchError(errors);\n\n const result = data?.importSharedRequisitionList;\n\n return {\n requisitionList: result?.requisition_list\n ? (transformRequisitionList(result.requisition_list) ?? null)\n : null,\n userErrors: (result?.user_errors ?? []).map((e: ImportSharedRequisitionListUserError) => ({\n message: e.message,\n code: e.code,\n })),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION = `\n mutation ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [RequisitionListItemsInput!]!\n ) {\n addProductsToRequisitionList(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\n// Correct type for GraphQL RequisitionListItemsInput\nexport type RequisitionListItemsInput = {\n sku: string;\n quantity: number;\n parent_sku?: string;\n selected_options?: string[];\n entered_options?: Array<{ uid: string; value: string }>;\n};\n\nexport const addProductsToRequisitionList = async (\n requisitionListUid: string,\n requisitionListItems: Array<RequisitionListItemsInput>\n): Promise<RequisitionList | null> => {\n // Clean items before performing the mutation - remove empty fields\n const cleanedItems = requisitionListItems.map((item) => {\n const cleaned: any = {\n sku: item.sku,\n quantity: item.quantity,\n };\n\n if (item.parent_sku) cleaned.parent_sku = item.parent_sku;\n if (item.selected_options && item.selected_options.length > 0) {\n cleaned.selected_options = item.selected_options;\n }\n if (item.entered_options && item.entered_options.length > 0) {\n cleaned.entered_options = item.entered_options;\n }\n\n return cleaned;\n });\n\n const { errors, data } = await fetchGraphQl(\n ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems: cleanedItems,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.addProductsToRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.addProductsToRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n};\n"],"names":["_state","state","target","key","value","setRequisitionLists","lists","updateRequisitionList","list","l","getRequisitionListsFromState","setRequisitionListsLoading","loading","STORE_CONFIG_QUERY","handleFetchError","errors","errorMessage","e","getStoreConfig","data","fetchGraphQl","error","missingShareConfig","missingShareMaxRecipientsConfig","missingShareStorefrontPathConfig","initialize","Initializer","config","defaultConfig","events","authenticated","payload","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","getConfig","FetchGraphQL","REQUISITION_LIST_FRAGMENT","REQUISITION_LIST_ITEMS_FRAGMENT","GET_REQUISITION_LIST_QUERY","GET_REQUISITION_LISTS_QUERY","transformRequisitionList","transformItems","_a","_b","items","item","transformedItem","_c","option","sample","_d","isValidBase64Uid","uid","mergeRemainingListItemPages","listItemsPageSize","pi","mergedItems","page","raw","chunk","getRequisitionLists","currentPage","pageSize","reqLists","requisitionList","_e","getRequisitionList","requisitionListID","enrichConfigurableProducts","rawList","UPDATE_REQUISITION_LIST_MUTATION","requisitionListUid","name","description","DELETE_REQUISITION_LIST_MUTATION","deleteRequisitionList","_f","UPDATE_REQUISITION_LIST_ITEMS_MUTATION","updateRequisitionListItems","requisitionListItems","DELETE_REQUISITION_LIST_ITEMS_MUTATION","deleteRequisitionListItems","ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addRequisitionListItemsToCart","requisitionListItemUids","MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","moveItemsBetweenRequisitionLists","sourceRequisitionListUid","destinationRequisitionListUid","source_requisition_list","destination_requisition_list","sourceList","destinationList","COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","copyItemsBetweenRequisitionLists","GET_COMPANY_USERS_QUERY","PAGE_SIZE","fetchPage","users","getCompanyUsers","firstPage","totalPages","remainingPages","_","i","SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION","shareRequisitionListByEmail","customerUids","shareResult","SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION","shareRequisitionListByToken","GET_SHARED_REQUISITION_LIST_QUERY","getSharedRequisitionList","token","IMPORT_SHARED_REQUISITION_LIST_MUTATION","importSharedRequisitionList","result","CREATE_REQUISITION_LIST_MUTATION","createRequisitionList","ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION","addProductsToRequisitionList","cleanedItems","cleaned"],"mappings":"wKAqCA,MAAMA,EACG,CACL,cAAe,GACf,OAAQ,OACR,cAAe,GACf,iBAAkB,CAAC,EACnB,wBAAyB,GACzB,wBAAyB,CAC3B,EAIWC,EAAQ,IAAI,MAAMD,EAAQ,CACrC,IAAIE,EAAQC,EAAKC,EAAO,CACtB,OAAO,QAAQ,IAAIF,EAAQC,EAAKC,CAAK,CACvC,EACA,IAAIF,EAAQC,EAAK,CACf,OAAOD,EAAOC,CAAkB,CAAA,CAEpC,CAAC,EAGYE,EAAuBC,GAA6B,CAC/DL,EAAM,iBAAmBK,EACnBL,EAAA,yBACR,EAOaM,EAAyBC,GAA0B,CAC/CP,EAAM,iBAAiB,KACnCQ,GAAuB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reConfig/graphql/storeConfigQuery.ts","/@dropins/storefront-requisition-list/src/lib/fetch-error.ts","/@dropins/storefront-requisition-list/src/api/getStoreConfig/getStoreConfig.ts","/@dropins/storefront-requisition-list/src/api/initialize/initialize.ts","/@dropins/storefront-requisition-list/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/fragments/RequisitionListItemsFragment.graphql.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/graphql/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/graphql/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/data/transforms/transform-requisition-list.ts","/@dropins/storefront-requisition-list/src/lib/validate-uid.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionLists/getRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getRequisitionList/getRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/graphql/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionList/updateRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/graphql/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionList/deleteRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/graphql/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/updateRequisitionListItems/updateRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/deleteRequisitionListItems/deleteRequisitionListItems.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/addRequisitionListItemsToCart/addRequisitionListItemsToCart.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/moveItemsBetweenRequisitionLists/moveItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/copyItemsBetweenRequisitionLists/copyItemsBetweenRequisitionLists.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/graphql/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/getCompanyUsers/getCompanyUsers.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByEmail/shareRequisitionListByEmail.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/shareRequisitionListByToken/shareRequisitionListByToken.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/graphql/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/getSharedRequisitionList/getSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/graphql/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/importSharedRequisitionList/importSharedRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/graphql/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/createRequisitionList/createRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList.ts","/@dropins/storefront-requisition-list/src/api/addProductsToRequisitionList/addProductsToRequisitionList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\n\nexport type StoreConfig = {\n is_requisition_list_active?: string;\n company_enabled?: boolean;\n requisition_list_sharing_enabled?: boolean | string;\n requisition_list_share_max_recipients?: string | number | null;\n requisition_list_share_storefront_path?: string | null;\n [key: string]: any; // Allow additional config properties\n};\n\ntype State = {\n authenticated: boolean;\n config: StoreConfig | undefined;\n isCompanyUser: boolean;\n requisitionLists: RequisitionList[];\n requisitionListsLoading: boolean;\n requisitionListsVersion: number;\n};\n\nconst _state: State = (() => {\n return {\n authenticated: false,\n config: undefined,\n isCompanyUser: false,\n requisitionLists: [],\n requisitionListsLoading: false,\n requisitionListsVersion: 0,\n };\n})();\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n return Reflect.set(target, key, value);\n },\n get(target, key) {\n return target[key as keyof State];\n },\n});\n\n// Helper functions for managing requisition lists\nexport const setRequisitionLists = (lists: RequisitionList[]) => {\n state.requisitionLists = lists;\n state.requisitionListsVersion++;\n};\n\nexport const addRequisitionList = (list: RequisitionList) => {\n state.requisitionLists = [...state.requisitionLists, list];\n state.requisitionListsVersion++;\n};\n\nexport const updateRequisitionList = (list: RequisitionList) => {\n const exists = state.requisitionLists.some(\n (l: RequisitionList) => l.uid === list.uid\n );\n\n if (exists) {\n state.requisitionLists = state.requisitionLists.map((l: RequisitionList) =>\n l.uid === list.uid ? list : l\n );\n } else {\n state.requisitionLists = [...state.requisitionLists, list];\n }\n state.requisitionListsVersion++;\n};\n\nexport const getRequisitionListsFromState = () => {\n return state.requisitionLists;\n};\n\nexport const setRequisitionListsLoading = (loading: boolean) => {\n state.requisitionListsLoading = loading;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const STORE_CONFIG_QUERY = `\nquery STORE_CONFIG_QUERY {\n storeConfig {\n is_requisition_list_active\n company_enabled\n requisition_list_sharing_enabled\n requisition_list_share_max_recipients\n requisition_list_share_storefront_path\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\n\nimport { STORE_CONFIG_QUERY } from './graphql/storeConfigQuery';\nimport { handleFetchError } from '../../lib/fetch-error';\nimport { StoreConfig } from '@/requisitionList/lib/state';\n\nexport const getStoreConfig = async (): Promise<any> => {\n try {\n const { errors, data } = await fetchGraphQl(STORE_CONFIG_QUERY, {\n cache: 'force-cache',\n });\n\n if (errors) {\n const missingField = errors.some(\n (error) =>\n (error.message &&\n error.message.includes(\n 'Cannot query field \"is_requisition_list_active\"'\n )) ||\n error.message.includes('Cannot query field \"company_enabled\"')\n );\n if (missingField) {\n return false;\n }\n const missingShareConfig = errors.some((error) =>\n error.message.includes(\n 'Cannot query field \"requisition_list_sharing_enabled\"'\n )\n );\n const missingShareMaxRecipientsConfig = errors.some((error) =>\n error.message.includes(\n 'Cannot query field \"requisition_list_share_max_recipients\"'\n )\n );\n const missingShareStorefrontPathConfig = errors.some((error) =>\n error.message.includes(\n 'Cannot query field \"requisition_list_share_storefront_path\"'\n )\n );\n\n if (missingShareConfig || missingShareMaxRecipientsConfig || missingShareStorefrontPathConfig) {\n return {\n ...data?.storeConfig,\n ...(missingShareConfig\n ? { requisition_list_sharing_enabled: false }\n : {}),\n ...(missingShareMaxRecipientsConfig\n ? { requisition_list_share_max_recipients: null }\n : {}),\n ...(missingShareStorefrontPathConfig\n ? { requisition_list_share_storefront_path: null }\n : {}),\n } as StoreConfig;\n }\n return handleFetchError(errors);\n }\n\n return data?.storeConfig;\n } catch {\n return {\n is_requisition_list_active: '0',\n company_enabled: false,\n requisition_list_sharing_enabled: false,\n requisition_list_share_max_recipients: null,\n requisition_list_share_storefront_path: null,\n } as StoreConfig;\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { state } from '@/requisitionList/lib/state';\nimport { getStoreConfig } from '@/requisitionList/api/getStoreConfig';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n // set config\n if (!state.config) {\n state.config = await getStoreConfig();\n // Emit event to notify listeners that requisition list has been initialized\n events.emit('requisitionList/initialized', state.config);\n }\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [\n events.on('authenticated', (authenticated) => {\n state.authenticated = authenticated;\n if (!authenticated) {\n state.isCompanyUser = false;\n }\n }),\n\n events.on(\n 'auth/permissions',\n (payload) => {\n // Company users have admin: true (company admin) or at least one\n // Magento_Company::* key. Checking these specifically avoids false\n // positives from B2C-only permissions (e.g. Magento_Sales::place_order).\n state.isCompanyUser =\n payload != null &&\n typeof payload === 'object' &&\n Object.entries(payload).some(\n ([key, value]) =>\n value === true &&\n (key === 'admin' || key.startsWith('Magento_Company::'))\n );\n },\n { eager: true }\n ),\n ],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_FRAGMENT = `\nfragment REQUISITION_LIST_FRAGMENT on RequisitionList {\n uid\n name\n description\n items_count\n updated_at\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const REQUISITION_LIST_ITEMS_FRAGMENT = `\nfragment REQUISITION_LIST_ITEMS_FRAGMENT on RequistionListItems {\n items {\n uid\n quantity\n product {\n sku\n stock_status\n only_x_left_in_stock\n }\n customizable_options {\n customizable_option_uid\n is_required\n label\n sort_order\n type\n values {\n customizable_option_value_uid\n label\n value\n price {\n type\n units\n value\n }\n }\n }\n ... on ConfigurableRequisitionListItem {\n configurable_options {\n configurable_product_option_uid\n configurable_product_option_value_uid\n option_label\n value_label\n }\n }\n ... on DownloadableRequisitionListItem {\n links {\n price\n sample_url\n sort_order\n title\n uid\n }\n samples {\n sample_url\n sort_order\n title\n }\n }\n ... on BundleRequisitionListItem {\n bundle_options {\n uid\n type\n label\n values {\n uid\n label\n quantity\n priceV2 {\n value\n currency\n }\n original_price {\n value\n currency\n }\n }\n }\n }\n ... on GiftCardRequisitionListItem {\n gift_card_options {\n amount {\n currency\n value\n }\n custom_giftcard_amount {\n currency\n value\n }\n message\n recipient_email\n recipient_name\n sender_name\n sender_email\n }\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_REQUISITION_LIST_QUERY = `\n query GET_REQUISITION_LIST_QUERY(\n $requisitionListUid: String,\n $currentPage: Int = 1,\n $pageSize: Int = 10,\n ) {\n customer {\n requisition_lists (\n filter: {\n uids: {\n eq: $requisitionListUid\n }\n }\n ){\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\n/**\n * Nested list line items use pagination. Default listItemsPageSize is 100 per page;\n * getRequisitionLists fetches further pages per list when page_info.total_pages > 1\n * so PDP \"active\" / membership checks are not limited to the first page only.\n */\nexport const GET_REQUISITION_LISTS_QUERY = `\n query GET_REQUISITION_LISTS_QUERY(\n $currentPage: Int = 1\n $pageSize: Int = 10,\n $listItemsPageSize: Int = 100,\n $listItemsCurrentPage: Int = 1,\n ) {\n customer {\n requisition_lists(pageSize: $pageSize, currentPage: $currentPage) {\n items {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $listItemsPageSize, currentPage: $listItemsCurrentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { RequisitionList } from '../models/requisitionList';\nimport {\n Item,\n ConfiguredProduct,\n Link,\n Sample,\n BundleOption,\n ConfigurableOption,\n RawCustomizableOption,\n GiftCardOption,\n} from '@/requisitionList/data/models/item';\n\n// Interface for raw API response data for a requisition list\nexport interface RawRequisitionListData {\n name: string;\n description: string;\n uid: string;\n updated_at: string;\n items_count: number;\n items: {\n items: RawItemData[];\n page_info: {\n total_pages: number;\n current_page: number;\n page_size: number;\n };\n };\n}\n\nexport function transformRequisitionList(\n data: RawRequisitionListData\n): RequisitionList | null {\n if (!data) {\n return null;\n }\n\n return {\n uid: data.uid,\n name: data.name,\n description: data.description,\n updated_at: data.updated_at,\n items_count: data.items_count,\n items: transformItems(data.items?.items),\n page_info: data.items?.page_info,\n };\n}\n\n// Interface for raw item data\ninterface RawItemData {\n uid: string;\n product: {\n sku: string;\n stock_status?: string;\n only_x_left_in_stock?: number | null;\n };\n quantity: number;\n customizable_options?: RawCustomizableOption[];\n bundle_options?: BundleOption[];\n configurable_options?: ConfigurableOption[];\n configured_product?: ConfiguredProduct;\n links?: Link[];\n samples?: Sample[];\n gift_card_options?: GiftCardOption;\n}\n\nfunction transformItems(items: RawItemData[]): Item[] {\n if (!items?.length) return [];\n\n return items.map((item: RawItemData) => {\n const transformedItem = {\n uid: item.uid,\n sku: item.product?.sku,\n quantity: item.quantity,\n stock_status: (item.product?.stock_status || 'IN_STOCK') as\n | 'IN_STOCK'\n | 'OUT_OF_STOCK',\n only_x_left_in_stock: item.product?.only_x_left_in_stock ?? null,\n customizable_options: item.customizable_options\n ? item.customizable_options.map((option) => ({\n uid: option.customizable_option_uid,\n is_required: option.is_required,\n label: option.label,\n sort_order: option.sort_order,\n type: option.type,\n values: option.values.map(\n (value: RawCustomizableOption['values'][number]) => ({\n uid: value.customizable_option_value_uid,\n label: value.label,\n price: value.price,\n value: value.value,\n })\n ),\n }))\n : [],\n bundle_options: item.bundle_options || [],\n configurable_options: item.configurable_options\n ? item.configurable_options.map((option) => ({\n option_uid: option.configurable_product_option_uid,\n option_label: option.option_label,\n value_uid: option.configurable_product_option_value_uid,\n value_label: option.value_label,\n }))\n : [],\n samples: item.samples\n ? item.samples.map((sample) => ({\n url: sample.sample_url,\n sort_order: sample.sort_order,\n title: sample.title,\n }))\n : [],\n gift_card_options: item.gift_card_options || {},\n };\n\n if (item.configured_product?.name) {\n return {\n ...transformedItem,\n configured_product: item.configured_product,\n };\n }\n return transformedItem;\n });\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Validates if a string is a valid base64-encoded UID\n * Adobe Commerce/Magento UIDs are base64 encoded\n *\n * @param uid - The UID to validate\n * @returns true if the UID appears to be valid base64 encoding\n */\nexport function isValidBase64Uid(uid: string | undefined | null): boolean {\n if (!uid || typeof uid !== 'string' || uid.length < 2) {\n return false;\n }\n\n // Base64 pattern: alphanumeric, +, /\n // Valid base64 can end with 0, 1, or 2 '=' padding characters\n // But the length must be a multiple of 4 when padded\n const base64Pattern = /^[A-Za-z0-9+/]+(==|=)?$/;\n\n if (!base64Pattern.test(uid)) {\n return false;\n }\n\n // Check that the total length is a multiple of 4 (valid base64 requirement)\n return uid.length % 4 === 0;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { GET_REQUISITION_LISTS_QUERY } from '@/requisitionList/api/getRequisitionLists/graphql/getRequisitionLists';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nasync function mergeRemainingListItemPages(\n list: RequisitionList,\n listItemsPageSize: number\n): Promise<RequisitionList> {\n const pi = list.page_info;\n if (!pi || pi.total_pages <= 1 || pi.current_page >= pi.total_pages) {\n return list;\n }\n\n const uid = String(list.uid);\n if (!isValidBase64Uid(uid)) {\n return list;\n }\n\n const mergedItems: Item[] = [...(list.items ?? [])];\n\n for (let page = pi.current_page + 1; page <= pi.total_pages; page += 1) {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: uid,\n currentPage: page,\n pageSize: listItemsPageSize,\n },\n });\n\n if (errors) {\n handleFetchError(errors);\n }\n\n const raw = data?.customer?.requisition_lists?.items?.[0];\n if (!raw) {\n break;\n }\n\n const chunk = transformRequisitionList(raw);\n if (chunk?.items?.length) {\n mergedItems.push(...chunk.items);\n }\n }\n\n return {\n ...list,\n items: mergedItems,\n page_info: {\n current_page: 1,\n total_pages: 1,\n page_size: mergedItems.length,\n },\n };\n}\n\nexport const getRequisitionLists = async (\n currentPage?: number,\n pageSize?: number,\n listItemsPageSize: number = 100\n): Promise<RequisitionList[] | null> => {\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LISTS_QUERY, {\n variables: {\n currentPage,\n pageSize,\n listItemsPageSize,\n listItemsCurrentPage: 1,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists) {\n return null;\n }\n\n let reqLists = data.customer.requisition_lists.items.map(\n (requisitionList: any) => transformRequisitionList(requisitionList)\n );\n\n reqLists = await Promise.all(\n reqLists.map((list) =>\n list == null\n ? Promise.resolve(list)\n : mergeRemainingListItemPages(list, listItemsPageSize)\n )\n );\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.customer?.requisition_lists?.page_info,\n total_count: data.customer?.requisition_lists?.total_count,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GET_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getRequisitionList/graphql/getRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { isValidBase64Uid } from '@/requisitionList/lib/validate-uid';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const getRequisitionList = async (\n requisitionListID: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n // Validate UID format before making API call\n if (!isValidBase64Uid(requisitionListID)) {\n console.error('Invalid requisition list UID format:', requisitionListID);\n return null;\n }\n\n const { errors, data } = await fetchGraphQl(GET_REQUISITION_LIST_QUERY, {\n variables: {\n requisitionListUid: requisitionListID,\n currentPage,\n pageSize,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.customer?.requisition_lists?.items?.[0]) {\n return null;\n }\n\n const rawList = data.customer.requisition_lists.items[0];\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n $name: String!,\n $description: String,\n $pageSize: Int,\n $currentPage: Int\n ) {\n updateRequisitionList(\n requisitionListUid: $requisitionListUid\n input: {\n name: $name\n description: $description\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/updateRequisitionList/graphql/updateRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionList = async (\n requisitionListUid: string,\n name: string,\n description?: string,\n pageSize?: number,\n currentPage?: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(UPDATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListUid,\n name,\n description,\n pageSize,\n currentPage,\n },\n });\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionList?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionList.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_MUTATION = `\n mutation DELETE_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!,\n ) {\n deleteRequisitionList(\n requisitionListUid: $requisitionListUid\n ) {\n status\n requisition_lists {\n items {\n ...REQUISITION_LIST_FRAGMENT\n }\n page_info {\n page_size\n current_page\n total_pages\n }\n total_count\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { DELETE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/deleteRequisitionList/graphql/deleteRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionList = async (\n requisitionListUid: string\n): Promise<{\n items: RequisitionList[];\n page_info: any;\n status: any;\n} | null> => {\n return fetchGraphQl(DELETE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListUid,\n },\n }).then(({ errors, data }) => {\n if (!requisitionListUid) return null;\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionList?.requisition_lists) {\n return null;\n }\n\n const reqLists =\n data.deleteRequisitionList.requisition_lists?.items?.map(\n (requisitionList: any) => transformRequisitionList(requisitionList)\n ) || [];\n\n events.emit('requisitionLists/data', reqLists);\n\n return {\n items: reqLists,\n page_info: data.deleteRequisitionList?.requisition_lists?.page_info,\n status: data.deleteRequisitionList?.status,\n };\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const UPDATE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation UPDATE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [UpdateRequisitionListItemsInput!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n updateRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { UPDATE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/updateRequisitionListItems/graphql/updateRequisitionListItems';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const updateRequisitionListItems = async (\n requisitionListUid: string,\n requisitionListItems: Array<UpdateRequisitionListItemsInput>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n UPDATE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems,\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.updateRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.updateRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n\ntype UpdateRequisitionListItemsInput = {\n item_id: string;\n quantity?: number;\n entered_options?: Array<{ uid: string; value: string }>;\n selected_options?: Array<string>;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const DELETE_REQUISITION_LIST_ITEMS_MUTATION = `\n mutation DELETE_REQUISITION_LIST_ITEMS_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n deleteRequisitionListItems(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { DELETE_REQUISITION_LIST_ITEMS_MUTATION } from '@/requisitionList/api/deleteRequisitionListItems/graphql/deleteRequisitionListItems';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const deleteRequisitionListItems = async (\n requisitionListUid: string,\n items: Array<string>,\n pageSize: number,\n currentPage: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<RequisitionList | null> => {\n const { errors, data } = await fetchGraphQl(\n DELETE_REQUISITION_LIST_ITEMS_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItemUids: items,\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.deleteRequisitionListItems?.requisition_list) {\n return null;\n }\n\n const rawList = data.deleteRequisitionListItems.requisition_list;\n let payload = transformRequisitionList(rawList);\n if (payload?.items?.length && enrichConfigurableProducts) {\n payload = {\n ...payload,\n items: await enrichConfigurableProducts(payload.items),\n };\n }\n events.emit('requisitionList/data', payload);\n return payload;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION = `\n mutation ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItemUids: [ID!]!\n ) {\n addRequisitionListItemsToCart(\n requisitionListUid: $requisitionListUid\n requisitionListItemUids: $requisitionListItemUids\n ) {\n status\n add_requisition_list_items_to_cart_user_errors {\n message\n type\n }\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n is_available\n }\n total_count\n }\n email\n total_quantity\n is_virtual\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION } from '@/requisitionList/api/addRequisitionListItemsToCart/graphql/addRequisitionListItemsToCart';\n\nexport interface AddToCartError {\n type: string;\n message: string;\n}\n\nexport const addRequisitionListItemsToCart = async (\n requisitionListUid: string,\n requisitionListItemUids: Array<string>\n): Promise<Array<AddToCartError> | null> => {\n return fetchGraphQl(ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION, {\n variables: {\n requisitionListUid,\n requisitionListItemUids,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (\n data.addRequisitionListItemsToCart\n .add_requisition_list_items_to_cart_user_errors?.length\n ) {\n return data.addRequisitionListItemsToCart.add_requisition_list_items_to_cart_user_errors.map(\n (e: any) => ({\n type: e.type,\n message: e.message || '',\n })\n );\n }\n return null;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: MoveItemsBetweenRequisitionListsInput,\n $pageSize: Int = 20,\n $currentPage: Int = 1\n ) {\n moveItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n source_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n destination_requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/moveItemsBetweenRequisitionLists/graphql/moveItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport interface MoveItemsResult {\n sourceList: RequisitionList | null;\n destinationList: RequisitionList | null;\n}\n\nexport const moveItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[],\n pageSize: number,\n currentPage: number\n): Promise<MoveItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n pageSize,\n currentPage,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.moveItemsBetweenRequisitionLists) {\n return null;\n }\n\n const { source_requisition_list, destination_requisition_list } =\n data.moveItemsBetweenRequisitionLists;\n\n const sourceList = source_requisition_list\n ? transformRequisitionList(source_requisition_list)\n : null;\n\n const destinationList = destination_requisition_list\n ? transformRequisitionList(destination_requisition_list)\n : null;\n\n if (sourceList) {\n events.emit('requisitionList/data', sourceList);\n }\n\n return { sourceList, destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION = `\n mutation COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION(\n $sourceRequisitionListUid: ID!,\n $destinationRequisitionListUid: ID!,\n $requisitionListItem: CopyItemsBetweenRequisitionListsInput\n ) {\n copyItemsBetweenRequisitionLists(\n sourceRequisitionListUid: $sourceRequisitionListUid\n destinationRequisitionListUid: $destinationRequisitionListUid\n requisitionListItem: $requisitionListItem\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION } from '@/requisitionList/api/copyItemsBetweenRequisitionLists/graphql/copyItemsBetweenRequisitionLists';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface CopyItemsResult {\n destinationList: RequisitionList | null;\n}\n\nexport const copyItemsBetweenRequisitionLists = async (\n sourceRequisitionListUid: string,\n destinationRequisitionListUid: string,\n requisitionListItemUids: string[]\n): Promise<CopyItemsResult | null> => {\n const { errors, data } = await fetchGraphQl(\n COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION,\n {\n variables: {\n sourceRequisitionListUid,\n destinationRequisitionListUid,\n requisitionListItem: {\n requisitionListItemUids,\n },\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.copyItemsBetweenRequisitionLists?.requisition_list) {\n return null;\n }\n\n const destinationList = transformRequisitionList(\n data.copyItemsBetweenRequisitionLists.requisition_list\n );\n\n return { destinationList };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_COMPANY_USERS_QUERY = `\n query GET_COMPANY_USERS_QUERY(\n $pageSize: Int = 100\n $currentPage: Int = 1\n ) {\n company {\n users(\n filter: { status: ACTIVE }\n pageSize: $pageSize\n currentPage: $currentPage\n ) {\n items {\n id\n firstname\n lastname\n email\n }\n page_info {\n total_pages\n current_page\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { GET_COMPANY_USERS_QUERY } from '@/requisitionList/api/getCompanyUsers/graphql/getCompanyUsers';\n\nexport interface CompanyUser {\n id: string;\n firstname: string;\n lastname: string;\n email: string;\n}\n\nconst PAGE_SIZE = 100;\n\nconst fetchPage = async (\n currentPage: number\n): Promise<{ items: CompanyUser[]; totalPages: number } | null> => {\n const { errors, data } = await fetchGraphQl(GET_COMPANY_USERS_QUERY, {\n variables: { pageSize: PAGE_SIZE, currentPage },\n });\n if (errors) return null;\n const users = data?.company?.users;\n if (!users?.items?.length) return null;\n return {\n items: users.items,\n totalPages: users.page_info?.total_pages ?? 1,\n };\n};\n\nexport const getCompanyUsers = async (): Promise<CompanyUser[]> => {\n const firstPage = await fetchPage(1);\n if (!firstPage) return [];\n\n const { items, totalPages } = firstPage;\n if (totalPages <= 1) return items;\n\n const remainingPages = await Promise.all(\n Array.from({ length: totalPages - 1 }, (_, i) => fetchPage(i + 2))\n );\n\n return [\n ...items,\n ...remainingPages.flatMap((page) => page?.items ?? []),\n ];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION(\n $requisitionListUid: ID!\n $customerUids: [ID!]!\n ) {\n shareRequisitionListByEmail(\n input: {\n requisitionListUid: $requisitionListUid\n customerUids: $customerUids\n }\n ) {\n sent_count\n user_errors {\n message\n code\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION } from '@/requisitionList/api/shareRequisitionListByEmail/graphql/shareRequisitionListByEmail';\n\nexport interface ShareRequisitionListByEmailError {\n message: string;\n code: string;\n}\n\nexport const shareRequisitionListByEmail = async (\n requisitionListUid: string,\n customerUids: string[]\n): Promise<Array<ShareRequisitionListByEmailError> | null> => {\n return fetchGraphQl(SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION, {\n variables: { requisitionListUid, customerUids },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n const shareResult = data?.shareRequisitionListByEmail;\n\n if ((shareResult?.sent_count ?? 0) > 0) {\n return null;\n }\n\n if (shareResult?.user_errors?.length) {\n return shareResult.user_errors.map((e: ShareRequisitionListByEmailError) => ({\n message: e.message,\n code: e.code,\n }));\n }\n return [\n { code: 'SHARE_FAILED', message: 'Unable to share requisition list.' },\n ];\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION = `\n mutation SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION(\n $requisitionListUid: ID!\n ) {\n shareRequisitionListByToken(\n requisitionListUid: $requisitionListUid\n ) {\n token\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION } from '@/requisitionList/api/shareRequisitionListByToken/graphql/shareRequisitionListByToken';\n\nexport interface ShareRequisitionListByTokenResult {\n token: string | null;\n errorMessage: string | null;\n}\n\nexport const shareRequisitionListByToken = async (\n requisitionListUid: string\n): Promise<ShareRequisitionListByTokenResult> => {\n try {\n const { errors, data } = await fetchGraphQl(\n SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION,\n { variables: { requisitionListUid } }\n );\n\n if (errors?.length) {\n return {\n token: null,\n errorMessage: errors[0]?.message ?? null,\n };\n }\n\n return {\n token: data?.shareRequisitionListByToken?.token ?? null,\n errorMessage: null,\n };\n } catch (error) {\n return {\n token: null,\n errorMessage:\n error instanceof Error\n ? error.message\n : 'Unable to generate share link.',\n };\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const GET_SHARED_REQUISITION_LIST_QUERY = `\n query GET_SHARED_REQUISITION_LIST_QUERY(\n $token: String!\n $currentPage: Int = 1\n $pageSize: Int = 10\n ) {\n sharedRequisitionList(token: $token) {\n sender_name\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items(pageSize: $pageSize, currentPage: $currentPage) {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { GET_SHARED_REQUISITION_LIST_QUERY } from '@/requisitionList/api/getSharedRequisitionList/graphql/getSharedRequisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { Item } from '@/requisitionList/data/models/item';\n\nexport interface SharedRequisitionListResult {\n senderName: string;\n requisitionList: RequisitionList;\n}\n\nexport const getSharedRequisitionList = async (\n token: string,\n currentPage?: number,\n pageSize?: number,\n enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>\n): Promise<SharedRequisitionListResult | null> => {\n const { errors, data } = await fetchGraphQl(GET_SHARED_REQUISITION_LIST_QUERY, {\n variables: { token, currentPage, pageSize },\n });\n\n if (errors) return handleFetchError(errors);\n\n const raw = data?.sharedRequisitionList;\n if (!raw?.requisition_list) {\n return null;\n }\n\n let requisitionList = transformRequisitionList(raw.requisition_list);\n if (!requisitionList) {\n return null;\n }\n\n if (requisitionList.items?.length && enrichConfigurableProducts) {\n requisitionList = {\n ...requisitionList,\n items: await enrichConfigurableProducts(requisitionList.items),\n };\n }\n\n return {\n senderName: raw.sender_name,\n requisitionList,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const IMPORT_SHARED_REQUISITION_LIST_MUTATION = `\n mutation IMPORT_SHARED_REQUISITION_LIST_MUTATION($token: String!) {\n importSharedRequisitionList(token: $token) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n user_errors {\n message\n code\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2026 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { IMPORT_SHARED_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/importSharedRequisitionList/graphql/importSharedRequisitionList';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\n\nexport interface ImportSharedRequisitionListUserError {\n message: string;\n code: string;\n}\n\nexport interface ImportSharedRequisitionListResult {\n requisitionList: RequisitionList | null;\n userErrors: ImportSharedRequisitionListUserError[];\n}\n\nexport const importSharedRequisitionList = async (\n token: string\n): Promise<ImportSharedRequisitionListResult> => {\n const { errors, data } = await fetchGraphQl(\n IMPORT_SHARED_REQUISITION_LIST_MUTATION,\n { variables: { token } }\n );\n\n if (errors) return handleFetchError(errors);\n\n const result = data?.importSharedRequisitionList;\n\n return {\n requisitionList: result?.requisition_list\n ? (transformRequisitionList(result.requisition_list) ?? null)\n : null,\n userErrors: (result?.user_errors ?? []).map((e: ImportSharedRequisitionListUserError) => ({\n message: e.message,\n code: e.code,\n })),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\n\nexport const CREATE_REQUISITION_LIST_MUTATION = `\n mutation CREATE_REQUISITION_LIST_MUTATION(\n $requisitionListName: String!,\n $requisitionListDescription: String,\n ) {\n createRequisitionList(\n input: {\n name: $requisitionListName\n description: $requisitionListDescription\n }\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n }\n }\n }\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { CREATE_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/createRequisitionList/graphql/createRequisitionList';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const createRequisitionList = async (\n name: string,\n description?: string\n): Promise<RequisitionList | null> => {\n return fetchGraphQl(CREATE_REQUISITION_LIST_MUTATION, {\n variables: {\n requisitionListName: name,\n requisitionListDescription: description,\n },\n }).then(({ errors, data }) => {\n if (errors) return handleFetchError(errors);\n\n if (!data?.createRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.createRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n });\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { REQUISITION_LIST_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListFragment.graphql';\nimport { REQUISITION_LIST_ITEMS_FRAGMENT } from '@/requisitionList/api/fragments/RequisitionListItemsFragment.graphql';\n\nexport const ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION = `\n mutation ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION(\n $requisitionListUid: ID!, \n $requisitionListItems: [RequisitionListItemsInput!]!\n ) {\n addProductsToRequisitionList(\n requisitionListUid: $requisitionListUid\n requisitionListItems: $requisitionListItems\n ) {\n requisition_list {\n ...REQUISITION_LIST_FRAGMENT\n items {\n ...REQUISITION_LIST_ITEMS_FRAGMENT\n }\n }\n }\n }\n${REQUISITION_LIST_ITEMS_FRAGMENT}\n${REQUISITION_LIST_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { RequisitionList } from '@/requisitionList/data/models/requisitionList';\nimport { fetchGraphQl } from '@/requisitionList/api';\nimport { ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION } from '@/requisitionList/api/addProductsToRequisitionList/graphql/addProductsToRequisitionList';\nimport { handleFetchError } from '@/requisitionList/lib/fetch-error';\nimport { transformRequisitionList } from '@/requisitionList/data/transforms';\nimport { events } from '@adobe-commerce/event-bus';\n\n// Correct type for GraphQL RequisitionListItemsInput\nexport type RequisitionListItemsInput = {\n sku: string;\n quantity: number;\n parent_sku?: string;\n selected_options?: string[];\n entered_options?: Array<{ uid: string; value: string }>;\n};\n\nexport const addProductsToRequisitionList = async (\n requisitionListUid: string,\n requisitionListItems: Array<RequisitionListItemsInput>\n): Promise<RequisitionList | null> => {\n // Clean items before performing the mutation - remove empty fields\n const cleanedItems = requisitionListItems.map((item) => {\n const cleaned: any = {\n sku: item.sku,\n quantity: item.quantity,\n };\n\n if (item.parent_sku) cleaned.parent_sku = item.parent_sku;\n if (item.selected_options && item.selected_options.length > 0) {\n cleaned.selected_options = item.selected_options;\n }\n if (item.entered_options && item.entered_options.length > 0) {\n cleaned.entered_options = item.entered_options;\n }\n\n return cleaned;\n });\n\n const { errors, data } = await fetchGraphQl(\n ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION,\n {\n variables: {\n requisitionListUid,\n requisitionListItems: cleanedItems,\n },\n }\n );\n\n if (errors) return handleFetchError(errors);\n\n if (!data?.addProductsToRequisitionList?.requisition_list) {\n return null;\n }\n\n const payload = transformRequisitionList(\n data.addProductsToRequisitionList.requisition_list\n );\n events.emit('requisitionList/data', payload);\n return payload;\n};\n"],"names":["_state","state","target","key","value","setRequisitionLists","lists","updateRequisitionList","list","l","getRequisitionListsFromState","setRequisitionListsLoading","loading","STORE_CONFIG_QUERY","handleFetchError","errors","errorMessage","e","getStoreConfig","data","fetchGraphQl","error","missingShareConfig","missingShareMaxRecipientsConfig","missingShareStorefrontPathConfig","initialize","Initializer","config","defaultConfig","events","authenticated","payload","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","getConfig","FetchGraphQL","REQUISITION_LIST_FRAGMENT","REQUISITION_LIST_ITEMS_FRAGMENT","GET_REQUISITION_LIST_QUERY","GET_REQUISITION_LISTS_QUERY","transformRequisitionList","transformItems","_a","_b","items","item","transformedItem","_c","option","sample","_d","isValidBase64Uid","uid","mergeRemainingListItemPages","listItemsPageSize","pi","mergedItems","page","raw","chunk","getRequisitionLists","currentPage","pageSize","reqLists","requisitionList","_e","getRequisitionList","requisitionListID","enrichConfigurableProducts","rawList","UPDATE_REQUISITION_LIST_MUTATION","requisitionListUid","name","description","DELETE_REQUISITION_LIST_MUTATION","deleteRequisitionList","_f","UPDATE_REQUISITION_LIST_ITEMS_MUTATION","updateRequisitionListItems","requisitionListItems","DELETE_REQUISITION_LIST_ITEMS_MUTATION","deleteRequisitionListItems","ADD_REQUISITION_LIST_ITEMS_TO_CART_MUTATION","addRequisitionListItemsToCart","requisitionListItemUids","MOVE_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","moveItemsBetweenRequisitionLists","sourceRequisitionListUid","destinationRequisitionListUid","source_requisition_list","destination_requisition_list","sourceList","destinationList","COPY_ITEMS_BETWEEN_REQUISITION_LISTS_MUTATION","copyItemsBetweenRequisitionLists","GET_COMPANY_USERS_QUERY","PAGE_SIZE","fetchPage","users","getCompanyUsers","firstPage","totalPages","remainingPages","_","i","SHARE_REQUISITION_LIST_BY_EMAIL_MUTATION","shareRequisitionListByEmail","customerUids","shareResult","SHARE_REQUISITION_LIST_BY_TOKEN_MUTATION","shareRequisitionListByToken","GET_SHARED_REQUISITION_LIST_QUERY","getSharedRequisitionList","token","IMPORT_SHARED_REQUISITION_LIST_MUTATION","importSharedRequisitionList","result","CREATE_REQUISITION_LIST_MUTATION","createRequisitionList","ADD_PRODUCTS_TO_REQUISITION_LIST_MUTATION","addProductsToRequisitionList","cleanedItems","cleaned"],"mappings":"wKAqCA,MAAMA,EACG,CACL,cAAe,GACf,OAAQ,OACR,cAAe,GACf,iBAAkB,CAAC,EACnB,wBAAyB,GACzB,wBAAyB,CAC3B,EAIWC,EAAQ,IAAI,MAAMD,EAAQ,CACrC,IAAIE,EAAQC,EAAKC,EAAO,CACtB,OAAO,QAAQ,IAAIF,EAAQC,EAAKC,CAAK,CACvC,EACA,IAAIF,EAAQC,EAAK,CACf,OAAOD,EAAOC,CAAkB,CAAA,CAEpC,CAAC,EAGYE,EAAuBC,GAA6B,CAC/DL,EAAM,iBAAmBK,EACnBL,EAAA,yBACR,EAOaM,EAAyBC,GAA0B,CAC/CP,EAAM,iBAAiB,KACnCQ,GAAuBA,EAAE,MAAQD,EAAK,GACzC,EAGQP,EAAA,iBAAmBA,EAAM,iBAAiB,IAAKQ,GACnDA,EAAE,MAAQD,EAAK,IAAMA,EAAOC,CAC9B,EAEAR,EAAM,iBAAmB,CAAC,GAAGA,EAAM,iBAAkBO,CAAI,EAErDP,EAAA,yBACR,EAEaS,EAA+B,IACnCT,EAAM,iBAGFU,GAA8BC,GAAqB,CAC9DX,EAAM,wBAA0BW,CAClC,ECzEaC,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBvDlF,CAA+B;AAAA,EAC/BD,CAAyB;AAAA,ECLdoF,GAA+B,MAC1CjD,EACAQ,IACoC,OAEpC,MAAM0C,EAAe1C,EAAqB,IAAKlC,GAAS,CACtD,MAAM6E,EAAe,CACnB,IAAK7E,EAAK,IACV,SAAUA,EAAK,QACjB,EAEA,OAAIA,EAAK,aAAoB6E,EAAA,WAAa7E,EAAK,YAC3CA,EAAK,kBAAoBA,EAAK,iBAAiB,OAAS,IAC1D6E,EAAQ,iBAAmB7E,EAAK,kBAE9BA,EAAK,iBAAmBA,EAAK,gBAAgB,OAAS,IACxD6E,EAAQ,gBAAkB7E,EAAK,iBAG1B6E,CAAA,CACR,EAEK,CAAE,OAAA7G,EAAQ,KAAAI,CAAK,EAAI,MAAMC,EAC7BqG,EACA,CACE,UAAW,CACT,mBAAAhD,EACA,qBAAsBkD,CAAA,CACxB,CAEJ,EAEI,GAAA5G,EAAe,OAAAD,EAAiBC,CAAM,EAEtC,GAAA,GAAC6B,EAAAzB,GAAA,YAAAA,EAAM,+BAAN,MAAAyB,EAAoC,kBAChC,OAAA,KAGT,MAAMb,EAAUW,EACdvB,EAAK,6BAA6B,gBACpC,EACO,OAAAU,EAAA,KAAK,uBAAwBE,CAAO,EACpCA,CACT"}
@@ -13,7 +13,7 @@ export interface RequisitionListHeaderProps {
13
13
  }) => void;
14
14
  enrichConfigurableProducts?: (items: Item[]) => Promise<Item[]>;
15
15
  currentCustomerEmail?: string;
16
- routeSharedRequisitionList?: (token: string) => string;
16
+ routeSharedRequisitionList?: (relativeUrl: string) => string;
17
17
  }
18
18
  export declare const RequisitionListHeader: Container<RequisitionListHeaderProps>;
19
19
  //# sourceMappingURL=RequisitionListHeader.d.ts.map
@@ -33,7 +33,7 @@ export interface RequisitionListViewProps extends HTMLAttributes<HTMLDivElement>
33
33
  getProductData: (skus: string[]) => Promise<Product[] | null>;
34
34
  enrichConfigurableProducts: (items: Item[]) => Promise<Item[]>;
35
35
  currentCustomerEmail?: string;
36
- routeSharedRequisitionList?: (token: string) => string;
36
+ routeSharedRequisitionList?: (relativeUrl: string) => string;
37
37
  }
38
38
  export declare const RequisitionListView: Container<RequisitionListViewProps>;
39
39
  //# sourceMappingURL=RequisitionListView.d.ts.map