{"version":3,"sources":["webpack:///./src/js/components/react/Dropdown.js","webpack:///./src/js/components/react/Pagination.js","webpack:///./src/js/helpers/reactHooks/useParams.js","webpack:///./src/js/helpers/reactHooks/useFetch.js","webpack:///./src/js/modules/insightsCenterCardListing/components/InsightsCenterFacetList.js","webpack:///./src/js/modules/insightsCenterCardListing/components/InsightsCenterCard.js","webpack:///./src/js/modules/insightsCenterCardListing/hooks/useFetch.js","webpack:///./src/js/modules/insightsCenterCardListing/index.js"],"names":["Dropdown","label","placeholder","selectedOption","options","onChange","disabled","compareAttr","style","useState","open","toggle","cursor","setCursor","guid","useRef","uuidv4","listboxGuid","nativeEl","dropdownEl","triggerEl","listingEl","useEffect","handleClickOutside","e","container","current","target","contains","document","addEventListener","removeEventListener","focus","index","findIndex","option","getDisplayLabel","className","htmlFor","isDevice","ref","id","find","value","Value","tabIndex","aria-label","map","i","key","role","type","aria-haspopup","aria-expanded","aria-controls","onClick","aria-activedescendant","onKeyDown","keyCode","preventDefault","length","aria-selected","handleOptionClick","propTypes","PropTypes","string","shape","oneOfType","number","bool","arrayOf","object","func","isRequired","Pagination","currentPage","totalPages","onNavigate","resultsPerPage","pagesArr","push","CurrentPage","InnerPagination","PaginationEllipsis","href","viewBox","xlinkHref","useParams","updateQs","useMemo","qs","parse","location","search","ignoreQueryPrefix","query","page","sort","currentContent","filters","Object","keys","forEach","filter","dates","params","setParams","qsParams","qsValue","stringify","encode","encodeValuesOnly","arrayFormat","newUrl","protocol","host","pathname","history","pushState","buildQueryString","handlePopState","window","useFetch","endpoint","language","results","setResults","loading","setLoading","Axios","method","url","data","console","log","fetchData","InsightsCenterFacetList","initialFacets","selectedFacets","onFiltersChange","onResetFilters","focusareaLabel","contenttypeLabel","resetBtnLabel","focusareaDropdownDefaultLabel","contenttypeDropdownDefaultLabel","getSelectedOption","facet","keyword","name","array","InsightsCenterCard","assetIcons","insightscenter","imageUrl","imageAlt","assetType","assetIcon","title","minsRead","linkLabel","indexOf","CommonInnerMarkup","srcSet","src","alt","setTotalPages","facets","setFacets","setResultsPerPage","resultsInfo","setResultsInfo","resultListing","totalResults","updatedFacets","Math","ceil","concat","InsightsCenterCardListing","noResultsLabel","setSelectedFacets","setPage","anchorRef","Number","scrollIntoView","handlePaginate","React","memo"],"mappings":"g6CAKA,IAAMA,EAAW,SAAC,GASZ,IARJC,EAQI,EARJA,MACAC,EAOI,EAPJA,YACAC,EAMI,EANJA,eAMI,IALJC,eAKI,MALM,GAKN,EAJJC,EAII,EAJJA,SAII,IAHJC,gBAGI,aAFJC,mBAEI,MAFU,QAEV,EADJC,EACI,EADJA,MACI,IACmBC,oBAAS,GAD5B,GACGC,EADH,KACSC,EADT,SAEwBF,mBAAS,MAFjC,GAEGG,EAFH,KAEWC,EAFX,KAGEC,EAAOC,iBAAOC,eACdC,EAAcF,iBAAOC,eACrBE,EAAWH,iBAAO,MAClBI,EAAaJ,iBAAO,MACpBK,EAAYL,iBAAO,MACnBM,EAAYN,iBAAO,MAEzBO,qBAAU,WACR,IAAMC,EAAqB,SAAAC,GACzB,IAAMC,EAAYN,EAAWO,QAEzBD,IACEA,IAAcD,EAAEG,QAAWF,EAAUG,SAASJ,EAAEG,SAClDhB,GAAO,KAOb,OAFAkB,SAASC,iBAAiB,QAASP,GAE5B,WACLM,SAASE,oBAAoB,QAASR,MAEvC,IAEHD,qBAAU,WACJZ,GACFW,EAAUK,QAAQM,UAEnB,CAACtB,IAEJY,qBAAU,WACR,GAAInB,EAAgB,CAClB,IAAM8B,EAAQ7B,EAAQ8B,WACpB,SAAAC,GAAM,OAAIA,EAAO5B,KAAiBJ,EAAeI,MAEnDM,EAAUoB,QAEVpB,EAAU,QAEX,CAACN,EAAaH,EAASD,IAE1B,IA0DMiC,EAAkB,WACtB,OAAIjC,EACF,UAAUA,EAAeF,OAEpBC,GAAe,MAGxB,OACE,yBAAKmC,UAAS,yCAAoC/B,EAAW,eAAiB,KAC5E,2BAAOgC,QAASxB,EAAKY,QAASW,UAAU,cACrCpC,GAEH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AAjB,OACZ,kBAAC,EAAD,CAAoBC,IAAKD,EAAGyG,eAAgBA,QALhD,2BAAI0B,KAWZ,8BACIpD,KAAa/B,GACb,yBAAK3D,UAAU,2CACb,kBAACqC,EAAA,EAAD,CACEC,YAAa4G,OAAOvF,GACpBpB,WAAYA,EACZC,WAAY,SAAAmB,GAAI,OAnDL,SAAAA,GACrBqF,EAAQrF,IACJsF,aAAJ,EAAIA,EAAW5J,WACb4J,WAAW5J,QAAQ8J,kBAgDSC,CAAezF,IACnClB,eAAgBA,QAS9BoG,EAA0BnH,UAAY,CACpC4D,SAAU3D,IAAUC,OAAOQ,WAC3BmD,SAAU5D,IAAUC,OAAOQ,WAC3B0G,eAAgBnH,IAAUC,OAAOQ,WACjCoE,eAAgB7E,IAAUC,OAAOQ,WACjCqE,iBAAkB9E,IAAUC,OAAOQ,WACnCsE,cAAe/E,IAAUC,OAAOQ,WAChCuE,8BAA+BhF,IAAUC,OAAOQ,WAChDwE,gCAAiCjF,IAAUC,OAAOQ,WAClDqF,MAAO9F,IAAUC,QAGJyH,cAAMC,KAAKT","file":"7.e577c3245ba8d59f5718.js","sourcesContent":["import React, { useState, useEffect, useRef, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { isDevice } from '../../helpers';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nconst Dropdown = ({\r\n label,\r\n placeholder,\r\n selectedOption,\r\n options = [],\r\n onChange,\r\n disabled = false,\r\n compareAttr = 'value',\r\n style\r\n}) => {\r\n const [open, toggle] = useState(false);\r\n const [cursor, setCursor] = useState(null);\r\n const guid = useRef(uuidv4());\r\n const listboxGuid = useRef(uuidv4());\r\n const nativeEl = useRef(null);\r\n const dropdownEl = useRef(null);\r\n const triggerEl = useRef(null);\r\n const listingEl = useRef(null);\r\n\r\n useEffect(() => {\r\n const handleClickOutside = e => {\r\n const container = dropdownEl.current;\r\n\r\n if (container) {\r\n if (container !== e.target && !container.contains(e.target)) {\r\n toggle(false);\r\n }\r\n }\r\n };\r\n\r\n document.addEventListener('click', handleClickOutside);\r\n\r\n return () => {\r\n document.removeEventListener('click', handleClickOutside);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n listingEl.current.focus();\r\n }\r\n }, [open]);\r\n\r\n useEffect(() => {\r\n if (selectedOption) {\r\n const index = options.findIndex(\r\n option => option[compareAttr] === selectedOption[compareAttr]\r\n );\r\n setCursor(index);\r\n } else {\r\n setCursor(null);\r\n }\r\n }, [compareAttr, options, selectedOption]);\r\n\r\n const handleTriggerClick = e => {\r\n if (isDevice()) {\r\n return;\r\n }\r\n\r\n toggle(!open);\r\n };\r\n\r\n const handleOptionClick = option => {\r\n onChange(option);\r\n toggle(false);\r\n };\r\n\r\n const handleOptionChange = e => {\r\n const option = options.find(option => option.value === e.target.value);\r\n onChange(option);\r\n toggle(false);\r\n };\r\n\r\n const handleKeyDown = e => {\r\n /* eslint-disable indent */\r\n switch (e.keyCode) {\r\n case 38: // up\r\n e.preventDefault();\r\n if (cursor) {\r\n setCursor(cursor - 1);\r\n } else {\r\n setCursor(options.length - 1);\r\n }\r\n break;\r\n case 40: // down\r\n e.preventDefault();\r\n if (cursor !== null && cursor < options.length - 1) {\r\n setCursor(cursor + 1);\r\n } else {\r\n setCursor(0);\r\n }\r\n break;\r\n case 27: // esc\r\n e.preventDefault();\r\n toggle(false);\r\n triggerEl.current.focus();\r\n break;\r\n case 13: // enter\r\n e.preventDefault();\r\n if (cursor !== null) {\r\n onChange(options[cursor]);\r\n }\r\n toggle(false);\r\n triggerEl.current.focus();\r\n break;\r\n case 9: // tab\r\n toggle(false);\r\n break;\r\n }\r\n /* eslint-enable indent */\r\n };\r\n\r\n const getDisplayLabel = () => {\r\n if (selectedOption) {\r\n return `${selectedOption.label}`;\r\n }\r\n return placeholder || null;\r\n };\r\n\r\n return (\r\n