{"version":3,"sources":["utils/helpers/jss/index.ts","components/Corporate/AddressCard/StyledAddressCard.ts","components/Corporate/MapStatic/StyledMapStatic.ts","components/Corporate/MapStatic/index.tsx","components/Corporate/GetDirectionsLink/StyledGetDirectionsLink.ts","components/Corporate/GetDirectionsLink/index.tsx","../node_modules/ramda/es/internal/_xmap.js","../node_modules/ramda/es/curryN.js","../node_modules/ramda/es/internal/_curryN.js","../node_modules/ramda/es/map.js","../node_modules/ramda/es/internal/_map.js","../node_modules/ramda/es/pick.js","components/Corporate/AddressCard/index.tsx"],"names":["normalizeJssFields","data","filters","normalized","keys","Object","filter","key","length","indexOf","forEach","val","hasOwnProperty","jss","Card","styled","article","theme","plainCard","Group","div","plainCardGroup","text_s","LinkHeading","Link","link","heading_s","spacing","mt","xs","AddressTag","address","ImageContainer","a","colors","element","focused","Image","img","imageFitCover","MapStatic","props","fields","latitude","longitude","googleListing","lat","value","lng","apikey","apiKey","googleListingUrl","href","editMode","staticMapUrl","target","rel","src","alt","Row","DirectionsLink","secondary","colorHover","ArrowIconWrap","span","svg","card","attributeIcon","ExternalIconWrap","GetDirectionsLink","useTranslation","t","directionsUrl","validGetDirURL","ariaHidden","XMap","f","xf","this","prototype","_xfBase","init","result","input","_xmap","_curry2","curryN","fn","_curry1","_arity","_curryN","received","combined","argsIdx","left","combinedIdx","arguments","_isPlaceholder","apply","map","_dispatchable","functor","toString","call","_reduce","acc","idx","len","Array","_map","pick","names","obj","addressFields","x","filteredFieldValues","Rmap","EditorText","compose","withEditModeNotice","Text","MissingDataSource","Address","primaryAddress","relatedAddress","place","space","cleanedAddress","addressClean","tag","field","noticeEnabled","noticeLevel","noticeMessage","addressMerge","addressLine1","addressLine2","addressLine3","postcode","suburb","placeName","placeUrl","pageTitle","url","addressLine4","join","getLink","StyledLink","withSitecoreContext","withEditMode","sitecoreContext","rendering","googleMapsApiKey","dataSource","route","relatedFields"],"mappings":"yHAAA,kCAAO,IAAMA,EAAqB,SAACC,GAAqC,IAAvBC,E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OAKxB,kBAAC,IAAD,KACE,kBAACP,EAAA,QAAD,CAAWE,OAAQA,EAAQQ,OAAQsG,EAAkBnG,SAAUA,IAC/D,kBAAC,EAAD,CAASX,OAAQA,EAAQW,SAAUA,KALhC,KAjBL,kBAACoE,EAAD,CAAmBU,eAAe,EAAME,cAAa","file":"static/js/AddressCard.6a2a3962.chunk.js","sourcesContent":["export const normalizeJssFields = (data: object, filters = []): any => {\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n let normalized = {};\r\n\r\n const keys = Object.keys(data).filter((key) => !filters.length || filters.indexOf(key) > -1);\r\n\r\n keys.forEach((key) => {\r\n const val = data[key];\r\n if (val && typeof val === 'object' && val.hasOwnProperty('jss')) {\r\n normalized[key] = val.jss;\r\n } else {\r\n normalized[key] = val;\r\n }\r\n });\r\n\r\n return normalized;\r\n};\r\n","import styled from 'styled-components';\r\nimport { plainCard, plainCardGroup, text_s, heading_s, link } from '_utils/styles';\r\nimport { Link } from 'react-router-dom';\r\nimport { spacing } from '_utils/props';\r\n\r\nexport const Card = styled.article`\r\n ${({ theme }) => plainCard({ theme })}\r\n /* overflow: hidden; */\r\n @media print {\r\n width: 60%;\r\n }\r\n`;\r\n\r\nexport const Group = styled.div`\r\n ${({ theme }) => plainCardGroup({ theme })}\r\n ${text_s}\r\n margin: 0;\r\n`;\r\n\r\nexport const LinkHeading = styled(Link)`\r\n ${link}\r\n display: inline;\r\n\r\n /* need to refactor this into a theme function */\r\n ${heading_s}\r\n\r\n & + div {\r\n ${({ theme }) => spacing({ theme, mt: { xs: 1 } })}\r\n }\r\n`;\r\n\r\nexport const AddressTag = styled.address`\r\n font-style: normal;\r\n ${text_s}\r\n &:first-child {\r\n margin-top: 0;\r\n }\r\n &:last-child {\r\n margin-bottom: 0;\r\n }\r\n`;\r\n","import styled from 'styled-components';\r\nimport { imageFitCover } from '_utils/styles';\r\n\r\nexport const ImageContainer = styled.div`\r\n position: relative;\r\n padding-top: 42.86%; /* 21:9 Aspect Ratio (divide 9 by 21 = 0.4285714286) */\r\n width: 100%;\r\n`;\r\n\r\nexport const Link = styled.a`\r\n width: 100%;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n position: absolute;\r\n outline: 0 !important;\r\n\r\n body:not(.safe-focus-removal) &:focus {\r\n &:before {\r\n content: '';\r\n position: absolute;\r\n left: -5px;\r\n top: -5px;\r\n z-index: 1;\r\n width: calc(100% + 10px);\r\n height: calc(100% + 10px);\r\n outline: 0;\r\n border-color: ${({ theme }) => theme.colors.element.focused};\r\n border-width: 2px;\r\n border-style: solid;\r\n border-top-left-radius: 10px;\r\n border-top-right-radius: 10px;\r\n }\r\n }\r\n`;\r\n\r\nexport const Image = styled.img`\r\n ${imageFitCover}\r\n`;\r\n","import React from 'react';\r\nimport { ImageContainer, Image, Link } from './StyledMapStatic';\r\n\r\nconst MapStatic = (props) => {\r\n const { latitude, longitude, googleListing } = props?.fields;\r\n const lat = latitude?.value ? latitude?.value : null;\r\n const lng = longitude?.value ? longitude?.value : null;\r\n const apikey = props?.apiKey?.value ? props?.apiKey?.value : null;\r\n const googleListingUrl = googleListing?.value?.href ? googleListing?.value.href : null;\r\n const editMode = props.editMode;\r\n\r\n let staticMapUrl = '';\r\n\r\n if ((!lat || !lng || !apikey) && !editMode) {\r\n return null;\r\n }\r\n\r\n if (lat && lng && apikey) {\r\n staticMapUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${lat}%2c%20${lng}&zoom=15&scale=2&size=286x123&markers=color:red%7Csize:mid%7C${lat}%2c%20${lng}&key=${apikey}`;\r\n }\r\n return (\r\n <>\r\n {staticMapUrl ? (\r\n \r\n {googleListingUrl ? (\r\n \r\n \r\n \r\n ) : (\r\n \r\n )}\r\n \r\n ) : (\r\n ''\r\n )}\r\n >\r\n );\r\n};\r\n\r\nexport default MapStatic;\r\n","import styled from 'styled-components';\r\nimport { text_s } from '_utils/styles';\r\nimport { svg } from '_utils/styles/';\r\n\r\nexport const Row = styled.div`\r\n display: flex;\r\n align-items: center;\r\n`;\r\n\r\nexport const DirectionsLink = styled.a`\r\n color: inherit;\r\n\r\n ${text_s}\r\n &:hover {\r\n ${({ theme }) => theme.colors.link.secondary.colorHover};\r\n }\r\n`;\r\n\r\nexport const ArrowIconWrap = styled.span`\r\n ${svg(17, 17)}\r\n flex: none;\r\n width: 17px;\r\n margin: 0 10px 0 0;\r\n path {\r\n fill: ${({ theme }) => theme.card.attributeIcon};\r\n }\r\n`;\r\n\r\nexport const ExternalIconWrap = styled.span`\r\n ${svg(13, 13)}\r\n flex: none;\r\n width: 13px;\r\n margin: 0 0 0 10px;\r\n path {\r\n fill: ${({ theme }) => theme.card.attributeIcon};\r\n }\r\n`;\r\n","import React from 'react';\r\nimport { Row, DirectionsLink, ArrowIconWrap, ExternalIconWrap } from './StyledGetDirectionsLink';\r\nimport { Directions, External } from '_utils/icons';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nconst GetDirectionsLink = (props) => {\r\n const [t] = useTranslation();\r\n const { latitude, longitude, googleListing } = props?.fields;\r\n let directionsUrl = '';\r\n\r\n const lat = latitude?.value;\r\n const lng = longitude?.value;\r\n const googleListingUrl = googleListing?.value?.href;\r\n\r\n const validGetDirURL =\r\n lat && lng ? `https://www.google.com/maps?saddr=My+Location&daddr=${lat},${lng}` : null; // If lat & lng concat with a comma\r\n\r\n if (validGetDirURL) {\r\n directionsUrl = validGetDirURL;\r\n } else if (googleListingUrl) {\r\n directionsUrl = googleListingUrl;\r\n }\r\n\r\n if (!directionsUrl) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {t('address-directions-link-label')}\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default GetDirectionsLink;\r\n","import _curry2 from './_curry2.js';\nimport _xfBase from './_xfBase.js';\n\nvar XMap = /*#__PURE__*/function () {\n function XMap(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XMap.prototype['@@transducer/init'] = _xfBase.init;\n XMap.prototype['@@transducer/result'] = _xfBase.result;\n XMap.prototype['@@transducer/step'] = function (result, input) {\n return this.xf['@@transducer/step'](result, this.f(input));\n };\n\n return XMap;\n}();\n\nvar _xmap = /*#__PURE__*/_curry2(function _xmap(f, xf) {\n return new XMap(f, xf);\n});\nexport default _xmap;","import _arity from './internal/_arity.js';\nimport _curry1 from './internal/_curry1.js';\nimport _curry2 from './internal/_curry2.js';\nimport _curryN from './internal/_curryN.js';\n\n/**\n * Returns a curried equivalent of the provided function, with the specified\n * arity. The curried function has two unusual capabilities. First, its\n * arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the\n * following are equivalent:\n *\n * - `g(1)(2)(3)`\n * - `g(1)(2, 3)`\n * - `g(1, 2)(3)`\n * - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value [`R.__`](#__) may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),\n * the following are equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.5.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} length The arity for the returned function.\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curry\n * @example\n *\n * const sumArgs = (...args) => R.sum(args);\n *\n * const curriedAddFourNumbers = R.curryN(4, sumArgs);\n * const f = curriedAddFourNumbers(1, 2);\n * const g = f(3);\n * g(4); //=> 10\n */\nvar curryN = /*#__PURE__*/_curry2(function curryN(length, fn) {\n if (length === 1) {\n return _curry1(fn);\n }\n return _arity(length, _curryN(length, [], fn));\n});\nexport default curryN;","import _arity from './_arity.js';\nimport _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Internal curryN function.\n *\n * @private\n * @category Function\n * @param {Number} length The arity of the curried function.\n * @param {Array} received An array of arguments received thus far.\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curryN(length, received, fn) {\n return function () {\n var combined = [];\n var argsIdx = 0;\n var left = length;\n var combinedIdx = 0;\n while (combinedIdx < received.length || argsIdx < arguments.length) {\n var result;\n if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {\n result = received[combinedIdx];\n } else {\n result = arguments[argsIdx];\n argsIdx += 1;\n }\n combined[combinedIdx] = result;\n if (!_isPlaceholder(result)) {\n left -= 1;\n }\n combinedIdx += 1;\n }\n return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));\n };\n}","import _curry2 from './internal/_curry2.js';\nimport _dispatchable from './internal/_dispatchable.js';\nimport _map from './internal/_map.js';\nimport _reduce from './internal/_reduce.js';\nimport _xmap from './internal/_xmap.js';\nimport curryN from './curryN.js';\nimport keys from './keys.js';\n\n/**\n * Takes a function and\n * a [functor](https://github.com/fantasyland/fantasy-land#functor),\n * applies the function to each of the functor's values, and returns\n * a functor of the same shape.\n *\n * Ramda provides suitable `map` implementations for `Array` and `Object`,\n * so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.\n *\n * Dispatches to the `map` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * Also treats functions as functors and will compose them together.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Functor f => (a -> b) -> f a -> f b\n * @param {Function} fn The function to be called on every element of the input `list`.\n * @param {Array} list The list to be iterated over.\n * @return {Array} The new list.\n * @see R.transduce, R.addIndex\n * @example\n *\n * const double = x => x * 2;\n *\n * R.map(double, [1, 2, 3]); //=> [2, 4, 6]\n *\n * R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}\n * @symb R.map(f, [a, b]) = [f(a), f(b)]\n * @symb R.map(f, { x: a, y: b }) = { x: f(a), y: f(b) }\n * @symb R.map(f, functor_o) = functor_o.map(f)\n */\nvar map = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {\n switch (Object.prototype.toString.call(functor)) {\n case '[object Function]':\n return curryN(functor.length, function () {\n return fn.call(this, functor.apply(this, arguments));\n });\n case '[object Object]':\n return _reduce(function (acc, key) {\n acc[key] = fn(functor[key]);\n return acc;\n }, {}, keys(functor));\n default:\n return _map(fn, functor);\n }\n}));\nexport default map;","export default function _map(fn, functor) {\n var idx = 0;\n var len = functor.length;\n var result = Array(len);\n while (idx < len) {\n result[idx] = fn(functor[idx]);\n idx += 1;\n }\n return result;\n}","import _curry2 from './internal/_curry2.js';\n\n/**\n * Returns a partial copy of an object containing only the keys specified. If\n * the key does not exist, the property is ignored.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [k] -> {k: v} -> {k: v}\n * @param {Array} names an array of String property names to copy onto a new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with only properties from `names` on it.\n * @see R.omit, R.props\n * @example\n *\n * R.pick(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n * R.pick(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1}\n */\nvar pick = /*#__PURE__*/_curry2(function pick(names, obj) {\n var result = {};\n var idx = 0;\n while (idx < names.length) {\n if (names[idx] in obj) {\n result[names[idx]] = obj[names[idx]];\n }\n idx += 1;\n }\n return result;\n});\nexport default pick;","import React from 'react';\r\nimport styled from 'styled-components';\r\nimport { Card, Group, LinkHeading, AddressTag } from './StyledAddressCard';\r\nimport { Text, withSitecoreContext } from '@sitecore-jss/sitecore-jss-react';\r\nimport { withEditMode, withEditModeNotice } from '_containers/BaseComponent';\r\nimport { compose } from 'ramda';\r\n// import data from './mockAddressCard.json';\r\nimport MapStatic from '../MapStatic';\r\nimport NavLink from '../NavItem';\r\n\r\nimport GetDirectionsLink from '../GetDirectionsLink';\r\n\r\nimport { addressClean, addressMerge } from '_utils/data';\r\nimport { normalizeJssFields } from '_utils/helpers/jss';\r\nimport { getLink } from '_utils/helpers/link';\r\nimport { map as Rmap, pick } from 'ramda';\r\n\r\ntype AddressCardProps = {\r\n sitecoreContext: any;\r\n rendering: any;\r\n editMode: boolean;\r\n};\r\n\r\nconst addressFields = ['addressLine1', 'addressLine2', 'addressLine3', 'suburb', 'postcode'];\r\n\r\n// functor to retrieve value\r\nconst value = (x) => x.value;\r\n\r\nconst filteredFieldValues = (fields, keys) => {\r\n if (!fields) {\r\n return {};\r\n }\r\n\r\n if (!keys) {\r\n return Rmap(value, fields);\r\n }\r\n\r\n return Rmap(value, pick(keys, fields));\r\n};\r\n\r\nconst EditorText = compose(withEditModeNotice)(Text);\r\nconst MissingDataSource = compose(withEditModeNotice)(styled.div``);\r\n\r\nconst Address = ({ editMode, fields }) => {\r\n let primaryAddress = filteredFieldValues(fields, addressFields);\r\n let relatedAddress = filteredFieldValues(fields.place?.fields, addressFields);\r\n\r\n if (fields.space && fields.space.fields.place) {\r\n relatedAddress = filteredFieldValues(fields.space.fields.place.fields, addressFields);\r\n const cleanedAddress = addressClean(primaryAddress);\r\n if (Object.keys(cleanedAddress).length === 0) {\r\n primaryAddress = filteredFieldValues(fields.space.fields, addressFields);\r\n }\r\n }\r\n else if (fields.space) {\r\n relatedAddress = filteredFieldValues(fields.space.fields, addressFields);\r\n }\r\n\r\n if (editMode) {\r\n return (\r\n \r\n {addressFields.map((key) => (\r\n \r\n ))}\r\n \r\n );\r\n } else {\r\n const mergedAddress = addressClean(addressMerge(primaryAddress, relatedAddress));\r\n\r\n const { addressLine1, addressLine2, addressLine3, postcode, suburb } = mergedAddress || {};\r\n\r\n let placeName = '';\r\n let placeUrl = '';\r\n \r\n if (fields.space && fields.space.fields.place) {\r\n placeName = fields.space.fields.place.fields.pageTitle.value;\r\n placeUrl = fields.space.fields.place.url;\r\n }\r\n else if (fields.space) {\r\n placeName = fields.space.fields.pageTitle.value;\r\n placeUrl = fields.space.url;\r\n }\r\n\r\n if (placeName === '' && fields.place) {\r\n placeName = fields.place.fields.pageTitle.value;\r\n placeUrl = fields.place.url;\r\n }\r\n\r\n if (!addressLine1 && !addressLine2 && !addressLine3 && !postcode && !suburb) {\r\n return null;\r\n }\r\n\r\n const addressLine4 = suburb || postcode ? [suburb, postcode].join(' ') : '';\r\n\r\n const link = getLink(placeUrl);\r\n\r\n return (\r\n \r\n \r\n {placeName && (\r\n \r\n {placeName}\r\n \r\n )}\r\n {addressLine1 && {addressLine1}
}\r\n {addressLine2 && {addressLine2}
}\r\n {addressLine3 && {addressLine3}
}\r\n {addressLine4 && {addressLine4}
}\r\n\r\n \r\n \r\n \r\n );\r\n }\r\n};\r\n\r\nconst AddressCard: React.FC = ({ sitecoreContext, rendering, editMode }) => {\r\n\r\n const googleMapsApiKey = rendering?.fields?.data?.apiKey?.googleMapsApiKey;\r\n const dataSource = rendering?.fields?.data?.dataSource;\r\n\r\n if (!dataSource) {\r\n\r\n const route = sitecoreContext?.route;\r\n let { fields } = route || {};\r\n \r\n const relatedFields = fields?.place?.fields || {};\r\n\r\n if (\r\n editMode &&\r\n !fields?.addressLine1 &&\r\n !fields?.addressLine2 &&\r\n !fields?.addressLine3 &&\r\n !fields?.suburb &&\r\n !fields?.postcode) {\r\n return (\r\n \r\n );\r\n }\r\n \r\n if (\r\n !editMode &&\r\n !fields?.addressLine1?.value &&\r\n !fields?.addressLine2?.value &&\r\n !fields?.addressLine3?.value &&\r\n !fields?.suburb?.value &&\r\n !fields?.postcode?.value &&\r\n !relatedFields?.addressLine1?.value &&\r\n !relatedFields?.addressLine2?.value &&\r\n !relatedFields?.addressLine3?.value &&\r\n !relatedFields?.suburb?.value &&\r\n !relatedFields?.postcode?.value\r\n ) {\r\n return null;\r\n } else {\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n } else {\r\n\r\n const fields = normalizeJssFields(dataSource);\r\n \r\n if (\r\n !editMode &&\r\n !fields?.addressLine1?.value &&\r\n !fields?.addressLine2?.value &&\r\n !fields?.addressLine3?.value &&\r\n !fields?.suburb?.value &&\r\n !fields?.postcode?.value\r\n ) {\r\n return null;\r\n } else {\r\n return (\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n};\r\n\r\nexport default compose(withSitecoreContext(), withEditMode)(AddressCard);"],"sourceRoot":""}