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yB,CACzH,EAAwB,eAAmB,CAAC,GAAI,EAAI,UAAW,GAAkB,kBAAmB,CACxF,eAAmB,CAAC,EAAW,CAAI,QAAJ,YAAI,kDAAiI,QAChL,SACA,EAAuB,eAAmB,CAAC,GAAI,EAAI,UAAW,GAAkB,sBAAuB,CAC3F,eAAmB,CAAC,EAAU,CAAI,KAAe,EAAnB,CAAmB,KAC7D,EACA,sCCtDA,UAiBA,WAPA,YAGA,IAFA,eAEA,2BACA,QACA,mBChBA,MAAe,EAAQ,KAAa,EACpC,EAAe,EAAQ,KAAY,CADb,CAEtB,EAAe,EAAQ,KAAY,CADb,CAItB,MAGA,IANsB,mBAStB,eAGA,gBAGA,UA8CA,WArBA,YACA,sBACA,SAEA,QACA,SAEA,SACA,iDACA,aACA,CACA,sBACA,kBAEA,OACA,gBACA,oBACA,oBACA,cACA,mBC7DA,MAAsB,EAAQ,KAAoB,EAGlD,SAeA,CAlB6B,CAkB7B,QANA,YACA,SACA,gCACA,CACA","sources":["webpack://_N_E/./node_modules/lodash/now.js","webpack://_N_E/./node_modules/lodash/debounce.js","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Grid/Grid.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Pagination/useRange.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconChevronLeft.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconChevronRight.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Pagination/PaginationItem.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Pagination/usePaginationItems.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Pagination/Pagination.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Pagination/usePagination.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/FieldGroupIcon/FieldGroupIcon.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/FieldGroupIcon/FieldGroupIconButton.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Field/FieldClearButton.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconSearch.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/SearchField/SearchFieldButton.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/hooks/useComposeRefsCallback.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/SearchField/useSearchField.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/SearchField/SearchField.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Collection/utils.mjs","webpack://_N_E/./node_modules/@aws-amplify/ui-react/dist/esm/primitives/Collection/Collection.mjs","webpack://_N_E/./node_modules/lodash/_trimmedEndIndex.js","webpack://_N_E/./node_modules/lodash/toNumber.js","webpack://_N_E/./node_modules/lodash/_baseTrim.js"],"sourcesContent":["var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import * as React from 'react';\nimport { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport { View } from '../View/View.mjs';\nimport { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';\n\nconst GridPrimitive = ({ className, children, ...rest }, ref) => (React.createElement(View, { className: classNames(ComponentClassName.Grid, className), ref: ref, ...rest }, children));\n/**\n * [📖 Docs](https://ui.docs.amplify.aws/react/components/grid)\n */\nconst Grid = primitiveWithForwardRef(GridPrimitive);\nGrid.displayName = 'Grid';\n\nexport { Grid };\n","import * as React from 'react';\nimport { getConsecutiveIntArray } from '../shared/utils.mjs';\n\nconst ELLIPSIS = '...';\n/**\n * This hook will be used to determine the range of page numbers to be rendered,\n * including ellipsis dots(e.g., an array like [1, '...', 4, 5, 6, '...', 10]).\n * @param currentPage current page number\n * @param totalPages total number of pages\n * @param siblingCount the number of siblings on each side of\n * @returns an array that contains the range of numbers to be rendered\n */\nconst useRange = (currentPageParam, totalPagesParam, siblingCountParam = 1) => {\n const range = React.useMemo(() => {\n // The current page should not be less than 1\n const currentPage = Math.max(currentPageParam, 1);\n // The sibling count should not be less than 1\n const siblingCount = Math.max(siblingCountParam, 1);\n // The total pages should be always greater than current page\n const totalPages = Math.max(currentPage, totalPagesParam);\n // Note: 1-based index will be used for page value.\n const firstPage = 1;\n const lastPage = totalPages;\n /**\n * To avoid resizing our pagination component while a user is interacting with the component,\n * the total number of items returned by the hook should remain constant.\n * The consant is supposed to be the max number of items that would returned by the hook in all cases,\n * so it should be calculated by 1(first page) + 1(last page) + 1(current page) + 2 * siblingCount + 2(ellipses)\n */\n const maxNumOfItems = 5 + 2 * siblingCount;\n /**\n * Case 1: If the total number of pages is not greater than the max number of items that would potentially be returned,\n * then no need to run through the ellipsis cases, just simply return the range from 1 to totalPages (e.g. [1, 2, 3, 4]).\n */\n if (totalPages < maxNumOfItems) {\n return getConsecutiveIntArray(1, totalPages);\n }\n /**\n * Determine if ellipsis dots should be rendered on either left or right side, or both\n */\n const leftSiblingPage = Math.max(currentPage - siblingCount, firstPage);\n const rightSiblingPage = Math.min(currentPage + siblingCount, lastPage);\n const shouldRenderStartEllipsis = leftSiblingPage > 2;\n const shouldRenderEndEllipsis = rightSiblingPage < lastPage - 1;\n /**\n * Case 2: Only render ellipsis dots on the left side (e.g. [1, '...', 6, 7, 8, 9, 10]).\n */\n if (shouldRenderStartEllipsis && !shouldRenderEndEllipsis) {\n // 1(current page) + 1(last page) + 1(fill up a page for the position of end ellipsis) + 2 * siblingCount\n const rightItemCount = 3 + 2 * siblingCount;\n const rightRange = getConsecutiveIntArray(lastPage - rightItemCount + 1, lastPage);\n return [firstPage, ELLIPSIS, ...rightRange];\n }\n /**\n * Case 3: Only render ellipsis dots on the right side (e.g. [1, 2, 3, 4, 5, '...', 10]).\n */\n if (!shouldRenderStartEllipsis && shouldRenderEndEllipsis) {\n // 1(current page) + 1(last page) + 1(fill up a page for the position of start ellipsis) + 2 * siblingCount\n const leftItemCount = 3 + 2 * siblingCount;\n const leftRange = getConsecutiveIntArray(firstPage, leftItemCount);\n return [...leftRange, ELLIPSIS, lastPage];\n }\n /**\n * Case 4: Render ellipsis on both side (e.g. [1, '...', 4, 5, 6, '...', 10]).\n */\n const middleRange = getConsecutiveIntArray(leftSiblingPage, rightSiblingPage);\n return [firstPage, ELLIPSIS, ...middleRange, ELLIPSIS, lastPage];\n }, [currentPageParam, totalPagesParam, siblingCountParam]);\n return range;\n};\n\nexport { ELLIPSIS, useRange };\n","import { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport * as React from 'react';\nimport { View } from '../../View/View.mjs';\n\n/**\n * @internal For internal Amplify UI use only. May be removed in a future release.\n */\nconst IconChevronLeft = (props) => {\n const { className, ...rest } = props;\n return (React.createElement(View, { as: \"span\", width: \"1em\", height: \"1em\", className: classNames(ComponentClassName.Icon, className), ...rest },\n React.createElement(\"svg\", { width: \"24\", height: \"24\", viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\" },\n React.createElement(\"path\", { d: \"M15.41 7.41L14 6L8 12L14 18L15.41 16.59L10.83 12L15.41 7.41Z\", fill: \"currentColor\" }))));\n};\n\nexport { IconChevronLeft };\n","import { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport * as React from 'react';\nimport { View } from '../../View/View.mjs';\n\n/**\n * @internal For internal Amplify UI use only. May be removed in a future release.\n */\nconst IconChevronRight = (props) => {\n const { className, ...rest } = props;\n return (React.createElement(View, { as: \"span\", width: \"1em\", height: \"1em\", className: classNames(ComponentClassName.Icon, className), ...rest },\n React.createElement(\"svg\", { width: \"24\", height: \"24\", viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\" },\n React.createElement(\"path\", { d: \"M9.99984 6L8.58984 7.41L13.1698 12L8.58984 16.59L9.99984 18L15.9998 12L9.99984 6Z\", fill: \"currentColor\" }))));\n};\n\nexport { IconChevronRight };\n","import * as React from 'react';\nimport { classNames, ComponentClassName, classNameModifier, classNameModifierByFlag } from '@aws-amplify/ui';\nimport { Button } from '../Button/Button.mjs';\nimport { Flex } from '../Flex/Flex.mjs';\nimport '../Icon/Icon.mjs';\nimport '../Icon/context/IconsContext.mjs';\nimport { useIcons } from '../Icon/context/useIcons.mjs';\nimport { View } from '../View/View.mjs';\nimport { IconChevronLeft } from '../Icon/icons/IconChevronLeft.mjs';\nimport { IconChevronRight } from '../Icon/icons/IconChevronRight.mjs';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.mjs';\nimport { ComponentText } from '../shared/constants.mjs';\n\nconst PAGINATION_CURRENT_TEST_ID = 'current';\nconst PAGINATION_ELLIPSIS_TEST_ID = 'ellipsis';\nconst PaginationItem = ({ type, page, currentPage, currentPageLabel = ComponentText.PaginationItem.currentPageLabel, isDisabled, onClick, ariaLabel, ...rest }) => {\n const icons = useIcons('pagination');\n const nextClasses = classNames(ComponentClassName.PaginationItem, classNameModifier(ComponentClassName.PaginationItem, 'link'), classNameModifierByFlag(ComponentClassName.PaginationItem, 'disabled', isDisabled));\n const previousClasses = classNames(ComponentClassName.PaginationItem, classNameModifier(ComponentClassName.PaginationItem, 'link'), classNameModifierByFlag(ComponentClassName.PaginationItem, 'disabled', isDisabled));\n switch (type) {\n case 'page':\n return (React.createElement(View, { as: \"li\" }, page === currentPage ? (React.createElement(Button, { \"aria-current\": \"page\", size: \"small\", variation: \"link\", className: classNames(ComponentClassName.PaginationItem, classNameModifier(ComponentClassName.PaginationItem, 'current')), testId: PAGINATION_CURRENT_TEST_ID, ...rest },\n React.createElement(VisuallyHidden, null,\n currentPageLabel,\n \":\"),\n page)) : (React.createElement(Button, { className: ComponentClassName.PaginationItem, size: \"small\", variation: \"link\", onClick: () => {\n onClick?.();\n }, ariaLabel: ariaLabel, ...rest }, page))));\n case 'next':\n return (React.createElement(View, { as: \"li\" },\n React.createElement(Button, { className: nextClasses, size: \"small\", variation: \"link\", isDisabled: isDisabled, onClick: () => {\n onClick?.();\n }, ariaLabel: ariaLabel, ...rest }, icons?.next ?? React.createElement(IconChevronRight, null))));\n case 'previous':\n return (React.createElement(View, { as: \"li\" },\n React.createElement(Button, { className: previousClasses, size: \"small\", variation: \"link\", isDisabled: isDisabled, onClick: () => {\n onClick?.();\n }, ariaLabel: ariaLabel, ...rest }, icons?.previous ?? React.createElement(IconChevronLeft, null))));\n case 'ellipsis':\n return (React.createElement(View, { as: \"li\" },\n React.createElement(Flex, { as: \"span\", className: classNameModifier(ComponentClassName.PaginationItem, 'ellipsis'), testId: PAGINATION_ELLIPSIS_TEST_ID, ...rest }, \"\\u2026\")));\n // No match type found\n }\n return React.createElement(View, { as: \"li\" });\n};\nPaginationItem.displayName = 'PaginationItem';\n\nexport { PAGINATION_CURRENT_TEST_ID, PAGINATION_ELLIPSIS_TEST_ID, PaginationItem };\n","import * as React from 'react';\nimport { useRange, ELLIPSIS } from './useRange.mjs';\nimport { PaginationItem } from './PaginationItem.mjs';\nimport { ComponentText } from '../shared/constants.mjs';\n\n/**\n * This hook will be used to get the pagination items to be rendered in the pagination primitive\n * @param currentPage current page number\n * @param totalPages total number of pages\n * @param siblingCount the number of siblings on each side of\n * @param onNext callback function triggered when the next-page button is pressed\n * @param onPrevious callback function triggered when the prev-page button is pressed\n * @param onChange callback function triggered every time the page changes\n * @returns an array of pagination items\n */\nconst usePaginationItems = ({ currentPage, totalPages, hasMorePages, siblingCount, currentPageLabel = ComponentText.PaginationItem.currentPageLabel, pageLabel = ComponentText.PaginationItem.pageLabel, previousLabel = ComponentText.PaginationItem.previousLabel, nextLabel = ComponentText.PaginationItem.nextLabel, onNext, onPrevious, onChange, }) => {\n const previousItem = (React.createElement(PaginationItem, { type: \"previous\", key: \"previous\", currentPage: currentPage, onClick: onPrevious, isDisabled: currentPage <= 1, ariaLabel: previousLabel }));\n const nextItem = (React.createElement(PaginationItem, { type: \"next\", key: \"next\", currentPage: currentPage, onClick: onNext, isDisabled: currentPage >= totalPages && !hasMorePages, ariaLabel: nextLabel }));\n // To get the range of page numbers to be rendered in the pagination primitive\n const range = useRange(currentPage, totalPages, siblingCount);\n const pageItems = React.useMemo(() => range.map((item, idx) => {\n if (item === ELLIPSIS) {\n return (React.createElement(PaginationItem, { type: \"ellipsis\", key: idx === 1 ? 'start-ellipsis' : 'end-ellipsis' }));\n }\n return (\n // Note: Do NOT use index for `key` and instead use page number\n // otherwise, react cannot update the component correctly with its diff mechanism\n React.createElement(PaginationItem, { key: item, type: \"page\", page: item, currentPage: currentPage, currentPageLabel: currentPageLabel, onClick: () => onChange?.(item, currentPage), \n /**\n * @todo We should consider how we would support interpolation in our string translations.\n * This works for \"Go to page 31\" or \"translatedText {s}\" as the supplied string\n * But for Arabic or Japanese or some other languages the supplied string might look like: \"{s} translatedText\".\n */\n ariaLabel: `${pageLabel} ${item}` }));\n }), [range, currentPage, currentPageLabel, pageLabel, onChange]);\n return [previousItem, ...pageItems, nextItem];\n};\n\nexport { usePaginationItems };\n","import * as React from 'react';\nimport { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport { Flex } from '../Flex/Flex.mjs';\nimport { View } from '../View/View.mjs';\nimport { usePaginationItems } from './usePaginationItems.mjs';\nimport { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';\n\nconst PaginationPrimitive = ({ className, currentPage = 1, totalPages, hasMorePages = false, siblingCount, currentPageLabel, pageLabel, previousLabel, nextLabel, onNext, onPrevious, onChange, ...rest }, ref) => {\n const paginationItems = usePaginationItems({\n currentPage,\n totalPages,\n hasMorePages,\n siblingCount,\n currentPageLabel,\n pageLabel,\n previousLabel,\n nextLabel,\n onNext,\n onPrevious,\n onChange,\n });\n return (React.createElement(View, { as: \"nav\", className: classNames(ComponentClassName.Pagination, className), ref: ref, ...rest },\n React.createElement(Flex, { as: \"ol\", justifyContent: \"center\", alignItems: \"center\", gap: \"inherit\" }, paginationItems)));\n};\n/**\n * [📖 Docs](https://ui.docs.amplify.aws/react/components/pagination)\n */\nconst Pagination = primitiveWithForwardRef(PaginationPrimitive);\nPagination.displayName = 'Pagination';\n\nexport { Pagination };\n","import * as React from 'react';\n\nconst usePagination = (props) => {\n const { currentPage: initialPage = 1, totalPages, hasMorePages = false, siblingCount = 1, } = props;\n // The current page should not be less than 1\n const sanitizedInitialPage = Math.max(initialPage, 1);\n // The total pages should be always greater than current page\n const sanitizedTotalPages = Math.max(sanitizedInitialPage, totalPages);\n const [currentPage, setCurrentPage] = React.useState(sanitizedInitialPage);\n // Reset current page if initialPage or totalPages changes\n React.useEffect(() => {\n setCurrentPage(sanitizedInitialPage);\n }, [sanitizedInitialPage, sanitizedTotalPages]);\n const onNext = React.useCallback(() => {\n if (currentPage < sanitizedTotalPages) {\n setCurrentPage(currentPage + 1);\n }\n }, [currentPage, sanitizedTotalPages]);\n const onPrevious = React.useCallback(() => {\n if (currentPage > 1) {\n setCurrentPage(currentPage - 1);\n }\n }, [currentPage]);\n const onChange = React.useCallback((newPageIndex) => {\n if (typeof newPageIndex === 'number') {\n setCurrentPage(newPageIndex);\n }\n }, []);\n return {\n currentPage,\n hasMorePages,\n onChange,\n onNext,\n onPrevious,\n // The sibling count should not be less than 1\n siblingCount: Math.max(siblingCount, 1),\n totalPages: sanitizedTotalPages,\n };\n};\n\nexport { usePagination };\n","import * as React from 'react';\nimport { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';\nimport { View } from '../View/View.mjs';\n\nconst FieldGroupIconPrimitive = ({ className, children, isVisible = true, excludeFromTabOrder = false, ...rest }, ref) => {\n return isVisible ? (React.createElement(View, { className: classNames(ComponentClassName.FieldGroupIcon, className), ref: ref, tabIndex: excludeFromTabOrder ? -1 : undefined, ...rest }, children)) : null;\n};\nconst FieldGroupIcon = primitiveWithForwardRef(FieldGroupIconPrimitive);\nFieldGroupIcon.displayName = 'FieldGroupIcon';\n\nexport { FieldGroupIcon };\n","import * as React from 'react';\nimport { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport { Button } from '../Button/Button.mjs';\nimport { FieldGroupIcon } from './FieldGroupIcon.mjs';\nimport { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';\n\nconst FieldGroupIconButtonPrimitive = ({ children, className, ...rest }, ref) => (React.createElement(FieldGroupIcon, { as: Button, className: classNames(ComponentClassName.FieldGroupIconButton, className), ref: ref, ...rest }, children));\nconst FieldGroupIconButton = primitiveWithForwardRef(FieldGroupIconButtonPrimitive);\nFieldGroupIconButton.displayName = 'FieldGroupIconButton';\n\nexport { FieldGroupIconButton };\n","import * as React from 'react';\nimport '../FieldGroupIcon/FieldGroupIcon.mjs';\nimport { FieldGroupIconButton } from '../FieldGroupIcon/FieldGroupIconButton.mjs';\nimport '../Icon/Icon.mjs';\nimport '../Icon/context/IconsContext.mjs';\nimport { useIcons } from '../Icon/context/useIcons.mjs';\nimport '@aws-amplify/ui';\nimport '../View/View.mjs';\nimport { IconClose } from '../Icon/icons/IconClose.mjs';\nimport { ComponentText } from '../shared/constants.mjs';\nimport { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';\n\nconst ariaLabelText = ComponentText.Fields.clearButtonLabel;\nconst FieldClearButtonPrimitive = ({ ariaLabel = ariaLabelText, size, ...rest }, ref) => {\n const icons = useIcons('field');\n return (React.createElement(FieldGroupIconButton, { ariaLabel: ariaLabel, size: size, ref: ref, ...rest }, icons?.clear ?? React.createElement(IconClose, null)));\n};\nconst FieldClearButton = primitiveWithForwardRef(FieldClearButtonPrimitive);\nFieldClearButton.displayName = 'FieldClearButton';\n\nexport { FieldClearButton };\n","import * as React from 'react';\nimport { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport { View } from '../../View/View.mjs';\n\n/**\n * @internal For internal Amplify UI use only. May be removed in a future release.\n */\nconst IconSearch = (props) => {\n const { className, ...rest } = props;\n return (React.createElement(View, { as: \"span\", width: \"1em\", height: \"1em\", className: classNames(ComponentClassName.Icon, className), ...rest },\n React.createElement(\"svg\", { width: \"24\", height: \"24\", viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\" },\n React.createElement(\"path\", { d: \"M15.5 14H14.71L14.43 13.73C15.41 12.59 16 11.11 16 9.5C16 5.91 13.09 3 9.5 3C5.91 3 3 5.91 3 9.5C3 13.09 5.91 16 9.5 16C11.11 16 12.59 15.41 13.73 14.43L14 14.71V15.5L19 20.49L20.49 19L15.5 14V14ZM9.5 14C7.01 14 5 11.99 5 9.5C5 7.01 7.01 5 9.5 5C11.99 5 14 7.01 14 9.5C14 11.99 11.99 14 9.5 14Z\", fill: \"currentColor\" }))));\n};\n\nexport { IconSearch };\n","import * as React from 'react';\nimport { ComponentClassName } from '@aws-amplify/ui';\nimport { ComponentText } from '../shared/constants.mjs';\nimport '../FieldGroupIcon/FieldGroupIcon.mjs';\nimport { FieldGroupIconButton } from '../FieldGroupIcon/FieldGroupIconButton.mjs';\nimport '../Icon/Icon.mjs';\nimport '../Icon/context/IconsContext.mjs';\nimport { useIcons } from '../Icon/context/useIcons.mjs';\nimport '../View/View.mjs';\nimport { IconSearch } from '../Icon/icons/IconSearch.mjs';\nimport { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';\n\nconst ariaLabelText = ComponentText.SearchField.searchButtonLabel;\nconst SearchFieldButtonPrimitive = ({ size, ...props }, ref) => {\n const icons = useIcons('searchField');\n return (React.createElement(FieldGroupIconButton, { ariaLabel: ariaLabelText, className: ComponentClassName.SearchFieldSearch, size: size, ref: ref, type: \"submit\", ...props }, icons?.search ?? React.createElement(IconSearch, null)));\n};\nconst SearchFieldButton = primitiveWithForwardRef(SearchFieldButtonPrimitive);\nSearchFieldButton.displayName = 'SearchFieldButton';\n\nexport { SearchFieldButton };\n","import * as React from 'react';\nimport { isFunction } from '@aws-amplify/ui';\n\n/**\n * Creates ref callback to compose together external and internal refs\n */\nfunction useComposeRefsCallback({ externalRef, internalRef, }) {\n return React.useCallback((node) => {\n // Handle callback ref\n if (isFunction(externalRef)) {\n externalRef(node);\n }\n else if (externalRef) {\n externalRef.current = node;\n }\n internalRef.current = node;\n }, [externalRef, internalRef]);\n}\n\nexport { useComposeRefsCallback };\n","import * as React from 'react';\nimport { isFunction } from '@aws-amplify/ui';\nimport { ESCAPE_KEY, ENTER_KEY } from '../shared/constants.mjs';\nimport { useComposeRefsCallback } from '../../hooks/useComposeRefsCallback.mjs';\n\nconst DEFAULT_KEYS = new Set([ESCAPE_KEY, ENTER_KEY]);\nconst useSearchField = ({ defaultValue = '', value, onChange, onClear, onSubmit, externalRef, }) => {\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = React.useState(defaultValue);\n const composedValue = isControlled ? value : internalValue;\n const internalRef = React.useRef(null);\n const composedRefs = useComposeRefsCallback({\n externalRef,\n internalRef,\n });\n const onClearHandler = React.useCallback(() => {\n if (!isControlled) {\n setInternalValue('');\n }\n internalRef?.current?.focus();\n if (isFunction(onClear)) {\n onClear();\n }\n }, [isControlled, setInternalValue, onClear]);\n const onSubmitHandler = React.useCallback((value) => {\n if (isFunction(onSubmit)) {\n onSubmit(value);\n }\n }, [onSubmit]);\n const onKeyDown = React.useCallback((event) => {\n const { key } = event;\n if (!DEFAULT_KEYS.has(key)) {\n return;\n }\n event.preventDefault();\n if (key === ESCAPE_KEY) {\n onClearHandler();\n }\n else if (key === ENTER_KEY) {\n onSubmitHandler(composedValue);\n }\n }, [composedValue, onClearHandler, onSubmitHandler]);\n const handleOnChange = React.useCallback((event) => {\n if (!isControlled) {\n setInternalValue(event.target.value);\n }\n if (isFunction(onChange)) {\n onChange(event);\n }\n }, [isControlled, onChange, setInternalValue]);\n const onClick = React.useCallback(() => {\n onSubmitHandler(composedValue);\n }, [onSubmitHandler, composedValue]);\n return {\n composedValue,\n onClearHandler,\n onKeyDown,\n onClick,\n handleOnChange,\n composedRefs,\n };\n};\n\nexport { useSearchField };\n","import { classNames, ComponentClassName } from '@aws-amplify/ui';\nimport * as React from 'react';\nimport { FieldClearButton } from '../Field/FieldClearButton.mjs';\nimport '../Field/FieldDescription.mjs';\nimport '../Field/FieldErrorMessage.mjs';\nimport '../Field/Field.mjs';\nimport { FieldGroupIcon } from '../FieldGroupIcon/FieldGroupIcon.mjs';\nimport '../FieldGroupIcon/FieldGroupIconButton.mjs';\nimport '../View/View.mjs';\nimport { IconSearch } from '../Icon/icons/IconSearch.mjs';\nimport '../Icon/context/IconsContext.mjs';\nimport { SearchFieldButton } from './SearchFieldButton.mjs';\nimport { TextField } from '../TextField/TextField.mjs';\nimport { useSearchField } from './useSearchField.mjs';\nimport { strHasLength } from '../shared/utils.mjs';\nimport { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';\n\nconst SearchFieldPrimitive = ({ autoComplete = 'off', className, isDisabled, clearButtonLabel, labelHidden = true, name = 'q', hasSearchButton = true, hasSearchIcon = false, onChange, onClear, onSubmit, searchButtonRef, size, defaultValue, value, ...rest }, ref) => {\n const { composedValue, onClearHandler, onKeyDown, onClick, handleOnChange, composedRefs, } = useSearchField({\n defaultValue,\n value,\n onChange,\n onClear,\n onSubmit,\n externalRef: ref,\n });\n const SearchButton = hasSearchButton ? (React.createElement(SearchFieldButton, { isDisabled: isDisabled, onClick: onClick, ref: searchButtonRef, size: size })) : undefined;\n const SearchIcon = hasSearchIcon ? (React.createElement(FieldGroupIcon, null,\n React.createElement(IconSearch, null))) : undefined;\n return (React.createElement(TextField, { autoComplete: autoComplete, className: classNames(ComponentClassName.SearchField, className), labelHidden: labelHidden, innerStartComponent: SearchIcon, innerEndComponent: React.createElement(FieldClearButton, { ariaLabel: clearButtonLabel, isVisible: !isDisabled && strHasLength(composedValue), onClick: onClearHandler, size: size, variation: \"link\" }), isDisabled: isDisabled, name: name, onChange: handleOnChange, onKeyDown: onKeyDown, outerEndComponent: SearchButton, ref: composedRefs, size: size, value: composedValue, ...rest }));\n};\n/**\n * [📖 Docs](https://ui.docs.amplify.aws/react/components/searchfield)\n */\nconst SearchField = primitiveWithForwardRef(SearchFieldPrimitive);\nSearchField.displayName = 'SearchField';\n\nexport { SearchField };\n","import { strHasLength } from '../shared/utils.mjs';\n\n/**\n * Slice a collection based on page index (starting at 1)\n */\nconst getItemsAtPage = (items, page, itemsPerPage) => {\n if (page < 1 || itemsPerPage < 1) {\n return [];\n }\n const startIndex = (page - 1) * itemsPerPage;\n return items.slice(startIndex, startIndex + itemsPerPage);\n};\n/**\n * Recursively find a keyword within an object (case insensitive)\n */\nconst itemHasText = (item, text) => {\n if (strHasLength(item)) {\n return item.toLowerCase().includes(text.toLowerCase());\n }\n if (typeof item === 'object' && item !== null) {\n return Object.values(item).some((subItem) => itemHasText(subItem, text));\n }\n return false;\n};\n/**\n * Computes the amount of available pages\n */\nconst getPageCount = (totalItems, itemsPerPage) => Math.ceil(totalItems / itemsPerPage);\n\nexport { getItemsAtPage, getPageCount, itemHasText };\n","import { ComponentClassName, classNames } from '@aws-amplify/ui';\nimport * as React from 'react';\nimport debounce from 'lodash/debounce.js';\nimport { Flex } from '../Flex/Flex.mjs';\nimport { Grid } from '../Grid/Grid.mjs';\nimport { Text } from '../Text/Text.mjs';\nimport { Pagination } from '../Pagination/Pagination.mjs';\nimport { usePagination } from '../Pagination/usePagination.mjs';\nimport { SearchField } from '../SearchField/SearchField.mjs';\nimport { ComponentText } from '../shared/constants.mjs';\nimport { strHasLength } from '../shared/utils.mjs';\nimport { getPageCount, getItemsAtPage, itemHasText } from './utils.mjs';\n\nconst DEFAULT_PAGE_SIZE = 10;\nconst TYPEAHEAD_DELAY_MS = 300;\nconst ListCollection = ({ children, direction = 'column', items, ...rest }) => (React.createElement(Flex, { direction: direction, ...rest }, Array.isArray(items) ? items.map(children) : null));\nconst GridCollection = ({ children, items, ...rest }) => (React.createElement(Grid, { ...rest }, Array.isArray(items) ? items.map(children) : null));\nconst renderCollectionOrNoResultsFound = (collection, items, searchNoResultsFound) => {\n if (items.length) {\n return collection;\n }\n if (searchNoResultsFound) {\n return searchNoResultsFound;\n }\n return (React.createElement(Flex, { justifyContent: \"center\" },\n React.createElement(Text, null, ComponentText.Collection.searchNoResultsFound)));\n};\n/**\n * [📖 Docs](https://ui.docs.amplify.aws/react/components/collection)\n */\nconst Collection = ({ className, isSearchable, isPaginated, items, itemsPerPage = DEFAULT_PAGE_SIZE, searchFilter = itemHasText, searchLabel = ComponentText.Collection.searchButtonLabel, searchNoResultsFound, searchPlaceholder, type = 'list', testId, ...rest }) => {\n const [searchText, setSearchText] = React.useState();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const onSearch = React.useCallback(debounce(setSearchText, TYPEAHEAD_DELAY_MS), [setSearchText]);\n // Make sure that items are iterable\n items = Array.isArray(items) ? items : [];\n // Filter items by text\n if (isSearchable && strHasLength(searchText)) {\n items = items.filter((item) => searchFilter(item, searchText));\n }\n // Pagination\n const pagination = usePagination({\n totalPages: getPageCount(items.length, itemsPerPage),\n });\n if (isPaginated) {\n items = getItemsAtPage(items, pagination.currentPage, itemsPerPage);\n }\n const collection = type === 'list' ? (React.createElement(ListCollection, { className: ComponentClassName.CollectionItems, items: items, ...rest })) : type === 'grid' ? (React.createElement(GridCollection, { className: ComponentClassName.CollectionItems, items: items, ...rest })) : null;\n return (React.createElement(Flex, { testId: testId, className: classNames(ComponentClassName.Collection, className) },\n isSearchable ? (React.createElement(Flex, { className: ComponentClassName.CollectionSearch },\n React.createElement(SearchField, { label: searchLabel, placeholder: searchPlaceholder, onChange: (e) => onSearch(e.target.value), onClear: () => setSearchText('') }))) : null,\n renderCollectionOrNoResultsFound(collection, items, searchNoResultsFound),\n isPaginated ? (React.createElement(Flex, { className: ComponentClassName.CollectionPagination },\n React.createElement(Pagination, { ...pagination }))) : null));\n};\nCollection.displayName = 'Collection';\n\nexport { Collection };\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n"],"names":[],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]}