/* Общие компоненты сайта: роутер, шапка, подвал, переиспользуемые блоки */ const A = window.ALTER; // ---------- router (pathname: /blog, /rutina, …) ---------- function parsePath() { let path = decodeURIComponent(location.pathname || '/') || '/'; if (!path.startsWith('/')) path = '/' + path; path = path.replace(/\/$/, '') || '/'; const query = Object.fromEntries(new URLSearchParams(location.search || '')); return { path, query, full: path + (location.search || '') }; } function navigate(to) { const url = to || '/'; if (url === location.pathname + location.search) { window.scrollTo(0, 0); return; } history.pushState(null, '', url); window.dispatchEvent(new PopStateEvent('popstate')); } function useRoute() { const [r, setR] = React.useState(parsePath()); React.useEffect(() => { const on = () => { setR(parsePath()); window.scrollTo(0, 0); }; window.addEventListener('popstate', on); return () => window.removeEventListener('popstate', on); }, []); return r; } function L({ to, children, className, style, onClick }) { return ( { if (onClick) onClick(e); if (e.defaultPrevented) return; if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return; e.preventDefault(); navigate(to); }} >{children} ); } const DIAG = '/diagnostika'; function UrlBar({ path, tpl }) { return null; } function Stripe() { return Бесплатная диагностика процессов: 30–40 минут, после неё у вас будет готовый план. Записаться →; } function Header({ path, theme, setTheme }) { const [open, setOpen] = React.useState(false); React.useEffect(() => setOpen(false), [path]); return (
ЗА Записки автоматизатораНаталия Вершинина · IT & AI {setTheme && } Диагностика
{A.nav.map((n, i) => n.children ? (
{n.label}
{n.children.map(c => {c.label})}
) : {n.label})}
Записаться на диагностику
); } function Footer() { return ( ); } // ---------- shared blocks ---------- function SecHead({ n, eyebrow, title, lead, right }) { return (
{n && {n}}{eyebrow}

{title}

{lead &&

{lead}

}
{right}
); } function Crumbs({ items }) { return
{items.map((it, i) => ( {i > 0 && /}{it.to ? {it.label} : {it.label}} ))}
; } function PainTiles({ only }) { const list = only ? A.pains.filter(p => only.includes(p.slug)) : A.pains; return (
{list.map(p => ( {p.n} · /{p.slug}

{p.title}

{p.quote} Разобрать→
))}
); } function BeforeAfter({ was, now, title = 'Было / стало' }) { return (
Было
Стало
); } function Steps() { return (
{A.process.map(([h, p, t], i) => (
STEP_{String(i + 1).padStart(2, '0')}

{h}

{p}

{t}
))}
); } /* Ira2: на карточке витрины — title + результат; стек/метки только внутри кейса. */ function CaseCard({ c }) { if (!c || !c.slug) return null; return (
{c.img ? {c.title :
{c.phLabel || 'обложка кейса'}
}

{c.title}

Результат{c.res}
); } function PriceCards() { return (
{A.prices.map(p => (
{p.name}
{p.amt} {p.unit}
{p.note}
{p.cta}
))}
); } function Faq({ items }) { return
{items.map(([q, a], i) => (
{q}

{a}

))}
; } function ReviewCards({ items = A.reviews }) { return (
{items.map(([t, who, ctx], i) => (
“

«{t}»

фото
{who}
{ctx}
))}
); } function postSkin(slug, hasImg) { let h = 0; const s = String(slug || ''); for (let i = 0; i < s.length; i++) h = (h * 31 + s.charCodeAt(i)) >>> 0; const kinds = hasImg ? ['green', 'black', 'white', 'image'] : ['green', 'black', 'white']; return kinds[h % kinds.length]; } /** Рубрика карточки блога — только боль. Без «Записки» / миров Завода. */ const STUDIO_WORLD_CATS = new Set([ 'Ренессанс', 'Fallout', 'Сибирь', 'Syberia', 'renaissance', 'syberia', 'renessans', 'sibir', 'fallout', 'Записки', 'Выпуск', ]); function blogPublicCat(p) { if (!p) return ''; const first = (Array.isArray(p.pains) && p.pains[0]) || p.pain || ''; const pain = first && A.painBy && A.painBy[first]; if (pain && pain.title) return pain.title; return ''; } function PostCard({ p, big, skin: skinProp }) { const skin = skinProp || postSkin(p.slug, Boolean(p.figure_url)); if (skin === 'image' && p.figure_url) { return (

{p.title}

Читать
); } return (
{blogPublicCat(p) ? {blogPublicCat(p)} : null}{p.date}{p.min} мин

{p.title}

{p.lead}

Читать
); } function TgChat({ compact }) { return (
Здравствуйте! Я помощник Наталии. Расскажите в двух словах, что в процессах хочется упростить?10:02
Заявки теряются, отвечаем медленно10:03
Поняла. Как к вам обращаться — и удобнее телефон, Telegram или Max? Я передам Наталии, обычно отвечает в течение дня.10:03
{!compact &&
Анна, @anna_co, лучше писать после 18:0010:04
} {!compact &&
Записала и передаю Наталии. Спасибо!10:04
}
); } function FinalCTA({ title = 'Давайте найдём, что у вас можно автоматизировать', sub }) { return (
CTAДиагностика бесплатно

{title}

{sub || 'Напишите боту в Telegram: помощник уточнит, что улучшить в процессах, и передаст заявку Наталии. На разговоре разберём процессы и составим план. Без обязательств.'}

➤Записаться в Telegram Как проходит диагностика
@automatizatorvdele_bot● online
); } function Hand({ children, style, rot = -2 }) { return {children}; } Object.assign(window, { useRoute, L, DIAG, UrlBar, Stripe, Header, Footer, SecHead, Crumbs, PainTiles, BeforeAfter, Steps, CaseCard, PriceCards, Faq, ReviewCards, PostCard, postSkin, blogPublicCat, STUDIO_WORLD_CATS, TgChat, FinalCTA, Hand });