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4BAA4B,KAAO,mBAAmB,MAAQ,oBAAoB,cAAgB,4BAA4B,KAAO,mBAAmB,gBAAkB,8BAA8B,SAAW,uBAAuB,MAAQ,oBAAoB,eAAiB,+B,kBCAzTD,EAAOC,QAAU,CAAC,UAAY,0BAA0B,cAAgB,8BAA8B,MAAQ,sBAAsB,OAAS,uBAAuB,UAAY,4B,kBCAhLD,EAAOC,QAAU,CAAC,UAAY,6BAA6B,MAAQ,yBAAyB,kBAAoB,wC","sources":["webpack://_N_E/?8f06","webpack://_N_E/./src/components/NextSeoWrapper.tsx","webpack://_N_E/./src/components/PageContainer/index.tsx","webpack://_N_E/./src/components/Sanity/LocalizationMessage/index.tsx","webpack://_N_E/./src/lib/sanity.ts","webpack://_N_E/./src/components/Sanity/Blocks/index.tsx","webpack://_N_E/./src/components/Sanity/Page/index.tsx","webpack://_N_E/./src/pages/_error.tsx","webpack://_N_E/./src/pages/product-updates/index.tsx","webpack://_N_E/./src/utils/string.ts","webpack://_N_E/./src/components/PageContainer/PageContainer.module.scss","webpack://_N_E/./src/components/Sanity/Blocks/Blocks.module.scss","webpack://_N_E/./src/components/Sanity/LocalizationMessage/LocalizationMessage.module.scss","webpack://_N_E/./src/components/Sanity/Page/Page.module.scss","webpack://_N_E/./src/pages/_error.module.scss","webpack://_N_E/./src/pages/product-updates/changelog.module.scss"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/product-updates\",\n function () {\n return require(\"private-next-pages/product-updates/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/product-updates\"])\n });\n }\n ","import React from 'react';\n\nimport { NextSeo } from 'next-seo';\n\nimport { SEOProps } from '@/utils/seo';\nimport { truncateString } from '@/utils/string';\n\ninterface Props extends SEOProps {\n url?: string;\n image?: string;\n imageAlt?: string;\n imageWidth?: number;\n imageHeight?: number;\n}\n\nconst NextSeoWrapper: React.FC<Props> = (props) => {\n const { url, image, imageAlt, imageHeight, imageWidth, openGraph, description, ...rest } = props;\n const openGraphParams = {\n ...(openGraph && { openGraph }),\n ...(url && { url }),\n ...(image && {\n images: [{ url: image, width: imageWidth, height: imageHeight, alt: imageAlt }],\n }),\n };\n const params = {\n ...rest,\n ...(description && { description: truncateString(description, 150) }),\n };\n return <NextSeo {...params} openGraph={openGraphParams} />;\n};\n\nexport default NextSeoWrapper;\n","import { ReactNode, FC } from 'react';\n\nimport styles from './PageContainer.module.scss';\n\ntype Props = {\n children: ReactNode | ReactNode[];\n};\n\nconst PageContainer: FC<Props> = ({ children }) => {\n return <div className={styles.container}>{children}</div>;\n};\n\nexport default PageContainer;\n","import React from 'react';\n\nimport useTranslation from 'next-translate/useTranslation';\n\nimport styles from './LocalizationMessage.module.scss';\n\nconst LocalizationMessage = () => {\n const { t, lang } = useTranslation('product-updates');\n if (lang === 'en') {\n return <></>;\n }\n return <div className={styles.container}>{t('localization-message')}</div>;\n};\n\nexport default LocalizationMessage;\n","import { createClient, SanityClient } from '@sanity/client';\nimport imageUrlBuilder from '@sanity/image-url';\nimport groq from 'groq';\n\nconst isSanityEnabled = !!process.env.NEXT_PUBLIC_SANITY_PROJECT_ID;\n\nlet sanityClient: SanityClient;\n\nif (isSanityEnabled) {\n sanityClient = createClient({\n projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,\n dataset: process.env.NEXT_PUBLIC_VERCEL_ENV === 'production' ? 'production' : 'staging',\n useCdn: false, // ensure fresh data\n });\n}\n\nexport const executeGroqQuery = async (\n query: string,\n params?: Record<string, any>,\n isSingleItem = false,\n) => {\n if (!isSanityEnabled) {\n if (isSingleItem) {\n return null;\n }\n return [];\n }\n\n const response = await sanityClient.fetch(groq`${query}`, params);\n return response;\n};\n\nexport const getImageUrl = (source) => {\n if (!isSanityEnabled) {\n return '';\n }\n return imageUrlBuilder(sanityClient).image(source).url();\n};\n","import classNames from 'classnames';\n\nimport styles from './Blocks.module.scss';\n\nimport Link, { LinkVariant } from '@/dls/Link/Link';\nimport { getImageUrl } from '@/lib/sanity';\n\ntype Props = {\n page: any;\n};\n\nconst PageBlocks: React.FC<Props> = ({ page }) => {\n const { body } = page;\n const [bodyObject] = body;\n const { body: bodyElements } = bodyObject;\n return bodyElements.map((bodyElement) => {\n const { _key: bodyElementKey, children, markDefs, listItem, level } = bodyElement;\n const isList = !!listItem;\n const elementBlocks = [];\n children.forEach((childElement) => {\n const { marks, text: originalChildElementWithMarksText } = childElement;\n if (marks.length) {\n marks.forEach((markKey) => {\n // eslint-disable-next-line no-underscore-dangle\n const markDefinition = markDefs.filter((markDef) => markDef._key === markKey);\n // replace the child with the markDefinition since it contains the actual details of the child\n if (markDefinition[0]) {\n // eslint-disable-next-line no-param-reassign\n childElement = markDefinition[0];\n }\n });\n }\n const { _type: childElementType, _key: childElementKey, text } = childElement;\n if (childElementType === 'inlineImage') {\n const { asset, _key: imageKey } = childElement;\n elementBlocks.push(\n <div\n key={`${bodyElementKey}-${childElementKey}-${imageKey}`}\n className={styles.imageContainer}\n >\n {/* eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text */}\n <img className={styles.image} src={getImageUrl(asset)} />\n </div>,\n );\n return;\n }\n if (childElementType === 'link') {\n const { href, url, _key: linkKey } = childElement;\n elementBlocks.push(\n <span\n className={styles.paragraph}\n key={`${bodyElementKey}-${childElementKey}-${linkKey}`}\n >\n <Link href={href || url} isNewTab variant={LinkVariant.Highlight}>\n {originalChildElementWithMarksText}\n </Link>\n </span>,\n );\n return;\n }\n if (isList) {\n elementBlocks.push(\n <li\n className={classNames(styles.list, styles[`li-${level}`])}\n key={`${bodyElementKey}-${childElementKey}`}\n >\n {text}\n </li>,\n );\n return;\n }\n if (text === '') {\n elementBlocks.push(<br key={`${bodyElementKey}-${childElementKey}`} />);\n return;\n }\n elementBlocks.push(\n <span className={styles.paragraph} key={`${bodyElementKey}-${childElementKey}`}>\n {text}\n </span>,\n );\n });\n return <div key={bodyElementKey}>{elementBlocks}</div>;\n });\n};\n\nexport default PageBlocks;\n","import React from 'react';\n\nimport classNames from 'classnames';\nimport useTranslation from 'next-translate/useTranslation';\n\nimport PageBlocks from '../Blocks';\n\nimport styles from './Page.module.scss';\n\nimport Link, { LinkVariant } from '@/dls/Link/Link';\nimport BackIcon from '@/icons/west.svg';\nimport { getImageUrl } from '@/lib/sanity';\n\ninterface Props {\n page: any;\n isIndividualPage?: boolean;\n}\n\nconst Page: React.FC<Props> = ({ page, isIndividualPage = false }) => {\n const { t } = useTranslation('error');\n\n const date = new Date(page.date).toLocaleString('en-US', {\n month: 'long',\n day: '2-digit',\n year: 'numeric',\n });\n const pageTitle = <p className={classNames(styles.title, styles.bold)}>{page.title}</p>;\n return (\n <div key={page.id} className={styles.pageContainer}>\n <div className={styles.headerSection}>\n {isIndividualPage && (\n <Link href=\"/product-updates\" variant={LinkVariant.Secondary} shouldPrefetch={false}>\n <span className={styles.backLink}>\n <BackIcon />\n {t('go-back')}\n </span>\n </Link>\n )}\n <p className={styles.date}>{date}</p>\n </div>\n <div className={styles.blocksContainer}>\n {isIndividualPage ? (\n <>\n {pageTitle}\n <PageBlocks page={page} />\n </>\n ) : (\n <>\n <Link href={`/product-updates/${page.slug.current}`} shouldPrefetch={false}>\n {pageTitle}\n </Link>\n {page.summary}\n {page.mainPhoto && (\n <div className={styles.imageContainer}>\n {/* eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text */}\n <img className={styles.image} src={getImageUrl(page.mainPhoto)} />\n </div>\n )}\n </>\n )}\n </div>\n </div>\n );\n};\n\nexport default Page;\n","/* eslint-disable jsx-a11y/anchor-is-valid */\nimport classNames from 'classnames';\nimport { useRouter } from 'next/router';\nimport useTranslation from 'next-translate/useTranslation';\n\nimport styles from './_error.module.scss';\n\nimport Button from '@/dls/Button/Button';\nimport Link, { LinkVariant } from '@/dls/Link/Link';\n\n// reference: https://nextjs.org/docs/advanced-features/custom-error-page#more-advanced-error-page-customizing\ntype ErrorProps = {\n statusCode?: number;\n hasFullWidth?: boolean;\n};\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst Error = ({ statusCode, hasFullWidth = true }: ErrorProps) => {\n const { t } = useTranslation('error');\n const router = useRouter();\n\n // if previous page url exist, go back, otherwise go to home\n const onBackButtonClicked = () => {\n if (document && document.referrer) {\n router.back();\n return;\n }\n router.push('/'); // go to home\n };\n return (\n <div\n className={classNames(styles.container, {\n [styles.withFullWidth]: hasFullWidth,\n })}\n >\n <h1 className={styles.title}>{t('title')}</h1>\n <div className={styles.goBack}>\n <Button onClick={onBackButtonClicked}>{t('go-back')}</Button>\n </div>\n <p className={styles.reportBug}>\n {t('if-persist')}{' '}\n <Link href=\"https://feedback.quran.com/\" variant={LinkVariant.Highlight}>\n {t('report-cta')}\n </Link>\n </p>\n </div>\n );\n};\n\nexport default Error;\n","import React from 'react';\n\nimport { GetStaticProps, NextPage } from 'next';\nimport useTranslation from 'next-translate/useTranslation';\n\nimport styles from './changelog.module.scss';\n\nimport NextSeoWrapper from '@/components/NextSeoWrapper';\nimport PageContainer from '@/components/PageContainer';\nimport LocalizationMessage from '@/components/Sanity/LocalizationMessage';\nimport Page from '@/components/Sanity/Page';\nimport { executeGroqQuery } from '@/lib/sanity';\nimport { getCanonicalUrl, getProductUpdatesUrl } from '@/utils/navigation';\nimport { REVALIDATION_PERIOD_ON_ERROR_SECONDS } from '@/utils/staticPageGeneration';\nimport Error from 'src/pages/_error';\n\ninterface Props {\n hasError?: boolean;\n pages?: any[];\n}\n\nconst ProductUpdatesPage: NextPage<Props> = ({ pages, hasError }) => {\n const { t, lang } = useTranslation('common');\n if (hasError) {\n return <Error statusCode={500} />;\n }\n // TODO: add getLanguageAlternates when we internationalize this page\n return (\n <>\n <NextSeoWrapper\n title={t('product-updates')}\n url={getCanonicalUrl(lang, getProductUpdatesUrl())}\n />\n <PageContainer>\n <div className={styles.container}>\n <LocalizationMessage />\n {pages.map((page) => (\n <Page key={page.slug.current} page={page} />\n ))}\n </div>\n </PageContainer>\n </>\n );\n};\n\nexport const getStaticProps: GetStaticProps = async () => {\n try {\n const pages = await executeGroqQuery(\n '*[_type == \"productUpdate\"]| order(date desc){ title, slug, mainPhoto, date, summary }',\n );\n return {\n props: {\n pages,\n },\n revalidate: REVALIDATION_PERIOD_ON_ERROR_SECONDS,\n };\n } catch (error) {\n return {\n props: {\n hasError: true,\n },\n revalidate: REVALIDATION_PERIOD_ON_ERROR_SECONDS, // 35 seconds will be enough time before we re-try generating the page again.\n };\n }\n};\n\nexport default ProductUpdatesPage;\n","/**\n * Shorten a text by setting the maximum number of characters\n * by the value of the parameter and adding \"...\" at the end.\n *\n * @param {string} rawString\n * @param {number} length\n * @param {string} suffix\n * @returns {string}\n */\nexport const truncateString = (rawString: string, length: number, suffix = '...'): string => {\n const characters = rawString.split('', length);\n let shortenedText = '';\n for (let index = 0; index < characters.length; index += 1) {\n const character = characters[index];\n if (shortenedText.length === length - 1) {\n shortenedText = `${shortenedText}${character}${suffix}`;\n break;\n }\n shortenedText = `${shortenedText}${character}`;\n }\n return shortenedText;\n};\n\n/**\n * Strip HTML tags from a string.\n *\n * @param {string} rawString\n * @returns {string}\n */\nexport const stripHTMLTags = (rawString: string): string => rawString.replace(/(<([^>]+)>)/gi, '');\n\n/**\n * Convert a slugified collection id to collection id only after\n * removing the slug.\n *\n * @param {string} slugifiedCollectionId\n * @returns {string}\n */\nexport const slugifiedCollectionIdToCollectionId = (slugifiedCollectionId: string): string => {\n if (!slugifiedCollectionId) {\n return '';\n }\n const splits = slugifiedCollectionId.split('-');\n // if there is no slug in the url (collections with a name that cannot be slugified e.g. emoticons)\n if (splits.length === 1) {\n return splits[0];\n }\n return splits[splits.length - 1];\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"PageContainer_container__1TUET\",\"fullWidth\":\"PageContainer_fullWidth__RU5GM\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"bold\":\"Blocks_bold__te66z\",\"title\":\"Blocks_title__wbxaX\",\"headerSection\":\"Blocks_headerSection__DRHJO\",\"caption\":\"Blocks_caption__azwqm\",\"image\":\"Blocks_image__bS2DH\",\"imageContainer\":\"Blocks_imageContainer__mm1Ja\",\"heading\":\"Blocks_heading__CgOJR\",\"h1\":\"Blocks_h1__OK_LF\",\"h2\":\"Blocks_h2__7SHvU\",\"paragraph\":\"Blocks_paragraph__LzJn6\",\"list\":\"Blocks_list__Jdt5n\",\"li-2\":\"Blocks_li-2__s0hQu\",\"li-3\":\"Blocks_li-3__VNTxD\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"LocalizationMessage_container__XPblc\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"pageContainer\":\"Page_pageContainer__rjHRz\",\"bold\":\"Page_bold__OpTLz\",\"title\":\"Page_title__mh5zs\",\"headerSection\":\"Page_headerSection__6j_S4\",\"date\":\"Page_date__mg8FT\",\"blocksContainer\":\"Page_blocksContainer__1_ZSD\",\"backLink\":\"Page_backLink__wvHCe\",\"image\":\"Page_image__dR_Y9\",\"imageContainer\":\"Page_imageContainer__wSKZ1\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"_error_container__vJFnH\",\"withFullWidth\":\"_error_withFullWidth__VEzYc\",\"title\":\"_error_title__oLWAK\",\"goBack\":\"_error_goBack__U4WNd\",\"reportBug\":\"_error_reportBug__tsKmR\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"changelog_container__YGwGk\",\"title\":\"changelog_title__QDG2e\",\"backIconContainer\":\"changelog_backIconContainer__g7B_m\"};"],"names":["window","__NEXT_P","push","props","url","image","imageAlt","imageHeight","imageWidth","openGraph","description","rest","openGraphParams","images","width","height","alt","params","truncateString","NextSeo","children","div","className","styles","useTranslation","t","lang","sanityClient","isSanityEnabled","process","env","NEXT_PUBLIC_SANITY_PROJECT_ID","createClient","projectId","dataset","NEXT_PUBLIC_VERCEL_ENV","useCdn","query","isSingleItem","fetch","groq","getImageUrl","source","imageUrlBuilder","page","body","map","bodyElement","_key","markDefs","listItem","level","isList","elementBlocks","forEach","childElement","marks","text","length","markKey","markDefinition","filter","markDef","_type","childElementType","li","classNames","childElementKey","bodyElementKey","span","br","href","Link","isNewTab","variant","LinkVariant","originalChildElementWithMarksText","linkKey","asset","img","src","imageKey","isIndividualPage","date","Date","toLocaleString","month","day","year","pageTitle","p","title","shouldPrefetch","BackIcon","PageBlocks","slug","current","summary","mainPhoto","id","statusCode","hasFullWidth","router","useRouter","h1","Button","onClick","document","referrer","back","pages","hasError","Error","NextSeoWrapper","getCanonicalUrl","getProductUpdatesUrl","PageContainer","LocalizationMessage","Page","rawString","suffix","characters","split","shortenedText","index","character","stripHTMLTags","replace","slugifiedCollectionIdToCollectionId","slugifiedCollectionId","splits","module","exports"],"sourceRoot":""}