{"version":3,"file":"static/chunks/pages/resource-center-32c7078cd17d61db.js","mappings":"2FACKA,OAAOC,SAAWD,OAAOC,UAAY,IAAIC,KAAK,CAC7C,mBACA,WACE,OAAO,EAAQ,U,4GCyCvB,UAtC8B,Y,IAC5BC,EAAQ,EAARA,SAEAC,GADI,EAAJC,KACM,EAAND,QACAE,EAAO,EAAPA,QACAC,EAAI,EAAJA,KACQ,KAARC,SAAQ,EACRC,UAAAA,OAAQ,IAAG,KAAE,MACbC,UAAAA,OAAS,IAAG,KAAE,MACdC,OAAAA,OAAM,IAAG,KAAE,MACXC,WAAAA,OAAU,IAAG,KAAE,MACfC,QAAAA,OAAO,IAAG,KAAE,MACZC,UAAAA,OAAS,IAAG,KAAE,MACdC,cAAAA,OAAa,IAAG,KAAE,MAClBC,oBAAAA,OAAmB,IAAG,KAAE,EAE0Bb,EAAAA,GAAY,GAAtDc,EAA0Cd,EAA1Cc,SAAUC,EAAgCf,EAAhCe,YAAa,EAAmBf,EAAnBgB,UAAAA,OAAS,IAAG,KAAE,EAE7C,OACE,SAACC,EAAAA,EAAoB,CACnBH,SAAUA,EACVC,YAAaA,EACbT,SAAUA,EACVC,UAAW,CAAEW,SAAUX,GACvBC,OAAQA,EACRE,QAASA,EACTD,WAAYA,EACZE,UAAWA,EACXP,KAAMA,EACNH,OAAQA,EACRE,QAASA,EACTa,UAAWA,EACXJ,cAAeA,EACfC,oBAAqBA,EACrBM,QAAQ,O","sources":["webpack://_N_E/?12dc","webpack://_N_E/./pages/resource-center/index.js"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/resource-center\",\n function () {\n return require(\"private-next-pages/resource-center/index.js\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/resource-center\"])\n });\n }\n ","import { LandingPageQuery } from 'queries/resources'\nimport { ResourceCardsAllQuery } from 'queries/resources'\nimport { GQLClient } from 'services/graphql'\nimport { Flatten, PickFirst, Slugify } from 'services/utils'\nimport LandingPagesContents from 'templates/LandingPagesContents/LandingPagesContents'\nimport { GetCachedData, GetMetaData } from 'services/data.service'\n\nconst ResourceCenterLanding = ({\n pageData,\n type,\n topNav,\n mainNav,\n meta,\n pathData,\n featured = [],\n resources = [],\n topics = [],\n categories = [],\n authors = [],\n solutions = [],\n footerContent = {},\n applicationSettings = {}\n}) => {\n const { headline, subheadline, footerCTA = [] } = pageData || {}\n\n return (\n \n )\n}\nexport default ResourceCenterLanding\n\nexport async function getStaticProps(context) {\n const client = await GQLClient()\n const data = await client.request(LandingPageQuery('resource-center'))\n\n const fullData = []\n let total = 0\n const fetchData = async () => {\n const data = await client.request(ResourceCardsAllQuery(total))\n total += data.queryResourceContentsWithTotal.items.length\n data.queryResourceContentsWithTotal.items.forEach((item) => {\n fullData.push(Flatten(item))\n })\n if (total < data.queryResourceContentsWithTotal.total) {\n return await fetchData()\n } else {\n return fullData\n }\n }\n\n const resources = await fetchData()\n\n const content = Flatten(PickFirst(data.queryLandingPagesContents))\n const allResources = resources.sort((a, b) => {\n return new Date(b.createdAt) - new Date(a.createdAt)\n })\n const featured = content.featuredContent.map((resource) => {\n resource = Flatten(resource)\n if (resource.__typename === 'LandingPages') {\n return {\n title: resource.headline,\n featuredImage: resource.featuredImage,\n pageBase: resource.pageBase\n }\n }\n\n if (resource.__typename === 'Resource') {\n return {\n title: resource.title,\n featuredImage:\n resource.featuredImage.length > 0 ? resource.featuredImage : resource.mainImage,\n pageBase: resource.pageBase\n }\n }\n\n if (resource.__typename === 'InteriorBlockPage') {\n return {\n title: resource.hero[0]?.headline,\n featuredImage: resource.featuredImage,\n pageBase: resource.pageBase\n }\n }\n }) //allResources.filter((resource) => resource.featured === true).slice(0, 6)\n const filters = require('data/filters.json') || {}\n let pageData = {\n type: '',\n pageData: content,\n meta: GetMetaData(content.pageBase),\n pathData: require('data/paths.json'),\n resources: allResources,\n featured,\n authors: Object.entries(filters.author).map(([slug, name]) => {\n return { slug, name }\n }),\n topics: Object.entries(filters.topic).map(([slug, name]) => {\n return { slug, name }\n }),\n categories: Object.entries(filters.category).map(([slug, name]) => {\n return { slug, name }\n }),\n solutions: Object.entries(filters.solution).map(([slug, name]) => {\n return { slug, name }\n })\n }\n pageData = GetCachedData(pageData)\n return {\n props: pageData || {}\n }\n}\n"],"names":["window","__NEXT_P","push","pageData","topNav","type","mainNav","meta","pathData","featured","resources","topics","categories","authors","solutions","footerContent","applicationSettings","headline","subheadline","footerCTA","LandingPagesContents","resource","isNews"],"sourceRoot":""}