{"version":3,"sources":["webpack://cep-gatsby-starter-code/./src/components/Quote/index.js","webpack://cep-gatsby-starter-code/./src/templates/Mentor.js","webpack://cep-gatsby-starter-code/./src/components/Card/JudgeCard.js","webpack://cep-gatsby-starter-code/./src/components/Card/MentorCard.js","webpack://cep-gatsby-starter-code/./src/utils/formatters.js","webpack://cep-gatsby-starter-code/./src/components/Card/StudentCard.js","webpack://cep-gatsby-starter-code/./src/utils/resource-helper.js"],"names":["image","text","className","filename","baseUrl","data","mentor","mentees","nodes","title","name","Link","to","prefix","size","offset","jobTitle","jobDivision","longDescription","map","paragraph","i","key","quoteImage","shortDescription","renderResources","judge","Image","cardImage","slug","normalize","strArray","resultArray","length","TypeError","match","shift","replace","component","push","str","join","parts","split","urlJoin","args","Array","from","isArray","GetUrl","student","pathname","useLocation","RegExp","test","studentAward","participations","award","toLowerCase","replaceAll","firstName","middleName","lastName","tag","ideaName","aboutIdea","challengeMotivation","favoriteInvention","dreamOcupation","type","resources","reduce","acc","curr","index","accIndex","Math","floor","undefined","resRow","renderRowOfResources","res"],"mappings":"gKAuBA,IAlBc,SAAC,GAAqB,IAAnBA,EAAkB,EAAlBA,MAAOC,EAAW,EAAXA,KACtB,OACE,uBAAKC,UAAU,SACb,gBAAC,IAAD,CAAOC,SAAUH,EAAOE,UAAU,iBAClC,uBAAKA,UAAU,oBACf,uBAAKA,UAAU,mBACb,qBAAGA,UAAU,yBAAyBD,IAExC,uBAAKC,UAAU,uB,kHCJfE,EAAU,6CA6GhB,UA5Ge,SAAC,GAAc,IAAZC,EAAW,EAAXA,KACVC,EAASD,EAAKC,OACdC,EAAUF,EAAKE,QAAQC,MAE7B,OACE,gBAAC,IAAD,CACEC,MAAK,WAAaH,EAAOI,KACzBR,UAAU,oDAEV,gBAAC,IAAD,KACE,gBAAC,KAAD,KAEE,sBAAIA,UAAU,uBACZ,sBAAIA,UAAU,cACZ,gBAAC,EAAAS,KAAD,CAAMC,GAAG,0CAAT,qBAIF,sBAAIV,UAAU,c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D,KAAD,CAAMC,GAAIqC,EAAOC,GAAUhD,UAAU,qBAArC,mB,UCDCuB,EAAkB,SAAC4C,EAAMC,GAAP,OAC7BA,GAAaA,EAAUrC,OAAS,EAC9B,gCACGqC,EACEC,QAAO,SAACC,EAAKC,EAAMC,GAClB,IAAMC,EAAWC,KAAKC,MAAMH,EAAQ,GAMpC,YALsBI,IAAlBN,EAAIG,GACNH,EAAIG,GAAY,CAACF,GAEjBD,EAAIG,GAAUpC,KAAKkC,GAEdD,IACN,IACFrD,KAAI,SAAC4D,GAAD,OAAYC,EAAqBX,EAAMU,OAGhD,uBAAK7E,UAAU,UACb,sBAAIA,UAAU,UAAd,kIAOA8E,EAAuB,SAACX,EAAMC,GAClC,OACE,gBAAC,KAAD,CAAKhD,IAAKgD,EAAU,GAAGV,WAAaU,EAAU,GAAG5D,KAAO4D,EAAU,GAAGzC,MAClEyC,EAAUnD,KAAI,SAAC8D,EAAKP,GAAN,OACb,gBAAC,KAAD,CAAQ5D,KAAM,EAAGQ,IAAK2D,EAAIrB,WAAaqB,EAAIvE,KAAOgE,GACtC,YAATL,GAAsB,gBAAC,EAAD,CAAY/D,OAAQ2E,IACjC,aAATZ,GAAuB,gBAAC,EAAD,CAAanB,QAAS+B,IACpC,WAATZ,GAAqB,gBAAC,EAAD,CAAW3C,MAAOuD","file":"component---src-templates-mentor-js-2d6ec93d1e55dc298654.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport Image from '../Image';\nimport './styles.scss';\n\nconst Quote = ({ image, text }) => {\n return (\n
\n \n
\n
\n

{text}

\n
\n
\n
\n );\n};\n\nQuote.propTypes = {\n image: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n};\n\nexport default Quote;\n","import { graphql, Link } from 'gatsby';\nimport React from 'react';\nimport { Column, Container, Row } from '../components/Grid';\nimport Layout from '../components/Layout';\nimport Quote from '../components/Quote';\nimport Section from '../components/Section';\nimport '../styles/templates/_mentor.scss';\nimport { renderResources } from '../utils/resource-helper';\n\nconst baseUrl = '/annual-challenge/finalists-mentors-judges';\nconst Mentor = ({ data }) => {\n const mentor = data.mentor;\n const mentees = data.mentees.nodes;\n\n return (\n \n
\n \n {/* Breadcrumbs */}\n
    \n
  • \n \n Annual Challenge\n \n
  • \n
  • \n Finalists, Mentors and Judges\n
  • \n
  • \n Mentors\n
  • \n
  • \n {mentor.prefix} {mentor.name}\n
  • \n
\n {/* Mentor Prfile */}\n \n \n
\n

Meet the Mentor:

\n

\n {mentor.prefix} {mentor.name}\n

\n

{mentor.jobTitle}

\n

{mentor.jobDivision}

\n
\n
\n {mentor.longDescription.map((paragraph, i) => (\n

{paragraph}

\n ))}\n
\n
\n \n \n \n
\n
\n
\n {/* Mentees */}\n
\n \n \n \n {mentees &&

Mentees

}\n {mentees && renderResources('students', mentees)}\n
\n
\n
\n
\n \n );\n};\n\nexport const query = graphql`\n query ($slug: String!) {\n mentor: mentorsYaml(slug: { eq: $slug }) {\n prefix\n name\n jobTitle\n jobDivision\n longDescription\n shortDescription\n quoteImage\n }\n mentees: allStudentsYaml(\n sort: {\n order: [DESC, ASC, ASC]\n fields: [participations___year, firstName, lastName]\n }\n filter: {\n mentor: { slug: { eq: $slug } }\n participations: {\n elemMatch: { award: { regex: \"/^Finalist$|^Winner$/i\" } }\n }\n }\n ) {\n nodes {\n firstName\n lastName\n middleName\n tag\n id\n cardImage\n ideaName\n aboutIdea\n participations {\n award\n year\n }\n slug\n }\n }\n }\n`;\n\nexport default Mentor;\n","import { Link } from 'gatsby';\nimport React from 'react';\nimport Image from '../Image';\nimport './styles.scss';\n\nconst GetFullNameWithPrefix = (prefix, name) => {\n if (prefix) {\n return `${prefix} ${name}`;\n } else {\n return name;\n }\n};\n\nconst JudgeCard = ({ judge }) => {\n return (\n
\n
\n \n
\n
\n

{GetFullNameWithPrefix(judge.prefix, judge.name)}

\n

{judge.jobTitle}

\n

{judge.shortDescription}

\n \n Learn More >\n \n
\n
\n );\n};\n\nexport default JudgeCard;\n","import { Link } from 'gatsby';\nimport React from 'react';\nimport Image from '../Image';\nimport './styles.scss';\n\nconst GetFullNameWithPrefix = (prefix, name) => {\n if (prefix) {\n return `${prefix} ${name}`;\n } else {\n return name;\n }\n};\n\nconst MentorCard = ({ mentor }) => {\n return (\n
\n
\n \n
\n
\n

{GetFullNameWithPrefix(mentor.prefix, mentor.name)}

\n

{mentor.jobTitle}

\n

{mentor.shortDescription}

\n \n Learn More >\n \n
\n
\n );\n};\n\nexport default MentorCard;\n","/* eslint-disable */\nfunction normalize(strArray) {\n const resultArray = [];\n if (strArray.length === 0) {\n return '';\n }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n strArray[0] = strArray.shift() + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (let i = 0; i < strArray.length; i++) {\n let component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') {\n continue;\n }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n }\n\n let str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n const parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?' : '') + parts.join('&');\n\n return str;\n}\n\n/**\n * Joins the given strings and returns a valid URL\n *\n * @param {Array.} args Strings that will be joined\n *\n * @returns {String} A valid URL\n *\n */\nexport const urlJoin = (...args) => {\n const parts = Array.from(Array.isArray(args[0]) ? args[0] : args);\n return normalize(parts);\n};\n","/* eslint-disable */\nimport { useLocation } from '@reach/router';\nimport { Link } from 'gatsby';\nimport React from 'react';\nimport { urlJoin } from '../../utils/formatters';\nimport Image from '../Image';\nimport './styles.scss';\n\nconst GetFullName = (firstName, middleName, lastName) => {\n return middleName\n ? `${firstName} ${middleName} ${lastName}`\n : `${firstName} ${lastName}`;\n};\n\nconst SlugifyAward = (award) => {\n return `${award.toLowerCase().replaceAll(' ', '-')}s`;\n};\n\nconst GetUrl = (student) => {\n const pathname = useLocation().pathname;\n const baseUrl = '/annual-challenge/finalists-mentors-judges';\n const winnersRegex = new RegExp(\n `^\\/?${baseUrl}\\/finalists|winners|state-merit-winners|honorable-mentions|improving-lives\\/?$`\n );\n if (winnersRegex.test(pathname)) {\n return urlJoin(pathname, student.slug);\n }\n try {\n const studentAward = student.participations[0].award.toLowerCase();\n return urlJoin(baseUrl, SlugifyAward(studentAward), student.slug);\n } catch {\n return urlJoin(baseUrl, 'improving-lives', student.slug);\n }\n};\n\nconst StudentCard = ({ student }) => {\n return (\n
\n
\n {student.cardImage?.[0] ? (\n \n ) : (\n \n )}\n\n {/**
{student.flag}
**/}\n
\n
\n
{student.tag}
\n

\n {GetFullName(student.firstName, student.middleName, student.lastName)}\n

\n

{student.ideaName}

\n

{student.aboutIdea}

\n {student.aboutIdea?.[0] &&\n student.challengeMotivation?.[0] &&\n student.favoriteInvention?.[0] &&\n student.dreamOcupation?.[0] && (\n \n Learn More >\n \n )}\n
\n
\n );\n};\n\nexport default StudentCard;\n","import React from 'react';\nimport { JudgeCard, MentorCard, StudentCard } from '../components/Card';\nimport { Column, Row } from '../components/Grid';\n\nconst deslugify = (slug) => {\n let splitSlug = slug.split('-');\n let camelCased = '';\n\n for (let i = 1; i < splitSlug.length; i++) {\n splitSlug[i] = splitSlug[i].charAt(0).toUpperCase() + splitSlug[i].slice(1);\n }\n\n camelCased = splitSlug.join('');\n return camelCased;\n};\n\n/**\n * Extracts the resources from the data object and flattens it to an\n * array of resources (objects).\n *\n * @param {Object} data GraphQL query response\n *\n * @returns {Array} An array of resources (objects)\n */\nexport const getRawResources = (data) =>\n data.allResourcesJson.edges.reduce((acc, curr) => {\n acc.push(curr.node);\n return acc;\n }, []);\n\n/**\n * Extracts the resources from the data object and modifies it into\n * an object with keys generated from the resource slug value. So a\n * resource with a slug value of \"slug-name\" will have a key of\n * \"slugName\". This is best used to destructure the resources you\n * want from the query.\n *\n * @param {Object} data GraphQL query response\n *\n * @returns {Object} An object with camel case keys generated from\n * the slug property of a resource.\n */\nexport const getKeyedResources = (data) =>\n getRawResources(data).reduce((acc, curr) => {\n acc[deslugify(curr.slug)] = curr;\n return acc;\n }, {});\n\n/**\n * Renders all the cards with the correct number of rows\n *\n * @param {String} type Can be 'mentors', 'students', or 'judges'\n * @param {Object} resources The Graphl query response containing\n * the mentors, students, judges\n *\n * @returns {Object} The HTML to render the data\n */\nexport const renderResources = (type, resources) =>\n resources && resources.length > 0 ? (\n <>\n {resources\n .reduce((acc, curr, index) => {\n const accIndex = Math.floor(index / 3);\n if (acc[accIndex] === undefined) {\n acc[accIndex] = [curr];\n } else {\n acc[accIndex].push(curr);\n }\n return acc;\n }, [])\n .map((resRow) => renderRowOfResources(type, resRow))}\n \n ) : (\n
\n

\n Currently, there are no results for your selection. Use the year and\n category filters above to search for another selection.\n

\n
\n );\n\nconst renderRowOfResources = (type, resources) => {\n return (\n \n {resources.map((res, index) => (\n \n {type === 'mentors' && }\n {type === 'students' && }\n {type === 'judges' && }\n \n ))}\n \n );\n};\n"],"sourceRoot":""}