{ "version": 3, "sources": ["../javascripts/components/search/result-set.tsx", "../javascripts/components/subscriptions/search-subscription.tsx", "../javascripts/components/search/result-set-container.tsx", "../javascripts/components/search/placeholder-result-set.tsx", "../javascripts/styled-components/components/ProductCard/ProductCardSkeleton.tsx"], "sourcesContent": ["import React, { useEffect, useState } from 'react';\nimport { useSelector } from 'react-redux';\n\nimport type { ElasticVehicle } from '../../@types/ElasticVehicle';\nimport { getQueryFilter } from '../../utils/reselectors';\nimport SearchSubscription from '../subscriptions/search-subscription';\nimport ResultSetContainer from './result-set-container';\n\ninterface ResultSetProps {\n data: ElasticVehicle[];\n title?: string;\n disableScrollTopButton?: boolean;\n shouldHideAds?: boolean;\n}\n\nconst ResultSet = ({ data, title, disableScrollTopButton, shouldHideAds }: ResultSetProps) => {\n const queryFilter = useSelector(getQueryFilter);\n\n const [subscribe, setSubscribe] = useState(false);\n const [visibleFilterScroll, setVisibleFilterScroll] = useState(false);\n\n const onScroll = () => {\n let offset = 0;\n if (document.documentElement) {\n offset = document.documentElement.scrollTop;\n }\n\n if (offset < 0) {\n offset = 0;\n }\n\n if (offset > 150 && !visibleFilterScroll) {\n setVisibleFilterScroll(true);\n } else if (offset <= 150 && visibleFilterScroll) {\n setVisibleFilterScroll(false);\n }\n };\n\n useEffect(() => {\n if (!disableScrollTopButton) {\n document.addEventListener('scroll', onScroll);\n }\n return () => {\n document.removeEventListener('scroll', onScroll);\n };\n }, [visibleFilterScroll]);\n\n if (!data) {\n return null;\n }\n\n return (\n <>\n {subscribe && (\n setSubscribe(false)} query={queryFilter.toString()} />\n )}\n \n \n );\n};\n\nexport default ResultSet;\n", "import { bindActionCreators } from '@reduxjs/toolkit';\nimport React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { create } from '../../actions/search-subscription';\nimport {\n trackLoginModuleClickLoginSaveSearchResult,\n trackLoginModuleInViewportSaveSearchResult,\n} from '../../actions/tracking';\nimport { ExchangeTypes, useDataExchangeStatus } from '../../hooks/exchange-status';\nimport type { RootState } from '../../reducers';\nimport Alert from '../../styled-components/components/Alert';\nimport { Button } from '../../styled-components/components/Button';\nimport Content from '../../styled-components/components/Content';\nimport InputHelp from '../../styled-components/components/InputHelp';\nimport InputLabel from '../../styled-components/components/InputLabel';\nimport InputText from '../../styled-components/components/InputText';\nimport Loader from '../../styled-components/components/Loader';\nimport Modal from '../../styled-components/components/Modal';\nimport { StackMedium } from '../../styled-components/components/Stack';\nimport SignInModal from '../../styled-components/structures/Modals/SignInModal';\n\ninterface SearchSubscriptionProps {\n query: string;\n onClose: () => void;\n}\n\nconst SearchSubscription = ({ query, onClose }: SearchSubscriptionProps) => {\n const { t } = useTranslation(['common', 'list']);\n const dispatch = useDispatch();\n\n const authenticated = useSelector((s) => !!s.auth.token);\n\n const requestStatus = useSelector((s) => s.subscriptions.search.requestStatus);\n const responseStatus = useSelector(\n (s) => s.subscriptions.search.responseStatus,\n );\n\n const requestCreate = useDataExchangeStatus(ExchangeTypes.Creating, [\n requestStatus,\n responseStatus,\n ]);\n\n const actions = bindActionCreators(\n {\n create,\n trackLoginModuleInViewportSaveSearchResult,\n trackLoginModuleClickLoginSaveSearchResult,\n },\n dispatch,\n );\n\n const [name, setName] = useState('');\n\n const onChange = (e: React.ChangeEvent) => setName(e.currentTarget.value);\n\n if (requestCreate.pending) {\n return (\n \n \n \n );\n }\n\n if (!authenticated) {\n const url = new URL(location.href);\n url.searchParams.append('subscribe', 'true');\n const authUrl = `/auth/signin?redirectUrl=${encodeURIComponent(url.pathname + url.search)}`;\n return (\n \n );\n }\n\n if (requestCreate.successful) {\n return (\n \n {t('close', { ns: 'common' })}\n ,\n ]}\n >\n \n

{t('monitoringHasBeenCreatedDescription', { ns: 'list' })}

\n
\n \n );\n }\n\n let alert = null;\n if (requestCreate.failed) {\n alert = (\n \n {t('monitoringCouldNotBeCreated', { ns: 'list' })}\n \n );\n }\n\n return (\n \n {t('cancel', { ns: 'common' })}\n ,\n \n actions.create({\n query,\n name,\n })\n }\n title={t('save', { ns: 'common' })}\n $tone=\"primary\"\n $fullWidth\n disabled={!name}\n data-testid=\"save-search-modal-save-button\"\n >\n {t('save', { ns: 'common' })}\n ,\n ]}\n >\n \n {t('monitoringHelp', { ns: 'list' })}\n \n \n {t('nameOfMonitoring', { ns: 'list' })}\n \n {t('monitoringNameHelp', { ns: 'list' })}\n \n {alert}\n \n );\n};\n\nexport default SearchSubscription;\n", "import React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport type { ElasticVehicle } from '../../@types/ElasticVehicle';\nimport { resolveCarValuationRoute } from '../../routes/utils';\nimport Alert from '../../styled-components/components/Alert';\nimport { Button } from '../../styled-components/components/Button';\nimport { Column, Columns } from '../../styled-components/components/Columns';\nimport Content from '../../styled-components/components/Content';\nimport { H2 } from '../../styled-components/components/Heading';\nimport { Label } from '../../styled-components/components/Label';\nimport { MaxWidth } from '../../styled-components/components/MaxWidth';\nimport { ProductGrid, ProductGridItem } from '../../styled-components/components/ProductGrid';\nimport { Sheet } from '../../styled-components/components/Sheet';\nimport { Stack, StackSmall } from '../../styled-components/components/Stack';\nimport Link from '../link';\nimport ResultSetItem from './result-set-item';\n\ninterface ItemsProps {\n data: ElasticVehicle[];\n from: number;\n to: number;\n title?: string;\n}\n\nconst Items = ({ data, from, to, title }: ItemsProps) => {\n return (\n <>\n {data.slice(from, to).map((document, index) => (\n \n ))}\n \n );\n};\n\ninterface ResultSetContainerProps {\n data: ElasticVehicle[];\n title?: string;\n shouldHideAds?: boolean;\n}\n\nconst ResultSetContainer = ({ data, title }: ResultSetContainerProps) => {\n const { t } = useTranslation(['search']);\n\n if (!data || data.length === 0) {\n return {t('yourSearchResultedInNoResults', { ns: 'search' })};\n }\n\n return (\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n

