// council-genesis.jsx — Real on-chain mint history for the 25 Council NFTs.
// Pulled directly from the Basescan transfer export. Every agent has a real
// genesis transaction; this file is the canonical map from token ID to its
// mint block + tx hash + timestamp.

const GENESIS = {
  1: { tx: '0xa55009e24cff5efe539dbaf7201cd9ee617c776b10a45b448d40b024d5d16370', block: 46269938, ts: '2026-05-21 02:07:03' },
  2: { tx: '0x700e771a8f1db2497f8b8db401c407001b0ae1d9b7217522c3072e5eaa1da189', block: 46269952, ts: '2026-05-21 02:07:31' },
  3: { tx: '0xc703f5c2987701e9191d2ee45208e63dfd2cf329f6b796b2a38d892d6d475038', block: 46269959, ts: '2026-05-21 02:07:45' },
  4: { tx: '0x8b77e9e81819035b4e5b7ba56626f2730350688bffb8184224be200b35c22dcb', block: 46269962, ts: '2026-05-21 02:07:51' },
  5: { tx: '0x335659fbf6f57446fa5b2b90fe9ad2156f9405a35dda859f3efa9645cf368198', block: 46269972, ts: '2026-05-21 02:08:11' },
  6: { tx: '0x888fa113a5995983539f82e632ed47e25019aed3fa9cf47ba6f41d1c70b5c408', block: 46269977, ts: '2026-05-21 02:08:21' },
  7: { tx: '0x84536212d1802b46f753a62db823878ceede6f68e7b36034b2f5caad10a2537a', block: 46269986, ts: '2026-05-21 02:08:39' },
  8: { tx: '0xc54195e9ac256d902cc99c8d6301030168dcd54d8a932101e53be042f454397a', block: 46269990, ts: '2026-05-21 02:08:47' },
  9: { tx: '0xdce85b91076ac6a4af38dc481cae24268b457034c02d05d6ea918305bb0856b5', block: 46270660, ts: '2026-05-21 02:31:07' },
  10: { tx: '0x9c3e3d50821f4accbd494f5a9bc81b55e0a0dd8bcfcf7e01ab9a3730cd9cbf56', block: 46270665, ts: '2026-05-21 02:31:17' },
  11: { tx: '0x83206e8d46d9bda4cc8eeea6bc308eebdc3ddc973ac98660732d0a1970ca4d4f', block: 46270677, ts: '2026-05-21 02:31:41' },
  12: { tx: '0xf9ee3ae0b869eda53a0df7bddfe45d81993dfcb9c1ba153b144aa36bd98157e6', block: 46270692, ts: '2026-05-21 02:32:11' },
  13: { tx: '0x46139830636ec3e92f14a3d8aefb35e6100593f9858d26f4e3b9d7b7e133ef4a', block: 46270695, ts: '2026-05-21 02:32:17' },
  14: { tx: '0xcc361732b79605fc078cdddaa3a261e993d91e3cb2947e0aecbc224fcd632556', block: 46270700, ts: '2026-05-21 02:32:27' },
  15: { tx: '0x1277c01660455b65532770c5b2a62ca6be9238fc6f4eb075ba3661c25614f131', block: 46270707, ts: '2026-05-21 02:32:41' },
  16: { tx: '0x37085babfe72714cba6df8369e3dcbbd7b36bee812f8c581587f28098beb3d27', block: 46270713, ts: '2026-05-21 02:32:53' },
  17: { tx: '0x886a50288cbf3848e0cead3886c2e614ff41d3ad7ff6ca5e89adf24db29ff3bf', block: 46270718, ts: '2026-05-21 02:33:03' },
  18: { tx: '0x09be172a2546faeb1728a77ca573c8806bd17007efb8ce0e24a43486d0323adb', block: 46270722, ts: '2026-05-21 02:33:11' },
  19: { tx: '0x9b96d96edc6f619ea06e6ebf358f4846dfb638084eb17cedb1343af7d85e67bb', block: 46270727, ts: '2026-05-21 02:33:21' },
  20: { tx: '0x8ef8e8436294a7db03f11e9220faf9289b9c15fffb8c381b105fa1bee2d1b4c3', block: 46270734, ts: '2026-05-21 02:33:35' },
  21: { tx: '0x9b8cca7cc79fa96f7b75c0d9a98c0f9ac7b4a3f78f2e0122ad5ec3dcc1da8ed0', block: 46270735, ts: '2026-05-21 02:33:37' },
  22: { tx: '0xea47fbea18a4284e25d2d8651437f1e1911e840e4af090734bcd47ca295efdb8', block: 46270743, ts: '2026-05-21 02:33:53' },
  23: { tx: '0x6f31fa28d7d5940f12eb8c402c03232461499d5a4ba7809fda6a52f7ba304d24', block: 46270749, ts: '2026-05-21 02:34:05' },
  24: { tx: '0x8e61371f93c7afa63a4af57c969b4a08d9221325e5ce0ca56b4cb99bddfba998', block: 46270756, ts: '2026-05-21 02:34:19' },
  25: { tx: '0x3674baf926eee2b47a66044ea26790a8c9221cbda85eab22d35ab298dcfacfd0', block: 46270762, ts: '2026-05-21 02:34:31' },
};

const MINT_OWNER = '0x9092BC0Fe1540fD34d9786EA11e450c5ed28bb8c';
const MINT_MINTER = '0x6b477738f7f73471A54bD390e5741FbD79730069';

// Time helpers
function genesisFor(id) { return GENESIS[id]; }

function genesisTimestamp(id) {
  const g = GENESIS[id];
  if (!g) return null;
  // Stored as "YYYY-MM-DD HH:MM:SS" — UTC
  return new Date(g.ts.replace(' ', 'T') + 'Z');
}

function genesisDate(id) {
  const d = genesisTimestamp(id);
  return d ? d.toISOString().slice(0, 10) : '—';
}

function genesisTimeOfDay(id) {
  const d = genesisTimestamp(id);
  if (!d) return '—';
  return d.toISOString().slice(11, 19) + ' UTC';
}

// Pull a deterministic short ID from the real tx hash so an agent's "id badge"
// becomes their actual on-chain fingerprint instead of a fake hex string.
function agentIdFromTx(id) {
  const g = GENESIS[id];
  return g ? 'ec_' + g.tx.slice(2, 9) : null;
}

Object.assign(window, {
  GENESIS, MINT_OWNER, MINT_MINTER,
  genesisFor, genesisTimestamp, genesisDate, genesisTimeOfDay, agentIdFromTx,
});
