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avoriteToggleButton/styles/FavoriteToggleButton.scss?7f74","webpack://myhooman-b2c-webapp/./src/components/FavoriteToggleButton/FavoriteToggleButton.tsx","webpack://myhooman-b2c-webapp/./src/components/FavoriteToggleButton/index.tsx","webpack://myhooman-b2c-webapp/./src/components/RegisterActionLayer/styles/RegisterActionLayer.scss?5607","webpack://myhooman-b2c-webapp/./src/components/Images/FavouriteCTA.png","webpack://myhooman-b2c-webapp/./src/components/RegisterActionLayer/RegisterActionLayer.tsx","webpack://myhooman-b2c-webapp/./src/components/RegisterActionLayer/index.tsx","webpack://myhooman-b2c-webapp/./src/hoc/withMatchParamCatcher.tsx","webpack://myhooman-b2c-webapp/./src/services/Share/index.ts","webpack://myhooman-b2c-webapp/./src/store/preferences/selectors.ts","webpack://myhooman-b2c-webapp/./src/store/search/selectors.ts","webpack://myhooman-b2c-webapp/./src/store/search/thunks.ts","webpack://myhooman-b2c-webapp/./src/components/FavoriteToggleButton/styles/FavoriteToggleButton.scss","webpack://myhooman-b2c-webapp/./src/components/RegisterActionLayer/styles/RegisterActionLayer.scss"],"sourcesContent":["import api from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./FavoriteToggleButton.scss\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import './styles';\n\nimport { Button, Icons } from '@colensobbdo/shelter-management-frontend';\nimport { AnimalIdType, Nil } from '@colensobbdo/shelter-management-frontend-integration';\nimport { ButtonProps } from '@colensobbdo/shelter-management-frontend/dist/components/Button/Button';\nimport ClassNames from 'classnames';\nimport React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { favoriteToggleAnimal } from 'store/favorites/actions';\nimport { isFavoritedAnimal } from 'store/favorites/selectors';\n\nconst { HeartFilledIcon, HeartIcon } = Icons;\n\nexport type FavoriteToggleButtonProps = {\n animalId: AnimalIdType | Nil;\n align?: 'right';\n big?: boolean;\n active?: boolean;\n} & ButtonProps;\n\n/**\n * @constructor\n */\nconst FavoriteToggleButton: React.FC = ({\n align,\n big,\n size,\n animalId,\n onClick,\n ...props\n}) => {\n const dispatch = useDispatch();\n\n const CLASS_NAMES = ClassNames(\n 'c-favorites',\n {\n 'c-favorites--right': align === 'right',\n 'c-favorites--big': big,\n 'c-favorites--small': size === 'small',\n },\n props.className,\n );\n\n const IS_FAVORITED = useSelector(isFavoritedAnimal(animalId));\n\n const _onClick = (event: React.MouseEvent) => {\n event.stopPropagation();\n\n dispatch(favoriteToggleAnimal(animalId));\n\n onClick && onClick(event);\n };\n\n const defaultAffix = props.active ? : ;\n\n return (\n : defaultAffix}\n onClick={_onClick}\n className={CLASS_NAMES}\n />\n );\n};\n\nexport default FavoriteToggleButton;\n","import React from 'react';\n\nimport BaseFavoriteToggleButton, { FavoriteToggleButtonProps } from './FavoriteToggleButton';\n\ntype Props = {\n onClick?: () => void;\n} & FavoriteToggleButtonProps;\n\n/**\n * @constructor\n */\nexport const FavoriteToggleButton: React.FC = ({ onClick, ...props }) => (\n \n);\n\nexport default FavoriteToggleButton;\n","import api from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./RegisterActionLayer.scss\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","export default __webpack_public_path__ + \"assets/FavouriteCTA.png\";","import './styles';\n\nimport { ActionLayer, Button, Heading, Spacer, Text } from '@colensobbdo/shelter-management-frontend';\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { useHistory } from 'react-router-dom';\n\nimport routes from '../../configs/routes';\nimport Images from '../Images';\nimport FavoriteCTAImage from '../Images/FavouriteCTA.png';\n\nconst { FavouritesCtaImage } = Images;\n\nexport type RegisterActionLayerData = {\n titleMessageId?: string;\n contentMessageId?: string;\n image?: React.ReactNode;\n};\n\ntype Props = {\n open?: boolean;\n handleClose?: () => void;\n data?: RegisterActionLayerData | null | undefined;\n matchesPage?: boolean;\n};\n\n/**\n * @param props\n * @constructor\n */\nconst RegisterActionLayer: React.FC = (props) => {\n const history = useHistory();\n const { open, data, handleClose, matchesPage } = props;\n const { titleMessageId, contentMessageId, image } = data || {};\n\n return (\n \n \n \n \n \n {matchesPage ? (\n \n \"Favorites\n \n ) : (\n \n {image || }\n \n )}\n \n {\n history.push(routes.pages.registration.root);\n }}\n >\n \n \n ),\n }}\n />\n \n\n \n history.push(routes.pages.registration.root)}\n style={{ maxWidth: '324px' }}\n >\n \n \n \n \n \n );\n};\n\nexport default RegisterActionLayer;\n","import { useActionLayer } from '@colensobbdo/shelter-management-frontend';\nimport React, { useState } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { preferenceRegisterActionLayerShown } from 'store/preferences/actions';\nimport { didShowRegisterActionLayer } from 'store/preferences/selectors';\n\nimport { isAuthenticated } from '../../store/auth/selectors';\nimport BaseRegisterActionLayer, { RegisterActionLayerData } from './RegisterActionLayer';\n\ninterface Props {\n matchesPage?: boolean;\n}\n\n/**\n * @constructor\n */\nconst useRegisterActionLayer = () => {\n const dispatch = useDispatch();\n\n const isLoggedIn = useSelector(isAuthenticated);\n const didShow = useSelector(didShowRegisterActionLayer);\n\n const [data, setData] = useState();\n\n const { open, openActionLayer, closeActionLayer } = useActionLayer();\n\n const openRegisterActionLayer = (data?: RegisterActionLayerData, force = false) => {\n // this action layer is only for unauthenticated users\n if (isLoggedIn) return;\n\n // only show this once\n if (didShow && !force) return;\n\n // the action layer message changes\n // according to the clicked button\n dispatch(preferenceRegisterActionLayerShown());\n\n if (data) setData(data);\n\n openActionLayer();\n };\n\n const RegisterActionLayer: React.FC = ({ matchesPage }) => (\n \n );\n\n return { RegisterActionLayer, openRegisterActionLayer };\n};\n\nexport default useRegisterActionLayer;\n","import { AnimalSpecieCategoryId, ensureInt } from '@colensobbdo/shelter-management-frontend-integration';\nimport _compact from 'lodash/compact';\nimport _isEmpty from 'lodash/isEmpty';\nimport _map from 'lodash/map';\nimport React, { useEffect, useState } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { useLocation } from 'react-router-dom';\nimport { searchStoreNewCoordinate, searchStoreParameters } from 'store/search/actions';\nimport { waitThenSyncAdopterAttributes } from 'store/search/thunks';\n\n// https://uat.myhooman.com/animals/profile/58?h=Woofn%E2%80%99%20great%20match!&d=6&s=74&a[]=3&a[]=8&a[]=13&a[]=23&a[]=18&a[]=26&lat=-36.8153806&long=174.7215331\n// \"?h=Woofn’ great match!&d=6&s=74&a[]=3&a[]=8&a[]=13&a[]=23&a[]=18&a[]=26&lat=-36.8153806&long=174.7215331\"\n// * ignored headline \"Woofn’ great match!\"\n// * ignored distance 6km\n// score 74%\n// attributes [3, 8, 13, 23, 18, 26]\n// coordinates -36.8153806, 174.7215331\n// animal id 58\n\n// https://uat.myhooman.com/matches?h=Woofn%E2%80%99%20great%20match!&d=6&s=74&a[]=3&a[]=8&a[]=13&a[]=23&a[]=18&a[]=26&lat=-36.8153806&long=174.7215331\n// ?h=Woofn’ great match!&d=6&s=74&a[]=3&a[]=8&a[]=13&a[]=23&a[]=18&a[]=26&lat=-36.8153806&long=174.7215331\"\n// * ignored headline \"Woofn’ great match!\"\n// * ignored distance 6km\n// * ignored score 74%\n// attributes [3, 8, 13, 23, 18, 26]\n// coordinates -36.8153806, 174.7215331\n\nexport function withMatchParamCatcher(WrappedComponent: React.ComponentType): React.FC {\n return function MatchParamCatcher(props: T) {\n const { search } = useLocation();\n const dispatch = useDispatch();\n\n const [loading, setLoading] = useState(true);\n\n const _catch = async () => {\n // intercept query string parameters\n // coming from pedigreeparenting.co.nz\n const queryParams = new URLSearchParams(search);\n\n const ATTRIBUTES = queryParams.getAll('a[]');\n\n const FILTERED_ATTRIBUTES = _compact(_map(ATTRIBUTES, ensureInt));\n\n const LATITUDE = parseFloat(queryParams.get('lat') || '0') || 0;\n const LONGITUDE = parseFloat(queryParams.get('long') || '0') || 0;\n\n if (!_isEmpty(FILTERED_ATTRIBUTES)) {\n // pedigreeparenting.co.nz currently only has dogs, so assume they are looking for dog matches\n dispatch(\n searchStoreParameters({\n attributes: { attributes: FILTERED_ATTRIBUTES, animalSpeciesCategory: AnimalSpecieCategoryId.Dogs },\n animalSpeciesCategory: AnimalSpecieCategoryId.Dogs,\n latitude: LATITUDE,\n longitude: LONGITUDE,\n }),\n );\n } else if (LATITUDE && LONGITUDE) {\n // just in case we only have the location\n dispatch(\n searchStoreNewCoordinate({\n latitude: LATITUDE,\n longitude: LONGITUDE,\n }),\n );\n }\n\n dispatch(waitThenSyncAdopterAttributes());\n\n setLoading(false);\n };\n\n useEffect(() => {\n _catch();\n }, []);\n\n if (loading) return null;\n\n return ;\n };\n}\n\nexport default withMatchParamCatcher;\n","import { AnimalIdType, Nil, makeLoggers } from '@colensobbdo/shelter-management-frontend-integration';\nimport routes from 'configs/routes';\nimport _isArray from 'lodash/isArray';\nimport _isNil from 'lodash/isNil';\nimport _replace from 'lodash/replace';\nimport { isMobile } from 'react-device-detect';\nimport { useIntl } from 'react-intl';\n\nconst { fork } = makeLoggers('services :: share');\n\nexport function useAnimalProfileSharing() {\n const intl = useIntl();\n\n const { log, loge } = fork('useAnimalProfileSharing');\n\n return (animalId: AnimalIdType | Nil, dogName: string) => () => {\n if (!animalId) {\n log('ignoring share request when animalId is empty', { animalId });\n\n return;\n }\n\n const relativePath = _replace(routes.pages.animals.profile, ':animalId', `${animalId}`);\n let url;\n try {\n url = new URL(relativePath, window.location.href).toString();\n } catch (err) {\n url = `${window.location.origin}${relativePath}`;\n }\n\n const shareData = {\n title: intl.formatMessage({ id: 'services.share.title' }, { dogName }),\n text: intl.formatMessage({ id: 'services.share.text' }, { dogName }),\n url,\n };\n log('shareData', shareData);\n\n if (navigator.share && isMobile) {\n log('using native sharing');\n\n navigator\n .share(shareData)\n .then(() => {\n // this will never happen in IOS 14.0.1\n log('content shared');\n })\n .catch((err) => {\n loge('error while calling native share', err);\n\n //this will catch the second share attempt\n window.location.reload(true); // now share works again\n });\n } else {\n log('using facebook share');\n\n let url = encodeURI(shareData.url);\n window.open(\n `https://www.facebook.com/sharer/sharer.php?u=${url}`,\n 'facebook',\n 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0',\n );\n return false;\n }\n };\n}\n\nexport function encodeQueryData(data: any) {\n const ret = [];\n for (let d in data) {\n if (_isArray(data[d])) {\n for (let arrD in data[d]) {\n ret.push(`${encodeURIComponent(d)}[]=${encodeURIComponent(data[d][arrD])}`);\n }\n } else if (_isNil(data[d])) {\n ret.push(encodeURIComponent(d));\n } else {\n ret.push(`${encodeURIComponent(d)}=${encodeURIComponent(data[d])}`);\n }\n }\n return ret.join('&');\n}\n","import { RootState } from '../store';\n\nexport const didShowRegisterActionLayer = (state: RootState) => state.preferences.didShowRegisterActionLayer;\nexport const didShowFavouriteActionLayer = (state: RootState) => state.preferences.didShowFavouriteActionLayer;\nexport const didShowGUOHModal = (state: RootState) => state.preferences.didShowGUOHModal;\n","import {\n AnimalIdType,\n AnimalMatching,\n AnimalSpecieCategoryId,\n IAdopterAttributeValue,\n Nil,\n} from '@colensobbdo/shelter-management-frontend-integration';\nimport _isEmpty from 'lodash/isEmpty';\nimport hash from 'object-hash';\n\nimport { RootState } from '../store';\nimport { AttributeMap } from './types';\n\nexport const getAllAdopterAttributeIds = (state: RootState): number[] => {\n const { attributeMap } = state.search;\n let ids: number[] = [];\n for (const animalSpeciesCategoryId in attributeMap) {\n const id = Number(animalSpeciesCategoryId) as AnimalSpecieCategoryId;\n ids = [...ids, ...(attributeMap[id] as number[])];\n }\n return ids;\n};\n\nexport const getAdopterAttributeIdsBySpecies = (\n animalSpeciesCategoryId: AnimalSpecieCategoryId,\n state: RootState,\n): number[] => {\n const attributes =\n state.search.attributeMap &&\n Object.prototype.hasOwnProperty.call(state.search.attributeMap, animalSpeciesCategoryId)\n ? (state.search.attributeMap[animalSpeciesCategoryId] as number[])\n : [];\n return attributes;\n};\n\nexport const hasAdopterLocation = (state: RootState): boolean =>\n typeof getAdopterLatitude(state) === 'number' && typeof getAdopterLongitude(state) === 'number';\n\nexport const getAdopterLatitude = (state: RootState): number | Nil => state.search.latitude;\n\nexport const getAdopterLongitude = (state: RootState): number | Nil => state.search.longitude;\n\nexport const getAdopterLocation = (state: RootState): { latitude: number | Nil; longitude: number | Nil } | Nil => {\n if (hasAdopterLocation(state))\n return {\n latitude: state.search.latitude,\n longitude: state.search.longitude,\n };\n};\n\nexport const getAdopterAnimalSpeciesCategory = (state: RootState): AnimalSpecieCategoryId | Nil =>\n state.search.animalSpeciesCategory;\n\nexport const getAdopterAttributes = (\n animalSpeciesCategoryId: AnimalSpecieCategoryId,\n state: RootState,\n): IAdopterAttributeValue[] => {\n const attributes =\n state.search.attributeMap &&\n Object.prototype.hasOwnProperty.call(state.search.attributeMap, animalSpeciesCategoryId)\n ? state.search.attributeMap[animalSpeciesCategoryId] || []\n : [];\n\n return attributes.map((attr) => ({ id: attr, type: 0 } as IAdopterAttributeValue));\n};\n\nexport const getSearchHash =\n (animalSpeciesCategoryId?: AnimalSpecieCategoryId) =>\n (state: RootState): string | undefined => {\n if (!animalSpeciesCategoryId) return;\n hash({\n attributes: getAdopterAttributes(animalSpeciesCategoryId, state),\n latitude: getAdopterLatitude(state),\n longitude: getAdopterLongitude(state),\n });\n };\nexport const isMatched =\n (animalSpeciesCategoryId?: AnimalSpecieCategoryId) =>\n (state: RootState): boolean =>\n animalSpeciesCategoryId ? !_isEmpty(getAdopterAttributeIdsBySpecies(animalSpeciesCategoryId, state)) : false;\n\nexport const isAnyMatched = (state: RootState): boolean => {\n const { attributeMap } = state.search;\n for (const animalSpeciesCategoryId in attributeMap) {\n const id = Number(animalSpeciesCategoryId) as AnimalSpecieCategoryId;\n if (!_isEmpty(attributeMap[id])) return true;\n }\n return false;\n};\n\nexport const getAllSearchAttributes = (state: RootState): AttributeMap | Nil => state.search.attributeMap;\n\nexport const getMatchParams =\n (animalSpeciesCategoryId?: AnimalSpecieCategoryId) =>\n (state: RootState): AnimalMatching.SearchRequest | undefined => {\n return {\n attributes: animalSpeciesCategoryId ? getAdopterAttributes(animalSpeciesCategoryId, state) : [],\n animalSpeciesCategory: getAdopterAnimalSpeciesCategory(state),\n location: hasAdopterLocation(state)\n ? {\n latitude: getAdopterLatitude(state) as number,\n longitude: getAdopterLongitude(state) as number,\n }\n : undefined,\n };\n };\n\nexport const getAnimalMatchParams =\n (animalId: AnimalIdType | Nil, animalSpeciesCategoryId?: AnimalSpecieCategoryId) =>\n (state: RootState): AnimalMatching.ByIdRequest | undefined => {\n if (!animalSpeciesCategoryId) return;\n return {\n animalId,\n attributes: getAdopterAttributes(animalSpeciesCategoryId, state),\n location: hasAdopterLocation(state)\n ? {\n latitude: getAdopterLatitude(state) as number,\n longitude: getAdopterLongitude(state) as number,\n }\n : undefined,\n };\n };\n","import {\n AnimalSpecieCategoryId,\n IAdopterAttributeValue,\n PersonAdopterAttribute,\n} from '@colensobbdo/shelter-management-frontend-integration';\nimport AwaitLock from 'await-lock';\nimport _isEmpty from 'lodash/isEmpty';\nimport { Action, Dispatch } from 'redux';\nimport { ThunkAction } from 'redux-thunk';\nimport { getPersonId } from 'store/person/selectors';\n\nimport { RootState } from '../store';\nimport { searchStoreReplaceAttributes } from './actions';\nimport { getAllAdopterAttributeIds } from './selectors';\nimport { AttributeMap } from './types';\n\nconst lock = new AwaitLock();\n\nconst convertRemoteAttributes = (remoteAttributes: IAdopterAttributeValue[]): AttributeMap => {\n const attributes: AttributeMap = {};\n remoteAttributes.forEach((attr) => {\n attributes[attr.animalSpeciesCategory] = [...(attributes[attr.animalSpeciesCategory] || []), attr.id];\n });\n return attributes;\n};\n\nexport const waitThenSyncAdopterAttributes =\n (): ThunkAction> =>\n async (dispatch: Dispatch, getState: () => RootState) => {\n const state = getState();\n const PERSON_ID = getPersonId(state);\n\n if (!PERSON_ID) return;\n\n //\n // use mutex access to this function\n // so that we prevent concurrent sync issues\n // (this is not 100% safe as we should prevent this even from different clients...)\n //\n\n await lock.acquireAsync();\n\n //\n // sync policy:\n // local first (override remote changes)\n //\n\n const response = await PersonAdopterAttribute.call({\n personId: PERSON_ID,\n });\n\n if (!response.success) {\n lock.release();\n return;\n }\n\n // Remote data\n const remoteAttributes = response.data;\n const remoteAttributeMap = convertRemoteAttributes(remoteAttributes);\n\n // to ease redux dispatch race conditions\n await new Promise((resolve) => setTimeout(resolve, 100));\n\n // Local data\n const localAttributes = getAllAdopterAttributeIds(state);\n\n //\n // if there are some attributes recorded locally\n // override the remote\n //\n\n if (!_isEmpty(localAttributes)) {\n const response2 = await PersonAdopterAttribute.update({\n personId: PERSON_ID,\n attributeIds: localAttributes,\n });\n\n //\n // if this fails\n // take the remote list and override local\n //\n\n if (!response2.success) {\n for (const animalSpeciesCategoryId in remoteAttributeMap) {\n const id = Number(animalSpeciesCategoryId) as AnimalSpecieCategoryId;\n dispatch(\n searchStoreReplaceAttributes({\n attributes: remoteAttributeMap[id] || [],\n animalSpeciesCategory: id,\n }),\n );\n }\n }\n } else {\n //\n // take the remote list and override local\n //\n for (const animalSpeciesCategoryId in remoteAttributeMap) {\n const id = Number(animalSpeciesCategoryId) as AnimalSpecieCategoryId;\n dispatch(\n searchStoreReplaceAttributes({\n attributes: remoteAttributeMap[id] || [],\n animalSpeciesCategory: id,\n }),\n );\n }\n }\n\n lock.release();\n };\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".c-button.c-favorites{position:absolute;width:60px;height:60px;border-radius:30px;background-color:#ff9eb0;border-color:rgba(0,0,0,0)}.c-button.c-favorites--big{width:70px;height:70px;border-radius:35px}.c-button.c-favorites--small{width:42px;height:42px}.c-button.c-favorites--small .c-icon{width:26px;height:26px;transform:scale(1) !important}.c-button.c-favorites--right{top:-50px;left:calc(100% - 90px)}.c-button.c-favorites .c-icon{transform:scale(1.6)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/FavoriteToggleButton/styles/FavoriteToggleButton.scss\"],\"names\":[],\"mappings\":\"AACE,sBAGE,iBAAA,CACA,UAAA,CACA,WAAA,CACA,kBAAA,CACA,wBAAA,CACA,0BAAA,CAEA,2BACE,UAAA,CACA,WAAA,CACA,kBAAA,CAGF,6BACE,UAAA,CACA,WAAA,CACA,qCACE,UAAA,CACA,WAAA,CACA,6BAAA,CAIJ,6BACE,SAAA,CACA,sBAAA,CAGF,8BACE,oBAAA\",\"sourcesContent\":[\".c-button {\\n &.c-favorites {\\n $this: &;\\n\\n position: absolute;\\n width: 60px;\\n height: 60px;\\n border-radius: 30px;\\n background-color: #ff9eb0;\\n border-color: transparent;\\n\\n &--big {\\n width: 70px;\\n height: 70px;\\n border-radius: 35px;\\n }\\n\\n &--small {\\n width: 42px;\\n height: 42px;\\n .c-icon {\\n width: 26px;\\n height: 26px;\\n transform: scale(1) !important;\\n }\\n }\\n\\n &--right {\\n top: -50px;\\n left: calc(100% - 90px);\\n }\\n\\n .c-icon {\\n transform: scale(1.6);\\n }\\n }\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".c-action-layer__icon{height:50px;width:94px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/RegisterActionLayer/styles/RegisterActionLayer.scss\"],\"names\":[],\"mappings\":\"AAKE,sBACE,WAAA,CACA,UAAA\",\"sourcesContent\":[\"// ======================================================\\n// RegisterActionLayer\\n// ======================================================\\n\\n.c-action-layer {\\n &__icon {\\n height: 50px;\\n width: 94px;\\n }\\n\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["options","HeartFilledIcon","Icons","HeartIcon","align","big","size","animalId","onClick","props","dispatch","useDispatch","CLASS_NAMES","ClassNames","className","IS_FAVORITED","useSelector","isFavoritedAnimal","defaultAffix","active","icon","affix","event","stopPropagation","favoriteToggleAnimal","FavouritesCtaImage","Images","history","useHistory","open","data","handleClose","matchesPage","titleMessageId","contentMessageId","image","backdrop","suffix","level","id","src","FavoriteCTAImage","alt","values","link","inline","text","style","fontSize","push","routes","block","color","maxWidth","isLoggedIn","isAuthenticated","didShow","didShowRegisterActionLayer","useState","setData","useActionLayer","openActionLayer","closeActionLayer","RegisterActionLayer","openRegisterActionLayer","force","preferenceRegisterActionLayerShown","WrappedComponent","search","useLocation","loading","setLoading","_catch","queryParams","URLSearchParams","ATTRIBUTES","getAll","FILTERED_ATTRIBUTES","_compact","_map","ensureInt","LATITUDE","parseFloat","get","LONGITUDE","_isEmpty","searchStoreNewCoordinate","latitude","longitude","searchStoreParameters","attributes","animalSpeciesCategory","AnimalSpecieCategoryId","waitThenSyncAdopterAttributes","useEffect","fork","makeLoggers","useAnimalProfileSharing","intl","useIntl","log","loge","dogName","url","relativePath","_replace","URL","window","location","href","toString","err","origin","shareData","title","formatMessage","navigator","share","isMobile","encodeURI","then","catch","reload","encodeQueryData","ret","d","_isArray","arrD","encodeURIComponent","_isNil","join","state","preferences","didShowFavouriteActionLayer","getAllAdopterAttributeIds","attributeMap","ids","animalSpeciesCategoryId","Number","hasAdopterLocation","getAdopterLatitude","getAdopterLongitude","getAdopterLocation","getAdopterAnimalSpeciesCategory","getAdopterAttributes","Object","prototype","hasOwnProperty","call","map","attr","type","getSearchHash","hash","isMatched","getAdopterAttributeIdsBySpecies","isAnyMatched","getAllSearchAttributes","getMatchParams","undefined","getAnimalMatchParams","lock","AwaitLock","convertRemoteAttributes","remoteAttributes","forEach","getState","PERSON_ID","getPersonId","acquireAsync","PersonAdopterAttribute","personId","response","success","release","remoteAttributeMap","Promise","resolve","setTimeout","localAttributes","attributeIds","searchStoreReplaceAttributes","___CSS_LOADER_EXPORT___","module"],"sourceRoot":""}