{"manifest":{"id":"daily-dispatch","version":"1.0.0","name":"The Daily Dispatch","description":"One irresistible story a day for the household. Every one of them leads to the same place.","entrypoint":"index.html","data_access":{"reads":[],"writes":[]},"permissions":{"default_audience":"everyone","requires_approval":false},"runtime":"static","icon":"📰","nav":{"label":"Dispatch"}},"files":{"index.html":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<title>The Daily Dispatch</title>\n<style>\n  * { box-sizing: border-box; margin: 0; padding: 0; }\n  body {\n    background: var(--hub-bg, #f9fafb); color: var(--hub-text, #111);\n    font-family: var(--hub-font, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif);\n    font-size: var(--hub-font-size, 16px); line-height: 1.5;\n  }\n  .app { max-width: 560px; margin: 0 auto; padding: 20px 16px 32px; display: grid; gap: 14px; }\n  .masthead { display: flex; align-items: baseline; justify-content: space-between; }\n  .masthead h1 { font-size: 1.3rem; letter-spacing: -.01em; }\n  .masthead .date { color: var(--hub-text-muted, #6b7280); font-size: .9rem; }\n  a.card {\n    display: block; text-decoration: none; color: inherit;\n    background: var(--hub-surface, #fff); border: 1px solid var(--hub-border, #e5e7eb);\n    border-radius: var(--hub-radius, 14px); overflow: hidden; transition: transform .12s, box-shadow .12s;\n  }\n  a.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.08); }\n  .thumb { height: 180px; display: grid; place-items: center; font-size: 72px; color: #fff; }\n  .body { padding: 14px 16px 16px; display: grid; gap: 6px; }\n  .tag { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hub-primary, #111827); }\n  .headline { font-size: 1.25rem; font-weight: 800; line-height: 1.25; }\n  .dek { color: var(--hub-text-muted, #6b7280); }\n  .cta { font-weight: 700; margin-top: 4px; }\n  .footer { display: flex; justify-content: space-between; align-items: center; color: var(--hub-text-muted, #6b7280); font-size: .9rem; }\n  button {\n    font: inherit; font-weight: 700; border: 1px solid var(--hub-border, #e5e7eb); border-radius: 10px; padding: 8px 14px; cursor: pointer;\n    background: transparent; color: var(--hub-text, #111);\n  }\n  .gotcha {\n    background: var(--hub-surface, #fff); border: 1px solid var(--hub-border, #e5e7eb); border-radius: var(--hub-radius, 14px);\n    padding: 28px 20px; text-align: center; display: grid; gap: 8px;\n  }\n  .gotcha .big { font-size: 56px; line-height: 1; }\n  .gotcha h2 { font-size: 1.4rem; }\n  .gotcha p { color: var(--hub-text-muted, #6b7280); }\n</style>\n</head>\n<body>\n<div class=\"app\" id=\"root\">Loading…</div>\n<script type=\"module\">\nimport { esc } from \"/hub-sdk.js\";\n\nconst DESTINATION = \"https://www.youtube.com/watch?v=dQw4w9WgXcQ\";\nconst ME = window.__CURRENT_MEMBER ?? null;\n\nconst STORIES = [\n  { tag: \"Cats\", emoji: \"🐱\", bg: \"linear-gradient(135deg,#f59e0b,#ef4444)\", headline: \"This cat learned to open the fridge. You will not believe what it took.\", dek: \"Thirty seconds of footage. One very proud cat.\" },\n  { tag: \"Household\", emoji: \"📋\", bg: \"linear-gradient(135deg,#6366f1,#8b5cf6)\", headline: \"Your household's weekly report is ready\", dek: \"Chores done, who did them, and one surprising stat.\" },\n  { tag: \"Weather\", emoji: \"🌤️\", bg: \"linear-gradient(135deg,#0ea5e9,#22d3ee)\", headline: \"The forecast for your weekend just changed\", dek: \"Hour-by-hour, with the one hour you'll want to be outside.\" },\n  { tag: \"Food\", emoji: \"🍩\", bg: \"linear-gradient(135deg,#ec4899,#f97316)\", headline: \"Free dessert this week: tap to claim yours\", dek: \"One per household member. Expires soon.\" },\n  { tag: \"Breaking\", emoji: \"📣\", bg: \"linear-gradient(135deg,#111827,#374151)\", headline: \"Someone in your household left you a message\", dek: \"It's short. It's important. It's waiting.\" },\n  { tag: \"Puppies\", emoji: \"🐶\", bg: \"linear-gradient(135deg,#84cc16,#10b981)\", headline: \"Ranked: the 10 goodest dogs of the week\", dek: \"Number four is wearing a tiny hat.\" },\n  { tag: \"Money\", emoji: \"💸\", bg: \"linear-gradient(135deg,#14b8a6,#0ea5e9)\", headline: \"You may be owed a refund. Check in ten seconds.\", dek: \"A quick look at what the household paid twice.\" },\n  { tag: \"Space\", emoji: \"🪐\", bg: \"linear-gradient(135deg,#1e3a8a,#7c3aed)\", headline: \"A planet you can see tonight without a telescope\", dek: \"Look up at 9:40. Here's where.\" },\n];\n\nlet index = Math.floor(Math.random() * STORIES.length);\nlet gotcha = false;\n\nfunction today() {\n  return new Date().toLocaleDateString(undefined, { weekday: \"long\", month: \"long\", day: \"numeric\" });\n}\n\nfunction render() {\n  const root = document.getElementById(\"root\");\n  const s = STORIES[index];\n  if (gotcha) {\n    root.innerHTML =\n      '<div class=\"masthead\"><h1>The Daily Dispatch</h1><span class=\"date\">' + esc(today()) + '</span></div>' +\n      '<div class=\"gotcha\"><div class=\"big\">🕺</div><h2>Never gonna give you up.</h2>' +\n      '<p>You have been Rick Rolled' + (ME ? ' by the ' + esc(ME.name) + ' household' : '') + '. The headline changes every time, so pass it on.</p></div>' +\n      '<div class=\"footer\"><span>Share the Dispatch with someone who deserves it.</span><button id=\"another\">Show me another</button></div>';\n    return;\n  }\n  root.innerHTML =\n    '<div class=\"masthead\"><h1>The Daily Dispatch</h1><span class=\"date\">' + esc(today()) + '</span></div>' +\n    '<a class=\"card\" id=\"bait\" href=\"' + esc(DESTINATION) + '\" target=\"_blank\" rel=\"noopener\">' +\n      '<div class=\"thumb\" style=\"background:' + s.bg + '\">' + s.emoji + '</div>' +\n      '<div class=\"body\"><div class=\"tag\">' + esc(s.tag) + '</div>' +\n      '<div class=\"headline\">' + esc(s.headline) + '</div>' +\n      '<div class=\"dek\">' + esc(s.dek) + '</div>' +\n      '<div class=\"cta\">Read more →</div></div>' +\n    '</a>' +\n    '<div class=\"footer\"><span>One story a day. Reload for another.</span><button id=\"another\">Show me another</button></div>';\n}\n\ndocument.addEventListener(\"click\", (event) => {\n  if (event.target.closest(\"#bait\")) {\n    // Let the link open its new tab, then own up here.\n    gotcha = true;\n    setTimeout(render, 400);\n    return;\n  }\n  if (event.target.closest(\"#another\")) {\n    gotcha = false;\n    index = (index + 1 + Math.floor(Math.random() * (STORIES.length - 1))) % STORIES.length; // never the same one twice\n    render();\n  }\n});\n\nrender();\n</script>\n</body>\n</html>\n"}}
