{"version":3,"file":"js/react/mls-players-match-log-app.js?_t=883c6045abcf46d3d607","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AAAA;AAEA;AAEA;AAEA;AACA;AAOA;AACA;AAAA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AAAA;AACA;AACA;AAGA;AACA;AAMA;AACA;AAAA;AACA;AACA;AAEA;AAOA;AACA;AAAA;AACA;AACA;AAEA;AAaA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAcA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAiBA;AACA;AACA;AAcA;AACA;AACA;AAUA;AACA;AACA;AAUA;AACA;AACA;AAcA;AACA;AACA;AAaA;AACA;AACA;AASA;AACA;AACA;AAMA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AASA;;;;;;;;;;;;;;;;AC5PA;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAGA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAmBA;AAEA;;;;;;;;;;;;;;;;ACpFA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAGA;AACA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAmBA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AAKA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAIA;AAGA;AAEA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AACA;AACA;AAIA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAQA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAWA;AAGA;AAEA;;;;;;;;;;;;;;;;;;;;AC/JA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AAAA;AAGA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAEA;AAAA;AACA;AAGA;AAEA;AACA;AAIA;AACA;AAAA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;AC9LA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AAAA;AAGA;AACA;AACA;AAAA;AAEA;AAEA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAGA;AACA;AACA;AAAA;AAGA;AACA;AAEA;AACA;AAAA;AACA;AAGA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAAA;AAGA;AACA;AACA;AAAA;AAGA;AACA;AAAA;AAIA;AAMA;AACA;AACA;AAAA;AACA;AACA;AAGA;AACA;AACA;AAAA;AAGA;AAOA;AAAA;AACA;AAGA;AAEA;AACA;AAAA;AAGA;AAAA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AAGA;AAEA;;;;;;;;;;;;;;;;AC7JA;;;;;;;;;;;;;;;;ACAA;AAEA;AACA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAAA;AAGA;AAAA;AAGA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AAAA;AACA;AACA;AAIA;AACA;AACA;AAGA;AAEA;;;;;;;;;;;;;;;;ACtDA;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAGA;AACA;AACA;AAAA;AACA;AAGA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;AAEA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AAEA;AACA;AACA;AAAA;AAGA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAIA;AACA;AACA;AAAA;AAAA;AACA;AAGA;AAMA;AAAA;AAEA;AACA;AAGA;AAcA;AAEA;;;;;;;;;;;;;;;;ACrGA;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAOA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AAIA;AAAA;AAGA;AAEA;;;;;;;;;;;;;;;;ACpCA;;;;;;;;;;;;;;;;;ACAA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAMA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAEA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAIA;AAEA;AAEA;AAOA;AAEA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AAGA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAGA;AAUA;AAGA;AAEA;;;;;;;;;;;;;;;;ACxGA;;;;;;;;;;;;;;;;;ACAA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AAAA;AACA;AAGA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAKA;AAIA;AAEA;;;;;;;;;;;;;;;;ACjDA;;;;;;;;;;;;;;;;ACAA;AAEA;AAEA;AACA;AAEA;AACA;AAAA;AAGA;AACA;;;;;;;;;;;;;;;;ACZA;AAEA;AAMA;AACA;AACA;AAAA;AAEA;AAAA;AACA;AAGA;AACA;AACA;AAAA;AAEA;AACA;AACA;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;ACxBA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AASA;AACA;AAEA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AACA;AAAA;AAGA;AACA;AASA;AACA;AACA;AAAA;AAEA;AACA;AASA;AACA;AACA;AAEA;AACA;AAKA;AACA;AAAA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AASA;AACA;AAKA;AAKA;AACA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAGA;AACA;;;;;;;;;;;;;;;;;;AC/IA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AAAA;AACA;AAEA;AAEA;;;;;;;;;;;;;;;;;;;;;;ACfA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AAAA;AAAA;AACA;AAEA;AAAA;AAGA;AAAA;AAAA;AACA;AAAA;AAEA;AAAA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AAEA;AASA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAiBA;AAGA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAKA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAKA;AAGA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAEA;AAAA;AAAA;AACA;AAAA;AAKA;AAAA;AAAA;AACA;AACA;AAAA;AAIA;AAAA;AAAA;AACA;AACA;AAAA;AAIA;AAEA;AAGA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAYA;AAMA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAIA;AAIA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAOA;;;;;;;;;;;;;;;;AClKA","sources":["webpack://@mlssoccer/netcore/./scripts/libraries/_modules/tracking/helpers.js","webpack://@mlssoccer/netcore/./scripts/react/mls-players-match-log/app.js","webpack://@mlssoccer/netcore/./scripts/react/mls-players-match-log/components/PlayersMatchLogTable/PlayersMatchLogTable.js","webpack://@mlssoccer/netcore/./scripts/react/mls-players-match-log/components/PlayersMatchLogTable/index.js","webpack://@mlssoccer/netcore/./scripts/react/mls-players-match-log/main.js","webpack://@mlssoccer/netcore/./scripts/react/mls-players-match-log/utils.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/ButtonBase/ButtonBase.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/ButtonBase/index.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/ButtonGroup/ButtonGroup.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/ButtonGroup/index.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/Dropdown/Dropdown.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/Dropdown/index.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/Pagination/Pagination.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/Pagination/index.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/Table/Table.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/Table/index.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/ToggleButton/ToggleButton.js","webpack://@mlssoccer/netcore/./scripts/react/shared/components/ToggleButton/index.js","webpack://@mlssoccer/netcore/./scripts/react/shared/hooks/useEventCallback.js","webpack://@mlssoccer/netcore/./scripts/react/shared/hooks/useForkRef.js","webpack://@mlssoccer/netcore/./scripts/react/shared/hooks/useIsFocusVisible.js","webpack://@mlssoccer/netcore/./scripts/react/shared/hooks/useResize.js","webpack://@mlssoccer/netcore/./scripts/react/shared/svg/Svg.js","webpack://@mlssoccer/netcore/./scripts/react/shared/svg/index.js"],"sourcesContent":["/**\n * @private\n * Push somethig in dataLayer\n * @param obj object to push\n */\nconst dataLayerPush = (obj) => {\n if (!obj) return;\n\n window.dataLayer = window.dataLayer ?? [];\n\n obj = cleanupNull(obj);\n\n window.dataLayer.push(obj);\n};\n\n/**\n * @private\n * cleanup inner props\n * @param {object} obj\n */\nconst cleanupNull = (obj) => {\n if (obj === null) return undefined;\n\n if (typeof obj === 'string') return obj;\n\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (Array.isArray(obj[key])) {\n for (let index = 0; index < obj[key].length; index++) {\n obj[key][index] = cleanupNull(obj[key][index]);\n }\n } else {\n obj[key] = cleanupNull(obj[key]);\n }\n }\n }\n\n return obj;\n};\n\n/**\n * Push new Core dataLayer info\n * @param data the meta data\n */\nexport const addCoreDataLayer = (data) => {\n dataLayerPush({\n 'event': 'dataLayer-initialized',\n ...data,\n });\n};\n\n/**\n * Track generic event\n * @param {string} eventName event name\n * @param {any} data event data\n */\nexport const trackEvent = (eventName, data = {}) => {\n dataLayerPush({\n 'event': eventName,\n ...data\n });\n};\n\n/**\n * track block impression\n * @param {string} bucketName\n * @param {string} blockType\n * @param {{\n * id: string,\n * name: string,\n * creative: string,\n * position: string,\n * }[]} promotions\n */\nexport const trackBlockImpression = (bucketName, blockType, promotions) => {\n const impressionData = {\n bucketName,\n blockType,\n 'ecommerce': promotions?.length ? {\n 'promoView': {\n promotions,\n },\n } : undefined,\n };\n\n trackEvent('block-impression', impressionData);\n};\n\n/**\n * track block click\n * @param {string} bucketName\n * @param {string} blockType\n * @param {object} data\n * @param {{\n * id: string,\n * name: string,\n * creative: string,\n * position: string,\n * }} promotion\n */\nexport const trackBlockClick = (bucketName, blockType, layoutName, blockLayout, blockStyle, data, promotion) => {\n const clickData = {\n bucketName,\n blockType,\n layoutName,\n blockLayout,\n blockStyle,\n ...data,\n 'ecommerce': promotion ? {\n 'promoClick': {\n promotions: [promotion],\n },\n } : undefined,\n };\n\n trackEvent('block-click', clickData);\n};\n\n/**\n * Track MatchHub click event\n * @param {{\n * clickType: string,\n * clickItem: string,\n * match: string,\n * matchState: string,\n * clubName: string,\n * playerName: string,\n * competition: string,\n * cardType: string,\n * optaEventType: string,\n * toggle: string\n * }} clickData\n */\nexport const trackMatchHubClick = (clickData) => {\n trackEvent('match-hub-click', clickData);\n};\n\n/**\n * Track Match interaction event\n * @param {{\n * clickType: string,\n * clickItem: string,\n * clickPosition: string,\n * matchState: string,\n * match: string,\n * competition: string,\n * travelType: string\n * }} clickData\n */\nexport const trackMatchInteraction = (clickData) => {\n trackEvent('match-interaction', clickData);\n};\n\n/**\n * Track Week Selector event\n * @param {{\n * selectorLocation: 'top' | 'bottom',\n * direction: 'forward' | 'back',\n * selection: string\n * }} clickData\n */\nexport const trackWeekSelector = (clickData) => {\n trackEvent('week-selector-click', clickData);\n};\n\n/**\n * Track Filter interaction event\n * @param {{\n * statsCategory: string,\n * filterType: string,\n * clickItem: string\n * }} clickData\n */\nexport const trackFilterClick = (clickData) => {\n trackEvent('filter-click', clickData);\n};\n\n/**\n * Track FeaturedMatch click event\n * @param {{\n* clickType: string,\n* clickItem: string,\n* match: string,\n* matchState: string,\n* playerName: string,\n* competition: string,\n* toggle: string\n* }} clickData\n*/\nexport const trackFeaturedMatchClick = (clickData) => {\n trackEvent('featured-match-click', clickData);\n};\n\n/**\n * Track HorizontalScoreboardMatch click event\n * @param {{\n* clickType: string,\n* clickItem: string,\n* match: string,\n* matchState: string,\n* competition: string,\n* clickPosition: string,\n* }} clickData\n*/\nexport const trackHorizontalScoreboardMatch = (clickData) => {\n trackEvent('horizontal-scoreboard-match-click', clickData);\n};\n\n/**\n * Track user successful login event\n * @param {{\n* userId: string,\n* method: string,\n* }} eventData\n*/\nexport const trackUserLogin = (eventData) => {\n trackEvent('successful-login-freemium', eventData);\n};\n\n\n/**\n * Track user login freemium login wall event\n*/\nexport const trackUserFreemiumLoginWall = (eventData) => {\n trackEvent('freemium-login-wall', eventData);\n};\n\nexport const trackUserFreemiumLoginWallViewed = (eventData) => {\n trackEvent('freemium-login-wall_viewed', eventData);\n};\n\nexport const trackUserFreemiumLoginWallCtaClicked = (eventData) => {\n trackEvent('freemium-cta-click', eventData);\n};\n\nexport const trackUserFreemiumSuccessfulSignup = (eventData) => {\n trackEvent('successful-signup', eventData);\n};\n\nexport const trackUserFreemiumSuccessfulLogin = (eventData) => {\n trackEvent('successful-login-freemium', eventData);\n};\n\nexport const trackUserLogged = (userId) => {\n // const dataLayerInitialized = window.dataLayer.find((e) => e.event == 'dataLayer-initialized');\n\n // if (dataLayerInitialized) {\n // dataLayerPush({\n // ...dataLayerInitialized,\n // 'userId': userId,\n // });\n // }\n};\n","export { default } from './main';\n","import React, { useEffect } from 'react';\nimport { useSortBy, useTable, usePagination } from \"react-table\";\nimport { useColumns } from \"../../../shared/components/Table/utils\";\nimport Table from \"../../../shared/components/Table\";\nimport { NoResults } from \"../../../shared/svg/Svg\";\nimport { getEmptyStatTableValuesAccessors, checkNextPage } from \"../../../shared/utils\";\nimport Pagination from \"../../../shared/components/Pagination\";\nimport { periodTypes } from '../../../mls-match-list/utils';\n\nconst PlayersMatchLogTable = ({ baseClass, emptyResultsComponent, playerData, page, statType, setPage, order, setOrder }) => {\n const columns = useColumns(statType, playerData);\n const columnAccessors = columns[0].columns.map((el) => el?.accessor);\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n state: { sortBy },\n } = useTable(\n {\n columns,\n data: playerData && playerData.length > 0\n ? playerData.filter((data) => data?.period === periodTypes.FullTime)\n : getEmptyStatTableValuesAccessors(30, columnAccessors).items,\n autoResetPage: true,\n autoResetSortBy: false,\n manualPagination: true,\n manualSortBy: true,\n disableMultiSort: true,\n disableSortRemove: true,\n initialState: {\n sortBy: [{ id: order?.id, desc: order?.desc }]\n }\n },\n useSortBy,\n usePagination\n );\n\n const canNextPage = checkNextPage(playerData, 30);\n\n const { desc: descending, id } = sortBy[0] || {};\n\n useEffect(() => {\n if (id != order?.id || order?.desc != descending) {\n setOrder({ id, desc: descending });\n\n if (page) {\n setPage(0);\n }\n }\n }, [descending, id]);\n\n return (\n <>\n \n {\n rows.length < 1\n ? (\n <>\n
\n \n {\n emptyResultsComponent ? emptyResultsComponent : null\n }\n
\n \n )\n : (
\n \n
)\n }\n \n );\n};\n\nexport default PlayersMatchLogTable;\n","export { default } from './PlayersMatchLogTable';\n","import React, { useState, useMemo, useEffect } from 'react';\nimport { useQuery } from \"react-query\";\nimport { statTypes } from \"../shared/components/Table/utils\";\nimport { fetchClient } from \"../shared/api/fetching\";\nimport PlayersMatchLogTable from \"./components/PlayersMatchLogTable\";\nimport { apiURL, mlsPlayerMatchLogStatsAPI } from \"../shared/api/variables\";\nimport Dropdown from \"../shared/components/Dropdown\";\nimport ButtonGroup from \"../shared/components/ButtonGroup\";\nimport ToggleButton from \"../shared/components/ToggleButton\";\nimport { formatMatchStatsData } from './utils';\nimport { useReactAppState } from \"../shared/containers/utils\";\nimport { NoResults } from \"../shared/svg/Svg\";\n\nfunction PlayersMatchLog({ options }) {\n const { t, mediaQueries } = useReactAppState();\n const initialStatType = options?.position === \"goalkeeper\" ? statTypes.playersMatchLogGoalKeeping : statTypes.playersMatchLogGeneral;\n const competitionsDropdownData = [{ optaId: \"all\", name: t(\"match_all_competitions\") }, ...options?.competitions?.items?.map((item) => { return { optaId: item?.fields?.optaId, name: item?.title }; })];\n const [page, setPage] = useState(0);\n const [order, setOrder] = useState({ id: \"date\", desc: true });\n const [competition, setCompetition] = useState(null);\n const [statType, setStatType] = useState(initialStatType);\n const { isLargeMin } = mediaQueries || {};\n\n const endpointKey = useMemo(() => {\n return `currentQueryType:page:${page || page === 0 ? page : null}-statType:${statType ? statType : initialStatType}-orderType:${order?.desc}:-orderBy:${order?.id}:-competition:${competition}`;\n }, [page, statType, order, competition]);\n\n useEffect(() => {\n setOrder({ id: \"date\", desc: true });\n setPage(0);\n }, [statType]);\n\n useEffect(() => {\n setCompetition(\"all\");\n }, []);\n\n const playerStatsEndpoint = () => {\n return mlsPlayerMatchLogStatsAPI({ playerOptaId: options?.player?.optaId, pageParam: page, pageSize: 30, desc: order?.desc, orderBy: order?.id, competition });\n };\n\n const {\n data: statsData,\n isLoading: statsLoading\n } = useQuery({\n queryKey: [`mls-player-match-log-${endpointKey}`],\n queryFn: () => fetchClient({ endpoint: playerStatsEndpoint(), apiURL: apiURL.statsAPI })\n });\n\n const formatStatsData = statsData ? formatMatchStatsData(statsData, options?.competitions) : [];\n\n return (\n
\n {options?.title ?\n <>\n
\n
\n {t(options?.title)}\n
\n
\n
\n
\n {t(options?.title)}\n
\n
\n \n : null\n }\n
\n {competitionsDropdownData?.length && competition ?\n setCompetition(comp)}\n displayKey={\"name\"}\n valueKey={\"optaId\"}\n items={competitionsDropdownData}\n currentValue={competition}\n /> : null}\n {\n isLargeMin\n ? (\n setStatType(e.target.value)}\n aria-label=\"statistics category\"\n >\n \n {t(\"stats_general\")}\n \n \n {t(\"stats_passing\")}\n \n\n \n {t(\"stats_attacking\")}\n \n\n \n {t(\"stats_defending\")}\n \n \n )\n : (\n setStatType(val)}\n displayKey={\"name\"}\n valueKey={\"statType\"}\n items={[\n {\n statType: initialStatType,\n name: t(\"stats_general\")\n },\n {\n statType: statTypes.playersMatchLogPassing,\n name: t(\"stats_passing\")\n },\n {\n statType: statTypes.playersMatchLogAttacking,\n name: t(\"stats_attacking\")\n },\n {\n statType: statTypes.playersMatchLogDefending,\n name: t(\"stats_defending\")\n }]}\n currentValue={statType}\n />\n )\n }\n
\n {\n statsLoading ||\n formatStatsData?.length ?\n \n }\n />\n :\n
\n \n
{t(\"no_match_log_available\")}
\n
\n }\n
\n );\n}\n\n// eslint-disable-next-line no-func-assign\nPlayersMatchLog = React.memo(PlayersMatchLog);\n\nexport default PlayersMatchLog;\n","import { createContext, useContext } from \"react\";\nimport { calculatePercentage, round, calculateSubtractedValues, calculateSum, decimalRound } from \"../../libraries/_helpers\";\nimport { format } from 'date-fns';\n\nexport const StatsContext = createContext();\nStatsContext.displayName = 'Stats';\n\nexport function useStatsData() {\n const context = useContext(StatsContext);\n if (context === undefined) {\n throw new Error('useStatsData must be used within a or ');\n }\n return context;\n}\n\nexport function formatMatchStatsData(data, competitions) {\n if (!data) {\n return [];\n }\n\n return data.map(el => {\n const { statistics, match, competition, club, opponent_club, club_match, opponent_club_match } = el || {};\n\n const {\n goals,\n goal_assist,\n total_scoring_att,\n ontarget_scoring_att,\n accurate_pass,\n saves,\n accurate_long_balls,\n failed_long_balls,\n clearance,\n penalty_save,\n penalty_faced,\n aerial_won,\n aerial_lost,\n goals_conceded,\n clean_sheet,\n ground_duel_won,\n ground_duel_lost,\n interception,\n attempts_conceded_ibox,\n expected_goals_conceded,\n attempts_conceded_obox,\n expected_assists,\n total_att_assist,\n accurate_fwd_zone_pass,\n accurate_back_zone_pass,\n accurate_cross,\n successful_short_pass,\n accurate_launches,\n failed_launches,\n turnover,\n expected_goals,\n att_ibox_goal,\n att_obox_goal,\n att_hd_goal,\n att_pen_goal,\n att_pen_taken,\n att_pen_miss,\n att_pen_post,\n att_pen_target,\n total_pass,\n fouls,\n was_fouled,\n total_offside,\n yellow_card,\n total_red_card,\n mins_played\n } = statistics || {};\n const { status } = el || {};\n const { date, minute, type, period } = match || {};\n const { name, opta_id } = competition || {};\n const { side, score, extra_score, shootout_score, is_winner, is_loser } = club_match || {};\n const { score: oppScore, extra_score: oppExtraScore, shootout_score: oppShootoutScore } = opponent_club_match || {};\n const { abbreviation: club_abbreviation } = club || {};\n const { abbreviation: opponent_club_abbreviation } = opponent_club || {};\n const pkaCalc = (att_pen_miss ? att_pen_miss : 0) + (att_pen_post ? att_pen_post : 0) + (att_pen_target ? att_pen_target : 0);\n const pk_percentage_calc = calculatePercentage(att_pen_goal, (pkaCalc + (att_pen_goal ? att_pen_goal : 0)));\n const results = (() => {\n if (!isNaN(score) && !isNaN(oppScore) && !isNaN(shootout_score) && !isNaN(oppShootoutScore)) {\n const sideStatus = is_winner ? \"W\" : (is_loser ? \"L\" : \"T\");\n\n if (side === \"away\") {\n const homeScore = oppScore + oppExtraScore;\n const awayScore = score + extra_score;\n const defaultShootout = oppShootoutScore || shootout_score ? \"(0)\" : \"\";\n return `${sideStatus} ${homeScore}${oppShootoutScore ? `(${oppShootoutScore})` : defaultShootout}-${awayScore}${shootout_score ? `(${shootout_score})` : defaultShootout}`;\n } else {\n const homeScore = score + extra_score;\n const awayScore = oppScore + oppExtraScore;\n const defaultShootout = oppShootoutScore || shootout_score ? \"(0)\" : \"\";\n return `${sideStatus} ${homeScore}${shootout_score ? `(${shootout_score})` : defaultShootout}-${awayScore}${oppShootoutScore ? `(${oppShootoutScore})` : defaultShootout}`;\n }\n } else {\n return null;\n }\n })();\n\n let competitionName = name ? name : null;\n\n if (competitionName && competitions) {\n const getCompetition = opta_id == 98 || opta_id == 1164 ?\n competitions?.items?.find((comp) => comp.optaId == opta_id && comp?.fields?.mlsPhaseType === type) :\n competitions?.items?.find((comp) => comp.optaId == opta_id);\n\n if (getCompetition && getCompetition?.fields?.shortName) {\n competitionName = getCompetition?.fields?.shortName;\n }\n }\n\n return {\n date: date ? format(date, 'yyyy/LL/dd') : null,\n name: competitionName ? competitionName : null,\n expected_goals_minus_goals: round(calculateSubtractedValues(expected_goals, goals), 1),\n att_ibox_goal: att_ibox_goal ? att_ibox_goal : 0,\n att_obox_goal: att_obox_goal ? att_obox_goal : 0,\n att_hd_goal: att_hd_goal ? att_hd_goal : 0,\n att_pen_goal: att_pen_goal ? att_pen_goal : 0,\n att_pen_taken: att_pen_taken ? att_pen_taken : 0,\n att_pen_percentage: calculatePercentage(att_pen_goal, att_pen_taken),\n pka: pkaCalc,\n pk_percentage: pk_percentage_calc,\n accurate_shooting_per: calculatePercentage(goals, total_scoring_att),\n expected_goals: expected_goals ? round(expected_goals, 1) : 0,\n goals_assists: calculateSum(goals, goal_assist),\n expected_goals_assists: round(calculateSum(expected_goals, expected_assists), 1),\n expected_assists_minus_assists: round(calculateSubtractedValues(expected_assists, goal_assist), 1),\n goals_against_expected_goals_against: round(calculateSubtractedValues(goals_conceded ? goals_conceded : 0, expected_goals_conceded ? expected_goals_conceded : 0), 1),\n launches_attempted: calculateSum(accurate_launches, failed_launches),\n shots_against: calculateSum(attempts_conceded_ibox, attempts_conceded_obox),\n headed_duel_percentage: calculatePercentage(aerial_won, aerial_lost),\n ground_duel_percentage: calculatePercentage(ground_duel_won, ground_duel_lost),\n long_ball_percentage: calculatePercentage(\n accurate_long_balls,\n accurate_long_balls + failed_long_balls\n ),\n penalty_kick_save_percentage: calculatePercentage(penalty_save, penalty_faced),\n save_percentage: calculatePercentage(saves, calculateSum(goals_conceded, saves)),\n saves: saves ? saves : 0,\n clearance: clearance ? clearance : 0,\n penalty_faced: penalty_faced ? penalty_faced : 0,\n penalty_save: penalty_save ? penalty_save : 0,\n interception: interception ? interception : 0,\n clean_sheet: clean_sheet ? clean_sheet : 0,\n goals_conceded: goals_conceded ? round(goals_conceded, 1) : 0,\n expected_goals_conceded: expected_goals_conceded ? round(expected_goals_conceded, 1) : 0,\n turnover: turnover ? turnover : 0,\n successful_short_pass: successful_short_pass ? successful_short_pass : 0,\n accurate_long_balls: accurate_long_balls ? accurate_long_balls : 0,\n expected_assists: expected_assists ? round(expected_assists, 1) : 0,\n total_att_assist: total_att_assist ? total_att_assist : 0,\n accurate_pass: accurate_pass ? accurate_pass : 0,\n total_pass: total_pass ? total_pass : 0,\n accurate_fwd_zone_pass: accurate_fwd_zone_pass ? accurate_fwd_zone_pass : 0,\n accurate_back_zone_pass: accurate_back_zone_pass ? accurate_back_zone_pass : 0,\n accurate_cross: accurate_cross ? accurate_cross : 0,\n status: status ? status : null,\n match: club_abbreviation && opponent_club_abbreviation && side ? `${side === \"away\" ? `${opponent_club_abbreviation} vs ${club_abbreviation}` : `${club_abbreviation} vs ${opponent_club_abbreviation}`}` : null,\n period: period ? period : null,\n minute: minute ? minute : 0,\n mins_played: mins_played ? mins_played : 0,\n goals: goals ? goals : 0,\n goal_assist: goal_assist ? goal_assist : 0,\n total_scoring_att: total_scoring_att ? total_scoring_att : 0,\n ontarget_scoring_att: ontarget_scoring_att ? ontarget_scoring_att : 0,\n accurate_pass_per: calculatePercentage(accurate_pass, total_pass),\n fouls: fouls ? fouls : 0,\n was_fouled: was_fouled ? was_fouled : 0,\n total_offside: total_offside ? total_offside : 0,\n yellow_card: yellow_card ? yellow_card : 0,\n total_red_card: total_red_card ? total_red_card : 0,\n gk_shots_against: calculateSum(goals_conceded, saves),\n results,\n att_lf_total: statistics?.att_lf_total || 0,\n att_rf_total: statistics?.att_rf_total || 0,\n att_hd_total: statistics?.att_hd_total || 0,\n corner_taken: statistics?.corner_taken || 0,\n att_freekick_total: statistics?.att_freekick_total || 0,\n total_att_assist: statistics?.total_att_assist || 0,\n accurate_cross_per: decimalRound(statistics?.accurate_cross_per) || 0,\n total_cross: statistics?.total_cross || 0,\n aerial_duel: statistics?.aerial_duel || 0,\n aerial_duel_per: calculatePercentage(statistics?.aerial_won, statistics?.aerial_duel),\n total_clearance: statistics?.total_clearance || 0,\n fk_foul_lost: statistics?.fk_foul_lost || 0,\n touches: statistics?.touches || 0,\n };\n });\n}\n","import React, { forwardRef, useImperativeHandle } from 'react';\nimport ReactDOM from 'react-dom';\nimport useIsFocusVisible from \"../../hooks/useIsFocusVisible\";\nimport useEventCallback from \"../../hooks/useEventCallback\";\nimport useForkRef from \"../../hooks/useForkRef\";\n\nconst ButtonBase = forwardRef(function ButtonBase(props, ref) {\n const {\n action,\n buttonRef: buttonRefProp,\n children,\n className,\n component = 'button',\n disabled = false,\n onBlur,\n onClick,\n onFocus,\n onFocusVisible,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n onDragLeave,\n tabIndex = 0,\n type = 'button',\n ...other\n } = props;\n\n const buttonRef = React.useRef(null);\n function getButtonNode() {\n // eslint-disable-next-line react/no-find-dom-node\n return ReactDOM.findDOMNode(buttonRef.current);\n }\n\n const [focusVisible, setFocusVisible] = React.useState(false);\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n const { isFocusVisible, ref: focusVisibleRef } = useIsFocusVisible();\n\n useImperativeHandle(\n action,\n () => ({\n focusVisible: () => {\n setFocusVisible(true);\n buttonRef.current?.focus();\n },\n }),\n [],\n );\n\n const handleFocus = useEventCallback((event) => {\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n\n if (isFocusVisible(event)) {\n setFocusVisible(true);\n\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n\n if (onFocus) {\n onFocus(event);\n }\n });\n\n const isNonNativeButton = () => {\n const button = getButtonNode();\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n\n const handleKeyDown = useEventCallback((event) => {\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n // Keyboard accessibility for non interactive elements\n if (\n event.target === event.currentTarget &&\n isNonNativeButton() &&\n event.key === 'Enter' &&\n !disabled\n ) {\n event.preventDefault();\n if (onClick) {\n onClick(event);\n }\n }\n });\n\n const handleKeyUp = useEventCallback((event) => {\n if (onKeyUp) {\n onKeyUp(event);\n }\n\n if (\n onClick &&\n event.target === event.currentTarget &&\n isNonNativeButton() &&\n event.key === ' ' &&\n !event.defaultPrevented\n ) {\n onClick(event);\n }\n });\n\n let ComponentProp = component;\n\n if (other?.href) {\n ComponentProp = 'a';\n }\n\n const buttonProps = {\n type,\n disabled\n };\n\n const handleUserRef = useForkRef(buttonRefProp, ref);\n const handleOwnRef = useForkRef(focusVisibleRef, buttonRef);\n const handleRef = useForkRef(handleUserRef, handleOwnRef);\n\n return (\n \n {children}\n \n );\n});\n\nexport default ButtonBase;\n","export { default } from './ButtonBase';\n","import React, { useState, forwardRef } from 'react';\n\nfunction isValueSelected(value, candidate) {\n if (candidate === undefined || value === undefined) {\n return false;\n }\n\n if (Array.isArray(candidate)) {\n return candidate.indexOf(value) >= 0;\n }\n\n return value === candidate;\n}\n\nconst ButtonGroup = forwardRef(function ToggleButton(props, ref) {\n const {\n children,\n className,\n onChange,\n value,\n } = props;\n\n const handleChange = (event, buttonValue) => {\n if (!onChange) {\n return;\n }\n\n onChange(event, value === buttonValue ? null : buttonValue);\n };\n\n return (\n \n {React.Children.map(children, (child) => {\n if (!React.isValidElement(child)) {\n return null;\n }\n\n return React.cloneElement(child, {\n className: child.props.className,\n onChange: handleChange,\n selected:\n child.props.selected === undefined\n ? isValueSelected(child.props.value, value)\n : child.props.selected,\n });\n })}\n \n );\n});\n\nexport default ButtonGroup;\n","export { default } from './ButtonGroup';\n","import React, { useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { checkIfObject } from \"../../../../libraries/_helpers\";\nimport useResize from \"../../hooks/useResize\";\nimport { trackFilterClick } from '../../../../libraries/_modules/tracking/helpers';\nimport { translateTypes } from \"../../utils\";\nimport { useReactAppState } from \"../../containers/utils\";\n\nfunction findOption({ items, value, valueKey }) {\n if (!value || !items || items.length === 0) {\n return;\n }\n\n const matchedOption = (items || []).find((item) => {\n if ((valueKey && item[valueKey] && item[valueKey].toString() === value?.toString()) || item?.toString() === value?.toString()) {\n return item;\n }\n });\n\n return matchedOption ? matchedOption : items[0];\n}\n\nconst trackClick = (statsCategory, filterType, clickItem) => {\n trackFilterClick({ statsCategory, filterType, clickItem });\n};\n\nconst Dropdown = ({ extraClass, onChangeFn, items, type, currentValue, valueKey, displayKey, autoWidth = true, disabled = false, ariaLabel = \"\", title = \"\" }) => {\n const optionFound = useMemo(() => findOption({ items, value: currentValue, valueKey }), [items, currentValue, valueKey]);\n\n const ref = useRef(null);\n const { t } = useReactAppState() || {};\n\n function handleResize() {\n if (ref?.current && autoWidth) {\n setWidth(ref.current.offsetWidth + 48);\n }\n }\n\n const [width, setWidth] = useState(\"auto\");\n const [selectedOption, setSelectedOption] = useState(optionFound);\n\n useLayoutEffect(() => {\n setSelectedOption(optionFound);\n }, [items, currentValue]);\n\n useLayoutEffect(() => {\n handleResize();\n }, [items, selectedOption]);\n\n useResize(handleResize, 1000);\n\n const handleChange = React.useCallback((e) => {\n onChangeFn(e.target.value);\n trackClick('schedule', type, e.target.options[e.target.selectedIndex].innerText);\n }, [onChangeFn], []);\n\n return (\n <>\n \n {\n items\n ? items.map((item, index) => {\n const isObject = checkIfObject(item);\n return (\n \n {isObject ? translateTypes(t, item[displayKey]) : translateTypes(t, item)}\n \n );\n })\n : null\n }\n \n
\n \n {\n displayKey && selectedOption && selectedOption[displayKey]\n ? translateTypes(t, selectedOption[displayKey])\n : translateTypes(t, selectedOption)\n }\n \n
\n \n );\n};\n\nexport default Dropdown;\n","export { default } from './Dropdown';\n","import React from \"react\";\nimport ToggleButton from \"../../../shared/components/ToggleButton\";\nimport { Chevron } from \"../../../shared/svg\";\nimport { chevronDirection } from \"../../svg/Svg\";\n\nfunction Pagination({ page, updateFilter, canNextPage }) {\n const isHidden = page === 0 && !canNextPage;\n\n return (\n
\n updateFilter(page - 1)}\n disabled={page === 0}\n aria-label=\"Previous results\">\n \n \n\n \n {`Page ${page + 1}`}\n \n\n updateFilter(page + 1)}\n disabled={!canNextPage}\n aria-label=\"Next results\">\n \n \n
\n );\n};\n\n// eslint-disable-next-line no-func-assign\nPagination = React.memo(Pagination);\n\nexport default Pagination;\n","export { default } from './Pagination';\n","import React from 'react';\nimport { getMinimumCount, getStandingsConfig, useHorizontalScrollSpy, getPlayoffCounter } from \"./utils\";\n\nfunction Table({\n baseClass,\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n tableConfig,\n extraClasses,\n tableIsGrouped,\n tableReferences,\n headerPure,\n isGroupedByDivision\n}) {\n const [ref, isOriginalPosition] = useHorizontalScrollSpy(headerGroups);\n const emptyRows = !rows || rows.length < 1;\n const { homeAdvantage, topClubsLegend, playoffQualifiedEastConference, playoffQualifiedWestConference, playoffQualifiedCentralConference, homeAdvantageLegend, topClubs } = tableConfig || {};\n const header = headerGroups?.[0]?.headers?.[0]?.Header;\n\n let topClubsCounter = topClubsLegend ? getMinimumCount(topClubs, homeAdvantage, 1) : null;\n const playoffQualified = Math.max(Number.isInteger(playoffQualifiedEastConference) ? playoffQualifiedEastConference : 0, Number.isInteger(playoffQualifiedWestConference) ? playoffQualifiedWestConference : 0, Number.isInteger(playoffQualifiedCentralConference) ? playoffQualifiedCentralConference : 0);\n let homeAdvantageCounter = homeAdvantageLegend && header && !header.includes('none') ? getMinimumCount(homeAdvantage, playoffQualified, 4) : null;\n let playoffQualifiedCounter = !isGroupedByDivision ? getPlayoffCounter(headerPure, playoffQualifiedEastConference, playoffQualifiedWestConference, playoffQualifiedCentralConference) : null;\n\n return (\n <>\n
\n \n \n {headerGroups.map((headerGroup, headerGroupIndex) => (\n \n {headerGroup.headers.map((column, tableHeaderIndex) => (\n \n ))}\n \n ))}\n \n \n {!emptyRows\n ? rows.map((row, rowIndex) => {\n prepareRow(row);\n\n if (rowIndex !== 0 && topClubsCounter > 0) {\n topClubsCounter--;\n }\n\n if (rowIndex !== 0 && playoffQualifiedCounter > 0) {\n playoffQualifiedCounter--;\n }\n\n if (rowIndex !== 0 && homeAdvantageCounter > 0) {\n homeAdvantageCounter--;\n }\n\n return (\n \n {row.cells.map((cell, index) => {\n return (\n \n );\n })}\n \n );\n }) : null\n }\n \n
{\n if (e.key === \"Enter\") {\n column.toggleSortBy(!column.isSortedDesc);\n }\n }}\n {...column.getHeaderProps(column.getSortByToggleProps({ title: undefined }))}>\n \n \n {column.render(\"Header\")}\n \n {\n column.canSort\n ?
\n : null\n }\n
\n
\n {cell.render(\"Cell\")}\n
\n
\n
\n \n );\n}\n\n// eslint-disable-next-line no-func-assign\nTable = React.memo(Table);\n\nexport default Table;\n","export { default } from './Table';\n","import React, { forwardRef } from 'react';\nimport ButtonBase from \"../ButtonBase\";\n\nconst ToggleButton = forwardRef(function ToggleButton(props, ref) {\n const {\n children,\n label,\n className,\n disabled = false,\n onChange,\n onClick,\n selected,\n value,\n ...other\n } = props;\n\n const handleClick = (event) => {\n if (onClick) {\n onClick(event, value);\n if (event.isDefaultPrevented()) {\n return;\n }\n }\n\n if (onChange) {\n onChange(event, value);\n }\n };\n\n return (\n \n {\n label\n ? {children}\n : children\n }\n \n );\n});\n\nexport default ToggleButton;\n","export { default } from './ToggleButton';\n","import React, { useRef, useCallback } from 'react';\n\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nexport default function useEventCallback(fn) {\n const ref = useRef(fn);\n\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n\n return useCallback((...args) => (0, ref.current)(...args), []);\n}\n","import * as React from 'react';\n\nexport default function useForkRef(refA, refB) {\n /**\n * This will create a new function if the ref props change and are defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior\n */\n function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n }\n\n return React.useMemo(() => {\n if (refA == null && refB == null) {\n return null;\n }\n return (refValue) => {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}\n","// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nlet hadFocusVisibleRecentlyTimeout = null;\n\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true,\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @return {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const { type, tagName } = node;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n\n if (node.isContentEditable) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\n\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\n\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nfunction isFocusVisible(event) {\n const { target } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // browsers not implementing :focus-visible will throw a SyntaxError\n // we use our own heuristic for those browsers\n // rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // no need for validFocusTarget check. the user does that by attaching it to\n // focusable events only\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\n\n/**\n * Should be called if a blur event is fired on a focus-visible element\n */\nfunction handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n}\n\nexport default function useIsFocusVisible() {\n const ref = React.useCallback((instance) => {\n // eslint-disable-next-line react/no-find-dom-node\n const node = ReactDOM.findDOMNode(instance);\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n\n return { isFocusVisible, onBlurVisible: handleBlurVisible, ref };\n}\n","import { useEffect } from 'react';\nimport { debounce } from \"lodash\";\n\nfunction useResize(fn, delay = 1000) {\n useEffect(() => {\n const debouncedHandleResize = debounce(fn, delay);\n\n window.addEventListener('resize', debouncedHandleResize);\n\n return () => {\n window.removeEventListener('resize', debouncedHandleResize);\n };\n });\n}\n\nexport default useResize;\n","import React from \"react\";\n\nexport const chevronDirection = {\n down: \"down\",\n up: \"up\",\n left: \"left\",\n right: \"right\",\n};\n\nexport const Chevron = ({\n useEmptyClasses = false,\n extraClasses,\n direction = chevronDirection.down,\n size = \"small\",\n}) =>\n !useEmptyClasses ? (\n \n \n \n \n \n \n
\n ) : (\n
\n \n \n \n
\n );\n\nexport const Filters = ({ extraClasses, size = \"small\" }) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport const NoResults = ({ extraClasses, size = \"large\" }) => (\n \n \n \n \n \n \n \n \n \n \n);\n\nexport const MediaPlayingSVG = ({ extraClasses, size = \"large\" }) => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport const CardBackground = ({ extraClasses }) => (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n);\n\nexport const TriangleSVG = ({ extraClasses, size = \"small\" }) => (\n \n \n \n \n \n \n \n);\n","export { Chevron } from './Svg';\n"],"names":[],"sourceRoot":""}