@the-portland-company/shell 0.41.0 → 0.41.1

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme/tokens.generated.ts","../src/theme/colors.ts","../src/theme/components.ts","../src/theme/index.ts","../src/components/Card.tsx","../src/components/PageContainer.tsx","../src/components/PageHeader.tsx","../src/components/BreadcrumbBar.tsx","../src/components/HeaderTabBar.tsx","../src/providers/GlobalUiIdProvider.tsx","../src/theme-preference.ts","../src/theme/colorMode.tsx","../src/providers/ShellProvider.tsx","../src/hooks/useShellAuth.ts","../src/hooks/useAppRegistry.ts","../src/hooks/useShellOrganization.ts","../src/hooks/useShellLinkedAccounts.ts","../src/hooks/useShellSupport.ts","../src/hooks/useShellChrome.ts","../src/hooks/useShellMode.ts","../src/hooks/useShellNavItems.ts","../src/hooks/useShellNavigationPreference.ts","../src/hooks/useShellRole.ts","../src/hooks/useShellFooter.ts","../src/components/BrandLogo.tsx","../src/components/BrandIcon.tsx","../src/lib/orgColors.ts","../src/lib/userDisplay.ts","../src/sw/registerShellPrecache.ts","../src/speculation/emitRules.ts"],"names":["extendTheme","jsxs","jsx","clsx","Link","Tooltip","useLocation","useEffect","useColorMode","createContext","useState","useMemo","ChakraProvider","useContext"],"mappings":";;;;;;;;;;;;;;;AAKO,IAAM,SAAA,GAAY,EAAE,EAAA,EAAI,SAAA,EAAW,KAAK,SAAA,EAAW,GAAA,EAAK,WAAW,GAAA,EAAK,SAAA,EAAW,KAAK,SAAA,EAAW,GAAA,EAAK,WAAW,GAAA,EAAK,SAAA,EAAW,KAAK,SAAA,EAAW,GAAA,EAAK,SAAA,EAAW,GAAA,EAAK,SAAA,EAAU;;;ACClL,IAAM,MAAA,GAAS;AAAA;AAAA,EAEpB,KAAA,EAAO,EAAE,GAAG,SAAA,EAAU;AAAA;AAAA,EAGtB,QAAA,EAAU;AAAA;AAAA,IAER,IAAA,EAAM;AAAA,M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AG,CAAA;AAAA,EAC9D;AACF;;;ACjBO,SAAS,qBAAA,CACd,YACA,QAAA,EACe;AACf,EAAA,MAAM,SAAS,QAAA,CAAS,MAAA;AAAA,IACtB,CAAC,KAAA,KAAU,KAAA,CAAM,EAAA,KAAO,UAAA,IAAc,MAAM,OAAA,KAAY;AAAA,GAC1D;AACA,EAAA,IAAI,MAAA,CAAO,MAAA,KAAW,CAAA,EAAG,OAAO,IAAA;AAChC,EAAA,MAAM,OAAA,GAAU;AAAA,IACd,SAAA,EAAW;AAAA,MACT;AAAA,QACE,MAAM,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,KAAU,MAAM,IAAI,CAAA;AAAA,QACtC,SAAA,EAAW;AAAA;AACb;AACF,GACF;AACA,EAAA,OAAO,IAAA,CAAK,UAAU,OAAO,CAAA;AAC/B","file":"index.cjs","sourcesContent":["// GENERATED by scripts/gen-tokens.mjs from Specs (/api/tokens). DO NOT EDIT.\n// The Chakra theme imports these so its colors derive from the same source\n// of truth (Admin Brand API → Specs) as chrome.css.\n// brandRamp = Specs colors.raceRed (primary brand), not shellChrome.brandRamp.\n\nexport const brandRamp = { 50: '#FDECEE', 100: '#FCE0E3', 200: '#F8B6BD', 300: '#EF6671', 400: '#EA4751', 500: '#E63946', 600: '#C42E3A', 700: '#9F252E', 800: '#660F17', 900: '#39080D' } as const;\nexport const grayRamp = { 50: '#F7FAFC', 100: '#EDF2F7', 200: '#E2E8F0', 300: '#CBD5E0', 400: '#A0AEC0', 500: '#718096', 600: '#4A5568', 700: '#2D3748', 800: '#1A202C', 900: '#171923' } as const;\nexport const buttonPrimaryBg = '#E63946';\nexport const buttonPrimaryBgHover = '#C42E3A';\nexport const fieldFocus = '#E63946';\n","// Theme color definitions for light and dark modes.\n// The primary brand ramp is GENERATED from Specs (the styling source of truth)\n// so the Chakra theme stays in lockstep with chrome.css — edit it in Admin →\n// sync to Specs → `npm run gen:tokens`, never hand-edit the ramp here.\nimport { brandRamp } from './tokens.generated';\n\nexport const colors = {\n // Primary brand = Specs race-red (#E63946 ramp). Generated via gen:tokens.\n brand: { ...brandRamp },\n\n // Politogy Brand Colors\n politogy: {\n // Legacy Blue - kept for reference\n blue: {\n 50: '#e8f4fd',\n 100: '#bee3f8',\n 200: '#90cdf4',\n 300: '#63b3ed',\n 400: '#4299e1',\n 500: '#3182ce',\n 600: '#2b6cb0',\n 700: '#2c5282',\n 800: '#2a4365',\n 900: '#1a365d',\n },\n // Race-red (Specs primary brand). Same ramp as `brand`.\n red: { ...brandRamp },\n // Navy - Professional & Authoritative\n navy: {\n 50: '#e8eef6',\n 100: '#c5d4e8',\n 200: '#9fb8d9',\n 300: '#789cca',\n 400: '#5b86be',\n 500: '#3e70b2',\n 600: '#325a8e',\n 700: '#26446a',\n 800: '#1a2e47',\n 900: '#0e1823',\n },\n // White & Off-white\n white: '#ffffff',\n offWhite: '#f8fafc',\n // Text colors\n text: {\n primary: '#1a202c',\n secondary: '#4a5568',\n muted: '#718096',\n light: '#a0aec0',\n },\n },\n\n // Semantic color tokens that will switch based on color mode\n gray: {\n 50: '#f7fafc',\n 100: '#edf2f7',\n 200: '#e2e8f0',\n 300: '#cbd5e0',\n 400: '#a0aec0',\n 500: '#718096',\n 600: '#4a5568',\n 700: '#2d3748',\n 800: '#1a202c',\n 900: '#171923',\n },\n\n // The neutral-black dark ramp from Reference/Global-Rules → Dark Mode. Every\n // value is hue-free (R = G = B); layering is expressed by lightness only.\n //\n // The `gray` ramp above is Chakra's, which is BLUE-TINTED (#2d3748, #1a202c,\n // #171923). Every dark value in the theme used to point into it, so dark mode\n // rendered navy against the black chrome — the single most common way dark\n // mode drifts off-brand, and explicitly called out in the spec. Dark values\n // resolve here instead.\n neutral: {\n page: '#0A0A0A',\n surface: '#161616',\n raised: '#1F1F1F',\n raised2: '#212121',\n hover: '#2B2B2B',\n border: '#333333',\n borderStrong: '#404040',\n textMuted: '#A3A3A3',\n textDim: '#8A8A8A',\n text: '#E8E8E8',\n textStrong: '#F5F5F5',\n },\n};\n\n// Semantic tokens for automatic color mode switching\nexport const semanticTokens = {\n colors: {\n // Every _dark value resolves to the NEUTRAL ramp (colors.neutral), never to\n // Chakra's blue-tinted `gray` scale. See the note on `neutral` above.\n\n // Text colors\n 'text.primary': { default: 'gray.900', _dark: 'neutral.text' },\n 'text.secondary': { default: 'gray.600', _dark: 'neutral.textMuted' },\n 'text.muted': { default: 'gray.500', _dark: 'neutral.textDim' },\n\n // Background colors\n 'bg.primary': { default: 'white', _dark: 'neutral.surface' },\n 'bg.secondary': { default: 'gray.50', _dark: 'neutral.page' },\n 'bg.surface': { default: 'white', _dark: 'neutral.raised' },\n 'bg.hover': { default: 'gray.50', _dark: 'neutral.hover' },\n\n // Border colors\n 'border.default': { default: 'gray.200', _dark: 'neutral.border' },\n 'border.muted': { default: 'gray.100', _dark: 'neutral.border' },\n\n // Component specific\n 'heading.fg': { default: 'politogy.navy.800', _dark: 'neutral.textStrong' },\n 'card.bg': { default: 'white', _dark: 'neutral.surface' },\n 'card.border': { default: 'gray.200', _dark: 'neutral.border' },\n 'input.bg': { default: 'white', _dark: 'neutral.raised' },\n 'input.border': { default: 'gray.200', _dark: 'neutral.border' },\n 'input.hover': { default: 'gray.400', _dark: 'neutral.borderStrong' },\n\n // Navigation\n 'nav.bg': { default: 'white', _dark: 'neutral.surface' },\n 'nav.border': { default: 'gray.200', _dark: 'neutral.border' },\n\n // Sidebar\n 'sidebar.bg': { default: 'gray.50', _dark: 'neutral.surface' },\n 'sidebar.hover': { default: 'gray.100', _dark: 'neutral.hover' },\n 'sidebar.active': { default: 'brand.50', _dark: 'brand.900' },\n\n // Status surfaces. In dark mode these become neutral raised surfaces — the\n // meaning is carried by the icon/text accent, not by a pale tint that would\n // glare against black (and would break the hue-free surface rule).\n 'success.bg': { default: 'green.50', _dark: 'neutral.raised' },\n 'error.bg': { default: 'red.50', _dark: 'neutral.raised' },\n 'warning.bg': { default: 'yellow.50', _dark: 'neutral.raised' },\n 'info.bg': { default: 'blue.50', _dark: 'neutral.raised' },\n\n // ---------------------------------------------------------------------\n // Raw palette remap — the high-leverage half of the dark-mode fix.\n //\n // The app carries ~650 hardcoded Chakra literals (`bg=\"gray.50\"`,\n // `borderColor=\"gray.200\"`, `color=\"gray.600\"`, ...) that no semantic token\n // can reach. Making the SCALE ITSELF color-mode-aware fixes them all at\n // once, centrally, with no app edits.\n //\n // The mapping INVERTS: in dark mode a low number (used as a pale surface)\n // becomes a dark surface, and a high number (used as dark text) becomes\n // light text. That is what makes one remap correct for both background and\n // foreground usage.\n 'gray.50': { default: '#f7fafc', _dark: 'neutral.raised' },\n 'gray.100': { default: '#edf2f7', _dark: 'neutral.raised2' },\n 'gray.200': { default: '#e2e8f0', _dark: 'neutral.border' },\n 'gray.300': { default: '#cbd5e0', _dark: 'neutral.borderStrong' },\n 'gray.400': { default: '#a0aec0', _dark: '#6B6B6B' },\n 'gray.500': { default: '#718096', _dark: 'neutral.textDim' },\n 'gray.600': { default: '#4a5568', _dark: 'neutral.textMuted' },\n 'gray.700': { default: '#2d3748', _dark: '#C6C6C6' },\n 'gray.800': { default: '#1a202c', _dark: 'neutral.text' },\n 'gray.900': { default: '#171923', _dark: 'neutral.textStrong' },\n\n // Pale status tints used directly as card/callout surfaces. Same reasoning\n // as the *.bg tokens above.\n 'blue.50': { default: '#ebf8ff', _dark: 'neutral.raised' },\n 'green.50': { default: '#f0fff4', _dark: 'neutral.raised' },\n 'red.50': { default: '#fff5f5', _dark: 'neutral.raised' },\n 'yellow.50': { default: '#fffff0', _dark: 'neutral.raised' },\n 'orange.50': { default: '#fffaf0', _dark: 'neutral.raised' },\n\n // Dark status TEXT. The deep shades are picked for contrast against a pale\n // tint; against a #1F1F1F surface they are unreadable — measured on the live\n // info alert, whose description rendered #2c5282 (blue.700) on near-black.\n // In dark mode they lighten to the 200/300 band so the hue still reads as\n // informational/success/error without losing legibility.\n 'blue.600': { default: '#2b6cb0', _dark: '#7CC0F5' },\n 'blue.700': { default: '#2c5282', _dark: '#9AD1F8' },\n 'blue.800': { default: '#2a4365', _dark: '#BFE3FB' },\n 'green.600': { default: '#38a169', _dark: '#68D391' },\n 'green.700': { default: '#2f855a', _dark: '#8EE0AE' },\n 'green.800': { default: '#276749', _dark: '#B6ECCB' },\n 'red.600': { default: '#e53e3e', _dark: '#FC8181' },\n 'red.700': { default: '#c53030', _dark: '#FEA8A8' },\n 'red.800': { default: '#9b2c2c', _dark: '#FECACA' },\n 'orange.600': { default: '#dd6b20', _dark: '#F6AD55' },\n 'orange.700': { default: '#c05621', _dark: '#FBC98A' },\n 'orange.800': { default: '#9c4221', _dark: '#FDDCB4' },\n 'yellow.600': { default: '#d69e2e', _dark: '#ECC94B' },\n 'yellow.700': { default: '#b7791f', _dark: '#F3DC85' },\n 'yellow.800': { default: '#975a16', _dark: '#F8EAB4' },\n },\n};\n","// Component style overrides for theme using Politogy brand colors\nexport const components = {\n Button: {\n baseStyle: {\n fontWeight: 'medium',\n },\n defaultProps: {\n colorScheme: 'brand',\n },\n variants: {\n primary: {\n bg: 'brand.500',\n color: 'white',\n _hover: {\n bg: 'brand.600',\n _disabled: {\n bg: 'brand.500',\n },\n },\n _active: {\n bg: 'brand.700',\n },\n },\n secondary: {\n borderWidth: '1px',\n borderColor: 'gray.300',\n // `card.bg`, not a raw `white` — a literal white here rendered a light\n // pill on the black page in dark mode. (`gray.*` is color-mode-aware via\n // the semanticTokens remap, so those are already safe.)\n bg: 'card.bg',\n color: 'gray.700',\n _hover: {\n bg: 'gray.50',\n },\n },\n solid: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n // For brand colorScheme, use explicit colors\n if (c === 'brand') {\n return {\n bg: 'brand.500',\n color: 'white',\n _hover: {\n bg: 'brand.600',\n _disabled: {\n bg: 'brand.500',\n },\n },\n _active: {\n bg: 'brand.700',\n },\n };\n }\n // For other colorSchemes, use standard pattern with explicit bg and white text\n return {\n bg: `${c}.500`,\n color: 'white',\n _hover: {\n bg: `${c}.600`,\n _disabled: {\n bg: `${c}.500`,\n },\n },\n _active: {\n bg: `${c}.700`,\n },\n };\n },\n ghost: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n return {\n color: `${c}.600`,\n _hover: {\n bg: `${c}.50`,\n },\n };\n },\n outline: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n return {\n borderColor: `${c}.500`,\n color: `${c}.600`,\n _hover: {\n bg: `${c}.50`,\n },\n };\n },\n link: {\n color: 'brand.500',\n _hover: {\n color: 'brand.600',\n textDecoration: 'underline',\n },\n },\n },\n },\n\n Heading: {\n baseStyle: {\n // Was a hard `politogy.navy.800` (#1a2e47) — near-invisible against the\n // black page in dark mode, and off-brand navy besides. Every heading in\n // every app went through this one style.\n color: 'heading.fg',\n fontWeight: 'semibold',\n },\n },\n\n Card: {\n baseStyle: {\n container: {\n bg: 'card.bg',\n borderWidth: '1px',\n borderColor: 'card.border',\n borderRadius: 'lg',\n },\n },\n },\n\n Input: {\n baseStyle: {\n field: {\n bg: 'input.bg',\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n field: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n },\n\n NumberInput: {\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n field: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n },\n\n Select: {\n baseStyle: {\n field: {\n bg: 'input.bg',\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n field: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n },\n\n Textarea: {\n baseStyle: {\n bg: 'input.bg',\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n\n Menu: {\n baseStyle: {\n list: {\n bg: 'bg.surface',\n borderColor: 'var(--mode-input-border-color)',\n boxShadow: 'lg',\n },\n item: {\n bg: 'transparent',\n _hover: {\n bg: 'bg.hover',\n },\n _focus: {\n bg: 'bg.hover',\n },\n },\n },\n },\n\n Modal: {\n baseStyle: {\n dialog: {\n bg: 'bg.surface',\n },\n overlay: {\n bg: 'blackAlpha.600',\n },\n },\n },\n\n Popover: {\n baseStyle: {\n content: {\n bg: 'bg.surface',\n borderColor: 'border.default',\n boxShadow: 'lg',\n },\n },\n },\n\n Drawer: {\n baseStyle: {\n dialog: {\n bg: 'bg.surface',\n },\n overlay: {\n bg: 'blackAlpha.600',\n },\n },\n },\n\n Tabs: {\n baseStyle: {\n root: {\n width: '100%',\n },\n tablist: {\n width: '100%',\n alignItems: 'flex-end',\n gap: 'var(--app-tab-gap)',\n },\n tabpanels: {\n width: '100%',\n },\n tabpanel: {\n width: '100%',\n },\n tab: {\n minHeight: 'var(--app-tab-height)',\n height: 'var(--app-tab-height)',\n lineHeight: 1,\n borderTopLeftRadius: 'var(--app-tab-radius)',\n borderTopRightRadius: 'var(--app-tab-radius)',\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n color: 'text.secondary',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n borderColor: 'brand.500',\n fontWeight: 'semibold',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n },\n variants: {\n enclosed: {\n tab: {\n color: 'gray.600',\n bg: 'transparent',\n borderColor: 'gray.200',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n borderColor: 'brand.500',\n borderBottomColor: 'brand.500',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n },\n 'enclosed-colored': {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n },\n },\n },\n 'soft-rounded': {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n },\n },\n },\n 'solid-rounded': {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n },\n },\n },\n line: {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n borderColor: 'brand.500',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n },\n unstyled: {\n tab: {\n // Allow inline styles to take precedence for unstyled variant\n },\n },\n },\n defaultProps: {\n colorScheme: 'brand',\n },\n },\n\n Badge: {\n baseStyle: {\n borderRadius: 'md',\n px: 2,\n py: 1,\n fontWeight: 'medium',\n },\n defaultProps: {\n colorScheme: 'brand',\n },\n },\n\n Link: {\n baseStyle: {\n color: 'brand.500',\n _hover: {\n color: 'brand.600',\n textDecoration: 'underline',\n },\n },\n },\n\n // Reference/UI-Platform: every top-bar control and every panel it opens share\n // ONE surface treatment — one definition of background, border, blur and\n // radius, not a per-component re-style. Chakra's stock Tooltip INVERTS\n // (dark text surface in light mode, LIGHT surface in dark mode), so in dark\n // mode every `div#tooltip-*` rendered a near-white #E8E8E8 slab against the\n // black chrome — measured on 15 of 29 pages, including inside the\n // Communications Fuel panel. Pin it to the shared panel surface instead, so a\n // Chakra tooltip and the native chrome's TopBarTooltip look identical.\n Tooltip: {\n baseStyle: {\n bg: 'var(--panel-elevated, #1F1F1F)',\n color: 'var(--foreground, #E8E8E8)',\n border: '1px solid',\n borderColor: 'var(--line, #333333)',\n borderRadius: 'var(--radius-lg, 0.5rem)',\n boxShadow: 'var(--shadow-soft)',\n fontSize: '12px',\n paddingX: 3,\n paddingY: 2,\n // Chakra draws the arrow with its own bg var; keep it on the same surface\n // so the pointer never reads as a different colour than the bubble.\n '--popper-arrow-bg': 'var(--panel-elevated, #1F1F1F)',\n },\n },\n\n Alert: {\n baseStyle: {\n container: {\n borderRadius: 'md',\n },\n },\n variants: {\n subtle: (props: { colorScheme: string; colorMode?: string }) => {\n const { colorScheme: c, colorMode } = props;\n // In DARK mode a \"subtle\" alert must not paint a pale tint: Chakra's\n // default resolves `<scheme>.200` for both the surface AND the icon, so\n // an error alert rendered a near-white pink (#FEB2B2 — measured live on\n // app) against the black page. Global-Rules → Dark Mode: every dark\n // surface is hue-free; meaning is carried by the icon/text accent, not\n // by the fill. Reds also reconcile to brand #E63946, not Chakra #E53E3E.\n if (colorMode === 'dark') {\n const accent =\n c === 'blue' || c === 'info'\n ? '#7CC0F5'\n : c === 'green' || c === 'success'\n ? '#68D391'\n : c === 'orange' || c === 'yellow' || c === 'warning'\n ? '#F6AD55'\n : 'var(--color-race-red-300, #EF6671)';\n return {\n container: { bg: 'neutral.raised', borderLeftColor: accent },\n icon: { color: accent },\n title: { color: 'neutral.text' },\n description: { color: 'neutral.textMuted' },\n };\n }\n // Keep info alerts blue\n if (c === 'blue' || c === 'info') {\n return {\n container: {\n bg: 'blue.50',\n },\n icon: {\n color: 'blue.500',\n },\n title: {\n color: 'blue.800',\n },\n description: {\n color: 'blue.700',\n },\n };\n }\n return {};\n },\n 'left-accent': (props: { colorScheme: string; colorMode?: string }) => {\n const { colorScheme: c, colorMode } = props;\n if (colorMode === 'dark') {\n const accent =\n c === 'blue' || c === 'info'\n ? '#7CC0F5'\n : c === 'green' || c === 'success'\n ? '#68D391'\n : c === 'orange' || c === 'yellow' || c === 'warning'\n ? '#F6AD55'\n : 'var(--color-race-red-300, #EF6671)';\n return {\n container: { bg: 'neutral.raised', borderLeftColor: accent },\n icon: { color: accent },\n title: { color: 'neutral.text' },\n description: { color: 'neutral.textMuted' },\n };\n }\n if (c === 'blue' || c === 'info') {\n return {\n container: {\n bg: 'blue.50',\n borderLeftColor: 'blue.500',\n },\n icon: {\n color: 'blue.500',\n },\n };\n }\n return {};\n },\n solid: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n if (c === 'blue' || c === 'info') {\n return {\n container: {\n bg: 'blue.500',\n color: 'white',\n },\n };\n }\n return {};\n },\n },\n },\n\n Table: {\n baseStyle: {\n table: {\n width: '100%',\n borderCollapse: 'collapse',\n borderSpacing: '0',\n borderColor: 'gray.200',\n },\n th: {\n borderColor: 'gray.200',\n borderBottom: 'none',\n bg: 'gray.200',\n color: 'text.secondary',\n fontWeight: 'semibold',\n px: 3,\n py: 2.5,\n minHeight: '44px',\n height: '44px',\n verticalAlign: 'middle',\n },\n td: {\n borderColor: 'gray.200',\n borderBottom: 'none',\n px: 3,\n py: 2.5,\n minHeight: '44px',\n height: '44px',\n verticalAlign: 'middle',\n },\n tr: {\n borderBottom: 'none',\n borderColor: 'transparent',\n _odd: {\n bg: 'card.bg',\n },\n _even: {\n bg: 'gray.50',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n tbody: {\n tr: {\n _odd: {\n bg: 'card.bg',\n },\n _even: {\n bg: 'gray.50',\n },\n _hover: {\n bg: 'blue.100',\n },\n },\n },\n },\n variants: {\n simple: {},\n striped: {},\n },\n defaultProps: {\n variant: 'striped',\n },\n },\n\n Divider: {\n baseStyle: {\n borderColor: 'border.default',\n },\n },\n};\n","import { extendTheme } from '@chakra-ui/react';\nimport { colors, semanticTokens } from './colors';\nimport { components } from './components';\n\n// Define the theme configuration\n// Chakra's color mode is driven by `politogyColorModeManager` (theme/colorMode),\n// which reads the resolved universal Politogy theme. These values are only the\n// pre-manager default; `useSystemColorMode` stays false on purpose, because the\n// OS scheme is consulted by `resolveTheme('system')` — letting Chakra ALSO watch\n// the media query would give it a second, competing opinion, which is exactly\n// the desync this manager exists to remove.\nconst config = {\n initialColorMode: 'light',\n useSystemColorMode: false,\n};\n\n// Global styles\nconst styles = {\n global: () => ({\n // Body surface comes from the chrome aliases that chrome.css emits in light\n // AND neutral-black dark, so the page follows `.dark` instead of forcing\n // white underneath dark chrome. Chakra's global styles beat app CSS, so\n // hardcoding `white`/`gray.900` here made every app light-only from the\n // inside no matter what the tokens said (Reference/Global-Rules → Dark Mode:\n // the neutral-black rule binds the entire app UI, not just the chrome).\n body: {\n bg: 'var(--color-bg, white)',\n color: 'var(--color-text, #1a202c)',\n },\n ':root': {\n '--mode-primary-color': 'var(--app-color-brand-500)',\n '--mode-input-border-color': 'var(--app-color-brand-500)',\n '--mode-input-hover-border-color': 'var(--app-color-brand-600)',\n '--mode-input-focus-shadow-color': 'var(--app-color-brand-500)',\n },\n // Ensure non-Chakra/native text-like inputs follow mode border colors as well.\n 'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"file\"]):not([type=\"color\"]), textarea, select':\n {\n borderColor: 'var(--mode-input-border-color)',\n },\n 'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"file\"]):not([type=\"color\"]):hover, textarea:hover, select:hover':\n {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n 'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"file\"]):not([type=\"color\"]):focus, textarea:focus, select:focus':\n {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n }),\n};\n\n// Fonts — Brand-token driven, exactly like color.\n//\n// These were hardcoded to the system stack, and because Chakra's global styles\n// beat app CSS, VRM rendered in -apple-system while every app on the native\n// chrome rendered the Brand family. A font change is supposed to ship from the\n// Brand editor without a redeploy, so heading/body resolve `--font-family` (and\n// mono resolves the shared mono token) with the old stacks as the pre-tokens\n// fallback only (Reference/UI-Platform → Typography; HITL 2026-07-23).\nconst SYSTEM_SANS =\n 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif'\nconst SYSTEM_MONO =\n 'SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace'\n\nconst fonts = {\n heading: `var(--font-family, ${SYSTEM_SANS})`,\n body: `var(--font-family, ${SYSTEM_SANS})`,\n mono: `var(--type-mono-family, ${SYSTEM_MONO})`,\n};\n\n// Create and export the theme\nexport const politogyTheme = extendTheme({\n config,\n colors,\n semanticTokens,\n components,\n styles,\n fonts,\n\n // Additional theme configurations\n shadows: {\n outline: '0 0 0 3px var(--app-color-brand-500)',\n },\n\n radii: {\n none: '0',\n sm: '0.125rem',\n base: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n xl: '0.75rem',\n '2xl': '1rem',\n '3xl': '1.5rem',\n full: '9999px',\n },\n});\n\nexport { politogyTheme as default };\n","import type { CSSProperties, ReactNode } from 'react';\ntype CardProps = {\n title?: string;\n children: ReactNode;\n minH?: string | number;\n className?: string;\n style?: CSSProperties;\n [key: string]: unknown;\n};\n\nexport default function Card({\n title,\n children,\n minH,\n className,\n style,\n ...props\n}: CardProps) {\n return (\n <div\n className={`rounded-lg border border-slate-200 bg-white p-6 shadow-sm ${className || ''}`}\n style={{ minHeight: minH, ...style }}\n {...props}\n >\n {title && <h3 className=\"mb-4 text-lg font-semibold\">{title}</h3>}\n {children}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\n\ntype PageContainerProps = {\n children: ReactNode;\n maxW?: string;\n px?: number | string;\n py?: number | string;\n lockHeight?: boolean;\n};\n\nexport default function PageContainer({\n children,\n maxW = 'container.xl',\n px,\n py,\n lockHeight = true,\n}: PageContainerProps) {\n const isFullWidth = maxW === 'full';\n const effectivePx = isFullWidth ? 0 : px === undefined ? 4 : Number(px);\n const effectivePy = py === undefined ? (isFullWidth ? 0 : 4) : py;\n const pxValue = String(effectivePx);\n const pyValue = String(effectivePy);\n\n const maxWClass = isFullWidth\n ? 'max-w-none'\n : maxW === 'container.xl'\n ? 'max-w-7xl'\n : maxW === 'container.lg'\n ? 'max-w-6xl'\n : maxW === 'container.md'\n ? 'max-w-5xl'\n : typeof maxW === 'string' && /^(\\d+)px$/.test(maxW)\n ? ''\n : 'max-w-7xl';\n\n const pxClass =\n pxValue === '0'\n ? 'px-0'\n : pxValue === '1'\n ? 'px-1'\n : pxValue === '2'\n ? 'px-2'\n : pxValue === '3'\n ? 'px-3'\n : pxValue === '4'\n ? 'px-4'\n : 'px-4';\n\n const pyClass =\n pyValue === '0'\n ? 'py-0'\n : pyValue === '4'\n ? 'py-4'\n : pyValue === '5'\n ? 'py-5'\n : pyValue === '6'\n ? 'py-6'\n : 'py-6';\n\n const inlineMaxWStyle =\n typeof maxW === 'string' && /^(\\d+)px$/.test(maxW) ? { maxWidth: maxW } : undefined;\n\n return (\n <main\n className={lockHeight ? 'h-[calc(100vh-80px)] min-h-[calc(100vh-80px)]' : ''}\n style={{ background: 'var(--app-tab-content-bg)' }}\n >\n <div\n className={clsx(\n 'mx-auto w-full',\n maxWClass,\n pxClass,\n pyClass,\n lockHeight ? 'h-full' : 'h-auto'\n )}\n style={inlineMaxWStyle}\n >\n {children}\n </div>\n </main>\n );\n}\n","import { Link } from 'react-router-dom';\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\ntype BreadcrumbItem = {\n label: string;\n href?: string;\n};\n\ntype PageHeaderProps = {\n title?: ReactNode;\n breadcrumbs?: BreadcrumbItem[];\n actions?: ReactNode;\n tabBar?: ReactNode;\n maxW?: string;\n hideSidebar?: boolean;\n};\n\nconst resolveMaxWidthClass = (maxW: string) => {\n if (maxW === 'full') return 'max-w-none';\n if (maxW === 'container.lg') return 'max-w-6xl';\n if (maxW === 'container.md') return 'max-w-5xl';\n return 'max-w-7xl';\n};\n\nexport default function PageHeader({\n title,\n breadcrumbs = [],\n actions = null,\n tabBar = null,\n maxW = 'full',\n hideSidebar = false,\n}: PageHeaderProps) {\n const maxWClass = resolveMaxWidthClass(maxW);\n const titleText = typeof title === 'string' ? title.trim() : '';\n const normalizedTitle = titleText.toLowerCase();\n const breadcrumbsWithoutCurrent = [...breadcrumbs];\n const last = breadcrumbsWithoutCurrent[breadcrumbsWithoutCurrent.length - 1];\n // Only remove a trailing breadcrumb that duplicates the page title when there's\n // still at least one breadcrumb left to show.\n if (\n breadcrumbsWithoutCurrent.length > 1 &&\n normalizedTitle &&\n last &&\n last.label.trim().toLowerCase() === normalizedTitle\n ) {\n breadcrumbsWithoutCurrent.pop();\n }\n\n // Avoid rendering an empty header bar (no title, no breadcrumbs, no actions, no tabs).\n if (!title && breadcrumbsWithoutCurrent.length === 0 && !actions && !tabBar) {\n return null;\n }\n\n return (\n <div\n style={{ backgroundColor: 'var(--app-tab-header-bg, #888888)' }}\n className={clsx('text-slate-100', tabBar ? 'pt-3 pb-0' : 'py-3 border-b border-gray-200', {\n 'md:ml-60': !hideSidebar,\n })}\n >\n <div className={clsx('w-full px-4', maxWClass)}>\n <div className=\"flex w-full flex-nowrap items-start justify-between gap-4\">\n <div className=\"min-w-0 flex-1\">\n {title ? (\n <div className=\"min-w-0\">\n <div className=\"truncate text-lg font-semibold text-white\">{title}</div>\n </div>\n ) : null}\n {breadcrumbsWithoutCurrent.length > 0 ? (\n <nav\n aria-label=\"Breadcrumb\"\n className={clsx('min-w-0 text-slate-100', title ? 'mt-1' : '')}\n >\n <ol className=\"flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600\">\n {breadcrumbsWithoutCurrent.map((item, index) => (\n <li\n key={`${item.label}-${index}`}\n className=\"flex min-w-0 flex-shrink-0 items-center gap-2\"\n >\n {index > 0 ? <span className=\"text-gray-400\">&gt;</span> : null}\n {item.href ? (\n <Link to={item.href} className=\"truncate text-slate-100 hover:underline\">\n {item.label}\n </Link>\n ) : (\n <span className=\"truncate text-slate-100\">{item.label}</span>\n )}\n </li>\n ))}\n </ol>\n </nav>\n ) : null}\n </div>\n {actions ? <div className=\"flex-shrink-0\">{actions}</div> : null}\n </div>\n </div>\n {tabBar ? (\n <div className=\"m-0 w-full px-0\" style={{ backgroundColor: 'transparent' }}>\n {tabBar}\n </div>\n ) : null}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Link } from 'react-router-dom';\nimport clsx from 'clsx';\n\ntype BreadcrumbItem = {\n label: string;\n href?: string;\n};\n\ntype BreadcrumbBarProps = {\n breadcrumbs?: BreadcrumbItem[];\n actions?: ReactNode;\n maxW?: string;\n};\n\nexport default function BreadcrumbBar({\n breadcrumbs = [],\n actions = null,\n maxW = 'full',\n}: BreadcrumbBarProps) {\n if ((!breadcrumbs || breadcrumbs.length === 0) && !actions) {\n return null;\n }\n\n const maxWClass =\n maxW === 'full'\n ? 'max-w-none'\n : maxW === 'container.xl'\n ? 'max-w-7xl'\n : maxW === 'container.lg'\n ? 'max-w-6xl'\n : maxW === 'container.md'\n ? 'max-w-5xl'\n : 'max-w-7xl';\n\n return (\n <div\n className=\"ml-0 border-b border-gray-200 px-4 py-3 md:ml-60\"\n style={{ backgroundColor: 'var(--app-tab-header-bg, #888888)' }}\n >\n <div className={clsx('mx-auto w-full px-0', maxWClass)}>\n <div className=\"flex w-full items-center justify-between\">\n {breadcrumbs && breadcrumbs.length > 0 && (\n <nav aria-label=\"Breadcrumb\">\n <ol className=\"flex items-center gap-2 text-sm text-slate-100\">\n {breadcrumbs.map((item, index) => (\n <li key={index} className=\"flex items-center gap-2\">\n {index > 0 ? <span className=\"text-gray-400\">&gt;</span> : null}\n {item.href ? (\n <Link to={item.href} className=\"text-slate-100 hover:underline\">\n {item.label}\n </Link>\n ) : (\n <span className=\"text-slate-100\">{item.label}</span>\n )}\n </li>\n ))}\n </ol>\n </nav>\n )}\n {actions && <div>{actions}</div>}\n </div>\n </div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { Tooltip } from '@chakra-ui/react';\n\nexport type HeaderTabBarItem = {\n id: string;\n label: string;\n icon: ReactNode;\n disabled?: boolean;\n};\n\ntype HeaderTabBarProps = {\n items: HeaderTabBarItem[];\n activeId: string;\n onChange: (id: string) => void;\n className?: string;\n ariaLabel?: string;\n};\n\nexport default function HeaderTabBar({\n items,\n activeId,\n onChange,\n className,\n ariaLabel = 'Tabs',\n}: HeaderTabBarProps) {\n return (\n <div\n role=\"tablist\"\n aria-label={ariaLabel}\n className={clsx(\n // Header-wide tab strip: background + bottom border only (no outer box).\n 'app-header-tab-bar m-0 flex w-full bg-slate-100 p-0',\n 'border-b border-slate-200',\n className\n )}\n >\n {items.map((item, idx) => {\n const isActive = item.id === activeId;\n const isDisabled = Boolean(item.disabled);\n return (\n <Tooltip\n key={item.id}\n label={item.label}\n placement=\"top\"\n hasArrow\n bg=\"black\"\n color=\"white\"\n isDisabled={isDisabled}\n >\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-label={item.label}\n disabled={isDisabled}\n onClick={() => onChange(item.id)}\n className={clsx(\n 'app-header-tab-button relative inline-flex flex-1 items-center justify-center',\n 'transition-colors',\n 'rounded-none',\n idx === 0 ? 'rounded-tl-lg' : null,\n idx === items.length - 1 ? 'rounded-tr-lg' : null,\n isActive\n ? 'text-white'\n : 'bg-transparent text-slate-600 hover:bg-white/60 hover:text-slate-900',\n isDisabled ? 'cursor-not-allowed opacity-50' : null\n )}\n style={{\n background: isActive\n ? 'var(--mode-primary-color, var(--app-btn-primary-bg))'\n : undefined,\n }}\n >\n <span className=\"inline-flex items-center justify-center text-[14px] leading-none\">\n {item.icon}\n </span>\n </button>\n </Tooltip>\n );\n })}\n </div>\n );\n}\n","import { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\n// Inlined feature-flag check (originally in react/app/src/utils/runtimeFeatureFlags.ts).\n// The shell package is self-contained; keeping this helper local avoids a\n// cross-app import while preserving identical runtime behavior.\nconst FLAG_PREFIX = ['__', 'politogy', 'enable'].join('');\nconst GLOBAL_UI_IDS_FLAG = [FLAG_PREFIX, 'global', 'ui', 'ids'].join('_');\n\nfunction isFlagEnabled(name: string): boolean {\n if (typeof window === 'undefined') return false;\n\n try {\n const params = new URLSearchParams(window.location.search);\n if (params.get(name) === '1') return true;\n } catch {\n // Ignore malformed location access.\n }\n\n try {\n return window.localStorage.getItem(name) === '1';\n } catch {\n return false;\n }\n}\n\nfunction isGlobalUiIdsEnabled(): boolean {\n return isFlagEnabled(GLOBAL_UI_IDS_FLAG);\n}\n\nconst TARGET_SELECTOR = [\n 'main',\n 'header',\n 'footer',\n 'aside',\n 'nav',\n 'section',\n '[role=\"region\"]',\n '[role=\"banner\"]',\n '[role=\"main\"]',\n '[role=\"navigation\"]',\n '[role=\"complementary\"]',\n 'button',\n '[role=\"button\"]',\n 'a[role=\"button\"]',\n 'input',\n 'textarea',\n 'select',\n '[role=\"combobox\"]',\n '[role=\"listbox\"]',\n '[role=\"option\"]',\n '[role=\"textbox\"]',\n '[role=\"tablist\"]',\n '[role=\"tab\"]',\n '[role=\"tabpanel\"]',\n '[role=\"menu\"]',\n '[role=\"menuitem\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'svg',\n '[data-icon]',\n].join(',');\n\nfunction sanitizeToken(raw: string | null | undefined, fallback: string): string {\n if (!raw) return fallback;\n const cleaned = raw\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 40);\n return cleaned || fallback;\n}\n\nfunction pageToken(pathname: string): string {\n if (!pathname || pathname === '/') return 'home';\n return sanitizeToken(pathname.replace(/\\//g, '-'), 'page');\n}\n\nfunction inferCategory(el: Element): string {\n const role = (el.getAttribute('role') || '').toLowerCase();\n const tag = el.tagName.toLowerCase();\n\n if (role.includes('tab') || tag === 'tabs') return 'tabs';\n if (role.startsWith('menu') || role === 'menu') return 'menu';\n if (tag === 'button' || role === 'button') return 'button';\n if (tag === 'input' || tag === 'textarea' || tag === 'select' || role === 'combobox')\n return 'field';\n if (tag === 'svg' || el.hasAttribute('data-icon')) return 'icon';\n if (\n ['main', 'header', 'footer', 'aside', 'nav', 'section'].includes(tag) ||\n ['region', 'banner', 'main', 'navigation', 'complementary'].includes(role)\n ) {\n return 'layout';\n }\n\n return 'ui';\n}\n\nfunction inferName(el: Element): string {\n const htmlEl = el as HTMLElement;\n return sanitizeToken(\n el.getAttribute('data-testid') ||\n el.getAttribute('aria-label') ||\n el.getAttribute('name') ||\n el.getAttribute('title') ||\n (htmlEl as HTMLInputElement).placeholder ||\n htmlEl.innerText ||\n el.getAttribute('class'),\n 'item'\n );\n}\n\nfunction assignUiIds(pathname: string): void {\n const used = new Set<string>();\n document.querySelectorAll('[id]').forEach((el) => {\n const id = el.id?.trim();\n if (id) used.add(id);\n });\n\n const counters: Record<string, number> = {};\n const page = pageToken(pathname);\n const elements = document.querySelectorAll(TARGET_SELECTOR);\n\n elements.forEach((el) => {\n const category = inferCategory(el);\n const name = inferName(el);\n const stableKey = `ui-${category}-${name}`;\n\n el.setAttribute('data-ui-category', category);\n el.setAttribute('data-ui-key', stableKey);\n el.setAttribute('data-ui-page', page);\n\n if (el.id) {\n return;\n }\n\n const counterKey = `${page}-${category}-${name}`;\n counters[counterKey] = (counters[counterKey] || 0) + 1;\n\n let nextId = `ui-${page}-${category}-${name}-${counters[counterKey]}`;\n while (used.has(nextId)) {\n counters[counterKey] += 1;\n nextId = `ui-${page}-${category}-${name}-${counters[counterKey]}`;\n }\n\n el.id = nextId;\n used.add(nextId);\n });\n}\n\nexport default function GlobalUiIdProvider() {\n const location = useLocation();\n const enabled = isGlobalUiIdsEnabled();\n\n useEffect(() => {\n if (!enabled) return;\n\n let rafId = 0;\n\n const schedule = () => {\n if (rafId) return;\n rafId = window.requestAnimationFrame(() => {\n rafId = 0;\n assignUiIds(location.pathname);\n });\n };\n\n schedule();\n\n const observer = new MutationObserver(() => {\n schedule();\n });\n\n observer.observe(document.body, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['role', 'aria-label', 'name', 'title', 'placeholder', 'class', 'data-icon'],\n });\n\n return () => {\n if (rafId) window.cancelAnimationFrame(rafId);\n observer.disconnect();\n };\n }, [enabled, location.pathname]);\n\n return null;\n}\n","// Universal theme preference — the ONE cross-app contract.\n//\n// One theme choice (Light / Dark / System) follows the authenticated user\n// across every Politogy app + subdomain. Three layers cooperate:\n// 1. VRM Core `profiles.theme_preference` — source of truth, persisted via\n// the chrome API (`PATCH me/preferences { themePreference }`) and read\n// back from `GET me` (`themePreference`).\n// 2. `.politogyvrm.com` cookie `politogy_theme` — zero-flash pre-paint\n// vehicle that crosses subdomains (auth session cookies are host-only).\n// 3. localStorage `politogy_theme` — offline fallback store.\n//\n// Ported verbatim from contacts/apps/web/src/lib/theme.ts (the origin of the\n// contract) so every app runs the identical behavior from npm. This module is\n// server-safe (no 'use client'): layouts import THEME_PREPAINT_SCRIPT for the\n// pre-paint inline script. The client-side hook lives in ./native\n// (useThemePreference).\n\nexport type ThemePreference = 'light' | 'dark' | 'system'\n\n// Single converged key for BOTH the localStorage store and the\n// cross-subdomain cookie, so a choice in one app is the same key in the next.\nexport const THEME_STORAGE_KEY = 'politogy_theme'\nexport const THEME_COOKIE = 'politogy_theme'\n\n// A local choice that has NOT yet reached VRM Core `profiles.theme_preference`.\n//\n// Politogy ID (auth.politogyvrm.com) has no chrome-API session to PATCH, so a\n// theme picked on the login screen only ever lands in the cookie. Without this\n// marker the next app booted the stale profile value through the reconcile step\n// below and overwrote the user's fresh choice — the \"I set System and it keeps\n// going back to Light\" bug (HITL 2026-07-23). The flag rides the same\n// cross-subdomain cookie so the first app that CAN talk to the chrome API\n// pushes the choice up instead of pulling the stale one down.\nexport const THEME_PENDING_COOKIE = 'politogy_theme_pending'\n\nconst VALID: readonly ThemePreference[] = ['light', 'dark', 'system']\n\nexport function isThemePreference(v: unknown): v is ThemePreference {\n return typeof v === 'string' && (VALID as readonly string[]).includes(v)\n}\n\n/** Read the shared cookie (browser only; null on the server or when unset). */\nexport function readThemeCookie(): ThemePreference | null {\n if (typeof document === 'undefined') return null\n try {\n const m = document.cookie.match(\n new RegExp(`(?:^|;\\\\s*)${THEME_COOKIE}=([^;]+)`),\n )\n const v = m ? decodeURIComponent(m[1]) : null\n return isThemePreference(v) ? v : null\n } catch {\n return null\n }\n}\n\n// Set the cross-subdomain cookie. On a *.politogyvrm.com host we scope it to\n// the parent domain so every app subdomain reads it; on any other host\n// (localhost, *.pages.dev preview) we fall back to a host-only cookie so\n// local/preview theming still works without a mismatched Domain attribute\n// (which browsers silently drop). 1-year, SameSite=Lax, Secure on https.\nexport function writeThemeCookie(pref: ThemePreference): void {\n if (typeof document === 'undefined' || typeof window === 'undefined') return\n const host = window.location.hostname\n const onParentDomain = /(^|\\.)politogyvrm\\.com$/i.test(host)\n const domainAttr = onParentDomain ? '; Domain=.politogyvrm.com' : ''\n const secure = window.location.protocol === 'https:' ? '; Secure' : ''\n document.cookie = `${THEME_COOKIE}=${encodeURIComponent(\n pref,\n )}; Path=/; Max-Age=31536000; SameSite=Lax${domainAttr}${secure}`\n}\n\n// Write an arbitrary cross-subdomain cookie with the same scoping rules as the\n// theme cookie itself (parent domain on *.politogyvrm.com, host-only elsewhere).\nfunction writeSharedCookie(name: string, value: string, maxAgeSeconds: number): void {\n if (typeof document === 'undefined' || typeof window === 'undefined') return\n const host = window.location.hostname\n const domainAttr = /(^|\\.)politogyvrm\\.com$/i.test(host) ? '; Domain=.politogyvrm.com' : ''\n const secure = window.location.protocol === 'https:' ? '; Secure' : ''\n document.cookie = `${name}=${encodeURIComponent(\n value,\n )}; Path=/; Max-Age=${maxAgeSeconds}; SameSite=Lax${domainAttr}${secure}`\n}\n\n/**\n * Mark the current cookie value as a local choice that still has to reach the\n * user's profile. Call this from any surface that changes the theme WITHOUT a\n * chrome-API session (Politogy ID's login screen is the only one today).\n */\nexport function markThemeChoicePending(pref: ThemePreference): void {\n writeSharedCookie(THEME_PENDING_COOKIE, pref, 31536000)\n}\n\n/** The pending (not-yet-persisted) local choice, if any. */\nexport function readPendingThemeChoice(): ThemePreference | null {\n if (typeof document === 'undefined') return null\n try {\n const m = document.cookie.match(\n new RegExp(`(?:^|;\\\\s*)${THEME_PENDING_COOKIE}=([^;]+)`),\n )\n const v = m ? decodeURIComponent(m[1]) : null\n return isThemePreference(v) ? v : null\n } catch {\n return null\n }\n}\n\n/** Clear the pending marker once the choice has been written to the profile. */\nexport function clearPendingThemeChoice(): void {\n writeSharedCookie(THEME_PENDING_COOKIE, '', 0)\n}\n\n/** Resolve a preference to the concrete light/dark it renders as right now. */\nexport function resolveTheme(pref: ThemePreference): 'light' | 'dark' {\n if (pref === 'system') {\n try {\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light'\n } catch {\n return 'light'\n }\n }\n return pref\n}\n\n/**\n * Read the stored preference the way the pre-paint script does — cookie →\n * localStorage → `'system'`. Kept in lockstep with THEME_PREPAINT_SCRIPT so a\n * runtime reader can never disagree with what was applied before paint.\n */\nexport function readStoredThemePreference(): ThemePreference {\n const cookie = readThemeCookie()\n if (cookie) return cookie\n try {\n const stored = window.localStorage.getItem(THEME_STORAGE_KEY)\n if (isThemePreference(stored)) return stored\n } catch {\n /* localStorage may be unavailable (private mode) */\n }\n return 'system'\n}\n\n/**\n * The concrete light/dark the document is rendering as right now.\n *\n * This is the value anything theme-derived must follow — notably Chakra's\n * `colorMode`. Chakra used to be pinned to light while this resolved to dark,\n * which rendered dark chrome tokens over light Chakra content (the \"dark\n * labels on a light page\" desync).\n */\nexport function readResolvedTheme(): 'light' | 'dark' {\n return resolveTheme(readStoredThemePreference())\n}\n\n/** Apply a preference to the document (`.dark` class + color-scheme). */\nexport function applyThemePreference(pref: ThemePreference): void {\n if (typeof document === 'undefined') return\n const resolved = resolveTheme(pref)\n const d = document.documentElement\n d.classList.toggle('dark', resolved === 'dark')\n try {\n d.style.colorScheme = resolved\n } catch {\n /* non-fatal */\n }\n}\n\n// Inline pre-paint script — render it in <head> (or as the first child of\n// <body>) so the theme applies before first paint. Resolves the preference\n// from cookie → localStorage → OS, applies the `.dark` class + `color-scheme`,\n// and seeds localStorage from the cookie so the app hydrates to the synced\n// value (the cross-subdomain flash fix). Self-contained, dependency-free, and\n// wrapped so any failure is silent (never blocks paint).\nexport const THEME_PREPAINT_SCRIPT = `(function(){try{\nvar KEY=${JSON.stringify(THEME_STORAGE_KEY)};\nvar VALID=[\"light\",\"dark\",\"system\"];\nfunction fromCookie(){try{var m=document.cookie.match(/(?:^|;\\\\s*)${THEME_COOKIE}=([^;]+)/);return m?decodeURIComponent(m[1]):null;}catch(e){return null;}}\nvar cookie=fromCookie();\nvar ls=null;try{ls=localStorage.getItem(KEY);}catch(e){}\nvar pref=cookie||ls||\"system\";\nif(VALID.indexOf(pref)===-1)pref=\"system\";\nif(cookie&&cookie!==ls){try{localStorage.setItem(KEY,cookie);}catch(e){}}\nvar resolved=pref;\nif(pref===\"system\"){try{resolved=window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\";}catch(e){resolved=\"light\";}}\nvar d=document.documentElement;\nif(resolved===\"dark\"){d.classList.add(\"dark\");}else{d.classList.remove(\"dark\");}\ntry{d.style.colorScheme=resolved;}catch(e){}\n}catch(e){}})();`\n","'use client'\n\n// Chakra's color mode is a SLAVE to the universal Politogy theme preference.\n//\n// Two independent theme systems used to run side by side inside the shell:\n//\n// 1. `theme-preference.ts` — the cross-app contract. Resolves the stored\n// preference (cookie -> localStorage -> `'system'`) and toggles `.dark` on\n// <html>, which is what makes the Brand stylesheet's complete `.dark {}`\n// win for every `--app-*` / `--sidebar-*` / `--topbar-*` token.\n// 2. Chakra, pinned to light by `politogyTheme`'s\n// `config.initialColorMode: 'light'` + `useSystemColorMode: false`.\n//\n// So any user whose resolved theme was dark — including the DEFAULT `'system'`\n// on a machine with a dark OS appearance — got dark chrome token values over\n// light Chakra content: a near-black sidebar and top bar beside a white page,\n// and floating field labels whose `--app-floating-label-bg` resolved dark while\n// their text stayed a light-mode slate. That reads as a wrong colour but it is\n// a desync: both halves were internally correct and simply disagreed.\n//\n// The fix is to give Chakra no opinion of its own. This manager makes Chakra\n// READ the resolved Politogy theme, and `ChakraColorModeSync` keeps it in step\n// as the preference changes. Writes are deliberately dropped: the My Account\n// Appearance control owns the preference, and `applyThemePreference` +\n// `writeThemeCookie` are the only writers.\n\nimport { useEffect } from 'react'\nimport { useColorMode, type ColorMode } from '@chakra-ui/react'\nimport { readResolvedTheme, THEME_STORAGE_KEY } from '../theme-preference'\n\ninterface ColorModeManager {\n type: 'localStorage' | 'cookie'\n ssr?: boolean\n get(init?: ColorMode): ColorMode | undefined\n set(value: ColorMode): void\n}\n\n/**\n * Pass as `<ChakraProvider colorModeManager={politogyColorModeManager}>`. Chakra\n * then boots in whatever light/dark the pre-paint script already applied, so\n * there is no light-Chakra-over-dark-chrome frame on first render.\n */\nexport const politogyColorModeManager: ColorModeManager = {\n type: 'localStorage',\n ssr: false,\n get(init) {\n if (typeof window === 'undefined') return init\n return readResolvedTheme()\n },\n set() {\n // Intentionally a no-op. Chakra must never persist a color mode of its own —\n // that is how the two systems drifted apart. The preference is written only\n // by the Appearance control via writeThemeCookie/applyThemePreference.\n },\n}\n\n/**\n * Keeps Chakra's `colorMode` equal to the resolved Politogy theme for the life\n * of the app. Render once inside `ChakraProvider`.\n *\n * Mirrors the live-sync surface documented in the theme contract: the shell's\n * own preference event, `storage` for same-app tabs, `focus` /\n * `visibilitychange` cookie re-reads for cross-app tabs, and the OS media query\n * so `'system'` follows the scheme live.\n */\nexport function ChakraColorModeSync(): null {\n const { colorMode, setColorMode } = useColorMode()\n\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const sync = () => {\n const resolved = readResolvedTheme()\n if (resolved !== colorMode) setColorMode(resolved)\n }\n\n sync()\n\n window.addEventListener('politogy:theme-preference', sync)\n window.addEventListener('storage', sync)\n window.addEventListener('focus', sync)\n document.addEventListener('visibilitychange', sync)\n\n // matchMedia is not universally present (jsdom without the polyfill, some\n // embedded webviews), and `resolveTheme` already tolerates its absence — so\n // losing the live OS-scheme watch must never throw and take the app's render\n // down with it. Everything above still keeps the theme in step.\n let unwatchMedia = () => {}\n try {\n const media = window.matchMedia('(prefers-color-scheme: dark)')\n media.addEventListener('change', sync)\n unwatchMedia = () => media.removeEventListener('change', sync)\n } catch {\n /* no live OS-scheme watch available */\n }\n\n return () => {\n window.removeEventListener('politogy:theme-preference', sync)\n window.removeEventListener('storage', sync)\n window.removeEventListener('focus', sync)\n document.removeEventListener('visibilitychange', sync)\n unwatchMedia()\n }\n }, [colorMode, setColorMode])\n\n return null\n}\n\nexport { THEME_STORAGE_KEY }\n","import { createContext, useEffect, useMemo, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { ChakraProvider } from '@chakra-ui/react'\nimport type { Session } from '@supabase/supabase-js'\nimport { politogyTheme } from '../theme'\nimport {\n ChakraColorModeSync,\n politogyColorModeManager,\n} from '../theme/colorMode'\nimport type {\n AppRegistryEntry,\n ShellAuthStatus,\n ShellAuthValue,\n ShellFooterValue,\n ShellLinkedAccountsValue,\n ShellModeValue,\n ShellNavItemsValue,\n ShellNavigationPreferenceValue,\n ShellOrganizationValue,\n ShellProviderProps,\n ShellRoleValue,\n ShellSupportValue,\n ShellUser,\n} from '../types'\n\nexport const ShellAuthContext = createContext<ShellAuthValue | null>(null)\n\ninterface ShellMetaValue {\n currentApp: string\n appRegistry: AppRegistryEntry[]\n basename: string\n}\n\nexport const ShellMetaContext = createContext<ShellMetaValue | null>(null)\n\nexport const ShellOrgContext = createContext<ShellOrganizationValue | null>(null)\nexport const ShellLinkedAccountsContext = createContext<ShellLinkedAccountsValue | null>(null)\nexport const ShellSupportProviderContext = createContext<ShellSupportValue | null>(null)\nexport const ShellModeContext = createContext<ShellModeValue | null>(null)\nexport const ShellNavItemsContext = createContext<ShellNavItemsValue | null>(null)\nexport const ShellNavigationPreferenceContext =\n createContext<ShellNavigationPreferenceValue | null>(null)\nexport const ShellRoleContext = createContext<ShellRoleValue | null>(null)\nexport const ShellFooterContext = createContext<ShellFooterValue | null>(null)\n\nexport interface ShellChromeValue {\n devNotesMenu: ReactNode | null\n myProfileHref: string\n brandLogoSrc?: string\n headerIconsSlot?: ReactNode\n organizationSettingsHref?: string\n showContinueOnboarding?: boolean\n onContinueOnboarding?: () => void\n pageTitle?: string\n breadcrumbs?: Array<{ label: string; href?: string }>\n headerActions?: ReactNode\n /** Avatar URL override for UserMenu. Apps that store the avatar in their own\n * profile table or localStorage should pass it here. */\n userAvatarUrl?: string\n}\n\nexport const ShellChromeContext = createContext<ShellChromeValue | null>(null)\n\nfunction toShellUser(session: Session | null): ShellUser | null {\n if (!session?.user) return null\n const su = session.user\n const fullName = (su.user_metadata as { full_name?: string } | null)?.full_name ?? null\n return {\n id: su.id,\n email: su.email ?? null,\n displayName: fullName ?? su.email ?? null,\n raw: su,\n }\n}\n\nexport function ShellProvider({\n children,\n supabaseClient,\n auth,\n currentApp,\n appRegistry,\n basename,\n organization,\n linkedAccounts,\n support,\n devNotesMenu,\n myProfileHref,\n userAvatarUrl,\n}: ShellProviderProps) {\n const [status, setStatus] = useState<ShellAuthStatus>('loading')\n const [session, setSession] = useState<Session | null>(null)\n\n useEffect(() => {\n // Host-driven auth (or no client at all): Supabase session tracking is off.\n if (auth || !supabaseClient) {\n setSession(null)\n if (!auth) setStatus('unauthenticated')\n return\n }\n let cancelled = false\n supabaseClient.auth.getSession().then(({ data }) => {\n if (cancelled) return\n setSession(data.session)\n setStatus(data.session ? 'authenticated' : 'unauthenticated')\n })\n const sub = supabaseClient.auth.onAuthStateChange((_event, newSession) => {\n setSession(newSession)\n setStatus(newSession ? 'authenticated' : 'unauthenticated')\n })\n return () => {\n cancelled = true\n sub.data.subscription.unsubscribe()\n }\n }, [supabaseClient, auth])\n\n const value = useMemo<ShellAuthValue>(() => {\n if (auth) {\n return {\n status: auth.status,\n session: null,\n user: auth.user,\n signOut: async () => {\n await auth.signOut()\n },\n }\n }\n return {\n status,\n session,\n user: toShellUser(session),\n signOut: async () => {\n await supabaseClient?.auth.signOut()\n },\n }\n }, [auth, status, session, supabaseClient])\n\n const meta = useMemo<ShellMetaValue>(\n () => ({\n currentApp,\n appRegistry: appRegistry ?? [],\n basename: basename ?? '',\n }),\n [currentApp, appRegistry, basename],\n )\n\n const chrome = useMemo<ShellChromeValue>(\n () => ({\n devNotesMenu: devNotesMenu ?? null,\n myProfileHref: myProfileHref ?? '/my-profile',\n userAvatarUrl,\n }),\n [devNotesMenu, myProfileHref, userAvatarUrl],\n )\n\n return (\n <ShellAuthContext.Provider value={value}>\n <ShellMetaContext.Provider value={meta}>\n <ShellOrgContext.Provider value={organization ?? null}>\n <ShellLinkedAccountsContext.Provider value={linkedAccounts ?? null}>\n <ShellSupportProviderContext.Provider value={support ?? null}>\n <ShellModeContext.Provider value={null}>\n <ShellNavItemsContext.Provider value={null}>\n <ShellNavigationPreferenceContext.Provider value={null}>\n <ShellRoleContext.Provider value={null}>\n <ShellFooterContext.Provider value={null}>\n <ShellChromeContext.Provider value={chrome}>\n <ChakraProvider\n theme={politogyTheme}\n colorModeManager={politogyColorModeManager}\n >\n <ChakraColorModeSync />\n {children}\n </ChakraProvider>\n </ShellChromeContext.Provider>\n </ShellFooterContext.Provider>\n </ShellRoleContext.Provider>\n </ShellNavigationPreferenceContext.Provider>\n </ShellNavItemsContext.Provider>\n </ShellModeContext.Provider>\n </ShellSupportProviderContext.Provider>\n </ShellLinkedAccountsContext.Provider>\n </ShellOrgContext.Provider>\n </ShellMetaContext.Provider>\n </ShellAuthContext.Provider>\n )\n}\n","import { useContext } from 'react'\nimport { ShellAuthContext } from '../providers/ShellProvider'\nimport type { ShellAuthValue } from '../types'\n\nexport function useShellAuth(): ShellAuthValue {\n const ctx = useContext(ShellAuthContext)\n if (!ctx) {\n throw new Error('useShellAuth must be used inside <ShellProvider>')\n }\n return ctx\n}\n","import { useContext } from 'react'\nimport { ShellMetaContext } from '../providers/ShellProvider'\nimport type { AppRegistryEntry } from '../types'\n\nexport function useAppRegistry(): AppRegistryEntry[] {\n const meta = useContext(ShellMetaContext)\n if (!meta) {\n throw new Error('useAppRegistry must be used inside <ShellProvider>')\n }\n return meta.appRegistry\n}\n\nexport function useCurrentApp(): string {\n const meta = useContext(ShellMetaContext)\n if (!meta) {\n throw new Error('useCurrentApp must be used inside <ShellProvider>')\n }\n return meta.currentApp\n}\n","import { useContext } from 'react'\nimport { ShellOrgContext } from '../providers/ShellProvider'\nimport type { ShellOrganizationValue } from '../types'\n\n/**\n * Returns the organization value supplied to ShellProvider, or null if the\n * host app didn't pass an `organization` prop. Returning null lets chrome\n * components (e.g., <OrgSelector />) render nothing instead of erroring.\n */\nexport function useShellOrganization(): ShellOrganizationValue | null {\n return useContext(ShellOrgContext)\n}\n","import { useContext } from 'react'\nimport { ShellLinkedAccountsContext } from '../providers/ShellProvider'\nimport type { ShellLinkedAccountsValue } from '../types'\n\n/**\n * Returns the linked-accounts value supplied to ShellProvider, or null if not\n * provided. UserMenu uses this to decide whether to render the\n * \"switch account\" section.\n */\nexport function useShellLinkedAccounts(): ShellLinkedAccountsValue | null {\n return useContext(ShellLinkedAccountsContext)\n}\n","import { useContext } from 'react'\nimport { ShellSupportProviderContext } from '../providers/ShellProvider'\nimport type { ShellSupportValue } from '../types'\n\n/**\n * Returns the support handler supplied to ShellProvider, or null if not\n * provided. SupportRequestButton uses this to decide whether to render.\n */\nexport function useShellSupport(): ShellSupportValue | null {\n return useContext(ShellSupportProviderContext)\n}\n","import { useContext } from 'react'\nimport { ShellChromeContext } from '../providers/ShellProvider'\nimport type { ShellChromeValue } from '../providers/ShellProvider'\n\nexport type { ShellChromeValue }\n\n/**\n * Returns chrome-level options supplied to ShellProvider/ShellChrome\n * (devNotesMenu slot, myProfileHref, header data, brand logo src, etc.).\n * Throws if used outside <ShellProvider>.\n */\nexport function useShellChrome(): ShellChromeValue {\n const ctx = useContext(ShellChromeContext)\n if (!ctx) {\n throw new Error('useShellChrome must be used inside <ShellProvider>')\n }\n return ctx\n}\n","import { useContext } from 'react'\nimport { ShellModeContext } from '../providers/ShellProvider'\nimport type { ShellModeValue } from '../types'\n\n/**\n * Returns the mode value supplied to ShellProvider/ShellChrome, or null if\n * the host app didn't pass a `mode` prop. Components like <ModePill /> use\n * this to conditionally render.\n */\nexport function useShellMode(): ShellModeValue | null {\n return useContext(ShellModeContext)\n}\n","import { useContext } from 'react'\nimport { ShellNavItemsContext } from '../providers/ShellProvider'\nimport type { ShellNavItemsValue } from '../types'\n\n/**\n * Returns the nav items value supplied to ShellChrome, or null if the host\n * app didn't pass a `navItems` prop. The sidebar uses this to decide what\n * rows to render.\n */\nexport function useShellNavItems(): ShellNavItemsValue | null {\n return useContext(ShellNavItemsContext)\n}\n","import { useContext } from 'react'\nimport { ShellNavigationPreferenceContext } from '../providers/ShellProvider'\nimport type { ShellNavigationPreferenceValue } from '../types'\n\n/**\n * Returns the user's navigation rendering preference supplied to\n * ShellChrome, or null if not provided. NavItem uses this to decide\n * whether to expand sub-menus.\n */\nexport function useShellNavigationPreference(): ShellNavigationPreferenceValue | null {\n return useContext(ShellNavigationPreferenceContext)\n}\n","import { useContext } from 'react'\nimport { ShellRoleContext } from '../providers/ShellProvider'\nimport type { ShellRoleValue } from '../types'\n\n/**\n * Returns the active-role info supplied to ShellChrome, or null if not\n * provided. UserMenu uses this to render the ROLES & ORGANIZATIONS badge.\n */\nexport function useShellRole(): ShellRoleValue | null {\n return useContext(ShellRoleContext)\n}\n","import { useContext } from 'react'\nimport { ShellFooterContext } from '../providers/ShellProvider'\nimport type { ShellFooterValue } from '../types'\n\n/**\n * Returns the footer data supplied to ShellChrome (links, commit/version\n * info), or null if not provided. The Sidebar footer reads this to render\n * Privacy / Terms / Subscriptions + commit copy button.\n */\nexport function useShellFooter(): ShellFooterValue | null {\n return useContext(ShellFooterContext)\n}\n","import type { CSSProperties } from 'react'\n\nexport interface BrandLogoProps {\n src?: string\n alt?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * Mode-aware brand logo rendered in the sidebar header. The host app\n * supplies `src` (e.g., a different image per mode); the shell wraps it\n * in a non-draggable <img> so it never accidentally drags on click.\n *\n * Render returns null when no src is supplied so consuming chrome can\n * gracefully omit the slot.\n */\nexport function BrandLogo({ src, alt = 'Brand', className, style }: BrandLogoProps) {\n if (!src) return null\n return (\n <img\n src={src}\n alt={alt}\n className={className}\n style={style}\n draggable={false}\n />\n )\n}\n\nexport default BrandLogo\n","import type { CSSProperties } from 'react'\n\nexport interface BrandIconProps {\n /** Brand-icon name keyed off `/brand/icons/<name>.svg` in the app's public dir. */\n name: string\n /** Pixel size shorthand — sets both width and height. */\n size?: number\n className?: string\n style?: CSSProperties\n alt?: string\n /** Optional prefix for the icon path. Defaults to '/brand/icons/'. */\n basePath?: string\n}\n\n/**\n * Brand-icon component used by sidebar NavItems. The actual SVG assets live\n * in the consuming app's `public/brand/icons/<name>.svg` — shell never\n * imports them directly, only references them by URL.\n */\nexport function BrandIcon({\n name,\n size,\n className,\n style,\n alt,\n basePath = '/brand/icons/',\n}: BrandIconProps) {\n const a11yLabel = alt ?? ''\n const isDecorative = a11yLabel === ''\n const inlineSize = size ? { width: size, height: size, ...style } : style\n\n return (\n <img\n src={`${basePath}${name}.svg`}\n alt={a11yLabel}\n role={isDecorative ? 'presentation' : undefined}\n aria-hidden={isDecorative ? true : undefined}\n className={className}\n style={inlineSize}\n draggable={false}\n />\n )\n}\n\nexport default BrandIcon\n","// Color + badge helpers used by sidebar/header chrome. Ported verbatim from\n// react/app/src/layouts/AuthenticatedLayout.tsx (lines 725–786, 2026-05-13).\n\nconst HEX_COLOR_PATTERN = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/\n\n/** Returns a normalized 7-char hex color, or null if the input isn't valid. */\nexport function normalizeHexColor(value?: string | null): string | null {\n const trimmed = value?.trim()\n if (!trimmed || !HEX_COLOR_PATTERN.test(trimmed)) return null\n if (trimmed.length === 7) return trimmed\n const [r, g, b] = trimmed.slice(1).split('')\n return `#${r}${r}${g}${g}${b}${b}`\n}\n\n/**\n * Returns an `rgba(...)` string lightened toward white by `amount` (0–1),\n * or null if the input isn't a valid hex.\n */\nexport function hexToRgba(hex: string, alpha: number): string | null {\n const normalized = normalizeHexColor(hex)\n if (!normalized) return null\n const red = parseInt(normalized.slice(1, 3), 16)\n const green = parseInt(normalized.slice(3, 5), 16)\n const blue = parseInt(normalized.slice(5, 7), 16)\n return `rgba(${red}, ${green}, ${blue}, ${alpha})`\n}\n\n/**\n * Returns a hex color that is `amount` (0–1) blended from `hex` toward\n * white. Used for the org-menu hover background.\n */\nexport function lightenHexColor(hex: string, amount: number): string | null {\n const normalized = normalizeHexColor(hex)\n if (!normalized) return null\n\n const clamp = (value: number) => Math.max(0, Math.min(255, Math.round(value)))\n const blend = (channel: number) => clamp(channel + (255 - channel) * amount)\n\n const red = parseInt(normalized.slice(1, 3), 16)\n const green = parseInt(normalized.slice(3, 5), 16)\n const blue = parseInt(normalized.slice(5, 7), 16)\n\n return `#${blend(red).toString(16).padStart(2, '0')}${blend(green)\n .toString(16)\n .padStart(2, '0')}${blend(blue).toString(16).padStart(2, '0')}`\n}\n\n/**\n * Reads `settings.brand_colors[0].value` off an org-like input and returns\n * the first valid normalized hex. Returns null if the input doesn't have\n * a usable brand color.\n */\nexport function getOrganizationBrandColor(organization?: {\n brandColor?: string | null\n settings?: {\n brand_colors?: Array<{ value?: string | null }> | null\n } | null\n} | null): string | null {\n if (!organization) return null\n // Direct brandColor (shell's ShellOrganization shape).\n const direct = normalizeHexColor(organization.brandColor)\n if (direct) return direct\n // Legacy settings.brand_colors shape.\n const brandColors = Array.isArray(organization.settings?.brand_colors)\n ? organization.settings?.brand_colors\n : []\n const firstBrandColor = brandColors?.find(\n (entry) => typeof entry?.value === 'string' && normalizeHexColor(entry.value),\n )\n return normalizeHexColor(firstBrandColor?.value ?? null)\n}\n\n/**\n * Returns the two-letter badge for an organization name (e.g., \"The Portland\n * Company\" -> \"TP\"). Falls back to \"OR\" when the input has no letters.\n */\nexport function getOrganizationBadgeLetters(name?: string | null): string {\n const normalizedName = String(name || '')\n .trim()\n .replace(/[^a-zA-Z0-9\\s]+/g, ' ')\n const parts = normalizedName.split(/\\s+/).filter(Boolean)\n\n if (parts.length >= 2) {\n return `${parts[0][0] || ''}${parts[1][0] || ''}`.toUpperCase()\n }\n\n const compact = parts[0] || normalizedName.replace(/\\s+/g, '')\n return compact.slice(0, 2).toUpperCase() || 'OR'\n}\n","// Display-name helper for user-menu / avatar fallbacks. Ported from\n// react/app/src/layouts/AuthenticatedLayout.tsx line 697 (2026-05-13).\n\ninterface UserLike {\n profile?: {\n full_name?: string | null\n name?: string | null\n } | null\n user_metadata?: {\n full_name?: string | null\n name?: string | null\n } | null\n email?: string | null\n}\n\n/**\n * Resolves a user-facing display name from a user object. Tries profile\n * fields first, then user_metadata, then the email local-part, then the\n * raw email, finally falling back to \"User\".\n */\nexport function getUserDisplayName(user: UserLike | null | undefined): string {\n if (!user) return 'User'\n return (\n user.profile?.full_name ||\n user.profile?.name ||\n user.user_metadata?.full_name ||\n user.user_metadata?.name ||\n (typeof user.email === 'string' ? user.email.split('@')[0] : '') ||\n user.email ||\n 'User'\n )\n}\n","export interface RegisterShellPrecacheOptions {\n /** Path the host app serves the SW from. Default: '/sw-shell.js'. */\n scriptUrl?: string\n /** Scope the SW controls. Default: '/'. */\n scope?: string\n}\n\n/**\n * Register the shell precache service worker. Silently no-ops in browsers that\n * don't support service workers (e.g., old Safari) and during SSR.\n *\n * Hosts must copy `node_modules/@the-portland-company/shell/dist/shell-precache.worker.js`\n * to the URL specified by `scriptUrl` (default `/sw-shell.js`) in their public\n * directory so the browser can fetch it at registration time.\n */\nexport async function registerShellPrecache(opts: RegisterShellPrecacheOptions = {}): Promise<void> {\n if (typeof window === 'undefined') return\n if (!('serviceWorker' in navigator)) return\n const scriptUrl = opts.scriptUrl ?? '/sw-shell.js'\n const scope = opts.scope ?? '/'\n try {\n await navigator.serviceWorker.register(scriptUrl, { scope })\n } catch (err) {\n // Registration failures are not user-visible. Log for ops, swallow.\n // eslint-disable-next-line no-console\n console.warn('[shell] precache SW registration failed:', err)\n }\n}\n","import type { AppRegistryEntry } from '../types'\n\n/**\n * Build a Speculation Rules JSON payload that prerenders other apps in the\n * registry on moderate eagerness. Returns null when there are no eligible\n * other apps to prerender (e.g., this is the only app in the registry).\n *\n * The host app is expected to render this as\n * `<script type=\"speculationrules\">{json}</script>` in <head> at runtime.\n */\nexport function buildSpeculationRules(\n currentApp: string,\n registry: AppRegistryEntry[],\n): string | null {\n const others = registry.filter(\n (entry) => entry.id !== currentApp && entry.visible !== false,\n )\n if (others.length === 0) return null\n const payload = {\n prerender: [\n {\n urls: others.map((entry) => entry.path),\n eagerness: 'moderate' as const,\n },\n ],\n }\n return JSON.stringify(payload)\n}\n"]}
1
+ {"version":3,"sources":["../src/theme/tokens.generated.ts","../src/theme/colors.ts","../src/theme/components.ts","../src/theme/index.ts","../src/components/Card.tsx","../src/components/PageContainer.tsx","../src/components/PageHeader.tsx","../src/components/BreadcrumbBar.tsx","../src/components/HeaderTabBar.tsx","../src/providers/GlobalUiIdProvider.tsx","../src/theme-preference.ts","../src/theme/colorMode.tsx","../src/providers/ShellProvider.tsx","../src/hooks/useShellAuth.ts","../src/hooks/useAppRegistry.ts","../src/hooks/useShellOrganization.ts","../src/hooks/useShellLinkedAccounts.ts","../src/hooks/useShellSupport.ts","../src/hooks/useShellChrome.ts","../src/hooks/useShellMode.ts","../src/hooks/useShellNavItems.ts","../src/hooks/useShellNavigationPreference.ts","../src/hooks/useShellRole.ts","../src/hooks/useShellFooter.ts","../src/components/BrandLogo.tsx","../src/components/BrandIcon.tsx","../src/lib/orgColors.ts","../src/lib/userDisplay.ts","../src/sw/registerShellPrecache.ts","../src/speculation/emitRules.ts"],"names":["extendTheme","jsxs","jsx","clsx","Link","Tooltip","useLocation","useEffect","useColorMode","createContext","useState","useMemo","ChakraProvider","useContext"],"mappings":";;;;;;;;;;;;;;;AAKO,IAAM,SAAA,GAAY,EAAE,EAAA,EAAI,SAAA,EAAW,KAAK,SAAA,EAAW,GAAA,EAAK,WAAW,GAAA,EAAK,SAAA,EAAW,KAAK,SAAA,EAAW,GAAA,EAAK,WAAW,GAAA,EAAK,SAAA,EAAW,KAAK,SAAA,EAAW,GAAA,EAAK,SAAA,EAAW,GAAA,EAAK,SAAA,EAAU;;;ACClL,IAAM,MAAA,GAAS;AAAA;AAAA,EAEpB,KAAA,EAAO,EAAE,GAAG,SAAA,EAAU;AAAA;AAAA,EAGtB,QAAA,EAAU;AAAA;AAAA,IAER,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK;AAAA,KACP;AAAA;AAAA,IAEA,GAAA,EAAK,EAAE,GAAG,SAAA,EAAU;AAAA;AAAA,IAEpB,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,GAAA,EAAK,SAAA;AAAA,MACL,GAAA,EAAK,SAAA;A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AA,CAAO,MAAA,KAAW,CAAA,EAAG,OAAO,IAAA;AAChC,EAAA,MAAM,OAAA,GAAU;AAAA,IACd,SAAA,EAAW;AAAA,MACT;AAAA,QACE,MAAM,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,KAAU,MAAM,IAAI,CAAA;AAAA,QACtC,SAAA,EAAW;AAAA;AACb;AACF,GACF;AACA,EAAA,OAAO,IAAA,CAAK,UAAU,OAAO,CAAA;AAC/B","file":"index.cjs","sourcesContent":["// GENERATED by scripts/gen-tokens.mjs from Specs (/api/tokens). DO NOT EDIT.\n// The Chakra theme imports these so its colors derive from the same source\n// of truth (Admin Brand API → Specs) as chrome.css.\n// brandRamp = Specs colors.raceRed (primary brand), not shellChrome.brandRamp.\n\nexport const brandRamp = { 50: '#FDECEE', 100: '#FCE0E3', 200: '#F8B6BD', 300: '#EF6671', 400: '#EA4751', 500: '#E63946', 600: '#C42E3A', 700: '#9F252E', 800: '#660F17', 900: '#39080D' } as const;\nexport const grayRamp = { 50: '#F7FAFC', 100: '#EDF2F7', 200: '#E2E8F0', 300: '#CBD5E0', 400: '#A0AEC0', 500: '#718096', 600: '#4A5568', 700: '#2D3748', 800: '#1A202C', 900: '#171923' } as const;\nexport const buttonPrimaryBg = '#E63946';\nexport const buttonPrimaryBgHover = '#C42E3A';\nexport const fieldFocus = '#E63946';\n","// Theme color definitions for light and dark modes.\n// The primary brand ramp is GENERATED from Specs (the styling source of truth)\n// so the Chakra theme stays in lockstep with chrome.css — edit it in Admin →\n// sync to Specs → `npm run gen:tokens`, never hand-edit the ramp here.\nimport { brandRamp } from './tokens.generated';\n\nexport const colors = {\n // Primary brand = Specs race-red (#E63946 ramp). Generated via gen:tokens.\n brand: { ...brandRamp },\n\n // Politogy Brand Colors\n politogy: {\n // Legacy Blue - kept for reference\n blue: {\n 50: '#e8f4fd',\n 100: '#bee3f8',\n 200: '#90cdf4',\n 300: '#63b3ed',\n 400: '#4299e1',\n 500: '#3182ce',\n 600: '#2b6cb0',\n 700: '#2c5282',\n 800: '#2a4365',\n 900: '#1a365d',\n },\n // Race-red (Specs primary brand). Same ramp as `brand`.\n red: { ...brandRamp },\n // Navy - Professional & Authoritative\n navy: {\n 50: '#e8eef6',\n 100: '#c5d4e8',\n 200: '#9fb8d9',\n 300: '#789cca',\n 400: '#5b86be',\n 500: '#3e70b2',\n 600: '#325a8e',\n 700: '#26446a',\n 800: '#1a2e47',\n 900: '#0e1823',\n },\n // White & Off-white\n white: '#ffffff',\n offWhite: '#f8fafc',\n // Text colors\n text: {\n primary: '#1a202c',\n secondary: '#4a5568',\n muted: '#718096',\n light: '#a0aec0',\n },\n },\n\n // Semantic color tokens that will switch based on color mode\n gray: {\n 50: '#f7fafc',\n 100: '#edf2f7',\n 200: '#e2e8f0',\n 300: '#cbd5e0',\n 400: '#a0aec0',\n 500: '#718096',\n 600: '#4a5568',\n 700: '#2d3748',\n 800: '#1a202c',\n 900: '#171923',\n },\n\n // The neutral-black dark ramp from Reference/Global-Rules → Dark Mode. Every\n // value is hue-free (R = G = B); layering is expressed by lightness only.\n //\n // The `gray` ramp above is Chakra's, which is BLUE-TINTED (#2d3748, #1a202c,\n // #171923). Every dark value in the theme used to point into it, so dark mode\n // rendered navy against the black chrome — the single most common way dark\n // mode drifts off-brand, and explicitly called out in the spec. Dark values\n // resolve here instead.\n neutral: {\n page: '#0A0A0A',\n surface: '#161616',\n raised: '#1F1F1F',\n raised2: '#212121',\n hover: '#2B2B2B',\n border: '#333333',\n borderStrong: '#404040',\n textMuted: '#A3A3A3',\n textDim: '#8A8A8A',\n text: '#E8E8E8',\n textStrong: '#F5F5F5',\n },\n};\n\n// Semantic tokens for automatic color mode switching\nexport const semanticTokens = {\n colors: {\n // Every _dark value resolves to the NEUTRAL ramp (colors.neutral), never to\n // Chakra's blue-tinted `gray` scale. See the note on `neutral` above.\n\n // Text colors\n 'text.primary': { default: 'gray.900', _dark: 'neutral.text' },\n 'text.secondary': { default: 'gray.600', _dark: 'neutral.textMuted' },\n 'text.muted': { default: 'gray.500', _dark: 'neutral.textDim' },\n\n // Background colors\n 'bg.primary': { default: 'white', _dark: 'neutral.surface' },\n 'bg.secondary': { default: 'gray.50', _dark: 'neutral.page' },\n 'bg.surface': { default: 'white', _dark: 'neutral.raised' },\n 'bg.hover': { default: 'gray.50', _dark: 'neutral.hover' },\n\n // Border colors\n 'border.default': { default: 'gray.200', _dark: 'neutral.border' },\n 'border.muted': { default: 'gray.100', _dark: 'neutral.border' },\n\n // Component specific\n 'heading.fg': { default: 'politogy.navy.800', _dark: 'neutral.textStrong' },\n 'card.bg': { default: 'white', _dark: 'neutral.surface' },\n 'card.border': { default: 'gray.200', _dark: 'neutral.border' },\n 'input.bg': { default: 'white', _dark: 'neutral.raised' },\n 'input.border': { default: 'gray.200', _dark: 'neutral.border' },\n 'input.hover': { default: 'gray.400', _dark: 'neutral.borderStrong' },\n\n // Navigation\n 'nav.bg': { default: 'white', _dark: 'neutral.surface' },\n 'nav.border': { default: 'gray.200', _dark: 'neutral.border' },\n\n // Sidebar\n 'sidebar.bg': { default: 'gray.50', _dark: 'neutral.surface' },\n 'sidebar.hover': { default: 'gray.100', _dark: 'neutral.hover' },\n 'sidebar.active': { default: 'brand.50', _dark: 'brand.900' },\n\n // Status surfaces. In dark mode these become neutral raised surfaces — the\n // meaning is carried by the icon/text accent, not by a pale tint that would\n // glare against black (and would break the hue-free surface rule).\n 'success.bg': { default: 'green.50', _dark: 'neutral.raised' },\n 'error.bg': { default: 'red.50', _dark: 'neutral.raised' },\n 'warning.bg': { default: 'yellow.50', _dark: 'neutral.raised' },\n 'info.bg': { default: 'blue.50', _dark: 'neutral.raised' },\n\n // ---------------------------------------------------------------------\n // Raw palette remap — the high-leverage half of the dark-mode fix.\n //\n // The app carries ~650 hardcoded Chakra literals (`bg=\"gray.50\"`,\n // `borderColor=\"gray.200\"`, `color=\"gray.600\"`, ...) that no semantic token\n // can reach. Making the SCALE ITSELF color-mode-aware fixes them all at\n // once, centrally, with no app edits.\n //\n // The mapping INVERTS: in dark mode a low number (used as a pale surface)\n // becomes a dark surface, and a high number (used as dark text) becomes\n // light text. That is what makes one remap correct for both background and\n // foreground usage.\n 'gray.50': { default: '#f7fafc', _dark: 'neutral.raised' },\n 'gray.100': { default: '#edf2f7', _dark: 'neutral.raised2' },\n 'gray.200': { default: '#e2e8f0', _dark: 'neutral.border' },\n 'gray.300': { default: '#cbd5e0', _dark: 'neutral.borderStrong' },\n 'gray.400': { default: '#a0aec0', _dark: '#6B6B6B' },\n 'gray.500': { default: '#718096', _dark: 'neutral.textDim' },\n 'gray.600': { default: '#4a5568', _dark: 'neutral.textMuted' },\n 'gray.700': { default: '#2d3748', _dark: '#C6C6C6' },\n 'gray.800': { default: '#1a202c', _dark: 'neutral.text' },\n 'gray.900': { default: '#171923', _dark: 'neutral.textStrong' },\n\n // Pale status tints used directly as card/callout surfaces. Same reasoning\n // as the *.bg tokens above.\n 'blue.50': { default: '#ebf8ff', _dark: 'neutral.raised' },\n 'green.50': { default: '#f0fff4', _dark: 'neutral.raised' },\n 'red.50': { default: '#fff5f5', _dark: 'neutral.raised' },\n 'yellow.50': { default: '#fffff0', _dark: 'neutral.raised' },\n 'orange.50': { default: '#fffaf0', _dark: 'neutral.raised' },\n\n // Dark status TEXT. The deep shades are picked for contrast against a pale\n // tint; against a #1F1F1F surface they are unreadable — measured on the live\n // info alert, whose description rendered #2c5282 (blue.700) on near-black.\n // In dark mode they lighten to the 200/300 band so the hue still reads as\n // informational/success/error without losing legibility.\n 'blue.600': { default: '#2b6cb0', _dark: '#7CC0F5' },\n 'blue.700': { default: '#2c5282', _dark: '#9AD1F8' },\n 'blue.800': { default: '#2a4365', _dark: '#BFE3FB' },\n 'green.600': { default: '#38a169', _dark: '#68D391' },\n 'green.700': { default: '#2f855a', _dark: '#8EE0AE' },\n 'green.800': { default: '#276749', _dark: '#B6ECCB' },\n 'red.600': { default: '#e53e3e', _dark: '#FC8181' },\n 'red.700': { default: '#c53030', _dark: '#FEA8A8' },\n 'red.800': { default: '#9b2c2c', _dark: '#FECACA' },\n 'orange.600': { default: '#dd6b20', _dark: '#F6AD55' },\n 'orange.700': { default: '#c05621', _dark: '#FBC98A' },\n 'orange.800': { default: '#9c4221', _dark: '#FDDCB4' },\n 'yellow.600': { default: '#d69e2e', _dark: '#ECC94B' },\n 'yellow.700': { default: '#b7791f', _dark: '#F3DC85' },\n 'yellow.800': { default: '#975a16', _dark: '#F8EAB4' },\n },\n};\n","// Component style overrides for theme using Politogy brand colors\nexport const components = {\n Button: {\n baseStyle: {\n fontWeight: 'medium',\n },\n defaultProps: {\n colorScheme: 'brand',\n },\n variants: {\n primary: {\n bg: 'brand.500',\n color: 'white',\n _hover: {\n bg: 'brand.600',\n _disabled: {\n bg: 'brand.500',\n },\n },\n _active: {\n bg: 'brand.700',\n },\n },\n secondary: {\n borderWidth: '1px',\n borderColor: 'gray.300',\n // `card.bg`, not a raw `white` — a literal white here rendered a light\n // pill on the black page in dark mode. (`gray.*` is color-mode-aware via\n // the semanticTokens remap, so those are already safe.)\n bg: 'card.bg',\n color: 'gray.700',\n _hover: {\n bg: 'gray.50',\n },\n },\n solid: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n // For brand colorScheme, use explicit colors\n if (c === 'brand') {\n return {\n bg: 'brand.500',\n color: 'white',\n _hover: {\n bg: 'brand.600',\n _disabled: {\n bg: 'brand.500',\n },\n },\n _active: {\n bg: 'brand.700',\n },\n };\n }\n // For other colorSchemes, use standard pattern with explicit bg and white text\n return {\n bg: `${c}.500`,\n color: 'white',\n _hover: {\n bg: `${c}.600`,\n _disabled: {\n bg: `${c}.500`,\n },\n },\n _active: {\n bg: `${c}.700`,\n },\n };\n },\n ghost: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n return {\n color: `${c}.600`,\n _hover: {\n bg: `${c}.50`,\n },\n };\n },\n outline: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n return {\n borderColor: `${c}.500`,\n color: `${c}.600`,\n _hover: {\n bg: `${c}.50`,\n },\n };\n },\n link: {\n color: 'brand.500',\n _hover: {\n color: 'brand.600',\n textDecoration: 'underline',\n },\n },\n },\n },\n\n Heading: {\n baseStyle: {\n // Was a hard `politogy.navy.800` (#1a2e47) — near-invisible against the\n // black page in dark mode, and off-brand navy besides. Every heading in\n // every app went through this one style.\n color: 'heading.fg',\n fontWeight: 'semibold',\n },\n },\n\n Card: {\n baseStyle: {\n container: {\n bg: 'card.bg',\n borderWidth: '1px',\n borderColor: 'card.border',\n borderRadius: 'lg',\n },\n },\n },\n\n Input: {\n baseStyle: {\n field: {\n bg: 'input.bg',\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n field: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n },\n\n NumberInput: {\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n field: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n },\n\n Select: {\n baseStyle: {\n field: {\n bg: 'input.bg',\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n field: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n },\n\n Textarea: {\n baseStyle: {\n bg: 'input.bg',\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n defaultProps: {\n variant: 'outline',\n },\n variants: {\n outline: {\n borderColor: 'var(--mode-input-border-color)',\n _hover: {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n _focus: {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n },\n },\n },\n\n Menu: {\n baseStyle: {\n list: {\n bg: 'bg.surface',\n borderColor: 'var(--mode-input-border-color)',\n boxShadow: 'lg',\n },\n item: {\n bg: 'transparent',\n _hover: {\n bg: 'bg.hover',\n },\n _focus: {\n bg: 'bg.hover',\n },\n },\n },\n },\n\n Modal: {\n baseStyle: {\n dialog: {\n bg: 'bg.surface',\n },\n overlay: {\n bg: 'blackAlpha.600',\n },\n },\n },\n\n Popover: {\n baseStyle: {\n content: {\n bg: 'bg.surface',\n borderColor: 'border.default',\n boxShadow: 'lg',\n },\n },\n },\n\n Drawer: {\n baseStyle: {\n dialog: {\n bg: 'bg.surface',\n },\n overlay: {\n bg: 'blackAlpha.600',\n },\n },\n },\n\n Tabs: {\n baseStyle: {\n root: {\n width: '100%',\n },\n tablist: {\n width: '100%',\n alignItems: 'flex-end',\n gap: 'var(--app-tab-gap)',\n },\n tabpanels: {\n width: '100%',\n },\n tabpanel: {\n width: '100%',\n },\n tab: {\n minHeight: 'var(--app-tab-height)',\n height: 'var(--app-tab-height)',\n lineHeight: 1,\n borderTopLeftRadius: 'var(--app-tab-radius)',\n borderTopRightRadius: 'var(--app-tab-radius)',\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n color: 'text.secondary',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n borderColor: 'brand.500',\n fontWeight: 'semibold',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n },\n variants: {\n enclosed: {\n tab: {\n color: 'gray.600',\n bg: 'transparent',\n borderColor: 'gray.200',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n borderColor: 'brand.500',\n borderBottomColor: 'brand.500',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n },\n 'enclosed-colored': {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n },\n },\n },\n 'soft-rounded': {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n },\n },\n },\n 'solid-rounded': {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n },\n },\n },\n line: {\n tab: {\n color: 'gray.600',\n _selected: {\n color: 'white',\n bg: 'brand.500',\n borderColor: 'brand.500',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n },\n unstyled: {\n tab: {\n // Allow inline styles to take precedence for unstyled variant\n },\n },\n },\n defaultProps: {\n colorScheme: 'brand',\n },\n },\n\n Badge: {\n baseStyle: {\n borderRadius: 'md',\n px: 2,\n py: 1,\n fontWeight: 'medium',\n },\n defaultProps: {\n colorScheme: 'brand',\n },\n },\n\n Link: {\n baseStyle: {\n color: 'brand.500',\n _hover: {\n color: 'brand.600',\n textDecoration: 'underline',\n },\n },\n },\n\n // Reference/UI-Platform: every top-bar control and every panel it opens share\n // ONE surface treatment — one definition of background, border, blur and\n // radius, not a per-component re-style. Chakra's stock Tooltip INVERTS\n // (dark text surface in light mode, LIGHT surface in dark mode), so in dark\n // mode every `div#tooltip-*` rendered a near-white #E8E8E8 slab against the\n // black chrome — measured on 15 of 29 pages, including inside the\n // Communications Fuel panel. Pin it to the shared panel surface instead, so a\n // Chakra tooltip and the native chrome's TopBarTooltip look identical.\n Tooltip: {\n baseStyle: {\n // Chakra's own baseStyle sets `bg: var(--tooltip-bg)` and then assigns\n // `--tooltip-bg` from its palette, so overriding `bg` alone loses — the\n // variable still resolves to Chakra's value and the bubble stayed light\n // (measured #E8E8E8 live after a first attempt that set only `bg`). Pin\n // the VARIABLE, which is what both the bubble and the arrow read.\n '--tooltip-bg': 'var(--panel-elevated, #1F1F1F)',\n '--tooltip-fg': 'var(--foreground, #E8E8E8)',\n '--popper-arrow-bg': 'var(--panel-elevated, #1F1F1F)',\n // Chakra ALSO ships a `_dark` block that re-assigns those two variables\n // to `colors.gray.300` / `colors.gray.900` — i.e. it deliberately INVERTS\n // in dark mode. That block wins over the base keys, so it has to be\n // overridden explicitly or the bubble goes light again.\n _dark: {\n '--tooltip-bg': 'var(--panel-elevated, #1F1F1F)',\n '--tooltip-fg': 'var(--foreground, #E8E8E8)',\n '--popper-arrow-bg': 'var(--panel-elevated, #1F1F1F)',\n },\n bg: 'var(--panel-elevated, #1F1F1F)',\n color: 'var(--foreground, #E8E8E8)',\n border: '1px solid',\n borderColor: 'var(--line, #333333)',\n borderRadius: 'var(--radius-lg, 0.5rem)',\n boxShadow: 'var(--shadow-soft)',\n fontSize: '12px',\n paddingX: 3,\n paddingY: 2,\n },\n },\n\n Alert: {\n baseStyle: {\n container: {\n borderRadius: 'md',\n },\n },\n variants: {\n subtle: (props: { colorScheme: string; colorMode?: string }) => {\n const { colorScheme: c, colorMode } = props;\n // In DARK mode a \"subtle\" alert must not paint a pale tint: Chakra's\n // default resolves `<scheme>.200` for both the surface AND the icon, so\n // an error alert rendered a near-white pink (#FEB2B2 — measured live on\n // app) against the black page. Global-Rules → Dark Mode: every dark\n // surface is hue-free; meaning is carried by the icon/text accent, not\n // by the fill. Reds also reconcile to brand #E63946, not Chakra #E53E3E.\n if (colorMode === 'dark') {\n const accent =\n c === 'blue' || c === 'info'\n ? '#7CC0F5'\n : c === 'green' || c === 'success'\n ? '#68D391'\n : c === 'orange' || c === 'yellow' || c === 'warning'\n ? '#F6AD55'\n : 'var(--color-race-red-300, #EF6671)';\n return {\n container: { bg: 'neutral.raised', borderLeftColor: accent },\n icon: { color: accent },\n title: { color: 'neutral.text' },\n description: { color: 'neutral.textMuted' },\n };\n }\n // Keep info alerts blue\n if (c === 'blue' || c === 'info') {\n return {\n container: {\n bg: 'blue.50',\n },\n icon: {\n color: 'blue.500',\n },\n title: {\n color: 'blue.800',\n },\n description: {\n color: 'blue.700',\n },\n };\n }\n return {};\n },\n 'left-accent': (props: { colorScheme: string; colorMode?: string }) => {\n const { colorScheme: c, colorMode } = props;\n if (colorMode === 'dark') {\n const accent =\n c === 'blue' || c === 'info'\n ? '#7CC0F5'\n : c === 'green' || c === 'success'\n ? '#68D391'\n : c === 'orange' || c === 'yellow' || c === 'warning'\n ? '#F6AD55'\n : 'var(--color-race-red-300, #EF6671)';\n return {\n container: { bg: 'neutral.raised', borderLeftColor: accent },\n icon: { color: accent },\n title: { color: 'neutral.text' },\n description: { color: 'neutral.textMuted' },\n };\n }\n if (c === 'blue' || c === 'info') {\n return {\n container: {\n bg: 'blue.50',\n borderLeftColor: 'blue.500',\n },\n icon: {\n color: 'blue.500',\n },\n };\n }\n return {};\n },\n solid: (props: { colorScheme: string }) => {\n const { colorScheme: c } = props;\n if (c === 'blue' || c === 'info') {\n return {\n container: {\n bg: 'blue.500',\n color: 'white',\n },\n };\n }\n return {};\n },\n },\n },\n\n Table: {\n baseStyle: {\n table: {\n width: '100%',\n borderCollapse: 'collapse',\n borderSpacing: '0',\n borderColor: 'gray.200',\n },\n th: {\n borderColor: 'gray.200',\n borderBottom: 'none',\n bg: 'gray.200',\n color: 'text.secondary',\n fontWeight: 'semibold',\n px: 3,\n py: 2.5,\n minHeight: '44px',\n height: '44px',\n verticalAlign: 'middle',\n },\n td: {\n borderColor: 'gray.200',\n borderBottom: 'none',\n px: 3,\n py: 2.5,\n minHeight: '44px',\n height: '44px',\n verticalAlign: 'middle',\n },\n tr: {\n borderBottom: 'none',\n borderColor: 'transparent',\n _odd: {\n bg: 'card.bg',\n },\n _even: {\n bg: 'gray.50',\n },\n _hover: {\n bg: 'gray.100',\n },\n },\n tbody: {\n tr: {\n _odd: {\n bg: 'card.bg',\n },\n _even: {\n bg: 'gray.50',\n },\n _hover: {\n bg: 'blue.100',\n },\n },\n },\n },\n variants: {\n simple: {},\n striped: {},\n },\n defaultProps: {\n variant: 'striped',\n },\n },\n\n Divider: {\n baseStyle: {\n borderColor: 'border.default',\n },\n },\n};\n","import { extendTheme } from '@chakra-ui/react';\nimport { colors, semanticTokens } from './colors';\nimport { components } from './components';\n\n// Define the theme configuration\n// Chakra's color mode is driven by `politogyColorModeManager` (theme/colorMode),\n// which reads the resolved universal Politogy theme. These values are only the\n// pre-manager default; `useSystemColorMode` stays false on purpose, because the\n// OS scheme is consulted by `resolveTheme('system')` — letting Chakra ALSO watch\n// the media query would give it a second, competing opinion, which is exactly\n// the desync this manager exists to remove.\nconst config = {\n initialColorMode: 'light',\n useSystemColorMode: false,\n};\n\n// Global styles\nconst styles = {\n global: () => ({\n // Body surface comes from the chrome aliases that chrome.css emits in light\n // AND neutral-black dark, so the page follows `.dark` instead of forcing\n // white underneath dark chrome. Chakra's global styles beat app CSS, so\n // hardcoding `white`/`gray.900` here made every app light-only from the\n // inside no matter what the tokens said (Reference/Global-Rules → Dark Mode:\n // the neutral-black rule binds the entire app UI, not just the chrome).\n body: {\n bg: 'var(--color-bg, white)',\n color: 'var(--color-text, #1a202c)',\n },\n ':root': {\n '--mode-primary-color': 'var(--app-color-brand-500)',\n '--mode-input-border-color': 'var(--app-color-brand-500)',\n '--mode-input-hover-border-color': 'var(--app-color-brand-600)',\n '--mode-input-focus-shadow-color': 'var(--app-color-brand-500)',\n },\n // Ensure non-Chakra/native text-like inputs follow mode border colors as well.\n 'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"file\"]):not([type=\"color\"]), textarea, select':\n {\n borderColor: 'var(--mode-input-border-color)',\n },\n 'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"file\"]):not([type=\"color\"]):hover, textarea:hover, select:hover':\n {\n borderColor: 'var(--mode-input-hover-border-color)',\n },\n 'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"file\"]):not([type=\"color\"]):focus, textarea:focus, select:focus':\n {\n borderColor: 'var(--mode-primary-color)',\n boxShadow: '0 0 0 1px var(--mode-input-focus-shadow-color)',\n },\n }),\n};\n\n// Fonts — Brand-token driven, exactly like color.\n//\n// These were hardcoded to the system stack, and because Chakra's global styles\n// beat app CSS, VRM rendered in -apple-system while every app on the native\n// chrome rendered the Brand family. A font change is supposed to ship from the\n// Brand editor without a redeploy, so heading/body resolve `--font-family` (and\n// mono resolves the shared mono token) with the old stacks as the pre-tokens\n// fallback only (Reference/UI-Platform → Typography; HITL 2026-07-23).\nconst SYSTEM_SANS =\n 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif'\nconst SYSTEM_MONO =\n 'SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace'\n\nconst fonts = {\n heading: `var(--font-family, ${SYSTEM_SANS})`,\n body: `var(--font-family, ${SYSTEM_SANS})`,\n mono: `var(--type-mono-family, ${SYSTEM_MONO})`,\n};\n\n// Create and export the theme\nexport const politogyTheme = extendTheme({\n config,\n colors,\n semanticTokens,\n components,\n styles,\n fonts,\n\n // Additional theme configurations\n shadows: {\n outline: '0 0 0 3px var(--app-color-brand-500)',\n },\n\n radii: {\n none: '0',\n sm: '0.125rem',\n base: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n xl: '0.75rem',\n '2xl': '1rem',\n '3xl': '1.5rem',\n full: '9999px',\n },\n});\n\nexport { politogyTheme as default };\n","import type { CSSProperties, ReactNode } from 'react';\ntype CardProps = {\n title?: string;\n children: ReactNode;\n minH?: string | number;\n className?: string;\n style?: CSSProperties;\n [key: string]: unknown;\n};\n\nexport default function Card({\n title,\n children,\n minH,\n className,\n style,\n ...props\n}: CardProps) {\n return (\n <div\n className={`rounded-lg border border-slate-200 bg-white p-6 shadow-sm ${className || ''}`}\n style={{ minHeight: minH, ...style }}\n {...props}\n >\n {title && <h3 className=\"mb-4 text-lg font-semibold\">{title}</h3>}\n {children}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\n\ntype PageContainerProps = {\n children: ReactNode;\n maxW?: string;\n px?: number | string;\n py?: number | string;\n lockHeight?: boolean;\n};\n\nexport default function PageContainer({\n children,\n maxW = 'container.xl',\n px,\n py,\n lockHeight = true,\n}: PageContainerProps) {\n const isFullWidth = maxW === 'full';\n const effectivePx = isFullWidth ? 0 : px === undefined ? 4 : Number(px);\n const effectivePy = py === undefined ? (isFullWidth ? 0 : 4) : py;\n const pxValue = String(effectivePx);\n const pyValue = String(effectivePy);\n\n const maxWClass = isFullWidth\n ? 'max-w-none'\n : maxW === 'container.xl'\n ? 'max-w-7xl'\n : maxW === 'container.lg'\n ? 'max-w-6xl'\n : maxW === 'container.md'\n ? 'max-w-5xl'\n : typeof maxW === 'string' && /^(\\d+)px$/.test(maxW)\n ? ''\n : 'max-w-7xl';\n\n const pxClass =\n pxValue === '0'\n ? 'px-0'\n : pxValue === '1'\n ? 'px-1'\n : pxValue === '2'\n ? 'px-2'\n : pxValue === '3'\n ? 'px-3'\n : pxValue === '4'\n ? 'px-4'\n : 'px-4';\n\n const pyClass =\n pyValue === '0'\n ? 'py-0'\n : pyValue === '4'\n ? 'py-4'\n : pyValue === '5'\n ? 'py-5'\n : pyValue === '6'\n ? 'py-6'\n : 'py-6';\n\n const inlineMaxWStyle =\n typeof maxW === 'string' && /^(\\d+)px$/.test(maxW) ? { maxWidth: maxW } : undefined;\n\n return (\n <main\n className={lockHeight ? 'h-[calc(100vh-80px)] min-h-[calc(100vh-80px)]' : ''}\n style={{ background: 'var(--app-tab-content-bg)' }}\n >\n <div\n className={clsx(\n 'mx-auto w-full',\n maxWClass,\n pxClass,\n pyClass,\n lockHeight ? 'h-full' : 'h-auto'\n )}\n style={inlineMaxWStyle}\n >\n {children}\n </div>\n </main>\n );\n}\n","import { Link } from 'react-router-dom';\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\ntype BreadcrumbItem = {\n label: string;\n href?: string;\n};\n\ntype PageHeaderProps = {\n title?: ReactNode;\n breadcrumbs?: BreadcrumbItem[];\n actions?: ReactNode;\n tabBar?: ReactNode;\n maxW?: string;\n hideSidebar?: boolean;\n};\n\nconst resolveMaxWidthClass = (maxW: string) => {\n if (maxW === 'full') return 'max-w-none';\n if (maxW === 'container.lg') return 'max-w-6xl';\n if (maxW === 'container.md') return 'max-w-5xl';\n return 'max-w-7xl';\n};\n\nexport default function PageHeader({\n title,\n breadcrumbs = [],\n actions = null,\n tabBar = null,\n maxW = 'full',\n hideSidebar = false,\n}: PageHeaderProps) {\n const maxWClass = resolveMaxWidthClass(maxW);\n const titleText = typeof title === 'string' ? title.trim() : '';\n const normalizedTitle = titleText.toLowerCase();\n const breadcrumbsWithoutCurrent = [...breadcrumbs];\n const last = breadcrumbsWithoutCurrent[breadcrumbsWithoutCurrent.length - 1];\n // Only remove a trailing breadcrumb that duplicates the page title when there's\n // still at least one breadcrumb left to show.\n if (\n breadcrumbsWithoutCurrent.length > 1 &&\n normalizedTitle &&\n last &&\n last.label.trim().toLowerCase() === normalizedTitle\n ) {\n breadcrumbsWithoutCurrent.pop();\n }\n\n // Avoid rendering an empty header bar (no title, no breadcrumbs, no actions, no tabs).\n if (!title && breadcrumbsWithoutCurrent.length === 0 && !actions && !tabBar) {\n return null;\n }\n\n return (\n <div\n style={{ backgroundColor: 'var(--app-tab-header-bg, #888888)' }}\n className={clsx('text-slate-100', tabBar ? 'pt-3 pb-0' : 'py-3 border-b border-gray-200', {\n 'md:ml-60': !hideSidebar,\n })}\n >\n <div className={clsx('w-full px-4', maxWClass)}>\n <div className=\"flex w-full flex-nowrap items-start justify-between gap-4\">\n <div className=\"min-w-0 flex-1\">\n {title ? (\n <div className=\"min-w-0\">\n <div className=\"truncate text-lg font-semibold text-white\">{title}</div>\n </div>\n ) : null}\n {breadcrumbsWithoutCurrent.length > 0 ? (\n <nav\n aria-label=\"Breadcrumb\"\n className={clsx('min-w-0 text-slate-100', title ? 'mt-1' : '')}\n >\n <ol className=\"flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600\">\n {breadcrumbsWithoutCurrent.map((item, index) => (\n <li\n key={`${item.label}-${index}`}\n className=\"flex min-w-0 flex-shrink-0 items-center gap-2\"\n >\n {index > 0 ? <span className=\"text-gray-400\">&gt;</span> : null}\n {item.href ? (\n <Link to={item.href} className=\"truncate text-slate-100 hover:underline\">\n {item.label}\n </Link>\n ) : (\n <span className=\"truncate text-slate-100\">{item.label}</span>\n )}\n </li>\n ))}\n </ol>\n </nav>\n ) : null}\n </div>\n {actions ? <div className=\"flex-shrink-0\">{actions}</div> : null}\n </div>\n </div>\n {tabBar ? (\n <div className=\"m-0 w-full px-0\" style={{ backgroundColor: 'transparent' }}>\n {tabBar}\n </div>\n ) : null}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Link } from 'react-router-dom';\nimport clsx from 'clsx';\n\ntype BreadcrumbItem = {\n label: string;\n href?: string;\n};\n\ntype BreadcrumbBarProps = {\n breadcrumbs?: BreadcrumbItem[];\n actions?: ReactNode;\n maxW?: string;\n};\n\nexport default function BreadcrumbBar({\n breadcrumbs = [],\n actions = null,\n maxW = 'full',\n}: BreadcrumbBarProps) {\n if ((!breadcrumbs || breadcrumbs.length === 0) && !actions) {\n return null;\n }\n\n const maxWClass =\n maxW === 'full'\n ? 'max-w-none'\n : maxW === 'container.xl'\n ? 'max-w-7xl'\n : maxW === 'container.lg'\n ? 'max-w-6xl'\n : maxW === 'container.md'\n ? 'max-w-5xl'\n : 'max-w-7xl';\n\n return (\n <div\n className=\"ml-0 border-b border-gray-200 px-4 py-3 md:ml-60\"\n style={{ backgroundColor: 'var(--app-tab-header-bg, #888888)' }}\n >\n <div className={clsx('mx-auto w-full px-0', maxWClass)}>\n <div className=\"flex w-full items-center justify-between\">\n {breadcrumbs && breadcrumbs.length > 0 && (\n <nav aria-label=\"Breadcrumb\">\n <ol className=\"flex items-center gap-2 text-sm text-slate-100\">\n {breadcrumbs.map((item, index) => (\n <li key={index} className=\"flex items-center gap-2\">\n {index > 0 ? <span className=\"text-gray-400\">&gt;</span> : null}\n {item.href ? (\n <Link to={item.href} className=\"text-slate-100 hover:underline\">\n {item.label}\n </Link>\n ) : (\n <span className=\"text-slate-100\">{item.label}</span>\n )}\n </li>\n ))}\n </ol>\n </nav>\n )}\n {actions && <div>{actions}</div>}\n </div>\n </div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { Tooltip } from '@chakra-ui/react';\n\nexport type HeaderTabBarItem = {\n id: string;\n label: string;\n icon: ReactNode;\n disabled?: boolean;\n};\n\ntype HeaderTabBarProps = {\n items: HeaderTabBarItem[];\n activeId: string;\n onChange: (id: string) => void;\n className?: string;\n ariaLabel?: string;\n};\n\nexport default function HeaderTabBar({\n items,\n activeId,\n onChange,\n className,\n ariaLabel = 'Tabs',\n}: HeaderTabBarProps) {\n return (\n <div\n role=\"tablist\"\n aria-label={ariaLabel}\n className={clsx(\n // Header-wide tab strip: background + bottom border only (no outer box).\n 'app-header-tab-bar m-0 flex w-full bg-slate-100 p-0',\n 'border-b border-slate-200',\n className\n )}\n >\n {items.map((item, idx) => {\n const isActive = item.id === activeId;\n const isDisabled = Boolean(item.disabled);\n return (\n <Tooltip\n key={item.id}\n label={item.label}\n placement=\"top\"\n hasArrow\n bg=\"black\"\n color=\"white\"\n isDisabled={isDisabled}\n >\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-label={item.label}\n disabled={isDisabled}\n onClick={() => onChange(item.id)}\n className={clsx(\n 'app-header-tab-button relative inline-flex flex-1 items-center justify-center',\n 'transition-colors',\n 'rounded-none',\n idx === 0 ? 'rounded-tl-lg' : null,\n idx === items.length - 1 ? 'rounded-tr-lg' : null,\n isActive\n ? 'text-white'\n : 'bg-transparent text-slate-600 hover:bg-white/60 hover:text-slate-900',\n isDisabled ? 'cursor-not-allowed opacity-50' : null\n )}\n style={{\n background: isActive\n ? 'var(--mode-primary-color, var(--app-btn-primary-bg))'\n : undefined,\n }}\n >\n <span className=\"inline-flex items-center justify-center text-[14px] leading-none\">\n {item.icon}\n </span>\n </button>\n </Tooltip>\n );\n })}\n </div>\n );\n}\n","import { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\n// Inlined feature-flag check (originally in react/app/src/utils/runtimeFeatureFlags.ts).\n// The shell package is self-contained; keeping this helper local avoids a\n// cross-app import while preserving identical runtime behavior.\nconst FLAG_PREFIX = ['__', 'politogy', 'enable'].join('');\nconst GLOBAL_UI_IDS_FLAG = [FLAG_PREFIX, 'global', 'ui', 'ids'].join('_');\n\nfunction isFlagEnabled(name: string): boolean {\n if (typeof window === 'undefined') return false;\n\n try {\n const params = new URLSearchParams(window.location.search);\n if (params.get(name) === '1') return true;\n } catch {\n // Ignore malformed location access.\n }\n\n try {\n return window.localStorage.getItem(name) === '1';\n } catch {\n return false;\n }\n}\n\nfunction isGlobalUiIdsEnabled(): boolean {\n return isFlagEnabled(GLOBAL_UI_IDS_FLAG);\n}\n\nconst TARGET_SELECTOR = [\n 'main',\n 'header',\n 'footer',\n 'aside',\n 'nav',\n 'section',\n '[role=\"region\"]',\n '[role=\"banner\"]',\n '[role=\"main\"]',\n '[role=\"navigation\"]',\n '[role=\"complementary\"]',\n 'button',\n '[role=\"button\"]',\n 'a[role=\"button\"]',\n 'input',\n 'textarea',\n 'select',\n '[role=\"combobox\"]',\n '[role=\"listbox\"]',\n '[role=\"option\"]',\n '[role=\"textbox\"]',\n '[role=\"tablist\"]',\n '[role=\"tab\"]',\n '[role=\"tabpanel\"]',\n '[role=\"menu\"]',\n '[role=\"menuitem\"]',\n '[role=\"menuitemcheckbox\"]',\n '[role=\"menuitemradio\"]',\n 'svg',\n '[data-icon]',\n].join(',');\n\nfunction sanitizeToken(raw: string | null | undefined, fallback: string): string {\n if (!raw) return fallback;\n const cleaned = raw\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 40);\n return cleaned || fallback;\n}\n\nfunction pageToken(pathname: string): string {\n if (!pathname || pathname === '/') return 'home';\n return sanitizeToken(pathname.replace(/\\//g, '-'), 'page');\n}\n\nfunction inferCategory(el: Element): string {\n const role = (el.getAttribute('role') || '').toLowerCase();\n const tag = el.tagName.toLowerCase();\n\n if (role.includes('tab') || tag === 'tabs') return 'tabs';\n if (role.startsWith('menu') || role === 'menu') return 'menu';\n if (tag === 'button' || role === 'button') return 'button';\n if (tag === 'input' || tag === 'textarea' || tag === 'select' || role === 'combobox')\n return 'field';\n if (tag === 'svg' || el.hasAttribute('data-icon')) return 'icon';\n if (\n ['main', 'header', 'footer', 'aside', 'nav', 'section'].includes(tag) ||\n ['region', 'banner', 'main', 'navigation', 'complementary'].includes(role)\n ) {\n return 'layout';\n }\n\n return 'ui';\n}\n\nfunction inferName(el: Element): string {\n const htmlEl = el as HTMLElement;\n return sanitizeToken(\n el.getAttribute('data-testid') ||\n el.getAttribute('aria-label') ||\n el.getAttribute('name') ||\n el.getAttribute('title') ||\n (htmlEl as HTMLInputElement).placeholder ||\n htmlEl.innerText ||\n el.getAttribute('class'),\n 'item'\n );\n}\n\nfunction assignUiIds(pathname: string): void {\n const used = new Set<string>();\n document.querySelectorAll('[id]').forEach((el) => {\n const id = el.id?.trim();\n if (id) used.add(id);\n });\n\n const counters: Record<string, number> = {};\n const page = pageToken(pathname);\n const elements = document.querySelectorAll(TARGET_SELECTOR);\n\n elements.forEach((el) => {\n const category = inferCategory(el);\n const name = inferName(el);\n const stableKey = `ui-${category}-${name}`;\n\n el.setAttribute('data-ui-category', category);\n el.setAttribute('data-ui-key', stableKey);\n el.setAttribute('data-ui-page', page);\n\n if (el.id) {\n return;\n }\n\n const counterKey = `${page}-${category}-${name}`;\n counters[counterKey] = (counters[counterKey] || 0) + 1;\n\n let nextId = `ui-${page}-${category}-${name}-${counters[counterKey]}`;\n while (used.has(nextId)) {\n counters[counterKey] += 1;\n nextId = `ui-${page}-${category}-${name}-${counters[counterKey]}`;\n }\n\n el.id = nextId;\n used.add(nextId);\n });\n}\n\nexport default function GlobalUiIdProvider() {\n const location = useLocation();\n const enabled = isGlobalUiIdsEnabled();\n\n useEffect(() => {\n if (!enabled) return;\n\n let rafId = 0;\n\n const schedule = () => {\n if (rafId) return;\n rafId = window.requestAnimationFrame(() => {\n rafId = 0;\n assignUiIds(location.pathname);\n });\n };\n\n schedule();\n\n const observer = new MutationObserver(() => {\n schedule();\n });\n\n observer.observe(document.body, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['role', 'aria-label', 'name', 'title', 'placeholder', 'class', 'data-icon'],\n });\n\n return () => {\n if (rafId) window.cancelAnimationFrame(rafId);\n observer.disconnect();\n };\n }, [enabled, location.pathname]);\n\n return null;\n}\n","// Universal theme preference — the ONE cross-app contract.\n//\n// One theme choice (Light / Dark / System) follows the authenticated user\n// across every Politogy app + subdomain. Three layers cooperate:\n// 1. VRM Core `profiles.theme_preference` — source of truth, persisted via\n// the chrome API (`PATCH me/preferences { themePreference }`) and read\n// back from `GET me` (`themePreference`).\n// 2. `.politogyvrm.com` cookie `politogy_theme` — zero-flash pre-paint\n// vehicle that crosses subdomains (auth session cookies are host-only).\n// 3. localStorage `politogy_theme` — offline fallback store.\n//\n// Ported verbatim from contacts/apps/web/src/lib/theme.ts (the origin of the\n// contract) so every app runs the identical behavior from npm. This module is\n// server-safe (no 'use client'): layouts import THEME_PREPAINT_SCRIPT for the\n// pre-paint inline script. The client-side hook lives in ./native\n// (useThemePreference).\n\nexport type ThemePreference = 'light' | 'dark' | 'system'\n\n// Single converged key for BOTH the localStorage store and the\n// cross-subdomain cookie, so a choice in one app is the same key in the next.\nexport const THEME_STORAGE_KEY = 'politogy_theme'\nexport const THEME_COOKIE = 'politogy_theme'\n\n// A local choice that has NOT yet reached VRM Core `profiles.theme_preference`.\n//\n// Politogy ID (auth.politogyvrm.com) has no chrome-API session to PATCH, so a\n// theme picked on the login screen only ever lands in the cookie. Without this\n// marker the next app booted the stale profile value through the reconcile step\n// below and overwrote the user's fresh choice — the \"I set System and it keeps\n// going back to Light\" bug (HITL 2026-07-23). The flag rides the same\n// cross-subdomain cookie so the first app that CAN talk to the chrome API\n// pushes the choice up instead of pulling the stale one down.\nexport const THEME_PENDING_COOKIE = 'politogy_theme_pending'\n\nconst VALID: readonly ThemePreference[] = ['light', 'dark', 'system']\n\nexport function isThemePreference(v: unknown): v is ThemePreference {\n return typeof v === 'string' && (VALID as readonly string[]).includes(v)\n}\n\n/** Read the shared cookie (browser only; null on the server or when unset). */\nexport function readThemeCookie(): ThemePreference | null {\n if (typeof document === 'undefined') return null\n try {\n const m = document.cookie.match(\n new RegExp(`(?:^|;\\\\s*)${THEME_COOKIE}=([^;]+)`),\n )\n const v = m ? decodeURIComponent(m[1]) : null\n return isThemePreference(v) ? v : null\n } catch {\n return null\n }\n}\n\n// Set the cross-subdomain cookie. On a *.politogyvrm.com host we scope it to\n// the parent domain so every app subdomain reads it; on any other host\n// (localhost, *.pages.dev preview) we fall back to a host-only cookie so\n// local/preview theming still works without a mismatched Domain attribute\n// (which browsers silently drop). 1-year, SameSite=Lax, Secure on https.\nexport function writeThemeCookie(pref: ThemePreference): void {\n if (typeof document === 'undefined' || typeof window === 'undefined') return\n const host = window.location.hostname\n const onParentDomain = /(^|\\.)politogyvrm\\.com$/i.test(host)\n const domainAttr = onParentDomain ? '; Domain=.politogyvrm.com' : ''\n const secure = window.location.protocol === 'https:' ? '; Secure' : ''\n document.cookie = `${THEME_COOKIE}=${encodeURIComponent(\n pref,\n )}; Path=/; Max-Age=31536000; SameSite=Lax${domainAttr}${secure}`\n}\n\n// Write an arbitrary cross-subdomain cookie with the same scoping rules as the\n// theme cookie itself (parent domain on *.politogyvrm.com, host-only elsewhere).\nfunction writeSharedCookie(name: string, value: string, maxAgeSeconds: number): void {\n if (typeof document === 'undefined' || typeof window === 'undefined') return\n const host = window.location.hostname\n const domainAttr = /(^|\\.)politogyvrm\\.com$/i.test(host) ? '; Domain=.politogyvrm.com' : ''\n const secure = window.location.protocol === 'https:' ? '; Secure' : ''\n document.cookie = `${name}=${encodeURIComponent(\n value,\n )}; Path=/; Max-Age=${maxAgeSeconds}; SameSite=Lax${domainAttr}${secure}`\n}\n\n/**\n * Mark the current cookie value as a local choice that still has to reach the\n * user's profile. Call this from any surface that changes the theme WITHOUT a\n * chrome-API session (Politogy ID's login screen is the only one today).\n */\nexport function markThemeChoicePending(pref: ThemePreference): void {\n writeSharedCookie(THEME_PENDING_COOKIE, pref, 31536000)\n}\n\n/** The pending (not-yet-persisted) local choice, if any. */\nexport function readPendingThemeChoice(): ThemePreference | null {\n if (typeof document === 'undefined') return null\n try {\n const m = document.cookie.match(\n new RegExp(`(?:^|;\\\\s*)${THEME_PENDING_COOKIE}=([^;]+)`),\n )\n const v = m ? decodeURIComponent(m[1]) : null\n return isThemePreference(v) ? v : null\n } catch {\n return null\n }\n}\n\n/** Clear the pending marker once the choice has been written to the profile. */\nexport function clearPendingThemeChoice(): void {\n writeSharedCookie(THEME_PENDING_COOKIE, '', 0)\n}\n\n/** Resolve a preference to the concrete light/dark it renders as right now. */\nexport function resolveTheme(pref: ThemePreference): 'light' | 'dark' {\n if (pref === 'system') {\n try {\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light'\n } catch {\n return 'light'\n }\n }\n return pref\n}\n\n/**\n * Read the stored preference the way the pre-paint script does — cookie →\n * localStorage → `'system'`. Kept in lockstep with THEME_PREPAINT_SCRIPT so a\n * runtime reader can never disagree with what was applied before paint.\n */\nexport function readStoredThemePreference(): ThemePreference {\n const cookie = readThemeCookie()\n if (cookie) return cookie\n try {\n const stored = window.localStorage.getItem(THEME_STORAGE_KEY)\n if (isThemePreference(stored)) return stored\n } catch {\n /* localStorage may be unavailable (private mode) */\n }\n return 'system'\n}\n\n/**\n * The concrete light/dark the document is rendering as right now.\n *\n * This is the value anything theme-derived must follow — notably Chakra's\n * `colorMode`. Chakra used to be pinned to light while this resolved to dark,\n * which rendered dark chrome tokens over light Chakra content (the \"dark\n * labels on a light page\" desync).\n */\nexport function readResolvedTheme(): 'light' | 'dark' {\n return resolveTheme(readStoredThemePreference())\n}\n\n/** Apply a preference to the document (`.dark` class + color-scheme). */\nexport function applyThemePreference(pref: ThemePreference): void {\n if (typeof document === 'undefined') return\n const resolved = resolveTheme(pref)\n const d = document.documentElement\n d.classList.toggle('dark', resolved === 'dark')\n try {\n d.style.colorScheme = resolved\n } catch {\n /* non-fatal */\n }\n}\n\n// Inline pre-paint script — render it in <head> (or as the first child of\n// <body>) so the theme applies before first paint. Resolves the preference\n// from cookie → localStorage → OS, applies the `.dark` class + `color-scheme`,\n// and seeds localStorage from the cookie so the app hydrates to the synced\n// value (the cross-subdomain flash fix). Self-contained, dependency-free, and\n// wrapped so any failure is silent (never blocks paint).\nexport const THEME_PREPAINT_SCRIPT = `(function(){try{\nvar KEY=${JSON.stringify(THEME_STORAGE_KEY)};\nvar VALID=[\"light\",\"dark\",\"system\"];\nfunction fromCookie(){try{var m=document.cookie.match(/(?:^|;\\\\s*)${THEME_COOKIE}=([^;]+)/);return m?decodeURIComponent(m[1]):null;}catch(e){return null;}}\nvar cookie=fromCookie();\nvar ls=null;try{ls=localStorage.getItem(KEY);}catch(e){}\nvar pref=cookie||ls||\"system\";\nif(VALID.indexOf(pref)===-1)pref=\"system\";\nif(cookie&&cookie!==ls){try{localStorage.setItem(KEY,cookie);}catch(e){}}\nvar resolved=pref;\nif(pref===\"system\"){try{resolved=window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\";}catch(e){resolved=\"light\";}}\nvar d=document.documentElement;\nif(resolved===\"dark\"){d.classList.add(\"dark\");}else{d.classList.remove(\"dark\");}\ntry{d.style.colorScheme=resolved;}catch(e){}\n}catch(e){}})();`\n","'use client'\n\n// Chakra's color mode is a SLAVE to the universal Politogy theme preference.\n//\n// Two independent theme systems used to run side by side inside the shell:\n//\n// 1. `theme-preference.ts` — the cross-app contract. Resolves the stored\n// preference (cookie -> localStorage -> `'system'`) and toggles `.dark` on\n// <html>, which is what makes the Brand stylesheet's complete `.dark {}`\n// win for every `--app-*` / `--sidebar-*` / `--topbar-*` token.\n// 2. Chakra, pinned to light by `politogyTheme`'s\n// `config.initialColorMode: 'light'` + `useSystemColorMode: false`.\n//\n// So any user whose resolved theme was dark — including the DEFAULT `'system'`\n// on a machine with a dark OS appearance — got dark chrome token values over\n// light Chakra content: a near-black sidebar and top bar beside a white page,\n// and floating field labels whose `--app-floating-label-bg` resolved dark while\n// their text stayed a light-mode slate. That reads as a wrong colour but it is\n// a desync: both halves were internally correct and simply disagreed.\n//\n// The fix is to give Chakra no opinion of its own. This manager makes Chakra\n// READ the resolved Politogy theme, and `ChakraColorModeSync` keeps it in step\n// as the preference changes. Writes are deliberately dropped: the My Account\n// Appearance control owns the preference, and `applyThemePreference` +\n// `writeThemeCookie` are the only writers.\n\nimport { useEffect } from 'react'\nimport { useColorMode, type ColorMode } from '@chakra-ui/react'\nimport { readResolvedTheme, THEME_STORAGE_KEY } from '../theme-preference'\n\ninterface ColorModeManager {\n type: 'localStorage' | 'cookie'\n ssr?: boolean\n get(init?: ColorMode): ColorMode | undefined\n set(value: ColorMode): void\n}\n\n/**\n * Pass as `<ChakraProvider colorModeManager={politogyColorModeManager}>`. Chakra\n * then boots in whatever light/dark the pre-paint script already applied, so\n * there is no light-Chakra-over-dark-chrome frame on first render.\n */\nexport const politogyColorModeManager: ColorModeManager = {\n type: 'localStorage',\n ssr: false,\n get(init) {\n if (typeof window === 'undefined') return init\n return readResolvedTheme()\n },\n set() {\n // Intentionally a no-op. Chakra must never persist a color mode of its own —\n // that is how the two systems drifted apart. The preference is written only\n // by the Appearance control via writeThemeCookie/applyThemePreference.\n },\n}\n\n/**\n * Keeps Chakra's `colorMode` equal to the resolved Politogy theme for the life\n * of the app. Render once inside `ChakraProvider`.\n *\n * Mirrors the live-sync surface documented in the theme contract: the shell's\n * own preference event, `storage` for same-app tabs, `focus` /\n * `visibilitychange` cookie re-reads for cross-app tabs, and the OS media query\n * so `'system'` follows the scheme live.\n */\nexport function ChakraColorModeSync(): null {\n const { colorMode, setColorMode } = useColorMode()\n\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const sync = () => {\n const resolved = readResolvedTheme()\n if (resolved !== colorMode) setColorMode(resolved)\n }\n\n sync()\n\n window.addEventListener('politogy:theme-preference', sync)\n window.addEventListener('storage', sync)\n window.addEventListener('focus', sync)\n document.addEventListener('visibilitychange', sync)\n\n // matchMedia is not universally present (jsdom without the polyfill, some\n // embedded webviews), and `resolveTheme` already tolerates its absence — so\n // losing the live OS-scheme watch must never throw and take the app's render\n // down with it. Everything above still keeps the theme in step.\n let unwatchMedia = () => {}\n try {\n const media = window.matchMedia('(prefers-color-scheme: dark)')\n media.addEventListener('change', sync)\n unwatchMedia = () => media.removeEventListener('change', sync)\n } catch {\n /* no live OS-scheme watch available */\n }\n\n return () => {\n window.removeEventListener('politogy:theme-preference', sync)\n window.removeEventListener('storage', sync)\n window.removeEventListener('focus', sync)\n document.removeEventListener('visibilitychange', sync)\n unwatchMedia()\n }\n }, [colorMode, setColorMode])\n\n return null\n}\n\nexport { THEME_STORAGE_KEY }\n","import { createContext, useEffect, useMemo, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { ChakraProvider } from '@chakra-ui/react'\nimport type { Session } from '@supabase/supabase-js'\nimport { politogyTheme } from '../theme'\nimport {\n ChakraColorModeSync,\n politogyColorModeManager,\n} from '../theme/colorMode'\nimport type {\n AppRegistryEntry,\n ShellAuthStatus,\n ShellAuthValue,\n ShellFooterValue,\n ShellLinkedAccountsValue,\n ShellModeValue,\n ShellNavItemsValue,\n ShellNavigationPreferenceValue,\n ShellOrganizationValue,\n ShellProviderProps,\n ShellRoleValue,\n ShellSupportValue,\n ShellUser,\n} from '../types'\n\nexport const ShellAuthContext = createContext<ShellAuthValue | null>(null)\n\ninterface ShellMetaValue {\n currentApp: string\n appRegistry: AppRegistryEntry[]\n basename: string\n}\n\nexport const ShellMetaContext = createContext<ShellMetaValue | null>(null)\n\nexport const ShellOrgContext = createContext<ShellOrganizationValue | null>(null)\nexport const ShellLinkedAccountsContext = createContext<ShellLinkedAccountsValue | null>(null)\nexport const ShellSupportProviderContext = createContext<ShellSupportValue | null>(null)\nexport const ShellModeContext = createContext<ShellModeValue | null>(null)\nexport const ShellNavItemsContext = createContext<ShellNavItemsValue | null>(null)\nexport const ShellNavigationPreferenceContext =\n createContext<ShellNavigationPreferenceValue | null>(null)\nexport const ShellRoleContext = createContext<ShellRoleValue | null>(null)\nexport const ShellFooterContext = createContext<ShellFooterValue | null>(null)\n\nexport interface ShellChromeValue {\n devNotesMenu: ReactNode | null\n myProfileHref: string\n brandLogoSrc?: string\n headerIconsSlot?: ReactNode\n organizationSettingsHref?: string\n showContinueOnboarding?: boolean\n onContinueOnboarding?: () => void\n pageTitle?: string\n breadcrumbs?: Array<{ label: string; href?: string }>\n headerActions?: ReactNode\n /** Avatar URL override for UserMenu. Apps that store the avatar in their own\n * profile table or localStorage should pass it here. */\n userAvatarUrl?: string\n}\n\nexport const ShellChromeContext = createContext<ShellChromeValue | null>(null)\n\nfunction toShellUser(session: Session | null): ShellUser | null {\n if (!session?.user) return null\n const su = session.user\n const fullName = (su.user_metadata as { full_name?: string } | null)?.full_name ?? null\n return {\n id: su.id,\n email: su.email ?? null,\n displayName: fullName ?? su.email ?? null,\n raw: su,\n }\n}\n\nexport function ShellProvider({\n children,\n supabaseClient,\n auth,\n currentApp,\n appRegistry,\n basename,\n organization,\n linkedAccounts,\n support,\n devNotesMenu,\n myProfileHref,\n userAvatarUrl,\n}: ShellProviderProps) {\n const [status, setStatus] = useState<ShellAuthStatus>('loading')\n const [session, setSession] = useState<Session | null>(null)\n\n useEffect(() => {\n // Host-driven auth (or no client at all): Supabase session tracking is off.\n if (auth || !supabaseClient) {\n setSession(null)\n if (!auth) setStatus('unauthenticated')\n return\n }\n let cancelled = false\n supabaseClient.auth.getSession().then(({ data }) => {\n if (cancelled) return\n setSession(data.session)\n setStatus(data.session ? 'authenticated' : 'unauthenticated')\n })\n const sub = supabaseClient.auth.onAuthStateChange((_event, newSession) => {\n setSession(newSession)\n setStatus(newSession ? 'authenticated' : 'unauthenticated')\n })\n return () => {\n cancelled = true\n sub.data.subscription.unsubscribe()\n }\n }, [supabaseClient, auth])\n\n const value = useMemo<ShellAuthValue>(() => {\n if (auth) {\n return {\n status: auth.status,\n session: null,\n user: auth.user,\n signOut: async () => {\n await auth.signOut()\n },\n }\n }\n return {\n status,\n session,\n user: toShellUser(session),\n signOut: async () => {\n await supabaseClient?.auth.signOut()\n },\n }\n }, [auth, status, session, supabaseClient])\n\n const meta = useMemo<ShellMetaValue>(\n () => ({\n currentApp,\n appRegistry: appRegistry ?? [],\n basename: basename ?? '',\n }),\n [currentApp, appRegistry, basename],\n )\n\n const chrome = useMemo<ShellChromeValue>(\n () => ({\n devNotesMenu: devNotesMenu ?? null,\n myProfileHref: myProfileHref ?? '/my-profile',\n userAvatarUrl,\n }),\n [devNotesMenu, myProfileHref, userAvatarUrl],\n )\n\n return (\n <ShellAuthContext.Provider value={value}>\n <ShellMetaContext.Provider value={meta}>\n <ShellOrgContext.Provider value={organization ?? null}>\n <ShellLinkedAccountsContext.Provider value={linkedAccounts ?? null}>\n <ShellSupportProviderContext.Provider value={support ?? null}>\n <ShellModeContext.Provider value={null}>\n <ShellNavItemsContext.Provider value={null}>\n <ShellNavigationPreferenceContext.Provider value={null}>\n <ShellRoleContext.Provider value={null}>\n <ShellFooterContext.Provider value={null}>\n <ShellChromeContext.Provider value={chrome}>\n <ChakraProvider\n theme={politogyTheme}\n colorModeManager={politogyColorModeManager}\n >\n <ChakraColorModeSync />\n {children}\n </ChakraProvider>\n </ShellChromeContext.Provider>\n </ShellFooterContext.Provider>\n </ShellRoleContext.Provider>\n </ShellNavigationPreferenceContext.Provider>\n </ShellNavItemsContext.Provider>\n </ShellModeContext.Provider>\n </ShellSupportProviderContext.Provider>\n </ShellLinkedAccountsContext.Provider>\n </ShellOrgContext.Provider>\n </ShellMetaContext.Provider>\n </ShellAuthContext.Provider>\n )\n}\n","import { useContext } from 'react'\nimport { ShellAuthContext } from '../providers/ShellProvider'\nimport type { ShellAuthValue } from '../types'\n\nexport function useShellAuth(): ShellAuthValue {\n const ctx = useContext(ShellAuthContext)\n if (!ctx) {\n throw new Error('useShellAuth must be used inside <ShellProvider>')\n }\n return ctx\n}\n","import { useContext } from 'react'\nimport { ShellMetaContext } from '../providers/ShellProvider'\nimport type { AppRegistryEntry } from '../types'\n\nexport function useAppRegistry(): AppRegistryEntry[] {\n const meta = useContext(ShellMetaContext)\n if (!meta) {\n throw new Error('useAppRegistry must be used inside <ShellProvider>')\n }\n return meta.appRegistry\n}\n\nexport function useCurrentApp(): string {\n const meta = useContext(ShellMetaContext)\n if (!meta) {\n throw new Error('useCurrentApp must be used inside <ShellProvider>')\n }\n return meta.currentApp\n}\n","import { useContext } from 'react'\nimport { ShellOrgContext } from '../providers/ShellProvider'\nimport type { ShellOrganizationValue } from '../types'\n\n/**\n * Returns the organization value supplied to ShellProvider, or null if the\n * host app didn't pass an `organization` prop. Returning null lets chrome\n * components (e.g., <OrgSelector />) render nothing instead of erroring.\n */\nexport function useShellOrganization(): ShellOrganizationValue | null {\n return useContext(ShellOrgContext)\n}\n","import { useContext } from 'react'\nimport { ShellLinkedAccountsContext } from '../providers/ShellProvider'\nimport type { ShellLinkedAccountsValue } from '../types'\n\n/**\n * Returns the linked-accounts value supplied to ShellProvider, or null if not\n * provided. UserMenu uses this to decide whether to render the\n * \"switch account\" section.\n */\nexport function useShellLinkedAccounts(): ShellLinkedAccountsValue | null {\n return useContext(ShellLinkedAccountsContext)\n}\n","import { useContext } from 'react'\nimport { ShellSupportProviderContext } from '../providers/ShellProvider'\nimport type { ShellSupportValue } from '../types'\n\n/**\n * Returns the support handler supplied to ShellProvider, or null if not\n * provided. SupportRequestButton uses this to decide whether to render.\n */\nexport function useShellSupport(): ShellSupportValue | null {\n return useContext(ShellSupportProviderContext)\n}\n","import { useContext } from 'react'\nimport { ShellChromeContext } from '../providers/ShellProvider'\nimport type { ShellChromeValue } from '../providers/ShellProvider'\n\nexport type { ShellChromeValue }\n\n/**\n * Returns chrome-level options supplied to ShellProvider/ShellChrome\n * (devNotesMenu slot, myProfileHref, header data, brand logo src, etc.).\n * Throws if used outside <ShellProvider>.\n */\nexport function useShellChrome(): ShellChromeValue {\n const ctx = useContext(ShellChromeContext)\n if (!ctx) {\n throw new Error('useShellChrome must be used inside <ShellProvider>')\n }\n return ctx\n}\n","import { useContext } from 'react'\nimport { ShellModeContext } from '../providers/ShellProvider'\nimport type { ShellModeValue } from '../types'\n\n/**\n * Returns the mode value supplied to ShellProvider/ShellChrome, or null if\n * the host app didn't pass a `mode` prop. Components like <ModePill /> use\n * this to conditionally render.\n */\nexport function useShellMode(): ShellModeValue | null {\n return useContext(ShellModeContext)\n}\n","import { useContext } from 'react'\nimport { ShellNavItemsContext } from '../providers/ShellProvider'\nimport type { ShellNavItemsValue } from '../types'\n\n/**\n * Returns the nav items value supplied to ShellChrome, or null if the host\n * app didn't pass a `navItems` prop. The sidebar uses this to decide what\n * rows to render.\n */\nexport function useShellNavItems(): ShellNavItemsValue | null {\n return useContext(ShellNavItemsContext)\n}\n","import { useContext } from 'react'\nimport { ShellNavigationPreferenceContext } from '../providers/ShellProvider'\nimport type { ShellNavigationPreferenceValue } from '../types'\n\n/**\n * Returns the user's navigation rendering preference supplied to\n * ShellChrome, or null if not provided. NavItem uses this to decide\n * whether to expand sub-menus.\n */\nexport function useShellNavigationPreference(): ShellNavigationPreferenceValue | null {\n return useContext(ShellNavigationPreferenceContext)\n}\n","import { useContext } from 'react'\nimport { ShellRoleContext } from '../providers/ShellProvider'\nimport type { ShellRoleValue } from '../types'\n\n/**\n * Returns the active-role info supplied to ShellChrome, or null if not\n * provided. UserMenu uses this to render the ROLES & ORGANIZATIONS badge.\n */\nexport function useShellRole(): ShellRoleValue | null {\n return useContext(ShellRoleContext)\n}\n","import { useContext } from 'react'\nimport { ShellFooterContext } from '../providers/ShellProvider'\nimport type { ShellFooterValue } from '../types'\n\n/**\n * Returns the footer data supplied to ShellChrome (links, commit/version\n * info), or null if not provided. The Sidebar footer reads this to render\n * Privacy / Terms / Subscriptions + commit copy button.\n */\nexport function useShellFooter(): ShellFooterValue | null {\n return useContext(ShellFooterContext)\n}\n","import type { CSSProperties } from 'react'\n\nexport interface BrandLogoProps {\n src?: string\n alt?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * Mode-aware brand logo rendered in the sidebar header. The host app\n * supplies `src` (e.g., a different image per mode); the shell wraps it\n * in a non-draggable <img> so it never accidentally drags on click.\n *\n * Render returns null when no src is supplied so consuming chrome can\n * gracefully omit the slot.\n */\nexport function BrandLogo({ src, alt = 'Brand', className, style }: BrandLogoProps) {\n if (!src) return null\n return (\n <img\n src={src}\n alt={alt}\n className={className}\n style={style}\n draggable={false}\n />\n )\n}\n\nexport default BrandLogo\n","import type { CSSProperties } from 'react'\n\nexport interface BrandIconProps {\n /** Brand-icon name keyed off `/brand/icons/<name>.svg` in the app's public dir. */\n name: string\n /** Pixel size shorthand — sets both width and height. */\n size?: number\n className?: string\n style?: CSSProperties\n alt?: string\n /** Optional prefix for the icon path. Defaults to '/brand/icons/'. */\n basePath?: string\n}\n\n/**\n * Brand-icon component used by sidebar NavItems. The actual SVG assets live\n * in the consuming app's `public/brand/icons/<name>.svg` — shell never\n * imports them directly, only references them by URL.\n */\nexport function BrandIcon({\n name,\n size,\n className,\n style,\n alt,\n basePath = '/brand/icons/',\n}: BrandIconProps) {\n const a11yLabel = alt ?? ''\n const isDecorative = a11yLabel === ''\n const inlineSize = size ? { width: size, height: size, ...style } : style\n\n return (\n <img\n src={`${basePath}${name}.svg`}\n alt={a11yLabel}\n role={isDecorative ? 'presentation' : undefined}\n aria-hidden={isDecorative ? true : undefined}\n className={className}\n style={inlineSize}\n draggable={false}\n />\n )\n}\n\nexport default BrandIcon\n","// Color + badge helpers used by sidebar/header chrome. Ported verbatim from\n// react/app/src/layouts/AuthenticatedLayout.tsx (lines 725–786, 2026-05-13).\n\nconst HEX_COLOR_PATTERN = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/\n\n/** Returns a normalized 7-char hex color, or null if the input isn't valid. */\nexport function normalizeHexColor(value?: string | null): string | null {\n const trimmed = value?.trim()\n if (!trimmed || !HEX_COLOR_PATTERN.test(trimmed)) return null\n if (trimmed.length === 7) return trimmed\n const [r, g, b] = trimmed.slice(1).split('')\n return `#${r}${r}${g}${g}${b}${b}`\n}\n\n/**\n * Returns an `rgba(...)` string lightened toward white by `amount` (0–1),\n * or null if the input isn't a valid hex.\n */\nexport function hexToRgba(hex: string, alpha: number): string | null {\n const normalized = normalizeHexColor(hex)\n if (!normalized) return null\n const red = parseInt(normalized.slice(1, 3), 16)\n const green = parseInt(normalized.slice(3, 5), 16)\n const blue = parseInt(normalized.slice(5, 7), 16)\n return `rgba(${red}, ${green}, ${blue}, ${alpha})`\n}\n\n/**\n * Returns a hex color that is `amount` (0–1) blended from `hex` toward\n * white. Used for the org-menu hover background.\n */\nexport function lightenHexColor(hex: string, amount: number): string | null {\n const normalized = normalizeHexColor(hex)\n if (!normalized) return null\n\n const clamp = (value: number) => Math.max(0, Math.min(255, Math.round(value)))\n const blend = (channel: number) => clamp(channel + (255 - channel) * amount)\n\n const red = parseInt(normalized.slice(1, 3), 16)\n const green = parseInt(normalized.slice(3, 5), 16)\n const blue = parseInt(normalized.slice(5, 7), 16)\n\n return `#${blend(red).toString(16).padStart(2, '0')}${blend(green)\n .toString(16)\n .padStart(2, '0')}${blend(blue).toString(16).padStart(2, '0')}`\n}\n\n/**\n * Reads `settings.brand_colors[0].value` off an org-like input and returns\n * the first valid normalized hex. Returns null if the input doesn't have\n * a usable brand color.\n */\nexport function getOrganizationBrandColor(organization?: {\n brandColor?: string | null\n settings?: {\n brand_colors?: Array<{ value?: string | null }> | null\n } | null\n} | null): string | null {\n if (!organization) return null\n // Direct brandColor (shell's ShellOrganization shape).\n const direct = normalizeHexColor(organization.brandColor)\n if (direct) return direct\n // Legacy settings.brand_colors shape.\n const brandColors = Array.isArray(organization.settings?.brand_colors)\n ? organization.settings?.brand_colors\n : []\n const firstBrandColor = brandColors?.find(\n (entry) => typeof entry?.value === 'string' && normalizeHexColor(entry.value),\n )\n return normalizeHexColor(firstBrandColor?.value ?? null)\n}\n\n/**\n * Returns the two-letter badge for an organization name (e.g., \"The Portland\n * Company\" -> \"TP\"). Falls back to \"OR\" when the input has no letters.\n */\nexport function getOrganizationBadgeLetters(name?: string | null): string {\n const normalizedName = String(name || '')\n .trim()\n .replace(/[^a-zA-Z0-9\\s]+/g, ' ')\n const parts = normalizedName.split(/\\s+/).filter(Boolean)\n\n if (parts.length >= 2) {\n return `${parts[0][0] || ''}${parts[1][0] || ''}`.toUpperCase()\n }\n\n const compact = parts[0] || normalizedName.replace(/\\s+/g, '')\n return compact.slice(0, 2).toUpperCase() || 'OR'\n}\n","// Display-name helper for user-menu / avatar fallbacks. Ported from\n// react/app/src/layouts/AuthenticatedLayout.tsx line 697 (2026-05-13).\n\ninterface UserLike {\n profile?: {\n full_name?: string | null\n name?: string | null\n } | null\n user_metadata?: {\n full_name?: string | null\n name?: string | null\n } | null\n email?: string | null\n}\n\n/**\n * Resolves a user-facing display name from a user object. Tries profile\n * fields first, then user_metadata, then the email local-part, then the\n * raw email, finally falling back to \"User\".\n */\nexport function getUserDisplayName(user: UserLike | null | undefined): string {\n if (!user) return 'User'\n return (\n user.profile?.full_name ||\n user.profile?.name ||\n user.user_metadata?.full_name ||\n user.user_metadata?.name ||\n (typeof user.email === 'string' ? user.email.split('@')[0] : '') ||\n user.email ||\n 'User'\n )\n}\n","export interface RegisterShellPrecacheOptions {\n /** Path the host app serves the SW from. Default: '/sw-shell.js'. */\n scriptUrl?: string\n /** Scope the SW controls. Default: '/'. */\n scope?: string\n}\n\n/**\n * Register the shell precache service worker. Silently no-ops in browsers that\n * don't support service workers (e.g., old Safari) and during SSR.\n *\n * Hosts must copy `node_modules/@the-portland-company/shell/dist/shell-precache.worker.js`\n * to the URL specified by `scriptUrl` (default `/sw-shell.js`) in their public\n * directory so the browser can fetch it at registration time.\n */\nexport async function registerShellPrecache(opts: RegisterShellPrecacheOptions = {}): Promise<void> {\n if (typeof window === 'undefined') return\n if (!('serviceWorker' in navigator)) return\n const scriptUrl = opts.scriptUrl ?? '/sw-shell.js'\n const scope = opts.scope ?? '/'\n try {\n await navigator.serviceWorker.register(scriptUrl, { scope })\n } catch (err) {\n // Registration failures are not user-visible. Log for ops, swallow.\n // eslint-disable-next-line no-console\n console.warn('[shell] precache SW registration failed:', err)\n }\n}\n","import type { AppRegistryEntry } from '../types'\n\n/**\n * Build a Speculation Rules JSON payload that prerenders other apps in the\n * registry on moderate eagerness. Returns null when there are no eligible\n * other apps to prerender (e.g., this is the only app in the registry).\n *\n * The host app is expected to render this as\n * `<script type=\"speculationrules\">{json}</script>` in <head> at runtime.\n */\nexport function buildSpeculationRules(\n currentApp: string,\n registry: AppRegistryEntry[],\n): string | null {\n const others = registry.filter(\n (entry) => entry.id !== currentApp && entry.visible !== false,\n )\n if (others.length === 0) return null\n const payload = {\n prerender: [\n {\n urls: others.map((entry) => entry.path),\n eagerness: 'moderate' as const,\n },\n ],\n }\n return JSON.stringify(payload)\n}\n"]}