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AAMC,OAASE,EAAY,QAAU,QAASiC,UACtFC,EAAAA,EAAAA,KAACzD,EAAa,CAAC0E,kBAAmBtD,EAAOE,oBAAqBjB,EAAM0B,0BAA4BH,EAAiBR,EAAMC,MAAQD,EAAME,oBAAqBqD,aAActE,EAAMsE,gBADxKvD,EAAMmD,gBAItB,EAId,W","sources":["webpack:///./React/Components/Listings/SEOLinks.jsx"],"sourcesContent":["import { sandhillsRequest } from '@Components/Utilities/SandhillsUtility';\r\nimport { useState, useEffect } from 'react';\r\nimport { loadable } from '@Components/Utilities/SandhillsLoadable';\r\nimport LoadingRing from '@Components/MuiWrappers/LoadingRing';\r\n\r\nconst SEOLinkWindow = loadable(() =>import('@Components/Listings/SEOLinkWindow'));\r\n\r\nconst SEOLinks = (props) => {\r\n\r\n const buildLinkGroupDictionary = (InternalLinkGroups) => {\r\n let mappedDict = {};\r\n InternalLinkGroups.map((group) => {\r\n mappedDict[group.Name] = group.InternalLinkColumns;\r\n });\r\n return mappedDict;\r\n };\r\n\r\n const initialDictionary = buildLinkGroupDictionary(props.InternalLinkGroups);\r\n const [facetOpen, setFacetOpen] = useState(null);\r\n const [currentlyLoadingGroup, setCurrentlyLoadingGroup] = useState(null);\r\n const [mappedDictionary, setMappedDictionary] = useState(initialDictionary);\r\n\r\n useEffect(function updateDictionary() {\r\n if (props.LoadInternalLinksOnDemand) {\r\n let mappedDictionaryCopy = mappedDictionary;\r\n props.InternalLinkGroups.map((group) => {\r\n mappedDictionaryCopy[group.Name] = group.InternalLinkColumns;\r\n });\r\n setMappedDictionary(mappedDictionaryCopy);\r\n }\r\n setFacetOpen(null);\r\n }, [props.SearchURL]);\r\n\r\n const buildAjaxSearchURL = (searchURL, ajaxLoadURL) => {\r\n let ajaxKeyword = 'ajaxsearch?';\r\n let sliceIndex = searchURL.indexOf(ajaxKeyword) + ajaxKeyword.length;\r\n let currentQueryString = '&' + searchURL.slice(sliceIndex);\r\n let searchUrl = ('' + ajaxLoadURL + currentQueryString);\r\n return searchUrl;\r\n };\r\n\r\n const changeActive = (propertyName, ajaxURL) => {\r\n if (!currentlyLoadingGroup) {\r\n if (props.LoadInternalLinksOnDemand && mappedDictionary[propertyName] && mappedDictionary[propertyName].length === 0) {\r\n setCurrentlyLoadingGroup(propertyName);\r\n let fullAjaxLoadURL = buildAjaxSearchURL(props.SearchURL, ajaxURL);\r\n sandhillsRequest({\r\n url: fullAjaxLoadURL,\r\n errorHandling: {\r\n message: 'Error retrieving internal links',\r\n showDetails: true,\r\n useConsole: true,\r\n useAlert: false\r\n }\r\n }).then((response) => {\r\n let newMappedDictionary = mappedDictionary;\r\n newMappedDictionary[propertyName] = response;\r\n setFacetOpen(propertyName);\r\n setCurrentlyLoadingGroup(null);\r\n setMappedDictionary(newMappedDictionary);\r\n });\r\n } else {\r\n setFacetOpen(propertyName);\r\n }\r\n }\r\n };\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n {props.InternalLinkGroups && props.InternalLinkGroups.map(group =>\r\n
\r\n \r\n
)}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SEOLinks;"],"names":["SEOLinkWindow","loadable","resolved","chunkName","isReady","props","key","resolve","__webpack_modules__","importAsync","requireAsync","then","requireSync","id","__webpack_require__","SEOLinks","InternalLinkGroups","mappedDict","initialDictionary","map","group","Name","InternalLinkColumns","facetOpen","setFacetOpen","useState","currentlyLoadingGroup","setCurrentlyLoadingGroup","mappedDictionary","setMappedDictionary","useEffect","LoadInternalLinksOnDemand","mappedDictionaryCopy","SearchURL","changeActive","propertyName","ajaxURL","length","fullAjaxLoadURL","searchURL","ajaxLoadURL","ajaxKeyword","sliceIndex","indexOf","slice","sandhillsRequest","url","errorHandling","message","showDetails","useConsole","useAlert","response","newMappedDictionary","buildAjaxSearchURL","_jsxs","children","_jsx","className","LoadingRing","backdrop","DrilldownPageUrl","href","DisplayText","onClick","AjaxLoadUrl","tabIndex","role","onKeyDown","e","preventDefault","ReactKey","style","display","InternalLinkGroup","IsHostedSite"],"sourceRoot":""}