\n {t('sheetAssignmentHeading', { ns: 'search' })}\n

\n
\n
\n \n \n

{t('sheetAssignmentBody', { ns: 'search' })}

\n
\n
\n
\n
\n \n \n {t('sheetAssignmentButtonText', { ns: 'search' })}\n \n \n
\n \n
\n\n \n \n\n \n \n\n \n \n
\n );\n};\n\nexport default ResultSetContainer;\n", "import React from 'react';\n\nimport ProductCardSkeleton from '../../styled-components/components/ProductCard/ProductCardSkeleton';\nimport { ProductGrid, ProductGridItem } from '../../styled-components/components/ProductGrid';\n\ninterface PlaceholderResultSetProps {\n size: number;\n}\n\nconst PlaceholderResultSet = ({ size }: PlaceholderResultSetProps) => (\n \n {Array.from({ length: size }).map((_, index) => (\n \n \n \n ))}\n \n);\n\nexport default PlaceholderResultSet;\n", "import React from 'react';\nimport { Skeleton } from '../Skeleton';\nimport { Body, Footer, Media, Wrapper } from './wrapper';\n\nconst ProductCardSkeleton = () => (\n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default ProductCardSkeleton;\n"], "mappings": "q3CAAA,IAAAA,EAA2C,SCC3C,IAAAC,EAAgC,SA2BhC,IAAMC,GAAqB,CAAC,CAAE,MAAAC,EAAO,QAAAC,CAAQ,IAA+B,CAC1E,GAAM,CAAE,CAAE,EAAIC,EAAe,CAAC,SAAU,MAAM,CAAC,EACzCC,EAAWC,EAAY,EAEvBC,EAAgBC,EAAiCC,GAAM,CAAC,CAACA,EAAE,KAAK,KAAK,EAErEC,EAAgBF,EAAgCC,GAAMA,EAAE,cAAc,OAAO,aAAa,EAC1FE,EAAiBH,EACpBC,GAAMA,EAAE,cAAc,OAAO,cAChC,EAEMG,EAAgBC,IAA8C,CAClEH,EACAC,CACF,CAAC,EAEKG,EAAUC,EACd,CACE,OAAAC,EACA,2CAAAC,EACA,2CAAAC,CACF,EACAb,CACF,EAEM,CAACc,EAAMC,CAAO,KAAI,YAAS,EAAE,EAE7BC,GAAYC,GAA2CF,EAAQE,EAAE,cAAc,KAAK,EAE1F,GAAIV,EAAc,QAChB,OACE,EAAAW,QAAA,cAACC,EAAA,CAAM,QAAS,EAAE,mBAAoB,CAAE,GAAI,MAAO,CAAC,EAAG,QAASrB,GAC9D,EAAAo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B,CACvB,CACD,CACH,EAGKC,GAAQR", "names": ["import_react", "import_react", "SearchSubscription", "query", "onClose", "useTranslation", "dispatch", "useDispatch", "authenticated", "useSelector", "s", "requestStatus", "responseStatus", "requestCreate", "useDataExchangeStatus", "actions", "bindActionCreators", "create", "trackLoginModuleInViewportSaveSearchResult", "trackLoginModuleClickLoginSaveSearchResult", "name", "setName", "onChange", "e", "React", "Modal_default", "Loader_default", "url", "authUrl", "SignInModal_default", "Button", "Content_default", "alert", "StackMedium", "Alert_default", "InputLabel_default", "InputText_default", "InputHelp_default", "search_subscription_default", "import_react", "Items", "data", "from", "to", "title", "React", "document", "index", "result_set_item_default", "ResultSetContainer", "useTranslation", "Alert_default", "ProductGrid", "ProductGridItem", "Sheet", "Columns", "Column", "MaxWidth", "Stack", "StackSmall", "Label", "H2", "Content_default", "Button", "link_default", "resolveCarValuationRoute", "result_set_container_default", "ResultSet", "data", "title", "disableScrollTopButton", "shouldHideAds", "queryFilter", "useSelector", "getQueryFilter", "subscribe", "setSubscribe", "visibleFilterScroll", "setVisibleFilterScroll", "onScroll", "offset", "React", "search_subscription_default", "result_set_container_default", "result_set_default", "import_react", "import_react", "ProductCardSkeleton", "React", "Wrapper", "Body", "Media", "Skeleton", "Footer", "ProductCardSkeleton_default", "PlaceholderResultSet", "size", "React", "ProductGrid", "_", "index", "ProductGridItem", "ProductCardSkeleton_default", "placeholder_result_set_default"] }