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AoBzF,EAAQgF,GAC3C,OAAO,OAAoBhF,EAAQgF,EAAOH,EAC5C,EAEI9E,GAAgC,IAAA2F,aAAW,SAAUC,EAAOhC,GAC9D,OAAO,gBAAoB,IAAUiC,OAAOC,OAAO,CACjDlC,IAAKA,GACJgC,EAAO,CACRF,WAAYA,IAEhB,IACA1F,EAAiB+F,YAAc,mBAE/B,K","sources":["webpack://easymoney/./src/components/storelocator/utils/formatStoreHours.ts","webpack://easymoney/./src/components/storelocator/utils/getCurrentDayName.ts","webpack://easymoney/./src/components/storelocator/utils/getStoreStatus.ts","webpack://easymoney/./src/components/storelocator/storePage/SPSection.tsx","webpack://easymoney/./src/components/storelocator/storePage/SPPhoneAddressSection.tsx","webpack://easymoney/./src/components/storelocator/storePage/SPServicesSection.tsx","webpack://easymoney/./src/components/storelocator/storePage/SPHoursSection.tsx","webpack://easymoney/./src/components/storelocator/storePage/StoreViewButton.tsx","webpack://easymoney/./src/components/storelocator/utils/generatePageMeta.ts","webpack://easymoney/./src/components/templates/store-page.tsx","webpack://easymoney/./src/utils/wordsToUrl.ts","webpack://easymoney/./src/utils/useWindowSize.ts","webpack://easymoney/./src/utils/insertSpaceChar.ts","webpack://easymoney/./src/utils/useMaxChildHeight.ts","webpack://easymoney/./src/utils/formatPhoneNumber.ts","webpack://easymoney/./node_modules/phosphor-react/dist/icons/CaretDoubleRight.esm.js"],"sourcesContent":["interface StoreHours {\r\n dayOfWeek: number; // 1 (Monday) - 7 (Sunday)\r\n from1?: string;\r\n to1?: string;\r\n closed?: boolean;\r\n}\r\n\r\ninterface FormattedHours {\r\n dayName: string;\r\n hours: string;\r\n}\r\n\r\nconst convertTo12HrFormat = (time?: string): string => {\r\n if (!time) {\r\n return \"Closed\";\r\n }\r\n const [hour, minute] = time.split(\":\");\r\n const h = parseInt(hour, 10);\r\n const m = parseInt(minute, 10);\r\n const amPm = h >= 12 ? \"PM\" : \"AM\";\r\n const h12 = h % 12 || 12; // Convert hour to 12-hour format\r\n return `${h12}:${m.toString().padStart(2, \"0\")} ${amPm}`;\r\n};\r\n\r\nconst formatStoreHours = (hoursDataFromApi: StoreHours[]): FormattedHours[] => {\r\n const dayNames = [\r\n \"Sunday\",\r\n \"Monday\",\r\n \"Tuesday\",\r\n \"Wednesday\",\r\n \"Thursday\",\r\n \"Friday\",\r\n \"Saturday\",\r\n ];\r\n\r\n return dayNames.map((dayName, index) => {\r\n // Convert index to match 1 (Monday) - 7 (Sunday), as per the API\r\n const dayOfWeek = index === 0 ? 7 : index;\r\n const hoursForDay = hoursDataFromApi.find(\r\n (day) => day.dayOfWeek === dayOfWeek\r\n );\r\n\r\n if (hoursForDay?.closed) {\r\n return { dayName, hours: \"Closed\" };\r\n } else if (hoursForDay?.from1 && hoursForDay?.to1) {\r\n return {\r\n dayName,\r\n hours: `${convertTo12HrFormat(\r\n hoursForDay.from1\r\n )} - ${convertTo12HrFormat(hoursForDay.to1)}`,\r\n };\r\n } else {\r\n return { dayName, hours: \"Closed\" }; // Default to \"Closed\" if hours are missing\r\n }\r\n });\r\n};\r\n\r\nexport default formatStoreHours;\r\n","const getCurrentDayName = (): string => {\r\n const dayNames = [\r\n \"Sunday\",\r\n \"Monday\",\r\n \"Tuesday\",\r\n \"Wednesday\",\r\n \"Thursday\",\r\n \"Friday\",\r\n \"Saturday\",\r\n ];\r\n const currentDayIndex = new Date().getDay();\r\n return dayNames[currentDayIndex];\r\n};\r\n\r\n\r\nexport default getCurrentDayName","interface StoreHours {\r\n dayOfWeek: number; // 1 (Monday) - 7 (Sunday)\r\n from1?: string;\r\n to1?: string;\r\n closed?: boolean;\r\n}\r\nexport const getDayOfTheWeek = (day: number) => {\r\n const dayOfWeek = [\r\n \"Sunday\",\r\n \"Monday\",\r\n \"Tuesday\",\r\n \"Wednesday\",\r\n \"Thursday\",\r\n \"Friday\",\r\n \"Saturday\",\r\n ];\r\n return dayOfWeek[day % 7];\r\n};\r\nconst convertTo12HourFormat = (time: string) => {\r\n const [hours, minutes] = time.split(\":\").map(Number);\r\n const suffix = hours >= 12 ? \"PM\" : \"AM\";\r\n const hours12 = hours % 12 || 12;\r\n\r\n return `${hours12}:${minutes.toString().padStart(2, \"0\")} ${suffix}`;\r\n};\r\n\r\nconst getStoreStatus = (storeHours: StoreHours[], now: Date) => {\r\n const currentDay = now.getDay() === 0 ? 7 : now.getDay(); // Convert Sunday from 0 to 7\r\n const currentTime = now.getHours() * 100 + now.getMinutes(); // Convert current time to comparable format\r\n const todayHours =\r\n storeHours.find((day) => day.dayOfWeek === currentDay) ?? null;\r\n if (todayHours?.closed) {\r\n // If the store is closed today, find the next opening time\r\n const nextOpeningDay = storeHours.find(\r\n (day) => day.dayOfWeek > currentDay && day.from1,\r\n );\r\n return {\r\n status: \"Closed.\",\r\n nextAction: `Opens ${convertTo12HourFormat(\r\n nextOpeningDay!.from1 ?? \"00:00\",\r\n )} ${getDayOfTheWeek(nextOpeningDay!.dayOfWeek)}`,\r\n };\r\n } else if (todayHours) {\r\n //const openingTime = parseInt(todayHours.from1!.replace(\":\", \"\"), 10);\r\n //const closingTime = parseInt(todayHours.to1!.replace(\":\", \"\"), 10);\r\n return {\r\n status: `Open today ${convertTo12HourFormat(todayHours.from1!)}`,\r\n nextAction: `- ${convertTo12HourFormat(todayHours.to1!)}`,\r\n };\r\n } else {\r\n throw Error(\"no store hours passed\");\r\n }\r\n};\r\nexport default getStoreStatus;\r\n","import React from \"react\";\r\nimport { twMerge } from \"tailwind-merge\";\r\nimport { Container } from \"@ui\";\r\n\r\ninterface SPSectionProps {\r\n children: React.ReactNode;\r\n headline: string;\r\n className?: string;\r\n}\r\n\r\nconst SPSection = ({ children, headline, className }: SPSectionProps) => {\r\n return (\r\n \r\n \r\n

