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UAAYtB,GACtB,uBAAK5C,IAxDO,SAAC,GAAyB,IAAvBkE,EAAsB,EAAtBA,SAAU9B,EAAY,EAAZA,MAC/B,OAAOU,EAAWsB,MAAK,SAACd,GAAD,OAASA,EAAIE,OAASU,KAAUR,OAAOtB,GAuD9C4C,CAAYvC,GAAavC,IAAI,Y,mBC5IjD","sources":["webpack://d9test/./src/components/HeadingWithSub.js","webpack://d9test/./src/components/HeadingWithSub.module.css","webpack://d9test/./src/components/Styled.js","webpack://d9test/./src/components/CustomSelect.js","webpack://d9test/./src/pages/map.js","webpack://d9test/./src/images/arrow.svg"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport styled from \"@emotion/styled\";\nimport { fontBold, textUpperCase } from \"./Styled\";\nimport { colors } from \"../utilities/themeVars\";\nimport arrow from \"../images/arrow.svg\";\nimport * as classes from \"./HeadingWithSub.module.css\";\nimport { Link } from \"gatsby\";\n\nconst Container = styled.div`\n margin: 10px 0;\n\n .main {\n margin-bottom: 0;\n }\n\n .small {\n font-size: 26px;\n }\n .subtitle {\n ${[textUpperCase, fontBold]};\n color: ${colors.primary};\n font-size: 12px;\n letter-spacing: 1px;\n margin-top: 6px;\n }\n .img {\n margin-left: 8px;\n }\n .headerLink {\n color: #000;\n }\n .withArrow {\n display: flex;\n }\n`;\n\nconst HeadingWithSub = ({\n main,\n subTitle,\n h2 = false,\n backArrow = false,\n link,\n}) => {\n return (\n \n {link ? (\n <>\n {h2 ? (\n \n {main}\n \n ) : (\n {main}\n )}\n {subTitle && {subTitle}}\n {backArrow && }\n >\n ) : (\n <>\n {h2 ? (\n {main}\n ) : (\n {main}\n )}\n {subTitle && {subTitle}}\n {backArrow && }\n >\n )}\n \n );\n};\n\nHeadingWithSub.propTypes = {\n main: PropTypes.string,\n subtitle: PropTypes.string,\n};\n\nexport default HeadingWithSub;\n","// extracted by mini-css-extract-plugin\nexport var withArrow = \"HeadingWithSub-module--withArrow--smkBK\";","import { css } from \"@emotion/react\";\nimport { colors } from \"../utilities/themeVars\";\n\nexport const textUpperCase = css`\n text-transform: uppercase;\n`;\n\nexport const colorPrimary = css`\n color: ${colors.primary};\n`;\n\nexport const fontBold = css`\n font-weight: bold;\n`;\n","import React from \"react\";\nimport Select from \"react-select\";\nimport { colors } from \"../utilities/themeVars\";\n\nconst customStyles = {\n control: (provided, state) => {\n let borderColor = colors.gray4;\n if (state.isSelected || state.isFocused) {\n borderColor = colors.gray4;\n }\n return {\n ...provided,\n borderRadius: \"0\",\n borderWidth: `2px`,\n borderColor,\n\n \"&:hover\": {\n borderColor,\n },\n };\n },\n\n indicatorSeparator: () => null,\n\n option: (provided, state) => ({\n ...provided,\n background: state.isSelected ? colors.gray : colors.white,\n color: colors.text,\n }),\n\n dropdownIndicator: (provided, state) => {\n return { ...provided, color: colors.primary };\n },\n\n singleValue: (provided, state) => {\n const opacity = state.isDisabled ? 0.5 : 1;\n const transition = \"opacity 300ms\";\n const textTransform = \"uppercase\";\n const letterSpacing = \"1px\";\n const fontWeight = \"bold\";\n\n return {\n ...provided,\n opacity,\n transition,\n fontWeight,\n letterSpacing,\n textTransform,\n };\n },\n};\n\n// export default ({ options, onChange, defaultValue, setValue, value }) => (\n// {\n// // this.select = ref;\n// // }}\n// defaultValue={defaultValue || options[0]}\n// value={value}\n// label=\"Single select\"\n// isSearchable={false}\n// options={options}\n// styles={customStyles}\n// onChange={val => onChange(val)}\n// />\n// );\n\nexport default ({ options, onChange, defaultValue, setValue, value }) => {\n return (\n {\n // this.select = ref;\n // }}\n defaultValue={defaultValue || options[0]}\n value={value}\n label=\"Single select\"\n isSearchable={false}\n options={options}\n styles={customStyles}\n onChange={(val) => onChange(val)}\n />\n );\n};\n","import React, { useContext, useEffect, useState } from \"react\";\nimport Seo from \"../components/seo\";\nimport CustomSelect from \"../components/CustomSelect\";\nimport HeadingWithSub from \"../components/HeadingWithSub\";\nimport styled from \"@emotion/styled\";\nimport { StoreContext } from \"../store\";\nimport { graphql } from \"gatsby\";\nimport ParentRouteHandler from \"../components/ParentRouteHandler\";\n\n// maps dropdown will always have 3 levels\n// 0 based levels to correspond to images array from graphql query\nconst mapDropdownOptions = [\n { value: 0, label: \"Level 1\" },\n { value: 1, label: \"Level 2\" },\n { value: 2, label: \"Level 3\" },\n];\n\nconst StyledMapContainer = styled.div`\n .heading {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 20px;\n }\n\n .dropdowns {\n display: flex;\n }\n\n .select-container {\n min-width: 120px;\n margin-left: 10px;\n\n &.lang-code {\n min-width: 80px;\n }\n }\n\n .maps {\n min-height: 200px;\n\n img {\n width: 100%;\n }\n }\n`;\n\nconst Map = ({ data, location }) => {\n const { currentMap, setMap } = useContext(StoreContext);\n const [isReady, setReadyState] = useState(false);\n\n const customMaps = data.maps.edges\n .filter(({ node }) => {\n if (node.relationships.field_mobile_map_images.length === 0) {\n return false; //skip\n }\n return true;\n })\n .map(({ node }) => {\n return {\n title: node.title,\n code: node.field_mobile_map_language_code,\n images: node.relationships.field_mobile_map_images\n .filter((el) => el.relationships.field_media_image.localFile)\n .map((el) => el.relationships.field_media_image.localFile.publicURL),\n };\n });\n\n const langCodeDropdownOptions = customMaps.map(({ code }) => {\n return {\n value: code,\n label: code.toUpperCase(),\n };\n });\n\n const setLang = (langCode) => {\n setMap({ langCode, level: 0 });\n };\n\n const setMapIndex = (index) => {\n const { langCode } = currentMap;\n setMap({ langCode, level: index });\n };\n\n const getMapImage = ({ langCode, level }) => {\n return customMaps.find((map) => map.code === langCode).images[level];\n };\n\n const getLangOption = (langCode) =>\n langCodeDropdownOptions.find((option) => option.value === langCode);\n\n const getLevelOption = (level) =>\n mapDropdownOptions.find((option) => option.value === level);\n\n useEffect(() => {\n let langCodeParam = location.search.split(\"?\").pop();\n\n if (langCodeParam.includes(\"lang\")) {\n langCodeParam = langCodeParam.split(\"=\").pop();\n }\n\n const match = getLangOption(langCodeParam);\n if (match && currentMap.langCode !== langCodeParam) {\n setLang(langCodeParam);\n }\n // to prevent flash of previous map\n setReadyState(true);\n }, []);\n\n return (\n \n \n \n \n\n \n \n \n {currentMap.langCode && (\n setLang(option.value)}\n value={getLangOption(currentMap.langCode)}\n />\n )}\n \n \n {currentMap.level !== undefined && (\n setMapIndex(option.value)}\n value={getLevelOption(currentMap.level)}\n />\n )}\n \n \n \n\n \n {currentMap.langCode && isReady && (\n \n )}\n \n \n );\n};\n\nexport default Map;\n\nexport const query = graphql`\n {\n maps: allNodeMobileMap(\n sort: { fields: field_mobile_map_language_order, order: ASC }\n ) {\n edges {\n node {\n ...MobileMapQuery\n }\n }\n }\n }\n`;\n","export default \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4LjkyMSIgaGVpZ2h0PSIxMy45OTIiIHZpZXdCb3g9IjAgMCA4LjkyMSAxMy45OTIiPjxkZWZzPjxzdHlsZT4uYXtmaWxsOiNkNjAwMWM7fTwvc3R5bGU+PC9kZWZzPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNC4wNjcgLTEwLjQwNCkiPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMuNjI4IDMuNjI4KSI+PHBhdGggY2xhc3M9ImEiIGQ9Ik0xMS43MzYsNy43NTIsMTguOSwxNC44MjZsLTcuMTc2LDYuOTE4LTEuNzM3LTEuOEwxNS4zMjEsMTQuOCw5Ljk4MSw5LjUzMloiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuNDU4IC0wLjk3NSkiLz48L2c+PC9nPjwvc3ZnPg==\""],"names":["Container","styled","textUpperCase","fontBold","colors","main","subTitle","h2","backArrow","link","className","Link","to","src","arrow","alt","css","customStyles","control","provided","state","borderColor","isSelected","isFocused","borderRadius","borderWidth","indicatorSeparator","option","background","color","dropdownIndicator","singleValue","opacity","isDisabled","transition","fontWeight","letterSpacing","textTransform","options","onChange","defaultValue","value","setValue","label","isSearchable","styles","val","mapDropdownOptions","StyledMapContainer","level","data","location","useContext","StoreContext","currentMap","setMap","useState","isReady","setReadyState","customMaps","maps","edges","filter","node","relationships","field_mobile_map_images","length","map","title","code","field_mobile_map_language_code","images","el","field_media_image","localFile","publicURL","langCodeDropdownOptions","toUpperCase","setLang","langCode","getLangOption","find","useEffect","langCodeParam","search","split","pop","includes","ParentRouteHandler","HeadingWithSub","CustomSelect","undefined","index","getMapImage"],"sourceRoot":""}