Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
No EOL
6.7 KiB
Text
1 line
No EOL
6.7 KiB
Text
{"version":3,"sources":["../../src/pages/_error.tsx"],"sourcesContent":["import React from 'react'\nimport Head from '../shared/lib/head'\nimport type { NextPageContext } from '../shared/lib/utils'\n\nconst statusCodes: { [code: number]: string } = {\n 400: 'Bad Request',\n 404: 'This page could not be found',\n 405: 'Method Not Allowed',\n 500: 'Internal Server Error',\n}\n\nexport type ErrorProps = {\n statusCode: number\n hostname?: string\n title?: string\n withDarkMode?: boolean\n}\n\nfunction _getInitialProps({\n req,\n res,\n err,\n}: NextPageContext): Promise<ErrorProps> | ErrorProps {\n const statusCode =\n res && res.statusCode ? res.statusCode : err ? err.statusCode! : 404\n\n let hostname\n\n if (typeof window !== 'undefined') {\n hostname = window.location.hostname\n } else if (req) {\n const { getRequestMeta } =\n require('../server/request-meta') as typeof import('../server/request-meta')\n\n const initUrl = getRequestMeta(req, 'initURL')\n if (initUrl) {\n const url = new URL(initUrl)\n hostname = url.hostname\n }\n }\n\n return { statusCode, hostname }\n}\n\nconst styles: Record<string, React.CSSProperties> = {\n error: {\n // https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52\n fontFamily:\n 'system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"',\n height: '100vh',\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n desc: {\n lineHeight: '48px',\n },\n h1: {\n display: 'inline-block',\n margin: '0 20px 0 0',\n paddingRight: 23,\n fontSize: 24,\n fontWeight: 500,\n verticalAlign: 'top',\n },\n h2: {\n fontSize: 14,\n fontWeight: 400,\n lineHeight: '28px',\n },\n wrap: {\n display: 'inline-block',\n },\n}\n\n/**\n * `Error` component used for handling errors.\n */\nexport default class Error<P = {}> extends React.Component<P & ErrorProps> {\n static displayName = 'ErrorPage'\n\n static getInitialProps = _getInitialProps\n static origGetInitialProps = _getInitialProps\n\n render() {\n const { statusCode, withDarkMode = true } = this.props\n const title =\n this.props.title ||\n statusCodes[statusCode] ||\n 'An unexpected error has occurred'\n\n return (\n <div style={styles.error}>\n <Head>\n <title>\n {statusCode\n ? `${statusCode}: ${title}`\n : 'Application error: a client-side exception has occurred'}\n </title>\n </Head>\n <div style={styles.desc}>\n <style\n dangerouslySetInnerHTML={{\n /* CSS minified from\n body { margin: 0; color: #000; background: #fff; }\n .next-error-h1 {\n border-right: 1px solid rgba(0, 0, 0, .3);\n }\n\n ${\n withDarkMode\n ? `@media (prefers-color-scheme: dark) {\n body { color: #fff; background: #000; }\n .next-error-h1 {\n border-right: 1px solid rgba(255, 255, 255, .3);\n }\n }`\n : ''\n }\n */\n __html: `body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}${\n withDarkMode\n ? '@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}'\n : ''\n }`,\n }}\n />\n\n {statusCode ? (\n <h1 className=\"next-error-h1\" style={styles.h1}>\n {statusCode}\n </h1>\n ) : null}\n <div style={styles.wrap}>\n <h2 style={styles.h2}>\n {this.props.title || statusCode ? (\n title\n ) : (\n <>\n Application error: a client-side exception has occurred{' '}\n {Boolean(this.props.hostname) && (\n <>while loading {this.props.hostname}</>\n )}{' '}\n (see the browser console for more information)\n </>\n )}\n .\n </h2>\n </div>\n </div>\n </div>\n )\n }\n}\n"],"names":["React","Head","statusCodes","_getInitialProps","req","res","err","statusCode","hostname","window","location","getRequestMeta","require","initUrl","url","URL","styles","error","fontFamily","height","textAlign","display","flexDirection","alignItems","justifyContent","desc","lineHeight","h1","margin","paddingRight","fontSize","fontWeight","verticalAlign","h2","wrap","Error","Component","displayName","getInitialProps","origGetInitialProps","render","withDarkMode","props","title","div","style","dangerouslySetInnerHTML","__html","className","Boolean"],"mappings":";AAAA,OAAOA,WAAW,QAAO;AACzB,OAAOC,UAAU,qBAAoB;AAGrC,MAAMC,cAA0C;IAC9C,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;AACP;AASA,SAASC,iBAAiB,EACxBC,GAAG,EACHC,GAAG,EACHC,GAAG,EACa;IAChB,MAAMC,aACJF,OAAOA,IAAIE,UAAU,GAAGF,IAAIE,UAAU,GAAGD,MAAMA,IAAIC,UAAU,GAAI;IAEnE,IAAIC;IAEJ,IAAI,OAAOC,WAAW,aAAa;QACjCD,WAAWC,OAAOC,QAAQ,CAACF,QAAQ;IACrC,OAAO,IAAIJ,KAAK;QACd,MAAM,EAAEO,cAAc,EAAE,GACtBC,QAAQ;QAEV,MAAMC,UAAUF,eAAeP,KAAK;QACpC,IAAIS,SAAS;YACX,MAAMC,MAAM,IAAIC,IAAIF;YACpBL,WAAWM,IAAIN,QAAQ;QACzB;IACF;IAEA,OAAO;QAAED;QAAYC;IAAS;AAChC;AAEA,MAAMQ,SAA8C;IAClDC,OAAO;QACL,0FAA0F;QAC1FC,YACE;QACFC,QAAQ;QACRC,WAAW;QACXC,SAAS;QACTC,eAAe;QACfC,YAAY;QACZC,gBAAgB;IAClB;IACAC,MAAM;QACJC,YAAY;IACd;IACAC,IAAI;QACFN,SAAS;QACTO,QAAQ;QACRC,cAAc;QACdC,UAAU;QACVC,YAAY;QACZC,eAAe;IACjB;IACAC,IAAI;QACFH,UAAU;QACVC,YAAY;QACZL,YAAY;IACd;IACAQ,MAAM;QACJb,SAAS;IACX;AACF;AAEA;;CAEC,GACD,eAAe,MAAMc,cAAsBnC,MAAMoC,SAAS;;aACjDC,cAAc;;;aAEdC,kBAAkBnC;;;aAClBoC,sBAAsBpC;;IAE7BqC,SAAS;QACP,MAAM,EAAEjC,UAAU,EAAEkC,eAAe,IAAI,EAAE,GAAG,IAAI,CAACC,KAAK;QACtD,M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