@aglyn/plugins-ai 1.0.0-beta.263 → 1.0.0-beta.266
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/src/lib/assets/site-styles/beauty.webp +0 -0
- package/src/lib/assets/site-styles/blog.webp +0 -0
- package/src/lib/assets/site-styles/business.webp +0 -0
- package/src/lib/assets/site-styles/coming-soon.webp +0 -0
- package/src/lib/assets/site-styles/education.webp +0 -0
- package/src/lib/assets/site-styles/events.webp +0 -0
- package/src/lib/assets/site-styles/fitness.webp +0 -0
- package/src/lib/assets/site-styles/landing.webp +0 -0
- package/src/lib/assets/site-styles/music.webp +0 -0
- package/src/lib/assets/site-styles/nonprofit.webp +0 -0
- package/src/lib/assets/site-styles/personal.webp +0 -0
- package/src/lib/assets/site-styles/photography.webp +0 -0
- package/src/lib/assets/site-styles/portfolio.webp +0 -0
- package/src/lib/assets/site-styles/professional.webp +0 -0
- package/src/lib/assets/site-styles/realestate.webp +0 -0
- package/src/lib/assets/site-styles/restaurant.webp +0 -0
- package/src/lib/assets/site-styles/store.webp +0 -0
- package/src/lib/assets/site-styles/studio.webp +0 -0
- package/src/lib/assets/site-styles/trades.webp +0 -0
- package/src/lib/assets/site-styles/wellness.webp +0 -0
- package/src/lib/assets/site-styles/yoga.webp +0 -0
- package/src/lib/components/ai-site-start-card.component.d.ts +12 -0
- package/src/lib/components/ai-site-start-card.component.js +256 -236
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +108 -0
- package/src/lib/components/ai-site-start-steps.component.js +451 -0
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -0
- package/src/lib/components/ai-site-start-tracking.d.ts +114 -0
- package/src/lib/components/ai-site-start-tracking.js +277 -0
- package/src/lib/components/ai-site-start-tracking.js.map +1 -0
- package/src/lib/components/ai-site-style-previews.d.ts +26 -0
- package/src/lib/components/ai-site-style-previews.js +115 -0
- package/src/lib/components/ai-site-style-previews.js.map +1 -0
- package/src/lib/insights/ai-insight-digest.d.ts +9 -0
- package/src/lib/insights/ai-insight-digest.js +35 -11
- package/src/lib/insights/ai-insight-digest.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +9 -0
- package/src/lib/jobs/ai-job-page-language.js +20 -2
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-sections.js +8 -2
- package/src/lib/jobs/ai-job-page-sections.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +43 -8
- package/src/lib/jobs/ai-job-plan-step.js +99 -18
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-datasets.d.ts +93 -2
- package/src/lib/jobs/ai-job-site-datasets.js +308 -21
- package/src/lib/jobs/ai-job-site-datasets.js.map +1 -1
- package/src/lib/jobs/ai-layout-stock-photos.d.ts +191 -13
- package/src/lib/jobs/ai-layout-stock-photos.js +1709 -69
- package/src/lib/jobs/ai-layout-stock-photos.js.map +1 -1
- package/src/lib/jobs/fixtures/ai-site-foreign-datasets-recording.d.ts +58 -0
- package/src/lib/jobs/fixtures/ai-site-foreign-datasets-recording.js +678 -0
- package/src/lib/jobs/fixtures/ai-site-foreign-datasets-recording.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-beta265-recordings.d.ts +33 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-beta265-recordings.js +270 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-beta265-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-people-recordings.d.ts +33 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-people-recordings.js +277 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-people-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-juniper-records-recordings.d.ts +23 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-juniper-records-recordings.js +163 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-juniper-records-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-learning-center-recordings.d.ts +23 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-learning-center-recordings.js +53 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-learning-center-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-synchronicity-recordings.d.ts +21 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-synchronicity-recordings.js +119 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-synchronicity-recordings.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.js +54 -15
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-design.d.ts +6 -3
- package/src/lib/layout-language/ai-layout-design.js +14 -13
- package/src/lib/layout-language/ai-layout-design.js.map +1 -1
- package/src/lib/layout-language/ai-layout-listings.d.ts +55 -0
- package/src/lib/layout-language/ai-layout-listings.js +103 -5
- package/src/lib/layout-language/ai-layout-listings.js.map +1 -1
- package/src/lib/layout-language/ai-layout-pictures.d.ts +42 -8
- package/src/lib/layout-language/ai-layout-pictures.js +91 -6
- package/src/lib/layout-language/ai-layout-pictures.js.map +1 -1
- package/src/lib/model/ai-site-home-arcs.d.ts +75 -0
- package/src/lib/model/ai-site-home-arcs.js +741 -0
- package/src/lib/model/ai-site-home-arcs.js.map +1 -0
- package/src/lib/model/ai-site-inventory.d.ts +18 -0
- package/src/lib/model/ai-site-inventory.js.map +1 -1
- package/src/lib/model/ai-site-job.d.ts +9 -6
- package/src/lib/model/ai-site-job.js +8 -5
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.js +24 -24
- package/src/lib/model/ai-site-kinds.js.map +1 -1
- package/src/lib/model/ai-site-start-steps.d.ts +67 -0
- package/src/lib/model/ai-site-start-steps.js +127 -0
- package/src/lib/model/ai-site-start-steps.js.map +1 -0
- package/src/lib/model/ai-site-start.js +4 -1
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +32 -0
- package/src/lib/runtime/ai-doctrine-validators.js +119 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.d.ts +6 -1
- package/src/lib/runtime/ai-doctrine.js +9 -5
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-palette.generated.js +5 -2
- package/src/lib/runtime/ai-palette.generated.js.map +1 -1
- package/src/lib/runtime/site-inventory.js +6 -0
- package/src/lib/runtime/site-inventory.js.map +1 -1
- package/src/lib/server/ai-insight-digest-route.js +2 -2
- package/src/lib/server/ai-insight-digest-route.js.map +1 -1
- package/src/lib/usage/assist-free-taste.js +3 -0
- package/src/lib/usage/assist-free-taste.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-site-start-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use client'\n\nimport { lockdownRefusalText, parseLockdownRefusal, PLATFORM_BRAND_NAME } from '@aglyn/aglyn'\nimport { trackEvent } from '@aglyn/aglyn/app-utils/analytics-events'\nimport type { ConsoleHostFirstRunZoneProps } from '@aglyn/aglyn/plugin-manager/feature-plugins'\nimport { ICON_VARIANT_CLOSE } from '@aglyn/shared-data-enums'\nimport {\n mdiAccount,\n mdiBookOpenPageVariant,\n mdiBriefcaseOutline,\n mdiCalendarHeart,\n mdiCamera,\n mdiClockOutline,\n mdiContentCut,\n mdiCreation,\n mdiDumbbell,\n mdiHandHeart,\n mdiHeartPulse,\n mdiHomeCity,\n mdiMusic,\n mdiPaletteOutline,\n mdiRocketLaunch,\n mdiScaleBalance,\n mdiSchool,\n mdiShopping,\n mdiSilverwareForkKnife,\n mdiViewGridOutline,\n mdiWrench,\n mdiYoga,\n mdiPageLayoutHeaderFooter,\n} from '@aglyn/shared-data-mdi'\nimport { pluginDocsHelp } from '@aglyn/aglyn/app-utils/docs-help'\nimport { HelpTip, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { OptionCardGrid } from '@aglyn/shared-ui-jsx/components/option-card-grid.component'\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\nimport { useUser } from '@aglyn/tenant-feature-instance'\nimport {\n Alert,\n AppBar,\n Box,\n Button,\n Card,\n CardActionArea,\n Chip,\n CircularProgress,\n Container,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n IconButton,\n MenuItem,\n Stack,\n Step,\n StepLabel,\n Stepper,\n TextField,\n Toolbar,\n Typography,\n} from '@mui/material'\nimport { alpha, type Theme } from '@mui/material/styles'\nimport { useRouter } from 'next/navigation'\nimport {\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ReactNode,\n type SyntheticEvent,\n} from 'react'\nimport {\n AI_JOB_AUTO_CONFIRM_INPUT,\n AI_SITE_FREE_PAGES,\n AI_SITE_FREE_PAGES_NOTE,\n AI_SITE_SUBMISSION_CHOICES,\n aiFreeCreditsNoneLeftText,\n aiFreeCreditsResetLabel,\n aiFreeSiteCreditRange,\n aiFreeSitePrompt,\n aiSiteCreditRange,\n type AiFreeCreditsLeft,\n aiSitePagesBand,\n type AiSiteSubmissions,\n} from '../model/ai-site-job'\nimport { FREE_AI_TASTE_CREDITS_PER_MONTH } from '../plan-entitlements'\nimport {\n AI_CREDITS_CONFIRM_CODE,\n aiCreditRangeText,\n type AiCreditRange,\n type AiCreditsPrompt,\n} from '../model/ai-credit-estimate'\nimport { AiCreditsPromptNotice } from './ai-credits-prompt.component'\nimport {\n AI_SITE_START_ANSWERS,\n AI_SITE_START_TYPES,\n aiSiteStartBrief,\n aiSiteStartKind,\n aiSiteStartInputs,\n aiSiteStartRefusal,\n type AiSiteStartAnswers,\n} from '../model/ai-site-start'\nimport type { AiJobSummary } from '../model/ai-jobs.types'\nimport { AI_SITE_KINDS, aiSiteKindOfInputs } from '../model/ai-site-kinds'\n\n/** The icon each kind of site's card shows. */\nconst AI_SITE_KIND_ICONS: Record<string, string> = {\n business: mdiBriefcaseOutline.path,\n trades: mdiWrench.path,\n professional: mdiScaleBalance.path,\n wellness: mdiHeartPulse.path,\n restaurant: mdiSilverwareForkKnife.path,\n store: mdiShopping.path,\n portfolio: mdiViewGridOutline.path,\n studio: mdiPaletteOutline.path,\n photography: mdiCamera.path,\n blog: mdiBookOpenPageVariant.path,\n events: mdiCalendarHeart.path,\n fitness: mdiDumbbell.path,\n yoga: mdiYoga.path,\n beauty: mdiContentCut.path,\n realestate: mdiHomeCity.path,\n education: mdiSchool.path,\n nonprofit: mdiHandHeart.path,\n music: mdiMusic.path,\n personal: mdiAccount.path,\n landing: mdiRocketLaunch.path,\n 'coming-soon': mdiClockOutline.path,\n}\nimport { AiJobFollow } from './ai-job-follow.component'\nimport { AiModelSelector } from './ai-model-selector.component'\nimport { useAiModelChoice } from './use-ai-model-choice'\nimport { aiCreditsBillingHref, aiSiteBuildHref } from './ai-job-links'\nimport { publishAiJob } from './ai-jobs-store'\n\n/**\n * The guided start (AGL-2918), on the `hostFirstRun` zone of the page a newly\n * created site lands on: a choice, a few questions, and the site scaffold they\n * become.\n *\n * ── Two steps (AGL-3594) ─────────────────────────────────────────────────\n *\n * Step 1 asks how to start, as two equal cards: the starter site — a\n * ready-made home page with a header and footer — or AI. The starter card is\n * the zone's `startBlank`, which gives a site born for the guided start the\n * starter every other new site is born with. The AI card moves to step 2, the\n * questions, which have a Back to step 1.\n *\n * ── A full screen dialog, and therefore three ways out ───────────────────\n *\n * The questions take the whole screen, which is the only presentation that\n * gets them read — but a surface that takes the screen and cannot be left is\n * a funnel, so leaving is drawn first and works three ways on both steps:\n *\n * - the close control at the start of the header,\n * - \"Skip\" at the end of it, named \"Skip and start blank\",\n * - Escape, which `Dialog` reports through `onClose`.\n *\n * Before a job is started all three are the zone's own `startBlank`: the\n * starter site, and no job, no draft, no record of a site half begun. After,\n * they close through `leave`, and the job builds the site.\n *\n * ── Or before the site exists (AGL-3761) ─────────────────────────────────\n *\n * \"Create site\" draws this straight away, with the zone's `pendingSite` and\n * no site. Step 1 then asks the site's name and address (the shell's own\n * fields) above the two cards, and the site is created only by a choice that\n * needs one: the starter card or Skip (`startBlank`, which creates it with the\n * starter), or Plan my site, which creates it and then starts the job on it.\n * The close control and Escape create nothing there: they are `leave`. If the\n * site was created and its job could not start, the site is a real one, and\n * every way out gives it the starter as above, so none is left empty.\n *\n * Escape and the close control are DISMISSALS, though, and Skip is a choice\n * (AGL-3660, 2026-10-08). Once anything is typed or picked, a dismissal asks\n * \"Leave without your answers?\" first, focused on Keep editing, so a stray\n * Escape — the second press after closing the model menu was the one in\n * production — can never trade a brief for the starter. Escape that reached\n * the dialog from a portal it does not contain (a menu, a select's list) is\n * that popup's, and the dialog ignores it.\n *\n * The header is the dialog's own chrome rather than part of its body, so the\n * way out cannot be scrolled off, and it is never disabled — least of all\n * while a request is in flight, which is the moment a person most wants it.\n * Nothing is focused ahead of the dialog's own frame, so the first thing a\n * keyboard reaches is the close control.\n *\n * ── It is absent until the route has answered ────────────────────────────\n *\n * The dialog covers the page, so being drawn on a guess is worse here than it\n * is for a card: it would be a takeover every flag-off workspace watches\n * disappear. Nothing renders at all — no `Dialog`, no portal — until the jobs\n * route has admitted this workspace, and a 404, a 403 or an unreachable route\n * is this widget staying absent and the ordinary blank page being all there\n * is. That the widget is mounted is itself the last of a stack of gates: the\n * shell held the plan's `aiGenerative` entitlement, the site's AI switch and\n * the reader's `ai.generate` first. A lockdown is the start door's to say,\n * here, in its own words.\n *\n * ── It builds and publishes for you ──────────────────────────────────────\n *\n * \"Plan my site\" starts a `site` job, which PLANS first: the pages, their\n * addresses, the navigation, the layout, the contact form and a palette. The\n * guided start confirms its own plan (AGL-3594), so the build follows with no\n * approval to make, and the site is published, indexable, when it is done.\n * The person edits or unpublishes it afterwards.\n *\n * ── It stays with the job (AGL-3593) ─────────────────────────────────────\n *\n * Once the job exists the dialog follows it live — planning, the plan with\n * its Confirm, building, then the draft pages to open — so a person never has\n * to leave it to get their site built. \"Open AI jobs\" follows the job in the\n * Assist panel instead; it leaves the guided start the way every other exit\n * does, because the dialog covers the panel it opens.\n */\n\ntype Verdict = 'checking' | 'ready' | 'hidden'\n\ntype Step = 'choose' | 'describe'\n\n/** Labels the dialog for a reader, from its own heading. */\nconst TITLE_ID = 'ai-site-start-title'\n\n/**\n * The takeover's surface, for its paper, its bar and its footer alike: the\n * console page's own background (AGL-3596). The paper sits at elevation 0,\n * which is what keeps MUI's dark-mode elevation overlay off it.\n */\nexport const AI_SITE_START_SURFACE_SX = { bgcolor: 'background.default' } as const\n\n/** The two steps, as the indicator under the header names them. */\nconst STEP_LABELS = ['Choose', 'Describe'] as const\n\n/** The soft round badge an icon sits in, in its accent's tint. */\nfunction IconBadge({ accent, children }: { accent: 'primary' | 'secondary'; children: ReactNode }) {\n return (\n <Box\n aria-hidden\n sx={(theme: Theme) => ({\n width: theme.spacing(9),\n height: theme.spacing(9),\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n bgcolor: alpha(theme.palette[accent].main, theme.palette.mode === 'dark' ? 0.24 : 0.12),\n color: `${accent}.main`,\n fontSize: theme.spacing(5.5),\n })}\n >\n {children}\n </Box>\n )\n}\n\n/**\n * One way to start, as a card the whole of which is the button. Its accessible\n * name is its title; its description describes it.\n */\nfunction ChoiceCard({\n accent,\n icon,\n iconId,\n title,\n description,\n busy = false,\n onChoose,\n children,\n}: {\n accent: 'primary' | 'secondary'\n icon: string\n /** Names the icon for a reader of the markup; the icon itself is decorative. */\n iconId: string\n title: string\n description: string\n busy?: boolean\n onChoose: () => void\n children?: ReactNode\n}) {\n const id = useId()\n return (\n <Card\n variant=\"outlined\"\n sx={(theme: Theme) => ({\n borderRadius: 2,\n height: '100%',\n transition: theme.transitions.create(['border-color', 'box-shadow', 'transform'], {\n duration: theme.transitions.duration.shorter,\n }),\n '&:hover, &:focus-within': {\n borderColor: `${accent}.main`,\n boxShadow: theme.shadows[4],\n transform: `translateY(-${theme.spacing(0.25)})`,\n },\n '@media (prefers-reduced-motion: reduce)': {\n transition: 'none',\n '&:hover, &:focus-within': { transform: 'none' },\n },\n })}\n >\n <CardActionArea\n onClick={onChoose}\n disabled={busy}\n aria-labelledby={`${id}-title`}\n aria-describedby={`${id}-description`}\n aria-busy={busy || undefined}\n sx={{ height: '100%', p: { xs: 3, sm: 4 } }}\n >\n <Stack spacing={2} sx={{ alignItems: 'center', textAlign: 'center' }}>\n <IconBadge accent={accent}>\n {busy ? (\n <CircularProgress size=\"1em\" color={accent} aria-label={`${title}…`} />\n ) : (\n <MdiIcon path={icon} data-icon={iconId} aria-hidden />\n )}\n </IconBadge>\n <Typography id={`${id}-title`} variant=\"h6\" component=\"h2\">\n {title}\n </Typography>\n <Typography id={`${id}-description`} variant=\"body2\" color=\"text.secondary\">\n {description}\n </Typography>\n {children}\n </Stack>\n </CardActionArea>\n </Card>\n )\n}\n\n/** A small label above a group of questions. */\n/**\n * Each part of the guided start links its own section of the Start with AI\n * guide (AGL-3660), so a `?` says what that one group of answers changes.\n */\nconst START_HELP = {\n choose: pluginDocsHelp('aiStart', {\n anchor: '#how-do-you-want-to-start',\n excerpt:\n 'The starter site gives you a ready-made home page to edit. Start with AI asks a few questions, then plans, writes and publishes your pages.',\n }),\n business: pluginDocsHelp('aiStart', {\n anchor: '#your-business',\n excerpt:\n 'What kind of site it is picks its style and pages; who it is for is who every page and the contact form are written for.',\n }),\n style: pluginDocsHelp('aiSiteLooks', {\n anchor: '#choose-a-style',\n excerpt:\n 'The style decides the look — theme, colors, fonts, buttons — and which pages the site usually has. Every site gets its own variation.',\n }),\n details: pluginDocsHelp('aiStart', {\n anchor: '#details',\n excerpt:\n 'Where contact form messages go, how many pages to write, and on paid plans whether to draft a welcome email. All can be changed later.',\n }),\n estimate: pluginDocsHelp('aiCredits', {\n anchor: '#before-a-job-starts',\n excerpt:\n 'About what a start like this costs, measured on real builds, and the most it can cost. What it really costs is what each step spends, and you can watch that add up while it runs.',\n }),\n}\n\nfunction SectionLabel({ children, help }: { children: ReactNode; help?: ReturnType<typeof pluginDocsHelp> }) {\n return (\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: 'center' }}>\n <Typography variant=\"overline\" color=\"text.secondary\" component=\"h2\" sx={{ display: 'block' }}>\n {children}\n </Typography>\n {help ? <HelpTip {...help} /> : null}\n </Stack>\n )\n}\n\n/**\n * The guided start, as the `hostFirstRun` zone draws it, or reopened on a\n * failed start's own answers (AGL-3596): `initialAnswers` opens it on the\n * questions, filled in, for the person to adjust and start a fresh job.\n */\nexport type AiSiteStartCardProps = ConsoleHostFirstRunZoneProps & {\n initialAnswers?: AiSiteStartAnswers | null\n}\n\nexport function AiSiteStartCard({\n hostId,\n orgId,\n orgSlug,\n host,\n startBlank,\n leave,\n pendingSite,\n initialAnswers = null,\n}: AiSiteStartCardProps) {\n const { data: user } = useUser()\n const router = useRouter()\n // Held in a ref so a request reads WHO is signed in, never the identity of\n // the object that says so.\n const userRef = useRef(user)\n userRef.current = user\n const uid = user?.uid ?? null\n const [verdict, setVerdict] = useState<Verdict>('checking')\n // Read once: a start reopened on its answers stays one while it is open.\n const reopened = useRef(initialAnswers !== null)\n const [step, setStep] = useState<Step>(initialAnswers ? 'describe' : 'choose')\n const [answers, setAnswers] = useState<AiSiteStartAnswers>(initialAnswers ?? AI_SITE_START_ANSWERS)\n const [busy, setBusy] = useState(false)\n // The starter card's own busy state while `startBlank` runs (AGL-3594).\n const [startingStarter, setStartingStarter] = useState(false)\n const [notice, setNotice] = useState<string | null>(null)\n /** The site job \"Plan my site\" started, as the create door answered with it. */\n const [started, setStarted] = useState<AiJobSummary | null>(null)\n // The Free taste's page band (AGL-3594), read off the verdict request.\n const [freeTaste, setFreeTaste] = useState(false)\n // What the Free workspace has left this month (AGL-3660), as the same read\n // the create door refuses on: the less of its own band and its owner's\n // allowance across their Free workspaces. `null` when the route said none.\n const [freeCredits, setFreeCredits] = useState<AiFreeCreditsLeft | null>(null)\n // \"Leave without your answers?\" (AGL-3660): a dismissal with a brief typed.\n const [confirmingLeave, setConfirmingLeave] = useState(false)\n // The dialog's own root, to tell its Escape from a nested popup's.\n const dialogRef = useRef<HTMLDivElement | null>(null)\n // Drawn by \"Create site\" before the site exists (AGL-3761): the shell's\n // name and address are asked on step 1, and the site is created only by\n // the starter, Skip, or Plan my site. Read through a ref by the verdict\n // below, which must not re-run when the shell re-renders it.\n const pendingRef = useRef(pendingSite)\n pendingRef.current = pendingSite\n const creating = Boolean(pendingSite) && !pendingSite?.created\n\n useEffect(() => {\n if (!orgId || !uid) return\n let active = true\n void (async () => {\n try {\n const response = await authorizedFetch(\n userRef.current,\n `/api/ai/jobs?orgId=${encodeURIComponent(orgId)}&limit=1`,\n )\n const payload = response.ok ? await response.json().catch(() => null) : null\n if (active) {\n if (payload?.freeTaste === true) {\n setFreeTaste(true)\n const credits = payload?.freeCredits as AiFreeCreditsLeft | undefined\n if (credits && Number.isFinite(credits.left)) setFreeCredits(credits)\n // A reopened start keeps the pages it asked for, within the band.\n setAnswers((current) => ({\n ...current,\n pages: reopened.current ? Math.min(current.pages, AI_SITE_FREE_PAGES.max) : AI_SITE_FREE_PAGES.max,\n welcomeEmail: false,\n }))\n }\n const shown = response.status !== 404 && response.status !== 403\n setVerdict(shown ? 'ready' : 'hidden')\n // \"Create site\" shows its own dialog when this one will not draw.\n pendingRef.current?.ready(shown)\n }\n } catch {\n if (active) {\n setVerdict('hidden')\n pendingRef.current?.ready(false)\n }\n }\n })()\n return () => {\n active = false\n }\n }, [orgId, uid])\n\n const answer = useCallback(\n (patch: Partial<AiSiteStartAnswers>) =>\n setAnswers((current) => ({ ...current, ...patch })),\n [],\n )\n\n // A Free start past what is left asks first (AGL-3722): it is admitted on\n // its measured p90, and one past what is left starts only on \"Build what\n // fits\" (pausing with Resume where the credits run out), or smaller as the\n // home page alone. The create door asks the same, so a stale dialog meets\n // the prompt there too (`serverPrompt`). Nothing at all left is a dead\n // stop until the credits renew or the workspace upgrades.\n const [serverPrompt, setServerPrompt] = useState<AiCreditsPrompt | null>(null)\n // The door's prompt was for the pages it was asked with.\n useEffect(() => setServerPrompt(null), [answers.pages])\n // A store's first products and a blog's first posts are part of the start (AGL-3676, AGL-3798).\n const siteKind = aiSiteKindOfInputs(aiSiteStartInputs(answers))?.id ?? null\n const prompt = freeTaste ? (aiFreeSitePrompt(freeCredits, answers.pages, { siteKind }) ?? serverPrompt) : null\n const noneLeft = freeTaste && freeCredits !== null && freeCredits.left <= 0\n const refusal = aiSiteStartRefusal(answers, { freeTaste })\n const band = aiSitePagesBand(freeTaste)\n // On a paid plan the person picks the model that builds the site (AGL-3660),\n // Auto by default, from the models their plan allows; every step of the job\n // runs on it. A Free workspace builds on the default and is offered none.\n const modelChoice = useAiModelChoice({ orgId, hostId, surface: 'jobs', kind: 'job.page' })\n // A pick remembered from before needs its cost to estimate by; Auto does not,\n // and the list is otherwise read when the picker opens.\n const { load: loadModels, model: rememberedModel } = modelChoice\n useEffect(() => {\n if (!freeTaste && step === 'describe' && rememberedModel) loadModels()\n }, [freeTaste, step, rememberedModel, loadModels])\n const pickedModel = freeTaste ? null : modelChoice.model\n\n const plan = useCallback(async (options: { creditsConfirmed?: boolean; pages?: number } = {}) => {\n const asked = options.pages ? { ...answers, pages: options.pages } : answers\n if (!orgId || aiSiteStartRefusal(asked, { freeTaste }) || noneLeft) return\n // Past what is left, only an explicit go-ahead starts it.\n if (freeTaste && !options.creditsConfirmed && aiFreeSitePrompt(freeCredits, asked.pages, { siteKind })) return\n if (options.pages) answer({ pages: options.pages })\n setBusy(true)\n setNotice(null)\n setServerPrompt(null)\n try {\n const requestJob = (siteId: string | null, check: boolean) =>\n authorizedFetch(userRef.current, '/api/ai/jobs', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n orgId,\n hostId: siteId,\n kind: 'site',\n brief: aiSiteStartBrief(asked),\n // The guided start confirms its own plan (AGL-3594): the build\n // follows the plan with no approval to make.\n inputs: { ...aiSiteStartInputs(asked), [AI_JOB_AUTO_CONFIRM_INPUT]: true },\n ...(pickedModel ? { model: pickedModel } : {}),\n ...(options.creditsConfirmed ? { creditsConfirmed: true } : {}),\n ...(check ? { check: true } : {}),\n }),\n })\n // A refusal said in the dialog, or the Free go-ahead it asks for.\n const refused = async (response: Response): Promise<unknown> => {\n const payload = await response.json().catch(() => null)\n if (response.ok) return payload ?? {}\n if (response.status === 409 && payload?.code === AI_CREDITS_CONFIRM_CODE && payload?.credits) {\n setServerPrompt(payload.credits as AiCreditsPrompt)\n return null\n }\n const locked = parseLockdownRefusal(response.status, payload)\n setNotice(\n locked\n ? lockdownRefusalText(locked)\n : String(payload?.error ?? 'The site could not be started. Try again.'),\n )\n return null\n }\n // The site, created now when it does not exist yet (AGL-3761): this is\n // the moment the person asked for it. The start is checked first\n // (AGL-3859), so one the jobs route would refuse, or would ask the Free\n // go-ahead for, is answered before any site exists. A refusal about the\n // name or address goes back to step 1, where they are typed.\n let site = { hostId, host, orgSlug }\n if (!hostId && pendingSite) {\n if (!pendingSite.created && !(await refused(await requestJob(null, true)))) return\n const made = await pendingSite.create()\n if ('error' in made) {\n setNotice(made.error)\n if (made.address) setStep('choose')\n return\n }\n site = { hostId: made.hostId, host: made.host, orgSlug: made.orgSlug || orgSlug }\n }\n if (!site.hostId) return\n const payload = (await refused(await requestJob(site.hostId, false))) as { job?: AiJobSummary } | null\n if (!payload) return\n const created = (payload?.job as AiJobSummary | undefined) ?? null\n if (!created) {\n setNotice('The site could not be started. Try again.')\n return\n }\n // The indicator and the launcher count it from the moment it exists.\n publishAiJob(created)\n // Where the next step is (AGL-3594): the site's \"Building your site\"\n // page for this job. The zone closes without the starter first, so the\n // setup page does not ask again behind it.\n const href = aiSiteBuildHref(site.orgSlug, site.host, created.id)\n if (href) {\n ;(leave ?? (() => undefined))()\n router.push(href)\n return\n }\n setStarted(created)\n } catch {\n setNotice('The site could not be started. Try again.')\n } finally {\n setBusy(false)\n }\n }, [orgId, hostId, answers, answer, freeTaste, freeCredits, noneLeft, orgSlug, host, leave, router, pickedModel, pendingSite, siteKind])\n\n // The zone's `startBlank`. Before the site exists it creates it with the\n // starter, and answers `false` when it could not — most often a name or\n // address to fix, which step 1 shows.\n const runStartBlank = useCallback(() => {\n const result = startBlank()\n if (result && typeof result.then === 'function') {\n void result.then((done) => {\n if (done) return\n setStartingStarter(false)\n setStep('choose')\n })\n }\n }, [startBlank])\n\n const chooseStarter = useCallback(() => {\n if (pendingSite && !pendingSite.created && !pendingSite.check()) return\n setStartingStarter(true)\n trackEvent('site_start_choice', { choice: 'starter' })\n runStartBlank()\n }, [pendingSite, runStartBlank])\n\n const chooseAi = useCallback(() => {\n if (pendingSite && !pendingSite.created && !pendingSite.check()) return\n trackEvent('site_start_choice', { choice: 'ai' })\n setStep('describe')\n }, [pendingSite])\n\n if (verdict !== 'ready') return null\n\n // Before a job is started Skip is the blank site, which writes the starter\n // (AGL-3594); after, it only closes — the job builds the site.\n const exit = started ? (leave ?? runStartBlank) : runStartBlank\n // Escape and the close control. Before \"Create site\" has made the site\n // (AGL-3761) there is nothing to give a starter to, so they only close,\n // and nothing is created; otherwise they are the same way out as Skip.\n const dismissTo = creating && !started ? (leave ?? runStartBlank) : exit\n // Anything the person typed or picked, which a dismissal must not discard\n // silently (AGL-3660). After a job starts there is nothing left to lose.\n const drafted =\n !started &&\n Boolean(\n answers.siteType.trim() ||\n answers.audience.trim() ||\n answers.kind !== null ||\n (creating && pendingSite?.dirty),\n )\n // Escape and the close control: a dismissal, never a choice. Escape that\n // bubbled here through React from a portal outside this dialog's own DOM is\n // a nested menu's, already handled there, and is not this dialog's to act on.\n const dismiss = (event?: SyntheticEvent | object, reason?: string) => {\n if (reason === 'escapeKeyDown') {\n const target = (event as SyntheticEvent | undefined)?.target\n const root = dialogRef.current\n if (root && target instanceof Node && !root.contains(target)) return\n }\n if (drafted) setConfirmingLeave(true)\n else dismissTo()\n }\n const leaveDraft = () => {\n setConfirmingLeave(false)\n dismissTo()\n }\n\n // The chosen model's cost against Auto's, as the model list states it.\n const modelMultiplier =\n (pickedModel && modelChoice.options?.options.find((option) => option.id === pickedModel)?.multiplier) || 1\n // What the start is likely to cost and at most (AGL-3722): \"About 137\n // credits (up to 283)\", the measured figures scaled by the chosen model.\n const scaled = (range: AiCreditRange): AiCreditRange => ({\n likely: Math.round(range.likely * modelMultiplier),\n p90: Math.round(range.p90 * modelMultiplier),\n ceiling: Math.round(range.ceiling * modelMultiplier),\n })\n const estimate = freeTaste\n ? aiFreeSiteCreditRange(answers.pages, { siteKind })\n : scaled(aiSiteCreditRange(answers.pages, { welcomeEmail: answers.welcomeEmail, siteKind }))\n // A Free start quotes what is LEFT (AGL-3660), shared across the owner's\n // Free workspaces — never the month's whole allowance as if none were spent.\n const estimateText = freeTaste\n ? freeCredits\n ? `${aiCreditRangeText(estimate)}. You have ${freeCredits.left.toLocaleString('en-US')} of your ${freeCredits.total.toLocaleString('en-US')} free AI credits left this month, until ${aiFreeCreditsResetLabel(freeCredits.resetsOn)}`\n : `${aiCreditRangeText(estimate)}, of the ${FREE_AI_TASTE_CREDITS_PER_MONTH} AI credits you get free each month`\n : `${aiCreditRangeText(estimate)}, estimated`\n\n const choosing = step === 'choose' && !started\n\n return (\n <Dialog\n open\n fullScreen\n ref={dialogRef}\n onClose={dismiss}\n aria-labelledby={TITLE_ID}\n // The console's own page surface, in both modes. A Dialog's paper sits\n // at elevation 24 by default, and in dark mode MUI lightens an elevated\n // paper with a white overlay, which turned the whole takeover a\n // washed-out gray; the overlay is for floating surfaces, and this one\n // fills the screen, so its paper is flat.\n slotProps={{ paper: { elevation: 0, sx: AI_SITE_START_SURFACE_SX } }}\n >\n {/*\n The way out, before anything it is a way out of: a slim header on the\n paper surface. On a narrow screen it is the TITLE that gives way, so\n the exits keep their words at every width.\n */}\n <AppBar\n position=\"relative\"\n color=\"inherit\"\n elevation={0}\n enableColorOnDark\n sx={{ ...AI_SITE_START_SURFACE_SX, borderBottom: 1, borderColor: 'divider' }}\n >\n <Toolbar variant=\"dense\" sx={{ gap: 1 }}>\n <IconButton\n edge=\"start\"\n color=\"inherit\"\n onClick={() => dismiss()}\n aria-label=\"Close the guided start\"\n >\n <MdiIcon path={ICON_VARIANT_CLOSE.path} />\n </IconButton>\n <Typography\n id={TITLE_ID}\n variant=\"subtitle1\"\n component=\"div\"\n noWrap\n sx={{ textOverflow: 'ellipsis', flex: 1 }}\n >\n {'Start your site'}\n </Typography>\n <Button color=\"inherit\" onClick={exit} aria-label={started ? 'Close' : 'Skip and start blank'}>\n {started ? 'Close' : 'Skip'}\n </Button>\n </Toolbar>\n </AppBar>\n <DialogContent sx={{ px: { xs: 2, sm: 3 } }}>\n <Container maxWidth={choosing ? 'md' : 'sm'} disableGutters sx={{ py: { xs: 3, sm: 5 } }}>\n <Stack spacing={4}>\n <Stepper\n activeStep={choosing ? 0 : 1}\n aria-label={choosing ? 'Step 1 of 2' : 'Step 2 of 2'}\n sx={{ maxWidth: (theme: Theme) => theme.spacing(40), width: '100%', mx: 'auto' }}\n >\n {STEP_LABELS.map((label) => (\n <Step key={label}>\n <StepLabel>{label}</StepLabel>\n </Step>\n ))}\n </Stepper>\n <Stack spacing={1} sx={{ textAlign: choosing ? 'center' : 'left' }}>\n <Typography variant=\"h4\" component=\"h1\">\n {choosing ? 'How do you want to start?' : 'Tell us about your site'}\n </Typography>\n <Typography variant=\"body1\" color=\"text.secondary\">\n {choosing ? <HelpTip sx={{ float: 'right' }} {...START_HELP.choose} /> : null}\n {choosing\n ? creating\n ? 'Name your site, then choose how it starts. You can change everything later.'\n : 'You can change everything later.'\n : `A few answers and ${PLATFORM_BRAND_NAME} AI plans and writes your pages, then publishes your site.`}\n </Typography>\n </Stack>\n {notice && <Alert severity=\"info\">{notice}</Alert>}\n {step === 'describe' && !started && noneLeft && freeCredits && (\n <Alert\n severity=\"warning\"\n action={\n orgSlug ? (\n <Button color=\"inherit\" size=\"small\" href={aiCreditsBillingHref(orgSlug)}>\n {'Upgrade'}\n </Button>\n ) : undefined\n }\n >\n {aiFreeCreditsNoneLeftText(freeCredits.resetsOn)}\n </Alert>\n )}\n {step === 'describe' && !started && !noneLeft && prompt && (\n <AiCreditsPromptNotice\n prompt={prompt}\n noun=\"site\"\n orgSlug={orgSlug}\n busy={busy}\n onBuildWhatFits={() => void plan({ creditsConfirmed: true })}\n onSmaller={() => void plan({ creditsConfirmed: true, pages: 1 })}\n />\n )}\n {choosing && creating && pendingSite ? (\n <Stack spacing={2} component=\"section\" aria-label=\"Your site\">\n <SectionLabel>{'Your site'}</SectionLabel>\n {pendingSite.fields}\n </Stack>\n ) : null}\n {choosing ? (\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: { xs: '1fr', sm: '1fr 1fr' },\n gap: 3,\n }}\n >\n <ChoiceCard\n accent=\"secondary\"\n icon={mdiPageLayoutHeaderFooter.path}\n iconId=\"page-layout-header-footer\"\n title=\"Start from the starter site\"\n description=\"A ready-made home page with a header, footer and contact form you can edit.\"\n busy={startingStarter}\n onChoose={chooseStarter}\n />\n <ChoiceCard\n accent=\"primary\"\n icon={mdiCreation.path}\n iconId=\"creation\"\n title=\"Start with AI\"\n description={`Answer a few questions and ${PLATFORM_BRAND_NAME} AI plans your pages.`}\n onChoose={chooseAi}\n >\n <Chip size=\"small\" color=\"primary\" label=\"Recommended\" />\n {freeTaste && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`Up to ${AI_SITE_FREE_PAGES.max} pages on the Free plan`}\n </Typography>\n )}\n </ChoiceCard>\n </Box>\n ) : started && orgId ? (\n <Card variant=\"outlined\" sx={{ borderRadius: 2, p: { xs: 2, sm: 3 } }}>\n <AiJobFollow\n job={started}\n orgId={orgId}\n orgSlug={orgSlug}\n user={user}\n intro={\n 'Your site is being planned. It is then built and published for you, with ' +\n 'nothing to approve. You can edit or unpublish it afterwards.'\n }\n // Full screen: AI jobs opens in the panel this dialog covers.\n onOpenJobs={exit}\n />\n </Card>\n ) : (\n <>\n <Stack spacing={2} component=\"section\" aria-label=\"Your business\">\n <SectionLabel help={START_HELP.business}>{'Your business'}</SectionLabel>\n <TextField\n fullWidth\n required\n label=\"What kind of site are you creating?\"\n placeholder=\"a neighborhood dog groomer that takes bookings\"\n value={answers.siteType}\n onChange={(event) => answer({ siteType: event.target.value })}\n helperText=\"A few words is enough, or pick one below.\"\n />\n <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>\n {AI_SITE_START_TYPES.map((type) => (\n <Chip\n key={type}\n label={type}\n size=\"small\"\n color={answers.siteType === type ? 'primary' : 'default'}\n variant={answers.siteType === type ? 'filled' : 'outlined'}\n onClick={() => answer({ siteType: type })}\n />\n ))}\n </Box>\n <TextField\n fullWidth\n label=\"Who is it for?\"\n placeholder=\"local dog owners who want a regular groom booked online\"\n value={answers.audience}\n onChange={(event) => answer({ audience: event.target.value })}\n helperText=\"Optional. It narrows who the pages are written for.\"\n />\n </Stack>\n <Stack spacing={2} component=\"section\" aria-label=\"Style\">\n <SectionLabel help={START_HELP.style}>{'Style'}</SectionLabel>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {answers.kind\n ? 'This decides how your site looks and which pages it usually has.'\n : 'Picked from your answer above. Choose another to change how your site looks and which pages it usually has.'}\n </Typography>\n <OptionCardGrid\n label=\"Style of site\"\n options={AI_SITE_KINDS.map((kind) => ({\n id: kind.id,\n title: kind.label,\n description: kind.blurb,\n icon: AI_SITE_KIND_ICONS[kind.id],\n }))}\n value={aiSiteStartKind(answers).id}\n onChange={(kind) => answer({ kind })}\n />\n </Stack>\n <Stack spacing={2} component=\"section\" aria-label=\"Details\">\n <SectionLabel help={START_HELP.details}>{'Details'}</SectionLabel>\n {/*\n The one setting a new site owner has to make, asked where\n they are already answering: a contact form nobody routed\n files its messages somewhere the person has not looked.\n */}\n <TextField\n select\n fullWidth\n label=\"Where do form submissions go?\"\n value={answers.submissions}\n onChange={(event) =>\n answer({ submissions: event.target.value as AiSiteSubmissions })\n }\n helperText=\"You can change this on the form itself afterwards.\"\n >\n {AI_SITE_SUBMISSION_CHOICES.map((option) => (\n <MenuItem key={option.id} value={option.id}>\n {`${option.label} — ${option.blurb}`}\n </MenuItem>\n ))}\n </TextField>\n <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>\n <TextField\n select\n fullWidth\n label=\"Pages\"\n value={answers.pages}\n onChange={(event) => answer({ pages: Number(event.target.value) })}\n helperText={freeTaste ? AI_SITE_FREE_PAGES_NOTE : undefined}\n >\n {Array.from(\n { length: band.max - band.min + 1 },\n (_, index) => band.min + index,\n ).map((count) => (\n <MenuItem key={count} value={count}>\n {count}\n </MenuItem>\n ))}\n </TextField>\n {!freeTaste && (\n <TextField\n select\n fullWidth\n label=\"Welcome email\"\n value={answers.welcomeEmail ? 'yes' : 'no'}\n onChange={(event) => answer({ welcomeEmail: event.target.value === 'yes' })}\n >\n <MenuItem value=\"yes\">{'Draft one'}</MenuItem>\n <MenuItem value=\"no\">{'No'}</MenuItem>\n </TextField>\n )}\n </Stack>\n </Stack>\n </>\n )}\n </Stack>\n </Container>\n </DialogContent>\n {step === 'describe' && !started && (\n /* The footer stays put while the questions scroll. It wraps, because\n the estimate, the reason and the buttons are wider than a phone. */\n <DialogActions\n sx={{\n px: { xs: 2, sm: 3 },\n py: 2,\n flexWrap: 'wrap',\n rowGap: 1,\n columnGap: 2,\n borderTop: 1,\n borderColor: 'divider',\n ...AI_SITE_START_SURFACE_SX,\n }}\n >\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: 'center', mr: 'auto', minWidth: 0 }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`${estimateText}.`}\n </Typography>\n <HelpTip {...START_HELP.estimate} ariaLabel=\"How the estimate works\" />\n </Stack>\n {refusal && (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {refusal}\n </Typography>\n )}\n {!freeTaste && <AiModelSelector choice={modelChoice} disabled={busy} />}\n <Button onClick={() => setStep('choose')}>{'Back'}</Button>\n <Button\n variant=\"contained\"\n size=\"large\"\n disabled={busy || Boolean(refusal) || Boolean(prompt) || noneLeft}\n onClick={() => void plan()}\n startIcon={<MdiIcon path={mdiCreation.path} />}\n >\n {busy ? 'Starting…' : 'Plan my site'}\n </Button>\n </DialogActions>\n )}\n <Dialog\n open={confirmingLeave}\n onClose={() => setConfirmingLeave(false)}\n aria-labelledby={`${TITLE_ID}-leave`}\n aria-describedby={`${TITLE_ID}-leave-text`}\n maxWidth=\"xs\"\n >\n <DialogTitle id={`${TITLE_ID}-leave`}>{'Leave without your answers?'}</DialogTitle>\n <DialogContent>\n <DialogContentText id={`${TITLE_ID}-leave-text`}>\n {creating\n ? 'What you typed is not saved, and no site is created.'\n : 'What you typed is not saved. Leaving starts your site from the starter site instead.'}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button color=\"inherit\" onClick={leaveDraft}>\n {creating ? 'Leave' : 'Leave and start blank'}\n </Button>\n <Button variant=\"contained\" autoFocus onClick={() => setConfirmingLeave(false)}>\n {'Keep editing'}\n </Button>\n </DialogActions>\n </Dialog>\n </Dialog>\n )\n}\n\nexport default AiSiteStartCard\n"],"names":["lockdownRefusalText","parseLockdownRefusal","PLATFORM_BRAND_NAME","trackEvent","ICON_VARIANT_CLOSE","mdiAccount","mdiBookOpenPageVariant","mdiBriefcaseOutline","mdiCalendarHeart","mdiCamera","mdiClockOutline","mdiContentCut","mdiCreation","mdiDumbbell","mdiHandHeart","mdiHeartPulse","mdiHomeCity","mdiMusic","mdiPaletteOutline","mdiRocketLaunch","mdiScaleBalance","mdiSchool","mdiShopping","mdiSilverwareForkKnife","mdiViewGridOutline","mdiWrench","mdiYoga","mdiPageLayoutHeaderFooter","pluginDocsHelp","HelpTip","MdiIcon","OptionCardGrid","authorizedFetch","useUser","Alert","AppBar","Box","Button","Card","CardActionArea","Chip","CircularProgress","Container","Dialog","DialogActions","DialogContent","DialogContentText","DialogTitle","IconButton","MenuItem","Stack","Step","StepLabel","Stepper","TextField","Toolbar","Typography","alpha","useRouter","useCallback","useEffect","useId","useRef","useState","AI_JOB_AUTO_CONFIRM_INPUT","AI_SITE_FREE_PAGES","AI_SITE_FREE_PAGES_NOTE","AI_SITE_SUBMISSION_CHOICES","aiFreeCreditsNoneLeftText","aiFreeCreditsResetLabel","aiFreeSiteCreditRange","aiFreeSitePrompt","aiSiteCreditRange","aiSitePagesBand","FREE_AI_TASTE_CREDITS_PER_MONTH","AI_CREDITS_CONFIRM_CODE","aiCreditRangeText","AiCreditsPromptNotice","AI_SITE_START_ANSWERS","AI_SITE_START_TYPES","aiSiteStartBrief","aiSiteStartKind","aiSiteStartInputs","aiSiteStartRefusal","AI_SITE_KINDS","aiSiteKindOfInputs","AI_SITE_KIND_ICONS","business","path","trades","professional","wellness","restaurant","store","portfolio","studio","photography","blog","events","fitness","yoga","beauty","realestate","education","nonprofit","music","personal","landing","AiJobFollow","AiModelSelector","useAiModelChoice","aiCreditsBillingHref","aiSiteBuildHref","publishAiJob","TITLE_ID","AI_SITE_START_SURFACE_SX","bgcolor","STEP_LABELS","IconBadge","accent","children","aria-hidden","sx","theme","width","spacing","height","borderRadius","display","alignItems","justifyContent","palette","main","mode","color","fontSize","ChoiceCard","icon","iconId","title","description","busy","onChoose","id","variant","transition","transitions","create","duration","shorter","borderColor","boxShadow","shadows","transform","onClick","disabled","aria-labelledby","aria-describedby","aria-busy","undefined","p","xs","sm","textAlign","size","aria-label","data-icon","component","START_HELP","choose","anchor","excerpt","style","details","estimate","SectionLabel","help","direction","AiSiteStartCard","hostId","orgId","orgSlug","host","startBlank","leave","pendingSite","initialAnswers","modelChoice","data","user","router","userRef","current","uid","verdict","setVerdict","reopened","step","setStep","answers","setAnswers","setBusy","startingStarter","setStartingStarter","notice","setNotice","started","setStarted","freeTaste","setFreeTaste","freeCredits","setFreeCredits","confirmingLeave","setConfirmingLeave","dialogRef","pendingRef","creating","Boolean","created","active","response","encodeURIComponent","payload","ok","json","catch","credits","Number","isFinite","left","pages","Math","min","max","welcomeEmail","shown","status","ready","answer","patch","serverPrompt","setServerPrompt","siteKind","prompt","noneLeft","refusal","band","surface","kind","load","loadModels","model","rememberedModel","pickedModel","plan","options","asked","creditsConfirmed","requestJob","siteId","check","method","headers","body","JSON","stringify","brief","inputs","refused","code","locked","String","error","site","made","address","job","href","push","runStartBlank","result","then","done","chooseStarter","choice","chooseAi","exit","dismissTo","drafted","siteType","trim","audience","dirty","dismiss","event","reason","target","root","Node","contains","leaveDraft","modelMultiplier","find","option","multiplier","scaled","range","likely","round","p90","ceiling","estimateText","toLocaleString","total","resetsOn","choosing","open","fullScreen","ref","onClose","slotProps","paper","elevation","position","enableColorOnDark","borderBottom","gap","edge","noWrap","textOverflow","flex","px","maxWidth","disableGutters","py","activeStep","mx","map","label","float","severity","action","noun","onBuildWhatFits","onSmaller","fields","gridTemplateColumns","intro","onOpenJobs","fullWidth","required","placeholder","value","onChange","helperText","flexWrap","type","blurb","select","submissions","Array","from","length","_","index","count","rowGap","columnGap","borderTop","mr","minWidth","ariaLabel","startIcon","autoFocus"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;AAEA,SAASA,mBAAmB,EAAEC,oBAAoB,EAAEC,mBAAmB,QAAQ,eAAc;AAC7F,SAASC,UAAU,QAAQ,0CAAyC;AAEpE,SAASC,kBAAkB,QAAQ,2BAA0B;AAC7D,SACEC,UAAU,EACVC,sBAAsB,EACtBC,mBAAmB,EACnBC,gBAAgB,EAChBC,SAAS,EACTC,eAAe,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,GAAG7B,SAAS,WAAW,CAAC;sCAC5CsG,WACG,yDACA;;;kCAGR,MAAC5K;;0CACC,KAACP;gCAAOiG,OAAM;gCAAUoB,SAASkJ;0CAC9BpF,WAAW,UAAU;;0CAExB,KAACnL;gCAAO2G,SAAQ;gCAAYqO,SAAS;gCAAC3N,SAAS,IAAM2D,mBAAmB;0CACrE;;;;;;;;AAMb;AAEA,eAAenC,gBAAe"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-site-start-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use client'\n\nimport { lockdownRefusalText, parseLockdownRefusal, PLATFORM_BRAND_NAME } from '@aglyn/aglyn'\nimport { trackEvent } from '@aglyn/aglyn/app-utils/analytics-events'\nimport type { ConsoleHostFirstRunZoneProps } from '@aglyn/aglyn/plugin-manager/feature-plugins'\nimport { ICON_VARIANT_CLOSE } from '@aglyn/shared-data-enums'\nimport { mdiCreation, mdiPageLayoutHeaderFooter } from '@aglyn/shared-data-mdi'\nimport { pluginDocsHelp } from '@aglyn/aglyn/app-utils/docs-help'\nimport { HelpTip, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\nimport { useUser } from '@aglyn/tenant-feature-instance'\nimport {\n Alert,\n AppBar,\n Box,\n Button,\n Card,\n CardActionArea,\n Chip,\n CircularProgress,\n Container,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n IconButton,\n Stack,\n Toolbar,\n Typography,\n useMediaQuery,\n} from '@mui/material'\nimport { alpha, useTheme, type Theme } from '@mui/material/styles'\nimport { useRouter } from 'next/navigation'\nimport {\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n type SyntheticEvent,\n} from 'react'\nimport {\n AI_JOB_AUTO_CONFIRM_INPUT,\n AI_SITE_FREE_PAGES,\n aiFreeCreditsNoneLeftText,\n aiFreeCreditsResetLabel,\n aiFreeSiteCreditRange,\n aiFreeSitePrompt,\n aiSiteCreditRange,\n type AiFreeCreditsLeft,\n aiSitePagesBand,\n} from '../model/ai-site-job'\nimport { FREE_AI_TASTE_CREDITS_PER_MONTH } from '../plan-entitlements'\nimport {\n AI_CREDITS_CONFIRM_CODE,\n aiCreditRangeText,\n type AiCreditRange,\n type AiCreditsPrompt,\n} from '../model/ai-credit-estimate'\nimport { AiCreditsPromptNotice } from './ai-credits-prompt.component'\nimport {\n AI_SITE_START_ANSWERS,\n aiSiteStartBrief,\n aiSiteStartInputs,\n aiSiteStartRefusal,\n type AiSiteStartAnswers,\n} from '../model/ai-site-start'\nimport {\n aiSiteStartFieldErrors,\n aiSiteStartFirstInvalidStep,\n aiSiteStartNextStep,\n aiSiteStartPreviousStep,\n aiSiteStartStepErrors,\n AI_SITE_START_STEP_FIELDS,\n type AiSiteStartField,\n type AiSiteStartStep,\n} from '../model/ai-site-start-steps'\nimport type { AiJobSummary } from '../model/ai-jobs.types'\nimport { aiSiteKindOfInputs } from '../model/ai-site-kinds'\nimport { aiSiteStartClickOf, useAiSiteStartTracking } from './ai-site-start-tracking'\nimport {\n AudienceStep,\n DetailsStep,\n KindStep,\n ReviewStep,\n StartProgress,\n StepHelp,\n StyleStep,\n} from './ai-site-start-steps.component'\nimport { AiJobFollow } from './ai-job-follow.component'\nimport { AiModelSelector } from './ai-model-selector.component'\nimport { useAiModelChoice } from './use-ai-model-choice'\nimport { aiCreditsBillingHref, aiSiteBuildHref } from './ai-job-links'\nimport { publishAiJob } from './ai-jobs-store'\n\n/**\n * The guided start (AGL-2918), on the `hostFirstRun` zone of the page a newly\n * created site lands on: a choice, a few questions, and the site scaffold they\n * become.\n *\n * ── Two steps (AGL-3594) ─────────────────────────────────────────────────\n *\n * Step 1 asks how to start, as two equal cards: the starter site — a\n * ready-made home page with a header and footer — or AI. The starter card is\n * the zone's `startBlank`, which gives a site born for the guided start the\n * starter every other new site is born with. The AI card moves on to the\n * questions, one decision a step (AGL-3898; see {@link AiSiteStartCard}).\n *\n * ── A full screen dialog, and therefore three ways out ───────────────────\n *\n * The questions take the whole screen, which is the only presentation that\n * gets them read — but a surface that takes the screen and cannot be left is\n * a funnel, so leaving is drawn first and works three ways on both steps:\n *\n * - the close control at the start of the header,\n * - \"Skip\" at the end of it, named \"Skip and start blank\",\n * - Escape, which `Dialog` reports through `onClose`.\n *\n * Before a job is started all three are the zone's own `startBlank`: the\n * starter site, and no job, no draft, no record of a site half begun. After,\n * they close through `leave`, and the job builds the site.\n *\n * ── Or before the site exists (AGL-3761) ─────────────────────────────────\n *\n * \"Create site\" draws this straight away, with the zone's `pendingSite` and\n * no site. Step 1 then asks the site's name and address (the shell's own\n * fields) above the two cards, and the site is created only by a choice that\n * needs one: the starter card or Skip (`startBlank`, which creates it with the\n * starter), or Plan my site, which creates it and then starts the job on it.\n * The close control and Escape create nothing there: they are `leave`. If the\n * site was created and its job could not start, the site is a real one, and\n * every way out gives it the starter as above, so none is left empty.\n *\n * Escape and the close control are DISMISSALS, though, and Skip is a choice\n * (AGL-3660, 2026-10-08). Once anything is typed or picked, a dismissal asks\n * \"Leave without your answers?\" first, focused on Keep editing, so a stray\n * Escape — the second press after closing the model menu was the one in\n * production — can never trade a brief for the starter. Escape that reached\n * the dialog from a portal it does not contain (a menu, a select's list) is\n * that popup's, and the dialog ignores it.\n *\n * The header is the dialog's own chrome rather than part of its body, so the\n * way out cannot be scrolled off, and it is never disabled — least of all\n * while a request is in flight, which is the moment a person most wants it.\n * Nothing is focused ahead of the dialog's own frame, so the first thing a\n * keyboard reaches is the close control.\n *\n * ── It is absent until the route has answered ────────────────────────────\n *\n * The dialog covers the page, so being drawn on a guess is worse here than it\n * is for a card: it would be a takeover every flag-off workspace watches\n * disappear. Nothing renders at all — no `Dialog`, no portal — until the jobs\n * route has admitted this workspace, and a 404, a 403 or an unreachable route\n * is this widget staying absent and the ordinary blank page being all there\n * is. That the widget is mounted is itself the last of a stack of gates: the\n * shell held the plan's `aiGenerative` entitlement, the site's AI switch and\n * the reader's `ai.generate` first. A lockdown is the start door's to say,\n * here, in its own words.\n *\n * ── It builds and publishes for you ──────────────────────────────────────\n *\n * \"Plan my site\" starts a `site` job, which PLANS first: the pages, their\n * addresses, the navigation, the layout, the contact form and a palette. The\n * guided start confirms its own plan (AGL-3594), so the build follows with no\n * approval to make, and the site is published, indexable, when it is done.\n * The person edits or unpublishes it afterwards.\n *\n * ── It stays with the job (AGL-3593) ─────────────────────────────────────\n *\n * Once the job exists the dialog follows it live — planning, the plan with\n * its Confirm, building, then the draft pages to open — so a person never has\n * to leave it to get their site built. \"Open AI jobs\" follows the job in the\n * Assist panel instead; it leaves the guided start the way every other exit\n * does, because the dialog covers the panel it opens.\n */\n\ntype Verdict = 'checking' | 'ready' | 'hidden'\n\n/** Labels the dialog for a reader, from its own heading. */\nconst TITLE_ID = 'ai-site-start-title'\n\n/**\n * The takeover's surface, for its paper, its bar and its footer alike: the\n * console page's own background (AGL-3596). The paper sits at elevation 0,\n * which is what keeps MUI's dark-mode elevation overlay off it.\n */\nexport const AI_SITE_START_SURFACE_SX = { bgcolor: 'background.default' } as const\n\n/** The soft round badge an icon sits in, in its accent's tint. */\nfunction IconBadge({ accent, children }: { accent: 'primary' | 'secondary'; children: ReactNode }) {\n return (\n <Box\n aria-hidden\n sx={(theme: Theme) => ({\n width: theme.spacing(9),\n height: theme.spacing(9),\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n bgcolor: alpha(theme.palette[accent].main, theme.palette.mode === 'dark' ? 0.24 : 0.12),\n color: `${accent}.main`,\n fontSize: theme.spacing(5.5),\n })}\n >\n {children}\n </Box>\n )\n}\n\n/**\n * One way to start, as a card the whole of which is the button. Its accessible\n * name is its title; its description describes it.\n */\nfunction ChoiceCard({\n accent,\n icon,\n iconId,\n title,\n description,\n busy = false,\n onChoose,\n children,\n}: {\n accent: 'primary' | 'secondary'\n icon: string\n /** Names the icon for a reader of the markup; the icon itself is decorative. */\n iconId: string\n title: string\n description: string\n busy?: boolean\n onChoose: () => void\n children?: ReactNode\n}) {\n const id = useId()\n return (\n <Card\n variant=\"outlined\"\n sx={(theme: Theme) => ({\n borderRadius: 2,\n height: '100%',\n transition: theme.transitions.create(['border-color', 'box-shadow', 'transform'], {\n duration: theme.transitions.duration.shorter,\n }),\n '&:hover, &:focus-within': {\n borderColor: `${accent}.main`,\n boxShadow: theme.shadows[4],\n transform: `translateY(-${theme.spacing(0.25)})`,\n },\n '@media (prefers-reduced-motion: reduce)': {\n transition: 'none',\n '&:hover, &:focus-within': { transform: 'none' },\n },\n })}\n >\n <CardActionArea\n onClick={onChoose}\n disabled={busy}\n aria-labelledby={`${id}-title`}\n aria-describedby={`${id}-description`}\n aria-busy={busy || undefined}\n sx={{ height: '100%', p: { xs: 3, sm: 4 } }}\n >\n <Stack spacing={2} sx={{ alignItems: 'center', textAlign: 'center' }}>\n <IconBadge accent={accent}>\n {busy ? (\n <CircularProgress size=\"1em\" color={accent} aria-label={`${title}…`} />\n ) : (\n <MdiIcon path={icon} data-icon={iconId} aria-hidden />\n )}\n </IconBadge>\n <Typography id={`${id}-title`} variant=\"h6\" component=\"h2\">\n {title}\n </Typography>\n <Typography id={`${id}-description`} variant=\"body2\" color=\"text.secondary\">\n {description}\n </Typography>\n {children}\n </Stack>\n </CardActionArea>\n </Card>\n )\n}\n\n/** A small label above a group of questions. */\n/**\n * Each part of the guided start links its own section of the Start with AI\n * guide (AGL-3660), so a `?` says what that one group of answers changes.\n */\nconst START_HELP = {\n choose: pluginDocsHelp('aiStart', {\n anchor: '#how-do-you-want-to-start',\n excerpt:\n 'The starter site gives you a ready-made home page to edit. Start with AI asks a few questions, then plans, writes and publishes your pages.',\n }),\n estimate: pluginDocsHelp('aiCredits', {\n anchor: '#before-a-job-starts',\n excerpt:\n 'About what a start like this costs, measured on real builds, and the most it can cost. What it really costs is what each step spends, and you can watch that add up while it runs.',\n }),\n}\n\nfunction SectionLabel({ children, help }: { children: ReactNode; help?: ReturnType<typeof pluginDocsHelp> }) {\n return (\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: 'center' }}>\n <Typography variant=\"overline\" color=\"text.secondary\" component=\"h2\" sx={{ display: 'block' }}>\n {children}\n </Typography>\n {help ? <HelpTip {...help} /> : null}\n </Stack>\n )\n}\n\n/**\n * The guided start, as the `hostFirstRun` zone draws it, or reopened on a\n * failed start's own answers (AGL-3596): `initialAnswers` opens it on the\n * questions, filled in, for the person to adjust and start a fresh job.\n */\nexport type AiSiteStartCardProps = ConsoleHostFirstRunZoneProps & {\n initialAnswers?: AiSiteStartAnswers | null\n}\n\n/**\n * The questions are one decision a step (AGL-3898): what kind of site it is\n * (typed, or a card), who it is for, the style (cards that show each one,\n * \"Pick for me\" first and picked), the details, and a review that plans the\n * site (`ai-site-start-steps.component.tsx`). Back and Next keep every\n * answer; Enter in a text answer is Next; each step's heading takes the focus\n * when it is drawn; a step that cannot go forward says why beside the field\n * and puts the cursor in it. The answers are the same object the single form\n * held, and only the review turns them into the job, through the same\n * `aiSiteStartBrief` and `aiSiteStartInputs`. Each step is reported as a\n * funnel, with where people struggle (`ai-site-start-tracking.ts`).\n */\nexport function AiSiteStartCard({\n hostId,\n orgId,\n orgSlug,\n host,\n startBlank,\n leave,\n pendingSite,\n initialAnswers = null,\n}: AiSiteStartCardProps) {\n const { data: user } = useUser()\n const router = useRouter()\n // Held in a ref so a request reads WHO is signed in, never the identity of\n // the object that says so.\n const userRef = useRef(user)\n userRef.current = user\n const uid = user?.uid ?? null\n const [verdict, setVerdict] = useState<Verdict>('checking')\n // Read once: a start reopened on its answers stays one while it is open.\n const reopened = useRef(initialAnswers !== null)\n // A start reopened on its answers opens on the review, every answer there to change.\n const [step, setStep] = useState<AiSiteStartStep>(initialAnswers ? 'review' : 'choose')\n const [answers, setAnswers] = useState<AiSiteStartAnswers>(initialAnswers ?? AI_SITE_START_ANSWERS)\n // The steps whose reasons not to go forward are shown: the ones Next was refused on.\n const [checked, setChecked] = useState<ReadonlySet<AiSiteStartStep>>(() => new Set())\n // A step opened from the review's Edit goes back to the review on Next.\n const [returnTo, setReturnTo] = useState<AiSiteStartStep | null>(null)\n // Each step's heading takes the focus when the step changes, never on the first draw.\n const headingRef = useRef<HTMLHeadingElement | null>(null)\n const drawnStep = useRef<AiSiteStartStep | null>(null)\n const fieldRefs = useRef<Partial<Record<AiSiteStartField, HTMLInputElement | null>>>({})\n const theme = useTheme()\n const compact = useMediaQuery(theme.breakpoints.down('sm'), { noSsr: true })\n const [busy, setBusy] = useState(false)\n // The starter card's own busy state while `startBlank` runs (AGL-3594).\n const [startingStarter, setStartingStarter] = useState(false)\n const [notice, setNotice] = useState<string | null>(null)\n /** The site job \"Plan my site\" started, as the create door answered with it. */\n const [started, setStarted] = useState<AiJobSummary | null>(null)\n // The Free taste's page band (AGL-3594), read off the verdict request.\n const [freeTaste, setFreeTaste] = useState(false)\n // What the Free workspace has left this month (AGL-3660), as the same read\n // the create door refuses on: the less of its own band and its owner's\n // allowance across their Free workspaces. `null` when the route said none.\n const [freeCredits, setFreeCredits] = useState<AiFreeCreditsLeft | null>(null)\n // \"Leave without your answers?\" (AGL-3660): a dismissal with a brief typed.\n const [confirmingLeave, setConfirmingLeave] = useState(false)\n // The dialog's own root, to tell its Escape from a nested popup's.\n const dialogRef = useRef<HTMLDivElement | null>(null)\n // Drawn by \"Create site\" before the site exists (AGL-3761): the shell's\n // name and address are asked on step 1, and the site is created only by\n // the starter, Skip, or Plan my site. Read through a ref by the verdict\n // below, which must not re-run when the shell re-renders it.\n const pendingRef = useRef(pendingSite)\n pendingRef.current = pendingSite\n const creating = Boolean(pendingSite) && !pendingSite?.created\n // The funnel (AGL-3898): each step drawn, left and abandoned, and where people struggle.\n const tracker = useAiSiteStartTracking(step, verdict === 'ready')\n\n useEffect(() => {\n if (!orgId || !uid) return\n let active = true\n void (async () => {\n try {\n const response = await authorizedFetch(\n userRef.current,\n `/api/ai/jobs?orgId=${encodeURIComponent(orgId)}&limit=1`,\n )\n const payload = response.ok ? await response.json().catch(() => null) : null\n if (active) {\n if (payload?.freeTaste === true) {\n setFreeTaste(true)\n const credits = payload?.freeCredits as AiFreeCreditsLeft | undefined\n if (credits && Number.isFinite(credits.left)) setFreeCredits(credits)\n // A reopened start keeps the pages it asked for, within the band.\n setAnswers((current) => ({\n ...current,\n pages: reopened.current ? Math.min(current.pages, AI_SITE_FREE_PAGES.max) : AI_SITE_FREE_PAGES.max,\n welcomeEmail: false,\n }))\n }\n const shown = response.status !== 404 && response.status !== 403\n setVerdict(shown ? 'ready' : 'hidden')\n // \"Create site\" shows its own dialog when this one will not draw.\n pendingRef.current?.ready(shown)\n }\n } catch {\n if (active) {\n setVerdict('hidden')\n pendingRef.current?.ready(false)\n }\n }\n })()\n return () => {\n active = false\n }\n }, [orgId, uid])\n\n const answer = useCallback(\n (patch: Partial<AiSiteStartAnswers>) =>\n setAnswers((current) => ({ ...current, ...patch })),\n [],\n )\n\n // A Free start past what is left asks first (AGL-3722): it is admitted on\n // its measured p90, and one past what is left starts only on \"Build what\n // fits\" (pausing with Resume where the credits run out), or smaller as the\n // home page alone. The create door asks the same, so a stale dialog meets\n // the prompt there too (`serverPrompt`). Nothing at all left is a dead\n // stop until the credits renew or the workspace upgrades.\n const [serverPrompt, setServerPrompt] = useState<AiCreditsPrompt | null>(null)\n // The door's prompt was for the pages it was asked with.\n useEffect(() => setServerPrompt(null), [answers.pages])\n // A store's first products and a blog's first posts are part of the start (AGL-3676, AGL-3798).\n const siteKind = aiSiteKindOfInputs(aiSiteStartInputs(answers))?.id ?? null\n const prompt = freeTaste ? (aiFreeSitePrompt(freeCredits, answers.pages, { siteKind }) ?? serverPrompt) : null\n const noneLeft = freeTaste && freeCredits !== null && freeCredits.left <= 0\n const refusal = aiSiteStartRefusal(answers, { freeTaste })\n const band = aiSitePagesBand(freeTaste)\n // On a paid plan the person picks the model that builds the site (AGL-3660),\n // Auto by default, from the models their plan allows; every step of the job\n // runs on it. A Free workspace builds on the default and is offered none.\n const modelChoice = useAiModelChoice({ orgId, hostId, surface: 'jobs', kind: 'job.page' })\n // A pick remembered from before needs its cost to estimate by; Auto does not,\n // and the list is otherwise read when the picker opens.\n const { load: loadModels, model: rememberedModel } = modelChoice\n useEffect(() => {\n if (!freeTaste && step === 'review' && rememberedModel) loadModels()\n }, [freeTaste, step, rememberedModel, loadModels])\n const pickedModel = freeTaste ? null : modelChoice.model\n\n const plan = useCallback(async (options: { creditsConfirmed?: boolean; pages?: number } = {}) => {\n const asked = options.pages ? { ...answers, pages: options.pages } : answers\n if (!orgId || aiSiteStartRefusal(asked, { freeTaste }) || noneLeft) return\n // Past what is left, only an explicit go-ahead starts it.\n if (freeTaste && !options.creditsConfirmed && aiFreeSitePrompt(freeCredits, asked.pages, { siteKind })) return\n if (options.pages) answer({ pages: options.pages })\n setBusy(true)\n setNotice(null)\n setServerPrompt(null)\n try {\n const requestJob = (siteId: string | null, check: boolean) =>\n authorizedFetch(userRef.current, '/api/ai/jobs', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n orgId,\n hostId: siteId,\n kind: 'site',\n brief: aiSiteStartBrief(asked),\n // The guided start confirms its own plan (AGL-3594): the build\n // follows the plan with no approval to make.\n inputs: { ...aiSiteStartInputs(asked), [AI_JOB_AUTO_CONFIRM_INPUT]: true },\n ...(pickedModel ? { model: pickedModel } : {}),\n ...(options.creditsConfirmed ? { creditsConfirmed: true } : {}),\n ...(check ? { check: true } : {}),\n }),\n })\n // A refusal said in the dialog, or the Free go-ahead it asks for.\n const refused = async (response: Response): Promise<unknown> => {\n const payload = await response.json().catch(() => null)\n if (response.ok) return payload ?? {}\n if (response.status === 409 && payload?.code === AI_CREDITS_CONFIRM_CODE && payload?.credits) {\n setServerPrompt(payload.credits as AiCreditsPrompt)\n return null\n }\n const locked = parseLockdownRefusal(response.status, payload)\n setNotice(\n locked\n ? lockdownRefusalText(locked)\n : String(payload?.error ?? 'The site could not be started. Try again.'),\n )\n return null\n }\n // The site, created now when it does not exist yet (AGL-3761): this is\n // the moment the person asked for it. The start is checked first\n // (AGL-3859), so one the jobs route would refuse, or would ask the Free\n // go-ahead for, is answered before any site exists. A refusal about the\n // name or address goes back to step 1, where they are typed.\n let site = { hostId, host, orgSlug }\n if (!hostId && pendingSite) {\n if (!pendingSite.created && !(await refused(await requestJob(null, true)))) return\n const made = await pendingSite.create()\n if ('error' in made) {\n setNotice(made.error)\n if (made.address) setStep('choose')\n return\n }\n site = { hostId: made.hostId, host: made.host, orgSlug: made.orgSlug || orgSlug }\n }\n if (!site.hostId) return\n const payload = (await refused(await requestJob(site.hostId, false))) as { job?: AiJobSummary } | null\n if (!payload) return\n const created = (payload?.job as AiJobSummary | undefined) ?? null\n if (!created) {\n setNotice('The site could not be started. Try again.')\n return\n }\n // The indicator and the launcher count it from the moment it exists.\n publishAiJob(created)\n // The funnel's last step: the site is started, and nothing after is leaving it.\n tracker.complete()\n tracker.finish()\n // Where the next step is (AGL-3594): the site's \"Building your site\"\n // page for this job. The zone closes without the starter first, so the\n // setup page does not ask again behind it.\n const href = aiSiteBuildHref(site.orgSlug, site.host, created.id)\n if (href) {\n ;(leave ?? (() => undefined))()\n router.push(href)\n return\n }\n setStarted(created)\n } catch {\n setNotice('The site could not be started. Try again.')\n } finally {\n setBusy(false)\n }\n }, [orgId, hostId, answers, answer, freeTaste, freeCredits, noneLeft, orgSlug, host, leave, router, pickedModel, pendingSite, siteKind, tracker])\n\n // The zone's `startBlank`. Before the site exists it creates it with the\n // starter, and answers `false` when it could not — most often a name or\n // address to fix, which step 1 shows.\n const runStartBlank = useCallback(() => {\n const result = startBlank()\n if (result && typeof result.then === 'function') {\n void result.then((done) => {\n if (done) return\n setStartingStarter(false)\n setStep('choose')\n })\n }\n }, [startBlank])\n\n const chooseStarter = useCallback(() => {\n if (pendingSite && !pendingSite.created && !pendingSite.check()) return\n setStartingStarter(true)\n trackEvent('site_start_choice', { choice: 'starter' })\n // The starter is a way to start, not a way to leave: no abandonment after it.\n tracker.finish()\n runStartBlank()\n }, [pendingSite, runStartBlank, tracker])\n\n const chooseAi = useCallback(() => {\n if (pendingSite && !pendingSite.created && !pendingSite.check()) return\n trackEvent('site_start_choice', { choice: 'ai' })\n tracker.complete()\n setStep('kind')\n }, [pendingSite, tracker])\n\n // The heading of each step takes the focus as the step is drawn, so a\n // keyboard and a screen reader start where the new question does.\n useEffect(() => {\n if (verdict !== 'ready') return\n if (drawnStep.current !== null && drawnStep.current !== step) headingRef.current?.focus()\n drawnStep.current = step\n }, [step, verdict])\n\n /** Forward from a question step, when its answers may go forward. */\n const next = useCallback(() => {\n if (step === 'choose' || step === 'review') return\n const errors = aiSiteStartStepErrors(step, answers, { freeTaste })\n if (errors.length) {\n setChecked((current) => new Set(current).add(step))\n for (const error of errors) tracker.fieldError(error.field, error.code)\n fieldRefs.current[errors[0].field]?.focus()\n return\n }\n tracker.complete()\n const target = returnTo ?? aiSiteStartNextStep(step)\n setReturnTo(null)\n // A review reached with an answer that cannot go forward opens on that answer instead.\n if (target === 'review') {\n const invalid = aiSiteStartFirstInvalidStep(answers, { freeTaste })\n if (invalid && invalid !== 'review') {\n setChecked((current) => new Set(current).add(invalid))\n setStep(invalid)\n return\n }\n }\n if (target) setStep(target)\n }, [step, answers, freeTaste, returnTo, tracker])\n\n /** Back one step, keeping every answer. */\n const back = useCallback(() => {\n const target = aiSiteStartPreviousStep(step)\n if (!target) return\n tracker.back()\n setReturnTo(null)\n setStep(target)\n }, [step, tracker])\n\n /** From the review, to the step that asks an answer, and back to the review on Next. */\n const edit = useCallback(\n (target: AiSiteStartStep) => {\n tracker.back()\n setReturnTo('review')\n setStep(target)\n },\n [tracker],\n )\n\n if (verdict !== 'ready') return null\n\n // Before a job is started Skip is the blank site, which writes the starter\n // (AGL-3594); after, it only closes — the job builds the site.\n const exit = started ? (leave ?? runStartBlank) : runStartBlank\n // Skip, as the header draws it: before a site is started it is leaving the questions.\n const skip = () => {\n if (!started) tracker.abandon('skip')\n exit()\n }\n // Escape and the close control. Before \"Create site\" has made the site\n // (AGL-3761) there is nothing to give a starter to, so they only close,\n // and nothing is created; otherwise they are the same way out as Skip.\n const dismissTo = creating && !started ? (leave ?? runStartBlank) : exit\n // Anything the person typed or picked, which a dismissal must not discard\n // silently (AGL-3660). After a job starts there is nothing left to lose.\n const drafted =\n !started &&\n Boolean(\n answers.siteType.trim() ||\n answers.audience.trim() ||\n answers.kind !== null ||\n (creating && pendingSite?.dirty),\n )\n // Escape and the close control: a dismissal, never a choice. Escape that\n // bubbled here through React from a portal outside this dialog's own DOM is\n // a nested menu's, already handled there, and is not this dialog's to act on.\n const dismiss = (event?: SyntheticEvent | object, reason?: string) => {\n if (reason === 'escapeKeyDown') {\n const target = (event as SyntheticEvent | undefined)?.target\n const root = dialogRef.current\n if (root && target instanceof Node && !root.contains(target)) return\n }\n if (drafted) setConfirmingLeave(true)\n else closeTo()\n }\n // The dismissal itself, once nothing typed is in the way of it.\n const closeTo = () => {\n if (!started) tracker.abandon('close')\n dismissTo()\n }\n const leaveDraft = () => {\n setConfirmingLeave(false)\n closeTo()\n }\n\n // The chosen model's cost against Auto's, as the model list states it.\n const modelMultiplier =\n (pickedModel && modelChoice.options?.options.find((option) => option.id === pickedModel)?.multiplier) || 1\n // What the start is likely to cost and at most (AGL-3722): \"About 137\n // credits (up to 283)\", the measured figures scaled by the chosen model.\n const scaled = (range: AiCreditRange): AiCreditRange => ({\n likely: Math.round(range.likely * modelMultiplier),\n p90: Math.round(range.p90 * modelMultiplier),\n ceiling: Math.round(range.ceiling * modelMultiplier),\n })\n const estimate = freeTaste\n ? aiFreeSiteCreditRange(answers.pages, { siteKind })\n : scaled(aiSiteCreditRange(answers.pages, { welcomeEmail: answers.welcomeEmail, siteKind }))\n // A Free start quotes what is LEFT (AGL-3660), shared across the owner's\n // Free workspaces — never the month's whole allowance as if none were spent.\n const estimateText = freeTaste\n ? freeCredits\n ? `${aiCreditRangeText(estimate)}. You have ${freeCredits.left.toLocaleString('en-US')} of your ${freeCredits.total.toLocaleString('en-US')} free AI credits left this month, until ${aiFreeCreditsResetLabel(freeCredits.resetsOn)}`\n : `${aiCreditRangeText(estimate)}, of the ${FREE_AI_TASTE_CREDITS_PER_MONTH} AI credits you get free each month`\n : `${aiCreditRangeText(estimate)}, estimated`\n\n const choosing = step === 'choose' && !started\n const reviewing = step === 'review' && !started\n const asking = step !== 'choose' && !started\n // Each answer's reason not to go forward, shown on a step once Next was refused there.\n const fieldErrors = aiSiteStartFieldErrors(answers, { freeTaste })\n const shownErrors = Object.fromEntries(\n AI_SITE_START_STEP_FIELDS[step]\n .filter((field) => checked.has(step) && fieldErrors[field])\n .map((field) => [field, fieldErrors[field]]),\n )\n const stepProps = {\n answers,\n answer,\n tracker,\n errors: shownErrors,\n fieldRef: (field: AiSiteStartField) => (node: HTMLInputElement | null) => {\n fieldRefs.current[field] = node\n },\n }\n const HEADINGS: Record<AiSiteStartStep, { title: string; lede: string }> = {\n choose: {\n title: 'How do you want to start?',\n lede: creating ? 'Name your site, then choose how it starts. You can change everything later.' : 'You can change everything later.',\n },\n kind: {\n title: 'What are you building?',\n lede: `Say it in a few words, or pick the closest. ${PLATFORM_BRAND_NAME} AI plans and writes your pages from it.`,\n },\n audience: { title: 'Who is it for?', lede: 'The pages and the contact form are written for them.' },\n style: {\n title: 'Choose a style',\n lede: 'Each picture is an example home page in that style. Yours is written for your business, with its own colors and fonts within the style you pick.',\n },\n details: { title: 'A few details', lede: 'Where messages go, how many pages, and what else to draft. All can be changed later.' },\n review: {\n title: 'Review your site',\n lede: started\n ? `${PLATFORM_BRAND_NAME} AI is on it.`\n : `${PLATFORM_BRAND_NAME} AI plans and writes your pages from these answers, then publishes your site.`,\n },\n }\n const heading = HEADINGS[step]\n // Enter in a text answer is Next. A select, a card or a button keeps its own Enter.\n const onStepKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (event.key !== 'Enter' || event.nativeEvent.isComposing || !asking || reviewing) return\n const target = event.target as HTMLElement\n if (target.tagName !== 'INPUT' || (target as HTMLInputElement).type === 'hidden') return\n event.preventDefault()\n next()\n }\n\n return (\n <Dialog\n open\n fullScreen\n ref={dialogRef}\n onClose={dismiss}\n aria-labelledby={TITLE_ID}\n // Where people get lost (AGL-3898): any input puts off the idle signal,\n // and every click is read for rage and dead clicks.\n onClickCapture={(event: MouseEvent<HTMLElement>) => tracker.click(aiSiteStartClickOf(event))}\n onKeyDownCapture={() => tracker.activity()}\n onInputCapture={() => tracker.activity()}\n // The console's own page surface, in both modes. A Dialog's paper sits\n // at elevation 24 by default, and in dark mode MUI lightens an elevated\n // paper with a white overlay, which turned the whole takeover a\n // washed-out gray; the overlay is for floating surfaces, and this one\n // fills the screen, so its paper is flat.\n slotProps={{ paper: { elevation: 0, sx: AI_SITE_START_SURFACE_SX } }}\n >\n {/*\n The way out, before anything it is a way out of: a slim header on the\n paper surface. On a narrow screen it is the TITLE that gives way, so\n the exits keep their words at every width.\n */}\n <AppBar\n position=\"relative\"\n color=\"inherit\"\n elevation={0}\n enableColorOnDark\n data-start-area=\"header\"\n sx={{ ...AI_SITE_START_SURFACE_SX, borderBottom: 1, borderColor: 'divider' }}\n >\n <Toolbar variant=\"dense\" sx={{ gap: 1 }}>\n <IconButton\n edge=\"start\"\n color=\"inherit\"\n onClick={() => dismiss()}\n aria-label=\"Close the guided start\"\n >\n <MdiIcon path={ICON_VARIANT_CLOSE.path} />\n </IconButton>\n <Typography\n id={TITLE_ID}\n variant=\"subtitle1\"\n component=\"div\"\n noWrap\n sx={{ textOverflow: 'ellipsis', flex: 1 }}\n >\n {'Start your site'}\n </Typography>\n <Button color=\"inherit\" onClick={skip} aria-label={started ? 'Close' : 'Skip and start blank'}>\n {started ? 'Close' : 'Skip'}\n </Button>\n </Toolbar>\n </AppBar>\n <DialogContent sx={{ px: { xs: 2, sm: 3 } }} onKeyDown={onStepKeyDown}>\n <Container\n maxWidth={choosing || step === 'kind' || step === 'style' ? 'md' : 'sm'}\n disableGutters\n sx={{ py: { xs: 3, sm: 5 } }}\n >\n <Stack spacing={4}>\n <Box sx={{ maxWidth: (t: Theme) => t.spacing(80), width: '100%', mx: 'auto' }}>\n <StartProgress step={step} compact={compact} />\n </Box>\n <Stack spacing={1} sx={{ textAlign: choosing ? 'center' : 'left' }} data-start-area=\"heading\">\n <Typography\n ref={headingRef}\n tabIndex={-1}\n variant=\"h4\"\n component=\"h1\"\n sx={{ '&:focus': { outline: 'none' }, '&:focus-visible': { outline: 'none' } }}\n >\n {heading.title}\n </Typography>\n <Typography variant=\"body1\" color=\"text.secondary\">\n {choosing ? <HelpTip sx={{ float: 'right' }} {...START_HELP.choose} /> : <StepHelp step={step} />}\n {heading.lede}\n </Typography>\n </Stack>\n {notice && (\n <Alert severity=\"info\" data-start-area=\"notice\">\n {notice}\n </Alert>\n )}\n {asking && noneLeft && freeCredits && (\n <Alert\n severity=\"warning\"\n data-start-area=\"notice\"\n action={\n orgSlug ? (\n <Button color=\"inherit\" size=\"small\" href={aiCreditsBillingHref(orgSlug)}>\n {'Upgrade'}\n </Button>\n ) : undefined\n }\n >\n {aiFreeCreditsNoneLeftText(freeCredits.resetsOn)}\n </Alert>\n )}\n {choosing && creating && pendingSite ? (\n <Stack spacing={2} component=\"section\" aria-label=\"Your site\">\n <SectionLabel>{'Your site'}</SectionLabel>\n {pendingSite.fields}\n </Stack>\n ) : null}\n {choosing ? (\n <Box\n data-start-area=\"choose-cards\"\n sx={{\n display: 'grid',\n gridTemplateColumns: { xs: '1fr', sm: '1fr 1fr' },\n gap: 3,\n }}\n >\n <ChoiceCard\n accent=\"secondary\"\n icon={mdiPageLayoutHeaderFooter.path}\n iconId=\"page-layout-header-footer\"\n title=\"Start from the starter site\"\n description=\"A ready-made home page with a header, footer and contact form you can edit.\"\n busy={startingStarter}\n onChoose={chooseStarter}\n />\n <ChoiceCard\n accent=\"primary\"\n icon={mdiCreation.path}\n iconId=\"creation\"\n title=\"Start with AI\"\n description={`Answer a few questions and ${PLATFORM_BRAND_NAME} AI plans your pages.`}\n onChoose={chooseAi}\n >\n <Chip size=\"small\" color=\"primary\" label=\"Recommended\" />\n {freeTaste && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`Up to ${AI_SITE_FREE_PAGES.max} pages on the Free plan`}\n </Typography>\n )}\n </ChoiceCard>\n </Box>\n ) : started && orgId ? (\n <Card variant=\"outlined\" sx={{ borderRadius: 2, p: { xs: 2, sm: 3 } }}>\n <AiJobFollow\n job={started}\n orgId={orgId}\n orgSlug={orgSlug}\n user={user}\n intro={\n 'Your site is being planned. It is then built and published for you, with ' +\n 'nothing to approve. You can edit or unpublish it afterwards.'\n }\n // Full screen: AI jobs opens in the panel this dialog covers.\n onOpenJobs={exit}\n />\n </Card>\n ) : (\n <Box component=\"section\">\n {step === 'kind' && <KindStep {...stepProps} />}\n {step === 'audience' && <AudienceStep {...stepProps} />}\n {step === 'style' && <StyleStep {...stepProps} />}\n {step === 'details' && <DetailsStep {...stepProps} freeTaste={freeTaste} band={band} />}\n {step === 'review' && (\n <ReviewStep answers={answers} freeTaste={freeTaste} onEdit={edit}>\n {!noneLeft && prompt && (\n <AiCreditsPromptNotice\n prompt={prompt}\n noun=\"site\"\n orgSlug={orgSlug}\n busy={busy}\n onBuildWhatFits={() => void plan({ creditsConfirmed: true })}\n onSmaller={() => void plan({ creditsConfirmed: true, pages: 1 })}\n />\n )}\n </ReviewStep>\n )}\n </Box>\n )}\n </Stack>\n </Container>\n </DialogContent>\n {asking && (\n /* The footer stays put while the questions scroll. It wraps, because\n the estimate, the reason and the buttons are wider than a phone. */\n <DialogActions\n data-start-area=\"footer\"\n sx={{\n px: { xs: 2, sm: 3 },\n py: 2,\n flexWrap: 'wrap',\n rowGap: 1,\n columnGap: 2,\n borderTop: 1,\n borderColor: 'divider',\n ...AI_SITE_START_SURFACE_SX,\n }}\n >\n {reviewing && (\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: 'center', mr: 'auto', minWidth: 0 }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`${estimateText}.`}\n </Typography>\n <HelpTip {...START_HELP.estimate} ariaLabel=\"How the estimate works\" />\n </Stack>\n )}\n {reviewing && refusal && (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {refusal}\n </Typography>\n )}\n {reviewing && !freeTaste && <AiModelSelector choice={modelChoice} disabled={busy} />}\n <Button onClick={back} sx={reviewing ? undefined : { mr: 'auto' }}>\n {'Back'}\n </Button>\n {reviewing ? (\n <Button\n variant=\"contained\"\n size=\"large\"\n disabled={busy || Boolean(refusal) || Boolean(prompt) || noneLeft}\n onClick={() => void plan()}\n startIcon={<MdiIcon path={mdiCreation.path} />}\n >\n {busy ? 'Starting…' : 'Plan my site'}\n </Button>\n ) : (\n <Button variant=\"contained\" size=\"large\" onClick={next}>\n {returnTo === 'review' ? 'Back to review' : 'Next'}\n </Button>\n )}\n </DialogActions>\n )}\n <Dialog\n open={confirmingLeave}\n onClose={() => setConfirmingLeave(false)}\n aria-labelledby={`${TITLE_ID}-leave`}\n aria-describedby={`${TITLE_ID}-leave-text`}\n maxWidth=\"xs\"\n >\n <DialogTitle id={`${TITLE_ID}-leave`}>{'Leave without your answers?'}</DialogTitle>\n <DialogContent>\n <DialogContentText id={`${TITLE_ID}-leave-text`}>\n {creating\n ? 'What you typed is not saved, and no site is created.'\n : 'What you typed is not saved. Leaving starts your site from the starter site instead.'}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button color=\"inherit\" onClick={leaveDraft}>\n {creating ? 'Leave' : 'Leave and start blank'}\n </Button>\n <Button variant=\"contained\" autoFocus onClick={() => setConfirmingLeave(false)}>\n {'Keep editing'}\n </Button>\n </DialogActions>\n </Dialog>\n </Dialog>\n )\n}\n\nexport default AiSiteStartCard\n"],"names":["lockdownRefusalText","parseLockdownRefusal","PLATFORM_BRAND_NAME","trackEvent","ICON_VARIANT_CLOSE","mdiCreation","mdiPageLayoutHeaderFooter","pluginDocsHelp","HelpTip","MdiIcon","authorizedFetch","useUser","Alert","AppBar","Box","Button","Card","CardActionArea","Chip","CircularProgress","Container","Dialog","DialogActions","DialogContent","DialogContentText","DialogTitle","IconButton","Stack","Toolbar","Typography","useMediaQuery","alpha","useTheme","useRouter","useCallback","useEffect","useId","useRef","useState","AI_JOB_AUTO_CONFIRM_INPUT","AI_SITE_FREE_PAGES","aiFreeCreditsNoneLeftText","aiFreeCreditsResetLabel","aiFreeSiteCreditRange","aiFreeSitePrompt","aiSiteCreditRange","aiSitePagesBand","FREE_AI_TASTE_CREDITS_PER_MONTH","AI_CREDITS_CONFIRM_CODE","aiCreditRangeText","AiCreditsPromptNotice","AI_SITE_START_ANSWERS","aiSiteStartBrief","aiSiteStartInputs","aiSiteStartRefusal","aiSiteStartFieldErrors","aiSiteStartFirstInvalidStep","aiSiteStartNextStep","aiSiteStartPreviousStep","aiSiteStartStepErrors","AI_SITE_START_STEP_FIELDS","aiSiteKindOfInputs","aiSiteStartClickOf","useAiSiteStartTracking","AudienceStep","DetailsStep","KindStep","ReviewStep","StartProgress","StepHelp","StyleStep","AiJobFollow","AiModelSelector","useAiModelChoice","aiCreditsBillingHref","aiSiteBuildHref","publishAiJob","TITLE_ID","AI_SITE_START_SURFACE_SX","bgcolor","IconBadge","accent","children","aria-hidden","sx","theme","width","spacing","height","borderRadius","display","alignItems","justifyContent","palette","main","mode","color","fontSize","ChoiceCard","icon","iconId","title","description","busy","onChoose","id","variant","transition","transitions","create","duration","shorter","borderColor","boxShadow","shadows","transform","onClick","disabled","aria-labelledby","aria-describedby","aria-busy","undefined","p","xs","sm","textAlign","size","aria-label","path","data-icon","component","START_HELP","choose","anchor","excerpt","estimate","SectionLabel","help","direction","AiSiteStartCard","hostId","orgId","orgSlug","host","startBlank","leave","pendingSite","initialAnswers","modelChoice","data","user","router","userRef","current","uid","verdict","setVerdict","reopened","step","setStep","answers","setAnswers","checked","setChecked","Set","returnTo","setReturnTo","headingRef","drawnStep","fieldRefs","compact","breakpoints","down","noSsr","setBusy","startingStarter","setStartingStarter","notice","setNotice","started","setStarted","freeTaste","setFreeTaste","freeCredits","setFreeCredits","confirmingLeave","setConfirmingLeave","dialogRef","pendingRef","creating","Boolean","created","tracker","active","response","encodeURIComponent","payload","ok","json","catch","credits","Number","isFinite","left","pages","Math","min","max","welcomeEmail","shown","status","ready","answer","patch","serverPrompt","setServerPrompt","siteKind","prompt","noneLeft","refusal","band","surface","kind","load","loadModels","model","rememberedModel","pickedModel","plan","options","asked","creditsConfirmed","requestJob","siteId","check","method","headers","body","JSON","stringify","brief","inputs","refused","code","locked","String","error","site","made","address","job","complete","finish","href","push","runStartBlank","result","then","done","chooseStarter","choice","chooseAi","focus","next","errors","length","add","fieldError","field","target","invalid","back","edit","exit","skip","abandon","dismissTo","drafted","siteType","trim","audience","dirty","dismiss","event","reason","root","Node","contains","closeTo","leaveDraft","modelMultiplier","find","option","multiplier","scaled","range","likely","round","p90","ceiling","estimateText","toLocaleString","total","resetsOn","choosing","reviewing","asking","fieldErrors","shownErrors","Object","fromEntries","filter","has","map","stepProps","fieldRef","node","HEADINGS","lede","style","details","review","heading","onStepKeyDown","key","nativeEvent","isComposing","tagName","type","preventDefault","open","fullScreen","ref","onClose","onClickCapture","click","onKeyDownCapture","activity","onInputCapture","slotProps","paper","elevation","position","enableColorOnDark","data-start-area","borderBottom","gap","edge","noWrap","textOverflow","flex","px","onKeyDown","maxWidth","disableGutters","py","t","mx","tabIndex","outline","float","severity","action","fields","gridTemplateColumns","label","intro","onOpenJobs","onEdit","noun","onBuildWhatFits","onSmaller","flexWrap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License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { type ReactNode, type Ref } from 'react';
|
|
18
|
+
import { type AiSiteStartAnswers } from '../model/ai-site-start';
|
|
19
|
+
import { type AiSiteStartField, type AiSiteStartFieldError, type AiSiteStartStep } from '../model/ai-site-start-steps';
|
|
20
|
+
import type { AiSiteStartTracker } from './ai-site-start-tracking';
|
|
21
|
+
/**
|
|
22
|
+
* The guided start's question steps (AGL-3898), one decision each. Each step
|
|
23
|
+
* draws its own answers and writes them through `answer`, exactly the patch
|
|
24
|
+
* the single form wrote, so the answers object is the same whichever way it
|
|
25
|
+
* was filled in. The dialog around them (`ai-site-start-card.component.tsx`)
|
|
26
|
+
* owns the step, Back and Next, validation and the job.
|
|
27
|
+
*/
|
|
28
|
+
/** Each part of the guided start links its own section of the Start with AI guide (AGL-3660). */
|
|
29
|
+
export declare const START_STEP_HELP: {
|
|
30
|
+
kind: {
|
|
31
|
+
title: string;
|
|
32
|
+
excerpt: ReactNode;
|
|
33
|
+
excerptText: string;
|
|
34
|
+
href: string;
|
|
35
|
+
};
|
|
36
|
+
audience: {
|
|
37
|
+
title: string;
|
|
38
|
+
excerpt: ReactNode;
|
|
39
|
+
excerptText: string;
|
|
40
|
+
href: string;
|
|
41
|
+
};
|
|
42
|
+
review: {
|
|
43
|
+
title: string;
|
|
44
|
+
excerpt: ReactNode;
|
|
45
|
+
excerptText: string;
|
|
46
|
+
href: string;
|
|
47
|
+
};
|
|
48
|
+
style: {
|
|
49
|
+
title: string;
|
|
50
|
+
excerpt: ReactNode;
|
|
51
|
+
excerptText: string;
|
|
52
|
+
href: string;
|
|
53
|
+
};
|
|
54
|
+
details: {
|
|
55
|
+
title: string;
|
|
56
|
+
excerpt: ReactNode;
|
|
57
|
+
excerptText: string;
|
|
58
|
+
href: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/** "a restaurant or cafe" as a card title: "Restaurant or cafe". The answer itself keeps its words. */
|
|
62
|
+
export declare function startTypeTitle(type: string): string;
|
|
63
|
+
/** The id the style grid gives "Pick for me", which is no kind: the answers' `kind: null`. */
|
|
64
|
+
export declare const AI_SITE_STYLE_AUTO = "auto";
|
|
65
|
+
/** The progress through the steps: labeled steps on a wide screen, a bar and "Step 3 of 6" on a phone. */
|
|
66
|
+
export declare function StartProgress({ step, compact }: {
|
|
67
|
+
step: AiSiteStartStep;
|
|
68
|
+
compact: boolean;
|
|
69
|
+
}): import("react").JSX.Element;
|
|
70
|
+
interface StepProps {
|
|
71
|
+
answers: AiSiteStartAnswers;
|
|
72
|
+
answer: (patch: Partial<AiSiteStartAnswers>) => void;
|
|
73
|
+
tracker: AiSiteStartTracker;
|
|
74
|
+
/** Each field's reason not to go forward, once the person has tried to. */
|
|
75
|
+
errors: Partial<Record<AiSiteStartField, AiSiteStartFieldError>>;
|
|
76
|
+
/** Where each field's input is, so a refused Next can put the cursor in it. */
|
|
77
|
+
fieldRef: (field: AiSiteStartField) => Ref<HTMLInputElement>;
|
|
78
|
+
}
|
|
79
|
+
/** Step: what kind of site it is — the one required answer — typed, or picked from cards. */
|
|
80
|
+
export declare function KindStep({ answers, answer, tracker, errors, fieldRef }: StepProps): import("react").JSX.Element;
|
|
81
|
+
/** Step: who the site is for. Optional. */
|
|
82
|
+
export declare function AudienceStep({ answers, answer, tracker, errors, fieldRef }: StepProps): import("react").JSX.Element;
|
|
83
|
+
/**
|
|
84
|
+
* Step: the style, from cards that show it. "Pick for me" leaves the kind
|
|
85
|
+
* unset, which is what the single form's unpicked state was: the kind the
|
|
86
|
+
* first answer suggests is the one used, and the card says which.
|
|
87
|
+
*/
|
|
88
|
+
export declare function StyleStep({ answers, answer, tracker }: StepProps): import("react").JSX.Element;
|
|
89
|
+
/** Step: where leads go, how many pages, and on a paid plan the welcome email. */
|
|
90
|
+
export declare function DetailsStep({ answers, answer, tracker, errors, fieldRef, freeTaste, band, }: StepProps & {
|
|
91
|
+
freeTaste: boolean;
|
|
92
|
+
band: {
|
|
93
|
+
min: number;
|
|
94
|
+
max: number;
|
|
95
|
+
};
|
|
96
|
+
}): import("react").JSX.Element;
|
|
97
|
+
/** Step: every answer, each with Edit, before "Plan my site". */
|
|
98
|
+
export declare function ReviewStep({ answers, freeTaste, onEdit, children, }: {
|
|
99
|
+
answers: AiSiteStartAnswers;
|
|
100
|
+
freeTaste: boolean;
|
|
101
|
+
onEdit: (step: AiSiteStartStep) => void;
|
|
102
|
+
children?: ReactNode;
|
|
103
|
+
}): import("react").JSX.Element;
|
|
104
|
+
/** A step's help beside its heading. */
|
|
105
|
+
export declare function StepHelp({ step }: {
|
|
106
|
+
step: AiSiteStartStep;
|
|
107
|
+
}): import("react").JSX.Element;
|
|
108
|
+
export {};
|