Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatstupidcomputer / packages/site/inquiry.mjs |
| Date | Not specified in source |
| Repository | Janady13/thatstupidcomputer |
| Revision | 57555cde46910102dd25d6c1c1fb2c359e9655bd |
| Branch | main |
| Path or archive member | packages/site/inquiry.mjs |
| Original SHA-256 | 205d7cd50d8525808d90350a237ccb0e5ec7468fbecd31477920010b088c9494 |
| Git blob SHA | 15bddb38e594463d5998f0fdd62d7891eeb85a84 |
| Reading-copy SHA-256 | 205d7cd50d8525808d90350a237ccb0e5ec7468fbecd31477920010b088c9494 |
Recovered source transcript
Download complete source text ↓21 lines · 1.3 KB
/** Shared public URL contract; only a finite project choice crosses into the form. */
export const INQUIRY_PATH = '/contact/';
export const INQUIRY_FORM_ID = 'demo-request';
export const INQUIRY_FORM_HREF = `${INQUIRY_PATH}#${INQUIRY_FORM_ID}`;
export const PROJECT_INTENTS = Object.freeze(['design', 'rescue', 'search', 'care', 'unsure']);
export const PROJECT_LABELS = Object.freeze({ design: 'a new website', rescue: 'rescuing your website', search: 'helping customers find you', care: 'looking after your website', unsure: 'finding the right starting point' });
export function demoIntentHref(project = 'unsure') {
if (!PROJECT_INTENTS.includes(project)) throw new RangeError('Unknown project intent');
return `${INQUIRY_PATH}?project=${project}&from=computer#${INQUIRY_FORM_ID}`;
}
export function parseDemoIntent(search) {
if (typeof search !== 'string' || search.length > 2048 || !search.startsWith('?')) return null;
const params = new URLSearchParams(search);
if (params.getAll('from').length !== 1 || params.get('from') !== 'computer' || params.getAll('project').length !== 1) return null;
const projectType = params.get('project');
if (!PROJECT_INTENTS.includes(projectType)) return null;
return Object.freeze({ projectType, source: 'computer', label: PROJECT_LABELS[projectType] });
}