\r\n {headline}\r\n

\r\n {children}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default SPSection;\r\n","import { Store } from \"@storeLocator/storeType\";\r\nimport { formatPhoneNumber } from \"@utils\";\r\nimport React from \"react\";\r\nimport { SPSection } from \".\";\r\n\r\ninterface SPPhoneAddressSectionProps {\r\n store: Store;\r\n}\r\n\r\nconst SPPhoneAddressSection = ({ store }: SPPhoneAddressSectionProps) => {\r\n return (\r\n \r\n
\r\n

\r\n {store.streetAndNumber}\r\n
\r\n \r\n {store.city}, {store.province} {store.zip}\r\n \r\n

\r\n
\r\n

\r\n \r\n Ph:{\" \"}\r\n \r\n {formatPhoneNumber(store.phone)}\r\n \r\n \r\n

\r\n {store?.fax && (\r\n

\r\n \r\n Fax:{\" \"}\r\n \r\n {formatPhoneNumber(store.fax)}\r\n \r\n \r\n

\r\n )}\r\n \r\n Get Directions\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SPPhoneAddressSection;\r\n","import React from \"react\";\r\nimport { Link } from \"gatsby\";\r\nimport { StatesData } from \"@components/templates/store-locator\";\r\nimport { Store } from \"@storeLocator/storeType\";\r\nimport { SPSection } from \".\";\r\nimport { wordsToUrl } from \"@utils\";\r\nimport { CaretDoubleRight } from \"phosphor-react\";\r\n\r\ninterface SPServicesSectionProps {\r\n stateProductInfo: StatesData;\r\n store: Store;\r\n}\r\n\r\nconst SPServicesSection = ({\r\n stateProductInfo,\r\n store,\r\n}: SPServicesSectionProps) => {\r\n const currentStateData = stateProductInfo.find(\r\n (state) => state.elements.state_abbreviation.value === store.province,\r\n );\r\n\r\n const renderLinkItem = (item: any, isProduct = true) => {\r\n const itemName = isProduct ? item.elements.product_name.value : item.name;\r\n const itemPage = isProduct ? item.elements.associated_page.value : \"\";\r\n let itemPath = isProduct\r\n ? `${itemPage}`\r\n : `/store-services#${wordsToUrl(itemName)}`;\r\n\r\n // Check if the path is \"express-title-loans\" and change it to \"title-loans\"\r\n if (itemPath === \"/express-title-loans\") {\r\n itemPath = \"/title-loans\";\r\n }\r\n\r\n return (\r\n \r\n
\r\n

{itemName}

\r\n {isProduct ?

Up to ${item.elements.max_amount.value}

:
}\r\n
\r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n \r\n
\r\n {currentStateData?.elements.products.value.map((product) =>\r\n renderLinkItem(product),\r\n )}\r\n {currentStateData?.elements.in_store_services.value.map((service) =>\r\n renderLinkItem(service, false),\r\n )}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SPServicesSection;\r\n","import React from \"react\";\r\nimport { twMerge } from \"tailwind-merge\";\r\nimport { Store } from \"../storeType\";\r\nimport formatStoreHours from \"../utils/formatStoreHours\";\r\nimport getCurrentDayName from \"../utils/getCurrentDayName\";\r\nimport { SPSection } from \".\";\r\n\r\ninterface SPHoursSectionProps {\r\n store: Store;\r\n}\r\n\r\nconst SPHoursSection = ({ store }: SPHoursSectionProps) => {\r\n const currentDayName = getCurrentDayName();\r\n\r\n return (\r\n \r\n
\r\n {formatStoreHours(store.openingHours).map((day) => (\r\n \r\n

{day.dayName}

\r\n
\r\n

{day.hours}

\r\n
\r\n ))}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SPHoursSection;\r\n","import { Button } from \"@components/ui\";\r\nimport React from \"react\";\r\n\r\nconst StoreViewButton = ({\r\n storeId,\r\n isMobile,\r\n}: {\r\n storeId: number;\r\n isMobile: boolean;\r\n}) => (\r\n \r\n View on Map\r\n \r\n);\r\n\r\nexport default StoreViewButton;\r\n","import { Product, StateElement } from \"@components/templates/store-locator\";\r\nimport { Store } from \"@storeLocator/storeType\";\r\n\r\nconst generatePageMeta = (states: StateElement[], store: Store): string => {\r\n // Find the current state\r\n const currentState = states.find(\r\n (state) => state.elements.state_abbreviation.value === store.province\r\n );\r\n\r\n let pageMeta: string;\r\n\r\n // Check if products are available\r\n if (currentState?.elements.products.value.length) {\r\n // Extract product names\r\n const products = currentState.elements.products.value.map(\r\n (product) => product.elements.product_name.value\r\n );\r\n\r\n // Function to find the largest amount\r\n const findLargestAmount = (data: Product[]): string => {\r\n const amounts = data.map((product) =>\r\n parseFloat(product.elements.max_amount.value.replace(/,/g, \"\"))\r\n );\r\n const maxAmount = Math.max(...amounts);\r\n return maxAmount.toLocaleString();\r\n };\r\n\r\n // Find the largest amount\r\n const largestAmount = findLargestAmount(\r\n currentState.elements.products.value\r\n );\r\n\r\n // Construct the pageMeta string for products\r\n pageMeta = `Looking for ${products.join(\" or \")} in ${\r\n store.city\r\n }? Visit easymoney at ${\r\n store.streetAndNumber\r\n } for a cash loan up to $${largestAmount}.`;\r\n } else {\r\n // Construct the pageMeta string for services when no products are available\r\n pageMeta = `Looking for services in ${store.city}? Visit easymoney at ${store.streetAndNumber} for a variety of financial services.`;\r\n }\r\n\r\n return pageMeta;\r\n};\r\n\r\nexport default generatePageMeta;\r\n","import * as React from \"react\";\r\nimport SEO from \"@global/Seo\";\r\nimport { Store } from \"@storeLocator/storeType\";\r\nimport { Layout } from \"@global\";\r\nimport { Container, HeadingRenderer, RichTextRenderer } from \"@ui\";\r\nimport getStoreStatus from \"@storeLocator/utils/getStoreStatus\";\r\nimport { graphql } from \"gatsby\";\r\nimport { StoreLocatorData } from \"./store-locator\";\r\nimport {\r\n SPPhoneAddressSection,\r\n SPHoursSection,\r\n SPServicesSection,\r\n StoreViewButton,\r\n} from \"@storeLocator/storePage\";\r\nimport generatePageMeta from \"@storeLocator/utils/generatePageMeta\";\r\nimport { StateElement } from \"./store-locator\";\r\n\r\nconst Index = ({\r\n pageContext,\r\n data,\r\n}: {\r\n pageContext: { store: Store };\r\n data: { kontentItemStoreLocatorPage: { elements: StoreLocatorData } };\r\n}) => {\r\n const { store } = pageContext;\r\n const { elements } = data.kontentItemStoreLocatorPage;\r\n const now = new Date();\r\n console.log(store.openingHours);\r\n const { status, nextAction } = getStoreStatus(store.openingHours, now);\r\n\r\n return (\r\n \r\n
\r\n \r\n ${store.streetAndNumber}`}\r\n className=\"font-body text-base font-semibold not-italic tracking-wide text-darkPurple md:text-2xl lg:text-[28px] lg:tracking-[0.56px]\"\r\n />\r\n ${store.city}, ${store.province}`}\r\n className=\"font-heading text-4xl font-bold italic text-armyGreen md:text-6xl lg:text-7xl lg:leading-[110%] [&_strong]:font-extrabold\"\r\n />\r\n ${status} ${nextAction}

`}\r\n className=\"text-lg lg:text-xl\"\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 Index;\r\n\r\nexport const Head = ({\r\n pageContext,\r\n data,\r\n}: {\r\n pageContext: { store: Store };\r\n data: { kontentItemStoreLocatorPage: { elements: StoreLocatorData } };\r\n}) => {\r\n const { store } = pageContext;\r\n const { elements } = data.kontentItemStoreLocatorPage;\r\n const pageMeta = generatePageMeta(\r\n elements.states.value as StateElement[],\r\n store,\r\n );\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const query = graphql`\r\n query storePageQuery {\r\n kontentItemStoreLocatorPage {\r\n elements {\r\n global_toggle {\r\n value {\r\n codename\r\n }\r\n }\r\n toggle_by_state {\r\n value {\r\n codename\r\n }\r\n }\r\n states {\r\n value {\r\n ... on kontent_item_state_selector_state {\r\n elements {\r\n state_name {\r\n value\r\n }\r\n state_abbreviation {\r\n value\r\n }\r\n in_store_services {\r\n value {\r\n name\r\n }\r\n }\r\n products {\r\n value {\r\n ... on kontent_item_state_selector_product {\r\n elements {\r\n product_name {\r\n value\r\n }\r\n max_amount {\r\n value\r\n }\r\n associated_page {\r\n value\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","const wordsToUrl = (name: string) => name.toLowerCase().split(\" \").join(\"-\");\r\n\r\nexport default wordsToUrl;\r\n","import { useEffect, useState } from \"react\";\r\n\r\nconst useWindowSize = () => {\r\n const [size, setSize] = useState(0);\r\n useEffect(() => {\r\n const listener = () => setSize(window.innerWidth);\r\n listener();\r\n window.addEventListener(\"resize\", listener);\r\n return () => window.removeEventListener(\"resize\", listener); //Cleanup\r\n }, []);\r\n return size;\r\n};\r\n\r\nexport default useWindowSize;\r\n","const insertSpaceChar = (path: string) => {\r\n return path.split(\"-\").join(\"%20\");\r\n};\r\n\r\nexport default insertSpaceChar;\r\n","import { useEffect, useState, RefObject } from \"react\";\r\n\r\n// Hook to get the maximum height of child elements\r\nconst useMaxChildHeight = (ref: RefObject): number | undefined => {\r\n const [maxHeight, setMaxHeight] = useState();\r\n\r\n useEffect(() => {\r\n const calculateMaxHeight = () => {\r\n if (ref.current) {\r\n const children = Array.from(ref.current.childNodes);\r\n const calculatedMaxHeight = children.reduce((top, element) => {\r\n return Math.max(top, (element as HTMLElement).scrollHeight);\r\n }, 0);\r\n\r\n setMaxHeight(calculatedMaxHeight);\r\n }\r\n };\r\n\r\n // Delay to ensure elements are rendered\r\n const timeoutId = setTimeout(calculateMaxHeight, 10);\r\n\r\n return () => clearTimeout(timeoutId);\r\n }, [ref]);\r\n\r\n return maxHeight;\r\n};\r\n\r\nexport default useMaxChildHeight;\r\n","const formatPhoneNumber = (phoneNumber: string): string => {\r\n const match = phoneNumber.match(/\\+1 (\\d{3})-(\\d{3})-(\\d{4})/);\r\n if (match) {\r\n return `(${match[1]}) ${match[2]}-${match[3]}`;\r\n }\r\n return phoneNumber; // Return the original if the format does not match\r\n};\r\n\r\nexport default formatPhoneNumber","import React, { forwardRef } from 'react';\nimport { renderPathForWeight } from '../lib/index.esm.js';\nimport IconBase from '../lib/IconBase.esm.js';\n\n/* GENERATED FILE */\nvar pathsByWeight = /*#__PURE__*/new Map();\npathsByWeight.set(\"bold\", function (color) {\n return React.createElement(React.Fragment, null, React.createElement(\"polyline\", {\n points: \"56 48 136 128 56 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"24\"\n }), React.createElement(\"polyline\", {\n points: \"136 48 216 128 136 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"24\"\n }));\n});\npathsByWeight.set(\"duotone\", function (color) {\n return React.createElement(React.Fragment, null, React.createElement(\"polygon\", {\n points: \"56 48 136 128 56 208 56 48\",\n opacity: \"0.2\"\n }), React.createElement(\"polygon\", {\n points: \"56 48 136 128 56 208 56 48\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"16\"\n }), React.createElement(\"polyline\", {\n points: \"136 48 216 128 136 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"16\"\n }));\n});\npathsByWeight.set(\"fill\", function () {\n return React.createElement(React.Fragment, null, React.createElement(\"path\", {\n d: \"M221.7,122.3l-80-80a8.4,8.4,0,0,0-8.8-1.7A8,8,0,0,0,128,48v60.7L61.7,42.3a8.4,8.4,0,0,0-8.8-1.7A8,8,0,0,0,48,48V208a8,8,0,0,0,4.9,7.4,8.5,8.5,0,0,0,3.1.6,8.3,8.3,0,0,0,5.7-2.3L128,147.3V208a8,8,0,0,0,4.9,7.4,8.5,8.5,0,0,0,3.1.6,8.3,8.3,0,0,0,5.7-2.3l80-80A8.1,8.1,0,0,0,221.7,122.3Z\"\n }));\n});\npathsByWeight.set(\"light\", function (color) {\n return React.createElement(React.Fragment, null, React.createElement(\"polyline\", {\n points: \"56 48 136 128 56 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"12\"\n }), React.createElement(\"polyline\", {\n points: \"136 48 216 128 136 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"12\"\n }));\n});\npathsByWeight.set(\"thin\", function (color) {\n return React.createElement(React.Fragment, null, React.createElement(\"polyline\", {\n points: \"56 48 136 128 56 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"8\"\n }), React.createElement(\"polyline\", {\n points: \"136 48 216 128 136 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"8\"\n }));\n});\npathsByWeight.set(\"regular\", function (color) {\n return React.createElement(React.Fragment, null, React.createElement(\"polyline\", {\n points: \"56 48 136 128 56 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"16\"\n }), React.createElement(\"polyline\", {\n points: \"136 48 216 128 136 208\",\n fill: \"none\",\n stroke: color,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"16\"\n }));\n});\n\nvar renderPath = function renderPath(weight, color) {\n return renderPathForWeight(weight, color, pathsByWeight);\n};\n\nvar CaretDoubleRight = /*#__PURE__*/forwardRef(function (props, ref) {\n return React.createElement(IconBase, Object.assign({\n ref: ref\n }, props, {\n renderPath: renderPath\n }));\n});\nCaretDoubleRight.displayName = \"CaretDoubleRight\";\n\nexport default CaretDoubleRight;\n//# sourceMappingURL=CaretDoubleRight.esm.js.map\n"],"names":["convertTo12HrFormat","time","hour","minute","split","h","parseInt","amPm","toString","padStart","hoursDataFromApi","map","dayName","index","dayOfWeek","hoursForDay","find","day","closed","hours","from1","to1","getCurrentDayName","Date","getDay","convertTo12HourFormat","minutes","Number","suffix","getStoreStatus","storeHours","now","_storeHours$find","currentDay","todayHours","getHours","getMinutes","_from","nextOpeningDay","status","nextAction","Error","_ref","children","headline","className","React","twMerge","Container","store","SPSection","streetAndNumber","city","province","zip","href","phone","formatPhoneNumber","fax","lat","lng","target","stateProductInfo","currentStateData","state","elements","state_abbreviation","value","renderLinkItem","item","isProduct","itemName","product_name","name","itemPage","associated_page","itemPath","wordsToUrl","Link","key","to","max_amount","CaretDoubleRight","weight","size","products","product","in_store_services","service","currentDayName","formatStoreHours","openingHours","storeId","isMobile","Button","internalPath","variant","generatePageMeta","states","currentState","pageMeta","length","largestAmount","data","amounts","parseFloat","replace","Math","max","apply","_toConsumableArray","toLocaleString","findLargestAmount","join","pageContext","kontentItemStoreLocatorPage","console","log","Layout","RichTextRenderer","HeadingRenderer","StoreViewButton","id","SPPhoneAddressSection","SPHoursSection","SPServicesSection","Head","_ref2","SEO","metadata__meta_description","metadata__title_tag","toLowerCase","useWindowSize","setSize","useState","useEffect","listener","window","innerWidth","addEventListener","removeEventListener","path","ref","maxHeight","setMaxHeight","timeoutId","setTimeout","calculateMaxHeight","current","calculatedMaxHeight","Array","from","childNodes","reduce","top","element","scrollHeight","clearTimeout","phoneNumber","match","pathsByWeight","Map","set","color","points","fill","stroke","strokeLinecap","strokeLinejoin","strokeWidth","opacity","d","renderPath","forwardRef","props","Object","assign","displayName"],"sourceRoot":""}