{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "orders-dashboard",
  "type": "registry:component",
  "title": "Orders Dashboard",
  "description": "An e-commerce orders screen with stat tiles, status tabs that filter an orders table, payment and fulfillment chips and a timeline panel for the selected order.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "dashboards",
    "dashboard",
    "orders",
    "ecommerce",
    "fulfillment",
    "timeline",
    "tabs"
  ],
  "docs": "https://hyperblur.dev/effects/orders-dashboard",
  "files": [
    {
      "path": "registry/hyperblur/orders-dashboard.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/orders-dashboard.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type OrderPayment = \"Paid\" | \"Pending\" | \"Refunded\" | \"Failed\";\nexport type OrderFulfillment = \"Unfulfilled\" | \"Shipped\" | \"Delivered\" | \"Returned\";\nexport type OrdersTab = \"all\" | \"unfulfilled\" | \"shipped\" | \"returns\";\n\nexport interface OrderItem {\n  name: string;\n  qty: number;\n  price: number;\n}\n\nexport interface Order {\n  id: string;\n  customer: string;\n  email: string;\n  city: string;\n  items: OrderItem[];\n  payment: OrderPayment;\n  fulfillment: OrderFulfillment;\n  day: number;\n  time: number;\n}\n\nexport interface OrdersDashboardProps extends React.HTMLAttributes<HTMLDivElement> {\n  accent?: string;\n  brand?: string;\n  store?: string;\n  user?: string;\n  orders?: Order[];\n  tab?: OrdersTab;\n  defaultTab?: OrdersTab;\n  onTabChange?: (tab: OrdersTab) => void;\n  onOrderSelect?: (order: Order) => void;\n}\n\nconst css = `\n.hb-dor {\n  --a: #2f7bff;\n  container: hb-dor / inline-size;\n  box-sizing: border-box;\n  width: 100%;\n  border: 1px solid #262626;\n  border-radius: 16px;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  font-size: 13px;\n  line-height: 1.4;\n  overflow: hidden;\n  position: relative;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-dor *, .hb-dor *::before, .hb-dor *::after { box-sizing: border-box; }\n.hb-dor button, .hb-dor input, .hb-dor select { font: inherit; color: inherit; }\n.hb-dor button:focus-visible, .hb-dor input:focus-visible, .hb-dor select:focus-visible, .hb-dor [tabindex]:focus-visible {\n  outline: 2px solid var(--a);\n  outline-offset: 2px;\n}\n.hb-dor-app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 640px; }\n.hb-dor-side {\n  display: flex;\n  flex-direction: column;\n  gap: 24px;\n  min-width: 0;\n  padding: 20px 12px 16px;\n  border-right: 1px solid #1f1f1f;\n  background: #0d0d0d;\n}\n.hb-dor-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }\n.hb-dor-mark {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 24px;\n  height: 24px;\n  border-radius: 7px;\n  background: linear-gradient(135deg, var(--a), color-mix(in srgb, var(--a) 45%, #ffffff));\n  color: #ffffff;\n}\n.hb-dor-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n.hb-dor-nav-label { padding: 12px 8px 6px; color: #6b6b6b; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }\n.hb-dor-link {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  width: 100%;\n  height: 34px;\n  padding: 0 8px;\n  border: 0;\n  border-radius: 8px;\n  background: transparent;\n  color: #a1a1a1;\n  font-size: 13px;\n  text-align: left;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease;\n}\n.hb-dor-link:hover { background: #161616; color: #ededed; }\n.hb-dor-link[aria-current=\"page\"] { background: #1b1b1b; color: #ffffff; }\n.hb-dor-link[aria-current=\"page\"] .hb-dor-ico { color: var(--a); }\n.hb-dor-link-n {\n  margin-left: auto;\n  padding: 1px 7px;\n  border-radius: 999px;\n  background: #1f1f1f;\n  color: #a1a1a1;\n  font-size: 11px;\n  font-variant-numeric: tabular-nums;\n}\n.hb-dor-side-foot { margin-top: auto; }\n.hb-dor-main { display: flex; flex-direction: column; min-width: 0; }\n.hb-dor-top { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px; border-bottom: 1px solid #1f1f1f; }\n.hb-dor-crumb { min-width: 0; overflow: hidden; color: #8f8f8f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }\n.hb-dor-crumb strong { color: #ededed; font-weight: 500; }\n.hb-dor-search { position: relative; width: 260px; margin-left: auto; color: #6b6b6b; }\n.hb-dor-search .hb-dor-ico { position: absolute; top: 50%; left: 10px; width: 15px; height: 15px; transform: translateY(-50%); pointer-events: none; }\n.hb-dor-search input {\n  width: 100%;\n  height: 34px;\n  padding: 0 40px 0 32px;\n  border: 1px solid #242424;\n  border-radius: 8px;\n  background: #111111;\n  color: #ededed;\n  font-size: 13px;\n  transition: border-color .15s ease, background .15s ease;\n}\n.hb-dor-search input::placeholder { color: #6b6b6b; }\n.hb-dor-search input:hover { border-color: #333333; }\n.hb-dor-search input:focus-visible { border-color: var(--a); outline-offset: 0; }\n.hb-dor-kbd {\n  position: absolute;\n  top: 50%;\n  right: 8px;\n  padding: 1px 6px;\n  border: 1px solid #2a2a2a;\n  border-radius: 5px;\n  background: #171717;\n  color: #8f8f8f;\n  font-size: 11px;\n  transform: translateY(-50%);\n  pointer-events: none;\n}\n.hb-dor-iconbtn {\n  position: relative;\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 34px;\n  height: 34px;\n  border: 1px solid #242424;\n  border-radius: 8px;\n  background: #111111;\n  color: #a1a1a1;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease, border-color .15s ease;\n}\n.hb-dor-iconbtn:hover { border-color: #333333; background: #171717; color: #ededed; }\n.hb-dor-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border: 2px solid #111111; border-radius: 50%; background: var(--a); box-sizing: content-box; margin: -2px; }\n.hb-dor-av {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 28px;\n  height: 28px;\n  border-radius: 50%;\n  color: #ffffff;\n  font-size: 11px;\n  font-weight: 600;\n  letter-spacing: .01em;\n}\n.hb-dor-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 24px; }\n.hb-dor-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }\n.hb-dor-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }\n.hb-dor-sub { margin: 4px 0 0; color: #8f8f8f; font-size: 13px; }\n.hb-dor-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }\n.hb-dor-card {\n  min-width: 0;\n  padding: 16px;\n  border: 1px solid #232323;\n  border-radius: 12px;\n  background: #111111;\n  animation: hb-dor-rise .55s cubic-bezier(.2, .7, .2, 1) both;\n  animation-delay: calc(var(--d, 0) * 60ms);\n}\n.hb-dor-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }\n.hb-dor-card-t { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -.005em; }\n.hb-dor-card-s { margin: 2px 0 0; color: #8f8f8f; font-size: 12px; }\n.hb-dor-seg { display: inline-flex; padding: 2px; border: 1px solid #262626; border-radius: 8px; background: #0d0d0d; }\n.hb-dor-seg button {\n  height: 26px;\n  padding: 0 10px;\n  border: 0;\n  border-radius: 6px;\n  background: transparent;\n  color: #8f8f8f;\n  font-size: 12px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease;\n}\n.hb-dor-seg button:hover { color: #ededed; }\n.hb-dor-seg button[aria-pressed=\"true\"] { background: #232323; color: #ffffff; }\n.hb-dor-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 6px;\n  height: 32px;\n  padding: 0 12px;\n  border: 1px solid #2a2a2a;\n  border-radius: 8px;\n  background: #151515;\n  color: #ededed;\n  font-size: 12.5px;\n  font-weight: 500;\n  white-space: nowrap;\n  cursor: pointer;\n  transition: background .15s ease, border-color .15s ease, transform .15s ease;\n}\n.hb-dor-btn:hover { border-color: #3a3a3a; background: #1c1c1c; }\n.hb-dor-btn:active { transform: translateY(1px); }\n.hb-dor-btn[data-p=\"true\"] { border-color: var(--a); background: var(--a); color: #ffffff; }\n.hb-dor-btn[data-p=\"true\"]:hover { background: color-mix(in srgb, var(--a) 85%, #ffffff); }\n.hb-dor-btn .hb-dor-ico { width: 14px; height: 14px; }\n.hb-dor-ico { display: block; flex: none; width: 16px; height: 16px; }\n.hb-dor-pill {\n  display: inline-flex;\n  align-items: center;\n  gap: 3px;\n  height: 20px;\n  padding: 0 7px;\n  border-radius: 999px;\n  font-size: 11px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n  white-space: nowrap;\n}\n.hb-dor-pill .hb-dor-ico { width: 11px; height: 11px; stroke-width: 2.4; }\n.hb-dor-pill[data-t=\"up\"] { background: rgba(74, 222, 128, .12); color: #4ade80; }\n.hb-dor-pill[data-t=\"down\"] { background: rgba(248, 113, 113, .12); color: #f87171; }\n.hb-dor-pill[data-t=\"flat\"] { background: #1f1f1f; color: #a1a1a1; }\n.hb-dor-spark { display: block; width: 100%; height: 36px; color: var(--a); animation: hb-dor-wipe .9s .15s cubic-bezier(.3, .7, .2, 1) both; }\n.hb-dor-spark-l { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }\n.hb-dor-tt {\n  position: absolute;\n  z-index: 3;\n  padding: 7px 10px;\n  border: 1px solid #2c2c2c;\n  border-radius: 8px;\n  background: rgba(22, 22, 22, .96);\n  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .7);\n  color: #ededed;\n  font-size: 12px;\n  line-height: 1.5;\n  white-space: nowrap;\n  pointer-events: none;\n}\n.hb-dor-tt b { font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-dor-tt-d { color: #8f8f8f; font-size: 11px; }\n@keyframes hb-dor-rise { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }\n@keyframes hb-dor-wipe { from { clip-path: inset(-6px 100% -6px -6px); } to { clip-path: inset(-6px -6px -6px -6px); } }\n@keyframes hb-dor-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }\n@keyframes hb-dor-fade { from { opacity: 0; } to { opacity: 1; } }\n@keyframes hb-dor-pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 100% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } }\n@keyframes hb-dor-arc { from { stroke-dasharray: 0 100; } }\n@container hb-dor (max-width: 759px) {\n  .hb-dor-app { grid-template-columns: minmax(0, 1fr); min-height: 0; }\n  .hb-dor-side { flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid #1f1f1f; overflow-x: auto; }\n  .hb-dor-brand { padding: 0; }\n  .hb-dor-brand span:last-child, .hb-dor-nav-label, .hb-dor-link-t, .hb-dor-link-n, .hb-dor-side-foot, .hb-dor-kbd { display: none; }\n  .hb-dor-nav { flex-direction: row; flex: 1; gap: 4px; }\n  .hb-dor-link { justify-content: center; width: 36px; padding: 0; }\n  .hb-dor-top { gap: 8px; padding: 0 16px; }\n  .hb-dor-crumb { display: none; }\n  .hb-dor-search { flex: 1; width: auto; margin-left: 0; }\n  .hb-dor-content { gap: 16px; padding: 16px; }\n  .hb-dor-title { font-size: 19px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-dor *, .hb-dor *::before, .hb-dor *::after { animation: none !important; transition: none !important; }\n}\n.hb-dor-store { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #232323; border-radius: 10px; background: #111111; }\n.hb-dor-store i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: hb-dor-pulse 1.8s ease-out infinite; }\n.hb-dor-store strong { display: block; font-size: 12.5px; font-weight: 500; }\n.hb-dor-store span { color: #8f8f8f; font-size: 11.5px; }\n.hb-dor-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }\n.hb-dor-tile { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; overflow: hidden; }\n.hb-dor-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #8f8f8f; font-size: 12px; }\n.hb-dor-tile-l { display: flex; align-items: center; gap: 8px; }\n.hb-dor-tile-i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: color-mix(in srgb, var(--k) 16%, transparent); color: var(--k); }\n.hb-dor-tile-i .hb-dor-ico { width: 14px; height: 14px; }\n.hb-dor-tile-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }\n.hb-dor-tile-v { margin: 0; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }\n.hb-dor-tile .hb-dor-spark { width: calc(100% + 16px); margin: 4px -8px -8px; color: var(--k); }\n.hb-dor-lay { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 12px; align-items: start; }\n.hb-dor-tcard { padding: 0; overflow: hidden; }\n.hb-dor-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid #1d1d1d; overflow-x: auto; }\n.hb-dor-tab {\n  position: relative;\n  display: inline-flex;\n  flex: none;\n  align-items: center;\n  gap: 8px;\n  height: 46px;\n  padding: 0 12px;\n  border: 0;\n  background: none;\n  color: #8f8f8f;\n  font-size: 13px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: color .15s ease;\n}\n.hb-dor-tab::after { content: \"\"; position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; border-radius: 2px 2px 0 0; background: var(--a); transform: scaleX(0); transition: transform .28s cubic-bezier(.3, .8, .3, 1); }\n.hb-dor-tab:hover { color: #ededed; }\n.hb-dor-tab[aria-selected=\"true\"] { color: #ffffff; }\n.hb-dor-tab[aria-selected=\"true\"]::after { transform: scaleX(1); }\n.hb-dor-tab span { padding: 1px 7px; border-radius: 999px; background: #1b1b1b; color: #a1a1a1; font-size: 11px; font-variant-numeric: tabular-nums; }\n.hb-dor-tab[aria-selected=\"true\"] span { background: color-mix(in srgb, var(--a) 18%, transparent); color: color-mix(in srgb, var(--a) 55%, #ffffff); }\n.hb-dor-tw { overflow-x: auto; }\n.hb-dor-ot { width: 100%; min-width: 520px; table-layout: fixed; border-collapse: collapse; }\n.hb-dor-ot th {\n  height: 38px;\n  padding: 0 6px;\n  border-bottom: 1px solid #1d1d1d;\n  background: #0e0e0e;\n  color: #8f8f8f;\n  font-size: 11px;\n  font-weight: 500;\n  letter-spacing: .04em;\n  text-align: left;\n  text-transform: uppercase;\n  white-space: nowrap;\n}\n.hb-dor-ot th:first-child, .hb-dor-ot td:first-child { padding-left: 12px; }\n.hb-dor-ot th:last-child, .hb-dor-ot td:last-child { padding-right: 12px; }\n.hb-dor-ot td { padding: 11px 6px; border-bottom: 1px solid #181818; overflow: hidden; font-size: 12.5px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }\n.hb-dor-ot tbody tr { cursor: pointer; transition: background .15s ease; }\n.hb-dor-ot tbody tr:hover td { background: #151515; }\n.hb-dor-ot tbody tr[aria-current=\"true\"] td { background: color-mix(in srgb, var(--a) 10%, transparent); }\n.hb-dor-ot tbody tr[aria-current=\"true\"] td:first-child { box-shadow: inset 2px 0 0 var(--a); }\n.hb-dor-ot tbody tr:focus-visible { outline: none; }\n.hb-dor-ot tbody tr:focus-visible td:first-child { box-shadow: inset 2px 0 0 #ffffff; }\n.hb-dor-oid { color: #ededed; font-weight: 500; }\n.hb-dor-ocust { display: block; overflow: hidden; font-weight: 500; text-overflow: ellipsis; }\n.hb-dor-dim { color: #8f8f8f; }\n.hb-dor-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--c) 26%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); font-size: 11px; font-weight: 500; line-height: 1.5; }\n.hb-dor-tag i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }\n.hb-dor-empty { padding: 56px 16px; color: #8f8f8f; text-align: center; }\n.hb-dor-empty strong { display: block; margin-bottom: 4px; color: #ededed; font-size: 14px; font-weight: 500; }\n.hb-dor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: #8f8f8f; font-size: 12.5px; }\n.hb-dor-pn { display: flex; flex-direction: column; gap: 18px; }\n.hb-dor-pn-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }\n.hb-dor-pn-h h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }\n.hb-dor-pn-h div span { display: block; margin-top: 2px; color: #8f8f8f; font-size: 12px; }\n.hb-dor-pn-c { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #1f1f1f; border-radius: 10px; background: #0e0e0e; }\n.hb-dor-pn-c .hb-dor-av { width: 34px; height: 34px; }\n.hb-dor-pn-c strong { display: block; font-size: 13px; font-weight: 500; }\n.hb-dor-pn-c div span { display: block; overflow: hidden; color: #8f8f8f; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }\n.hb-dor-pn-c div { min-width: 0; }\n.hb-dor-pn-s { margin: 0 0 10px; color: #6b6b6b; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }\n.hb-dor-li { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }\n.hb-dor-li li { display: flex; justify-content: space-between; gap: 12px; }\n.hb-dor-li li span:last-child { color: #a1a1a1; font-variant-numeric: tabular-nums; }\n.hb-dor-li li[data-sum=\"true\"] { margin-top: 4px; padding-top: 10px; border-top: 1px solid #1f1f1f; color: #ededed; font-weight: 600; }\n.hb-dor-li li[data-sum=\"true\"] span:last-child { color: #ededed; }\n.hb-dor-tl { margin: 0; padding: 0; list-style: none; }\n.hb-dor-tl li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }\n.hb-dor-tl li:last-child { padding-bottom: 0; }\n.hb-dor-tl li::before { content: \"\"; position: absolute; top: 22px; bottom: 2px; left: 9px; width: 2px; background: #232323; }\n.hb-dor-tl li:last-child::before { display: none; }\n.hb-dor-tl li[data-s=\"done\"]::before { background: color-mix(in srgb, var(--a) 65%, #232323); }\n.hb-dor-tl-d { display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid #2a2a2a; border-radius: 50%; background: #0f0f0f; color: transparent; }\n.hb-dor-tl-d .hb-dor-ico { width: 11px; height: 11px; stroke-width: 3.2; }\n.hb-dor-tl li[data-s=\"done\"] .hb-dor-tl-d { border-color: var(--a); background: var(--a); color: #ffffff; }\n.hb-dor-tl li[data-s=\"current\"] .hb-dor-tl-d { border-color: var(--a); animation: hb-dor-ring 1.8s ease-out infinite; }\n.hb-dor-tl li[data-s=\"current\"] .hb-dor-tl-d::after { content: \"\"; width: 6px; height: 6px; border-radius: 50%; background: var(--a); }\n.hb-dor-tl li[data-s=\"fail\"] .hb-dor-tl-d { border-color: #f87171; background: #f87171; color: #0a0a0a; }\n.hb-dor-tl strong { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.4; }\n.hb-dor-tl li[data-s=\"todo\"] strong { color: #6b6b6b; }\n.hb-dor-tl div span { display: block; color: #8f8f8f; font-size: 12px; line-height: 1.45; }\n.hb-dor-pn-a { display: flex; gap: 8px; }\n.hb-dor-pn-a .hb-dor-btn { flex: 1; }\n@keyframes hb-dor-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--a) 55%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }\n@container hb-dor (max-width: 999px) {\n  .hb-dor-lay { grid-template-columns: minmax(0, 1fr); }\n}\n@container hb-dor (max-width: 959px) {\n  .hb-dor-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n}\n@container hb-dor (max-width: 419px) {\n  .hb-dor-tiles { grid-template-columns: minmax(0, 1fr); }\n}\n`;\n\nfunction hash(n: number) {\n  let x = Math.imul(n + 1, 2654435761) >>> 0;\n  x ^= x >>> 15;\n  x = Math.imul(x, 2246822519) >>> 0;\n  x ^= x >>> 13;\n  return (x >>> 0) / 4294967296;\n}\n\ntype Pt = [number, number];\n\nfunction smooth(pts: Pt[]) {\n  let d = `M${pts[0][0].toFixed(1)} ${pts[0][1].toFixed(1)}`;\n  for (let i = 0; i < pts.length - 1; i++) {\n    const p0 = pts[i - 1] ?? pts[i];\n    const p1 = pts[i];\n    const p2 = pts[i + 1];\n    const p3 = pts[i + 2] ?? p2;\n    const c1x = p1[0] + (p2[0] - p0[0]) / 6;\n    const c1y = p1[1] + (p2[1] - p0[1]) / 6;\n    const c2x = p2[0] - (p3[0] - p1[0]) / 6;\n    const c2y = p2[1] - (p3[1] - p1[1]) / 6;\n    d += `C${c1x.toFixed(1)} ${c1y.toFixed(1)} ${c2x.toFixed(1)} ${c2y.toFixed(1)} ${p2[0].toFixed(1)} ${p2[1].toFixed(1)}`;\n  }\n  return d;\n}\n\nfunction project(values: number[], w: number, h: number, padY: number, lo?: number, hi?: number): Pt[] {\n  const min = lo ?? Math.min(...values);\n  const max = hi ?? Math.max(...values);\n  const span = max - min || 1;\n  return values.map((v, i) => [\n    values.length === 1 ? w / 2 : (i / (values.length - 1)) * w,\n    padY + (1 - (v - min) / span) * (h - padY * 2),\n  ]);\n}\n\nfunction tone(name: string) {\n  let h = 0;\n  for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) >>> 0;\n  const hue = h % 360;\n  return `linear-gradient(135deg, hsl(${hue} 62% 52%), hsl(${(hue + 48) % 360} 62% 36%))`;\n}\n\nfunction initials(name: string) {\n  return name\n    .split(\" \")\n    .map((w) => w[0])\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n}\n\nconst icons: Record<string, string[]> = {\n  bars: [\"M18 20V10M12 20V4M6 20v-6\"],\n  users: [\"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2\", \"M9 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8z\", \"M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\"],\n  sliders: [\"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6\"],\n  bell: [\"M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9\", \"M13.7 21a2 2 0 0 1-3.4 0\"],\n  search: [\"M11 3a8 8 0 1 0 0 16 8 8 0 0 0 0-16z\", \"M21 21l-4.3-4.3\"],\n  cart: [\"M6 6h15l-2 9H8z\", \"M6 6L5 3H2\", \"M9 20a1 1 0 1 0 0 .01\", \"M18 20a1 1 0 1 0 0 .01\"],\n  box: [\"M21 8l-9-5-9 5v8l9 5 9-5z\", \"M3 8l9 5 9-5M12 13v9\"],\n  check: [\"M5 12.5l4.5 4.5L19 7.5\"],\n  up: [\"M12 19V5M5 12l7-7 7 7\"],\n  down: [\"M12 5v14M19 12l-7 7-7-7\"],\n  x: [\"M18 6L6 18M6 6l12 12\"],\n  download: [\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\", \"M7 10l5 5 5-5M12 15V3\"],\n  clock: [\"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z\", \"M12 7v5l3 2\"],\n  truck: [\"M1 4h13v12H1zM14 8h4l3 3v5h-7z\", \"M5.5 18.5a1.5 1.5 0 1 0 0 .01\", \"M17.5 18.5a1.5 1.5 0 1 0 0 .01\"],\n  refund: [\"M3 12a9 9 0 1 0 3-6.7L3 8\", \"M3 3v5h5\"],\n  plus: [\"M12 5v14M5 12h14\"],\n  tag: [\"M20 12l-8 8-9-9V3h8z\", \"M7.5 7.5h.01\"],\n  receipt: [\"M5 3h14v18l-3-2-2 2-2-2-2 2-2-2-3 2z\", \"M9 8h6M9 12h6\"],\n};\n\nfunction Ico({ n }: { n: string }) {\n  return (\n    <svg className=\"hb-dor-ico\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      {(icons[n] ?? []).map((d, i) => (\n        <path key={i} d={d} />\n      ))}\n    </svg>\n  );\n}\n\nfunction Spark({ values, id }: { values: number[]; id: string }) {\n  const line = smooth(project(values, 100, 32, 3));\n  return (\n    <svg className=\"hb-dor-spark\" viewBox=\"0 0 100 32\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n      <defs>\n        <linearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n          <stop offset=\"0\" stopColor=\"currentColor\" stopOpacity=\".26\" />\n          <stop offset=\"1\" stopColor=\"currentColor\" stopOpacity=\"0\" />\n        </linearGradient>\n      </defs>\n      <path d={`${line}L100 32L0 32Z`} fill={`url(#${id})`} />\n      <path className=\"hb-dor-spark-l\" d={line} />\n    </svg>\n  );\n}\n\nfunction Delta({ value, good = true, suffix = \"%\" }: { value: number; good?: boolean; suffix?: string }) {\n  const up = value >= 0;\n  const t = value === 0 ? \"flat\" : up === good ? \"up\" : \"down\";\n  return (\n    <span className=\"hb-dor-pill\" data-t={t}>\n      <Ico n={up ? \"up\" : \"down\"} />\n      {Math.abs(value).toFixed(1)}\n      {suffix}\n    </span>\n  );\n}\n\ninterface NavItem {\n  id: string;\n  label: string;\n  icon: string;\n  count?: string;\n  section?: string;\n}\nfunction Shell({\n  brand,\n  nav,\n  defaultActive,\n  crumb,\n  placeholder,\n  user,\n  foot,\n  children,\n}: {\n  brand: string;\n  nav: NavItem[];\n  defaultActive: string;\n  crumb: [string, string];\n  placeholder: string;\n  user: string;\n  foot?: React.ReactNode;\n  children: React.ReactNode;\n}) {\n  const [active, setActive] = React.useState(defaultActive);\n  return (\n    <div className=\"hb-dor-app\">\n      <aside className=\"hb-dor-side\">\n        <div className=\"hb-dor-brand\">\n          <span className=\"hb-dor-mark\" aria-hidden=\"true\">\n            <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n              <path d=\"M4 18L10 6l4 8 2-4 4 8\" />\n            </svg>\n          </span>\n          <span>{brand}</span>\n        </div>\n        <nav aria-label=\"Main\">\n          <ul className=\"hb-dor-nav\">\n            {nav.map((item) => (\n              <React.Fragment key={item.id}>\n                {item.section ? (\n                  <li className=\"hb-dor-nav-label\" aria-hidden=\"true\">\n                    {item.section}\n                  </li>\n                ) : null}\n                <li>\n                  <button type=\"button\" className=\"hb-dor-link\" aria-current={active === item.id ? \"page\" : undefined} aria-label={item.label} onClick={() => setActive(item.id)}>\n                    <Ico n={item.icon} />\n                    <span className=\"hb-dor-link-t\">{item.label}</span>\n                    {item.count ? <span className=\"hb-dor-link-n\">{item.count}</span> : null}\n                  </button>\n                </li>\n              </React.Fragment>\n            ))}\n          </ul>\n        </nav>\n        {foot ? <div className=\"hb-dor-side-foot\">{foot}</div> : null}\n      </aside>\n      <div className=\"hb-dor-main\">\n        <header className=\"hb-dor-top\">\n          <div className=\"hb-dor-crumb\">\n            {crumb[0]} / <strong>{crumb[1]}</strong>\n          </div>\n          <label className=\"hb-dor-search\">\n            <Ico n=\"search\" />\n            <input type=\"search\" placeholder={placeholder} aria-label={placeholder} />\n            <span className=\"hb-dor-kbd\">/</span>\n          </label>\n          <button type=\"button\" className=\"hb-dor-iconbtn\" aria-label=\"Notifications\">\n            <Ico n=\"bell\" />\n            <span className=\"hb-dor-dot\" />\n          </button>\n          <span className=\"hb-dor-av\" style={{ background: tone(user), width: 34, height: 34 }} title={user}>\n            {initials(user)}\n          </span>\n        </header>\n        <div className=\"hb-dor-content\">{children}</div>\n      </div>\n    </div>\n  );\n}\n\nconst TABS: { id: OrdersTab; label: string }[] = [\n  { id: \"all\", label: \"All\" },\n  { id: \"unfulfilled\", label: \"Unfulfilled\" },\n  { id: \"shipped\", label: \"Shipped\" },\n  { id: \"returns\", label: \"Returns\" },\n];\n\nconst PAYMENT_COLOR: Record<OrderPayment, string> = { Paid: \"#4ade80\", Pending: \"#fbbf24\", Refunded: \"#7fb3ff\", Failed: \"#f87171\" };\nconst FULFILL_COLOR: Record<OrderFulfillment, string> = { Unfulfilled: \"#fbbf24\", Shipped: \"#7fb3ff\", Delivered: \"#4ade80\", Returned: \"#a78bfa\" };\n\nconst SHOP = {\n  fern: { name: \"Boston fern\", price: 34 },\n  pot: { name: \"Clay pot, 6 in\", price: 18 },\n  pole: { name: \"Moss pole\", price: 12 },\n  shears: { name: \"Pruning shears\", price: 26 },\n  can: { name: \"Copper watering can\", price: 38 },\n  saucer: { name: \"Saucer set\", price: 14 },\n  lily: { name: \"Peace lily\", price: 29 },\n  mister: { name: \"Plant mister\", price: 16 },\n  soil: { name: \"Potting mix, 10 L\", price: 21 },\n  snake: { name: \"Snake plant\", price: 31 },\n};\n\ntype ShopKey = keyof typeof SHOP;\n\nfunction line(key: ShopKey, qty = 1): OrderItem {\n  return { name: SHOP[key].name, qty, price: SHOP[key].price };\n}\n\nconst DEFAULT_ORDERS: Order[] = [\n  { id: \"10482\", customer: \"Maya Johnson\", email: \"maya.johnson@mail.example\", city: \"Portland, OR\", items: [line(\"fern\"), line(\"pot\")], payment: \"Paid\", fulfillment: \"Unfulfilled\", day: 32, time: 582 },\n  { id: \"10481\", customer: \"Tomas Reyes\", email: \"tomas.reyes@mail.example\", city: \"Austin, TX\", items: [line(\"snake\", 2), line(\"soil\")], payment: \"Paid\", fulfillment: \"Unfulfilled\", day: 31, time: 1275 },\n  { id: \"10480\", customer: \"Aisha Rahman\", email: \"aisha.rahman@mail.example\", city: \"Toronto, ON\", items: [line(\"can\")], payment: \"Pending\", fulfillment: \"Unfulfilled\", day: 31, time: 1083 },\n  { id: \"10479\", customer: \"Lars Eriksson\", email: \"lars.eriksson@mail.example\", city: \"Seattle, WA\", items: [line(\"lily\"), line(\"mister\"), line(\"saucer\", 2)], payment: \"Paid\", fulfillment: \"Shipped\", day: 30, time: 687 },\n  { id: \"10478\", customer: \"Hannah Cho\", email: \"hannah.cho@mail.example\", city: \"Denver, CO\", items: [line(\"shears\"), line(\"pole\", 3)], payment: \"Paid\", fulfillment: \"Shipped\", day: 30, time: 530 },\n  { id: \"10477\", customer: \"Diego Alvarez\", email: \"diego.alvarez@mail.example\", city: \"Miami, FL\", items: [line(\"fern\", 2)], payment: \"Paid\", fulfillment: \"Delivered\", day: 28, time: 980 },\n  { id: \"10476\", customer: \"Priya Menon\", email: \"priya.menon@mail.example\", city: \"Chicago, IL\", items: [line(\"pot\", 3), line(\"soil\", 2)], payment: \"Refunded\", fulfillment: \"Returned\", day: 27, time: 791 },\n  { id: \"10475\", customer: \"Oliver Grant\", email: \"oliver.grant@mail.example\", city: \"Boston, MA\", items: [line(\"snake\")], payment: \"Paid\", fulfillment: \"Delivered\", day: 27, time: 605 },\n  { id: \"10474\", customer: \"Sofia Marino\", email: \"sofia.marino@mail.example\", city: \"Phoenix, AZ\", items: [line(\"pole\", 2), line(\"mister\")], payment: \"Failed\", fulfillment: \"Unfulfilled\", day: 26, time: 1184 },\n  { id: \"10473\", customer: \"Kenji Watanabe\", email: \"kenji.watanabe@mail.example\", city: \"San Diego, CA\", items: [line(\"lily\", 2), line(\"pot\", 2)], payment: \"Paid\", fulfillment: \"Delivered\", day: 25, time: 750 },\n  { id: \"10472\", customer: \"Grace Lindqvist\", email: \"grace.lindqvist@mail.example\", city: \"Minneapolis, MN\", items: [line(\"can\"), line(\"shears\")], payment: \"Refunded\", fulfillment: \"Returned\", day: 24, time: 952 },\n  { id: \"10471\", customer: \"Marcus Bell\", email: \"marcus.bell@mail.example\", city: \"Atlanta, GA\", items: [line(\"fern\"), line(\"saucer\")], payment: \"Paid\", fulfillment: \"Delivered\", day: 24, time: 558 },\n];\n\nconst NAV: NavItem[] = [\n  { id: \"orders\", label: \"Orders\", icon: \"box\", count: \"38\", section: \"Store\" },\n  { id: \"products\", label: \"Products\", icon: \"tag\" },\n  { id: \"customers\", label: \"Customers\", icon: \"users\" },\n  { id: \"shipping\", label: \"Shipping\", icon: \"truck\" },\n  { id: \"discounts\", label: \"Discounts\", icon: \"receipt\", section: \"Marketing\" },\n  { id: \"analytics\", label: \"Analytics\", icon: \"bars\" },\n  { id: \"settings\", label: \"Settings\", icon: \"sliders\" },\n];\n\nconst TILES = [\n  { label: \"New orders\", icon: \"cart\", color: \"var(--a)\", delta: 12.4, good: true },\n  { label: \"Pending\", icon: \"clock\", color: \"#fbbf24\", delta: -6.1, good: false },\n  { label: \"Shipped\", icon: \"truck\", color: \"#34d399\", delta: 8.7, good: true },\n  { label: \"Refunds\", icon: \"refund\", color: \"#f87171\", delta: 14.2, good: false },\n];\n\ninterface Step {\n  title: string;\n  detail?: string;\n  time?: string;\n  state: \"done\" | \"current\" | \"todo\" | \"fail\";\n}\n\nfunction stamp(day: number, minutes: number) {\n  const d = day + Math.floor(minutes / 1440);\n  const m = minutes % 1440;\n  const h = Math.floor(m / 60);\n  const label = d > 31 ? `Nov ${d - 31}` : `Oct ${d}`;\n  return `${label}, ${h % 12 === 0 ? 12 : h % 12}:${String(m % 60).padStart(2, \"0\")} ${h < 12 ? \"AM\" : \"PM\"}`;\n}\n\nfunction shortDate(day: number) {\n  return day > 31 ? `Nov ${day - 31}` : `Oct ${day}`;\n}\n\nfunction subtotal(o: Order) {\n  return o.items.reduce((t, i) => t + i.qty * i.price, 0);\n}\n\nfunction shipping(o: Order) {\n  return subtotal(o) >= 60 ? 0 : 6.5;\n}\n\nfunction total(o: Order) {\n  return subtotal(o) + shipping(o);\n}\n\nfunction money(n: number) {\n  return `$${n.toFixed(2)}`;\n}\n\nfunction units(o: Order) {\n  return o.items.reduce((t, i) => t + i.qty, 0);\n}\n\nfunction timeline(o: Order): Step[] {\n  const at = (mins: number) => stamp(o.day, o.time + mins);\n  const steps: Step[] = [{ title: \"Order placed\", detail: `${o.customer} checked out`, time: at(0), state: \"done\" }];\n  if (o.payment === \"Failed\") {\n    steps.push({ title: \"Payment failed\", detail: \"The card was declined\", time: at(1), state: \"fail\" });\n    steps.push({ title: \"Reminder sent\", detail: \"Customer can retry from the email link\", state: \"current\" });\n    steps.push({ title: \"Packed\", state: \"todo\" }, { title: \"Shipped\", state: \"todo\" });\n    return steps;\n  }\n  if (o.payment === \"Pending\") {\n    steps.push({ title: \"Awaiting payment\", detail: \"Bank transfer not received yet\", state: \"current\" });\n    steps.push({ title: \"Packed\", state: \"todo\" }, { title: \"Shipped\", state: \"todo\" }, { title: \"Delivered\", state: \"todo\" });\n    return steps;\n  }\n  steps.push({ title: \"Payment confirmed\", detail: money(total(o)), time: at(1), state: \"done\" });\n  if (o.fulfillment === \"Unfulfilled\") {\n    steps.push({ title: \"Packing in progress\", detail: \"Ready to ship within 24 hours\", state: \"current\" });\n    steps.push({ title: \"Shipped\", state: \"todo\" }, { title: \"Delivered\", state: \"todo\" });\n    return steps;\n  }\n  steps.push({ title: \"Packed\", time: at(360), state: \"done\" });\n  steps.push({ title: \"Shipped\", detail: \"Tracking 1Z84 F330 0344 21\", time: at(1200), state: \"done\" });\n  if (o.fulfillment === \"Shipped\") {\n    steps.push({ title: \"In transit\", detail: \"Arrived at the regional hub\", state: \"current\" });\n    steps.push({ title: \"Delivered\", detail: `Expected ${shortDate(o.day + 3)}`, state: \"todo\" });\n    return steps;\n  }\n  steps.push({ title: \"Delivered\", time: at(4320), state: \"done\" });\n  if (o.fulfillment === \"Returned\") {\n    steps.push({ title: \"Return requested\", detail: \"Plant arrived damaged\", time: at(5400), state: \"done\" });\n    steps.push(o.payment === \"Refunded\" ? { title: \"Refund issued\", detail: money(total(o)), time: at(7200), state: \"done\" } : { title: \"Refund pending\", state: \"current\" });\n  }\n  return steps;\n}\n\nexport function OrdersDashboard({\n  accent = \"#2f7bff\",\n  brand = \"Parcel\",\n  store = \"Fernhill Goods\",\n  user = \"Nora Whitfield\",\n  orders: ordersProp,\n  tab,\n  defaultTab = \"all\",\n  onTabChange,\n  onOrderSelect,\n  className = \"\",\n  style,\n  ...rest\n}: OrdersDashboardProps) {\n  const uid = React.useId().replace(/:/g, \"\");\n  const [orders, setOrders] = React.useState<Order[]>(ordersProp ?? DEFAULT_ORDERS);\n  const [inner, setInner] = React.useState<OrdersTab>(defaultTab);\n  const [selectedId, setSelectedId] = React.useState<string | null>(null);\n  const current = tab ?? inner;\n\n  const inTab = (o: Order, t: OrdersTab) =>\n    t === \"all\" || (t === \"unfulfilled\" && o.fulfillment === \"Unfulfilled\") || (t === \"shipped\" && (o.fulfillment === \"Shipped\" || o.fulfillment === \"Delivered\")) || (t === \"returns\" && o.fulfillment === \"Returned\");\n\n  const rows = orders.filter((o) => inTab(o, current));\n  const active = rows.find((o) => o.id === selectedId) ?? rows[0] ?? null;\n  const steps = active ? timeline(active) : [];\n  const counts = (t: OrdersTab) => orders.filter((o) => inTab(o, t)).length;\n  const pendingNow = 11 + counts(\"unfulfilled\");\n  const shippedNow = 120 + counts(\"shipped\");\n  const refundsNow = 3 + counts(\"returns\");\n  const values = [38, pendingNow, shippedNow, refundsNow];\n\n  const pickTab = (t: OrdersTab) => {\n    setInner(t);\n    onTabChange?.(t);\n  };\n\n  const select = (o: Order) => {\n    setSelectedId(o.id);\n    onOrderSelect?.(o);\n  };\n\n  const advance = (o: Order) => {\n    const next: OrderFulfillment = o.fulfillment === \"Unfulfilled\" ? \"Shipped\" : \"Delivered\";\n    setOrders((list) => list.map((x) => (x.id === o.id ? { ...x, fulfillment: next } : x)));\n  };\n\n  const tabKey = (e: React.KeyboardEvent<HTMLButtonElement>, i: number) => {\n    const move = e.key === \"ArrowRight\" ? 1 : e.key === \"ArrowLeft\" ? -1 : 0;\n    if (!move) return;\n    e.preventDefault();\n    const next = (i + move + TABS.length) % TABS.length;\n    pickTab(TABS[next].id);\n    (e.currentTarget.parentElement?.children[next] as HTMLElement | undefined)?.focus();\n  };\n\n  const rowKey = (e: React.KeyboardEvent<HTMLTableRowElement>, o: Order, i: number) => {\n    if (e.key === \"Enter\" || e.key === \" \") {\n      e.preventDefault();\n      select(o);\n    } else if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n      e.preventDefault();\n      const target = rows[i + (e.key === \"ArrowDown\" ? 1 : -1)];\n      if (!target) return;\n      select(target);\n      const sib = e.key === \"ArrowDown\" ? e.currentTarget.nextElementSibling : e.currentTarget.previousElementSibling;\n      (sib as HTMLElement | null)?.focus();\n    }\n  };\n\n  const vars = { \"--a\": accent, ...style } as React.CSSProperties;\n  const nextLabel = active ? (active.payment === \"Paid\" && active.fulfillment === \"Unfulfilled\" ? \"Mark as shipped\" : active.fulfillment === \"Shipped\" ? \"Mark as delivered\" : null) : null;\n\n  return (\n    <div className={`hb-dor ${className}`} style={vars} {...rest}>\n      <style href=\"hb-orders-dashboard\" precedence=\"default\">\n        {css}\n      </style>\n      <Shell\n        brand={brand}\n        nav={NAV}\n        defaultActive=\"orders\"\n        crumb={[store, \"Orders\"]}\n        placeholder=\"Search orders\"\n        user={user}\n        foot={\n          <div className=\"hb-dor-store\">\n            <i />\n            <div>\n              <strong>{store}</strong>\n              <span>Storefront is live</span>\n            </div>\n          </div>\n        }\n      >\n        <div className=\"hb-dor-head\">\n          <div>\n            <h2 className=\"hb-dor-title\">Orders</h2>\n            <p className=\"hb-dor-sub\">{store} · updated 2 minutes ago</p>\n          </div>\n          <div className=\"hb-dor-tools\">\n            <button type=\"button\" className=\"hb-dor-btn\">\n              <Ico n=\"download\" />\n              Export\n            </button>\n            <button type=\"button\" className=\"hb-dor-btn\" data-p=\"true\">\n              <Ico n=\"plus\" />\n              Create order\n            </button>\n          </div>\n        </div>\n\n        <div className=\"hb-dor-tiles\">\n          {TILES.map((t, i) => (\n            <div className=\"hb-dor-card hb-dor-tile\" key={t.label} style={{ \"--k\": t.color, \"--d\": i } as React.CSSProperties}>\n              <div className=\"hb-dor-tile-top\">\n                <span className=\"hb-dor-tile-l\">\n                  <span className=\"hb-dor-tile-i\">\n                    <Ico n={t.icon} />\n                  </span>\n                  {t.label}\n                </span>\n              </div>\n              <div className=\"hb-dor-tile-row\">\n                <p className=\"hb-dor-tile-v\">{values[i]}</p>\n                <Delta value={t.delta} good={t.good} />\n              </div>\n              <Spark values={Array.from({ length: 14 }, (_, k) => 40 + k * (t.delta > 0 ? 2.2 : -1.2) + hash(i * 17 + k) * 22)} id={`${uid}${i}`} />\n            </div>\n          ))}\n        </div>\n\n        <div className=\"hb-dor-lay\">\n          <div className=\"hb-dor-card hb-dor-tcard\" style={{ \"--d\": 4 } as React.CSSProperties}>\n            <div className=\"hb-dor-tabs\" role=\"tablist\" aria-label=\"Order status\">\n              {TABS.map((t, i) => (\n                <button\n                  key={t.id}\n                  type=\"button\"\n                  role=\"tab\"\n                  id={`${uid}-tab-${t.id}`}\n                  aria-selected={current === t.id}\n                  aria-controls={`${uid}-panel`}\n                  tabIndex={current === t.id ? 0 : -1}\n                  className=\"hb-dor-tab\"\n                  onClick={() => pickTab(t.id)}\n                  onKeyDown={(e) => tabKey(e, i)}\n                >\n                  {t.label}\n                  <span>{counts(t.id)}</span>\n                </button>\n              ))}\n            </div>\n            <div id={`${uid}-panel`} role=\"tabpanel\" aria-labelledby={`${uid}-tab-${current}`}>\n              {rows.length > 0 ? (\n                <div className=\"hb-dor-tw\">\n                  <table className=\"hb-dor-ot\">\n                    <colgroup>\n                      <col style={{ width: \"13%\" }} />\n                      <col style={{ width: \"19%\" }} />\n                      <col style={{ width: \"8%\" }} />\n                      <col style={{ width: \"11%\" }} />\n                      <col style={{ width: \"16%\" }} />\n                      <col style={{ width: \"18%\" }} />\n                      <col style={{ width: \"15%\" }} />\n                    </colgroup>\n                    <thead>\n                      <tr>\n                        <th>Order</th>\n                        <th>Customer</th>\n                        <th>Items</th>\n                        <th>Total</th>\n                        <th>Payment</th>\n                        <th>Fulfillment</th>\n                        <th>Date</th>\n                      </tr>\n                    </thead>\n                    <tbody>\n                      {rows.map((o, i) => (\n                        <tr key={o.id} tabIndex={0} aria-current={active?.id === o.id} onClick={() => select(o)} onKeyDown={(e) => rowKey(e, o, i)}>\n                          <td className=\"hb-dor-oid\">#{o.id}</td>\n                          <td>\n                            <span className=\"hb-dor-ocust\">{o.customer}</span>\n                          </td>\n                          <td className=\"hb-dor-dim\">{units(o)}</td>\n                          <td>{money(total(o))}</td>\n                          <td>\n                            <span className=\"hb-dor-tag\" style={{ \"--c\": PAYMENT_COLOR[o.payment] } as React.CSSProperties}>\n                              <i />\n                              {o.payment}\n                            </span>\n                          </td>\n                          <td>\n                            <span className=\"hb-dor-tag\" style={{ \"--c\": FULFILL_COLOR[o.fulfillment] } as React.CSSProperties}>\n                              <i />\n                              {o.fulfillment}\n                            </span>\n                          </td>\n                          <td className=\"hb-dor-dim\">{shortDate(o.day)}</td>\n                        </tr>\n                      ))}\n                    </tbody>\n                  </table>\n                </div>\n              ) : (\n                <div className=\"hb-dor-empty\">\n                  <strong>No orders here</strong>\n                  Orders matching this tab will show up as they come in.\n                </div>\n              )}\n            </div>\n            <div className=\"hb-dor-foot\">\n              <span>\n                {rows.length} {rows.length === 1 ? \"order\" : \"orders\"}\n              </span>\n              <span>Select a row to see its timeline</span>\n            </div>\n          </div>\n\n          <aside className=\"hb-dor-card\" style={{ \"--d\": 5 } as React.CSSProperties} aria-label=\"Order timeline\">\n            {active ? (\n              <div className=\"hb-dor-pn\" key={active.id}>\n                <div className=\"hb-dor-pn-h\">\n                  <div>\n                    <h3>Order #{active.id}</h3>\n                    <span>{stamp(active.day, active.time)}</span>\n                  </div>\n                  <span className=\"hb-dor-tag\" style={{ \"--c\": FULFILL_COLOR[active.fulfillment], margin: 0 } as React.CSSProperties}>\n                    <i />\n                    {active.fulfillment}\n                  </span>\n                </div>\n                <div className=\"hb-dor-pn-c\">\n                  <span className=\"hb-dor-av\" style={{ background: tone(active.customer) }}>\n                    {initials(active.customer)}\n                  </span>\n                  <div>\n                    <strong>{active.customer}</strong>\n                    <span>{active.email}</span>\n                    <span>{active.city}</span>\n                  </div>\n                </div>\n                <div>\n                  <p className=\"hb-dor-pn-s\">Items</p>\n                  <ul className=\"hb-dor-li\">\n                    {active.items.map((i) => (\n                      <li key={i.name}>\n                        <span>\n                          {i.qty} × {i.name}\n                        </span>\n                        <span>{money(i.qty * i.price)}</span>\n                      </li>\n                    ))}\n                    <li>\n                      <span>Shipping</span>\n                      <span>{shipping(active) === 0 ? \"Free\" : money(shipping(active))}</span>\n                    </li>\n                    <li data-sum=\"true\">\n                      <span>Total</span>\n                      <span>{money(total(active))}</span>\n                    </li>\n                  </ul>\n                </div>\n                <div>\n                  <p className=\"hb-dor-pn-s\">Timeline</p>\n                  <ol className=\"hb-dor-tl\">\n                    {steps.map((s) => (\n                      <li key={s.title} data-s={s.state}>\n                        <span className=\"hb-dor-tl-d\">{s.state === \"done\" ? <Ico n=\"check\" /> : s.state === \"fail\" ? <Ico n=\"x\" /> : null}</span>\n                        <div>\n                          <strong>{s.title}</strong>\n                          {s.detail ? <span>{s.detail}</span> : null}\n                          {s.time ? <span>{s.time}</span> : null}\n                        </div>\n                      </li>\n                    ))}\n                  </ol>\n                </div>\n                <div className=\"hb-dor-pn-a\">\n                  <button type=\"button\" className=\"hb-dor-btn\">\n                    <Ico n=\"receipt\" />\n                    Invoice\n                  </button>\n                  {nextLabel ? (\n                    <button type=\"button\" className=\"hb-dor-btn\" data-p=\"true\" onClick={() => advance(active)}>\n                      <Ico n=\"truck\" />\n                      {nextLabel}\n                    </button>\n                  ) : null}\n                </div>\n              </div>\n            ) : (\n              <div className=\"hb-dor-empty\">\n                <strong>Nothing selected</strong>\n                Pick an order to follow it step by step.\n              </div>\n            )}\n          </aside>\n        </div>\n      </Shell>\n    </div>\n  );\n}\n"
    }
  ]
}