// Network Weekend (Marty 2026-11-17): Black Friday to Cyber Monday 2026, Fri 11-27 00:00 CT to Tue 12-01 00:00 CT, exact instants // (late November is CST, UTC-6). Switches on and off by itself; nothing to flip on the server. // On this site: 2 free post credits a day for network members (FREE_CREDITS_PER_DAY stays the normal value, 1). // The $10 pack's 50 credits are NOT here: that is the VBBShop SKU the owner wallet sets (see chainskus.js, the pages read it live). // WEEKEND_NOW (ISO time) is the test clock: tests only, never set it on the server. 'use strict'; const START = Date.parse('2026-11-27T06:00:00Z'); // Fri 11-27 00:00 CT const END = Date.parse('2026-12-01T06:00:00Z'); // Tue 12-01 00:00 CT const FREE_PER_DAY = 2; function now() { const o = process.env.WEEKEND_NOW; const t = o ? Date.parse(o) : NaN; return Number.isNaN(t) ? Date.now() : t; } function on(ms) { ms = ms == null ? now() : ms; return ms >= START && ms < END; } // free post credits per Central day: the weekend number while it runs, else the normal setting function freePerDay(base, ms) { return on(ms) ? Math.max(Number(base) || 0, FREE_PER_DAY) : Number(base) || 0; } // the ribbon's VBB deal line from live values: the biggest pack's credits as the contract holds them (chainskus.js) against the // normal CREDIT_PACKS number, and today's free credits. Nothing true to say (the owner has not switched the SKU yet and it is not // the weekend) = null, so the ribbon shows no VBB line rather than a wrong one. function dealLine(C, d) { const live = require('./chainskus').packs(C); const big = live.slice().sort((a, b) => b.usd - a.usd)[0]; const base = (C.packs.slice().sort((a, b) => b.usd - a.usd)[0] || {}).credits; const free = freePerDay(C.freeCreditsPerDay); const parts = []; if (big && base && big.credits > base) parts.push('The $' + big.usd + ' pack carries ' + big.credits + ' credits instead of ' + base); if (free > C.freeCreditsPerDay) parts.push((parts.length ? 'and network' : 'Network') + ' members get ' + free + ' free post credits a day'); if (!parts.length) return null; const x = Object.assign({}, d, { text: parts.join(', ') + '.' }); delete x.byDay; return x; } module.exports = { START, END, FREE_PER_DAY, now, on, freePerDay, dealLine };