);
}
/* ── NAV ────────────────────────────────────────────────────── */
/* The inline links need ~1000px (more in some languages); below that the
menu button takes over, while spacing stays desktop above MOBILE_MAX. */
const NAV_LINKS_MIN = 1000;
function Nav({ th, pill, L, lang, setLang }) {
const phone = useIsMobile();
const m = useViewportWidth() < NAV_LINKS_MIN;
const [sc,setSc]=useState(false);
const [menu,setMenu]=useState(false);
useEffect(()=>{ const fn=()=>setSc(window.scrollY>50); window.addEventListener('scroll',fn,{passive:true}); return ()=>window.removeEventListener('scroll',fn); },[]);
useEffect(()=>{ if(!m) setMenu(false); },[m]);
const solid = sc || menu;
return (
);
}
/* ── HERO ───────────────────────────────────────────────────── */
/* The app's Home and a habit's community count, with a challenge and the buddy floating around them. */
const HERO_CHIPS = [
{ key:'challenge', icon:'⏳', color:'#F47215', pos:{ top:400, insetInlineStart:0 } },
{ key:'buddy', img:'boy', color:'#2563EB', pos:{ bottom:20, insetInlineEnd:0 } },
];
/* Two phones: today's Home in front (Done or Not today), the crowd behind it. */
const HERO_BACK_SCALE = 0.86;
/* Floats beside the phone on wide screens; on a phone the chips sit in a row under it. */
function FloatChip({ icon, img, color, title, sub, style }) {
return (
{img ? : icon}
{title}
{sub}
);
}
/* Live numbers under the store badges: today, this week and the people
active, with the last 14 days as a small column trend (today in the accent).
Anything the server held back as too small is left out. */
const HERO_LIVE_KEYS = [['todayCompletions','today'], ['weekCompletions','week'], ['activeMembers','people']];
function HeroLive({ th, L, m, centered }) {
const S = window.LANDING_STATS || {};
const daily = (window.LANDING_TRENDS || {}).daily || [];
const figures = HERO_LIVE_KEYS.filter(([k]) => S[k] != null);
if (!figures.length) return null;
const max = Math.max(1, ...daily.map(d=>d.completions));
return (
{figures.map(([k,label],i)=>(
{i===0 && }
{L.hero.live[label]}
))}
{daily.length > 0 && (
{daily.map((d,i)=>(
))}
{L.hero.live.trend}
)}
);
}
function Hero({ th, layout, L, dir }) {
const m = useIsMobile();
const vw = useViewportWidth();
const split = layout==='split' && vw >= 1000;
const textBlock = (
);
}
/* ── MISS A DAY (streak apps vs. UpWeDo) ───────────────────── */
/* A two-way switch flips between a normal day and a missed one: the streak
app falls to zero; UpWeDo has no streak, so the week's active days just
count one fewer and nothing resets. The result panels flip it too. */
function MissADay({ L }) {
const m = useIsMobile();
const c = L.missDay;
const [missed,setMissed] = useState(false);
const [tried,setTried] = useState(false);
const choose = v => { setTried(true); setMissed(v); };
const option = (value, label, emoji) => {
const on = missed===value;
return (
);
};
const panel = (side, good) => {
const d = c[side];
const tone = !missed ? '#111827' : good ? '#16A34A' : '#DC2626';
return (
);
};
return (
);
}
/* ── PLAN LIMITS (live from window.PLAN_LIMITS; null = unlimited) ── */
/* Groups are hidden in the app for now, so their limits are not shown. */
const HIDDEN_LIMITS = new Set(['groups','groupMembers','orgGroups']);
function PlanLimitRows({ limits, t, loc, featured }) {
return (
);
}
/* ── PRICING ────────────────────────────────────────────────── */
function Pricing({ accent, L }) {
const m = useIsMobile();
/* Three plans side by side need ~1000px; narrower, one centred column (no 2 + 1 split). */
const single = useViewportWidth() < 1000;
return (
{L.pricing.kicker}
{L.pricing.h2}
{L.pricing.plans.map((p,i)=>{
const featured = i===1;
const live = (window.PLAN_PRICES||{})[p.key];
const price = live ? live.monthly : p.price;
const sub = live ? `${p.sub} · ${L.pricing.annual.replace('{price}', live.annual)}` : p.sub;
/* Paid plans can't be bought yet: their button says so instead of starting a trial. */
const paid = p.key!=='free';
const limits = (window.PLAN_LIMITS||{})[p.key] || [];
return (
{featured&&
{L.pricing.popular}
}
{/* Paid plans show no price until they can be bought: the plan name takes the price's place. */}
{paid
?