1 Commits

Author SHA1 Message Date
martbost efe9044497 Turkey Drop integration, gated (2026-10-28): the Thanksgiving season game at turkeydropgame.com, same protocol as POL Miner. TD_SSO_SECRET / TD_URL (default https://turkeydropgame.com) / TD_ALT_URLS (default www + turkeydrop.saasy.top) with tdMint/tdOpen/tdIsGameUrl/tdCallback (code defaults only, no env set); GAME_AUTH turkeydrop (in-game sign-in kit, three origins); /api/my/turkeydrop hand-off + iap.return + my.js redirect; refuel game 'turkeydrop' (label "back on the air", receipt kind td-life, note "Turkey Drop back on the air", gameplay only, never POL; refuel.js done text "WFWL is back on the air"); GAMES() card with season TD_SEASON 2026-11-02..2026-12-01 (Limited time ribbon, gone after Nov 30, CDN art game-banners/turkeydrop/og-turkeydrop-clean.jpg, per-action copy: first score milestones + weekly top 3) and STRIP line, both hidden until 'turkeydrop' is in gamesLive (admin preview kept); /api/public/games/all now shows a seasonal game's "Opens" date only once it is in gamesLive (it used to list any pre-season game); growth snapshot "opened today" counts a season start only when live; walletnudge entry (idle until the secret is set); gamestats name; Game Pass: gamepass GAMES/NAMES += turkeydrop, GP_SECRETS, GP_PERKS row "one free back on the air extra life every day" shown only while the game is in the public games list (Spooky Doors row the same, so it drops after Oct 31), pass copy made count-free ("every game" / "all the games": my.js card, perks table, cap nudge, chatbot pass/Friday/tiers answers + fact, friday.html, Friday pass email); promo tools Games entry (turkeydropgame.com/?ref=, og + 11 CDN banners, 2 posts) shown only while listed and from Nov 2; chatbot CANNED turkeydrop + fact follow gamesLive and the season (coming-soon answer without a date before launch, like POL Miner's; season-over answer from Dec 1; KB answer kept out of the prompt unless live), Game Pass answer names the Turkey Drop perk only while live. my.js?v=20261028td, promo.js?v=20261028td, refuel.js?v=20261028td. qa member 0 bugs (2 old admin warnings), qa public 0 bugs (1 old /shorts warning), refuel-fallback + kb all passed; local e2e (23 checks) and chatbot gating (7 checks) passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:38:01 -05:00
177 changed files with 6901 additions and 18834 deletions
+15 -39
View File
@@ -36,12 +36,8 @@ const pub = a => a ? { email: a.email, sponsorRef: a.sponsorRef || '', code: a.c
username: a.username || null, memberId: a.memberId || 0, joinedVia: a.joinedVia || null, joinedRef: a.joinedRef || null, username: a.username || null, memberId: a.memberId || 0, joinedVia: a.joinedVia || null, joinedRef: a.joinedRef || null,
lineBannerUrl: a.lineBannerUrl || null, lineTargetUrl: a.lineTargetUrl || null, wallOffers: a.wallOffers || null, lineBannerUrl: a.lineBannerUrl || null, lineTargetUrl: a.lineTargetUrl || null, wallOffers: a.wallOffers || null,
avatarUrl: a.avatarUrl || null, bio: a.bio || null, socials: a.socials || null, avatarUrl: a.avatarUrl || null, bio: a.bio || null, socials: a.socials || null,
bixPartnerLink: a.bixPartnerLink || null, // BixPay partner link (bixpay.js, 2026-10-29): one identity, follows the member to LinkSpin/CTB
profileQuarantined: !!a.profileQuarantined, // 2026-10-30: first profile save of a brand-new free account planted a link; stored, never rendered publicly (spamscan.js)
chatAvailable: a.chatAvailable === false ? false : true, lastSeen: a.lastSeen || 0, chatAvailable: a.chatAvailable === false ? false : true, lastSeen: a.lastSeen || 0,
theme: a.theme || null, // 2026-11-01 appearance: auto | light | dark, follows the member across browsers (common.js IAP.themeSync)
address: a.address || null, created: a.created } : null; address: a.address || null, created: a.created } : null;
const THEMES = new Set(['auto', 'light', 'dark']);
const USER_RE = /^[a-zA-Z0-9_]{3,20}$/; const USER_RE = /^[a-zA-Z0-9_]{3,20}$/;
const normUser = u => String(u || '').trim().toLowerCase(); const normUser = u => String(u || '').trim().toLowerCase();
@@ -120,19 +116,16 @@ const J = {
acct.wallOffers = json || null; this.save(); acct.wallOffers = json || null; this.save();
return { ok: true, account: pub(acct) }; return { ok: true, account: pub(acct) };
}, },
async setProfile(e, avatarUrl, bio, socials, quarantined) { async setProfile(e, avatarUrl, bio, socials) {
const acct = this.db.byEmail[e]; const acct = this.db.byEmail[e];
if (!acct) return { error: 'No such account.' }; if (!acct) return { error: 'No such account.' };
if (avatarUrl !== undefined) acct.avatarUrl = avatarUrl || null; if (avatarUrl !== undefined) acct.avatarUrl = avatarUrl || null;
if (bio !== undefined) acct.bio = bio || null; if (bio !== undefined) acct.bio = bio || null;
if (socials !== undefined) acct.socials = socials || null; if (socials !== undefined) acct.socials = socials || null;
if (quarantined !== undefined) acct.profileQuarantined = !!quarantined;
this.save(); this.save();
return { ok: true, account: pub(acct) }; return { ok: true, account: pub(acct) };
}, },
async setBixLink(e, link) { const acct = this.db.byEmail[e]; if (!acct) return { error: 'No such account.' }; acct.bixPartnerLink = link || null; this.save(); return { ok: true, account: pub(acct) }; },
async touchSeen(e) { const a = this.db.byEmail[e]; if (a) { a.lastSeen = Date.now(); this.save(); } }, async touchSeen(e) { const a = this.db.byEmail[e]; if (a) { a.lastSeen = Date.now(); this.save(); } },
async setTheme(e, t) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.theme = THEMES.has(t) ? t : null; this.save(); return { ok: true, account: pub(a) }; },
async setChatAvailable(e, v) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.chatAvailable = !!v; this.save(); return { ok: true, available: !!v }; }, async setChatAvailable(e, v) { const a = this.db.byEmail[e]; if (!a) return { error: 'No such account.' }; a.chatAvailable = !!v; this.save(); return { ok: true, available: !!v }; },
async getMutes(e) { const a = this.db.byEmail[e]; return (a && Array.isArray(a.chatMutes)) ? a.chatMutes : []; }, async getMutes(e) { const a = this.db.byEmail[e]; return (a && Array.isArray(a.chatMutes)) ? a.chatMutes : []; },
async setMute(owner, target, muted) { async setMute(owner, target, muted) {
@@ -160,7 +153,7 @@ const J = {
return Object.values(this.db.byEmail) return Object.values(this.db.byEmail)
.filter(a => set.has(String(a.sponsorRef || ''))) .filter(a => set.has(String(a.sponsorRef || '')))
.sort((a, b) => b.created - a.created) .sort((a, b) => b.created - a.created)
.slice(0, 2000).map(pub); .slice(0, 200).map(pub);
}, },
async linkWallet(e, a) { async linkWallet(e, a) {
const acct = this.db.byEmail[e]; const acct = this.db.byEmail[e];
@@ -235,8 +228,8 @@ const J = {
const rowPub = r => r ? pub({ email: r.email, sponsorRef: r.sponsor_ref, code: r.code, const rowPub = r => r ? pub({ email: r.email, sponsorRef: r.sponsor_ref, code: r.code,
username: r.username, memberId: r.member_id || 0, joinedVia: r.joined_via || null, joinedRef: r.joined_ref || null, username: r.username, memberId: r.member_id || 0, joinedVia: r.joined_via || null, joinedRef: r.joined_ref || null,
lineBannerUrl: r.line_banner_url, lineTargetUrl: r.line_target_url, wallOffers: r.wall_offers || null, lineBannerUrl: r.line_banner_url, lineTargetUrl: r.line_target_url, wallOffers: r.wall_offers || null,
avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials, bixPartnerLink: r.bix_partner_link || null, profileQuarantined: !!r.profile_quarantined, avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials,
chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0), theme: r.theme || null, chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0),
address: r.address, created: Number(r.created) }) : null; address: r.address, created: Number(r.created) }) : null;
const D = { const D = {
async signup(e, password, ref) { async signup(e, password, ref) {
@@ -290,16 +283,13 @@ const D = {
await db.q('UPDATE accounts SET wall_offers=? WHERE email=?', [json || null, e]); await db.q('UPDATE accounts SET wall_offers=? WHERE email=?', [json || null, e]);
return { ok: true, account: await this.byEmail(e) }; return { ok: true, account: await this.byEmail(e) };
}, },
async setProfile(e, avatarUrl, bio, socials, quarantined) { async setProfile(e, avatarUrl, bio, socials) {
if (avatarUrl !== undefined) await db.q('UPDATE accounts SET avatar_url=? WHERE email=?', [avatarUrl || null, e]); if (avatarUrl !== undefined) await db.q('UPDATE accounts SET avatar_url=? WHERE email=?', [avatarUrl || null, e]);
if (bio !== undefined) await db.q('UPDATE accounts SET bio=? WHERE email=?', [bio || null, e]); if (bio !== undefined) await db.q('UPDATE accounts SET bio=? WHERE email=?', [bio || null, e]);
if (socials !== undefined) await db.q('UPDATE accounts SET socials=? WHERE email=?', [socials || null, e]); if (socials !== undefined) await db.q('UPDATE accounts SET socials=? WHERE email=?', [socials || null, e]);
if (quarantined !== undefined) await db.q('UPDATE accounts SET profile_quarantined=? WHERE email=?', [quarantined ? 1 : 0, e]);
return { ok: true, account: await this.byEmail(e) }; return { ok: true, account: await this.byEmail(e) };
}, },
async setBixLink(e, link) { const r = await db.q('UPDATE accounts SET bix_partner_link=? WHERE email=?', [link || null, e]); if (!r || !r.affectedRows) return { error: 'No such account.' }; return { ok: true, account: await this.byEmail(e) }; },
async touchSeen(e) { await db.q('UPDATE accounts SET last_seen=? WHERE email=?', [Date.now(), e]); }, async touchSeen(e) { await db.q('UPDATE accounts SET last_seen=? WHERE email=?', [Date.now(), e]); },
async setTheme(e, t) { await db.q('UPDATE accounts SET theme=? WHERE email=?', [THEMES.has(t) ? t : null, e]); return { ok: true, account: await this.byEmail(e) }; },
async setChatAvailable(e, v) { await db.q('UPDATE accounts SET chat_available=? WHERE email=?', [v ? 1 : 0, e]); return { ok: true, available: !!v }; }, async setChatAvailable(e, v) { await db.q('UPDATE accounts SET chat_available=? WHERE email=?', [v ? 1 : 0, e]); return { ok: true, available: !!v }; },
async getMutes(e) { async getMutes(e) {
const r = await db.q('SELECT chat_mutes FROM accounts WHERE email=?', [e]); const r = await db.q('SELECT chat_mutes FROM accounts WHERE email=?', [e]);
@@ -329,7 +319,7 @@ const D = {
const clean = refs.filter(Boolean).map(String); const clean = refs.filter(Boolean).map(String);
if (!clean.length) return []; if (!clean.length) return [];
const rows = await db.q('SELECT * FROM accounts WHERE sponsor_ref IN (' + clean.map(() => '?').join(',') const rows = await db.q('SELECT * FROM accounts WHERE sponsor_ref IN (' + clean.map(() => '?').join(',')
+ ') ORDER BY created DESC LIMIT 2000', clean); + ') ORDER BY created DESC LIMIT 200', clean);
return rows.map(rowPub); return rows.map(rowPub);
}, },
async linkWallet(e, a) { async linkWallet(e, a) {
@@ -411,7 +401,6 @@ async function signup(email, password, sponsorRef) {
async function login(email, password) { return impl().login(normEmail(email), String(password || '')); } async function login(email, password) { return impl().login(normEmail(email), String(password || '')); }
// change listener (2026-10-08): LinkSpin's registry sync hears about created / named / wallet-linked / re-sponsored accounts // change listener (2026-10-08): LinkSpin's registry sync hears about created / named / wallet-linked / re-sponsored accounts
let changeFn = null; function onChange(fn) { changeFn = fn; } const changed = e => { try { if (changeFn) changeFn(e); } catch (err) {} }; let changeFn = null; function onChange(fn) { changeFn = fn; } const changed = e => { try { if (changeFn) changeFn(e); } catch (err) {} };
let walletFn = null; function onWalletLinked(fn) { walletFn = fn; } // reporting only (lsreport.js, 2026-11-07): told after a main wallet is linked, never in the way of it
async function ensure(email, sponsorRef, via, joinedRef) { async function ensure(email, sponsorRef, via, joinedRef) {
const e = normEmail(email); const e = normEmail(email);
if (!EMAIL_RE.test(e)) return { error: 'That email address does not look right.' }; if (!EMAIL_RE.test(e)) return { error: 'That email address does not look right.' };
@@ -475,7 +464,7 @@ async function downline(email, depth = 3) {
async function linkWallet(email, address) { async function linkWallet(email, address) {
const a = normAddr(address); const a = normAddr(address);
if (!/^0x[0-9a-f]{40}$/.test(a)) return { error: 'Bad wallet address.' }; if (!/^0x[0-9a-f]{40}$/.test(a)) return { error: 'Bad wallet address.' };
const r = await impl().linkWallet(normEmail(email), a); if (r && !r.error) { changed(normEmail(email)); try { if (walletFn) walletFn(normEmail(email)); } catch (err) {} } return r; const r = await impl().linkWallet(normEmail(email), a); if (r && !r.error) changed(normEmail(email)); return r;
} }
async function count() { return impl().count(); } async function count() { return impl().count(); }
// admin: newest-first account list, and re-pointing a member's sponsor (a // admin: newest-first account list, and re-pointing a member's sponsor (a
@@ -483,13 +472,8 @@ async function count() { return impl().count(); }
// A waiting account made from a LinkSpin registry row (lsinbound.js, 2026-10-15) that its owner has not signed in to yet. // A waiting account made from a LinkSpin registry row (lsinbound.js, 2026-10-15) that its owner has not signed in to yet.
// It exists so the LinkSpin line is already in place; it is not a member yet, so the sweeps that mail, count or adopt // It exists so the LinkSpin line is already in place; it is not a member yet, so the sweeps that mail, count or adopt
// members (listAll by default) leave it out. It becomes an ordinary account the first time its owner signs in (lastSeen). // members (listAll by default) leave it out. It becomes an ordinary account the first time its owner signs in (lastSeen).
// BTC4Hits members imported 2026-11-11 (btc4hits-migration, joinedVia 'btc4hits') are the same kind of waiting account. const isUnclaimedShell = a => !!a && a.joinedVia === 'linkspin' && !a.lastSeen && !a.memberId;
// Network hub members who joined at another door (hubsync.js, 2026-11-12, only while HUB_ENABLED) arrive as joinedVia 'hub'. async function listAll(limit = 500, opts) { const all = await impl().listAll(limit); return opts && opts.shells ? all : all.filter(a => !isUnclaimedShell(a)); }
const SHELL_VIAS = new Set(['linkspin', 'btc4hits', 'hub']);
const isUnclaimedShell = a => !!a && SHELL_VIAS.has(a.joinedVia) && !a.lastSeen && !a.memberId;
// the limit counts members, not waiting accounts: newest-first LIMIT before the filter let thousands of waiting accounts push
// older real members out of the sweeps that read listAll(5000) (tank, coach, leaderboard, Friday, Wednesday)
async function listAll(limit = 500, opts) { if (opts && opts.shells) return impl().listAll(limit); const all = await impl().listAll(1e7); return all.filter(a => !isUnclaimedShell(a)).slice(0, limit); }
async function identities() { return impl().identities(); } async function identities() { return impl().identities(); }
async function setSponsorRef(email, ref) { const r = await impl().setSponsorRef(normEmail(email), String(ref || '').trim().toLowerCase().slice(0, 40)); if (r && !r.error) changed(normEmail(email)); return r; } async function setSponsorRef(email, ref) { const r = await impl().setSponsorRef(normEmail(email), String(ref || '').trim().toLowerCase().slice(0, 40)); if (r && !r.error) changed(normEmail(email)); return r; }
@@ -501,34 +485,26 @@ async function sponsorOf(email) {
let s = null; let s = null;
try { s = await byCode(ref); } catch (e) {} try { s = await byCode(ref); } catch (e) {}
if (!s) { try { s = await byUsername(ref); } catch (e) {} } if (!s) { try { s = await byUsername(ref); } catch (e) {} }
if (!s && /^\d+$/.test(ref)) { try { s = await impl().byMemberId(Number(ref)); } catch (e) {} } // a numeric ref is a member id; byMemberId exists only on the exports object, so the bare name threw and was swallowed (2026-11-17) if (!s && /^\d+$/.test(ref)) { try { s = await byMemberId(Number(ref)); } catch (e) {} }
return s || null; return s || null;
} }
// is `memberEmail` anywhere in `sponsorEmail`'s downline (to `depth` levels)? // is `memberEmail` anywhere in `sponsorEmail`'s downline (to `depth` levels)?
// walks UP from the member through their sponsors (exact and uncapped): the old walk down the sponsor's line read
// listByReferrer, which returns the newest directs only, so a big sponsor could not message an older direct (2026-11-17)
async function isDownlineOf(sponsorEmail, memberEmail, depth = 3) { async function isDownlineOf(sponsorEmail, memberEmail, depth = 3) {
const want = String(sponsorEmail || '').toLowerCase(); let cur = String(memberEmail || '').toLowerCase(); const target = String(memberEmail || '').toLowerCase();
if (!want || !cur || want === cur) return false; const levels = await downline(sponsorEmail, depth);
for (let i = 0; i < depth; i++) { return levels.some(L => L.members.some(m => String(m.email || '').toLowerCase() === target));
const s = await sponsorOf(cur); if (!s || !s.email) return false;
const e = String(s.email).toLowerCase(); if (e === want) return true; if (e === cur) return false; cur = e;
}
return false;
} }
async function getChatSettings(email) { async function getChatSettings(email) {
const a = await byEmail(email); const a = await byEmail(email);
return { available: a ? a.chatAvailable !== false : true, mutes: await impl().getMutes(String(email || '').toLowerCase()) }; return { available: a ? a.chatAvailable !== false : true, mutes: await impl().getMutes(String(email || '').toLowerCase()) };
} }
module.exports = { init, signup, login, ensure, onChange, onWalletLinked, isUnclaimedShell, byEmail, byAddress, byCode, byUsername, byMemberId: id => impl().byMemberId(Number(id) || 0), listAll, identities, setSponsorRef, module.exports = { init, signup, login, ensure, onChange, isUnclaimedShell, byEmail, byAddress, byCode, byUsername, byMemberId: id => impl().byMemberId(Number(id) || 0), listAll, identities, setSponsorRef,
setUsername, reservedUsername, setMemberId, namesForMembers, listByReferrer, downline, linkWallet, count, setUsername, reservedUsername, setMemberId, namesForMembers, listByReferrer, downline, linkWallet, count,
setLineBanner: (e, b, t) => impl().setLineBanner(String(e || '').toLowerCase(), b, t), setLineBanner: (e, b, t) => impl().setLineBanner(String(e || '').toLowerCase(), b, t),
setWallOffers: (e, j) => impl().setWallOffers(String(e || '').toLowerCase(), j), setWallOffers: (e, j) => impl().setWallOffers(String(e || '').toLowerCase(), j),
setProfile: async (e, a, bio, socials, quarantined) => { const r = await impl().setProfile(String(e || '').toLowerCase(), a, bio, socials, quarantined); if (!(r && r.error)) changed(String(e || '').toLowerCase()); return r; }, // profile edits reach LinkSpin too setProfile: async (e, a, bio, socials) => { const r = await impl().setProfile(String(e || '').toLowerCase(), a, bio, socials); if (!(r && r.error)) changed(String(e || '').toLowerCase()); return r; }, // profile edits reach LinkSpin too
setBixLink: async (e, link) => { const r = await impl().setBixLink(normEmail(e), link ? String(link).slice(0, 300) : null); if (!(r && r.error)) changed(normEmail(e)); return r; }, // the BixPay partner link rides to LinkSpin in the profile row (lssync.js)
touchSeen: e => impl().touchSeen(String(e || '').toLowerCase()), touchSeen: e => impl().touchSeen(String(e || '').toLowerCase()),
setTheme: (e, t) => impl().setTheme(String(e || '').toLowerCase(), t), // appearance only: no changed() tap, LinkSpin does not mirror it either (its accounts.js says the same)
adminSetAddress: (e, a) => impl().adminSetAddress(String(e || '').toLowerCase(), a ? normAddr(a) : null), adminSetAddress: (e, a) => impl().adminSetAddress(String(e || '').toLowerCase(), a ? normAddr(a) : null),
positionByAddress: a => impl().positionByAddress(normAddr(a)), positionByAddress: a => impl().positionByAddress(normAddr(a)),
removeAccount: e => impl().removeAccount(String(e || '').toLowerCase()), removeAccount: e => impl().removeAccount(String(e || '').toLowerCase()),
BIN
View File
Binary file not shown.
+4 -12
View File
@@ -58,9 +58,7 @@ const J = {
this.sessions.set(token, Object.assign({}, s, fields)); this.sessions.set(token, Object.assign({}, s, fields));
this.save(); this.save();
}, },
async drop(token) { this.sessions.delete(token); this.save(); }, async drop(token) { this.sessions.delete(token); this.save(); }
async renew(token) { const s = this.sessions.get(token); if (!s) return; s.expires = Date.now() + SESSION_TTL; s.issued = Date.now(); this.save(); },
async dropBy(email, address) { let n = 0; for (const [t, s] of this.sessions) if ((email && s.email === email) || (address && String(s.address || '').toLowerCase() === address)) { this.sessions.delete(t); n++; } if (n) this.save(); return n; }
}; };
// ---- MySQL session mode ---- // ---- MySQL session mode ----
@@ -86,9 +84,7 @@ const D = {
vals.push(token); vals.push(token);
await db.q('UPDATE sessions SET ' + sets.join(',') + ' WHERE token=?', vals); await db.q('UPDATE sessions SET ' + sets.join(',') + ' WHERE token=?', vals);
}, },
async drop(token) { await db.q('DELETE FROM sessions WHERE token=?', [token]); }, async drop(token) { await db.q('DELETE FROM sessions WHERE token=?', [token]); }
async renew(token) { await db.q('UPDATE sessions SET expires=? WHERE token=?', [Date.now() + SESSION_TTL, token]); },
async dropBy(email, address) { const r = await db.q('DELETE FROM sessions WHERE ' + (email && address ? 'email=? OR LOWER(address)=?' : email ? 'email=?' : 'LOWER(address)=?'), [email, address].filter(Boolean)); return Number(r.affectedRows || 0); }
}; };
const impl = () => db.enabled() ? D : J; const impl = () => db.enabled() ? D : J;
@@ -147,7 +143,7 @@ async function verifyChallenge(address, signature) {
async function mintSession(fields) { return impl().mint(fields || {}); } async function mintSession(fields) { return impl().mint(fields || {}); }
async function updateSession(token, fields) { return impl().update(token, fields || {}); } async function updateSession(token, fields) { return impl().update(token, fields || {}); }
function sessionCookie(token) { function sessionCookie(token) {
return `iap.sid=${encodeURIComponent(token)}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${Math.max(SESSION_TTL / 1000, 30 * 86400)}${IS_PROD ? '; Secure' : ''}`; // the cookie outlives the session; the server's sliding expiry decides (2026-11-15) return `iap.sid=${encodeURIComponent(token)}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${SESSION_TTL / 1000}${IS_PROD ? '; Secure' : ''}`;
} }
function clearCookie() { return 'iap.sid=; Path=/; HttpOnly; SameSite=Lax; Max-Age=0'; } function clearCookie() { return 'iap.sid=; Path=/; HttpOnly; SameSite=Lax; Max-Age=0'; }
// onSeen (2026-10-26): told the email + request of every resolved session (conversion tracking keeps the soft keys a member // onSeen (2026-10-26): told the email + request of every resolved session (conversion tracking keeps the soft keys a member
@@ -157,9 +153,6 @@ async function fromRequest(req) {
const m = /(?:^|;\s*)iap\.sid=([^;]+)/.exec(req.headers.cookie || ''); const m = /(?:^|;\s*)iap\.sid=([^;]+)/.exec(req.headers.cookie || '');
if (!m) return null; if (!m) return null;
const s = await impl().get(decodeURIComponent(m[1])); const s = await impl().get(decodeURIComponent(m[1]));
// renewed on use (2026-11-15, the network hub era: sessions are SESSION_TTL_HOURS long, 168 = 7 days, and slide while the member
// is active; the login ad keeps its own clock, loginadclock.js). At most one write an hour per session.
if (s && Number(s.expires) && Number(s.expires) - Date.now() < SESSION_TTL - Math.min(3600000, SESSION_TTL / 4)) { try { await impl().renew(s.token || decodeURIComponent(m[1])); } catch (e) {} }
if (s && s.email && seenFn) { try { seenFn(s.email, req); } catch (e) {} } if (s && s.email && seenFn) { try { seenFn(s.email, req); } catch (e) {} }
return s; return s;
} }
@@ -184,5 +177,4 @@ async function logout(req) {
if (s) await impl().drop(s.token); if (s) await impl().drop(s.token);
} }
async function endSessions(email, address) { return impl().dropBy(email ? String(email).toLowerCase() : null, address ? String(address).toLowerCase() : null); } // hub: blocked, erased, signed out everywhere module.exports = { init, makeChallenge, verifyChallenge, mintSession, updateSession, sessionCookie, clearCookie, fromRequest, onSeen, refreshMemberId, logout };
module.exports = { endSessions, init, makeChallenge, verifyChallenge, mintSession, updateSession, sessionCookie, clearCookie, fromRequest, onSeen, refreshMemberId, logout };
+1 -1
View File
@@ -8,7 +8,7 @@ const path = require('path');
const { spawn } = require('child_process'); const { spawn } = require('child_process');
let PUBLIC_DIR = null; let PUBLIC_DIR = null;
const ART = { payouts: { file: 'badge-spark.jpg', ribbonY: 0.728 }, firstBuyer: { file: 'badge-surge.jpg', ribbonY: 0.76 }, level2: { file: 'badge-circuit.jpg', ribbonY: 0.72 }, level3: { file: 'badge-nexus.jpg', ribbonY: 0.73 }, fridays: { file: 'badge-fridays.jpg', ribbonY: 0.719 }, gamepass: { file: 'badge-gamepass.jpg', ribbonY: 0.84 }, stackpro: { file: 'badge-stackpro.jpg', ribbonY: 0.855 }, refuelStart: { file: 'badge-refuelstart.jpg', ribbonY: 0.735 }, refuel3: { file: 'badge-refuel3.jpg', ribbonY: 0.783 }, refuel6: { file: 'badge-refuel6.jpg', ribbonY: 0.716 }, refuel12: { file: 'badge-refuel12.jpg', ribbonY: 0.744 } }; const ART = { payouts: { file: 'badge-spark.jpg', ribbonY: 0.728 }, firstBuyer: { file: 'badge-surge.jpg', ribbonY: 0.76 }, level2: { file: 'badge-circuit.jpg', ribbonY: 0.72 }, level3: { file: 'badge-nexus.jpg', ribbonY: 0.73 }, fridays: { file: 'badge-fridays.jpg', ribbonY: 0.719 }, gamepass: { file: 'badge-gamepass.jpg', ribbonY: 0.84 } , refuelStart: { file: 'badge-refuelstart.jpg', ribbonY: 0.735 }, refuel3: { file: 'badge-refuel3.jpg', ribbonY: 0.783 }, refuel6: { file: 'badge-refuel6.jpg', ribbonY: 0.716 }, refuel12: { file: 'badge-refuel12.jpg', ribbonY: 0.744 } };
let FONT; let FONT;
function font() { function font() {
if (FONT !== undefined) return FONT; if (FONT !== undefined) return FONT;
-120
View File
@@ -1,120 +0,0 @@
// BixPay card integration, phase 1 (Marty approved 2026-10-29; spec docs/BIXPAY-INTEGRATION.md).
// BIX is a separate company: a self-custody wallet with a Visa card spent from USDT/USDC. We only carry each member's
// PARTNER link (bix.ibportal.io/auth/register?e=<token>&a=1) so anyone who gets a card through their pages is credited to
// them in the BIX portal. Nothing is settled on our side: the portal tracks directs and levels itself.
//
// One identity, sponsor follows (feedback-one-identity-sponsor-follows): the link a visitor gets is the member's own,
// else the first sponsor up the chain (10 levels) with one, else the company link (site config bixCompanyLink). Every
// surface says WHOSE link is in play ("you" / "@sponsor" / "network") so members add their own and sponsors get their
// teams signed up.
//
// Everything is gated by site config bixpayLive ('0' = nothing shows; the admin flips it in Admin > Settings).
// Clicks: every surface links through /go/bixpay?s=<surface>[&m=<member>] which counts here (DATA_DIR/bixpay-clicks.json)
// and 302s to the resolved partner link. Counts per surface land in the admin Traffic tab, per member on the Promo tab.
const fs = require('fs');
const path = require('path');
let R = {}; // { dataDir, accounts, siteConfig, refAccount }
const HOST = 'bix.ibportal.io';
const PATH = '/auth/register';
const MAX_LEN = 300;
const MAX_LEVELS = 10;
// Marty's own PARTNER link (IB12143793): the company fallback until Admin > Settings bixCompanyLink says otherwise
const DEFAULT_COMPANY_LINK = 'https://bix.ibportal.io/auth/register?e=XqwU9T1aJ5N0UJ0yr9x0TGUiSQTsVCkTM01MIovVNnc&a=1';
const SURFACES = ['wallet', 'overview', 'email', 'nudge', 'promo', 'guide', 'chat'];
const CUSTOMER_LINK_MSG = "That's the card-customer link. Paste the Partner link from your BIX portal profile instead.";
const ANNOUNCE_MS = 7 * 86400000; // the Overview announcement card shows for the first week after the switch is flipped
function init(opts) { R = opts || {}; }
const cfg = () => { try { return (R.siteConfig && R.siteConfig()) || {}; } catch (e) { return {}; } };
function live() { return String(cfg().bixpayLive == null ? '0' : cfg().bixpayLive) === '1'; }
function companyLink() { const v = validate(cfg().bixCompanyLink); return v.ok ? v.link : DEFAULT_COMPANY_LINK; }
// the Overview announcement runs a week from bixpayLiveSince (stamped by the admin settings route when the switch is flipped on)
function announcing() { if (!live()) return false; const t = Date.parse(String(cfg().bixpayLiveSince || '')); return !(t > 0) || Date.now() - t < ANNOUNCE_MS; }
// A pasted partner link -> { ok: true, link } (normalised to e= and a=1 only) or { error }.
// The card-customer link carries appId=3 (it makes a card customer, not a partner): refused with the message members see.
function validate(input) {
const s = String(input == null ? '' : input).trim();
if (!s) return { error: 'Paste your BixPay partner link first.' };
if (s.length > MAX_LEN) return { error: 'That link is too long. Copy the Partner link from your BIX portal profile.' };
let u; try { u = new URL(s); } catch (e) { return { error: 'That is not a full link. It starts with https://bix.ibportal.io/auth/register?e=' }; }
if (u.protocol !== 'https:' || u.hostname.toLowerCase() !== HOST) return { error: 'A BixPay partner link lives on https://bix.ibportal.io. Copy it from your BIX portal profile (Profile > Partner).' };
if (u.pathname.replace(/\/+$/, '') !== PATH) return { error: 'That is not the register link. It looks like https://bix.ibportal.io/auth/register?e=...&a=1' };
if (u.searchParams.has('appId') || u.searchParams.has('appid')) return { error: CUSTOMER_LINK_MSG };
const e = String(u.searchParams.get('e') || '').trim();
if (!/^[A-Za-z0-9_-]{16,128}$/.test(e)) return { error: 'The link is missing its e= token. Copy the whole Partner link from your BIX portal profile.' };
if (String(u.searchParams.get('a') || '').trim() !== '1') return { error: 'The link needs a=1 on the end. Copy the whole Partner link from your BIX portal profile.' };
return { ok: true, link: 'https://' + HOST + PATH + '?e=' + e + '&a=1' };
}
const nameOf = a => a ? (a.username ? '@' + a.username : a.memberId ? 'member #' + a.memberId : 'your sponsor') : null;
// bixLinkFor(member): own link, else the first sponsor up the chain with one (10 levels), else the company link.
// -> { link, whose: 'you' | 'sponsor' | 'network', name, email } (name/email = the sponsor whose link it is)
async function resolve(acct) {
if (acct && validate(acct.bixPartnerLink).ok) return { link: validate(acct.bixPartnerLink).link, whose: 'you', name: nameOf(acct), email: acct.email };
if (acct && R.accounts && R.accounts.sponsorOf) {
const seen = new Set([String(acct.email || '').toLowerCase()]);
let cur = acct;
for (let i = 0; i < MAX_LEVELS && cur; i++) {
let s = null; try { s = await R.accounts.sponsorOf(cur.email); } catch (e) { s = null; }
if (!s || seen.has(String(s.email).toLowerCase())) break;
seen.add(String(s.email).toLowerCase());
const v = validate(s.bixPartnerLink);
if (v.ok) return { link: v.link, whose: 'sponsor', name: nameOf(s), email: s.email };
cur = s;
}
}
return { link: companyLink(), whose: 'network', name: null, email: null };
}
// the same for a public page: the referrer token (?ref / the sponsor cookie) resolves like the member it names
async function resolveRef(tok) {
let a = null; try { a = tok && R.refAccount ? await R.refAccount(tok) : null; } catch (e) { a = null; }
return resolve(a);
}
// the line every surface shows under the button
function usingLine(r) { return r.whose === 'you' ? 'Using: your link.' : r.whose === 'sponsor' ? 'Using: ' + r.name + "'s link. Add yours in Profile." : 'Using: the network link. Add yours in Profile.'; }
// tracked link for a surface (+ the member it belongs to: the sharer on promo/guide/email, the viewer on the dashboard cards)
const SITE = () => String(process.env.PUBLIC_URL || 'https://instantadpay.com').replace(/\/+$/, '');
function goLink(surface, token) { return SITE() + '/go/bixpay?s=' + encodeURIComponent(surface) + (token ? '&m=' + encodeURIComponent(String(token)) : ''); }
// one sentence for payout emails and the games' wallet nudges (text), only while live
function emailLine(token) { return live() ? 'Want to spend it? A BixPay Visa card turns POL into everyday purchases: ' + goLink('email', token) : ''; }
function nudgeLine(token) { return live() ? 'Want to spend it? A BixPay Visa card turns POL into everyday purchases: ' + goLink('nudge', token) : ''; }
// ---- clicks ----
const FILE = () => path.join(R.dataDir || '.', 'bixpay-clicks.json');
const blank = () => ({ v: 1, total: {}, days: {}, members: {} });
let S = null;
function load() { if (S) return S; try { S = Object.assign(blank(), JSON.parse(fs.readFileSync(FILE(), 'utf8'))); } catch (e) { S = blank(); } return S; }
function save() { try { fs.writeFileSync(FILE(), JSON.stringify(S)); } catch (e) {} }
const day = ts => new Date(ts).toISOString().slice(0, 10);
function click(surface, email) {
const s = SURFACES.includes(surface) ? surface : 'other';
const st = load();
st.total[s] = (st.total[s] || 0) + 1;
const d = day(Date.now()); st.days[d] = st.days[d] || {}; st.days[d][s] = (st.days[d][s] || 0) + 1;
const e = String(email || '').trim().toLowerCase();
if (e) { const m = st.members[e] = st.members[e] || { total: 0 }; m.total++; m[s] = (m[s] || 0) + 1; m.last = Date.now(); }
// bounded: 400 days
const cutoff = day(Date.now() - 400 * 86400000); for (const k of Object.keys(st.days)) if (k < cutoff) delete st.days[k];
save();
return { surface: s, email: e || null };
}
function memberClicks(email) {
const m = load().members[String(email || '').trim().toLowerCase()];
if (!m) return { total: 0 };
return Object.assign({}, m);
}
function adminView(days) {
const st = load(); const n = Math.min(365, Math.max(1, Number(days) || 30));
const since = day(Date.now() - n * 86400000);
const bySurface = {}; let total = 0;
for (const [d, row] of Object.entries(st.days)) if (d >= since) for (const [s, c] of Object.entries(row)) { bySurface[s] = (bySurface[s] || 0) + c; total += c; }
const daily = Object.entries(st.days).filter(([d]) => d >= since).sort((a, b) => a[0] < b[0] ? 1 : -1).map(([d, row]) => ({ day: d, clicks: Object.values(row).reduce((x, y) => x + y, 0) }));
const members = Object.entries(st.members).map(([email, m]) => ({ email, total: m.total || 0, last: m.last || 0, promo: m.promo || 0 })).sort((a, b) => b.total - a.total).slice(0, 50);
return { days: n, total, allTime: Object.values(st.total).reduce((x, y) => x + y, 0), bySurface, daily, members, surfaces: SURFACES };
}
function _reset() { S = null; }
module.exports = { init, live, announcing, validate, resolve, resolveRef, usingLine, companyLink, goLink, emailLine, nudgeLine, click, memberClicks, adminView, SURFACES, CUSTOMER_LINK_MSG, DEFAULT_COMPANY_LINK, MAX_LEVELS, _reset };
+6 -8
View File
@@ -6,7 +6,6 @@
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const db = require('./db'); const db = require('./db');
const themehead = require('./themehead'); // light/dark theme head script (2026-11-01)
let DATA_DIR = null; let DATA_DIR = null;
const SITE = 'https://instantadpay.com'; const SITE = 'https://instantadpay.com';
const AUTHOR = 'Marty Bostick'; const AUTHOR = 'Marty Bostick';
@@ -70,8 +69,7 @@ const D = {
const row = r => ({ slug: r.slug, title: r.title, excerpt: r.excerpt || '', body: r.body || '', cover: r.cover || '', tags: r.tags ? String(r.tags).split(',').filter(Boolean) : [], status: r.status, author: r.author || AUTHOR, created: Number(r.created), updated: Number(r.updated), publishedAt: r.published_at ? Number(r.published_at) : null, views: Number(r.views) || 0 }); const row = r => ({ slug: r.slug, title: r.title, excerpt: r.excerpt || '', body: r.body || '', cover: r.cover || '', tags: r.tags ? String(r.tags).split(',').filter(Boolean) : [], status: r.status, author: r.author || AUTHOR, created: Number(r.created), updated: Number(r.updated), publishedAt: r.published_at ? Number(r.published_at) : null, views: Number(r.views) || 0 });
const impl = () => db.enabled() ? D : J; const impl = () => db.enabled() ? D : J;
let EXTRA_PAGES = () => []; // sitemap entries that follow a switch (the /bixpay guide while bixpayLive, 2026-10-29) function init(opts) { DATA_DIR = opts.dataDir; if (!db.enabled()) J.load(); }
function init(opts) { DATA_DIR = opts.dataDir; if (typeof opts.extraPages === 'function') EXTRA_PAGES = opts.extraPages; if (!db.enabled()) J.load(); }
async function listAll() { return (await impl().all()).sort((a, b) => (b.publishedAt || b.created) - (a.publishedAt || a.created)); } async function listAll() { return (await impl().all()).sort((a, b) => (b.publishedAt || b.created) - (a.publishedAt || a.created)); }
async function listPublished() { return (await listAll()).filter(p => p.status === 'published' && (p.publishedAt || 0) <= Date.now()); } async function listPublished() { return (await listAll()).filter(p => p.status === 'published' && (p.publishedAt || 0) <= Date.now()); }
async function get(slug) { return impl().get(slugify(slug)); } async function get(slug) { return impl().get(slugify(slug)); }
@@ -98,19 +96,19 @@ async function bumpViews(slug) { try { await impl().bumpViews(slug); } catch (e)
function head(o) { function head(o) {
const url = SITE + o.path; const url = SITE + o.path;
const img = o.image ? (o.image.startsWith('http') ? o.image : SITE + o.image) : SITE + '/banners/iap-hero-1200x630.png'; const img = o.image ? (o.image.startsWith('http') ? o.image : SITE + o.image) : SITE + '/banners/iap-hero-1200x630.png';
return '<!doctype html><html lang="en"' + themehead.htmlAttr('dark') + '><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">' return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">'
+ '<title>' + esc(o.title) + '</title><meta name="description" content="' + esc(o.desc) + '"><link rel="canonical" href="' + esc(url) + '">' + '<title>' + esc(o.title) + '</title><meta name="description" content="' + esc(o.desc) + '"><link rel="canonical" href="' + esc(url) + '">'
+ '<meta name="robots" content="index,follow,max-image-preview:large"><meta name="theme-color" content="#043b2f">' + '<meta name="robots" content="index,follow,max-image-preview:large"><meta name="theme-color" content="#043b2f">'
+ '<meta property="og:type" content="' + (o.article ? 'article' : 'website') + '"><meta property="og:site_name" content="InstantAdPay"><meta property="og:title" content="' + esc(o.title) + '"><meta property="og:description" content="' + esc(o.desc) + '"><meta property="og:url" content="' + esc(url) + '"><meta property="og:image" content="' + esc(img) + '">' + '<meta property="og:type" content="' + (o.article ? 'article' : 'website') + '"><meta property="og:site_name" content="InstantAdPay"><meta property="og:title" content="' + esc(o.title) + '"><meta property="og:description" content="' + esc(o.desc) + '"><meta property="og:url" content="' + esc(url) + '"><meta property="og:image" content="' + esc(img) + '">'
+ (o.article ? '<meta property="article:published_time" content="' + new Date(o.article.publishedAt || o.article.created).toISOString() + '"><meta property="article:modified_time" content="' + new Date(o.article.updated).toISOString() + '"><meta property="article:author" content="' + esc(AUTHOR) + '">' + (o.article.tags || []).map(t => '<meta property="article:tag" content="' + esc(t) + '">').join('') : '') + (o.article ? '<meta property="article:published_time" content="' + new Date(o.article.publishedAt || o.article.created).toISOString() + '"><meta property="article:modified_time" content="' + new Date(o.article.updated).toISOString() + '"><meta property="article:author" content="' + esc(AUTHOR) + '">' + (o.article.tags || []).map(t => '<meta property="article:tag" content="' + esc(t) + '">').join('') : '')
+ '<meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="' + esc(o.title) + '"><meta name="twitter:description" content="' + esc(o.desc) + '"><meta name="twitter:image" content="' + esc(img) + '">' + '<meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="' + esc(o.title) + '"><meta name="twitter:description" content="' + esc(o.desc) + '"><meta name="twitter:image" content="' + esc(img) + '">'
+ '<link rel="alternate" type="application/rss+xml" title="InstantAdPay blog" href="' + SITE + '/blog/feed.xml"><link rel="icon" type="image/png" href="/logo-icon.png">' + '<link rel="alternate" type="application/rss+xml" title="InstantAdPay blog" href="' + SITE + '/blog/feed.xml"><link rel="icon" type="image/png" href="/logo-icon.png">'
+ '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">' + themehead.tag() + '<link rel="stylesheet" href="/assets/site.css?v=20261112ln">' + '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"><link rel="stylesheet" href="/assets/site.css?v=20260912b">'
+ '<style>.bl{max-width:760px}.bl h1{font-size:clamp(30px,4.6vw,44px);line-height:1.12;margin:10px 0 12px}.bl .meta{color:var(--muted);font-size:14px;margin:0 0 22px}.bl .cover{width:100%;border-radius:14px;border:1px solid var(--line);margin:0 0 26px;display:block}.bl article{font-size:17.5px;line-height:1.7}.bl article p{margin:0 0 18px;max-width:68ch}.bl article h2{font-size:26px;margin:36px 0 12px}.bl article h3{font-size:20px;margin:28px 0 10px}.bl article ul,.bl article ol{margin:0 0 18px 22px;max-width:66ch}.bl article li{margin:6px 0}.bl article blockquote{border-left:4px solid var(--mint);margin:0 0 18px;padding:8px 18px;color:var(--muted);font-style:italic}.bl article img{max-width:100%;border-radius:12px;border:1px solid var(--line)}.bl article a{color:var(--mint)}.bl article pre{background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:14px;overflow:auto;font-size:14px}.bl article table{border-collapse:collapse;width:100%;font-size:15px}.bl article th,.bl article td{border-bottom:1px solid var(--line);padding:8px 10px;text-align:left}.tags a{display:inline-block;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--mint);border:1px solid var(--mint-line);border-radius:999px;padding:3px 10px;margin:0 6px 6px 0;text-decoration:none}.post-card{display:block;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px 22px;margin:0 0 14px;color:inherit;text-decoration:none}.post-card:hover{border-color:var(--mint)}.post-card h2{font-size:22px;margin:0 0 6px}.post-card p{margin:0;color:var(--muted);font-size:15px;max-width:70ch}.post-card .meta{margin:8px 0 0;font-size:13px}.author{display:flex;gap:14px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:36px 0 0;background:var(--panel)}.author img{width:56px;height:56px;border-radius:50%;object-fit:cover}.author b{display:block}.author span{color:var(--muted);font-size:14px}.share a{margin-right:14px;font-size:14px}.pager{display:flex;justify-content:space-between;margin:26px 0}.related{margin-top:40px}.related h3{margin-bottom:10px}</style>' + '<style>.bl{max-width:760px}.bl h1{font-size:clamp(30px,4.6vw,44px);line-height:1.12;margin:10px 0 12px}.bl .meta{color:var(--muted);font-size:14px;margin:0 0 22px}.bl .cover{width:100%;border-radius:14px;border:1px solid var(--line);margin:0 0 26px;display:block}.bl article{font-size:17.5px;line-height:1.7}.bl article p{margin:0 0 18px;max-width:68ch}.bl article h2{font-size:26px;margin:36px 0 12px}.bl article h3{font-size:20px;margin:28px 0 10px}.bl article ul,.bl article ol{margin:0 0 18px 22px;max-width:66ch}.bl article li{margin:6px 0}.bl article blockquote{border-left:4px solid var(--mint);margin:0 0 18px;padding:8px 18px;color:var(--muted);font-style:italic}.bl article img{max-width:100%;border-radius:12px;border:1px solid var(--line)}.bl article a{color:var(--mint)}.bl article pre{background:rgba(4,8,7,.6);border:1px solid var(--line);border-radius:10px;padding:14px;overflow:auto;font-size:14px}.bl article table{border-collapse:collapse;width:100%;font-size:15px}.bl article th,.bl article td{border-bottom:1px solid var(--line);padding:8px 10px;text-align:left}.tags a{display:inline-block;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--mint);border:1px solid rgba(67,232,195,.4);border-radius:999px;padding:3px 10px;margin:0 6px 6px 0;text-decoration:none}.post-card{display:block;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px 22px;margin:0 0 14px;color:inherit;text-decoration:none}.post-card:hover{border-color:var(--mint)}.post-card h2{font-size:22px;margin:0 0 6px}.post-card p{margin:0;color:var(--muted);font-size:15px;max-width:70ch}.post-card .meta{margin:8px 0 0;font-size:13px}.author{display:flex;gap:14px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:36px 0 0;background:var(--panel)}.author img{width:56px;height:56px;border-radius:50%;object-fit:cover}.author b{display:block}.author span{color:var(--muted);font-size:14px}.share a{margin-right:14px;font-size:14px}.pager{display:flex;justify-content:space-between;margin:26px 0}.related{margin-top:40px}.related h3{margin-bottom:10px}</style>'
+ '</head><body><div class="wrap bl">'; + '</head><body><div class="wrap bl">';
} }
function tail() { function tail() {
return '</div><script src="/assets/common.js?v=20261117nw"></script><script src="/assets/blog-page.js?v=20261101th"></script></body></html>'; return '</div><script src="/assets/common.js?v=20261023ov"></script><script src="/assets/blog-page.js?v=20260921a"></script></body></html>';
} }
const authorBox = () => '<div class="author"><img src="/logo-icon.png" alt="InstantAdPay"><div><b>' + AUTHOR + '</b><span>Founder of InstantAdPay and the Crypto Team Build Network. Twenty-plus years of internet marketing, and a habit of writing down what actually worked.</span></div></div>'; const authorBox = () => '<div class="author"><img src="/logo-icon.png" alt="InstantAdPay"><div><b>' + AUTHOR + '</b><span>Founder of InstantAdPay and the Crypto Team Build Network. Twenty-plus years of internet marketing, and a habit of writing down what actually worked.</span></div></div>';
const cardHtml = p => '<a class="post-card" href="/blog/' + esc(p.slug) + '">' + (p.cover ? '<img src="' + esc(p.cover) + '" alt="" loading="lazy" style="width:100%;border-radius:10px;margin:0 0 12px">' : '') + '<h2>' + esc(p.title) + '</h2><p>' + esc(p.excerpt) + '</p><p class="meta">' + fmtDate(p.publishedAt || p.created) + ' · ' + readMinutes(p.body) + ' min read' + (p.tags.length ? ' · ' + p.tags.map(esc).join(', ') : '') + '</p></a>'; const cardHtml = p => '<a class="post-card" href="/blog/' + esc(p.slug) + '">' + (p.cover ? '<img src="' + esc(p.cover) + '" alt="" loading="lazy" style="width:100%;border-radius:10px;margin:0 0 12px">' : '') + '<h2>' + esc(p.title) + '</h2><p>' + esc(p.excerpt) + '</p><p class="meta">' + fmtDate(p.publishedAt || p.created) + ' · ' + readMinutes(p.body) + ' min read' + (p.tags.length ? ' · ' + p.tags.map(esc).join(', ') : '') + '</p></a>';
@@ -154,7 +152,7 @@ function rss(posts) {
return '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>InstantAdPay blog</title><link>' + SITE + '/blog</link><description>Coaching and teaching articles from Marty Bostick.</description>' + items + '</channel></rss>'; return '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>InstantAdPay blog</title><link>' + SITE + '/blog</link><description>Coaching and teaching articles from Marty Bostick.</description>' + items + '</channel></rss>';
} }
function sitemap(posts) { function sitemap(posts) {
const pages = ['/', '/facts', '/blog', '/whats-new', '/leaderboard', '/ledger', '/contract', '/plays', '/wallets', '/earning', '/partners', '/friday', '/wednesday', '/refuel', '/conversion-tracking', '/presentation'].concat(EXTRA_PAGES() || []); const pages = ['/', '/facts', '/blog', '/whats-new', '/leaderboard', '/ledger', '/contract', '/plays', '/wallets', '/earning', '/partners', '/friday', '/wednesday', '/refuel', '/conversion-tracking', '/presentation'];
const u = pages.map(p => '<url><loc>' + SITE + p + '</loc><changefreq>weekly</changefreq></url>').join('') const u = pages.map(p => '<url><loc>' + SITE + p + '</loc><changefreq>weekly</changefreq></url>').join('')
+ posts.map(p => '<url><loc>' + SITE + '/blog/' + p.slug + '</loc><lastmod>' + new Date(p.updated).toISOString().slice(0, 10) + '</lastmod><changefreq>monthly</changefreq></url>').join(''); + posts.map(p => '<url><loc>' + SITE + '/blog/' + p.slug + '</loc><lastmod>' + new Date(p.updated).toISOString().slice(0, 10) + '</lastmod><changefreq>monthly</changefreq></url>').join('');
return '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + u + '</urlset>'; return '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + u + '</urlset>';
+43 -195
View File
@@ -16,33 +16,15 @@ const https = require('https');
const http = require('http'); const http = require('http');
const kb = require('./kb'); const kb = require('./kb');
const kbSeed = require('./kb-seed'); const kbSeed = require('./kb-seed');
const netkb = require('./netkb'); // the shared network knowledge base on the hub (2026-11-15): publishes this site's entries, reads the other sites'
let DATA_DIR = null; let DATA_DIR = null;
let chain = null; let chain = null;
let HERO_SALE = null; // () => gamepass.cfg().heroes + names (server.js): the bonus-hero fact follows heroSales (2026-11-05)
let PASS_TIERS = null; // () => the live pass tiers (server.js, from gamepass.cfg): the tier fact follows the sovTiers switch let PASS_TIERS = null; // () => the live pass tiers (server.js, from gamepass.cfg): the tier fact follows the sovTiers switch
const MODEL = process.env.OPENROUTER_MODEL || 'deepseek/deepseek-v4-flash:nitro'; const MODEL = process.env.OPENROUTER_MODEL || 'deepseek/deepseek-v4-flash:nitro';
// Network Weekend (2026-11-17, promodays.js): a date-gated fact and answer; empty outside the window, so nothing to undo after it
let WEEKEND = null;
function init(opts) { function init(opts) {
WEEKEND = opts && opts.weekend && typeof opts.weekend.fact === 'function' ? opts.weekend : null;
if (opts && typeof opts.gameLive === 'function') GAME_LIVE = opts.gameLive; if (opts && typeof opts.gameLive === 'function') GAME_LIVE = opts.gameLive;
if (opts && typeof opts.refuelOn === 'function') REFUEL_ON = opts.refuelOn; if (opts && typeof opts.refuelOn === 'function') REFUEL_ON = opts.refuelOn; DATA_DIR = opts.dataDir; chain = opts.chain; PASS_TIERS = typeof opts.passTiers === 'function' ? opts.passTiers : null; return kb.init({ dataDir: DATA_DIR, seeds: seeds() }); }
if (opts && typeof opts.bixLive === 'function') BIX_LIVE = opts.bixLive; DATA_DIR = opts.dataDir; chain = opts.chain; PASS_TIERS = typeof opts.passTiers === 'function' ? opts.passTiers : null; HERO_SALE = typeof opts.heroSale === 'function' ? opts.heroSale : null; const ready = kb.init({ dataDir: DATA_DIR, seeds: seeds() });
netkb.init({ dataDir: DATA_DIR, site: process.env.HUB_SITE || 'iap', name: 'InstantAdPay', url: 'https://instantadpay.com', entries: () => kb.own(), linkFor: netLink });
return ready; }
// the link to another network site: its LinkSpin tracked link with ?src=iap (netsites.js), else its plain address
function netLink(url) {
try { const ns = require('./netsites'); const h = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
const m = ns.list().concat(ns.FALLBACK || []).find(x => h(x.url) === h(url)); return (m && m.id !== 'iap' && ns.tracked(m.id, 'iap')) || url; } catch (e) { return url; }
}
// the other network sites for the system prompt (from the hub's merged set)
function networkBlock() {
const l = netkb.sites(); if (!l.length) return '';
return '\n- OTHER NETWORK SITES (one network account works across them): ' + l.map(x => x.name + ' ' + x.go).join('; ') + '. A question about one of them: answer from its KNOWLEDGE BASE entries below, say which site it is about, give its link exactly as shown, and never mix two sites\' prices, splits or rules. Wallets: say "SafePal or any other crypto wallet". Ad credits buy advertising, not income. Never mention RM Circle.';
}
function key() { function key() {
if (process.env.OPENROUTER_API_KEY) return process.env.OPENROUTER_API_KEY.trim(); if (process.env.OPENROUTER_API_KEY) return process.env.OPENROUTER_API_KEY.trim();
try { return fs.readFileSync(path.join(DATA_DIR, 'openrouter.key'), 'utf8').trim(); } catch (e) { return ''; } try { return fs.readFileSync(path.join(DATA_DIR, 'openrouter.key'), 'utf8').trim(); } catch (e) { return ''; }
@@ -50,53 +32,18 @@ function key() {
function enabled() { return !!key(); } function enabled() { return !!key(); }
// ---- canned answers: instant, free, always in voice ---- // ---- canned answers: instant, free, always in voice ----
const KNOWLEDGE_DATE = '2026-11-23'; // bump whenever the canned answers / prompt are brought up to date const KNOWLEDGE_DATE = '2026-10-28'; // bump whenever the canned answers / prompt are brought up to date
const SUPPORT_RE = /(contact|reach|email|e-mail|message|talk to|speak (to|with)|get hold of) (the )?(support|admin|administrator|owner|marty|staff|team at instantadpay|someone|a (human|person|real person))|support (email|address|ticket|team|desk)|help ?desk|(open|send|file|submit|raise) (a )?(support )?ticket|\b(human|real person|live (agent|person|chat|support))\b|customer (service|support)|support@|how (do|can) i get (help|support)/i; const SUPPORT_RE = /(contact|reach|email|e-mail|message|talk to|speak (to|with)|get hold of) (the )?(support|admin|administrator|owner|marty|staff|team at instantadpay|someone|a (human|person|real person))|support (email|address|ticket|team|desk)|help ?desk|(open|send|file|submit|raise) (a )?(support )?ticket|\b(human|real person|live (agent|person|chat|support))\b|customer (service|support)|support@|how (do|can) i get (help|support)/i;
const CANNED = [ const CANNED = [
// network sign-in (2026-11-12): signed in on one of InstantAdPay / LinkSpin = signed in on the other, no code (networksso.js)
{ id: 'network-signin', title: 'One sign-in for InstantAdPay and LinkSpin', q: ['Do I have to sign in again on LinkSpin?', 'Why was I signed in on LinkSpin without a code?', 'Is it one sign-in for both sites?'], tags: ['sign in', 'network sign-in', 'linkspin', 'code', 'single sign-on'],
re: /(((sign(ed)?|log(ged)?) ?-?(in|on)\b(?! ?-?ads?\b)|\bcodes?\b|password).{0,40}(linkspin|both sites|other site)|(linkspin|both sites|other site).{0,40}((sign(ed)?|log(ged)?) ?-?(in|on)\b(?! ?-?ads?\b)|\bcodes?\b|password)|single sign|sso|one sign.?in|network sign.?in)/i,
a: 'One sign-in covers both sites. While you are signed in on InstantAdPay, any link inside your account that opens LinkSpin (the Engine Room, Refuel and the other LinkSpin links) lands you there signed in, with no code. It works the other way too, and if you open the sign-in screen on either site while you are signed in on the other, it signs you in by itself. Both sites use the same email. The one exception: if your account on the other site is not set up yet (for example you joined minutes ago, or it is waiting for your first visit), you get the usual email code that one time, with your email already filled in. Signing out signs you out of that site only, and it stays signed out there until you sign in again or follow a link from the other site. A sign-in now lasts 7 days on each site and renews while you use it; the login sponsor ad still shows every few hours. This sign-in never moves money: buying, payouts and wallet actions work exactly as before.' },
// Stack POL (2026-11-09): stackpol.com, every POL payout across the network on one page; members opt in to a page in Promo tools
// Earners Corner (2026-11-10): earnerscorner.com, the network's forum; sign-in is the InstantAdPay account (DiscourseConnect)
{ id: 'earners-corner', title: 'Earners Corner forum', q: ['What is Earners Corner?', 'Is there a forum?', 'How do I sign in to the forum?'], tags: ['earners corner', 'forum', 'earnerscorner', 'community', 'discussion'],
re: /\b(earners ?corner|earnerscorner(\.com)?|forum)\b/i,
a: 'Earners Corner (https://earnerscorner.com) is our forum for people who earn online: business opportunities, paid to click, traffic exchanges and mailers, crypto earning and wallets, affiliate marketing and tools, with its own section for InstantAdPay, LinkSpin, the games and Stack POL. Anyone can read it. To post, tap Log In there and sign in with your InstantAdPay account, no new password. A new account\'s first post is reviewed before it shows, and referral links belong in the Promote Your Program category. Members with an on-chain position can post links from day one. It also has an assistant that answers questions about the network and finds related threads.' },
{ id: 'stack-pol', title: 'Stack POL', q: ['What is Stack POL?', 'How do I get my Stack POL page?', 'What is stackpol.com?'], tags: ['stack pol', 'stackpol', 'payouts', 'ledger', 'promo tools', 'stack pol pro', 'pro'],
re: /\b(stack ?pol|stackpol(\.com)?)\b/i,
a: 'Stack POL (https://stackpol.com) adds up every POL payout in the network: InstantAdPay and LinkSpin referral payments and the rewards from every game that pays POL. It shows the network total, one page per program, and a public ledger of the latest payouts with the username and a Polygonscan link for every payment. It refreshes every 5 minutes. Every member who has been paid has a page by default at stackpol.com/your-username (Promo tools > Stack POL shows the link and the switch "Show my Stack POL page"). It appears at stackpol.com/your-username within 5 minutes and carries your referral link on every program card. Link a wallet so your payouts can be added up. Switch it off any time. Stack POL Pro is a one-time upgrade: your page then shows your own LinkSpin Banner Spins in its ad spots and your spin links, a purple QR code that opens your page, and blog articles opened from your page show your banners and use your referral links on every button. Any ad package of $10 or more unlocks it automatically, one time, yours for good: Pro switches on when that package settles on chain, and you keep every credit of the package. Credits never unlock it. Pro owners also get the Stack POL Pro badge. The totals are what members were paid, not a promise of what anyone will earn.' },
// Shards of Valor bonus heroes (2026-11-05, Marty approved): sold one time. The prices and whether they are on sale live in settings, so
// this answer names neither; heroesFact() gives the AI the live state.
{ id: 'sov-bonus-heroes', title: 'Shards of Valor bonus heroes', q: ['What are the bonus heroes in Shards of Valor?', 'How do I get Kestrel, Valda, Morag or Roland?', 'Is the hero a subscription?'], tags: ['shards of valor', 'heroes', 'bonus heroes', 'kestrel', 'valda', 'morag', 'roland', 'party'],
re: /\b(bonus heroe?s?|kestrel|valda|morag|roland|paladin|barbarian|druid hero|archer hero|hero bundle)\b/i,
a: 'Shards of Valor has four bonus heroes: Kestrel the Archer, Valda the Barbarian, Morag the Druid and Roland the Paladin. Kestrel is free for every player: she joins for good once a hero in your party reaches level 20, and she is not sold. Valda, Morag and Roland are each a one-time purchase, yours for good, with no subscription, and there is a bundle of those three. Like a Game Pass, a hero is paid by a new package purchase of at least its price (your sponsor and team are paid as usual and you keep the package credits for your ads); credits you already hold never buy one. When they are on sale they show on the Game Pass card in Members > Games (https://instantadpay.com/my#games) with each price; if you do not see them there, they are not on sale yet. In the game three heroes fight at a time and you pick which three at an inn, a rest spot or a dungeon camp; heroes waiting in the roster keep their gear and level and earn half experience. A bonus hero joins at your party level (at most 20) and is never stronger than the free heroes. The whole story stays free with Aldric, Sylwen and Borin.' },
{ id: 'support', title: 'Contact support or open a ticket', q: ['How do I contact support?', 'How do I talk to a real person?', 'How do I open a support ticket?'], tags: ['support', 'help', 'ticket', 'contact', 'help desk'], { id: 'support', title: 'Contact support or open a ticket', q: ['How do I contact support?', 'How do I talk to a real person?', 'How do I open a support ticket?'], tags: ['support', 'help', 'ticket', 'contact', 'help desk'],
re: SUPPORT_RE, handoff: true, re: SUPPORT_RE, handoff: true,
a: 'Open Help in your member dashboard (https://instantadpay.com/my#help) to send Marty a ticket, and his replies land right there and in your email. Not signed in or locked out? Use https://instantadpay.com/support, or email support@instantadpay.com. You can also tap "Send this to support" below and I will pass this chat along.' }, a: 'Open Help in your member dashboard (https://instantadpay.com/my#help) to send Marty a ticket, and his replies land right there and in your email. Not signed in or locked out? Use https://instantadpay.com/support, or email support@instantadpay.com. You can also tap "Send this to support" below and I will pass this chat along.' },
// BixPay Visa card (2026-10-29, docs/BIXPAY-INTEGRATION.md). Sits ahead of the Level 4 entry because that one also matches "3%".
// While site config bixpayLive is off, answer() swaps every bixpay-* hit for BIX_SOON_ANSWER. Never BIX's marketing claims (user
// counts, spend per day, valuations) as facts; the only fee we state is 3% per purchase, no load fee, see BIX's terms for the rest.
{ id: 'bixpay-link', title: 'Where to put my BixPay partner link', q: ['Where do I put my BixPay partner link?', 'How do I add my BIX link?', 'Which BixPay link do I paste, referral or partner?'], tags: ['bixpay', 'bix', 'partner link', 'profile', 'ib portal'],
re: /(bix|bixpay).*(partner link|my link|referral link|ib ?portal|paste|where do i (put|add|enter)|profile)|(partner link|ib ?portal).*(bix|bixpay)/i,
a: 'Members > Profile > BixPay card. Paste your PARTNER link there: in your BIX portal (bix.ibportal.io) open Profile and copy the link in the second box, the one labelled Partner. It looks like https://bix.ibportal.io/auth/register?e=...&a=1. The first box, the Bix referral link (it ends in appId=3), only makes a card customer, so the field refuses it and asks for the Partner one. Once saved, your Wallet card, your promo kit, the /bixpay guide opened from your links and the line in your payout emails all carry your link, and LinkSpin will read the same one.' },
{ id: 'bixpay-credit', title: 'Who gets the BixPay credit', q: ['Who gets credit when someone signs up for BixPay through my page?', 'Whose BixPay link is on my pages?', 'What does "Using: the network link" mean?'], tags: ['bixpay', 'bix', 'credit', 'sponsor', 'network link'],
re: /(bix|bixpay).*(credit|whose|who gets|sponsor.s link|network link|using:|my sponsor|upline)|(whose|who gets).*(bix|bixpay)/i,
a: 'The BixPay link on your pages is yours when you have saved your partner link in Profile. If you have not, it is the first sponsor up your line (up to ten levels) who has one, and if nobody has, it is the network link. Every BixPay card says which one is in play: "Using: your link", "Using: @name’s link" or "Using: the network link". Sign-ups are credited inside the BIX portal to whoever owns that link, directs and levels included; InstantAdPay does not count or pay BixPay sign-ups itself. Add your own link in Members > Profile > BixPay card so the credit is yours.' },
{ id: 'bixpay-load', title: 'Loading the BixPay card from POL', q: ['How do I load my BixPay card from POL?', 'Can I send POL to BixPay?', 'How do I fund the BixPay card?'], tags: ['bixpay', 'bix', 'fund', 'load', 'usdt', 'usdc', 'polygon', 'cash app'],
re: /(bix|bixpay).*(load|fund|top ?up|deposit|send pol|from pol|usdt|usdc|swap|cash ?app)|(load|fund|top ?up).*(bix|bixpay)/i,
a: 'The BixPay card spends USDT or USDC, so the step is POL to USDT or USDC first. Three ways: (1) swap your POL for USDT or USDC on any exchange or on-ramp you already use, then send it to your BixPay wallet on the Polygon network (open the BIX app, Wallet > Receive, pick USDT or USDC, and use the Polygon address); (2) in the US, Cash App can send crypto straight to the BixPay wallet; (3) BIX has said an in-app swap is coming, and we will add it here when it ships. Once the USDT or USDC is in the wallet, tap TOPUP on the card. No load fee; 3% per purchase; see BIX’s terms for other charges. The full walk-through with screenshots is at https://instantadpay.com/bixpay.' },
{ id: 'bixpay-card', title: 'How to get the BixPay card', q: ['How do I get the BixPay card?', 'How do I sign up for BixPay?', 'Is BixPay available in my state?'], tags: ['bixpay', 'bix', 'visa card', 'virtual card', 'sign up', 'states'],
re: /(bix|bixpay).*(get|sign ?up|join|order|apply|virtual|plastic|metal|state|country|available|how much|cost|price|\$9)|(get|sign ?up for|order).*(bix|bixpay)/i,
a: 'Open the BixPay card in your Wallet tab (Members > Wallet) and tap Get your BixPay card. That opens a partner sign-up link, so you join as a partner and the card and the referral plan come with it: 1) register in the BIX portal ON THE PAGE THE LINK OPENS (if you are reading this inside Gmail or Telegram, open the page in Chrome or Safari first; do not install the app first and do not use the portal’s own Sign Up menu, or your sponsor is lost and BIX shows the referrer as N/A), 2) download the BIX app and create your wallet, 3) in the app open Settings > Scan QR and scan the code in your portal profile to link the two, 4) Cards > Create Card for the $9.99 virtual Visa (plastic, metal and gold cards cost more). KYC is required for the card. In the US it is open in 31 states so far; not in your state yet? You can still get the wallet and build. Elsewhere availability varies by country. Guide: https://instantadpay.com/bixpay.' },
{ id: 'bixpay', title: 'What BixPay is', q: ['What is BixPay?', 'What is the BIX card?', 'Can I spend my POL with a Visa card?'], tags: ['bixpay', 'bix', 'visa', 'card', 'spend pol', 'wallet'],
re: /(bix|bixpay|bix card|visa card|debit card|spend (my )?(pol|crypto|earnings)|crypto card)/i,
a: 'BixPay is a self-custody wallet with a Visa card, made by BIX, a separate company. You send USDT or USDC to it on Polygon, load the card, and spend wherever Visa is accepted, including Apple Pay and Google Pay. Virtual cards from $9.99. 3% per purchase, no load fee; see BIX’s terms for other charges. InstantAdPay is not the card issuer; members who join BixPay as partners get their own partner link, and anyone who gets a card through their pages is credited to them in the BIX portal, up to ten levels deep. Where to find it: Members > Wallet (the card), Members > Profile (your partner link), Promo tools > BixPay (posts and banners), and the guide at https://instantadpay.com/bixpay. Crypto assets can lose value.' },
{ id: 'level4-override', title: 'The Level 4 override (3%)', q: ['What is the Level 4 override?', 'Do I earn from my fourth level?', 'How does the 3% override work?'], tags: ['override', 'level 4', 'fourth level', 'commission', 'payouts'], { id: 'level4-override', title: 'The Level 4 override (3%)', q: ['What is the Level 4 override?', 'Do I earn from my fourth level?', 'How does the 3% override work?'], tags: ['override', 'level 4', 'fourth level', 'commission', 'payouts'],
re: /(level ?(4|four)|4th level|fourth level|override|3 ?%|three percent)/i, re: /(level ?(4|four)|4th level|fourth level|override|3 ?%|three percent)/i,
a: 'The Level 4 override is 3% of every package bought four levels below you, paid by the company on top of the three levels the contract pays. It goes to the buyer’s 4th sponsor up if that member has 5 or more qualifying buyers (direct referrals who bought $20 or more, the same bar as level 3). If they do not have 5 yet, it moves up the line to the next member who does, up to 25 steps, and each purchase pays one override to one person. It is paid weekly in POL from a company wallet, every Monday after 9 AM Central for the Monday to Sunday week before, through the contract’s award function, so every payment has a Polygon link, and it shows in your Earnings as "Level 4 override". Weekly totals under 0.01 POL carry over to the next week. It counts purchases from the start date on, not earlier ones. It comes from the platform’s 20% share, so the 50/20/10 split does not change. What you earn depends on real purchases in your line; nothing is guaranteed.' }, a: 'The Level 4 override is 3% of every package bought four levels below you, paid by the company on top of the three levels the contract pays. It goes to the buyer’s 4th sponsor up if that member has 5 or more qualifying buyers (direct referrals who bought $20 or more, the same bar as level 3). If they do not have 5 yet, it moves up the line to the next member who does, up to 25 steps, and each purchase pays one override to one person. It is paid weekly in POL from a company wallet, every Monday after 9 AM Central for the Monday to Sunday week before, through the contract’s award function, so every payment has a Polygon link, and it shows in your Earnings as "Level 4 override". Weekly totals under 0.01 POL carry over to the next week. It counts purchases from the start date on, not earlier ones. It comes from the platform’s 20% share, so the 50/20/10 split does not change. What you earn depends on real purchases in your line; nothing is guaranteed.' },
{ id: 'game-pass', title: 'Game Pass and daily POL caps', q: ['What is the Game Pass?', 'Why did I hit the daily POL cap in the games?', 'Does a boss reward carry over to the next day?'], tags: ['games', 'game pass', 'daily cap', 'tournament'], { id: 'game-pass', title: 'Game Pass and daily POL caps', q: ['What is the Game Pass?', 'Why did I hit the daily POL cap in the games?', 'Does a boss reward carry over to the next day?'], tags: ['games', 'game pass', 'daily cap', 'tournament'],
re: /(game ?pass|pass tournament|daily (pol )?cap|pol cap|cap(ped|s)? (on|in|for) (the )?games?|hit (the|my|today.s) (free )?cap|carr(y|ied) (over|forward))/i, re: /(game ?pass|pass tournament|daily (pol )?cap|pol cap|cap(ped|s)? (on|in|for) (the )?games?|hit (the|my|today.s) (free )?cap|carr(y|ied) (over|forward))/i,
a: 'The Game Pass is $5 for 7 days and covers every game in the network on your InstantAdPay account (linked positions included). Since Nov 2 free play is a taste and the Pass is where the games pay: higher daily POL caps across every game (1.50 POL a day on repeatable rewards instead of 0.30, and 5 POL a day in all instead of 2), a seat in the weekly Pass Tournament (POL prizes from 5% of pass sales, settled Mondays, top 3 posted to Game Achievements), extra plays or a perk in each game, and the gold Game Pass badge with your name. Per game: PolHunter 5 hunts a day at the full 0.05 to 1 POL draw instead of one small free hunt (0.02 to 0.10), plus the weekly prizes, the Mystery Hunt Box and 2 Ad Detective cases; Gem Kingdom one free continue a day; Spooky Doors one extra door a day; ClutterHunt 2 bonus hints a day; SpellWheel daily streak 0.30 POL instead of 0.15 plus 1 free hint a day; PolyBreak daily gem limit 1.5 POL instead of 0.5 plus an extra paddle every round; POL Miner daily crystal limit 1.5 POL instead of 0.5 plus one free supply crate every day; PolyWarriors a 4th daily mission and defense pays 25 Circuits instead of 15; Drip Runner a free shield at the start of every run; Road Agent 2 patrols a day and 25% more scrap. The full list is on the Game Pass card. Caps are account-wide and reset at midnight Central. There is also a free allowance: an account with no pass receives at most 2 POL of game rewards in total, across every game, ever; after that the games keep paying only while a pass is active, and one-time progress rewards earned in the meantime are held and paid once it is. When your allowance is used up, the game you are playing and your Overview tell you, with the amount being held for you. A one-time progress reward (a boss, a chapter, a sector) is never lost: whatever is over the day\u2019s total carries to the next day until it is paid in full; repeatable daily play over the daily cap is simply not paid that day. The Pass never changes how much any reward pays, so it is more game, not more payback. Get it in Members > Games > Game Pass: every pass is paid by a NEW package purchase of $5 or more. Tap Get the Pass, then buy the package; the pass starts the moment that purchase settles on chain. Your sponsor and team are paid from that package as usual, and you keep every credit of the package for your ads. Credits you already hold (earned or purchased) never buy a pass, and a package bought before you tapped Get the Pass does not count. Buying again while a pass is active adds 7 days.' }, a: 'The Game Pass is $5 for 7 days and covers every game in the network on your InstantAdPay account (linked positions included). Free play keeps paying real POL every day; the Pass plays more: higher daily POL caps across every game (1.50 POL a day on repeatable rewards instead of 0.30, and 5 POL a day in all instead of 2), a seat in the weekly Pass Tournament (POL prizes from 5% of pass sales, settled Mondays, top 3 posted to Game Achievements), extra plays or a perk in each game, and the gold Game Pass badge with your name. Per game: PolHunter 5 missions a day instead of 3 plus 2 Ad Detective cases; Gem Kingdom one free continue a day; Spooky Doors one extra door a day; ClutterHunt 2 bonus hints a day; SpellWheel daily streak 0.30 POL instead of 0.15 plus 1 free hint a day; PolyBreak daily gem limit 1.5 POL instead of 0.5 plus an extra paddle every round; POL Miner daily crystal limit 1.5 POL instead of 0.5 plus one free supply crate every day; PolyWarriors a 4th daily mission and defense pays 25 Circuits instead of 15; Drip Runner a free shield at the start of every run; Road Agent 2 patrols a day and 25% more scrap. The full list is on the Game Pass card. Caps are account-wide and reset at midnight Central. A one-time progress reward (a boss, a chapter, a sector) is never lost: whatever is over the day\u2019s total carries to the next day until it is paid in full; repeatable daily play over the daily cap is simply not paid that day. The Pass never changes how much any reward pays, so it is more game, not more payback. Get it in Members > Games > Game Pass: every pass is paid by a NEW package purchase of $5 or more. Tap Get the Pass, then buy the package; the pass starts the moment that purchase settles on chain. Your sponsor and team are paid from that package as usual, and you keep every credit of the package for your ads. Credits you already hold (earned or purchased) never buy a pass, and a package bought before you tapped Get the Pass does not count. Buying again while a pass is active adds 7 days.' },
// game POL to any linked wallet (Marty, 2026-10-27, "build all three"): sits ahead of the per-game entries so "my Gem Kingdom POL never came" lands here // game POL to any linked wallet (Marty, 2026-10-27, "build all three"): sits ahead of the per-game entries so "my Gem Kingdom POL never came" lands here
{ id: 'game-pol-wallet', title: 'Getting your game POL (link your wallet)', q: ['Why was my game POL not sent?', 'It says POL is waiting for my wallet', 'Do I need to switch on payouts to get game POL?'], tags: ['games', 'game pol', 'link wallet', 'waiting for your wallet', 'not sent'], { id: 'game-pol-wallet', title: 'Getting your game POL (link your wallet)', q: ['Why was my game POL not sent?', 'It says POL is waiting for my wallet', 'Do I need to switch on payouts to get game POL?'], tags: ['games', 'game pol', 'link wallet', 'waiting for your wallet', 'not sent'],
re: /(pol (is )?waiting for (my |your |a )?wallet|link (my |your |a )?wallet to (receive|get)|(game|games|gem ?kingdom|drip ?runner|clutter ?hunt|spooky ?doors|road ?agent|poly ?break|spell ?wheel|poly ?warriors?)\b[^.?!]{0,60}\bpol\b[^.?!]{0,40}\b(not (been )?(paid|sent)|never (paid|sent|arrived|came)|stuck|waiting|pending|switch on|activat\w*)|(switch on|turn on|activate) payouts?[^.?!]{0,40}\b(game|games)\b[^.?!]{0,20}\bpol\b)/i, re: /(pol (is )?waiting for (my |your |a )?wallet|link (my |your |a )?wallet to (receive|get)|(game|games|gem ?kingdom|drip ?runner|clutter ?hunt|spooky ?doors|road ?agent|poly ?break|spell ?wheel|poly ?warriors?)\b[^.?!]{0,60}\bpol\b[^.?!]{0,40}\b(not (been )?(paid|sent)|never (paid|sent|arrived|came)|stuck|waiting|pending|switch on|activat\w*)|(switch on|turn on|activate) payouts?[^.?!]{0,40}\b(game|games)\b[^.?!]{0,20}\bpol\b)/i,
@@ -112,10 +59,7 @@ const CANNED = [
a: 'PassiveDrip (https://passivedrip.com) is our earning site, listed under More ways to earn on your Earn tab. Claim the faucet, view paid-to-click ads, complete offers and roll the daily bonus for coins. When your balance reaches 2,000 coins ($1) it is paid out automatically in POL to your wallet on Polygon. Open it from the Earn tab with one tap: it signs you in with your InstantAdPay account, no new password. Add your Polygon wallet there so payouts can reach you. What you earn depends on what you do there; nothing is guaranteed.' }, a: 'PassiveDrip (https://passivedrip.com) is our earning site, listed under More ways to earn on your Earn tab. Claim the faucet, view paid-to-click ads, complete offers and roll the daily bonus for coins. When your balance reaches 2,000 coins ($1) it is paid out automatically in POL to your wallet on Polygon. Open it from the Earn tab with one tap: it signs you in with your InstantAdPay account, no new password. Add your Polygon wallet there so payouts can reach you. What you earn depends on what you do there; nothing is guaranteed.' },
{ id: 'spellwheel', title: 'SpellWheel word game', q: ['What is SpellWheel?', 'Is there a daily word puzzle?'], tags: ['games', 'spellwheel', 'word game', 'daily puzzle'], { id: 'spellwheel', title: 'SpellWheel word game', q: ['What is SpellWheel?', 'Is there a daily word puzzle?'], tags: ['games', 'spellwheel', 'word game', 'daily puzzle'],
re: /(spell ?wheel|letter wheel|word (game|puzzle)|crossword|daily puzzle)/i, re: /(spell ?wheel|letter wheel|word (game|puzzle)|crossword|daily puzzle)/i,
a: 'SpellWheel (https://spellwheel.com, also in Members > Games) is a word game: swipe the letters on the wheel to fill the crossword grid, travel through six cozy places, and solve a new daily puzzle that everyone gets at the same time. Guests play the first place. Signing in with your InstantAdPay account opens the second and saves your progress. The Mountain Lodge and the three places after it, plus the POL for the daily puzzle and streaks, are for Game Pass holders. POL is paid for first clears only: a small taste in the first two places, and the full table from the third place on for pass holders, collected in your SpellWheel balance and sent to the wallet on your InstantAdPay account automatically. Nothing here is a promise of income.' }, a: 'SpellWheel (https://spellwheel.com, also in Members > Games) is a free word game: swipe the letters on the wheel to fill the crossword grid, travel through six cozy places, and solve a new daily puzzle that everyone gets at the same time. Sign in with your InstantAdPay account right in the game to save progress: clearing levels, finishing a place and solving the daily puzzle each pay POL, collected in your SpellWheel balance and sent to the wallet on your InstantAdPay account automatically. Nothing here is a promise of income.' },
{ id: 'warpwares', title: 'Warp & Wares season game', q: ['What is Warp & Wares?', 'How does Warp & Wares pay?', 'What is a sponsor dock?'], tags: ['games', 'warp and wares', 'trade wars', 'season', 'sponsor dock', 'turns'],
re: /(warp ?(and|&) ?wares|warpwares|trade ?wars|sponsor docks?|bonus turns|trading season)/i,
a: 'Warp & Wares (also in Members > Games) is the network\u2019s 30-day season game in the Trade Wars style. One shared galaxy of 1,200 sectors; every captain gets the same 200 turns a day (reset at midnight Central, never banked) to warp between sectors, buy ore, grain and parts where they are cheap and sell where they are not, haggle, leave fighters and mines to hold sectors, found a base and run a team of up to five with a shared vault. One tap signs you in with your InstantAdPay account. Credits stay in the game; POL is paid for fixed outcomes from a published season budget: the holders of the six landmark sectors and the top traders at each weekly tick (Sundays 9 AM Central), one-time milestones (first base, first garrison, first 100,000 credits traded), and the season-close leaderboard and titles. POL collects in your Warp & Wares balance and is sent automatically to the wallet linked to your InstantAdPay account (one free signature on the Wallet tab). Sponsor markets: docking at one opens a short verified sponsor visit on InstantAdPay and pays bonus turns, the only turns past the daily 200; that is gameplay only, never POL. When the season ends the galaxy resets and the next one starts. Nothing here is a promise of income.' },
{ id: 'polminer', title: 'POL Miner mining game', q: ['What is POL Miner?', 'How do Polygon crystals work in POL Miner?', 'What is a supply crate?'], tags: ['games', 'polminer', 'mining', 'polygon crystal', 'supply crate'], { id: 'polminer', title: 'POL Miner mining game', q: ['What is POL Miner?', 'How do Polygon crystals work in POL Miner?', 'What is a supply crate?'], tags: ['games', 'polminer', 'mining', 'polygon crystal', 'supply crate'],
re: /(pol ?miner|mining game|digging game|polygon crystals?|pink crystals?|drill boss(es)?|supply crates?)/i, re: /(pol ?miner|mining game|digging game|polygon crystals?|pink crystals?|drill boss(es)?|supply crates?)/i,
a: 'POL Miner (https://polminer.com, also in Members > Games) is a free dig-down mining game. Dig through the layers of dirt and rock, haul ore up to sell for coins, upgrade your pick, lamp, cart and thruster, and beat a drill boss every 30 m to open the way deeper. The rare glowing pink Polygon crystals pay a random amount of POL the first time you dig each one out, each drill boss pays POL the first time you beat it, and so do your first trips to 50, 100, 150 and 200 m. Coins are for upgrades only and never turn into POL. You can play as a guest right away; sign in with your InstantAdPay account in the game and what you earned as a guest is collected. POL collects in your POL Miner balance and is sent automatically to the wallet linked to your InstantAdPay account (one free signature on the Wallet tab) once it reaches the payout amount. Low on lamp power or coins? Park on the SUPPLY pad: a short sponsor visit opens a supply crate with a full lamp and coins.' }, a: 'POL Miner (https://polminer.com, also in Members > Games) is a free dig-down mining game. Dig through the layers of dirt and rock, haul ore up to sell for coins, upgrade your pick, lamp, cart and thruster, and beat a drill boss every 30 m to open the way deeper. The rare glowing pink Polygon crystals pay a random amount of POL the first time you dig each one out, each drill boss pays POL the first time you beat it, and so do your first trips to 50, 100, 150 and 200 m. Coins are for upgrades only and never turn into POL. You can play as a guest right away; sign in with your InstantAdPay account in the game and what you earned as a guest is collected. POL collects in your POL Miner balance and is sent automatically to the wallet linked to your InstantAdPay account (one free signature on the Wallet tab) once it reaches the payout amount. Low on lamp power or coins? Park on the SUPPLY pad: a short sponsor visit opens a supply crate with a full lamp and coins.' },
@@ -130,31 +74,22 @@ const CANNED = [
a: 'PolyWarriors (https://www.polywarriors.com, also in Members > Games) is a free cyberpunk turn-based fighting game, open since Oct 12. Recruit warriors that are each born with their own traits and rarity, fight through 24 arena rivals (a 12-rival district ladder, then a 12-rival elite circuit), and challenge other members to duels that play out while you are away. Your first win over each rival pays POL to the wallet on your InstantAdPay account. Your first warrior mints to your wallet as an NFT on Polygon, free; after that each $5 ad package you buy on InstantAdPay earns a mint pass. Fuse three warriors of the same rarity into one rarer warrior, and trade warriors with other members on the marketplace, settled in POL. Sign in with your InstantAdPay account in one tap. Nothing here is a promise of income.' }, a: 'PolyWarriors (https://www.polywarriors.com, also in Members > Games) is a free cyberpunk turn-based fighting game, open since Oct 12. Recruit warriors that are each born with their own traits and rarity, fight through 24 arena rivals (a 12-rival district ladder, then a 12-rival elite circuit), and challenge other members to duels that play out while you are away. Your first win over each rival pays POL to the wallet on your InstantAdPay account. Your first warrior mints to your wallet as an NFT on Polygon, free; after that each $5 ad package you buy on InstantAdPay earns a mint pass. Fuse three warriors of the same rarity into one rarer warrior, and trade warriors with other members on the marketplace, settled in POL. Sign in with your InstantAdPay account in one tap. Nothing here is a promise of income.' },
{ id: 'clutterhunt', title: 'ClutterHunt hidden-object game', q: ['What is ClutterHunt?', 'How do hints work in ClutterHunt?'], tags: ['games', 'clutterhunt', 'hidden object', 'hints'], { id: 'clutterhunt', title: 'ClutterHunt hidden-object game', q: ['What is ClutterHunt?', 'How do hints work in ClutterHunt?'], tags: ['games', 'clutterhunt', 'hidden object', 'hints'],
re: /(clutter ?hunt|hidden.object|haunted manor)/i, re: /(clutter ?hunt|hidden.object|haunted manor)/i,
a: 'ClutterHunt (https://clutterhunt.com, also in Members > Games) is a free hidden-object game: search cozy, cluttered rooms for 12 hidden objects plus one sponsored find. This season is the Harvest Farmhouse (Nov 1 to 30: the Farmhouse Kitchen, the Pantry, the Harvest Dining Room, the Barn Loft, the Front Porch and the Cozy Parlor); the Haunted Manor closed with Halloween, and new rooms move in every season, and objects move every time you play. You get 2 free hints a round; after that, a short visit to a member’s page earns another. Sign in with your InstantAdPay account right in the game to save your stars and earn POL: each room pays POL for your first clear and your first 3-star clear every season (Expert rooms pay more), collected in your ClutterHunt balance and sent to the wallet on your InstantAdPay account automatically.' }, a: 'ClutterHunt (https://clutterhunt.com, also in Members > Games) is a free hidden-object game: search cozy, cluttered rooms for 12 hidden objects plus one sponsored find. This season is the Haunted Manor (six rooms) through Oct 31, then new rooms move in every season, and objects move every time you play. You get 2 free hints a round; after that, a short visit to a member’s page earns another. Sign in with your InstantAdPay account right in the game to save your stars and earn POL: each room pays POL for your first clear and your first 3-star clear every season (Expert rooms pay more), collected in your ClutterHunt balance and sent to the wallet on your InstantAdPay account automatically.' },
{ id: 'spooky-doors', title: 'Spooky Doors Halloween game', q: ['What is Spooky Doors?', 'How does the candy ladder pay?', 'How do I buy a costume?'], tags: ['games', 'spooky doors', 'halloween', 'candy', 'costume'], { id: 'spooky-doors', title: 'Spooky Doors Halloween game', q: ['What is Spooky Doors?', 'How does the candy ladder pay?', 'How do I buy a costume?'], tags: ['games', 'spooky doors', 'halloween', 'candy', 'costume'],
re: /(spooky ?doors?|trick.or.treat|hallowe.?en|costume|candy ladder|\bcandy\b|\bknock)/i, re: /(spooky ?doors?|trick.or.treat|hallowe.?en|costume|candy ladder|\bcandy\b|\bknock)/i,
a: 'Spooky Doors (https://spookydoors.com) was the network’s Halloween game. The season ran Oct 4 through Halloween night and closed at midnight Central at the end of Oct 31, so the game and its Games tab card are off for now and the doors no longer pay. The Candy Crunch contest ended with the season: the top 10 candy collectors share 27 POL (10, 6, 4, then 1 each), paid from the game’s wallet after admin sign-off, and a winner without a linked wallet is paid once one is linked on InstantAdPay. Candy ladder POL you earned but had not received (0.10 POL or more) also pays out once your InstantAdPay wallet is linked. Costumes and door packs are no longer sold. Keep an eye on Members > Games for the next seasonal game: Turkey Drop opens Nov 2.' }, a: 'Spooky Doors (https://spookydoors.com) is the network\u2019s Halloween game. It opens on Oct 4 and closes at midnight Central at the end of Halloween night (Oct 31), and it shows in Members > Games only during the season; one tap signs you in with your InstantAdPay account. Walk the street, grab loose candy, hop the black cats and bats, and knock on doors. Every door is a short verified visit to a member\u2019s page or ad (a member video once you have visited them all), up to 15 doors a day, separate from your Earn visits and Drip Runner refuels. Most doors give a treat of 10 candy; about one door in five plays a trick, and beating it with quick taps adds a small bonus. Candy climbs a ladder that pays POL once per rung (100 candy 0.1 POL, 250 candy 0.25, 500 candy 0.5, 1,000 candy 1, 2,000 candy 2), from a season pool funded by a share of door ad spend and costume sales, so rungs pay only while the pool covers them. POL goes to the wallet on your InstantAdPay account once your game balance reaches 0.25 POL. The witch costume is free; the vampire (300 credits), bedsheet ghost (300) and Lucky caramel apple (500) are bought with your ad credits in the game\u2019s costume shop. Advertisers can also put a verified-visits pack behind the doors: when you create a verified-visits campaign, pick Everywhere (3 credits a visit), Behind Spooky Doors (4 credits a door) or Golden Spooky Door (6 credits a door, and the player gets a little bonus candy). Door packs show only in Spooky Doors until the season ends, then any doors left run as normal visits. Nothing here is a promise of income.' },
{ id: 'games-tab', title: 'Games tab and Drip Runner', q: ['Which games pay POL?', 'What is Drip Runner?', 'How do game refuels work?'], tags: ['games', 'drip runner', 'game refuel', 'games tab'], { id: 'games-tab', title: 'Games tab and Drip Runner', q: ['Which games pay POL?', 'What is Drip Runner?', 'How do game refuels work?'], tags: ['games', 'drip runner', 'game refuel', 'games tab'],
re: /(drip ?runner|games? (tab|page|hub)|play (a |the )?game|games? (that )?pay|(?<!(monthly|my|your|the|a) )refuels?(?!(ing)? ?(day|streak|bonus|window|kit|card|guide)))/i, // 2026-10-24: questions about the Monthly Refuel streak go to the 'refuel' entry, not here re: /(drip ?runner|games? (tab|page|hub)|play (a |the )?game|games? (that )?pay|(?<!(monthly|my|your|the|a) )refuels?(?!(ing)? ?(day|streak|bonus|window|kit|card|guide)))/i, // 2026-10-24: questions about the Monthly Refuel streak go to the 'refuel' entry, not here
a: 'Members > Games lists the network\u2019s games; one tap signs you in. Drip Runner is a runner game: tap to hop, collect gold drips, dodge the bots, clear chapters. The first clear of each chapter drips a little POL into your game balance, which is sent to your wallet once it reaches the payout line shown in the game. When a run ends you can refuel instead of restarting: a short verified visit to a member\u2019s page (or a member video when you have visited them all), up to 20 refuels a day, separate from your regular Earn visits. Refuels are paid for by advertisers, and a share of that funds the POL pool every drip is paid from, so drips depend on the pool and are small. Share your link from the game lobby: when people on your team refuel, a share of what their refuels add to the pool goes to your game balance. Nothing here is a promise of income. The Games tab also has PolHunter, Gem Kingdom (match-3, POL for first clears of stages and bosses), ClutterHunt (hidden objects), SpellWheel (word puzzle), PolyWarriors (cyberpunk fighting, open Oct 12), PolyBreak (brick breaker, opens Oct 13) and Spooky Doors during Halloween; Road Agent opens Thursday Oct 15. The public list of every game, open now and opening next, is https://instantadpay.com/games (add ?ref=yourusername to keep your referral).' }, a: 'Members > Games lists the network\u2019s games; one tap signs you in. Drip Runner is a runner game: tap to hop, collect gold drips, dodge the bots, clear chapters. The first clear of each chapter drips a little POL into your game balance, which is sent to your wallet once it reaches the payout line shown in the game. When a run ends you can refuel instead of restarting: a short verified visit to a member\u2019s page (or a member video when you have visited them all), up to 20 refuels a day, separate from your regular Earn visits. Refuels are paid for by advertisers, and a share of that funds the POL pool every drip is paid from, so drips depend on the pool and are small. Share your link from the game lobby: when people on your team refuel, a share of what their refuels add to the pool goes to your game balance. Nothing here is a promise of income. The Games tab also has PolHunter, Gem Kingdom (match-3, POL for first clears of stages and bosses), ClutterHunt (hidden objects), SpellWheel (word puzzle), PolyWarriors (cyberpunk fighting, open Oct 12), PolyBreak (brick breaker, opens Oct 13) and Spooky Doors during Halloween; Road Agent opens Thursday Oct 15. The public list of every game, open now and opening next, is https://instantadpay.com/games (add ?ref=yourusername to keep your referral).' },
{ id: 'gem-kingdom', title: 'Gem Kingdom match-3 and Crowns', q: ['What is Gem Kingdom?', 'How do I buy Crowns?', 'What do the bosses pay?'], tags: ['games', 'gem kingdom', 'crowns', 'match-3'], { id: 'gem-kingdom', title: 'Gem Kingdom match-3 and Crowns', q: ['What is Gem Kingdom?', 'How do I buy Crowns?', 'What do the bosses pay?'], tags: ['games', 'gem kingdom', 'crowns', 'match-3'],
re: /(gem ?kingdom|crowns?\b|match.?3|goblin king|ice queen|bog witch|ember dragon|stronghold)/i, re: /(gem ?kingdom|crowns?\b|match.?3|goblin king|ice queen|bog witch|ember dragon|stronghold)/i,
a: 'Gem Kingdom (https://gemkingdom.app) is a free fantasy match-3: match gems so three heroes battle monsters across six chapters (Goblin Woods, the Frozen Pass, the Haunted Swamp, Dragon\u2019s Peak, the Sunken Reef and the Shadow Citadel, where the Shadow King waits), earn stars, and rebuild your Stronghold and forge weapons. Chapters 1 and 2 are open to everyone; Chapter 3 needs a free InstantAdPay account; Chapters 4 to 6 need the Royal Charter, a one-time $5 (500 purchased credits, paid credits only), which a Kingdom Pass or an active Game Pass also covers. It pays POL for first clears only: a small taste through chapters 1 to 3 (about 1.2 POL in all), and for Charter holders the real ladder in chapters 4 to 6 (the Ember Dragon 3 POL, the Kraken 5, the Shadow King 7.5), never more in total than the player has paid in. Replays pay nothing, and once the Shadow King is beaten the game pays nothing more until new chapters are added. Rewards go into your game balance and are sent to the wallet on your InstantAdPay account on Polygon once it reaches 0.25 POL. They come from a reward pool funded by a share of Crown purchases, so they pay while the pool has funds (a clear the pool cannot cover pays nothing). Crowns, its upgrade currency, are bought with your InstantAdPay ad credits: tap Buy in the game\u2019s Crown Shop, confirm on InstantAdPay (top up with a pack if you are short), and you land back in the game with the Crowns added. Crowns buy buildings, weapons, battle boosts and a revive after a defeat. Sign in with your InstantAdPay account to save progress, earn badges and appear in the Game Achievements posts in the Crypto Team Build group. After a defeat you can also take a free revive by making a short verified visit to a member’s page. In the shop, Specials has a one-time Hero Bundle ($5: a forge weapon, a building level and 60 Crowns), the Kingdom Pass ($10 for 30 days: 10 Crowns a day, a 25-Crown chest each week and the Royal hero looks, no auto-renew) and Hero looks (Halloween looks for 40 Crowns each through Oct 31, yours to keep). Looks are cosmetic only.' }, a: 'Gem Kingdom (https://gemkingdom.app) is a free fantasy match-3: match gems so three heroes battle monsters across six chapters (Goblin Woods, the Frozen Pass, the Haunted Swamp, Dragon\u2019s Peak, the Sunken Reef and the Shadow Citadel, where the Shadow King waits), earn stars, and rebuild your Stronghold and forge weapons. It pays POL for first clears only: a little for each stage the first time you clear it, and more for each chapter boss (the Ember Dragon 5 POL, the Kraken 7.5, the Shadow King 10). Replays pay nothing. Rewards go into your game balance and are sent to the wallet on your InstantAdPay account on Polygon once it reaches 0.25 POL. They come from a reward pool funded by a share of Crown purchases, so they pay while the pool has funds (a clear the pool cannot cover pays nothing). Crowns, its upgrade currency, are bought with your InstantAdPay ad credits: tap Buy in the game\u2019s Crown Shop, confirm on InstantAdPay (top up with a pack if you are short), and you land back in the game with the Crowns added. Crowns buy buildings, weapons, battle boosts and a revive after a defeat. Sign in with your InstantAdPay account to save progress, earn badges and appear in the Game Achievements posts in the Crypto Team Build group. After a defeat you can also take a free revive by making a short verified visit to a member’s page. In the shop, Specials has a one-time Hero Bundle ($5: a forge weapon, a building level and 60 Crowns), the Kingdom Pass ($10 for 30 days: 10 Crowns a day, a 25-Crown chest each week and the Royal hero looks, no auto-renew) and Hero looks (Halloween looks for 40 Crowns each through Oct 31, yours to keep). Looks are cosmetic only.' },
{ id: 'viral-links', title: 'Viral links: ?ref= on any page', q: ['Can any page be my referral link?', 'Do blog links credit me?'], tags: ['referral', 'viral links', 'ref', 'blog'], { id: 'viral-links', title: 'Viral links: ?ref= on any page', q: ['Can any page be my referral link?', 'Do blog links credit me?'], tags: ['referral', 'viral links', 'ref', 'blog'],
re: /(viral link|any page.{0,30}(link|referr)|blog.{0,40}(referral|my link|credit)|(referral|invite|my) link.{0,30}(blog|article|any page)|\?ref=|ref=)/i, re: /(viral link|any page.{0,30}(link|referr)|blog.{0,40}(referral|my link|credit)|(referral|invite|my) link.{0,30}(blog|article|any page)|\?ref=|ref=)/i,
a: 'Any page on instantadpay.com becomes your referral link when you add ?ref= and your username to the end, for example instantadpay.com/blog/what-is-a-feeder-program?ref=yourname. Whoever opens it is tagged to you for 30 days, exactly like your invite link, so if they join from any page on the site the credit is yours. Promo tools > Viral links builds these links for you, and every blog article shows your link when you are signed in.' }, a: 'Any page on instantadpay.com becomes your referral link when you add ?ref= and your username to the end, for example instantadpay.com/blog/what-is-a-feeder-program?ref=yourname. Whoever opens it is tagged to you for 30 days, exactly like your invite link, so if they join from any page on the site the credit is yours. Promo tools > Viral links builds these links for you, and every blog article shows your link when you are signed in.' },
{ id: 'refuel', title: 'Monthly Refuel streak and Pit Stops', q: ['What is my refuel day?', 'How does the refuel streak work?', 'What is a Pit Stop?', 'How much should I spend each month?'], tags: ['refuel', 'streak', 'pit stop', 'twin engine', 'bonus credits'], { id: 'refuel', title: 'Monthly Refuel streak and Pit Stops', q: ['What is my refuel day?', 'How does the refuel streak work?', 'What is a Pit Stop?', 'How much should I spend each month?'], tags: ['refuel', 'streak', 'pit stop', 'twin engine', 'bonus credits'],
re: /(refuel(ing)? (day|streak|bonus|window)|my refuel|monthly refuel|pit ?stop|twin engine|both engines|refuel streak|streak bonus|free miss)/i, re: /(refuel(ing)? (day|streak|bonus|window)|my refuel|monthly refuel|pit ?stop|twin engine|both engines|refuel streak|streak bonus|free miss)/i,
a: 'The Monthly Refuel streak rewards members who refuel their ads every month. A counted refuel is a new package of $20 or more on InstantAdPay, or $25 or more on LinkSpin, bought by one of your own positions. Your first one sets your refuel day; the next is due 30 days later, the window opens 5 days before that day and there is a 5-day grace after it (Central time). Each refuel adds bonus ad credits on the site where you bought: month 1 +10%, month 2 +15%, month 3 +20%, month 4 and up +25%. Refuel BOTH sites in the same cycle and each gets +15%, +20%, +30% or +40% (the first site is topped up to that rate), plus a 100-credit Featured bonus on InstantAdPay from month 4 (enough for two Featured days and more). Either site alone keeps your streak going; both sites in a cycle is the bigger bonus. The bonus stacks on Five Dollar Friday and Wired Wednesday. Another $20+/$25+ package on a site you already refueled this cycle, before your next window opens, is a Pit Stop: half your current rate, once per site per cycle, and it does not count as the refuel. Miss the grace and the streak starts again, except for one free miss a year. Badges at your first refuel and at 3, 6 and 12 months. Each counted refuel also unlocks the Refuel Kit for that month: members-only banners (728x90, 300x250, 468x60, 160x600 and 1200x630) with your @name and a QR code to your own link drawn on them, in Promo tools; they stay yours after the month, a 3-month streak adds an animated version and 6 months a custom-banners credit. Your first counted refuel also opens the Engine Room tab in your member area: three plain dials (fuel left on both sites against this cycle’s refuel with days left at your burn, clicks this week with clicks per 1,000 credits, goals this month against a goal you set), warning lights, six part lights with setup links and one next move. Your refuel day, streak, next bonus and Pit Stop status are on the Refuel card on your Overview (with a Refuel LinkSpin link once this site is done for the cycle). Buy here: https://instantadpay.com/my#buy. The full guide, with the flow step by step: https://instantadpay.com/refuel. Bonus credits are ad credits that buy delivery, never cash, and no income is guaranteed. A counted refuel of $50 or more (either site) also earns you one free Downline Banners spot (downlinebanners.com, the network banner board), paid by the company and placed for your main wallet, so link a wallet to receive it.' }, a: 'The Monthly Refuel streak rewards members who refuel their ads every month. A counted refuel is a new package of $20 or more on InstantAdPay, or $25 or more on LinkSpin, bought by one of your own positions. Your first one sets your refuel day; the next is due 30 days later, the window opens 5 days before that day and there is a 5-day grace after it (Central time). Each refuel adds bonus ad credits on the site where you bought: month 1 +10%, month 2 +15%, month 3 +20%, month 4 and up +25%. Refuel BOTH sites in the same cycle and each gets +15%, +20%, +30% or +40% (the first site is topped up to that rate), plus a 100-credit Featured bonus on InstantAdPay from month 4 (enough for two Featured days and more). Either site alone keeps your streak going; both sites in a cycle is the bigger bonus. The bonus stacks on Five Dollar Friday and Wired Wednesday. Another $20+/$25+ package on a site you already refueled this cycle, before your next window opens, is a Pit Stop: half your current rate, once per site per cycle, and it does not count as the refuel. Miss the grace and the streak starts again, except for one free miss a year. Badges at your first refuel and at 3, 6 and 12 months. Each counted refuel also unlocks the Refuel Kit for that month: members-only banners (728x90, 300x250, 468x60, 160x600 and 1200x630) with your @name and a QR code to your own link drawn on them, in Promo tools; they stay yours after the month, a 3-month streak adds an animated version and 6 months a custom-banners credit. Your first counted refuel also opens the Engine Room tab in your member area: three plain dials (fuel left on both sites against this cycle’s refuel with days left at your burn, clicks this week with clicks per 1,000 credits, goals this month against a goal you set), warning lights, six part lights with setup links and one next move. Your refuel day, streak, next bonus and Pit Stop status are on the Refuel card on your Overview (with a Refuel LinkSpin link once this site is done for the cycle). Buy here: https://instantadpay.com/my#buy. The full guide, with the flow step by step: https://instantadpay.com/refuel. Bonus credits are ad credits that buy delivery, never cash, and no income is guaranteed.' },
{ id: 'downline-banners', title: 'Downline Banners (network banner board)', q: ['What is Downline Banners?', 'How do I use my LinkSpin Banner Spin on Downline Banners?', 'How do I sign in to Downline Banners?'], tags: ['downline banners', 'banner board', 'spot', 'banner spin'],
re: /(downline ?banners|banner (board|spot)|banner line)/i,
a: 'Downline Banners (https://downlinebanners.com) is the Crypto Team Build Network banner board on Polygon. A $5 spot (paid in POL) buys 300 guaranteed views on the board and a place in one global line; when later spots sell, the contract pays the 10 spots above them and the buyer\u2019s sponsor in the same transaction. Nothing is promised: you are paid only when spots sell after yours. Signed in on InstantAdPay? Open its My Spots page and you arrive signed in as your linked wallet, and your share link uses your InstantAdPay username. In My Spots, the "Use a LinkSpin Banner Spin" button puts one of your 468x60 Banner Spins on a spot in two taps, with click tracking under a Downline Banners source on LinkSpin. A $50+ Monthly Refuel earns one free spot. To promote it: Promo tools > Network sites > Downline Banners (or downlinebanners.com/promote) has your links, creatives in every common size, lines, headlines, an email and posts, all carrying your username.' },
{ id: 'viral-banner-blitz', title: 'Viral Banner Blitz (network banner loop)', q: ['What is Viral Banner Blitz?', 'How do I post on Viral Banner Blitz?'], tags: ['viral banner blitz', 'vbb', 'banner loop', '125x125'],
re: /(viral ?banner ?blitz|vbb|banner loop)/i,
a: 'Viral Banner Blitz (https://viralbannerblitz.com) is the network’s shared loop of 125x125 banners. InstantAdPay and LinkSpin members get one free post credit each day they sign in there (Sign in with InstantAdPay works). Real, verified visitors move the loop; a banner that rides out the end has cycled and earns network ad views, which are advertising, not cash. Weekly leaderboards count the visitors you send and the traffic sources they come from, with a prize pot paid in POL to the top three on each board. Your link is viralbannerblitz.com/?ref=your-username. Promo tools > Network sites > Viral Banner Blitz (or viralbannerblitz.com/promote) has your links, creatives, lines, headlines, an email and posts.' },
{ id: 'network-sites-kits', title: 'Promo tools: Network sites', q: ['Where are the Downline Banners and Viral Banner Blitz banners?', 'How do I promote the other network sites?'], tags: ['network sites', 'promo kit', 'promote', 'creatives'],
re: /(network sites|promo kit|promote (downline|viral|the other|network))/i,
a: 'Members > Promo tools > Network sites shows the promo kits of Downline Banners and Viral Banner Blitz with your InstantAdPay username already in every link: your personal links, creatives in 125x125, 468x60, 728x90, 300x250, 160x600, 1200x630 and 1080x1080 (download, copy the URL or copy ready HTML that links to you), 5 short lines, 3 headlines, an email and 2 social posts. Your username works as your sponsor link on those sites even if you never visited them. Each site keeps its own kit, so the copy here is always the current one; the same kit is on each site’s Promote page. Each link also has a tracked version that goes through LinkSpin first (so the network can see which site sent the visit) and then opens the same page with your username; use either one. Video App Income (short promo videos made from a topic) was added to this tab on 2026-11-23, with banners in web and social sizes, lines, headlines, an email and posts.' },
{ id: 'wired-wednesday', title: 'Wired Wednesday bonus', q: ['What is Wired Wednesday?', 'What happens on Wednesday?'], tags: ['wired wednesday', 'bonus credits', 'promotion'], { id: 'wired-wednesday', title: 'Wired Wednesday bonus', q: ['What is Wired Wednesday?', 'What happens on Wednesday?'], tags: ['wired wednesday', 'bonus credits', 'promotion'],
re: /(wired wednesday|wednesday (bonus|promo|deal|special)|what happens on wednesday)/i, re: /(wired wednesday|wednesday (bonus|promo|deal|special)|what happens on wednesday)/i,
a: 'Wired Wednesday: every Wednesday (Central time, midnight to midnight), any ad package from $20 up (the Activation pack and above; there is no $10 pack) earns +25% bonus credits, wired into your balance the moment the purchase settles. They are purchased-grade, so they run on any format, login ads included, and the bonus is labelled in your credit log. The page instantadpay.com/wednesday shows whether it is live now and the next date; add ?ref=yourusername to that address and anyone who joins from it is your referral. Every pack still pays its sponsor line in the same on-chain transaction. Credits buy ad delivery and cannot be withdrawn; no income is guaranteed.' }, a: 'Wired Wednesday: every Wednesday (Central time, midnight to midnight), any ad package from $20 up (the Activation pack and above; there is no $10 pack) earns +25% bonus credits, wired into your balance the moment the purchase settles. They are purchased-grade, so they run on any format, login ads included, and the bonus is labelled in your credit log. The page instantadpay.com/wednesday shows whether it is live now and the next date; add ?ref=yourusername to that address and anyone who joins from it is your referral. Every pack still pays its sponsor line in the same on-chain transaction. Credits buy ad delivery and cannot be withdrawn; no income is guaranteed.' },
@@ -162,10 +97,6 @@ const CANNED = [
re: /(five dollar friday|5 dollar friday|\$5 friday|friday (bonus|promo|deal|special)|what happens on friday)/i, re: /(five dollar friday|5 dollar friday|\$5 friday|friday (bonus|promo|deal|special)|what happens on friday)/i,
a: 'Five Dollar Friday: every Friday (Central time), any ad package from $5 up earns +20% bonus credits, added the moment the purchase settles and labelled in your credit log. The page instantadpay.com/friday shows whether it is live right now and the next date; add ?ref=yourusername to that address and anyone who joins from it is your referral. Every pack pays its sponsor line in the same on-chain transaction, so when the whole network buys on the same day every line gets paid at once. Since 2026-10-23 a $5+ Friday package also gives you a free 7-day Game Pass (once per Friday, all the games); if that package is the one starting a pass you already ordered, it does not add a second week. Five Fridays in a row earn the Five Fridays badge. Buy under My account > Buy packages.' }, a: 'Five Dollar Friday: every Friday (Central time), any ad package from $5 up earns +20% bonus credits, added the moment the purchase settles and labelled in your credit log. The page instantadpay.com/friday shows whether it is live right now and the next date; add ?ref=yourusername to that address and anyone who joins from it is your referral. Every pack pays its sponsor line in the same on-chain transaction, so when the whole network buys on the same day every line gets paid at once. Since 2026-10-23 a $5+ Friday package also gives you a free 7-day Game Pass (once per Friday, all the games); if that package is the one starting a pass you already ordered, it does not add a second week. Five Fridays in a row earn the Five Fridays badge. Buy under My account > Buy packages.' },
// 2026-10-23 conversion pixel (LinkSpin counts, IAP shows): Campaigns > Conversion tracking // 2026-10-23 conversion pixel (LinkSpin counts, IAP shows): Campaigns > Conversion tracking
// 2026-11-07 conversion linkage (reporting only)
{ id: 'network-conversions', title: 'Sign-ups and purchases on your click', q: ['I sent someone and they joined, why do I not see a conversion?', 'Do sign-ups on InstantAdPay show in my LinkSpin reports?', 'Does the landing tag track InstantAdPay purchases?'], tags: ['conversion tracking', 'lsclk', 'landing tag', 'reports', 'join', 'purchase'],
re: /((sign.?ups?|joins?|purchases?|sales?|conversions?).{0,40}(show|count|track|see|report).{0,30}(linkspin|reports?|landing tag|bridge|on my click)|(bridge|landing) page.{0,40}(click id|lsclk|track|count)|landing tag.{0,40}(instantadpay|purchases?|sign.?ups?|joins?))/i,
a: 'People you send to InstantAdPay or LinkSpin count with no goal and no pixel, as long as the click reaches the join page. With the LinkSpin landing tag on your page, your links to either site carry the click id, also inside a redirect link of your own. A spin link or Banner Spin pointed straight at either site carries it too. We keep the click 30 days and store it on the account at sign-up, then their sign-up, wallet link and each package they buy within 30 days of the click count on your click: a sign-up and a wallet once per click, each package on its own with its USD price. See them on Campaigns > Conversion tracking and in LinkSpin under Reports, Conversions, next to your goals. Your own account is never counted, a button that only runs a script cannot carry the click, and people who joined before 2026-11-07 cannot be matched afterwards. This is reporting only: it never changes who a sponsor is or what anyone is paid.' },
{ id: 'conversion-tracking', title: 'Conversion tracking (goal pixel)', q: ['How do I track conversions?', 'Can I see which ad brought a sign-up or sale?', 'Where do I put the goal pixel?', 'What is the landing tag?', 'How do I set up conversion tracking on WordPress?'], tags: ['conversion tracking', 'goal pixel', 'landing tag', 'cost per goal', 'aweber', 'getresponse', 'wordpress', 'setup guide'], { id: 'conversion-tracking', title: 'Conversion tracking (goal pixel)', q: ['How do I track conversions?', 'Can I see which ad brought a sign-up or sale?', 'Where do I put the goal pixel?', 'What is the landing tag?', 'How do I set up conversion tracking on WordPress?'], tags: ['conversion tracking', 'goal pixel', 'landing tag', 'cost per goal', 'aweber', 'getresponse', 'wordpress', 'setup guide'],
re: /(conver(sion|t)s?.{0,20}(track|pixel|goal)|track(ing)?.{0,30}(conversions?|sign.?ups?|sales|subscribers|leads)|goal pixel|landing tag|tracking pixel|cost per (goal|lead|sale|sign.?up|conversion)|thank.?you page|lsclk)/i, re: /(conver(sion|t)s?.{0,20}(track|pixel|goal)|track(ing)?.{0,30}(conversions?|sign.?ups?|sales|subscribers|leads)|goal pixel|landing tag|tracking pixel|cost per (goal|lead|sale|sign.?up|conversion)|thank.?you page|lsclk)/i,
a: 'Conversion tracking shows which of your ads bring subscribers and sales, not just clicks. It lives in your dashboard under Campaigns > Conversion tracking (https://instantadpay.com/my#campaigns). Three steps: 1) add a goal, like subscriber or sale (a default value is optional); 2) put the landing tag on the page your ad points to; 3) put the goal pixel on your thank-you page. Every click on your ad carries a click id (lsclk=...), and LinkSpin, our sister site, matches each goal to the click: first by the click id still in the address, then the id the landing tag stored, then LinkSpin\'s cookie, and last a 24-hour match on the same connection and browser (the panel says how sure each kind is). Each goal counts once per click, only within 30 days of a real click on your ad, and each campaign shows its goals and its cost per goal (30 days) in credits: the credits that campaign spent in the same 30 days, divided by its goals. Using Aweber or GetResponse? Set the form\'s thank-you (success) page to a page on YOUR site that carries the goal pixel (Aweber: Thank You Page: custom page; GetResponse: Thank-you page: custom URL). If you cannot change it, the pixel can still count through the cookie or the 24-hour match, just less surely. The Send a test conversion button fires your real pixel in test mode (Last test updates); to check your real thank-you page, add &test=1 to its pixel and open it once. Tests and your own clicks (on your ads, and on your LinkSpin spin links and Banner Spins) never count in your numbers; the card says how many of your own clicks were kept as tests. The step-by-step guide, with copy-paste examples for plain HTML, WordPress, page builders and autoresponder thank-you pages, how to read the report and a troubleshooting checklist: https://instantadpay.com/conversion-tracking' }, a: 'Conversion tracking shows which of your ads bring subscribers and sales, not just clicks. It lives in your dashboard under Campaigns > Conversion tracking (https://instantadpay.com/my#campaigns). Three steps: 1) add a goal, like subscriber or sale (a default value is optional); 2) put the landing tag on the page your ad points to; 3) put the goal pixel on your thank-you page. Every click on your ad carries a click id (lsclk=...), and LinkSpin, our sister site, matches each goal to the click: first by the click id still in the address, then the id the landing tag stored, then LinkSpin\'s cookie, and last a 24-hour match on the same connection and browser (the panel says how sure each kind is). Each goal counts once per click, only within 30 days of a real click on your ad, and each campaign shows its goals and its cost per goal (30 days) in credits: the credits that campaign spent in the same 30 days, divided by its goals. Using Aweber or GetResponse? Set the form\'s thank-you (success) page to a page on YOUR site that carries the goal pixel (Aweber: Thank You Page: custom page; GetResponse: Thank-you page: custom URL). If you cannot change it, the pixel can still count through the cookie or the 24-hour match, just less surely. The Send a test conversion button fires your real pixel in test mode (Last test updates); to check your real thank-you page, add &test=1 to its pixel and open it once. Tests and your own clicks (on your ads, and on your LinkSpin spin links and Banner Spins) never count in your numbers; the card says how many of your own clicks were kept as tests. The step-by-step guide, with copy-paste examples for plain HTML, WordPress, page builders and autoresponder thank-you pages, how to read the report and a troubleshooting checklist: https://instantadpay.com/conversion-tracking' },
@@ -175,9 +106,9 @@ const CANNED = [
a: 'A login ad is your page shown full screen to members right after they sign in, on the dashboard and in the connected games. A slot is a flat buy: 1,000 purchased credits for 30 days of unlimited sign-in impressions, paid once up front and never charged per day. Earned credits cannot pay for it. Up to 6 member slots run at once, because they all share the same sign-ins. When all 6 are taken you can reserve the next slot in Members > Campaigns: you pay the same price now, and your place in line is first paid, first served. Your 30 days only start when your turn comes, and the form shows your place and an estimated start date in Central time. That date is an estimate, because a slot can end early if its owner archives it. When your ad starts you get a notice on site and an email. Until it starts you can edit the link, image or headline for free, or cancel it and get every credit back. Once it has started, normal slot rules apply. A freed slot always goes to the line first, so a paused slot can only be resumed when a slot is open with nobody waiting.' }, a: 'A login ad is your page shown full screen to members right after they sign in, on the dashboard and in the connected games. A slot is a flat buy: 1,000 purchased credits for 30 days of unlimited sign-in impressions, paid once up front and never charged per day. Earned credits cannot pay for it. Up to 6 member slots run at once, because they all share the same sign-ins. When all 6 are taken you can reserve the next slot in Members > Campaigns: you pay the same price now, and your place in line is first paid, first served. Your 30 days only start when your turn comes, and the form shows your place and an estimated start date in Central time. That date is an estimate, because a slot can end early if its owner archives it. When your ad starts you get a notice on site and an email. Until it starts you can edit the link, image or headline for free, or cancel it and get every credit back. Once it has started, normal slot rules apply. A freed slot always goes to the line first, so a paused slot can only be resumed when a slot is open with nobody waiting.' },
// 2026-09-18: sessions were shortened to 4h on purpose. Members WILL ask why they keep being // 2026-09-18: sessions were shortened to 4h on purpose. Members WILL ask why they keep being
// signed out, and the honest answer reads far better than letting it look like a fault. // signed out, and the honest answer reads far better than letting it look like a fault.
{ id: 'session-4h', title: 'How long does a sign-in last?', q: ['Why do I keep getting logged out?', 'Why do I have to sign in again?', 'My session expired'], tags: ['session', 'sign in', 'logged out', 'login'], { id: 'session-4h', title: 'Why am I signed out after 4 hours?', q: ['Why do I keep getting logged out?', 'Why do I have to sign in again?', 'My session expired'], tags: ['session', 'sign in', 'logged out', 'login'],
re: /(logged out|log(ged)? me out|signed (me |us )?out|keep.{0,20}(logging|signing) in|session (expired|timed? out)|why.{0,25}(log ?in|sign ?in) again|have to log ?in again|stay logged in)/i, re: /(logged out|log(ged)? me out|signed (me |us )?out|keep.{0,20}(logging|signing) in|session (expired|timed? out)|why.{0,25}(log ?in|sign ?in) again|have to log ?in again|stay logged in)/i,
a: 'A sign-in lasts 7 days and renews while you use the site, and signing in on any network site signs you in on the others. If you are signed out, sign in again with a fresh code or open the site from another network site you are signed in on - nothing about your account, your credits or your line is affected. The login sponsor ad shows again every few hours whether or not you signed in; that is part of what keeps the free side of the platform paid for. Signing out on a site signs you out of that site only; Sign out everywhere ends it on every network site.' }, a: 'That is deliberate, not a fault. To keep resources optimised we do not keep anyone signed in longer than 4 hours. After that your session ends and you sign in again with a fresh code - nothing about your account, your credits or your line is affected. You will see the login sponsor ad on the way back in, and that is part of what keeps the free side of the platform paid for.' },
{ id: 'one-account', title: 'One account per person', q: ['Can I open a second account?', 'Can my wife have an account?', 'Can I refer myself?'], tags: ['account', 'second account', 'duplicate', 'terms', 'qualified start'], { id: 'one-account', title: 'One account per person', q: ['Can I open a second account?', 'Can my wife have an account?', 'Can I refer myself?'], tags: ['account', 'second account', 'duplicate', 'terms', 'qualified start'],
re: /(second account|another account|two accounts|multiple accounts|more than one account|duplicate account|new account with|refer myself|self.?refer|sign up (my )?(wife|husband|partner|spouse|kids?|family))/i, re: /(second account|another account|two accounts|multiple accounts|more than one account|duplicate account|new account with|refer myself|self.?refer|sign up (my )?(wife|husband|partner|spouse|kids?|family))/i,
a: 'One account per person, and that is in the Terms (https://instantadpay.com/terms). A second account under another email, name or wallet is not allowed, and neither is referring yourself through one. The one sanctioned way to hold more than one position is Qualified Start: extra wallets linked inside your single account, on the Buy packages tab, where they are visible as yours. A family member who genuinely wants to join can join under your link with their own email. Duplicate accounts can be merged or closed and any credits or prizes earned through them are forfeited; payments the contract already made cannot be reversed.' }, a: 'One account per person, and that is in the Terms (https://instantadpay.com/terms). A second account under another email, name or wallet is not allowed, and neither is referring yourself through one. The one sanctioned way to hold more than one position is Qualified Start: extra wallets linked inside your single account, on the Buy packages tab, where they are visible as yours. A family member who genuinely wants to join can join under your link with their own email. Duplicate accounts can be merged or closed and any credits or prizes earned through them are forfeited; payments the contract already made cannot be reversed.' },
@@ -192,9 +123,9 @@ const CANNED = [
{ id: 'split', title: 'How much do I earn: the split', q: ['How much do I earn?', 'What commission do I get?', 'What is the split on a package?'], tags: ['earn', 'commission', 'split', 'percent', 'levels'], { id: 'split', title: 'How much do I earn: the split', q: ['How much do I earn?', 'What commission do I get?', 'What is the split on a package?'], tags: ['earn', 'commission', 'split', 'percent', 'levels'],
re: /(how (much|do i) earn|how much (do|can|will|would|could|might) (i|we|you|they) (earn|make|get)|what (do|would|will) i (earn|make|get paid)|commission|percent|split)/i, re: /(how (much|do i) earn|how much (do|can|will|would|could|might) (i|we|you|they) (earn|make|get)|what (do|would|will) i (earn|make|get paid)|commission|percent|split)/i,
a: 'Every package splits the same way: 50 percent to the direct sponsor, 20 percent to level 2, 10 percent to level 3, 20 percent to the platform. Those numbers are constants in the contract and cannot be changed. The package ladder is on the home page. No income is promised; nobody earns unless real ad buying happens.' }, a: 'Every package splits the same way: 50 percent to the direct sponsor, 20 percent to level 2, 10 percent to level 3, 20 percent to the platform. Those numbers are constants in the contract and cannot be changed. The package ladder is on the home page. No income is promised; nobody earns unless real ad buying happens.' },
{ id: 'network-rate', title: 'Network views and partner visits cost less than views here', q: ['Do network views use my credits?', 'How much do Network Ad Space views cost?', 'Why are network views cheaper?'], tags: ['network views', 'network ad space', 'syndication', 'passivedrip', 'partner visits', 'credits', 'rate'], { id: 'network-rate', title: 'Network views and partner visits cost a quarter of the rate', q: ['Do network views use my credits?', 'How much do Network Ad Space views cost?', 'Why are network views cheaper?'], tags: ['network views', 'network ad space', 'syndication', 'passivedrip', 'partner visits', 'credits', 'rate'],
re: /((network (views?|ad space)|syndicat\w*|partner (sites?|visits?)).{0,60}(credits?|charge[ds]?|cost|spend|balance|budget|free|pay|rate|cheap)|(credits?|charge[ds]?|cost|spend|balance|budget|pay|rate).{0,60}(network (views?|ad space)|syndicat\w*|partner (sites?|visits?)))/i, re: /((network (views?|ad space)|syndicat\w*|partner (sites?|visits?)).{0,60}(credits?|charge[ds]?|cost|spend|balance|budget|free|pay|rate|cheap)|(credits?|charge[ds]?|cost|spend|balance|budget|pay|rate).{0,60}(network (views?|ad space)|syndicat\w*|partner (sites?|visits?)))/i,
a: 'Views and visits here on InstantAdPay use credits at the normal rate. Your banner and text ads also run on Network Ad Space, and visit packs also get visits from partner sites like PassiveDrip. That delivery costs less: for a banner, 4 network views cost what 1 view here does, and 4 partner visits use up 1 visit of your pack. Text ads are one price everywhere since November 20: 1 credit buys 100 text ad views, here or on the network (text ads get clicked about as often in both places, so a click costs about the same wherever it comes from). So your budget goes further, and every credit still buys real delivery. You see network views and partner visits in Members > Campaigns, and network charges show as "Network views (1/4 rate)" lines for banners and "Network views" lines for text ads in Credit activity (older text lines say "Network views (1/10 rate)").' }, a: 'Views and visits here on InstantAdPay use credits at the normal rate. Your banner and text ads also run on Network Ad Space, and visit packs also get visits from partner sites like PassiveDrip. That delivery costs a quarter of the rate: 4 network views cost what 1 view here does, and 4 partner visits use up 1 visit of your pack. So your budget goes further, and every credit still buys real delivery. You see network views and partner visits in Members > Campaigns, and network charges show as "Network views (1/4 rate)" lines in Credit activity.' },
{ id: 'balance-rule', title: 'Why my balance went down', q: ['Why did my balance go down?', 'Where did my credits go?', 'What does In live campaigns mean?'], tags: ['balance', 'credits', 'campaigns', 'credit activity'], { id: 'balance-rule', title: 'Why my balance went down', q: ['Why did my balance go down?', 'Where did my credits go?', 'What does In live campaigns mean?'], tags: ['balance', 'credits', 'campaigns', 'credit activity'],
re: /(balance (went|going|keeps going) down|credits? (disappear|missing|gone|dropping|went down|ticking)|why (is|did) my (balance|credits)|in campaigns|set aside|reserved credits|available to spend)/i, re: /(balance (went|going|keeps going) down|credits? (disappear|missing|gone|dropping|went down|ticking)|why (is|did) my (balance|credits)|in campaigns|set aside|reserved credits|available to spend)/i,
a: 'One rule: your balance is what is NOT committed to a live campaign. When you start a campaign its whole budget is set aside right then (earned credits first, then purchased), so your Available number drops once and then sits still while the ad runs. The budget spends down inside that campaign in Members > Campaigns, where you can see delivered views, network views and what is left. The dashboard shows Purchased available, Earned available and In live campaigns as three separate numbers; a paused campaign keeps its unspent budget set aside so it can resume. Nothing is lost when a balance reads low while a campaign is live. Purchased credits live on the blockchain; if we ever refund or credit purchased money it shows under Purchased as "credited to you" and spends like a purchase, login ads included. Earned credits fund every format except login ads. Two formats are flat buys paid in full when booked: featured links (sold by the day) and verified-visit packs. Adding credits to a featured link does nothing, so its row offers Extend run instead, which books more days at the daily rate; a visit pack offers Buy more visits. Every credit that comes in or goes out is listed with its reason under Members > Campaigns > Credit activity (also linked from Earn credits): sign-in bonus, daily claim, video watched, verified visit, campaign buys, views delivered per day, grants and refunds. Check it before assuming credits went missing.' }, a: 'One rule: your balance is what is NOT committed to a live campaign. When you start a campaign its whole budget is set aside right then (earned credits first, then purchased), so your Available number drops once and then sits still while the ad runs. The budget spends down inside that campaign in Members > Campaigns, where you can see delivered views, network views and what is left. The dashboard shows Purchased available, Earned available and In live campaigns as three separate numbers; a paused campaign keeps its unspent budget set aside so it can resume. Nothing is lost when a balance reads low while a campaign is live. Purchased credits live on the blockchain; if we ever refund or credit purchased money it shows under Purchased as "credited to you" and spends like a purchase, login ads included. Earned credits fund every format except login ads. Two formats are flat buys paid in full when booked: featured links (sold by the day) and verified-visit packs. Adding credits to a featured link does nothing, so its row offers Extend run instead, which books more days at the daily rate; a visit pack offers Buy more visits. Every credit that comes in or goes out is listed with its reason under Members > Campaigns > Credit activity (also linked from Earn credits): sign-in bonus, daily claim, video watched, verified visit, campaign buys, views delivered per day, grants and refunds. Check it before assuming credits went missing.' },
@@ -214,30 +145,15 @@ const CANNED = [
{ id: 'pif', title: 'Pay it forward (PIF)', q: ['How do I PIF someone?', 'Can I buy a package for my referral?', 'Should I fund someone from the tank?'], tags: ['pif', 'pay it forward', 'gift', 'holding tank'], { id: 'pif', title: 'Pay it forward (PIF)', q: ['How do I PIF someone?', 'Can I buy a package for my referral?', 'Should I fund someone from the tank?'], tags: ['pif', 'pay it forward', 'gift', 'holding tank'],
re: /\b(pif|p\.i\.f|pay(ing)? it forward|paid it forward|gift (them|him|her|someone|a member)|send (them|him|her) (some )?pol)\b|\b(fund(ing)?|pay(ing)? for|cover(ing)?|buy(ing)?|purchas(e|ing)|front(ing)?|spot)\b[^.?!]{0,50}\b(for (them|him|her|someone|a member|a new member|my (referral|downline|member))|(their|his|her|someone'?s|a member'?s) (first )?(package|starter|activation|\$?20))\b|\b(front|spot|lend|loan|advance|stake|grubstake)\b[^.?!]{0,30}\b(them|him|her|someone|a member|a new member|my (referral|downline|member))\b/i, re: /\b(pif|p\.i\.f|pay(ing)? it forward|paid it forward|gift (them|him|her|someone|a member)|send (them|him|her) (some )?pol)\b|\b(fund(ing)?|pay(ing)? for|cover(ing)?|buy(ing)?|purchas(e|ing)|front(ing)?|spot)\b[^.?!]{0,50}\b(for (them|him|her|someone|a member|a new member|my (referral|downline|member))|(their|his|her|someone'?s|a member'?s) (first )?(package|starter|activation|\$?20))\b|\b(front|spot|lend|loan|advance|stake|grubstake)\b[^.?!]{0,30}\b(them|him|her|someone|a member|a new member|my (referral|downline|member))\b/i,
a: 'PIF is a gift you send from your own wallet, and the site never touches the money. That is different from other platforms, where the site takes money out of your account balance and buys the position for the other person: InstantAdPay has no balances, so the POL goes straight from your wallet to theirs, and they buy their package themselves, from their own wallet. It only appears on your own free referrals and on members you have adopted, and only once they have linked a wallet, so you cannot PIF somebody who is still sitting in the holding tank. The order is: adopt them from Members > My line > Holding tank, get them to link a wallet on their Wallet tab, then the PIF button shows up, you enter an amount and your own wallet app opens with their address already filled in. Now the part that matters most: do not send anything until you have actually talked to that person and they have told you they will use it. Once that POL leaves your wallet it is gone, there is no refund, no chargeback and nothing we can do to pull it back, because the money goes straight from your wallet to theirs and never touches us. The gift is theirs to keep whatever they do with it, so they can go quiet, spend it on something else, or never sign in again, and none of that is against any rule. Someone in the holding tank joined with nobody working with them and may never have engaged at all, which makes an unanswered PIF the easiest money on this site to lose. Get a reply, get a clear commitment that they are going to buy and build, see that they have linked a wallet and are actually active, and only then decide. If they do buy a $20 package the contract pays you 50 percent as their sponsor and they become one of your qualifying buyers, so a gift that works costs you about half; a gift to somebody who never answers costs you all of it. Never gift money you need, never borrow to do it, and treat every PIF as money you are content to lose.' }, a: 'PIF is a gift you send from your own wallet, and the site never touches the money. That is different from other platforms, where the site takes money out of your account balance and buys the position for the other person: InstantAdPay has no balances, so the POL goes straight from your wallet to theirs, and they buy their package themselves, from their own wallet. It only appears on your own free referrals and on members you have adopted, and only once they have linked a wallet, so you cannot PIF somebody who is still sitting in the holding tank. The order is: adopt them from Members > My line > Holding tank, get them to link a wallet on their Wallet tab, then the PIF button shows up, you enter an amount and your own wallet app opens with their address already filled in. Now the part that matters most: do not send anything until you have actually talked to that person and they have told you they will use it. Once that POL leaves your wallet it is gone, there is no refund, no chargeback and nothing we can do to pull it back, because the money goes straight from your wallet to theirs and never touches us. The gift is theirs to keep whatever they do with it, so they can go quiet, spend it on something else, or never sign in again, and none of that is against any rule. Someone in the holding tank joined with nobody working with them and may never have engaged at all, which makes an unanswered PIF the easiest money on this site to lose. Get a reply, get a clear commitment that they are going to buy and build, see that they have linked a wallet and are actually active, and only then decide. If they do buy a $20 package the contract pays you 50 percent as their sponsor and they become one of your qualifying buyers, so a gift that works costs you about half; a gift to somebody who never answers costs you all of it. Never gift money you need, never borrow to do it, and treat every PIF as money you are content to lose.' },
{ id: 'socialtube-earn', title: 'Earning credits by watching on Social Tube', q: ['Can I earn credits on Social Tube?', 'What is Earn by watching on Social Tube?', 'Do Social Tube watches count toward my daily limit?'], tags: ['social tube', 'earn by watching', 'socialtube'],
re: /(social ?tube.{0,60}\b(earn|credit|watch|paid|limit|cap)|\b(earn|credit|paid)\w*.{0,40}social ?tube)/i,
a: 'Yes. Social Tube (socialtube.club) is a video site in the same network. Its Earn page plays the same watch-to-earn video ads you see here in Shorts and Watch videos. Sign in there with your network account, watch a video for its full time, and the credits land in your InstantAdPay balance at the same rate as watching here. InstantAdPay does the timing and the crediting, so the rules are identical: one daily limit shared between the two sites, each video pays once a day, and you are never shown your own video. Your credit activity shows those lines as Watched a video on Social Tube.' },
{ id: 'vai-video-ad', title: 'Video App Income: the Run this on InstantAdPay button', q: ['What is the Run this on InstantAdPay button?', 'How do I advertise something I made on Video App Income here?', 'Can a Social Tube page be advertised on InstantAdPay?'], tags: ['video app income', 'social tube', 'run this on instantadpay'],
re: /(run (this|it|my video) on instantadpay|(video app income|videoappincome|social ?tube) video.{0,40}\b(ad|advertis|campaign|promot)|\b(ad|advertis|campaign|promot)\w*.{0,40}(video app income|videoappincome|social ?tube) video)/i,
a: 'Yes. On Video App Income, open the Share tab, find the video and tap Run this on InstantAdPay. It opens Campaigns here with a Video ad (watch to earn) already filled in: your video, its title, and your Social Tube page as the place the button leads. Nothing is bought for you. You choose the watch length and the budget and press the button yourself, and it is paid with your InstantAdPay ad credits like any other campaign. Members here are paid credits to watch it for the full time, and a tall phone-shaped video plays in Shorts. Two things to know: if you remake or delete that video on Video App Income its file changes, so pause the campaign and start a new one from the new video; and paid views are views, not sales, so nothing about results is promised.' },
{ id: 'sponsor-video-invite', title: 'An email saying my sponsor made me a video', q: ['I got an email that my sponsor made me a video, is it real?', 'What is Video App Income?', 'How do I stop invite emails from my sponsor?'], tags: ['video app income', 'sponsor invite', 'invite email', 'made you a video'],
re: /(made (me|you) a video|video app income|videoappincome|invite(d)? (email|from my sponsor)|email from my sponsor)/i,
a: 'That email is real if it names your sponsor. Video App Income is another site in the network that makes short promo videos from a phone. A sponsor there can send each of their own direct referrals one invite, once, and it is delivered by InstantAdPay so it comes from an address you already know. It shows a video your sponsor made, or a short one that shows how the app works, and says plainly that they earn a share if you buy credits there. Your first video there is free, nothing is promised, and you do not have to join. Your email address was not given to your sponsor or to Video App Income: InstantAdPay sent the note on their behalf. Each person gets this invite one time only. To stop all InstantAdPay emails except sign-in codes and receipts, use the Stop these emails link at the bottom of the message. Separately: if you asked Video App Income to confirm your email, the 6-digit code arrives in an email that says it was sent by InstantAdPay, because InstantAdPay is the mail service for the network. That is expected. Type the code into Video App Income within 15 minutes; if you did not ask for it, ignore it.' },
{ id: 'who-invited', title: 'Who invited you? (naming your sponsor)', q: ['How do I add the person who invited me?', 'I joined without a link, can I name my sponsor?', 'What is the Who invited you card?'], tags: ['who invited you', 'invited', 'holding tank', 'no sponsor', 'sponsor link'],
re: /(who invited|invited (me|by)|joined without a (link|sponsor)|forgot (the|my|to use).{0,12}(link|sponsor)|(add|name|set|enter|pick|choose) (my |a )?sponsor|nobody invited)/i,
a: 'If you joined without a sponsor link, your Overview shows a Who invited you? card. Type the username of the person who invited you, confirm it, and they become your sponsor, here and on LinkSpin, and they get a notice. Do it before you switch on payouts or buy, because your sponsor locks on the contract at that point. It has to be a real member: not you, not someone in your own line, and not someone who has not switched on payouts with nobody above them who has (ask them to switch on first). Once you have a sponsor or a member number the card goes away. Nobody invited you? Tap Nobody invited me and stay in the holding tank; a small link on the Overview brings the card back while you are still there. Nothing on the site waits for your answer. New sign-ups cannot be adopted by hand for their first 24 hours, so you have a day to tell us before a member can pick you up.' },
{ id: 'tank-hold', title: 'Matched with a sponsor (activation on hold)', q: ['Why can I not switch on payouts?', 'It says I am being matched with a sponsor'], tags: ['holding tank', 'switch on payouts', 'matched with a sponsor', 'ready to activate'], { id: 'tank-hold', title: 'Matched with a sponsor (activation on hold)', q: ['Why can I not switch on payouts?', 'It says I am being matched with a sponsor'], tags: ['holding tank', 'switch on payouts', 'matched with a sponsor', 'ready to activate'],
re: /(being matched|matched with a sponsor|(can.?t|cannot|unable to) (i )?(switch on|turn on|activate) (my )?payouts|activate (button|payouts) (is )?(gone|missing|hidden)|ready to activate)/i, re: /(being matched|matched with a sponsor|(can.?t|cannot|unable to) (i )?(switch on|turn on|activate) (my )?payouts|activate (button|payouts) (is )?(gone|missing|hidden)|ready to activate)/i,
a: 'You joined without a sponsor, so you are in the holding tank. If someone invited you, type their username on the Who invited you? card on your Overview and this ends right away. The contract locks your sponsor for good the first time you switch on payouts or buy, so switching on payouts on its own waits until a real member picks you up. Buying is never held: you can buy a package any time, and with no sponsor it goes through under the company position. Once your wallet is linked, members see you at the top of their holding tank with a Ready to activate badge. If nobody adopts you within 24 hours, the site assigns you to the next eligible member in turn (someone active with their own $20 package). As soon as you have a sponsor, the Switch on payouts button comes back. If you already have a sponsor on LinkSpin with the same email or wallet, you are placed under them right away.' }, a: 'You joined without a sponsor, so you are in the holding tank. The contract locks your sponsor for good the first time you switch on payouts or buy, so switching on payouts on its own waits until a real member picks you up. Buying is never held: you can buy a package any time, and with no sponsor it goes through under the company position. Once your wallet is linked, members see you at the top of their holding tank with a Ready to activate badge. If nobody adopts you within 24 hours, the site assigns you to the next eligible member in turn (someone active with their own $20 package). As soon as you have a sponsor, the Switch on payouts button comes back. If you already have a sponsor on LinkSpin with the same email or wallet, you are placed under them right away.' },
{ id: 'tank-activate-link', title: 'Switch on payouts after you were picked up (one-tap link)', q: ['I got a Switch on payouts link from my new sponsor', 'How do I switch on payouts after I was adopted?'], tags: ['holding tank', 'switch on payouts', 'adopted', 'one tap', 'reminder'], { id: 'tank-activate-link', title: 'Switch on payouts after you were picked up (one-tap link)', q: ['I got a Switch on payouts link from my new sponsor', 'How do I switch on payouts after I was adopted?'], tags: ['holding tank', 'switch on payouts', 'adopted', 'one tap', 'reminder'],
re: /((switch on|turn on|activate) payouts? (link|email|reminder)|activate=1|(picked (me )?up|adopted( me)?).*(switch on|activate)|one.?tap.*(payouts|activate)|reminder.*switch on payouts)/i, re: /((switch on|turn on|activate) payouts? (link|email|reminder)|activate=1|(picked (me )?up|adopted( me)?).*(switch on|activate)|one.?tap.*(payouts|activate)|reminder.*switch on payouts)/i,
a: 'When a member picks you up from the holding tank (or the site assigns you to one after 24 hours), the chat and the email you get both carry a Switch on payouts link: instantadpay.com/my?activate=1#wallet. Tap it, sign in if asked, and your wallet opens with your new sponsor already filled in. It is one free transaction, no package needed, and it locks that sponsor in as yours on the contract. No wallet linked yet? The same link asks you to link one first (one free signature) and then carries on. On a phone without a wallet browser, the wallet picker opens and hands you to your wallet app to confirm. Nobody, not even the site, can switch payouts on for you: it has to come from your own wallet. If you have not done it 24 hours after you were picked up you get one reminder email (and your sponsor gets a note to give you a nudge), and one last reminder at 72 hours. They stop as soon as your payouts are on or you buy a package.' }, a: 'When a member picks you up from the holding tank (or the site assigns you to one after 24 hours), the chat and the email you get both carry a Switch on payouts link: instantadpay.com/my?activate=1#wallet. Tap it, sign in if asked, and your wallet opens with your new sponsor already filled in. It is one free transaction, no package needed, and it locks that sponsor in as yours on the contract. No wallet linked yet? The same link asks you to link one first (one free signature) and then carries on. On a phone without a wallet browser, the wallet picker opens and hands you to your wallet app to confirm. Nobody, not even the site, can switch payouts on for you: it has to come from your own wallet. If you have not done it 24 hours after you were picked up you get one reminder email (and your sponsor gets a note to give you a nudge), and one last reminder at 72 hours. They stop as soon as your payouts are on or you buy a package.' },
{ id: 'tank-batches', title: 'Holding tank batches (coming soon)', q: ['Will the site send me people from the holding tank?', 'How do I get fed leads?', 'What are holding tank batches?'], tags: ['holding tank', 'batches', 'fed leads', 'auto-assign', 'coming soon'],
re: /(holding tank batch|fed leads|get (fed )?leads from the (holding )?tank|batch(es)? (of people )?from the (holding )?tank)/i,
a: 'Coming soon, not switched on yet: holding tank batches. The plan is that active members who bought their own package receive a batch of people from the holding tank every 2 days, people who joined without a sponsor and become your referrals to welcome and help. The planned ladder: your own $20 package on InstantAdPay or $25 on LinkSpin = 10 people at a time; a counted monthly refuel or a higher package ($50 or more) = 20; both engines refueled in the same cycle, or the top package = 25; then 5 more for every further refuel month in a row, up to 50. You would need to sign in at least once a week, and anyone you have not contacted within 7 days (a chat, or Contacted them on their row in My line) goes back to the tank for another member. These are leads you can sponsor, not income: what they do next depends on them and on your follow-up. Until it is switched on, adopt by hand from Members > My line > Holding tank as today, and the 24-hour safety net keeps running as it does now.' },
{ id: 'holding-tank', title: 'Holding tank and adoptions', q: ['What is the holding tank?', 'How do I adopt a member?'], tags: ['holding tank', 'adopt', 'unsponsored'], { id: 'holding-tank', title: 'Holding tank and adoptions', q: ['What is the holding tank?', 'How do I adopt a member?'], tags: ['holding tank', 'adopt', 'unsponsored'],
re: /(holding tank|adopt(ing|ion|ed)? (a |an |from|someone|member)|orphan(ed)? member|no sponsor|unsponsored|release to tank)/i, re: /(holding tank|adopt(ing|ion|ed)? (a |an |from|someone|member)|orphan(ed)? member|no sponsor|unsponsored|release to tank)/i,
a: 'The holding tank is where free members who joined without a sponsor wait, and anyone can be picked up first come once they have been here 24 hours. A new sign-up shows an Opens in badge until then, with no Adopt button, so they have a day to tell us who invited them (the 24-hour safety net for wallet-linked members still runs on its own clock). To adopt you need payouts switched on and your own $20 or larger package bought; then open Members > My line > Holding tank. You can hold up to 10 people from the tank at one time (counting the ones who have not switched on payouts yet) and each one runs for 7 days, and if that person never links a wallet or buys they drop back into the tank. Adopting sets you as their sponsor, opens a chat and emails them, and their first purchase binds to you on the chain. You can also release one of your own free referrals into the tank for somebody else to work with, though not one you adopted less than 3 days ago. A member can be adopted twice in their lifetime at most, so an adoption you drop still costs them one of those chances. Members who have linked a wallet show a Ready to activate badge with the hours left and sit at the top of the list: their payouts are on hold until someone adopts them, and after 24 hours the site assigns them to the next eligible adopter in turn (own $20 package, fewer than 10 people held from the tank who have not switched on payouts yet, signed in within the last 7 days). Adopters take turns, so the one assigned least recently goes first.' }, a: 'The holding tank is where free members who joined without a sponsor wait, and anyone can be picked up first come. To adopt you need payouts switched on and your own $20 or larger package bought; then open Members > My line > Holding tank. You can hold 2 open adoptions at a time and each one runs for 7 days, and if that person never links a wallet or buys they drop back into the tank. Adopting sets you as their sponsor, opens a chat and emails them, and their first purchase binds to you on the chain. You can also release one of your own free referrals into the tank for somebody else to work with, though not one you adopted less than 3 days ago. A member can be adopted twice in their lifetime at most, so an adoption you drop still costs them one of those chances. Members who have linked a wallet show a Ready to activate badge with the hours left and sit at the top of the list: their payouts are on hold until someone adopts them, and after 24 hours the site assigns them to the next eligible adopter in turn (own $20 package, fewer than 2 open adoptions, signed in within the last 7 days). Adopters take turns, so the one assigned least recently goes first.' },
{ id: 'qualification', title: 'Qualification, levels 2 and 3, credits vs POL', q: ['How do I unlock level 2?', 'How does qualification work?', 'What is a pass-up?'], tags: ['qualification', 'level 2', 'level 3', 'pass-up', 'qualified start'], { id: 'qualification', title: 'Qualification, levels 2 and 3, credits vs POL', q: ['How do I unlock level 2?', 'How does qualification work?', 'What is a pass-up?'], tags: ['qualification', 'level 2', 'level 3', 'pass-up', 'qualified start'],
re: /(qualif|unlock level|level 2|level 3|pass.?up)/i, re: /(qualif|unlock level|level 2|level 3|pass.?up)/i,
a: 'Two different things are earned here. CREDITS: every member, free ones included, earns ad credits by viewing ads, videos, visits and the daily sign-in; credits buy your own ads and are never withdrawn. POL: real crypto paid to your wallet when your referrals buy packages, once you are activated: the $20 starter package plus payouts switched on from your wallet. Level 1 pays 50 percent of the packages your direct referrals buy, from the day you are activated. Bring 2 buyers of $20 or more and level 2 unlocks; 5 unlock level 3. When a level is not qualified, its share climbs the sponsor line, checking up to 25 positions, and pays the first qualified person. Qualification never expires and cannot be bought. Qualified Start: you may link extra wallets of your own as positions under your account (Buy packages > Qualified Start); each one that buys a $20+ package counts as a qualifying buyer, its credits pool with yours, and 50% of its purchase comes back to your main wallet. Your own money, your own wallets, a faster start, never an income promise.' }, a: 'Two different things are earned here. CREDITS: every member, free ones included, earns ad credits by viewing ads, videos, visits and the daily sign-in; credits buy your own ads and are never withdrawn. POL: real crypto paid to your wallet when your referrals buy packages, once you are activated: the $20 starter package plus payouts switched on from your wallet. Level 1 pays 50 percent of the packages your direct referrals buy, from the day you are activated. Bring 2 buyers of $20 or more and level 2 unlocks; 5 unlock level 3. When a level is not qualified, its share climbs the sponsor line, checking up to 25 positions, and pays the first qualified person. Qualification never expires and cannot be bought. Qualified Start: you may link extra wallets of your own as positions under your account (Buy packages > Qualified Start); each one that buys a $20+ package counts as a qualifying buyer, its credits pool with yours, and 50% of its purchase comes back to your main wallet. Your own money, your own wallets, a faster start, never an income promise.' },
@@ -252,19 +168,13 @@ const CANNED = [
a: 'You get your share link the moment you sign in, free members included. Open Members > Promo tools: the "Your links" block at the top lists your invite link plus five angle versions (Instant, Ad spend, Free, Ledger, Two), each with a note on who it is for and Copy and Share buttons. They are the same link with a code on the end, so every join and purchase credits you; only the first page the person sees changes. One tip: switch on payouts (one free wallet step in Members) before your people start buying, because the contract locks each buyer to their sponsor at their first purchase.' }, a: 'You get your share link the moment you sign in, free members included. Open Members > Promo tools: the "Your links" block at the top lists your invite link plus five angle versions (Instant, Ad spend, Free, Ledger, Two), each with a note on who it is for and Copy and Share buttons. They are the same link with a code on the end, so every join and purchase credits you; only the first page the person sees changes. One tip: switch on payouts (one free wallet step in Members) before your people start buying, because the contract locks each buyer to their sponsor at their first purchase.' },
{ id: 'banner-image', title: 'Banner image link and sizes', q: ['Why was my banner image refused?', 'What banner sizes are there?', 'How do I upload a banner?'], tags: ['banner', 'image', 'sizes', 'campaign'], { id: 'banner-image', title: 'Banner image link and sizes', q: ['Why was my banner image refused?', 'What banner sizes are there?', 'How do I upload a banner?'], tags: ['banner', 'image', 'sizes', 'campaign'],
re: /(banner (image|url|link|size|creative|file)|image (url|link|field)|broken (banner|image)|upload (a |my |the )?(banner|image|creative)|(png|jpg|jpeg) link|which sizes?)/i, re: /(banner (image|url|link|size|creative|file)|image (url|link|field)|broken (banner|image)|upload (a |my |the )?(banner|image|creative)|(png|jpg|jpeg) link|which sizes?)/i,
a: 'The image field on a banner campaign needs a direct link to the picture itself, one that ends in .png, .jpg, .gif, .webp or .svg, or an upload. A web page link (your join page, an image-hosting page) is refused, because it would show a broken banner. Easiest source: Promo tools > Banners, pick the size you want and tap Copy image URL. Game and BixPay banner links in Promo tools are short (for example https://instantadpay.link/b/turkeydrop/728x90.png) so they fit the image fields on exchanges and safelists that cut long links. Sizes are the standard ad sizes (728x90, 300x250, 160x600, 320x50 and more); the campaign form asks for the size too. Banner and text ads also run out on the wider network.' }, a: 'The image field on a banner campaign needs a direct link to the picture itself, one that ends in .png, .jpg, .gif, .webp or .svg, or an upload. A web page link (your join page, an image-hosting page) is refused, because it would show a broken banner. Easiest source: Promo tools > Banners, pick the size you want and tap Copy image URL. Sizes are the standard ad sizes (728x90, 300x250, 160x600, 320x50 and more); the campaign form asks for the size too. Banner and text ads also run out on the wider network.' },
{ id: 'themes', title: 'Light and dark themes', q: ['Is there a light mode?', 'How do I switch themes?'], tags: ['theme', 'dark mode', 'light mode', 'appearance', 'accessibility'],
re: /(dark ?mode|light ?mode|dark theme|light theme|night mode|themes?|appearance|too bright|too dark|high contrast)/i,
a: 'InstantAdPay has light and dark themes (added 2026-11-02). In the member area use the Light, Dark or Auto control in the header, or the Appearance card on your Profile. Dark is the original look, Light is a bright green-grey workspace with the same layout, and Auto follows your device setting and switches with it. Your choice is saved on your account, so it follows you to any device once you sign in, and it applies to the public pages and your wall too. Nothing changes until you pick one. Both themes pass the accessibility contrast standard for text.' },
{ id: 'promo-tools', title: 'Promo tools', q: ['What is in Promo tools?', 'Where are the email swipes and banners?'], tags: ['promo tools', 'social posts', 'swipes', 'banners', 'objections'], { id: 'promo-tools', title: 'Promo tools', q: ['What is in Promo tools?', 'Where are the email swipes and banners?'], tags: ['promo tools', 'social posts', 'swipes', 'banners', 'objections'],
re: /(promo tools?|social posts?|email swipes?|banner kit|download banners?|promo banners?|text a friend|objection|share buttons?)/i, re: /(promo tools?|social posts?|email swipes?|banner kit|download banners?|promo banners?|text a friend|objection|share buttons?)/i,
a: 'Promo tools (Members > Promo tools) has pill menus for each kit: Social posts (X, Facebook, LinkedIn, Telegram or WhatsApp, with post and share buttons), Text a friend (SMS-sized messages with Text it, WhatsApp, Telegram and Copy), Email swipes (short, standard, long, follow-up), Banners (every standard ad size plus 600x300 wide cards and 250x250 small squares, square, story and Telegram sizes, download or copy URL), your Banner wall link, an Objection handling bank with the truth plus a ready-to-send reply, and a Games tab with a kit for every network game plus the EnjoyBestGames arcade (enjoybestgames.com, hundreds of free games; only the featured Polygon games pay, and your ?r= link cookies visitors as your referral for 30 days). Everything is personalized with your invite link.' }, a: 'Promo tools (Members > Promo tools) has pill menus for each kit: Social posts (X, Facebook, LinkedIn, Telegram or WhatsApp, with post and share buttons), Text a friend (SMS-sized messages with Text it, WhatsApp, Telegram and Copy), Email swipes (short, standard, long, follow-up), Banners (every standard ad size plus square, story and Telegram sizes, download or copy URL), your Banner wall link, and an Objection handling bank with the truth plus a ready-to-send reply. Everything is personalized with your invite link.' },
{ id: 'trust-drain', title: 'Trust Wallet "drain your wallet" warning', q: ['Trust Wallet says this transaction will drain my wallet', 'My wallet blocked the purchase'], tags: ['trust wallet', 'drain', 'wallet warning', 'walletconnect'], { id: 'trust-drain', title: 'Trust Wallet "drain your wallet" warning', q: ['Trust Wallet says this transaction will drain my wallet', 'My wallet blocked the purchase'], tags: ['trust wallet', 'drain', 'wallet warning', 'walletconnect'],
re: /(drain (my|your) wallet|stop and go back|trust wallet.*(warn|block|red)|wallet (warning|blocked))/i, re: /(drain (my|your) wallet|stop and go back|trust wallet.*(warn|block|red)|wallet (warning|blocked))/i,
a: 'That red "this transaction will drain your wallet" screen is the wallet\'s own safety rule, not a problem with the purchase: Trust Wallet blocks any transaction that spends most of the POL in the wallet. Ways through: buy a smaller package first, add some POL so the purchase is well under half the balance, or connect a different wallet (SafePal and most other wallets have no such block). Extra POL always stays yours. If the next try says WalletConnect disconnected, open Wallet, tap Disconnect, then Connect again.' }, a: 'That red "this transaction will drain your wallet" screen is the wallet\'s own safety rule, not a problem with the purchase: Trust Wallet blocks any transaction that spends most of the POL in the wallet. Ways through: buy a smaller package first, add some POL so the purchase is well under half the balance, or connect a different wallet (MetaMask, Phantom, SafePal have no such block). Extra POL always stays yours. If the next try says WalletConnect disconnected, open Wallet, tap Disconnect, then Connect again. Phantom, SafePal and MetaMask do not have the hard block.' },
{ id: 'prohibited-content', title: 'What content is not allowed?', q: ['What content is not allowed?', 'Can I put a link in my bio?', 'Can I advertise a casino or CBD?'], tags: ['prohibited content', 'rules', 'bio links', 'gambling', 'adult', 'link farm'],
re: /(not allowed|prohibited|forbidden|banned (content|words|niches?)|content (rules|policy)|what (content|ads|niches?) (is|are) (not )?(allowed|ok|accepted)|can i (post|promote|advertise|run) .*(casino|gambling|betting|adult|porn|cbd|weed|pharma|guns?)|link ?farm|backlinks?|links? in (the |my |your )?bio|bio (link|url)|why was my (bio|profile|link) (refused|rejected|blocked))/i,
a: 'Not allowed anywhere on InstantAdPay (ads, campaigns, line banners, wall offers, bios and social links): gambling, casinos, betting, lotteries and sweepstakes; adult or sexual content; drugs and prescription pharmaceuticals; weapons; hate or harassment; malware, phishing and counterfeit goods; misleading financial promises. The bio is text only: no links and no domain names, links go in the social fields in Profile. Your bio, avatar and social links show on your public wall once you have bought a package; free accounts show only their name and the line’s ads there. Accounts created just to place links in profile fields (link farming) are removed without notice, with their profile text. The full list is in the Terms, section 8: https://instantadpay.com/terms#prohibited' },
{ id: 'wall', title: 'Your banner wall and its three positions', q: ['How does my wall work?', 'How do I own wall positions 2 and 3?'], tags: ['wall', 'banner wall', 'positions'], { id: 'wall', title: 'Your banner wall and its three positions', q: ['How does my wall work?', 'How do I own wall positions 2 and 3?'], tags: ['wall', 'banner wall', 'positions'],
re: /(wall (page|slots?|positions?)|banner wall|my wall|three (ads|slots) on (my|the) wall)/i, re: /(wall (page|slots?|positions?)|banner wall|my wall|three (ads|slots) on (my|the) wall)/i,
a: 'Your wall (instantadpay.com/wall/yourname) shows three ads. Position 1 is always your line banner. Positions 2 and 3 show your upline (or InstantAdPay) until you earn them: 2 qualifying buyers ($20 or more) make position 2 yours, 5 make position 3 yours, so a fully qualified member owns the whole page with their own links and offers. Set them in Profile > Your wall; an unlocked slot you leave empty keeps showing your upline until you fill it.' }, a: 'Your wall (instantadpay.com/wall/yourname) shows three ads. Position 1 is always your line banner. Positions 2 and 3 show your upline (or InstantAdPay) until you earn them: 2 qualifying buyers ($20 or more) make position 2 yours, 5 make position 3 yours, so a fully qualified member owns the whole page with their own links and offers. Set them in Profile > Your wall; an unlocked slot you leave empty keeps showing your upline until you fill it.' },
@@ -297,10 +207,10 @@ const CANNED = [
a: 'Packages mint ad credits on-chain, and every new member also gets a small batch of welcome credits just for joining. One credit is one cent of ad delivery: banners and text ads (also syndicated to the wider network), full-screen login ads, watch-to-earn video ads, solo ads into member inboxes, featured links in the strip on every Overview, and verified-visit packs, all managed from Members > Campaigns. Only your campaigns can spend your credits.' }, a: 'Packages mint ad credits on-chain, and every new member also gets a small batch of welcome credits just for joining. One credit is one cent of ad delivery: banners and text ads (also syndicated to the wider network), full-screen login ads, watch-to-earn video ads, solo ads into member inboxes, featured links in the strip on every Overview, and verified-visit packs, all managed from Members > Campaigns. Only your campaigns can spend your credits.' },
{ id: 'pol-only', title: 'Which coin and network: POL on Polygon', q: ['Which crypto do you use?', 'What network is this on?', 'Do you accept other coins?'], tags: ['pol', 'polygon', 'crypto', 'network'], { id: 'pol-only', title: 'Which coin and network: POL on Polygon', q: ['Which crypto do you use?', 'What network is this on?', 'Do you accept other coins?'], tags: ['pol', 'polygon', 'crypto', 'network'],
re: /(which|what) (crypto|coin|token|currency|chain|network)|paid in what|get paid in|supported (crypto|coins|wallets)|do you (support|accept)/i, re: /(which|what) (crypto|coin|token|currency|chain|network)|paid in what|get paid in|supported (crypto|coins|wallets)|do you (support|accept)/i,
a: 'One coin, one network: POL, the native coin of Polygon. You pay for packages in POL and every payout arrives as POL in your own Polygon wallet, in the same transaction. No other coins, tokens or chains are used. Use SafePal or any other crypto wallet on Polygon, and you can buy POL with a card from Buy packages if you have never held crypto.' }, a: 'One coin, one network: POL, the native coin of Polygon. You pay for packages in POL and every payout arrives as POL in your own Polygon wallet, in the same transaction. No other coins, tokens or chains are used. Any Polygon wallet works (MetaMask, SafePal, Phantom, Coinbase Wallet), and you can buy POL with a card from Buy packages if you have never held crypto.' },
{ id: 'wallets', title: 'Which wallet, and buying POL with a card', q: ['Which wallet should I use?', 'How do I buy POL with a card?', 'I have never owned crypto'], tags: ['wallet', 'metamask', 'safepal', 'phantom', 'moonpay', 'buy pol'], { id: 'wallets', title: 'Which wallet, and buying POL with a card', q: ['Which wallet should I use?', 'How do I buy POL with a card?', 'I have never owned crypto'], tags: ['wallet', 'metamask', 'safepal', 'phantom', 'moonpay', 'buy pol'],
re: /(which wallet|what wallet|best wallet|recommended wallet|set ?up (a )?wallet|buy (pol|crypto|polygon)|get (pol|crypto)|moonpay|card to crypto|no crypto|never (had|held|owned) crypto)/i, re: /(which wallet|what wallet|best wallet|recommended wallet|set ?up (a )?wallet|buy (pol|crypto|polygon)|get (pol|crypto)|moonpay|card to crypto|no crypto|never (had|held|owned) crypto)/i,
a: 'Use SafePal or any other crypto wallet on Polygon (in Phantom, turn Polygon on first: Settings, Active Networks). Trust Wallet works but blocks a purchase that spends most of the POL in it, so keep about double the package cost there. To buy POL with a card: connect your wallet, open Buy packages, tap "Buy POL with a card". MoonPay opens with POL on Polygon and your own address filled in; pay by card, Apple Pay or Google Pay (first time needs an ID check, minimum order around $30), the POL lands in your wallet in minutes, then buy the package. The full step-by-step guide is in Training: Wallets and buying POL (https://instantadpay.com/wallets, members only).' }, a: 'Preferred wallets: MetaMask (recommended, and the one for Qualified Start extra accounts), Phantom (turn Polygon on first: Settings, Active Networks), SafePal or Coinbase Wallet. Trust Wallet works but blocks a purchase that spends most of the POL in it, so keep about double the package cost there. To buy POL with a card: connect your wallet, open Buy packages, tap "Buy POL with a card". MoonPay opens with POL on Polygon and your own address filled in; pay by card, Apple Pay or Google Pay (first time needs an ID check, minimum order around $30), the POL lands in your wallet in minutes, then buy the package. The full step-by-step guide is in Training: Wallets and buying POL (https://instantadpay.com/wallets, members only).' },
{ id: 'safe', title: 'Is it safe? What if the company disappears?', q: ['Is this safe?', 'Can you run away with the money?', 'What if the company disappears?'], tags: ['safe', 'contract', 'trust', 'custody'], { id: 'safe', title: 'Is it safe? What if the company disappears?', q: ['Is this safe?', 'Can you run away with the money?', 'What if the company disappears?'], tags: ['safe', 'contract', 'trust', 'custody'],
re: /(safe|trust|rug|run away|company disappear)/i, re: /(safe|trust|rug|run away|company disappear)/i,
a: 'The money never touches us. An immutable contract splits every purchase in the same transaction, holds zero balance, and has no pause switch or upgrade path. Read the plain-language review and the verified source at https://instantadpay.com/contract.' } a: 'The money never touches us. An immutable contract splits every purchase in the same transaction, holds zero balance, and has no pause switch or upgrade path. Read the plain-language review and the verified source at https://instantadpay.com/contract.' }
@@ -315,14 +225,6 @@ function seeds() {
// ---- facts for the AI fallback ---- // ---- facts for the AI fallback ----
// PASS TIERS (2026-10-22): the passes above the weekly Game Pass (Explorer, Champion, Sovereign, Legend; names from gamepass.js // PASS TIERS (2026-10-22): the passes above the weekly Game Pass (Explorer, Champion, Sovereign, Legend; names from gamepass.js
// TIER_DEFS). While sovTiers is off the assistant only says they are coming soon; once on, it quotes the live prices and contents. // TIER_DEFS). While sovTiers is off the assistant only says they are coming soon; once on, it quotes the live prices and contents.
// BONUS HEROES (2026-11-05): sold one time; while heroSales is off the assistant says they are coming soon, once on it quotes the live prices
function heroesFact() {
let h = null; try { h = HERO_SALE ? HERO_SALE() : null; } catch (e) { h = null; }
const base = 'Shards of Valor bonus heroes: Kestrel the Archer, Valda the Barbarian, Morag the Druid, Roland the Paladin. Kestrel is FREE for every player once a hero in the party reaches level 20 (since 2026-11-14) and is NOT sold; anyone who bought her before keeps her. Valda, Morag and Roland are sold ONE TIME, owned for good, never a subscription; paid by a NEW package purchase of at least the price (sponsor and team paid as usual, the member keeps the package credits); credits already held never buy one. Three heroes fight at a time, picked at an inn, rest spot or dungeon camp; the roster keeps gear and level and earns half experience. A bonus hero joins at the party level (at most 20) and is never stronger than the free heroes. The Champion and Sovereign passes no longer include a hero (the Necromancer was dropped); the Legend pass opens every bonus hero while it is active.';
if (!h || !h.sale) return '- BONUS HEROES (COMING SOON, not on sale yet): ' + base + ' Never quote their prices or a launch date while they are not on sale.\n';
const each = (h.rows || []).map(r => r.name + (r.freeAt ? ' free at level ' + r.freeAt + ' (not sold)' : r.free ? ' free for everyone' : ' $' + r.usd)).join(', ');
return '- BONUS HEROES (ON SALE, Members > Games > Game Pass card at https://instantadpay.com/my#games): ' + each + (h.bundle && h.bundle.names.length ? '; the bundle ' + h.bundle.names.join(', ') + ' $' + h.bundle.usd : '') + '. ' + base + ' The bundle is heroes only (no level cap change).\n';
}
function passTiersFact() { function passTiersFact() {
let t = null; try { t = PASS_TIERS ? PASS_TIERS() : null; } catch (e) { t = null; } let t = null; try { t = PASS_TIERS ? PASS_TIERS() : null; } catch (e) { t = null; }
const soon = '- MORE GAME PASSES: monthly and yearly passes for Shards of Valor are COMING SOON and are not on sale yet. If someone asks about them (or about an Explorer, Champion, Sovereign or Legend pass, or a monthly or yearly pass), say they are coming soon and that the $5 weekly Game Pass is the pass on sale today. Never quote their prices, contents or a launch date.\n'; const soon = '- MORE GAME PASSES: monthly and yearly passes for Shards of Valor are COMING SOON and are not on sale yet. If someone asks about them (or about an Explorer, Champion, Sovereign or Legend pass, or a monthly or yearly pass), say they are coming soon and that the $5 weekly Game Pass is the pass on sale today. Never quote their prices, contents or a launch date.\n';
@@ -335,32 +237,13 @@ function passTiersFact() {
// SYNDICATED RATE (Marty, 2026-10-27, approved 4:1) follows ads rates().synRateDivisor; the canned answer quotes 1/4, so // SYNDICATED RATE (Marty, 2026-10-27, approved 4:1) follows ads rates().synRateDivisor; the canned answer quotes 1/4, so
// the fast path rewrites it when the admin picks another N, and the AI fact always states the live N. // the fast path rewrites it when the admin picks another N, and the AI fact always states the live N.
const SYN_N = () => { try { return Math.max(1, Math.floor(Number(require('./ads').synRateDivisor()) || 1)); } catch (e) { return 4; } }; const SYN_N = () => { try { return Math.max(1, Math.floor(Number(require('./ads').synRateDivisor()) || 1)); } catch (e) { return 4; } };
// text ads have their own N since 2026-11-12 (Marty: 1/10); the canned answer quotes 4 and 10
const SYN_T = () => { try { return Math.max(1, Math.floor(Number(require('./ads').synRateDivisorText()) || 1)); } catch (e) { return 10; } };
const netRateAnswer = n => n === 1 ? 'Your banner and text ads also run on Network Ad Space, and visit packs also get visits from partner sites like PassiveDrip. That delivery uses credits at the same rate as views and visits here.' const netRateAnswer = n => n === 1 ? 'Your banner and text ads also run on Network Ad Space, and visit packs also get visits from partner sites like PassiveDrip. That delivery uses credits at the same rate as views and visits here.'
: 'Views and visits here on InstantAdPay use credits at the normal rate. Your banner and text ads also run on Network Ad Space, and visit packs also get visits from partner sites like PassiveDrip. That delivery costs 1/' + n + ' of the rate: ' + n + ' network views of a banner cost what 1 view here does, and ' + n + ' partner visits use up 1 visit of your pack.' + (SYN_T() === 1 ? ' Text ads are one price everywhere: 1 credit buys 100 text ad views, here or on the network.' : SYN_T() !== n ? ' Text ads: ' + SYN_T() + ' network views cost what 1 view here does.' : '') + ' So your budget goes further, and every credit still buys real delivery. You see network views and partner visits in Members > Campaigns, and network charges show as "Network views (1/' + n + ' rate)" lines in Credit activity.'; : 'Views and visits here on InstantAdPay use credits at the normal rate. Your banner and text ads also run on Network Ad Space, and visit packs also get visits from partner sites like PassiveDrip. That delivery costs 1/' + n + ' of the rate: ' + n + ' network views cost what 1 view here does, and ' + n + ' partner visits use up 1 visit of your pack. So your budget goes further, and every credit still buys real delivery. You see network views and partner visits in Members > Campaigns, and network charges show as "Network views (1/' + n + ' rate)" lines in Credit activity.';
function synFact() { const n = SYN_N(); return '- NETWORK RATE (live, Marty 2026-10-27): delivery ON instantadpay.com is charged at the normal rate. Network Ad Space impressions of BANNER ads cost 1/' + n + ' of the on-site rate (' + n + ' network views = the price of 1 view here; credit log line "Network views (1/' + n + ' rate)"); TEXT ads (Marty 2026-11-20): one price everywhere, 1 credit = 100 text ad views on-site AND on Network Ad Space (on-site text was 1 credit per 10 views until 2026-11-20; network text was already 1 credit per 100 views since 2026-11-12), because text ads get clicked about as often in both places; network text credit log lines now read "Network views" (older ones "Network views (1/10 rate)"); live text network divisor: ' + SYN_T() + ', going forward only; and PassiveDrip partner visits use up 1 visit of a pack per ' + n + ' partner visits. The budget is the limit, burns follow what was charged, nothing charged before 2026-10-27 changed. AdRevLinks popups and DripOffers clicks are not charged. Game refuels and Spooky Doors are charged as normal visits.' + String.fromCharCode(10); } function synFact() { const n = SYN_N(); return '- NETWORK RATE (live, Marty 2026-10-27): delivery ON instantadpay.com is charged at the normal rate. Network Ad Space impressions of banner/text ads cost 1/' + n + ' of the on-site rate (' + n + ' network views = the price of 1 view here; credit log line "Network views (1/' + n + ' rate)"), and PassiveDrip partner visits use up 1 visit of a pack per ' + n + ' partner visits. The budget is the limit, burns follow what was charged, nothing charged before 2026-10-27 changed. AdRevLinks popups and DripOffers clicks are not charged. Game refuels and Spooky Doors are charged as normal visits.' + String.fromCharCode(10); }
// the refuel fact follows the refuelStreak switch: while it is off the assistant says it is not live yet (2026-10-24) // the refuel fact follows the refuelStreak switch: while it is off the assistant says it is not live yet (2026-10-24)
let REFUEL_ON = () => false; let REFUEL_ON = () => false;
// POL Miner (2026-10-28) follows site config gamesLive: until 'polminer' is in it the assistant only says it is coming soon // POL Miner (2026-10-28) follows site config gamesLive: until 'polminer' is in it the assistant only says it is coming soon
let GAME_LIVE = () => false; let GAME_LIVE = () => false;
// BixPay (2026-10-29) follows site config bixpayLive: until it is on the assistant only says the card is coming soon
let BIX_LIVE = () => false;
const bixLive = () => { try { return !!BIX_LIVE(); } catch (e) { return false; } };
const isBixId = id => /^(c-)?bixpay(-[a-z]+)?$/.test(String(id || ''));
const BIX_SOON_ANSWER = 'A BixPay Visa card for spending POL is coming to InstantAdPay soon: a self-custody wallet with a Visa card, made by BIX, a separate company. It is not switched on here yet. When it is, it shows up on your Wallet tab, with a partner-link field in your Profile and a guide at instantadpay.com/bixpay, and the release notes will say so.';
function bixFact() { return bixLive()
? '- BIXPAY VISA CARD (LIVE, 2026-10-29): BixPay = a self-custody wallet + Visa card made by BIX, a SEPARATE company (not InstantAdPay). The member sends USDT or USDC to the BixPay wallet on Polygon, loads the card, spends wherever Visa is accepted incl. Apple Pay and Google Pay. Virtual card $9.99 (plastic, metal and gold cost more). The ONLY fee we state: 3% per purchase, no load fee; for anything else say "see BIX’s terms". US: open in 31 states so far; not in your state yet = you can still get the wallet and build; elsewhere availability varies by country; KYC required for the card. Funding POL -> card: (1) swap POL to USDT/USDC on any exchange or on-ramp, send on Polygon (app: Wallet > Receive > USDT or USDC > Polygon address); (2) US: Cash App can send crypto straight to the BixPay wallet; (3) an in-app swap is announced by BIX but NOT live: never say members can swap POL inside the app today. Sign-up steps: partner link -> register in the BIX portal (bix.ibportal.io) -> download the BIX app -> Settings > Scan QR to link app and portal -> Cards > Create Card ($9.99 virtual). Partner plan, plain words: BIX puts half of the 3% fee and of card sales into its partner plan, paid over ten levels (15% level 1, 10% level 2, 2.5% each on levels 3 to 10) plus a 5% pool; sign-ups and commissions are tracked and paid by BIX in the BIX portal, never by InstantAdPay; any worked example is hypothetical, not typical, and never a promise. Disputes: BIX accepts a dispute up to 120 days after a transaction posts; they can take 30 to 60 business days. WHERE: Members > Wallet (the card with Get your BixPay card + How it works), Members > Profile > BixPay card (the member pastes their PARTNER link from BIX portal > Profile > Partner, the second box; the referral link with appId=3 is refused), Promo tools > BixPay tab (3 posts, an email swipe, 4 text-only banners, all carrying the member’s link, plus the tab’s click count), the public guide https://instantadpay.com/bixpay (add ?ref=<username> and the page carries that member’s link), one sentence in payout emails. WHOSE LINK: the member’s own partner link, else the first sponsor up the chain (10 levels) with one, else the network link; every card says which ("Using: your link / @name’s link / the network link"). Compliance: InstantAdPay is not the card issuer and earns a referral commission when someone signs up through a partner link; crypto assets can lose value. NEVER repeat BIX marketing claims (user counts, cards issued, spend per day, valuations, "bigger than X") as facts; if asked, say those are BIX’s own claims and we have not verified them.\n'
: '- BIXPAY VISA CARD: COMING SOON, not switched on yet. If asked about BixPay, BIX, a crypto Visa card or spending POL with a card, say it is coming to the Wallet tab soon and nothing is live yet; never quote its fees, steps, links or the partner plan until it is on.\n'; }
// Warp & Wares (2026-10-29, the 30-day season game) follows gamesLive the same way; its season window is WW_SEASON_START / WW_SEASON_END (Central, end exclusive)
const WW_END = /^\d{4}-\d{2}-\d{2}$/.test(String(process.env.WW_SEASON_END || '')) ? process.env.WW_SEASON_END : '2026-12-30';
const wwDay = () => new Date().toLocaleDateString('en-CA', { timeZone: 'America/Chicago' });
const wwOver = () => wwDay() >= WW_END;
const wwLive = () => { try { return !!GAME_LIVE('warpwares') && !wwOver(); } catch (e) { return false; } };
const WARPWARES_SOON_ANSWER = 'Warp & Wares, a 30-day space trading season game in the Trade Wars style, is coming soon to the InstantAdPay games. It is not open yet; it will show up on your Games tab (Members > Games) and in the release notes when it opens.';
const WARPWARES_OVER_ANSWER = 'The Warp & Wares season is over; the next one is announced on the Games tab and in the release notes. The other games are on your Games tab (Members > Games).';
const wwAnswer = () => wwOver() ? WARPWARES_OVER_ANSWER : WARPWARES_SOON_ANSWER;
function warpwaresFact() { return wwLive() ? '- WARP & WARES (30-day season game, Members > Games): a Trade Wars-style trading and territory game in one shared galaxy of 1,200 sectors. Every captain gets 200 turns a day (reset midnight Central, never banked): warp, trade ore/grain/parts between markets, haggle, hold sectors with fighters and mines, found a base (six levels on build clocks), teams of five with a shared vault and elected leader. One-tap sign-in with the InstantAdPay account. PAYS POL from a published season budget: landmark holders and top traders at each weekly tick (Sundays 9 AM Central), one-time milestones (first base, first garrison, first 100,000 credits traded), the season-close leaderboard and titles. POL collects in the game balance and is paid automatically to the wallet linked on InstantAdPay. SPONSOR DOCK: docking at a sponsor market opens a short verified sponsor visit (charged to the advertiser like any game refuel visit, visit kind dock) and pays BONUS TURNS, the only turns past 200; gameplay only, never POL. Credits never turn into POL. Season Pass through the Game Pass: a hull step up, a second base slot, a named ship, a team banner, gold badges; never turns, fighters or prizes. Never state amounts, caps, totals or a season budget.\n' : wwOver() ? '- WARP & WARES: the season has ENDED; say the season is over and point to the Games tab for the next one.\n' : '- WARP & WARES: COMING SOON, not open yet. Never send members to the game address; say it is coming soon to the Games tab, and do not bring it up unless asked.\n'; }
const POLMINER_SOON_ANSWER = 'POL Miner, a dig-down mining game where rare Polygon crystals pay POL, is coming soon to the InstantAdPay games. It is not open yet; it will show up on your Games tab (Members > Games) and in the release notes when it launches.'; const POLMINER_SOON_ANSWER = 'POL Miner, a dig-down mining game where rare Polygon crystals pay POL, is coming soon to the InstantAdPay games. It is not open yet; it will show up on your Games tab (Members > Games) and in the release notes when it launches.';
const pmLive = () => { try { return !!GAME_LIVE('polminer'); } catch (e) { return false; } }; const pmLive = () => { try { return !!GAME_LIVE('polminer'); } catch (e) { return false; } };
// Turkey Drop (2026-10-28, the Thanksgiving season game) follows gamesLive the same way, and its season (Nov 2 to 30, Central) ends it // Turkey Drop (2026-10-28, the Thanksgiving season game) follows gamesLive the same way, and its season (Nov 2 to 30, Central) ends it
@@ -373,48 +256,36 @@ const TURKEYDROP_OVER_ANSWER = 'Turkey Drop was the network’s Thanksgiving gam
const tdAnswer = () => tdOver() ? TURKEYDROP_OVER_ANSWER : TURKEYDROP_SOON_ANSWER; const tdAnswer = () => tdOver() ? TURKEYDROP_OVER_ANSWER : TURKEYDROP_SOON_ANSWER;
const TD_PASS_PERK = ' Turkey Drop one free “back on the air” extra life every day;'; const TD_PASS_PERK = ' Turkey Drop one free “back on the air” extra life every day;';
const gpWithTd = a => tdLive() ? String(a).replace('plus one free supply crate every day;', 'plus one free supply crate every day;' + TD_PASS_PERK) : a; // the Game Pass answer names the perk only while Turkey Drop is live const gpWithTd = a => tdLive() ? String(a).replace('plus one free supply crate every day;', 'plus one free supply crate every day;' + TD_PASS_PERK) : a; // the Game Pass answer names the perk only while Turkey Drop is live
// Shards of Valor (2026-11-06, Marty): open for testing from the Games tab once 'shardsofvalor' is in gamesLive; no POL until a launch date
function sovTestFact() { return GAME_LIVE && GAME_LIVE('shardsofvalor') ? '- SHARDS OF VALOR (OPEN TESTING since Nov 6, https://shardsofvalor.com, Members > Games > Shards of Valor > Play): a pixel adventure RPG for many players at once; lead three heroes across the islands, help the townspeople, fight in the dungeons and recover the eight Shards of Valor. It is in open testing: anyone can play it now, but it is NOT live and pays NO POL until a launch date is set; there is no launch date yet. ALL TESTING PROGRESS IS WIPED AT LAUNCH (heroes, levels, gold and items start fresh), because this phase is only for finding bugs. Never promise a date or a payout. Ask testers to report bugs through Support.\n' : ''; }
function turkeydropFact() { return tdLive() ? '- TURKEY DROP (Thanksgiving season game, https://turkeydropgame.com, Members > Games; open Nov 2 through Nov 30 Central, its Games card shows a "Limited time, ends Nov 30" ribbon and is gone after): a free 70s-cartoon arcade game. The WFWL 98.7 radio helicopter drops turkeys over the mall; the player swings a net to catch them before they splat; too many splats and the station pulls them off the air. One-tap sign-in with the InstantAdPay account. PAYS POL: the first time a player reaches each score milestone, plus a weekly top-3 leaderboard POL prize. POL collects in the Turkey Drop balance and is paid automatically to the wallet linked on InstantAdPay. BACK ON THE AIR: after being pulled off the air, a short verified sponsor visit (charged to the advertiser like any game refuel visit) gives one extra life; gameplay only, never POL. Game Pass perk: one free back-on-the-air extra life every day. Never state amounts, caps, totals or a season budget.\n' : tdOver() ? '- TURKEY DROP: the Thanksgiving season game (Nov 2 to 30) has ENDED; say the season is over and point to the other games.\n' : '- TURKEY DROP: COMING SOON, not open yet. Never send members to turkeydropgame.com; say it is coming soon to the Games tab, and do not bring it up unless asked.\n'; } function turkeydropFact() { return tdLive() ? '- TURKEY DROP (Thanksgiving season game, https://turkeydropgame.com, Members > Games; open Nov 2 through Nov 30 Central, its Games card shows a "Limited time, ends Nov 30" ribbon and is gone after): a free 70s-cartoon arcade game. The WFWL 98.7 radio helicopter drops turkeys over the mall; the player swings a net to catch them before they splat; too many splats and the station pulls them off the air. One-tap sign-in with the InstantAdPay account. PAYS POL: the first time a player reaches each score milestone, plus a weekly top-3 leaderboard POL prize. POL collects in the Turkey Drop balance and is paid automatically to the wallet linked on InstantAdPay. BACK ON THE AIR: after being pulled off the air, a short verified sponsor visit (charged to the advertiser like any game refuel visit) gives one extra life; gameplay only, never POL. Game Pass perk: one free back-on-the-air extra life every day. Never state amounts, caps, totals or a season budget.\n' : tdOver() ? '- TURKEY DROP: the Thanksgiving season game (Nov 2 to 30) has ENDED; say the season is over and point to the other games.\n' : '- TURKEY DROP: COMING SOON, not open yet. Never send members to turkeydropgame.com; say it is coming soon to the Games tab, and do not bring it up unless asked.\n'; }
function polminerFact() { return pmLive() ? '- POL MINER (https://polminer.com, Members > Games): a free dig-down mining game. Dig, sell ore for coins, upgrade pick/lamp/cart/thruster, beat a drill boss every 30 m. Pink Polygon crystals pay a random POL amount the first time each one is dug out; each boss pays POL on its first win per account; first trips to 50/100/150/200 m pay POL. Coins never turn into POL. Guests can play and collect at sign-in. POL is paid automatically to the wallet linked on InstantAdPay. The SUPPLY pad opens a sponsored supply crate (full lamp + coins, never POL) after a short sponsor visit.\n' : '- POL MINER: COMING SOON, not open yet. Never send members to polminer.com; say it is coming soon to the Games tab.\n'; } function polminerFact() { return pmLive() ? '- POL MINER (https://polminer.com, Members > Games): a free dig-down mining game. Dig, sell ore for coins, upgrade pick/lamp/cart/thruster, beat a drill boss every 30 m. Pink Polygon crystals pay a random POL amount the first time each one is dug out; each boss pays POL on its first win per account; first trips to 50/100/150/200 m pay POL. Coins never turn into POL. Guests can play and collect at sign-in. POL is paid automatically to the wallet linked on InstantAdPay. The SUPPLY pad opens a sponsored supply crate (full lamp + coins, never POL) after a short sponsor visit.\n' : '- POL MINER: COMING SOON, not open yet. Never send members to polminer.com; say it is coming soon to the Games tab.\n'; }
function refuelFact() { return "- DOWNLINE BANNERS (LIVE 2026-11-13, https://downlinebanners.com, contract verified on Polygonscan): network banner board; a $5 spot in POL = 300 guaranteed views + a place in one line; the contract pays the 10 spots above and the buyer's sponsor when later spots sell; nothing promised. InstantAdPay sign-in carries members in as their linked wallet; share links use the InstantAdPay username; My Spots has a 'Use a LinkSpin Banner Spin' button. A counted Monthly Refuel of $50+ (either site) earns one free spot for the member's main wallet, paid by the company (no wallet linked = no spot).\n" + (REFUEL_ON() ? "- MONTHLY REFUEL STREAK (built 2026-10-24, switch refuelStreak): ONE streak per member across InstantAdPay and LinkSpin. Counted refuel = a NEW package of $20+ on InstantAdPay or $25+ on LinkSpin by one of the member's own positions. First one sets the member's own refuel day; next due 30 days after the last counted refuel; window opens 5 days before the due day; 5-day grace after it; Central time. Missing the grace resets the streak, except one free miss per 365 days. Bonus (purchased-grade ad credits on the site where bought, credit log 'Refuel streak'): one engine m1 +10%, m2 +15%, m3 +20%, m4+ +25%; both sites in the same cycle m1 +15%, m2 +20%, m3 +30%, m4+ +40% each (first site topped up to the both rate, difference only) plus a 100-credit Featured bonus on InstantAdPay at m4+ (purchased-grade credits, any format). Stacks on Five Dollar Friday / Wired Wednesday. Pit Stop: another $20+/$25+ package on a site already refueled this cycle, before the next window opens (the other site's first package in the cycle is the second engine instead) = half the current streak rate, once per site per cycle, not a counted refuel. Badges: Engine Started (first refuel), Refueled 3 / 6 / 12 months. ENGINE ROOM: unlocked by the first counted refuel (greyed 'Refuel to start your engine' before), IAP tab Engine Room + LinkSpin Ads screen panel, same data both sites: dials Fuel left (credits free + in campaigns on both sites vs this cycle's refuel credits incl. bonus, days left at the recent burn), Clicks this week (vs last week, clicks per 1,000 credits), Goals this month (conversion pixel conversions since the 1st Central vs the member's own goal); streak panel; warning lights (ads at 80%, ads out, refuel day coming, login slot open); six part lights (fuel, banner spin, spin link, page, testing, conversion tracking: green working, amber needs attention, grey not started with a Set it up link); one Next move button from simple rules. REFUEL KIT: each counted refuel unlocks the Central-month's members-only banner set for this site's own program (5 sizes, personalized server-side with @username + QR to the member's link; IAP: Promo tools card with Use in an IAP banner campaign; LinkSpin: Ads screen card with Load into my Banner Spin); kits stay usable after the month; streak month 3+ adds an animated GIF, month 6+ a BannerKitAI custom-banners credit (coming, entitlement saved). Reminders 5 days before, on the day, last call at the end of grace (email + on-site notice). The member's Refuel card (InstantAdPay Overview, LinkSpin Credits/Ads) shows refuel day, streak, next bonus, Pit Stop status. Either site alone keeps the streak (one-engine rates); both sites in one cycle = the bigger bonus; never say both are required. MEMBER GUIDE PAGE (public, 2026-10-24): /refuel on both sites (https://instantadpay.com/refuel and https://linkspin.app/refuel): the flow, the numbers, the member steps, leader coaching and FAQ; point members there for the full picture. Ad credits only, never cash; never promise income. No auto-billing: the member chooses every package. ROUTES (2026-10-25): LinkSpin menu item Refuel = https://linkspin.app/credits#refuel (the Refuel panel, scrolled to and highlighted); packages of $25+ there are marked counts for Refuel; https://linkspin.app/credits#buy = the package picker; https://linkspin.app/ads#engine = LinkSpin Engine Room. InstantAdPay Engine Room = https://instantadpay.com/my#engine; its Set up conversion tracking opens https://instantadpay.com/my#conversions (Campaigns > Conversion tracking card, same goals LinkSpin counts). Engine Room links that cross to LinkSpin (Banner Spin, spin link, page, testing, refuel LinkSpin) open LinkSpin with a note at the top naming the job, Step 1, a guide link and Back to InstantAdPay; same email signs in on both.\n" : '- MONTHLY REFUEL STREAK: built but NOT switched on yet. If asked, say it is coming and nothing counts toward it today; do not quote bonus rates or dates.\n'); } function refuelFact() { return REFUEL_ON() ? "- MONTHLY REFUEL STREAK (built 2026-10-24, switch refuelStreak): ONE streak per member across InstantAdPay and LinkSpin. Counted refuel = a NEW package of $20+ on InstantAdPay or $25+ on LinkSpin by one of the member's own positions. First one sets the member's own refuel day; next due 30 days after the last counted refuel; window opens 5 days before the due day; 5-day grace after it; Central time. Missing the grace resets the streak, except one free miss per 365 days. Bonus (purchased-grade ad credits on the site where bought, credit log 'Refuel streak'): one engine m1 +10%, m2 +15%, m3 +20%, m4+ +25%; both sites in the same cycle m1 +15%, m2 +20%, m3 +30%, m4+ +40% each (first site topped up to the both rate, difference only) plus a 100-credit Featured bonus on InstantAdPay at m4+ (purchased-grade credits, any format). Stacks on Five Dollar Friday / Wired Wednesday. Pit Stop: another $20+/$25+ package on a site already refueled this cycle, before the next window opens (the other site's first package in the cycle is the second engine instead) = half the current streak rate, once per site per cycle, not a counted refuel. Badges: Engine Started (first refuel), Refueled 3 / 6 / 12 months. ENGINE ROOM: unlocked by the first counted refuel (greyed 'Refuel to start your engine' before), IAP tab Engine Room + LinkSpin Ads screen panel, same data both sites: dials Fuel left (credits free + in campaigns on both sites vs this cycle's refuel credits incl. bonus, days left at the recent burn), Clicks this week (vs last week, clicks per 1,000 credits), Goals this month (conversion pixel conversions since the 1st Central vs the member's own goal); streak panel; warning lights (ads at 80%, ads out, refuel day coming, login slot open); six part lights (fuel, banner spin, spin link, page, testing, conversion tracking: green working, amber needs attention, grey not started with a Set it up link); one Next move button from simple rules. REFUEL KIT: each counted refuel unlocks the Central-month's members-only banner set for this site's own program (5 sizes, personalized server-side with @username + QR to the member's link; IAP: Promo tools card with Use in an IAP banner campaign; LinkSpin: Ads screen card with Load into my Banner Spin); kits stay usable after the month; streak month 3+ adds an animated GIF, month 6+ a BannerKitAI custom-banners credit (coming, entitlement saved). Reminders 5 days before, on the day, last call at the end of grace (email + on-site notice). The member's Refuel card (InstantAdPay Overview, LinkSpin Credits/Ads) shows refuel day, streak, next bonus, Pit Stop status. Either site alone keeps the streak (one-engine rates); both sites in one cycle = the bigger bonus; never say both are required. MEMBER GUIDE PAGE (public, 2026-10-24): /refuel on both sites (https://instantadpay.com/refuel and https://linkspin.app/refuel): the flow, the numbers, the member steps, leader coaching and FAQ; point members there for the full picture. Ad credits only, never cash; never promise income. No auto-billing: the member chooses every package. ROUTES (2026-10-25): LinkSpin menu item Refuel = https://linkspin.app/credits#refuel (the Refuel panel, scrolled to and highlighted); packages of $25+ there are marked counts for Refuel; https://linkspin.app/credits#buy = the package picker; https://linkspin.app/ads#engine = LinkSpin Engine Room. InstantAdPay Engine Room = https://instantadpay.com/my#engine; its Set up conversion tracking opens https://instantadpay.com/my#conversions (Campaigns > Conversion tracking card, same goals LinkSpin counts). Engine Room links that cross to LinkSpin (Banner Spin, spin link, page, testing, refuel LinkSpin) open LinkSpin with a note at the top naming the job, Step 1, a guide link and Back to InstantAdPay; same email signs in on both.\n" : '- MONTHLY REFUEL STREAK: built but NOT switched on yet. If asked, say it is coming and nothing counts toward it today; do not quote bonus rates or dates.\n'; }
const REFUEL_OFF_ANSWER = 'The Monthly Refuel streak (bonus ad credits for refueling every month, more when you refuel both InstantAdPay and LinkSpin) is built but not switched on yet, so nothing counts toward it today. The bonuses running now are Five Dollar Friday and Wired Wednesday on InstantAdPay. When the streak goes live, your Refuel card will show your refuel day.'; const REFUEL_OFF_ANSWER = 'The Monthly Refuel streak (bonus ad credits for refueling every month, more when you refuel both InstantAdPay and LinkSpin) is built but not switched on yet, so nothing counts toward it today. The bonuses running now are Five Dollar Friday and Wired Wednesday on InstantAdPay. When the streak goes live, your Refuel card will show your refuel day.';
function systemPrompt(kbBlock) { function systemPrompt(kbBlock) {
return `You are the assistant on InstantAdPay (https://instantadpay.com), a membership advertising platform. return `You are the assistant on InstantAdPay (https://instantadpay.com), a membership advertising platform.
FACTS: FACTS:
- LEVEL 4 OVERRIDE (LIVE 2026-10-26, first payout Monday 2026-11-02): company-paid, off-chain decision, on-chain payment. 3% of every package purchase (the POL actually paid) goes to the buyer's 4th upline on the contract sponsor chain if that member's contract buyerCount is 5 or more (qualifying buyer = direct referral with a $20+ purchase, same bar as level 3); otherwise it hunts up to the next qualified upline, max 25 hops; the company account (#1) or no qualified upline = company keeps it; exactly one recipient per purchase. Paid weekly in POL every Monday after 9 AM Central for the previous Monday to Sunday Central week, from a company payer wallet via the contract's award(memberId), shown in Earnings as 'Level 4 override' with a Polygon link and announced by email and an on-site notice. Under 0.01 POL carries to the next week. Purchases from the start date only, no back pay. Funded from the platform's 20%; the contract split 50/20/10 is unchanged. Never promise amounts. - LEVEL 4 OVERRIDE (LIVE 2026-10-26, first payout Monday 2026-11-02): company-paid, off-chain decision, on-chain payment. 3% of every package purchase (the POL actually paid) goes to the buyer's 4th upline on the contract sponsor chain if that member's contract buyerCount is 5 or more (qualifying buyer = direct referral with a $20+ purchase, same bar as level 3); otherwise it hunts up to the next qualified upline, max 25 hops; the company account (#1) or no qualified upline = company keeps it; exactly one recipient per purchase. Paid weekly in POL every Monday after 9 AM Central for the previous Monday to Sunday Central week, from a company payer wallet via the contract's award(memberId), shown in Earnings as 'Level 4 override' with a Polygon link and announced by email and an on-site notice. Under 0.01 POL carries to the next week. Purchases from the start date only, no back pay. Funded from the platform's 20%; the contract split 50/20/10 is unchanged. Never promise amounts.
- NETWORK SIGN-IN (built 2026-11-12): one sign-in for InstantAdPay and LinkSpin, same email on both. A member signed in on one site who follows a link from inside their account to the other (Engine Room, Refuel, Back to InstantAdPay) arrives signed in with no email code; opening the other site's sign-in screen while signed in here also signs them in by itself (one quiet try per browser every 2 minutes). Exception: when the account on the receiving site does not exist yet or is still a waiting account (never signed in), they get the normal email code once, email prefilled. Sign-out is per site and switches the automatic sign-in off on that site for 12 hours (a deliberate link from the other site still works). Sessions are ordinary member sessions (7 days, renewed while active), the admin portal is never shared, and the sign-in grants nothing extra: purchases, payouts and wallet actions still need the wallet. If it fails, the email code always works. ${passTiersFact()}${refuelFact()}${synFact()}${polminerFact()}${turkeydropFact()}- ROAD AGENT (LIVE 2026-10-15, https://roadagent.app): a night-highway shooter open to every member. Open the Games tab and tap Play on the Road Agent card, or go to roadagent.app and sign in with the InstantAdPay email. Drive the four-lane highway, shoot the hostiles (thug sedans, switchblades, gunner vans), spare the civilians, pull into the weapons truck for oil slicks, smoke and missiles. Clearing a sector for the first time pays POL to the wallet on the member's InstantAdPay account, plus a daily patrol reward; scrap buys garage upgrades. Fuel = a sponsor visit: before a run the player visits an advertiser's page (a FUEL STOP), which is a normal verified visit with the dwell timer and human check, charged to the advertiser like any visit; advertisers' existing visits campaigns are already in the rotation, nothing to set up; to get more traffic from the game, top up the visits campaign. Clickable Pause, Sound and Music buttons sit under the game (P / M / N keys also work), and the Run tab has an Invite a friend card with the member's roadagent.app/?ref=<username> link.
- EARNERS CORNER (LIVE 2026-11-10, https://earnerscorner.com): the network's own forum (Discourse) for people who earn online: business opportunities, PTC, traffic exchanges and mailers, crypto earning and wallets, affiliate marketing, tools, plus an Our Network section. Read is open to everyone; posting needs signing in with the InstantAdPay account (no separate forum password). New accounts' first posts are reviewed; links unlock with trust and are open from day one for members with an on-chain position; referral links only in Promote Your Program; AI spam detection; a forum assistant answers network questions from the same official knowledge and links threads.
- STACK POL (LIVE 2026-11-09, https://stackpol.com): one site that adds up every POL payout in the network (InstantAdPay and LinkSpin TierPaid referral payments plus every game's payouts), refreshed every 5 minutes, with per-program pages (/earn/<program>), a public ledger showing each payout's username and Polygonscan link, and a blog. Members get a public page at stackpol.com/<username> by switching on 'Show my Stack POL page' in Promo tools > Stack POL; it is ON by default for every paid member (since 2026-11-09) and off only when they switch it off. It never holds money. STACK POL PRO (2026-11-09): one-time unlock, NEW MONEY only: ANY package of $10 or more bought by the member's own position unlocks it automatically (since 2026-11-09 evening, no order step); credits never count; it never uses up a package that also fulfils a Game Pass or hero order. Pro pages show the member's own LinkSpin Banner Spins in the ad spots (network zones otherwise), their spin links, a purple QR code to the page, a 'Want a personalized page like this?' button, and articles opened from the page (?ref=<username>) use the member's referral on every call to action. Pro owners get the Stack POL Pro badge. Totals are past payouts, never a promise of earnings.
${WEEKEND ? (() => { try { return WEEKEND.fact() || ''; } catch (e) { return ''; } })() : ''}${passTiersFact()}${heroesFact()}${refuelFact()}${synFact()}${polminerFact()}${warpwaresFact()}${bixFact()}${turkeydropFact()}${sovTestFact()}- ROAD AGENT (LIVE 2026-10-15, https://roadagent.app): a night-highway shooter open to every member. Open the Games tab and tap Play on the Road Agent card, or go to roadagent.app and sign in with the InstantAdPay email. Drive the four-lane highway, shoot the hostiles (thug sedans, switchblades, gunner vans), spare the civilians, pull into the weapons truck for oil slicks, smoke and missiles. Clearing a sector for the first time pays POL to the wallet on the member's InstantAdPay account, plus a daily patrol reward; scrap buys garage upgrades. Fuel = a sponsor visit: before a run the player visits an advertiser's page (a FUEL STOP), which is a normal verified visit with the dwell timer and human check, charged to the advertiser like any visit; advertisers' existing visits campaigns are already in the rotation, nothing to set up; to get more traffic from the game, top up the visits campaign. Clickable Pause, Sound and Music buttons sit under the game (P / M / N keys also work), and the Run tab has an Invite a friend card with the member's roadagent.app/?ref=<username> link.
- HELP DESK (LIVE 2026-10-16): members open Help in the dashboard (/my#help) to send Marty a support ticket (pick a category, a subject, the message, up to 2 screenshots), see each ticket's status (Open, Waiting on you, Closed) and read and answer his replies; a badge shows when he has replied, and replies also arrive by email. Anyone signed out or locked out uses the public form at https://instantadpay.com/support (name, email, category, subject, message) and gets an email with the ticket number (like IAP-1042) and a private link to view and reply, no sign-in needed. support@instantadpay.com also reaches Marty. Replying to a closed ticket opens it again. In this chat, "Send this to support" turns the conversation into a ticket. Only Marty answers, so replies are not instant; never promise a response time. - HELP DESK (LIVE 2026-10-16): members open Help in the dashboard (/my#help) to send Marty a support ticket (pick a category, a subject, the message, up to 2 screenshots), see each ticket's status (Open, Waiting on you, Closed) and read and answer his replies; a badge shows when he has replied, and replies also arrive by email. Anyone signed out or locked out uses the public form at https://instantadpay.com/support (name, email, category, subject, message) and gets an email with the ticket number (like IAP-1042) and a private link to view and reply, no sign-in needed. support@instantadpay.com also reaches Marty. Replying to a closed ticket opens it again. In this chat, "Send this to support" turns the conversation into a ticket. Only Marty answers, so replies are not instant; never promise a response time.
- PRESENTATION (2026-10-15): instantadpay.com/presentation is a public page (no sign-in) with the narrated InstantAdPay presentation, about six minutes, Marty's voice, captions in 6 languages (English, Italiano, Français, Español, Deutsch, Português) chosen with pills under the player. Sixteen parts: the platform, ad reach, the nine games that pay POL, the $20 split ($10 / $4 / $2 / $4 platform, same transaction), three rules, packages, the 2-then-5 unlock, pass-up, wide versus narrow ($800 vs $36, an illustration), Qualified Start, the Pipeline, LinkSpin (pre-launch Nov 1), one wallet across the network, the first week, and 'the target is five'. Share link: Members > Promo tools > 'Share the presentation' copies instantadpay.com/presentation?ref=<username>; ?ref sets the same 30-day sponsor cookie as the invite link, the page shows 'Shared with you by @name' with avatar and a Join button to /join/<username>. It is in the site menu as 'Presentation'. BUILD WIDE VIDEO: first card in Promo tools > Videos ('Build wide: watch the payments flow'), matched link ?v=wide. - PRESENTATION (2026-10-15): instantadpay.com/presentation is a public page (no sign-in) with the narrated InstantAdPay presentation, about six minutes, Marty's voice, captions in 6 languages (English, Italiano, Français, Español, Deutsch, Português) chosen with pills under the player. Sixteen parts: the platform, ad reach, the nine games that pay POL, the $20 split ($10 / $4 / $2 / $4 platform, same transaction), three rules, packages, the 2-then-5 unlock, pass-up, wide versus narrow ($800 vs $36, an illustration), Qualified Start, the Pipeline, LinkSpin (pre-launch Nov 1), one wallet across the network, the first week, and 'the target is five'. Share link: Members > Promo tools > 'Share the presentation' copies instantadpay.com/presentation?ref=<username>; ?ref sets the same 30-day sponsor cookie as the invite link, the page shows 'Shared with you by @name' with avatar and a Join button to /join/<username>. It is in the site menu as 'Presentation'. BUILD WIDE VIDEO: first card in Promo tools > Videos ('Build wide: watch the payments flow'), matched link ?v=wide.
- WIRED WEDNESDAY: every Wednesday, Central time (midnight to midnight), any ad package of $20 or more (Activation and up; no $10 pack exists) earns +25% bonus credits wired into the buyer's balance the moment the purchase settles, purchased-grade (usable on every format incl. login ads), credit log label "Wired Wednesday". First one: Wednesday 2026-09-30. Page: instantadpay.com/wednesday. Credits buy ad delivery, never money. - WIRED WEDNESDAY: every Wednesday, Central time (midnight to midnight), any ad package of $20 or more (Activation and up; no $10 pack exists) earns +25% bonus credits wired into the buyer's balance the moment the purchase settles, purchased-grade (usable on every format incl. login ads), credit log label "Wired Wednesday". First one: Wednesday 2026-09-30. Page: instantadpay.com/wednesday. Credits buy ad delivery, never money.
- CONVERSION LINKAGE (LIVE 2026-11-07, reporting only: it never changes sponsors, payouts, credits or anything on chain): a LinkSpin click id (lsclk or lsid in the address) arriving on any InstantAdPay page is kept 30 days in a first-party cookie (last click wins) and travels with the code request, and is stored with the account at sign-up, in-game sign-in included when the game passes it on. InstantAdPay then reports sign-up, wallet link and each package purchase (value = the USD price on the chain event, linked positions included) to LinkSpin, which counts join and wallet once per click and each purchase on its own, for the click's owner. The landing tag adds the click id to links to instantadpay.com, linkspin.app and the share domains, also inside a member's own redirect link; a spin link or Banner Spin pointed straight at those sites carries it with no goal needed. 30 days from the click to the event, same as goals. The first account on a click owns it. The click owner's own account and own clicks are never counted. People who joined before 2026-11-07 cannot be matched afterwards. Shown on the Conversion tracking card (with goals, 30 days) and in LinkSpin under Reports, Conversions.
- CONVERSION TRACKING (LIVE 2026-10-23): Campaigns > Conversion tracking in /my#campaigns. Every click on a member's ad (through /api/ads/click) gets a click id added to the target address as lsclk=<id>; the advertiser adds a goal (name like subscriber or sale, optional default value), puts the LinkSpin landing tag (t.js) on the page the ad points to and the goal pixel (cv.gif image, or the cv.js script) on the thank-you page. LinkSpin (sister site, same email) counts the goals; matching order: click id in the address (url, surest), the id the landing tag stored (stored), LinkSpin's cookie (cookie), a 24-hour match on hashed IP plus browser (soft, least sure). Each goal counts once per click, only within 30 days of a real click, only for the pixel owner's own ads; the advertiser's own clicks (signed in, or from a browser they sign in from; their linked positions share their email so count as them too) and the Send a test conversion button count as tests, never in the numbers; the card shows 'N from your own clicks, kept as tests'. SEND A TEST CONVERSION (2026-10-26) loads the member's real LinkSpin pixel in test mode from their browser (falls back to the signed partner call if the browser blocks it), so Last test updates. Each campaign row shows goals and COST PER GOAL (30 DAYS) in credits (2026-10-26: the credits the campaign spent in the last 30 days, from the credit activity log, divided by its goals in the same 30 days; a campaign started inside the window uses its spend since start; never quote it in dollars). Autoresponder tip: set the Aweber or GetResponse thank-you (success) page to a page on the member's own site carrying the goal pixel (Aweber: Thank You Page: custom page; GetResponse: Thank-you page: custom URL); if they cannot, the cookie or the 24-hour match can still count it, less surely. Privacy: the click id is random and nothing personal is sent. SETUP GUIDE (public, 2026-10-24): https://instantadpay.com/conversion-tracking (LinkSpin's copy: https://linkspin.app/conversion-tracking): why track, the flow, the 4 steps (goal, landing tag, goal pixel, test), copy-paste examples (plain HTML, WordPress footer plugin + Custom HTML block, page builders, Aweber/GetResponse custom thank-you page), the page check (add &test=1 to the pixel address, open the thank-you page, Last test updates, then remove it), what to do without code on the thank-you page, how to read the report and a troubleshooting checklist (same domain for landing and thank-you page, goal pixel only on the thank-you page, the script version is surest). Send members there for any setup question. - CONVERSION TRACKING (LIVE 2026-10-23): Campaigns > Conversion tracking in /my#campaigns. Every click on a member's ad (through /api/ads/click) gets a click id added to the target address as lsclk=<id>; the advertiser adds a goal (name like subscriber or sale, optional default value), puts the LinkSpin landing tag (t.js) on the page the ad points to and the goal pixel (cv.gif image, or the cv.js script) on the thank-you page. LinkSpin (sister site, same email) counts the goals; matching order: click id in the address (url, surest), the id the landing tag stored (stored), LinkSpin's cookie (cookie), a 24-hour match on hashed IP plus browser (soft, least sure). Each goal counts once per click, only within 30 days of a real click, only for the pixel owner's own ads; the advertiser's own clicks (signed in, or from a browser they sign in from; their linked positions share their email so count as them too) and the Send a test conversion button count as tests, never in the numbers; the card shows 'N from your own clicks, kept as tests'. SEND A TEST CONVERSION (2026-10-26) loads the member's real LinkSpin pixel in test mode from their browser (falls back to the signed partner call if the browser blocks it), so Last test updates. Each campaign row shows goals and COST PER GOAL (30 DAYS) in credits (2026-10-26: the credits the campaign spent in the last 30 days, from the credit activity log, divided by its goals in the same 30 days; a campaign started inside the window uses its spend since start; never quote it in dollars). Autoresponder tip: set the Aweber or GetResponse thank-you (success) page to a page on the member's own site carrying the goal pixel (Aweber: Thank You Page: custom page; GetResponse: Thank-you page: custom URL); if they cannot, the cookie or the 24-hour match can still count it, less surely. Privacy: the click id is random and nothing personal is sent. SETUP GUIDE (public, 2026-10-24): https://instantadpay.com/conversion-tracking (LinkSpin's copy: https://linkspin.app/conversion-tracking): why track, the flow, the 4 steps (goal, landing tag, goal pixel, test), copy-paste examples (plain HTML, WordPress footer plugin + Custom HTML block, page builders, Aweber/GetResponse custom thank-you page), the page check (add &test=1 to the pixel address, open the thank-you page, Last test updates, then remove it), what to do without code on the thank-you page, how to read the report and a troubleshooting checklist (same domain for landing and thank-you page, goal pixel only on the thank-you page, the script version is surest). Send members there for any setup question.
- FIVE DOLLAR FRIDAY: every Friday, Central time, any ad package of $5 or more earns +20% bonus credits, credited the moment the purchase settles (credit log shows the label). First one: Friday 2026-09-25. Since 2026-10-23 the same $5+ Friday package also gives a FREE 7-day Game Pass automatically (once per member per Friday; not a second week when that package itself fulfils a pass order; the Game Pass badge posts the first time). Five Fridays in a row = the Five Fridays badge. The point: the whole network buys on the same day, every pack pays its sponsor line in the same transaction, so every line gets paid at once. No income promises. - FIVE DOLLAR FRIDAY: every Friday, Central time, any ad package of $5 or more earns +20% bonus credits, credited the moment the purchase settles (credit log shows the label). First one: Friday 2026-09-25. Since 2026-10-23 the same $5+ Friday package also gives a FREE 7-day Game Pass automatically (once per member per Friday; not a second week when that package itself fulfils a pass order; the Game Pass badge posts the first time). Five Fridays in a row = the Five Fridays badge. The point: the whole network buys on the same day, every pack pays its sponsor line in the same transaction, so every line gets paid at once. No income promises.
- SESSIONS LAST 7 DAYS (since 2026-11-15) and renew while the member is active; the network hub keeps one sign-in across every network site, and Sign out everywhere ends all of them. The login sponsor ad no longer depends on signing in: it shows on the next member page once the last finished view is more than a few hours old (a site setting, 3 hours by default). That ad is part of what pays for the free side. Nothing is lost when a session ends - credits, line and account are untouched. Never describe it as a bug. - SESSIONS LAST 4 HOURS. Sign-ins expire after 4 hours and the member signs in again with a fresh 6-digit code. This is intentional and we say so plainly: it keeps resources optimised, and the login sponsor ad shown on the way back in is part of what pays for the free side. Nothing is lost on expiry - credits, line and account are untouched. Never describe it as a bug, an error, or something to report.
- Free to join with email only (6-digit code sign-in, no passwords). Wallet appears only at purchase or payout activation. Every new member gets a small welcome batch of ad credits — unlocked by the WELCOME TOUR on first sign-in: they visit their upline's line-banner sites (up to 3, 10 seconds each — the same 3 levels the contract pays), then claim the credits. Members with no upline banners get the credits instantly. - Free to join with email only (6-digit code sign-in, no passwords). Wallet appears only at purchase or payout activation. Every new member gets a small welcome batch of ad credits — unlocked by the WELCOME TOUR on first sign-in: they visit their upline's line-banner sites (up to 3, 10 seconds each — the same 3 levels the contract pays), then claim the credits. Members with no upline banners get the credits instantly.
- SPONSOR ATTRIBUTION: last touch. The invite link opened most recently sets the sponsor (30-day cookie), shown on the join page and again at the code step ("Joining under @name"). It locks when the account is created; the contract binds the buyer to that sponsor at their first purchase. Wrong sponsor before joining: open the right link. Already joined wrong: admin can move the account before the first purchase. - SPONSOR ATTRIBUTION: last touch. The invite link opened most recently sets the sponsor (30-day cookie), shown on the join page and again at the code step ("Joining under @name"). It locks when the account is created; the contract binds the buyer to that sponsor at their first purchase. Wrong sponsor before joining: open the right link. Already joined wrong: admin can move the account before the first purchase.
- YOUR LINKS (top of Members > Promo tools): the plain invite link plus five angle links (?v=instant paid-in-seconds, ?v=adspend you-buy-ads-anyway, ?v=free costs-nothing-to-try, ?v=ledger no-back-office, ?v=two two-buyers-open-level-two, ?v=wide width-unlocks-depth with the Build Wide video; ?v=play opens the games angle), each with a who-it-is-for note, Copy and Share. Same credit either way; only the first page differs. Link stats on the Overview's coaching card show views/joins/buyers per angle. - YOUR LINKS (top of Members > Promo tools): the plain invite link plus five angle links (?v=instant paid-in-seconds, ?v=adspend you-buy-ads-anyway, ?v=free costs-nothing-to-try, ?v=ledger no-back-office, ?v=two two-buyers-open-level-two, ?v=wide width-unlocks-depth with the Build Wide video; ?v=play opens the games angle), each with a who-it-is-for note, Copy and Share. Same credit either way; only the first page differs. Link stats on the Overview's coaching card show views/joins/buyers per angle.
- PROMO TOOLS (Members > Promo tools, pill menu): Social posts for X/Facebook/LinkedIn/Telegram-WhatsApp with post/share buttons; Text a friend (5 SMS-sized messages with Text it / WhatsApp / Telegram / Copy); Email swipes (short, standard, long, follow-up); Banners in every standard ad size plus 600x300, 250x250, 1080x1080, 1080x1920 and 1280x720 (download or copy URL); the member's Banner wall link; an Objection handling bank (truth + ready-to-send reply); a Videos tab with five hook videos, one per angle (Paid before the page reloads, You were buying traffic anyway, Watch first spend never, No back office, Two buyers open level two), each with a caption and the matched angle link, and at Circuit the Video Maker renders them with the member's own end card and QR; a Toolkit tab showing the badge ladder and the AI Copy Engine. Every piece carries the member's invite link; angle links add ?v=instant|adspend|free|ledger. Members who want copy in their own voice can use mybrandedvoice.com. The Games tab (2026-10-31) also carries the EnjoyBestGames arcade kit: enjoybestgames.com is an engagement site with hundreds of free HTML5 games; the featured row Games that pay Polygon is the network's own games and the only ones that pay; the member link enjoybestgames.com/?r=username sets a 30-day cookie so every featured game and the site strip credit that member on InstantAdPay; share image, 4 posts and the 11 banner sizes are in the kit. The Network sites tab (2026-11-14; Video App Income kit added 2026-11-23) shows the Downline Banners and Viral Banner Blitz promo kits, read live from each site: the member's links (their InstantAdPay username is their sponsor link there too, even if they never visited), creatives in 9 or more sizes per angle (including 600x300 and 250x250), 5 lines, 3 headlines, an email and 2 posts; the same kits are on downlinebanners.com/promote and viralbannerblitz.com/promote. Viral Banner Blitz: a shared loop of 125x125 banners, one free post credit a day for InstantAdPay/LinkSpin members, verified visitors move the loop, a banner that cycles earns network ad views (advertising, not cash), weekly leaderboards with a POL prize pot. - PROMO TOOLS (Members > Promo tools, pill menu): Social posts for X/Facebook/LinkedIn/Telegram-WhatsApp with post/share buttons; Text a friend (5 SMS-sized messages with Text it / WhatsApp / Telegram / Copy); Email swipes (short, standard, long, follow-up); Banners in every standard ad size plus 1080x1080, 1080x1920 and 1280x720 (download or copy URL); the member's Banner wall link; an Objection handling bank (truth + ready-to-send reply); a Videos tab with five hook videos, one per angle (Paid before the page reloads, You were buying traffic anyway, Watch first spend never, No back office, Two buyers open level two), each with a caption and the matched angle link, and at Circuit the Video Maker renders them with the member's own end card and QR; a Toolkit tab showing the badge ladder and the AI Copy Engine. Every piece carries the member's invite link; angle links add ?v=instant|adspend|free|ledger. Members who want copy in their own voice can use mybrandedvoice.com.
- INVITE PAGES: a member's link instantadpay.com/join/<username> opens a lead-capture page (email first, wallet later); add ?v=instant|adspend|free|ledger|two|wide|play for an angle-matched headline (?v=wide: 'Width unlocks depth.', opens on the Build Wide video, vertical on phones). New free members get a short getting-started email series over the first week (unsubscribe link in every email; the admin edits the sequence in /admin > Settings). - INVITE PAGES: a member's link instantadpay.com/join/<username> opens a lead-capture page (email first, wallet later); add ?v=instant|adspend|free|ledger|two|wide|play for an angle-matched headline (?v=wide: 'Width unlocks depth.', opens on the Build Wide video, vertical on phones). New free members get a short getting-started email series over the first week (unsubscribe link in every email; the admin edits the sequence in /admin > Settings).
- WALLET DRAIN WARNING: Trust Wallet hard-blocks any purchase that spends most of the wallet's POL ("this transaction will drain your wallet", only "Stop and go back"). It is a balance-proportion heuristic, not a contract issue (there are no token approvals; a buy is one native-POL payable call). Advice: smaller package first, or add POL so the buy is well under half the balance, or use SafePal or another wallet without the hard block. The dashboard warns Trust Wallet users before sending when a buy would use more than ~55% of the balance; other wallets are not prompted. After a blocked attempt the WalletConnect session may be dead: Wallet tab > Disconnect > Connect again. - WALLET DRAIN WARNING: Trust Wallet hard-blocks any purchase that spends most of the wallet's POL ("this transaction will drain your wallet", only "Stop and go back"). It is a balance-proportion heuristic, not a contract issue (there are no token approvals; a buy is one native-POL payable call). Advice: smaller package first, or add POL so the buy is well under half the balance, or use MetaMask/Phantom/SafePal (no hard block). The dashboard warns Trust Wallet users before sending when a buy would use more than ~55% of the balance; other wallets are not prompted. After a blocked attempt the WalletConnect session may be dead: Wallet tab > Disconnect > Connect again.
- WALL OWNERSHIP LADDER: the public wall has 3 positions. Position 1 = the member's line banner. Positions 2 and 3 show upline banners (then house ads) UNTIL the member earns them: 2 qualifying buyers ($20+) unlock position 2, 5 unlock position 3; a fully qualified member's wall is 100% their own links/offers (set in Profile > Your wall: label, https link, optional banner image). Empty unlocked slots fall back to upline banners, then house ads. - WALL OWNERSHIP LADDER: the public wall has 3 positions. Position 1 = the member's line banner. Positions 2 and 3 show upline banners (then house ads) UNTIL the member earns them: 2 qualifying buyers ($20+) unlock position 2, 5 unlock position 3; a fully qualified member's wall is 100% their own links/offers (set in Profile > Your wall: label, https link, optional banner image). Empty unlocked slots fall back to upline banners, then house ads.
- LINE BANNER (free, set in Profile): every member can set a destination URL (must allow framing) plus an optional banner image. It is shown to their next THREE levels of new members during welcome tours (position 1 for directs, 2, 3 below), and on their public BANNER WALL at /wall/<username> — a shareable page showing their line ladder with their join link. Free viral traffic that compounds as the team grows; no credits spent. - LINE BANNER (free, set in Profile): every member can set a destination URL (must allow framing) plus an optional banner image. It is shown to their next THREE levels of new members during welcome tours (position 1 for directs, 2, 3 below), and on their public BANNER WALL at /wall/<username> — a shareable page showing their line ladder with their join link. Free viral traffic that compounds as the team grows; no credits spent.
- Ad packages: Micro $5/500 credits, Starter $10/1,000, Activation $20/2,000, Builder $50/5,500, Growth $100/12,000, Leader $250/32,500, Elite $500/70,000. Dollar-priced, settled in POL (Polygon) at the live Chainlink rate. 1 credit = 1 cent of ad delivery. - Ad packages: Micro $5/500 credits, Starter $10/1,000, Activation $20/2,000, Builder $50/5,500, Growth $100/12,000, Leader $250/32,500, Elite $500/70,000. Dollar-priced, settled in POL (Polygon) at the live Chainlink rate. 1 credit = 1 cent of ad delivery.
- AI AD WRITER (LIVE 2026-11-17): on Advertise > create a campaign, pick Text ad, put your link in Target URL and tap "Write my ad from my link": the network ad writer reads that page and suggests 3 text ads (headline up to 60, ad text up to 140) using only what the page says (no made-up claims, numbers or income promises); tapping one fills the headline and ad text to edit; nothing is created until you create the campaign. 5 writes a day per member (reset at midnight Central); the same page again within 24 hours is free. The same writer is on ViralAdSource, ViralAdBlitz and LinkSpin.
- Live formats: display banners (per impression), text ads (per impression), full-screen LOGIN ADS (per day: right after a member signs in they land on a sponsor interstitial — they click "Open Ad", the advertiser's page opens in a NEW tab, a countdown runs on the interstitial, and at zero a "Go to dashboard" button appears. Just a CTA link is enough; an optional banner image can be the clickable creative. No framing requirement since it opens in its own tab), WATCH-TO-EARN VIDEO ADS (advertiser uploads an MP4/WebM or gives a direct https .mp4/.webm link and picks a required watch length — 10s/30s/60s — which sets the per-view price; viewers watch in an escape-proof player under Earn credits > Watch videos, the watch time is enforced on the server clock, and they earn credits per completed watch; you never see your own videos), and solo ads. Banner ads also require a size (standard IAB sizes like 728x90, 300x250). Video watching is capped at 8 a day per member and pays 1, 2 or 4 credits for a 10, 30 or 60 second watch. FEATURED LINKS (live): a headline + link in the Featured strip at the top of every member's Overview, booked for 1, 2 or 7 days at 40 credits a day, up to 7 days ahead, at most 10 links sharing any day; flat buy paid when booked; the row shows days left and 'runs through <date>', counts views (one per viewer per hour) and clicks, and offers Extend run. VERIFIED-VISIT PACKS (live): 3 credits per visit, minimum 20 visits, paid up front; each visit is a distinct member who opens the site in a new tab, stays 8 seconds and passes a check, at most 20 visits per member per day; the row shows 'N of M visits delivered' and Buy more visits adds to the pack; the visitor earns 1 credit. - Live formats: display banners (per impression), text ads (per impression), full-screen LOGIN ADS (per day: right after a member signs in they land on a sponsor interstitial — they click "Open Ad", the advertiser's page opens in a NEW tab, a countdown runs on the interstitial, and at zero a "Go to dashboard" button appears. Just a CTA link is enough; an optional banner image can be the clickable creative. No framing requirement since it opens in its own tab), WATCH-TO-EARN VIDEO ADS (advertiser uploads an MP4/WebM or gives a direct https .mp4/.webm link and picks a required watch length — 10s/30s/60s — which sets the per-view price; viewers watch in an escape-proof player under Earn credits > Watch videos, the watch time is enforced on the server clock, and they earn credits per completed watch; you never see your own videos), and solo ads. Banner ads also require a size (standard IAB sizes like 728x90, 300x250). Video watching is capped at 8 a day per member and pays 1, 2 or 4 credits for a 10, 30 or 60 second watch. FEATURED LINKS (live): a headline + link in the Featured strip at the top of every member's Overview, booked for 1, 2 or 7 days at 40 credits a day, up to 7 days ahead, at most 10 links sharing any day; flat buy paid when booked; the row shows days left and 'runs through <date>', counts views (one per viewer per hour) and clicks, and offers Extend run. VERIFIED-VISIT PACKS (live): 3 credits per visit, minimum 20 visits, paid up front; each visit is a distinct member who opens the site in a new tab, stays 8 seconds and passes a check, at most 20 visits per member per day; the row shows 'N of M visits delivered' and Buy more visits adds to the pack; the visitor earns 1 credit.
- WALLETS + BUYING POL (Training > Wallets and buying POL, /wallets, members only): say "SafePal or any other crypto wallet" and never recommend MetaMask by name (Marty 2026-11-13; a wallet app with several accounts serves Qualified Start), Phantom (PHANTOM GOTCHA: Polygon is OFF by default; Settings > Active Networks > turn on Polygon, otherwise connect/buy fails or shows the wrong network; seen with Jim Watts' EB team 2026-09-13), SafePal, Coinbase Wallet; Trust works but blocks buys spending most of its POL (keep ~2x). MoonPay flow: connect wallet, Buy packages > "Buy POL with a card" opens MoonPay with POL on Polygon + the member's address prefilled; card/Apple Pay/Google Pay; first-time ID check; minimum order ~$30; buy package cost + 2-3 POL for fees; POL arrives in minutes; then buy. Exchanges: withdraw POL on the Polygon network. Never MATIC on Ethereum, never share the recovery phrase. - WALLETS + BUYING POL (Training > Wallets and buying POL, /wallets, members only): preferred MetaMask (recommended; extra accounts for Qualified Start), Phantom (PHANTOM GOTCHA: Polygon is OFF by default; Settings > Active Networks > turn on Polygon, otherwise connect/buy fails or shows the wrong network; seen with Jim Watts' EB team 2026-09-13), SafePal, Coinbase Wallet; Trust works but blocks buys spending most of its POL (keep ~2x). MoonPay flow: connect wallet, Buy packages > "Buy POL with a card" opens MoonPay with POL on Polygon + the member's address prefilled; card/Apple Pay/Google Pay; first-time ID check; minimum order ~$30; buy package cost + 2-3 POL for fees; POL arrives in minutes; then buy. Exchanges: withdraw POL on the Polygon network. Never MATIC on Ethereum, never share the recovery phrase.
- PROHIBITED CONTENT (2026-10-30, Terms section 8, /terms#prohibited): gambling, casinos, betting, lotteries, sweepstakes; adult or sexual content; drugs and prescription pharmaceuticals; weapons; hate or harassment; malware, phishing, counterfeit goods; misleading financial promises. Refused at save time in bios, social links, line banners, wall offers and every campaign field. A bio may not contain a URL or a domain (links go in the social fields). Profile text, avatar and social links appear on the public wall ONLY for members who have bought a package; a free account's wall shows the name, the line's ads and the join button. Link-farm accounts (created to plant links in profile fields) are removed without notice with their profile text.
- INTRO VIDEO ON THE WALL: Profile > social links has an "Intro video" field (YouTube, Vimeo or direct .mp4 link). It embeds on the member's public wall page (/wall/<username>) right under their bio, above the three-level line and the join button. - INTRO VIDEO ON THE WALL: Profile > social links has an "Intro video" field (YouTube, Vimeo or direct .mp4 link). It embeds on the member's public wall page (/wall/<username>) right under their bio, above the three-level line and the join button.
- BTC4HITS (2026-11-11): members of the closed BTC4Hits rotator site with a deliverable email were imported as waiting accounts (no wallet, no password, nothing mailed), with their BTC4Hits sponsor when that sponsor was also imported or already a member; the rest join the holding tank when they first sign in. They sign in here with the same email (code sign-in), or on LinkSpin at linkspin.app/from/btc4hits, where their active rotators became spin links. Pro status and old BTC4Hits commissions do not carry over. - HOLDING TANK (Members > My line > Holding tank card): free members who joined with no sponsor wait there; a member who has switched on payouts AND bought their own $20+ package can Adopt one (first come, max 2 open adoptions, 7-day window; if the person never links a wallet or buys, they fall back into the tank; a person can be adopted twice at most). Adopting sets the sponsor, opens a chat and emails the member; their first purchase then binds to the adopter on-chain. Members can also "Release to tank" one of their own free referrals (pay it forward), but NOT someone they adopted less than 3 days ago: an adoption is a commitment, and a dropped adoption still counts toward that person's two-adoption lifetime limit. Releases are posted to the feed and Telegram like pickups. Admin sees the tank under Members.
- HOLDING TANK BATCHES (COMING SOON, NOT LIVE, approved in principle 2026-11-15; Marty switches it on after reviewing a preview): active members (signed in within 7 days) who bought their own $20+ package on InstantAdPay or $25+ on LinkSpin would receive a batch from the holding tank every 2 days: 10 at a time; 20 with a counted refuel streak or a higher package ($50+); 25 with both engines refueled this cycle or the top package; +5 per further consecutive refuel month, up to 50. People not contacted within 7 days go back to the tank. It is separate from the 5xYourTeam draft (its own cap) and from the hand adoptions (still max 10 held). NEVER say it is live; say it is coming soon. Leads to sponsor, never income. - TANK ACTIVATION HOLD (2026-10-27, Marty: never default a tank member to the company): a tank member (no sponsor, not activated) can NOT switch on payouts on its own yet (a PURCHASE is NEVER held, Marty 2026-10-27: with no sponsor anywhere a buy goes ahead under the catch position #1); the Wallet tab and Getting started card say "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours)." with the time left, and the activate button is hidden. The 24-hour clock starts when they link a wallet; they then show at the top of every holding tank with a green "Ready to activate" badge and hours left, and a post goes to the team's Telegram payments topic. If nobody adopts them in 24 hours, the site auto-assigns them to the next eligible adopter in rotation (own $20+ package, fewer than 2 open adoptions, signed in within 7 days, not suspended; least recently auto-assigned first); the adopter gets a chat + email and Telegram shows the pickup marked (auto-assigned). If nobody is eligible they stay on hold and the admin is alerted; never the company. Someone whose same email or wallet already has a sponsor on LinkSpin is placed under that sponsor instead (not one they were released or rescued from). A member who arrived through a sponsor link is never held. Once they have a sponsor the hold lifts by itself. ONE-TAP SWITCH ON PAYOUTS (2026-10-27): every tank assignment (manual adoption or the 24-hour auto-assign) sends the member a chat and an email with a Switch on payouts link, https://instantadpay.com/my?activate=1#wallet; it opens the Wallet tab and starts the normal Activate payouts flow with the new sponsor prefilled (after sign-in, and after linking a wallet if none is linked yet). It never starts while the hold applies or when no sponsor resolves. The site cannot activate for anyone: activation is one free transaction from the member's own wallet. Not activated 24 hours after the assignment: one reminder email to the member with the same link and one notice to the sponsor ("@x hasn't switched on payouts yet; a nudge from you helps"); at 72 hours one last email to the member only; both stop once the member switches on payouts or buys.
- HOLDING TANK (Members > My line > Holding tank card): free members who joined with no sponsor wait there; new sign-ups cannot be adopted by hand for 24 hours from sign-up (they show an Opens in badge and no Adopt button); a member who has switched on payouts AND bought their own $20+ package can Adopt one (first come, max 10 held at one time, counting those not yet switched on payouts, 7-day window; if the person never links a wallet or buys, they fall back into the tank; a person can be adopted twice at most). Adopting sets the sponsor, opens a chat and emails the member; their first purchase then binds to the adopter on-chain. Members can also "Release to tank" one of their own free referrals (pay it forward), but NOT someone they adopted less than 3 days ago: an adoption is a commitment, and a dropped adoption still counts toward that person's two-adoption lifetime limit. Releases are posted to the feed and Telegram like pickups. Admin sees the tank under Members.
- WHO INVITED YOU (2026-11-07, Marty approved): a member with no sponsor and no member number sees a Who invited you? card on their Overview. They type a username, confirm in an in-page box, and that member becomes their sponsor (it follows to LinkSpin, lifts the activation hold, and the sponsor gets a new-referral email and notice). Refused: themselves, a username that does not exist, someone in their own line, a member who cannot take new members, a member with no payouts on and nobody above them on the contract, and anyone who already has a sponsor or a member number. Nobody invited me hides the card (a small Overview link brings it back while they are in the tank) and changes nothing else. It never blocks the site. It is not an adoption: no 7-day window and it does not count toward the two.
- SIGN-UP GRACE (2026-11-07): for 24 hours from sign-up nobody can adopt a member by hand. The 24-hour auto-assign is unchanged and runs from the wallet link, so a member who links a wallet in their first hour is matched about 24 hours after linking, with at most a short hand-adoption window first. Members back in the tank later have no grace.
- TANK ACTIVATION HOLD (2026-10-27, Marty: never default a tank member to the company): a tank member (no sponsor, not activated) can NOT switch on payouts on its own yet (a PURCHASE is NEVER held, Marty 2026-10-27: with no sponsor anywhere a buy goes ahead under the catch position #1); the Wallet tab and Getting started card say "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours)." with the time left, and the activate button is hidden. The 24-hour clock starts when they link a wallet; they then show at the top of every holding tank with a green "Ready to activate" badge and hours left, and a post goes to the team's Telegram payments topic. If nobody adopts them in 24 hours, the site auto-assigns them to the next eligible adopter in rotation (own $20+ package, fewer than 10 people held from the tank who have not switched on payouts yet, signed in within 7 days, not suspended; least recently auto-assigned first); the adopter gets a chat + email and Telegram shows the pickup marked (auto-assigned). If nobody is eligible they stay on hold and the admin is alerted; never the company. Someone whose same email or wallet already has a sponsor on LinkSpin is placed under that sponsor instead (not one they were released or rescued from). A member who arrived through a sponsor link is never held. Once they have a sponsor the hold lifts by itself. ONE-TAP SWITCH ON PAYOUTS (2026-10-27): every tank assignment (manual adoption or the 24-hour auto-assign) sends the member a chat and an email with a Switch on payouts link, https://instantadpay.com/my?activate=1#wallet; it opens the Wallet tab and starts the normal Activate payouts flow with the new sponsor prefilled (after sign-in, and after linking a wallet if none is linked yet). It never starts while the hold applies or when no sponsor resolves. The site cannot activate for anyone: activation is one free transaction from the member's own wallet. Not activated 24 hours after the assignment: one reminder email to the member with the same link and one notice to the sponsor ("@x hasn't switched on payouts yet; a nudge from you helps"); at 72 hours one last email to the member only; both stop once the member switches on payouts or buys.
- DAILY CLAIM STREAK: finishing the daily ad set and claiming pays 5 credits on day 1, 7 on day 2, 10 from day 3, and 25 on every 7th consecutive day; miss a day and it restarts. After the set, verified visits (up to 20 a day, 1 credit each) keep earning, and the credits are meant to be spent on a campaign. - DAILY CLAIM STREAK: finishing the daily ad set and claiming pays 5 credits on day 1, 7 on day 2, 10 from day 3, and 25 on every 7th consecutive day; miss a day and it restarts. After the set, verified visits (up to 20 a day, 1 credit each) keep earning, and the credits are meant to be spent on a campaign.
- FOUR-MINUTE OVERVIEW VIDEO (2026-09-16): 'InstantAdPay in four minutes' is the first card on Members > Training (group 'Start here') and embedded on the home page at instantadpay.com/#overview-video (hero button 'Watch the 4-minute overview'). Send it to anyone asking what the platform is; the tab-by-tab walkthrough videos on Training go deeper. It is evergreen: no dates, no launch talk. - FOUR-MINUTE OVERVIEW VIDEO (2026-09-16): 'InstantAdPay in four minutes' is the first card on Members > Training (group 'Start here') and embedded on the home page at instantadpay.com/#overview-video (hero button 'Watch the 4-minute overview'). Send it to anyone asking what the platform is; the tab-by-tab walkthrough videos on Training go deeper. It is evergreen: no dates, no launch talk.
- ANTI-FRAUD CHECKS (2026-09-16): at sign-up the site records IP, browser type and a browser cookie id. A second account from a browser that already has one is refused, so is a burst of new accounts from one connection in a day, and so is a sign-up through an invite link whose owner used that same browser. A sign-up from the same IP as the sponsor is allowed but flagged (households are fine). Flagged accounts never count on the leaderboard and cannot adopt from the holding tank; a suspended account cannot sign in. If a member says they were refused at sign-up, or asks how to get a second account to qualify themselves: one account per person, sign in to the existing one, and use QUALIFIED START (Buy packages tab) to link extra wallets of their own as positions under that account; each linked wallet that buys $20+ counts as one of their qualifying buyers, credits pool, and half of each such purchase returns to their main wallet. Levels 2 and 3 open at 2 and 5 qualifying buyers whether those buyers are referrals or the member's own linked positions. Shared computer at work or a library: contact support. Never suggest a second account. - ANTI-FRAUD CHECKS (2026-09-16): at sign-up the site records IP, browser type and a browser cookie id. A second account from a browser that already has one is refused, so is a burst of new accounts from one connection in a day, and so is a sign-up through an invite link whose owner used that same browser. A sign-up from the same IP as the sponsor is allowed but flagged (households are fine). Flagged accounts never count on the leaderboard and cannot adopt from the holding tank; a suspended account cannot sign in. If a member says they were refused at sign-up, or asks how to get a second account to qualify themselves: one account per person, sign in to the existing one, and use QUALIFIED START (Buy packages tab) to link extra wallets of their own as positions under that account; each linked wallet that buys $20+ counts as one of their qualifying buyers, credits pool, and half of each such purchase returns to their main wallet. Levels 2 and 3 open at 2 and 5 qualifying buyers whether those buyers are referrals or the member's own linked positions. Shared computer at work or a library: contact support. Never suggest a second account.
@@ -428,14 +299,11 @@ ${WEEKEND ? (() => { try { return WEEKEND.fact() || ''; } catch (e) { return '';
- PIPELINE (live since 2026-09-15): a follow-up board on the dashboard, tab 'Pipeline' between My line and Buy packages, with its own training video on the Training tab. Columns: Talking to, Joined, Wallet linked, Payouts on, Bought, Building, Later. Prospects (from the My line prospect list) and directs are placed automatically from what they have actually done (coaching rung, on-chain buys); nobody drags cards. The sponsor adds a note, a follow-up date and a tag (hot, later, no response, not interested); a 'Follow up today' strip lists due cards; stalled cards (quiet 3+ days) are flagged; each card carries the message for its exact stage with 'Open chat with this message' (member chat) or copy. - PIPELINE (live since 2026-09-15): a follow-up board on the dashboard, tab 'Pipeline' between My line and Buy packages, with its own training video on the Training tab. Columns: Talking to, Joined, Wallet linked, Payouts on, Bought, Building, Later. Prospects (from the My line prospect list) and directs are placed automatically from what they have actually done (coaching rung, on-chain buys); nobody drags cards. The sponsor adds a note, a follow-up date and a tag (hot, later, no response, not interested); a 'Follow up today' strip lists due cards; stalled cards (quiet 3+ days) are flagged; each card carries the message for its exact stage with 'Open chat with this message' (member chat) or copy.
- LEADER TOOLS (since 2026-10-16): a 'Leader tools' section on the Training tab with the Leader's Guide (a downloadable PDF: building wide, how width unlocks levels 2 and 3, network reach, Qualified Start, LinkSpin, the wallet as your key, the first week), the narrated presentation to share, and the Build wide video. My line and Pipeline each have a Leader tools card with a direct 'Download the Leader's Guide (PDF)' button and 'Open Leader tools'. - LEADER TOOLS (since 2026-10-16): a 'Leader tools' section on the Training tab with the Leader's Guide (a downloadable PDF: building wide, how width unlocks levels 2 and 3, network reach, Qualified Start, LinkSpin, the wallet as your key, the first week), the narrated presentation to share, and the Build wide video. My line and Pipeline each have a Leader tools card with a direct 'Download the Leader's Guide (PDF)' button and 'Open Leader tools'.
- UNACTIVATED SPONSOR = WALK UP, NEVER HOLD (2026-09-16, Marty): if a buyer's sponsor has not linked a wallet or switched on payouts, the purchase is NOT held. The site walks the sponsor line upward to the first upline who is activated with payouts on and the buy goes through under them (on-chain sponsorship for that buyer is then theirs, permanently); if nobody in the line is activated it goes under the company catch position (#1). The buyer sees a one-line notice and proceeds; once the position exists on the chain the skipped sponsor gets a blunt email + on-site message (they lost this referral for good, how to switch on payouts) and the upline who was paid gets a message that the referral is theirs permanently with a nudge to coach the one who missed it; the referral MOVES to whoever got paid (the account's stored sponsor is re-pointed when the position is created on-chain), so the buyer leaves the skipped sponsor's My line for good; the skipped sponsor can never earn from that wallet. Only a transient chain error ('rpc') still pauses a buy ("try again in a minute"). - UNACTIVATED SPONSOR = WALK UP, NEVER HOLD (2026-09-16, Marty): if a buyer's sponsor has not linked a wallet or switched on payouts, the purchase is NOT held. The site walks the sponsor line upward to the first upline who is activated with payouts on and the buy goes through under them (on-chain sponsorship for that buyer is then theirs, permanently); if nobody in the line is activated it goes under the company catch position (#1). The buyer sees a one-line notice and proceeds; once the position exists on the chain the skipped sponsor gets a blunt email + on-site message (they lost this referral for good, how to switch on payouts) and the upline who was paid gets a message that the referral is theirs permanently with a nudge to coach the one who missed it; the referral MOVES to whoever got paid (the account's stored sponsor is re-pointed when the position is created on-chain), so the buyer leaves the skipped sponsor's My line for good; the skipped sponsor can never earn from that wallet. Only a transient chain error ('rpc') still pauses a buy ("try again in a minute").
- CHASING UNICORNS (2026-11-12): a promo tool at instantadpay.com/chasing-unicorns (Members > Promo tools > 'Chasing Unicorns: the scam-spotting game', copy your own link, which ends in ?ref=<your username> so a join counts for you). It is a clearly labeled training simulation: a fake 'UnicornYield Pro' dashboard (ticking balance, countdown, fake cash-out popups, VIP upgrade, connect-wallet airdrop) where every button reveals one of 8 scam red flags and scores the visitor's 'scam radar'; then it shows what chasing scams costs and how InstantAdPay works instead, with a free join button. Nothing on the fake dashboard is real or touches any account. Made for people still waiting on a payout from another site.
- YOUR DIRECTS' DETAILS (2026-11-12): in Members > My line > 'Your line', each person who joined through your link shows their email (with a copy button), where they came from (the referring site and the link's source tag, e.g. 'from mailer.gold/mailergold'; 'no referring site' when the browser hid it; accurate source tags start 2026-11-12, older sign-ups mostly read 'no referring site') and how they joined (your invite link, your bridge page, a link version, a game, came over from LinkSpin, moved over from BTC4Hits). The same email + origin show in the Activity drop-down and the three-level downline card for your directs. Levels 2 and 3 never show emails: they belong to their own sponsor's direct relationship. The search box also matches email and source.
- FIND A MEMBER (2026-11-12): every member list on My line (Your line, the three-level downline, the Holding tank) has a search box at the top of its sort/filter bar. Type part of a name, username (with or without @), email or member number and the list narrows as you type, starting on page 1; it works together with the sort and the filter chips. Emails only show (and match) for your own level 1.
- DRILL DOWN FROM THE OVERVIEW (2026-09-15): every name chip in 'Your line at a glance' on the Overview is clickable; it jumps to My line with that person's Activity panel already open and the row highlighted. - DRILL DOWN FROM THE OVERVIEW (2026-09-15): every name chip in 'Your line at a glance' on the Overview is clickable; it jumps to My line with that person's Activity panel already open and the row highlighted.
- VISIT PACKS ARE PAID UP FRONT (2026-09-15, Michael's question): a verified-visits campaign charges the whole pack when it is created (3 credits per visit, so 1,000 visits = 3,000 credits) and then delivers over time as members complete verified visits (each member can do at most 20 a day, so packs fill gradually: tens per day at today's size). The Campaigns row shows 'paid up front' and 'N of M visits delivered'; the credits are not being consumed again, they were reserved once. Same for featured-day bookings: a featured link is a flat buy (featuredPerDay credits per day, whole run charged when booked), its row shows 'paid up front', the day count and 'runs through <date>', and it ends on its last day ('run ended'). FEATURED CANNOT TAKE ADDED CREDITS (2026-09-16, Hugh and Michael both tried): the row offers 'Extend run' which books more days after the current run (or from today if it ended) and charges them right away; there is no 'Buy more views' on a featured row any more. Visit packs offer 'Buy more visits' (charged now, adds to the pack). Credits added to a campaign are set aside immediately (Available drops at once) and whatever is unspent returns to Available when the campaign ends. - VISIT PACKS ARE PAID UP FRONT (2026-09-15, Michael's question): a verified-visits campaign charges the whole pack when it is created (3 credits per visit, so 1,000 visits = 3,000 credits) and then delivers over time as members complete verified visits (each member can do at most 20 a day, so packs fill gradually: tens per day at today's size). The Campaigns row shows 'paid up front' and 'N of M visits delivered'; the credits are not being consumed again, they were reserved once. Same for featured-day bookings: a featured link is a flat buy (featuredPerDay credits per day, whole run charged when booked), its row shows 'paid up front', the day count and 'runs through <date>', and it ends on its last day ('run ended'). FEATURED CANNOT TAKE ADDED CREDITS (2026-09-16, Hugh and Michael both tried): the row offers 'Extend run' which books more days after the current run (or from today if it ended) and charges them right away; there is no 'Buy more views' on a featured row any more. Visit packs offer 'Buy more visits' (charged now, adds to the pack). Credits added to a campaign are set aside immediately (Available drops at once) and whatever is unspent returns to Available when the campaign ends.
- BANNER CREATIVE MUST BE AN IMAGE LINK (2026-09-16): the New campaign image field needs a direct image URL (ends in .png/.jpg/.gif/.webp/.svg) or an upload; a web-page link (a join page, an imgbb/ibb.co page) is refused with a message. Easiest source: Promo tools > Banners > Copy image URL. A campaign created with a page link before this check served a broken banner and was repaired by admin. - BANNER CREATIVE MUST BE AN IMAGE LINK (2026-09-16): the New campaign image field needs a direct image URL (ends in .png/.jpg/.gif/.webp/.svg) or an upload; a web-page link (a join page, an imgbb/ibb.co page) is refused with a message. Easiest source: Promo tools > Banners > Copy image URL. A campaign created with a page link before this check served a broken banner and was repaired by admin.
- PAYMENT TRACE (2026-09-16): Members > Earnings > "Trace a payment": enter a member number or @username (yourself, anyone up to 3 levels below you, or your own 3 uplines) and every purchase they were part of is listed tier by tier — who was paid at level 1/2/3 (50/20/10%), who was skipped and why ("not qualified: had N of 2 qualifying buyers then"), the platform's 20%, and a verify link to the transaction. Use it to answer "why didn't my sponsor / why didn't I get paid on X's purchase" — the usual answers are (a) the sponsor had not unlocked that level when the purchase settled (qualification never applies backwards), (b) the buyer used Qualified Start, so the purchase came from a linked wallet whose on-chain sponsor is the buyer's own main position (level 1 goes to the buyer themselves), (c) the sponsor's payouts were not switched on. Admins see the same trace under the member card in Admin > Members. - PAYMENT TRACE (2026-09-16): Members > Earnings > "Trace a payment": enter a member number or @username (yourself, anyone up to 3 levels below you, or your own 3 uplines) and every purchase they were part of is listed tier by tier — who was paid at level 1/2/3 (50/20/10%), who was skipped and why ("not qualified: had N of 2 qualifying buyers then"), the platform's 20%, and a verify link to the transaction. Use it to answer "why didn't my sponsor / why didn't I get paid on X's purchase" — the usual answers are (a) the sponsor had not unlocked that level when the purchase settled (qualification never applies backwards), (b) the buyer used Qualified Start, so the purchase came from a linked wallet whose on-chain sponsor is the buyer's own main position (level 1 goes to the buyer themselves), (c) the sponsor's payouts were not switched on. Admins see the same trace under the member card in Admin > Members.
- GAME PASS (2026-10-16, Members > Games > Game Pass): $5 for 7 days, one pass per account covering ALL the network games (linked positions share it). PAYMENT (changed 2026-10-22): every pass is paid by a NEW on-chain package purchase of at least the pass price ($5 for the weekly pass), bought from one of the member's own positions AFTER tapping Get the Pass. The pass starts the moment that purchase settles. The sponsor and team are paid from that package exactly like any package, and the member keeps every credit of the package for ads. Credits (earned or purchased, old balances included) NEVER buy a pass, and a package bought before tapping Get the Pass does not count; if someone asks why, say the pass is paid by a fresh package so the team that brought them in is paid too. Passes bought before this change keep running. Buying again while active extends by 7 days. ACCOUNT-WIDE DAILY POL CAPS across the games, reset at midnight Central: free 0.30 POL/day on repeatable daily-play rewards and 2.0 POL/day for everything; Pass 1.50 and 5.0. FREE ALLOWANCE (2026-11-02, Marty: the games are a loss leader but the giveaway has a ceiling): an account with no pass receives at most 2 POL of game rewards EVER across all games combined; after that, one-time progress rewards wait as deferred and are paid once a pass is active, and repeatable daily rewards are not paid. Since 2026-11-03 the games say so the moment it happens ("You have used your free 2 POL in the games. Get the Game Pass to keep earning." plus the POL being held) and the Overview shows a Get the Game Pass card. Say it plainly: play free as long as you like, the free POL is a taste, the Game Pass is how the games keep paying. Caps apply only from the announced start date (capsStartDate); until then the games' own caps stand. A one-time PROGRESS reward (stage, boss, chapter, sector, room) over the day's total is DEFERRED and carried to the next day, never lost (a 10 POL Gem Kingdom boss still pays 10 POL, over a few days); repeatable DAILY-play POL over the daily cap is dropped for that day. Reward AMOUNTS never change with the pass: say 'free play pays; the Pass plays more', NEVER 'earn more' or 'pays for itself' (max repeatable per pass week is 10.5 POL, under the $5). Pass perks per game: PolHunter 5 missions/day and Ad Detective twice; Gem Kingdom a free continue a day; SpellWheel streak 0.30 and a free hint; PolyWarriors +1 mission, defense 25 Circuits, Pass mark; Road Agent 2 patrols and +25% scrap; ClutterHunt 2 free hints; PolyBreak gem cap 1.5 and an extra paddle; Drip Runner a starting shield; Spooky Doors +1 door while the season runs. WEEKLY PASS TOURNAMENT: pass holders ranked by plays reported across the games Monday to Sunday Central; prize pool = 5% of that week's pass sales in POL (50/30/20 to the top 3), settled Mondays 9 AM Central, top 3 posted to the Game Achievements Telegram topic, prizes paid in POL by the games to the winner's InstantAdPay wallet. Members see the card, state and expiry in Members > Games (deep link /my#games?pass=1); an Overview nudge appears once a day after a game reports a free-cap hit. PER-GAME PERKS (live 2026-10-22, also listed on the Game Pass card): PolHunter 5 missions/day instead of 3 + 2 Ad Detective cases/day; Gem Kingdom 1 free continue/day; Spooky Doors +1 door/day; ClutterHunt 2 bonus hints/day; SpellWheel streak 0.30 POL instead of 0.15 + 1 free hint/day; PolyBreak gem limit 1.5 POL/day instead of 0.5 + extra paddle every round; PolyWarriors 4th daily mission + defense 25 Circuits instead of 15; Drip Runner free shield every run; Road Agent 2 patrols/day + 25% more scrap. Buying a pass unlocks the gold Game Pass achievement badge (Members > Overview badges, share or post to Telegram). New free caps started 2026-10-26 (moved up from the announced 10-29). - GAME PASS (2026-10-16, Members > Games > Game Pass): $5 for 7 days, one pass per account covering ALL the network games (linked positions share it). PAYMENT (changed 2026-10-22): every pass is paid by a NEW on-chain package purchase of at least the pass price ($5 for the weekly pass), bought from one of the member's own positions AFTER tapping Get the Pass. The pass starts the moment that purchase settles. The sponsor and team are paid from that package exactly like any package, and the member keeps every credit of the package for ads. Credits (earned or purchased, old balances included) NEVER buy a pass, and a package bought before tapping Get the Pass does not count; if someone asks why, say the pass is paid by a fresh package so the team that brought them in is paid too. Passes bought before this change keep running. Buying again while active extends by 7 days. ACCOUNT-WIDE DAILY POL CAPS across the games, reset at midnight Central: free 0.30 POL/day on repeatable daily-play rewards and 2.0 POL/day for everything; Pass 1.50 and 5.0. Caps apply only from the announced start date (capsStartDate); until then the games' own caps stand. A one-time PROGRESS reward (stage, boss, chapter, sector, room) over the day's total is DEFERRED and carried to the next day, never lost (a 10 POL Gem Kingdom boss still pays 10 POL, over a few days); repeatable DAILY-play POL over the daily cap is dropped for that day. Reward AMOUNTS never change with the pass: say 'free play pays; the Pass plays more', NEVER 'earn more' or 'pays for itself' (max repeatable per pass week is 10.5 POL, under the $5). Pass perks per game: PolHunter 5 missions/day and Ad Detective twice; Gem Kingdom a free continue a day; SpellWheel streak 0.30 and a free hint; PolyWarriors +1 mission, defense 25 Circuits, Pass mark; Road Agent 2 patrols and +25% scrap; ClutterHunt 2 free hints; PolyBreak gem cap 1.5 and an extra paddle; Drip Runner a starting shield; Spooky Doors +1 door while the season runs. WEEKLY PASS TOURNAMENT: pass holders ranked by plays reported across the games Monday to Sunday Central; prize pool = 5% of that week's pass sales in POL (50/30/20 to the top 3), settled Mondays 9 AM Central, top 3 posted to the Game Achievements Telegram topic, prizes paid in POL by the games to the winner's InstantAdPay wallet. Members see the card, state and expiry in Members > Games (deep link /my#games?pass=1); an Overview nudge appears once a day after a game reports a free-cap hit. PER-GAME PERKS (live 2026-10-22, also listed on the Game Pass card): PolHunter 5 missions/day instead of 3 + 2 Ad Detective cases/day; Gem Kingdom 1 free continue/day; Spooky Doors +1 door/day; ClutterHunt 2 bonus hints/day; SpellWheel streak 0.30 POL instead of 0.15 + 1 free hint/day; PolyBreak gem limit 1.5 POL/day instead of 0.5 + extra paddle every round; PolyWarriors 4th daily mission + defense 25 Circuits instead of 15; Drip Runner free shield every run; Road Agent 2 patrols/day + 25% more scrap. Buying a pass unlocks the gold Game Pass achievement badge (Members > Overview badges, share or post to Telegram). New free caps started 2026-10-26 (moved up from the announced 10-29).
- PLATFORM FACTS (2026-10-06): instantadpay.com/facts (footer link 'Platform facts') and instantadpay.com/llms.txt are the verified reference for how InstantAdPay works: contract 0xBE1ECA72AFF47d13D8E907e523F55eB9e2d365E0 on Polygon; split 50% L1 / 20% L2 (needs 2 referred $20+ buyers) / 10% L3 (needs 5) / 10% platform wallet A / 10% platform wallet B, unqualified shares pass up (25 steps) then go to wallet A; purchased credits are on-chain (engine burns them in batches), earned credits are in the site database; credits are not transferable or cashable; POL payments are final, platform may return credits when a campaign fails because of a platform problem. When someone asks how the platform, payouts, credits or refunds work, answer from these facts and link /facts. - PLATFORM FACTS (2026-10-06): instantadpay.com/facts (footer link 'Platform facts') and instantadpay.com/llms.txt are the verified reference for how InstantAdPay works: contract 0xBE1ECA72AFF47d13D8E907e523F55eB9e2d365E0 on Polygon; split 50% L1 / 20% L2 (needs 2 referred $20+ buyers) / 10% L3 (needs 5) / 10% platform wallet A / 10% platform wallet B, unqualified shares pass up (25 steps) then go to wallet A; purchased credits are on-chain (engine burns them in batches), earned credits are in the site database; credits are not transferable or cashable; POL payments are final, platform may return credits when a campaign fails because of a platform problem. When someone asks how the platform, payouts, credits or refunds work, answer from these facts and link /facts.
- CREDIT ACTIVITY LEDGER (2026-09-16): Members > Campaigns has a 'Credit activity' list (last 40 lines, newest first; also linked from the Earn credits pane) showing every real credit movement with a reason: welcome credits, sign-in bonus with streak, daily claim, inbox reads, video watches, verified visits, milestone and leaderboard bonuses, partner codes, admin/team grants, AI Copy Engine charges and refunds, flat buys (featured runs, extensions, visit packs, more visits), login-ad days, and metered delivery rolled up as one line per campaign per day ('Ad views: NAME', 'Inbox deliveries: NAME', 'Video views: NAME'); lines marked '(purchased credits)' spent on-chain purchased credits rather than the earned pool. Reservations (credits set aside for a live campaign) are NOT ledger lines; they show as 'in live campaigns'. Earned credits are spent before purchased ones, so an earn followed by a buy appears as two lines. The ledger starts 2026-09-16; nothing earlier is listed. - CREDIT ACTIVITY LEDGER (2026-09-16): Members > Campaigns has a 'Credit activity' list (last 40 lines, newest first; also linked from the Earn credits pane) showing every real credit movement with a reason: welcome credits, sign-in bonus with streak, daily claim, inbox reads, video watches, verified visits, milestone and leaderboard bonuses, partner codes, admin/team grants, AI Copy Engine charges and refunds, flat buys (featured runs, extensions, visit packs, more visits), login-ad days, and metered delivery rolled up as one line per campaign per day ('Ad views: NAME', 'Inbox deliveries: NAME', 'Video views: NAME'); lines marked '(purchased credits)' spent on-chain purchased credits rather than the earned pool. Reservations (credits set aside for a live campaign) are NOT ledger lines; they show as 'in live campaigns'. Earned credits are spent before purchased ones, so an earn followed by a buy appears as two lines. The ledger starts 2026-09-16; nothing earlier is listed.
- PAYMENT + MISSED-PAYMENT NOTICES (2026-09-15): every payout that lands (who bought, level, share in POL and dollars, transaction link) and every missed payout is delivered BOTH by email and as an on-site inbox message from the company account, shown in the login pop-up and the Messages card, so it is waiting when the member signs in. MISSED-PAYOUT detail: when a level-2 or level-3 share passes a member by because that level is not open on their account, the member gets an email the same minute: who bought, the POL and dollar amount they missed, how many qualifying buyers they have versus the 2 or 5 needed, and the two ways to close the gap (bring buyers, or Qualified Start). Qualified members whose wallet rejected a transfer get a different email telling them to link a regular wallet. MISSED PAYOUTS ARE ALSO PUBLIC (2026-09-16): the team's Telegram payments feed posts, by username, who was passed over on a purchase, why (not qualified yet with N of 2 buyers, or payouts not switched on), the amount, and who received it instead; the same for a sale that routed past an unactivated sponsor. Nothing about the contract changed; it is visibility. - PAYMENT + MISSED-PAYMENT NOTICES (2026-09-15): every payout that lands (who bought, level, share in POL and dollars, transaction link) and every missed payout is delivered BOTH by email and as an on-site inbox message from the company account, shown in the login pop-up and the Messages card, so it is waiting when the member signs in. MISSED-PAYOUT detail: when a level-2 or level-3 share passes a member by because that level is not open on their account, the member gets an email the same minute: who bought, the POL and dollar amount they missed, how many qualifying buyers they have versus the 2 or 5 needed, and the two ways to close the gap (bring buyers, or Qualified Start). Qualified members whose wallet rejected a transfer get a different email telling them to link a regular wallet. MISSED PAYOUTS ARE ALSO PUBLIC (2026-09-16): the team's Telegram payments feed posts, by username, who was passed over on a purchase, why (not qualified yet with N of 2 buyers, or payouts not switched on), the amount, and who received it instead; the same for a sale that routed past an unactivated sponsor. Nothing about the contract changed; it is visibility.
@@ -450,7 +318,7 @@ ${WEEKEND ? (() => { try { return WEEKEND.fact() || ''; } catch (e) { return '';
- GETTING STARTED CARD (2026-09-14): the top of every new member's Overview shows four steps (username, link wallet, switch on payouts, first package) with the current one explained and one button that opens the right tab and highlights the control (Wallet tab > Link wallet; then Activate payouts). Encouragement only: it can be hidden, and members who only want to view ads and earn credits are never blocked. It disappears once all four are done. - GETTING STARTED CARD (2026-09-14): the top of every new member's Overview shows four steps (username, link wallet, switch on payouts, first package) with the current one explained and one button that opens the right tab and highlights the control (Wallet tab > Link wallet; then Activate payouts). Encouragement only: it can be hidden, and members who only want to view ads and earn credits are never blocked. It disappears once all four are done.
- LEADERBOARD + REFERRAL CONTEST (2026-09-14): instantadpay.com/leaderboard ranks members by ad packages sold to people they directly sponsor (dollar value, read from the chain; a member's own linked positions and second accounts never count). Periods: this week (Monday to Sunday, Central time), this month, all time. Weekly and monthly winners are recorded automatically at rollover, announced in Telegram, and the credit prizes set by the admin (a ladder: 1st 1,000 / 2nd 500 / 3rd 250 weekly, 5,000 / 2,500 / 1,000 monthly by default) are granted automatically to those positions; the prize text is shown on the page and on the Overview's Leaderboard card, which also shows the member's own rank. Prizes are credits or packages, never cash. - LEADERBOARD + REFERRAL CONTEST (2026-09-14): instantadpay.com/leaderboard ranks members by ad packages sold to people they directly sponsor (dollar value, read from the chain; a member's own linked positions and second accounts never count). Periods: this week (Monday to Sunday, Central time), this month, all time. Weekly and monthly winners are recorded automatically at rollover, announced in Telegram, and the credit prizes set by the admin (a ladder: 1st 1,000 / 2nd 500 / 3rd 250 weekly, 5,000 / 2,500 / 1,000 monthly by default) are granted automatically to those positions; the prize text is shown on the page and on the Overview's Leaderboard card, which also shows the member's own rank. Prizes are credits or packages, never cash.
- WHAT'S NEW / ROADMAP (2026-09-14): instantadpay.com/whats-new lists release notes (what shipped, dated, tagged new/improved/fixed) and the roadmap (planned / building, with rough ETAs). The Overview has a "What's new" card with the latest three notes and what is being built; a dot marks notes since the member's last look. Written by the admin in Admin > Releases. - WHAT'S NEW / ROADMAP (2026-09-14): instantadpay.com/whats-new lists release notes (what shipped, dated, tagged new/improved/fixed) and the roadmap (planned / building, with rough ETAs). The Overview has a "What's new" card with the latest three notes and what is being built; a dot marks notes since the member's last look. Written by the admin in Admin > Releases.
- HOLDING TANK ALERTS: 24 hours after a new member joins (when they can be adopted), a note at the top of every member's Overview names them (usernames) and a post goes to the team's Telegram payments topic; adopt from My line > Holding tank (your own $20 package required). - HOLDING TANK ALERTS: when new members land in the tank, a note at the top of every member's Overview names them (usernames) and a post goes to the team's Telegram payments topic; adopt from My line > Holding tank (your own $20 package required).
- LEGACY WELCOME (former Faucet Wave / Tier One Ads members): they join through instantadpay.com/from/faucetwave or instantadpay.com/from/tieroneads and, if their email is on the legacy list, welcome-back credits are added automatically at signup (former advertisers 500, former earners 150; once per person; credits, not POL). They land in the holding tank like any member who joins without a sponsor. SOCIALPIX GATE (2026-09-20): socialpix.club no longer takes ad posts; its visitors are sent to instantadpay.com/from/socialpix (advertiser copy by default, ?seg=earn for the earner copy). No welcome-back credits for SocialPix arrivals; they join free by email and land in the holding tank. - LEGACY WELCOME (former Faucet Wave / Tier One Ads members): they join through instantadpay.com/from/faucetwave or instantadpay.com/from/tieroneads and, if their email is on the legacy list, welcome-back credits are added automatically at signup (former advertisers 500, former earners 150; once per person; credits, not POL). They land in the holding tank like any member who joins without a sponsor. SOCIALPIX GATE (2026-09-20): socialpix.club no longer takes ad posts; its visitors are sent to instantadpay.com/from/socialpix (advertiser copy by default, ?seg=earn for the earner copy). No welcome-back credits for SocialPix arrivals; they join free by email and land in the holding tank.
- PROMO CODES: partner site owners get a reusable code; a member redeems it on a join link (?promo=CODE) or in the Overview box "Have a promo code?" and receives free ad credits (amount set per code by the admin, one use per account; codes can cap uses or expire). Credits, not POL. - PROMO CODES: partner site owners get a reusable code; a member redeems it on a join link (?promo=CODE) or in the Overview box "Have a promo code?" and receives free ad credits (amount set per code by the admin, one use per account; codes can cap uses or expire). Credits, not POL.
- DORMANT-LEAD RESCUE: a FREE referral (no wallet, no purchase) with no message from their sponsor for 10 days triggers a warning email + dashboard flag to the sponsor ("unreached, tank in N days"); at 14 days (warning at least 4 days old) the lead moves to the holding tank and the sponsor is told. Sponsor resets the clock with a chat, a Nudge, or the "Contacted them" button (for phone/text contact). Leads whose sponsor link resolves to nobody go to the tank after a day. Nothing on-chain moves; anyone bound by a purchase never moves. - DORMANT-LEAD RESCUE: a FREE referral (no wallet, no purchase) with no message from their sponsor for 10 days triggers a warning email + dashboard flag to the sponsor ("unreached, tank in N days"); at 14 days (warning at least 4 days old) the lead moves to the holding tank and the sponsor is told. Sponsor resets the clock with a chat, a Nudge, or the "Contacted them" button (for phone/text contact). Leads whose sponsor link resolves to nobody go to the tank after a day. Nothing on-chain moves; anyone bound by a purchase never moves.
@@ -467,12 +335,11 @@ ${WEEKEND ? (() => { try { return WEEKEND.fact() || ''; } catch (e) { return '';
- PASSIVEDRIP (LIVE on the Earn tab for every member since 2026-10-03): https://passivedrip.com, an EARNING SITE (never call it a game): faucet claims, paid-to-click ad views, offers (offer walls) and a daily bonus roll earn coins; at 2,000 coins ($1) the balance is paid out AUTOMATICALLY in POL on Polygon to the wallet saved on PassiveDrip. The Earn tab card (More ways to earn: PassiveDrip) opens it with ONE TAP using the InstantAdPay account (no new password; it offers the member's InstantAdPay wallet to save). No income is promised. - PASSIVEDRIP (LIVE on the Earn tab for every member since 2026-10-03): https://passivedrip.com, an EARNING SITE (never call it a game): faucet claims, paid-to-click ad views, offers (offer walls) and a daily bonus roll earn coins; at 2,000 coins ($1) the balance is paid out AUTOMATICALLY in POL on Polygon to the wallet saved on PassiveDrip. The Earn tab card (More ways to earn: PassiveDrip) opens it with ONE TAP using the InstantAdPay account (no new password; it offers the member's InstantAdPay wallet to save). No income is promised.
- POLYBREAK (opens 2026-10-13, https://polybreak.app, in Members > Games): a free Arkanoid-style brick breaker. Eight hand-built rounds that then repeat with tougher silver bricks; colored bricks break in one hit, silver takes more hits each round, gold never breaks. Capsules: S slow, C catch, L laser, E enlarge, D disrupt (three balls), B break (a gate in the right wall skips the round), P extra paddle. One-tap sign-in with the InstantAdPay account; guests can play and their first clears are paid once they sign in. PAYS POL: the first clear of each round (replays pay nothing) and catches of the purple Polygon gem (a small random amount each time, the gem appears every so often during play), into the PolyBreak game balance, sent automatically to the wallet on the member's InstantAdPay account at the payout line shown in the game; rewards are paid from the game's pool, funded by a share of the one-more-paddle visits. ONE MORE PADDLE: when the last paddle is lost, a verified visit to a member's page (or a member video) continues the round with one paddle; it uses the daily refuel allowance shared with the other games. REFERRALS: each player's share link polybreak.app/r/<username>; a sponsor earns a share of the pool income from the paddle visits of players they invited. Never state a maximum or total a player can earn and never promise income. - POLYBREAK (opens 2026-10-13, https://polybreak.app, in Members > Games): a free Arkanoid-style brick breaker. Eight hand-built rounds that then repeat with tougher silver bricks; colored bricks break in one hit, silver takes more hits each round, gold never breaks. Capsules: S slow, C catch, L laser, E enlarge, D disrupt (three balls), B break (a gate in the right wall skips the round), P extra paddle. One-tap sign-in with the InstantAdPay account; guests can play and their first clears are paid once they sign in. PAYS POL: the first clear of each round (replays pay nothing) and catches of the purple Polygon gem (a small random amount each time, the gem appears every so often during play), into the PolyBreak game balance, sent automatically to the wallet on the member's InstantAdPay account at the payout line shown in the game; rewards are paid from the game's pool, funded by a share of the one-more-paddle visits. ONE MORE PADDLE: when the last paddle is lost, a verified visit to a member's page (or a member video) continues the round with one paddle; it uses the daily refuel allowance shared with the other games. REFERRALS: each player's share link polybreak.app/r/<username>; a sponsor earns a share of the pool income from the paddle visits of players they invited. Never state a maximum or total a player can earn and never promise income.
- POLYWARRIORS (LIVE 2026-10-12, https://www.polywarriors.com, in Members > Games): a free cyberpunk turn-based fighting game. Recruit warriors that are each born with their own traits and rarity (Common, Rare, Epic, Legendary); fight through 24 arena rivals (a 12-rival district ladder, then a 12-rival elite circuit); challenge other members to async duels that play out while they are away. The FIRST win over each rival pays POL to the wallet on the member's InstantAdPay account (replays pay nothing). The first warrior mints to the member's wallet as an NFT on Polygon for free; after that every $5 ad package bought on InstantAdPay earns a mint pass. Fusion: three warriors of the same rarity fuse into one rarer warrior (the three are consumed). Marketplace: warriors trade between members, settled in POL. One-tap sign-in with the InstantAdPay account; guests can try fights but earn nothing until they sign in. A 40-second trailer and a promo kit are in Promo tools > Games > PolyWarriors. Never state a maximum or total a player can earn and never promise income. - POLYWARRIORS (LIVE 2026-10-12, https://www.polywarriors.com, in Members > Games): a free cyberpunk turn-based fighting game. Recruit warriors that are each born with their own traits and rarity (Common, Rare, Epic, Legendary); fight through 24 arena rivals (a 12-rival district ladder, then a 12-rival elite circuit); challenge other members to async duels that play out while they are away. The FIRST win over each rival pays POL to the wallet on the member's InstantAdPay account (replays pay nothing). The first warrior mints to the member's wallet as an NFT on Polygon for free; after that every $5 ad package bought on InstantAdPay earns a mint pass. Fusion: three warriors of the same rarity fuse into one rarer warrior (the three are consumed). Marketplace: warriors trade between members, settled in POL. One-tap sign-in with the InstantAdPay account; guests can try fights but earn nothing until they sign in. A 40-second trailer and a promo kit are in Promo tools > Games > PolyWarriors. Never state a maximum or total a player can earn and never promise income.
- SPELLWHEEL (LIVE 2026-10-10, https://spellwheel.com, in Members > Games): a letter-wheel word game: swipe letters on the wheel to fill the crossword grid, travel through six cozy places (chapters: the Lantern Library, the Harbor Market, the Mountain Lodge, the Desert Caravan, the Snowy Cabin, the Glass Conservatory), and solve a new daily puzzle shared by everyone. LADDER since 2026-11-02: guests play the first place only and earn nothing (their clears carry over as progress at sign-in, never as POL); a free InstantAdPay account plays the first two places; the Mountain Lodge and beyond need an active Game Pass (the game answers "for Game Pass holders" with a link to the pass). POL, first clears only: levels 0.01/0.01/0.03/0.03/0.05/0.05 and a completed place 0.1/0.1/0.5/0.5/1/1 by chapter; from the third place on, and for the daily puzzle (0.03) and the 7-day streak, only pass holders are paid; a player who has cleared every place earns nothing more until new places ship. Collected in the SpellWheel balance and sent automatically to the wallet on the member's InstantAdPay account. One-tap sign-in with the InstantAdPay account. Never state totals or promise income. - SPELLWHEEL (LIVE 2026-10-10, https://spellwheel.com, in Members > Games): a free letter-wheel word game: swipe letters on the wheel to fill the crossword grid, travel through six cozy places (chapters), and solve a new daily puzzle shared by everyone. Pays POL for clearing levels, finishing a place and solving the daily puzzle, collected in the SpellWheel balance and sent automatically to the wallet on the member's InstantAdPay account. One-tap sign-in with the InstantAdPay account. Never state totals or promise income.
- CLUTTERHUNT (LIVE 2026-10-03, https://clutterhunt.com, in Members > Games): a free hidden-object game. Search cozy, cluttered rooms for 12 hidden objects plus one sponsored find (a sealed letter with a sponsor's name; tapping it shows their ad). Rooms change with the seasons: the Haunted Manor (Attic, Library, Witch's Kitchen, Wizard's Study, Moonlit Greenhouse, Wine Cellar) through Oct 31, then new seasonal rooms. Objects move every round. Stars: finish under 3 minutes, use at most 1 hint, at most 6 wrong taps. 2 free hints a round; after that a short verified visit to a member's page earns a hint (shares the daily refuel allowance). Sign in with the InstantAdPay account right inside the game to save stars. PAYS POL since 2026-10-04: fixed rewards per room each season for the first clear and the first 3-star clear (more for Expert rooms, which unlock after all six rooms), collected in the ClutterHunt balance and sent automatically to the wallet on the member's InstantAdPay account once it reaches the payout amount. Players who cleared rooms before 10-04 can replay each room once to collect. NEVER state a maximum or total a player can earn (Marty's rule) and never promise earnings. HARVEST FARMHOUSE season 2026-11-01 to 11-30 (six new rooms: Farmhouse Kitchen, Pantry, Harvest Dining Room, Barn Loft, Front Porch, Cozy Parlor); the Haunted Manor closed 2026-11-01. Rewards unchanged: first clear 0.05 POL per room per season, +0.05 for three stars, Expert 0.15 and +0.10 for three stars, from the season pool while it lasts. - CLUTTERHUNT (LIVE 2026-10-03, https://clutterhunt.com, in Members > Games): a free hidden-object game. Search cozy, cluttered rooms for 12 hidden objects plus one sponsored find (a sealed letter with a sponsor's name; tapping it shows their ad). Rooms change with the seasons: the Haunted Manor (Attic, Library, Witch's Kitchen, Wizard's Study, Moonlit Greenhouse, Wine Cellar) through Oct 31, then new seasonal rooms. Objects move every round. Stars: finish under 3 minutes, use at most 1 hint, at most 6 wrong taps. 2 free hints a round; after that a short verified visit to a member's page earns a hint (shares the daily refuel allowance). Sign in with the InstantAdPay account right inside the game to save stars. PAYS POL since 2026-10-04: fixed rewards per room each season for the first clear and the first 3-star clear (more for Expert rooms, which unlock after all six rooms), collected in the ClutterHunt balance and sent automatically to the wallet on the member's InstantAdPay account once it reaches the payout amount. Players who cleared rooms before 10-04 can replay each room once to collect. NEVER state a maximum or total a player can earn (Marty's rule) and never promise earnings.
- SPOOKY DOORS (Halloween season game, 2026-10-02): https://spookydoors.com, open 2026-10-04 through Halloween night (closes at midnight Central at the end of Oct 31); its Games tab card shows only during the season, with a "Limited time, ends Oct 31" ribbon. Members sign in with one tap from Members > Games. Walk the street, collect candy, avoid black cats and bats, knock on doors. Each door is a verified visit to a member's page or ad (a member video once every page has been visited), the advertiser is charged as for any visit, the player gets candy not credits; 15 doors per Central day, separate from the 20 Earn-tab visits and the 20 Drip Runner refuels. A treat is 10 candy; about 1 door in 5 is a trick (a ghost or skeleton you tap 5 times quickly; beat it for a 3 candy bonus, miss it for half the treat). If no paid ad is left for that player, the door shows a house ad for one of our own programs: a smaller treat (5 candy), and it still counts toward the 15 doors. CANDY LADDER pays POL once per rung: 100 candy 0.1 POL, 250 0.25, 500 0.5, 1,000 1, 2,000 2 (Halloween 2026 badge at 500), paid from a season pool funded by a share of door ad spend and costume sales, only while the pool covers it; the game balance is sent to the member's InstantAdPay wallet on Polygon at 0.25 POL. COSTUMES bought with ad credits like Gem Kingdom Crowns: witch free, vampire 300 credits (longer trick timer), bedsheet ghost 300 (black cats ignore you), Lucky caramel apple 500 (+2 candy per treat); no cash value. Top 20 by candy on the season leaderboard. DOOR PACKS: creating a verified-visits campaign, the advertiser picks Everywhere (3 credits per visit, as before), Behind Spooky Doors (4 credits per door) or Golden Spooky Door (6 credits per door; the player gets +2 bonus candy). Paid up front like any visit pack. Door packs are served first on doors (Golden Doors before door packs), each player sees a pack at most once per Central day, they never run on the Earn tab or refuels during the season, and from Nov 1 any doors left run as normal visits; the campaign shows doors opened and unique players. Never promise earnings or call it income. CLOSED 2026-11-01: the season is over, the card is hidden, doors and shop are off; Candy Crunch top 10 share 27 POL (10/6/4/1x7) paid after admin approval, unlinked winners paid once they link a wallet; unpaid ladder POL (0.10+) pays once a wallet is linked; next seasonal game is Turkey Drop (opens 2026-11-02). - SPOOKY DOORS (Halloween season game, 2026-10-02): https://spookydoors.com, open 2026-10-04 through Halloween night (closes at midnight Central at the end of Oct 31); its Games tab card shows only during the season, with a "Limited time, ends Oct 31" ribbon. Members sign in with one tap from Members > Games. Walk the street, collect candy, avoid black cats and bats, knock on doors. Each door is a verified visit to a member's page or ad (a member video once every page has been visited), the advertiser is charged as for any visit, the player gets candy not credits; 15 doors per Central day, separate from the 20 Earn-tab visits and the 20 Drip Runner refuels. A treat is 10 candy; about 1 door in 5 is a trick (a ghost or skeleton you tap 5 times quickly; beat it for a 3 candy bonus, miss it for half the treat). If no paid ad is left for that player, the door shows a house ad for one of our own programs: a smaller treat (5 candy), and it still counts toward the 15 doors. CANDY LADDER pays POL once per rung: 100 candy 0.1 POL, 250 0.25, 500 0.5, 1,000 1, 2,000 2 (Halloween 2026 badge at 500), paid from a season pool funded by a share of door ad spend and costume sales, only while the pool covers it; the game balance is sent to the member's InstantAdPay wallet on Polygon at 0.25 POL. COSTUMES bought with ad credits like Gem Kingdom Crowns: witch free, vampire 300 credits (longer trick timer), bedsheet ghost 300 (black cats ignore you), Lucky caramel apple 500 (+2 candy per treat); no cash value. Top 20 by candy on the season leaderboard. DOOR PACKS: creating a verified-visits campaign, the advertiser picks Everywhere (3 credits per visit, as before), Behind Spooky Doors (4 credits per door) or Golden Spooky Door (6 credits per door; the player gets +2 bonus candy). Paid up front like any visit pack. Door packs are served first on doors (Golden Doors before door packs), each player sees a pack at most once per Central day, they never run on the Earn tab or refuels during the season, and from Nov 1 any doors left run as normal visits; the campaign shows doors opened and unique players. Never promise earnings or call it income.
- GEM KINGDOM (LIVE in the Games tab since 2026-10-02): Gem Kingdom (https://gemkingdom.app) is a free fantasy match-3: match gems so three heroes battle monsters across six chapters (Goblin Woods, the Frozen Pass, the Haunted Swamp, Dragon's Peak, the Sunken Reef, the Shadow Citadel), earn stars, and rebuild your Stronghold and forge weapons. LADDER since 2026-11-02 (Marty: the game funds itself): Chapters 1-2 open to everyone (guests included); Chapter 3 needs a free InstantAdPay account; Chapters 4-6 need the ROYAL CHARTER, $5 one time = 500 PURCHASED credits (paid credits only, never earned viewing credits), bought in the game's Specials; a Kingdom Pass or an active Game Pass counts as a Charter; anyone who had already spent $5+ of purchased credits in the game has it. It pays POL for FIRST clears only: chapters 1-3 are a taste (stages 0.01/0.01/0.02, bosses 0.1/0.2/0.5, about 1.2 POL in all); chapters 4-6 pay Charter holders only (stages 0.08/0.12/0.15, bosses 3/5/7.5 for the Ember Dragon, Kraken and Shadow King, about 19 POL for the full ladder) and a player's chapter 4-6 total never exceeds what they paid in. Replays pay nothing; after the Shadow King nothing more is paid until a new chapter ships. The game balance is sent to the member's InstantAdPay wallet on Polygon at 0.25 POL. Rewards come from a pool funded by a share of Crown purchases and pay only while the pool has funds; never promise earnings or call it income. No referral bonus on game clears. Crowns, its upgrade currency, are bought with your InstantAdPay ad credits: tap Buy in the game's Crown Shop, confirm on InstantAdPay (top up with a pack if you are short), and you land back in the game with the Crowns added. Crowns buy buildings, weapons, battle boosts and a revive after a defeat. Sign in with your InstantAdPay account to save progress, earn badges and appear in the Game Achievements posts in the Crypto Team Build group. Never promise an amount beyond the posted rewards. (2026-10-03) FREE REVIVE: after a defeat, a short verified visit to a member's page (InstantAdPay verified-visit flow inside the game, shares the 20-a-day refuel allowance with Drip Runner) revives the party once per battle; a revived win earns at most 2 stars. SPECIALS in the Crown shop: Hero Bundle (one time, $5 = 500 credits: a tier-1 forge weapon, one building level, 60 Crowns), Kingdom Pass ($10 = 1,000 credits for 30 days: 10 Crowns a day credited on the first visit each Central day, a 25-Crown chest every 7 days, the three Royal hero looks; no auto-renew, buying again adds 30 days), Hero looks (cosmetic only: Halloween looks Pumpkin Knight, Moon Witch, Scarecrow Ranger for 40 Crowns each, sold through Oct 31 and kept forever; Royal looks with the Pass). Only the purchased-credit part of a purchase funds the POL reward pool. - GEM KINGDOM (LIVE in the Games tab since 2026-10-02): Gem Kingdom (https://gemkingdom.app) is a free fantasy match-3: match gems so three heroes battle monsters across six chapters (Goblin Woods, the Frozen Pass, the Haunted Swamp, Dragon's Peak, the Sunken Reef, the Shadow Citadel), earn stars, and rebuild your Stronghold and forge weapons. It pays POL for FIRST clears only (stages 0.02 to 0.15 POL rising by chapter; bosses 0.25, 0.5, 2, 5, 7.5 and 10 POL for the Goblin King, Ice Queen, Bog Witch, Ember Dragon, Kraken and Shadow King); replays pay nothing. The game balance is sent to the member's InstantAdPay wallet on Polygon at 0.25 POL. Rewards come from a pool funded by a share of Crown purchases and pay only while the pool has funds; never promise earnings or call it income. No referral bonus on game clears. Crowns, its upgrade currency, are bought with your InstantAdPay ad credits: tap Buy in the game's Crown Shop, confirm on InstantAdPay (top up with a pack if you are short), and you land back in the game with the Crowns added. Crowns buy buildings, weapons, battle boosts and a revive after a defeat. Sign in with your InstantAdPay account to save progress, earn badges and appear in the Game Achievements posts in the Crypto Team Build group. Never promise an amount beyond the posted rewards. (2026-10-03) FREE REVIVE: after a defeat, a short verified visit to a member's page (InstantAdPay verified-visit flow inside the game, shares the 20-a-day refuel allowance with Drip Runner) revives the party once per battle; a revived win earns at most 2 stars. SPECIALS in the Crown shop: Hero Bundle (one time, $5 = 500 credits: a tier-1 forge weapon, one building level, 60 Crowns), Kingdom Pass ($10 = 1,000 credits for 30 days: 10 Crowns a day credited on the first visit each Central day, a 25-Crown chest every 7 days, the three Royal hero looks; no auto-renew, buying again adds 30 days), Hero looks (cosmetic only: Halloween looks Pumpkin Knight, Moon Witch, Scarecrow Ranger for 40 Crowns each, sold through Oct 31 and kept forever; Royal looks with the Pass). Only the purchased-credit part of a purchase funds the POL reward pool.
- GAME POL TO ANY LINKED WALLET (2026-10-27, Marty): game POL (Drip Runner, Gem Kingdom, ClutterHunt, Spooky Doors, Road Agent, PolyBreak, SpellWheel, PolyWarriors) is paid to the wallet LINKED to the member's InstantAdPay account (one free signature on the Wallet tab, https://instantadpay.com/my#wallet). Activation is NOT needed: a linked wallet that has not switched on payouts (for example a holding-tank member waiting for a sponsor) is paid too. InstantAdPay hands the linked wallet to every game where the member has a balance (hourly, and on every sign-in to a game), and the game sends the POL on its own sweep once the balance reaches that game's payout line, including everything earned before the link. A game that already holds a different wallet keeps paying that one (it is never replaced automatically). Players with no linked wallet get at most three reminders ("X POL is waiting for your wallet": link your wallet, one free signature, and it's sent automatically, including everything you've earned so far), and in the games the reward screen says "Link your wallet to receive this POL" with the same link. Never tell a member to switch on payouts to get game POL. - GAME POL TO ANY LINKED WALLET (2026-10-27, Marty): game POL (Drip Runner, Gem Kingdom, ClutterHunt, Spooky Doors, Road Agent, PolyBreak, SpellWheel, PolyWarriors) is paid to the wallet LINKED to the member's InstantAdPay account (one free signature on the Wallet tab, https://instantadpay.com/my#wallet). Activation is NOT needed: a linked wallet that has not switched on payouts (for example a holding-tank member waiting for a sponsor) is paid too. InstantAdPay hands the linked wallet to every game where the member has a balance (hourly, and on every sign-in to a game), and the game sends the POL on its own sweep once the balance reaches that game's payout line, including everything earned before the link. A game that already holds a different wallet keeps paying that one (it is never replaced automatically). Players with no linked wallet get at most three reminders ("X POL is waiting for your wallet": link your wallet, one free signature, and it's sent automatically, including everything you've earned so far), and in the games the reward screen says "Link your wallet to receive this POL" with the same link. Never tell a member to switch on payouts to get game POL.
- GAME TIERS (2026-11-02, Marty: every game funds itself; rolling out game by game, no announcements): guests get a first slice and earn nothing; a free InstantAdPay account gets a small taste of POL; the full content and the full rewards need a purchase (the $5 Game Pass, or a one-time unlock where the content is finite). Done so far: GEM KINGDOM (Royal Charter, see its own line), POLHUNTER (a free account hunts ONE code a day drawn on 0.02 to 0.10 POL; Game Pass holders hunt five a day at the full 0.05 to 1 POL draw and alone qualify for the weekly prizes and the Mystery Hunt Box; advertiser-funded finds pay the advertiser's amount on every tier), SPELLWHEEL (guests the first place, a free account the first two, the Mountain Lodge and beyond plus daily-puzzle and streak POL for Game Pass holders; see its own line). ALL OTHER GAMES since the evening of 2026-11-02: guests play but earn no POL (guest progress carries over at sign-in, guest POL does not); a free account earns 25% of each one-time progress reward (chapters, rounds, sectors, rungs, bosses, depth marks) and keeps the existing free daily limits on repeatable rewards; Game Pass holders earn 100%. Specifics: CLUTTERHUNT guests room 1, a free account rooms 1 and 2 at a quarter, Game Pass rooms 3 to 6 and Expert; POL MINER guests dig the Dirt (to 10 m), a free account to 24 m, Game Pass from the Gravel down; POLYWARRIORS the full table needs a PAID warrior mint or the Game Pass (the free first mint does not count), free accounts earn a quarter and cannot place for weekly prizes; TURKEY DROP weekly top-3 prizes go to Game Pass holders from the week of Nov 9 (the week of Nov 2 settles as announced); Drip Runner, PolyBreak, Road Agent and Spooky Doors follow the general rule. Nothing already paid changed.
- GAMES TAB (2026-10-01): Members > Games (/my#games) shows one card per network game (as of 2026-10-15: PolHunter, Drip Runner, Gem Kingdom, ClutterHunt, SpellWheel, PolyWarriors, PolyBreak, Road Agent, Spooky Doors during Halloween; all pay POL to the member's InstantAdPay wallet), with their own progress and a Play button that signs them in with one tap; new games appear there as they launch (PolHunter is one card). DRIP RUNNER (https://driprunner.app, LIVE for every member since 2026-10-01): tap-to-hop runner; gold drips, magenta bots, orange firewalls from chapter 2; each chapter has a drip goal for one run; the FIRST clear of a chapter pays a small POL drip (amount set by the admin, shown in the game) into the game balance, replays pay nothing; the balance is sent on Polygon to the member's InstantAdPay wallet once it reaches the payout line shown in the game. REFUELS: a run that ends can be refuelled with a verified visit to a member's page (once every page has been visited: a member video, a page seen more than 7 days ago again, or one of the network's own programs, so a game visit is never empty; since 2026-10-28 for every game's refuel, paddle, continue, hint and supply crate), up to 20 a day, separate from the 20 Earn-tab visits; the advertiser is charged as for any visit, the player gets fuel not credits. The POL pool is funded ONLY by a share of refuel ad spend plus POL spent in the hangar, so drips depend on refuels and can be zero when the pool is empty; say so honestly. HANGAR: Drip Magnet and Courier Mk II cost drips (game currency); Shield Core and Slow Field cost POL from the game balance, which returns to the pool. GUESTS can try a run without signing in; their clears pay once they sign in. REFERRALS: each player's share link /r/<username>; when members whose InstantAdPay sponsor is that player refuel, a share (10 percent by default) of each refuel's pool income goes to the sponsor's game balance. Telegram posts achievement badges (chapters, unlocks, refuel milestones, payouts). Never promise amounts or income. The public list of every game, open now and opening next, is https://instantadpay.com/games (shareable; add ?ref=<username> to keep the referral). - GAMES TAB (2026-10-01): Members > Games (/my#games) shows one card per network game (as of 2026-10-15: PolHunter, Drip Runner, Gem Kingdom, ClutterHunt, SpellWheel, PolyWarriors, PolyBreak, Road Agent, Spooky Doors during Halloween; all pay POL to the member's InstantAdPay wallet), with their own progress and a Play button that signs them in with one tap; new games appear there as they launch (PolHunter is one card). DRIP RUNNER (https://driprunner.app, LIVE for every member since 2026-10-01): tap-to-hop runner; gold drips, magenta bots, orange firewalls from chapter 2; each chapter has a drip goal for one run; the FIRST clear of a chapter pays a small POL drip (amount set by the admin, shown in the game) into the game balance, replays pay nothing; the balance is sent on Polygon to the member's InstantAdPay wallet once it reaches the payout line shown in the game. REFUELS: a run that ends can be refuelled with a verified visit to a member's page (once every page has been visited: a member video, a page seen more than 7 days ago again, or one of the network's own programs, so a game visit is never empty; since 2026-10-28 for every game's refuel, paddle, continue, hint and supply crate), up to 20 a day, separate from the 20 Earn-tab visits; the advertiser is charged as for any visit, the player gets fuel not credits. The POL pool is funded ONLY by a share of refuel ad spend plus POL spent in the hangar, so drips depend on refuels and can be zero when the pool is empty; say so honestly. HANGAR: Drip Magnet and Courier Mk II cost drips (game currency); Shield Core and Slow Field cost POL from the game balance, which returns to the pool. GUESTS can try a run without signing in; their clears pay once they sign in. REFERRALS: each player's share link /r/<username>; when members whose InstantAdPay sponsor is that player refuel, a share (10 percent by default) of each refuel's pool income goes to the sponsor's game balance. Telegram posts achievement badges (chapters, unlocks, refuel milestones, payouts). Never promise amounts or income. The public list of every game, open now and opening next, is https://instantadpay.com/games (shareable; add ?ref=<username> to keep the referral).
- Every purchase is split by an immutable smart contract in the same transaction: 50% direct sponsor, 20% level 2, 10% level 3, 20% platform. No withdrawals exist; money lands in members' own wallets instantly. - Every purchase is split by an immutable smart contract in the same transaction: 50% direct sponsor, 20% level 2, 10% level 3, 20% platform. No withdrawals exist; money lands in members' own wallets instantly.
- Qualification: level 1 open to all; 2 buyers of $20+ unlock level 2; 5 unlock level 3. Unqualified shares pass up the sponsor line, checking up to 25 positions, else the platform receives them. Qualification cannot be bought and never expires. - Qualification: level 1 open to all; 2 buyers of $20+ unlock level 2; 5 unlock level 3. Unqualified shares pass up the sponsor line, checking up to 25 positions, else the platform receives them. Qualification cannot be bought and never expires.
@@ -480,17 +347,15 @@ ${WEEKEND ? (() => { try { return WEEKEND.fact() || ''; } catch (e) { return '';
- Transparency: live ledger at /ledger streams every chain event, and EVERY transaction row carries a clickable "verify" link — to the public block explorer when the chain has one, or to the built-in transaction viewer at /tx/<hash> (block, time, from/to, value, gas, decoded events, read live from the node). Plain-language contract review at /contract; the verified source is public. - Transparency: live ledger at /ledger streams every chain event, and EVERY transaction row carries a clickable "verify" link — to the public block explorer when the chain has one, or to the built-in transaction viewer at /tx/<hash> (block, time, from/to, value, gas, decoded events, read live from the node). Plain-language contract review at /contract; the verified source is public.
- The contract cannot be paused, upgraded, or drained. The operator can only manage the ad catalog ($1-$500 bounds, 24h price timelock) and rotate keys. - The contract cannot be paused, upgraded, or drained. The operator can only manage the ad catalog ($1-$500 bounds, 24h price timelock) and rotate keys.
- VIDEO APP INCOME VIDEOS AS VIDEO ADS (2026-11-22): a member of Video App Income (a network site that makes short phone videos, shown publicly on Social Tube, socialtube.club) can tap "Run this on InstantAdPay" on that site's Share tab. It opens /my#campaigns with the Video ad (watch to earn) form filled in with their video file, its title and their Social Tube page as the target. Nothing is purchased automatically: the member picks the watch length and budget and submits; it costs their InstantAdPay credits at the normal video rates. Portrait videos play in Shorts. If the video is remade or deleted on Video App Income its file address changes, so the campaign should be paused and a new one made. No results are promised.
- EARN BY WATCHING ON SOCIAL TUBE (2026-11-22): Social Tube (socialtube.club, the network's video gallery) has an Earn page that plays InstantAdPay's watch-to-earn video ads. A member signs in there with the network account, watches for the full time, and earns the SAME InstantAdPay credits as in Shorts / Watch videos here. InstantAdPay picks the video, times it, charges the advertiser and credits the viewer, so the daily video limit is ONE limit shared by both sites, each video pays once per day, and nobody is served their own video. Credit activity reads "Watched a video on Social Tube". Advertisers do nothing extra: every live video campaign can also be watched there.
PAGES (the ONLY addresses that exist; never invent others): home https://instantadpay.com, member dashboard https://instantadpay.com/my with tabs as hashes: /my#overview, /my#line (My line, holding tank, prospects), /my#pipeline, /my#buy (Buy packages, Qualified Start, Buy POL with a card), /my#campaigns (New campaign, campaign rows, Credit activity), /my#earn (Watch ads, Watch videos, Verified visits, Inbox), /my#earnings (Trace a payment, payouts, referrals, purchases), /my#promo (Your links, Social posts, Text a friend, Email swipes, Banners, Wall, Objections, Videos, Toolkit), /my#training, /my#games (PolHunter, Drip Runner, Gem Kingdom, ClutterHunt, SpellWheel, PolyWarriors, PolyBreak, Spooky Doors in season), /games (public list of every game), /my#wallet, /my#profile, /my#help (Help: support tickets). Public: /support (contact form for anyone signed out or locked out; support@instantadpay.com also works), /join/<username> (invite page, ?v=angle), /wall/<username>, /b/<username>/<badge>, /handout/<username>, /ledger, /tx/<hash>, /contract, /leaderboard, /whats-new, /blog, /plays, /wallets (members), /launch (members), /partners, /earning, /shorts, /terms, /privacy, /disclaimer, /from/faucetwave, /from/tieroneads and /from/socialpix. PAGES (the ONLY addresses that exist; never invent others): home https://instantadpay.com, member dashboard https://instantadpay.com/my with tabs as hashes: /my#overview, /my#line (My line, holding tank, prospects), /my#pipeline, /my#buy (Buy packages, Qualified Start, Buy POL with a card), /my#campaigns (New campaign, campaign rows, Credit activity), /my#earn (Watch ads, Watch videos, Verified visits, Inbox), /my#earnings (Trace a payment, payouts, referrals, purchases), /my#promo (Your links, Social posts, Text a friend, Email swipes, Banners, Wall, Objections, Videos, Toolkit), /my#training, /my#games (PolHunter, Drip Runner, Gem Kingdom, ClutterHunt, SpellWheel, PolyWarriors, PolyBreak, Spooky Doors in season), /games (public list of every game), /my#wallet, /my#profile, /my#help (Help: support tickets). Public: /support (contact form for anyone signed out or locked out; support@instantadpay.com also works), /join/<username> (invite page, ?v=angle), /wall/<username>, /b/<username>/<badge>, /handout/<username>, /ledger, /tx/<hash>, /contract, /leaderboard, /whats-new, /blog, /plays, /wallets (members), /launch (members), /partners, /earning, /shorts, /terms, /privacy, /disclaimer, /from/faucetwave, /from/tieroneads and /from/socialpix.
RULES: RULES:
- 1 to 4 sentences, plain text, no markdown, include full URLs when pointing at a page, and only URLs from the PAGES list above or a network site's link from the KNOWLEDGE BASE. - 1 to 4 sentences, plain text, no markdown, include full URLs when pointing at a page, and only URLs from the PAGES list above.
- Never send someone to a warning, notice, guide, document or page section that is not named above. Saying "read the full warning on your training page" invents something that does not exist and the member will go looking for it. If the answer is not on a page in the PAGES list, give the answer here or say you are not sure and point to /contract, the ledger, or their sponsor. - Never send someone to a warning, notice, guide, document or page section that is not named above. Saying "read the full warning on your training page" invents something that does not exist and the member will go looking for it. If the answer is not on a page in the PAGES list, give the answer here or say you are not sure and point to /contract, the ledger, or their sponsor.
- Plain ASCII only: a normal hyphen, never a non-breaking hyphen, and no smart quotes. - Plain ASCII only: a normal hyphen, never a non-breaking hyphen, and no smart quotes.
- NEVER promise or estimate income. This is an advertising service with a referral program, never an investment. Be honest about risk: crypto transactions are irreversible, nobody earns unless real ad purchases happen. - NEVER promise or estimate income. This is an advertising service with a referral program, never an investment. Be honest about risk: crypto transactions are irreversible, nobody earns unless real ad purchases happen.
- No em dashes. If you do not know, say so and point to /contract or the ledger. - No em dashes. If you do not know, say so and point to /contract or the ledger.
- Anything about one person's own account (a missing payout, a sign-in that will not work, a charge, a bug) you cannot look up: say so and point them to Help at https://instantadpay.com/my#help, or https://instantadpay.com/support when signed out.${networkBlock()}` + (kbBlock ? '\n\n' + kbBlock : ''); - Anything about one person's own account (a missing payout, a sign-in that will not work, a charge, a bug) you cannot look up: say so and point them to Help at https://instantadpay.com/my#help, or https://instantadpay.com/support when signed out.` + (kbBlock ? '\n\n' + kbBlock : '');
} }
// OPENROUTER_URL overrides the endpoint (local tests point it at a mock); production uses openrouter.ai // OPENROUTER_URL overrides the endpoint (local tests point it at a mock); production uses openrouter.ai
@@ -542,39 +407,22 @@ async function answer(message, historyText) { const r = await answerRaw(message,
async function answerRaw(message, historyText) { async function answerRaw(message, historyText) {
const msg = String(message || '').trim(); const msg = String(message || '').trim();
if (!msg) return { error: 'Say something first.' }; if (!msg) return { error: 'Say something first.' };
// Network Weekend: inside the window a weekend or Friday question gets the live answer (the Five Dollar Friday entry says +20%)
if (WEEKEND) { try { const w = WEEKEND.answer(msg); if (w) return { reply: w, canned: true, kb: 'network-weekend' }; } catch (e) {} }
// fast path: the knowledge base's instant answers (seeded from CANNED); the in-code list only if the KB store is down // fast path: the knowledge base's instant answers (seeded from CANNED); the in-code list only if the KB store is down
let hit = null, kbOk = true, other = []; let hit = null, kbOk = true;
try { try { hit = await kb.fastPath(msg); } catch (e) { kbOk = false; console.error('kb fast path', e.message); }
await kb.load();
// another network site named (and this one not): this site's instant answers stand aside, except a hand-off (2026-11-15)
other = /instant ?ad ?pay|\biap\b/i.test(msg) ? [] : kb.namesOther(msg, process.env.HUB_SITE || 'iap');
hit = await kb.fastPath(msg);
if (hit && other.length && !hit.handoff) hit = null;
} catch (e) { kbOk = false; console.error('kb fast path', e.message); }
// a hand-off answers from its exact pattern before anything else; then meaning (2026-11-16, netkb.route): the hub's semantic match
// over the network KB answers, keeps or overrules the pattern hit and picks the prompt context. Hub or model slow or down: null,
// and the pattern + BM25 path below runs exactly as before.
let sem = null;
if (kbOk && !(hit && hit.handoff)) { try { sem = await netkb.route(msg, { fast: hit, own: await kb.own(), prefer: other }); } catch (e) { sem = null; } }
if (sem) hit = sem.hit;
if (hit && hit.id === 'refuel' && !REFUEL_ON()) return { reply: REFUEL_OFF_ANSWER, canned: true, kb: hit.id }; if (hit && hit.id === 'refuel' && !REFUEL_ON()) return { reply: REFUEL_OFF_ANSWER, canned: true, kb: hit.id };
if (hit && (hit.id === 'polminer' || hit.id === 'c-polminer') && !pmLive()) return { reply: POLMINER_SOON_ANSWER, canned: true, kb: hit.id }; if (hit && (hit.id === 'polminer' || hit.id === 'c-polminer') && !pmLive()) return { reply: POLMINER_SOON_ANSWER, canned: true, kb: hit.id };
if (hit && (hit.id === 'turkeydrop' || hit.id === 'c-turkeydrop') && !tdLive()) return { reply: tdAnswer(), canned: true, kb: hit.id }; if (hit && (hit.id === 'turkeydrop' || hit.id === 'c-turkeydrop') && !tdLive()) return { reply: tdAnswer(), canned: true, kb: hit.id };
if (hit && (hit.id === 'game-pass' || hit.id === 'c-game-pass')) return Object.assign({ reply: gpWithTd(hit.answer), canned: true, kb: hit.id }, hit.handoff ? { handoff: true } : {}); if (hit && (hit.id === 'game-pass' || hit.id === 'c-game-pass')) return Object.assign({ reply: gpWithTd(hit.answer), canned: true, kb: hit.id }, hit.handoff ? { handoff: true } : {});
if (hit && (hit.id === 'network-rate' || hit.id === 'c-network-rate') && SYN_N() !== 4) return { reply: netRateAnswer(SYN_N()), canned: true, kb: hit.id };
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, hit.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of CANNED) if (c.re.test(msg)) return c.id === 'refuel' && !REFUEL_ON() ? { reply: REFUEL_OFF_ANSWER, canned: true } : c.id === 'polminer' && !pmLive() ? { reply: POLMINER_SOON_ANSWER, canned: true } : c.id === 'turkeydrop' && !tdLive() ? { reply: tdAnswer(), canned: true } : c.id === 'game-pass' ? { reply: gpWithTd(c.a), canned: true } : c.id === 'network-rate' && SYN_N() !== 4 ? { reply: netRateAnswer(SYN_N()), canned: true } : Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {}); if (!kbOk) for (const c of CANNED) if (c.re.test(msg)) return c.id === 'refuel' && !REFUEL_ON() ? { reply: REFUEL_OFF_ANSWER, canned: true } : c.id === 'polminer' && !pmLive() ? { reply: POLMINER_SOON_ANSWER, canned: true } : c.id === 'turkeydrop' && !tdLive() ? { reply: tdAnswer(), canned: true } : c.id === 'game-pass' ? { reply: gpWithTd(c.a), canned: true } : c.id === 'network-rate' && SYN_N() !== 4 ? { reply: netRateAnswer(SYN_N()), canned: true } : Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
if (hit && (hit.id === 'warpwares' || hit.id === 'c-warpwares') && !wwLive()) return { reply: wwAnswer(), canned: true, kb: hit.id };
if (hit && isBixId(hit.id) && !bixLive()) return { reply: BIX_SOON_ANSWER, canned: true, kb: hit.id };
if (hit && (hit.id === 'network-rate' || hit.id === 'c-network-rate') && (SYN_N() !== 4 || SYN_T() !== 10)) return { reply: netRateAnswer(SYN_N()), canned: true, kb: hit.id };
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, sem ? { via: sem.via } : {}, hit.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of CANNED) if (c.re.test(msg)) return c.id === 'refuel' && !REFUEL_ON() ? { reply: REFUEL_OFF_ANSWER, canned: true } : c.id === 'polminer' && !pmLive() ? { reply: POLMINER_SOON_ANSWER, canned: true } : c.id === 'warpwares' && !wwLive() ? { reply: wwAnswer(), canned: true } : isBixId(c.id) && !bixLive() ? { reply: BIX_SOON_ANSWER, canned: true } : c.id === 'network-rate' && SYN_N() !== 4 ? { reply: netRateAnswer(SYN_N()), canned: true } : Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
// retrieval: the closest entries ride along in the system prompt (a short follow-up borrows words from the chat so far) // retrieval: the closest entries ride along in the system prompt (a short follow-up borrows words from the chat so far)
let kbBlock = '', kbIds = []; let kbBlock = '', kbIds = [];
try { try {
const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg; const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg;
const hits = sem && sem.hits.length ? sem.hits : await kb.context(query, 5); // the semantic context when the hub answered (2026-11-16) const hits = await kb.context(query, 5);
const hitsOk = hits.filter(h => (pmLive() || !/^(c-)?polminer$/.test(String(h.entry && h.entry.id))) && (wwLive() || !/^(c-)?warpwares$/.test(String(h.entry && h.entry.id))) && (bixLive() || !isBixId(h.entry && h.entry.id)) && (tdLive() || !/^(c-)?turkeydrop$/.test(String(h.entry && h.entry.id)))); // not live yet: keep its answer out of the prompt const hitsOk = hits.filter(h => (pmLive() || !/^(c-)?polminer$/.test(String(h.entry && h.entry.id))) && (tdLive() || !/^(c-)?turkeydrop$/.test(String(h.entry && h.entry.id)))); // not live yet (or season over): keep its answer out of the prompt
kbBlock = kb.promptBlock(hitsOk); kbIds = hitsOk.map(h => h.entry.id); kbBlock = kb.promptBlock(hitsOk); kbIds = hitsOk.map(h => h.entry.id);
} catch (e) { console.error('kb search', e.message); } } catch (e) { console.error('kb search', e.message); }
if (!enabled()) return { reply: 'Good question. The quick answers I have cover packages, payouts, qualification, and joining; for anything deeper, the plain-language contract review at https://instantadpay.com/contract covers most of it, or tap "Send this to support" and Marty will answer.', handoff: true }; if (!enabled()) return { reply: 'Good question. The quick answers I have cover packages, payouts, qualification, and joining; for anything deeper, the plain-language contract review at https://instantadpay.com/contract covers most of it, or tap "Send this to support" and Marty will answer.', handoff: true };
+3 -8
View File
@@ -56,16 +56,12 @@ async function member(id) {
const STALL_DAYS = 3; const STALL_DAYS = 3;
async function describe(acct, now = Date.now()) { async function describe(acct, now = Date.now()) {
const mm = await member(acct.memberId); const mm = await member(acct.memberId);
// unknown = the member is on chain but the read failed just now (member() swallows RPC errors and caches null for a
// minute); rungFor would call them "payouts on, no purchase" and the coach would mail a buyer the first-package nudge
// (2026-10-31 on LinkSpin: Marty, 4 purchases and 7 buyers, got "See a payout land"). Callers that mail must skip unknown.
const unknown = !!(acct.memberId && !mm);
const rung = rungFor(acct, mm); const rung = rungFor(acct, mm);
const last = Math.max(acct.created || 0, acct.lastSeen || 0); const last = Math.max(acct.created || 0, acct.lastSeen || 0);
const quietDays = Math.floor((now - last) / DAY); const quietDays = Math.floor((now - last) / DAY);
const stalled = !unknown && rung < 6 && quietDays >= STALL_DAYS; const stalled = rung < 6 && quietDays >= STALL_DAYS;
const R = RUNGS[rung]; const R = RUNGS[rung];
return { rung, label: R.label, next: R.next, say: R.say, quietDays, stalled, unknown, buyerCount: mm ? mm.buyerCount : 0, return { rung, label: R.label, next: R.next, say: R.say, quietDays, stalled, buyerCount: mm ? mm.buyerCount : 0,
counted: !!(mm && mm.countedAsBuyer), joined: acct.created, lastSeen: acct.lastSeen || 0, onchainSponsorId: mm ? mm.sponsorId : null }; counted: !!(mm && mm.countedAsBuyer), joined: acct.created, lastSeen: acct.lastSeen || 0, onchainSponsorId: mm ? mm.sponsorId : null };
} }
// coaching view for a sponsor: every direct, ladder rung, stalled flag, what to say // coaching view for a sponsor: every direct, ladder rung, stalled flag, what to say
@@ -324,7 +320,6 @@ async function nudgeTick() {
const all = await accounts.listAll(5000); const all = await accounts.listAll(5000);
for (const acct of all) { for (const acct of all) {
if (!acct.email || !acct.created || now - acct.created < STALL_DAYS * DAY) continue; if (!acct.email || !acct.created || now - acct.created < STALL_DAYS * DAY) continue;
if (X.adminEmail && String(acct.email).toLowerCase() === String(X.adminEmail).toLowerCase()) continue; // the site owner is never coached (2026-10-31)
const c = await describe(acct, now); const c = await describe(acct, now);
if (!c.stalled) continue; if (!c.stalled) continue;
const R = RUNGS[c.rung]; if (!R.mail) continue; const R = RUNGS[c.rung]; if (!R.mail) continue;
@@ -340,7 +335,7 @@ async function nudgeTick() {
// weekly member email (Marty, 2026-09-14, modelled on the mailer.gold weekly): credits sitting unspent, // weekly member email (Marty, 2026-09-14, modelled on the mailer.gold weekly): credits sitting unspent,
// the streak, the contest standings with the member's own rank, the tank, and the line for sponsors // the streak, the contest standings with the member's own rank, the tank, and the line for sponsors
let lbWeek = null; try { lbWeek = X.lb ? await X.lb().view('week') : null; } catch (e) {} let lbWeek = null; try { lbWeek = X.lb ? await X.lb().view('week') : null; } catch (e) {}
let tankN = 0; try { tankN = X.tank ? (await X.tank.adoptable()).length : 0; } catch (e) {} let tankN = 0; try { tankN = X.tank ? (await X.tank.waiting()).length : 0; } catch (e) {}
for (const acct of all) { for (const acct of all) {
if (!acct.email) continue; if (!acct.email) continue;
const lastD = await impl().lastDigest(acct.email); const lastD = await impl().lastDigest(acct.email);
-4
View File
@@ -82,7 +82,6 @@ async function bootstrap() {
catch (e) { if (!['ER_DUP_FIELDNAME', 'ER_DUP_KEYNAME'].includes(e.code)) throw e; } catch (e) { if (!['ER_DUP_FIELDNAME', 'ER_DUP_KEYNAME'].includes(e.code)) throw e; }
}; };
await alterSafe('ALTER TABLE promo_codes ADD COLUMN funder VARCHAR(190) NULL'); // member-funded partner codes (Nexus), 2026-09-14 await alterSafe('ALTER TABLE promo_codes ADD COLUMN funder VARCHAR(190) NULL'); // member-funded partner codes (Nexus), 2026-09-14
await alterSafe('ALTER TABLE promo_codes ADD COLUMN starts BIGINT NOT NULL DEFAULT 0'); // a code dormant until this time (Network Weekend, 2026-11-17)
await alterSafe('ALTER TABLE accounts ADD COLUMN username VARCHAR(30) NULL'); await alterSafe('ALTER TABLE accounts ADD COLUMN username VARCHAR(30) NULL');
await alterSafe('ALTER TABLE accounts ADD UNIQUE KEY uq_username (username)'); await alterSafe('ALTER TABLE accounts ADD UNIQUE KEY uq_username (username)');
await alterSafe('ALTER TABLE accounts ADD COLUMN member_id INT NULL'); await alterSafe('ALTER TABLE accounts ADD COLUMN member_id INT NULL');
@@ -345,9 +344,6 @@ async function bootstrap() {
await alterSafe('ALTER TABLE accounts ADD COLUMN joined_via VARCHAR(20) NULL'); // ?v= angle the lead came in on await alterSafe('ALTER TABLE accounts ADD COLUMN joined_via VARCHAR(20) NULL'); // ?v= angle the lead came in on
await alterSafe('ALTER TABLE accounts ADD COLUMN joined_ref VARCHAR(80) NULL'); // referring domain of the first join-page visit await alterSafe('ALTER TABLE accounts ADD COLUMN joined_ref VARCHAR(80) NULL'); // referring domain of the first join-page visit
await alterSafe('ALTER TABLE accounts ADD COLUMN wall_offers VARCHAR(2000) NULL'); // JSON [{title,bannerUrl,targetUrl}] for wall positions 2-3 (unlock at 2 / 5 qualifying buyers) await alterSafe('ALTER TABLE accounts ADD COLUMN wall_offers VARCHAR(2000) NULL'); // JSON [{title,bannerUrl,targetUrl}] for wall positions 2-3 (unlock at 2 / 5 qualifying buyers)
await alterSafe('ALTER TABLE accounts ADD COLUMN profile_quarantined TINYINT NOT NULL DEFAULT 0'); // 2026-10-30 link-farm rule: first profile save of a new free account carried a link (spamscan.js)
await alterSafe('ALTER TABLE accounts ADD COLUMN bix_partner_link VARCHAR(300) NULL'); // BixPay partner link (bixpay.js, 2026-10-29); column name checked against MySQL 8 reserved words
await alterSafe('ALTER TABLE accounts ADD COLUMN theme VARCHAR(8) NULL'); // 2026-11-01 appearance: auto | light | dark (same column as LinkSpin)
// help desk (2026-10-16, tickets.js): one shared desk for IAP and, later, LinkSpin; email_message_id threads inbound mail // help desk (2026-10-16, tickets.js): one shared desk for IAP and, later, LinkSpin; email_message_id threads inbound mail
await q(`CREATE TABLE IF NOT EXISTS tickets ( await q(`CREATE TABLE IF NOT EXISTS tickets (
id INT AUTO_INCREMENT PRIMARY KEY, id INT AUTO_INCREMENT PRIMARY KEY,
-99
View File
@@ -1,99 +0,0 @@
# BixPay card integration (DRAFT for Marty, 2026-10-29)
Scope: InstantAdPay first, LinkSpin second, CTB when it launches. Nothing here is built yet.
## What we know about BIX (verified 2026-10-29)
- BIX = self-custody wallet + Visa card spent from USDT/USDC. Funding networks include Polygon, so a member can swap POL
to USDT in the BIX app and load the card with no bridge. No load fee; up to 3% per purchase, 1% FX.
- Cards: virtual $9.99, plastic $100, metal $250, gold $25,000. US = Visa Signature (29 states); elsewhere Visa Platinum.
- Partner plan: 50% of net fees and card sales -> 45% over 10 levels (15 / 10 / 2.5 x 8) + 5% pool.
- Partner link format: `https://bix.ibportal.io/auth/register?e=<43-char token>&a=1` (opaque token, not derivable from the
IB ID). The referral link (`&appId=3`) makes a card customer only; the PARTNER link makes a partner. We use the partner link.
- Company fallback link: Marty's partner link (IB12143793).
## 1. The profile field (one identity, follows the member)
- InstantAdPay Profile tab, new section **"BixPay card"**: one input, `bixPartnerLink`.
- Accepts a full partner link. Validation: host `bix.ibportal.io`, path `/auth/register`, `e=` present, `a=1`; strip `appId`
if pasted (the customer link) and tell the member "That's the card-customer link. Paste the Partner link from your BIX
portal profile instead." Max 300 chars. Saved on the IAP account; LinkSpin and CTB read it through the existing partner
API (the same way wallet and sponsor already flow), and LinkSpin's own Profile shows it read-only with "Edit on InstantAdPay".
- Member sees under the field: "Where to find it: BIX portal > Profile > Partner (the second box). Copy the link."
- Admin: the field shows on the member card; a count of members with a link set on the admin Overview.
## 2. The link each visitor gets (sponsor follows)
`bixLinkFor(member)` =
1. the member's own `bixPartnerLink`, else
2. walk the sponsor chain up to 10 levels, first sponsor with a link, else
3. the company link (site config `bixCompanyLink`, default Marty's partner link).
The card promo always shows WHOSE link is in play: "Your link" / "Your sponsor @name's link" / "Network link". That nudges
members to add their own, and sponsors to get their teams signed up.
For public pages (games' landing pages, /join/<user>), the referrer whose `?ref` is on the page resolves the same way.
## 3. Where members see it
### Wallet tab (primary)
Card: **"Spend your POL anywhere with a BixPay Visa card"**
"BixPay is a self-custody wallet with a Visa card. Send USDT or USDC to it on Polygon, load the card, and spend it wherever
Visa is accepted, including Apple Pay and Google Pay. Virtual cards from $9.99."
(No in-app swap: Marty confirmed 2026-10-29 he swaps POL to USDT/USDC on an exchange, then sends it to BixPay. The guide
gets a "turn your POL into USDT" step: any exchange or on-ramp, then send on Polygon. Add the swap line only once BIX
ships it; the founder said "in the next three months" on 10-17.)
Buttons: **Get your BixPay card** (partner link) · **How it works** (opens the guide).
Small line: "Using: your link / @sponsor's link / the network link. Add yours in Profile."
### Overview
A one-line announcement card the first week ("New: a Visa card for your POL"), dismissable like the other cards.
### Payout emails + game "link your wallet" nudges
One sentence after the amount: "Want to spend it? A BixPay Visa card turns POL into everyday purchases: <link>."
(Payout emails already carry the member's identity, so the link resolves per member.)
### Promo tools > new tab "BixPay"
- The member's link with Copy/Share.
- 3 posts (short, friendly, the "spend your crypto" angle), an email swipe, and 4 banners we make (no BIX logo until
Marty confirms brand rules; text-only "crypto Visa card" creative is safe).
- Every asset carries the member's resolved link.
### Guide page /bixpay (public, SEO)
What it is, the fee table, the funding path (POL -> USDT on Polygon -> card), the sign-up steps with screenshots, the
partner plan in plain words, and the compliance box. CTA carries the viewer's resolved link.
### Chatbot
Canned answers: what BixPay is, how to get the card, how to load it from POL, where to put my partner link, who gets the
credit. Facts in the system prompt with KNOWLEDGE_DATE.
## 4. Copy (Marty's voice, no em dashes)
- Wallet card title: "Spend your POL anywhere with a BixPay Visa card"
- Body: see above.
- Profile field label: "Your BixPay partner link"
- Profile help: "Join BixPay as a partner, then paste your Partner link here. Members and visitors who get a card through
your pages are credited to you in your BIX portal, up to ten levels deep."
- Email line: "Want to spend it? A BixPay Visa card turns POL into everyday purchases."
- Post 1 (short): "I spend my crypto with a Visa card now. BixPay keeps the keys with you, loads from USDT or USDC with no
load fee, and works with Apple Pay. Virtual card from $9.99: {L}"
- Fees line everywhere: "3% per purchase, no load fee. See BIX's terms for other charges."
- US line on the Wallet card and guide: "Available in 31 US states so far. Not in your state yet? You can still get the
wallet and build."
- Guide: a "Funding your card" section with three paths: (1) swap POL to USDT or USDC on any exchange, send on Polygon;
(2) Cash App (US): send crypto straight to the BixPay wallet; (3) the BIX in-app swap, once it ships.
- Post 2 (friendly): "Earning crypto is one thing. Spending it without jumping through hoops is another. BixPay fixed that
for me: a self-custody wallet and a Visa card in one app. Here's where I got mine: {L}"
- Post 3 (partner angle): "BixPay pays partners on every card and on card spending, ten levels deep. If you're building a
team anyway, this fits right in: {L}"
## 5. Compliance box (shown on the Wallet card's "How it works" and the guide)
"BixPay is a separate company. BIX issues the wallet and the card through its banking partners and sets its own fees,
limits, eligibility and terms. InstantAdPay is not the card issuer and earns a referral commission when you sign up
through a partner link. Card availability varies by country. Crypto assets can lose value."
## 6. Tracking
- Click counts per surface (wallet card, email, promo tools, guide) in the admin Traffic tab; per-member click counts on
the Promo tools BixPay tab. No sign-up credit on our side: the BIX portal shows each partner their directs and levels.
- If BIX ever offers a postback, add a "BixPay sign-ups" stat next to the click counts.
## 7. Rollout
1. IAP: field + resolver + Wallet card + guide + chatbot + promo tab (gated by site config `bixpayLive`).
2. LinkSpin: read-only field + Wallet/Credits card + promo entry, same resolver through the partner API.
3. CTB: same card and field in ctb-next, same identity.
4. Announcement (release note + member email + Telegram) after Marty's copy approval.
## Open questions for Marty / BIX upline
- Does a partner sign-up also get the card, or does the member need the app invitation too? (If both: show "Join as a
partner" and "Just want the card?" buttons, each with the member's own link type.)
- BIX name/logo use in our promo material.
- The pool's "50/50 rule".
- Any updated BIX materials.
-38
View File
@@ -1,38 +0,0 @@
# BixPay opportunity call, 2026-10-17 (Zoom replay notes, made 2026-10-29)
"$iNVU - Live Opportunity Call", 47 min. Host "Bass"; main speaker David Emenite (22-year network marketer; his own company
is a trading opportunity, "tap to trade"); BIX founder "Nick" (28, Germany, says he owns "one of the largest Forex brokers
on the planet"; BIX started "a couple of months ago"); leaders Tracy Fischer, Lisa, Alan Jones, Gary. The $iNVU / trading
company parts are NOT BIX. Transcript: D:/tmp/bix-zoom/transcript.txt; slides D:/tmp/bix-zoom/frames.
## Plan mechanics (as presented; matches the BIX commission PDF)
- The only fee claimed: 3% per transaction. "No top-up fees, no hidden fees." (A third-party review lists 1% FX, $0.75
under $50, ATM $1 + 0.6%, so present 3% as THE fee and point to BIX's terms for the rest.)
- 50% of the 3% goes into the plan; paid over 10 levels: L1 15%, L2 10%, L3-L10 2.5% each; the other 5% = BIX pool,
1 share per 10,000 cards in your network. Worked example: $1,000 spent -> $30 fee -> $15 into the plan.
- Card sales pay too: slide "EARN A 50% REFERRAL BONUS ON EVERY CARD PURCHASE" (virtual $9.99, plastic $100, metal $250,
24K gold $25,000; shipping to 179 countries). The optional $9.99/month rewards membership is also commissionable.
- Upcoming banking (SEPA IBAN, ACH, SWIFT, fiat on/off-ramp): instant 0%, SEPA/ACH 1%, "up to 50% included in the
compensation plan". Nick: IBANs and the in-app SWAP "in the next three months", i.e. NOT live on 10-17.
- Shareholder: 500,000 cards in your network "on a 50/50 rule" = shareholder of BIX (Nick). Network contest: first to
10,000 cards gets a $100,000 bonus. The 50/50 rule is still not defined on the call.
- US: "open in 31 states" (review on 10-24: 29), rest "first part of 2027". Wallet works everywhere; you can build from a
closed state. KYC required for the card; problems go to BIX support.
- Funding tip (Tracy/Bass): Cash App can send crypto straight to the BixPay wallet (about 20 transactions a month, up to
$5,000 a week); they used Coinbase before. Card works in Apple Wallet.
- Usage data quoted: average customer spends $1,400-1,500 a month (industry figure); Bass's back office shows $20-80 a
week per user so far.
## Claims to treat as marketing, not facts
300,000 downloads / 300,000 cards active, $3M spent per day, live since August with global launch ~6 weeks before the
call, "5 million users in one year, 80 million in three, bigger than Revolut", "worth a couple hundred million, $100B in
three years", "$1 to $1 million per day" spend limit, $2.6T daily payments, founder "a billionaire".
## What it changes in our integration draft (BIXPAY-INTEGRATION.md)
1. Don't promise an in-app swap yet. Copy becomes "load it with USDT or USDC on Polygon" until Marty confirms Swap works
in his app; add a short "how to turn POL into USDT" step (any exchange or the BIX swap once live).
2. Fees line: "3% per purchase, no load fee; see BIX's terms for other charges."
3. Lead with the $9.99 virtual card: it pays the referrer on the sale and on every swipe after.
4. US members: add "available in 31 states; not in your state yet? You can still build and get the wallet."
5. Add the Cash App funding path to the guide for non-crypto members (US).
6. Events in the call (Houston 10-20, Tampa 10-21, Bangkok 11-28) are the leaders' own, not ours.
+3 -12
View File
@@ -230,18 +230,9 @@ switched off for members (`sovTiers` 0) until Marty flips it.
|---|---|---|---|---| |---|---|---|---|---|
| `weekly` | Game Pass | 500 credits ($5) | 7 days | the Game Pass in all nine games, the Sunless Vault, weapons unlocked | | `weekly` | Game Pass | 500 credits ($5) | 7 days | the Game Pass in all nine games, the Sunless Vault, weapons unlocked |
| `explorer` | Explorer | 2000 ($20, the Activation package) | 30 days | weapons, gear, 2 DLC islands | | `explorer` | Explorer | 2000 ($20, the Activation package) | 30 days | weapons, gear, 2 DLC islands |
| `champion` | Champion | 5000 ($50, the Builder package) | 30 days | weapons, gear, 4 DLC islands of your choice, level cap 30 | | `champion` | Champion | 5000 ($50, the Builder package) | 30 days | weapons, gear, 4 DLC islands of your choice, the Druid hero, level cap 30 |
| `sovereign` | Sovereign | 10000 ($100, the Growth package) | 30 days | weapons, gear, all DLC islands, level cap 40 | | `sovereign` | Sovereign | 10000 ($100, the Growth package) | 30 days | weapons, gear, all DLC islands, the Necromancer hero, level cap 40 |
| `legend` | Legend | 25000 ($250, the Leader package) | 365 days | weapons, gear, all DLC islands, every bonus hero while active, level cap 40 | | `legend` | Legend | 25000 ($250, the Leader package) | 365 days | weapons, gear, all DLC islands, every hero including the Archer, level cap 40 |
**Bonus heroes (2026-11-05, Marty approved).** Kestrel the Archer, Valda the Barbarian, Morag the Druid and Roland the Paladin are
SOLD ONE TIME (no subscription, no expiry), not by a tier: $20 each (2000 cents, the Activation package) and a $50 bundle (5000, the
Builder package) of Valda, Morag and Roland by default. Paid like a pass: POST /api/my/heroes/buy { hero } opens a waiting order (kind
hero); a fresh package of at least the price from one of the member's own positions fulfils it in `onEvent` (one package, one order, the
highest-priced it covers). Owned heroes live on the passes record (`heroes`, `heroBundle`) and never in `bought`, so they never feed the
Pass Tournament pool. Settings: `heroSales` (sale switch, OFF), `heroPrice<Name>Cents` (0 = free for every account), `heroBundlePriceCents`,
`heroBundleHeroes`, `heroBundleCap` (empty: no cap change; not approved). Shards of Valor reads `heroes`, `heroBundle`, `heroSale` (and
`heroBundleCap` only when set) on the sign-in hand-off. Admin > Game Pass has a hero test on the admin's own account. QA: qa/sov-heroes-store.cjs.
- **One table**: `gamepass.js` `TIER_DEFS` holds the rank, wire key, display name, settings stem, default price/length and the - **One table**: `gamepass.js` `TIER_DEFS` holds the rank, wire key, display name, settings stem, default price/length and the
member-card list for every tier. Rename a tier there (the card, admin pane, charge label and chatbot all read it). member-card list for every tier. Rename a tier there (the card, admin pane, charge label and chatbot all read it).
-192
View File
@@ -1,192 +0,0 @@
// Database-backed data documents (Marty 2026-11-13, standing rule: "everything database-driven ... files only for early
// prototyping"). Every *.json / *.jsonl data document under DATA_DIR that a module reads or writes with the fs *Sync calls lives
// in MySQL instead of on the volume: table `docs` (name = path relative to DATA_DIR, body LONGTEXT, updated_at). The modules keep
// their code; install() routes their fs calls on those paths to an in-memory copy that init() loads from MySQL at boot, and every
// change is written through to MySQL (coalesced per document, newest body wins, in order, retried until it lands).
//
// One writer at a time: init() claims the `docs_writer` row; an older app copy still running during a deploy finds the row taken
// and stops writing (logged), so it can never put stale data over the new copy's (the 2026-11-13 rotator.json loss).
// First boot: a document missing from MySQL is imported from its file, and the file is renamed <name>.imported-<date> (kept, not
// read again). Files the volume keeps on purpose: KEEP (rebuildable caches, uploads, images, the geo database, queues read by
// listing a folder). The SAME file ships in InstantAdPay and LinkSpin.
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const KEEP_FILES = new Set(['chain-index.json']); // a rebuildable cache of the blockchain
const KEEP_DIRS = ['uploads', 'geo', 'refuel-pending', 'backups', 'marks', 'kits', 'kitimg']; // binary files, or folders read by listing
const O = { readFileSync: fs.readFileSync, writeFileSync: fs.writeFileSync, existsSync: fs.existsSync, renameSync: fs.renameSync,
unlinkSync: fs.unlinkSync, statSync: fs.statSync, appendFileSync: fs.appendFileSync };
let ROOT = null, pool = null, ME = crypto.randomBytes(8).toString('hex'), ready = false, writer = true;
const cache = new Map(); // name -> { body: string, at: ms }
const pending = new Map(); // name -> body string | null (delete)
let flushing = false, timer = null;
const stats = { writes: 0, deletes: 0, refused: 0, errors: 0, imported: 0, lastError: null };
function nameOf(p) {
if (!ROOT || typeof p !== 'string' || !/\.jsonl?$/i.test(p)) return null;
const abs = path.resolve(p); if (!abs.startsWith(ROOT + path.sep)) return null;
const rel = abs.slice(ROOT.length + 1).split(path.sep).join('/');
if (KEEP_FILES.has(rel) || KEEP_DIRS.some(d => rel === d || rel.startsWith(d + '/'))) return null;
return rel;
}
const enoent = p => { const e = new Error("ENOENT: no such file or directory, open '" + p + "'"); e.code = 'ENOENT'; e.errno = -2; e.path = p; return e; };
const enc = o => (typeof o === 'string' ? o : o && o.encoding) || null;
function put(name, body) { cache.set(name, { body, at: Date.now() }); pending.set(name, body); kick(); }
function drop(name) { cache.delete(name); pending.set(name, null); kick(); }
function kick() { if (!timer) timer = setTimeout(() => { timer = null; flush().catch(() => {}); }, 300); }
async function flush() {
if (!pool || flushing || !pending.size) return;
flushing = true;
try {
for (const [name, body] of [...pending]) {
if (pending.get(name) !== body) continue; // replaced while we were busy: the newer body goes next round
if (!writer) { pending.delete(name); stats.refused++; continue; }
const c = await pool.getConnection();
try {
await c.beginTransaction();
const [[w]] = await c.query('SELECT owner FROM docs_writer WHERE id = 1 FOR UPDATE');
if (!w || w.owner !== ME) { await c.rollback(); writer = false; pending.delete(name); stats.refused++; console.error('docstore: another app copy took over writing; this copy stops writing'); continue; }
if (body === null) { await c.query('DELETE FROM docs WHERE name = ?', [name]); stats.deletes++; }
else { await c.query('INSERT INTO docs (name, body, updated_at) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE body = VALUES(body), updated_at = VALUES(updated_at)', [name, body, Date.now()]); stats.writes++; }
await c.commit();
if (pending.get(name) === body) pending.delete(name);
} catch (e) { try { await c.rollback(); } catch (x) {} stats.errors++; stats.lastError = String(e.message).slice(0, 200); console.error('docstore write', name, e.message); }
finally { c.release(); }
}
} finally { flushing = false; if (pending.size) setTimeout(() => flush().catch(() => {}), 1000); }
}
// Route the fs *Sync calls on data documents. Installed before any module runs; until init() the documents read from disk.
function install(dataDir) {
if (ROOT) return; ROOT = path.resolve(dataDir);
fs.readFileSync = function (p, o) {
if (!ready && process.env.DOCSTORE_URL && nameOf(p)) console.error('docstore: read before init', p, new Error().stack.split('\n')[2]);
const n = ready ? nameOf(p) : null; if (!n) return O.readFileSync.apply(fs, arguments);
const d = cache.get(n); if (!d) throw enoent(p);
return enc(o) ? d.body : Buffer.from(d.body, 'utf8');
};
fs.existsSync = function (p) { const n = ready ? nameOf(p) : null; return n ? cache.has(n) : O.existsSync.apply(fs, arguments); };
fs.writeFileSync = function (p, data, o) {
const n = ready ? nameOf(p) : null; if (!n) return O.writeFileSync.apply(fs, arguments);
const flag = o && typeof o === 'object' ? o.flag : null;
const s = Buffer.isBuffer(data) ? data.toString('utf8') : String(data);
put(n, flag && flag[0] === 'a' ? ((cache.get(n) || {}).body || '') + s : s);
};
fs.appendFileSync = function (p, data) {
const n = ready ? nameOf(p) : null; if (!n) return O.appendFileSync.apply(fs, arguments);
put(n, ((cache.get(n) || {}).body || '') + (Buffer.isBuffer(data) ? data.toString('utf8') : String(data)));
};
fs.renameSync = function (a, b) {
const nb = ready ? nameOf(b) : null; const na = ready ? nameOf(a) : null;
if (!nb && !na) return O.renameSync.apply(fs, arguments);
let body;
if (na) { const d = cache.get(na); if (!d) throw enoent(a); body = d.body; drop(na); }
else { body = O.readFileSync.call(fs, a, 'utf8'); try { O.unlinkSync.call(fs, a); } catch (e) {} }
if (nb) put(nb, body); else O.writeFileSync.call(fs, b, body);
};
fs.unlinkSync = function (p) { const n = ready ? nameOf(p) : null; if (!n) return O.unlinkSync.apply(fs, arguments); if (!cache.has(n)) throw enoent(p); drop(n); };
fs.statSync = function (p, o) {
const n = ready ? nameOf(p) : null; if (!n) return O.statSync.apply(fs, arguments);
const d = cache.get(n); if (!d) { if (o && o.throwIfNoEntry === false) return undefined; throw enoent(p); }
const size = Buffer.byteLength(d.body, 'utf8'); const t = new Date(d.at);
return { size, mtimeMs: d.at, mtime: t, ctime: t, birthtime: t, isFile: () => true, isDirectory: () => false, isSymbolicLink: () => false };
};
}
// Connect, claim writing, load every document, import files MySQL does not have yet. Throws if MySQL is unreachable: the app
// must not run on an empty copy.
async function init(opts) {
const url = String(process.env.DOCSTORE_URL || '').trim();
if (!url) { console.log('docstore: no DOCSTORE_URL, documents stay files (prototype mode)'); return false; }
const mysql = require('mysql2/promise');
pool = mysql.createPool({ uri: url, connectionLimit: 6, charset: 'utf8mb4' });
await pool.query('CREATE TABLE IF NOT EXISTS docs (name VARCHAR(190) PRIMARY KEY, body LONGTEXT NOT NULL, updated_at BIGINT NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4');
await pool.query('CREATE TABLE IF NOT EXISTS docs_writer (id TINYINT PRIMARY KEY, owner VARCHAR(40) NOT NULL, at BIGINT NOT NULL) ENGINE=InnoDB');
await pool.query('INSERT INTO docs_writer (id, owner, at) VALUES (1, ?, ?) ON DUPLICATE KEY UPDATE owner = VALUES(owner), at = VALUES(at)', [ME, Date.now()]);
const [rows] = await pool.query('SELECT name, body, updated_at FROM docs');
for (const r of rows) cache.set(r.name, { body: r.body, at: Number(r.updated_at) });
for (const sp of (opts && opts.splits) || []) await openSplit(sp);
// first boot for any document: import its file, then set the file aside
const stamp = new Date().toISOString().slice(0, 10);
const walk = dir => { let out = []; let ents = []; try { ents = fs.readdirSync(dir, { withFileTypes: true }); } catch (e) {} for (const e of ents) { const p = path.join(dir, e.name); if (e.isDirectory()) out = out.concat(walk(p)); else out.push(p); } return out; };
for (const p of walk(ROOT)) {
const n = nameOf(p); if (!n || cache.has(n)) continue;
const body = O.readFileSync.call(fs, p, 'utf8');
if (/\.json$/i.test(n) && body.trim()) { try { JSON.parse(body); } catch (e) { throw new Error('docstore: ' + n + ' is not valid JSON; fix or move it before switching to MySQL'); } }
await pool.query('INSERT INTO docs (name, body, updated_at) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE name = name', [n, body, Date.now()]);
const [[got]] = await pool.query('SELECT body FROM docs WHERE name = ?', [n]);
cache.set(n, { body: got.body, at: Date.now() }); stats.imported++;
O.renameSync.call(fs, p, p + '.imported-' + stamp);
}
for (const sp of (opts && opts.splits) || []) await migrateSplit(sp);
ready = true;
console.log('docstore: MySQL documents ready,', cache.size, 'documents,', stats.imported, 'imported from files this boot');
const shut = () => { flush().catch(() => {}).finally(() => {}); };
process.once('beforeExit', shut);
return true;
}
// ---- row tables: an ever-growing array (spin-link clicks) is one row per item, never a rewrite of the whole document ----
// spec { doc: 'rotator.json', field: 'hits', table: 'rot_hits', key: 'id', ts: 'ts' }. rows(table) gives the loaded items (oldest
// first); the module inserts / deletes rows itself and saves its document WITHOUT the field.
const ROWS = new Map(); const rowQ = []; let rowBusy = false;
async function openSplit(sp) {
await pool.query('CREATE TABLE IF NOT EXISTS `' + sp.table + '` (id VARCHAR(64) PRIMARY KEY, ts BIGINT NOT NULL, body MEDIUMTEXT NOT NULL, KEY ts (ts)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4');
const [r] = await pool.query('SELECT body FROM `' + sp.table + '` ORDER BY ts, id');
ROWS.set(sp.table, r.map(x => JSON.parse(x.body)));
}
async function insertMany(table, items, key, ts) {
for (let i = 0; i < items.length; i += 500) {
const part = items.slice(i, i + 500);
await pool.query('INSERT INTO `' + table + '` (id, ts, body) VALUES ? ON DUPLICATE KEY UPDATE body = VALUES(body), ts = VALUES(ts)', [part.map(x => [String(x[key]), Number(x[ts]) || 0, JSON.stringify(x)])]);
}
}
// first boot: the array still inside the document moves to its table, then the document is saved without it
async function migrateSplit(sp) {
const d = cache.get(sp.doc); if (!d) return;
let obj; try { obj = JSON.parse(d.body); } catch (e) { return; }
const arr = Array.isArray(obj[sp.field]) ? obj[sp.field] : null; if (!arr || !arr.length) return;
await insertMany(sp.table, arr, sp.key, sp.ts);
const [[{ n }]] = await pool.query('SELECT COUNT(*) n FROM `' + sp.table + '`');
if (n < arr.length) throw new Error('docstore: ' + sp.table + ' holds ' + n + ' rows after moving ' + arr.length + '; stopping before the document is changed');
const seen = new Set((ROWS.get(sp.table) || []).map(x => String(x[sp.key]))); const merged = (ROWS.get(sp.table) || []).concat(arr.filter(x => !seen.has(String(x[sp.key]))));
merged.sort((a, b) => (Number(a[sp.ts]) || 0) - (Number(b[sp.ts]) || 0)); ROWS.set(sp.table, merged);
obj[sp.field] = []; const body = JSON.stringify(obj);
await pool.query('UPDATE docs SET body = ?, updated_at = ? WHERE name = ?', [body, Date.now(), sp.doc]); cache.set(sp.doc, { body, at: Date.now() });
console.log('docstore:', arr.length, sp.field, 'moved from', sp.doc, 'to table', sp.table);
}
function rows(table) { return ROWS.get(table) || null; }
function rowOp(op) { if (!pool || !writer) return; rowQ.push(op); if (!rowBusy) runRows(); }
async function runRows() {
rowBusy = true;
try {
while (rowQ.length && writer) {
const op = rowQ[0];
try {
if (op.del) await pool.query('DELETE FROM `' + op.table + '` WHERE id IN (?)', [op.ids]);
else await pool.query('INSERT INTO `' + op.table + '` (id, ts, body) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE body = VALUES(body), ts = VALUES(ts)', [op.id, op.ts, op.body]);
rowQ.shift();
} catch (e) { stats.errors++; stats.lastError = String(e.message).slice(0, 200); await new Promise(r => setTimeout(r, 1000)); }
}
} finally { rowBusy = false; }
}
const rowPut = (table, id, ts, obj) => rowOp({ table, id: String(id), ts: Number(ts) || 0, body: JSON.stringify(obj) });
const rowDel = (table, ids) => { const list = [...ids].map(String); for (let i = 0; i < list.length; i += 1000) rowOp({ table, del: true, ids: list.slice(i, i + 1000) }); };
function isOn() { return ready && !!pool; }
// once across app copies (two run side by side during a deploy): true for the first caller of a key, false after. Without MySQL: true.
async function claim(key) {
if (!pool) return true;
await pool.query('CREATE TABLE IF NOT EXISTS doc_claims (k VARCHAR(190) PRIMARY KEY, at BIGINT NOT NULL) ENGINE=InnoDB');
const [r] = await pool.query('INSERT IGNORE INTO doc_claims (k, at) VALUES (?, ?)', [String(key).slice(0, 190), Date.now()]);
return r.affectedRows === 1;
}
// SIGTERM during a deploy: write what is pending, then exit
async function drain(ms) { const end = Date.now() + (ms || 8000); while ((pending.size || flushing || rowQ.length || rowBusy) && Date.now() < end) { await flush().catch(() => {}); await new Promise(r => setTimeout(r, 100)); } }
function view() { return Object.assign({ ready, writer, documents: cache.size, pending: pending.size, rowQueue: rowQ.length, rowTables: Object.fromEntries([...ROWS].map(([k, v]) => [k, v.length])), bytes: [...cache.values()].reduce((t, d) => t + d.body.length, 0) }, stats); }
const names = () => [...cache.keys()]; // every document name (the member erase walks them all, 2026-11-15)
module.exports = { install, init, drain, flush, view, nameOf, rows, rowPut, rowDel, isOn, claim, names };
-316
View File
@@ -1,316 +0,0 @@
'use strict';
// 5xYourTeam "The Draft" partner side (Marty approved the rules 2026-11-15). The network holding tank lives HERE (tank.js);
// 5xYourTeam coaches draft from it through four signed calls, and every pick is a real tank adoption through tank.adopt():
//
// POST /api/partner/draft/pool {} -> { ok, rules, pool: [card], excluded: {why: n} }
// POST /api/partner/draft/adopt { rid, coach, person, kind, week?, slot?, note? } -> { ok, ref, person, adoptionId, at, expires, holdUntil }
// POST /api/partner/draft/release { rid, coach, ref | person, why: 'coach' | 'return' } -> { ok, outcome: 'returned' | 'kept' | 'done' | <closed status>, already? }
// POST /api/partner/draft/status { ids: [person id] } -> { ok, people: { id: milestones | null } }
// coach = { wallet, hubId?, username?, positions } (the 5xYourTeam claim: positions = 5x positions this wallet holds)
// card = { id, username, door, joinedAt, lastSeen, wallet (bool), ready, holdUntil, opensAt, adoptions (outside 5x), adoptionsTotal, games, surfWei, surfCredits }
//
// Signature: X-Draft-Ts (ms) + X-Draft-Sig = hex HMAC-SHA256(DRAFT_PARTNER_SECRET, 'draft.v1.' + ts + '\n' + raw body), 5-minute
// window. A dedicated secret (not NETWORK_SSO_SECRET): this one can move sponsors. adopt and release carry a request id (rid): a
// retried or replayed call answers what the first one did and changes nothing.
//
// The rules (project-5xyourteam-draft, 11-15):
// - only 5xYourTeam position holders draft and coach: the signed claim (positions >= 1) REPLACES InstantAdPay's own-$20-buy rule
// for these calls only (the member's own tank button keeps its $20 rule); a coach needs an account here with a wallet linked,
// and someone on this contract in their line (tank.partnerEligibility); free members cannot adopt
// - the pool = tank.waiting() (rule 3 already applied: nobody the hub reports locked on any contract or sponsored, nobody adopted
// on LinkSpin) minus spam / suspended / flagged, throwaway or mistyped email domains, and anyone adopted twice already
// - max 10 open picks a coach (site setting fiveXDraftCap, its own cap since 2026-11-15, not the tank's); max 2 adoptions per person (every pick counts, both sites)
// - a pick that has not STARTED (payouts on or a first purchase) in 3 days goes back to the pool; a coach cannot release one in its
// first 48 hours; a person who has had their 2 adoptions stays with the coach (the tank sweep rule); started picks stay
// - never anyone locked on a network contract: asked fresh at adopt and at every return; a hub that does not answer refuses / waits
// - 24-hour sign-up grace (tank.adopt refuses it; the card carries opensAt); coaches never see contact data: no email, phone or
// address leaves this module, person ids are hub ids (or an opaque i_ id the hub does not know)
// - the only mail: tank.adopt's normal "X is now your sponsor" adoption email. No switch-on-payouts reminders for picks, no
// payments-topic post (5xYourTeam posts its own Draft Day card)
//
// Auto-assign vs the 3-day window (the conflict the 5x build flagged), the rule implemented:
// - a drafted person is an open adoption with a sponsor, so they are out of the tank: no 24-hour activation hold, no auto-assign,
// no sign-up announcement, no dormant-lead rescue while the pick window runs
// - the pick's adoption row expires at +3 days (not IAP's 7), and tank.sweep leaves it alone (hooks.isDraftPick): this module
// closes it at 3 days with the pick's rule (started = payouts on or a purchase, a wallet alone is not started)
// - a returned pick goes back with their ORIGINAL join time (account `created` is never touched, so no new sign-up grace) and,
// with a wallet linked, a fresh 24-hour activation hold like anyone back in the tank (never the company)
// - sponsor moves go through tank.js setSponsor (sponsorfollow + the hub's /v1/sponsor-change with by 'adopt' / 'release')
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const db = require('./db');
const H = 3600000, D = 86400000;
const RULES = { returnMs: 3 * D, holdMs: 48 * H, maxOpen: 10, maxAdoptions: 2 };
const ADDR = /^0x[0-9a-f]{40}$/;
const lc = v => String(v || '').trim().toLowerCase();
// throwaway / disposable inboxes: the adoption email would go nowhere. Plus a mistyped big-provider domain (emailcheck.js).
const THROWAWAY = new Set(['mailinator.com', 'guerrillamail.com', 'guerrillamail.net', 'sharklasers.com', 'grr.la', '10minutemail.com', 'tempmail.com', 'temp-mail.org',
'yopmail.com', 'trashmail.com', 'getnada.com', 'maildrop.cc', 'dispostable.com', 'throwawaymail.com', 'fakeinbox.com', 'mintemail.com', 'mohmal.com', 'emailondeck.com',
'tempail.com', 'tempr.email', 'discard.email', 'spamgourmet.com', 'mailnesia.com', 'mytemp.email', 'tempmailo.com', 'burnermail.io', 'example.com', 'test.com']);
const DOORS = { iap: 'InstantAdPay', instantadpay: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', dlb: 'Downline Banners', vbb: 'Viral Banner Blitz',
ctb: 'CryptoTeamBuild', fivex: '5xYourTeam', vab: 'ViralAdBlitz', viraladblitz: 'ViralAdBlitz', dh: 'DownlineHydra', btc4hits: 'BTC4Hits', stackpol: 'Stack POL' };
let R = null; // { dataDir, accounts, chain, tank, ads, hooks: { hubInfo, resolvePerson, excluded, spamEmails, networkOn, suggestDomain }, requireHub, clock }
const clock = () => (R && R.clock ? R.clock() : Date.now());
const SECRET = () => String((R && R.secret) || process.env.DRAFT_PARTNER_SECRET || '').trim();
const enabled = () => SECRET().length >= 32;
// ---- storage: MySQL (draft_picks, draft_log) when DATABASE_URL is set, else a JSON document (local QA) ----
const J = {
st: null, FILE: () => path.join(R.dataDir, 'draft-partner.json'),
load() { if (this.st) return this.st; try { this.st = JSON.parse(fs.readFileSync(this.FILE(), 'utf8')); } catch (e) { this.st = null; } if (!this.st || typeof this.st !== 'object') this.st = {}; this.st.nextId = this.st.nextId || 1; this.st.picks = this.st.picks || []; this.st.log = this.st.log || []; return this.st; },
save() { const f = this.FILE(); fs.writeFileSync(f + '.tmp', JSON.stringify(this.load())); fs.renameSync(f + '.tmp', f); },
async add(p) { const s = this.load(); const row = Object.assign({ id: s.nextId++ }, p); s.picks.push(row); this.save(); return Object.assign({}, row); },
async put(p) { const s = this.load(); const i = s.picks.findIndex(x => x.id === p.id); if (i >= 0) s.picks[i] = Object.assign({}, p); this.save(); },
async byId(id) { const x = this.load().picks.find(r => r.id === Number(id)); return x ? Object.assign({}, x) : null; },
async byRid(rid) { const x = this.load().picks.find(r => r.rid === rid); return x ? Object.assign({}, x) : null; },
async byAdoption(aid) { const x = this.load().picks.find(r => r.adoptionId === Number(aid)); return x ? Object.assign({}, x) : null; },
async ofPerson(pid) { return this.load().picks.filter(r => r.personId === pid).map(x => Object.assign({}, x)); },
async open() { return this.load().picks.filter(r => r.status === 'open').map(x => Object.assign({}, x)); },
async openOfCoach(w) { return this.load().picks.filter(r => r.status === 'open' && r.coachWallet === w).map(x => Object.assign({}, x)); },
async recent(n) { return this.load().picks.slice(-(n || 100)).reverse().map(x => Object.assign({}, x)); },
async countsByAdoptee() { const m = new Map(); for (const r of this.load().picks) m.set(r.adoptee, (m.get(r.adoptee) || 0) + 1); return m; },
async log(row) { const s = this.load(); s.log.push(row); if (s.log.length > 2000) s.log = s.log.slice(-2000); this.save(); },
async logs(n) { return this.load().log.slice(-(n || 100)).reverse(); }
};
const COLS = ['rid', 'adoptionId', 'adoptee', 'personId', 'coachEmail', 'coachWallet', 'coachHubId', 'kind', 'week', 'slot', 'ts', 'expires', 'holdUntil', 'status', 'closed', 'outcomeWhy', 'walletAt', 'payoutsAt', 'purchaseAt'];
const SQLC = { rid: 'rid', adoptionId: 'adoption_id', adoptee: 'adoptee', personId: 'person_id', coachEmail: 'coach_email', coachWallet: 'coach_wallet', coachHubId: 'coach_hub_id', kind: 'kind', week: 'week', slot: 'slot', ts: 'ts', expires: 'expires', holdUntil: 'hold_until', status: 'status', closed: 'closed', outcomeWhy: 'outcome_why', walletAt: 'wallet_at', payoutsAt: 'payouts_at', purchaseAt: 'purchase_at' };
const NUM = new Set(['adoptionId', 'ts', 'expires', 'holdUntil', 'closed', 'walletAt', 'payoutsAt', 'purchaseAt']);
const rowP = r => { if (!r) return null; const o = { id: Number(r.id) }; for (const k of COLS) { const v = r[SQLC[k]]; o[k] = NUM.has(k) ? Number(v || 0) : (v == null ? null : String(v)); } return o; };
const Q = {
async add(p) { const r = await db.q('INSERT INTO draft_picks (' + COLS.map(k => SQLC[k]).join(',') + ') VALUES (' + COLS.map(() => '?').join(',') + ')', COLS.map(k => p[k] == null ? null : p[k])); return Object.assign({ id: r.insertId }, p); },
async put(p) { await db.q('UPDATE draft_picks SET ' + COLS.map(k => SQLC[k] + '=?').join(',') + ' WHERE id=?', COLS.map(k => p[k] == null ? null : p[k]).concat([p.id])); },
async byId(id) { return rowP((await db.q('SELECT * FROM draft_picks WHERE id=?', [Number(id)]))[0]); },
async byRid(rid) { return rowP((await db.q('SELECT * FROM draft_picks WHERE rid=?', [rid]))[0]); },
async byAdoption(aid) { return rowP((await db.q('SELECT * FROM draft_picks WHERE adoption_id=?', [Number(aid)]))[0]); },
async ofPerson(pid) { return (await db.q('SELECT * FROM draft_picks WHERE person_id=? ORDER BY id', [pid])).map(rowP); },
async open() { return (await db.q("SELECT * FROM draft_picks WHERE status='open' ORDER BY id")).map(rowP); },
async openOfCoach(w) { return (await db.q("SELECT * FROM draft_picks WHERE status='open' AND coach_wallet=?", [w])).map(rowP); },
async recent(n) { return (await db.q('SELECT * FROM draft_picks ORDER BY id DESC LIMIT ?', [Number(n) || 100])).map(rowP); },
async countsByAdoptee() { return new Map((await db.q('SELECT adoptee, COUNT(*) n FROM draft_picks GROUP BY adoptee')).map(r => [r.adoptee, Number(r.n)])); },
async log(x) { await db.q('INSERT INTO draft_log (ts,op,ok,code,reason,coach,person,ref,rid) VALUES (?,?,?,?,?,?,?,?,?)', [x.ts, x.op, x.ok ? 1 : 0, x.code || null, String(x.reason || '').slice(0, 400), x.coach || null, x.person || null, x.ref || null, x.rid || null]); },
async logs(n) { return (await db.q('SELECT * FROM draft_log ORDER BY id DESC LIMIT ?', [Number(n) || 100])).map(r => ({ ts: Number(r.ts), op: r.op, ok: !!r.ok, code: r.code, reason: r.reason, coach: r.coach, person: r.person, ref: r.ref, rid: r.rid })); }
};
const S = () => (db.enabled() ? Q : J);
async function ensureTables() {
if (!db.enabled()) return;
await db.q(`CREATE TABLE IF NOT EXISTS draft_picks (
id INT AUTO_INCREMENT PRIMARY KEY, rid VARCHAR(80) NOT NULL, adoption_id INT NOT NULL, adoptee VARCHAR(190) NOT NULL, person_id VARCHAR(40) NOT NULL,
coach_email VARCHAR(190) NOT NULL, coach_wallet VARCHAR(42) NOT NULL, coach_hub_id VARCHAR(40) NULL, kind VARCHAR(16) NULL, week VARCHAR(16) NULL, slot VARCHAR(16) NULL,
ts BIGINT NOT NULL, expires BIGINT NOT NULL, hold_until BIGINT NOT NULL, status VARCHAR(16) NOT NULL, closed BIGINT NULL, outcome_why VARCHAR(200) NULL,
wallet_at BIGINT NULL, payouts_at BIGINT NULL, purchase_at BIGINT NULL,
UNIQUE KEY rid (rid), KEY adoption (adoption_id), KEY person (person_id), KEY coach (coach_wallet, status), KEY st (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`); // 5xYourTeam draft picks (each one a tank adoption)
await db.q(`CREATE TABLE IF NOT EXISTS draft_log (
id INT AUTO_INCREMENT PRIMARY KEY, ts BIGINT NOT NULL, op VARCHAR(16) NOT NULL, ok TINYINT NOT NULL, code VARCHAR(40) NULL, reason VARCHAR(400) NULL,
coach VARCHAR(42) NULL, person VARCHAR(40) NULL, ref VARCHAR(40) NULL, rid VARCHAR(80) NULL, KEY t (ts)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`); // every partner call, with its reason
}
// the draft's own cap (Marty 2026-11-15: "5x your team's draft is a different thing altogether"): site setting fiveXDraftCap (default 10),
// counted over open draft picks only; the member's own tank adoptions and holding tank batches never share it (tank.partnerEligibility)
const capOf = () => { const n = Math.round(Number(R && R.maxOpen ? R.maxOpen() : 10)); return n >= 1 && n <= 100 ? n : 10; };
async function init(opts) { R = opts; if (R.tank && R.tank.GRACE_MS) RULES.graceMs = R.tank.GRACE_MS; Object.defineProperty(RULES, 'maxOpen', { get: capOf, enumerable: true, configurable: true }); await ensureTables(); }
// ---- signature ----
function sign(ts, raw, secret) { return crypto.createHmac('sha256', secret || SECRET()).update('draft.v1.' + ts + '\n' + raw).digest('hex'); }
function verify(headers, raw) {
if (!enabled()) return { status: 503, error: 'draft partner not configured' };
const ts = String(headers['x-draft-ts'] || ''), sig = String(headers['x-draft-sig'] || '');
if (!/^\d{13}$/.test(ts) || Math.abs(Date.now() - Number(ts)) > 5 * 60000) return { status: 401, error: 'stale' };
const want = sign(ts, raw);
if (want.length !== sig.length || !crypto.timingSafeEqual(Buffer.from(want), Buffer.from(sig))) return { status: 401, error: 'bad signature' };
try { const b = JSON.parse(raw || '{}'); return b && typeof b === 'object' ? { body: b } : { status: 400, error: 'bad json' }; } catch (e) { return { status: 400, error: 'bad json' }; }
}
// ---- helpers ----
const idOf = email => { const hi = R.hooks && R.hooks.hubInfo ? R.hooks.hubInfo(email) : null; return hi && /^h_[0-9a-f]{16}$/.test(hi.id) ? hi.id : 'i_' + crypto.createHmac('sha256', SECRET() || 'local').update('pid:' + lc(email)).digest('hex').slice(0, 16); };
const doorOf = (email, via) => { const hi = R.hooks && R.hooks.hubInfo ? R.hooks.hubInfo(email) : null; const k = lc((hi && hi.door) || via); return DOORS[k] || (k === 'hub' ? 'Network' : 'InstantAdPay'); };
function throwaway(email) {
const d = lc(email).split('@')[1] || ''; if (!d) return true;
if (THROWAWAY.has(d)) return true;
const fix = R.hooks && R.hooks.suggestDomain ? R.hooks.suggestDomain(d) : null; return !!(fix && fix !== d); // a mistyped provider: the mail bounces
}
function spamSet() { try { return new Set((R.hooks && R.hooks.spamEmails ? R.hooks.spamEmails() : []).map(lc)); } catch (e) { return new Set(); } }
const hubOff = () => R.requireHub !== false && !(R.hooks && R.hooks.networkOn && R.hooks.networkOn());
async function logCall(op, x) { const row = Object.assign({ ts: clock(), op }, x); try { await S().log(row); } catch (e) { console.error('draft log', e.message); } if (!x.ok) console.log('draft', op, 'refused', x.code || '', String(x.reason || '').slice(0, 120)); return row; }
const fail = async (op, code, reason, x) => { await logCall(op, Object.assign({ ok: false, code, reason }, x || {})); return { error: reason, code }; };
function purchasers() { const s = new Set(); for (const ev of R.chain.recentEvents(1e9)) if (ev.type === 'Purchase' && ev.buyerId) s.add(Number(ev.buyerId)); return s; }
// a coach: the wallet that holds the 5x position, then a position wallet here, then the hub's person for the hub id
async function coachAccount(c) {
const w = lc(c && c.wallet); if (!ADDR.test(w)) return { code: 'bad_coach', reason: 'Which coach? (wallet missing)' };
let a = await R.accounts.byAddress(w).catch(() => null);
if (!a && R.accounts.positionOwner) { const po = await R.accounts.positionOwner(w).catch(() => null); if (po && po.email) a = await R.accounts.byEmail(po.email); }
if (!a && c.hubId && R.hooks && R.hooks.resolvePerson) { try { const p = await R.hooks.resolvePerson({ id: String(c.hubId) }); if (p && p.email && !p.blocked) a = await R.accounts.byEmail(lc(p.email)); } catch (e) {} }
if (!a) return { code: 'coach_unknown', reason: 'This coach has no InstantAdPay account yet. Sign in on InstantAdPay once (network sign-in) and link a wallet.' };
return { account: a, wallet: w };
}
// ---- the pool ----
let poolCache = null;
async function poolRows(fresh) {
if (!fresh && poolCache && clock() - poolCache.at < 30000) return poolCache;
const list = await R.tank.waiting(); const spam = spamSet(); const ex = { spam: 0, throwaway: 0, adoptedTwice: 0 };
const local = await R.tank.summaryMap(); const mine = await S().countsByAdoptee(); const rows = [];
for (const w of list) {
if ((R.hooks.excluded && R.hooks.excluded(w.email)) || spam.has(lc(w.email))) { ex.spam++; continue; }
if (throwaway(w.email)) { ex.throwaway++; continue; }
const n = ((local.get(w.email) || {}).count || 0) + (R.tank.remoteCount ? R.tank.remoteCount(w.email) : 0);
if (n >= RULES.maxAdoptions) { ex.adoptedTwice++; continue; }
rows.push({ email: w.email, card: { id: idOf(w.email), username: w.username || null, door: doorOf(w.email, w.via), joinedAt: Number(w.joined) || 0, lastSeen: Number(w.lastSeen) || 0,
// adoptions = OUTSIDE 5xYourTeam (5xYourTeam adds its own picks; counting them here too would double them); adoptionsTotal = all
wallet: !!w.wallet, ready: !!w.ready, holdUntil: w.holdUntil || 0, opensAt: w.opensAt || 0, adoptions: Math.max(0, n - (mine.get(w.email) || 0)), adoptionsTotal: n,
games: null, surfWei: null, surfCredits: Number(w.earned) || 0 } }); // games: InstantAdPay keeps no per-member game record (never invented)
}
poolCache = { at: clock(), rows, excluded: ex }; return poolCache;
}
async function pool() {
if (hubOff()) { await logCall('pool', { ok: false, code: 'hub_off', reason: 'the network hub is off, so locked people cannot be ruled out' }); return { ok: true, rules: rulesView(), pool: [], excluded: {}, hubOff: true }; }
const p = await poolRows(false);
return { ok: true, rules: rulesView(), pool: p.rows.map(r => r.card), excluded: p.excluded };
}
const rulesView = () => ({ returnHours: RULES.returnMs / H, holdHours: RULES.holdMs / H, maxOpen: RULES.maxOpen, maxAdoptions: RULES.maxAdoptions, graceHours: (RULES.graceMs || D) / H });
// ---- adopt ----
async function adopt(b) {
const rid = String(b.rid || '').slice(0, 80); const c = b.coach || {}; const pid = String(b.person || '').slice(0, 40); const kind = /^(draft|instant)$/.test(b.kind) ? b.kind : 'draft';
const x = { coach: lc(c.wallet) || null, person: pid || null, rid };
if (!/^[A-Za-z0-9_.:-]{8,80}$/.test(rid)) return fail('adopt', 'bad_rid', 'A request id (rid) is required.', x);
const prev = await S().byRid(rid);
if (prev) return { ok: true, repeat: true, ref: 'iap:' + prev.id, person: prev.personId, adoptionId: prev.adoptionId, at: prev.ts, expires: prev.expires, holdUntil: prev.holdUntil };
if (!(Number(c.positions) >= 1)) return fail('adopt', 'not_vested', 'Only 5xYourTeam position holders can draft and coach.', x);
if (hubOff()) return fail('adopt', 'hub_off', 'The network hub is off, so nobody can be drafted right now.', x);
const co = await coachAccount(c); if (!co.account) return fail('adopt', co.code, co.reason, x);
if ((await S().openOfCoach(co.wallet)).length >= RULES.maxOpen) return fail('adopt', 'full', 'Your team is full (' + RULES.maxOpen + ' open picks). Help one get started first.', x);
const hit = (await poolRows(true)).rows.find(r => r.card.id === pid);
if (!hit) return fail('adopt', 'gone', 'That player is no longer in the holding tank.', x);
const r = await R.tank.adopt(co.account.email, hit.email, String(b.note || ''), { partner: { positions: Number(c.positions), ttlMs: RULES.returnMs, maxOpen: RULES.maxOpen }, recordNote: '5xYourTeam draft pick (' + kind + (b.week ? ', week ' + String(b.week).slice(0, 10) : '') + (b.slot ? ', slot ' + String(b.slot).slice(0, 10) : '') + ')' });
if (!r || !r.ok) return fail('adopt', (r && r.code) || 'refused', (r && r.error) || 'The tank refused.', x);
poolCache = null;
const now = clock(); const acct = await R.accounts.byEmail(hit.email);
const pick = await S().add({ rid, adoptionId: Number(r.adoption.id), adoptee: hit.email, personId: pid, coachEmail: co.account.email, coachWallet: co.wallet, coachHubId: c.hubId ? String(c.hubId).slice(0, 40) : null,
kind, week: b.week ? String(b.week).slice(0, 16) : null, slot: b.slot ? String(b.slot).slice(0, 16) : null, ts: now, expires: now + RULES.returnMs, holdUntil: now + RULES.holdMs, status: 'open', closed: 0, outcomeWhy: null,
walletAt: acct && acct.address ? now : 0, payoutsAt: 0, purchaseAt: 0 });
await logCall('adopt', Object.assign(x, { ok: true, ref: 'iap:' + pick.id, reason: kind + ' pick by ' + (c.username ? '@' + String(c.username).slice(0, 40) : x.coach) }));
return { ok: true, ref: 'iap:' + pick.id, person: pid, adoptionId: pick.adoptionId, at: pick.ts, expires: pick.expires, holdUntil: pick.holdUntil };
}
// is the pick's adoption still the open one? (released on InstantAdPay itself, moved by a LinkSpin follow, ...) -> closed here too
async function reconcile(p) {
if (p.status !== 'open') return p;
const open = await R.tank.openOf(p.adoptee);
if (open.some(ad => Number(ad.id) === p.adoptionId)) return p;
p.status = 'moved'; p.closed = clock(); p.outcomeWhy = 'the adoption was closed on InstantAdPay (released, moved or followed from LinkSpin)'; await S().put(p);
await logCall('reconcile', { ok: true, code: 'moved', reason: p.outcomeWhy, coach: p.coachWallet, person: p.personId, ref: 'iap:' + p.id });
return p;
}
// milestones seen so far (first-seen times; the chain events carry no timestamps here)
async function observe(p, a, buyers) {
if (!a) return p; const now = clock(); let ch = false;
if (a.address && !p.walletAt) { p.walletAt = now; ch = true; }
if (Number(a.memberId) > 0 && !p.payoutsAt) { p.payoutsAt = now; ch = true; }
if (Number(a.memberId) > 0 && !p.purchaseAt && buyers && buyers.has(Number(a.memberId))) { p.purchaseAt = now; ch = true; }
if (ch) await S().put(p); return p;
}
const started = (p, a) => !!(a && Number(a.memberId) > 0) || !!(p.payoutsAt || p.purchaseAt);
// close one open pick: 'coach' (released after the 48 h hold) or 'return' (3 days, not started). Shared by release() and sweep().
async function closePick(p, why, now) {
const a = await R.accounts.byEmail(p.adoptee);
await observe(p, a, purchasers());
if (started(p, a)) { p.status = 'done'; p.closed = now; p.outcomeWhy = 'started (payouts on or a purchase)'; await S().put(p); await R.tank.closeAdoption(p.adoptionId, 'done'); return { outcome: 'done', why: p.outcomeWhy }; }
if (why === 'coach' && now < p.holdUntil) return { code: 'hold', reason: 'You picked them less than ' + (RULES.holdMs / H) + ' hours ago. Give them a little time first (' + Math.ceil((p.holdUntil - now) / H) + ' h left).' };
if (why === 'return' && now < p.expires) return { code: 'too_early', reason: 'The pick window runs until ' + new Date(p.expires).toISOString() + '.' };
const count = await R.tank.countAll(p.adoptee);
if (count >= RULES.maxAdoptions) { // their second adoption: they stay with this coach (the tank sweep rule, never back to nobody)
p.status = 'kept'; p.closed = now; p.outcomeWhy = 'adopted twice: stays with this coach'; await S().put(p); await R.tank.closeAdoption(p.adoptionId, 'expired');
return { outcome: 'kept', why: p.outcomeWhy };
}
const lk = await R.tank.lockedWhy(p.adoptee);
if (lk === 'unknown') return { code: 'hub_unknown', reason: 'The network record cannot be checked right now. Try again later.' };
if (lk === 'locked') { p.status = 'kept'; p.closed = now; p.outcomeWhy = 'locked on a network contract: never moved'; await S().put(p); await R.tank.closeAdoption(p.adoptionId, 'expired'); return { outcome: 'kept', why: p.outcomeWhy }; }
const note = why === 'return' ? '5xYourTeam pick returned: not started in ' + (RULES.returnMs / D) + ' days' : '5xYourTeam pick released by the coach';
const r = await R.tank.setSponsorDeliberate(p.adoptee, '', 'release', note);
if (r && r.error) return { code: 'refused', reason: r.error };
await R.tank.closeAdoption(p.adoptionId, why === 'return' ? 'expired' : 'dropped'); // both still count toward their two adoptions
p.status = 'returned'; p.closed = now; p.outcomeWhy = note; await S().put(p); poolCache = null;
return { outcome: 'returned', why: note };
}
async function findPick(b) {
const ref = String(b.ref || ''); const m = /^iap:(\d+)$/.exec(ref);
if (m) return S().byId(Number(m[1]));
const pid = String(b.person || ''); const w = lc(b.coach && b.coach.wallet);
const rows = (await S().ofPerson(pid)).filter(p => p.coachWallet === w); return rows.find(p => p.status === 'open') || rows[rows.length - 1] || null;
}
async function release(b) {
const why = b.why === 'return' ? 'return' : 'coach'; const w = lc(b.coach && b.coach.wallet); const rid = String(b.rid || '').slice(0, 80);
const x = { coach: w || null, person: b.person ? String(b.person).slice(0, 40) : null, rid, ref: b.ref ? String(b.ref).slice(0, 40) : null };
let p = await findPick(b);
if (!p) return fail('release', 'no_pick', 'No such pick.', x);
if (p.coachWallet !== w) return fail('release', 'not_yours', 'Not your pick.', x);
x.person = p.personId; x.ref = 'iap:' + p.id;
p = await reconcile(p);
if (p.status !== 'open') { await logCall('release', Object.assign(x, { ok: true, code: 'already', reason: why + ': already ' + p.status })); return { ok: true, already: true, outcome: p.status }; }
const r = await closePick(p, why, clock());
if (!r.outcome) return fail('release', r.code, r.reason, x);
await logCall('release', Object.assign(x, { ok: true, code: r.outcome, reason: why + ': ' + r.why }));
return { ok: true, outcome: r.outcome };
}
// ---- status: milestones for the people 5xYourTeam holds picks for (anyone else answers null) ----
async function status(b) {
const ids = [...new Set((Array.isArray(b.ids) ? b.ids : []).map(v => String(v || '').slice(0, 40)).filter(Boolean))].slice(0, 500);
const buyers = purchasers(); const out = {};
const emails = []; const picksBy = {};
for (const id of ids) { const rows = await S().ofPerson(id); if (!rows.length) { out[id] = null; continue; } picksBy[id] = rows; emails.push(rows[0].adoptee); }
const tot = R.ads && R.ads.earnedTotals ? await R.ads.earnedTotals(emails).catch(() => ({})) : {};
for (const id of Object.keys(picksBy)) {
const rows = picksBy[id]; let last = rows[rows.length - 1]; const email = last.adoptee;
const a = await R.accounts.byEmail(email); if (!a) { out[id] = null; continue; }
last = await reconcile(last); last = await observe(last, a, buyers);
const count = await R.tank.countAll(email);
out[id] = { username: a.username || null, door: doorOf(email, a.joinedVia), lastSeen: Number(a.lastSeen) || 0,
wallet: a.address ? (rows.map(r => r.walletAt).filter(Boolean).sort((x, y) => x - y)[0] || clock()) : 0,
payouts: Number(a.memberId) > 0 ? (last.payoutsAt || clock()) : 0, purchase: Number(a.memberId) > 0 && buyers.has(Number(a.memberId)) ? (last.purchaseAt || clock()) : 0,
adoptions: Math.max(0, count - rows.length), // adoptions outside 5xYourTeam (5x counts its own picks itself)
games: null, surfWei: null, surfCredits: (tot[email] || {}).earned || 0,
pick: { ref: 'iap:' + last.id, status: last.status, coachWallet: last.coachWallet, expires: last.expires, holdUntil: last.holdUntil } };
}
return { ok: true, people: out };
}
// ---- the hourly sweep (server.js, beside tank.sweep): started picks close as done, unstarted ones past 3 days go back ----
let sweeping = null;
function sweep() { if (!sweeping) sweeping = sweepRun().finally(() => { sweeping = null; }); return sweeping; }
async function sweepRun() {
const now = clock(); const out = { done: 0, returned: 0, kept: 0, moved: 0, waiting: 0 }; const buyers = purchasers();
for (let p of await S().open()) {
p = await reconcile(p); if (p.status !== 'open') { out.moved++; continue; }
const a = await R.accounts.byEmail(p.adoptee); await observe(p, a, buyers);
if (!started(p, a) && now < p.expires) continue;
const r = await closePick(p, 'return', now);
if (!r.outcome) { out.waiting++; continue; }
out[r.outcome] = (out[r.outcome] || 0) + 1;
await logCall('sweep', { ok: true, code: r.outcome, reason: r.why, coach: p.coachWallet, person: p.personId, ref: 'iap:' + p.id });
}
return out;
}
// tank.sweep asks this before closing an expired adoption (the pick's own rule decides)
async function isDraftPick(adoptionId) { if (!R) return false; const p = await S().byAdoption(adoptionId); return !!(p && p.status === 'open'); }
async function adminView() { return { enabled: enabled(), rules: rulesView(), hubOff: hubOff(), picks: (await S().recent(200)).map(p => Object.assign({}, p, { adoptee: undefined, coachEmail: undefined })), log: await S().logs(200) }; }
// one entry for the HTTP routes (server.js) and the cross-repo test: op = pool | adopt | release | status
async function handle(op, body) {
if (op === 'pool') return pool();
if (op === 'adopt') return adopt(body);
if (op === 'release') return release(body);
if (op === 'status') return status(body);
return { error: 'unknown op', code: 'unknown_op' };
}
module.exports = { init, enabled, verify, sign, handle, pool, adopt, release, status, sweep, isDraftPick, adminView, RULES, _poolReset: () => { poolCache = null; } };
-199
View File
@@ -1,199 +0,0 @@
// Member erase (Marty 2026-11-15, ticket LS-1021: "I want delete my account data from all your sites"). One named admin action
// that takes a person out of InstantAdPay from INSIDE the running app, so the documents the modules keep in memory and the MySQL
// rows stay consistent (an edit straight in the database would be written back over by the next save).
// POST /api/admin/erase {email, dryRun (default true), force} (admin) and the hub's member.erased event (hubsync.js)
// Refused unless force: a linked main wallet, an on-chain member number, linked positions, anyone sponsored under them here,
// an ad still running or queued (stop it first: skill iap-kill-ad). What goes:
// - the account, sessions, signals, credits (unspent ad credits simply go away), credit log, views, visits, drips, nudges,
// digests, adoptions (as adoptee or adopter), marks, promo redemptions, prospects and pipeline notes, their ads with every
// row that hangs off them (hours, countries, clicks, inbox deliveries, visits, reports);
// - messages: everything they sent; notices and broadcasts to them; a CHAT message another member sent them stays for that
// member, its recipient replaced by a tombstone address;
// - help desk tickets stay as closed history: requester replaced by the tombstone, their own messages blanked;
// - every data document (docs table) that mentions them: their keys, list items and records (scrub.js), through the owning
// module's live state when a module keeps one in memory, else read and written through docstore.
// A tombstone (SHA-256 of the email, kept 30 days in erase.json) stops the LinkSpin and hub syncs from bringing them back while
// the other sites catch up. The log keeps hashes and counts, never the email. Dry run = the same counts, nothing changed.
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const db = require('./db');
const { scrubDeep, scrubText, mentions } = require('./scrub');
let R = null; // { dataDir, accounts, docstore, owners: {doc: {state, save}}, reload: {doc: fn}, forget: [fn(email)] }
const TOMB_MS = 30 * 86400000;
const REMOVED = '[removed: this member asked for their data to be erased]';
const norm = v => String(v || '').trim().toLowerCase();
const hashOf = email => crypto.createHash('sha256').update(norm(email)).digest('hex');
const tombAddr = hash => 'erased-' + hash.slice(0, 12) + '@erased.invalid';
const FILE = () => path.join(R.dataDir, 'erase.json');
let st = null;
function load() {
if (st) return st;
try { st = JSON.parse(fs.readFileSync(FILE(), 'utf8')); } catch (e) { st = null; }
if (!st || typeof st !== 'object') st = {};
st.v = 1; st.tomb = st.tomb || {}; st.log = st.log || [];
return st;
}
function save() { try { const f = FILE(); fs.writeFileSync(f + '.tmp', JSON.stringify(load())); fs.renameSync(f + '.tmp', f); } catch (e) { console.error('erase save', e.message); } }
function init(deps) { R = deps; st = null; load(); }
function isErased(email) {
const s = load(); const h = hashOf(email); const t = s.tomb[h];
if (!t) return false;
if (Date.now() - t > TOMB_MS) { delete s.tomb[h]; save(); return false; }
return true;
}
const like = t => '%' + String(t).replace(/[\\%_]/g, m => '\\' + m) + '%';
async function tables() { return new Set((await db.q('SELECT table_name t FROM information_schema.tables WHERE table_schema = DATABASE()')).map(r => r.t || r.TABLE_NAME)); }
// the SQL work, in order: deletes and the two updates that keep other members' side of a conversation / the desk history
function steps(E, h, campIds, ticketIds, memberMsgIds) {
const S = []; const tomb = tombAddr(h);
const del = (t, where, args) => S.push({ t, where, args, op: 'delete' });
const upd = (t, set, setArgs, where, args) => S.push({ t, where, args, op: 'update', set, setArgs });
del('accounts', 'email=?', [E]); del('sessions', 'email=?', [E]); // first: nothing can sign in or be synced as them while the rest runs
if (campIds.length) for (const t of ['camp_hours', 'camp_geo', 'click_sources', 'solo_inbox', 'visit_seen', 'visit_repeat', 'video_seen', 'ad_reports', 'ad_clicks']) del(t, 'campaign_id IN (?)', [campIds]);
del('campaigns', 'owner_email=?', [E]); del('ad_clicks', 'owner_email=?', [E]);
for (const t of ['account_signals', 'daily_views', 'digests', 'drips', 'earned_credits', 'nudges', 'solo_inbox', 'visit_seen', 'visit_repeat', 'video_seen', 'credit_log', 'promo_redemptions', 'positions']) del(t, 'email=?', [E]);
del('prospects', 'owner_email=?', [E]); del('pipeline_notes', 'owner_email=? OR person=?', [E, E]); del('lead_marks', '`lead`=? OR sponsor=?', [E, E]);
upd('ad_reports', "reporter=''", [], 'reporter=?', [E]); upd('promo_codes', 'funder=NULL', [], 'funder=?', [E]);
del('adoptions', 'adoptee=? OR adopter=?', [E, E]); del('tank_batch_picks', 'adoptee=? OR sponsor=?', [E, E]); // holding tank batches (2026-11-15)
del('event_marks', 'k LIKE ?', [like(E)]); del('doc_claims', 'k LIKE ?', [like(E)]);
del('sponsor_messages', 'from_email=?', [E]);
upd('sponsor_messages', 'to_email=?', [tomb], "to_email=? AND kind='chat'", [E]); // the other member's own words stay theirs
del('sponsor_messages', "to_email=? AND kind<>'chat'", [E]); // notices, alerts, broadcasts: copies made for them alone
if (memberMsgIds.length) del('ticket_translations', 'message_id IN (?)', [memberMsgIds]);
if (ticketIds.length) upd('ticket_messages', 'body=?, attachments=NULL, email_message_id=NULL', [REMOVED], "ticket_id IN (?) AND author='member'", [ticketIds]);
upd('tickets', 'email=?, name=NULL, username=NULL', [tomb], 'email=?', [E]);
return S;
}
// what still mentions them anywhere in the database (every text column of every table but docs); [] = clean
async function residue(E, exact) {
if (!db.enabled()) return [];
const cols = await db.q("SELECT table_name t, column_name c FROM information_schema.columns WHERE table_schema = DATABASE() AND data_type IN ('char','varchar','text','mediumtext','longtext','json') AND table_name NOT IN ('docs','docs_writer')");
const out = [];
for (const r of cols) {
const t = r.t || r.TABLE_NAME, c = r.c || r.COLUMN_NAME; const ex = exact.filter(Boolean); const words = ex.filter(x => x.length >= 5); // a long username inside text too
const where = '`' + c + '` LIKE ?' + ex.map(() => ' OR `' + c + '` = ?').join('') + words.map(() => ' OR `' + c + '` REGEXP ?').join('');
const wordRe = w => '(^|[^a-z0-9_])' + w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '([^a-z0-9_]|$)'; // the whole word, not a longer name
try { const [x] = await db.q('SELECT COUNT(*) n FROM `' + t + '` WHERE ' + where, [like(E)].concat(ex, words.map(wordRe))); if (Number(x.n)) out.push({ table: t, column: c, n: Number(x.n) }); } catch (e) {}
}
return out;
}
function docNames() {
if (R.docstore && R.docstore.isOn && R.docstore.isOn()) return R.docstore.names();
const out = []; const walk = (d, pre) => { let ents = []; try { ents = fs.readdirSync(d, { withFileTypes: true }); } catch (e) {} for (const x of ents) { const p = path.join(d, x.name); if (x.isDirectory()) walk(p, pre + x.name + '/'); else if (/\.jsonl?$/i.test(x.name)) out.push(pre + x.name); } };
walk(R.dataDir, ''); return out;
}
// every data document that mentions them: counted (dry run) or scrubbed, through the module that holds it in memory if any
function docs(needles, dryRun) {
const out = {};
for (const name of docNames()) {
if (name === 'erase.json') continue; // hashes only
const file = path.join(R.dataDir, name); let body;
try { body = fs.readFileSync(file, 'utf8'); } catch (e) { continue; }
if (!mentions(body, needles)) continue;
const own = R.owners[name];
try {
if (own) {
const live = own.state(); const n = scrubDeep(dryRun ? JSON.parse(JSON.stringify(live)) : live, needles);
if (!dryRun && n) own.save(); out[name] = n;
} else {
const r = scrubText(body, needles, /\.jsonl$/i.test(name));
if (!dryRun && r.removed) { fs.writeFileSync(file, r.body); if (R.reload && R.reload[name]) R.reload[name](); }
out[name] = r.removed;
}
} catch (e) { out[name] = 'error: ' + String(e.message).slice(0, 80); }
}
return out;
}
function docResidue(needles) { return docNames().filter(n => n !== 'erase.json').filter(n => { try { return mentions(fs.readFileSync(path.join(R.dataDir, n), 'utf8'), needles); } catch (e) { return false; } }); }
async function blockersOf(acct, E) {
const out = [];
if (acct.address) out.push('main wallet linked');
if (Number(acct.memberId) > 0) out.push('on-chain member #' + acct.memberId);
try { const pos = await R.accounts.positions(E); if (pos && pos.length) out.push('linked positions: ' + pos.length); } catch (e) {}
const refs = [acct.username, acct.code].filter(Boolean).map(norm);
if (refs.length) { const team = (await R.accounts.listByReferrer(refs)).filter(a => norm(a.email) !== E); if (team.length) out.push('sponsored under them here: ' + team.length); }
if (db.enabled()) { const [r] = await db.q("SELECT COUNT(*) n FROM campaigns WHERE owner_email=? AND status IN ('active','queued','paused')", [E]); if (Number(r.n)) out.push('ads still running or queued: ' + r.n + ' (stop them first, skill iap-kill-ad)'); }
return out;
}
// email -> {ok, dryRun, emailHash, found, blockers, sql: {table: rows}, docs: {doc: removed}, residue, docResidue}
async function erase(email, opts) {
const o = Object.assign({ dryRun: true, force: false, by: 'admin', sweep: true }, opts || {});
const E = norm(email); if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(E)) return { error: 'A valid email is required.' };
const h = hashOf(E); const acct = await R.accounts.byEmail(E);
// names: usernames of an account already erased (a second pass after the code learned something new), e.g. ['oldname']
const names = (Array.isArray(o.names) ? o.names : []).map(norm).filter(x => /^[a-z0-9_.-]{5,30}$/.test(x));
const exact = (acct ? [acct.username, acct.code].filter(Boolean).map(norm) : []).concat(names);
const needles = { emails: [E], exact };
const blockers = acct ? await blockersOf(acct, E) : [];
const res = { dryRun: !!o.dryRun, emailHash: h, found: !!acct, blockers, forced: !!o.force && blockers.length > 0, sql: {}, docs: {} };
if (blockers.length && !o.force && !o.dryRun) return Object.assign(res, { error: 'Not erased: ' + blockers.join('; ') + '. Send force: true to erase anyway.' });
let campIds = [], ticketIds = [], memberMsgIds = [], have = new Set();
if (db.enabled()) {
have = await tables();
campIds = (await db.q('SELECT id FROM campaigns WHERE owner_email=?', [E])).map(r => r.id);
ticketIds = have.has('tickets') ? (await db.q('SELECT id FROM tickets WHERE email=?', [E])).map(r => r.id) : [];
memberMsgIds = ticketIds.length ? (await db.q("SELECT id FROM ticket_messages WHERE ticket_id IN (?) AND author='member'", [ticketIds])).map(r => r.id) : [];
}
if (!o.dryRun) { load().tomb[h] = Date.now(); save(); } // before anything goes: the syncs refuse them from here on
if (db.enabled()) {
for (const s of steps(E, h, campIds, ticketIds, memberMsgIds)) {
if (!have.has(s.t)) continue;
const key = s.t + (s.op === 'update' ? ' (kept, scrubbed)' : '');
if (o.dryRun) { const [r] = await db.q('SELECT COUNT(*) n FROM `' + s.t + '` WHERE ' + s.where, s.args); res.sql[key] = (res.sql[key] || 0) + Number(r.n); continue; }
const r = s.op === 'delete' ? await db.q('DELETE FROM `' + s.t + '` WHERE ' + s.where, s.args) : await db.q('UPDATE `' + s.t + '` SET ' + s.set + ' WHERE ' + s.where, s.setArgs.concat(s.args));
res.sql[key] = (res.sql[key] || 0) + Number(r.affectedRows || 0);
}
// other members' chat mute lists that name them
const mutes = await db.q('SELECT email, chat_mutes FROM accounts WHERE chat_mutes LIKE ?', [like(E)]);
let mu = 0; for (const m of mutes) { let list = []; try { list = JSON.parse(m.chat_mutes || '[]'); } catch (e) {} const keep = list.filter(x => norm(x) !== E); if (keep.length !== list.length) { mu++; if (!o.dryRun) await db.q('UPDATE accounts SET chat_mutes=? WHERE email=?', [JSON.stringify(keep), m.email]); } }
if (mu) res.sql['accounts.chat_mutes (others, scrubbed)'] = mu;
// their username inside messages that stay (another member's chat to them, a notice to their sponsor about them): the name
// goes, the message stays. Whole words only, usernames of 5+ characters (a short one could be an ordinary word).
let rd = 0;
for (const u of exact.filter(x => x.length >= 5 && ((acct && norm(acct.username) === x) || names.includes(x)))) {
const re = new RegExp('(^|[^a-z0-9_])@?' + u.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '(?![a-z0-9_])', 'gi');
for (const m of await db.q('SELECT id, subject, body FROM sponsor_messages WHERE subject LIKE ? OR body LIKE ?', [like(u), like(u)])) {
const sub = String(m.subject || '').replace(re, '$1[erased member]'), body = m.body == null ? null : String(m.body).replace(re, '$1[erased member]');
if (sub === m.subject && body === m.body) continue;
rd++; if (!o.dryRun) await db.q('UPDATE sponsor_messages SET subject=?, body=? WHERE id=?', [sub, body, m.id]);
}
}
if (rd) res.sql['sponsor_messages (others, name removed)'] = rd;
} else if (acct && !o.dryRun) { const r = await R.accounts.removeAccount(E); res.sql.accounts = r && r.ok ? 1 : 0; }
else if (acct) res.sql.accounts = 1;
res.docs = docs(needles, o.dryRun);
if (!o.dryRun) for (const f of R.forget || []) { try { f(E); } catch (e) {} } // caches that are not documents (hub lookups, pending pushes)
for (const k of Object.keys(res.sql)) if (!res.sql[k]) delete res.sql[k];
for (const k of Object.keys(res.docs)) if (!res.docs[k]) delete res.docs[k];
if (o.sweep) { res.residue = await residue(E, exact); res.docResidue = o.dryRun ? [] : docResidue(needles); }
if (!o.dryRun) {
const s = load(); s.log.push({ at: Date.now(), by: String(o.by).slice(0, 20), hash: h.slice(0, 16), forced: res.forced, found: res.found,
sql: Object.values(res.sql).reduce((a, b) => a + b, 0), docs: Object.keys(res.docs).length, residue: (res.residue || []).length });
if (s.log.length > 500) s.log = s.log.slice(-500); save();
console.log('member erase', h.slice(0, 16), 'by', o.by, 'sql rows', JSON.stringify(res.sql), 'docs', JSON.stringify(res.docs));
}
res.ok = true; return res;
}
// the hub's member.erased event carries only the SHA-256 of the email: find who here has it (accounts, then the help desk)
async function byHash(hash, by) {
const h = norm(hash); if (!/^[0-9a-f]{64}$/.test(h)) return { result: 'bad-hash' };
let email = null;
for (const a of await R.accounts.identities()) if (hashOf(a.email) === h) { email = norm(a.email); break; }
if (!email && db.enabled()) { try { for (const r of await db.q('SELECT DISTINCT email FROM tickets')) if (hashOf(r.email) === h) { email = norm(r.email); break; } } catch (e) {} }
if (!email) { const s = load(); s.tomb[h] = Date.now(); save(); return { result: 'not-here' }; }
const r = await erase(email, { dryRun: false, by: by || 'hub', sweep: false });
return { result: r.error ? 'refused' : 'erased', error: r.error || null, sql: r.sql, docs: r.docs };
}
function view() { const s = load(); return { tombstones: Object.keys(s.tomb).length, recent: s.log.slice(-20).reverse() }; }
module.exports = { init, erase, byHash, isErased, hashOf, view, _reset: () => { st = null; } };
-55
View File
@@ -1,55 +0,0 @@
// Earners Corner forum sign-in (Marty 2026-11-10): earnerscorner.com runs Discourse with DiscourseConnect, and InstantAdPay is the
// identity provider, so every forum name is a real InstantAdPay account (no separate forum sign-ups to farm). Discourse sends
// /forum/sso?sso=<base64 payload>&sig=<hex HMAC-SHA256>; we check the signature, make sure the visitor is signed in here, and send
// back a signed payload with the member's email, username and groups. Secret: env FORUM_SSO_SECRET (the same value is set in
// Discourse as discourse_connect_secret). Groups: network_members (paying member: an on-chain position) and wallet_linked; in
// Discourse those groups grant the trust level that may post links, so link spam needs a real member behind it.
'use strict';
const crypto = require('crypto');
const SECRET = () => String(process.env.FORUM_SSO_SECRET || '').trim();
const FORUM_URL = () => String(process.env.FORUM_URL || 'https://earnerscorner.com').replace(/\/+$/, '');
const sign = s => crypto.createHmac('sha256', SECRET()).update(s).digest('hex');
// -> { nonce, returnUrl } or { error }
function verify(sso, sig) {
if (SECRET().length < 32) return { error: 'The forum sign-in is not connected yet.' };
sso = String(sso || ''); sig = String(sig || '').toLowerCase();
if (!sso || !/^[0-9a-f]{64}$/.test(sig)) return { error: 'That forum sign-in link is incomplete.' };
const want = Buffer.from(sign(sso), 'hex'), got = Buffer.from(sig, 'hex');
if (want.length !== got.length || !crypto.timingSafeEqual(want, got)) return { error: 'That forum sign-in link is not valid.' };
const q = new URLSearchParams(Buffer.from(sso, 'base64').toString('utf8'));
const nonce = q.get('nonce'), returnUrl = q.get('return_sso_url') || '';
if (!nonce) return { error: 'That forum sign-in link is incomplete.' };
if (!returnUrl.startsWith(FORUM_URL() + '/')) return { error: 'That forum sign-in link points somewhere else.' };
return { nonce, returnUrl };
}
// the signed redirect back to the forum for this account
function redirectFor(v, acct, site) {
const email = String(acct.email || '').toLowerCase();
const groups = [];
if (Number(acct.memberId) > 0) groups.push('network_members');
if (acct.address) groups.push('wallet_linked');
const p = new URLSearchParams({ nonce: v.nonce, email, external_id: email, require_activation: 'false', suppress_welcome_message: 'false' });
if (acct.username) { p.set('username', acct.username); p.set('name', acct.username); }
if (acct.avatarUrl) p.set('avatar_url', /^https?:/.test(acct.avatarUrl) ? acct.avatarUrl : site + acct.avatarUrl);
// no website on sign-in (Marty 2026-11-14): Discourse holds a new user who "entered profile information without reading" for
// approval, and the stackpol.com link we filled in put every new member in the review queue. Members add their own.
if (groups.length) p.set('add_groups', groups.join(','));
const remove = ['network_members', 'wallet_linked'].filter(g => !groups.includes(g)); if (remove.length) p.set('remove_groups', remove.join(','));
const out = Buffer.from(p.toString()).toString('base64');
return v.returnUrl + (v.returnUrl.includes('?') ? '&' : '?') + 'sso=' + encodeURIComponent(out) + '&sig=' + sign(out);
}
// server-to-server: the forum's reward service asks "is this email an activated member, and where are payouts sent?" The request is
// signed with the same shared secret: header x-forum-sig = hex HMAC-SHA256 of "<email>.<unix seconds>", x-forum-ts = those seconds,
// valid for 5 minutes.
function verifyServer(email, ts, sig) {
if (SECRET().length < 32) return false;
const t = Number(ts); if (!(t > 0) || Math.abs(Date.now() / 1000 - t) > 300) return false;
const want = Buffer.from(sign(String(email || '').toLowerCase() + '.' + t), 'hex'), got = Buffer.from(String(sig || ''), 'hex');
return want.length === got.length && crypto.timingSafeEqual(want, got);
}
module.exports = { verify, verifyServer, redirectFor, sign, SECRET, FORUM_URL };
+13 -26
View File
@@ -7,8 +7,6 @@
// //
// Settings (siteConfig): fridayPromo '1'|'0', fridayBonusPct (20), fridayStart 'YYYY-MM-DD' (first // Settings (siteConfig): fridayPromo '1'|'0', fridayBonusPct (20), fridayStart 'YYYY-MM-DD' (first
// Friday, 2026-09-25). Everything reads the chain index, never a marketing counter. // Friday, 2026-09-25). Everything reads the chain index, never a marketing counter.
// Promo days (promodays.js, 2026-11-17): a Friday in the promo map (Black Friday 11-27) pays max(fridayBonusPct, the day's pct),
// ONE bonus per tx, under the day's name; the Thursday notice and email, the kickoff and the wrap-up carry that day's copy.
'use strict'; 'use strict';
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
@@ -19,11 +17,6 @@ const dayOf = ts => new Date(ts).toLocaleDateString('en-CA', { timeZone: TZ });
const weekdayOf = ts => new Date(ts).toLocaleDateString('en-US', { timeZone: TZ, weekday: 'short' }); const weekdayOf = ts => new Date(ts).toLocaleDateString('en-US', { timeZone: TZ, weekday: 'short' });
const hourOf = ts => Number(new Date(ts).toLocaleString('en-US', { timeZone: TZ, hour: 'numeric', hour12: false })); const hourOf = ts => Number(new Date(ts).toLocaleString('en-US', { timeZone: TZ, hour: 'numeric', hour12: false }));
const isFriday = ts => weekdayOf(ts) === 'Fri'; const isFriday = ts => weekdayOf(ts) === 'Fri';
// test clock (2026-11-17): env IAP_TEST_NOW (ISO) for the view and the scheduled moments; ignored when NODE_ENV=production
const clock = () => { const o = process.env.NODE_ENV !== 'production' && process.env.IAP_TEST_NOW; const t = o ? Date.parse(o) : NaN; return Number.isNaN(t) ? Date.now() : t; };
// the promo-day overlay (X.promodays): the effective percent and name for a Friday purchase or moment
const pctAt = (ts, cents) => Math.max(cfg().pct, (X.promodays && X.promodays.fridayPct(ts, cents)) || 0);
const nameAt = ts => (X.promodays && X.promodays.fridayName(ts)) || 'Five Dollar Friday';
function init(opts) { X = opts; FILE = path.join(opts.dataDir, 'friday.json'); S = load(); } function init(opts) { X = opts; FILE = path.join(opts.dataDir, 'friday.json'); S = load(); }
function load() { try { return JSON.parse(fs.readFileSync(FILE, 'utf8')); } catch (e) { return { granted: {}, posts: {}, badges: {}, sent: {} }; } } function load() { try { return JSON.parse(fs.readFileSync(FILE, 'utf8')); } catch (e) { return { granted: {}, posts: {}, badges: {}, sent: {} }; } }
@@ -72,29 +65,26 @@ function stats(dayKey) {
} }
// public view // public view
function view() { function view() {
const c = cfg(); const now = clock(); const live = liveNow(now); const next = nextFriday(now); const c = cfg(); const now = Date.now(); const live = liveNow(now); const next = nextFriday(now);
const nextTs = next ? Date.parse(next + 'T12:00:00Z') : 0; // midday UTC = morning Central of that Friday return { on: c.on, pct: c.pct, live, today: live ? stats(dayOf(now)) : null, nextFriday: next, nextLabel: next ? labelOf(next) : null, start: c.start };
return { on: c.on, pct: live ? pctAt(now) : (next ? pctAt(nextTs) : c.pct), name: live ? nameAt(now) : (next ? nameAt(nextTs) : 'Five Dollar Friday'), live, today: live ? stats(dayOf(now)) : null, nextFriday: next, nextLabel: next ? labelOf(next) : null, start: c.start };
} }
// the bonus: once per purchase tx, on a Friday on or after the start // the bonus: once per purchase tx, on a Friday on or after the start
async function onEvent(ev) { async function onEvent(ev) {
if (!ev || ev.type !== 'Purchase' || !liveNow(ev.ts) || ev.priceCents < 500) return null; if (!ev || ev.type !== 'Purchase' || !liveNow(ev.ts) || ev.priceCents < 500) return null;
if (S.granted[ev.tx]) return null; if (S.granted[ev.tx]) return null;
const c = Object.assign({}, cfg(), { pct: pctAt(ev.ts, ev.priceCents) }); const nm = nameAt(ev.ts); const bonus = Math.round((Number(ev.creditAmount) || 0) * c.pct / 100); const c = cfg(); const bonus = Math.round((Number(ev.creditAmount) || 0) * c.pct / 100);
if (bonus <= 0) return null; if (bonus <= 0) return null;
const a = await X.accounts.byMemberId(ev.buyerId); if (!a || !a.email) return null; const a = await X.accounts.byMemberId(ev.buyerId); if (!a || !a.email) return null;
const usd = ('$' + (ev.priceCents / 100).toFixed(2)).replace(/\.00$/, ''); const usd = ('$' + (ev.priceCents / 100).toFixed(2)).replace(/\.00$/, '');
await X.ads.addEarned(a.email, bonus, { purchased: true, log: { kind: 'bonus', note: nm + ': +' + c.pct + '% on your ' + usd + ' package', ref: 'fdf:' + String(ev.tx).slice(0, 30) } }); await X.ads.addEarned(a.email, bonus, { purchased: true, log: { kind: 'bonus', note: 'Five Dollar Friday: +' + c.pct + '% on your ' + usd + ' package', ref: 'fdf:' + String(ev.tx).slice(0, 30) } });
S.granted[ev.tx] = { day: dayOf(ev.ts), memberId: ev.buyerId, bonus, at: Date.now() }; save(); S.granted[ev.tx] = { day: dayOf(ev.ts), memberId: ev.buyerId, bonus, at: Date.now() }; save();
try { await X.notify(ev.buyerId, nm + ': +' + bonus + ' bonus credits', nm !== 'Five Dollar Friday' try { await X.notify(ev.buyerId, 'Five Dollar Friday: +' + bonus + ' bonus credits', 'Your ' + usd + ' package landed on a Five Dollar Friday, so ' + bonus + ' bonus credits (+' + c.pct + '%) were added to your balance. Every pack bought on a Friday gets this. See your balance: https://instantadpay.com/my#campaigns', 'notice'); } catch (e) {}
? 'Your ' + usd + ' package landed on ' + nm + ', so ' + bonus + ' bonus ad credits (+' + c.pct + '%) were added to your balance, in place of the usual Five Dollar Friday +20%. Ad credits buy advertising, not income. See your balance: https://instantadpay.com/my#campaigns\n\nEvery Network Weekend deal across the network: https://instantadpay.com/weekend'
: 'Your ' + usd + ' package landed on a Five Dollar Friday, so ' + bonus + ' bonus credits (+' + c.pct + '%) were added to your balance. Every pack bought on a Friday gets this. See your balance: https://instantadpay.com/my#campaigns', 'notice'); } catch (e) {}
// the wave, every ten packs // the wave, every ten packs
const st = stats(dayOf(ev.ts)); const st = stats(dayOf(ev.ts));
if (st.packs > 0 && st.packs % 10 === 0 && !S.posts[st.day + ':' + st.packs]) { if (st.packs > 0 && st.packs % 10 === 0 && !S.posts[st.day + ':' + st.packs]) {
S.posts[st.day + ':' + st.packs] = Date.now(); save(); S.posts[st.day + ':' + st.packs] = Date.now(); save();
X.telegram('\u{1F4B5} <b>' + nm + '</b> · <b>' + st.packs + ' packs</b> so far today from ' + st.buyers + ' buyers, <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members in the same transactions.\nEvery $5+ pack today earns +' + c.pct + '% credits: https://instantadpay.com/my#buy').catch(() => {}); X.telegram('\u{1F4B5} <b>Five Dollar Friday</b> · <b>' + st.packs + ' packs</b> so far today from ' + st.buyers + ' buyers, <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members in the same transactions.\nEvery $5+ pack today earns +' + c.pct + '% credits: https://instantadpay.com/my#buy').catch(() => {});
} }
return bonus; return bonus;
} }
@@ -117,28 +107,25 @@ function earnedBadge(memberId) {
// Saturday 00:xx CT wrap-up of the Friday that just ended // Saturday 00:xx CT wrap-up of the Friday that just ended
async function tick() { async function tick() {
const c = cfg(); if (!c.on) return; const c = cfg(); if (!c.on) return;
const now = clock(); const day = dayOf(now); const wd = weekdayOf(now); const h = hourOf(now); const now = Date.now(); const day = dayOf(now); const wd = weekdayOf(now); const h = hourOf(now);
const next = nextFriday(now); const next = nextFriday(now);
if (wd === 'Thu' && h >= 18 && next && !S.sent['thu:' + next] && await claimOnce('fri:thu:' + next)) { if (wd === 'Thu' && h >= 18 && next && !S.sent['thu:' + next] && await claimOnce('fri:thu:' + next)) {
S.sent['thu:' + next] = now; save(); S.sent['thu:' + next] = now; save();
const promo = X.promodays && X.promodays.thursdayCopy(next); // Thanksgiving 11-26: the Black Friday copy instead, one message const subject = 'Tomorrow is Five Dollar Friday';
const subject = promo ? promo.subject : 'Tomorrow is Five Dollar Friday'; const text = 'Tomorrow is Five Dollar Friday on InstantAdPay.\n\nAny ad package of $5 or more bought on Friday (Central time) earns +' + c.pct + '% bonus credits, added the moment the purchase settles. Your $5 pays your sponsor line the second it clears, and your line’s $5s pay you. Friday is when we all push at once.\n\nLine up your pack: https://instantadpay.com/my#buy\nWatch the wave on the live ledger: https://instantadpay.com/ledger';
const text = promo ? promo.text : 'Tomorrow is Five Dollar Friday on InstantAdPay.\n\nAny ad package of $5 or more bought on Friday (Central time) earns +' + c.pct + '% bonus credits, added the moment the purchase settles. Your $5 pays your sponsor line the second it clears, and your line’s $5s pay you. Friday is when we all push at once.\n\nGame Pass too: the same Friday purchase gives you a free 7-day Game Pass for every game in the network (once per Friday, added automatically), and the $5 pack lands as 600 credits that you keep for your ads.\n\nLine up your pack: https://instantadpay.com/my#buy\nWatch the wave on the live ledger: https://instantadpay.com/ledger';
await broadcast(subject, text); await broadcast(subject, text);
} }
if (wd === 'Fri' && h >= c.kickHour && day >= c.start && !S.sent['kick:' + day] && await claimOnce('fri:kick:' + day)) { if (wd === 'Fri' && h >= c.kickHour && day >= c.start && !S.sent['kick:' + day] && await claimOnce('fri:kick:' + day)) {
S.sent['kick:' + day] = now; save(); S.sent['kick:' + day] = now; save();
if (nameAt(now) !== 'Five Dollar Friday') X.telegram('\u{1F4B5} <b>It’s ' + nameAt(now) + '. Network Weekend is live</b>, midnight to midnight Central through Cyber Monday. Any ad package from $5 up earns <b>+' + pctAt(now) + '% bonus ad credits</b> today, and every pack pays its sponsor line in the same transaction. The same purchase gives you a free 7-day Game Pass. Ad credits buy advertising, not income. Every deal on the network: https://instantadpay.com/weekend').catch(() => {}); X.telegram('\u{1F4B5} <b>It’s Five Dollar Friday.</b> Any ad package from $5 up earns <b>+' + c.pct + '% credits</b> today, and every pack pays its sponsor line in the same transaction. Buy yours, then watch the ledger fill up: https://instantadpay.com/my#buy').catch(() => {});
else X.telegram('\u{1F4B5} <b>It’s Five Dollar Friday.</b> Any ad package from $5 up earns <b>+' + c.pct + '% credits</b> today, and every pack pays its sponsor line in the same transaction. Game Pass day too: the same purchase gives you a free 7-day Game Pass for every game (once per Friday, automatic), and the $5 pack lands as 600 credits you keep for ads. Buy yours, then watch the ledger fill up: https://instantadpay.com/my#buy').catch(() => {});
} }
if (wd === 'Sat' && h < 3) { if (wd === 'Sat' && h < 3) {
const fri = dayOf(now - 86400000); const fri = dayOf(now - 86400000);
if (isFriday(now - 86400000) && fri >= c.start && !S.sent['wrap:' + fri] && await claimOnce('fri:wrap:' + fri)) { if (isFriday(now - 86400000) && fri >= c.start && !S.sent['wrap:' + fri] && await claimOnce('fri:wrap:' + fri)) {
S.sent['wrap:' + fri] = now; save(); S.sent['wrap:' + fri] = now; save();
const st = stats(fri); const top = await topLines(fri); const st = stats(fri); const top = await topLines(fri);
const wn = nameAt(now - 86400000); const promoFri = wn !== 'Five Dollar Friday'; X.telegram('\u{1F3C1} <b>Five Dollar Friday wrap-up</b> (' + labelOf(fri) + ')\n<b>' + st.packs + ' packs</b> from ' + st.buyers + ' buyers · $' + st.usd.toFixed(0) + ' in ad packages · <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members · ' + st.bonusCredits.toLocaleString() + ' bonus credits handed out'
X.telegram('\u{1F3C1} <b>' + wn + ' wrap-up</b> (' + labelOf(fri) + ')\n<b>' + st.packs + ' packs</b> from ' + st.buyers + ' buyers · $' + st.usd.toFixed(0) + ' in ad packages · <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members · ' + st.bonusCredits.toLocaleString() + ' bonus credits handed out' + (top.length ? '\nBiggest lines today: ' + top.map(t => t.who + ' (' + t.packs + ')').join(', ') : '') + '\nNext one is a week away. Line it up: https://instantadpay.com/my#buy').catch(() => {});
+ (top.length ? '\nBiggest lines today: ' + top.map(t => t.who + ' (' + t.packs + ')').join(', ') : '') + (promoFri ? '\nNetwork Weekend carries on: +20% on $5+ packs Saturday and Sunday, +30% on $20+ on Cyber Monday. Every deal: https://instantadpay.com/weekend' : '\nNext one is a week away. Line it up: https://instantadpay.com/my#buy')).catch(() => {});
} }
} }
} }
@@ -153,7 +140,7 @@ async function topLines(dayKey) {
// on-site notice + email to every active member (quiet 45+ days skipped, drip unsubscribes honoured) // on-site notice + email to every active member (quiet 45+ days skipped, drip unsubscribes honoured)
async function broadcast(subject, text) { async function broadcast(subject, text) {
let all = []; try { all = await X.accounts.listAll(5000); } catch (e) { return; } let all = []; try { all = await X.accounts.listAll(5000); } catch (e) { return; }
const now = clock(); let n = 0; const now = Date.now(); let n = 0;
for (const a of all) { for (const a of all) {
if (!a.email) continue; if (!a.email) continue;
if (now - (a.lastSeen || a.created || 0) > 45 * 86400000) continue; if (now - (a.lastSeen || a.created || 0) > 45 * 86400000) continue;
+25 -236
View File
@@ -36,8 +36,8 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
const TZ = 'America/Chicago'; const TZ = 'America/Chicago';
const GAMES = ['polhunter', 'gemkingdom', 'spellwheel', 'spookydoors', 'polywarriors', 'clutterhunt', 'polybreak', 'driprunner', 'roadagent', 'shardsofvalor', 'polminer', 'warpwares', 'turkeydrop']; const GAMES = ['polhunter', 'gemkingdom', 'spellwheel', 'spookydoors', 'polywarriors', 'clutterhunt', 'polybreak', 'driprunner', 'roadagent', 'shardsofvalor', 'polminer', 'turkeydrop'];
const NAMES = { polhunter: 'PolHunter', gemkingdom: 'Gem Kingdom', spellwheel: 'SpellWheel', spookydoors: 'Spooky Doors', polywarriors: 'PolyWarriors', clutterhunt: 'ClutterHunt', polybreak: 'PolyBreak', driprunner: 'Drip Runner', roadagent: 'Road Agent', shardsofvalor: 'Shards of Valor', polminer: 'POL Miner', warpwares: 'Warp & Wares', turkeydrop: 'Turkey Drop' }; const NAMES = { polhunter: 'PolHunter', gemkingdom: 'Gem Kingdom', spellwheel: 'SpellWheel', spookydoors: 'Spooky Doors', polywarriors: 'PolyWarriors', clutterhunt: 'ClutterHunt', polybreak: 'PolyBreak', driprunner: 'Drip Runner', roadagent: 'Road Agent', shardsofvalor: 'Shards of Valor', polminer: 'POL Miner', turkeydrop: 'Turkey Drop' };
const SHARES = [0.5, 0.3, 0.2]; // tournament prize split, places 1-3 const SHARES = [0.5, 0.3, 0.2]; // tournament prize split, places 1-3
const KEEP_DAYS = 90; // answered refs and day rows are kept this long (idempotency window) const KEEP_DAYS = 90; // answered refs and day rows are kept this long (idempotency window)
// THE pass table (2026-10-22, Dallas's structure, Marty approved): lowest to highest, a higher tier includes everything below. // THE pass table (2026-10-22, Dallas's structure, Marty approved): lowest to highest, a higher tier includes everything below.
@@ -52,11 +52,11 @@ const TIER_DEFS = [
{ key: 'explorer', name: 'Explorer', set: 'Explorer', price: 2000, days: 30, { key: 'explorer', name: 'Explorer', set: 'Explorer', price: 2000, days: 30,
perks: ['Everything in the Game Pass, in every game', 'Shards of Valor: weapons and gear unlocked', 'Shards of Valor: 2 bonus islands'] }, perks: ['Everything in the Game Pass, in every game', 'Shards of Valor: weapons and gear unlocked', 'Shards of Valor: 2 bonus islands'] },
{ key: 'champion', name: 'Champion', set: 'Champion', price: 5000, days: 30, { key: 'champion', name: 'Champion', set: 'Champion', price: 5000, days: 30,
perks: ['Everything in Explorer', 'Shards of Valor: 4 bonus islands of your choice', 'Shards of Valor: level cap 30'] }, // 2026-11-05: the Druid moved to the one-time bonus heroes perks: ['Everything in Explorer', 'Shards of Valor: 4 bonus islands of your choice', 'Shards of Valor: the Druid hero', 'Shards of Valor: level cap 30'] },
{ key: 'sovereign', name: 'Sovereign', set: 'Sovereign', price: 10000, days: 30, { key: 'sovereign', name: 'Sovereign', set: 'Sovereign', price: 10000, days: 30,
perks: ['Everything in Champion', 'Shards of Valor: every bonus island', 'Shards of Valor: level cap 40'] }, // 2026-11-05: the Necromancer was dropped perks: ['Everything in Champion', 'Shards of Valor: every bonus island', 'Shards of Valor: the Necromancer hero', 'Shards of Valor: level cap 40'] },
{ key: 'legend', name: 'Legend', set: 'Legend', price: 25000, days: 365, { key: 'legend', name: 'Legend', set: 'Legend', price: 25000, days: 365,
perks: ['Everything in Sovereign, for a full year', 'Shards of Valor: every bonus island', 'Shards of Valor: every bonus hero while Legend is active (Kestrel, Valda, Morag, Roland), and every new hero as it ships', 'Shards of Valor: level cap 40'] }, // new heroes as a Legend perk: Marty 2026-10-30 (Dallas's $100/year idea folded in here) perks: ['Everything in Sovereign, for a full year', 'Shards of Valor: every bonus island', 'Shards of Valor: every hero, the Archer included', 'Shards of Valor: level cap 40'] },
]; ];
const TIERS = TIER_DEFS.map(d => d.key); // lowest to highest const TIERS = TIER_DEFS.map(d => d.key); // lowest to highest
const TIER_NAMES = Object.fromEntries(TIER_DEFS.map(d => [d.key, d.name])); const TIER_NAMES = Object.fromEntries(TIER_DEFS.map(d => [d.key, d.name]));
@@ -64,30 +64,9 @@ const TIER_DEF = Object.fromEntries(TIER_DEFS.map(d => [d.key, d]));
const tierOk = t => TIERS.includes(t); const tierOk = t => TIERS.includes(t);
const rowTier = b => (b && tierOk(b.tier)) ? b.tier : 'weekly'; // bought rows before 2026-10-18 have no tier: weekly const rowTier = b => (b && tierOk(b.tier)) ? b.tier : 'weekly'; // bought rows before 2026-10-18 have no tier: weekly
const r6 = x => Math.round((Number(x) || 0) * 1e6) / 1e6; const r6 = x => Math.round((Number(x) || 0) * 1e6) / 1e6;
// Bonus heroes for Shards of Valor (Marty approved 2026-11-05, Dallas's request): SOLD ONE TIME, no subscription, owned for good. Paid
// exactly like a pass: no credits, no direct POL; buying opens a waiting order, fulfilled by a FRESH package of at least the price
// bought by one of the member's own positions, so the sponsor line is paid as usual (onEvent). $20 each = the Activation package; the
// $50 bundle (the Builder package) is a settings list, default Valda + Morag + Roland (Dallas 13:26; Marty approved a $50 bundle of
// three). Settings (Admin > Settings, no deploy): heroSales (sale switch, default OFF), heroPrice<Set>Cents per hero (0 = free for
// every account, granted like a base hero), heroBundlePriceCents, heroBundleHeroes, heroBundleCap (a level the bundle would raise the
// cap to; UNSET = no cap change, Marty has not approved one). key = the wire value Shards of Valor reads (classes.json paid buy).
// 2026-11-14 (Marty approved, "Yes make it free"; Dallas: "The Archer should be free to everyone at level 20"): Kestrel is FREE for every
// player once a hero in their party reaches level 20 (the game decides, Shards of Valor classes.json freeAt) and is NOT SOLD here any more
// (freeAt): no buy, not in any bundle, waiting Kestrel orders are cancelled unpaid. A member who bought her keeps her (record.heroes.kestrel);
// nothing refunded. Valda, Morag and Roland, the $50 bundle and every price are unchanged.
const HERO_DEFS = [
{ key: 'kestrel', set: 'Kestrel', name: 'Kestrel the Archer', price: 2000, freeAt: 20, blurb: 'Quick and sharp-eyed: arrows on every foe.' },
{ key: 'valda', set: 'Valda', name: 'Valda the Barbarian', price: 2000, blurb: 'A berserker: hits harder the more she is hurt, light on armour.' },
{ key: 'morag', set: 'Morag', name: 'Morag the Druid', price: 2000, blurb: 'A healer of the wild: heals the whole party.' },
{ key: 'roland', set: 'Roland', name: 'Roland the Paladin', price: 2000, blurb: 'A holy knight: sword and shield, heals one hero at a time.' },
];
const HERO_KEYS = HERO_DEFS.map(d => d.key);
const HERO_DEF = Object.fromEntries(HERO_DEFS.map(d => [d.key, d]));
const HERO_SOLD = HERO_DEFS.filter(d => !d.freeAt).map(d => d.key); // free at a level in the game (Kestrel at 20): never sold, never in a bundle
const HERO_BUNDLE_DEFAULT = 'valda,morag,roland';
let R = null; // deps from server.js let R = null; // deps from server.js
let passes, orders, prizes, stackpro; // stackpro: Stack POL Pro owners, email -> { ts, tx, cents, order } (2026-11-09). durable persisted maps (server.js open-tokens store, DURABLE set) let passes, orders, prizes; // durable persisted maps (server.js open-tokens store, DURABLE set)
let L = null; // the cap ledger: { members: { email: { days: {}, deferred: {}, weeks: {} } }, refs: { 'game:ref': {...} } } let L = null; // the cap ledger: { members: { email: { days: {}, deferred: {}, weeks: {} } }, refs: { 'game:ref': {...} } }
let saveTimer = null; let saveTimer = null;
@@ -122,23 +101,11 @@ function cfg() {
sale: on('gamePassEnabled') && on('sovTiers') && !offExplicit('gamePass' + d.set + 'Enabled') }])), sale: on('gamePassEnabled') && on('sovTiers') && !offExplicit('gamePass' + d.set + 'Enabled') }])),
tournamentTierSales: on('passTournamentTierSales'), // off: only weekly pass sales feed the Pass Tournament pool (exactly as before tiers) tournamentTierSales: on('passTournamentTierSales'), // off: only weekly pass sales feed the Pass Tournament pool (exactly as before tiers)
free: { daily: Math.max(0, n('capFreeDaily', 0.30)), total: Math.max(0, n('capFreeTotal', 2.0)) }, free: { daily: Math.max(0, n('capFreeDaily', 0.30)), total: Math.max(0, n('capFreeTotal', 2.0)) },
// the free allowance (Marty 2026-11-02, "cap these so that if the user wants to keep playing they spend a tiny amount"):
// the most game POL an account EVER receives while it holds no pass, across every game. After that, progress rewards
// wait as deferred until a pass is active and repeatable rewards are dropped. 2 POL default; admin key capFreeLifetime.
freeLifetime: Math.max(0, n('capFreeLifetime', 2.0)),
pass: { daily: Math.max(0, n('capPassDaily', 1.50)), total: Math.max(0, n('capPassTotal', 5.0)) }, pass: { daily: Math.max(0, n('capPassDaily', 1.50)), total: Math.max(0, n('capPassTotal', 5.0)) },
start: /^\d{4}-\d{2}-\d{2}$/.test(start) ? start : '', start: /^\d{4}-\d{2}-\d{2}$/.test(start) ? start : '',
pct: Math.max(0, n('passTournamentPct', 5)), pct: Math.max(0, n('passTournamentPct', 5)),
gamesChat: String(sc.telegramGamesChatId || sc.telegramEchoChatId || '').trim(), gamesChat: String(sc.telegramGamesChatId || sc.telegramEchoChatId || '').trim(),
gamesTopic: String(sc.telegramGamesTopicId || '').trim(), gamesTopic: String(sc.telegramGamesTopicId || '').trim(),
heroes: (() => {
const price = Object.fromEntries(HERO_DEFS.map(d => [d.key, Math.max(0, Math.round(n('heroPrice' + d.set + 'Cents', d.price)))]));
const raw = sc.heroBundleHeroes == null || String(sc.heroBundleHeroes).trim() === '' ? HERO_BUNDLE_DEFAULT : String(sc.heroBundleHeroes);
const list = [...new Set(raw.split(',').map(x => x.trim().toLowerCase()).filter(k => HERO_SOLD.includes(k) && price[k] > 0))];
const capRaw = String(sc.heroBundleCap == null ? '' : sc.heroBundleCap).trim(), cap = capRaw === '' ? NaN : Number(capRaw);
return { sale: on('heroSales'), price, free: HERO_KEYS.filter(k => price[k] === 0), bundle: { heroes: list.length >= 2 ? list : [], price: Math.max(1, Math.round(n('heroBundlePriceCents', 5000))) },
cap: Number.isInteger(cap) && cap > 0 ? cap : null };
})(),
}; };
} }
const enforcedOn = (c, day) => !!(c.start && day >= c.start); const enforcedOn = (c, day) => !!(c.start && day >= c.start);
@@ -160,7 +127,6 @@ function init(deps) {
passes = R.persistedMap('gamepass'); passes = R.persistedMap('gamepass');
orders = R.persistedMap('gporders'); orders = R.persistedMap('gporders');
prizes = R.persistedMap('gpprizes'); prizes = R.persistedMap('gpprizes');
stackpro = R.persistedMap('stackpro');
load(); load();
} }
@@ -192,16 +158,12 @@ function extend(e, via, extra, now, tier) {
tier = tierOk(tier) ? tier : 'weekly'; tier = tierOk(tier) ? tier : 'weekly';
const c = cfg(); const tc = c.tiers[tier]; const t = now || Date.now(); const cur = passes.get(e) || { until: 0, bought: [] }; const c = cfg(); const tc = c.tiers[tier]; const t = now || Date.now(); const cur = passes.get(e) || { until: 0, bought: [] };
const T = tiersOf(cur); const T = tiersOf(cur);
// Network Weekend (2026-11-17, promodays.js passBonusDays): a tier pass PAID by a package fulfilled Fri 11-27 00:00 CT to Fri 12-04 const until = Math.max(t, T[tier]) + tc.days * 86400000; T[tier] = until; // renewing early loses nothing: from max(now, until)
// 00:00 CT gets bonus days (Explorer/Champion +15 = 45, Legend +60 = 425); comps and the weekly pass never do const bought = [Object.assign({ ts: t, via, tier, usd: tc.price / 100, days: tc.days }, extra || {})].concat(cur.bought || []).slice(0, 200);
const bonus = via === 'package' && R && typeof R.bonusDays === 'function' ? Math.max(0, Number(R.bonusDays(tier, t)) || 0) : 0;
const days = tc.days + bonus;
const until = Math.max(t, T[tier]) + days * 86400000; T[tier] = until; // renewing early loses nothing: from max(now, until)
const bought = [Object.assign({ ts: t, via, tier, usd: tc.price / 100, days }, bonus ? { bonusDays: bonus } : {}, extra || {})].concat(cur.bought || []).slice(0, 200);
passes.set(e, writeTiers(cur, T, { bought, ts: t })); passes.set(e, writeTiers(cur, T, { bought, ts: t }));
return { until, days, tier, bonusDays: bonus }; return { until, days: tc.days, tier };
} }
function waitingOrders(e) { const out = []; for (const [k, o] of orders) if (o.status === 'waiting' && o.email === e && o.kind !== 'hero' && o.kind !== 'stackpro') out.push(Object.assign({ order: k }, o, { tier: tierOk(o.tier) ? o.tier : 'weekly' })); return out; } function waitingOrders(e) { const out = []; for (const [k, o] of orders) if (o.status === 'waiting' && o.email === e) out.push(Object.assign({ order: k }, o, { tier: tierOk(o.tier) ? o.tier : 'weekly' })); return out; }
function waitingOrder(e, tier) { return waitingOrders(e).find(o => o.tier === (tier || 'weekly')) || null; } function waitingOrder(e, tier) { return waitingOrders(e).find(o => o.tier === (tier || 'weekly')) || null; }
// the admin's tier test: drop a waiting order that was opened for testing, so a later real package never fulfils it by surprise // the admin's tier test: drop a waiting order that was opened for testing, so a later real package never fulfils it by surprise
function cancelOrder(email, tier) { function cancelOrder(email, tier) {
@@ -236,8 +198,7 @@ function view(email, now, opts) {
// the tier rows this member sees: weekly always; a higher tier while on sale, in the admin preview, or to a current holder (holders // the tier rows this member sees: weekly always; a higher tier while on sale, in the admin preview, or to a current holder (holders
// keep their pass when a sale is switched off, they just cannot buy more) // keep their pass when a sale is switched off, they just cannot buy more)
const passRows = TIERS.filter(k => k === 'weekly' || c.tiers[k].sale || admin || T[k] > t).map(k => { const passRows = TIERS.filter(k => k === 'weekly' || c.tiers[k].sale || admin || T[k] > t).map(k => {
const tc = c.tiers[k]; const bd = k !== 'weekly' && R && typeof R.bonusDays === 'function' ? Math.max(0, Number(R.bonusDays(k, t)) || 0) : 0; const tc = c.tiers[k]; return { tier: k, name: TIER_NAMES[k], perks: TIER_DEF[k].perks, price: tc.price, usd: tc.price / 100, days: tc.days, package: packageFor(tc.price / 100),
return { tier: k, name: TIER_NAMES[k], perks: TIER_DEF[k].perks, price: tc.price, usd: tc.price / 100, days: tc.days + bd, bonusDays: bd, package: packageFor(tc.price / 100),
active: T[k] > t, until: T[k] > t ? T[k] : null, waiting: !!waitingOrder(e, k), sale: !!tc.sale, open: k === 'weekly' ? c.enabled : tierOpen(c, k, admin) }; active: T[k] > t, until: T[k] > t ? T[k] : null, waiting: !!waitingOrder(e, k), sale: !!tc.sale, open: k === 'weekly' ? c.enabled : tierOpen(c, k, admin) };
}); });
const tiered = passRows.some(r => r.tier !== 'weekly'); const tiered = passRows.some(r => r.tier !== 'weekly');
@@ -245,8 +206,7 @@ function view(email, now, opts) {
waiting: !!w, waitingSince: w ? w.ts : null, bought: p ? (p.bought || []).length : 0, waiting: !!w, waitingSince: w ? w.ts : null, bought: p ? (p.bought || []).length : 0,
caps, capsStart: c.start || null, lastCapHit: p && p.lastCapHit && (t - p.lastCapHit.ts) < 2 * 86400000 ? p.lastCapHit : null, caps, capsStart: c.start || null, lastCapHit: p && p.lastCapHit && (t - p.lastCapHit.ts) < 2 * 86400000 ? p.lastCapHit : null,
tournament: { pct: c.pct, shares: SHARES, next: nextTournamentAt(t) }, tournament: { pct: c.pct, shares: SHARES, next: nextTournamentAt(t) },
show: c.enabled || tiered, passes: passRows, tierPreview: tiered && admin && !c.tierSales, show: c.enabled || tiered, passes: passRows, tierPreview: tiered && admin && !c.tierSales };
heroes: heroView(e, t, opts) }; // bonus heroes (2026-11-05): sold one time, shown while heroSales is on, to an owner, or in the admin test
} }
// POST /api/my/gamepass/buy { tier }. tier missing = weekly (exactly the pass as it was before tiers). opts.preview = the admin // POST /api/my/gamepass/buy { tier }. tier missing = weekly (exactly the pass as it was before tiers). opts.preview = the admin
@@ -270,47 +230,6 @@ function buy(email, now, tier, opts) {
message: (tier === 'weekly' ? 'Your Game Pass' : 'Your ' + name + ' pass') + ' starts the moment your next package of $' + pkg + ' or more settles on chain. Your sponsor and team are paid from it as usual, and you keep every credit of the package for your ads.' }; message: (tier === 'weekly' ? 'Your Game Pass' : 'Your ' + name + ' pass') + ' starts the moment your next package of $' + pkg + ' or more settles on chain. Your sponsor and team are paid from it as usual, and you keep every credit of the package for your ads.' };
} }
// Stack POL Pro (Marty 2026-11-09): a one-time unlock for the member's stackpol.com page (their LinkSpin Banner Spins and spin links
// on the page, the shareable stack card). Like a pass or a hero it is NEW MONEY only: "Get Pro" opens a waiting order, and the next
// package purchase of $10 or more by one of the member's own positions fulfils it (onEvent). Never credits, never direct POL; the
// member keeps every credit of the package and the sponsor line is paid on chain as usual. Owned for good once paid.
const STACK_PRO_CENTS = 1000;
function stackOrders(e) { const out = []; for (const [k, o] of orders) if (o.status === 'waiting' && o.email === e && o.kind === 'stackpro') out.push(Object.assign({ order: k }, o)); return out; }
function stackPro(email) { const e = String(email || '').toLowerCase(); return stackpro.get(e) || null; }
function stackProView(email) { const e = String(email || '').toLowerCase(); const own = stackpro.get(e) || null; const w = stackOrders(e)[0] || null; return { pro: !!own, since: own ? own.ts : null, waiting: !!w, order: w ? w.order : null, usd: STACK_PRO_CENTS / 100 }; }
function buyStackPro(email, now) {
const e = String(email || '').toLowerCase(); const t = now || Date.now();
if (stackpro.get(e)) return { ok: true, pro: true };
let w = stackOrders(e)[0]; const reused = !!w;
if (!w) { const k = 'sp-' + t.toString(36) + '-' + Math.random().toString(36).slice(2, 8); orders.set(k, { status: 'waiting', email: e, ts: t, kind: 'stackpro' }); w = Object.assign({ order: k }, orders.get(k)); console.log('stack pro order opened', e, k); }
return { ok: false, needPay: true, payUrl: '/my?from=stackpro#buy', order: w.order, orderTs: w.ts, reused, usd: STACK_PRO_CENTS / 100, package: packageFor(STACK_PRO_CENTS / 100),
message: 'Stack POL Pro switches on the moment your next package of $10 or more settles on chain. Your sponsor and team are paid from it as usual, and you keep every credit of the package for your ads.' };
}
function cancelStackOrder(email) { const e = String(email || '').toLowerCase(); const w = stackOrders(e)[0]; if (!w) return { ok: true }; orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'cancelled', cancelledAt: Date.now() })); return { ok: true, order: w.order }; }
function compStackPro(email, on, note) { const e = String(email || '').toLowerCase(); if (on) stackpro.set(e, { ts: Date.now(), via: 'comp', note: String(note || '').slice(0, 120) }); else stackpro.delete(e); return { ok: true, pro: !!on }; }
// a package bought WITHOUT a Pro order first, granted by the admin (Marty 2026-11-09, Orlando's $10 package): recorded as a
// package sale with its tx so it counts as new money, and the tx is marked used like any fulfilment
function grantStackProForPackage(email, tx, cents, buyerId, note) {
const e = String(email || '').toLowerCase(); if (!e) return { error: 'No account.' };
if (stackpro.get(e)) return { ok: true, already: true };
stackpro.set(e, { ts: Date.now(), via: 'package', tx, cents, buyerId, note: String(note || 'admin grant: package bought without a Pro order').slice(0, 120) });
console.log('stack pro granted for package', e, tx, cents, 'cents');
return { ok: true, pro: true };
}
// Marty 2026-11-09 (evening): "Any $10 package or higher unlocks it". No Get Pro step: the member's own package purchase of $10 or more,
// on chain, switches Pro on for good. Still new money only (credits never reach onEvent). Only packages from the Pro launch on count
// (a reindex of older history never hands it out). A Pro order left waiting from the first version is closed as paid by the same tx.
const PRO_START = Date.parse('2026-11-09T21:30:00Z');
function proFromPackage(e, ev, cents) {
if (cents < STACK_PRO_CENTS || stackpro.get(e)) return false;
const t = (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()); if (t < PRO_START) return false;
stackpro.set(e, { ts: t, via: 'package', tx: ev.tx, cents, buyerId: Number(ev.buyerId) || 0 });
for (const o of stackOrders(e)) orders.set(o.order, Object.assign({}, orders.get(o.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), buyerId: Number(ev.buyerId) || 0 }));
console.log('stack pro unlocked by package', e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents');
return true;
}
function stackProOwners() { return [...stackpro.keys()]; }
// A package purchase landing on chain fulfils one of this account's waiting orders: the highest-priced one the package covers. // A package purchase landing on chain fulfils one of this account's waiting orders: the highest-priced one the package covers.
// Rules (2026-10-22): the buyer must be one of this account's own positions (main member id or a linked position); the purchase must // Rules (2026-10-22): the buyer must be one of this account's own positions (main member id or a linked position); the purchase must
// be mined AFTER the order was opened (block time, ORDER_SKEW_MS for clock drift); one pass per purchase of $5 or more; each tx used // be mined AFTER the order was opened (block time, ORDER_SKEW_MS for clock drift); one pass per purchase of $5 or more; each tx used
@@ -340,130 +259,18 @@ async function minedAt(ev) { // block time in ms; the indexed-at time only when
async function onEvent(ev) { async function onEvent(ev) {
if (!ev || ev.type !== 'Purchase' || (ev.priceCents || 0) < 500) return null; if (!ev || ev.type !== 'Purchase' || (ev.priceCents || 0) < 500) return null;
const c = cfg(); const cents = ev.priceCents || 0; const c = cfg(); const cents = ev.priceCents || 0;
if (!TIERS.some(k => cents >= c.tiers[k].price) && !heroOrderPrices(c).some(x => cents >= x) && cents < STACK_PRO_CENTS) return null; if (!TIERS.some(k => cents >= c.tiers[k].price)) return null;
const e = await ownerOf(ev); if (!e) return null; const e = await ownerOf(ev); if (!e) return null;
const pro = proFromPackage(e, ev, cents); // any $10+ package unlocks Stack POL Pro; it rides along, never takes the package from an order if (!waitingOrders(e).length) return null;
const withPro = r => pro ? Object.assign(r || {}, { stackPro: true, email: e }) : r; if (txUsed(ev.tx)) return null; // each purchase counts once, everywhere
if (!waitingOrders(e).length && !heroOrders(e).length) return withPro(null);
if (txUsed(ev.tx)) return withPro(null); // each purchase counts once, everywhere
const at = await minedAt(ev); const at = await minedAt(ev);
// one package fulfils ONE order, pass or bonus hero (2026-11-05): the highest-priced one it covers, then the oldest const w = waitingOrders(e).filter(o => cents >= c.tiers[o.tier].price && at + ORDER_SKEW_MS >= o.ts)
const all = waitingOrders(e).map(o => Object.assign({ price: c.tiers[o.tier].price }, o)).concat(heroOrders(e).filter(o => heroOrderOpen(e, o.hero)).map(o => Object.assign({ price: heroOrderPrice(c, o.hero) }, o))).concat(stackpro.get(e) ? [] : stackOrders(e).map(o => Object.assign({ price: STACK_PRO_CENTS }, o))); .sort((x, y) => c.tiers[y.tier].price - c.tiers[x.tier].price || x.ts - y.ts)[0];
const w = all.filter(o => cents >= o.price && at + ORDER_SKEW_MS >= o.ts).sort((x, y) => y.price - x.price || x.ts - y.ts)[0]; if (!w) { console.log('gamepass: package', String(ev.tx).slice(0, 12), 'by', e, 'fulfils no order (bought before the order or too small)'); return null; }
if (!w) { console.log('gamepass: package', String(ev.tx).slice(0, 12), 'by', e, 'fulfils no order (bought before the order or too small)'); return withPro(null); }
if (w.kind === 'stackpro') {
orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), minedAt: at, buyerId: Number(ev.buyerId) || 0 }));
stackpro.set(e, { ts: (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()), via: 'package', tx: ev.tx, cents, order: w.order, buyerId: Number(ev.buyerId) || 0 });
console.log('stack pro fulfilled by package', e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents');
return { order: w.order, stackPro: true, email: e };
}
if (w.kind === 'hero') {
orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), minedAt: at, buyerId: Number(ev.buyerId) || 0 }));
const g = grantHeroes(e, w.hero, 'package', { tx: ev.tx, cents, order: w.order, buyerId: Number(ev.buyerId) || 0, usd: heroOrderPrice(c, w.hero) / 100, packageUsd: cents / 100 }, (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()));
console.log('bonus heroes fulfilled by package', w.hero, e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents:', g.heroes.join(','));
return withPro({ order: w.order, hero: w.hero, heroes: g.heroes });
}
orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), minedAt: at, buyerId: Number(ev.buyerId) || 0 })); orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), minedAt: at, buyerId: Number(ev.buyerId) || 0 }));
const x = extend(e, 'package', { tx: ev.tx, cents, order: w.order, buyerId: Number(ev.buyerId) || 0, usd: c.tiers[w.tier].price / 100, packageUsd: cents / 100 }, (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()), w.tier); const x = extend(e, 'package', { tx: ev.tx, cents, order: w.order, buyerId: Number(ev.buyerId) || 0, usd: c.tiers[w.tier].price / 100, packageUsd: cents / 100 }, (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()), w.tier);
console.log('gamepass fulfilled by package', w.tier, e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents, until', new Date(x.until).toISOString()); console.log('gamepass fulfilled by package', w.tier, e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents, until', new Date(x.until).toISOString());
return withPro({ order: w.order, until: x.until, tier: w.tier }); return { order: w.order, until: x.until, tier: w.tier };
}
// ---- bonus heroes (2026-11-05) ----
// owned for good: record.heroes = { kestrel: { ts, via, tx, order, cents, usd, bundle? } }, record.heroBundle = { ts, via, heroes, tx, order }
// (in the passes map, the same durable record as the passes). A hero is never in `bought`, so hero sales never feed the Pass Tournament pool.
function heroOrders(e) {
const out = [];
for (const [k, o] of orders) if (o.status === 'waiting' && o.email === e && o.kind === 'hero') {
if (HERO_DEF[o.hero] && HERO_DEF[o.hero].freeAt) { orders.set(k, Object.assign({}, o, { status: 'cancelled', cancelledAt: Date.now(), why: 'free at level ' + HERO_DEF[o.hero].freeAt + ' in the game' })); continue; } // never paid: she is free now
out.push(Object.assign({ order: k }, o));
}
return out;
}
function heroOrder(e, key) { return heroOrders(e).find(o => o.hero === key) || null; }
const heroOrderPrice = (c, key) => key === 'bundle' ? c.heroes.bundle.price : (c.heroes.price[key] || 0);
const heroOrderPrices = c => [c.heroes.bundle.price].concat(HERO_SOLD.map(k => c.heroes.price[k]).filter(x => x > 0));
// a waiting hero order still worth fulfilling: nothing in it is owned yet (a bundle also needs its list set)
function heroOrderOpen(e, key) { const c = cfg(), own = new Set(heroesOwned(e).owned); if (key === 'bundle') return c.heroes.bundle.heroes.length > 0 && !c.heroes.bundle.heroes.some(k => own.has(k)); return HERO_SOLD.includes(key) && !own.has(key); }
// -> { owned: bought, comped and free heroes; bought: on the record; bundle: bought as the bundle }
function heroesOwned(email) {
const p = rec(String(email || '').toLowerCase()), c = cfg(), H = (p && p.heroes) || {};
return { owned: HERO_KEYS.filter(k => H[k] || c.heroes.free.includes(k)), bought: HERO_KEYS.filter(k => H[k]), bundle: !!(p && p.heroBundle) };
}
// the hand-off claim for Shards of Valor (server.js sovMint): what this member owns, and the current sale (the game keeps it, so a free
// hero opens for guests too)
function heroClaim(email) {
const c = cfg(), h = heroesOwned(email), out = { heroes: h.owned, heroBundle: h.bundle, heroSale: { free: c.heroes.free, bundle: c.heroes.bundle.heroes, each: (c.heroes.price.valda || 2000) / 100, bundlePrice: c.heroes.bundle.price / 100 } };
if (h.bundle && c.heroes.cap) out.heroBundleCap = c.heroes.cap; // only once Marty sets heroBundleCap (unset today: heroes only)
return out;
}
function grantHeroes(e, key, via, extra, now) {
const t = now || Date.now(), c = cfg(), cur = passes.get(e) || { until: 0, bought: [] }, H = Object.assign({}, cur.heroes || {});
const list = key === 'bundle' ? c.heroes.bundle.heroes.slice() : [key], got = [];
for (const k of list) if (!H[k]) { H[k] = Object.assign({ ts: t, via }, extra || {}, key === 'bundle' ? { bundle: true } : {}); got.push(k); }
const upd = { heroes: H }; if (key === 'bundle') upd.heroBundle = Object.assign({ ts: t, via, heroes: list }, extra || {});
passes.set(e, Object.assign({}, cur, upd));
// never a second charge for a hero you have: drop waiting orders that are now owned (in full or in part)
for (const o of heroOrders(e)) if (!heroOrderOpen(e, o.hero)) orders.set(o.order, Object.assign({}, orders.get(o.order), { status: 'cancelled', cancelledAt: t, why: 'already owned' }));
return { heroes: got, owned: heroesOwned(e).owned };
}
// the member card part: every hero, its price and state, and the bundle. open = on sale (heroSales) or the admin portal's test (opts.preview)
function heroView(email, now, opts) {
const e = String(email || '').toLowerCase(), c = cfg(), h = heroesOwned(e), own = new Set(h.owned), preview = !!(opts && opts.preview), open = c.heroes.sale || preview;
const items = HERO_DEFS.map(d => { const price = c.heroes.price[d.key], fa = d.freeAt || null; return { key: d.key, name: d.name, blurb: d.blurb, price, usd: price / 100, package: packageFor(price / 100), free: price === 0, freeAt: fa, owned: own.has(d.key), waiting: !fa && !!heroOrder(e, d.key), open: !fa && open && price > 0 && !own.has(d.key) }; });
const B = c.heroes.bundle, bOwn = B.heroes.filter(k => own.has(k));
const bundle = B.heroes.length ? { key: 'bundle', names: B.heroes.map(k => HERO_DEF[k].name), heroes: B.heroes, price: B.price, usd: B.price / 100, package: packageFor(B.price / 100), owned: bOwn.length === B.heroes.length, some: bOwn.length > 0, waiting: !!heroOrder(e, 'bundle'), open: open && !bOwn.length } : null;
return { sale: c.heroes.sale, preview: preview && !c.heroes.sale, show: c.heroes.sale || preview || h.bought.length > 0, items, bundle, owned: h.owned, bundleOwned: h.bundle };
}
// POST /api/my/heroes/buy { hero: kestrel | valda | morag | roland | bundle }: opens (or reuses) a waiting order; a fresh package of at
// least the price fulfils it (onEvent). Never spends credits. Refuses a hero already owned, a free one, and a bundle when any of its
// heroes is already owned (the rest one at a time costs less).
function buyHero(email, now, key, opts) {
const e = String(email || '').toLowerCase(), c = cfg(), t = now || Date.now(); key = String(key || '').toLowerCase();
if (key !== 'bundle' && !HERO_KEYS.includes(key)) return { error: 'There is no such hero.' };
if (!(c.heroes.sale || (opts && opts.preview))) return { error: 'Bonus heroes are not on sale yet.' };
const own = new Set(heroesOwned(e).owned);
if (key === 'bundle') {
const B = c.heroes.bundle; if (!B.heroes.length) return { error: 'There is no hero bundle right now.' };
const have = B.heroes.filter(k => own.has(k)); if (have.length) return { error: 'You already have ' + have.map(k => HERO_DEF[k].name).join(' and ') + ', so the bundle is not for you: get the others one at a time.' };
} else {
if (HERO_DEF[key].freeAt) return { error: HERO_DEF[key].name + ' is free for every player at level ' + HERO_DEF[key].freeAt + ' in Shards of Valor, so she is not for sale.' };
if (c.heroes.price[key] === 0) return { error: HERO_DEF[key].name + ' is free for everyone.' };
if (own.has(key)) return { error: 'You already have ' + HERO_DEF[key].name + '. Heroes are yours for good.' };
}
let w = heroOrder(e, key); const reused = !!w;
if (!w) { const k = 'hero-' + t.toString(36) + '-' + Math.random().toString(36).slice(2, 8); orders.set(k, { status: 'waiting', kind: 'hero', hero: key, email: e, ts: t }); w = Object.assign({ order: k }, orders.get(k)); }
const price = heroOrderPrice(c, key), pkg = packageFor(price / 100);
const name = key === 'bundle' ? 'The hero bundle (' + c.heroes.bundle.heroes.map(k => HERO_DEF[k].name).join(', ') + ')' : HERO_DEF[key].name;
if (!reused) console.log('bonus hero order opened', key, e, w.order, 'needs a package of', price, 'cents');
return { ok: false, needPay: true, hero: key, payUrl: '/my?from=heroes&hero=' + key + '#buy', order: w.order, orderTs: w.ts, reused, price, usd: price / 100, package: pkg,
message: name + ' joins you in Shards of Valor the moment your next package of $' + pkg + ' or more settles on chain. One time, yours for good. Your sponsor and team are paid from it as usual, and you keep every credit of the package for your ads.' };
}
function cancelHeroOrder(email, key) {
const e = String(email || '').toLowerCase(), w = heroOrder(e, String(key || '').toLowerCase()); if (!w) return { ok: true, none: true };
orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'cancelled', cancelledAt: Date.now() })); return { ok: true, order: w.order, hero: w.hero };
}
function compHero(email, key, why) { // support or the admin test: counts as no sale
const e = String(email || '').toLowerCase(); key = String(key || '').toLowerCase(); if (key !== 'bundle' && !HERO_KEYS.includes(key)) return { error: 'There is no such hero.' };
return Object.assign({ ok: true }, grantHeroes(e, key, 'admin', { note: String(why || 'support').slice(0, 80), usd: 0 }));
}
function revokeHero(email, key, why) { // support only (an admin test, a mistaken comp); never automatic
const e = String(email || '').toLowerCase(); key = String(key || '').toLowerCase(); const p = passes.get(e); const H = Object.assign({}, (p && p.heroes) || {});
const keys = key === 'all' ? Object.keys(H) : [key]; if (!p || !keys.some(k => H[k])) return { error: 'This account does not own that hero.' };
const gone = []; for (const k of keys) if (H[k]) { gone.push(Object.assign({}, H[k], { hero: k, revokedAt: Date.now(), why: String(why || 'support').slice(0, 80) })); delete H[k]; }
const upd = { heroes: H, heroRevokes: gone.concat(p.heroRevokes || []).slice(0, 50) };
if (p.heroBundle && !(p.heroBundle.heroes || []).every(k => H[k])) upd.heroBundle = null;
passes.set(e, Object.assign({}, p, upd)); return { ok: true, revoked: gone.map(g => g.hero) };
}
function heroStats() {
const c = cfg(); const out = { sale: c.heroes.sale, sold: Object.fromEntries(HERO_KEYS.map(k => [k, 0])), bundles: 0, comped: 0, usd: 0, waiting: 0 };
for (const [, p] of passes) {
if (!p) continue;
for (const [k, h] of Object.entries(p.heroes || {})) { if (!(k in out.sold)) continue; if (h.via === 'admin') { out.comped += 1; continue; } out.sold[k] += 1; if (!h.bundle) out.usd += Number(h.usd) || 0; }
if (p.heroBundle && p.heroBundle.via !== 'admin') { out.bundles += 1; out.usd += Number(p.heroBundle.usd) || 0; }
}
for (const [, o] of orders) if (o.status === 'waiting' && o.kind === 'hero' && !(HERO_DEF[o.hero] && HERO_DEF[o.hero].freeAt)) out.waiting += 1;
out.usd = Math.round(out.usd * 100) / 100; return out;
} }
// ---- the caps ---- // ---- the caps ----
@@ -472,19 +279,10 @@ function capsFor(email, now, game) {
const lim = pass ? c.pass : c.free; const M = L.members[e]; const D = M && M.days[day]; const lim = pass ? c.pass : c.free; const M = L.members[e]; const D = M && M.days[day];
const used = { daily: r6(D ? D.daily : 0), total: r6(D ? D.total : 0) }; const used = { daily: r6(D ? D.daily : 0), total: r6(D ? D.total : 0) };
const out = { daily: lim.daily, total: lim.total, used, day, enforced: enforcedOn(c, day), pass }; const out = { daily: lim.daily, total: lim.total, used, day, enforced: enforcedOn(c, day), pass };
out.lifetime = { cap: c.freeLifetime, used: r6(M && M.freeTotal != null ? M.freeTotal : (M ? Object.values(M.days).reduce((n, d) => n + ((d.tier && d.tier.free && d.tier.free.allowed) || 0), 0) : 0)) }; // the free allowance, what has been used of it
if (game && M) out.pending = r6((M.deferred[game] || []).reduce((n, x) => n + x.left, 0)); if (game && M) out.pending = r6((M.deferred[game] || []).reduce((n, x) => n + x.left, 0));
out.lifetime.done = !pass && out.lifetime.used + 1e-9 >= out.lifetime.cap; // the free allowance is used up (only a pass pays from here)
out.lifetime.waiting = M ? r6(Object.values(M.deferred).reduce((n, q) => n + (q || []).reduce((m, x) => m + (x.left || 0), 0), 0)) : 0;
return out; return out;
} }
// quest-site check (Zealy, 2026-11-05): has this account earned any game reward, and how much in total
function activity(email) {
const M = L.members[String(email || '').toLowerCase()]; if (!M) return { grants: 0, pol: 0 };
return Object.values(M.days).reduce((o, d) => ({ grants: o.grants + (d.grants || 0), pol: r6(o.pol + (d.total || 0)) }), { grants: 0, pol: 0 });
}
// POST /api/partner/polgrant. Returns { allowed, deferred, pass, day } (+ carried, capHit, enforced, repeat). // POST /api/partner/polgrant. Returns { allowed, deferred, pass, day } (+ carried, capHit, enforced, repeat).
function grant(o) { function grant(o) {
const e = String(o.email || '').toLowerCase(); const game = String(o.game || '').toLowerCase(); const kind = o.kind === 'progress' ? 'progress' : 'daily'; const e = String(o.email || '').toLowerCase(); const game = String(o.game || '').toLowerCase(); const kind = o.kind === 'progress' ? 'progress' : 'daily';
@@ -496,11 +294,6 @@ function grant(o) {
const c = cfg(); const pass = flag(e, t).active; const lim = pass ? c.pass : c.free; const enforced = enforcedOn(c, day); const c = cfg(); const pass = flag(e, t).active; const lim = pass ? c.pass : c.free; const enforced = enforcedOn(c, day);
const M = member(e); const D = dayRow(M, day); const tier = D.tier[pass ? 'pass' : 'free']; const M = member(e); const D = dayRow(M, day); const tier = D.tier[pass ? 'pass' : 'free'];
let totalRem = Math.max(0, r6(lim.total - D.total)), dailyRem = Math.max(0, r6(lim.daily - D.daily)); let totalRem = Math.max(0, r6(lim.total - D.total)), dailyRem = Math.max(0, r6(lim.daily - D.daily));
// the free allowance: a running total of what this account received while it held no pass (seeded once from the day rows
// still on file); once it reaches freeLifetime, a free account's room for today is zero, carry included
if (M.freeTotal == null) M.freeTotal = r6(Object.values(M.days).reduce((n, d) => n + ((d.tier && d.tier.free && d.tier.free.allowed) || 0), 0));
let lifetimeHit = false;
if (!pass && enforced) { const room = Math.max(0, r6(c.freeLifetime - M.freeTotal)); if (room < totalRem) totalRem = room; lifetimeHit = room < pol; } // hit = the allowance, not the day, is what trims this grant
// carry-forward: progress POL deferred on an EARLIER day for this game is paid first, inside today's total cap // carry-forward: progress POL deferred on an EARLIER day for this game is paid first, inside today's total cap
let carried = 0; const q = M.deferred[game] || []; let carried = 0; const q = M.deferred[game] || [];
for (const d of q) { for (const d of q) {
@@ -526,16 +319,12 @@ function grant(o) {
} }
if (kind === 'daily') D.daily = r6(D.daily + allowed); if (kind === 'daily') D.daily = r6(D.daily + allowed);
D.total = r6(D.total + allowed); tier.allowed = r6(tier.allowed + allowed); D.grants += 1; D.total = r6(D.total + allowed); tier.allowed = r6(tier.allowed + allowed); D.grants += 1;
if (!pass) M.freeTotal = r6((M.freeTotal || 0) + allowed + carried); // counts toward the free allowance only while no pass is held
// tournament activity: one point per reported grant (progress and daily weigh the same) // tournament activity: one point per reported grant (progress and daily weigh the same)
if (pol > 0) { const wk = weekKey(t); M.weeks[wk] = M.weeks[wk] || {}; M.weeks[wk][game] = (M.weeks[wk][game] || 0) + 1; } if (pol > 0) { const wk = weekKey(t); M.weeks[wk] = M.weeks[wk] || {}; M.weeks[wk][game] = (M.weeks[wk][game] || 0) + 1; }
if (capHit) { const p = passes.get(e) || { until: 0, bought: [] }; passes.set(e, Object.assign({}, p, { lastCapHit: { ts: t, day, game, kind: capHit, pass, lifetime: !!lifetimeHit } })); } if (capHit) { const p = passes.get(e) || { until: 0, bought: [] }; passes.set(e, Object.assign({}, p, { lastCapHit: { ts: t, day, game, kind: capHit, pass } })); }
const out = { allowed: r6(carried + allowed), deferred, pass, day, carried, capHit, enforced, kind, pol, email: e, ts: t, own: allowed, lifetimeHit }; const out = { allowed: r6(carried + allowed), deferred, pass, day, carried, capHit, enforced, kind, pol, email: e, ts: t, own: allowed };
L.refs[key] = out; touch(); L.refs[key] = out; touch();
// waiting = every game's progress POL deferred for this account (it pays once a pass is active, inside the pass cap); the games return { allowed: out.allowed, deferred, pass, day, carried, capHit, enforced, repeat: false };
// show it in the allowance note (Marty 2026-11-03: tell members at the cap to get the Pass, and what is waiting for them)
const waiting = r6(Object.values(M.deferred).reduce((n, q) => n + (q || []).reduce((m, x) => m + (x.left || 0), 0), 0));
return { allowed: out.allowed, deferred, pass, day, carried, capHit, enforced, repeat: false, lifetimeHit, freeUsed: r6(M.freeTotal || 0), freeLifetime: c.freeLifetime, waiting };
} }
// POST /api/partner/polgrant/void: the game decided not to pay after all. Reverses this ref's own share (the carry it triggered // POST /api/partner/polgrant/void: the game decided not to pay after all. Reverses this ref's own share (the carry it triggered
@@ -637,7 +426,7 @@ function tierStats(t) {
if (b.ts >= d30 && rows.some(x => x !== b && rowTier(x) === k && x.ts < b.ts)) o.renewals30d += 1; if (b.ts >= d30 && rows.some(x => x !== b && rowTier(x) === k && x.ts < b.ts)) o.renewals30d += 1;
} }
} }
for (const [, o] of orders) if (o.status === 'waiting' && o.kind !== 'hero' && o.kind !== 'stackpro') out[tierOk(o.tier) ? o.tier : 'weekly'].waitingOrders += 1; for (const [, o] of orders) if (o.status === 'waiting') out[tierOk(o.tier) ? o.tier : 'weekly'].waitingOrders += 1;
for (const k of TIERS) for (const f of ['usdWeek', 'usdMonth', 'usdTotal']) out[k][f] = Math.round(out[k][f] * 100) / 100; for (const k of TIERS) for (const f of ['usdWeek', 'usdMonth', 'usdTotal']) out[k][f] = Math.round(out[k][f] * 100) / 100;
return out; return out;
} }
@@ -668,7 +457,7 @@ function adminStats(now) {
const t = now || Date.now(); const c = cfg(); const ws = weekStart(t); const day = dayKey(t); const wkFrom = dayKey(ws); const t = now || Date.now(); const c = cfg(); const ws = weekStart(t); const day = dayKey(t); const wkFrom = dayKey(ws);
let active = 0, soldTotal = 0, usdTotal = 0, soldWeek = 0, usdWeek = 0, waiting = 0, comped = 0; let active = 0, soldTotal = 0, usdTotal = 0, soldWeek = 0, usdWeek = 0, waiting = 0, comped = 0;
for (const [, p] of passes) { if (!p) continue; if (topTier(tiersOf(p), t)) active += 1; for (const b of p.bought || []) { if (!isSale(b)) { comped += 1; continue; } soldTotal += 1; usdTotal += Number(b.usd) || 0; if (b.ts >= ws) { soldWeek += 1; usdWeek += Number(b.usd) || 0; } } } for (const [, p] of passes) { if (!p) continue; if (topTier(tiersOf(p), t)) active += 1; for (const b of p.bought || []) { if (!isSale(b)) { comped += 1; continue; } soldTotal += 1; usdTotal += Number(b.usd) || 0; if (b.ts >= ws) { soldWeek += 1; usdWeek += Number(b.usd) || 0; } } }
for (const [, o] of orders) if (o.status === 'waiting' && o.kind !== 'hero' && o.kind !== 'stackpro') waiting += 1; for (const [, o] of orders) if (o.status === 'waiting') waiting += 1;
const wk = { pass: { allowed: 0, hitsDaily: 0, hitsTotal: 0 }, free: { allowed: 0, hitsDaily: 0, hitsTotal: 0 }, carried: 0, dropped: 0, deferredOut: 0, grants: 0, would: { dropped: 0, deferred: 0, hitsDaily: 0, hitsTotal: 0 }, players: 0 }; const wk = { pass: { allowed: 0, hitsDaily: 0, hitsTotal: 0 }, free: { allowed: 0, hitsDaily: 0, hitsTotal: 0 }, carried: 0, dropped: 0, deferredOut: 0, grants: 0, would: { dropped: 0, deferred: 0, hitsDaily: 0, hitsTotal: 0 }, players: 0 };
const today = { allowed: 0, grants: 0, players: 0 }; const today = { allowed: 0, grants: 0, players: 0 };
let qEntries = 0, qPol = 0, qMembers = 0; const byGame = {}; let qEntries = 0, qPol = 0, qMembers = 0; const byGame = {};
@@ -713,5 +502,5 @@ function prune(now) {
return n; return n;
} }
module.exports = { STACK_PRO_CENTS, stackPro, stackProView, buyStackPro, cancelStackOrder, compStackPro, stackProOwners, grantStackProForPackage, init, cfg, GAMES, NAMES, TIERS, TIER_NAMES, TIER_DEFS, HERO_DEFS, HERO_KEYS, heroesOwned, heroClaim, heroView, buyHero, cancelHeroOrder, compHero, revokeHero, heroStats, flag, activity, view, buy, cancelOrder, comp, revoke, onEvent, capsFor, grant, voidGrant, tournamentTick, runTournament, pending, markPaid, adminStats, prune, weekStart, dayKey, module.exports = { init, cfg, GAMES, NAMES, TIERS, TIER_NAMES, TIER_DEFS, flag, view, buy, cancelOrder, comp, revoke, onEvent, capsFor, grant, voidGrant, tournamentTick, runTournament, pending, markPaid, adminStats, prune, weekStart, dayKey,
_ledger: () => L }; _ledger: () => L };
+1 -1
View File
@@ -10,7 +10,7 @@ const fs = require('fs');
const path = require('path'); const path = require('path');
let R = null; let R = null;
const NAMES = { spookydoors: 'Spooky Doors', gemkingdom: 'Gem Kingdom', clutterhunt: 'ClutterHunt', driprunner: 'Drip Runner', polywarriors: 'PolyWarriors', spellwheel: 'SpellWheel', roadagent: 'Road Agent', polhunter: 'PolHunter', passivedrip: 'PassiveDrip', polybreak: 'PolyBreak', polminer: 'POL Miner', warpwares: 'Warp & Wares', turkeydrop: 'Turkey Drop', shardsofvalor: 'Shards of Valor' }; const NAMES = { spookydoors: 'Spooky Doors', gemkingdom: 'Gem Kingdom', clutterhunt: 'ClutterHunt', driprunner: 'Drip Runner', polywarriors: 'PolyWarriors', spellwheel: 'SpellWheel', roadagent: 'Road Agent', polhunter: 'PolHunter', passivedrip: 'PassiveDrip', polybreak: 'PolyBreak', polminer: 'POL Miner', turkeydrop: 'Turkey Drop', shardsofvalor: 'Shards of Valor' };
const wallets = () => Object.fromEntries(String(process.env.GAME_WALLETS || '').split(',').map(x => x.trim()).filter(Boolean).map(x => { const [k, a] = x.split(':'); return [String(k).toLowerCase(), String(a || '').toLowerCase()]; }).filter(([k, a]) => k && /^0x[0-9a-f]{40}$/.test(a))); const wallets = () => Object.fromEntries(String(process.env.GAME_WALLETS || '').split(',').map(x => x.trim()).filter(Boolean).map(x => { const [k, a] = x.split(':'); return [String(k).toLowerCase(), String(a || '').toLowerCase()]; }).filter(([k, a]) => k && /^0x[0-9a-f]{40}$/.test(a)));
const KEY = () => String(process.env.ETHERSCAN_KEY || '').trim(); const KEY = () => String(process.env.ETHERSCAN_KEY || '').trim();
// money never flows to these from a game wallet as a payout: Marty's fee wallets, the other game wallets // money never flows to these from a game wallet as a payout: Marty's fee wallets, the other game wallets
-54
View File
@@ -1,54 +0,0 @@
// The network AI ad writer, asked through the hub (Marty 2026-11-17: "the AI generation of the ads worked really well. Let's go
// ahead and do it on the other sites too."). The hub reads the member's page, asks the model and filters the copy
// (network-hub lib/adwriter.js); this file only signs the call for this site's signed-in member and passes the answer on.
// status(member?) -> {on, daily, left?} (cached 60 s; on: false when the hub is unset, unreachable or switched off)
// write(member, url, limits) -> {ok, options: [{headline, line?}], url, cached, left} | {error (member-friendly), code, status, left?}
// Signed as HUB_SITE with HUB_SECRET: X-Hub-Site, X-Hub-Ts, X-Hub-Sig = hex HMAC-SHA256(ts + newline + raw body), like every /v1 call.
// AI_WRITER=0 hides the button on this site. Nothing is posted: the member picks an option, edits it and saves it themselves.
'use strict';
const crypto = require('crypto');
const DEFAULT_SITE = 'iap';
const hubUrl = () => String(process.env.HUB_URL || '').trim().replace(/\/+$/, '');
const secret = () => String(process.env.HUB_SECRET || '').trim();
const site = () => String(process.env.HUB_SITE || DEFAULT_SITE).trim();
const configured = () => !/^(0|false|no|off)$/i.test(String(process.env.AI_WRITER || '').trim()) && !!hubUrl() && secret().length >= 32;
async function call(route, body, timeoutMs) {
const raw = JSON.stringify(body); const ts = String(Date.now());
const sig = crypto.createHmac('sha256', secret()).update(ts + '\n' + raw).digest('hex');
const r = await fetch(hubUrl() + route, { method: 'POST', body: raw, signal: AbortSignal.timeout(timeoutMs),
headers: { 'Content-Type': 'application/json', 'X-Hub-Site': site(), 'X-Hub-Ts': ts, 'X-Hub-Sig': sig } });
let j = null; try { j = await r.json(); } catch (e) { j = null; }
return { status: r.status, body: j || {} };
}
let st = { at: 0, v: { on: false, daily: 0 } };
async function status(member) {
if (!configured()) return { on: false, daily: 0 };
if (!member && Date.now() - st.at < 60000) return st.v;
try {
const r = await call('/v1/adwriter/status', member ? { member: String(member) } : {}, 3000);
const v = r.status === 200 && r.body && typeof r.body.on === 'boolean' ? r.body : { on: false, daily: 0 };
if (!member) st = { at: Date.now(), v: { on: v.on, daily: v.daily || 0 } };
return v;
} catch (e) { if (!member) st = { at: Date.now() - 45000, v: { on: false, daily: 0 } }; return { on: false, daily: 0 }; } // a down hub is asked again in 15 s
}
// the button shows only when the hub says the writer is on (60 s cache, never waits on a slow hub for long)
async function enabled() { return (await status()).on === true; }
async function write(member, url, limits) {
if (!configured()) return { error: 'The ad writer is switched off right now. You can still write your ad yourself.', code: 'off', status: 503 };
try {
const r = await call('/v1/adwriter', { member: String(member), url: String(url || '').trim().slice(0, 600), limits }, 75000);
const b = r.body || {};
if (r.status === 200 && b.ok && Array.isArray(b.options)) return { ok: true, options: b.options, url: b.url, cached: !!b.cached, left: b.left };
if (r.status === 401 || r.status === 403 || !b.message) { console.error('hubadwriter: hub answered ' + r.status + ' ' + String(b.error || '')); return { error: 'The ad writer is busy right now. Try again in a minute, or write your ad yourself.', code: 'hub', status: 502 }; }
return { error: String(b.message), code: b.error || b.code || 'error', status: r.status >= 400 && r.status < 600 ? r.status : 502, left: b.left };
} catch (e) {
console.error('hubadwriter: ' + (e.name === 'TimeoutError' || e.name === 'AbortError' ? 'timeout' : String(e.message).slice(0, 120)));
return { error: 'The ad writer did not answer in time. Try again in a minute, or write your ad yourself.', code: 'hub', status: 504 };
}
}
module.exports = { status, enabled, write, configured, _reset: () => { st = { at: 0, v: { on: false, daily: 0 } }; } };
-382
View File
@@ -1,382 +0,0 @@
// Network hub sync (2026-11-12, Marty 2026-11-06: one membership from any door; the hub is the single identity).
// Everything here sleeps unless HUB_ENABLED is on: server.js does not even init this module without it, so no file is
// written, no route answers and no hook is wired. The InstantAdPay <-> LinkSpin direct sync (lssync.js / lsinbound.js)
// keeps running exactly as before either way.
//
// Inbound (POST /api/hub/events, signed by the hub with HUB_SECRET: X-Hub-Ts + X-Hub-Sig = hex HMAC-SHA256(ts + newline +
// raw body), 5-minute window). The hub only moves its cursor after a 2xx and may send an event twice:
// member.joined someone joined at another door: /v1/resolve the person (and, climbing, any sponsor not here yet) and
// hand the rows to lsinbound.receive, the same waiting-account path LinkSpin-first members take, with
// joinedVia 'hub' and joinedRef 'hub:<door>'. First-platform rule as there: an account that already
// exists here keeps its sponsor and only gets empty fields filled. Joins from this site are skipped.
// wallet.connected filled only on a waiting account that still has no wallet (lsinbound fill rules). A claimed account
// links its own wallet here; the hub's wallet is not proof of ownership on InstantAdPay.
// sponsor.changed ignored on purpose (2026-11-14): lsinbound's follow rule needs sponsorSetAt / By / PrevEmail, which the
// hub view does not expose, and someone the InstantAdPay contract holds never moves anyway.
// Rule 2 (2026-11-14): the sponsor written for an arrival is person.locks.iap's sponsor when that lock exists, never the
// plain network sponsor. QUIET: nothing on this path sends mail, a notice or a post, and lssync.js never
// pushes a hub waiting account to LinkSpin (qa/hubsync.test.cjs, mail audit).
// member.erased (2026-11-15) the hub erased someone: erase.js finds them by the SHA-256 of the email and takes them out
// here too; refused (wallet, member number, team) = a log note, never retried.
// anything else ignored.
// Each seq is applied once (done map). A failing event answers 503 so the hub retries it; after 5 tries it is set aside
// in the log so one bad row cannot hold every later event back.
//
// Outbound (/v1/join, /v1/wallet, signed as HUB_SITE): new accounts made here since the flag first went on and every main
// wallet linked here go into a persisted outbox (DATA_DIR/hubsync.json) and are sent in order, never in the way of a
// sign-up. Retried with backoff on 5xx / network / 404-before-join; a 400/409 refusal is final and logged.
// Gaps closed 2026-11-13 (Marty: "let's get the gaps report built"), all still one way:
// - any later change to a member's username or sponsor goes to /v1/join again (names them; a sponsor only lands where the
// hub has none), old members included, not only accounts made since the flag went on;
// - a DELIBERATE sponsor change (sponsorfollow: adopt, rescue, release, expire->expiry, admin) goes to /v1/sponsor-change;
// - every MemberActivated on the InstantAdPay contract goes to /v1/contract-bind (contract 'iap', the sponsor by wallet),
// by email when the wallet belongs to an account here, else by wallet alone.
// - every paid Purchase goes to /v1/contract-spend (2026-11-14, rule 2: the contract with money spent decides the network
// sponsor when two contracts hold different ones).
// Where the hub and InstantAdPay name different sponsors, nothing is forced on either side: the case goes to `disagree`
// (Admin > /api/admin/hub) for Marty, since an InstantAdPay member bound on our contract cannot move anyway.
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
let R = null, st = null, chain_ = Promise.resolve(), timer = null, sending = false, interval = null;
const MAX_UP = 25, EVENT_TRIES = 5, OUT_TRIES = 20, KEEP_DONE = 5000;
const SHELL_ORIGINS = new Set(['linkspin', 'btc4hits', 'hub']);
const DELIBERATE = new Set(['adopt', 'rescue', 'release', 'expire', 'expiry', 'admin']); // sponsorfollow.js kinds the hub accepts // came here from another site: that site tells the hub itself
const enabled = () => /^(1|true|yes|on)$/i.test(String(process.env.HUB_ENABLED || '').trim());
const URL_ = () => String(process.env.HUB_URL || '').trim().replace(/\/+$/, '');
const SECRET = () => String(process.env.HUB_SECRET || '').trim();
const SITE = () => String(process.env.HUB_SITE || 'iap').trim().toLowerCase();
const on = () => enabled() && !!URL_() && SECRET().length >= 32;
const norm = v => String(v || '').trim().toLowerCase();
const FILE = () => path.join(R.dataDir, 'hubsync.json');
function load() {
if (st) return st;
try { st = JSON.parse(fs.readFileSync(FILE(), 'utf8')); } catch (e) { st = null; }
if (!st || typeof st !== 'object') st = {};
st.since = Number(st.since) || Date.now(); // only accounts made after the flag first went on are reported as joins
st.done = st.done || {}; st.tries = st.tries || {}; st.outbox = st.outbox || []; st.reported = st.reported || {};
st.disagree = st.disagree || {}; st.log = st.log || [];
st.stats = Object.assign({ batches: 0, events: 0, applied: 0, skipped: 0, ignored: 0, gaveUp: 0, sent: 0, refused: 0, sendErrors: 0 }, st.stats || {});
return st;
}
function save() { try { const tmp = FILE() + '.tmp'; fs.writeFileSync(tmp, JSON.stringify(load())); fs.renameSync(tmp, FILE()); } catch (e) { console.error('hubsync save', e.message); } }
function note(ev) { const s = load(); s.log.push(Object.assign({ ts: Date.now() }, ev)); if (s.log.length > 300) s.log = s.log.slice(-300); }
// deps: { dataDir, accounts, lsinbound }
function init(deps) { R = deps; load(); save(); }
const sign = (ts, raw) => crypto.createHmac('sha256', SECRET()).update(String(ts) + '\n' + raw).digest('hex');
function verify(headers, raw) {
if (SECRET().length < 32) return false;
const ts = String(headers['x-hub-ts'] || ''), sig = String(headers['x-hub-sig'] || '');
if (!/^\d{10,16}$/.test(ts) || Math.abs(Date.now() - Number(ts)) > 5 * 60000) return false;
const want = sign(ts, raw);
return want.length === sig.length && crypto.timingSafeEqual(Buffer.from(want), Buffer.from(sig));
}
async function hubPost(p, body, timeout) {
const raw = JSON.stringify(body); const ts = String(Date.now());
const r = await fetch(URL_() + p, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Hub-Site': SITE(), 'X-Hub-Ts': ts, 'X-Hub-Sig': sign(ts, raw) }, body: raw, signal: AbortSignal.timeout(timeout || 15000) });
let j = null; try { j = await r.json(); } catch (e) {}
return { status: r.status, body: j };
}
async function resolve(q) {
const r = await hubPost('/v1/resolve', q);
if (r.status !== 200) throw new Error('hub resolve ' + r.status);
return (r.body && r.body.person) || null;
}
const doorOf = p => norm(p && p.firstDoor && p.firstDoor.site).replace(/[^a-z0-9_-]/g, '').slice(0, 30) || 'network';
// Rule 2 (Marty 2026-11-14): the sponsor written here is the one the InstantAdPay CONTRACT holds for them when it holds them
// (person.locks.iap), never the plain network sponsor, which may come from another contract where they spent money
const CONTRACT = 'iap';
const sponsorFor = p => { const l = p && p.locks && p.locks[CONTRACT]; if (l) return (l.sponsor && l.sponsor.email) || null; return (p && p.sponsor && p.sponsor.email) || null; };
const rowOf = p => ({ email: norm(p.email), username: p.username || null, wallet: p.wallet || null, sponsorEmail: sponsorFor(p), joinedAt: Number(p.firstDoor && p.firstDoor.at) || null, profile: null });
// what InstantAdPay and the hub each say the sponsor is; a difference is recorded, never forced
async function compare(email, hubSponsorEmail, how) {
const sp = await R.accounts.sponsorOf(email); const here = sp ? norm(sp.email) : null; const there = norm(hubSponsorEmail) || null;
const s = load();
if (here === there) { delete s.disagree[email]; return; }
s.disagree[email] = { at: Date.now(), iap: here, hub: there, how };
}
async function memberJoined(ev) {
if (norm(ev.data && ev.data.site) === SITE()) return 'own';
const first = await resolve({ id: ev.personId });
if (!first || !first.email) return first ? 'no-email' : 'unknown'; // the hub must give this site seeEmails
if (first.blocked) return 'blocked';
const email = norm(first.email); const A = R.accounts;
const existing = await A.byEmail(email);
const rows = [rowOf(first)]; const doors = { [email]: doorOf(first) }; const seen = new Set([email]);
if (existing && !A.isUnclaimedShell(existing)) rows[0].wallet = null; // a real account links its own wallet here
// sponsors not on InstantAdPay yet come along as waiting accounts too (lsinbound builds them from rows in the same batch)
let p = first;
for (let i = 0; i < MAX_UP && sponsorFor(p); i++) {
const se = norm(sponsorFor(p)); if (seen.has(se) || await A.byEmail(se)) break;
const up = await resolve({ email: se }); if (!up || !up.email || up.blocked) break;
seen.add(se); rows.push(rowOf(up)); doors[se] = doorOf(up); p = up;
}
const sum = await R.lsinbound.receive(rows, { via: 'hub', refOf: e => 'hub:' + (doors[e] || 'network') });
if (sum && sum.errors) throw new Error('lsinbound errors ' + sum.errors);
await compare(email, rows[0].sponsorEmail, 'hub-join');
note({ type: 'joined', email, door: doors[email], created: sum ? sum.created : 0, existed: !!existing });
return 'applied';
}
async function walletConnected(ev) {
const p = await resolve({ id: ev.personId });
if (!p || !p.email || !p.wallet || p.blocked) return 'skip';
const a = await R.accounts.byEmail(p.email);
if (!a) return 'not-here'; // member.joined makes the account; a wallet alone does not
if (!R.accounts.isUnclaimedShell(a) || a.address) return 'kept'; // claimed accounts link their own wallet here
const sum = await R.lsinbound.receive([rowOf(p)], { via: 'hub', refOf: () => 'hub:' + doorOf(p) });
if (sum && sum.errors) throw new Error('lsinbound errors ' + sum.errors);
return 'applied';
}
// member.erased (2026-11-15): the hub erased someone; erase.js takes them out here too, found by the SHA-256 of the email
// (the event carries nothing else). Refused here (a wallet, a member number, a team) = noted for Marty, never retried.
async function memberErased(ev) {
if (!R.erase) return 'ignored';
const r = await R.erase.byHash(ev.data && ev.data.emailHash, 'hub');
if (r.result === 'refused') note({ type: 'erase-refused', hash: String(ev.data.emailHash).slice(0, 16), error: String(r.error || '').slice(0, 200) });
else note({ type: 'erased', hash: String((ev.data && ev.data.emailHash) || '').slice(0, 16), result: r.result });
return r.result === 'erased' ? 'applied' : 'ignored';
}
async function apply(ev) {
if (ev.type === 'member.joined') return memberJoined(ev);
if (ev.type === 'wallet.connected') return walletConnected(ev);
if (ev.type === 'member.erased') return memberErased(ev);
// network sign-in (2026-11-15): a member the hub blocked, or who chose "Sign out everywhere" on any site, is signed out here too
if (ev.type === 'member.blocked' || ev.type === 'member.signedout') {
if (!R.endSessions) return 'ignored';
const p = await resolve({ id: ev.personId }); if (!p || !p.email) return 'ignored';
const n = await R.endSessions(p.email, p.wallet || null);
note({ type: ev.type === 'member.blocked' ? 'blocked-signed-out' : 'signed-out-everywhere', sessions: n });
return n ? 'applied' : 'ignored';
}
// sponsor.changed is IGNORED here on purpose (checked 2026-11-14 for the switch-on): it would need the deliberate-change
// record (at / by / previous sponsor) to go through sponsorfollow's rule, and a member locked on the InstantAdPay contract
// must never move anyway (the contract pays whoever it holds). qa/hubsync.test.cjs proves a locked member stays put.
return 'ignored';
}
function prune() {
const s = load(); const seqs = Object.keys(s.done).map(Number).sort((a, b) => a - b);
for (const q of seqs.slice(0, Math.max(0, seqs.length - KEEP_DONE))) delete s.done[q];
}
async function handle(events) {
const s = load(); s.stats.batches++; let failed = null;
for (const ev of Array.isArray(events) ? events : []) {
const seq = Number(ev && ev.seq); if (!seq) continue;
if (s.done[seq]) { s.stats.skipped++; continue; } // delivered twice: already applied
s.stats.events++;
try {
const r = await apply(ev);
s.done[seq] = Date.now(); delete s.tries[seq];
if (r === 'applied') s.stats.applied++; else s.stats.ignored++;
} catch (e) {
s.tries[seq] = (s.tries[seq] || 0) + 1;
console.error('hubsync event', seq, ev.type, e.message);
if (s.tries[seq] >= EVENT_TRIES) { s.done[seq] = Date.now(); delete s.tries[seq]; s.stats.gaveUp++; note({ type: 'gave-up', seq, event: ev.type, error: String(e.message).slice(0, 160) }); continue; }
failed = e; break; // answer 503: the hub sends this one (and everything after it) again
}
}
prune(); save();
return failed ? { status: 503, body: { error: 'retry' } } : { status: 200, body: { ok: true } };
}
// the POST /api/hub/events handler: { status, body }. Batches run one at a time.
function receive(headers, raw) {
if (!R || !enabled()) return Promise.resolve({ status: 404, body: { error: 'not found' } });
if (!verify(headers, raw)) return Promise.resolve({ status: 401, body: { error: 'unauthorized' } });
let b; try { b = JSON.parse(raw || '{}'); } catch (e) { return Promise.resolve({ status: 400, body: { error: 'bad json' } }); }
const run = chain_.then(() => handle(b.events)); chain_ = run.catch(() => {}); return run;
}
// ---------- outbound ----------
function enqueue(kind, email) {
const s = load(); if (s.outbox.length >= 20000) { s.stats.sendErrors++; return; }
s.outbox.push({ kind, email, at: Date.now(), tries: 0, next: 0 }); save(); kick();
}
function kick() { if (!timer) timer = setTimeout(() => { timer = null; flush().catch(e => console.error('hubsync flush', e.message)); }, 2000); }
// accounts.onChange: a new account made here, or a later username / sponsor change on any account, goes to /v1/join;
// a deliberate sponsor change also goes to /v1/sponsor-change
function touch(email) {
if (!R || !on() || !email) return;
(async () => {
const e = norm(email); const a = await R.accounts.byEmail(e); const s = load();
if (!a || SHELL_ORIGINS.has(a.joinedVia)) return;
const sp = await R.accounts.sponsorOf(e); const spE = sp ? norm(sp.email) : '';
const key = (a.username || '') + '|' + spE;
const rep = s.reported[e];
if (!rep) { s.reported[e] = { u: a.username || null, k: key }; enqueue('join', e); } // new here, or an older member's first change since the flag
else if (rep.k !== key) { rep.u = a.username || null; rep.k = key; enqueue('join', e); }
const rec = R.follow && R.follow.get ? R.follow.get(e) : null;
if (rec && DELIBERATE.has(rec.by) && norm(rec.sponsorEmail) === spE && Number(rec.at) > 0 && s.reported[e].sc !== Number(rec.at)) {
s.reported[e].sc = Number(rec.at); enqueue('sponsor', e);
}
save();
})().catch(err => console.error('hubsync touch', err.message));
}
// chain.onEvent (once across copies): a payout switch-on on the InstantAdPay contract goes to /v1/contract-bind
function onChain(ev) {
if (ev && ev.type === 'Purchase') return onPurchase(ev);
if (!R || !on() || !ev || ev.type !== 'MemberActivated' || !ev.account) return;
(async () => {
let spW = null; try { const m = ev.sponsorId ? await R.chain.member(ev.sponsorId) : null; spW = m && m.account ? norm(m.account) : null; } catch (e) {}
const s = load(); if (s.outbox.length >= 20000) { s.stats.sendErrors++; return; }
s.outbox.push({ kind: 'bind', email: norm(ev.account), wallet: norm(ev.account), sponsorWallet: spW, at: Date.now(), tries: 0, next: 0 }); save(); kick();
})().catch(err => console.error('hubsync onChain', err.message));
}
// chain.onEvent: money paid into the InstantAdPay contract (Purchase with POL in) goes to /v1/contract-spend (Marty 2026-11-14,
// rule 2: when two contracts hold different sponsors, the one with money spent decides the network sponsor). Keyed by the
// buyer's position wallet, the same key as its bind, so the bind is always sent first; the tx hash makes a resend count once.
// A 404 (bind not there yet, or a linked extra position the hub does not know) is retried like any other miss.
function onPurchase(ev) {
if (!R || !on() || !ev.buyerId || !(Number(ev.priceCents) > 0)) return;
try { if (BigInt(ev.paidWei || '0') <= 0n) return; } catch (e) { return; } // nothing paid in: not a spend
(async () => {
const m = await R.chain.member(ev.buyerId); const w = m && m.account ? norm(m.account) : null; if (!w) return;
const s = load(); if (s.outbox.length >= 20000) { s.stats.sendErrors++; return; }
s.outbox.push({ kind: 'spend', email: w, wallet: w, cents: Number(ev.priceCents), tx: ev.tx || null, paidAt: Number(ev.ts) || Date.now(), at: Date.now(), tries: 0, next: 0 }); save(); kick();
})().catch(err => console.error('hubsync onPurchase', err.message));
}
// accounts.onWalletLinked: a main wallet linked here goes to /v1/wallet
function wallet(email) {
if (!R || !on() || !email) return;
(async () => {
const a = await R.accounts.byEmail(email);
if (a && a.address && !R.accounts.isUnclaimedShell(a)) enqueue('wallet', norm(email)); // a waiting account's wallet came from a sync
})().catch(err => console.error('hubsync wallet', err.message));
}
// sponsorfollow / tank.js label a window expiry 'expire'; the hub (and its DELIBERATE list) calls it 'expiry' (fixed 2026-11-15:
// before, IAP window-expiry moves never reached the hub as a sponsor change)
const HUB_BY = { expire: 'expiry' };
const hubBy = by => HUB_BY[by] || by;
const ROUTE = { join: '/v1/join', wallet: '/v1/wallet', sponsor: '/v1/sponsor-change', bind: '/v1/contract-bind', spend: '/v1/contract-spend' };
async function bodyFor(item) {
if (item.kind === 'spend') {
let owner = null; try { owner = (await R.accounts.byAddress(item.wallet)) || (R.accounts.positionOwner ? await R.accounts.positionOwner(item.wallet) : null); } catch (e) {}
return { contract: 'iap', email: owner && owner.email ? owner.email : undefined, wallet: item.wallet, cents: item.cents, tx: item.tx || undefined, at: item.paidAt };
}
if (item.kind === 'bind') {
let owner = null; try { owner = await R.accounts.byAddress(item.wallet); } catch (e) {}
return { contract: 'iap', email: owner && owner.email ? owner.email : undefined, wallet: item.wallet, sponsorRef: item.sponsorWallet || '' };
}
const a = await R.accounts.byEmail(item.email); if (!a) return null;
if (item.kind === 'sponsor') {
const sp = await R.accounts.sponsorOf(a.email); const rec = R.follow && R.follow.get ? R.follow.get(a.email) : null;
if (!rec || !DELIBERATE.has(rec.by) || norm(rec.sponsorEmail) !== (sp ? norm(sp.email) : '')) return null; // superseded since
return { email: a.email, sponsorEmail: sp ? sp.email : null, by: hubBy(rec.by) };
}
if (item.kind === 'wallet') return a.address ? { email: a.email, wallet: a.address } : null;
const sp = await R.accounts.sponsorOf(a.email);
return { email: a.email, ref: sp ? sp.email : (a.sponsorRef || undefined), username: a.username || undefined };
}
async function flush(force) { // force (tests, admin): ignore the backoff wait
if (!R || !on() || sending) return { skipped: true };
sending = true; const s = load(); const now = Date.now(); const held = new Set(); let sent = 0;
try {
for (const item of s.outbox.slice()) {
if (held.has(item.email)) continue; // keep each member's calls in order (join before wallet)
if (item.next > now && !force) { held.add(item.email); continue; }
const drop = (why, code) => { s.outbox.splice(s.outbox.indexOf(item), 1); if (why) note({ type: 'out-' + why, kind: item.kind, email: item.email, code: code || null }); };
let r = null;
try {
const body = await bodyFor(item); if (!body) { drop('gone'); save(); continue; }
r = await hubPost(ROUTE[item.kind] || '/v1/wallet', body);
} catch (e) { r = { status: 0, body: { error: e.message } }; }
const code = (r.body && r.body.error) || null;
if (r.status >= 200 && r.status < 300) {
drop(null); s.stats.sent++; sent++;
if (item.kind === 'join' && r.body && r.body.person) await compare(item.email, r.body.person.sponsor && r.body.person.sponsor.email, 'iap-join');
} else if ((r.status === 400 || r.status === 409) || (r.status === 403 && code === 'blocked') || (item.kind === 'sponsor' && r.status === 404)) {
drop('refused', code); s.stats.refused++;
} else {
item.tries++; s.stats.sendErrors++;
if (item.tries >= OUT_TRIES) drop('gave-up', code || String(r.status));
else { item.next = now + Math.min(3600000, 30000 * Math.pow(2, item.tries)); held.add(item.email); }
}
save();
}
} finally { sending = false; }
return { sent, waiting: s.outbox.length };
}
// password sign-ups do not fire accounts.onChange until they pick a username: every 10 minutes, any account made here since
// the flag went on that the hub has not heard about yet is queued
async function reconcile() {
if (!R || !on()) return { skipped: true };
const s = load(); let queued = 0;
for (const a of await R.accounts.listAll(1e6)) {
const e = norm(a.email);
if (!e || s.reported[e] || SHELL_ORIGINS.has(a.joinedVia) || Number(a.created) < s.since) continue;
s.reported[e] = { u: a.username || null }; s.outbox.push({ kind: 'join', email: e, at: Date.now(), tries: 0, next: 0 }); queued++;
}
if (queued) { save(); kick(); }
return { queued };
}
function start() {
if (interval) return;
interval = setInterval(() => flush().catch(e => console.error('hubsync flush', e.message)), 30000);
const rec = setInterval(() => reconcile().catch(e => console.error('hubsync reconcile', e.message)), 10 * 60000);
for (const t of [interval, rec]) if (t.unref) t.unref();
}
// ---------- rule 3: the holding tank asks the hub (Marty 2026-11-14) ----------
// The tank never offers anyone locked on ANY network contract, or anyone the hub already knows a sponsor for. tank.js asks
// through its hooks (networkHeld, networkLocked, network); server.js wires them only with HUB_ENABLED, so with the flag off
// the tank works exactly as before. One /v1/locked {emails, detail} call per 2,000 emails, cached per email: fresh for 10
// minutes. CONSERVATIVE when the hub cannot be reached: the last answer stands for up to 1 hour, after that the person is
// held ('unknown', not offered, not moved to the tank, not auto-assigned) until the hub answers again. A held tank for a
// while is the safe side; offering someone a contract already holds is not. After a failed call the hub is left alone
// for 2 minutes (page views must not each wait for a timeout).
const HELD_FRESH_MS = 10 * 60000, HELD_STALE_MS = 60 * 60000, HELD_DOWN_MS = 2 * 60000, HELD_CHUNK = 2000;
const held = new Map(); let heldDownUntil = 0, heldBusy = Promise.resolve();
async function refreshHeld(emails, timeout) {
const run = heldBusy.then(async () => {
const now = Date.now(); const miss = emails.filter(e => { const c = held.get(e); return !c || now - c.at > HELD_FRESH_MS; });
if (!miss.length || now < heldDownUntil) return;
try {
for (let i = 0; i < miss.length; i += HELD_CHUNK) {
const part = miss.slice(i, i + HELD_CHUNK);
const r = await hubPost('/v1/locked', { emails: part, detail: true, ids: true }, timeout || 5000); // ids: hub id + door per row (a hub without it ignores the flag)
if (r.status !== 200 || !r.body || !r.body.found || typeof r.body.found !== 'object') throw new Error('hub locked ' + r.status);
if (held.size > 60000) held.clear();
const at = Date.now(); for (const e of part) held.set(e, { at, row: r.body.found[e] || null });
}
} catch (e) { heldDownUntil = Date.now() + HELD_DOWN_MS; load().stats.heldErrors = (load().stats.heldErrors || 0) + 1; console.log('hubsync: hub /v1/locked unreachable:', e.message); }
});
heldBusy = run.catch(() => {}); return run;
}
const whyHeld = (c, now) => (!c || now - c.at > HELD_STALE_MS ? 'unknown' : c.row && c.row.locked ? 'locked' : c.row && c.row.sponsored ? 'sponsored' : null);
// accounts -> Map email -> 'locked' | 'sponsored' | 'unknown' for the ones the tank must not offer
async function heldAmong(accts, opts) {
const out = new Map(); if (!R || !on()) return out;
const emails = [...new Set((accts || []).map(a => norm(a && a.email)).filter(Boolean))]; if (!emails.length) return out;
await refreshHeld(emails, opts && opts.timeout);
const now = Date.now(); for (const e of emails) { const w = whyHeld(held.get(e), now); if (w) out.set(e, w); }
return out;
}
// release, rescue and expiry moves: 'locked' (on any network contract) | 'unknown' (hub not answering) | null
async function lockedAnywhere(email) {
if (!R || !on()) return null; const e = norm(email); if (!e) return null;
await refreshHeld([e]); const w = whyHeld(held.get(e), Date.now());
return w === 'locked' || w === 'unknown' ? w : null;
}
// the sponsor the hub knows for a tank member, for tank.alignToNetwork: this contract's lock first, else the network sponsor
// OFF unless HUB_TANK_ALIGN=on: aligning moves sponsors (and on LinkSpin a linked wallet then has its payouts switched on, which
// locks that sponsor on the contract), so the first run over a full tank is Marty's deliberate step, not a side effect of the
// deploy. While it is off the people the hub knows a sponsor for are simply held out of the tank (rule 3).
const alignOn = () => /^(1|true|on|yes)$/i.test(String(process.env.HUB_TANK_ALIGN || '').trim());
async function hubSponsor(email) {
if (!R || !on() || !alignOn()) return null; const e = norm(email); if (!e) return null;
await refreshHeld([e]); const c = held.get(e); if (!c || !c.row || Date.now() - c.at > HELD_STALE_MS) return null;
const l = c.row.locks && Object.prototype.hasOwnProperty.call(c.row.locks, CONTRACT) ? c.row.locks[CONTRACT] : undefined;
const sp = norm(l !== undefined ? l : c.row.sponsorEmail);
return sp && sp !== e ? { sponsorEmail: sp, via: l !== undefined ? 'network hub, InstantAdPay contract' : 'network hub' } : null;
}
// the hub id and first door of a person the tank cache holds (5xYourTeam draft pool, 2026-11-15): { id, door } | null. Read-only, no call.
function hubInfo(email) { const c = held.get(norm(email)); return c && c.row && c.row.id ? { id: c.row.id, door: c.row.door || null } : null; }
function adminView() {
const s = load();
return Object.assign({ enabled: enabled(), on: on(), site: SITE(), url: URL_(), since: s.since, outbox: s.outbox.length, retrying: Object.keys(s.tries).length,
disagree: Object.keys(s.disagree).length, tankCache: held.size, tankHubDownUntil: heldDownUntil || null }, s.stats, { disagreements: Object.entries(s.disagree).slice(-25).map(([email, d]) => Object.assign({ email }, d)), recent: s.log.slice(-25).reverse() });
}
module.exports = { _state: load, _save: save, _forgetHeld: email => held.delete(norm(email)), _hubBy: hubBy, init, enabled, on, receive, touch, wallet, onChain, flush, reconcile, start, adminView, heldAmong, lockedAnywhere, hubSponsor, hubInfo, resolvePerson: q => resolve(q), _sign: sign, _heldReset: () => { held.clear(); heldDownUntil = 0; }, _heldAge: ms => { for (const c of held.values()) c.at -= ms; } };
+1 -1
View File
@@ -59,7 +59,7 @@ const FAQ = [
{ id: 'f-same-wallet-positions', title: 'One wallet, one position', source: 'faq', { id: 'f-same-wallet-positions', title: 'One wallet, one position', source: 'faq',
questions: ['Can I use the same wallet for more than one position?', 'How do I add positions for Qualified Start?'], questions: ['Can I use the same wallet for more than one position?', 'How do I add positions for Qualified Start?'],
tags: ['wallet', 'position', 'qualified start', 'metamask'], tags: ['wallet', 'position', 'qualified start', 'metamask'],
answer: 'One address is one position on the contract. For Qualified Start, add extra accounts inside your wallet app, each with its own address, and link them on the Buy packages tab. The three Qualified Start videos in Training walk through it.' }, answer: 'One address is one position on the contract. For Qualified Start, add extra accounts inside MetaMask, each with its own address, and link them on the Buy packages tab. The three Qualified Start videos in Training walk through it.' },
{ id: 'f-exchange-withdraw', title: 'Sending POL from an exchange', source: 'faq', { id: 'f-exchange-withdraw', title: 'Sending POL from an exchange', source: 'faq',
questions: ['How do I send POL from Binance or Kraken?', 'Which network do I pick when withdrawing from an exchange?', 'I sent POL on the wrong network'], questions: ['How do I send POL from Binance or Kraken?', 'Which network do I pick when withdrawing from an exchange?', 'I sent POL on the wrong network'],
tags: ['exchange', 'withdraw', 'network', 'polygon', 'binance', 'kraken'], tags: ['exchange', 'withdraw', 'network', 'polygon', 'binance', 'kraken'],
+11 -52
View File
@@ -9,12 +9,6 @@
// path serves the new text. // path serves the new text.
// source canned | faq | ticket | admin // source canned | faq | ticket | admin
// //
// NETWORK (2026-11-15, netkb.js): the other network sites' entries, read from the hub, sit in the same index. This site's own
// entries are boosted first (HOME_BOOST); a question that names another site boosts that site's entries (NAMED_BOOST) and
// skips this site's instant answers (namesOther, chatbot.js). Other sites' entries never take the fast path; they ride along as
// context labelled with the site and the link to send people to. This site's own entries are published to the hub. The same
// merge code is in InstantAdPay, LinkSpin and the rebuilt sites' kb.js.
//
// Retrieval: BM25 over title, question variants and tags, plus the answer text at a low weight, with // Retrieval: BM25 over title, question variants and tags, plus the answer text at a low weight, with
// word bigrams so phrase overlap counts more than scattered words. No embeddings, no external calls. // word bigrams so phrase overlap counts more than scattered words. No embeddings, no external calls.
// The top hits go into the AI system prompt as "Knowledge base" context (chatbot.js). // The top hits go into the AI system prompt as "Knowledge base" context (chatbot.js).
@@ -28,11 +22,10 @@
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const crypto = require('crypto'); const crypto = require('crypto');
let netkb = null; try { netkb = require('./netkb'); } catch (e) {}
const db = require('./db'); const db = require('./db');
let DATA_DIR = null, SEEDS = [], ready = null; let DATA_DIR = null, SEEDS = [], ready = null;
let cache = null, cacheAt = 0, index = null, netVer = ''; let cache = null, cacheAt = 0, index = null;
const TTL = 30000; // two app copies run during a deploy, and MySQL is shared: re-read now and then const TTL = 30000; // two app copies run during a deploy, and MySQL is shared: re-read now and then
// ---------------------------------------------------------------- text + scoring (pure, unit-tested) // ---------------------------------------------------------------- text + scoring (pure, unit-tested)
@@ -89,38 +82,10 @@ function buildIndex(entries) {
} }
return { docs, df, avg, n: docs.length }; return { docs, df, avg, n: docs.length };
} }
const HOME_BOOST = 2, NAMED_BOOST = 3;
// which network sites a question names, by the site name or a short alias ("dlb", "vbb", "iap", ...)
const ALIASES = { iap: ['iap', 'instant ad pay'], linkspin: ['link spin'], bannerline: ['dlb', 'downline banner', 'downline banners'], vbb: ['vbb', 'viral banner'],
viraladblitz: ['vab', 'viral ad blitz'], downlinehydra: ['hydra', 'dh'], fivex: ['5x', '5x your team', 'five x', 'the draft'], stackpol: ['stack pol', 'stackpol'] };
const norm = s => ' ' + String(s || '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim() + ' ';
function namedSites(query, idx) {
const q = norm(query); const out = new Set();
for (const s of (idx && idx.sites) || []) {
const names = [s.name, s.site].concat(ALIASES[s.site] || []).map(norm);
if (names.some(n => n.trim() && q.includes(n))) out.add(s.site);
}
return out;
}
// does the question name a network site other than this one (hub site id `self`)? Then the home fast path stands aside.
const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz', viraladblitz: 'ViralAdBlitz',
downlinehydra: 'DownlineHydra', fivex: '5xYourTeam', stackpol: 'Stack POL', earnerscorner: 'Earners Corner' };
function namesOther(query, self) {
const q = norm(query); const out = [];
const ids = new Set(Object.keys(NAMES).concat(((index && index.sites) || []).map(s => s.site)));
for (const id of ids) {
if (id === self) continue;
const s = ((index && index.sites) || []).find(x => x.site === id) || {};
const names = [s.name, NAMES[id], id.length > 3 ? id : ''].concat(ALIASES[id] || []).filter(Boolean).map(norm);
if (names.some(n => n.trim() && q.includes(n))) out.push(id);
}
return out;
}
function rank(idx, query, k) { function rank(idx, query, k) {
if (!idx || !idx.n) return []; if (!idx || !idx.n) return [];
const qt = [...new Set(terms(query))]; const qt = [...new Set(terms(query))];
if (!qt.length) return []; if (!qt.length) return [];
const named = namedSites(query, idx);
const out = []; const out = [];
for (const d of idx.docs) { for (const d of idx.docs) {
let s = 0; let s = 0;
@@ -132,8 +97,6 @@ function rank(idx, query, k) {
s += FIELDS[f] * idf * (tf * (K1 + 1)) / (tf + K1 * (1 - B + B * d.f[f].len / idx.avg[f])); s += FIELDS[f] * idf * (tf * (K1 + 1)) / (tf + K1 * (1 - B + B * d.f[f].len / idx.avg[f]));
} }
} }
if (s > 0 && d.e.site) s *= named.has(d.e.site) ? NAMED_BOOST : 1;
else if (s > 0) s *= named.size ? 1 : HOME_BOOST;
if (s > 0) out.push({ entry: d.e, score: Math.round(s * 100) / 100 }); if (s > 0) out.push({ entry: d.e, score: Math.round(s * 100) / 100 });
} }
out.sort((a, b) => b.score - a.score); out.sort((a, b) => b.score - a.score);
@@ -225,10 +188,9 @@ function init(opts) {
} }
async function load(force) { async function load(force) {
if (ready) await ready; if (ready) await ready;
if (!force && cache && Date.now() - cacheAt < TTL && (!netkb || netkb.version() === netVer)) return cache; // a new network set rebuilds at once if (!force && cache && Date.now() - cacheAt < TTL) return cache;
const all = await store().all(); const all = await store().all();
cache = all.filter(e => !e.deleted); cacheAt = Date.now(); rx.clear(); netVer = netkb ? netkb.version() : ''; cache = all.filter(e => !e.deleted); cacheAt = Date.now(); index = buildIndex(cache); rx.clear();
index = buildIndex(cache.concat(netkb ? netkb.remote() : [])); index.sites = netkb ? netkb.sites() : [];
return cache; return cache;
} }
const rx = new Map(); const rx = new Map();
@@ -246,16 +208,13 @@ async function fastPath(msg) {
} }
async function search(query, k) { await load(); return rank(index, query, k || 5); } async function search(query, k) { await load(); return rank(index, query, k || 5); }
async function context(query, k) { return relevant(await search(query, k || 5)); } async function context(query, k) { return relevant(await search(query, k || 5)); }
// this site's own entries, for netkb.publish
async function own() { await load(); return cache.slice(); }
const label = e => e.site ? ' (about ' + e.siteName + ', another network site; send people to ' + e.go + ')' : '';
const HELP = 'Help (https://instantadpay.com/my#help, or https://instantadpay.com/support when signed out)'; const HELP = 'Help (https://instantadpay.com/my#help, or https://instantadpay.com/support when signed out)';
function promptBlock(hits) { function promptBlock(hits) {
const unsure = 'say "I\'m not sure, ask support" and point to ' + HELP + '.'; const unsure = 'say "I\'m not sure, ask support" and point to ' + HELP + '.';
if (!hits.length) return 'KNOWLEDGE BASE: no entry matches this question. If the FACTS above do not answer it either, ' + unsure + ' Do not guess.'; if (!hits.length) return 'KNOWLEDGE BASE: no entry matches this question. If the FACTS above do not answer it either, ' + unsure + ' Do not guess.';
return 'KNOWLEDGE BASE (maintained answers, most relevant first). Answer from these when one fits: keep its facts, numbers and links exactly, in your own short words. ' return 'KNOWLEDGE BASE (maintained answers, most relevant first). Answer from these when one fits: keep its facts, numbers and links exactly, in your own short words. '
+ 'If none of them and none of the FACTS answer the question, ' + unsure + ' Never guess.\n' + 'If none of them and none of the FACTS answer the question, ' + unsure + ' Never guess.\n'
+ hits.map((h, i) => '[' + (i + 1) + '] ' + h.entry.title + label(h.entry) + '\nAsked as: ' + (h.entry.questions || []).slice(0, 4).join(' | ') + '\nAnswer: ' + h.entry.answer).join('\n\n'); + hits.map((h, i) => '[' + (i + 1) + '] ' + h.entry.title + '\nAsked as: ' + (h.entry.questions || []).slice(0, 4).join(' | ') + '\nAnswer: ' + h.entry.answer).join('\n\n');
} }
// ---------------------------------------------------------------- the admin side // ---------------------------------------------------------------- the admin side
@@ -276,7 +235,7 @@ function validate(o, cur) {
async function list(q) { async function list(q) {
const all = (await load(true)).slice(); const all = (await load(true)).slice();
if (!q) return all.sort((a, b) => b.updated - a.updated); if (!q) return all.sort((a, b) => b.updated - a.updated);
const ranked = rank(index, q, 50).filter(h => !h.entry.site).map(h => Object.assign({ score: h.score }, h.entry)); const ranked = rank(index, q, 50).map(h => Object.assign({ score: h.score }, h.entry));
const lc = String(q).toLowerCase(), seen = new Set(ranked.map(e => e.id)); const lc = String(q).toLowerCase(), seen = new Set(ranked.map(e => e.id));
const plain = all.filter(e => !seen.has(e.id) && (e.id.includes(lc) || (e.title + ' ' + e.answer + ' ' + (e.ticketRef || '')).toLowerCase().includes(lc))); const plain = all.filter(e => !seen.has(e.id) && (e.id.includes(lc) || (e.title + ' ' + e.answer + ' ' + (e.ticketRef || '')).toLowerCase().includes(lc)));
return ranked.concat(plain); return ranked.concat(plain);
@@ -287,19 +246,19 @@ async function create(o) {
const now = Date.now(), id = 'kb-' + now.toString(36) + crypto.randomBytes(2).toString('hex'); const now = Date.now(), id = 'kb-' + now.toString(36) + crypto.randomBytes(2).toString('hex');
const src = ['ticket', 'admin'].includes(o.source) ? o.source : 'admin'; const src = ['ticket', 'admin'].includes(o.source) ? o.source : 'admin';
const e = Object.assign(v, { id, source: src, ticketRef: String(o.ticketRef || '').slice(0, 20), seedHash: '', edited: true, deleted: false, created: now, updated: now }); const e = Object.assign(v, { id, source: src, ticketRef: String(o.ticketRef || '').slice(0, 20), seedHash: '', edited: true, deleted: false, created: now, updated: now });
await store().put(e); await load(true); if (netkb) netkb.publishSoon(); await store().put(e); await load(true);
return { ok: true, entry: e }; return { ok: true, entry: e };
} }
async function update(id, o) { async function update(id, o) {
const cur = await get(id); if (!cur) return { error: 'Entry not found.' }; const cur = await get(id); if (!cur) return { error: 'Entry not found.' };
const v = validate(o, cur); if (v.error) return v; const v = validate(o, cur); if (v.error) return v;
const e = Object.assign({}, cur, v, { edited: true, updated: Date.now() }); const e = Object.assign({}, cur, v, { edited: true, updated: Date.now() });
await store().put(e); await load(true); if (netkb) netkb.publishSoon(); await store().put(e); await load(true);
return { ok: true, entry: e }; return { ok: true, entry: e };
} }
async function remove(id) { async function remove(id) {
const cur = await get(id); if (!cur) return { error: 'Entry not found.' }; const cur = await get(id); if (!cur) return { error: 'Entry not found.' };
await store().put(Object.assign({}, cur, { deleted: true, updated: Date.now() })); await load(true); if (netkb) netkb.publishSoon(); await store().put(Object.assign({}, cur, { deleted: true, updated: Date.now() })); await load(true);
return { ok: true }; return { ok: true };
} }
// newest change made by a person (admin pane or a saved ticket reply), as a Central-time day. The chatbot-sync // newest change made by a person (admin pane or a saved ticket reply), as a Central-time day. The chatbot-sync
@@ -314,8 +273,8 @@ async function stamp() {
async function test(question) { async function test(question) {
const fast = await fastPath(String(question || '')); const fast = await fastPath(String(question || ''));
const hits = await search(String(question || ''), 8), used = new Set(relevant(hits).map(h => h.entry.id)); const hits = await search(String(question || ''), 8), used = new Set(relevant(hits).map(h => h.entry.id));
return { fast: fast ? { id: fast.id, title: fast.title } : null, ranked: hits.map(h => ({ id: h.entry.id, site: h.entry.site || '', title: h.entry.title, score: h.score, used: used.has(h.entry.id) })) }; return { fast: fast ? { id: fast.id, title: fast.title } : null, ranked: hits.map(h => ({ id: h.entry.id, title: h.entry.title, score: h.score, used: used.has(h.entry.id) })) };
} }
module.exports = { init, load, own, namesOther, fastPath, search, context, promptBlock, list, get, create, update, remove, stamp, test, module.exports = { init, load, fastPath, search, context, promptBlock, list, get, create, update, remove, stamp, test,
_pure: { words, terms, buildIndex, rank, relevant, validate, seedHash, namedSites, MIN_SCORE, HOME_BOOST, NAMED_BOOST } }; _pure: { words, terms, buildIndex, rank, relevant, validate, seedHash, MIN_SCORE } };
+4 -5
View File
@@ -5,7 +5,6 @@
// rollover (checked hourly), announced to Telegram, and credit prizes are granted automatically. // rollover (checked hourly), announced to Telegram, and credit prizes are granted automatically.
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const themehead = require('./themehead'); // light/dark theme head script (2026-11-01)
let R = null; // { chain, accounts, ads, dataDir, siteConfig, notify(text), pushFeed(ev) } let R = null; // { chain, accounts, ads, dataDir, siteConfig, notify(text), pushFeed(ev) }
const TZ = 'America/Chicago'; const TZ = 'America/Chicago';
let cache = { at: 0, rows: null }; let cache = { at: 0, rows: null };
@@ -132,9 +131,9 @@ async function renderPage() {
+ (v.top.length ? v.top.map(r => '<tr><td>' + r.rank + '</td><td><b>' + esc(r.name) + '</b></td><td>' + r.sales + '</td><td>$' + r.usd.toLocaleString() + '</td><td>' + r.buyers + '</td><td>' + r.joins + '</td></tr>').join('') : '<tr><td colspan="6" class="muted">No sales yet in this period.</td></tr>') + '</table>'; + (v.top.length ? v.top.map(r => '<tr><td>' + r.rank + '</td><td><b>' + esc(r.name) + '</b></td><td>' + r.sales + '</td><td>$' + r.usd.toLocaleString() + '</td><td>' + r.buyers + '</td><td>' + r.joins + '</td></tr>').join('') : '<tr><td colspan="6" class="muted">No sales yet in this period.</td></tr>') + '</table>';
const fmtD = ts => new Date(ts).toLocaleDateString('en-US', { timeZone: TZ, month: 'short', day: 'numeric' }); const fmtD = ts => new Date(ts).toLocaleDateString('en-US', { timeZone: TZ, month: 'short', day: 'numeric' });
const desc = 'Who is selling the most ad packages on InstantAdPay this week and this month. Weekly and monthly referral contest standings, read from the chain.'; const desc = 'Who is selling the most ad packages on InstantAdPay this week and this month. Weekly and monthly referral contest standings, read from the chain.';
let h = '<!doctype html><html lang="en"' + themehead.htmlAttr('dark') + '><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Leaderboard | InstantAdPay</title><meta name="description" content="' + esc(desc) + '"><link rel="canonical" href="https://instantadpay.com/leaderboard"><meta property="og:title" content="InstantAdPay leaderboard"><meta property="og:description" content="' + esc(desc) + '"><meta property="og:image" content="https://instantadpay.com/banners/iap-hero-1200x630.png"><meta name="twitter:card" content="summary_large_image">' let h = '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Leaderboard | InstantAdPay</title><meta name="description" content="' + esc(desc) + '"><link rel="canonical" href="https://instantadpay.com/leaderboard"><meta property="og:title" content="InstantAdPay leaderboard"><meta property="og:description" content="' + esc(desc) + '"><meta property="og:image" content="https://instantadpay.com/banners/iap-hero-1200x630.png"><meta name="twitter:card" content="summary_large_image">'
+ '<link rel="icon" type="image/png" href="/logo-icon.png"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">' + themehead.tag() + '<link rel="stylesheet" href="/assets/site.css?v=20261112ln">' + '<link rel="icon" type="image/png" href="/logo-icon.png"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"><link rel="stylesheet" href="/assets/site.css?v=20260913a">'
+ '<style>.lbw{max-width:860px}.lb{width:100%;border-collapse:collapse;margin:8px 0 26px;font-variant-numeric:tabular-nums}.lb th{text-align:left;color:var(--muted);font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:8px 10px;border-bottom:1px solid var(--line)}.lb td{padding:10px;border-bottom:1px solid var(--line)}.lb tr:first-child + tr td:first-child{color:var(--gold);font-weight:800}.prize{border-left:4px solid var(--mint);background:var(--mint-soft);padding:12px 16px;border-radius:0 12px 12px 0;margin:0 0 18px}.win{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:0 0 10px}</style></head><body><div class="wrap lbw">' + '<style>.lbw{max-width:860px}.lb{width:100%;border-collapse:collapse;margin:8px 0 26px;font-variant-numeric:tabular-nums}.lb th{text-align:left;color:var(--muted);font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:8px 10px;border-bottom:1px solid var(--line)}.lb td{padding:10px;border-bottom:1px solid var(--line)}.lb tr:first-child + tr td:first-child{color:#ffd15c;font-weight:800}.prize{border-left:4px solid var(--mint);background:rgba(67,232,195,.07);padding:12px 16px;border-radius:0 12px 12px 0;margin:0 0 18px}.win{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:0 0 10px}</style></head><body><div class="wrap lbw">'
+ '<section class="hero" style="padding:56px 0 8px"><p class="eyebrow">Referral contest</p><h1>Leaderboard: <em>who is selling</em>.</h1><p class="lead">Ranked by ad packages sold to other people (your own positions never count, and the company account is not a contestant). Read from the chain, updated live. Weeks run Monday to Sunday, Central time.</p></section>'; + '<section class="hero" style="padding:56px 0 8px"><p class="eyebrow">Referral contest</p><h1>Leaderboard: <em>who is selling</em>.</h1><p class="lead">Ranked by ad packages sold to other people (your own positions never count, and the company account is not a contestant). Read from the chain, updated live. Weeks run Monday to Sunday, Central time.</p></section>';
h += '<h2 style="font-size:24px;margin:0 0 4px">' + week.label + ' <span class="muted small">' + fmtD(week.start) + ' to Sunday</span></h2>' + (week.prize ? '<div class="prize"><b>Weekly prizes:</b> ' + esc(week.prize) + '</div>' : '') + table(week); h += '<h2 style="font-size:24px;margin:0 0 4px">' + week.label + ' <span class="muted small">' + fmtD(week.start) + ' to Sunday</span></h2>' + (week.prize ? '<div class="prize"><b>Weekly prizes:</b> ' + esc(week.prize) + '</div>' : '') + table(week);
h += '<h2 style="font-size:24px;margin:0 0 4px">' + month.label + '</h2>' + (month.prize ? '<div class="prize"><b>Monthly prizes:</b> ' + esc(month.prize) + '</div>' : '') + table(month); h += '<h2 style="font-size:24px;margin:0 0 4px">' + month.label + '</h2>' + (month.prize ? '<div class="prize"><b>Monthly prizes:</b> ' + esc(month.prize) + '</div>' : '') + table(month);
@@ -142,7 +141,7 @@ async function renderPage() {
const w = winners(); const w = winners();
if (w.length) h += '<h2 style="font-size:24px;margin:0 0 10px">Past winners</h2>' + w.slice(0, 12).map(x => '<div class="win"><b>' + (x.kind === 'week' ? 'Week of ' : 'Month of ') + fmtD(x.start) + '</b>: ' + (x.top[0] ? esc(x.top[0].name) + ' (' + x.top[0].sales + ' sold, $' + x.top[0].usd + ')' : 'no sales') + (x.granted && x.granted.length ? ' · awarded: ' + x.granted.map(g => esc(g.name) + ' +' + g.credits.toLocaleString()).join(', ') : (x.prize ? ' · prize ' + esc(x.prize) : '')) + '</div>').join(''); if (w.length) h += '<h2 style="font-size:24px;margin:0 0 10px">Past winners</h2>' + w.slice(0, 12).map(x => '<div class="win"><b>' + (x.kind === 'week' ? 'Week of ' : 'Month of ') + fmtD(x.start) + '</b>: ' + (x.top[0] ? esc(x.top[0].name) + ' (' + x.top[0].sales + ' sold, $' + x.top[0].usd + ')' : 'no sales') + (x.granted && x.granted.length ? ' · awarded: ' + x.granted.map(g => esc(g.name) + ' +' + g.credits.toLocaleString()).join(', ') : (x.prize ? ' · prize ' + esc(x.prize) : '')) + '</div>').join('');
h += '<p class="muted small" style="margin-top:30px">Sales are $ of packages bought by members you directly sponsor. Prizes are advertising credits or packages, never cash. No income is guaranteed.</p>'; h += '<p class="muted small" style="margin-top:30px">Sales are $ of packages bought by members you directly sponsor. Prizes are advertising credits or packages, never cash. No income is guaranteed.</p>';
h += '</div><script src="/assets/common.js?v=20261117nw"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>'; h += '</div><script src="/assets/common.js?v=20261023ov"></script><script src="/assets/blog-page.js?v=20260914a"></script></body></html>';
return h; return h;
} }
module.exports = { init, view, compute, renderPage, rolloverTick, winners, periodBounds }; module.exports = { init, view, compute, renderPage, rolloverTick, winners, periodBounds };
-76
View File
@@ -1,76 +0,0 @@
// Login-ad clock (Marty 2026-11-15): "I definitely don't want somebody to not look at a login ad for 7 days... if login ads are
// available on those sites, they need to be seen several times a day." The SAME file ships in InstantAdPay and LinkSpin.
//
// A member sees the login ad on their next member-area page load whenever their last finished login-ad view on THIS site is more
// than loginAdEveryHours old (site setting, default 3), whether or not they just signed in. One row per member in MySQL
// (table login_ad_views: k = lowercased email, or 'w:' + wallet for a wallet-only session; seen_at; served_at).
// due(k) true when the member should get the login ad now (no row, or seen_at older than the setting)
// served(k) the login ad was handed to this member (the countdown starts on their screen)
// seen(k, s) the countdown ended: counts only when a serve to this member happened at least s - 2 seconds ago and within the
// last 30 minutes, so reloading during the countdown never skips the ad
// forget(k) member erase
// No database (local QA): the same rules in memory. A failed database read answers "due": when in doubt the ad shows.
'use strict';
let pool = null, tableReady = null, hours = () => 3;
const mem = new Map(); // k -> { seen, served }
const SERVE_WINDOW = 30 * 60 * 1000;
const keyOf = s => {
if (!s) return '';
const e = String(s.email || '').trim().toLowerCase();
if (e) return e.slice(0, 190);
const a = String(s.address || '').trim().toLowerCase();
return /^0x[0-9a-f]{40}$/.test(a) ? 'w:' + a : '';
};
const everyMs = () => { const h = Number(hours()); return (Number.isFinite(h) && h > 0 ? Math.min(h, 24 * 30) : 3) * 3600 * 1000; };
function init(opts) {
const o = opts || {};
if (typeof o.hours === 'function') hours = o.hours;
const url = String(o.url || '').trim();
pool = null; tableReady = null; mem.clear();
if (url) { const mysql = require('mysql2/promise'); pool = mysql.createPool({ uri: url, connectionLimit: 3, charset: 'utf8mb4' }); }
}
async function table() {
if (!tableReady) tableReady = pool.query('CREATE TABLE IF NOT EXISTS login_ad_views (k VARCHAR(200) PRIMARY KEY, seen_at BIGINT NOT NULL DEFAULT 0, served_at BIGINT NOT NULL DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4').catch(e => { tableReady = null; throw e; });
return tableReady;
}
async function row(k) {
if (!pool) return mem.get(k) || null;
await table();
const [r] = await pool.query('SELECT seen_at, served_at FROM login_ad_views WHERE k = ?', [k]);
return r[0] ? { seen: Number(r[0].seen_at) || 0, served: Number(r[0].served_at) || 0 } : null;
}
async function due(k, now) {
if (!k) return false;
const t = now || Date.now();
try { const r = await row(k); return !r || !r.seen || t - r.seen >= everyMs(); } catch (e) { console.error('login-ad clock read', e.message); return true; }
}
async function served(k, now) {
if (!k) return;
const t = now || Date.now();
if (!pool) { const r = mem.get(k) || { seen: 0, served: 0 }; r.served = t; mem.set(k, r); return; }
try { await table(); await pool.query('INSERT INTO login_ad_views (k, served_at) VALUES (?, ?) ON DUPLICATE KEY UPDATE served_at = VALUES(served_at)', [k, t]); }
catch (e) { console.error('login-ad clock serve', e.message); }
}
// -> { ok: true } or { ok: false, reason }
async function seen(k, dwellSec, now) {
if (!k) return { ok: false, reason: 'signed out' };
const t = now || Date.now();
const need = Math.max(0, (Number(dwellSec) || 10) - 2) * 1000;
let r = null; try { r = await row(k); } catch (e) { console.error('login-ad clock read', e.message); return { ok: false, reason: 'store' }; }
if (!r || !r.served || t - r.served > SERVE_WINDOW) return { ok: false, reason: 'not served' };
if (t - r.served < need) return { ok: false, reason: 'too soon' };
if (!pool) { r.seen = t; mem.set(k, r); return { ok: true }; }
try { await pool.query('UPDATE login_ad_views SET seen_at = ? WHERE k = ?', [t, k]); return { ok: true }; }
catch (e) { console.error('login-ad clock seen', e.message); return { ok: false, reason: 'store' }; }
}
async function forget(k) {
if (!k) return;
mem.delete(k);
if (pool) { try { await table(); await pool.query('DELETE FROM login_ad_views WHERE k = ?', [k]); } catch (e) { console.error('login-ad clock forget', e.message); } }
}
module.exports = { init, keyOf, due, served, seen, forget, everyMs };
+1 -1
View File
@@ -173,4 +173,4 @@ async function goalOp(email, op, fields) {
cache.delete(e); return out; cache.delete(e); return out;
} }
function adminView() { return { on: on(), url: URL_(), pushed: stats.pushed, lastAt: stats.lastAt, errors: stats.errors, lastError: stats.lastError, fails, nextAt: nextAt || null }; } function adminView() { return { on: on(), url: URL_(), pushed: stats.pushed, lastAt: stats.lastAt, errors: stats.errors, lastError: stats.lastError, fails, nextAt: nextAt || null }; }
module.exports = { signedPost, init, record, flush, summary, goalOp, withClickId, softKey, placementOf, deviceOf, newId, adminView, on, noteSession, isOwnerSk }; module.exports = { init, record, flush, summary, goalOp, withClickId, softKey, placementOf, deviceOf, newId, adminView, on, noteSession, isOwnerSk };
+8 -12
View File
@@ -25,7 +25,6 @@
// hides someone adopted on LinkSpin and the two-adoptions limit counts both sites. // hides someone adopted on LinkSpin and the two-adoptions limit counts both sites.
'use strict'; 'use strict';
const SF = require('./sponsorfollow'); const SF = require('./sponsorfollow');
const prohibited = require('./prohibited'); // 2026-10-30: policy applied on ingest
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
@@ -99,10 +98,8 @@ async function fill(a, r, sum) {
} }
if (r.profile && A.setProfile) { // same rules as LinkSpin's side: https only, known socials, fills only what is empty if (r.profile && A.setProfile) { // same rules as LinkSpin's side: https only, known socials, fills only what is empty
const pf = r.profile, ok = v => /^https:[/][/][^ ]+$/i.test(v) && v.length <= 300; const pf = r.profile, ok = v => /^https:[/][/][^ ]+$/i.test(v) && v.length <= 300;
// prohibited-content policy on ingest (2026-10-30): a bio with a link or a prohibited term, or a social carrying one, is dropped, not stored const av = String(pf.avatarUrl || '').trim(); const bio = String(pf.bio || '').trim().slice(0, 600); let soc = null;
const cp = prohibited.cleanProfile(pf, 'InstantAdPay'); if (cp.dropped.length) console.log('lsinbound profile dropped', String(a.email).replace(/^(.).*(@.*)$/, '$1***$2'), cp.dropped.join(',')); if (pf.socials && typeof pf.socials === 'object') { const c = {}; for (const k of ['facebook', 'twitter', 'youtube', 'instagram', 'tiktok', 'telegram', 'linkedin', 'website', 'video']) { const v = String(pf.socials[k] || '').trim(); if (ok(v)) c[k] = v; } if (Object.keys(c).length) soc = JSON.stringify(c); }
const av = String(pf.avatarUrl || '').trim(); const bio = cp.bio || ''; let soc = null;
if (cp.socials) { const c = {}; for (const k of ['facebook', 'twitter', 'youtube', 'instagram', 'tiktok', 'telegram', 'linkedin', 'website', 'video']) { const v = String(cp.socials[k] || '').trim(); if (ok(v)) c[k] = v; } if (Object.keys(c).length) soc = JSON.stringify(c); }
const upd = [!a.avatarUrl && ok(av) ? av : undefined, !a.bio && bio ? bio : undefined, !a.socials && soc ? soc : undefined]; const upd = [!a.avatarUrl && ok(av) ? av : undefined, !a.bio && bio ? bio : undefined, !a.socials && soc ? soc : undefined];
if (upd.some(v => v !== undefined)) { const x = await A.setProfile(a.email, upd[0], upd[1], upd[2]); if (!(x && x.error)) { sum.filled++; wrote = true; } } if (upd.some(v => v !== undefined)) { const x = await A.setProfile(a.email, upd[0], upd[1], upd[2]); if (!(x && x.error)) { sum.filled++; wrote = true; } }
} }
@@ -127,7 +124,7 @@ async function place(email, depth, ctx) {
const sp = await sponsorAccount(r.sponsorEmail, depth, ctx); const sp = await sponsorAccount(r.sponsorEmail, depth, ctx);
if (sp) tok = tokenOf(sp); else { s.pending[email] = r.sponsorEmail; ctx.sum.pendingSponsor++; } if (sp) tok = tokenOf(sp); else { s.pending[email] = r.sponsorEmail; ctx.sum.pendingSponsor++; }
} }
const x = await A.ensure(email, tok, ctx.via || 'linkspin', ctx.refOf ? ctx.refOf(email) : 'linkspin'); // hubsync.js passes its own via (2026-11-12) const x = await A.ensure(email, tok, 'linkspin', 'linkspin');
if (!x || x.error) { conflict(ctx.sum, email, 'create', x && x.error); return null; } if (!x || x.error) { conflict(ctx.sum, email, 'create', x && x.error); return null; }
a = x.account; a = x.account;
if (x.created) { ctx.sum.created++; wrote = true; note({ type: 'shell', email, sponsor: tok || null, pending: tok ? null : (r.sponsorEmail || null) }); } if (x.created) { ctx.sum.created++; wrote = true; note({ type: 'shell', email, sponsor: tok || null, pending: tok ? null : (r.sponsorEmail || null) }); }
@@ -156,11 +153,11 @@ async function resolvePending(ctx) {
note({ type: 'sponsored', email, sponsor: tokenOf(sp) }); note({ type: 'sponsored', email, sponsor: tokenOf(sp) });
} }
} }
async function handle(rows, opts) { async function handle(rows) {
const s = load(); s.stats.batches++; const s = load(); s.stats.batches++;
const sum = { rows: 0, noop: 0, created: 0, filled: 0, sponsored: 0, conflicts: 0, pendingSponsor: 0, errors: 0, followed: 0, followKept: 0, tank: 0 }; const sum = { rows: 0, noop: 0, created: 0, filled: 0, sponsored: 0, conflicts: 0, pendingSponsor: 0, errors: 0, followed: 0, followKept: 0, tank: 0 };
const ctx = { sum, done: new Set(), via: opts && opts.via, refOf: opts && opts.refOf }; const batch = []; const ctx = { sum, done: new Set() }; const batch = [];
for (const x of rows || []) { const r = clean(x); if (!r) continue; if (R.erased && R.erased(r.email)) { sum.erased = (sum.erased || 0) + 1; continue; } sum.rows++; s.rows[r.email] = r; batch.push(r); } // erased here (erase.js): never brought back by a sync for (const x of rows || []) { const r = clean(x); if (!r) continue; sum.rows++; s.rows[r.email] = r; batch.push(r); }
if (R.store) for (const r of batch) if (Object.prototype.hasOwnProperty.call(r, 'tank')) { R.store.setRemote(r.email, r.tank); sum.tank++; } // network tank if (R.store) for (const r of batch) if (Object.prototype.hasOwnProperty.call(r, 'tank')) { R.store.setRemote(r.email, r.tank); sum.tank++; } // network tank
try { try {
for (const r of batch) { for (const r of batch) {
@@ -176,8 +173,7 @@ async function handle(rows, opts) {
return Object.assign({ proto: SF.PROTO }, sum); // proto 2: this side understands sponsor follow + network tank facts return Object.assign({ proto: SF.PROTO }, sum); // proto 2: this side understands sponsor follow + network tank facts
} }
// batches are applied one at a time (two overlapping posts must not both create the same sponsor shell) // batches are applied one at a time (two overlapping posts must not both create the same sponsor shell)
// opts (hubsync.js only): { via, refOf(email) } names where a new waiting account came from; LinkSpin's posts pass none function receive(rows) { const run = chain_.then(() => handle(rows)); chain_ = run.catch(() => {}); return run; }
function receive(rows, opts) { const run = chain_.then(() => handle(rows, opts)); chain_ = run.catch(() => {}); return run; }
function adminView() { function adminView() {
const s = load(); const s = load();
return Object.assign({}, s.stats, { knownRows: Object.keys(s.rows).length, pendingSponsors: Object.keys(s.pending).length, last: s.last || null, lastError: s.stats.lastError || null, recent: s.log.slice(-25).reverse() }); return Object.assign({}, s.stats, { knownRows: Object.keys(s.rows).length, pendingSponsors: Object.keys(s.pending).length, last: s.last || null, lastError: s.stats.lastError || null, recent: s.log.slice(-25).reverse() });
@@ -192,4 +188,4 @@ function networkSponsor(email, address) {
if (/^0x[0-9a-f]{40}$/.test(w)) for (const x of Object.values(s.rows)) if (x.wallet === w && x.sponsorEmail && x.sponsorEmail !== e && x.email !== e) return { sponsorEmail: x.sponsorEmail, via: 'same wallet' }; if (/^0x[0-9a-f]{40}$/.test(w)) for (const x of Object.values(s.rows)) if (x.wallet === w && x.sponsorEmail && x.sponsorEmail !== e && x.email !== e) return { sponsorEmail: x.sponsorEmail, via: 'same wallet' };
return null; return null;
} }
module.exports = { init, receive, adminView, networkSponsor, _state: load, _save: save }; // _state/_save: the member erase (erase.js) module.exports = { init, receive, adminView, networkSponsor };
-151
View File
@@ -1,151 +0,0 @@
// Conversion linkage, InstantAdPay half (Marty 2026-11-07, "Yes ship these"). REPORTING ONLY: this module never reads or changes a
// sponsor, a payout, credits or anything on chain. LinkSpin owns the counting; this keeps the click and tells it what happened.
// the click arrives as ?lsclk= or ?lsid= on any page: a first-party cookie iap.lsclk, 30 days, last click wins (the same life
// and last-touch rule as the sponsor cookie), plus the page's own copy sent with the code request, because the
// cookie is refused inside a traffic-exchange frame and never crosses browsers (the 2026-09-29 sponsor lesson)
// the account kept in its own table, ls_account_clicks, keyed by email: remembered when the code is requested, bound when the
// account is created (or a waiting LinkSpin shell is claimed). Its own table on purpose: accounts is not touched
// the events sign-up, wallet link, each package Purchase on the chain, by an account with a bound click. One row each in
// ls_events; its primary key is the idempotency key (join:<hash>, wallet:<hash>, purchase:<tx>:<log index>), so two
// app copies during a deploy can both try and only one row exists
// the delivery a loop in the background posts unsent rows to LinkSpin (POST /api/partner/conv op events, signed like lsconv), 100
// at a time, every ~5 s with backoff to 5 minutes. A row is marked sent only after LinkSpin answers, and LinkSpin
// dedupes by the same key, so a row sent by both copies, or twice, counts once
// Nothing here runs in the chain event handler's path or in a sign-up's path beyond one local write: LinkSpin down, slow or
// blocked changes nothing except that rows wait. No LS_SYNC_SECRET: rows wait too.
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const lsconv = require('./lsconv');
let R = null, timer = null, flushing = false, fails = 0, nextAt = 0, jstate = null, saveT = null;
const stats = { sent: 0, lastAt: null, lastError: null, errors: 0 };
const DAY = 86400000, WINDOW = 30 * DAY;
const useDb = () => !!(R && R.db && R.db.enabled());
const JFILE = () => path.join(R.dataDir, 'lsreport.json');
const norm = e => String(e || '').trim().toLowerCase();
const isId = v => /^(?:[a-f0-9]{10}|[aik][a-f0-9]{11})$/.test(String(v || ''));
const hash = email => crypto.createHash('sha256').update(norm(email)).digest('hex').slice(0, 24);
// the id in a page address, or '' (lsclk first: it is the id the landing tag and ad clicks carry)
const fromUrl = u => { const v = u.searchParams.get('lsclk') || u.searchParams.get('lsid') || ''; return isId(v) ? v : ''; };
const pick = (...vals) => { for (const v of vals) if (isId(v)) return String(v); return ''; };
const COOKIE = 'iap.lsclk';
const cookieHeader = (id, isProd) => COOKIE + '=' + id + '; Path=/; Max-Age=' + (30 * 86400) + '; ' + (isProd ? 'SameSite=None; Secure' : 'SameSite=Lax');
function init(deps) {
R = deps;
if (useDb()) ensureTables().catch(e => console.error('lsreport tables', e.message));
if (!deps.noTimers) {
if (!timer) { timer = setInterval(() => { flush().catch(() => {}); }, 5000); if (timer.unref) timer.unref(); }
setInterval(() => prune().catch(() => {}), 6 * 3600 * 1000).unref();
}
}
// column names checked against MySQL 8 reserved words (none of email, click_id, ts, bound, k, ev, cents, ev_ts, tx, sk, pushed, outcome is reserved)
async function ensureTables() {
await R.db.q(`CREATE TABLE IF NOT EXISTS ls_account_clicks (
email VARCHAR(190) PRIMARY KEY,
click_id VARCHAR(16) NOT NULL,
ts BIGINT NOT NULL,
bound TINYINT NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`);
await R.db.q(`CREATE TABLE IF NOT EXISTS ls_events (
k VARCHAR(120) PRIMARY KEY,
ev VARCHAR(10) NOT NULL,
email VARCHAR(190) NOT NULL,
click_id VARCHAR(16) NOT NULL,
cents INT NOT NULL DEFAULT 0,
ev_ts BIGINT NOT NULL,
tx VARCHAR(80) NULL,
sk VARCHAR(24) NULL,
pushed TINYINT NOT NULL DEFAULT 0,
outcome VARCHAR(12) NULL,
INDEX (pushed, ev_ts)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4`);
}
// ---- JSON store (local runs) ----
function jload() { if (jstate) return jstate; try { jstate = JSON.parse(fs.readFileSync(JFILE(), 'utf8')); if (!jstate.clicks || !Array.isArray(jstate.events)) throw 0; } catch (e) { jstate = { clicks: {}, events: [] }; } return jstate; }
function jsave() { if (saveT) return; saveT = setTimeout(() => { saveT = null; try { fs.writeFileSync(JFILE(), JSON.stringify(jload())); } catch (e) {} }, 300); if (saveT.unref) saveT.unref(); }
// ---- the click on the account ----
async function clickOf(email) {
const e = norm(email);
if (useDb()) { const r = (await R.db.q('SELECT click_id, ts, bound FROM ls_account_clicks WHERE email=?', [e]))[0]; return r ? { click: r.click_id, ts: Number(r.ts), bound: Number(r.bound) ? 1 : 0 } : null; }
return jload().clicks[e] || null;
}
// at the code request: the click travels with the email, so verifying in another browser still finds it. Last click wins until bound.
async function remember(email, click) {
const e = norm(email); if (!e || e.length > 190 || !isId(click)) return false;
const now = Date.now();
if (useDb()) { await R.db.q('INSERT INTO ls_account_clicks (email, click_id, ts, bound) VALUES (?,?,?,0) ON DUPLICATE KEY UPDATE click_id=IF(bound=0,VALUES(click_id),click_id), ts=IF(bound=0,VALUES(ts),ts)', [e, click, now]); return true; }
const st = jload(); if (st.clicks[e] && st.clicks[e].bound) return false; st.clicks[e] = { click, ts: now, bound: 0 }; jsave(); return true;
}
// the account now exists: bind the click (this request's, else the remembered one), once, and queue the join
async function signup(email, click, sk) {
const e = norm(email); if (!e || e.length > 190) return false;
const row = await clickOf(e); if (row && row.bound) return false;
const c = isId(click) ? click : (row && Date.now() - row.ts <= WINDOW ? row.click : ''); if (!c) return false;
const now = Date.now();
if (useDb()) {
await R.db.q('INSERT IGNORE INTO ls_account_clicks (email, click_id, ts, bound) VALUES (?,?,?,0)', [e, c, now]);
const u = await R.db.q('UPDATE ls_account_clicks SET click_id=?, ts=?, bound=1 WHERE email=? AND bound=0', [c, now, e]);
if (!(u && u.affectedRows === 1)) return false;
} else { const st = jload(); st.clicks[e] = { click: c, ts: now, bound: 1 }; jsave(); }
await enqueue({ k: 'join:' + hash(e), ev: 'join', email: e, click: c, cents: 0, ts: now, sk: /^s:[a-f0-9]{20}$/.test(String(sk || '')) ? sk : null });
return true;
}
async function wallet(email) {
const e = norm(email); const row = await clickOf(e); if (!row || !row.bound) return false;
return enqueue({ k: 'wallet:' + hash(e), ev: 'wallet', email: e, click: row.click, cents: 0, ts: Date.now() });
}
// a Purchase chain event, already resolved to its account. Value = the USD price on the event. Linked positions sit on the same
// account, so they count as that account's purchases. Past the click window nothing is queued: LinkSpin would refuse it anyway
// (the bind is never earlier than the click, so more than 30 days after the bind is more than 30 days after the click).
async function purchase(ev, email) {
const e = norm(email); const cents = Number(ev && ev.priceCents) || 0; if (!e || cents <= 0 || !ev.tx) return false;
const row = await clickOf(e); if (!row || !row.bound) return false;
const ts = Number(ev.ts) || Date.now();
if (ts < row.ts - 60000 || ts - row.ts > WINDOW) return false; // before the sign-up, or past the window
return enqueue({ k: ('purchase:' + ev.tx + ':' + ev.li).slice(0, 120), ev: 'purchase', email: e, click: row.click, cents, ts, tx: String(ev.tx).slice(0, 80) });
}
async function enqueue(x) {
if (useDb()) { const r = await R.db.q('INSERT IGNORE INTO ls_events (k, ev, email, click_id, cents, ev_ts, tx, sk, pushed) VALUES (?,?,?,?,?,?,?,?,0)', [x.k, x.ev, x.email, x.click, x.cents, x.ts, x.tx || null, x.sk || null]); return !!(r && r.affectedRows === 1); }
const st = jload(); if (st.events.some(r => r.k === x.k)) return false; st.events.push(Object.assign({ pushed: 0 }, x)); if (st.events.length > 5000) st.events = st.events.slice(-4000); jsave(); return true;
}
// ---- delivery ----
async function unsent(n) {
if (useDb()) return (await R.db.q('SELECT k, ev, email, click_id, cents, ev_ts, tx, sk FROM ls_events WHERE pushed=0 ORDER BY ev_ts LIMIT ?', [n])).map(r => ({ k: r.k, ev: r.ev, email: r.email, click: r.click_id, cents: Number(r.cents) || 0, ts: Number(r.ev_ts), tx: r.tx, sk: r.sk }));
return jload().events.filter(r => !r.pushed).slice(0, n);
}
async function markSent(k, outcome) {
if (useDb()) { await R.db.q('UPDATE ls_events SET pushed=1, outcome=? WHERE k=?', [String(outcome || '').slice(0, 12) || null, k]); return; }
const r = jload().events.find(x => x.k === k); if (r) { r.pushed = 1; r.outcome = outcome; jsave(); }
}
async function flush() {
if (!lsconv.on() || flushing || Date.now() < nextAt) return { skipped: true };
flushing = true; let sent = 0;
try {
for (let round = 0; round < 10; round++) {
const rows = await unsent(100); if (!rows.length) break;
const res = await lsconv.signedPost('/api/partner/conv', { op: 'events', events: rows.map(r => ({ k: r.k, ev: r.ev, email: r.email, click: r.click, value: r.cents / 100, ts: r.ts, tx: r.tx || undefined, sk: r.sk || undefined })) }, 15000);
if (!res || res.ok !== true || !Array.isArray(res.results)) throw new Error('linkspin answered without results');
for (const a of res.results) { await markSent(a.k, a.result); sent++; stats.sent++; }
stats.lastAt = Date.now();
if (rows.length < 100) break;
}
fails = 0; nextAt = 0; return { sent };
} catch (e) {
fails++; stats.errors++; stats.lastError = e.message; nextAt = Date.now() + Math.min(300000, 5000 * Math.pow(2, Math.min(fails, 6)));
if (fails <= 3 || fails % 20 === 0) console.error('lsreport push', e.message);
return { error: e.message, sent };
} finally { flushing = false; }
}
async function prune() {
const now = Date.now(); const old = now - 60 * DAY, stale = now - 31 * DAY;
if (useDb()) { await R.db.q('DELETE FROM ls_events WHERE ev_ts<?', [old]); await R.db.q('DELETE FROM ls_account_clicks WHERE (bound=0 AND ts<?) OR ts<?', [stale, old]); return; }
const st = jload(); st.events = st.events.filter(r => r.ts >= old); for (const k of Object.keys(st.clicks)) { const c = st.clicks[k]; if (c.ts < old || (!c.bound && c.ts < stale)) delete st.clicks[k]; } jsave();
}
function adminView() { return { on: lsconv.on(), sent: stats.sent, lastAt: stats.lastAt, errors: stats.errors, lastError: stats.lastError, fails, nextAt: nextAt || null }; }
module.exports = { init, ensureTables, fromUrl, pick, cookieHeader, COOKIE, isId, remember, signup, wallet, purchase, clickOf, flush, prune, adminView };
+7 -22
View File
@@ -14,7 +14,6 @@
'use strict'; 'use strict';
const crypto = require('crypto'); const crypto = require('crypto');
const SF = require('./sponsorfollow'); const SF = require('./sponsorfollow');
const prohibited = require('./prohibited'); // 2026-10-30: a profile that fails the policy never leaves this site
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
@@ -32,7 +31,6 @@ async function rowFor(acct, byRef, tankMap) {
const ref = String(acct.sponsorRef || '').toLowerCase(); let sponsorEmail = null; const ref = String(acct.sponsorRef || '').toLowerCase(); let sponsorEmail = null;
if (ref) { const sp = byRef ? byRef.get(ref) : (await R.accounts.byUsername(ref) || await R.accounts.byCode(ref)); if (sp && sp.email !== acct.email) sponsorEmail = sp.email; } if (ref) { const sp = byRef ? byRef.get(ref) : (await R.accounts.byUsername(ref) || await R.accounts.byCode(ref)); if (sp && sp.email !== acct.email) sponsorEmail = sp.email; }
const row = { email: acct.email, username: acct.username || null, wallet: acct.address || null, sponsorEmail, joinedAt: Number(acct.created) || null, memberId: acct.memberId || null, profile: profileOf(acct) }; const row = { email: acct.email, username: acct.username || null, wallet: acct.address || null, sponsorEmail, joinedAt: Number(acct.created) || null, memberId: acct.memberId || null, profile: profileOf(acct) };
if (acct.joinedVia === 'btc4hits') row.origin = 'btc4hits'; // BTC4Hits import (2026-11-11): LinkSpin words its holding-tank mail for them
if (R.follow) Object.assign(row, SF.rowFields(R.follow.get(acct.email), sponsorEmail) || {}); if (R.follow) Object.assign(row, SF.rowFields(R.follow.get(acct.email), sponsorEmail) || {});
const T = R.tank && R.tank(); const T = R.tank && R.tank();
if (T) { try { row.tank = (tankMap ? tankMap.get(String(acct.email).toLowerCase()) : await T.summaryFor(acct.email)) || null; } catch (e) {} } if (T) { try { row.tank = (tankMap ? tankMap.get(String(acct.email).toLowerCase()) : await T.summaryFor(acct.email)) || null; } catch (e) {} }
@@ -43,19 +41,12 @@ const carriesNew = r => !!(r.sponsorSetBy || r.tank);
// absolute https URL so the other property can show it; socials as the parsed {platform: url} object. // absolute https URL so the other property can show it; socials as the parsed {platform: url} object.
const PUBLIC = () => String(process.env.PUBLIC_URL || 'https://instantadpay.com').replace(/\/+$/, ''); const PUBLIC = () => String(process.env.PUBLIC_URL || 'https://instantadpay.com').replace(/\/+$/, '');
function profileOf(a) { function profileOf(a) {
if (a.profileQuarantined) return null; // quarantined (link planted on a brand-new free account): stays here, unseen, until Marty decides let socials = null; try { socials = a.socials ? (typeof a.socials === 'string' ? JSON.parse(a.socials) : a.socials) : null; } catch (e) { socials = null; }
const cp = prohibited.cleanProfile({ avatarUrl: a.avatarUrl, bio: a.bio, socials: a.socials }, 'InstantAdPay'); // policy applied on the way out too
const socials = cp.socials;
const av = String(a.avatarUrl || '').trim(); const av = String(a.avatarUrl || '').trim();
const avatarUrl = !av ? null : /^https:\/\//i.test(av) ? av : av.startsWith('/') ? PUBLIC() + av : null; const avatarUrl = !av ? null : /^https:\/\//i.test(av) ? av : av.startsWith('/') ? PUBLIC() + av : null;
const bio = cp.bio; const bio = String(a.bio || '').trim().slice(0, 600) || null;
// the BixPay partner link travels too (2026-10-29): LinkSpin shows it read-only ("Edit on InstantAdPay") and resolves the if (!avatarUrl && !bio && !(socials && Object.keys(socials).length)) return null;
// same way; only set when there is one, so rows without it keep the hash they had return { avatarUrl, bio, socials: socials && Object.keys(socials).length ? socials : null };
const bixPartnerLink = String(a.bixPartnerLink || '').trim() || null;
if (!avatarUrl && !bio && !bixPartnerLink && !(socials && Object.keys(socials).length)) return null;
const out = { avatarUrl, bio, socials: socials && Object.keys(socials).length ? socials : null };
if (bixPartnerLink) out.bixPartnerLink = bixPartnerLink;
return out;
} }
const hashOf = r => crypto.createHash('sha1').update([r.username || '', r.wallet || '', r.sponsorEmail || '', r.joinedAt || '', r.memberId || '', r.profile ? JSON.stringify(r.profile) : ''].join('|') + SF.hashExtra(r)).digest('hex').slice(0, 16); const hashOf = r => crypto.createHash('sha1').update([r.username || '', r.wallet || '', r.sponsorEmail || '', r.joinedAt || '', r.memberId || '', r.profile ? JSON.stringify(r.profile) : ''].join('|') + SF.hashExtra(r)).digest('hex').slice(0, 16);
@@ -75,14 +66,10 @@ async function push(rows) {
} }
st.pushed += sent; st.last = { at: Date.now(), rows: sent }; save(); return sent; st.pushed += sent; st.last = { at: Date.now(), rows: sent }; save(); return sent;
} }
// QUIET (Marty 2026-11-14, "join one = join all"): a waiting account the network hub made here (joinedVia 'hub', never signed
// in) is never pushed to LinkSpin. The hub tells LinkSpin itself, quietly; pushed from here, LinkSpin's registry route would
// link the wallet and its engine would switch payouts on and email them. Once they sign in here they sync like anyone.
const hubShell = a => !!a && a.joinedVia === 'hub' && R.accounts.isUnclaimedShell && R.accounts.isUnclaimedShell(a);
// an account just changed: send its row shortly (debounced so a join + username + wallet in a row go as one) // an account just changed: send its row shortly (debounced so a join + username + wallet in a row go as one)
function touch(email) { function touch(email) {
if (!on() || !email) return; pending.set(String(email).toLowerCase(), Date.now()); if (!on() || !email) return; pending.set(String(email).toLowerCase(), Date.now());
if (!timer) timer = setTimeout(async () => { timer = null; const st = load(); const emails = [...pending.keys()].filter(e => !muted.has(e)); for (const e of emails) pending.delete(e); try { const rows = []; for (const e of emails) { const a = await R.accounts.byEmail(e); if (a && !hubShell(a)) { const r = await rowFor(a); if (st.hashes[r.email] !== hashOf(r)) rows.push(r); } } if (rows.length) await push(rows); } catch (e) { load().errors++; save(); console.error('lssync touch', e.message); } }, 3000); if (!timer) timer = setTimeout(async () => { timer = null; const st = load(); const emails = [...pending.keys()].filter(e => !muted.has(e)); for (const e of emails) pending.delete(e); try { const rows = []; for (const e of emails) { const a = await R.accounts.byEmail(e); if (a) { const r = await rowFor(a); if (st.hashes[r.email] !== hashOf(r)) rows.push(r); } } if (rows.length) await push(rows); } catch (e) { load().errors++; save(); console.error('lssync touch', e.message); } }, 3000);
} }
// the reconcile pass: only rows whose hash changed since the last push // the reconcile pass: only rows whose hash changed since the last push
async function tick(force) { async function tick(force) {
@@ -92,7 +79,7 @@ async function tick(force) {
const all = await R.accounts.listAll(50000, { shells: true }); const st = load(); const all = await R.accounts.listAll(50000, { shells: true }); const st = load();
const byRef = new Map(); for (const a of all) { if (a.username) byRef.set(String(a.username).toLowerCase(), a); if (a.code) byRef.set(String(a.code).toLowerCase(), a); } const byRef = new Map(); for (const a of all) { if (a.username) byRef.set(String(a.username).toLowerCase(), a); if (a.code) byRef.set(String(a.code).toLowerCase(), a); }
const T = R.tank && R.tank(); let tankMap = null; if (T) { try { tankMap = await T.summaryMap(); } catch (e) { tankMap = null; } } const T = R.tank && R.tank(); let tankMap = null; if (T) { try { tankMap = await T.summaryMap(); } catch (e) { tankMap = null; } }
const rows = []; for (const a of all) { if (!a.email || muted.has(a.email) || hubShell(a)) continue; const r = await rowFor(a, byRef, tankMap || (T ? new Map() : null)); if (force || st.hashes[r.email] !== hashOf(r)) rows.push(r); } const rows = []; for (const a of all) { if (!a.email || muted.has(a.email)) continue; const r = await rowFor(a, byRef, tankMap || (T ? new Map() : null)); if (force || st.hashes[r.email] !== hashOf(r)) rows.push(r); }
const sent = rows.length ? await push(rows) : 0; const sent = rows.length ? await push(rows) : 0;
return { accounts: all.length, changed: rows.length, sent }; return { accounts: all.length, changed: rows.length, sent };
} catch (e) { load().errors++; save(); console.error('lssync tick', e.message); return { error: e.message }; } } catch (e) { load().errors++; save(); console.error('lssync tick', e.message); return { error: e.message }; }
@@ -117,7 +104,5 @@ async function release(email, sent) {
if (pending.has(e) && !timer) { pending.delete(e); touch(e); } // a touch that queued while muted goes now (the hash check drops it when same) if (pending.has(e) && !timer) { pending.delete(e); touch(e); } // a touch that queued while muted goes now (the hash check drops it when same)
return same; return same;
} }
// does LinkSpin know this email? (its row was pushed and recorded) - used by the link-farm admin list, never for a cascade
function knows(email) { const st = load(); return Object.prototype.hasOwnProperty.call(st.hashes || {}, String(email || '').toLowerCase()); }
function adminView() { const st = load(); return { on: on(), url: URL_(), tracked: Object.keys(st.hashes).length, pushed: st.pushed, last: st.last, errors: st.errors, pendingTouches: pending.size }; } function adminView() { const st = load(); return { on: on(), url: URL_(), tracked: Object.keys(st.hashes).length, pushed: st.pushed, last: st.last, errors: st.errors, pendingTouches: pending.size }; }
module.exports = { _state: load, _save: save, _forget: e => { pending.delete(String(e || '').toLowerCase()); muted.delete(String(e || '').toLowerCase()); }, init, touch, tick, adminView, on, mute, release, knows }; module.exports = { init, touch, tick, adminView, on, mute, release };
+3 -15
View File
@@ -1,4 +1,4 @@
// Outbound mail via SendGrid v3 (domain-authenticated instantadpay.com; links in bodies go out on the share domain, see mailLinks). // Outbound mail via SendGrid v3 (domain-authenticated instantadpay.com).
// Key sources: SENDGRID_KEY env, else DATA_DIR/sendgrid.key in the volume. // Key sources: SENDGRID_KEY env, else DATA_DIR/sendgrid.key in the volume.
// No key = email sign-in stays feature-flagged off in production. // No key = email sign-in stays feature-flagged off in production.
const fs = require('fs'); const fs = require('fs');
@@ -19,17 +19,6 @@ function hasKey() { return !!key(); }
// codes and mail to the admin is skipped for anyone who unsubscribed, carries // codes and mail to the admin is skipped for anyone who unsubscribed, carries
// the signed unsubscribe link (appended unless the body already has one) and // the signed unsubscribe link (appended unless the body already has one) and
// RFC 8058 one-click List-Unsubscribe headers. New senders inherit this. // RFC 8058 one-click List-Unsubscribe headers. New senders inherit this.
// Links in mail go on the share domain (2026-11-17, Spamhaus DBL): instantadpay.com is on the DBL, so every URL to it in a body
// (and the List-Unsubscribe header) counts against each email. One rewrite here covers every sender; the share host passes
// /my, /ledger, /join/<tok>, ... through to the same page and answers /unsubscribe and /banners/* itself. The From address
// and any name@instantadpay.com in the text stay as they are. MAIL_BASE='' turns it off.
const MAIL_BASE = String(process.env.MAIL_BASE == null ? 'https://instantadpay.link' : process.env.MAIL_BASE).trim().replace(/\/+$/, '');
const IAP_LINK_RE = /(?<![@\w.-])(?:https?:\/\/)?(?:www\.)?instantadpay\.com(?![\w-])/gi;
function mailLinks(s) {
if (!MAIL_BASE || s == null) return s;
const bare = MAIL_BASE.replace(/^https?:\/\//, '');
return String(s).replace(IAP_LINK_RE, m => /^https?:/i.test(m) ? MAIL_BASE : bare);
}
function isAdmin(to) { const a = String(process.env.ADMIN_EMAIL || '').trim().toLowerCase(); return !!a && String(to).trim().toLowerCase() === a; } function isAdmin(to) { const a = String(process.env.ADMIN_EMAIL || '').trim().toLowerCase(); return !!a && String(to).trim().toLowerCase() === a; }
async function send(to, subject, text, html, opts) { // html optional (2026-10-01): sent alongside the plain text, never instead of it async function send(to, subject, text, html, opts) { // html optional (2026-10-01): sent alongside the plain text, never instead of it
@@ -40,7 +29,6 @@ async function send(to, subject, text, html, opts) { // html optional (2026-10-0
try { if (await drip.isUnsubscribed(to)) return false; } catch (e) { console.error('mailer opt-out check', e.message); } try { if (await drip.isUnsubscribed(to)) return false; } catch (e) { console.error('mailer opt-out check', e.message); }
try { unsub = drip.unsubUrl(to); } catch (e) { console.error('mailer unsub link', e.message); } try { unsub = drip.unsubUrl(to); } catch (e) { console.error('mailer unsub link', e.message); }
} }
unsub = mailLinks(unsub); text = mailLinks(text); if (html) html = mailLinks(html); subject = mailLinks(subject);
if (unsub && !String(text).includes('/unsubscribe?')) text = text + '\n\n--\nStop these emails: ' + unsub; if (unsub && !String(text).includes('/unsubscribe?')) text = text + '\n\n--\nStop these emails: ' + unsub;
if (unsub && html && !String(html).includes('/unsubscribe?')) { if (unsub && html && !String(html).includes('/unsubscribe?')) {
const foot = '<p style="font-size:12px;color:#888;margin-top:24px">Stop these emails: <a href="' + unsub + '" style="color:#888">unsubscribe</a></p>'; const foot = '<p style="font-size:12px;color:#888;margin-top:24px">Stop these emails: <a href="' + unsub + '" style="color:#888">unsubscribe</a></p>';
@@ -51,7 +39,7 @@ async function send(to, subject, text, html, opts) { // html optional (2026-10-0
if (html) content.push({ type: 'text/html', value: html }); if (html) content.push({ type: 'text/html', value: html });
const msg = { const msg = {
personalizations: [{ to: [{ email: to }] }], personalizations: [{ to: [{ email: to }] }],
from: opts && opts.fromName ? { email: FROM.email, name: String(opts.fromName).slice(0, 60) } : FROM, // same authenticated address; another network site's name on mail sent for it (siteinvite.js code mail, 2026-11-21) from: FROM,
subject, subject,
content content
}; };
@@ -80,4 +68,4 @@ function sendCode(to, code) {
+ 'InstantAdPay\nAdvertise and earn instantly. Locked in code, not promises.\nhttps://instantadpay.com', null, { transactional: true }); + 'InstantAdPay\nAdvertise and earn instantly. Locked in code, not promises.\nhttps://instantadpay.com', null, { transactional: true });
} }
module.exports = { init, hasKey, send, sendCode, mailLinks }; module.exports = { init, hasKey, send, sendCode };
+3 -4
View File
@@ -40,8 +40,7 @@ const CATID_CRYPTO = Number(process.env.NAS_CATID || 5);
// how many NAS impressions one IAP credit buys, per format. IAP charges credits // how many NAS impressions one IAP credit buys, per format. IAP charges credits
// on its own surfaces at these same rates, so NAS delivery draws the same pool. // on its own surfaces at these same rates, so NAS delivery draws the same pool.
function impressionsPerCredit(type) { function impressionsPerCredit(type) {
// text 100 since 2026-11-20 (was 10, with a 1/10 network divisor on top): the on-site text price moved to 100 views per credit return type === 'banner' ? 5 : type === 'text' ? 10 : type === 'video' ? 0 : 0;
return type === 'banner' ? 5 : type === 'text' ? 100 : type === 'video' ? 0 : 0;
} }
function nasKind(type) { function nasKind(type) {
// pid encodes text(1)/banner(2); adtype is a separate small int — 1 is the // pid encodes text(1)/banner(2); adtype is a separate small int — 1 is the
@@ -77,7 +76,7 @@ async function pushCampaign(c, opts = {}) {
Name, Email, PaymentDetails, EDate, sp, width, height, BannerURL, pid, ref_by, catid) Name, Email, PaymentDetails, EDate, sp, width, height, BannerURL, pid, ref_by, catid)
VALUES (?,?,?,?,?,?,0,1,?,?,?,?,?,?,'',?,?,?,?,0,?)`, VALUES (?,?,?,?,?,?,0,1,?,?,?,?,?,?,'',?,?,?,?,0,?)`,
// clicks route through our redirect so they count and carry the network site as the referrer // clicks route through our redirect so they count and carry the network site as the referrer
[token, c.title || null, c.type === 'text' ? (c.body || null) : null, (process.env.NAS_CLICK_BASE || 'https://instantadpay.link') + '/api/ads/click/' + c.id, [token, c.title || null, c.type === 'text' ? (c.body || null) : null, 'https://instantadpay.com/api/ads/click/' + c.id,
assigned, assigned, now, kind.adtype, assigned, assigned, now, kind.adtype,
opts.name || 'InstantAdPay member', opts.email || 'ads@instantadpay.com', opts.name || 'InstantAdPay member', opts.email || 'ads@instantadpay.com',
'InstantAdPay campaign #' + c.id, edate, 'InstantAdPay campaign #' + c.id, edate,
@@ -123,7 +122,7 @@ async function deactivate(nasAdId) {
// point an existing NAS ad at our click redirect (migration for rows pushed before 2026-09-10) // point an existing NAS ad at our click redirect (migration for rows pushed before 2026-09-10)
async function setClickUrl(nasAdId, campaignId) { async function setClickUrl(nasAdId, campaignId) {
if (!enabled()) return { skipped: 'flag-off' }; if (!enabled()) return { skipped: 'flag-off' };
await q('UPDATE sponsorads SET WebsiteURL=? WHERE ID=?', [(process.env.NAS_CLICK_BASE || 'https://instantadpay.link') + '/api/ads/click/' + Number(campaignId), Number(nasAdId)]); await q('UPDATE sponsorads SET WebsiteURL=? WHERE ID=?', ['https://instantadpay.com/api/ads/click/' + Number(campaignId), Number(nasAdId)]);
return { ok: true }; return { ok: true };
} }
async function topUp(nasAdId, addImpressions, days) { async function topUp(nasAdId, addImpressions, days) {
-55
View File
@@ -1,55 +0,0 @@
// Network deals for this site's "Network Weekend" ribbon (Marty 2026-11-17). One source: the hub's public GET /v1/network-deals
// (HUB_URL). Cached 2 minutes, refreshed in the background, never waits on a slow hub (2.5 s timeout); hub down = no ribbon.
// The same file lives in every network site. Never RM Circle, never the games (the hub list never names them).
// The page (/assets/netweekend.js) switches the ribbon on and off by its own clock at startsAt / endsAt, so a cached copy never
// shows early or late. setLocal(fn) lets a site rewrite its own deal line from live data (for example a price read from chain),
// so the ribbon never shows a number the contract does not charge: fn(deal) returns the deal, a changed copy, or null to drop it.
const TTL = 2 * 60 * 1000;
let cache = { at: 0, body: { events: [] } };
let inflight = null;
let local = null;
const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, '');
const safeUrl = u => (/^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(u || '')) ? String(u) : '');
const str = (v, n) => String(v == null ? '' : v).slice(0, n || 300);
function clean(j) {
if (!j || !Array.isArray(j.events)) return null;
return { events: j.events.slice(0, 5).filter(e => e && e.id && !Number.isNaN(Date.parse(e.startsAt)) && !Number.isNaN(Date.parse(e.endsAt))).map(e => ({
id: str(e.id, 60), name: str(e.name, 60), tagline: str(e.tagline, 160), url: safeUrl(e.url), startsAt: e.startsAt, endsAt: e.endsAt,
days: e.days && typeof e.days === 'object' ? Object.fromEntries(Object.entries(e.days).slice(0, 20).map(([k, v]) => [str(k, 10), str(v, 40)])) : {},
deals: (Array.isArray(e.deals) ? e.deals : []).slice(0, 40).map(d => {
const x = { site: str(d.site, 30), name: str(d.name, 80), url: safeUrl(d.url), text: str(d.text), endsAt: Number.isNaN(Date.parse(d.endsAt)) ? e.endsAt : d.endsAt };
if (d.note) x.note = str(d.note, 120);
if (d.byDay && typeof d.byDay === 'object') x.byDay = Object.fromEntries(Object.entries(d.byDay).slice(0, 20).map(([k, v]) => [str(k, 10), str(v)]));
return x;
})
})) };
}
function refresh() {
if (inflight || process.env.NETWORK_DEALS_HUB === '0') return inflight;
const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500);
inflight = fetch(hubUrl() + '/v1/network-deals', { signal: ac.signal })
.then(r => (r.ok ? r.json() : null))
.then(j => { const b = clean(j); if (b) cache = { at: Date.now(), body: b }; else cache.at = Date.now(); })
.catch(() => { cache.at = Date.now() - TTL + 30 * 1000; }) // hub down: try again in 30 s, keep the last good copy
.finally(() => { clearTimeout(t); inflight = null; });
return inflight;
}
function current() { if (Date.now() - cache.at > TTL) refresh(); return cache.body; }
function setLocal(fn) { local = typeof fn === 'function' ? fn : null; }
function withLocal(body, self) {
if (!local) return body;
return { events: body.events.map(e => Object.assign({}, e, { deals: e.deals.map(d => {
if (d.site !== self) return d;
try { const r = local(Object.assign({}, d)); return r === undefined ? d : r; } catch (err) { return d; }
}).filter(Boolean) })) };
}
// GET /api/network-deals: public, short cache, the same answer on every page. self = this site's network id (NETWORK_SITE_ID).
async function handle(req, res, self) {
if (!cache.at) { try { await refresh(); } catch (e) {} } // first ask after a boot waits for the hub once (2.5 s cap)
const me = String(self || process.env.NETWORK_SITE_ID || '').trim().toLowerCase();
const body = Object.assign({ self: me }, withLocal(current(), me));
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=60', 'X-Content-Type-Options': 'nosniff' });
res.end(JSON.stringify(body));
}
module.exports = { current, handle, refresh, setLocal, clean, _set: b => { cache = { at: Date.now(), body: clean(b) || { events: [] } }; } };
-204
View File
@@ -1,204 +0,0 @@
// Shared network knowledge, site side (Marty 2026-11-15: every network site's chatbot answers about the whole network, with its
// own site first). This site publishes its own knowledge-base entries to the network hub and reads the merged set back:
// PUT HUB_URL/v1/kb {name, url, entries} replaces this site's set (the hub skips a set it already holds)
// GET HUB_URL/v1/kb signed over an empty body, If-None-Match: the last version -> 304 when nothing changed
// Signed as HUB_SITE with HUB_SECRET (X-Hub-Site, X-Hub-Ts, X-Hub-Sig = hex HMAC-SHA256(ts + "\n" + raw body)), like hubreport.js.
// The merged set is kept in memory and in DATA_DIR/netkb-cache.json (a MySQL document through docstore where the site has
// DOCSTORE_URL; written only when the version changes), so a hub outage at boot still answers about the other sites.
// Off when HUB_URL or a 32+ character HUB_SECRET is missing, or NETKB=0: the chatbot then answers about this site only.
//
// SEMANTIC MATCHING (Marty 2026-11-16): the hub matches a question by meaning against the whole network KB with the free core2
// embeddings model (POST HUB_URL/v1/kb/match). match() asks it with a strict timeout (NETKB_MATCH_MS, default 1500) and fails
// soft: an error or a timeout answers null and the next MATCH_PAUSE_MS skip the hub, so the chat never waits on a slow model and
// the site's own BM25 retrieval (kb.js) answers as before. route() turns a match into the chatbot's decision:
// - this site's own entry, raw score >= SEM.answer with a clear lead (or the instant-answer pattern agrees): the answer itself
// - the instant-answer pattern hit kept when the match agrees (its entry within SEM.agree of the top), or when the match has
// no idea (top below SEM.unsure); this site's own entries rank first unless another site is named or clearly closer
// - otherwise no instant answer (the regex is overruled by meaning); the entries >= SEM.context feed the AI prompt
// suggest() gives the support desk's new-ticket form the closest help answers (KB entries only) the same way, BM25 as the fallback.
// Off with NETKB_MATCH=0. Thresholds measured on bge-large-en-v1.5 over the network KB (2026-11-16). Tests: qa/netkb-semantic.test.mjs
// The SAME file ships in every network site (InstantAdPay, LinkSpin, ViralAdBlitz, DownlineHydra, 5xYourTeam, VBB, Downline
// Banners, Stack POL). Keep them identical.
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const REFRESH_MS = 10 * 60 * 1000;
let O = null; // { dataDir, site, name, url, netId, entries: async () => [...], linkFor: (url) => link }
let merged = { version: '', sites: {}, entries: [] }, loadedAt = 0, publishedHash = '', pubTimer = null, timer = null;
const stats = { published: 0, publishErrors: 0, reads: 0, notModified: 0, readErrors: 0, lastError: null, lastPublishAt: 0, lastReadAt: 0 };
const hubUrl = () => String(process.env.HUB_URL || '').trim().replace(/\/+$/, '');
const secret = () => String(process.env.HUB_SECRET || '').trim();
const siteName = () => String(process.env.HUB_SITE || (O && O.site) || '').trim();
const enabled = () => process.env.NETKB !== '0' && !!hubUrl() && secret().length >= 32 && !!siteName();
const cacheFile = () => (O && O.dataDir ? path.join(O.dataDir, 'netkb-cache.json') : null);
async function call(method, route, body, headers, timeoutMs) {
const raw = body === undefined ? '' : JSON.stringify(body); const ts = String(Date.now());
const sig = crypto.createHmac('sha256', secret()).update(ts + '\n' + raw).digest('hex');
const r = await fetch(hubUrl() + route, { method, body: method === 'GET' ? undefined : raw, signal: AbortSignal.timeout(timeoutMs || 15000),
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Hub-Site': siteName(), 'X-Hub-Ts': ts, 'X-Hub-Sig': sig }, headers || {}) });
let j = null; if (r.status !== 304) { try { j = await r.json(); } catch (e) {} }
return { status: r.status, body: j };
}
// the entries this site shares: what the chatbot's knowledge base holds, minus the instant-answer patterns (those stay home)
const shape = e => ({ id: String(e.id), title: e.title, questions: (e.questions || []).slice(0, 15), answer: e.answer, tags: (e.tags || []).slice(0, 15), link: e.link || (O && O.url) || undefined });
async function publish() {
if (!enabled() || !O || typeof O.entries !== 'function') return { skipped: true };
const entries = (await O.entries()).filter(e => e && e.id && e.answer && !e.deleted).map(shape);
const body = { name: O.name, url: O.url, entries };
const h = crypto.createHash('sha1').update(JSON.stringify(body)).digest('hex');
if (h === publishedHash) return { same: true };
try {
const r = await call('PUT', '/v1/kb', body);
if (r.status !== 200) { stats.publishErrors++; stats.lastError = 'publish ' + r.status + ' ' + ((r.body && r.body.error) || ''); return { error: stats.lastError }; }
publishedHash = h; stats.published++; stats.lastPublishAt = Date.now();
return r.body;
} catch (e) { stats.publishErrors++; stats.lastError = 'publish ' + e.message; return { error: e.message }; }
}
// an admin edit: publish a few seconds later (several quick edits go as one)
function publishSoon() { if (pubTimer) return; pubTimer = setTimeout(() => { pubTimer = null; publish().catch(() => {}); }, 5000); if (pubTimer.unref) pubTimer.unref(); }
function readCache() {
const f = cacheFile(); if (!f) return;
try { const d = JSON.parse(fs.readFileSync(f, 'utf8')); if (d && Array.isArray(d.entries)) { merged = d; loadedAt = 0; } } catch (e) {}
}
function writeCache() {
const f = cacheFile(); if (!f) return;
try { fs.writeFileSync(f + '.tmp', JSON.stringify(merged)); fs.renameSync(f + '.tmp', f); } catch (e) { console.error('netkb cache', e.message); }
}
async function refresh() {
if (!enabled()) return { skipped: true };
try {
const r = await call('GET', '/v1/kb', undefined, merged.version ? { 'If-None-Match': '"' + merged.version + '"' } : {});
stats.lastReadAt = Date.now();
if (r.status === 304) { stats.notModified++; loadedAt = Date.now(); return { same: true }; }
if (r.status !== 200 || !r.body || !Array.isArray(r.body.entries)) { stats.readErrors++; stats.lastError = 'read ' + r.status; return { error: stats.lastError }; }
merged = { version: String(r.body.version || ''), sites: r.body.sites || {}, entries: r.body.entries }; loadedAt = Date.now(); stats.reads++;
writeCache();
return { version: merged.version, count: merged.entries.length };
} catch (e) { stats.readErrors++; stats.lastError = 'read ' + e.message; return { error: e.message }; }
}
// other sites' entries, ready for the chatbot's index: id "<site>:<id>", plus where they come from and the link to send people to
function remote() {
const me = siteName(); const out = [];
for (const e of merged.entries || []) {
if (!e || e.site === me) continue;
const s = (merged.sites || {})[e.site] || {};
const url = s.url || e.link || '';
out.push({ id: e.site + ':' + e.id, title: e.title, questions: e.questions || [], answer: e.answer, tags: e.tags || [],
site: e.site, siteName: s.name || e.site, siteUrl: url, go: (O && typeof O.linkFor === 'function' && url ? O.linkFor(url) : '') || url });
}
return out;
}
// the network's sites as the hub knows them (name, link), this one left out
function sites() {
const me = siteName();
return Object.entries(merged.sites || {}).filter(([k]) => k !== me).map(([k, s]) => ({ site: k, name: s.name || k, url: s.url || '', go: (O && typeof O.linkFor === 'function' && s.url ? O.linkFor(s.url) : '') || s.url || '', count: s.count || 0 }));
}
// ---- semantic matching (2026-11-16)
const SEM = { answer: Number(process.env.NETKB_SEM_ANSWER) || 0.84, margin: 0.02, context: Number(process.env.NETKB_SEM_CONTEXT) || 0.68, unsure: 0.70, band: 0.08, away: 0.06, agree: 0.10, floor: 0.60 };
const MATCH_PAUSE_MS = 30000;
let matchDownUntil = 0;
const mstats = { matches: 0, matchErrors: 0, matchSkipped: 0, matchLastMs: 0, matchLastError: null, semAnswer: 0, semAgree: 0, semRegex: 0, semVeto: 0, semContext: 0 };
const matchOn = () => enabled() && process.env.NETKB_MATCH !== '0';
// -> the hub's answer {confidence, margin, hits: [{site, id, title, answer, score, boosted, home}]} or null (off, down, slow)
async function match(q, o) {
o = o || {};
if (!matchOn()) return null;
if (Date.now() < matchDownUntil) { mstats.matchSkipped++; return null; }
const t0 = Date.now();
try {
const body = { q: String(q || '').slice(0, 600), k: o.k || 6 };
if (o.prefer && o.prefer.length) body.prefer = o.prefer;
if (o.only && o.only.length) body.only = o.only;
const r = await call('POST', '/v1/kb/match', body, undefined, o.timeoutMs || Number(process.env.NETKB_MATCH_MS) || 1500);
mstats.matchLastMs = Date.now() - t0;
if (r.status !== 200 || !r.body || !Array.isArray(r.body.hits)) throw new Error('match ' + r.status + ' ' + ((r.body && r.body.error) || ''));
mstats.matches++;
return r.body;
} catch (e) { mstats.matchErrors++; mstats.matchLastError = e.message; matchDownUntil = Date.now() + MATCH_PAUSE_MS; return null; }
}
// msg + { fast: the instant-answer pattern hit (or null), own: this site's entries, prefer: [site ids the question names] }
// -> null (no match: the caller keeps its old path) or { via, hit: own entry to answer with | null, hits: [{entry, score}] for the prompt }
async function route(msg, o) {
o = o || {};
// a question that names another site but asks about "here" is about this site (e.g. "I am on InstantAdPay, does my team carry over here?")
const prefer = (o.prefer || []).length && !/\b(here|this site|this one)\b/i.test(msg) ? o.prefer : [];
const m = await match(msg, { k: 8, prefer });
if (!m) return null;
const me = siteName();
const own = new Map((o.own || []).map(e => [String(e.id), e]));
const rem = new Map(remote().map(e => [e.id, e]));
const all = m.hits.map(h => ({ entry: h.site === me ? own.get(String(h.id)) : rem.get(h.site + ':' + h.id), score: Number(h.score) || 0, home: h.site === me })).filter(h => h.entry);
let hits = all;
const named = prefer.length > 0, fast = o.fast || null;
if (!named) { // home-site first: this site's own entries lead; another site's ride behind them only when clearly closer (a thing only that site has)
const mine = hits.filter(h => h.home && h.score >= SEM.context);
const homeTop = mine.length ? mine[0].score : 0;
hits = mine.concat(hits.filter(h => !h.home && h.score >= homeTop + SEM.away));
}
const top = hits[0];
const ctx = top ? hits.filter(h => h.score >= SEM.context && (h.score >= top.score - SEM.band || !h.home)).map(h => ({ entry: h.entry, score: Math.round(h.score * 1000) / 1000 })) : [];
const out = (via, hit) => { mstats['sem' + via[0].toUpperCase() + via.slice(1)]++; return { via, hit, hits: ctx, confidence: top ? top.score : 0 }; };
if (top && top.home && !named && top.score >= SEM.answer && (Number(m.margin) >= SEM.margin || (fast && String(fast.id) === String(top.entry.id)))) return out('answer', top.entry);
if (fast) {
const best = all.length ? all[0].score : 0;
if (all.some(h => h.home && String(h.entry.id) === String(fast.id) && h.score >= SEM.floor && h.score >= best - SEM.agree)) return out('agree', fast);
if (!top || top.score < SEM.unsure) return out('regex', fast);
return out('veto', null);
}
return out('context', null);
}
// support desk suggestions (2026-11-16): the help answers closest to what a signed-in member is typing into a new ticket.
// Knowledge-base entries only (published answers, including the ones written from past tickets), never anyone's ticket text.
// text + { own: this site's entries, fallback: async q => [{entry}] (BM25) when the hub is slow or down, max }
const SUGGEST_MIN = Number(process.env.NETKB_SUGGEST_MIN) || 0.70;
const NOT_SUGGESTED = /(^|[-:])support$|^c-refund$/; // the "contact support" entry is no help on the support form itself
function suggestItem(e, home, score) {
return { id: String(e.id), title: e.title, answer: String(e.answer || '').slice(0, 900), site: home ? '' : (e.siteName || e.site || ''),
link: home ? (e.link || '') : (e.go || e.siteUrl || ''), fromTicket: !!(home && e.source === 'ticket'), score: score == null ? null : Math.round(score * 1000) / 1000 };
}
async function suggest(text, o) {
o = o || {};
const q = String(text || '').replace(/\s+/g, ' ').trim().slice(0, 600);
if (q.replace(/[^A-Za-z0-9]/g, '').length < 10) return { items: [], via: 'short' };
const me = siteName(); const own = new Map((o.own || []).map(e => [String(e.id), e]));
const keep = (e, home) => e && !(home && e.handoff) && !NOT_SUGGESTED.test(String(e.id));
let items = [], via = 'none';
const m = await match(q, { k: 8, timeoutMs: o.timeoutMs || 2000 });
if (m) {
via = 'semantic'; const top = m.hits.length ? Number(m.hits[0].score) : 0; const rem = new Map(remote().map(e => [e.id, e]));
for (const h of m.hits) {
if (h.score < SUGGEST_MIN || h.score < top - 0.08) continue;
const home = h.site === me; const e = home ? own.get(String(h.id)) : rem.get(h.site + ':' + h.id);
if (keep(e, home)) items.push(suggestItem(e, home, h.score));
}
} else if (typeof o.fallback === 'function') {
via = 'bm25';
try { for (const x of (await o.fallback(q)) || []) { const e = x && x.entry; const home = !!e && !e.site; if (keep(e, home)) items.push(suggestItem(e, home, null)); } } catch (e) {}
}
return { items: items.slice(0, o.max || 3), via };
}
// opts: { dataDir, site (hub site id), name, url, entries: async () => [...], linkFor: url => tracked link }
function init(opts) {
O = opts || {}; readCache();
if (!enabled()) return;
const first = setTimeout(async () => { await publish().catch(() => {}); await refresh().catch(() => {}); }, Math.max(0, Number(process.env.NETKB_FIRST_MS) || 8000));
if (first.unref) first.unref();
timer = setInterval(async () => { await refresh().catch(() => {}); if (!publishedHash) await publish().catch(() => {}); }, Math.max(1000, Number(process.env.NETKB_REFRESH_MS) || REFRESH_MS));
if (timer.unref) timer.unref();
}
function view() { return Object.assign({ enabled: enabled(), site: siteName(), version: merged.version, sites: Object.keys(merged.sites || {}), entries: (merged.entries || []).length, remote: remote().length, loadedAt, semantic: matchOn(), sem: SEM }, stats, mstats); }
function _set(m) { merged = m; } // tests
const version = () => merged.version || '';
function _matchReset() { matchDownUntil = 0; } // tests
module.exports = { init, publish, publishSoon, refresh, remote, sites, view, enabled, version, match, route, suggest, SEM, _set, _matchReset };
-60
View File
@@ -1,60 +0,0 @@
// The network sites list for the footer's "Part of the network" line (Marty 2026-11-14 trust pack).
// One source: the hub's public GET /v1/network-sites (HUB_URL). Cached 10 minutes, refreshed in the background, never waits on a
// slow hub (2.5 s timeout), and falls back to the same built-in list. Never RM Circle, never the games.
// The same file lives in every network site (InstantAdPay, LinkSpin, Downline Banners, VBB, Stack POL).
const FALLBACK = [
{ id: 'iap', name: 'InstantAdPay', url: 'https://instantadpay.com' },
{ id: 'linkspin', name: 'LinkSpin', url: 'https://linkspin.app' },
{ id: 'dlb', name: 'Downline Banners', url: 'https://downlinebanners.com' },
{ id: 'vbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com' },
{ id: 'stackpol', name: 'Stack POL', url: 'https://stackpol.com' },
{ id: 'earnerscorner', name: 'Earners Corner', url: 'https://earnerscorner.com' }
];
const TTL = 10 * 60 * 1000;
let cache = { at: 0, list: FALLBACK, from: 'fallback' };
let inflight = null;
const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, '');
function clean(list) {
if (!Array.isArray(list)) return null;
const ok = list.filter(s => s && typeof s.name === 'string' && /^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(s.url || '')))
.slice(0, 30).map(s => ({ id: String(s.id || s.name).toLowerCase().replace(/[^a-z0-9]+/g, '').slice(0, 30), name: String(s.name).slice(0, 60), url: String(s.url).replace(/\/+$/, '') }));
return ok.length ? ok : null;
}
function refresh() {
if (inflight || process.env.NETWORK_SITES_HUB === '0') return inflight;
const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500);
inflight = fetch(hubUrl() + '/v1/network-sites', { signal: ac.signal })
.then(r => (r.ok ? r.json() : null))
.then(j => { const l = clean(j); if (l) cache = { at: Date.now(), list: l, from: 'hub' }; else cache.at = Date.now(); })
.catch(() => { cache.at = Date.now() - TTL + 60 * 1000; }) // hub down: try again in a minute, keep the last good list
.finally(() => { clearTimeout(t); inflight = null; });
return inflight;
}
function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list; }
// Tracked links (Marty 2026-11-14: "make sure each of these sites is its own traffic source and link spun so we can track it"): each
// entry also gets go = the LinkSpin network link for that site with ?src=<this site>, so a click shows in LinkSpin Reports under the
// site that sent it (LinkSpin netlinks.js: fixed codes on the admin account). This site = NETWORK_SITE_ID, else the request host.
// No go for this site itself, or when this site cannot be told (a test host): the page then uses the plain url.
const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', viraladsource: 'nwvas', yourprogrambuilder: 'nwypb', fivex: 'nw5x', downlinehydra: 'nwdh', stackpol: 'nwsp', earnerscorner: 'nwec' };
const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, '');
const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
function selfId(req, l) {
const env = String(process.env.NETWORK_SITE_ID || '').trim().toLowerCase(); if (env) return env;
const h = String((req && req.headers && (req.headers['x-forwarded-host'] || req.headers.host)) || '').split(',')[0].trim().toLowerCase().replace(/:\d+$/, '').replace(/^www\./, '');
const m = h && (l || list()).find(s => hostOf(s.url) === h); return m ? m.id : '';
}
// the LinkSpin-tracked link to site `id` sent from site `from` (from = id: the site's own promo kit); extra = { s1: member username, s2: one path segment }
function tracked(id, from, extra) {
const code = CODES[id]; if (!code || !from) return '';
const q = new URLSearchParams({ src: from }); for (const [k, v] of Object.entries(extra || {})) if (v) q.set(k, String(v));
return linksBase() + '/r/' + code + '?' + q.toString();
}
function withGo(l, me) { return l.map(s => { const go = me && s.id !== me ? tracked(s.id, me) : ''; return go ? Object.assign({}, s, { go }) : s; }); }
// GET /api/network-sites: public, cacheable, the same answer on every page
function handle(req, res) {
const l = list();
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=300', 'X-Content-Type-Options': 'nosniff' });
res.end(JSON.stringify(withGo(l, selfId(req, l))));
}
module.exports = { list, handle, refresh, tracked, selfId, withGo, CODES, FALLBACK, _state: () => cache };
-452
View File
@@ -1,452 +0,0 @@
// Network sign-in between InstantAdPay and LinkSpin (Marty approved 2026-11-12). The SAME file ships in both repos; each
// server calls init({ self, peer, peerBase, ... hooks }) and hands every request to handle() before its own routes.
//
// One flow, used two ways. R = the site the member is going TO (receiver), P = the site they are signed in on (provider).
// 1. R GET /sso/start?mode=go|check&to=/path R makes a random state, keeps it in a 5-minute HttpOnly cookie (nsso.st),
// sets the loop guard (nsso.tried, 2 minutes) and sends the browser to P.
// 2. P GET /sso/check?st=<state>&to=/path P looks at its OWN member session (never the admin portal). Signed in:
// P mints a token bound to R, the state and the email, and sends the browser
// to R /sso/in?t=<token>. Not signed in: R /sso/in?none=1&to=/path.
// 3. R GET /sso/in?t=<token> R checks signature, audience, expiry (60 s), the state against its cookie
// (so nobody can push their own token into someone else's browser), and spends
// the nonce (a second use is refused). The email must already be a member
// here; then R makes an ordinary session and redirects to the relative path.
// Outbound links: P GET /go/<peer>?to=/path is the hop a signed-in member's cross-site link points at. Signed out (or the
// secret not set), it is a plain redirect to the other site, so it is always safe to link through.
// Silent check: R's sign-in page calls GET /api/sso/status; { check: true } means "bounce once through P". The guard cookie
// stops a second bounce for 2 minutes (30 until 2026-11-15, when it blocked Marty's silent sign-in on LinkSpin), signing out sets nsso.off (12 hours, cleared by the next deliberate cross-site link),
// bots and non-page fetches never bounce.
// Token: "v1.<base64url JSON>.<base64url HMAC-SHA256(NETWORK_SSO_SECRET, 'nsso.v1.' + JSON part)>", JSON = { iss, aud, email,
// st, to, iat, exp, n[, wallet, name] }. The token grants a plain member session and nothing else: no wallet action, payout or purchase rides on it.
//
// Wallet sites (Downline Banners, 2026-11-13, Marty: "sign in once and be logged into all these sites"). Downline Banners has no email
// accounts; its members are wallets. IAP and LinkSpin list it under `wallets: { bannerline: base }` and vouch one way: /go/bannerline
// and /sso/check?r=bannerline mint a token that also carries the member's wallet (the one they signed in with, else the main wallet
// their account linked by signature) and username. Downline Banners runs this file with `from: { iap, linkspin }`, accepts a token from
// either, and makes a session for that wallet. /sso/start?via=<site> picks which site to ask; old copies ignore the new parameters.
//
// THE HUB AS THE PROVIDER (Marty approved 2026-11-15; off unless HUB_SSO=on, with HUB_URL, HUB_SECRET (32+) and HUB_SITE or C.hubSite).
// The network hub keeps one network sign-in per browser in its own cookie (7 days, renewed on use). With it on:
// /sso/start asks the hub (GET <hub>/sso/check?site=<HUB_SITE>&st&to&m) instead of one other site; the hub answers
// /sso/in?h=<token> ("h1." token, HMAC-SHA256 with this site's HUB_SECRET under 'hubsso.v1.', iss 'hub', aud = this site,
// 60 s, single use, bound to the state cookie) or /sso/in?none=1&hub=1, and then the old pairwise path is tried once as the
// fallback (until every site is switched).
// Push: a signed-in member's page load (a real top-level navigation only) with no matching nsso.hp cookie goes once through
// <hub>/sso/set?site&t=<this site's token for the member> and straight back, so signing in on any site signs in the hub.
// Only when the hub answered /health in the last 2 minutes: a hub that is down never takes a page with it.
// Activity (Marty 2026-11-15, DownlineHydra "Wake it", the CRM score): a signed-in member's page load pings POST <hub>/v1/activity
// {email|wallet, kind 'visit'} at most once per member per day, fire and forget (HUB_URL + HUB_SECRET; HUB_ACTIVITY=0 turns it off).
// signOutEverywhere(session): POST <hub>/v1/sso/signout; the hub ends every hub sign-in of that person and tells hooked sites.
//
// ONE SITES LIST + THE WAY BACK (Marty 2026-11-17: "I logged in to Instant Ad Pay from Viral Ad Source, and it never had a return
// path back"). Before, each provider (IAP, LinkSpin) kept its own hand-written `wallets` list; a site missing from it (5xYourTeam
// 11-15, ViralAdSource 11-17) was refused at /sso/check and the member was dropped on the provider's dashboard with no way back.
// Sites list: a provider also knows every site in the hub's public GET <hub>/v1/sso-sites (HUB_SSO_SITES there; the same list the
// hub signs in for). Read at start, every 5 minutes, and once more (2 s at most) when an unknown site asks. Hand-written entries win.
// Return links: any provider page with ?return=<site>&to=/path (a known site only, never an open redirect) remembers the way back
// in nsso.ret (1 day) and reloads without the two parameters. Signed in already: straight back. After the email-code sign-in (and
// after the username step for a new account) the provider's dashboard goes to /sso/resume, which finishes it: /go/<site>?to=/path.
// No wallet yet (a wallet site needs one): with C.walletPath the member goes to the provider's wallet step first (nsso.wait), and
// afterWallet(req) gives the wallet-link answer its next hop, /sso/resume. The same holds for a deliberate tap (nsso.back).
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const SECRET = () => String(process.env.NETWORK_SSO_SECRET || '').trim();
const enabled = () => SECRET().length >= 32;
const TTL = 60 * 1000; // token life
const SKEW = 30 * 1000; // clock skew allowed between the two servers
const STATE_AGE = 300; // seconds: the state cookie
const GO_STATE_AGE = 3600; // seconds: the state cookie on a deliberate tap (time to sign in, pick a username and link a wallet on the provider first; 20 minutes until 2026-11-17)
const BACK_AGE = 3600; // seconds: the provider remembers an unfinished deliberate check while the member signs in (20 minutes until 2026-11-17)
const RET_AGE = 86400; // seconds: a ?return=<site> link remembers the way back (2026-11-17)
const TRIED_AGE = 120; // seconds: one silent check per browser per 2 minutes (loop guard only; 30 minutes until 2026-11-15)
const OFF_AGE = 12 * 3600; // seconds: no silent check after a sign-out on this site
const HINT_AGE = 300; // seconds: the email prefill when the member is not here yet
const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz', viraladblitz: 'ViralAdBlitz', downlinehydra: 'DownlineHydra', fivex: '5xYourTeam' }; // vbb = Viral Banner Blitz, a wallet site like Downline Banners (2026-11-14); viraladblitz = ViralAdBlitz, a wallet site like VBB (2026-11-15); downlinehydra = DownlineHydra (2026-11-15); fivex = 5xYourTeam (2026-11-15)
const WALLET_RE = /^0x[0-9a-f]{40}$/;
const PUSH_AGE = 6 * 86400; // seconds: this browser's member is signed in on the hub (the hub's own sign-in lasts 7 days)
const HUB_BASE = () => String(process.env.HUB_URL || '').trim().replace(/\/+$/, '');
const HUB_KEY = () => String(process.env.HUB_SECRET || '').trim();
const HUB_NAME = () => String(process.env.HUB_SITE || (C && (C.hubSite || C.self)) || '').trim().toLowerCase();
const hubCreds = () => /^https?:\/\/[a-z0-9.:-]+$/i.test(HUB_BASE()) && HUB_KEY().length >= 32 && /^[a-z0-9_-]{1,64}$/.test(HUB_NAME());
const hubOn = () => String(process.env.HUB_SSO || '').trim().toLowerCase() === 'on' && hubCreds();
let hubSeen = 0, hubChecked = 0, hubAsking = null; // last good /health answer, last time we asked
// true when the hub answered /health in the last 2 minutes. Asked at most once a minute; while the answer is unknown (first use, or
// the last good answer is old) the caller waits for that one question (2 s at most), so a hub that is down costs one page 2 s a minute.
async function hubUp() {
const now = Date.now();
if (now - hubChecked >= 60000 && !hubAsking && typeof fetch === 'function') {
hubChecked = now;
const ac = typeof AbortController === 'function' ? new AbortController() : null; const tm = setTimeout(() => { if (ac) ac.abort(); }, 2000);
hubAsking = fetch(HUB_BASE() + '/health', { signal: ac ? ac.signal : undefined }).then(r => { if (r.ok) hubSeen = Date.now(); }).catch(() => {}).finally(() => { clearTimeout(tm); hubAsking = null; });
}
if (hubAsking && Date.now() - hubSeen >= 120000) await hubAsking;
return Date.now() - hubSeen < 120000;
}
// the hub's sign-in sites {site: base} (2026-11-17): providers answer every site the hub knows, not only their hand-written list
let hubSites = {}, hubSitesAt = 0, hubSitesAsking = null;
const SITE_RE = /^[a-z0-9_-]{1,64}$/, BASE_RE = /^https?:\/\/[a-z0-9.:-]+$/i;
function loadHubSites() {
if (hubSitesAsking) return hubSitesAsking;
if (!BASE_RE.test(HUB_BASE()) || typeof fetch !== 'function' || String(process.env.NSSO_HUB_SITES || '') === '0') return Promise.resolve();
hubSitesAt = Date.now();
const ac = typeof AbortController === 'function' ? new AbortController() : null; const tm = setTimeout(() => { if (ac) ac.abort(); }, 2000);
hubSitesAsking = fetch(HUB_BASE() + '/v1/sso-sites', { signal: ac ? ac.signal : undefined }).then(r => (r.ok ? r.json() : null)).then(j => {
if (!j || !j.sites || typeof j.sites !== 'object') return;
const out = {}; for (const [k, v] of Object.entries(j.sites)) { const b = String(v || '').replace(/\/+$/, ''); if (SITE_RE.test(k) && BASE_RE.test(b)) out[k] = b; }
hubSites = out;
}).catch(() => {}).finally(() => { clearTimeout(tm); hubSitesAsking = null; });
return hubSitesAsking;
}
const freshSites = () => { if (C && C.wallet && Date.now() - hubSitesAt > 5 * 60 * 1000) loadHubSites(); };
let C = null; // { self, peer, peerBase(), isProd, dataDir, db, member(req), accept(email, req, v), signIn(email, req, v), landing(to), signinPath(to), defaultPath,
// wallets?: { site: base() } + wallet(session) -> { address, name }, from?: { site: base() }, walletPath?: the provider's wallet step }
const b64u = buf => Buffer.from(buf).toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');
const unb64u = s => Buffer.from(String(s).replace(/-/g, '+').replace(/_/g, '/'), 'base64');
const mac = s => crypto.createHmac('sha256', SECRET()).update('nsso.v1.' + s).digest();
const mask = e => String(e || '').replace(/^(.).*(@.*)$/, '$1***$2');
const log = (what, email, extra) => console.log('network-sso', what, email ? mask(email) : '-', extra || '');
// a same-site relative path, or the default. No scheme, no host, no protocol-relative //x, no backslashes, no control characters.
function safePath(to, dflt) {
const d = dflt == null ? '/' : dflt;
const s = String(to == null ? '' : to);
if (!s || s.length > 600 || s[0] !== '/' || s[1] === '/' || s[1] === '\\' || /[\\\u0000-\u001f\u007f\s]/.test(s)) return d;
try { const x = new URL(s, 'http://x.invalid'); if (x.host !== 'x.invalid' || x.protocol !== 'http:') return d; return x.pathname + x.search + x.hash; } catch (e) { return d; }
}
function mint(o) {
const now = o.now || Date.now();
const t = { iss: o.iss, aud: o.aud, email: String(o.email || '').trim().toLowerCase(), st: o.st, to: safePath(o.to), iat: now, exp: now + TTL, n: crypto.randomBytes(16).toString('hex') };
if (o.wallet) t.wallet = String(o.wallet).toLowerCase();
if (o.name) t.name = String(o.name).slice(0, 40);
const body = b64u(JSON.stringify(t));
return 'v1.' + body + '.' + b64u(mac(body));
}
// -> { ok, email, to, n, exp } or { error: reason }
function verify(tok, o) {
if (!enabled()) return { error: 'off' };
const m = /^v1\.([A-Za-z0-9_-]{20,2000})\.([A-Za-z0-9_-]{43})$/.exec(String(tok || ''));
if (!m) return { error: 'malformed' };
const want = mac(m[1]), got = unb64u(m[2]);
if (want.length !== got.length || !crypto.timingSafeEqual(want, got)) return { error: 'signature' };
let p; try { p = JSON.parse(unb64u(m[1]).toString('utf8')); } catch (e) { return { error: 'malformed' }; }
const now = (o && o.now) || Date.now();
if (!p || p.aud !== o.aud || ![].concat(o.iss).includes(p.iss)) return { error: 'audience' };
if (!(Number(p.exp) > now) || Number(p.iat) > now + SKEW || Number(p.exp) - Number(p.iat) > TTL) return { error: 'expired' };
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(p.email || ''))) return { error: 'email' };
if (!/^[a-f0-9]{32}$/.test(String(p.n || ''))) return { error: 'malformed' };
const st = String((o && o.st) || '');
if (!/^[a-f0-9]{32}$/.test(st) || !/^[a-f0-9]{32}$/.test(String(p.st || '')) || !crypto.timingSafeEqual(Buffer.from(st), Buffer.from(p.st))) return { error: 'state' };
if (p.wallet != null && !WALLET_RE.test(String(p.wallet))) return { error: 'wallet' };
const name = p.name != null && /^[A-Za-z0-9_.-]{1,40}$/.test(String(p.name)) ? String(p.name) : null;
return { ok: true, iss: p.iss, email: String(p.email).toLowerCase(), wallet: p.wallet || null, name, to: safePath(p.to), n: p.n, exp: Number(p.exp) };
}
// hub tokens ("h1.", the hub's format): mint for the hub (push), verify from the hub (sign-in)
const hmacHub = x => crypto.createHmac('sha256', HUB_KEY()).update('hubsso.v1.' + x).digest();
function mintHub(o) {
const now = o.now || Date.now();
const t = { iss: HUB_NAME(), aud: 'hub', to: safePath(o.to), iat: now, exp: now + TTL, n: crypto.randomBytes(16).toString('hex') };
if (o.email) t.email = String(o.email).trim().toLowerCase(); else if (o.wallet) t.wallet = String(o.wallet).toLowerCase();
const body = b64u(JSON.stringify(t));
return 'h1.' + body + '.' + b64u(hmacHub(body));
}
function verifyHub(tok, o) {
if (!hubCreds()) return { error: 'off' };
const m = /^h1\.([A-Za-z0-9_-]{20,2000})\.([A-Za-z0-9_-]{43})$/.exec(String(tok || ''));
if (!m) return { error: 'malformed' };
const want = hmacHub(m[1]), got = unb64u(m[2]);
if (want.length !== got.length || !crypto.timingSafeEqual(want, got)) return { error: 'signature' };
let p; try { p = JSON.parse(unb64u(m[1]).toString('utf8')); } catch (e) { return { error: 'malformed' }; }
const now = (o && o.now) || Date.now();
if (!p || p.iss !== 'hub' || p.aud !== HUB_NAME()) return { error: 'audience' };
if (!(Number(p.exp) > now) || Number(p.iat) > now + SKEW || Number(p.exp) - Number(p.iat) > TTL) return { error: 'expired' };
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(p.email || ''))) return { error: 'email' };
if (!/^[a-f0-9]{32}$/.test(String(p.n || ''))) return { error: 'malformed' };
const st = String((o && o.st) || '');
if (!/^[a-f0-9]{32}$/.test(st) || !/^[a-f0-9]{32}$/.test(String(p.st || '')) || !crypto.timingSafeEqual(Buffer.from(st), Buffer.from(p.st))) return { error: 'state' };
if (p.wallet != null && !WALLET_RE.test(String(p.wallet))) return { error: 'wallet' };
const name = p.name != null && /^[A-Za-z0-9_.-]{1,40}$/.test(String(p.name)) ? String(p.name) : null;
return { ok: true, iss: 'hub', email: String(p.email).toLowerCase(), wallet: p.wallet || null, name, to: safePath(p.to), n: p.n, exp: Number(p.exp) };
}
// a signed /v1 call to the hub (the scheme every site already uses): hex HMAC-SHA256(HUB_SECRET, ts + newline + body)
async function hubCall(route, body, ms) {
const raw = JSON.stringify(body || {}); const ts = String(Date.now());
const ac = typeof AbortController === 'function' ? new AbortController() : null; const tm = setTimeout(() => { if (ac) ac.abort(); }, ms || 5000);
try {
const r = await fetch(HUB_BASE() + route, { method: 'POST', body: raw, signal: ac ? ac.signal : undefined, headers: { 'Content-Type': 'application/json', 'X-Hub-Site': HUB_NAME(), 'X-Hub-Ts': ts, 'X-Hub-Sig': crypto.createHmac('sha256', HUB_KEY()).update(ts + '\n' + raw).digest('hex') } });
let j = null; try { j = await r.json(); } catch (e) {}
return { status: r.status, json: j };
} finally { clearTimeout(tm); }
}
const who = s => (s && s.email ? { email: String(s.email).toLowerCase() } : s && s.address && WALLET_RE.test(String(s.address).toLowerCase()) ? { wallet: String(s.address).toLowerCase() } : null);
const pushTag = w => b64u(crypto.createHmac('sha256', HUB_KEY()).update('push.' + (w.email || w.wallet)).digest()).slice(0, 22);
// once per member per day (memory; a restart may ping once more, the hub counts a visit once per 10 minutes anyway)
const pinged = new Map(); let pingDay = '';
function activity(w) {
if (String(process.env.HUB_ACTIVITY || '') === '0' || !hubCreds() || typeof fetch !== 'function') return;
const day = new Date().toISOString().slice(0, 10); if (day !== pingDay) { pinged.clear(); pingDay = day; }
const k = w.email || w.wallet; if (pinged.has(k)) return; pinged.set(k, 1);
hubCall('/v1/activity', Object.assign({ kind: 'visit' }, w), 5000).then(r => { if (r.status >= 500) pinged.delete(k); }).catch(() => { pinged.delete(k); });
}
// a signed-in request the site already answers (2026-11-16, Marty: "LinkSpin never reports activity"): /api/me, the dashboard
// heartbeat (/api/my/ping) and the admin portal call this, so a Control Room tab kept open for days, a browser that sends no
// Sec-Fetch headers and a wallet-only session still count the day's visit. The page-load ping in page() only sees full navigations.
// s = {email} and/or {address}. Same once-a-day rule as page(). -> true when a ping was due or already sent today.
function seen(s) {
try {
if (!C || !hubCreds()) return false;
const w = who(s && s.email ? s : s && s.address ? { address: s.address } : null); if (!w) return false;
activity(w); return true;
} catch (e) { return false; }
}
// a real top-level page load of a page (never an API call, an asset, a fetch, a bot or one of our own hops)
function pageLoad(req, p) {
if (req.method !== 'GET' || isBot(req)) return false;
if (req.headers['sec-fetch-dest'] !== 'document' || (req.headers['sec-fetch-mode'] && req.headers['sec-fetch-mode'] !== 'navigate')) return false;
if (/^\/(sso|api|go|assets|art|img|fonts|uploads|admin)(\/|$)/.test(p)) return false;
return !/\.[a-z0-9]{1,5}$/i.test(p);
}
async function signOutEverywhere(s) {
const w = who(s); if (!w || !hubCreds()) return { ok: false, reason: !w ? 'signed out' : 'hub off' };
try { const r = await hubCall('/v1/sso/signout', w, 8000); return r.status === 200 ? Object.assign({ ok: true }, r.json || {}) : { ok: false, reason: 'hub ' + r.status }; }
catch (e) { return { ok: false, reason: 'hub unreachable' }; }
}
// single use: true the first time a nonce is spent. MySQL when the site runs on it (two app copies during a deploy share it),
// else memory + a small file in DATA_DIR (survives a restart inside the 60-second window).
const used = new Map(); let fileLoaded = false, tableReady = null;
const FILE = () => C && C.dataDir ? path.join(C.dataDir, 'network-sso-nonces.json') : null;
function prune(now) { for (const [k, exp] of used) if (exp < now) used.delete(k); }
function loadFile() {
if (fileLoaded) return; fileLoaded = true;
try { const o = JSON.parse(fs.readFileSync(FILE(), 'utf8')); for (const k of Object.keys(o)) used.set(k, Number(o[k])); } catch (e) {}
}
function saveFile() { const f = FILE(); if (!f) return; try { fs.writeFileSync(f + '.tmp', JSON.stringify(Object.fromEntries(used))); fs.renameSync(f + '.tmp', f); } catch (e) { console.error('network-sso nonce save', e.message); } }
async function spend(n, exp) {
const now = Date.now(); loadFile(); prune(now);
if (used.has(n)) return false;
used.set(n, Number(exp) + SKEW); saveFile();
const db = C && C.db;
if (db && db.enabled && db.enabled()) {
try {
if (!tableReady) tableReady = db.q('CREATE TABLE IF NOT EXISTS network_sso_nonces (n VARCHAR(40) PRIMARY KEY, exp BIGINT NOT NULL) ENGINE=InnoDB').catch(e => { tableReady = null; throw e; });
await tableReady;
await db.q('INSERT INTO network_sso_nonces (n, exp) VALUES (?, ?)', [n, Number(exp) + SKEW]);
if (Math.random() < 0.05) db.q('DELETE FROM network_sso_nonces WHERE exp < ?', [now]).catch(() => {});
} catch (e) { if (/duplicate/i.test(e.message || '') || e.code === 'ER_DUP_ENTRY') return false; console.error('network-sso nonce db', e.message); return false; } // fail closed
}
return true;
}
// crawlers, link previews and headless browsers never bounce
const BOT_RE = /bot|crawl|spider|slurp|preview|facebookexternalhit|embedly|quora link|whatsapp|telegram|discord|skype|curl|wget|python|httpclient|headless|lighthouse|pingdom|monitor|go-http|java\/|okhttp|axios|node-fetch|undici/i;
const isBot = req => { const ua = String(req.headers['user-agent'] || ''); return !ua || BOT_RE.test(ua); };
// only a real top-level page load may start a bounce (sec-fetch-dest is sent by every current browser)
const notPage = req => { const d = req.headers['sec-fetch-dest']; return !!d && d !== 'document'; };
function cookies(req) {
const out = {};
for (const p of String(req.headers.cookie || '').split(';')) { const i = p.indexOf('='); if (i > 0) { try { out[p.slice(0, i).trim()] = decodeURIComponent(p.slice(i + 1).trim()); } catch (e) {} } }
return out;
}
const ck = (k, v, age, httpOnly) => k + '=' + encodeURIComponent(v) + '; Path=/; SameSite=Lax; Max-Age=' + age + (httpOnly ? '; HttpOnly' : '') + (C && C.isProd ? '; Secure' : '');
const go = (res, loc, set) => { const h = { Location: loc, 'Cache-Control': 'no-store', 'Referrer-Policy': 'no-referrer', 'X-Robots-Tag': 'noindex' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(302, h); res.end(); return true; };
const sendJson = (res, obj, set) => { const h = { 'Content-Type': 'application/json', 'Cache-Control': 'no-store' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(200, h); res.end(JSON.stringify(obj)); return true; };
function init(opts) { C = Object.assign({ defaultPath: '/' }, opts); fileLoaded = false; used.clear(); if (hubOn()) { hubSeen = 0; hubChecked = 0; hubUp().catch(() => {}); } hubSites = {}; hubSitesAt = 0; if (C.wallet) loadHubSites(); }
// a site this provider answers for: its own list first, then the hub's (never itself, never the peer, which has its own path)
function siteBase(x) {
if (!C || !C.wallet || !SITE_RE.test(String(x || '')) || x === C.self || x === C.peer) return null;
if (C.wallets && Object.prototype.hasOwnProperty.call(C.wallets, x)) return C.wallets[x];
if (Object.prototype.hasOwnProperty.call(hubSites, x)) { const b = hubSites[x]; return () => b; }
return null;
}
// an unknown site asking: ask the hub once more (at most every 30 s, 2 s at most) before refusing
async function siteBaseFresh(x) { let b = siteBase(x); if (!b && C && C.wallet && SITE_RE.test(String(x || '')) && Date.now() - hubSitesAt > 30000) { await loadHubSites(); b = siteBase(x); } return b; }
const siteName = x => NAMES[x] || ({ viraladsource: 'ViralAdSource', webworthit: 'WebWorthIt', stackpol: 'Stack POL' })[x] || x;
const retOf = req => { const m = /^([a-z0-9_-]{1,64})\|(\/.*)$/.exec(cookies(req)['nsso.ret'] || ''); return m ? { site: m[1], to: safePath(m[2], '/') } : null; };
// signed in here, on the way back to a site: its wallet step first when the site needs a wallet this account does not have yet
async function backHop(s, site, to, set) {
let w = null; try { w = await C.wallet(s); } catch (e) {}
if ((!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) && C.walletPath) { set.push(ck('nsso.wait', '1', BACK_AGE, true)); log('back: wallet step first', s.email, 'for ' + siteName(site)); return C.walletPath; }
return '/go/' + site + '?to=' + encodeURIComponent(to);
}
// the cookie a sign-out adds: no silent check on this site for 12 hours (a deliberate cross-site link still signs in)
const offCookie = () => ck('nsso.off', '1', OFF_AGE, true);
// -> true when the request was one of ours and has been answered
async function handle(req, res, u) {
if (!C || req.method !== 'GET') return false;
const p = u.pathname;
if (C.wallet && u.searchParams.has('return') && !/^\/(sso|api|go)(\/|$)/.test(p)) { // a site's "sign in / join on <provider>" link: remember the way back (2026-11-17)
const site = String(u.searchParams.get('return') || '').toLowerCase(); const to = safePath(u.searchParams.get('to'), '/');
const clean = new URL(u.pathname + u.search, 'http://x.invalid'); clean.searchParams.delete('return'); clean.searchParams.delete('to');
const here = safePath(clean.pathname + clean.search, '/');
const base = isBot(req) ? null : await siteBaseFresh(site);
if (!base) return go(res, here); // unknown site (or a bot): the page itself, nothing remembered
let s = null; try { s = await C.member(req); } catch (e) {}
if (s && s.email) { // signed in here already: straight back (wallet step first when the site needs one)
const set = []; const hop = await backHop(s, site, to, set);
set.push(hop === C.walletPath ? ck('nsso.ret', site + '|' + to, RET_AGE, true) : ck('nsso.ret', '', 0, true));
return go(res, hop, set);
}
log('return link remembered', null, 'for ' + siteName(site));
return go(res, here, [ck('nsso.ret', site + '|' + to, RET_AGE, true), ck('nsso.wait', '', 0, true)]);
}
const peerName = NAMES[C.peer] || C.peer;
const goTo = p.startsWith('/go/') ? p.slice(4) : '';
const walletBase = siteBase; freshSites(); // the hand-written list, then the hub's sign-in sites (2026-11-17)
if (goTo && (goTo === C.peer || walletBase(goTo))) {
const base = goTo === C.peer ? C.peerBase() : walletBase(goTo)();
const to = safePath(u.searchParams.get('to'), '/');
const plain = base + to;
if (!enabled() || isBot(req)) return go(res, plain);
let s = null; try { s = await C.member(req); } catch (e) {}
if (!s || !s.email) return go(res, plain);
if (goTo !== C.peer) { let w = null; try { w = await C.wallet(s); } catch (e) {} if (!w || !w.address) return go(res, plain); } // no wallet to vouch for: a plain link
return go(res, base + '/sso/start?mode=go' + (goTo === C.peer ? '' : '&via=' + C.self) + '&to=' + encodeURIComponent(to));
}
if (p === '/sso/start') {
const to = safePath(u.searchParams.get('to'), C.defaultPath);
const mode = u.searchParams.get('mode') === 'go' ? 'go' : 'check';
const via = String(u.searchParams.get('via') || '');
const from = C.from && Object.prototype.hasOwnProperty.call(C.from, via) ? C.from[via] : null; // a wallet site may ask either provider
const viaHub = hubOn() && !u.searchParams.get('nohub') && (await hubUp());
if (!(enabled() || viaHub) || isBot(req) || notPage(req)) return go(res, to);
let s = null; try { s = await C.member(req); } catch (e) {}
if (s && (s.email || s.address)) return go(res, to); // already signed in here
const c = cookies(req);
if (mode === 'check' && (c['nsso.tried'] || c['nsso.off']) && !u.searchParams.get('nohub')) return go(res, to);
const st = crypto.randomBytes(16).toString('hex');
if (viaHub) { // the hub answers for the whole network; the pairwise provider is the fallback when it has nobody (nsso.via)
const set = [ck('nsso.st', st, mode === 'go' ? GO_STATE_AGE : STATE_AGE, true), ck('nsso.tried', '1', TRIED_AGE, true), ck('nsso.via', via || '-', STATE_AGE, true)];
if (mode === 'go' && c['nsso.off']) set.push(ck('nsso.off', '', 0, true));
return go(res, HUB_BASE() + '/sso/check?site=' + encodeURIComponent(HUB_NAME()) + '&st=' + st + '&to=' + encodeURIComponent(to) + (mode === 'go' ? '&m=go' : ''), set);
}
const set = [ck('nsso.st', st, mode === 'go' ? GO_STATE_AGE : STATE_AGE, true), ck('nsso.tried', '1', TRIED_AGE, true)];
if (mode === 'go' && c['nsso.off']) set.push(ck('nsso.off', '', 0, true));
return go(res, (from ? from() : C.peerBase()) + '/sso/check?st=' + st + (C.from ? '&r=' + C.self : '') + '&to=' + encodeURIComponent(to) + (mode === 'go' ? '&m=go' : ''), set);
}
if (p === '/sso/resume') { // signed in on the provider after a deliberate tap: finish the check it was asked for (2026-11-14)
const q = new URLSearchParams(cookies(req)['nsso.back'] || '');
const clear = [ck('nsso.back', '', 0, true), ck('nsso.wait', '', 0, true)];
if (!/^[a-f0-9]{32}$/.test(q.get('st') || '')) { // no deliberate tap waiting: a ?return=<site> link may be (2026-11-17)
const ret = retOf(req);
if (!ret || !siteBase(ret.site)) return go(res, C.defaultPath, clear.concat(ck('nsso.ret', '', 0, true)));
let s = null; try { s = await C.member(req); } catch (e) {}
if (!s || !s.email) return go(res, C.signinPath(C.defaultPath)); // not signed in yet: keep it for after the sign-in
const set = clear.slice(); const hop = await backHop(s, ret.site, ret.to, set);
set.push(hop === C.walletPath ? ck('nsso.ret', ret.site + '|' + ret.to, RET_AGE, true) : ck('nsso.ret', '', 0, true));
log('back to ' + siteName(ret.site), s.email); return go(res, hop, set);
}
return go(res, '/sso/check?st=' + q.get('st') + (q.get('r') ? '&r=' + encodeURIComponent(q.get('r')) : '') + '&to=' + encodeURIComponent(safePath(q.get('to'), '/')) + '&m=go', clear); // m=go: still a deliberate tap (the wallet step when one is missing)
}
if (p === '/sso/check') {
const st = String(u.searchParams.get('st') || '');
const to = safePath(u.searchParams.get('to'), '/');
const r = String(u.searchParams.get('r') || '');
const wb = r && r !== C.peer ? await siteBaseFresh(r) : null; // a wallet site asking: the token carries the wallet (the hub's sign-in sites too, 2026-11-17)
if (r && r !== C.peer && !wb) { log('check: unknown site asking, nothing sent', null, r.slice(0, 20)); return go(res, C.defaultPath); } // never answer an unknown site as if the peer asked (2026-11-15: 5xYourTeam was sent to LinkSpin)
const base = wb ? wb() : C.peerBase(), aud = wb ? r : C.peer, forName = siteName(aud);
const none = base + '/sso/in?none=1&to=' + encodeURIComponent(to);
if (!enabled() || !/^[a-f0-9]{32}$/.test(st)) return go(res, none);
let s = null; try { s = await C.member(req); } catch (e) {}
if (!s || !s.email) {
if (u.searchParams.get('m') === 'go' && !isBot(req)) { // a deliberate tap: sign in here first, then /sso/resume finishes the trip
log('check: not signed in here, asking to sign in', null, 'for ' + forName);
const back = new URLSearchParams({ st, to }); if (r) back.set('r', r);
return go(res, C.signinPath(C.defaultPath), [ck('nsso.back', back.toString(), BACK_AGE, true)]);
}
log('check: not signed in here', null, 'for ' + forName); return go(res, none);
}
let w = null;
if (wb) { try { w = await C.wallet(s); } catch (e) {} if (!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) {
if (u.searchParams.get('m') === 'go' && C.walletPath && !isBot(req)) { // a deliberate tap: link a wallet here first, then /sso/resume finishes the trip (2026-11-17)
log('check: no wallet on the account, wallet step first', s.email, 'for ' + forName);
const back = new URLSearchParams({ st, to, m: 'go' }); if (r) back.set('r', r);
return go(res, C.walletPath, [ck('nsso.back', back.toString(), BACK_AGE, true), ck('nsso.wait', '1', BACK_AGE, true)]);
}
log('check: no wallet on the account', s.email, 'for ' + forName); return go(res, none); } }
log('token issued', s.email, 'for ' + forName);
return go(res, base + '/sso/in?t=' + mint({ iss: C.self, aud, email: s.email, wallet: w && w.address, name: w && w.name, st, to }));
}
if (p === '/sso/in') {
const c = cookies(req);
const set = [ck('nsso.st', '', 0, true)];
if (u.searchParams.get('none')) {
const nto = safePath(u.searchParams.get('to'), C.defaultPath);
if (u.searchParams.get('hub') && enabled()) { // nobody on the hub: ask the old pairwise provider once (until every site is switched)
const via = String(c['nsso.via'] || ''); set.push(ck('nsso.via', '', 0, true));
log('none on the hub, trying ' + (NAMES[via] || peerName));
return go(res, '/sso/start?nohub=1&mode=' + (u.searchParams.get('m') === 'go' ? 'go' : 'check') + (via && via !== '-' ? '&via=' + encodeURIComponent(via) : '') + '&to=' + encodeURIComponent(nto), set);
}
log('none: not signed in on ' + (u.searchParams.get('hub') ? 'the hub' : peerName)); return go(res, C.signinPath(nto), set);
}
const fromHub = !!u.searchParams.get('h');
const v = fromHub ? verifyHub(u.searchParams.get('h'), { st: c['nsso.st'] }) : verify(u.searchParams.get('t'), { iss: [C.peer].concat(Object.keys(C.from || {})), aud: C.self, st: c['nsso.st'] });
if (v.error) { log('refused: ' + v.error); return go(res, C.signinPath(C.defaultPath), set); }
if (!(await spend(v.n, v.exp))) { log('refused: token already used', v.email); return go(res, C.signinPath(v.to), set); }
let a = null; try { a = await C.accept(v.email, req, v); } catch (e) { a = { fallback: 'error ' + e.message }; }
if (!a || !a.ok) { // not a member here yet (or not allowed to sign in): the normal email-code sign-in, email filled in
log('fallback to email code: ' + ((a && a.fallback) || 'not accepted'), v.email);
set.push(ck('nsso.hint', v.email, HINT_AGE, true));
return go(res, C.signinPath(v.to), set);
}
let cookie = null; try { cookie = await C.signIn(v.email, req, v); } catch (e) { console.error('network-sso sign-in', e.message); }
if (!cookie) { log('fallback to email code: session not made', v.email); return go(res, C.signinPath(v.to), set); }
set.push(cookie); if (c['nsso.off']) set.push(ck('nsso.off', '', 0, true));
if (fromHub) { const w2 = v.wallet && C.from ? { wallet: v.wallet } : { email: v.email }; set.push(ck('nsso.hp', pushTag(w2), PUSH_AGE, true)); } // the hub already has this sign-in
log('signed in from ' + (fromHub ? 'the network hub' : (NAMES[v.iss] || peerName)), v.email);
return go(res, C.landing(v.to === '/' ? C.defaultPath : v.to), set); // no page named: the dashboard, not the public home page (2026-11-13)
}
if (p === '/api/sso/status') {
const c = cookies(req); const set = [];
let s = null; try { s = await C.member(req); } catch (e) {}
const signedIn = !!(s && (s.email || s.address));
const out = { peer: hubOn() ? 'the network' : peerName, check: (enabled() || (hubOn() && (await hubUp()))) && !signedIn && !isBot(req) && !c['nsso.tried'] && !c['nsso.off'] };
if (c['nsso.hint']) { if (!signedIn) out.hint = c['nsso.hint']; set.push(ck('nsso.hint', '', 0, true)); }
return sendJson(res, out, set);
}
return false;
}
// every GET a site serves passes here first (2026-11-15): a signed-in member's real page load pings the hub's activity once a day and,
// with the hub on, tells the hub about this sign-in once (nsso.hp). -> true when it answered (the redirect through the hub).
async function page(req, res, u) {
if (!C || !hubCreds()) return false;
const p = u.pathname;
if (!pageLoad(req, p)) return false;
let s = null; try { s = await C.member(req); } catch (e) {}
const w = who(s); if (!w) return false;
activity(w);
if (hubOn() && cookies(req)['nsso.hp'] !== pushTag(w) && (await hubUp())) {
log('hub: telling the hub about this sign-in', w.email || null);
return go(res, HUB_BASE() + '/sso/set?site=' + encodeURIComponent(HUB_NAME()) + '&t=' + mintHub(Object.assign({ to: p + u.search }, w)), [ck('nsso.hp', pushTag(w), PUSH_AGE, true)]);
}
return false;
}
// true when this browser came here from a deliberate network tap (nsso.back) or a ?return=<site> link (nsso.ret) and still has to
// finish it after signing in. False while it waits on the wallet step (nsso.wait): the dashboard must not bounce it back and forth.
const pendingBack = req => { const c = cookies(req); return !!(c['nsso.back'] || retOf(req)) && !c['nsso.wait']; };
// the wallet was just linked: the next hop when a way back is waiting (2026-11-17), else null
const afterWallet = req => { const c = cookies(req); return c['nsso.back'] || retOf(req) ? '/sso/resume' : null; };
// the name of the site a member is on the way back to, for a line on the provider's dashboard; null when none
function backName(req) {
const c = cookies(req); const ret = retOf(req);
if (ret) return siteName(ret.site);
if (!c['nsso.back']) return null;
const r = new URLSearchParams(c['nsso.back']).get('r'); return siteName(r || (C && C.peer) || '') || null;
}
module.exports = { init, handle, page, seen, enabled, pendingBack, afterWallet, backName, siteBase, mint, verify, spend, safePath, isBot, offCookie, mask, TTL, NAMES, hubOn, hubCreds, signOutEverywhere, mintHub, verifyHub, _hubSeen: t => { hubSeen = t == null ? Date.now() : t; hubChecked = Date.now(); }, _pinged: pinged, _hubSites: o => { if (o) { hubSites = o; hubSitesAt = Date.now(); } return hubSites; } };
-108
View File
@@ -1,108 +0,0 @@
// Prohibited-content policy, one module shared by InstantAdPay and LinkSpin (keep the two copies identical).
// 2026-10-30: an SEO backlink farm opened 106 free accounts, each with a casino or local-business bio and a
// website link, and Google indexed that text under our domains through the public walls. Rules (Marty):
// - profile fields are not a free backlink: a bio may not carry a URL or a domain-looking token;
// - gambling, adult, pharma, weapons and link-selling terms are refused in every member-set text field
// (bio, social links, line banner, wall offers, campaign names, headlines, copy and target URLs);
// - case-insensitive and Unicode aware (NFC, lower-cased, letter/number boundaries, so "Essex" never hits "sex").
// Pure functions, no state, no dependencies.
'use strict';
// One entry per term or phrase; spaces match any run of whitespace. Grouped for the Terms page and the admin.
const LIST = {
gambling: ['casino', 'casinos', 'cassino', 'cassinos', 'slots', 'slot gacor', 'betting', 'sportsbook', 'sportsbooks', 'bookmaker', 'bookmakers', 'bookie',
'lottery', 'lotteries', 'lotto', 'poker', 'baccarat', 'roulette', 'blackjack', 'jackpot', 'togel', 'judi', 'judi online', 'apostas', 'apuestas',
'nổ hũ', 'cá cược', 'đổi thưởng', 'xổ số', 'kèo', 'nhà cái', 'soi kèo', 'game bài', 'tài xỉu', 'bắn cá'],
adult: ['porn', 'porno', 'pornography', 'sex', 'sexy', 'escort', 'escorts', 'erotic', 'erotica', 'xxx', 'onlyfans', 'nude', 'nudes', 'hentai', 'cam girl', 'cam girls', 'sex cam', 'hookup', 'hookups'],
pharma: ['viagra', 'cialis', 'levitra', 'pharmacy', 'pharmacies', 'prescription', 'prescriptions', 'steroids', 'anabolic', 'cannabis', 'marijuana', 'weed', 'cbd', 'kratom', 'opioid', 'opioids',
'xanax', 'adderall', 'tramadol', 'oxycodone', 'ketamine', 'cocaine', 'mdma', 'psilocybin', 'vape', 'vaping'],
weapons: ['firearm', 'firearms', 'guns', 'gun shop', 'gun store', 'ammunition', 'ammo', 'rifle', 'rifles', 'pistol', 'pistols', 'handgun', 'handguns', 'silencer', 'suppressor', 'explosives'],
linkfarm: ['backlink', 'backlinks', 'seo service', 'seo services', 'seo agency', 'link building', 'link-building', 'guest post', 'guest posts', 'guest posting', 'pbn', 'buy links', 'sell links', 'dofollow']
};
const ALL = Object.values(LIST).reduce((a, b) => a.concat(b), []);
const esc = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const ZW = /[​-‏⁠]/g; // zero-width joiners hide nothing
const strip = s => String(s == null ? '' : s).normalize('NFC').replace(ZW, '');
const norm = s => strip(s).toLowerCase();
// Boundary = anything that is not a letter or a number (works for every script, unlike \b).
const TERM_RE = new RegExp('(?<![\\p{L}\\p{N}])(?:' + ALL.map(t => esc(norm(t)).replace(/\s+/g, '\\s+')).join('|') + ')(?![\\p{L}\\p{N}])', 'u');
// Common gTLDs plus the ccTLDs link farms actually use. A short two-letter list keeps "Mr.Li" style text out of it.
const TLDS = 'com|net|org|info|biz|io|co|app|xyz|me|tv|us|uk|vn|de|fr|ru|in|id|br|es|it|nl|ca|au|eu|ch|at|be|pt|pl|cz|se|no|fi|dk|ie|nz|za|ng|ke|eg|tr|ua|il|ae|sa|pk|bd|lk|np|kh|la|mm|my|sg|ph|th|jp|kr|cn|tw|hk|mx|ar|cl|pe|to|ly|cc|gg|ai|pw|ws|tk|ml|ga|cf|gq|su|'
+ 'site|online|store|shop|club|top|pro|live|link|page|dev|fun|vip|one|tech|space|website|cloud|digital|agency|company|email|news|blog|life|world|today|zone|guru|ninja|game|games|team|network|money|cash|gold|bid|trade|win|bet|casino|poker|mobi|name|tel|travel|jobs|pics|photo|video|press|media|art|design|studio|capital|finance|exchange|solutions|services|systems|tools|works|center|group|global|international|institute|academy|school|education|university|church|community|social|chat|dating|love|wiki|review|reviews|directory|guide|help|support|rocks|ventures|holdings|partners|limited|ltd|llc|inc|asia|africa|london|nyc|tokyo|berlin|paris|best|buzz|click|host|hosting|lol|monster|wtf|ooo|icu|sbs|cfd|cyou|rest|bar|cam|surf|run|fit|health|care|dog|cat|pet|pets|wine|beer|vodka|bio|eco|green|energy|solar|car|cars|auto|bike|tires|taxi|limo|rent|rentals|house|homes|realty|estate|land|city|town|place|map|earth|fund|loans|credit|insure|legal|law|lawyer|attorney|tax|accountant|consulting|marketing|promo|sale|deals|discount|coupons|gift|gifts|toys|baby|kids|mom|family|wedding|party|events|tickets|show|theater|film|movie|music|band|dance|yoga|golf|football|soccer|hockey|tennis|racing';
// Schemes and www. are matched in any case; a bare domain token (or an email address) only with its TLD in lower case, so a
// missed space after a period ("ads.One day") is not mistaken for a link while real spam domains (typed lower case) are caught.
const SCHEME_RE = /(?:https?:\/\/|ftp:\/\/|(?<![\p{L}\p{N}])www\.)/iu;
const DOMAIN_RE = new RegExp('(?<![\\p{L}\\p{N}])[\\p{L}\\p{N}-]{1,63}(?:\\.[\\p{L}\\p{N}-]{1,63})*\\.(?:' + TLDS + ')(?![\\p{L}\\p{N}])', 'u');
// The matching prohibited term, or null.
function match(text) { const m = TERM_RE.exec(norm(text)); return m ? m[0].replace(/\s+/g, ' ') : null; }
// True when the text carries a URL or a domain-looking token (http(s)://, www., word.tld).
function hasUrl(text) { const t = strip(text); return SCHEME_RE.test(t) || DOMAIN_RE.test(t); }
const BIO_LINK_MSG = 'Links go in the social fields, not the bio.';
const blockedMsg = site => 'That content is not allowed on ' + (site || 'InstantAdPay/LinkSpin') + ' profiles (see Terms).';
const blockedAdMsg = site => 'That content is not allowed on ' + (site || 'InstantAdPay/LinkSpin') + ' (see Terms, Prohibited content).';
// Bio rule: no links, no prohibited terms. Returns { ok: true } or { error, reason }.
function checkBio(bio, site) {
const t = String(bio || '');
if (!t.trim()) return { ok: true };
if (hasUrl(t)) return { error: BIO_LINK_MSG, reason: 'url' };
const term = match(t);
if (term) return { error: blockedMsg(site), reason: 'term:' + term };
return { ok: true };
}
// Any other member-set text (social URL, banner target, campaign name, headline, copy): prohibited terms only.
// Pass profile: true for profile fields (the message names profiles), else the ad message is used.
function checkText(text, site, opts) {
const term = match(text);
if (!term) return { ok: true };
return { error: (opts && opts.profile) ? blockedMsg(site) : blockedAdMsg(site), reason: 'term:' + term };
}
// Several fields at once: { name: value, ... } -> first failure, with the field named in `field`.
function checkFields(fields, site, opts) {
for (const k of Object.keys(fields || {})) {
const v = fields[k]; if (v == null || v === '') continue;
const r = checkText(Array.isArray(v) ? v.join(' ') : String(v), site, opts);
if (r.error) return Object.assign({ field: k }, r);
}
return { ok: true };
}
// Profile ingest (registry sync from the other property, or a saved profile replayed): the parts of a profile that may be
// stored. A bio with a link or a prohibited term is dropped (null); a social URL carrying a prohibited term is dropped.
function cleanProfile(pf, site) {
const out = { avatarUrl: null, bio: null, socials: null, dropped: [] };
if (!pf || typeof pf !== 'object') return out;
const av = String(pf.avatarUrl || '').trim(); if (/^https:\/\/[^\s]+$/i.test(av) && av.length <= 300) out.avatarUrl = av;
const bio = String(pf.bio || '').trim().slice(0, 600);
if (bio) { const r = checkBio(bio, site); if (r.ok) out.bio = bio; else out.dropped.push('bio:' + r.reason); }
const src = pf.socials && typeof pf.socials === 'object' ? pf.socials : (typeof pf.socials === 'string' ? safeJson(pf.socials) : null);
if (src) {
const c = {};
for (const k of Object.keys(src)) {
const v = String(src[k] || '').trim(); if (!v) continue;
const r = checkText(v, site, { profile: true }); if (r.ok) c[k] = v; else out.dropped.push('socials.' + k + ':' + r.reason);
}
if (Object.keys(c).length) out.socials = c;
}
return out;
}
function safeJson(s) { try { const o = JSON.parse(s); return o && typeof o === 'object' ? o : null; } catch (e) { return null; } }
// Terms-page wording, one line per group (kept here so both sites say the same thing).
const POLICY = [
'gambling, casinos, betting, lotteries and sweepstakes',
'adult or sexual content',
'drugs and prescription pharmaceuticals',
'weapons',
'hate or harassment',
'malware, phishing and counterfeit goods',
'misleading financial promises',
'accounts created to place links in profile fields (link farming), which are removed without notice together with their profile text'
];
// One log line per refusal, with the email masked (never the text itself at full length).
function logRefusal(where, email, r) {
try { console.log('prohibited-content refused', where, String(email || '-').replace(/^(.).*(@.*)$/, '$1***$2'), r && r.field ? 'field=' + r.field : '', r && r.reason ? r.reason : ''); } catch (e) {}
}
module.exports = { LIST, ALL, POLICY, match, hasUrl, checkBio, checkText, checkFields, cleanProfile, logRefusal, BIO_LINK_MSG, blockedMsg, blockedAdMsg };
-184
View File
@@ -1,184 +0,0 @@
// Promo days (Marty 2026-11-17, "Network Weekend", Black Friday to Cyber Monday 2026): a reusable date-to-percent bonus map, cloned
// from Five Dollar Friday (friday.js). Any package bought on a mapped Central day, at or above that day's minimum, earns that day's
// bonus percent of its on-chain credits (purchased-grade, labelled in the credit log), once per purchase tx across app copies
// (marks.js, MySQL), with a purchase notice that names the day. Future holidays = a new map in the promoDays setting, no code.
//
// The 2026 map (DEFAULT_DAYS): Fri 11-27 Black Friday +40% $5+, Sat 11-28 and Sun 11-29 +20% $5+, Mon 11-30 Cyber Monday +30% $20+.
// Each day is midnight to midnight Central. A mapped day that is a Friday is paid by friday.js at max(fridayBonusPct, the day's pct)
// (fridayPct below), so Black Friday is ONE bonus per tx at 40%, the free 7-day Game Pass perk still fires, and nobody flips
// fridayBonusPct by hand; normal Five Dollar Friday (+20%) resumes on 12-04 by itself.
//
// Also here, all date-gated to the weekend window (weekendStart..weekendEnd, Fri 11-27 00:00 CT to Tue 12-01 00:00 CT):
// - Weekend Starter Bundle: a $20+ pack also gets the LinkSpin code (setting weekendLinkspinCode, default WEEKEND500) in its notice
// - Builder Bundle: a $100+ pack is listed for DownlineHydra (GET /api/network/weekend-builders); DH grants Pro, 25 comps
// - Game Pass bonus days for tier passes fulfilled Fri 11-27 00:00 CT to Fri 12-04 00:00 CT (passBonusDays, read by gamepass.js)
// - the chatbot fact and answer, the /api/promodays view for the strip, Overview card and /weekend page
//
// Settings (siteConfig): promoDaysOn '1'|'0' (kill switch), promoDays (JSON {"YYYY-MM-DD": {pct, minCents, name}}), weekendStart /
// weekendEnd / weekendPassEnd (ISO), weekendLinkspinCode, weekendBuilderCap (24: DH keeperGrantsLeft 49 on 11-17, minus 5 PRO_PENDING, keeps a 20-grant reserve), promoMailBase (link base for emails, default the share domain instantadpay.link).
// Test clock: env IAP_TEST_NOW (ISO), ignored when NODE_ENV=production. Copy rules: no em dashes, Central times, no income promises.
'use strict';
const fs = require('fs');
const path = require('path');
let X = {}, FILE = null, S = null;
const TZ = 'America/Chicago';
const dayOf = ts => new Date(ts).toLocaleDateString('en-CA', { timeZone: TZ });
const weekdayOf = ts => new Date(ts).toLocaleDateString('en-US', { timeZone: TZ, weekday: 'short' });
const CREDITS_LINE = 'Ad credits buy advertising, not income.';
const DEFAULT_DAYS = {
'2026-11-27': { pct: 40, minCents: 500, name: 'Black Friday' },
'2026-11-28': { pct: 20, minCents: 500, name: 'Network Weekend Saturday' },
'2026-11-29': { pct: 20, minCents: 500, name: 'Network Weekend Sunday' },
'2026-11-30': { pct: 30, minCents: 2000, name: 'Cyber Monday' }
};
const DEFAULTS = {
weekendStart: '2026-11-27T00:00:00-06:00', weekendEnd: '2026-12-01T00:00:00-06:00', weekendPassEnd: '2026-12-04T00:00:00-06:00',
weekendLinkspinCode: 'WEEKEND500', weekendStarterMinCents: 2000, weekendBuilderMinCents: 10000, weekendBuilderCap: 24,
passBonus: { explorer: 15, champion: 15, legend: 60 } // days on top of the tier's own (30, 30, 365)
};
function now() {
const o = process.env.NODE_ENV !== 'production' && process.env.IAP_TEST_NOW; const t = o ? Date.parse(o) : NaN;
return Number.isNaN(t) ? Date.now() : t;
}
function init(opts) { X = opts || {}; FILE = path.join(opts.dataDir, 'promodays.json'); S = load(); }
function load() { try { return Object.assign({ granted: {}, bundles: {} }, JSON.parse(fs.readFileSync(FILE, 'utf8'))); } catch (e) { return { granted: {}, bundles: {} }; } }
function save() { try { fs.writeFileSync(FILE, JSON.stringify(S)); } catch (e) {} }
async function claimOnce(key) { try { return X.marks ? await X.marks.claim(key) : true; } catch (e) { return true; } }
function cfg() {
const c = (X.siteConfig && X.siteConfig()) || {};
let days = DEFAULT_DAYS;
if (c.promoDays) { try { const j = typeof c.promoDays === 'string' ? JSON.parse(c.promoDays) : c.promoDays; if (j && typeof j === 'object') days = j; } catch (e) { console.error('promoDays setting is not valid JSON, using the built-in map'); } }
const ms = (k) => { const t = Date.parse(c[k] || DEFAULTS[k]); return Number.isNaN(t) ? Date.parse(DEFAULTS[k]) : t; };
return {
on: String(c.promoDaysOn == null ? '1' : c.promoDaysOn) === '1',
days, start: ms('weekendStart'), end: ms('weekendEnd'), passEnd: ms('weekendPassEnd'),
lsCode: String(c.weekendLinkspinCode || DEFAULTS.weekendLinkspinCode).toUpperCase().replace(/[^A-Z0-9_-]/g, '').slice(0, 24),
starterMin: Number(c.weekendStarterMinCents) || DEFAULTS.weekendStarterMinCents,
builderMin: Number(c.weekendBuilderMinCents) || DEFAULTS.weekendBuilderMinCents,
builderCap: Math.max(0, Number(c.weekendBuilderCap == null ? DEFAULTS.weekendBuilderCap : c.weekendBuilderCap) || 0),
mailBase: String(c.promoMailBase || 'https://instantadpay.link').replace(/\/+$/, ''), // instantadpay.com is on the Spamhaus DBL (still listed 2026-11-17): email links use the share domain
passBonus: DEFAULTS.passBonus,
tiersOn: String(c.sovTiers) === '1' // the tier passes are only on sale with sovTiers; the pass bonus days are only said while they are
};
}
// the mapped day at ts, or null: { day, pct, minCents, name }
function dayAt(ts) {
const c = cfg(); if (!c.on) return null;
const d = dayOf(ts); const e = c.days[d];
if (!e || !(Number(e.pct) > 0)) return null;
return { day: d, pct: Number(e.pct), minCents: Math.max(0, Number(e.minCents) || 0), name: String(e.name || 'Promo day').slice(0, 60) };
}
// friday.js asks: the promo percent for a Friday purchase (0 = none), so Black Friday is paid there, once, at the higher rate
function fridayPct(ts, cents) { const d = dayAt(ts); return d && weekdayOf(ts) === 'Fri' && (cents == null || cents >= d.minCents) ? d.pct : 0; }
function fridayName(ts) { const d = dayAt(ts); return d && weekdayOf(ts) === 'Fri' ? d.name : ''; }
function inWeekend(ts) { const c = cfg(); return c.on && ts >= c.start && ts < c.end; }
function weekendLive(t) { return inWeekend(t == null ? now() : t); }
// Game Pass bonus days for a tier pass fulfilled at ts (gamepass.js extend, via 'package' only; comps never get them)
function passBonusDays(tier, ts) {
const c = cfg(); if (!c.on || !(ts >= c.start && ts < c.passEnd)) return 0;
return Number(c.passBonus[tier]) || 0;
}
const usdOf = cents => ('$' + (cents / 100).toFixed(2)).replace(/\.00$/, '');
const tsOf = ev => (Number(ev.ts) > 1e12 ? Number(ev.ts) : (Number(ev.ts) > 0 ? Number(ev.ts) * 1000 : Date.now()));
// the bonus on a mapped non-Friday day (Fridays are paid by friday.js), and the bundle notices on any weekend day
async function onEvent(ev) {
if (!ev || ev.type !== 'Purchase') return null;
const ts = tsOf(ev); const cents = Number(ev.priceCents) || 0;
const out = { bonus: 0, starter: false, builder: false };
const d = dayAt(ts);
if (d && weekdayOf(ts) !== 'Fri' && cents >= d.minCents && !S.granted[ev.tx] && await claimOnce('pd:' + ev.tx)) {
const bonus = Math.round((Number(ev.creditAmount) || 0) * d.pct / 100);
const a = bonus > 0 && X.accounts ? await X.accounts.byMemberId(ev.buyerId) : null;
if (a && a.email) {
await X.ads.addEarned(a.email, bonus, { purchased: true, log: { kind: 'bonus', note: d.name + ': +' + d.pct + '% on your ' + usdOf(cents) + ' package', ref: 'pd:' + String(ev.tx).slice(0, 30) } });
S.granted[ev.tx] = { day: d.day, memberId: ev.buyerId, bonus, pct: d.pct, at: Date.now() }; save();
out.bonus = bonus;
try { await X.notify(ev.buyerId, d.name + ': +' + bonus + ' bonus credits', 'Your ' + usdOf(cents) + ' package landed on ' + d.name + ', so ' + bonus + ' bonus ad credits (+' + d.pct + '%) were added to your balance. ' + CREDITS_LINE + ' See your balance: https://instantadpay.com/my#campaigns\n\nEvery Network Weekend deal across the network: https://instantadpay.com/weekend', 'notice'); } catch (e) {}
}
}
if (inWeekend(ts) && cents >= cfg().starterMin && !S.bundles[ev.tx] && await claimOnce('pdb:' + ev.tx)) {
const c = cfg(); const builder = cents >= c.builderMin;
const wallet = builder ? await walletOf(ev) : '';
S.bundles[ev.tx] = { memberId: ev.buyerId, cents, at: ts, builder, wallet }; save();
out.starter = true; out.builder = builder;
const lines = ['Your ' + usdOf(cents) + ' package came in during Network Weekend, so it carries the Weekend Starter Bundle: a ' + '500-credit LinkSpin code, ' + c.lsCode + '. Enter it at https://linkspin.app (same email as here, one per account).'];
if (builder) lines.push('It is also a Builder Bundle: DownlineHydra Pro is on its way to the wallet that paid' + (wallet ? ' (' + wallet.slice(0, 6) + '...' + wallet.slice(-4) + ')' : '') + ', free, while the first ' + c.builderCap + ' comps last. If that wallet already holds Pro, nothing changes. It lands within the hour; check https://downlinehydra.com.');
lines.push(CREDITS_LINE);
try { await X.notify(ev.buyerId, 'Network Weekend: your bundle extras', lines.join('\n\n'), 'notice'); } catch (e) {}
}
return out;
}
// the buying position's wallet: the chain index first (MemberActivated), then a contract read
async function walletOf(ev) {
const id = Number(ev.buyerId) || 0; if (!id || !X.chain) return '';
try { for (const e of X.chain.recentEvents(1e9)) if (e.type === 'MemberActivated' && Number(e.id) === id && e.account) return String(e.account).toLowerCase(); } catch (e) {}
try { const m = await X.chain.member(id); return m && m.account ? String(m.account).toLowerCase() : ''; } catch (e) { return ''; }
}
// GET /api/network/weekend-builders (DownlineHydra pulls it): every $100+ package in the window, from the chain index, never a counter
async function builders() {
const c = cfg(); const out = [];
let evs = []; try { evs = X.chain.recentEvents(1e9); } catch (e) {}
for (const ev of evs) {
if (ev.type !== 'Purchase' || (Number(ev.priceCents) || 0) < c.builderMin) continue;
const ts = tsOf(ev); if (!(ts >= c.start && ts < c.end)) continue;
const wallet = (S.bundles[ev.tx] && S.bundles[ev.tx].wallet) || await walletOf(ev);
if (wallet) out.push({ wallet, txHash: ev.tx, usdCents: Number(ev.priceCents), at: new Date(ts).toISOString() });
}
return { start: new Date(c.start).toISOString(), end: new Date(c.end).toISOString(), cap: c.builderCap, builders: out.sort((a, b) => a.at < b.at ? -1 : 1) };
}
// the public view for the strip, Overview card and /weekend page
function view(t) {
const c = cfg(); t = t == null ? now() : t;
const d = dayAt(t); const live = inWeekend(t);
// nothing about the deals is published before Thanksgiving Thursday 00:00 CT (24 h before the start)
if (t < c.start - 86400000) return { on: c.on, live: false, today: null, days: [], startsAt: new Date(c.start).toISOString(), endsAt: new Date(c.end).toISOString(), published: false };
const list = Object.entries(c.days).sort().map(([k, v]) => ({ day: k, name: v.name, pct: Number(v.pct), minUsd: (Number(v.minCents) || 0) / 100 }));
let st = null;
if (d) { let packs = 0, usd = 0; try { for (const ev of X.chain.recentEvents(1e9)) if (ev.type === 'Purchase' && ev.priceCents >= d.minCents && dayOf(tsOf(ev)) === d.day) { packs++; usd += ev.priceCents / 100; } } catch (e) {}
st = { packs, usd, bonusCredits: Object.values(S.granted).filter(g => g.day === d.day).reduce((s, g) => s + g.bonus, 0) }; }
return { on: c.on, live, today: d ? { day: d.day, name: d.name, pct: d.pct, minUsd: d.minCents / 100, stats: st } : null, days: list,
startsAt: new Date(c.start).toISOString(), endsAt: new Date(c.end).toISOString(), passEndsAt: new Date(c.passEnd).toISOString(),
published: true, passBonusLive: c.on && c.tiersOn && t >= c.start && t < c.passEnd, passBonus: c.passBonus, lsCode: live ? c.lsCode : null, builderCap: c.builderCap, note: CREDITS_LINE };
}
// Thanksgiving: friday.js sends this instead of the normal Thursday copy when tomorrow is a mapped Friday (one message)
function thursdayCopy(nextFridayKey) {
const c = cfg(); const d = c.on && c.days[nextFridayKey]; if (!d) return null;
const B = c.mailBase;
return { subject: d.name + ' starts at midnight: Network Weekend',
text: 'Network Weekend starts tonight at midnight Central and runs Black Friday to Cyber Monday, midnight to midnight.\n\n'
+ 'On InstantAdPay:\n'
+ 'Black Friday (Fri 11-27): +40% bonus ad credits on any $5+ pack, and the same pack gives you a free 7-day Game Pass.\n'
+ 'Saturday and Sunday: +20% bonus ad credits on any $5+ pack.\n'
+ 'Cyber Monday (Mon 11-30): +30% bonus ad credits on any $20+ pack.\n'
+ 'Any $20+ pack also gets a 500-credit LinkSpin code. Any $100+ pack also gets DownlineHydra Pro free, while the first ' + c.builderCap + ' comps last.\n'
+ 'Code NETWORKWEEKEND: 300 bonus ad credits, one per account, from midnight.\n\n'
+ 'Every pack still pays its sponsor line in the same transaction, at the full price. ' + CREDITS_LINE + '\n\n'
+ 'Every network site has its own weekend deal: ' + B + '/weekend\n'
+ 'Line up your pack: ' + B + '/my#buy' };
}
// the chatbot (chatbot.js): a fact for the system prompt and one answer, only while the weekend (or the Game Pass days) is on
function chatFact(t) {
const c = cfg(); t = t == null ? now() : t;
if (!c.on || t < c.start - 86400000 || t >= (c.tiersOn ? c.passEnd : c.end)) return '';
if (t < c.start) return '- NETWORK WEEKEND (starts Fri 2026-11-27 00:00 Central, tomorrow): Black Friday to Cyber Monday, midnight to midnight Central. Not live yet: say it starts at midnight; deals at https://instantadpay.com/weekend.\n';
if (t >= c.end) return !c.tiersOn ? '' : '- NETWORK WEEKEND is over (it ended Mon 11-30 at midnight Central). Still on until Thu 12-03 23:59 Central: tier Game Pass bonus days (Explorer and Champion 45 days, Legend 365 + 60). Five Dollar Friday is back to +20% on $5+ from Fri 12-04.\n';
return '- NETWORK WEEKEND (LIVE now, Fri 11-27 00:00 to Mon 11-30 23:59 Central, midnight to midnight): Black Friday +40% bonus ad credits on any $5+ pack (instead of the usual Five Dollar Friday +20%, never both) plus the free 7-day Game Pass; Saturday and Sunday +20% on $5+; Cyber Monday +30% on $20+. Weekend Starter Bundle: any $20+ pack gets the LinkSpin code ' + c.lsCode + ' (500 LinkSpin credits, shown on the purchase notice). Builder Bundle: any $100+ pack gets DownlineHydra Pro free for the paying wallet, first ' + c.builderCap + ' comps, nobody is paid on a comp. Code NETWORKWEEKEND: 300 bonus ad credits, paid in 5 daily installments as the member finishes the daily ad set, one per account, new and existing accounts, valid until Mon 11-30 23:59 Central.' + (c.tiersOn ? ' Tier Game Pass bonus days through Thu 12-03 23:59 Central (Explorer and Champion 45 days, Legend 365 + 60).' : '') + ' Every pack pays its sponsor line in full. No price is cut on InstantAdPay. All deals: https://instantadpay.com/weekend. Ad credits buy advertising, not income; never promise income.\n';
}
const CHAT_RE = /(black friday|cyber monday|network weekend|weekend (deal|sale|bonus|promo|special)s?|thanksgiving|bundle|networkweekend|friday (bonus|promo|deal|special)|five dollar friday)/i;
function chatAnswer(msg, t) {
const c = cfg(); t = t == null ? now() : t;
if (!c.on || !CHAT_RE.test(String(msg || '')) || t < c.start - 86400000 || t >= c.end) return null;
if (t < c.start) return 'Network Weekend starts tonight at midnight Central and runs Black Friday to Cyber Monday, midnight to midnight. Black Friday: +40% bonus ad credits on any $5+ pack plus a free 7-day Game Pass. Saturday and Sunday: +20% on $5+. Cyber Monday: +30% on $20+. Any $20+ pack adds a 500-credit LinkSpin code, any $100+ pack adds DownlineHydra Pro while the first ' + c.builderCap + ' comps last, and code NETWORKWEEKEND gives 300 bonus ad credits from midnight. Every deal: https://instantadpay.com/weekend. ' + CREDITS_LINE;
const d = dayAt(t);
return 'Network Weekend is on now, midnight to midnight Central through Cyber Monday. ' + (d ? 'Today is ' + d.name + ': +' + d.pct + '% bonus ad credits on any ' + usdOf(d.minCents) + '+ pack' + (weekdayOf(t) === 'Fri' ? ' (this replaces the usual Five Dollar Friday +20%), plus a free 7-day Game Pass' : '') + '. ' : '')
+ 'Saturday and Sunday are +20% on $5+, Cyber Monday is +30% on $20+. Any $20+ pack also gets the LinkSpin code ' + c.lsCode + ' (500 LinkSpin credits) on your purchase notice, and any $100+ pack gets DownlineHydra Pro free for the paying wallet while the first ' + c.builderCap + ' comps last. Code NETWORKWEEKEND gives 300 bonus ad credits over 5 days of your daily ad set, one per account. Buy under My account > Buy packages: https://instantadpay.com/my#buy. Every deal on the network: https://instantadpay.com/weekend. ' + CREDITS_LINE;
}
module.exports = { init, cfg, dayAt, fridayPct, fridayName, inWeekend, weekendLive, passBonusDays, onEvent, builders, view, thursdayCopy, chatFact, chatAnswer, now, DEFAULT_DAYS, CREDITS_LINE };
+5 -9
View File
@@ -4,8 +4,6 @@
// the dashboard. One redemption per code per account; every redemption is logged; optional // the dashboard. One redemption per code per account; every redemption is logged; optional
// cap (max uses) and expiry; codes can be switched off. Storage: MySQL promo_codes + // cap (max uses) and expiry; codes can be switched off. Storage: MySQL promo_codes +
// promo_redemptions, or DATA_DIR/promos.json. // promo_redemptions, or DATA_DIR/promos.json.
// Start time (2026-11-17, Network Weekend code NETWORKWEEKEND): `starts` (ms, 0 = at once) keeps a code dormant until then, so a
// weekend code can be created ahead and opens by itself. Test clock: env IAP_TEST_NOW, ignored when NODE_ENV=production.
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const db = require('./db'); const db = require('./db');
@@ -17,7 +15,6 @@ const norm = c => String(c || '').trim().toUpperCase().replace(/[^A-Z0-9_-]/g, '
const STEPS = 5; const STEPS = 5;
const WINDOW_DAYS = 30; const WINDOW_DAYS = 30;
const stepOf = credits => Math.ceil(Number(credits) / STEPS); const stepOf = credits => Math.ceil(Number(credits) / STEPS);
const nowMs = () => { const o = process.env.NODE_ENV !== 'production' && process.env.IAP_TEST_NOW; const t = o ? Date.parse(o) : NaN; return Number.isNaN(t) ? Date.now() : t; };
const J = { const J = {
db: { v: 1, codes: {}, redemptions: [] }, db: { v: 1, codes: {}, redemptions: [] },
@@ -38,8 +35,8 @@ const D = {
async get(code) { const r = await db.q('SELECT * FROM promo_codes WHERE code=?', [code]); return r[0] ? row(r[0]) : null; }, async get(code) { const r = await db.q('SELECT * FROM promo_codes WHERE code=?', [code]); return r[0] ? row(r[0]) : null; },
async list() { return (await db.q('SELECT * FROM promo_codes ORDER BY created DESC')).map(row); }, async list() { return (await db.q('SELECT * FROM promo_codes ORDER BY created DESC')).map(row); },
async put(c) { async put(c) {
await db.q('INSERT INTO promo_codes (code,credits,partner,note,max_uses,expires,active,created,funder,starts) VALUES (?,?,?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE funder=VALUES(funder), credits=VALUES(credits), partner=VALUES(partner), note=VALUES(note), max_uses=VALUES(max_uses), expires=VALUES(expires), active=VALUES(active), starts=VALUES(starts)', await db.q('INSERT INTO promo_codes (code,credits,partner,note,max_uses,expires,active,created,funder) VALUES (?,?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE funder=VALUES(funder), credits=VALUES(credits), partner=VALUES(partner), note=VALUES(note), max_uses=VALUES(max_uses), expires=VALUES(expires), active=VALUES(active)',
[c.code, c.credits, c.partner || null, c.note || null, c.maxUses || 0, c.expires || 0, c.active ? 1 : 0, c.created || Date.now(), c.funder || null, c.starts || 0]); [c.code, c.credits, c.partner || null, c.note || null, c.maxUses || 0, c.expires || 0, c.active ? 1 : 0, c.created || Date.now(), c.funder || null]);
return this.get(c.code); return this.get(c.code);
}, },
async uses(code) { const r = await db.q('SELECT COUNT(*) n FROM promo_redemptions WHERE code=?', [code]); return Number(r[0].n); }, async uses(code) { const r = await db.q('SELECT COUNT(*) n FROM promo_redemptions WHERE code=?', [code]); return Number(r[0].n); },
@@ -49,7 +46,7 @@ const D = {
async markPaid(code, email, paid, lastDay) { await db.q('UPDATE promo_redemptions SET paid=?, last_day=? WHERE code=? AND email=?', [paid, lastDay, code, email]); }, async markPaid(code, email, paid, lastDay) { await db.q('UPDATE promo_redemptions SET paid=?, last_day=? WHERE code=? AND email=?', [paid, lastDay, code, email]); },
async redemptions(code, n) { const rows = code ? await db.q('SELECT * FROM promo_redemptions WHERE code=? ORDER BY ts DESC LIMIT ?', [code, Number(n) || 200]) : await db.q('SELECT * FROM promo_redemptions ORDER BY ts DESC LIMIT ?', [Number(n) || 200]); return rows.map(r => ({ code: r.code, email: r.email, credits: Number(r.credits), via: r.via, ts: Number(r.ts) })); } async redemptions(code, n) { const rows = code ? await db.q('SELECT * FROM promo_redemptions WHERE code=? ORDER BY ts DESC LIMIT ?', [code, Number(n) || 200]) : await db.q('SELECT * FROM promo_redemptions ORDER BY ts DESC LIMIT ?', [Number(n) || 200]); return rows.map(r => ({ code: r.code, email: r.email, credits: Number(r.credits), via: r.via, ts: Number(r.ts) })); }
}; };
const row = r => ({ code: r.code, funder: r.funder || null, credits: Number(r.credits), partner: r.partner || '', note: r.note || '', maxUses: Number(r.max_uses) || 0, expires: Number(r.expires) || 0, active: !!Number(r.active), created: Number(r.created), starts: Number(r.starts) || 0 }); const row = r => ({ code: r.code, funder: r.funder || null, credits: Number(r.credits), partner: r.partner || '', note: r.note || '', maxUses: Number(r.max_uses) || 0, expires: Number(r.expires) || 0, active: !!Number(r.active), created: Number(r.created) });
const impl = () => db.enabled() ? D : J; const impl = () => db.enabled() ? D : J;
function init(opts) { DATA_DIR = opts.dataDir; if (!db.enabled()) J.load(); } function init(opts) { DATA_DIR = opts.dataDir; if (!db.enabled()) J.load(); }
@@ -57,7 +54,7 @@ async function create(c) {
const code = norm(c.code); if (!code || code.length < 3) return { error: 'Code must be 3 to 24 letters or numbers.' }; const code = norm(c.code); if (!code || code.length < 3) return { error: 'Code must be 3 to 24 letters or numbers.' };
const credits = Math.floor(Number(c.credits)); if (!(credits > 0) || credits > 100000) return { error: 'Credits must be between 1 and 100,000.' }; const credits = Math.floor(Number(c.credits)); if (!(credits > 0) || credits > 100000) return { error: 'Credits must be between 1 and 100,000.' };
const cur = await impl().get(code); const cur = await impl().get(code);
const saved = await impl().put({ code, credits, funder: c.funder ? String(c.funder).toLowerCase() : (cur && cur.funder) || null, partner: String(c.partner || '').slice(0, 80), note: String(c.note || '').slice(0, 200), maxUses: Math.max(0, Math.floor(Number(c.maxUses) || 0)), expires: c.expires ? Number(new Date(c.expires)) || 0 : 0, starts: c.starts ? Number(new Date(c.starts)) || 0 : (c.starts === undefined && cur ? cur.starts || 0 : 0), active: c.active !== false && c.active !== 0 && c.active !== '0', created: cur ? cur.created : Date.now() }); const saved = await impl().put({ code, credits, funder: c.funder ? String(c.funder).toLowerCase() : (cur && cur.funder) || null, partner: String(c.partner || '').slice(0, 80), note: String(c.note || '').slice(0, 200), maxUses: Math.max(0, Math.floor(Number(c.maxUses) || 0)), expires: c.expires ? Number(new Date(c.expires)) || 0 : 0, active: c.active !== false && c.active !== 0 && c.active !== '0', created: cur ? cur.created : Date.now() });
return { ok: true, code: saved }; return { ok: true, code: saved };
} }
async function setActive(code, active) { const c = await impl().get(norm(code)); if (!c) return { error: 'No such code.' }; await impl().put(Object.assign(c, { active: !!active })); return { ok: true }; } async function setActive(code, active) { const c = await impl().get(norm(code)); if (!c) return { error: 'No such code.' }; await impl().put(Object.assign(c, { active: !!active })); return { ok: true }; }
@@ -65,8 +62,7 @@ async function setActive(code, active) { const c = await impl().get(norm(code));
async function check(code, email) { async function check(code, email) {
const k = norm(code); if (!k) return { error: 'Enter a promo code.' }; const k = norm(code); if (!k) return { error: 'Enter a promo code.' };
const c = await impl().get(k); if (!c || !c.active) return { error: 'That promo code is not valid.' }; const c = await impl().get(k); if (!c || !c.active) return { error: 'That promo code is not valid.' };
if (c.starts && nowMs() < c.starts) return { error: 'That promo code opens ' + new Date(c.starts).toLocaleString('en-US', { timeZone: 'America/Chicago', weekday: 'long', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) + ' Central.' }; if (c.expires && Date.now() > c.expires) return { error: 'That promo code has expired.' };
if (c.expires && nowMs() > c.expires) return { error: 'That promo code has expired.' };
if (email && await impl().redeemed(k, email)) return { error: 'You already used that promo code.' }; if (email && await impl().redeemed(k, email)) return { error: 'You already used that promo code.' };
if (c.maxUses && (await impl().uses(k)) >= c.maxUses) return { error: 'That promo code has been fully redeemed.' }; if (c.maxUses && (await impl().uses(k)) >= c.maxUses) return { error: 'That promo code has been fully redeemed.' };
return null; return null;
+10 -23
View File
@@ -1,13 +1,12 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="noindex,nofollow"> <meta name="robots" content="noindex,nofollow">
<title>Admin | InstantAdPay</title> <title>Admin | InstantAdPay</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261118rd"> <link rel="stylesheet" href="/assets/site.css?v=20260910h">
<style> <style>
.adm-table{width:100%;table-layout:auto} .adm-table{width:100%;table-layout:auto}
.adm-table th{cursor:pointer;user-select:none;white-space:nowrap} .adm-table th{cursor:pointer;user-select:none;white-space:nowrap}
@@ -25,10 +24,10 @@
.adm-table .act{white-space:nowrap} .adm-table .act{white-space:nowrap}
.adm-table .act button{margin-right:6px} .adm-table .act button{margin-right:6px}
.st{display:inline-block;border-radius:999px;padding:2px 9px;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase} .st{display:inline-block;border-radius:999px;padding:2px 9px;font-size:11.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.st.active{background:var(--mint-soft-2);color:var(--mint)} .st.active{background:rgba(67,232,195,.14);color:var(--mint)}
.st.paused{background:var(--amber-soft);color:var(--amber)} .st.paused{background:rgba(255,178,56,.14);color:var(--amber)}
.st.out{background:var(--muted-soft);color:var(--muted)} .st.out{background:rgba(255,255,255,.08);color:var(--muted)}
.house-tag{display:inline-block;border:1px solid var(--violet-line);color:var(--violet);border-radius:6px;padding:1px 6px;font-size:10.5px;font-weight:700;margin-left:6px;vertical-align:middle} .house-tag{display:inline-block;border:1px solid rgba(157,125,255,.5);color:var(--violet);border-radius:6px;padding:1px 6px;font-size:10.5px;font-weight:700;margin-left:6px;vertical-align:middle}
.adm-form p{margin:0 0 10px} .adm-form p{margin:0 0 10px}
.adm-form label.small{display:block;margin-bottom:4px} .adm-form label.small{display:block;margin-bottom:4px}
.trunc{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:bottom} .trunc{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:bottom}
@@ -36,7 +35,7 @@
.ph-chips{display:inline-flex;gap:6px;flex-wrap:wrap;margin-left:6px;vertical-align:middle} .ph-chips{display:inline-flex;gap:6px;flex-wrap:wrap;margin-left:6px;vertical-align:middle}
.ph-chips .chip-t{padding:2px 10px;font-size:11.5px;font-family:var(--mono);text-transform:none;letter-spacing:0;cursor:pointer;background:transparent} .ph-chips .chip-t{padding:2px 10px;font-size:11.5px;font-family:var(--mono);text-transform:none;letter-spacing:0;cursor:pointer;background:transparent}
.drip-steps{display:grid;gap:12px} .drip-steps{display:grid;gap:12px}
.drip-step{border:1px solid var(--line);border-radius:12px;padding:14px 16px;background:var(--ground-soft)} .drip-step{border:1px solid var(--line);border-radius:12px;padding:14px 16px;background:rgba(4,8,7,.4)}
.drip-step .ds-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:8px} .drip-step .ds-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
.drip-step .ds-n{font-family:var(--mono);font-size:12px;color:var(--mint);letter-spacing:.08em} .drip-step .ds-n{font-family:var(--mono);font-size:12px;color:var(--mint);letter-spacing:.08em}
.drip-step .ds-when{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)} .drip-step .ds-when{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
@@ -132,7 +131,6 @@
<button id="boBurger" aria-label="Menu" type="button">☰</button> <button id="boBurger" aria-label="Menu" type="button">☰</button>
<h2 id="boTitle" style="margin:0">Overview</h2> <h2 id="boTitle" style="margin:0">Overview</h2>
<span class="small muted" id="chainLine"></span> <span class="small muted" id="chainLine"></span>
<span class="seg theme-seg" id="boTheme" role="group" aria-label="Theme"><button type="button" data-theme="light" title="Light theme">Light</button><button type="button" data-theme="dark" title="Dark theme">Dark</button><button type="button" data-theme="auto" title="Follow the device">Auto</button></span>
</header> </header>
<main class="bo-content"> <main class="bo-content">
@@ -143,7 +141,6 @@
<div class="statx c-violet"><div><div class="nv" id="ovActive">0</div><div class="lb">Active campaigns</div><span class="chip flat" id="ovCampSub"></span></div></div> <div class="statx c-violet"><div><div class="nv" id="ovActive">0</div><div class="lb">Active campaigns</div><span class="chip flat" id="ovCampSub"></span></div></div>
<div class="statx c-amber"><div><div class="nv" id="ovReports">0</div><div class="lb">Open reports</div><span class="chip flat" id="ovBurnSub"></span></div></div> <div class="statx c-amber"><div><div class="nv" id="ovReports">0</div><div class="lb">Open reports</div><span class="chip flat" id="ovBurnSub"></span></div></div>
<div class="statx"><div><div class="nv" id="ovDrips">0</div><div class="lb">Follow-ups in flight</div><span class="chip flat" id="ovDripSub"></span></div></div> <div class="statx"><div><div class="nv" id="ovDrips">0</div><div class="lb">Follow-ups in flight</div><span class="chip flat" id="ovDripSub"></span></div></div>
<div class="statx c-cyan"><div><div class="nv" id="ovBix">0</div><div class="lb">BixPay partner links</div><span class="chip flat" id="ovBixSub"></span></div></div>
</div> </div>
<div class="grid c2" style="margin-top:16px"> <div class="grid c2" style="margin-top:16px">
<div class="card"> <div class="card">
@@ -270,7 +267,6 @@
<button type="button" class="btn small sec" data-mcact="sponsor">Set sponsor</button> <button type="button" class="btn small sec" data-mcact="sponsor">Set sponsor</button>
<button type="button" class="btn small sec" data-mcact="wallet">Swap main wallet</button> <button type="button" class="btn small sec" data-mcact="wallet">Swap main wallet</button>
<button type="button" class="btn small sec" data-mcact="credits">Grant credits</button> <button type="button" class="btn small sec" data-mcact="credits">Grant credits</button>
<button type="button" class="btn small sec" data-mcact="message">Message (inbox + email)</button>
<a class="btn small sec" id="mcWall" href="#" target="_blank" rel="noopener">Public wall</a> <a class="btn small sec" id="mcWall" href="#" target="_blank" rel="noopener">Public wall</a>
<button type="button" class="btn small sec" data-mcact="delete" style="margin-left:auto">Delete account</button> <button type="button" class="btn small sec" data-mcact="delete" style="margin-left:auto">Delete account</button>
</div> </div>
@@ -296,12 +292,6 @@
<p class="small muted">Sponsor = the token the account joined under (username, share code, or member #). Editing it re-points free referrals and future purchases. On-chain sponsorship is permanent once activated.</p> <p class="small muted">Sponsor = the token the account joined under (username, share code, or member #). Editing it re-points free referrals and future purchases. On-chain sponsorship is permanent once activated.</p>
<div class="tablewrap"><table class="adm-table" id="memTable"></table></div> <div class="tablewrap"><table class="adm-table" id="memTable"></table></div>
</div> </div>
<div class="card" id="spamCard">
<div class="card-head"><h3>Link-farm list</h3><span class="sub" id="spamSub">daily scan at 06:30 Central</span></div>
<p class="small muted">Free accounts (no package, no wallet) that carry a link plus a farm signal: a prohibited term in the profile, a sign-in that ended within 15 minutes of the sign-up, or no sponsor. Nothing is deleted on its own. Delete uses the normal member delete (on-chain members are refused) and never touches LinkSpin; the "also on LinkSpin" column is there so you can decide. Allow keeps an email off this list for good.</p>
<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0 0 10px"><button class="btn small" id="spamRun" type="button">Scan now</button><button class="btn small sec" id="spamDelete" type="button">Delete selected</button><span class="small muted" id="spamAllow"></span></p>
<div class="tablewrap"><table class="adm-table" id="spamTable"></table></div>
</div>
</div> </div>
<div class="pane" id="pane-support" hidden> <div class="pane" id="pane-support" hidden>
@@ -367,9 +357,6 @@
<div class="pane" id="pane-traffic" hidden> <div class="pane" id="pane-traffic" hidden>
<div class="card"><div class="card-head"><h3>Games to members</h3><span class="sub" id="stSub">the $5 welcome offer after a game win</span></div><div class="tablewrap"><table class="adm-table" id="trfStarter"></table></div></div> <div class="card"><div class="card-head"><h3>Games to members</h3><span class="sub" id="stSub">the $5 welcome offer after a game win</span></div><div class="tablewrap"><table class="adm-table" id="trfStarter"></table></div></div>
<div class="card"><div class="card-head"><h3>Login-ad showings</h3><span class="sub" id="lsSub">sign-in interstitials per day, dashboard vs games</span></div><div class="tablewrap"><table class="adm-table" id="trfLogin"></table></div></div> <div class="card"><div class="card-head"><h3>Login-ad showings</h3><span class="sub" id="lsSub">sign-in interstitials per day, dashboard vs games</span></div><div class="tablewrap"><table class="adm-table" id="trfLogin"></table></div></div>
<div class="card" id="trfBixCard"><div class="card-head"><h3>BixPay clicks</h3><span class="sub" id="bixSub">taps on "Get your BixPay card" by surface (the range picked below)</span></div>
<p class="muted small" style="margin:0 0 10px">Every BixPay button and banner goes through /go/bixpay, which counts the tap and opens the member's resolved partner link (own, else a sponsor's, else the network link). Sign-ups are not counted here: the BIX portal shows each partner their directs and levels.</p>
<div class="grid c2"><div class="tablewrap"><table class="adm-table" id="trfBix"></table></div><div class="tablewrap"><table class="adm-table" id="trfBixMembers"></table></div></div></div>
<div class="card"> <div class="card">
<div class="card-head"><h3>Where visitors come from</h3><span class="sub" id="trfSub"></span></div> <div class="card-head"><h3>Where visitors come from</h3><span class="sub" id="trfSub"></span></div>
<div class="chips" id="trfRange" style="margin:0 0 10px"><button type="button" class="chip-t" data-days="7">7 days</button><button type="button" class="chip-t on" data-days="30">30 days</button><button type="button" class="chip-t" data-days="90">90 days</button><button type="button" class="chip-t" data-days="365">Year</button></div> <div class="chips" id="trfRange" style="margin:0 0 10px"><button type="button" class="chip-t" data-days="7">7 days</button><button type="button" class="chip-t on" data-days="30">30 days</button><button type="button" class="chip-t" data-days="90">90 days</button><button type="button" class="chip-t" data-days="365">Year</button></div>
@@ -493,7 +480,7 @@
<label class="small">Closing (after the notes, e.g. your sign-off)<textarea id="updClosing" rows="2" style="width:100%" placeholder="See you Monday.&#10;&#10;Marty"></textarea></label> <label class="small">Closing (after the notes, e.g. your sign-off)<textarea id="updClosing" rows="2" style="width:100%" placeholder="See you Monday.&#10;&#10;Marty"></textarea></label>
<label class="small">Audience<select id="updAudience"></select></label> <label class="small">Audience<select id="updAudience"></select></label>
<div style="display:flex;gap:8px;flex-wrap:wrap"><button type="button" class="btn small sec" id="updSaveDraft">Save draft</button><button type="button" class="btn small sec" id="updPreview">Preview</button><button type="button" class="btn small sec" id="updTest">Send test to me</button><button type="button" class="btn small" id="updSend">Send</button></div> <div style="display:flex;gap:8px;flex-wrap:wrap"><button type="button" class="btn small sec" id="updSaveDraft">Save draft</button><button type="button" class="btn small sec" id="updPreview">Preview</button><button type="button" class="btn small sec" id="updTest">Send test to me</button><button type="button" class="btn small" id="updSend">Send</button></div>
<pre id="updPre" class="small" hidden style="white-space:pre-wrap;background:var(--ink-faint);border:1px solid var(--line);border-radius:10px;padding:10px;max-height:320px;overflow:auto"></pre> <pre id="updPre" class="small" hidden style="white-space:pre-wrap;background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:10px;padding:10px;max-height:320px;overflow:auto"></pre>
</div> </div>
<div> <div>
<div class="small muted" style="margin:0 0 6px">Release notes to include (newest first; notes since your last send are pre-ticked)</div> <div class="small muted" style="margin:0 0 6px">Release notes to include (newest first; notes since your last send are pre-ticked)</div>
@@ -652,8 +639,8 @@
</div> </div>
</div> </div>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/welcome.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/admin-kb.js?v=20261020kb"></script> <script src="/assets/admin-kb.js?v=20261020kb"></script>
<script src="/assets/tankready.js?v=20261118rd"></script><script src="/assets/admin.js?v=20261120tx"></script><script src="/assets/admin-sponsorcheck.js?v=20261107tg"></script><script src="/assets/admin-kits.js?v=20261101th"></script> <script src="/assets/admin.js?v=20261027nr"></script><script src="/assets/admin-sponsorcheck.js?v=20261022sc"></script><script src="/assets/admin-kits.js?v=20261024kit"></script>
</body> </body>
</html> </html>
+1 -1
View File
@@ -34,7 +34,7 @@
$('kitPlaceholder').addEventListener('click', async () => { try { const r = await post('/api/admin/kits/placeholder', { month: $('kitMonth').value.trim() }); say('placeholder art: ' + r.sizes.join(', ')); load(); } catch (e) { say(e.message); } }); $('kitPlaceholder').addEventListener('click', async () => { try { const r = await post('/api/admin/kits/placeholder', { month: $('kitMonth').value.trim() }); say('placeholder art: ' + r.sizes.join(', ')); load(); } catch (e) { say(e.message); } });
$('kitPreview').addEventListener('click', () => { $('kitPreview').addEventListener('click', () => {
const q = 'month=' + encodeURIComponent($('kitMonth').value.trim()) + '&size=' + encodeURIComponent($('kitPrevSize').value) + '&username=' + encodeURIComponent($('kitPrevName').value || 'yourname') + ($('kitPrevGif').checked ? '&variant=gif' : '') + '&t=' + Date.now(); const q = 'month=' + encodeURIComponent($('kitMonth').value.trim()) + '&size=' + encodeURIComponent($('kitPrevSize').value) + '&username=' + encodeURIComponent($('kitPrevName').value || 'yourname') + ($('kitPrevGif').checked ? '&variant=gif' : '') + '&t=' + Date.now();
$('kitPrevBox').innerHTML = '<img alt="preview" style="max-width:100%;border:1px solid var(--line-strong)" src="/api/admin/kits/preview?' + q + '">'; $('kitPrevBox').innerHTML = '<img alt="preview" style="max-width:100%;border:1px solid #ccd" src="/api/admin/kits/preview?' + q + '">';
}); });
load(); load();
})(); })();
+1 -1
View File
@@ -8,7 +8,7 @@
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c])); const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
const day = ts => ts ? new Date(Number(ts)).toLocaleString([], { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : ''; const day = ts => ts ? new Date(Number(ts)).toLocaleString([], { year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : '';
const say = (m, k) => { try { IAP.status(m, k); } catch (e) {} }; const say = (m, k) => { try { IAP.status(m, k); } catch (e) {} };
const HOW = { adopt: 'adopted from the tank', rescue: 'rescued to the tank', release: 'released to the tank', expire: 'adoption window ended', admin: 'admin edit', invited: 'the member named who invited them' }; const HOW = { adopt: 'adopted from the tank', rescue: 'rescued to the tank', release: 'released to the tank', expire: 'adoption window ended', admin: 'admin edit' };
const NAME = { instantadpay: 'InstantAdPay', linkspin: 'LinkSpin' }; const NAME = { instantadpay: 'InstantAdPay', linkspin: 'LinkSpin' };
function side(f) { function side(f) {
if (!f) return '<span class="muted">no account</span>'; if (!f) return '<span class="muted">no account</span>';
+13 -93
View File
@@ -91,7 +91,6 @@
const f = o.followups || {}; const f = o.followups || {};
$('ovDrips').textContent = f.active || 0; $('ovDrips').textContent = f.active || 0;
$('ovDripSub').textContent = (f.done || 0) + ' finished · ' + (f.unsubscribed || 0) + ' unsubscribed'; $('ovDripSub').textContent = (f.done || 0) + ' finished · ' + (f.unsubscribed || 0) + ' unsubscribed';
if ($('ovBix')) { $('ovBix').textContent = Number(o.bixLinks || 0).toLocaleString(); $('ovBixSub').textContent = o.bixpayLive ? 'members with their own link · live' : 'members with their own link · bixpayLive is off'; } // BixPay (2026-10-29)
const bt = Object.entries(o.byType || {}).sort((a, b) => b[1] - a[1]); const bt = Object.entries(o.byType || {}).sort((a, b) => b[1] - a[1]);
$('ovByType').innerHTML = bt.length ? bt.map(([t, n]) => '<div style="display:flex;justify-content:space-between;padding:4px 0;border-bottom:1px solid var(--line)"><span>' + esc(t) + '</span><b>' + n + '</b></div>').join('') : 'No campaigns yet.'; $('ovByType').innerHTML = bt.length ? bt.map(([t, n]) => '<div style="display:flex;justify-content:space-between;padding:4px 0;border-bottom:1px solid var(--line)"><span>' + esc(t) + '</span><b>' + n + '</b></div>').join('') : 'No campaigns yet.';
const ch = o.chain || {}; const ch = o.chain || {};
@@ -299,20 +298,13 @@
$('tankAdmSub').textContent = r.waiting.length + ' waiting' + (nReady ? ' (' + nReady + ' ready to activate)' : '') + ' · cap ' + r.cap + ' open per adopter · ' + r.ttlDays + '-day window · ready members held ' + (r.holdHours || 24) + ' h, then auto-assigned in rotation'; $('tankAdmSub').textContent = r.waiting.length + ' waiting' + (nReady ? ' (' + nReady + ' ready to activate)' : '') + ' · cap ' + r.cap + ' open per adopter · ' + r.ttlDays + '-day window · ready members held ' + (r.holdHours || 24) + ' h, then auto-assigned in rotation';
// ready = wallet linked: activation is held (never the company) until someone adopts them or the 24-hour safety net assigns them (2026-10-27) // ready = wallet linked: activation is held (never the company) until someone adopts them or the 24-hour safety net assigns them (2026-10-27)
const left = w => { const ms = (w.holdUntil || 0) - Date.now(); if (ms <= 0) return 'assigning now'; const m = Math.round(ms / 60000); return (m >= 60 ? Math.floor(m / 60) + ' h ' + (m % 60) + ' min' : m + ' min') + ' left'; }; const left = w => { const ms = (w.holdUntil || 0) - Date.now(); if (ms <= 0) return 'assigning now'; const m = Math.round(ms / 60000); return (m >= 60 ? Math.floor(m / 60) + ' h ' + (m % 60) + ' min' : m + ' min') + ' left'; };
const rb = w => (w.opensAt > Date.now() ? ' <span class="badge amber" title="New sign-up: hand adoption opens 24 hours after they joined">Opens ' + when(w.opensAt) + '</span>' : '') + (w.ready ? ' <span class="badge" style="background:var(--ok-soft);border-color:var(--ok);color:var(--ok)">Ready to activate · ' + left(w) + '</span>' : ''); const rb = w => w.ready ? ' <span class="badge" style="background:rgba(34,197,94,.15);border-color:#22c55e;color:#22c55e">Ready to activate · ' + left(w) + '</span>' : '';
// readiness (2026-11-18, network hub): hottest first, stage + heat + last action + how they got here; the hub down = the old table $('tankWait').innerHTML = '<tr><th>Waiting</th><th>Email</th><th>Joined</th><th>Last sign-in</th></tr>' + (r.waiting.length ? r.waiting.map(w => '<tr><td>' + esc(w.name) + rb(w) + '</td><td>' + esc(w.email) + '</td><td class="when">' + when(w.joined) + '</td><td class="when">' + (w.lastSeen ? when(w.lastSeen) : '<span class="muted">never</span>') + '</td></tr>').join('') : '<tr><td colspan="4" class="muted">empty</td></tr>')
const RD = window.TankReady; const rdOn = RD && r.waiting.some(w => w.rd);
const wl = rdOn ? r.waiting.slice().sort((a, b) => RD.score(b) - RD.score(a)) : r.waiting;
const rs = r.readiness || {}; const rc = rs.counts || {}; const cnt = o => Object.entries(o || {}).sort((a, b) => b[1] - a[1]).map(([k, v]) => k + ' ' + v).join(', ');
$('tankAdmSub').textContent += rs.on ? (rs.ok === false ? ' · readiness: hub not answering (' + (rs.error || '') + ')' : rc.n ? ' · readiness: how they got here ' + cnt(rc.reasons) + ' · stages ' + cnt(rc.stages) + ' · heat ' + cnt(rc.bands) : ' · readiness: loading') : ' · readiness off';
const cols = rdOn ? 5 : 4;
$('tankWait').innerHTML = '<tr><th>Waiting</th><th>Email</th><th>Joined</th><th>Last sign-in</th>' + (rdOn ? '<th>Readiness (hottest first)</th>' : '') + '</tr>' + (wl.length ? wl.map(w => '<tr><td>' + esc(w.name) + rb(w) + '</td><td>' + esc(w.email) + '</td><td class="when">' + when(w.joined) + '</td><td class="when">' + (w.lastSeen ? when(w.lastSeen) : '<span class="muted">never</span>') + '</td>' + (rdOn ? '<td>' + (w.rd ? RD.html(w.rd) : '<span class="muted small">no answer</span>') + '</td>' : '') + '</tr>').join('') : '<tr><td colspan="' + cols + '" class="muted">empty</td></tr>')
+ ((r.aligned || []).length ? '<tr><th colspan="4">Aligned to their network sponsor (LinkSpin) instead of the tank</th></tr>' + r.aligned.slice(0, 15).map(x => '<tr><td>' + esc(x.email) + '</td><td>' + esc(x.toName || x.to) + '</td><td class="when">' + when(x.at) + '</td><td class="muted">' + esc(x.via || '') + '</td></tr>').join('') : ''); + ((r.aligned || []).length ? '<tr><th colspan="4">Aligned to their network sponsor (LinkSpin) instead of the tank</th></tr>' + r.aligned.slice(0, 15).map(x => '<tr><td>' + esc(x.email) + '</td><td>' + esc(x.toName || x.to) + '</td><td class="when">' + when(x.at) + '</td><td class="muted">' + esc(x.via || '') + '</td></tr>').join('') : '');
$('tankAdopt').innerHTML = '<tr><th>Member</th><th>Adopted by</th><th>When</th><th>Window ends</th><th>Status</th></tr>' + (r.adoptions.length ? r.adoptions.map(a => '<tr><td>' + esc(a.adopteeName) + '</td><td>' + esc(a.adopterName) + '</td><td class="when">' + when(a.ts) + '</td><td class="when">' + (a.status === 'released' || a.status === 'invited' ? '' : when(a.expires)) + '</td><td>' + esc(a.status) + '</td></tr>').join('') : '<tr><td colspan="5" class="muted">none yet</td></tr>'); $('tankAdopt').innerHTML = '<tr><th>Member</th><th>Adopted by</th><th>When</th><th>Window ends</th><th>Status</th></tr>' + (r.adoptions.length ? r.adoptions.map(a => '<tr><td>' + esc(a.adopteeName) + '</td><td>' + esc(a.adopterName) + '</td><td class="when">' + when(a.ts) + '</td><td class="when">' + (a.status === 'released' ? '' : when(a.expires)) + '</td><td>' + esc(a.status) + '</td></tr>').join('') : '<tr><td colspan="5" class="muted">none yet</td></tr>');
} catch (e) {} } catch (e) {}
} }
async function loadMembers() { async function loadMembers() {
loadSpamScan().catch(() => {});
loadTank(); loadFraud(); loadTank(); loadFraud();
const r = await api('/api/admin/members'); const r = await api('/api/admin/members');
allMembers = r.members || []; allMembers = r.members || [];
@@ -331,31 +323,6 @@
+ '<td class="act"><button class="btn small sec" data-mcopen="' + esc(a.email) + '">Open</button> <button class="btn small sec" data-susp="' + esc(a.email) + '" data-on="' + (a.suspended ? '1' : '0') + '">' + (a.suspended ? 'Unsuspend' : 'Suspend') + '</button> <button class="btn small sec" data-spon="' + esc(a.email) + '" data-cur="' + esc(a.sponsorRef || '') + '">Sponsor</button></td></tr>').join(''); + '<td class="act"><button class="btn small sec" data-mcopen="' + esc(a.email) + '">Open</button> <button class="btn small sec" data-susp="' + esc(a.email) + '" data-on="' + (a.suspended ? '1' : '0') + '">' + (a.suspended ? 'Unsuspend' : 'Suspend') + '</button> <button class="btn small sec" data-spon="' + esc(a.email) + '" data-cur="' + esc(a.sponsorRef || '') + '">Sponsor</button></td></tr>').join('');
} }
$('memFilter').addEventListener('input', drawMembers); $('memFilter').addEventListener('input', drawMembers);
// Link-farm list (2026-10-30): the daily scan's candidates; Delete selected = one DELETE /api/admin/member per email (on-chain refused); Allow = spamScanAllow
async function loadSpamScan() {
let v; try { v = await api('/api/admin/spamscan'); } catch (e) { return; }
const last = v.last || {}; const rows = last.candidates || [];
$('spamSub').textContent = last.at ? (rows.length + ' candidate' + (rows.length === 1 ? '' : 's') + ' \u00B7 scanned ' + when(last.at) + (last.manual ? ' (manual)' : '') + ' \u00B7 ' + (last.scanned || 0) + ' accounts, ' + (last.skipped || 0) + ' allowlisted') : 'no scan yet (daily at 06:30 Central)';
$('spamAllow').textContent = 'Allowlist: ' + ((v.allow || []).join(', ') || 'empty');
$('spamTable').innerHTML = '<tr><th></th><th>Account</th><th>Joined</th><th>Sponsor</th><th>First link</th><th>Why</th><th>Also on ' + esc(v.otherSite || 'the other site') + '</th><th></th></tr>'
+ (rows.length ? rows.map(c => '<tr><td><input type="checkbox" data-spamsel="' + esc(c.email) + '"></td><td>' + (c.username ? '<b>@' + esc(c.username) + '</b><br>' : '') + '<span class="small">' + esc(c.email) + '</span>' + (c.quarantined ? ' <span class="badge amber">quarantined</span>' : '') + '</td>'
+ '<td class="small muted when">' + when(c.created) + '</td><td class="small">' + esc(c.sponsorName || 'none') + '</td><td class="small mono" style="max-width:260px;overflow:hidden;text-overflow:ellipsis" title="' + esc((c.links || []).join(' ')) + '">' + esc(c.firstLink || '') + '</td>'
+ '<td class="small">' + esc((c.reasons || []).join(', ')) + '</td><td class="small">' + (c.alsoOn === true ? 'yes' : c.alsoOn === false ? 'no' : 'unknown') + '</td>'
+ '<td class="act"><button class="btn small sec" data-mcopen="' + esc(c.email) + '">Open</button> <button class="btn small sec" data-spamallow="' + esc(c.email) + '">Allow</button></td></tr>').join('') : '<tr><td colspan="8" class="muted small">Nothing to review.</td></tr>');
}
$('spamRun').addEventListener('click', busy($('spamRun'), async () => { await api('/api/admin/spamscan/run', {}); await loadSpamScan(); IAP.status('Scan done.', 'ok'); }));
$('spamDelete').addEventListener('click', busy($('spamDelete'), async () => {
const sel = [...document.querySelectorAll('[data-spamsel]:checked')].map(x => x.dataset.spamsel);
if (!sel.length) { IAP.status('Tick the accounts to delete first.', 'bad'); return; }
if (!await IAP.confirmBox('Delete ' + sel.length + ' account' + (sel.length === 1 ? '' : 's') + ' with their profile text? On-chain members are refused. LinkSpin is not touched.', { title: 'Delete selected', ok: 'Delete', cancel: 'Cancel' })) return;
let ok = 0, bad = 0; for (const e of sel) { try { await api('/api/admin/member?email=' + encodeURIComponent(e), undefined, 'DELETE'); ok++; } catch (err) { bad++; } }
IAP.status(ok + ' deleted' + (bad ? ', ' + bad + ' refused' : '') + '.', bad ? 'bad' : 'ok');
await api('/api/admin/spamscan/run', {}).catch(() => {}); await loadSpamScan(); loadMembers().catch(() => {});
}));
document.addEventListener('click', async e => {
const b = e.target.closest('[data-spamallow]'); if (!b) return;
try { await api('/api/admin/spamscan/allow', { email: b.dataset.spamallow }); IAP.status('Allowed ' + b.dataset.spamallow + '.', 'ok'); await api('/api/admin/spamscan/run', {}).catch(() => {}); loadSpamScan(); } catch (err) { IAP.status(err.message, 'bad'); }
});
document.addEventListener('click', async e => { document.addEventListener('click', async e => {
const b = e.target.closest('[data-susp]'); if (!b) return; const b = e.target.closest('[data-susp]'); if (!b) return;
const on = b.dataset.on === '1'; const on = b.dataset.on === '1';
@@ -436,7 +403,7 @@
mcCur = d; const a = d.account; $('memHits').hidden = true; mcCur = d; const a = d.account; $('memHits').hidden = true;
$('memCard').hidden = false; document.querySelectorAll('#pane-members > .card').forEach(c => { if (c.id !== 'memCard' && c.id !== 'memSearchCard') c.hidden = true; }); $('memCard').hidden = false; document.querySelectorAll('#pane-members > .card').forEach(c => { if (c.id !== 'memCard' && c.id !== 'memSearchCard') c.hidden = true; });
$('mcName').textContent = (a.username ? '@' + a.username : a.email) + (a.memberId ? ' · member #' + a.memberId : ' · free member'); $('mcName').textContent = (a.username ? '@' + a.username : a.email) + (a.memberId ? ' · member #' + a.memberId : ' · free member');
$('mcSub').textContent = 'joined ' + when(a.created) + ' · last seen ' + ago(a.lastSeen) + (a.profileQuarantined ? ' · PROFILE QUARANTINED (link planted on a brand-new free account; not shown publicly)' : ''); $('mcSub').textContent = 'joined ' + when(a.created) + ' · last seen ' + ago(a.lastSeen);
$('mcWall').hidden = !a.username; if (a.username) $('mcWall').href = '/wall/' + a.username; $('mcWall').hidden = !a.username; if (a.username) $('mcWall').href = '/wall/' + a.username;
const ch = d.chain, cr = d.credits, t = d.totals; const ch = d.chain, cr = d.credits, t = d.totals;
const level = ch && !ch.readError ? (ch.buyerCount >= 5 ? 'level 3 (5+ buyers)' : ch.buyerCount >= 2 ? 'level 2 (2 buyers)' : 'level 1') : ''; const level = ch && !ch.readError ? (ch.buyerCount >= 5 ? 'level 3 (5+ buyers)' : ch.buyerCount >= 2 ? 'level 2 (2 buyers)' : 'level 1') : '';
@@ -458,7 +425,6 @@
['Upline chain', d.upline.length > 1 ? d.upline.map(u => memLink(u.email, u.name)).join(' &rarr; ') : '<span class="muted">-</span>'], ['Upline chain', d.upline.length > 1 ? d.upline.map(u => memLink(u.email, u.name)).join(' &rarr; ') : '<span class="muted">-</span>'],
['Joined via', esc(a.joinedVia || 'join page') + (a.joinedRef ? ' from ' + esc(a.joinedRef) : '')], ['Joined via', esc(a.joinedVia || 'join page') + (a.joinedRef ? ' from ' + esc(a.joinedRef) : '')],
['Line banner', a.lineTargetUrl ? '<a href="' + esc(a.lineTargetUrl) + '" target="_blank" rel="noopener">' + esc(a.lineTargetUrl.slice(0, 50)) + '</a>' : '<span class="muted">not set</span>'], ['Line banner', a.lineTargetUrl ? '<a href="' + esc(a.lineTargetUrl) + '" target="_blank" rel="noopener">' + esc(a.lineTargetUrl.slice(0, 50)) + '</a>' : '<span class="muted">not set</span>'],
['BixPay partner link', a.bixPartnerLink ? '<span class="mono small" style="overflow-wrap:anywhere">' + esc(a.bixPartnerLink) + '</span>' : '<span class="muted">not set (pages use a sponsor’s link or the network link)</span>'],
['Chat', a.chatAvailable ? 'available' : 'switched off']]) + '</div>'; ['Chat', a.chatAvailable ? 'available' : 'switched off']]) + '</div>';
h += '<div><h4 style="margin:0 0 6px">On-chain and money</h4>' + kv([ h += '<div><h4 style="margin:0 0 6px">On-chain and money</h4>' + kv([
// Say WHICH of the two "not registered" states this is, and what it costs them, so the row // Say WHICH of the two "not registered" states this is, and what it costs them, so the row
@@ -509,11 +475,11 @@
let h = '<h4 style="margin:18px 0 6px">Payment trace</h4><p class="small muted" style="margin:0 0 6px">' + r.buyersNow + ' qualifying buyer' + (r.buyersNow === 1 ? '' : 's') + ' · every purchase this member was part of, newest first.</p>'; let h = '<h4 style="margin:18px 0 6px">Payment trace</h4><p class="small muted" style="margin:0 0 6px">' + r.buyersNow + ' qualifying buyer' + (r.buyersNow === 1 ? '' : 's') + ' · every purchase this member was part of, newest first.</p>';
if (!r.purchases.length) h += '<p class="small muted">No purchases involving them yet.</p>'; if (!r.purchases.length) h += '<p class="small muted">No purchases involving them yet.</p>';
for (const p of r.purchases) { for (const p of r.purchases) {
h += '<div style="border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin:0 0 6px"><div class="small"><b>' + when(p.ts) + '</b> · ' + nm(p.buyerId) + ' bought $' + (p.priceCents / 100).toFixed(0) + ' (' + polOf(p.paidWei) + ' POL)' + (p.sponsorId ? ' · sponsor ' + nm(p.sponsorId) : '') + ' · <span class="muted">' + esc(p.tx.slice(0, 12)) + '…</span></div>'; h += '<div style="border:1px solid rgba(255,255,255,.1);border-radius:8px;padding:8px 10px;margin:0 0 6px"><div class="small"><b>' + when(p.ts) + '</b> · ' + nm(p.buyerId) + ' bought $' + (p.priceCents / 100).toFixed(0) + ' (' + polOf(p.paidWei) + ' POL)' + (p.sponsorId ? ' · sponsor ' + nm(p.sponsorId) : '') + ' · <span class="muted">' + esc(p.tx.slice(0, 12)) + '…</span></div>';
for (const t of p.tiers) { for (const t of p.tiers) {
let line = '<b>L' + t.tier + ' ' + t.pct + '%</b>: '; let line = '<b>L' + t.tier + ' ' + t.pct + '%</b>: ';
for (const x of t.skipped) line += '<span style="color:var(--warn)">' + nm(x.id) + ' skipped (' + (x.reason === 'unqualified' ? 'had ' + x.buyersThen + ' of ' + (t.tier === 2 ? 2 : 5) + ' buyers then' : esc(x.reason)) + ')</span> → '; for (const x of t.skipped) line += '<span style="color:#f0a742">' + nm(x.id) + ' skipped (' + (x.reason === 'unqualified' ? 'had ' + x.buyersThen + ' of ' + (t.tier === 2 ? 2 : 5) + ' buyers then' : esc(x.reason)) + ')</span> → ';
line += t.paidTo ? '<span style="color:' + (t.paidTo === mid ? 'var(--ok)' : 'inherit') + '">' + nm(t.paidTo) + ' ' + polOf(t.amountWei) + ' POL</span>' : '<span class="muted">no catcher → company</span>'; line += t.paidTo ? '<span style="color:' + (t.paidTo === mid ? '#3ecf7a' : 'inherit') + '">' + nm(t.paidTo) + ' ' + polOf(t.amountWei) + ' POL</span>' : '<span class="muted">no catcher → company</span>';
h += '<div class="small" style="margin-top:3px">' + line + '</div>'; h += '<div class="small" style="margin-top:3px">' + line + '</div>';
} }
h += '<div class="small muted" style="margin-top:3px">platform ' + polOf(p.adminWei) + ' POL</div></div>'; h += '<div class="small muted" style="margin-top:3px">platform ' + polOf(p.adminWei) + ' POL</div></div>';
@@ -550,14 +516,6 @@
if (act === 'sponsor') { const v = await IAP.ask({ title: 'Sponsor for ' + (a.username ? '@' + a.username : a.email), text: 'Username, share code or member #. Blank = no sponsor (company). Re-points free referrals and future purchases; on-chain sponsorship never changes.', value: a.sponsorRef || '', ok: 'Save' }); if (v === null || v === undefined) return; body = { sponsorRef: v }; } if (act === 'sponsor') { const v = await IAP.ask({ title: 'Sponsor for ' + (a.username ? '@' + a.username : a.email), text: 'Username, share code or member #. Blank = no sponsor (company). Re-points free referrals and future purchases; on-chain sponsorship never changes.', value: a.sponsorRef || '', ok: 'Save' }); if (v === null || v === undefined) return; body = { sponsorRef: v }; }
if (act === 'wallet') { const v = await IAP.ask({ title: 'Main wallet for ' + a.email, text: 'Paste the 0x address that should be their main wallet (the one that paid, if a purchase came from an unlinked account). The member number is re-read from the chain. Blank = unlink.', value: a.address || '', ok: 'Swap' }); if (v === null || v === undefined) return; if (!await IAP.confirmBox('Swap the main wallet for ' + a.email + ' to ' + (v.trim() || 'nothing') + '?', { title: 'Sure?', ok: 'Swap it', cancel: 'Cancel' })) return; body = { address: v }; } if (act === 'wallet') { const v = await IAP.ask({ title: 'Main wallet for ' + a.email, text: 'Paste the 0x address that should be their main wallet (the one that paid, if a purchase came from an unlinked account). The member number is re-read from the chain. Blank = unlink.', value: a.address || '', ok: 'Swap' }); if (v === null || v === undefined) return; if (!await IAP.confirmBox('Swap the main wallet for ' + a.email + ' to ' + (v.trim() || 'nothing') + '?', { title: 'Sure?', ok: 'Swap it', cancel: 'Cancel' })) return; body = { address: v }; }
if (act === 'credits') { const v = await IAP.ask({ title: 'Grant credits to ' + (a.username ? '@' + a.username : a.email), text: 'Whole number of earned-pool credits (1 credit = 1 cent of delivery). They can spend them on campaigns right away.', type: 'number', value: '', placeholder: '250', ok: 'Grant' }); if (!v) return; const note = await IAP.ask({ title: 'Reason (kept in the server log)', value: '', placeholder: 'e.g. refund for broken banner', ok: 'Grant' }); body = { grantCredits: v, note: note || '' }; } if (act === 'credits') { const v = await IAP.ask({ title: 'Grant credits to ' + (a.username ? '@' + a.username : a.email), text: 'Whole number of earned-pool credits (1 credit = 1 cent of delivery). They can spend them on campaigns right away.', type: 'number', value: '', placeholder: '250', ok: 'Grant' }); if (!v) return; const note = await IAP.ask({ title: 'Reason (kept in the server log)', value: '', placeholder: 'e.g. refund for broken banner', ok: 'Grant' }); body = { grantCredits: v, note: note || '' }; }
// message the member (Marty 2026-11-12): lands in their member inbox AND emails them (opt-outs honoured by the mailer)
if (act === 'message') {
const who = a.username ? '@' + a.username : a.email;
const subject = await IAP.ask({ title: 'Message ' + who, text: 'Subject line. The message goes to their member inbox and is emailed to them (unless they unsubscribed from email).', value: '', placeholder: 'A quick note from Marty', ok: 'Next' }); if (!subject) return;
const text = await IAP.ask({ title: subject, text: 'Your message. Plain text; blank lines start new paragraphs.', type: 'textarea', value: '', ok: 'Send' }); if (!text || !text.trim()) return;
const r = await api('/api/admin/member/message', { email: a.email, subject, text }, 'POST');
IAP.status('Sent to ' + who + "'s inbox" + (r.emailed ? ' and emailed.' : r.emailSkipped ? '. Email skipped: ' + r.emailSkipped + '.' : '.'), r.emailed ? 'ok' : 'warn'); return;
}
if (act === 'delete') { if (act === 'delete') {
if (a.memberId) { IAP.status('Registered members cannot be deleted; their position is on-chain.', 'bad'); return; } if (a.memberId) { IAP.status('Registered members cannot be deleted; their position is on-chain.', 'bad'); return; }
if (!await IAP.confirmBox('Delete the free account ' + a.email + '? Their sign-in, referrals link and credits go away. There is no undo.', { title: 'Delete account', ok: 'Delete', cancel: 'Keep it' })) return; if (!await IAP.confirmBox('Delete the free account ' + a.email + '? Their sign-in, referrals link and credits go away. There is no undo.', { title: 'Delete account', ok: 'Delete', cancel: 'Keep it' })) return;
@@ -665,7 +623,7 @@
const r = await api('/api/admin/promos', { code: $('pcCode').value, credits: $('pcCredits').value, partner: $('pcPartner').value, maxUses: $('pcMax').value, expires: $('pcExpires').value || null, active: true }); const r = await api('/api/admin/promos', { code: $('pcCode').value, credits: $('pcCredits').value, partner: $('pcPartner').value, maxUses: $('pcMax').value, expires: $('pcExpires').value || null, active: true });
msg.textContent = 'Saved ' + r.code.code + ': ' + r.code.credits + ' credits.'; msg.style.color = 'var(--mint)'; msg.textContent = 'Saved ' + r.code.code + ': ' + r.code.credits + ' credits.'; msg.style.color = 'var(--mint)';
$('pcCode').value = ''; $('pcCredits').value = ''; $('pcPartner').value = ''; loadPromos(); $('pcCode').value = ''; $('pcCredits').value = ''; $('pcPartner').value = ''; loadPromos();
} catch (e) { msg.textContent = e.message; msg.style.color = 'var(--bad)'; } } catch (e) { msg.textContent = e.message; msg.style.color = '#ff8a8a'; }
}); });
async function loadTraffic() { async function loadTraffic() {
loadPromos().catch(e => IAP.status(e.message, 'bad')); loadPromos().catch(e => IAP.status(e.message, 'bad'));
@@ -685,12 +643,6 @@
$('stSub').textContent = (st.settings.on ? 'on' : 'off') + ' · welcome bonus ' + st.settings.bonus + ' credits · ' + st.granted + ' granted'; $('stSub').textContent = (st.settings.on ? 'on' : 'off') + ' · welcome bonus ' + st.settings.bonus + ' credits · ' + st.granted + ' granted';
$('trfStarter').innerHTML = '<tr><th>Game</th><th>Offer taps</th><th>First packages</th><th>Package $</th><th>Tap &rarr; buy</th></tr>' + rows.map(g => '<tr><td>' + esc(g.name) + '</td><td>' + n(g.visits) + '</td><td>' + n(g.buyers) + '</td><td>$' + g.usd.toFixed(2) + '</td><td>' + pct(g.buyers, g.visits) + '</td></tr>').join(''); } $('trfStarter').innerHTML = '<tr><th>Game</th><th>Offer taps</th><th>First packages</th><th>Package $</th><th>Tap &rarr; buy</th></tr>' + rows.map(g => '<tr><td>' + esc(g.name) + '</td><td>' + n(g.visits) + '</td><td>' + n(g.buyers) + '</td><td>$' + g.usd.toFixed(2) + '</td><td>' + pct(g.buyers, g.visits) + '</td></tr>').join(''); }
$('trfPaths').innerHTML = '<tr><th>Page</th><th>Views</th></tr>' + (d.paths.length ? d.paths.map(p => '<tr><td>' + esc(p.path) + '</td><td>' + n(p.hits) + '</td></tr>').join('') : '<tr><td colspan="2" class="muted">No page views yet.</td></tr>'); $('trfPaths').innerHTML = '<tr><th>Page</th><th>Views</th></tr>' + (d.paths.length ? d.paths.map(p => '<tr><td>' + esc(p.path) + '</td><td>' + n(p.hits) + '</td></tr>').join('') : '<tr><td colspan="2" class="muted">No page views yet.</td></tr>');
// BixPay clicks by surface + per member (2026-10-29)
if (d.bixpay && $('trfBix')) { const bx = d.bixpay, LBL = { wallet: 'Wallet tab card', overview: 'Overview card', email: 'Payout emails', nudge: 'Game wallet nudges', promo: 'Promo tools (members’ posts and banners)', guide: '/bixpay guide', chat: 'Chatbot', other: 'Other' };
$('bixSub').textContent = 'last ' + bx.days + ' days: ' + n(bx.total) + ' clicks · all time ' + n(bx.allTime) + (bx.live ? '' : ' · bixpayLive is OFF');
const rows = Object.entries(bx.bySurface).sort((a, b) => b[1] - a[1]);
$('trfBix').innerHTML = '<tr><th>Surface</th><th>Clicks</th></tr>' + (rows.length ? rows.map(([s, c]) => '<tr><td>' + esc(LBL[s] || s) + '</td><td>' + n(c) + '</td></tr>').join('') : '<tr><td colspan="2" class="muted">No BixPay clicks in this range yet.</td></tr>');
$('trfBixMembers').innerHTML = '<tr><th>Member</th><th>All clicks</th><th>Via promo kit</th><th>Last</th></tr>' + (bx.members.length ? bx.members.map(m => '<tr><td>' + esc(m.name || m.email) + '</td><td>' + n(m.total) + '</td><td>' + n(m.promo) + '</td><td class="small muted">' + (m.last ? ago(m.last) : '') + '</td></tr>').join('') : '<tr><td colspan="4" class="muted">No member clicks yet.</td></tr>'); }
$('trfAngles').innerHTML = '<tr><th>Angle</th><th>Join-page<br>views</th><th>Signups</th><th>View &rarr;<br>signup</th></tr>' + (d.angles.length ? d.angles.map(a => '<tr><td>' + esc(a.angle) + '</td><td>' + n(a.views) + '</td><td>' + n(a.signups) + '</td><td>' + pct(a.signups, a.views) + '</td></tr>').join('') : '<tr><td colspan="4" class="muted">No angle data yet.</td></tr>'); $('trfAngles').innerHTML = '<tr><th>Angle</th><th>Join-page<br>views</th><th>Signups</th><th>View &rarr;<br>signup</th></tr>' + (d.angles.length ? d.angles.map(a => '<tr><td>' + esc(a.angle) + '</td><td>' + n(a.views) + '</td><td>' + n(a.signups) + '</td><td>' + pct(a.signups, a.views) + '</td></tr>').join('') : '<tr><td colspan="4" class="muted">No angle data yet.</td></tr>');
$('trfDaily').innerHTML = '<tr><th>Day</th><th>Page views</th><th>Signups</th></tr>' + (d.daily.length ? d.daily.slice().reverse().map(x => '<tr><td>' + esc(x.day) + '</td><td>' + n(x.hits) + '</td><td>' + n(x.signups) + '</td></tr>').join('') : '<tr><td colspan="3" class="muted">Nothing yet.</td></tr>'); $('trfDaily').innerHTML = '<tr><th>Day</th><th>Page views</th><th>Signups</th></tr>' + (d.daily.length ? d.daily.slice().reverse().map(x => '<tr><td>' + esc(x.day) + '</td><td>' + n(x.hits) + '</td><td>' + n(x.signups) + '</td></tr>').join('') : '<tr><td colspan="3" class="muted">Nothing yet.</td></tr>');
} }
@@ -1011,11 +963,11 @@
['Wallet linked', rq.wallet ? 'yes' : 'no'], ['Joined', esc(ctWhen(rq.created))], ['Last seen', esc(ctWhen(rq.lastSeen) || 'never')]] : []).concat([['Private link', '<span class="mono small" style="word-break:break-all">' + esc(v.link) + '</span>']])) ['Wallet linked', rq.wallet ? 'yes' : 'no'], ['Joined', esc(ctWhen(rq.created))], ['Last seen', esc(ctWhen(rq.lastSeen) || 'never')]] : []).concat([['Private link', '<span class="mono small" style="word-break:break-all">' + esc(v.link) + '</span>']]))
+ '</div>' + '</div>'
+ '<div class="card"><div class="card-head"><h3>Thread</h3><span class="sub">' + v.messages.length + ' message' + (v.messages.length === 1 ? '' : 's') + '</span></div>' + '<div class="card"><div class="card-head"><h3>Thread</h3><span class="sub">' + v.messages.length + ' message' + (v.messages.length === 1 ? '' : 's') + '</span></div>'
+ v.messages.map(m => '<div style="border:1px solid ' + (m.internal ? 'var(--gold-line)' : m.author === 'admin' ? 'var(--mint-line)' : 'var(--line)') + ';background:' + (m.internal ? 'var(--gold-soft)' : m.author === 'admin' ? 'var(--mint-faint)' : 'transparent') + ';border-radius:12px;padding:10px 14px;margin:8px 0">' + v.messages.map(m => '<div style="border:1px solid ' + (m.internal ? 'rgba(242,201,76,.55)' : m.author === 'admin' ? 'rgba(67,232,195,.45)' : 'var(--line)') + ';background:' + (m.internal ? 'rgba(242,201,76,.07)' : m.author === 'admin' ? 'rgba(67,232,195,.05)' : 'transparent') + ';border-radius:12px;padding:10px 14px;margin:8px 0">'
+ '<div class="small muted" style="display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap"><b>' + esc(SP_AUTHOR[m.author] || m.author) + (m.internal ? ' · internal note' : '') + (m.via && m.via !== 'web' ? ' · via ' + esc(m.via) : '') + '</b><span>' + esc(ctWhen(m.created)) + '</span></div>' + '<div class="small muted" style="display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap"><b>' + esc(SP_AUTHOR[m.author] || m.author) + (m.internal ? ' · internal note' : '') + (m.via && m.via !== 'web' ? ' · via ' + esc(m.via) : '') + '</b><span>' + esc(ctWhen(m.created)) + '</span></div>'
+ '<div style="white-space:pre-wrap;word-wrap:break-word;margin-top:6px">' + spLink(m.body) + '</div>' + '<div style="white-space:pre-wrap;word-wrap:break-word;margin-top:6px">' + spLink(m.body) + '</div>'
+ (m.author === 'admin' && !m.internal && t.platform !== 'linkspin' && window.IAPKB ? '<p style="margin:8px 0 0"><button type="button" class="btn small sec" data-kbsave="' + m.id + '">Save as KB entry</button></p>' : '') + (m.author === 'admin' && !m.internal && t.platform !== 'linkspin' && window.IAPKB ? '<p style="margin:8px 0 0"><button type="button" class="btn small sec" data-kbsave="' + m.id + '">Save as KB entry</button></p>' : '')
+ (m.bodyEn ? '<div style="white-space:pre-wrap;word-wrap:break-word;margin-top:8px;padding:8px 10px;border-left:3px solid var(--mint);background:var(--mint-soft);border-radius:6px"><span class="small muted">🌐 ' + esc(m.langName || m.lang) + ', in English (your reply goes back in ' + esc(m.langName || m.lang) + ' with your English underneath)</span>\n' + spLink(m.bodyEn) + '</div>' : '') + (m.bodyEn ? '<div style="white-space:pre-wrap;word-wrap:break-word;margin-top:8px;padding:8px 10px;border-left:3px solid var(--accent,#43e8c3);background:rgba(67,232,195,.07);border-radius:6px"><span class="small muted">🌐 ' + esc(m.langName || m.lang) + ', in English (your reply goes back in ' + esc(m.langName || m.lang) + ' with your English underneath)</span>\n' + spLink(m.bodyEn) + '</div>' : '')
+ ((m.attachments || []).length ? '<div style="display:flex;gap:8px;margin-top:8px;flex-wrap:wrap">' + m.attachments.map(a => '<a href="' + esc(a) + '" target="_blank" rel="noopener"><img src="' + esc(a) + '" alt="attachment" style="max-width:180px;max-height:140px;border-radius:8px;border:1px solid var(--line)"></a>').join('') + '</div>' : '') + '</div>').join('') + ((m.attachments || []).length ? '<div style="display:flex;gap:8px;margin-top:8px;flex-wrap:wrap">' + m.attachments.map(a => '<a href="' + esc(a) + '" target="_blank" rel="noopener"><img src="' + esc(a) + '" alt="attachment" style="max-width:180px;max-height:140px;border-radius:8px;border:1px solid var(--line)"></a>').join('') + '</div>' : '') + '</div>').join('')
+ '</div>' + '</div>'
+ '<div class="card"><div class="card-head"><h3>Reply</h3><span class="sub">emailed to the requester' + (rq.member ? ' and put in their Help tab and inbox' : '') + '</span></div>' + '<div class="card"><div class="card-head"><h3>Reply</h3><span class="sub">emailed to the requester' + (rq.member ? ' and put in their Help tab and inbox' : '') + '</span></div>'
@@ -1151,8 +1103,7 @@
loginCreditsPerDay: ['Login ad: credits per day', 'flat daily charge while active'], loginCreditsPerDay: ['Login ad: credits per day', 'flat daily charge while active'],
loginDwellSeconds: ['Login ad: seconds shown', 'full-screen interstitial after sign-in'], loginDwellSeconds: ['Login ad: seconds shown', 'full-screen interstitial after sign-in'],
burnBatchMin: ['On-chain burn batch (credits)', 'accrued spend is burned once it reaches this'], burnBatchMin: ['On-chain burn batch (credits)', 'accrued spend is burned once it reaches this'],
synRateDivisor: ['Network rate divisor (N)', 'Network Ad Space banner views and PassiveDrip visits cost 1/N of the on-site rate; 1 = same rate as on-site; whole numbers'], synRateDivisor: ['Network rate divisor (N)', 'Network Ad Space views and PassiveDrip visits cost 1/N of the on-site rate; 1 = same rate as on-site; whole numbers'],
synRateDivisorText: ['Network rate divisor for TEXT ads (N)', 'Network Ad Space text-ad views cost 1/N of the on-site text rate (1 = the same as on-site, 1 credit per 100 views since 2026-11-20); whole numbers'],
welcomeCredits: ['Welcome credits', 'granted after the welcome tour'], welcomeCredits: ['Welcome credits', 'granted after the welcome tour'],
dailyViewTarget: ['Daily view set (ads)', 'ads a member views for the daily claim'], dailyViewTarget: ['Daily view set (ads)', 'ads a member views for the daily claim'],
dailyClaimCredits: ['Daily claim (credits)', 'paid when the set is complete'], dailyClaimCredits: ['Daily claim (credits)', 'paid when the set is complete'],
@@ -1208,7 +1159,7 @@
})); }));
// site settings: key / value rows; booleans as checkboxes, numbers stay numbers // site settings: key / value rows; booleans as checkboxes, numbers stay numbers
const SITE_META = { loginAdEveryHours: 'Login ad: show again on the next member page once the last finished view is this many hours old (default 3)', noPayoutIds: 'No-payout positions (member #s, comma): linkage only, no buys from them, no joins routed under them', siteName: 'Site name', tagline: 'Tagline', rehearsal: 'Testnet rehearsal banner', defaultSponsorId: 'Fallback sponsor (member #)', walletConnectProjectId: 'WalletConnect project id', moonpayPublicKey: 'MoonPay public key', telegramBotToken: 'Telegram proof feed: bot token', telegramChatId: 'Telegram proof feed: chat id', telegramTopicId: 'Telegram proof feed: topic id (optional)', telegramEvents: 'Telegram proof feed: events (payouts | payouts+purchases | all)', telegramCtaUrl: 'Telegram proof feed: join link under each post', aiCreditsPerGen: 'AI Copy Engine: credits per generation after the free allowance', aiFreeSurge: 'AI Copy Engine: free generations a month at Surge', aiFreeCircuit: 'AI Copy Engine: free generations a month at Circuit', aiFreeNexus: 'AI Copy Engine: free generations a month at Nexus', snapshotEnabled: 'Daily growth snapshot to Telegram (1/0)', snapshotHourUtc: 'Daily growth snapshot: hour (UTC; 14 = 9 AM Central)', snapshotTargets: 'Targets for milestones + daily snapshot: feed = main group, support = IAP support topic, echo = shared payments topic (comma list)', pipelineMode: 'Pipeline board: off (coming soon card) | preview (admin account only) | on (everyone)', pipelineEta: 'Pipeline: opening date shown on the coming-soon card (e.g. Sep 28)', memberWeeklyEmail: 'Weekly member email to everyone active (1) or only sponsors with a line (0)', leaderboardWeeklyPrize: 'Leaderboard: weekly prize text (optional; blank shows the credit ladder)', leaderboardMonthlyPrize: 'Leaderboard: monthly prize text (optional)', leaderboardWeeklyCredits: 'Leaderboard: weekly credits for 1st,2nd,3rd… (e.g. 1000,500,250; blank = none)', leaderboardMonthlyCredits: 'Leaderboard: monthly credits for 1st,2nd,3rd… (e.g. 5000,2500,1000)', leaderboardAnnounceGeneral: 'Leaderboard: announce winners in the main group too (1/0)', telegramSupportChatId: 'Telegram support topic: chat id (milestones + daily snapshot)', telegramSupportTopicId: 'Telegram support topic: topic id', telegramEchoChatId: 'Telegram echo (shared payments topic): chat id', telegramEchoTopicId: 'Telegram echo: topic id', telegramEchoEvents: 'Telegram echo: events (payouts | payouts+purchases | all)', legacyCreditsAdvertiser: 'Legacy welcome credits: former advertisers', legacyCreditsEarner: 'Legacy welcome credits: former earners', pnlFixedMonthlyUsd: 'P&L: fixed monthly cost (USD)' }; const SITE_META = { noPayoutIds: 'No-payout positions (member #s, comma): linkage only, no buys from them, no joins routed under them', siteName: 'Site name', tagline: 'Tagline', rehearsal: 'Testnet rehearsal banner', defaultSponsorId: 'Fallback sponsor (member #)', walletConnectProjectId: 'WalletConnect project id', moonpayPublicKey: 'MoonPay public key', telegramBotToken: 'Telegram proof feed: bot token', telegramChatId: 'Telegram proof feed: chat id', telegramTopicId: 'Telegram proof feed: topic id (optional)', telegramEvents: 'Telegram proof feed: events (payouts | payouts+purchases | all)', telegramCtaUrl: 'Telegram proof feed: join link under each post', aiCreditsPerGen: 'AI Copy Engine: credits per generation after the free allowance', aiFreeSurge: 'AI Copy Engine: free generations a month at Surge', aiFreeCircuit: 'AI Copy Engine: free generations a month at Circuit', aiFreeNexus: 'AI Copy Engine: free generations a month at Nexus', snapshotEnabled: 'Daily growth snapshot to Telegram (1/0)', snapshotHourUtc: 'Daily growth snapshot: hour (UTC; 14 = 9 AM Central)', snapshotTargets: 'Targets for milestones + daily snapshot: feed = main group, support = IAP support topic, echo = shared payments topic (comma list)', pipelineMode: 'Pipeline board: off (coming soon card) | preview (admin account only) | on (everyone)', pipelineEta: 'Pipeline: opening date shown on the coming-soon card (e.g. Sep 28)', memberWeeklyEmail: 'Weekly member email to everyone active (1) or only sponsors with a line (0)', leaderboardWeeklyPrize: 'Leaderboard: weekly prize text (optional; blank shows the credit ladder)', leaderboardMonthlyPrize: 'Leaderboard: monthly prize text (optional)', leaderboardWeeklyCredits: 'Leaderboard: weekly credits for 1st,2nd,3rd… (e.g. 1000,500,250; blank = none)', leaderboardMonthlyCredits: 'Leaderboard: monthly credits for 1st,2nd,3rd… (e.g. 5000,2500,1000)', leaderboardAnnounceGeneral: 'Leaderboard: announce winners in the main group too (1/0)', telegramSupportChatId: 'Telegram support topic: chat id (milestones + daily snapshot)', telegramSupportTopicId: 'Telegram support topic: topic id', telegramEchoChatId: 'Telegram echo (shared payments topic): chat id', telegramEchoTopicId: 'Telegram echo: topic id', telegramEchoEvents: 'Telegram echo: events (payouts | payouts+purchases | all)', legacyCreditsAdvertiser: 'Legacy welcome credits: former advertisers', legacyCreditsEarner: 'Legacy welcome credits: former earners', pnlFixedMonthlyUsd: 'P&L: fixed monthly cost (USD)' };
function drawSite() { function drawSite() {
const wrap = $('siteForm'); const wrap = $('siteForm');
wrap.innerHTML = Object.entries(siteObj).map(([k, v]) => '<div class="kv-row"><span class="k" title="' + esc(k) + '">' + esc(SITE_META[k] || humanize(k)) + '</span>' wrap.innerHTML = Object.entries(siteObj).map(([k, v]) => '<div class="kv-row"><span class="k" title="' + esc(k) + '">' + esc(SITE_META[k] || humanize(k)) + '</span>'
@@ -1291,35 +1242,6 @@
// Tier test and preview (2026-10-25, Marty): the member Games card shows the admin exactly what a member sees, so every tier test lives // Tier test and preview (2026-10-25, Marty): the member Games card shows the admin exactly what a member sees, so every tier test lives
// here. Every action touches ONLY the signed-in admin's own account; a test buy opens the same waiting order a member gets (a fresh // here. Every action touches ONLY the signed-in admin's own account; a test buy opens the same waiting order a member gets (a fresh
// package on /my fulfils it, sponsors paid as usual), a test comp starts the tier at once with no sale recorded. // package on /my fulfils it, sponsors paid as usual), a test comp starts the tier at once with no sale recorded.
// Shards of Valor bonus heroes (2026-11-05, Marty approved): sold ONE TIME. The same test path as the tiers, on the admin's own account:
// a test buy opens the real waiting order (a fresh $20 / $50 package on /my fulfils it), Give grants it at once as comped, Remove takes it back.
function heroTestHtml(H) {
if (!H || !H.items) return '';
const row = (key, name, sub, usd, pkg, owned, waiting, free) => '<div class="gpt-tier' + (owned ? ' on' : '') + '"><h4>' + esc(name) + '</h4><p class="small muted" style="margin:0 0 4px">' + esc(sub) + '</p>'
+ '<p class="gpt-price">' + (free ? 'Free for everyone' : '$' + usd + ' <span class="small muted">one time, the $' + pkg + ' package</span>') + '</p>'
+ '<p class="small" style="margin:4px 0">' + (owned ? '<b>Your account: owned</b>' : waiting ? '<b>Your account: test order waiting for a $' + pkg + ' package</b>' : 'Your account: not owned') + '</p><div class="gpt-acts">'
+ (free || owned ? '' : waiting ? '<a class="btn small" href="/my?from=heroes#buy" target="_blank" rel="noopener">Buy the $' + pkg + ' package on /my</a><button class="btn small sec" type="button" data-ht-cancel="' + key + '">Cancel test order</button>' : '<button class="btn small" type="button" data-ht-buy="' + key + '">Test buy (real order, $' + pkg + ' package)</button>')
+ (owned || free ? '' : '<button class="btn small sec" type="button" data-ht-comp="' + key + '">Give my account ' + esc(name.split(' ')[0]) + ' now (test)</button>')
+ (owned && !free && key !== 'bundle' ? '<button class="btn small sec" type="button" data-ht-revoke="' + key + '">Remove from my account</button>' : '') + '</div></div>';
const B = H.bundle;
return '<h3 style="margin:16px 0 6px">Shards of Valor bonus heroes <span class="chip flat">' + (H.sale ? 'on sale: members see them' : 'hidden from members (heroSales off)') + '</span></h3>'
+ '<p class="muted" style="margin:0 0 8px">Sold one time, owned for good, paid by a fresh package like a pass (no credits). Prices, the free list and the bundle are settings: heroPrice&lt;Name&gt;Cents (0 = free for everyone), heroBundleHeroes, heroBundlePriceCents. heroBundleCap stays empty (the bundle is heroes only). Members see heroes only once <b>heroSales</b> is on.</p>'
+ '<div class="gpt-grid">' + H.items.map(i => row(i.key, i.name, i.blurb, i.usd, i.package, i.owned, i.waiting, i.free)).join('')
+ (B ? row('bundle', 'Hero bundle', B.names.join(', '), B.usd, B.package, B.owned, B.waiting, false) : '') + '</div>';
}
function wireHeroTest(box, g) {
const nm = k => k === 'bundle' ? 'the hero bundle' : ((g.heroes.items.find(i => i.key === k) || {}).name || k);
box.querySelectorAll('[data-ht-buy]').forEach(b => b.addEventListener('click', busy(b, async () => {
const k = b.dataset.htBuy; if (!(await IAP.confirmBox('Open a TEST order for ' + nm(k) + ' on your own account (' + g.email + ')? It is fulfilled when a fresh package of at least its price from one of your positions settles on chain. Members still cannot buy heroes while heroSales is off.', { title: 'Test buy: ' + nm(k), ok: 'Open the test order', cancel: 'Not now' }))) return;
const x = await api('/api/admin/heroes/test-buy', { hero: k }); IAP.status('Test order for ' + nm(k) + ' is waiting for a $' + x.package + ' package on ' + x.email + '.', 'ok'); await loadGpTest();
})));
box.querySelectorAll('[data-ht-cancel]').forEach(b => b.addEventListener('click', busy(b, async () => { const k = b.dataset.htCancel; await api('/api/admin/heroes/test-cancel', { hero: k }); IAP.status('Test order for ' + nm(k) + ' cancelled.', 'ok'); await loadGpTest(); })));
box.querySelectorAll('[data-ht-comp]').forEach(b => b.addEventListener('click', busy(b, async () => {
const k = b.dataset.htComp; if (!(await IAP.confirmBox('Give your own account ' + nm(k) + ' now, for testing? Recorded as comped (no sale); the game shows it the next time you sign in to it from /my Games.', { title: 'Test ' + nm(k), ok: 'Give it to me', cancel: 'Not now' }))) return;
await api('/api/admin/heroes/test-comp', { hero: k }); IAP.status(nm(k) + ' is on your account (test).', 'ok'); await loadGpTest();
})));
box.querySelectorAll('[data-ht-revoke]').forEach(b => b.addEventListener('click', busy(b, async () => { const k = b.dataset.htRevoke; await api('/api/admin/heroes/test-revoke', { hero: k }); IAP.status(nm(k) + ' removed from your account.', 'ok'); await loadGpTest(); })));
}
async function loadGpTest() { async function loadGpTest() {
const box = $('gpTest'); if (!box) return; const box = $('gpTest'); if (!box) return;
let g; try { g = await api('/api/admin/gamepass/preview'); } catch (e) { box.innerHTML = '<p class="muted">' + esc(e.message) + '</p>'; return; } let g; try { g = await api('/api/admin/gamepass/preview'); } catch (e) { box.innerHTML = '<p class="muted">' + esc(e.message) + '</p>'; return; }
@@ -1343,10 +1265,8 @@
+ 'These are the tier cards as members will see them. Every button here acts on your own account (' + esc(g.email) + ') and nobody else’s. The member Games card on /my shows you exactly what a member sees: while you hold a test tier it shows that tier the way it would for any member who holds one.</p>' + 'These are the tier cards as members will see them. Every button here acts on your own account (' + esc(g.email) + ') and nobody else’s. The member Games card on /my shows you exactly what a member sees: while you hold a test tier it shows that tier the way it would for any member who holds one.</p>'
+ '<div class="gpt-grid">' + rows.map(card).join('') + '</div>' + '<div class="gpt-grid">' + rows.map(card).join('') + '</div>'
+ '<p class="muted" style="margin:10px 0 0"><b>Test buy</b> opens the same waiting order a member gets: a fresh package of at least the price, bought on /my by one of your positions, starts it (sponsors paid as usual). Cancel a test order you will not pay, or a later real package of that size fulfils it. <b>Give my account</b> starts one pass period at once, recorded as comped (no sale); <b>End</b> stops it. ' + '<p class="muted" style="margin:10px 0 0"><b>Test buy</b> opens the same waiting order a member gets: a fresh package of at least the price, bought on /my by one of your positions, starts it (sponsors paid as usual). Cancel a test order you will not pay, or a later real package of that size fulfils it. <b>Give my account</b> starts one pass period at once, recorded as comped (no sale); <b>End</b> stops it. '
+ 'To test it in game, open <b>Shards of Valor &gt; Passes</b> (key P) after signing in to the game again from /my Games: the game reads your highest tier from InstantAdPay at sign-in.</p>' + 'To test it in game, open <b>Shards of Valor &gt; Passes</b> (key P) after signing in to the game again from /my Games: the game reads your highest tier from InstantAdPay at sign-in.</p>';
+ heroTestHtml(g.heroes);
const tierName = k => (rows.find(r => r.tier === k) || {}).name || k; const tierName = k => (rows.find(r => r.tier === k) || {}).name || k;
wireHeroTest(box, g);
box.querySelectorAll('[data-gpt-buy]').forEach(b => b.addEventListener('click', busy(b, async () => { box.querySelectorAll('[data-gpt-buy]').forEach(b => b.addEventListener('click', busy(b, async () => {
const k = b.dataset.gptBuy; const r = rows.find(x => x.tier === k); const k = b.dataset.gptBuy; const r = rows.find(x => x.tier === k);
if (!(await IAP.confirmBox('Open a TEST order for ' + tierName(k) + ' on your own account (' + g.email + ')? It starts when a fresh $' + r.package + ' or bigger package from one of your positions settles on chain. Members still cannot see or buy this tier.', { title: 'Test buy: ' + tierName(k), ok: 'Open the test order', cancel: 'Not now' }))) return; if (!(await IAP.confirmBox('Open a TEST order for ' + tierName(k) + ' on your own account (' + g.email + ')? It starts when a fresh $' + r.package + ' or bigger package from one of your positions settles on chain. Members still cannot see or buy this tier.', { title: 'Test buy: ' + tierName(k), ok: 'Open the test order', cancel: 'Not now' }))) return;
-33
View File
@@ -1,33 +0,0 @@
// BixPay guide (/bixpay, 2026-10-29): the CTA carries the viewer's resolved partner link (their own when signed in, else the
// member whose ?ref brought them here or whose sponsor cookie they carry, else the network link), always through the counted
// /go/bixpay link. The server already folded ?ref into the sponsor cookie; the ref is passed along too so the first view resolves.
// In-app browsers (Gmail, Telegram, Facebook webviews): BIX's register page runs a Cloudflare check that often fails there, and
// the invite token lives only in the URL, so a member who then reopens BIX elsewhere registers with no sponsor (bizventures,
// 2026-10-29: referrer N/A). Those viewers get a notice with the link to copy into a real browser.
(function () {
var cta = document.getElementById('bixCta'), using = document.getElementById('bixUsing'), soon = document.getElementById('bixSoon');
var box = document.getElementById('bixInApp'), boxLink = document.getElementById('bixInAppLink'), boxCopy = document.getElementById('bixInAppCopy');
if (!cta) return;
function inApp() {
var u = navigator.userAgent || '';
if (/FBAN|FBAV|FB_IAB|Instagram|Line\/|Twitter|Snapchat|GSA\/|Telegram|\bwv\b|WebView/i.test(u)) return true;
return /iPhone|iPad|iPod/.test(u) && !/Safari\//.test(u); // an iOS web view: no Safari token
}
var ref = '';
try { ref = new URLSearchParams(location.search).get('ref') || ''; } catch (e) { ref = ''; }
fetch('/api/public/bixpay' + (ref ? '?ref=' + encodeURIComponent(ref) : ''), { credentials: 'same-origin' }).then(function (r) { return r.json(); }).then(function (d) {
if (!d || !d.live) { if (soon) soon.hidden = false; cta.href = '/my#wallet'; if (using) using.textContent = 'Sign in to your dashboard and open the Wallet tab.'; return; }
cta.href = d.go;
if (using) using.textContent = d.whose === 'you' ? 'The button opens your own BixPay partner link.' : d.whose === 'sponsor' ? 'The button opens ' + d.name + "'s BixPay partner link." + (d.signedIn ? ' Add yours in Members > Profile.' : '') : 'The button opens the network’s BixPay partner link.' + (d.signedIn ? ' Add yours in Members > Profile.' : '');
if (box && inApp()) {
box.hidden = false;
if (boxLink) boxLink.textContent = d.go;
if (boxCopy) boxCopy.addEventListener('click', function () {
var done = function () { boxCopy.textContent = 'Copied'; setTimeout(function () { boxCopy.textContent = 'Copy link'; }, 2000); };
var select = function () { try { var r = document.createRange(); r.selectNodeContents(boxLink); var s = window.getSelection(); s.removeAllRanges(); s.addRange(r); boxCopy.textContent = 'Selected: copy it'; } catch (e) {} }; // no native dialogs
if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(d.go).then(done, select);
else select();
});
}
}).catch(function () {});
})();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

+1 -1
View File
@@ -11,7 +11,7 @@
share.querySelectorAll('a').forEach(a => { a.href = a.href.replace(encodeURIComponent('https://instantadpay.com' + location.pathname), encodeURIComponent(link)); }); share.querySelectorAll('a').forEach(a => { a.href = a.href.replace(encodeURIComponent('https://instantadpay.com' + location.pathname), encodeURIComponent(link)); });
const bar = document.createElement('div'); const bar = document.createElement('div');
bar.id = 'viralBar'; bar.id = 'viralBar';
bar.style.cssText = 'margin-top:18px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--ink-faint);display:flex;gap:10px;align-items:center;flex-wrap:wrap'; bar.style.cssText = 'margin-top:18px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--card, rgba(255,255,255,.03));display:flex;gap:10px;align-items:center;flex-wrap:wrap';
bar.innerHTML = '<div style="flex:1;min-width:220px"><div class="eyebrow" style="margin:0 0 4px">Your link for this article</div><div class="mono small" style="overflow-wrap:anywhere">' + link.replace(/[&<>]/g, '') + '</div><div class="muted small" style="margin-top:4px">Share this and anyone who joins from it is yours, same as your invite link.</div></div><button class="btn small" type="button">Copy link</button>'; bar.innerHTML = '<div style="flex:1;min-width:220px"><div class="eyebrow" style="margin:0 0 4px">Your link for this article</div><div class="mono small" style="overflow-wrap:anywhere">' + link.replace(/[&<>]/g, '') + '</div><div class="muted small" style="margin-top:4px">Share this and anyone who joins from it is yours, same as your invite link.</div></div><button class="btn small" type="button">Copy link</button>';
bar.querySelector('button').onclick = async () => { try { await navigator.clipboard.writeText(link); IAP.status('Link copied.', 'ok'); } catch (e) { IAP.status('Copy failed.', 'bad'); } }; bar.querySelector('button').onclick = async () => { try { await navigator.clipboard.writeText(link); IAP.status('Link copied.', 'ok'); } catch (e) { IAP.status('Copy failed.', 'bad'); } };
share.parentNode.insertBefore(bar, share); share.parentNode.insertBefore(bar, share);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

-122
View File
@@ -1,122 +0,0 @@
// Chasing Unicorns (Marty, 2026-11-12): a promo-tool lead magnet. A fake earnings dashboard where every button, tile and popup
// is one of the classic scam warning signs; clicking one reveals it and scores the visitor's "scam radar", and the ending
// contrasts the unicorn with how InstantAdPay works. Shared as /chasing-unicorns?ref=<username> (the viral ?ref= link sets the
// sponsor cookie server-side). Nothing here touches an account: it is all made up on the page.
(function () {
var $ = function (id) { return document.getElementById(id); };
var usd = function (n) { return '$' + n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); };
var calm = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var FLAGS = {
daily: { name: 'A fixed daily return', short: 'Guaranteed % a day on your deposit',
h: 'Nobody pays a fixed 3% a day.', p: 'That is over 4 million percent a year, compounded. No business earns that. The only way to pay a fixed daily return is with the next person\'s deposit.',
tell: 'Your "interest" is a line of code adding to a number. Watch it: it goes up even though nothing happened.', do: 'Ask what the product is and who buys it. If the answer is "the return", walk away.' },
withdraw: { name: 'Withdrawals that never arrive', short: 'Always "processing"',
h: 'Withdrawal processing... forever.', p: 'Deposits are instant. Withdrawals need "verification", a "maintenance window", a new minimum. That is how a site with no money buys time.',
tell: 'The balance on screen is not money. Money is what lands in your own wallet or bank.', do: 'Withdraw a small amount early. If $20 is a hostage negotiation, you have your answer.' },
vip: { name: 'Pay to unlock your own money', short: 'Upgrade or "release fee" first',
h: 'Pay $199 to unlock your own $25,000?', p: 'The "upgrade", the "tax", the "release fee", a "small miner fee" or "gas fee". It always sounds minor next to the balance waiting for you. It is the oldest trick: the balance is bait, and the fee is the real product. Some sites are free right up until the countdown ends, then everybody gets the fee at once.',
tell: 'If the money were there, they would take the fee out of it. They want new money from you instead.', do: 'Never pay to withdraw. A real balance pays its own fees.' },
team: { name: 'The product is recruiting', short: 'Paid mainly for sign-ups',
h: '+$500 per sign-up. Paid with what?', p: 'If you earn for bringing people in and nobody is buying anything real, the money for your bonus comes from the people you brought in.',
tell: 'A team bonus with no product is your friends\' deposits with your name on them.', do: 'Ask: if nobody new joined tomorrow, where would the money come from?' },
clock: { name: 'The clock is always ticking', short: 'Countdowns and "spots left"',
h: 'The countdown resets. It always does.', p: 'Urgency is there to stop you thinking and to get you recruiting before you check anything. Watch the timer: when it hits zero, it starts over.',
tell: 'A good opportunity is still there after you sleep on it. A bad one needs you not to.', do: 'Wait 48 hours and search the name plus "withdrawal" and "scam" first.' },
coin: { name: 'Paid in their own coin', short: 'Tokens you cannot sell anywhere real',
h: '48,000 UYP, worth whatever they say.', p: 'A token you can only "sell" back on their own site is Monopoly money with better branding. They print it, they price it, they decide when you can sell.',
tell: '"Soon x100" is a promise from the people holding all the supply.', do: 'Check whether it trades anywhere real, with real volume, and who holds most of it.' },
keys: { name: 'Anything that touches your keys', short: '"Connect wallet to claim"',
h: 'Connect wallet to claim? That is the scam.', p: 'Claim pages ask you to sign an approval that lets them spend your tokens. Some ask for your seed phrase outright. Nobody legit ever needs either.',
tell: 'One signature can empty a wallet. The "airdrop" is the bait.', do: 'Never type a seed phrase into a website. Read what a signature approves before you sign it.' },
proof: { name: 'Fake social proof', short: 'People "cashing out" every few seconds',
h: '"Dave from Denver just withdrew $19,350."', p: 'These popups are a few lines of code picking a random name and a random amount. They are on scam sites because they work on all of us.',
tell: 'A popup is not a receipt. A transaction you can look up is.', do: 'Ask for a payment you can verify yourself, on a public ledger, not a screenshot.' }
};
var ORDER = ['daily', 'withdraw', 'vip', 'team', 'clock', 'coin', 'keys', 'proof'];
var seen = [];
// the visitor's sponsor rides the share link (?ref=), so the join button and the share line keep it
var ref = (new URLSearchParams(location.search).get('ref') || '').toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20);
// where the page link was posted (?src=massifly, ?src=leasedadspace...) rides into the join, so a sign-up says which channel
var chan = (new URLSearchParams(location.search).get('src') || '').toLowerCase().replace(/[^a-z0-9_.-]/g, '').slice(0, 18);
var srcTag = chan ? 'unicorns-' + chan : 'chasing-unicorns';
$('joinBtn').href = '/join?src=' + srcTag;
if (ref) {
$('joinBtn').href = '/join/' + ref + '?src=' + srcTag;
$('ledgerBtn').href = '/ledger?ref=' + ref;
$('shareLink').textContent = 'https://instantadpay.com/chasing-unicorns?ref=' + ref;
}
// radar
var dots = $('dots'); ORDER.forEach(function () { dots.appendChild(document.createElement('i')); });
function renderRadar() {
[].forEach.call(dots.children, function (d, i) { d.className = i < seen.length ? 'on' : ''; });
$('score').textContent = seen.length + ' of 8';
$('endH').textContent = seen.length === 8 ? 'Scam radar: 8 of 8. You are a unicorn hunter.' : 'Your scam radar: ' + seen.length + ' of 8 red flags spotted';
$('flags').innerHTML = ORDER.map(function (k) { var f = FLAGS[k]; return '<li class="' + (seen.indexOf(k) >= 0 ? 'on' : '') + '"><b>' + f.name + '</b><span class="fine">' + f.short + '</span></li>'; }).join('');
document.querySelectorAll('[data-flag]').forEach(function (b) { b.classList.toggle('done', seen.indexOf(b.getAttribute('data-flag')) >= 0); });
if (seen.length >= 3) $('after').hidden = false;
}
renderRadar();
// the reveal card
var lastFocus = null;
function reveal(k) {
var f = FLAGS[k]; if (!f) return;
if (seen.indexOf(k) < 0) seen.push(k);
renderRadar();
$('cardK').textContent = 'Red flag ' + seen.length + ' of 8 spotted: ' + f.name;
$('cardH').textContent = f.h; $('cardP').textContent = f.p;
$('cardTell').textContent = f.tell; $('cardDo').textContent = 'What to do: ' + f.do;
$('cardNext').textContent = seen.length === 8 ? 'See my result' : 'Keep hunting';
lastFocus = document.activeElement; $('veil').hidden = false; $('cardNext').focus();
}
function closeCard(toEnd) {
$('veil').hidden = true;
if (toEnd || seen.length === 8) $('end').scrollIntoView({ behavior: calm ? 'auto' : 'smooth', block: 'start' });
else if (lastFocus) lastFocus.focus();
}
document.querySelectorAll('[data-flag]').forEach(function (b) { b.addEventListener('click', function () { reveal(b.getAttribute('data-flag')); }); });
$('cardNext').addEventListener('click', function () { closeCard(false); });
$('cardEnd').addEventListener('click', function () { closeCard(true); });
$('veil').addEventListener('click', function (e) { if (e.target === $('veil')) closeCard(false); });
document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && !$('veil').hidden) closeCard(false); });
$('showAll').addEventListener('click', function () { ORDER.forEach(function (k) { if (seen.indexOf(k) < 0) seen.push(k); }); renderRadar(); $('after').scrollIntoView({ behavior: calm ? 'auto' : 'smooth', block: 'start' }); });
$('copyShare').addEventListener('click', function () {
var t = $('shareLink').textContent, b = $('copyShare');
navigator.clipboard.writeText(t).then(function () { b.textContent = 'Copied'; }, function () { var r = document.createRange(); r.selectNodeContents($('shareLink')); var s = getSelection(); s.removeAllRanges(); s.addRange(r); b.textContent = 'Press Ctrl+C'; });
});
// the ticking balance: 3% a day of $25,000, out of thin air
var START = 25000, perSec = START * 0.03 / 86400, t0 = performance.now(), midnight = new Date(); midnight.setHours(0, 0, 0, 0);
function tick() {
var gain = (performance.now() - t0) / 1000 * perSec;
$('bal').textContent = usd(START + gain);
$('rate').textContent = '+3.00% daily compound interest · +' + usd(gain) + ' since you opened this page';
$('today').textContent = usd((Date.now() - midnight.getTime()) / 1000 * perSec);
}
tick(); setInterval(tick, calm ? 1000 : 100);
// the countdown that starts over at zero, and spots that never run out
var LEN = 600, end = Date.now() + LEN * 1000, spots = 3;
setInterval(function () {
var left = Math.round((end - Date.now()) / 1000);
if (left <= 0) { end = Date.now() + LEN * 1000; left = LEN; spots = 3; }
else if (left % 89 === 0 && spots > 1) spots--;
$('clock').textContent = String(Math.floor(left / 60)).padStart(2, '0') + ':' + String(left % 60).padStart(2, '0');
$('spots').textContent = 'Only ' + spots + ' VIP spot' + (spots === 1 ? '' : 's') + ' left';
}, 1000);
// fake "cash out" popups every few seconds: random made-up names and amounts
var who = ['Jessica from Ohio', 'Mike in Texas', 'Priya from London', 'Carlos in Miami', 'Ahmed from Dubai', 'Linda in Phoenix', 'Tom from Sydney', 'Grace in Toronto', 'Dave from Denver', 'Nina in Berlin', 'Kwame from Accra', 'Rosa in Manila'];
var what = ['just withdrew', 'just cashed out', 'just earned', 'just got a team bonus of'];
function pop() {
var n = who[Math.floor(Math.random() * who.length)], amt = Math.round((Math.random() * 40000 + 1500) / 10) * 10;
$('pAv').textContent = n.charAt(0);
$('pT').innerHTML = n + ' ' + what[Math.floor(Math.random() * what.length)] + ' <b>' + usd(amt) + '</b> ' + (1 + Math.floor(Math.random() * 9)) + ' min ago';
$('proof').classList.add('on');
setTimeout(function () { $('proof').classList.remove('on'); }, 4500);
}
setTimeout(function () { pop(); setInterval(pop, 8000); }, 3000);
})();
+3 -81
View File
@@ -57,59 +57,9 @@ window.IAP = (function () {
f.innerHTML = '<div>© ' + new Date().getFullYear() + ' InstantAdPay</div>' f.innerHTML = '<div>© ' + new Date().getFullYear() + ' InstantAdPay</div>'
+ '<div style="margin-top:8px;display:flex;gap:16px;justify-content:center;flex-wrap:wrap">' + '<div style="margin-top:8px;display:flex;gap:16px;justify-content:center;flex-wrap:wrap">'
+ '<a href="/">How it works</a><a href="/presentation">Presentation</a><a href="/ledger">Live ledger</a><a href="/contract">The contract</a><a href="/blog">Blog</a><a href="/leaderboard">Leaderboard</a><a href="/whats-new">What\'s new</a>' + '<a href="/">How it works</a><a href="/presentation">Presentation</a><a href="/ledger">Live ledger</a><a href="/contract">The contract</a><a href="/blog">Blog</a><a href="/leaderboard">Leaderboard</a><a href="/whats-new">What\'s new</a>'
+ '<a href="/facts">Platform facts</a><a href="/support">Support</a><a href="/terms">Terms</a><a href="/disclaimer">Earnings Disclaimer</a><a href="/privacy">Privacy</a></div>' + '<a href="/facts">Platform facts</a><a href="/support">Support</a><a href="/terms">Terms</a><a href="/privacy">Privacy</a><a href="/disclaimer">Disclaimer</a></div>';
+ '<div style="margin-top:10px">© 2026 TrustClickz</div>';
document.body.appendChild(f); document.body.appendChild(f);
renderNetworkLine(f);
} }
// "Part of the network" (Marty 2026-11-14 trust pack): the list comes from the hub through /api/network-sites, built-in copy if not
const NET_FALLBACK = [['iap', 'InstantAdPay', 'https://instantadpay.com'], ['linkspin', 'LinkSpin', 'https://linkspin.app'], ['dlb', 'Downline Banners', 'https://downlinebanners.com'],
['vbb', 'Viral Banner Blitz', 'https://viralbannerblitz.com'], ['stackpol', 'Stack POL', 'https://stackpol.com'], ['earnerscorner', 'Earners Corner', 'https://earnerscorner.com']].map(a => ({ id: a[0], name: a[1], url: a[2] }));
let netList = null;
async function networkSites() {
if (!netList) netList = fetch('/api/network-sites').then(r => r.json()).then(l => (Array.isArray(l) && l.length ? l : NET_FALLBACK)).catch(() => NET_FALLBACK);
return netList;
}
// the footer links carry a referral username (Marty 2026-11-15): the signed-in member's own, else the sponsor this visitor came in on
// (iap.sponsor cookie, usernames only, never a member number or wallet). Tracked links get it as s1 (LinkSpin sends it on as ?ref=),
// plain links as ?ref=. Earners Corner takes none.
const REF_RE = /^[A-Za-z0-9_.-]{1,40}$/;
const okRef = v => REF_RE.test(v) && !/^\d+$/.test(v) && !/^0x[0-9a-f]{40}$/i.test(v) && v !== 'company' && v !== 'top';
const refCookie = () => { const m = document.cookie.match(/(?:^|;\s*)iap\.sponsor=([^;]*)/); try { const v = m ? decodeURIComponent(m[1]) : ''; return okRef(v) ? v : ''; } catch (e) { return ''; } };
let netRef = null;
function networkRef() {
if (!netRef) netRef = fetch('/api/me', { credentials: 'same-origin' }).then(r => r.json()).then(m => (m && m.signedIn && m.username && okRef(m.username) ? m.username : refCookie())).catch(() => refCookie());
return netRef;
}
function withRef(s, ref) {
const href = s.go || s.url; if (!ref || s.id === 'earnerscorner') return href;
try { const u = new URL(href); u.searchParams.set(s.go ? 's1' : 'ref', ref); return u.toString(); } catch (e) { return href; }
}
function renderNetworkLine(host) {
if (!host || host.querySelector('.netline')) return;
const d = document.createElement('div'); d.className = 'netline';
d.style.cssText = 'margin-top:10px;display:flex;gap:6px 14px;justify-content:center;flex-wrap:wrap;align-items:baseline;font-size:12.5px';
host.appendChild(d);
const esc = s => String(s).replace(/[&<>"]/g, ch => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[ch]);
let list = NET_FALLBACK, ref = refCookie();
const paint = () => {
d.innerHTML = '<b>Part of the network</b><span>One account across the network:</span>' + list.map(s => (s.id === 'iap' || /instantadpay\.com/.test(s.url))
? '<span aria-current="page" style="font-weight:700;color:var(--ink)">' + esc(s.name) + ' (you are here)</span>'
: '<a href="' + esc(withRef(s, ref)) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>').join('');
};
paint();
networkSites().then(l => { list = l; paint(); });
networkRef().then(r => { if (r !== ref) { ref = r; paint(); } });
}
// pages with their own footer (the members area) get the network line too
function decorateFooters() { document.querySelectorAll('footer.bo-pagefoot').forEach(f => { const w = document.createElement('div'); w.style.width = '100%'; f.appendChild(w); renderNetworkLine(w); }); }
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', decorateFooters); else decorateFooters();
// Network Weekend (2026-11-17): the network ribbon (netweekend.js, every page) and the weekend strip / Overview card (weekend-card.js,
// Home and /my). Both switch on and off by date inside the scripts themselves, so outside the window they show nothing.
[['/assets/netweekend.js?v=20261117nw', 'iap'], ['/assets/weekend-card.js?v=20261117nw', '']].forEach(([src, site]) => {
if (document.querySelector('script[src^="' + src.split('?')[0] + '"]')) return;
const t = document.createElement('script'); t.src = src; t.defer = true; if (site) t.setAttribute('data-site', site); document.head.appendChild(t);
});
async function refreshNavWallet() { async function refreshNavWallet() {
try { try {
const me = await (await fetch('/api/me')).json(); const me = await (await fetch('/api/me')).json();
@@ -241,7 +191,7 @@ window.IAP = (function () {
await formSettled(); await formSettled();
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i++) {
const r = await (await fetch('/api/auth/email/start', { method: 'POST', headers: { 'Content-Type': 'application/json' }, const r = await (await fetch('/api/auth/email/start', { method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, fts: FORM_TS, fage: Date.now() - FORM_TS, hp_field_x9: hpValue(o.honeypot), pick, ref: o.ref || null, angle: o.angle || null, lsclk: o.lsclk || null }) })).json(); // ref = the join page's own link token, so the sponsor survives a lost cookie body: JSON.stringify({ email, fts: FORM_TS, fage: Date.now() - FORM_TS, hp_field_x9: hpValue(o.honeypot), pick, ref: o.ref || null, angle: o.angle || null }) })).json(); // ref = the join page's own link token, so the sponsor survives a lost cookie
if (r.challenge && o.host) { pick = await iconCheck(o.host, r.challenge, r.error); continue; } if (r.challenge && o.host) { pick = await iconCheck(o.host, r.challenge, r.error); continue; }
if (r.error) throw new Error(r.error); if (r.error) throw new Error(r.error);
return r; return r;
@@ -314,20 +264,7 @@ window.IAP = (function () {
} }
function ask(o) { return dialog(Object.assign({ type: 'text', value: '', placeholder: '' }, o || {})); } function ask(o) { return dialog(Object.assign({ type: 'text', value: '', placeholder: '' }, o || {})); }
function confirmBox(text, o) { return dialog(Object.assign({ type: 'none', text, ok: 'Yes', cancel: 'No' }, o || {})); } function confirmBox(text, o) { return dialog(Object.assign({ type: 'none', text, ok: 'Yes', cancel: 'No' }, o || {})); }
// ── appearance (2026-11-01): Light / Dark / Auto, mirrored from LinkSpin. The head script (themehead.js) owns window.IAPTheme and return { getConfig, fmtPol, fmtUsd, status, renderNav, refreshNavWallet, describeEvent, feedRow, adSlot, reportAd, requestCode, launchChecks, launchToggle, ask, confirmBox, $,
// localStorage iap.theme; this paints every .theme-seg on the page (member-area header, Profile pane, admin header), saves a
// click to the account when signed in (POST /api/my/profile {theme}), and at sign-in lets the account value win over the local
// one (a local choice is pushed up when the account has none yet). Pages without a .theme-seg still get the theme from the head script.
const THEME_VALUES = ['light', 'dark', 'auto'];
function storedTheme() { try { const v = localStorage.getItem('iap.theme'); return THEME_VALUES.includes(v) ? v : null; } catch (e) { return null; } }
function paintTheme() { const c = window.IAPTheme ? IAPTheme.get() : 'dark'; document.querySelectorAll('.theme-seg [data-theme]').forEach(b => { const on = b.dataset.theme === c; b.classList.toggle('on', on); b.setAttribute('aria-pressed', on ? 'true' : 'false'); }); }
const saveTheme = v => fetch('/api/my/profile', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ theme: v }) }).catch(() => {});
function themeSync(m) { if (!window.IAPTheme) return; const acct = m && m.signedIn && THEME_VALUES.includes(m.theme) ? m.theme : null; const local = storedTheme(); if (acct) { if (acct !== local) IAPTheme.set(acct, true); } else if (m && m.signedIn && local) saveTheme(local); paintTheme(); }
// the controls only exist on signed-in surfaces (member-area shell, admin), so a click always tries the save; signed out it is a harmless 401
document.addEventListener('click', e => { const b = e.target.closest && e.target.closest('.theme-seg [data-theme]'); if (!b || !window.IAPTheme) return; const v = b.dataset.theme; IAPTheme.set(v); saveTheme(v); });
window.addEventListener('iap-theme', paintTheme);
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', paintTheme); else paintTheme();
return { getConfig, fmtPol, fmtUsd, status, renderNav, refreshNavWallet, describeEvent, feedRow, adSlot, reportAd, requestCode, launchChecks, launchToggle, ask, confirmBox, $, themeSync, paintTheme,
guard: { FORM_TS, iconCheck, hpValue, formSettled } }; // guard: the sign-up walls, reused by the support form and the chatbot hand-off guard: { FORM_TS, iconCheck, hpValue, formSettled } }; // guard: the sign-up walls, reused by the support form and the chatbot hand-off
})(); })();
// shown inside someone else's frame (traffic exchanges, 2026-10-03): sign-in, join and off-site links open in a new tab, // shown inside someone else's frame (traffic exchanges, 2026-10-03): sign-in, join and off-site links open in a new tab,
@@ -358,18 +295,3 @@ window.IAP = (function () {
els.forEach(function (e) { e.hidden = false; }); els.forEach(function (e) { e.hidden = false; });
}).catch(function () {}); }).catch(function () {});
})(); })();
// Network links (2026-11-13): a click on a link to LinkSpin goes through /go/linkspin, which signs a signed-in member in over there and is a
// plain redirect for everyone else. Rewritten at click time only, so links people copy to share stay clean. data-nogo opts a link out.
(function () {
if (window.__netlinks) return; window.__netlinks = 1;
const HOSTS = ['linkspin.app', 'www.linkspin.app'];
document.addEventListener('click', e => {
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
const a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
if (!a || a.hasAttribute('download') || a.hasAttribute('data-nogo')) return;
let u; try { u = new URL(a.href); } catch (x) { return; }
if (u.protocol !== 'https:' || !HOSTS.includes(u.hostname)) return;
a.href = '/go/linkspin?to=' + encodeURIComponent(u.pathname + u.search + u.hash);
}, true);
})();
+3 -4
View File
@@ -11,8 +11,7 @@
const TASK = { tracking: 'conversions', start: 'refuel', refuel: 'refuel', pitstop: 'refuel', bannerspin: 'bannerspin', testing: 'testing', relaunch: 'ads', topup: 'ads', cut: 'ads', cruise: 'ads' }; const TASK = { tracking: 'conversions', start: 'refuel', refuel: 'refuel', pitstop: 'refuel', bannerspin: 'bannerspin', testing: 'testing', relaunch: 'ads', topup: 'ads', cut: 'ads', cruise: 'ads' };
let FROM = 'iap'; let FROM = 'iap';
const siteOf = u => /linkspin/i.test(u.host) ? 'linkspin' : 'iap'; // which site a link belongs to, by its host (also right on a local copy) const siteOf = u => /linkspin/i.test(u.host) ? 'linkspin' : 'iap'; // which site a link belongs to, by its host (also right on a local copy)
// a link to the other site goes through this site's /go/<other> hop (network sign-in, 2026-11-12): the member arrives signed in const go = (url, task) => { try { const u = new URL(url); if (u.host === location.host || siteOf(u) === FROM) return u.pathname + u.search + u.hash; if (task) { u.searchParams.set('from', FROM); u.searchParams.set('task', task); } return u.href; } catch (e) { return url; } };
const go = (url, task) => { try { const u = new URL(url); if (u.host === location.host || siteOf(u) === FROM) return u.pathname + u.search + u.hash; if (task) { u.searchParams.set('from', FROM); u.searchParams.set('task', task); } return '/go/' + (FROM === 'iap' ? 'linkspin' : 'iap') + '?to=' + encodeURIComponent(u.pathname + u.search + u.hash); } catch (e) { return url; } };
// "Refuel LinkSpin this cycle..." gets a way there (2026-10-25): the other site's buy screen, tagged for its arrival strip // "Refuel LinkSpin this cycle..." gets a way there (2026-10-25): the other site's buy screen, tagged for its arrival strip
const otherBuy = note => { const m = /^Refuel (LinkSpin|InstantAdPay) /.exec(note || ''); if (!m) return ''; const otherBuy = note => { const m = /^Refuel (LinkSpin|InstantAdPay) /.exec(note || ''); if (!m) return '';
const url = m[1] === 'LinkSpin' ? 'https://linkspin.app/credits#refuel' : 'https://instantadpay.com/my#buy'; const url = m[1] === 'LinkSpin' ? 'https://linkspin.app/credits#refuel' : 'https://instantadpay.com/my#buy';
@@ -22,7 +21,7 @@
+ '.er-dial{border:1px solid rgba(127,127,127,.3);border-radius:10px;padding:10px 12px;text-align:center;min-width:0}.er-dial svg{width:100%;max-width:200px;height:auto;display:block;margin:0 auto}' + '.er-dial{border:1px solid rgba(127,127,127,.3);border-radius:10px;padding:10px 12px;text-align:center;min-width:0}.er-dial svg{width:100%;max-width:200px;height:auto;display:block;margin:0 auto}'
+ '.er-dial .v{font-size:22px;font-weight:700;margin-top:-6px}.er-dial .c{font-size:12px;opacity:.8}.er-row{display:flex;flex-wrap:wrap;gap:8px}' + '.er-dial .v{font-size:22px;font-weight:700;margin-top:-6px}.er-dial .c{font-size:12px;opacity:.8}.er-row{display:flex;flex-wrap:wrap;gap:8px}'
+ '.er-light{display:flex;gap:6px;align-items:center;border:1px solid rgba(127,127,127,.3);border-radius:999px;padding:4px 10px;font-size:12.5px}.er-dot{width:10px;height:10px;border-radius:50%;background:rgba(127,127,127,.45);flex:none}' + '.er-light{display:flex;gap:6px;align-items:center;border:1px solid rgba(127,127,127,.3);border-radius:999px;padding:4px 10px;font-size:12.5px}.er-dot{width:10px;height:10px;border-radius:50%;background:rgba(127,127,127,.45);flex:none}'
+ '.er-dot.on{background:var(--warn,#e8a317)}.er-dot.green{background:var(--ok,#2fa36b)}.er-dot.amber{background:var(--warn,#e8a317)}.er-dot.grey{background:rgba(127,127,127,.45)}.er-parts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:8px}' + '.er-dot.on{background:#e8a317}.er-dot.green{background:#2fa36b}.er-dot.amber{background:#e8a317}.er-dot.grey{background:rgba(127,127,127,.45)}.er-parts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:8px}'
+ '.er-part{border:1px solid rgba(127,127,127,.3);border-radius:8px;padding:8px 10px;font-size:13px;display:grid;gap:3px;min-width:0}.er-part b{display:flex;flex-wrap:wrap;gap:2px 6px;align-items:center}.er-next{border:1px solid rgba(127,127,127,.4);border-radius:10px;padding:12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}' + '.er-part{border:1px solid rgba(127,127,127,.3);border-radius:8px;padding:8px 10px;font-size:13px;display:grid;gap:3px;min-width:0}.er-part b{display:flex;flex-wrap:wrap;gap:2px 6px;align-items:center}.er-next{border:1px solid rgba(127,127,127,.4);border-radius:10px;padding:12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}'
+ '.er-next .w{flex:1 1 220px;font-size:13px}.er-h{font-size:12px;letter-spacing:.06em;text-transform:uppercase;opacity:.75;margin:0}.er-streak{font-size:13.5px;line-height:1.5}.er-goal{display:flex;gap:6px;align-items:center;justify-content:center;margin-top:6px;font-size:12px}.er-goal input{width:70px}'; + '.er-next .w{flex:1 1 220px;font-size:13px}.er-h{font-size:12px;letter-spacing:.06em;text-transform:uppercase;opacity:.75;margin:0}.er-streak{font-size:13.5px;line-height:1.5}.er-goal{display:flex;gap:6px;align-items:center;justify-content:center;margin-top:6px;font-size:12px}.er-goal input{width:70px}';
if (!document.getElementById('erCss')) { const st = document.createElement('style'); st.id = 'erCss'; st.textContent = css; document.head.appendChild(st); } if (!document.getElementById('erCss')) { const st = document.createElement('style'); st.id = 'erCss'; st.textContent = css; document.head.appendChild(st); }
@@ -30,7 +29,7 @@
function dial(pct, value, caption, aria, warn) { function dial(pct, value, caption, aria, warn) {
const p = pct == null ? 0 : Math.max(0, Math.min(100, pct)); const p = pct == null ? 0 : Math.max(0, Math.min(100, pct));
const a = Math.PI * (1 - p / 100); const x = 100 + 80 * Math.cos(a), y = 100 - 80 * Math.sin(a); const a = Math.PI * (1 - p / 100); const x = 100 + 80 * Math.cos(a), y = 100 - 80 * Math.sin(a);
const col = warn ? 'var(--warn,#e8a317)' : 'currentColor'; const col = warn ? '#e8a317' : 'currentColor';
return '<div class="er-dial" role="img" aria-label="' + esc(aria) + '"><svg viewBox="0 0 200 112" aria-hidden="true"><path d="M20 100 A80 80 0 0 1 180 100" fill="none" stroke="rgba(127,127,127,.3)" stroke-width="14" stroke-linecap="round"/>' return '<div class="er-dial" role="img" aria-label="' + esc(aria) + '"><svg viewBox="0 0 200 112" aria-hidden="true"><path d="M20 100 A80 80 0 0 1 180 100" fill="none" stroke="rgba(127,127,127,.3)" stroke-width="14" stroke-linecap="round"/>'
+ (pct == null ? '' : '<path d="M20 100 A80 80 0 0 1 ' + x.toFixed(1) + ' ' + y.toFixed(1) + '" fill="none" stroke="' + col + '" stroke-width="14" stroke-linecap="round"/>') + '</svg>' + (pct == null ? '' : '<path d="M20 100 A80 80 0 0 1 ' + x.toFixed(1) + ' ' + y.toFixed(1) + '" fill="none" stroke="' + col + '" stroke-width="14" stroke-linecap="round"/>') + '</svg>'
+ '<div class="v">' + esc(value) + '</div><div class="c">' + caption + '</div></div>'; + '<div class="v">' + esc(value) + '</div><div class="c">' + caption + '</div></div>';
+1 -1
View File
@@ -28,7 +28,7 @@
let twin = ''; let twin = '';
if (!v.windowOpen && c.month && !c.both) twin = '<p class="small">Refuel ' + (c.iap && c.iap.refueled ? 'LinkSpin ($' + v.minUsd.linkspin + '+)' : 'InstantAdPay ($' + v.minUsd.iap + '+)') + ' before ' + esc(v.opensLabel) + ' and both sites move to <b>+' + v.next.secondEngine + '%</b>; the one you already refueled is topped up to match.' if (!v.windowOpen && c.month && !c.both) twin = '<p class="small">Refuel ' + (c.iap && c.iap.refueled ? 'LinkSpin ($' + v.minUsd.linkspin + '+)' : 'InstantAdPay ($' + v.minUsd.iap + '+)') + ' before ' + esc(v.opensLabel) + ' and both sites move to <b>+' + v.next.secondEngine + '%</b>; the one you already refueled is topped up to match.'
// the second engine is on the other site: a direct way there (2026-10-25), landing on LinkSpin's Refuel panel with an arrival strip // the second engine is on the other site: a direct way there (2026-10-25), landing on LinkSpin's Refuel panel with an arrival strip
+ (c.iap && c.iap.refueled ? ' <a href="/go/linkspin?to=%2Fcredits%3Ffrom%3Diap%26task%3Drefuel%23refuel" target="_blank" rel="noopener">Refuel LinkSpin &#8599;</a> (same email signs you in)' : '') + '</p>'; + (c.iap && c.iap.refueled ? ' <a href="https://linkspin.app/credits?from=iap&amp;task=refuel#refuel" target="_blank" rel="noopener">Refuel LinkSpin &#8599;</a> (same email signs you in)' : '') + '</p>';
let pit = ''; let pit = '';
if (v.pitStop) { if (v.pitStop) {
const here = v.pitStop.iap ? 'available here (+' + v.pitStop.pct + '% on a $' + v.minUsd.iap + '+ top-up, once this cycle)' : v.pitStop.usedIap ? 'used here this cycle' : null; const here = v.pitStop.iap ? 'available here (+' + v.pitStop.pct + '% on a $' + v.minUsd.iap + '+ top-up, once this cycle)' : v.pitStop.usedIap ? 'used here this cycle' : null;
+2 -3
View File
@@ -84,8 +84,7 @@
function busy(btn, fn) { function busy(btn, fn) {
return async () => { if (btn.disabled) return; btn.disabled = true; err(''); try { await fn(); } catch (e) { err(e.message || 'Something went wrong.'); } finally { btn.disabled = false; } }; return async () => { if (btn.disabled) return; btn.disabled = true; err(''); try { await fn(); } catch (e) { err(e.message || 'Something went wrong.'); } finally { btn.disabled = false; } };
} }
const pageClick = (() => { const q = new URLSearchParams(location.search); return q.get('lsclk') || q.get('lsid') || ''; })(); // the LinkSpin click in this page's address: travels with the requests, the cookie may be refused in a frame (reporting only) const codeOpts = () => ({ honeypot: $('jnWebsite'), host: $('jnCheck'), ref: linkTok, angle: v || '' }); // the page's own token rides with the code request (cookie may be blocked in a frame)
const codeOpts = () => ({ honeypot: $('jnWebsite'), host: $('jnCheck'), ref: linkTok, angle: v || '', lsclk: pageClick }); // the page's own token rides with the code request (cookie may be blocked in a frame)
const send = busy($('jnSend'), async () => { const send = busy($('jnSend'), async () => {
const r = await IAP.requestCode($('jnEmail').value, codeOpts()); const r = await IAP.requestCode($('jnEmail').value, codeOpts());
$('jnCodeRow').hidden = false; $('jnVerify').hidden = false; $('jnSend').hidden = true; $('jnResend').hidden = false; $('jnCodeRow').hidden = false; $('jnVerify').hidden = false; $('jnSend').hidden = true; $('jnResend').hidden = false;
@@ -106,7 +105,7 @@
IAP.status('Fresh code sent.', 'ok'); IAP.status('Fresh code sent.', 'ok');
})); }));
$('jnVerify').addEventListener('click', busy($('jnVerify'), async () => { $('jnVerify').addEventListener('click', busy($('jnVerify'), async () => {
await api('/api/auth/email/verify', { email: $('jnEmail').value, code: $('jnCode').value, newsletter: !!$('jnNews').checked, followups: !!$('jnNews').checked, ref: linkTok, lsclk: pageClick }); await api('/api/auth/email/verify', { email: $('jnEmail').value, code: $('jnCode').value, newsletter: !!$('jnNews').checked, followups: !!$('jnNews').checked, ref: linkTok });
IAP.status('You are in. Taking you to your dashboard…', 'ok'); IAP.status('You are in. Taking you to your dashboard…', 'ok');
location.href = '/my?welcome=1'; // dashboard runs the username step + welcome tour on arrival location.href = '/my?welcome=1'; // dashboard runs the username step + welcome tour on arrival
})); }));
+62 -351
View File
@@ -1,4 +1,4 @@
// member share links go out on the share domain (2026-10-20): https://instantadpay.link/<name> (ctbgo.com before 2026-11-04) -> /join/<name> on InstantAdPay. // member share links go out on the share domain (2026-10-20): https://ctbgo.com/<name> -> /join/<name> on InstantAdPay.
// The domain comes from site config (shareDomain); empty falls back to this site's own /join link. // The domain comes from site config (shareDomain); empty falls back to this site's own /join link.
let SHARE_DOMAIN = ''; let SHARE_DOMAIN = '';
const SHARE_READY = fetch('/api/config').then(r => r.json()).then(c => { SHARE_DOMAIN = String((c && c.shareDomain) || '').trim(); }).catch(() => {}); const SHARE_READY = fetch('/api/config').then(r => r.json()).then(c => { SHARE_DOMAIN = String((c && c.shareDomain) || '').trim(); }).catch(() => {});
@@ -39,35 +39,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
function tankHoldText(h) { function tankHoldText(h) {
let t = "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours)."; let t = "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours).";
if (h && h.until) { const ms = h.until - Date.now(); t += ms > 0 ? ' Time left: ' + holdLeft(ms) + '.' : ' Any minute now.'; } if (h && h.until) { const ms = h.until - Date.now(); t += ms > 0 ? ' Time left: ' + holdLeft(ms) + '.' : ' Any minute now.'; }
return t + ' Did someone invite you? Tell us on your Overview.'; return t;
}
// "Who invited you?" card (Marty approved 2026-11-07): a member with no sponsor and no member number can name who invited
// them. Soft: nothing else on the site waits for it, and "Nobody invited me" leaves a small link to bring it back.
function paintInvite(me) {
const c = $('inviteCard'), s = $('inviteSmall'); if (!c || !s) return;
const ask = !me.memberId && me.inviteAsk;
const small = !!(ask && ask.dismissed) && !paintInvite.reopened; // reopened from the small link: the next render must not close it under their fingers
c.hidden = !ask || small; s.hidden = !small;
}
if ($('inviteGo')) {
const say = (t, bad) => { const m = $('inviteMsg'); m.textContent = t || ''; m.style.color = bad ? 'var(--bad)' : ''; };
const go = async () => {
say('');
try {
const who = $('inviteWho').value;
const chk = await api('/api/my/tank/invited', { who, check: true });
if (!(await IAP.confirmBox(chk.name + ' becomes your sponsor. Your sponsor locks on the contract the first time you switch on payouts or buy, so check this is the right person.', { title: 'Who invited you?', ok: 'Yes, ' + chk.name, cancel: 'Not them' }))) return;
const r = await api('/api/my/tank/invited', { who });
$('inviteCard').hidden = true; IAP.status(r.name + ' is now your sponsor.', 'ok'); render();
} catch (e) { say(e.message, true); }
};
$('inviteGo').addEventListener('click', go);
$('inviteWho').addEventListener('keydown', e => { if (e.key === 'Enter') { e.preventDefault(); go(); } });
$('inviteNo').addEventListener('click', async () => {
try { await api('/api/my/tank/invited/dismiss', {}); } catch (e) {}
paintInvite.reopened = false; $('inviteCard').hidden = true; $('inviteSmall').hidden = false;
});
$('inviteBack').addEventListener('click', e => { e.preventDefault(); paintInvite.reopened = true; $('inviteSmall').hidden = true; $('inviteCard').hidden = false; $('inviteWho').focus(); });
} }
// one-tap switch on payouts (2026-10-27): the tank assignment chat + emails link to /my?activate=1#wallet. The intent // one-tap switch on payouts (2026-10-27): the tank assignment chat + emails link to /my?activate=1#wallet. The intent
// survives the sign-in and the wallet link (memory + sessionStorage) and runs the Activate button's own flow once. // survives the sign-in and the wallet link (memory + sessionStorage) and runs the Activate button's own flow once.
@@ -80,7 +52,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
} }
function actNote(text) { function actNote(text) {
let n = $('actIntentNote'); let n = $('actIntentNote');
if (!n && text) { n = document.createElement('p'); n.id = 'actIntentNote'; n.className = 'small'; n.style.cssText = 'margin:8px 0;color:var(--ok);font-weight:600'; } if (!n && text) { n = document.createElement('p'); n.id = 'actIntentNote'; n.className = 'small'; n.style.cssText = 'margin:8px 0;color:#22c55e;font-weight:600'; }
if (!n) return null; if (!n) return null;
n.hidden = !text; n.textContent = text || ''; n.hidden = !text; n.textContent = text || '';
return n; return n;
@@ -155,7 +127,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
{ key: 'level3', label: 'Nexus', sub: 'fully qualified', img: '/badges/badge-nexus.jpg?v=2', ribbonY: 0.73 }, { key: 'level3', label: 'Nexus', sub: 'fully qualified', img: '/badges/badge-nexus.jpg?v=2', ribbonY: 0.73 },
{ key: 'fridays', label: 'Five Fridays', sub: 'five Five Dollar Fridays in a row', img: '/badges/badge-fridays.jpg', ribbonY: 0.719 }, { key: 'fridays', label: 'Five Fridays', sub: 'five Five Dollar Fridays in a row', img: '/badges/badge-fridays.jpg', ribbonY: 0.719 },
{ key: 'gamepass', label: 'Game Pass', sub: 'bought a Game Pass', img: '/badges/badge-gamepass.jpg', ribbonY: 0.84 }, { key: 'gamepass', label: 'Game Pass', sub: 'bought a Game Pass', img: '/badges/badge-gamepass.jpg', ribbonY: 0.84 },
{ key: 'stackpro', label: 'Stack POL Pro', sub: 'unlocked Stack POL Pro', img: '/badges/badge-stackpro.jpg', ribbonY: 0.855 }, // 2026-11-09
// Monthly Refuel badges (2026-10-24): final art, ribbon heights measured per image // Monthly Refuel badges (2026-10-24): final art, ribbon heights measured per image
{ key: 'refuelStart', label: 'Engine Started', sub: 'first monthly refuel', img: '/badges/badge-refuelstart.jpg?v=2', ribbonY: 0.735, earnedOnly: true }, { key: 'refuelStart', label: 'Engine Started', sub: 'first monthly refuel', img: '/badges/badge-refuelstart.jpg?v=2', ribbonY: 0.735, earnedOnly: true },
{ key: 'refuel3', label: 'Refueled 3 months', sub: 'three monthly refuels in a row', img: '/badges/badge-refuel3.jpg?v=3', ribbonY: 0.783, earnedOnly: true }, { key: 'refuel3', label: 'Refueled 3 months', sub: 'three monthly refuels in a row', img: '/badges/badge-refuel3.jpg?v=3', ribbonY: 0.783, earnedOnly: true },
@@ -336,8 +307,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
{ k: 'earned', label: 'Surf earnings', v: m => m.earned || 0 }, { k: 'earned', label: 'Surf earnings', v: m => m.earned || 0 },
{ k: 'balance', label: 'Earned balance', v: m => m.balance || 0 }, { k: 'balance', label: 'Earned balance', v: m => m.balance || 0 },
{ k: 'name', label: 'Name', v: m => String(m.name || '').toLowerCase(), str: true }, { k: 'name', label: 'Name', v: m => String(m.name || '').toLowerCase(), str: true },
// holding tank only (2026-11-18): the network heat score, hottest first by default (a lead the hub has no answer for sorts last)
{ k: 'heat', label: 'Heat', v: m => (window.TankReady ? TankReady.score(m) : -1), only: 'tank' },
]; ];
const LIST_FILTERS = [ const LIST_FILTERS = [
{ k: 'today', label: 'Active today', t: m => activeToday(m) }, { k: 'today', label: 'Active today', t: m => activeToday(m) },
@@ -346,32 +315,21 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
{ k: 'nopay', label: 'Wallet, payouts off', t: m => !!m.wallet && !m.activated }, { k: 'nopay', label: 'Wallet, payouts off', t: m => !!m.wallet && !m.activated },
{ k: 'payouts', label: 'Payouts on', t: m => !!m.activated }, { k: 'payouts', label: 'Payouts on', t: m => !!m.activated },
{ k: 'nowallet', label: 'No wallet', t: m => !m.wallet }, { k: 'nowallet', label: 'No wallet', t: m => !m.wallet },
{ k: 'pulse', label: 'Warm or hot', t: m => !!(m.rd && m.rd.heat && m.rd.heat.score >= 40), only: 'tank' },
]; ];
const listState = key => LIST_UI[key] || (LIST_UI[key] = { sort: key === 'tank' ? 'heat' : 'seen', dir: -1, on: new Set(), q: '' }); const listState = key => LIST_UI[key] || (LIST_UI[key] = { sort: 'seen', dir: -1, on: new Set() });
// search box (Marty, 2026-11-12: "a user can find their member in the list"): name, username, email or member number
const listHay = m => [m.name, m.username, m.email, m.ref, m.src, m.memberId ? '#' + m.memberId : ''].filter(Boolean).join(' ').toLowerCase();
function listApply(key, rows) { function listApply(key, rows) {
const st = listState(key); const s = LIST_SORTS.find(x => x.k === st.sort) || LIST_SORTS[0]; const st = listState(key); const s = LIST_SORTS.find(x => x.k === st.sort) || LIST_SORTS[0];
const q = String(st.q || '').trim().toLowerCase().replace(/^@/, ''); const out = (rows || []).filter(m => m.own || [...st.on].every(k => { const f = LIST_FILTERS.find(x => x.k === k); return !f || f.t(m); }));
const out = (rows || []).filter(m => (!q || listHay(m).includes(q))
&& (m.own || [...st.on].every(k => { const f = LIST_FILTERS.find(x => x.k === k); return !f || f.t(m); })));
out.sort((a, b) => { const x = s.v(a), y = s.v(b); return (s.str ? String(x).localeCompare(String(y)) : x - y) * st.dir; }); out.sort((a, b) => { const x = s.v(a), y = s.v(b); return (s.str ? String(x).localeCompare(String(y)) : x - y) * st.dir; });
return out; return out;
} }
function listBar(key, total, shown, rerender, opts) { function listBar(key, total, shown, rerender, opts) {
const st = listState(key); const hide = (opts && opts.hide) || []; const st = listState(key); const hide = (opts && opts.hide) || [];
const bar = document.createElement('div'); bar.className = 'lst-bar'; const bar = document.createElement('div'); bar.className = 'lst-bar';
bar.innerHTML = '<input type="search" class="lst-q" placeholder="Find a member: name, username or email" aria-label="Find a member in this list" autocomplete="off" spellcheck="false">' bar.innerHTML = '<label class="lst-sort">Sort <select aria-label="Sort by">' + LIST_SORTS.map(s => '<option value="' + s.k + '"' + (s.k === st.sort ? ' selected' : '') + '>' + s.label + '</option>').join('') + '</select></label>'
+ '<label class="lst-sort">Sort <select aria-label="Sort by">' + LIST_SORTS.filter(s => !s.only || s.only === key).map(s => '<option value="' + s.k + '"' + (s.k === st.sort ? ' selected' : '') + '>' + s.label + '</option>').join('') + '</select></label>'
+ '<button type="button" class="lst-dir" title="Flip the order">' + (st.dir < 0 ? '&#8595; high to low' : '&#8593; low to high') + '</button>' + '<button type="button" class="lst-dir" title="Flip the order">' + (st.dir < 0 ? '&#8595; high to low' : '&#8593; low to high') + '</button>'
+ '<span class="lst-chips">' + LIST_FILTERS.filter(f => !hide.includes(f.k) && (!f.only || f.only === key)).map(f => '<button type="button" class="lst-chip' + (st.on.has(f.k) ? ' on' : '') + '" data-f="' + f.k + '" aria-pressed="' + (st.on.has(f.k) ? 'true' : 'false') + '">' + f.label + '</button>').join('') + '</span>' + '<span class="lst-chips">' + LIST_FILTERS.filter(f => !hide.includes(f.k)).map(f => '<button type="button" class="lst-chip' + (st.on.has(f.k) ? ' on' : '') + '" data-f="' + f.k + '" aria-pressed="' + (st.on.has(f.k) ? 'true' : 'false') + '">' + f.label + '</button>').join('') + '</span>'
+ '<span class="lst-n">' + (shown === total ? total + (total === 1 ? ' person' : ' people') : shown + ' of ' + total) + '</span>'; + '<span class="lst-n">' + (shown === total ? total + (total === 1 ? ' person' : ' people') : shown + ' of ' + total) + '</span>';
// the list (and this bar with it) is rebuilt on every keystroke, so the new box takes the focus and caret back
const qi = bar.querySelector('.lst-q'); qi.value = st.q || '';
if (Date.now() - (st.qAt || 0) < 1000) setTimeout(() => { qi.focus(); const n = qi.value.length; try { qi.setSelectionRange(n, n); } catch (e) {} }, 0);
let qt = null;
qi.addEventListener('input', () => { clearTimeout(qt); qt = setTimeout(() => { st.q = qi.value; st.qAt = Date.now(); Object.keys(PAGE_AT).forEach(k => { if (k === key || k.startsWith(key + '-')) delete PAGE_AT[k]; }); rerender(); }, 150); }); // a new search starts on page 1
bar.querySelector('select').addEventListener('change', e => { st.sort = e.target.value; st.dir = st.sort === 'name' ? 1 : -1; rerender(); }); bar.querySelector('select').addEventListener('change', e => { st.sort = e.target.value; st.dir = st.sort === 'name' ? 1 : -1; rerender(); });
bar.querySelector('.lst-dir').addEventListener('click', () => { st.dir = -st.dir; rerender(); }); bar.querySelector('.lst-dir').addEventListener('click', () => { st.dir = -st.dir; rerender(); });
bar.querySelectorAll('[data-f]').forEach(b => b.addEventListener('click', () => { const k = b.dataset.f; if (st.on.has(k)) st.on.delete(k); else st.on.add(k); rerender(); })); bar.querySelectorAll('[data-f]').forEach(b => b.addEventListener('click', () => { const k = b.dataset.f; if (st.on.has(k)) st.on.delete(k); else st.on.add(k); rerender(); }));
@@ -437,8 +395,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
})); }));
host.appendChild(bar); host.appendChild(bar);
} }
// chart colours come from the live theme tokens (2026-11-01): read at draw time so a theme switch repaints correctly const CH = { mint: '#43e8c3', cyan: '#54ccff', violet: '#9d7dff', amber: '#ffb238', track: 'rgba(139,166,156,.18)' };
const CH = new Proxy({}, { get: (_, k) => { const cs = getComputedStyle(document.documentElement); const v = { mint: '--mint', cyan: '--cyan', violet: '--violet', amber: '--amber', track: '--muted-soft' }[k]; return (v && cs.getPropertyValue(v).trim()) || { mint: '#43e8c3', cyan: '#54ccff', violet: '#9d7dff', amber: '#ffb238', track: 'rgba(139,166,156,.18)' }[k]; } });
function bars(el, xel, data) { // data: [{v,label,tip,alt}] function bars(el, xel, data) { // data: [{v,label,tip,alt}]
if (!el) return; if (!el) return;
const max = Math.max(1, ...data.map(d => d.v)); const max = Math.max(1, ...data.map(d => d.v));
@@ -460,7 +417,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
off -= len; off -= len;
} }
out += '<text x="21" y="20.5" text-anchor="middle" fill="currentColor" font-size="6.5" font-weight="800" class="donut-center">' + esc(center.big) + '</text>' out += '<text x="21" y="20.5" text-anchor="middle" fill="currentColor" font-size="6.5" font-weight="800" class="donut-center">' + esc(center.big) + '</text>'
+ '<text x="21" y="26.5" text-anchor="middle" style="fill:var(--muted)" font-size="3.1">' + esc(center.small) + '</text>'; + '<text x="21" y="26.5" text-anchor="middle" fill="#8ba69c" font-size="3.1">' + esc(center.small) + '</text>';
el.innerHTML = out; el.innerHTML = out;
} }
function legend(el, rows) { function legend(el, rows) {
@@ -635,28 +592,18 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
}).join(''); }).join('');
} catch (e) {} } catch (e) {}
} }
// where a direct came from + how they joined (Marty, 2026-11-12: "it was kind of buried in there"). src = the first-touch
// referring site, with the link's ?src= tag since 2026-11-12 ("mailer.gold/mailergold", or just "mailergold"); via = the path.
const VIA_LABEL = { btc4hits: 'moved over from BTC4Hits', linkspin: 'came over from LinkSpin', page: 'your bridge page', direct: 'your invite link',
'fw-earn': 'FaucetWave', 't1-adv': 'Tier1Ads', polminer: 'POL Miner', seek: 'ClutterHunt', polhunter: 'PolHunter', driprunner: 'Drip Runner', gemkingdom: 'Gem Kingdom', tank: 'adopted from the holding tank' };
const srcLabel = s => !s ? '' : s === 'direct' ? 'no referring site' : s === 'linkspin' ? 'LinkSpin' : /^legacy:/.test(s) ? s.split(':')[1] : s;
const originText = m => { const a = srcLabel(m.src), b = m.via ? (VIA_LABEL[m.via] || ('link "' + m.via + '"')) : '';
return (a ? 'from ' + a : '') + (a && b ? ' · ' : '') + (b ? 'via ' + b : ''); };
// visual line tree on the Overview: YOU + three levels, qualified directs in gold // visual line tree on the Overview: YOU + three levels, qualified directs in gold
function renderRoster(wrap, all) { function renderRoster(wrap, all) {
const rows = listApply('roster', all); const rows = listApply('roster', all);
wrap.querySelectorAll(':scope > .lst-bar, :scope > table, :scope > .pgr, :scope > .lst-none').forEach(n => n.remove()); wrap.querySelectorAll(':scope > .lst-bar, :scope > table, :scope > .pgr, :scope > .lst-none').forEach(n => n.remove());
wrap.appendChild(listBar('roster', all.length, rows.length, () => renderRoster(wrap, all))); wrap.appendChild(listBar('roster', all.length, rows.length, () => renderRoster(wrap, all)));
if (!rows.length) { wrap.insertAdjacentHTML('beforeend', '<p class="muted small lst-none">Nobody in your line matches your search or filters.</p>'); return; } if (!rows.length) { wrap.insertAdjacentHTML('beforeend', '<p class="muted small lst-none">Nobody in your line matches those filters.</p>'); return; }
const t = document.createElement('table'); t.className = 'roster'; const t = document.createElement('table'); t.className = 'roster';
t.innerHTML = rows.map(r => '<tr><td>' + (r.email && /\*\*\*/.test(r.name || '') ? '<span class="muted">no username yet</span>' : esc(r.name ? (/^@|\*\*\*/.test(r.name) ? r.name : '@' + r.name) : r.email || '')) t.innerHTML = rows.map(r => '<tr><td>' + esc(r.name || r.email || '') + '</td>'
+ (r.email ? '<div class="small mono roster-em">' + esc(r.email) + ' <button type="button" class="lst-copy" data-copy="' + esc(r.email) + '" title="Copy email">copy</button></div>' : '')
+ (originText(r) ? '<div class="muted small">' + esc(originText(r)) + '</div>' : '') + '</td>'
+ '<td><span class="muted">joined</span> ' + new Date(r.joined).toLocaleDateString() + '</td>' + '<td><span class="muted">joined</span> ' + new Date(r.joined).toLocaleDateString() + '</td>'
+ '<td>' + memberChips(r) + '</td>' + '<td>' + memberChips(r) + '</td>'
+ '<td><span class="badge' + (r.status === 'joined free' ? ' amber' : '') + '">' + esc(r.status) + '</span></td></tr>').join(''); + '<td><span class="badge' + (r.status === 'joined free' ? ' amber' : '') + '">' + esc(r.status) + '</span></td></tr>').join('');
wrap.appendChild(t); wrap.appendChild(t);
t.querySelectorAll('[data-copy]').forEach(b => b.addEventListener('click', async () => { try { await navigator.clipboard.writeText(b.dataset.copy); IAP.status('Email copied.', 'ok'); } catch (e) { IAP.status('Copy failed. Select the address and copy it.', 'bad'); } }));
pageList('roster', wrap, 'table.roster tr', { per: LINE_PER }); pageList('roster', wrap, 'table.roster tr', { per: LINE_PER });
} }
async function loadLineTree(buyerCount) { async function loadLineTree(buyerCount) {
@@ -708,7 +655,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const r = await (await fetch('/api/leaderboard?period=week')).json(); const r = await (await fetch('/api/leaderboard?period=week')).json();
const esc = t => String(t == null ? '' : t).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c])); const esc = t => String(t == null ? '' : t).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
let h = r.prize ? '<p style="margin:0 0 8px"><b>Prize this week:</b> ' + esc(r.prize) + '</p>' : ''; let h = r.prize ? '<p style="margin:0 0 8px"><b>Prize this week:</b> ' + esc(r.prize) + '</p>' : '';
h += r.top.length ? '<table style="width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums">' + r.top.slice(0, 5).map(x => '<tr><td style="padding:3px 0;width:26px;color:' + (x.rank === 1 ? 'var(--gold)' : 'var(--muted)') + '">' + x.rank + '</td><td style="padding:3px 0"><b>' + esc(x.name) + '</b></td><td style="padding:3px 0;text-align:right">' + x.sales + ' sold · $' + x.usd + '</td></tr>').join('') + '</table>' h += r.top.length ? '<table style="width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums">' + r.top.slice(0, 5).map(x => '<tr><td style="padding:3px 0;width:26px;color:' + (x.rank === 1 ? '#ffd15c' : 'var(--muted)') + '">' + x.rank + '</td><td style="padding:3px 0"><b>' + esc(x.name) + '</b></td><td style="padding:3px 0;text-align:right">' + x.sales + ' sold · $' + x.usd + '</td></tr>').join('') + '</table>'
: '<p class="muted" style="margin:0">No packages sold yet this week. First sale takes the top spot.</p>'; : '<p class="muted" style="margin:0">No packages sold yet this week. First sale takes the top spot.</p>';
h += r.me ? '<p style="margin:8px 0 0">You: <b>#' + r.me.rank + '</b> · ' + r.me.sales + ' sold · $' + r.me.usd + '</p>' : '<p class="muted" style="margin:8px 0 0">You: no sales yet this week. Sales are $20+ packages bought by people you sponsor.</p>'; h += r.me ? '<p style="margin:8px 0 0">You: <b>#' + r.me.rank + '</b> · ' + r.me.sales + ' sold · $' + r.me.usd + '</p>' : '<p class="muted" style="margin:8px 0 0">You: no sales yet this week. Sales are $20+ packages bought by people you sponsor.</p>';
h += '<p style="margin:6px 0 0"><a href="/leaderboard" target="_blank" rel="noopener" style="color:var(--mint)">Full leaderboard: week, month, all time →</a></p>'; h += '<p style="margin:6px 0 0"><a href="/leaderboard" target="_blank" rel="noopener" style="color:var(--mint)">Full leaderboard: week, month, all time →</a></p>';
@@ -756,7 +703,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const pane = document.querySelector('#pane-buy .card'); if (!pane) return; const pane = document.querySelector('#pane-buy .card'); if (!pane) return;
let box = document.getElementById('starterBox'); if (!box) { box = document.createElement('div'); box.id = 'starterBox'; pane.insertBefore(box, pane.children[1] || null); } let box = document.getElementById('starterBox'); if (!box) { box = document.createElement('div'); box.id = 'starterBox'; pane.insertBefore(box, pane.children[1] || null); }
const esc = t => String(t).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c])); const esc = t => String(t).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
box.style.cssText = 'border:1px solid var(--gold, #e2b04a);border-radius:12px;padding:12px 14px;margin:0 0 14px;background:var(--gold-soft)'; box.style.cssText = 'border:1px solid var(--gold, #e2b04a);border-radius:12px;padding:12px 14px;margin:0 0 14px;background:rgba(226,176,74,.08)';
box.innerHTML = v.eligible box.innerHTML = v.eligible
? '<b>Welcome from ' + esc(v.game) + '!</b><br><span class="small">Your first package, $5 or more, comes with <b>+' + v.bonus + ' bonus ad credits</b>, and ' + esc(v.perk) + ' waiting for you in ' + esc(v.game) + '.</span>' ? '<b>Welcome from ' + esc(v.game) + '!</b><br><span class="small">Your first package, $5 or more, comes with <b>+' + v.bonus + ' bonus ad credits</b>, and ' + esc(v.perk) + ' waiting for you in ' + esc(v.game) + '.</span>'
: '<b>You are a member.</b> <span class="small">' + (v.granted ? 'Your +' + v.bonus + ' welcome credits are in your balance. ' : '') + 'Your ' + esc(v.perk) + ' is waiting in ' + esc(v.game) + '.</span><br><a class="btn small" style="margin-top:8px;display:inline-block" href="' + esc(v.back) + '">Back to ' + esc(v.game) + ' to collect it</a>'; : '<b>You are a member.</b> <span class="small">' + (v.granted ? 'Your +' + v.bonus + ' welcome credits are in your balance. ' : '') + 'Your ' + esc(v.perk) + ' is waiting in ' + esc(v.game) + '.</span><br><a class="btn small" style="margin-top:8px;display:inline-block" href="' + esc(v.back) + '">Back to ' + esc(v.game) + ' to collect it</a>';
@@ -857,17 +804,13 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (tw && tw.count) tn.innerHTML = '<b>' + tw.count + (tw.count === 1 ? ' person is' : ' people are') + ' waiting for a sponsor in the holding tank</b> \u00b7 ' if (tw && tw.count) tn.innerHTML = '<b>' + tw.count + (tw.count === 1 ? ' person is' : ' people are') + ' waiting for a sponsor in the holding tank</b> \u00b7 '
+ tw.names.map(esc).join(', ') + (tw.count > tw.names.length ? ' and more' : '') + '. <a href="#line">Adopt them from My line</a>' + tw.names.map(esc).join(', ') + (tw.count > tw.names.length ? ' and more' : '') + '. <a href="#line">Adopt them from My line</a>'
+ (tw.eligible ? '.' : ' (you need your own $20 package first).') + (tw.eligible ? '.' : ' (you need your own $20 package first).')
+ (tw.ready ? ' <b style="color:var(--ok)">' + tw.ready + ' of them ' + (tw.ready === 1 ? 'has' : 'have') + ' linked a wallet and ' + (tw.ready === 1 ? 'is' : 'are') + ' ready to switch on payouts.</b>' : ''); + (tw.ready ? ' <b style="color:#22c55e">' + tw.ready + ' of them ' + (tw.ready === 1 ? 'has' : 'have') + ' linked a wallet and ' + (tw.ready === 1 ? 'is' : 'are') + ' ready to switch on payouts.</b>' : '');
} }
} catch (e) {} } catch (e) {}
// Share the presentation (2026-10-15): instantadpay.com/presentation?ref=<username> sets the same sponsor cookie as /join // Share the presentation (2026-10-15): instantadpay.com/presentation?ref=<username> sets the same sponsor cookie as /join
{ const tokP = d.username || d.refCode || d.memberId; const ps = $('promoPresStrip'); { const tokP = d.username || d.refCode || d.memberId; const ps = $('promoPresStrip');
if (ps && tokP) { const pl = 'https://instantadpay.com/presentation?ref=' + encodeURIComponent(tokP); ps.hidden = false; $('promoPresLink').textContent = pl; $('promoPresOpen').href = '/presentation?ref=' + encodeURIComponent(tokP); if (ps && tokP) { const pl = 'https://instantadpay.com/presentation?ref=' + encodeURIComponent(tokP); ps.hidden = false; $('promoPresLink').textContent = pl; $('promoPresOpen').href = '/presentation?ref=' + encodeURIComponent(tokP);
$('promoPresCopy').onclick = async () => { try { await navigator.clipboard.writeText(pl); IAP.status('Presentation link copied.', 'ok'); } catch (e) { IAP.status('Copy failed. Select the link and copy it.', 'bad'); } }; } } $('promoPresCopy').onclick = async () => { try { await navigator.clipboard.writeText(pl); IAP.status('Presentation link copied.', 'ok'); } catch (e) { IAP.status('Copy failed. Select the link and copy it.', 'bad'); } }; } }
// Chasing Unicorns (2026-11-12): the scam-spotting lead magnet, shared with the member's ?ref= (the viral link sets the sponsor)
{ const tokU = d.username || d.refCode || d.memberId; const us = $('promoUniStrip');
if (us && tokU) { const ul = 'https://instantadpay.com/chasing-unicorns?ref=' + encodeURIComponent(tokU); us.hidden = false; $('promoUniLink').textContent = ul; $('promoUniOpen').href = '/chasing-unicorns?ref=' + encodeURIComponent(tokU);
$('promoUniCopy').onclick = async () => { try { await navigator.clipboard.writeText(ul); IAP.status('Chasing Unicorns link copied.', 'ok'); } catch (e) { IAP.status('Copy failed. Select the link and copy it.', 'bad'); } }; } }
if (d.username) { // wall link rides the username if (d.username) { // wall link rides the username
const wl = location.origin + '/wall/' + d.username; const wl = location.origin + '/wall/' + d.username;
$('wallLine').textContent = wl; $('wallLine').textContent = wl;
@@ -910,7 +853,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const el = $(id); const el = $(id);
if (!el || el.hidden || !el.offsetParent) { if (Date.now() - t0 < 20000) setTimeout(tick, 300); return; } if (!el || el.hidden || !el.offsetParent) { if (Date.now() - t0 < 20000) setTimeout(tick, 300); return; }
el.scrollIntoView({ behavior: 'smooth', block: 'start' }); el.scrollIntoView({ behavior: 'smooth', block: 'start' });
el.style.transition = 'box-shadow .4s'; el.style.boxShadow = '0 0 0 3px var(--mint)'; el.style.transition = 'box-shadow .4s'; el.style.boxShadow = '0 0 0 3px #45e3c4';
setTimeout(() => { el.style.boxShadow = ''; }, 2600); setTimeout(() => { el.style.boxShadow = ''; }, 2600);
const inp = inputId && $(inputId); if (inp && !inp.closest('[hidden]')) setTimeout(() => { try { inp.focus({ preventScroll: true }); } catch (e) {} }, 500); const inp = inputId && $(inputId); if (inp && !inp.closest('[hidden]')) setTimeout(() => { try { inp.focus({ preventScroll: true }); } catch (e) {} }, 500);
}; };
@@ -938,10 +881,8 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (name === 'profile') loadLineBanner(); if (name === 'profile') loadLineBanner();
if (name === 'line') { buildLineJump(); loadLineage(); loadUplineMessages(); loadCoach(); loadLinkStats(); loadProspects(); } if (name === 'line') { buildLineJump(); loadLineage(); loadUplineMessages(); loadCoach(); loadLinkStats(); loadProspects(); }
if (name === 'campaigns') ['cTarget', 'cImage', 'cVideoUrl'].forEach(id => { if ($(id)) $(id).value = ''; }); // no residual URL between visits if (name === 'campaigns') ['cTarget', 'cImage', 'cVideoUrl'].forEach(id => { if ($(id)) $(id).value = ''; }); // no residual URL between visits
if (name === 'campaigns' && /(^|&)video=/.test(paneQ)) prefillVideoAd(paneQ); // /my#campaigns?video=...: the video ad form filled in (Video App Income's "Run this on InstantAdPay", 2026-11-22)
if (name === 'training') { if (/(^|&)g=leader/.test(paneQ)) loadTraining.filter = 'Leader tools'; loadTraining(); } if (name === 'training') { if (/(^|&)g=leader/.test(paneQ)) loadTraining.filter = 'Leader tools'; loadTraining(); }
if (name === 'pipeline') loadPipeline(); if (name === 'pipeline') loadPipeline();
if (name === 'promo') { const ps = /(^|&)s=([a-z]+)/.exec(paneQ || ''); if (ps) setPromoSub(ps[2]); }
if (name === 'games') loadGames(paneQ); if (name === 'games') loadGames(paneQ);
if (name === 'help' && window.IAPSupport) IAPSupport.help(paneQ); // help desk tickets (2026-10-16) if (name === 'help' && window.IAPSupport) IAPSupport.help(paneQ); // help desk tickets (2026-10-16)
document.getElementById('memberArea').classList.remove('side-open'); // close mobile drawer document.getElementById('memberArea').classList.remove('side-open'); // close mobile drawer
@@ -975,7 +916,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
$('authArea').hidden = !!signedIn; $('authArea').hidden = !!signedIn;
$('memberArea').hidden = !signedIn; $('memberArea').hidden = !signedIn;
if ($('mcFinish')) $('mcFinish').hidden = !walletOnly; if ($('mcFinish')) $('mcFinish').hidden = !walletOnly;
if (IAP.themeSync) IAP.themeSync(signedIn ? me : null); // appearance (2026-11-01): the account's theme wins at sign-in, a local choice is pushed up when the account has none
if (!signedIn) return; if (!signedIn) return;
TANK_HOLD = (!me.memberId && me.tankHold) || null; TANK_HOLD = (!me.memberId && me.tankHold) || null;
if ($('adminLink')) $('adminLink').hidden = !me.isAdmin; // admin portal link, only for ADMIN_EMAIL if ($('adminLink')) $('adminLink').hidden = !me.isAdmin; // admin portal link, only for ADMIN_EMAIL
@@ -986,18 +926,13 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (!render.gating) { render.gating = true; showOnboard(true).then(() => { render.gating = false; render(); }); } if (!render.gating) { render.gating = true; showOnboard(true).then(() => { render.gating = false; render(); }); }
return; return;
} }
paintInvite(me);
// came from a Drip Runner share link: once they have a username, straight back into the game (2026-09-30) // came from a Drip Runner share link: once they have a username, straight back into the game (2026-09-30)
if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; } if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; }
if (me.returnTo === 'gemkingdom' && !render.toGame) { render.toGame = true; location.href = '/api/my/gemkingdom'; return; } // Gem Kingdom sent them here to sign in (2026-10-01) if (me.returnTo === 'gemkingdom' && !render.toGame) { render.toGame = true; location.href = '/api/my/gemkingdom'; return; } // Gem Kingdom sent them here to sign in (2026-10-01)
if (me.returnTo === 'gkshop' && !render.toGame) { render.toGame = true; location.href = '/gk/shop/resume'; return; } if (me.returnTo === 'gkshop' && !render.toGame) { render.toGame = true; location.href = '/gk/shop/resume'; return; }
if (me.returnTo === 'spookydoors' && !render.toGame) { render.toGame = true; location.href = '/api/my/spookydoors'; return; } // Spooky Doors sent them here to sign in (2026-10-02) if (me.returnTo === 'spookydoors' && !render.toGame) { render.toGame = true; location.href = '/api/my/spookydoors'; return; } // Spooky Doors sent them here to sign in (2026-10-02)
if (me.returnTo === 'polybreak' && !render.toGame) { render.toGame = true; location.href = '/api/my/polybreak'; return; } // PolyBreak sent them here to sign in (2026-10-13) if (me.returnTo === 'polybreak' && !render.toGame) { render.toGame = true; location.href = '/api/my/polybreak'; return; } // PolyBreak sent them here to sign in (2026-10-13)
if (me.returnTo === 'nsso' && !render.toGame) { render.toGame = true; location.href = '/sso/resume'; return; } // tapped "Sign in with InstantAdPay" on another network site while signed out here (2026-11-14)
if (me.nssoBackTo && !me.nssoBack && !me.address && !render.walletAsk) { render.walletAsk = true; setTimeout(() => IAP.status(me.nssoBackTo + ' signs you in with your wallet. Link it here on the Wallet tab (one free signature) and you go straight back to ' + me.nssoBackTo + '.'), 2500); } // after the sign-in toasts (daily bonus), and it stays up // waiting on the wallet step (2026-11-17)
if (me.returnTo === 'forum' && !render.toGame) { render.toGame = true; location.href = '/api/my/forum'; return; } // Earners Corner forum sign-in (2026-11-10)
if (me.returnTo === 'polminer' && !render.toGame) { render.toGame = true; location.href = '/api/my/polminer'; return; } // POL Miner sent them here to sign in (2026-10-28) if (me.returnTo === 'polminer' && !render.toGame) { render.toGame = true; location.href = '/api/my/polminer'; return; } // POL Miner sent them here to sign in (2026-10-28)
if (me.returnTo === 'warpwares' && !render.toGame) { render.toGame = true; location.href = '/api/my/warpwares'; return; } // Warp & Wares sent them here to sign in (2026-10-29)
if (me.returnTo === 'turkeydrop' && !render.toGame) { render.toGame = true; location.href = '/api/my/turkeydrop'; return; } // Turkey Drop sent them here to sign in (2026-10-28) if (me.returnTo === 'turkeydrop' && !render.toGame) { render.toGame = true; location.href = '/api/my/turkeydrop'; return; } // Turkey Drop sent them here to sign in (2026-10-28)
if (me.returnTo === 'shardsofvalor' && !render.toGame) { render.toGame = true; location.href = '/api/my/shardsofvalor'; return; } // Shards of Valor sent them here to sign in (2026-10-18) if (me.returnTo === 'shardsofvalor' && !render.toGame) { render.toGame = true; location.href = '/api/my/shardsofvalor'; return; } // Shards of Valor sent them here to sign in (2026-10-18)
if (me.returnTo === 'pwmint' && !render.toGame) { render.toGame = true; location.href = '/pw/mint/resume'; return; } // PolyWarriors paid mint (2026-10-05) if (me.returnTo === 'pwmint' && !render.toGame) { render.toGame = true; location.href = '/pw/mint/resume'; return; } // PolyWarriors paid mint (2026-10-05)
@@ -1014,24 +949,22 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
render.welcomed = true; render.welcomed = true;
history.replaceState(null, '', '/my' + (location.hash || '')); history.replaceState(null, '', '/my' + (location.hash || ''));
(async () => { (async () => {
try { if (await showGauntlet()) showLoginAd.asked = true; else await showLoginAd(); } catch (e) {} try { if (!(await showGauntlet())) await showLoginAd(); } catch (e) {}
await render(); await render();
})(); })();
} else if (!showLoginAd.asked) { // login ad on the member's clock (Marty 2026-11-15): any page load, signed in just now or not; the server says when it is due
(async () => { try { await showLoginAd(); } catch (e) {} if (me.nssoBack && me.username) location.href = '/sso/resume'; })();
} }
starterBanner(me).catch(() => {}); starterBanner(me).catch(() => {});
setPane(location.hash.slice(1) || 'overview'); setPane(location.hash.slice(1) || 'overview');
$('campGate').hidden = !!me.memberId; $('campGate').hidden = !!me.memberId;
$('earnGate').hidden = !!me.memberId; $('earnGate').hidden = !!me.memberId;
if (me.username && !me.address && !render.walletAsk) { let shown = ''; try { shown = sessionStorage.getItem('iap.gs.walletHint'); sessionStorage.setItem('iap.gs.walletHint', '1'); } catch (e) {} if (shown !== '1') setTimeout(() => IAP.status('Next step when you are ready: link your wallet so your payouts have somewhere to land. The Getting started card at the top shows how.', 'ok'), 1200); } if (me.username && !me.address) { let shown = ''; try { shown = sessionStorage.getItem('iap.gs.walletHint'); sessionStorage.setItem('iap.gs.walletHint', '1'); } catch (e) {} if (shown !== '1') setTimeout(() => IAP.status('Next step when you are ready: link your wallet so your payouts have somewhere to land. The Getting started card at the top shows how.', 'ok'), 1200); }
loadDashboard(); loadDashboard();
if (window.IAPSupport) IAPSupport.badge(); // Help badge: Marty replied to a ticket if (window.IAPSupport) IAPSupport.badge(); // Help badge: Marty replied to a ticket
const who = []; const who = [];
if (me.email) who.push(me.email); if (me.email) who.push(me.email);
// members kept asking whether the wallet was really connected (Marty, 2026-09-12): say it, with a green check // members kept asking whether the wallet was really connected (Marty, 2026-09-12): say it, with a green check
if (me.address) who.push('<span style="display:inline-flex;align-items:center;gap:8px"><span aria-hidden="true" style="display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--ok);color:var(--ok-ink);font-weight:900;font-size:13px;line-height:1">&#10003;</span><b style="color:var(--ok)">Wallet connected</b> <span class="mono">' + me.address.slice(0, 8) + '…' + me.address.slice(-6) + '</span></span>'); if (me.address) who.push('<span style="display:inline-flex;align-items:center;gap:8px"><span aria-hidden="true" style="display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:#22c55e;color:#04140a;font-weight:900;font-size:13px;line-height:1">&#10003;</span><b style="color:#22c55e">Wallet connected</b> <span class="mono">' + me.address.slice(0, 8) + '…' + me.address.slice(-6) + '</span></span>');
else who.push('<span style="display:inline-flex;align-items:center;gap:8px"><span aria-hidden="true" style="display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;border:2px solid var(--muted);color:var(--muted);font-weight:900;font-size:12px;line-height:1">!</span><b>No wallet connected yet</b> <span class="muted">(link one below)</span></span>'); else who.push('<span style="display:inline-flex;align-items:center;gap:8px"><span aria-hidden="true" style="display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;border:2px solid var(--muted);color:var(--muted);font-weight:900;font-size:12px;line-height:1">!</span><b>No wallet connected yet</b> <span class="muted">(link one below)</span></span>');
if (me.memberId) who.push('on-chain <b>member #' + me.memberId + '</b>' if (me.memberId) who.push('on-chain <b>member #' + me.memberId + '</b>'
+ (me.onchainSponsorId ? ', sponsored by #' + me.onchainSponsorId : '')); + (me.onchainSponsorId ? ', sponsored by #' + me.onchainSponsorId : ''));
@@ -1042,9 +975,8 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
loadPositions(me); loadPositions(me);
$('linkCard').hidden = !!me.address; $('linkCard').hidden = !!me.address;
$('activateCard').hidden = !(me.address && !me.memberId); $('activateCard').hidden = !(me.address && !me.memberId);
renderBix(me); // BixPay Visa card: Wallet card, Overview announcement, Profile field, promo pill (2026-10-29; nothing while bixpayLive is off)
{ let hn = $('tankHoldNote'); // held for an adopter: say so, and no activate button { let hn = $('tankHoldNote'); // held for an adopter: say so, and no activate button
if (!hn) { hn = document.createElement('p'); hn.id = 'tankHoldNote'; hn.className = 'small'; hn.style.cssText = 'margin:8px 0 0;color:var(--ok)'; $('activateBtn').insertAdjacentElement('beforebegin', hn); } if (!hn) { hn = document.createElement('p'); hn.id = 'tankHoldNote'; hn.className = 'small'; hn.style.cssText = 'margin:8px 0 0;color:#22c55e'; $('activateBtn').insertAdjacentElement('beforebegin', hn); }
hn.hidden = !TANK_HOLD; hn.textContent = TANK_HOLD ? tankHoldText(TANK_HOLD) : ''; $('activateBtn').hidden = !!TANK_HOLD; } hn.hidden = !TANK_HOLD; hn.textContent = TANK_HOLD ? tankHoldText(TANK_HOLD) : ''; $('activateBtn').hidden = !!TANK_HOLD; }
runActivateIntent(me).catch(() => {}); // arrived from the one-tap "Switch on payouts" link (tank assignment chat/email) runActivateIntent(me).catch(() => {}); // arrived from the one-tap "Switch on payouts" link (tank assignment chat/email)
$('activityArea').hidden = !me.memberId; $('activityArea').hidden = !me.memberId;
@@ -1147,9 +1079,9 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
for (const t of p.tiers) { for (const t of p.tiers) {
const me = t.paidTo === r.memberId, skippedMe = t.skipped.some(x => x.id === r.memberId); const me = t.paidTo === r.memberId, skippedMe = t.skipped.some(x => x.id === r.memberId);
let line = '<b>Level ' + t.tier + ' (' + t.pct + '%)</b>: '; let line = '<b>Level ' + t.tier + ' (' + t.pct + '%)</b>: ';
for (const x of t.skipped) line += '<span style="color:var(--warn)">' + nm(x.id) + ' skipped (' + (x.reason === 'unqualified' ? 'not qualified: had ' + x.buyersThen + ' of ' + (t.tier === 2 ? 2 : 5) + ' qualifying buyers then' : esc(x.reason)) + ')</span> → '; for (const x of t.skipped) line += '<span style="color:#f0a742">' + nm(x.id) + ' skipped (' + (x.reason === 'unqualified' ? 'not qualified: had ' + x.buyersThen + ' of ' + (t.tier === 2 ? 2 : 5) + ' qualifying buyers then' : esc(x.reason)) + ')</span> → ';
line += t.paidTo ? '<span style="color:' + (me ? 'var(--ok)' : 'inherit') + '">' + nm(t.paidTo) + ' paid ' + pol(t.amountWei) + '</span>' : '<span class="muted">no eligible catcher within reach → company</span>'; line += t.paidTo ? '<span style="color:' + (me ? '#3ecf7a' : 'inherit') + '">' + nm(t.paidTo) + ' paid ' + pol(t.amountWei) + '</span>' : '<span class="muted">no eligible catcher within reach → company</span>';
h += '<div class="small" style="margin-top:4px' + (me || skippedMe ? ';background:var(--ink-faint);border-radius:6px;padding:2px 6px' : '') + '">' + line + '</div>'; h += '<div class="small" style="margin-top:4px' + (me || skippedMe ? ';background:rgba(255,255,255,.04);border-radius:6px;padding:2px 6px' : '') + '">' + line + '</div>';
} }
h += '<div class="small muted" style="margin-top:4px">Platform (20%): ' + pol(p.adminWei) + (isBuyer ? '' : '') + '</div></div>'; h += '<div class="small muted" style="margin-top:4px">Platform (20%): ' + pol(p.adminWei) + (isBuyer ? '' : '') + '</div></div>';
} }
@@ -1199,7 +1131,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
box.innerHTML = '<h4 style="margin:0 0 4px">Credit activity</h4>' box.innerHTML = '<h4 style="margin:0 0 4px">Credit activity</h4>'
+ '<p class="muted small" style="margin:0 0 8px">Every credit that came in or went out, newest first. Earned credits are spent before purchased ones, so an earn followed by a buy shows as two lines here. Views a campaign delivers roll up into one line per day.</p>' + '<p class="muted small" style="margin:0 0 8px">Every credit that came in or went out, newest first. Earned credits are spent before purchased ones, so an earn followed by a buy shows as two lines here. Views a campaign delivers roll up into one line per day.</p>'
+ '<div class="tablewrap"><table class="camp-table act-table"><tbody>' + '<div class="tablewrap"><table class="camp-table act-table"><tbody>'
+ r.items.map(i => '<tr><td class="muted small" style="white-space:nowrap">' + when(i.ts) + '</td><td class="num" style="white-space:nowrap"><b style="color:' + (i.delta > 0 ? 'var(--ok)' : 'inherit') + '">' + (i.delta > 0 ? '+' : '') + i.delta.toLocaleString() + '</b></td><td>' + esc(i.note) + '</td></tr>').join('') + r.items.map(i => '<tr><td class="muted small" style="white-space:nowrap">' + when(i.ts) + '</td><td class="num" style="white-space:nowrap"><b style="color:' + (i.delta > 0 ? '#3ecf7a' : 'inherit') + '">' + (i.delta > 0 ? '+' : '') + i.delta.toLocaleString() + '</b></td><td>' + esc(i.note) + '</td></tr>').join('')
+ '</tbody></table></div>'; + '</tbody></table></div>';
el.appendChild(box); el.appendChild(box);
pageList('credits', box, 'tbody tr'); pageList('credits', box, 'tbody tr');
@@ -1236,7 +1168,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
else if (Number(c.created) >= since) { spent = Number(c.spent || 0); basis = 'the credits it spent since it started on ' + new Date(Number(c.created)).toLocaleDateString([], { month: 'short', day: 'numeric' }) + ', inside the 30 days'; } else if (Number(c.created) >= since) { spent = Number(c.spent || 0); basis = 'the credits it spent since it started on ' + new Date(Number(c.created)).toLocaleDateString([], { month: 'short', day: 'numeric' }) + ', inside the 30 days'; }
const parts = d.goals.map(g => { const n = Number(b && b.conv && b.conv[g.px]) || 0; const parts = d.goals.map(g => { const n = Number(b && b.conv && b.conv[g.px]) || 0;
return '<span>' + esc(g.name) + ' ' + n.toLocaleString() + (n > 0 && spent != null ? ' (' + convFmt(spent / n) + ' credits each)' : '') + '</span>'; }); return '<span>' + esc(g.name) + ' ' + n.toLocaleString() + (n > 0 && spent != null ? ' (' + convFmt(spent / n) + ' credits each)' : '') + '</span>'; });
el.innerHTML = '\u{1F3AF} <span class="muted">Goals and cost per goal (30 days):</span> ' + parts.join(' · ') + (spent == null ? ' <span class="muted">· no spend on record for these 30 days, so no cost per goal</span>' : '') + (b && b.clicks ? ' <span class="muted">· ' + Number(b.clicks).toLocaleString() + ' tracked clicks</span>' : '') + (() => { const nb = ((d.network || {}).byCampaign || {})[id]; if (!nb) return ''; const bits = [['join', 'joins'], ['wallet', 'wallets'], ['purchase', 'purchases']].filter(([k]) => nb[k]).map(([k, l]) => nb[k].toLocaleString() + ' ' + l); return bits.length ? ' <span>· ' + bits.join(' · ') + (nb.value ? ' ($' + Number(nb.value).toFixed(2) + ')' : '') + '</span>' : ''; })(); el.innerHTML = '\u{1F3AF} <span class="muted">Goals and cost per goal (30 days):</span> ' + parts.join(' · ') + (spent == null ? ' <span class="muted">· no spend on record for these 30 days, so no cost per goal</span>' : '') + (b && b.clicks ? ' <span class="muted">· ' + Number(b.clicks).toLocaleString() + ' tracked clicks</span>' : '');
el.title = 'Goals counted for this campaign in the last 30 days. Cost per goal (30 days) = ' + (spent != null ? basis : 'the credits it spent in the same 30 days') + ', divided by those goals.'; el.title = 'Goals counted for this campaign in the last 30 days. Cost per goal (30 days) = ' + (spent != null ? basis : 'the credits it spent in the same 30 days') + ', divided by those goals.';
el.hidden = false; el.hidden = false;
}); });
@@ -1250,10 +1182,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const st = $('convStatus'), list = $('convGoals'), snips = $('convSnips'), add = $('convAddRow'); const st = $('convStatus'), list = $('convGoals'), snips = $('convSnips'), add = $('convAddRow');
if (!d || !d.ok) { st.textContent = (d && d.error) || 'Conversion tracking is not available right now.'; list.innerHTML = ''; snips.innerHTML = ''; add.hidden = !!(d && d.reason === 'off'); return; } if (!d || !d.ok) { st.textContent = (d && d.error) || 'Conversion tracking is not available right now.'; list.innerHTML = ''; snips.innerHTML = ''; add.hidden = !!(d && d.reason === 'off'); return; }
add.hidden = false; add.hidden = false;
// network events (2026-11-07): sign-ups, wallets and purchases on the member's clicks, plus goals, each once (LinkSpin's one list)
{ const nt = $('convNet'), rows = (d.network && d.network.rows) || []; const NAME = { join: 'joins', lead: 'leads', wallet: 'wallets', purchase: 'purchases', external: 'partner postbacks' };
nt.hidden = !rows.length;
if (rows.length) nt.innerHTML = '<b>Everything your clicks led to (30 days):</b> ' + rows.map(x => esc(Number(x.n).toLocaleString() + ' ' + (NAME[x.k] || String(x.k).replace(/^goal:\s*/, '') + ' (goal)')) + (x.value ? ' ($' + Number(x.value).toFixed(2) + ')' : '')).join(' \u00b7 ') + '.'; }
const goals = d.goals || []; const goals = d.goals || [];
const m = d.methods || {}; const mt = ['url', 'stored', 'cookie', 'soft'].reduce((s, k) => s + (Number(m[k]) || 0), 0); const m = d.methods || {}; const mt = ['url', 'stored', 'cookie', 'soft'].reduce((s, k) => s + (Number(m[k]) || 0), 0);
const selfN = Number(d.selfTests) || 0; // own clicks (ads here, spin links and Banner Spins on LinkSpin), kept as tests const selfN = Number(d.selfTests) || 0; // own clicks (ads here, spin links and Banner Spins on LinkSpin), kept as tests
@@ -1263,7 +1191,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (!convSel || !goals.some(g => g.px === convSel)) convSel = goals[0].px; if (!convSel || !goals.some(g => g.px === convSel)) convSel = goals[0].px;
const when = ts => ts ? new Date(ts).toLocaleString([], { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'never'; const when = ts => ts ? new Date(ts).toLocaleString([], { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) : 'never';
list.innerHTML = '<div class="tablewrap"><table class="camp-table"><thead><tr><th>Goal</th><th class="num">Default value</th><th>Pixel id</th><th class="num">Conversions (30 days)</th><th>Last test</th><th></th></tr></thead><tbody>' list.innerHTML = '<div class="tablewrap"><table class="camp-table"><thead><tr><th>Goal</th><th class="num">Default value</th><th>Pixel id</th><th class="num">Conversions (30 days)</th><th>Last test</th><th></th></tr></thead><tbody>'
+ goals.map(g => '<tr' + (g.px === convSel ? ' style="background:var(--cyan-soft)"' : '') + '><td data-l="Goal"><b>' + esc(g.name) + '</b></td>' + goals.map(g => '<tr' + (g.px === convSel ? ' style="background:rgba(120,160,255,.08)"' : '') + '><td data-l="Goal"><b>' + esc(g.name) + '</b></td>'
+ '<td class="num" data-l="Default value">' + (Number(g.value) > 0 ? esc(g.value) : '<span class="muted">none</span>') + '</td>' + '<td class="num" data-l="Default value">' + (Number(g.value) > 0 ? esc(g.value) : '<span class="muted">none</span>') + '</td>'
+ '<td data-l="Pixel id" class="mono small">' + esc(g.px) + '</td>' + '<td data-l="Pixel id" class="mono small">' + esc(g.px) + '</td>'
+ '<td class="num" data-l="Conversions (30 days)">' + Number(g.conv || 0).toLocaleString() + (g.lastAt ? '<div class="muted small">last ' + when(g.lastAt) + '</div>' : '') + '</td>' + '<td class="num" data-l="Conversions (30 days)">' + Number(g.conv || 0).toLocaleString() + (g.lastAt ? '<div class="muted small">last ' + when(g.lastAt) + '</div>' : '') + '</td>'
@@ -1342,13 +1270,10 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
tbl.className = 'tablewrap'; tbl.className = 'tablewrap';
// syndicated rate (Marty, 2026-10-27, 4:1): network views and partner visits cost 1/N of a view or visit here // syndicated rate (Marty, 2026-10-27, 4:1): network views and partner visits cost 1/N of a view or visit here
const synN = Math.max(1, Math.floor(Number(r.rates && r.rates.synRateDivisor) || 1)); const synN = Math.max(1, Math.floor(Number(r.rates && r.rates.synRateDivisor) || 1));
// text ads have their own network rate since 2026-11-12 (Marty: 1/10, text budgets were gone in about a week) const netCell = c => ['banner', 'text'].includes(c.type) ? (c.impsNas || 0).toLocaleString() + (synN > 1 && c.impsNas ? ' <span class="muted small">at 1/' + synN + '</span>' : '')
const synT = Math.max(1, Math.floor(Number(r.rates && r.rates.synRateDivisorText != null ? r.rates.synRateDivisorText : synN) || 1));
const nOf = c => c.type === 'text' ? synT : synN;
const netCell = c => ['banner', 'text'].includes(c.type) ? (c.impsNas || 0).toLocaleString() + (nOf(c) > 1 && c.impsNas ? ' <span class="muted small">at 1/' + nOf(c) + '</span>' : '')
: (c.type === 'visits' && c.impsSyn) ? c.impsSyn.toLocaleString() + ' <span class="muted small">partner visits' + (synN > 1 ? ', ' + synN + ' = 1 visit' : '') + '</span>' : (c.type === 'visits' && c.impsSyn) ? c.impsSyn.toLocaleString() + ' <span class="muted small">partner visits' + (synN > 1 ? ', ' + synN + ' = 1 visit' : '') + '</span>'
: '<span class="muted small" title="only banner and text ads syndicate to the network">n/a</span>'; : '<span class="muted small" title="only banner and text ads syndicate to the network">n/a</span>';
if (synN > 1) { const n = document.createElement('p'); n.className = 'muted small'; n.textContent = 'Views and visits here on InstantAdPay use credits at the normal rate. Your ads also run on Network Ad Space and partner sites, and that delivery costs a ' + (synN === 4 ? 'quarter' : '1/' + synN) + ' of the rate: ' + synN + ' network views of a banner cost what 1 view here does, and ' + synN + ' partner visits use up 1 visit of your pack.' + (synT === 1 ? ' Text ads are one price everywhere: 1 credit buys ' + (Number(r.rates && r.rates.textBatch) || 100) + ' text views, here or on the network.' : synT !== synN ? ' Text ads go further still: ' + synT + ' network views of a text ad cost what 1 view here does.' : '') + ' Your budget goes further and every credit still buys real delivery.'; el.appendChild(n); } if (synN > 1) { const n = document.createElement('p'); n.className = 'muted small'; n.textContent = 'Views and visits here on InstantAdPay use credits at the normal rate. Your ads also run on Network Ad Space and partner sites, and that delivery costs a ' + (synN === 4 ? 'quarter' : '1/' + synN) + ' of the rate: ' + synN + ' network views cost what 1 view here does, and ' + synN + ' partner visits use up 1 visit of your pack. Your budget goes further and every credit still buys real delivery.'; el.appendChild(n); }
tbl.innerHTML = '<table class="camp-table"><thead><tr><th>Name</th><th>Type</th><th class="num">Views here</th><th class="num" title="Impressions delivered by Network Ad Space across the wider network (banner and text ads), and visits from partner sites (visit packs)' + (synN > 1 ? ', at 1/' + synN + ' of the rate here' : '') + '">Network views</th><th class="num">Clicks</th>' tbl.innerHTML = '<table class="camp-table"><thead><tr><th>Name</th><th>Type</th><th class="num">Views here</th><th class="num" title="Impressions delivered by Network Ad Space across the wider network (banner and text ads), and visits from partner sites (visit packs)' + (synN > 1 ? ', at 1/' + synN + ' of the rate here' : '') + '">Network views</th><th class="num">Clicks</th>'
+ '<th class="num">Spent</th><th class="num">Budget</th><th>Status</th><th></th></tr></thead><tbody>' + '<th class="num">Spent</th><th class="num">Budget</th><th>Status</th><th></th></tr></thead><tbody>'
+ r.campaigns.map(c => '<tr><td data-l="Campaign"><b>' + c.name + '</b>' + hourBars(r.hours && r.hours[c.id]) + geoLine(r.geo && r.geo[c.id]) + '<div class="muted small conv-line" data-convcamp="' + c.id + '" hidden></div></td>' + r.campaigns.map(c => '<tr><td data-l="Campaign"><b>' + c.name + '</b>' + hourBars(r.hours && r.hours[c.id]) + geoLine(r.geo && r.geo[c.id]) + '<div class="muted small conv-line" data-convcamp="' + c.id + '" hidden></div></td>'
@@ -1547,7 +1472,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
$('cSizeRow').hidden = t !== 'banner'; $('cSizeRow').hidden = t !== 'banner';
$('cTitleRow').hidden = t !== 'text' && t !== 'solo'; $('cTitleRow').hidden = t !== 'text' && t !== 'solo';
$('cBodyRow').hidden = t !== 'text'; $('cBodyRow').hidden = t !== 'text';
if ($('cAiRow')) $('cAiRow').hidden = t !== 'text' || !aiWriterOn;
$('cSoloRow').hidden = t !== 'solo'; $('cSoloRow').hidden = t !== 'solo';
$('cSoloHint').hidden = t !== 'solo'; $('cSoloHint').hidden = t !== 'solo';
$('cVideoRow').hidden = t !== 'video'; $('cVideoRow').hidden = t !== 'video';
@@ -1568,28 +1492,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (t === 'featured') featHint(); if (t === 'featured') featHint();
} }
$('cType').addEventListener('change', applyType); $('cType').addEventListener('change', applyType);
// the AI ad writer (Marty 2026-11-17): 3 text ads the network hub writes only from the member's own Target URL; picking one fills
// the headline and ad text to edit. Shown only when the hub answers it is on.
var aiWriterOn = false;
(async () => {
if (!$('cAiRow')) return;
try { const w = await (await fetch('/api/my/adwriter')).json(); aiWriterOn = !!(w && w.on); } catch (e) { aiWriterOn = false; }
applyType();
const box = $('cAiList'); let opts = [];
const escA = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
$('cAiWrite').onclick = async () => {
const url = $('cTarget').value.trim(); box.hidden = false;
if (!/^https?:\/\/\S+\.\S+/i.test(url)) { box.innerHTML = '<p class="small" style="margin:0">Put your link in the Target URL box first (starting with https://), then tap the button again.</p>'; $('cTarget').focus(); return; }
$('cAiWrite').disabled = true; box.innerHTML = '<p class="small muted" style="margin:0">Reading your page and writing 3 ads. This takes a few seconds...</p>';
let r; try { r = await api('/api/my/adwriter', { url }); } catch (e) { r = { error: e.message || 'The ad writer did not answer. Try again in a minute.' }; }
$('cAiWrite').disabled = false;
if (r.error) { box.innerHTML = '<p class="small" style="margin:0">' + escA(r.error) + '</p>'; return; }
opts = r.options || [];
box.innerHTML = '<p class="small muted" style="margin:0 0 6px">Tap one to use it. Check every word is true for your offer before you create the campaign.' + (typeof r.left === 'number' ? ' Ad writes left today: ' + r.left + '.' : '') + '</p>'
+ opts.map((o, i) => '<button type="button" class="btn sec small" data-ai="' + i + '" style="display:block;width:100%;text-align:left;margin:0 0 6px;white-space:normal"><b>' + escA(o.headline) + '</b><br><span class="small">' + escA(o.line || '') + '</span></button>').join('');
box.querySelectorAll('button[data-ai]').forEach(b => { b.onclick = () => { const o = opts[Number(b.dataset.ai)]; $('cTitle').value = o.headline; $('cBody').value = o.line || ''; box.hidden = true; IAP.status('Filled in. Edit it as you like, then create your campaign.', 'ok'); }; });
};
})();
let featStartDay = 0; // selected start-day offset (0 = today) let featStartDay = 0; // selected start-day offset (0 = today)
async function featHint() { async function featHint() {
if (!lastRates || !lastRates.featuredDurations) return; if (!lastRates || !lastRates.featuredDurations) return;
@@ -1810,22 +1712,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
v.onerror = () => fin(null); setTimeout(() => fin(null), 8000); v.src = url; v.onerror = () => fin(null); setTimeout(() => fin(null), 8000); v.src = url;
}); });
} }
// /my#campaigns?video=<https .mp4>&to=<https page>&title=&cta=&secs= (2026-11-22): a partner site's button opens the watch-to-earn video form
// with the member's own video filled in. Fields only: the member still sets the budget and presses the button, and the server validates as usual.
function prefillVideoAd(q) {
let p; try { p = new URLSearchParams(q); } catch (e) { return; }
const video = String(p.get('video') || '');
if (!/^https:\/\/[^\s"'<>]{4,300}\.(mp4|webm)$/i.test(video)) return;
const ct = $('cType'); if (!ct || !$('cVideoUrl')) return;
ct.value = 'video'; ct.dispatchEvent(new Event('change'));
const put = (id, v, max) => { v = String(v || '').replace(/[\u0000-\u001f]/g, ' ').trim().slice(0, max); if ($(id) && v) $(id).value = v; };
const to = String(p.get('to') || ''); if (/^https:\/\/[^\s"'<>]{4,300}$/i.test(to)) put('cTarget', to, 300);
put('cName', p.get('title'), 60); put('cVideoTitle', p.get('title'), 80); put('cCtaLabel', p.get('cta'), 30);
$('cVideoUrl').value = video; $('cVideoUrl').dispatchEvent(new Event('change')); // reads the size, so portrait goes to Shorts
const want = Number(p.get('secs')), pick = () => { videoHint(); const s = $('cWatchSecs'); if (s && [].some.call(s.options, o => Number(o.value) === want)) { s.value = String(want); videoHint(); } };
pick(); setTimeout(pick, 1500); setTimeout(pick, 4000); // the rates may still be loading on a fresh page
setTimeout(() => { try { $('cVideoUrl').scrollIntoView({ block: 'center' }); if ($('cBudget')) $('cBudget').focus({ preventScroll: true }); } catch (e) {} }, 300);
}
function showVidOrient() { function showVidOrient() {
const el = $('cVideoInfo'); if (!el) return; const el = $('cVideoInfo'); if (!el) return;
if (!cVidDims) return; if (!cVidDims) return;
@@ -2010,19 +1896,15 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
} catch (e) {} } catch (e) {}
} }
function renderTank(el, r) { function renderTank(el, r) {
const opens = w => w.opensAt > Date.now(); // new sign-up: they have 24 hours to say who invited them const rows = listApply('tank', r.waiting).sort((a, b) => (b.ready ? 1 : 0) - (a.ready ? 1 : 0)); // ready to activate always on top (stable: the chosen order stays inside each group)
const opensBadge = w => ' <span class="badge amber" title="New member. They have 24 hours from sign-up to tell us who invited them. You can adopt them after that.">Opens in ' + holdLeft(w.opensAt - Date.now()) + '</span>';
const rows = listApply('tank', r.waiting).sort((a, b) => (opens(a) ? 1 : 0) - (opens(b) ? 1 : 0) || (b.ready ? 1 : 0) - (a.ready ? 1 : 0)); // ready to activate always on top, the sign-up grace ones last (stable: the chosen order stays inside each group)
el.innerHTML = ''; el.innerHTML = '';
el.appendChild(listBar('tank', r.waiting.length, rows.length, () => renderTank(el, r), { hide: ['payouts'] })); // nobody in the tank has payouts on el.appendChild(listBar('tank', r.waiting.length, rows.length, () => renderTank(el, r), { hide: ['payouts'] })); // nobody in the tank has payouts on
const readyBadge = w => w.ready ? ' <span class="badge" style="background:var(--ok-soft);border-color:var(--ok);color:var(--ok)" title="Wallet linked. If nobody adopts them, the site assigns them to the next eligible adopter when the time runs out.">Ready to activate \u00b7 ' + (w.holdUntil > Date.now() ? holdLeft(w.holdUntil - Date.now()) + ' left' : 'assigning now') + '</span>' : ''; const readyBadge = w => w.ready ? ' <span class="badge" style="background:rgba(34,197,94,.15);border-color:#22c55e;color:#22c55e" title="Wallet linked. If nobody adopts them, the site assigns them to the next eligible adopter when the time runs out.">Ready to activate \u00b7 ' + (w.holdUntil > Date.now() ? holdLeft(w.holdUntil - Date.now()) + ' left' : 'assigning now') + '</span>' : '';
// readiness (2026-11-18, network hub): stage, heat, last action and how they got here under each lead; none when the hub is down el.insertAdjacentHTML('beforeend', rows.length ? rows.map(w => '<div class="lin-row"><span class="nm">' + esc(w.name) + readyBadge(w) + '</span>'
const rdHtml = w => (w.rd && window.TankReady ? TankReady.html(w.rd) : ''); + '<span class="em">joined ' + ago(w.joined) + '<span class="sp wrap">' + memberChips(w) + '</span></span>'
el.insertAdjacentHTML('beforeend', rows.length ? rows.map(w => '<div class="lin-row' + (w.rd ? ' rd-row' : '') + '"><span class="nm">' + esc(w.name) + (opens(w) ? opensBadge(w) : readyBadge(w)) + '</span>'
+ '<span class="em">joined ' + ago(w.joined) + '<span class="sp wrap">' + memberChips(w) + '</span>' + rdHtml(w) + '</span>'
+ '<span class="dt">last sign-in: <b>' + ago(w.lastSeen) + '</b></span>' + '<span class="dt">last sign-in: <b>' + ago(w.lastSeen) + '</b></span>'
+ (r.eligible && !opens(w) ? '<button class="btn small" type="button" data-adopt="' + esc(w.username || w.email) + '" data-aname="' + esc(w.name) + '">Adopt</button>' : '') + '</div>').join('') + (r.eligible ? '<button class="btn small" type="button" data-adopt="' + esc(w.username || w.email) + '" data-aname="' + esc(w.name) + '">Adopt</button>' : '') + '</div>').join('')
: '<p class="muted small">Nobody in the tank matches your search or filters.</p>'); : '<p class="muted small">Nobody in the tank matches those filters.</p>');
pageList('tank', el, ':scope > .lin-row', { per: LINE_PER }); pageList('tank', el, ':scope > .lin-row', { per: LINE_PER });
el.querySelectorAll('[data-adopt]').forEach(b => b.addEventListener('click', async () => { el.querySelectorAll('[data-adopt]').forEach(b => b.addEventListener('click', async () => {
const note = await IAP.ask({ title: 'Adopt ' + b.dataset.aname, text: 'Your first message to ' + b.dataset.aname + ' (sent as a chat and an email):', type: 'textarea', ok: 'Adopt and send', value: 'Hi, I picked you up from the InstantAdPay holding tank so you have a sponsor who will actually help. Reply here and I will walk you through the first three steps.' }); const note = await IAP.ask({ title: 'Adopt ' + b.dataset.aname, text: 'Your first message to ' + b.dataset.aname + ' (sent as a chat and an email):', type: 'textarea', ok: 'Adopt and send', value: 'Hi, I picked you up from the InstantAdPay holding tank so you have a sponsor who will actually help. Reply here and I will walk you through the first three steps.' });
@@ -2081,68 +1963,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
} catch (e) {} } catch (e) {}
} }
loadWednesdayCard(); setInterval(loadWednesdayCard, 120000); loadWednesdayCard(); setInterval(loadWednesdayCard, 120000);
// ── BixPay Visa card (2026-10-29, docs/BIXPAY-INTEGRATION.md). me.bix comes from /api/me: { live, own, link, whose, name, using, go, announce, clicks }.
// Copy is Marty's approved wording; no in-app swap claim, "3% per purchase, no load fee", the 31-states line. No em dashes.
// sign-up warning (2026-10-29, bizventures registered with referrer N/A): the BIX invite token lives only in the URL and their
// security check often fails inside app webviews, so members who reopen BIX elsewhere lose their sponsor
const BIX_SIGNUP_NOTE = 'Sign up on the page the button opens. Don’t install the BIX app first and don’t use the portal’s own Sign Up menu: your sponsor is lost and BIX shows the referrer as N/A.';
const bixInApp = () => { const u = navigator.userAgent || ''; return /FBAN|FBAV|FB_IAB|Instagram|Line\/|Twitter|Snapchat|GSA\/|Telegram|\bwv\b|WebView/i.test(u) || (/iPhone|iPad|iPod/.test(u) && !/Safari\//.test(u)); };
const BIX_INAPP_NOTE = 'You’re in an app’s built-in browser. BIX’s security check often fails here and your sponsor gets dropped: open instantadpay.com in Chrome or Safari first, then tap the button there.';
const BIX_BODY = 'BixPay is a self-custody wallet with a Visa card. Send USDT or USDC to it on Polygon, load the card, and spend it wherever Visa is accepted, including Apple Pay and Google Pay. Virtual cards from $9.99.';
const BIX_COMPLIANCE = 'BixPay is a separate company. BIX issues the wallet and the card through its banking partners and sets its own fees, limits, eligibility and terms. InstantAdPay is not the card issuer and earns a referral commission when you sign up through a partner link. Card availability varies by country. Crypto assets can lose value.';
function renderBix(me) {
const b = (me && me.bix) || { live: false };
const pill = document.querySelector('.promo-pills [data-promo="bixpay"]');
if (pill) pill.hidden = !b.live;
if ($('pfBixCard')) $('pfBixCard').hidden = !b.live;
const wc = $('bixWalletCard'), oc = $('bixCard');
if (!b.live || b.error) { if (wc) wc.hidden = true; if (oc) oc.hidden = true; if (!b.live && pill && pill.classList.contains('on')) setPromoSub('posts'); return; }
// Wallet tab (primary)
if (wc) {
wc.hidden = false;
wc.innerHTML = '<div class="card-head"><h3>Spend your POL anywhere with a BixPay Visa card</h3><span class="sub">a separate company; your partner link rides along</span></div>'
+ '<p>' + esc(BIX_BODY) + '</p>'
+ '<p class="small">3% per purchase, no load fee. See BIX\'s terms for other charges. Available in 31 US states so far. Not in your state yet? You can still get the wallet and build.</p>'
+ '<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center"><a class="btn" id="bixWalletGo" href="' + esc(b.go.wallet) + '" target="_blank" rel="noopener">Get your BixPay card</a> <a class="btn sec" href="/bixpay" target="_blank" rel="noopener">How it works</a></p>'
+ '<p class="small muted" id="bixWalletUsing" style="margin:6px 0 0">' + esc(b.whose === 'you' ? b.using : b.using.replace(/\s*Add yours in Profile\.$/, '')) + (b.whose !== 'you' ? ' <a href="#profile" data-goto="profile" style="color:var(--mint)">Add yours in Profile</a>' : '') + '</p>'
+ '<p class="small" id="bixWalletNote" style="margin:6px 0 0"><b>' + esc(BIX_SIGNUP_NOTE.split('. ')[0]) + '.</b> ' + esc(BIX_SIGNUP_NOTE.slice(BIX_SIGNUP_NOTE.indexOf('. ') + 2)) + '</p>'
+ (bixInApp() ? '<p class="small" id="bixWalletInApp" style="margin:6px 0 0;border:1px solid var(--amber-line);background:var(--amber-soft);border-radius:8px;padding:8px 10px">' + esc(BIX_INAPP_NOTE) + '</p>' : '')
+ '<details class="small muted" style="margin-top:8px"><summary style="cursor:pointer">The fine print</summary><p style="margin:6px 0 0">' + esc(BIX_COMPLIANCE) + '</p></details>';
wc.querySelectorAll('[data-goto="profile"]').forEach(a => a.addEventListener('click', e => { e.preventDefault(); const m = document.querySelector('.bo-menu [data-pane="profile"]'); if (m) m.click(); setTimeout(() => { const i = $('pfBixLink'); if (i) { i.scrollIntoView({ behavior: 'smooth', block: 'center' }); i.focus(); } }, 300); }));
}
// Overview: a one-line announcement the first week, dismissable for 24 h like the other cards
if (oc) {
if (!b.announce || cardHidden('bix')) oc.hidden = true;
else {
oc.hidden = false;
oc.innerHTML = '<div class="card-head"><h3>\u{1F4B3} New: a Visa card for your POL</h3><span class="sub">BixPay, a separate company</span></div>'
+ '<p>' + esc(BIX_BODY) + ' 3% per purchase, no load fee.</p>'
+ '<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0"><a class="btn small" href="' + esc(b.go.overview) + '" target="_blank" rel="noopener">Get your BixPay card</a> <a class="btn small sec" href="/bixpay" target="_blank" rel="noopener">How it works</a> <span class="small muted">' + esc(b.using) + '</span></p>'
+ '<p class="small muted" style="margin:6px 0 0">' + esc(BIX_SIGNUP_NOTE) + '</p>';
cardDismiss(oc, 'bix');
}
}
// Profile field
fillBixProfile(b);
// Promo tools tab (promo.js)
if (window.IAPPromo && IAPPromo.fillBix) IAPPromo.fillBix(me);
}
function fillBixProfile(b) {
const i = $('pfBixLink'), st = $('pfBixStatus'); if (!i || !st) return;
if (document.activeElement !== i) i.value = b.own || '';
st.innerHTML = b.own
? '<span style="color:var(--mint)">Saved.</span> Your pages, posts and banners carry your own partner link.'
: (b.whose === 'sponsor' ? 'Not set yet. Until you add yours, your pages carry ' + esc(b.name) + '\'s link.' : 'Not set yet. Until you add yours, your pages carry the network link.');
}
if ($('pfBixSave')) $('pfBixSave').addEventListener('click', busy2($('pfBixSave'), async () => {
const link = $('pfBixLink').value.trim();
if (!link && !(await IAP.confirmBox('Remove your BixPay partner link? Your pages go back to your sponsor\'s link (or the network link).', { title: 'Remove the link', ok: 'Remove it', cancel: 'Keep it' }))) return;
try {
const r = await api('/api/my/bixpay', { link });
IAP.status(link ? 'BixPay partner link saved.' : 'BixPay partner link removed.', 'ok');
const me = await (await fetch('/api/me')).json(); renderBix(me);
} catch (e) { $('pfBixStatus').innerHTML = '<span style="color:var(--bad)">' + esc(e.message) + '</span>'; IAP.status(e.message, 'bad'); }
}));
// ---- Game Pass (2026-10-16, docs/GAME-PASS.md): $5 for 7 days across every network game. More game, never "earn more". ---- // ---- Game Pass (2026-10-16, docs/GAME-PASS.md): $5 for 7 days across every network game. More game, never "earn more". ----
// (2026-10-28) the copy names no game count: seasonal games come and go (Spooky Doors ends Oct 31, Turkey Drop runs Nov 2 to 30) // (2026-10-28) the copy names no game count: seasonal games come and go (Spooky Doors ends Oct 31, Turkey Drop runs Nov 2 to 30)
@@ -2162,38 +1982,9 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
// package's ad credits (the base credits per package, same table as Buy packages; day bonuses can add more) // package's ad credits (the base credits per package, same table as Buy packages; day bonuses can add more)
const GP_PKG_CREDITS = { 5: 500, 10: 1000, 20: 2000, 50: 5500, 100: 12000, 250: 32500, 500: 70000 }; const GP_PKG_CREDITS = { 5: 500, 10: 1000, 20: 2000, 50: 5500, 100: 12000, 250: 32500, 500: 70000 };
const gpLen = d => d >= 365 && d % 365 === 0 ? (d === 365 ? '1 year' : (d / 365) + ' years') : d + ' days'; const gpLen = d => d >= 365 && d % 365 === 0 ? (d === 365 ? '1 year' : (d / 365) + ' years') : d + ' days';
// Shards of Valor bonus heroes (2026-11-05, Marty approved): sold ONE TIME, yours for good, paid by a new package like a pass (credits
// never buy one). Shown while heroSales is on, or to a member who owns one. gp.heroes comes from gamepass.js heroView.
function heroesHtml(H) {
if (!H || !H.show) return '';
const btn = (key, label, pkg) => '<button class="btn small" type="button" data-hero-buy="' + esc(key) + '">' + esc(label) + ' · $' + pkg + ' package</button>';
const item = i => '<div class="gp-tier' + (i.owned ? ' on' : '') + '"><h4>' + esc(i.name) + '</h4>'
+ '<p class="gp-price">' + (i.free ? 'Free for everyone' : i.freeAt ? 'Free at level ' + i.freeAt : '$' + i.usd + ' <span class="small muted">one time</span>') + '</p>'
+ '<p class="small muted" style="margin:0 0 6px">' + esc(i.blurb) + '</p>'
+ (i.owned ? '<p class="small"><b>Yours for good</b></p>' : i.freeAt ? '<span class="small muted">Not for sale: joins every player free in the game once a hero reaches level ' + i.freeAt + '.</span>' : i.waiting ? '<button class="btn small" type="button" data-gp-go="1">Buy a $' + i.package + ' package</button>' : i.open ? btn(i.key, 'Get ' + i.name.split(' ')[0], i.package) : '<span class="small muted">Not on sale right now.</span>') + '</div>';
const B = H.bundle;
const bundle = !B ? '' : '<div class="gp-tier' + (B.owned ? ' on' : '') + '"><h4>Hero bundle</h4><p class="gp-price">$' + B.usd + ' <span class="small muted">one time</span></p>'
+ '<p class="small muted" style="margin:0 0 6px">' + esc(B.names.join(', ')) + ', together.</p>'
+ (B.owned ? '<p class="small"><b>Yours for good</b></p>' : B.waiting ? '<button class="btn small" type="button" data-gp-go="1">Buy a $' + B.package + ' package</button>' : B.open ? btn('bundle', 'Get all three', B.package) : B.some ? '<span class="small muted">You already have one of them: get the others one at a time.</span>' : '<span class="small muted">Not on sale right now.</span>') + '</div>';
return '<div id="gpHeroes" style="margin-top:14px"><h4 style="margin:0 0 6px">Shards of Valor bonus heroes</h4>'
+ '<p class="small" style="margin:0 0 8px">Extra heroes for your party, bought <b>one time</b> and yours for good: no subscription. Three heroes fight at a time and you pick which three. A bonus hero joins at your party level (at most 20) with its own bound gear, never stronger than heroes and gear you can earn. The whole story stays free with Aldric, Sylwen and Borin.</p>'
+ '<div class="gp-tiers">' + H.items.map(item).join('') + bundle + '</div>'
+ '<p class="small muted" style="margin:8px 0 0">Every hero is paid by a new package purchase of at least its price, so your sponsor and team are paid; you keep the package credits for your ads. Credits you already hold never buy a hero.</p></div>';
}
function wireHeroes(card, H) {
if (!H) return;
card.querySelectorAll('[data-hero-buy]').forEach(b => b.addEventListener('click', async () => {
const k = b.dataset.heroBuy, i = k === 'bundle' ? Object.assign({ name: 'the hero bundle (' + H.bundle.names.join(', ') + ')' }, H.bundle) : H.items.find(x => x.key === k); if (!i) return;
const yes = await IAP.confirmBox('Get ' + i.name + ' for $' + i.usd + ', one time? It is paid by a new package purchase of $' + i.package + ' or more: your sponsor and team are paid from it as usual, you keep all its credits for your ads, and ' + (k === 'bundle' ? 'the heroes join' : 'the hero joins') + ' you in Shards of Valor the moment it settles. Credits you already hold never buy a hero.', { title: 'Bonus heroes', ok: 'Get ' + (k === 'bundle' ? 'the bundle' : i.name.split(' ')[0]), cancel: 'Not now' });
if (!yes) return; b.disabled = true;
try { const x = await api('/api/my/heroes/buy', { hero: k }); if (x.needPay) { IAP.status(x.message || 'Buy a package and the hero joins when it settles.', 'ok'); setPane('buy'); return; } }
catch (e) { IAP.status(e.message, 'bad'); b.disabled = false; }
}));
card.querySelectorAll('#gpHeroes [data-gp-go]').forEach(b => b.addEventListener('click', () => setPane('buy')));
}
function renderPassTiers(card, gp, highlight) { function renderPassTiers(card, gp, highlight) {
const rows = gp.passes || []; const top = rows.find(r => r.tier === gp.tier); const rows = gp.passes || []; const top = rows.find(r => r.tier === gp.tier);
const state = top ? '<span class="badge" style="background:var(--gold);color:var(--gold-ink)">' + esc(top.name) + ' active · until ' + esc(gpCT(top.until)) + '</span>' const state = top ? '<span class="badge" style="background:var(--gold,#e2b04a);color:#111">' + esc(top.name) + ' active · until ' + esc(gpCT(top.until)) + '</span>'
: '<span class="badge">No pass active</span>'; : '<span class="badge">No pass active</span>';
const caps = gp.caps || {}; const caps = gp.caps || {};
const capsLine = caps.enforced ? 'Today: <b>' + gpPol(caps.used && caps.used.total) + '</b> of ' + gpPol(caps.total) + ' POL used across the games (' + gpPol(caps.used && caps.used.daily) + ' of ' + gpPol(caps.daily) + ' on daily play).' : ''; const capsLine = caps.enforced ? 'Today: <b>' + gpPol(caps.used && caps.used.total) + '</b> of ' + gpPol(caps.total) + ' POL used across the games (' + gpPol(caps.used && caps.used.daily) + ' of ' + gpPol(caps.daily) + ' on daily play).' : '';
@@ -2214,9 +2005,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
+ '<p>Free play pays real POL every day, and the main story of Shards of Valor is free for everyone. Every pass gives the same higher POL caps in every game. Each higher pass includes everything below it and adds more of Shards of Valor: weapons, gear, bonus islands, heroes and a higher level cap. <b>Paid passes add heroes, islands, a higher level cap and new looks.</b> Pass gear is never better than gear players can earn, and passes never pay more POL.</p>' + '<p>Free play pays real POL every day, and the main story of Shards of Valor is free for everyone. Every pass gives the same higher POL caps in every game. Each higher pass includes everything below it and adds more of Shards of Valor: weapons, gear, bonus islands, heroes and a higher level cap. <b>Paid passes add heroes, islands, a higher level cap and new looks.</b> Pass gear is never better than gear players can earn, and passes never pay more POL.</p>'
+ '<div class="gp-tiers">' + rows.map(box).join('') + '</div>' + '<div class="gp-tiers">' + rows.map(box).join('') + '</div>'
+ (capsLine ? '<p class="small muted" style="margin-top:10px">' + capsLine + '</p>' : '') + (capsLine ? '<p class="small muted" style="margin-top:10px">' + capsLine + '</p>' : '')
+ '<p class="small muted" style="margin:10px 0 0">Every pass is paid by a new package purchase of at least its price, so your sponsor and team are paid; you keep the package credits for your ads. Credits you already hold never buy a pass. Passes run side by side: a higher pass shows first, and the one underneath keeps its own end date. No auto-renew: buy again any time and that pass extends from its end date. When a pass ends, nothing you earned in a game is taken away.</p>' + '<p class="small muted" style="margin:10px 0 0">Every pass is paid by a new package purchase of at least its price, so your sponsor and team are paid; you keep the package credits for your ads. Credits you already hold never buy a pass. Passes run side by side: a higher pass shows first, and the one underneath keeps its own end date. No auto-renew: buy again any time and that pass extends from its end date. When a pass ends, nothing you earned in a game is taken away.</p>';
+ heroesHtml(gp.heroes);
wireHeroes(card, gp.heroes);
card.querySelectorAll('[data-gp-tier]').forEach(b => b.addEventListener('click', async () => { card.querySelectorAll('[data-gp-tier]').forEach(b => b.addEventListener('click', async () => {
const r = rows.find(x => x.tier === b.dataset.gpTier); if (!r) return; const r = rows.find(x => x.tier === b.dataset.gpTier); if (!r) return;
const yes = await IAP.confirmBox((r.active ? 'Extend your ' + r.name + ' by ' + gpLen(r.days) : 'Get ' + r.name + ' for ' + gpLen(r.days)) + ' ($' + r.usd + ')? Every pass is paid by a new package purchase of $' + r.package + ' or more: your sponsor and team are paid from it as usual, you keep all its credits for your ads, and the pass starts the moment it settles. Credits you already hold never buy a pass. The same POL caps as every pass: no extra POL.', { title: r.name, ok: r.active ? 'Extend' : 'Get ' + r.name, cancel: 'Not now' }); const yes = await IAP.confirmBox((r.active ? 'Extend your ' + r.name + ' by ' + gpLen(r.days) : 'Get ' + r.name + ' for ' + gpLen(r.days)) + ' ($' + r.usd + ')? Every pass is paid by a new package purchase of $' + r.package + ' or more: your sponsor and team are paid from it as usual, you keep all its credits for your ads, and the pass starts the moment it settles. Credits you already hold never buy a pass. The same POL caps as every pass: no extra POL.', { title: r.name, ok: r.active ? 'Extend' : 'Get ' + r.name, cancel: 'Not now' });
@@ -2241,13 +2030,12 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
['SpellWheel', 'daily streak pays 0.30 POL instead of 0.15, plus 1 free hint a day'], ['SpellWheel', 'daily streak pays 0.30 POL instead of 0.15, plus 1 free hint a day'],
['PolyBreak', 'daily gem limit 1.5 POL instead of 0.5, plus an extra paddle every round'], ['PolyBreak', 'daily gem limit 1.5 POL instead of 0.5, plus an extra paddle every round'],
['POL Miner', 'daily crystal limit 1.5 POL instead of 0.5, plus one free supply crate every day'], ['POL Miner', 'daily crystal limit 1.5 POL instead of 0.5, plus one free supply crate every day'],
['Warp & Wares', 'the Season Pass: a hull step up, a second base slot, a named ship, a team banner and gold badges (never turns or prizes)', 'warpwares'],
['Turkey Drop', 'one free \u201cback on the air\u201d extra life every day', 'turkeydrop'], ['Turkey Drop', 'one free \u201cback on the air\u201d extra life every day', 'turkeydrop'],
['PolyWarriors', 'a 4th daily mission, and defense pays 25 Circuits instead of 15'], ['PolyWarriors', 'a 4th daily mission, and defense pays 25 Circuits instead of 15'],
['Drip Runner', 'a free shield at the start of every run'], ['Drip Runner', 'a free shield at the start of every run'],
['Road Agent', '2 patrols a day and 25% more scrap'] ['Road Agent', '2 patrols a day and 25% more scrap']
]; ];
let gpShown = null; // slugs in the public games list (gamesLive, seasons applied): a perk row with a slug shows only while its game does (2026-10-29) let gpShown = null; // slugs in the public games list (gamesLive, seasons applied): a row with a slug shows only while its game does
async function gpShownLoad() { if (gpShown) return gpShown; try { const d = await (await fetch('/api/public/games')).json(); gpShown = new Set((d.games || []).map(g => g.slug)); } catch (e) { gpShown = new Set(); } return gpShown; } async function gpShownLoad() { if (gpShown) return gpShown; try { const d = await (await fetch('/api/public/games')).json(); gpShown = new Set((d.games || []).map(g => g.slug)); } catch (e) { gpShown = new Set(); } return gpShown; }
function gpPerksHtml() { function gpPerksHtml() {
return '<div class="gp-perks"><p style="margin:10px 0 6px"><b>What you get</b></p>' return '<div class="gp-perks"><p style="margin:10px 0 6px"><b>What you get</b></p>'
@@ -2261,18 +2049,14 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
async function loadGamePassCard(highlight) { async function loadGamePassCard(highlight) {
const card = $('gpCard'); if (!card) return; const card = $('gpCard'); if (!card) return;
let gp = null; try { gp = await (await fetch('/api/my/gamepass')).json(); } catch (e) {} let gp = null; try { gp = await (await fetch('/api/my/gamepass')).json(); } catch (e) {}
if (gp && !(gp.enabled || gp.show) && gp.heroes && gp.heroes.show) { // heroes on sale (or owned) while no pass is: a card with the heroes only
card.hidden = false; card.classList.toggle('gp-hl', !!highlight);
card.innerHTML = '<div class="card-head"><h3>\u{1F6E1}\uFE0F Shards of Valor heroes</h3><span class="sub">one time · yours for good</span></div>' + heroesHtml(gp.heroes); wireHeroes(card, gp.heroes); return;
}
if (!gp || !(gp.enabled || gp.show)) { card.hidden = true; return; } if (!gp || !(gp.enabled || gp.show)) { card.hidden = true; return; }
await gpShownLoad(); await gpShownLoad();
if ((gp.passes || []).some(r => r.tier !== 'weekly')) return renderPassTiers(card, gp, highlight); if ((gp.passes || []).some(r => r.tier !== 'weekly')) return renderPassTiers(card, gp, highlight);
// Five Dollar Friday + the pass (Marty 2026-10-23): the package that starts the pass also gets the Friday bonus, so say so on Fridays // Five Dollar Friday + the pass (Marty 2026-10-23): the package that starts the pass also gets the Friday bonus, so say so on Fridays
let fdf = ''; try { const f = await (await fetch('/api/friday')).json(); if (f && f.on && f.live) { const base = gp.price || 500, got = Math.round(base * (1 + (Number(f.pct) || 20) / 100)); let fdf = ''; try { const f = await (await fetch('/api/friday')).json(); if (f && f.on && f.live) { const base = gp.price || 500, got = Math.round(base * (1 + (Number(f.pct) || 20) / 100));
fdf = '<p style="margin:0 0 10px;padding:8px 10px;border-radius:8px;background:var(--gold-soft);border:1px solid var(--gold-line)">\u{1F383} <b>It\u2019s Five Dollar Friday.</b> The $' + (gp.usd || 5) + ' package that starts your pass gets +' + (Number(f.pct) || 20) + '% too, so you get the ' + (gp.days || 7) + '-day pass <b>and keep ' + got.toLocaleString() + ' ad credits</b>. Tap Get the Pass first, then buy the package.</p>'; } } catch (e) {} // the tier boxes above show only when a tier above weekly is on sale or the member holds one (never an admin-only view: tier tests live in Admin > Game Pass) fdf = '<p style="margin:0 0 10px;padding:8px 10px;border-radius:8px;background:rgba(226,176,74,.12);border:1px solid rgba(226,176,74,.35)">\u{1F383} <b>It\u2019s Five Dollar Friday.</b> The $' + (gp.usd || 5) + ' package that starts your pass gets +' + (Number(f.pct) || 20) + '% too, so you get the ' + (gp.days || 7) + '-day pass <b>and keep ' + got.toLocaleString() + ' ad credits</b>. Tap Get the Pass first, then buy the package.</p>'; } } catch (e) {} // the tier boxes above show only when a tier above weekly is on sale or the member holds one (never an admin-only view: tier tests live in Admin > Game Pass)
const caps = gp.caps || {}; const price = gp.price || 500; const caps = gp.caps || {}; const price = gp.price || 500;
const state = gp.active ? '<span class="badge" style="background:var(--gold);color:var(--gold-ink)">Pass active \u00b7 until ' + esc(gpDate(gp.until)) + '</span>' const state = gp.active ? '<span class="badge" style="background:var(--gold,#e2b04a);color:#111">Pass active \u00b7 until ' + esc(gpDate(gp.until)) + '</span>'
: gp.waiting ? '<span class="badge amber">Waiting for a $' + (gp.usd || 5) + ' package</span>' : '<span class="badge">Not active</span>'; : gp.waiting ? '<span class="badge amber">Waiting for a $' + (gp.usd || 5) + ' package</span>' : '<span class="badge">Not active</span>';
const capsLine = caps.enforced const capsLine = caps.enforced
? 'Today: <b>' + gpPol(caps.used && caps.used.total) + '</b> of ' + gpPol(caps.total) + ' POL used across the games (' + gpPol(caps.used && caps.used.daily) + ' of ' + gpPol(caps.daily) + ' on daily play).' ? 'Today: <b>' + gpPol(caps.used && caps.used.total) + '</b> of ' + gpPol(caps.total) + ' POL used across the games (' + gpPol(caps.used && caps.used.daily) + ' of ' + gpPol(caps.daily) + ' on daily play).'
@@ -2288,9 +2072,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
+ (gp.waiting ? '<p class="small">Your pass is waiting: buy a $' + (gp.usd || 5) + ' package and it starts the moment the purchase settles. You keep every credit of the package for your ads.</p>' : '') + (gp.waiting ? '<p class="small">Your pass is waiting: buy a $' + (gp.usd || 5) + ' package and it starts the moment the purchase settles. You keep every credit of the package for your ads.</p>' : '')
+ '<p style="display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0 0">' + '<p style="display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0 0">'
+ (gp.waiting ? '<button class="btn" type="button" id="gpGoBuy">Buy a $' + (gp.usd || 5) + ' package</button>' : '<button class="btn" type="button" id="gpBuy">' + (gp.active ? 'Extend ' + (gp.days || 7) + ' more days' : 'Get the Pass') + ' \u00b7 buy a $' + (gp.usd || 5) + ' package</button>') + (gp.waiting ? '<button class="btn" type="button" id="gpGoBuy">Buy a $' + (gp.usd || 5) + ' package</button>' : '<button class="btn" type="button" id="gpBuy">' + (gp.active ? 'Extend ' + (gp.days || 7) + ' more days' : 'Get the Pass') + ' \u00b7 buy a $' + (gp.usd || 5) + ' package</button>')
+ '<span class="small muted">Paid by a new $' + (gp.usd || 5) + ' or bigger package, so your sponsor and team are paid. You keep the package credits for your ads; credits you already hold never buy a pass.</span></p>' + '<span class="small muted">Paid by a new $' + (gp.usd || 5) + ' or bigger package, so your sponsor and team are paid. You keep the package credits for your ads; credits you already hold never buy a pass.</span></p>';
+ heroesHtml(gp.heroes);
wireHeroes(card, gp.heroes);
const b = $('gpBuy'); if (b) b.addEventListener('click', async () => { const b = $('gpBuy'); if (b) b.addEventListener('click', async () => {
const yes = await IAP.confirmBox((gp.active ? 'Extend your Game Pass by ' + (gp.days || 7) + ' days' : 'Get the Game Pass for ' + (gp.days || 7) + ' days') + '? The Pass is paid by a new package purchase of $' + (gp.usd || 5) + ' or more: your sponsor and team are paid from it as usual, you keep all its credits for your ads, and the Pass starts the moment it settles. Credits you already hold never buy a pass.', { title: 'Game Pass', ok: gp.active ? 'Extend the Pass' : 'Get the Pass', cancel: 'Not now' }); const yes = await IAP.confirmBox((gp.active ? 'Extend your Game Pass by ' + (gp.days || 7) + ' days' : 'Get the Game Pass for ' + (gp.days || 7) + ' days') + '? The Pass is paid by a new package purchase of $' + (gp.usd || 5) + ' or more: your sponsor and team are paid from it as usual, you keep all its credits for your ads, and the Pass starts the moment it settles. Credits you already hold never buy a pass.', { title: 'Game Pass', ok: gp.active ? 'Extend the Pass' : 'Get the Pass', cancel: 'Not now' });
if (!yes) return; if (!yes) return;
@@ -2311,22 +2093,9 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const card = $('gpNudge'); if (!card) return; const card = $('gpNudge'); if (!card) return;
if (cardHidden('gpnudge')) { card.hidden = true; return; } if (cardHidden('gpnudge')) { card.hidden = true; return; }
let gp = null; try { gp = await (await fetch('/api/my/gamepass')).json(); } catch (e) {} let gp = null; try { gp = await (await fetch('/api/my/gamepass')).json(); } catch (e) {}
const allowanceDone = !!(gp && gp.caps && gp.caps.lifetime && gp.caps.lifetime.done && gp.caps.enforced); if (!gp || !gp.enabled || gp.active || !gp.lastCapHit || gp.lastCapHit.pass) { card.hidden = true; return; }
if (!gp || !gp.enabled || gp.active || (!allowanceDone && (!gp.lastCapHit || gp.lastCapHit.pass))) { card.hidden = true; return; } const NAMES = { polhunter: 'PolHunter', gemkingdom: 'Gem Kingdom', spellwheel: 'SpellWheel', spookydoors: 'Spooky Doors', polywarriors: 'PolyWarriors', clutterhunt: 'ClutterHunt', polybreak: 'PolyBreak', polminer: 'POL Miner', turkeydrop: 'Turkey Drop', driprunner: 'Drip Runner', roadagent: 'Road Agent' };
const NAMES = { polhunter: 'PolHunter', gemkingdom: 'Gem Kingdom', spellwheel: 'SpellWheel', spookydoors: 'Spooky Doors', polywarriors: 'PolyWarriors', clutterhunt: 'ClutterHunt', polybreak: 'PolyBreak', polminer: 'POL Miner', warpwares: 'Warp & Wares', turkeydrop: 'Turkey Drop', driprunner: 'Drip Runner', roadagent: 'Road Agent' };
card.hidden = false; card.hidden = false;
const lt = gp.caps && gp.caps.lifetime;
if (lt && lt.done) { // the free allowance is used up (Marty 2026-11-03): only the Pass pays from here, and what it unlocks
const fmt = n => String(Math.round(n * 100) / 100);
card.innerHTML = '<div class="card-head"><h3>\u{1F39F}\uFE0F You have used your free ' + fmt(lt.cap) + ' POL in the games</h3><span class="sub">the Game Pass keeps them paying</span></div>'
+ '<p>Every member gets ' + fmt(lt.cap) + ' POL of game rewards free, and yours is used. The games stay free to play, but from here rewards pay only with the <b>Game Pass</b>: ' + (gp.days || 7) + ' days for $' + (gp.usd || 5) + ', paid with a new package, with full rewards in every game, the weekly Pass Tournament and a perk in each game.'
+ (lt.waiting > 0 ? ' <b>' + fmt(lt.waiting) + ' POL</b> you have earned since is saved and pays out once your Pass is active.' : '') + '</p>'
+ '<button class="btn" type="button" id="gpNudgeGo">Get the Game Pass</button>';
$('gpNudgeGo').addEventListener('click', () => setPane('games?pass=1'));
try { localStorage.setItem('iap-hide-gpnudge', String(Date.now())); } catch (e) {}
cardDismiss(card, 'gpnudge');
return;
}
card.innerHTML = '<div class="card-head"><h3>\u{1F39F}\uFE0F You reached today\u2019s free cap in ' + esc(NAMES[gp.lastCapHit.game] || 'the games') + '</h3><span class="sub">free play keeps paying; the Pass plays more</span></div>' card.innerHTML = '<div class="card-head"><h3>\u{1F39F}\uFE0F You reached today\u2019s free cap in ' + esc(NAMES[gp.lastCapHit.game] || 'the games') + '</h3><span class="sub">free play keeps paying; the Pass plays more</span></div>'
+ '<p>Every member earns real POL in the games up to the daily cap. The <b>Game Pass</b> raises the caps across all the games for ' + (gp.days || 7) + ' days ($' + (gp.usd || 5) + ', paid with a new package), adds the weekly Pass Tournament and a perk in every game.</p>' + '<p>Every member earns real POL in the games up to the daily cap. The <b>Game Pass</b> raises the caps across all the games for ' + (gp.days || 7) + ' days ($' + (gp.usd || 5) + ', paid with a new package), adds the weekly Pass Tournament and a perk in every game.</p>'
+ '<button class="btn" type="button" id="gpNudgeGo">See the Game Pass</button>'; + '<button class="btn" type="button" id="gpNudgeGo">See the Game Pass</button>';
@@ -2629,10 +2398,10 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const kept = shown.reduce((n, L) => n + L.members.length, 0); const kept = shown.reduce((n, L) => n + L.members.length, 0);
el.innerHTML = ''; el.innerHTML = '';
el.appendChild(listBar('line', all, kept, () => renderLineage(el))); el.appendChild(listBar('line', all, kept, () => renderLineage(el)));
el.insertAdjacentHTML('beforeend', !kept ? '<p class="muted small">Nobody in your downline matches your search or filters.</p>' : shown.map(L => !L.members.length ? '' : el.insertAdjacentHTML('beforeend', !kept ? '<p class="muted small">Nobody in your downline matches those filters.</p>' : shown.map(L => !L.members.length ? '' :
'<div class="lin-lvl"><div class="cap">Level ' + L.level + ' · ' + L.members.length + (L.level === 1 ? ' direct' : '') + '</div>' '<div class="lin-lvl"><div class="cap">Level ' + L.level + ' · ' + L.members.length + (L.level === 1 ? ' direct' : '') + '</div>'
+ L.members.map(m => '<div class="lin-row' + (m.own ? ' own' : '') + '"><span class="nm">' + esc(m.name) + (m.own ? ' <span class="badge">yours</span>' : '') + '</span>' + L.members.map(m => '<div class="lin-row' + (m.own ? ' own' : '') + '"><span class="nm">' + esc(m.name) + (m.own ? ' <span class="badge">yours</span>' : '') + '</span>'
+ '<span class="em">' + (m.email ? esc(m.email) : (m.memberId ? '<span class="id">#' + m.memberId + '</span>' : '')) + (m.sponsor ? '<span class="sp">sponsored by ' + esc(m.sponsor) + '</span>' : '') + (!m.own && originText(m) ? '<span class="sp">' + esc(originText(m)) + '</span>' : '') + (m.own ? '' : '<span class="sp">' + (m.bought ? '$20+ buy ✓' : 'no $20+ buy yet') + (m.buyers ? ' · ' + m.buyers + ' qualifying buyer' + (m.buyers === 1 ? '' : 's') + ' of their own' : '') + '</span><span class="sp wrap">' + memberChips(m) + '</span>') + '</span>' + '<span class="em">' + (m.email ? esc(m.email) : (m.memberId ? '<span class="id">#' + m.memberId + '</span>' : '')) + (m.sponsor ? '<span class="sp">sponsored by ' + esc(m.sponsor) + '</span>' : '') + (m.own ? '' : '<span class="sp">' + (m.bought ? '$20+ buy ✓' : 'no $20+ buy yet') + (m.buyers ? ' · ' + m.buyers + ' qualifying buyer' + (m.buyers === 1 ? '' : 's') + ' of their own' : '') + '</span><span class="sp wrap">' + memberChips(m) + '</span>') + '</span>'
+ '<span class="earn' + (m.earnedWei && m.earnedWei !== '0' ? ' on' : '') + '" title="POL this person has paid you so far">' + '<span class="earn' + (m.earnedWei && m.earnedWei !== '0' ? ' on' : '') + '" title="POL this person has paid you so far">'
+ (m.earnedWei && m.earnedWei !== '0' ? '+' + IAP.fmtPol(m.earnedWei) + ' POL' : '0.00 POL') + '</span>' + (m.earnedWei && m.earnedWei !== '0' ? '+' + IAP.fmtPol(m.earnedWei) + ' POL' : '0.00 POL') + '</span>'
+ '<span class="dt">' + new Date(m.joined).toLocaleDateString() + '</span>' + '<span class="dt">' + new Date(m.joined).toLocaleDateString() + '</span>'
@@ -2667,9 +2436,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
const ago = t => { if (!t) return 'never'; const d = Date.now() - t; if (d < 3600e3) return Math.max(1, Math.round(d / 60e3)) + ' min ago'; if (d < 86400e3) return Math.round(d / 3600e3) + 'h ago'; return Math.round(d / 86400e3) + 'd ago'; }; const ago = t => { if (!t) return 'never'; const d = Date.now() - t; if (d < 3600e3) return Math.max(1, Math.round(d / 60e3)) + ' min ago'; if (d < 86400e3) return Math.round(d / 3600e3) + 'h ago'; return Math.round(d / 86400e3) + 'd ago'; };
const chip = (label, val, cls) => '<span class="lin-chip' + (cls ? ' ' + cls : '') + '"><b>' + esc(label) + '</b>' + esc(val) + '</span>'; const chip = (label, val, cls) => '<span class="lin-chip' + (cls ? ' ' + cls : '') + '"><b>' + esc(label) + '</b>' + esc(val) + '</span>';
const working = (a.viewsToday || 0) > 0 || (a.campaignsActive || 0) > 0 || (a.linkViews30 || 0) > 0 || (a.lastSeen && Date.now() - a.lastSeen < 2 * 86400e3); const working = (a.viewsToday || 0) > 0 || (a.campaignsActive || 0) > 0 || (a.linkViews30 || 0) > 0 || (a.lastSeen && Date.now() - a.lastSeen < 2 * 86400e3);
box.innerHTML = (a.direct && a.email ? chip('Email', a.email) : '') // your own directs only (2026-11-12) box.innerHTML = chip('Last seen', ago(a.lastSeen), a.lastSeen && Date.now() - a.lastSeen < 2 * 86400e3 ? 'on' : (a.quietDays >= 3 ? 'warn' : ''))
+ (a.direct && originText(a) ? chip('Came', originText(a)) : '')
+ chip('Last seen', ago(a.lastSeen), a.lastSeen && Date.now() - a.lastSeen < 2 * 86400e3 ? 'on' : (a.quietDays >= 3 ? 'warn' : ''))
+ chip('Joined', new Date(a.joined).toLocaleDateString()) + chip('Joined', new Date(a.joined).toLocaleDateString())
+ chip('Stage', (a.rung || 'Joined') + (a.next ? ' · next: ' + a.next : ''), a.stalled ? 'warn' : '') + chip('Stage', (a.rung || 'Joined') + (a.next ? ' · next: ' + a.next : ''), a.stalled ? 'warn' : '')
+ chip('Ads today', (a.viewsToday || 0) + '/' + (a.target || 5) + (a.claimedToday ? ' claimed' : '') + (a.streakDay ? ' · streak day ' + a.streakDay : ''), (a.viewsToday || 0) > 0 ? 'on' : '') + chip('Ads today', (a.viewsToday || 0) + '/' + (a.target || 5) + (a.claimedToday ? ' claimed' : '') + (a.streakDay ? ' · streak day ' + a.streakDay : ''), (a.viewsToday || 0) > 0 ? 'on' : '')
@@ -2861,11 +2628,9 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if ($('tkGo')) { $('tkGo').addEventListener('click', tkGenerate); $('tkAgain').addEventListener('click', tkGenerate); $('tkCopy').addEventListener('click', async () => { try { await navigator.clipboard.writeText($('tkText').value); IAP.status('Copied.', 'ok'); } catch (e) { $('tkText').select(); } }); $('tkSendBc').addEventListener('click', tkSendBroadcast); } if ($('tkGo')) { $('tkGo').addEventListener('click', tkGenerate); $('tkAgain').addEventListener('click', tkGenerate); $('tkCopy').addEventListener('click', async () => { try { await navigator.clipboard.writeText($('tkText').value); IAP.status('Copied.', 'ok'); } catch (e) { $('tkText').select(); } }); $('tkSendBc').addEventListener('click', tkSendBroadcast); }
// promo tools: pill menu switches between posts / swipes / banners / wall / videos // promo tools: pill menu switches between posts / swipes / banners / wall / videos
function setPromoSub(name) { function setPromoSub(name) {
const ids = ['toolkit', 'posts', 'text', 'swipe', 'banners', 'wall', 'objections', 'videos', 'viral', 'stackpol', 'games', 'network', 'bixpay']; // bixpay: the BixPay partner kit, pill hidden while bixpayLive is off (2026-10-29) const ids = ['toolkit', 'posts', 'text', 'swipe', 'banners', 'wall', 'objections', 'videos', 'viral', 'games'];
if (['polhunter', 'spookydoors', 'gamebanners'].includes(name)) name = 'games'; // those tabs live inside Games now (2026-10-06) if (['polhunter', 'spookydoors', 'gamebanners'].includes(name)) name = 'games'; // those tabs live inside Games now (2026-10-06)
if (name === 'toolkit') loadToolkit(); if (name === 'toolkit') loadToolkit();
if (name === 'stackpol') loadStackPol();
if (name === 'network' && window.IAPNetKits) IAPNetKits.load(); // Network sites kits (2026-11-14), loaded when the tab opens
const pill = document.querySelector('.promo-pills [data-promo="' + name + '"]'); const pill = document.querySelector('.promo-pills [data-promo="' + name + '"]');
if (!ids.includes(name) || !pill || pill.hidden) name = 'posts'; if (!ids.includes(name) || !pill || pill.hidden) name = 'posts';
ids.forEach(id => { const el = $('promo-' + id); if (el) el.hidden = id !== name; }); ids.forEach(id => { const el = $('promo-' + id); if (el) el.hidden = id !== name; });
@@ -2875,33 +2640,9 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
}); });
try { localStorage.setItem('iap.promoSub', name); } catch (e) {} try { localStorage.setItem('iap.promoSub', name); } catch (e) {}
} }
// Stack POL page switch (2026-11-09): GET/POST /api/my/stackpol, the opt-in the stackpol.com indexer reads every 5 minutes
function showStackPol(d) {
$('spOn').checked = !!d.on; $('spLinkRow').hidden = !d.on; $('spUrl').textContent = d.url || ''; $('spOpen').href = d.url || '#';
$('spNote').textContent = d.on ? (d.wallet ? 'Your page is live once a payout reaches your wallet and updates every 5 minutes.' : 'Link a wallet (Wallet tab) so your payouts can be added up on your page.') : '';
const pv = d.pro || {}; $('spProOn').hidden = !pv.pro; $('spProOff').hidden = !!pv.pro; // any $10+ package unlocks Pro (2026-11-09): no order to wait on
// owned state (Marty 2026-11-10): say plainly that the member OWNS the upgrade, since when, with a link to the Pro page
$('spProSince').textContent = pv.pro && pv.since ? 'Unlocked ' + new Date(pv.since).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) + '. ' : '';
$('spProOpen').href = d.url || '#';
}
async function stackPolPost(body) { const r = await fetch('/api/my/stackpol', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) }); const d = await r.json(); if (!r.ok) throw new Error(d.error || 'Could not save that.'); return d; }
// a purchase made in another tab or on chain while this pane was open (Marty 2026-11-10): re-check when the member comes back
document.addEventListener('visibilitychange', () => { const el = $('promo-stackpol'); if (!document.hidden && el && !el.hidden) loadStackPol(); });
async function loadStackPol() { try { const r = await fetch('/api/my/stackpol'); const d = await r.json(); if (!r.ok) { $('spNote').textContent = d.error || ''; return; } showStackPol(d); } catch (e) {} }
if ($('spOn')) {
$('spOn').addEventListener('change', async () => {
const on = $('spOn').checked;
try { const r = await fetch('/api/my/stackpol', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ on }) }); const d = await r.json();
if (!r.ok) { $('spOn').checked = !on; IAP.status(d.error || 'Could not save that.', 'bad'); return; }
showStackPol(d); IAP.status(on ? 'Stack POL page switched on.' : 'Stack POL page switched off.', 'ok');
} catch (e) { $('spOn').checked = !on; IAP.status('Could not save that. Try again.', 'bad'); }
});
$('spCopy').addEventListener('click', async () => { try { await navigator.clipboard.writeText($('spUrl').textContent); IAP.status('Link copied.', 'ok'); } catch (e) { const r = document.createRange(); r.selectNodeContents($('spUrl')); const sel = getSelection(); sel.removeAllRanges(); sel.addRange(r); } });
}
document.querySelectorAll('.promo-pills [data-promo]').forEach(b => document.querySelectorAll('.promo-pills [data-promo]').forEach(b =>
b.addEventListener('click', () => setPromoSub(b.dataset.promo))); b.addEventListener('click', () => setPromoSub(b.dataset.promo)));
const promoDeep = /^#promo\?(?:.*&)?s=([a-z]+)/.exec(location.hash); // a deep link to one tab, e.g. stackpol.com's Pro button: /my#promo?s=stackpol (2026-11-09) try { setPromoSub(localStorage.getItem('iap.promoSub') || 'posts'); } catch (e) { setPromoSub('posts'); }
try { setPromoSub((promoDeep && promoDeep[1]) || localStorage.getItem('iap.promoSub') || 'posts'); } catch (e) { setPromoSub('posts'); }
async function loadInbox() { async function loadInbox() {
try { try {
const r = await (await fetch('/api/my/inbox')).json(); const r = await (await fetch('/api/my/inbox')).json();
@@ -3004,7 +2745,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
// ── promo tools: content + rendering live in promo.js (IAPPromo.fill) ── // ── promo tools: content + rendering live in promo.js (IAPPromo.fill) ──
function fillPromo(link, me) { function fillPromo(link, me) {
if (window.IAPPromo) IAPPromo.fill(link, me || {}); if (window.IAPPromo) IAPPromo.fill(link, me || {});
if (window.IAPNetKits && me && me.username) { IAPNetKits.setUser(me.username); const ns = $('promo-network'); if (ns && !ns.hidden) IAPNetKits.load(); }
// banner kit // banner kit
const bwrap = $('promoBanners'); const bwrap = $('promoBanners');
if (bwrap && !bwrap.dataset.filled) { if (bwrap && !bwrap.dataset.filled) {
@@ -3021,9 +2761,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
{ file: 'iap-wired-wednesday-1200x630.jpg', size: '1200×630 · Wired Wednesday · social card, link previews, Daily News' }, { file: 'iap-wired-wednesday-1200x630.jpg', size: '1200×630 · Wired Wednesday · social card, link previews, Daily News' },
{ file: 'iap-wired-wednesday-1080x1080.jpg', size: '1080×1080 · Wired Wednesday · Instagram, Facebook, Telegram' }, { file: 'iap-wired-wednesday-1080x1080.jpg', size: '1080×1080 · Wired Wednesday · Instagram, Facebook, Telegram' },
{ file: 'iap-wired-wednesday-728x90.png', size: '728×90 · Wired Wednesday · leaderboard' }, { file: 'iap-wired-wednesday-728x90.png', size: '728×90 · Wired Wednesday · leaderboard' },
{ file: 'iap-wired-wednesday-300x250.png', size: '300×250 · Wired Wednesday · rectangle' }, { file: 'iap-wired-wednesday-300x250.png', size: '300×250 · Wired Wednesday · rectangle' } ] },
{ file: 'iap-wired-wednesday-wide.png', size: '600×300 · Wired Wednesday · traffic exchanges, splash pages' },
{ file: 'iap-wired-wednesday-small.png', size: '250×250 · Wired Wednesday · small square' } ] },
{ title: 'Five Dollar Friday · share with your /friday link', friday: true, items: [ { title: 'Five Dollar Friday · share with your /friday link', friday: true, items: [
{ file: 'iap-five-dollar-friday-october-1200x630.jpg', size: '1200×630 · Five Dollar Friday · October porch, bright' }, { file: 'iap-five-dollar-friday-october-1200x630.jpg', size: '1200×630 · Five Dollar Friday · October porch, bright' },
{ file: 'iap-five-dollar-friday-october-1080x1080.jpg', size: '1080×1080 · Five Dollar Friday · October porch, square' }, { file: 'iap-five-dollar-friday-october-1080x1080.jpg', size: '1080×1080 · Five Dollar Friday · October porch, square' },
@@ -3031,15 +2769,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
{ file: 'iap-five-dollar-friday-dark-1200x630.jpg', size: '1200×630 · Five Dollar Friday · dark studio' }, { file: 'iap-five-dollar-friday-dark-1200x630.jpg', size: '1200×630 · Five Dollar Friday · dark studio' },
{ file: 'iap-five-dollar-friday-v2-1080x1080.jpg', size: '1080×1080 · Five Dollar Friday · square for Instagram and feeds' } ] }, { file: 'iap-five-dollar-friday-v2-1080x1080.jpg', size: '1080×1080 · Five Dollar Friday · square for Instagram and feeds' } ] },
{ title: '600×300 · traffic exchanges and splash pages', items: [ { title: '600×300 · traffic exchanges and splash pages', items: [
{ file: 'iap-advertise-earn-600x300.png', size: '600×300 · advertise and earn · traffic exchanges, splash pages, safelist mailers' }, { file: 'iap-advertise-earn-600x300.png', size: '600×300 · advertise and earn · traffic exchanges, splash pages, safelist mailers' } ] },
{ file: 'iap-core-wide.png', size: '600×300 · advertise and earn · Join free' },
{ file: 'iap-ledger-wide.png', size: '600×300 · advertising that pays you on-chain · See the ledger' },
{ file: 'iap-team-wide.png', size: '600×300 · build your team with one link · Join free' } ] },
{ title: '250×250 · small squares', items: [
{ file: 'iap-core-small.png', size: '250×250 · advertise and earn · Join free' },
{ file: 'iap-earn-small.png', size: '250×250 · advertise and earn · globe art' },
{ file: 'iap-ledger-small.png', size: '250×250 · advertising that pays you on-chain · See the ledger' },
{ file: 'iap-team-small.png', size: '250×250 · one link, your team · Join free' } ] },
{ title: '1200×630 · social posts, link previews, Daily News covers', items: [ { title: '1200×630 · social posts, link previews, Daily News covers', items: [
{ file: 'iap-hero-1200x630.png', size: '1200×630 · hero · advertise and earn' }, { file: 'iap-hero-1200x630.png', size: '1200×630 · hero · advertise and earn' },
{ file: 'iap-advertise-earn-1200x630.jpg', size: '1200×630 · advertise and earn instantly, locked in code' }, { file: 'iap-advertise-earn-1200x630.jpg', size: '1200×630 · advertise and earn instantly, locked in code' },
@@ -3056,9 +2786,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
{ file: 'iap-five-dollar-friday-1200x630.jpg', size: '1200×630 · social card, Daily News, feed posts' }, { file: 'iap-five-dollar-friday-1200x630.jpg', size: '1200×630 · social card, Daily News, feed posts' },
{ file: 'iap-five-dollar-friday-1080x1080.jpg', size: '1080×1080 · Instagram, Facebook, Telegram' }, { file: 'iap-five-dollar-friday-1080x1080.jpg', size: '1080×1080 · Instagram, Facebook, Telegram' },
{ file: 'iap-five-dollar-friday-728x90.png', size: '728×90 · leaderboard' }, { file: 'iap-five-dollar-friday-728x90.png', size: '728×90 · leaderboard' },
{ file: 'iap-five-dollar-friday-300x250.png', size: '300×250 · rectangle' }, { file: 'iap-five-dollar-friday-300x250.png', size: '300×250 · rectangle' } ] },
{ file: 'iap-five-dollar-friday-wide.png', size: '600×300 · traffic exchanges, splash pages' },
{ file: 'iap-five-dollar-friday-small.png', size: '250×250 · small square' } ] },
{ title: '1080×1080 and 1080×1920 · Instagram, Facebook, stories, reels', items: [ { title: '1080×1080 and 1080×1920 · Instagram, Facebook, stories, reels', items: [
{ file: 'iap-1080x1080.png', size: '1080×1080 · square' }, { file: 'iap-1080x1080.png', size: '1080×1080 · square' },
{ file: 'iap-1080x1920.png', size: '1080×1920 · story / reel' } ] }, { file: 'iap-1080x1920.png', size: '1080×1920 · story / reel' } ] },
@@ -3077,7 +2805,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
{ file: 'iap-advertise-earn-v2-336x280.png', size: '336×280 · advertise and earn · variant 2' }, { file: 'iap-advertise-earn-v2-336x280.png', size: '336×280 · advertise and earn · variant 2' },
{ file: 'iap-300x250.png', size: '300×250 · rectangle' }, { file: 'iap-300x250.png', size: '300×250 · rectangle' },
{ file: 'iap-advertise-earn-300x250.png', size: '300×250 · advertise and earn instantly' }, { file: 'iap-advertise-earn-300x250.png', size: '300×250 · advertise and earn instantly' },
{ file: 'iap-team-box.png', size: '300×250 · build your team with one link · Join free' }, { file: 'iap-team-build-link-300x250.jpg', size: '300×250 · team build and instant payments · "link in the description"' },
{ file: 'iap-125x125.png', size: '125×125 · square button' } ] }, { file: 'iap-125x125.png', size: '125×125 · square button' } ] },
{ title: 'Skyscrapers · 160×600, 120×600', items: [ { title: 'Skyscrapers · 160×600, 120×600', items: [
{ file: 'iap-160x600.png', size: '160×600 · wide skyscraper' }, { file: 'iap-160x600.png', size: '160×600 · wide skyscraper' },
@@ -3093,9 +2821,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (bridge) { if (bridge) {
// the bridge page with this member's referral: any public page + ?ref sets the sponsor cookie // the bridge page with this member's referral: any public page + ?ref sets the sponsor cookie
const inv = (document.getElementById('inviteLine') || {}).textContent || ''; const inv = (document.getElementById('inviteLine') || {}).textContent || '';
// the invite line is the share link (https://<share>/<user>) or the old /join/<user> form (2026-11-17: the share form never matched, so the bridge link was the plain invite) const fl = inv.replace(/\/join\/([^/?#]+).*$/, '/' + bridge.page + '?ref=$1');
const im = /\/(?:join\/)?([A-Za-z0-9_]{1,40})\/?(?:[?#].*)?$/.exec(inv.trim());
const fl = im ? (SHARE_DOMAIN ? 'https://' + SHARE_DOMAIN : location.origin) + '/' + bridge.page + '?ref=' + im[1] : inv;
const note = document.createElement('div'); const note = document.createElement('div');
note.className = 'pb-note'; note.className = 'pb-note';
note.innerHTML = '<span>Post any of these with your ' + esc(bridge.name) + ' link: <b class="mono"></b></span>'; note.innerHTML = '<span>Post any of these with your ' + esc(bridge.name) + ' link: <b class="mono"></b></span>';
@@ -3106,7 +2832,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
grid.before(note); grid.before(note);
} }
for (const b of g.items) { for (const b of g.items) {
const url = (SHARE_DOMAIN ? 'https://' + SHARE_DOMAIN : location.origin) + '/banners/' + b.file; // share hosts serve /banners/* in place (2026-11-17, instantadpay.com is on Spamhaus DBL) const url = location.origin + '/banners/' + b.file;
const d = document.createElement('div'); const d = document.createElement('div');
d.className = 'pb-item'; d.className = 'pb-item';
d.innerHTML = '<img src="/banners/' + b.file + '?v=4" alt="InstantAdPay banner ' + b.size + '" loading="lazy">' d.innerHTML = '<img src="/banners/' + b.file + '?v=4" alt="InstantAdPay banner ' + b.size + '" loading="lazy">'
@@ -3443,10 +3169,9 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
$('mcVerifyBtn').addEventListener('click', busy($('mcVerifyBtn'), async () => { $('mcVerifyBtn').addEventListener('click', busy($('mcVerifyBtn'), async () => {
const r = await api('/api/auth/email/verify', { email: $('mcEmail').value, code: $('mcCode').value, newsletter: !!($('nlOptin') && $('nlOptin').checked) }); const r = await api('/api/auth/email/verify', { email: $('mcEmail').value, code: $('mcCode').value, newsletter: !!($('nlOptin') && $('nlOptin').checked) });
IAP.status('You are in.', 'ok'); IAP.status('You are in.', 'ok');
if (r.next === '/sso/resume' && !r.created) { try { await showLoginAd(); } catch (e) {} location.href = r.next; return; } // another network site asked: login ad if due, then straight back there (2026-11-15)
if (r.next && !r.created) { location.href = r.next; return; } // came from Drip Runner: straight back into the game if (r.next && !r.created) { location.href = r.next; return; } // came from Drip Runner: straight back into the game
if (r.created && !(r.account && r.account.username)) await showOnboard(); // pick a username first if (r.created && !(r.account && r.account.username)) await showOnboard(); // pick a username first
if (await showGauntlet()) showLoginAd.asked = true; else await showLoginAd(); // welcome tour outranks the login ad if (!(await showGauntlet())) await showLoginAd(); // welcome tour outranks the login ad
await render(); await render();
})); }));
})(); })();
@@ -3487,13 +3212,13 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
$('loginBtn').addEventListener('click', busy($('loginBtn'), async () => { $('loginBtn').addEventListener('click', busy($('loginBtn'), async () => {
await api('/api/login', { email: $('liEmail').value, password: $('liPass').value }); await api('/api/login', { email: $('liEmail').value, password: $('liPass').value });
IAP.status('Logged in.', 'ok'); IAP.status('Logged in.', 'ok');
if (await showGauntlet()) showLoginAd.asked = true; else await showLoginAd(); // welcome tour outranks the login ad if (!(await showGauntlet())) await showLoginAd(); // welcome tour outranks the login ad
await render(); await render();
})); }));
$('linkBtn').addEventListener('click', busy($('linkBtn'), async () => { $('linkBtn').addEventListener('click', busy($('linkBtn'), async () => {
IAP.status('Check your wallet for the free link signature…'); IAP.status('Check your wallet for the free link signature…');
const lr = await IAPWallet.signIn(); // server binds the wallet to the signed-in email account const lr = await IAPWallet.signIn(); // server binds the wallet to the signed-in email account
if (lr && lr.next) { IAP.status('Wallet linked. Taking you back to ' + (lr.backTo || 'PolHunter') + '…', 'ok'); setTimeout(() => { location.href = lr.next; }, 700); return; } // they came from PolHunter or another network site: close the loop (2026-11-17) if (lr && lr.next) { IAP.status('Wallet linked. Taking you back to PolHunter…', 'ok'); setTimeout(() => { location.href = lr.next; }, 700); return; } // they came from PolHunter: close the loop
IAP.status('Wallet linked. Earnings pay there from now on.', 'ok'); IAP.status('Wallet linked. Earnings pay there from now on.', 'ok');
await render(); await render();
})); }));
@@ -3537,12 +3262,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
try { await navigator.clipboard.writeText($('inviteLine').textContent); IAP.status('Link copied.', 'ok'); } try { await navigator.clipboard.writeText($('inviteLine').textContent); IAP.status('Link copied.', 'ok'); }
catch (e) { IAP.status('Copy failed. Select and copy the link text.', 'bad'); } catch (e) { IAP.status('Copy failed. Select and copy the link text.', 'bad'); }
}); });
if ($('logoutAllLink')) $('logoutAllLink').addEventListener('click', async e => { // every network site (2026-11-15)
e.preventDefault();
let r = {}; try { r = await (await fetch('/api/auth/logout-everywhere', { method: 'POST' })).json(); } catch (er) {}
IAP.status(r.everywhere ? 'Signed out on every network site.' : 'Signed out here. The other network sites could not be reached just now, so sign out there too.', r.everywhere ? 'ok' : 'bad');
await render();
});
$('logoutLink').addEventListener('click', async e => { $('logoutLink').addEventListener('click', async e => {
e.preventDefault(); e.preventDefault();
await fetch('/api/auth/logout', { method: 'POST' }); await fetch('/api/auth/logout', { method: 'POST' });
@@ -3688,7 +3407,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
for (const p of SOCIALS) body.socials[p] = ($('soc-' + p) && $('soc-' + p).value.trim()) || ''; for (const p of SOCIALS) body.socials[p] = ($('soc-' + p) && $('soc-' + p).value.trim()) || '';
if (pfAvatar) body.avatarUrl = pfAvatar; if (pfAvatar) body.avatarUrl = pfAvatar;
const r = await api('/api/my/profile-details', body); const r = await api('/api/my/profile-details', body);
IAP.status(r.notice ? 'Profile saved. ' + r.notice : 'Profile saved.', 'ok'); IAP.status('Profile saved.', 'ok');
if (r.account) fillProfileDetails(r.account); if (r.account) fillProfileDetails(r.account);
})); }));
$('lbUploadBtn').addEventListener('click', () => $('lbFile').click()); $('lbUploadBtn').addEventListener('click', () => $('lbFile').click());
@@ -3718,15 +3437,10 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
// out sit on the ad itself (Brian Holland, 2026-10-09: "no timer, no X"). // out sit on the ad itself (Brian Holland, 2026-10-09: "no timer, no X").
// Sites that refuse framing open in a new tab instead, with the bar saying // Sites that refuse framing open in a new tab instead, with the bar saying
// so; the timer is not paused, the member is expected to be on the ad. // so; the timer is not paused, the member is expected to be on the ad.
// 2026-11-15: shown on the member's clock (loginadclock.js, site setting loginAdEveryHours), asked once per page load; the end of
// the countdown tells the server (POST /api/ads/login/seen). back = a network sign-in hop waiting (another site asked): the
// finish button continues it, back to the site and page it came from, never the dashboard (Marty was stranded here from 5xYourTeam).
async function showLoginAd() { async function showLoginAd() {
if (showLoginAd.asked) return; showLoginAd.asked = true;
try { try {
const { ad, back } = await (await fetch('/api/ads/slot?type=login')).json(); const { ad } = await (await fetch('/api/ads/slot?type=login')).json();
if (!ad || !ad.targetUrl) return; if (!ad || !ad.targetUrl) return;
$('lgContinue').textContent = back ? 'Continue' : 'Go to dashboard';
const gate = $('loginGate'); const gate = $('loginGate');
const openBtn = $('lgOpen'); const openBtn = $('lgOpen');
const goBtn = $('lgContinue'); const goBtn = $('lgContinue');
@@ -3749,7 +3463,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
if (frame) { frame.hidden = true; frame.src = 'about:blank'; } if (frame) { frame.hidden = true; frame.src = 'about:blank'; }
if (body) body.hidden = false; if (body) body.hidden = false;
openBtn.disabled = false; openBtn.disabled = false;
const pop = document.querySelector('.iap-welcome'); if (pop) pop.style.display = 'none'; // the session pop-up waits until the login ad is done (welcome.js holds new ones back too)
gate.hidden = false; gate.hidden = false;
await new Promise(done => { await new Promise(done => {
openBtn.onclick = () => { openBtn.onclick = () => {
@@ -3773,15 +3486,13 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
clearInterval(t); clearInterval(t);
timer.textContent = 'Time is up'; timer.textContent = 'Time is up';
timer.classList.add('done'); timer.classList.add('done');
fetch('/api/ads/login/seen', { method: 'POST' }).catch(() => {}); $('lgStatus').textContent = 'Thanks for the look. Your dashboard is ready.';
$('lgStatus').textContent = back ? 'Thanks for the look. Continue to finish signing in where you came from.' : 'Thanks for the look. Your dashboard is ready.';
goBtn.hidden = false; goBtn.hidden = false;
}, 1000); }, 1000);
goBtn.onclick = () => { if (back) { goBtn.disabled = true; location.href = back; return; } done(); }; goBtn.onclick = () => done();
}; };
}); });
gate.hidden = true; gate.hidden = true;
if (pop) pop.style.display = '';
if (frame) { frame.src = 'about:blank'; frame.hidden = true; } if (frame) { frame.src = 'about:blank'; frame.hidden = true; }
if (body) body.hidden = false; if (body) body.hidden = false;
$('lgTimer').classList.remove('done'); $('lgTimer').classList.remove('done');
@@ -3963,7 +3674,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str
(function () { (function () {
const btn = document.getElementById('promoApply'), inp = document.getElementById('promoCode'), msg = document.getElementById('promoMsg'); const btn = document.getElementById('promoApply'), inp = document.getElementById('promoCode'), msg = document.getElementById('promoMsg');
if (!btn || !inp) return; if (!btn || !inp) return;
const say = (t, ok) => { msg.hidden = false; msg.textContent = t; msg.style.color = ok ? 'var(--mint)' : 'var(--bad)'; }; const say = (t, ok) => { msg.hidden = false; msg.textContent = t; msg.style.color = ok ? 'var(--mint)' : '#ff8a8a'; };
const go = async () => { const go = async () => {
const code = inp.value.trim(); if (!code) { say('Enter a promo code.', false); return; } const code = inp.value.trim(); if (!code) { say('Enter a promo code.', false); return; }
btn.disabled = true; btn.disabled = true;
@@ -3988,9 +3699,9 @@ async function loadFridayBank() {
const wd = d => WD[new Date(d + 'T12:00:00Z').getUTCDay()]; const wd = d => WD[new Date(d + 'T12:00:00Z').getUTCDay()];
document.getElementById('fbankCount').textContent = b.banked + ' banked'; document.getElementById('fbankCount').textContent = b.banked + ' banked';
document.getElementById('fbankDays').innerHTML = (b.days || []).map(d => { document.getElementById('fbankDays').innerHTML = (b.days || []).map(d => {
const st = d.banked ? ['var(--mint)', '&#10003;'] : d.future ? ['var(--line-strong)', '&middot;'] : d.day === b.today ? ['var(--amber)', '&#9675;'] : ['var(--line-strong)', '&times;']; const st = d.banked ? ['#43e8c3', '&#10003;'] : d.future ? ['var(--line-strong)', '&middot;'] : d.day === b.today ? ['#ffb238', '&#9675;'] : ['var(--line-strong)', '&times;'];
return '<span title="' + d.day + '" style="display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;border:1px solid ' + st[0] + ';font-size:13px"><b style="color:' + st[0] + '">' + st[1] + '</b>' + wd(d.day) + '</span>'; return '<span title="' + d.day + '" style="display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;border:1px solid ' + st[0] + ';font-size:13px"><b style="color:' + st[0] + '">' + st[1] + '</b>' + wd(d.day) + '</span>';
}).join('') + '<span style="display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;background:var(--violet-soft);font-size:13px">Fri: +' + b.banked + ' hunts</span>'; }).join('') + '<span style="display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;background:rgba(180,140,255,.18);font-size:13px">Fri: +' + b.banked + ' hunts</span>';
const t = (b.days || []).find(d => d.day === b.today); const t = (b.days || []).find(d => d.day === b.today);
let msg = ''; let msg = '';
if (b.isFriday) msg = b.banked ? '<b>It\'s Friday.</b> Your ' + b.banked + ' banked hunt' + (b.banked === 1 ? '' : 's') + ' are live on <a href="/api/my/polhunter">PolHunter</a> today.' : 'It\'s Friday. Bank hunts Saturday through Thursday for next Friday.'; if (b.isFriday) msg = b.banked ? '<b>It\'s Friday.</b> Your ' + b.banked + ' banked hunt' + (b.banked === 1 ? '' : 's') + ' are live on <a href="/api/my/polhunter">PolHunter</a> today.' : 'It\'s Friday. Bank hunts Saturday through Thursday for next Friday.';
-77
View File
@@ -1,77 +0,0 @@
// Promo tools > Network sites (Marty 2026-11-14): the promo kits of the other network sites, read live from each site's own public
// feed (GET <site>/api/promo-kit?u=<username>), so a creative or line changed on any of those sites shows here (ViralAdBlitz, DownlineHydra and 5xYourTeam added 2026-11-15, ViralAdSource and YourProgramBuilder 2026-11-17)
// at once. Usernames are network-wide: the member's InstantAdPay username is their sponsor link on those sites even if they never
// visited them. Nothing is stored here.
window.IAPNetKits = (function () {
const SITES = [
{ key: 'dlb', name: 'Downline Banners', feed: 'https://downlinebanners.com/api/promo-kit', blurb: 'One global line of $5 banner spots on Polygon. A spot buys 300 guaranteed views on the board and a place in the line; every sale is split on-chain in the same transaction. Nothing is promised: a spot is paid only when spots sell after it.' },
{ key: 'vbb', name: 'Viral Banner Blitz', feed: 'https://viralbannerblitz.com/api/promo-kit', blurb: 'One shared loop of 125x125 banners. Network members post free once a day, real visitors push the loop, and a banner that rides out earns network ad views. Weekly leaderboards for visitors sent. Advertising, not income.' },
{ key: 'vab', name: 'ViralAdBlitz', feed: 'https://viraladblitz.com/api/promo-kit', blurb: 'Your free text ad shows on your whole team\'s pages, five levels deep. A $5 Boost adds 500 views; every Boost is split on-chain in the same transaction. Nothing is promised.' },
{ key: 'vas', name: 'ViralAdSource', feed: 'https://viraladsource.com/api/promo-kit', blurb: 'Post a free text ad that anyone can reshare with their own link, and watch its family tree grow branch by branch. A $5 Boost puts an ad on top of the reshare board for 7 days; every Boost is split on-chain in the same transaction. Nothing is promised.' },
{ key: 'ypb', name: 'YourProgramBuilder', feed: 'https://yourprogrambuilder.com/api/promo-kit', blurb: 'Plant a program you already use, free, and network members save their own IDs in it. A visitor who comes through you sees your link first. At 10 saved IDs it goes to review for the Crypto Team Build Network builder. A $10 Spotlight buys 1,000 views, split by the contract. Nothing is promised.' },
{ key: 'dh', name: 'DownlineHydra', feed: 'https://downlinehydra.com/api/promo-kit', blurb: 'One join, many heads: one free account and one sponsor line across the network, plus the downline builder for the programs you promote. Pro is $30 one time, never a subscription, split on-chain. Nothing is promised.' },
{ key: 'vai', name: 'Video App Income', feed: 'https://videoappincome.com/api/promo-kit', blurb: 'Short promo videos made from your phone: type a topic, paste a link, and about a minute later there is a finished video with a voice, captions and music on its own tracked page. The first video is free. Credit purchases are split on-chain in the same transaction. Nothing is promised.' },
{ key: 'fivex', name: '5xYourTeam', feed: 'https://5xyourteam.com/api/promo-kit', blurb: 'The weekly draft for people who need a sponsor. A $10 position lets you draft people waiting in the holding tank and coach them. Nothing is promised.' }
];
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
const $ = id => document.getElementById(id);
let user = '', cur = '', cache = {}, txt = [];
try { cur = localStorage.getItem('iap.netkit') || ''; } catch (e) {}
if (!SITES.some(s => s.key === cur)) cur = SITES[0].key;
function setUser(u) { if (u && u !== user) { user = u; cache = {}; } }
async function copy(t, btn) {
try { await navigator.clipboard.writeText(t); } catch (e) { const a = document.createElement('textarea'); a.value = t; document.body.appendChild(a); a.select(); try { document.execCommand('copy'); } catch (e2) {} a.remove(); }
if (window.IAP && IAP.status) IAP.status('Copied.', 'ok');
if (btn) { const o = btn.textContent; btn.textContent = 'Copied'; setTimeout(() => { btn.textContent = o; }, 1300); }
}
const cb = (t, label, cls) => { txt.push(t); return '<button type="button" class="btn small ' + (cls == null ? 'sec' : cls) + '" data-nkc="' + (txt.length - 1) + '">' + esc(label || 'Copy') + '</button>'; };
function pick() {
const p = $('nkPick'); if (!p) return;
p.innerHTML = SITES.map(s => '<button type="button" class="chip-t' + (s.key === cur ? ' on' : '') + '" data-nk="' + s.key + '">' + esc(s.name) + '</button>').join('');
p.querySelectorAll('[data-nk]').forEach(b => b.addEventListener('click', () => { cur = b.dataset.nk; try { localStorage.setItem('iap.netkit', cur); } catch (e) {} pick(); show(); }));
}
function render(site, k) {
txt = [];
const by = {}; const angles = [];
(k.creatives || []).forEach(c => { if (!by[c.angle]) { by[c.angle] = []; angles.push(c); } by[c.angle].push(c); });
let h = '<p class="muted small" style="margin:0 0 12px">' + esc(site.blurb) + '</p>';
// tracked links (2026-11-14): the site's LinkSpin network link, credited here to InstantAdPay as the site that sent the visit
const strip = (label, url, cls) => '<div class="promo-strip" style="padding:0 0 12px"><div><span class="eyebrow" style="margin:0 0 4px">' + esc(label) + '</span><div class="mono small" style="overflow-wrap:anywhere">' + esc(url) + '</div></div><span>' + cb(url, 'Copy link', cls) + '</span></div>';
const fromHere = u => String(u).replace(/([?&]src=)[a-z0-9]+/gi, '$1iap'); // also inside copy and HTML that already carry a tracked link (ViralAdSource 2026-11-17)
h += k.links.map(l => strip(l.label, l.url, '') + (l.tracked ? strip(l.label + ', tracked', fromHere(l.tracked), 'sec') : '')).join('');
if (k.links.some(l => l.tracked)) h += '<p class="muted small" style="margin:0 0 12px">A tracked link goes through LinkSpin first, so the network can see the visit came from InstantAdPay, then opens the same page with your username. Use either one.</p>';
h += '<div class="card-head" style="margin-top:6px"><h3>Creatives</h3><span class="sub">every HTML snippet already links to you</span></div>';
angles.forEach(a => {
h += '<details class="promo-block nk-set"' + (a === angles[0] ? ' open' : '') + '><summary class="pb-head" style="cursor:pointer"><span class="lab"><b>' + esc(a.angleLabel) + '</b></span> <span class="muted small">' + by[a.angle].length + ' sizes</span></summary><div class="nk-grid">'
+ by[a.angle].map(c => '<figure class="nk-fig"><a href="' + esc(c.url) + '" target="_blank" rel="noopener"><img src="' + esc(c.url) + '" alt="' + esc(k.name + ', ' + c.label) + '" width="' + c.w + '" height="' + c.h + '" loading="lazy" style="max-width:' + Math.min(c.w, c.w > 600 ? 420 : c.w) + 'px"></a>'
+ '<figcaption class="small"><b>' + esc(c.label) + '</b> <span class="muted">' + c.w + '×' + c.h + '</span></figcaption><div class="pb-actions"><a class="btn small sec" href="' + esc(c.url) + '" target="_blank" rel="noopener" download>Download</a> ' + cb(c.url, 'Copy URL') + ' ' + cb(fromHere(c.html), 'Copy HTML') + '</div></figure>').join('')
+ '</div></details>';
});
h += '<div class="card-head" style="margin-top:14px"><h3>Short lines</h3><span class="sub">chats, comments, text ads, signatures</span></div>'
+ k.lines.map(fromHere).map(t => '<div class="promo-block"><div class="pb-text">' + esc(t) + '</div><div class="pb-actions">' + cb(t) + '</div></div>').join('');
h += '<div class="card-head" style="margin-top:14px"><h3>Headlines</h3></div>' + k.headlines.map(t => '<div class="promo-block"><div class="pb-text"><b>' + esc(t) + '</b></div><div class="pb-actions">' + cb(t) + '</div></div>').join('');
h += '<div class="card-head" style="margin-top:14px"><h3>Email</h3><span class="sub">plain text, paste it into any mailer</span></div><div class="promo-block"><div class="pb-head"><span class="lab">Subject:</span> ' + esc(k.email.subject) + '</div><div class="pb-text">' + esc(fromHere(k.email.body)) + '</div><div class="pb-actions">' + cb(k.email.subject, 'Copy subject') + ' ' + cb(fromHere(k.email.body), 'Copy email', '') + '</div></div>';
h += '<div class="card-head" style="margin-top:14px"><h3>Social posts</h3></div>' + k.posts.map(fromHere).map(t => '<div class="promo-block"><div class="pb-text">' + esc(t) + '</div><div class="pb-actions">' + cb(t, 'Copy post') + '</div></div>').join('');
if (k.note) h += '<p class="muted small" style="margin:12px 0 0">' + esc(k.note) + '</p>';
if (k.promotePage) h += '<p class="small" style="margin:8px 0 0">The same kit is on <a href="' + esc(k.promotePage + '?u=' + encodeURIComponent(user)) + '" target="_blank" rel="noopener">' + esc(k.name) + ' &rsaquo; Promote</a>.</p>';
return h;
}
async function show() {
const box = $('nkBody'); if (!box) return;
const site = SITES.find(s => s.key === cur);
if (!user) { box.innerHTML = '<p class="muted">Pick a username first: it becomes your link on every network site.</p>'; return; }
box.innerHTML = '<p class="muted small">Loading the ' + esc(site.name) + ' kit...</p>';
try {
if (!cache[cur]) {
const r = await fetch(site.feed + '?u=' + encodeURIComponent(user), { cache: 'no-store' });
if (!r.ok) throw new Error('HTTP ' + r.status);
cache[cur] = await r.json();
}
if (cur !== site.key) return;
box.innerHTML = render(site, cache[cur]);
box.querySelectorAll('[data-nkc]').forEach(b => b.addEventListener('click', () => copy(txt[Number(b.dataset.nkc)], b)));
} catch (e) { box.innerHTML = '<p class="muted">Could not load the ' + esc(site.name) + ' kit right now. Try again in a minute.</p>'; }
}
function load(u) { if (u) setUser(u); pick(); show(); }
return { load, setUser, SITES };
})();
-36
View File
@@ -1,36 +0,0 @@
// "Part of the network" footer line for pages that do not load common.js (Marty 2026-11-14 trust pack): company line + the network
// list from the hub (/api/network-sites, built-in copy if it does not answer). The current site comes from data-site on this tag.
(function () {
var me = (document.currentScript && document.currentScript.getAttribute('data-site')) || 'iap';
var FALLBACK = [['iap', 'InstantAdPay', 'https://instantadpay.com'], ['linkspin', 'LinkSpin', 'https://linkspin.app'], ['dlb', 'Downline Banners', 'https://downlinebanners.com'],
['vbb', 'Viral Banner Blitz', 'https://viralbannerblitz.com'], ['stackpol', 'Stack POL', 'https://stackpol.com'], ['earnerscorner', 'Earners Corner', 'https://earnerscorner.com']].map(function (a) { return { id: a[0], name: a[1], url: a[2] }; });
// the links carry a referral username (Marty 2026-11-15): the signed-in member's own, else the sponsor this visitor came in on
// (iap.sponsor cookie, usernames only). Tracked links get it as s1 (LinkSpin sends it on as ?ref=), plain links as ?ref=; Earners Corner none.
function okRef(v) { return /^[A-Za-z0-9_.-]{1,40}$/.test(v) && !/^\d+$/.test(v) && !/^0x[0-9a-f]{40}$/i.test(v) && v !== 'company' && v !== 'top'; }
function refCookie() { var m = document.cookie.match(/(?:^|;\s*)iap\.sponsor=([^;]*)/); try { var v = m ? decodeURIComponent(m[1]) : ''; return okRef(v) ? v : ''; } catch (e) { return ''; } }
function withRef(s, ref) {
var href = s.go || s.url; if (!ref || s.id === 'earnerscorner') return href;
try { var u = new URL(href); u.searchParams.set(s.go ? 's1' : 'ref', ref); return u.toString(); } catch (e) { return href; }
}
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]; }); }
function run() {
var f = document.querySelector('footer'); if (!f || f.querySelector('.netline')) return;
var hasLegal = !!f.querySelector('a[href="/terms"]'); // decided once, before this line adds its own links
var host = f.querySelector('.wrap') || f;
var box = document.createElement('div'); box.className = 'netline';
box.style.cssText = 'flex-basis:100%;width:100%;margin-top:10px;display:flex;gap:6px 14px;flex-wrap:wrap;align-items:baseline;font-size:12.5px';
host.appendChild(box);
var list = FALLBACK, ref = refCookie();
var paint = function () {
box.innerHTML = (hasLegal ? '' : '<span style="flex-basis:100%"><a href="/terms">Terms</a> · <a href="/disclaimer">Earnings Disclaimer</a> · <a href="/privacy">Privacy</a> · <a href="/contract">Contract</a> · <a href="/ledger">Ledger</a> · <a href="/support">Support</a></span>') + '<span style="flex-basis:100%">© 2026 TrustClickz</span><b>Part of the network</b><span>One account across the network:</span>' + list.map(function (s) {
return s.id === me ? '<span aria-current="page" style="font-weight:700">' + esc(s.name) + ' (you are here)</span>' : '<a href="' + esc(withRef(s, ref)) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>';
}).join('');
};
paint();
fetch('/api/network-sites').then(function (r) { return r.json(); }).then(function (l) { if (Array.isArray(l) && l.length) { list = l; paint(); } }).catch(function () {});
fetch('/api/me', { credentials: 'same-origin' }).then(function (r) { return r.json(); }).then(function (m) { if (m && m.signedIn && m.username && okRef(m.username)) { ref = m.username; paint(); } }).catch(function () {});
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
// Network Weekend ribbon (2026-11-17): date-gated inside netweekend.js; loaded once even when common.js loads it too
if (!document.querySelector('script[src^="/assets/netweekend.js"]')) { var t = document.createElement('script'); t.src = '/assets/netweekend.js?v=20261117nw'; t.defer = true; t.setAttribute('data-site', me); document.head.appendChild(t); }
})();
-30
View File
@@ -1,30 +0,0 @@
// Network sign-in, the sign-in page side (2026-11-12). The SAME file ships in InstantAdPay and LinkSpin (see networksso.js).
// On a sign-in screen with no session: ask /api/sso/status once; { check: true } means bounce once through the other site,
// which signs the member in here if they are signed in there (the server allows one try per browser per 30 minutes and none
// after a sign-out). { hint } means they came from the other site but need the email code here the first time: fill it in.
(function () {
if (window.__netsso) return; window.__netsso = 1;
const BOXES = '#mcEmail,#jnEmail,#siEmail';
function fill(email, peer) {
let n = 0;
const t = setInterval(() => {
const el = document.querySelector(BOXES);
if (el && el.offsetParent !== null) {
clearInterval(t);
if (!el.value) el.value = email;
if (!document.getElementById('nssoNote')) {
const p = document.createElement('p'); p.id = 'nssoNote'; p.className = 'muted small'; p.setAttribute('role', 'note'); p.style.margin = '6px 0';
p.textContent = 'Welcome over from ' + peer + '. The first time here, send yourself a code with the same email to finish signing in. After that, ' + peer + ' signs you in here.';
(el.closest('label') || el).insertAdjacentElement('afterend', p);
}
try { el.focus(); } catch (e) {}
} else if (++n > 60) clearInterval(t);
}, 250);
}
fetch('/api/sso/status', { credentials: 'same-origin', headers: { Accept: 'application/json' }, cache: 'no-store' })
.then(r => r.json()).then(d => {
if (!d) return;
if (d.check) { location.replace('/sso/start?mode=check&to=' + encodeURIComponent(location.pathname + location.search + location.hash)); return; }
if (d.hint) fill(String(d.hint), String(d.peer || 'the other site'));
}).catch(() => {});
})();
-68
View File
@@ -1,68 +0,0 @@
// "Network Weekend" ribbon (Marty 2026-11-17): a thin bar at the top of every network site page while a network event is live.
// Data: /api/network-deals (netdeals.js, from the hub). Switches on and off by this page's own clock at the event's exact
// startsAt / endsAt (US Central midnights), so a cached feed never shows it early or late, and it takes itself down at endsAt on
// a page left open. Shows this site's own deal for today (byDay, Central date) and links to the full deals page.
// The same file lives in every network site. Never RM Circle, never the games. No inline styles (CSP): styles go through CSSOM.
// Test clock: window.__NW_NOW (ms) before this script runs; nothing else.
(function () {
if (window.__nwRibbon) return; window.__nwRibbon = 1;
var tag = document.currentScript;
var meAttr = (tag && tag.getAttribute('data-site')) || '';
function now() { return typeof window.__NW_NOW === 'number' ? window.__NW_NOW : Date.now(); }
// late November is CST (UTC-6) for every date this ribbon covers
function ctDay(ms) { return new Date(ms - 6 * 3600 * 1000).toISOString().slice(0, 10); }
function closedKey(id, day) { return 'nw.closed.' + id + '.' + day; }
function isClosed(id, day) { try { return window.localStorage.getItem(closedKey(id, day)) === '1'; } catch (e) { return false; } }
function setClosed(id, day) { try { window.localStorage.setItem(closedKey(id, day), '1'); } catch (e) {} }
var bar = null;
function remove() { if (bar && bar.parentNode) bar.parentNode.removeChild(bar); bar = null; }
function paint(body) {
var me = meAttr || (body && body.self) || '';
var t = now();
var ev = ((body && body.events) || []).filter(function (e) { return t >= Date.parse(e.startsAt) && t < Date.parse(e.endsAt); })[0];
if (!ev) { remove(); return false; }
var day = ctDay(t);
if (isClosed(ev.id, day)) { remove(); return true; }
var mine = (ev.deals || []).filter(function (d) { return d.site === me && t < Date.parse(d.endsAt || ev.endsAt); })[0];
var line = mine ? ((mine.byDay && mine.byDay[day]) || mine.text) : '';
var label = (ev.days && ev.days[day]) || '';
if (label && line.indexOf(label + ': ') === 0) line = line.slice(label.length + 2); // "Black Friday, Black Friday: ..." reads once
var onDealsPage = !!ev.url && (function () { try { var u = new URL(ev.url); return location.pathname === u.pathname && (location.hostname === u.hostname || me === 'iap'); } catch (e) { return false; } })();
remove();
bar = document.createElement('div');
bar.className = 'nw-ribbon'; bar.setAttribute('role', 'region'); bar.setAttribute('aria-label', ev.name);
bar.style.cssText = 'position:relative;z-index:50;display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;justify-content:center;padding:8px 40px 8px 16px;'
+ 'background:#14161b;color:#f4f1e8;font:600 13.5px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-align:center;border-bottom:2px solid #f2c94c';
// built node by node with CSSOM styles: no style attributes, so a strict CSP (style-src 'self') has nothing to block
function el(tagName, css, text) { var n = document.createElement(tagName); if (css) n.style.cssText = css; if (text) n.textContent = text; return n; }
var head = el('span'); head.appendChild(el('b', 'color:#f2c94c', ev.name)); if (label) head.appendChild(document.createTextNode(' · ' + label));
bar.appendChild(head);
var body2 = el('span', 'font-weight:500', line || ev.tagline);
if (line && mine && mine.note) { body2.appendChild(document.createTextNode(' ')); body2.appendChild(el('span', 'opacity:.75', mine.note)); }
bar.appendChild(body2);
if (ev.url && !onDealsPage) { var a = el('a', 'color:#f2c94c;text-decoration:underline', 'See every deal'); a.href = ev.url; a.target = '_blank'; a.rel = 'noopener'; bar.appendChild(a); }
var x = el('button', 'position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:0;color:#f4f1e8;font-size:18px;line-height:1;cursor:pointer;padding:4px 8px', '×');
x.type = 'button'; x.setAttribute('aria-label', 'Hide for today'); bar.appendChild(x);
bar.querySelector('button').addEventListener('click', function () { setClosed(ev.id, day); remove(); });
document.body.insertBefore(bar, document.body.firstChild);
return true;
}
var feed = null, timer = null;
function schedule() {
clearTimeout(timer); if (!feed) return;
// wake at the next switch moment (start, end, a deal ending, the next Central midnight), at least once a minute
var t = now(), next = t + 60 * 1000;
(feed.events || []).forEach(function (e) {
[e.startsAt, e.endsAt].concat((e.deals || []).map(function (d) { return d.endsAt; })).forEach(function (s) { var x = Date.parse(s); if (x > t && x < next) next = x; });
});
timer = setTimeout(function () { if (typeof window.__NW_NOW === 'number') window.__NW_NOW += next - t; paint(feed); schedule(); }, Math.max(250, next - t));
}
function run() {
fetch('/api/network-deals', { credentials: 'omit' }).then(function (r) { return r.ok ? r.json() : null; }).then(function (b) {
if (!b || !Array.isArray(b.events) || !b.events.length) return;
feed = b; paint(b); schedule();
}).catch(function () {});
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
window.__nwPaint = function (b) { feed = b; return paint(b); }; // tests
})();
+12 -81
View File
@@ -286,10 +286,7 @@ window.IAPPromo = (function () {
const gms = $('promo-games'); const gms = $('promo-games');
if (gms && token && gms.dataset.filled !== token) { if (gms && token && gms.dataset.filled !== token) {
gms.dataset.filled = token; gms.dataset.filled = token;
const enc = encodeURIComponent; const enc = encodeURIComponent, CDN = 'https://coolify-saasytop.nyc3.cdn.digitaloceanspaces.com/game-banners/';
// short image host (2026-11-03, Michael Camire via Marty): /b/<slug>/<file> on the share domain serves the game-banners CDN files in
// place; the ~105-character CDN URLs were cut off by exchange and safelist image fields. 728x90.png expands to <slug>-728x90.png.
const CDN = ((typeof SHARE_DOMAIN === 'string' && SHARE_DOMAIN) ? 'https://' + SHARE_DOMAIN : location.origin) + '/b/';
const preLaunch = (y, m, d) => Date.now() < Date.UTC(y, m - 1, d, 5); // before midnight Central on that day const preLaunch = (y, m, d) => Date.now() < Date.UTC(y, m - 1, d, 5); // before midnight Central on that day
const GAMES = [ const GAMES = [
// the public games page (2026-10-10, Marty: "make sure that's in the promo tools for everyone"): every game on one page, with the member's referral on the Join button // the public games page (2026-10-10, Marty: "make sure that's in the promo tools for everyone"): every game on one page, with the member's referral on the Join button
@@ -298,35 +295,19 @@ window.IAPPromo = (function () {
{ name: 'Short post', text: 'Every game in the InstantAdPay network on one page: a word puzzle, a hidden-object hunt, a match-3, a runner, a scavenger hunt, a cyberpunk battler, a brick breaker, a mining game. Free to play, and they pay POL to the wallet on your account. {L}' }, { name: 'Short post', text: 'Every game in the InstantAdPay network on one page: a word puzzle, a hidden-object hunt, a match-3, a runner, a scavenger hunt, a cyberpunk battler, a brick breaker, a mining game. Free to play, and they pay POL to the wallet on your account. {L}' },
{ name: 'Friendly post', text: 'If you like small games that actually pay something, this is the page I send people. Every one is free, and they all pay POL on Polygon for first clears, levels, bosses and daily puzzles. Pick one: {L}' }, { name: 'Friendly post', text: 'If you like small games that actually pay something, this is the page I send people. Every one is free, and they all pay POL on Polygon for first clears, levels, bosses and daily puzzles. Pick one: {L}' },
{ name: 'Telegram or WhatsApp line', text: 'All the games that pay POL, one page, free to play: {L}' }] }, { name: 'Telegram or WhatsApp line', text: 'All the games that pay POL, one page, free to play: {L}' }] },
// EnjoyBestGames arcade (2026-10-31, Marty): the engagement site. Hundreds of free HTML5 games draw the crowd; the featured
// "Games that pay Polygon" row is the only part that pays, and every game link there carries the member's ref through the
// ?r= cookie (30 days). The site's own images live on the game-banners CDN like the other kits.
{ slug: 'enjoybestgames', name: 'EnjoyBestGames arcade', link: 'https://enjoybestgames.com/?r=', img: CDN + 'enjoybestgames/og-enjoybestgames.jpg', sub: 'free arcade, the Polygon games pay',
note: 'EnjoyBestGames is an engagement site: hundreds of free HTML5 games people already search for. The featured row, Games that pay Polygon, is our network games, and those are the only ones that pay. The rest are there to draw the crowd and keep them on the site. Your link sets a 30-day cookie, so anyone who plays a featured game or clicks the strip lands on InstantAdPay as your referral.',
posts: [
{ name: 'Short post', text: 'Free games site I keep open on my phone: hundreds of HTML5 games, nothing to install. The featured row is the games that pay Polygon to your wallet when you clear levels and bosses. Play free: {L}' },
{ name: 'Friendly post', text: 'If you like casual games, bookmark this one. EnjoyBestGames has hundreds of free games in every genre, and a featured row of games that actually pay POL on Polygon for first clears and daily puzzles. Start with any of them: {L}' },
{ name: 'Casual gamer angle', text: 'Puzzle, racing, arcade, word games, match-3. All free, all in the browser. And the Games that pay Polygon row does what it says. {L}' },
{ name: 'Telegram or WhatsApp line', text: 'Hundreds of free games, and the Polygon ones pay: {L}' }] },
// Warp & Wares (2026-10-29, the 30-day season game): shows once 'warpwares' is in the public games list (gamesLive, in season)
{ slug: 'warpwares', name: 'Warp & Wares', link: 'https://warpwares.saasy.top/?ref=', img: 'https://warpwares.saasy.top/og-warpwares.jpg', sub: 'space trading season that pays Polygon',
posts: [
{ name: 'Short post', text: 'Warp & Wares is a free 30-day space trading season. One shared galaxy, 200 turns a day for everyone: buy low, sell high, hold your sectors, build a base, run a team. The weekly territory and trader prizes pay Polygon, and the season leaderboard pays at the close. {L}' },
{ name: 'Friendly post', text: 'If you ever played Trade Wars on a BBS, this is that feeling again, on your phone. Warp & Wares: 30 days, 1,200 sectors, three goods, a team of five, and prizes in Polygon at published positions. Free to play: {L}' },
{ name: 'Telegram or WhatsApp line', text: 'New season game in the network: Warp & Wares. 200 turns a day, trade and hold territory, weekly Polygon prizes. Free: {L}' }] },
// Turkey Drop (2026-10-28, the Thanksgiving season game): shows only while it is in the public games list (gamesLive, through Nov 30) and from Nov 2 // Turkey Drop (2026-10-28, the Thanksgiving season game): shows only while it is in the public games list (gamesLive, through Nov 30) and from Nov 2
{ slug: 'turkeydrop', name: 'Turkey Drop', link: 'https://turkeydropgame.com/?ref=', img: CDN + 'turkeydrop/og-turkeydrop.jpg', sub: 'Thanksgiving game that pays Polygon, through Nov 30', { slug: 'turkeydrop', name: 'Turkey Drop', link: 'https://turkeydropgame.com/?ref=', img: 'https://coolify-saasytop.nyc3.cdn.digitaloceanspaces.com/game-banners/turkeydrop/og-turkeydrop.jpg', sub: 'Thanksgiving game that pays Polygon, through Nov 30',
posts: [ posts: [
{ name: 'Short post', text: 'Turkey Drop is a free Thanksgiving game. The radio station helicopter is dropping turkeys over the mall, and you swing the net to catch them before they splat. Score milestones pay Polygon the first time you reach them, and the top 3 each week win a Polygon prize. Here through Nov 30: {L}' }, { name: 'Short post', text: 'Turkey Drop is a free Thanksgiving game. The radio station helicopter is dropping turkeys over the mall, and you swing the net to catch them before they splat. Score milestones pay Polygon the first time you reach them, and the top 3 each week win a Polygon prize. Here through Nov 30: {L}' },
{ name: 'Telegram or WhatsApp line', text: 'Thanksgiving game in the network: Turkey Drop. Catch the turkeys before they splat, score milestones pay Polygon. Free, through Nov 30: {L}' }] }, { name: 'Telegram or WhatsApp line', text: 'Thanksgiving game in the network: Turkey Drop. Catch the turkeys before they splat, score milestones pay Polygon. Free, through Nov 30: {L}' }] },
// POL Miner (2026-10-28): shows once 'polminer' is in gamesLive (the public games list), like PolyBreak // POL Miner (2026-10-28): shows once 'polminer' is in gamesLive (the public games list), like PolyBreak
{ slug: 'polminer', name: 'POL Miner', link: 'https://polminer.com/?ref=', img: CDN + 'polminer/og-polminer.jpg', sub: 'mining game that pays Polygon', { slug: 'polminer', name: 'POL Miner', link: 'https://polminer.com/?ref=', img: 'https://coolify-saasytop.nyc3.cdn.digitaloceanspaces.com/game-banners/polminer/og-polminer.jpg', sub: 'mining game that pays Polygon',
posts: [ posts: [
{ name: 'Short post', text: 'POL Miner is a free mining game. Dig down through the layers, haul ore up to sell, upgrade your pick, lamp and cart, and beat a drill boss every 30 m. The rare pink Polygon crystals pay Polygon to the wallet on your InstantAdPay account. {L}' }, { name: 'Short post', text: 'POL Miner is a free mining game. Dig down through the layers, haul ore up to sell, upgrade your pick, lamp and cart, and beat a drill boss every 30 m. The rare pink Polygon crystals pay Polygon to the wallet on your InstantAdPay account. {L}' },
{ name: 'Friendly post', text: 'This one is easy to lose an hour in. POL Miner is free, it plays fine on a phone, and you sign in with your InstantAdPay account. Each pink Polygon crystal you dig out pays Polygon, and so does each drill boss the first time you beat it. Give it a dig: {L}' }, { name: 'Friendly post', text: 'This one is easy to lose an hour in. POL Miner is free, it plays fine on a phone, and you sign in with your InstantAdPay account. Each pink Polygon crystal you dig out pays Polygon, and so does each drill boss the first time you beat it. Give it a dig: {L}' },
{ name: 'Crystal angle', text: 'Somewhere under the gravel there is a pink glow. In POL Miner the rare Polygon crystals pay Polygon when you dig them out. Free to play: {L}' }, { name: 'Crystal angle', text: 'Somewhere under the gravel there is a pink glow. In POL Miner the rare Polygon crystals pay Polygon when you dig them out. Free to play: {L}' },
{ name: 'Telegram or WhatsApp line', text: 'New game in the network: POL Miner. Free mining game, the pink Polygon crystals pay Polygon: {L}' }] }, { name: 'Telegram or WhatsApp line', text: 'New game in the network: POL Miner. Free mining game, the pink Polygon crystals pay Polygon: {L}' }] },
{ slug: 'polybreak', name: 'PolyBreak', link: 'https://polybreak.app/?ref=', img: CDN + 'polybreak/og-polybreak.jpg', sub: 'brick breaker that pays Polygon', { slug: 'polybreak', name: 'PolyBreak', link: 'https://polybreak.app/?ref=', img: 'https://coolify-saasytop.nyc3.cdn.digitaloceanspaces.com/game-banners/polybreak/og-polybreak.jpg', sub: 'brick breaker that pays Polygon',
posts: [ posts: [
{ name: 'Short post', text: 'PolyBreak is a free brick breaker in the old Amiga arcade style. Smash a wall of glass jewel bricks, grab the capsules, and catch the purple Polygon gem when it drops. Your first clear of each round pays Polygon to the wallet on your InstantAdPay account. {L}' }, { name: 'Short post', text: 'PolyBreak is a free brick breaker in the old Amiga arcade style. Smash a wall of glass jewel bricks, grab the capsules, and catch the purple Polygon gem when it drops. Your first clear of each round pays Polygon to the wallet on your InstantAdPay account. {L}' },
{ name: 'Friendly post', text: 'I grew up on brick breakers, so this one got me. PolyBreak is free, it plays great on a phone, and it signs in with your InstantAdPay account. First round clears pay Polygon, and so does every purple gem you catch. Out of paddles? Visit a member\'s page and you get one more. Give it a try: {L}' }, { name: 'Friendly post', text: 'I grew up on brick breakers, so this one got me. PolyBreak is free, it plays great on a phone, and it signs in with your InstantAdPay account. First round clears pay Polygon, and so does every purple gem you catch. Out of paddles? Visit a member\'s page and you get one more. Give it a try: {L}' },
@@ -343,7 +324,7 @@ window.IAPPromo = (function () {
{ name: 'Telegram or WhatsApp line', text: 'New game in the network: PolyWarriors. Free cyberpunk battler, pays Polygon for first wins, your first warrior mints free: {L}' }] }, { name: 'Telegram or WhatsApp line', text: 'New game in the network: PolyWarriors. Free cyberpunk battler, pays Polygon for first wins, your first warrior mints free: {L}' }] },
{ slug: 'gemkingdom', name: 'Gem Kingdom', link: 'https://gemkingdom.app/?ref=', img: 'https://gemkingdom.app/fantasy/og-gemkingdom.jpg', sub: 'fantasy match-3 with boss battles', { slug: 'gemkingdom', name: 'Gem Kingdom', link: 'https://gemkingdom.app/?ref=', img: 'https://gemkingdom.app/fantasy/og-gemkingdom.jpg', sub: 'fantasy match-3 with boss battles',
posts: [ posts: [
{ name: 'Short post', text: 'Gem Kingdom is a fantasy match-3 you can start playing free. Lead three heroes, beat the Goblin King’s bosses and rebuild your village. A one-time $5 Royal Charter opens the last three chapters and their POL rewards. Play here: {L}' }, { name: 'Short post', text: 'Gem Kingdom is a free fantasy match-3. Lead three heroes, beat the Goblin King’s bosses and rebuild your village. Boss wins come with POL rewards. Play here: {L}' },
{ name: 'Friendly post', text: 'Looking for a game to unwind with? Gem Kingdom is match-3 with a story: forge weapons, collect stars and climb the leaderboard. Free in your browser: {L}' }] }, { name: 'Friendly post', text: 'Looking for a game to unwind with? Gem Kingdom is match-3 with a story: forge weapons, collect stars and climb the leaderboard. Free in your browser: {L}' }] },
{ slug: 'roadagent', name: 'Road Agent', link: 'https://roadagent.app/?ref=', img: 'https://roadagent.app/og-roadagent.jpg', sub: 'night highway shooter', { slug: 'roadagent', name: 'Road Agent', link: 'https://roadagent.app/?ref=', img: 'https://roadagent.app/og-roadagent.jpg', sub: 'night highway shooter',
posts: [ posts: [
@@ -353,11 +334,10 @@ window.IAPPromo = (function () {
posts: [ posts: [
{ name: 'Short post', text: 'Drip Runner is a quick free runner game. Hop the network, dodge the drones, clear chapters and refuel for POL rewards. Play in your browser: {L}' }, { name: 'Short post', text: 'Drip Runner is a quick free runner game. Hop the network, dodge the drones, clear chapters and refuel for POL rewards. Play in your browser: {L}' },
{ name: 'Friendly post', text: 'Got two minutes? Drip Runner is a fast little runner game I keep coming back to. See how far you get: {L}' }] }, { name: 'Friendly post', text: 'Got two minutes? Drip Runner is a fast little runner game I keep coming back to. See how far you get: {L}' }] },
{ slug: 'clutterhunt', name: 'ClutterHunt', link: 'https://clutterhunt.com/?ref=', img: CDN + 'clutterhunt/og-harvest-farmhouse.jpg', sub: 'hidden-object game, Harvest Farmhouse rooms through Nov 30', { slug: 'clutterhunt', name: 'ClutterHunt', link: 'https://clutterhunt.com/?ref=', img: 'https://clutterhunt.com/og-clutterhunt.jpg', sub: 'seasonal hidden-object game',
posts: [ posts: [
{ name: 'Short post', text: 'ClutterHunt is a free hidden-object game, and the Harvest Farmhouse just opened: six new rooms through Nov 30, a clock running, and everything moves each time you play. First clears pay POL. Can you three-star Expert? {L}' }, { name: 'Short post', text: 'ClutterHunt is a free hidden-object game. Six rooms to search, a clock running, and everything moves each time you play. Can you three-star Expert? {L}' },
{ name: 'Friendly post', text: 'If you like spot-the-object puzzles, try ClutterHunt. New farmhouse rooms this month, free in your browser, with POL rewards for clearing rooms: {L}' }, { name: 'Friendly post', text: 'If you like spot-the-object puzzles, try ClutterHunt. Free in your browser, with POL rewards for clearing rooms: {L}' }] },
{ name: 'Telegram or WhatsApp line', text: 'ClutterHunt has six new Harvest Farmhouse rooms through Nov 30. Free hidden-object game, first clears pay POL: {L}' }] },
{ slug: 'spellwheel', name: 'SpellWheel', link: 'https://spellwheel.com/?ref=', img: 'https://spellwheel.com/og-spellwheel.jpg', sub: 'letter-wheel word game', { slug: 'spellwheel', name: 'SpellWheel', link: 'https://spellwheel.com/?ref=', img: 'https://spellwheel.com/og-spellwheel.jpg', sub: 'letter-wheel word game',
posts: [ posts: [
{ name: 'Short post', text: 'SpellWheel is a free word game. Swipe the letters on the wheel to fill the grid, one place at a time.' + (preLaunch(2026, 10, 10) ? ' Opens Saturday Oct 10.' : '') + ' {L}' }, { name: 'Short post', text: 'SpellWheel is a free word game. Swipe the letters on the wheel to fill the grid, one place at a time.' + (preLaunch(2026, 10, 10) ? ' Opens Saturday Oct 10.' : '') + ' {L}' },
@@ -365,7 +345,7 @@ window.IAPPromo = (function () {
{ slug: 'spookydoors', name: 'Spooky Doors', link: 'https://spookydoors.com/?ref=', kit: 'promo-spookydoors', seasonal: true }, { slug: 'spookydoors', name: 'Spooky Doors', link: 'https://spookydoors.com/?ref=', kit: 'promo-spookydoors', seasonal: true },
{ slug: 'polhunter', name: 'PolHunter', link: 'https://polhunter.com/?r=', kit: 'promo-polhunter' }]; { slug: 'polhunter', name: 'PolHunter', link: 'https://polhunter.com/?r=', kit: 'promo-polhunter' }];
const SIZES = [['728x90', 'Leaderboard'], ['468x60', 'Banner'], ['320x50', 'Mobile banner'], ['300x250', 'Medium rectangle'], ['336x280', 'Large rectangle'], ['250x250', 'Square'], ['125x125', 'Button'], ['160x600', 'Wide skyscraper'], ['120x600', 'Skyscraper'], ['300x600', 'Half page'], ['600x300', 'Traffic exchange / splash page']]; const SIZES = [['728x90', 'Leaderboard'], ['468x60', 'Banner'], ['320x50', 'Mobile banner'], ['300x250', 'Medium rectangle'], ['336x280', 'Large rectangle'], ['250x250', 'Square'], ['125x125', 'Button'], ['160x600', 'Wide skyscraper'], ['120x600', 'Skyscraper'], ['300x600', 'Half page'], ['600x300', 'Traffic exchange / splash page']];
const avail = { spookydoors: false, roadagent: !preLaunch(2026, 10, 15), polybreak: false, polminer: false, warpwares: false, turkeydrop: false }; // Warp & Wares: in the public games list (its season window applies there) // PolyBreak joins once it is in gamesLive (public games list) // seasonal: the Spooky Doors kit says whether its season is showing; Road Agent joins the list on its launch day const avail = { spookydoors: false, roadagent: !preLaunch(2026, 10, 15), polybreak: false, polminer: false, turkeydrop: false }; // Turkey Drop: in the public games list AND from Nov 2 (its season start) // PolyBreak joins once it is in gamesLive (public games list) // seasonal: the Spooky Doors kit says whether its season is showing; Road Agent joins the list on its launch day
const list = () => GAMES.filter(g => avail[g.slug] !== false); const list = () => GAMES.filter(g => avail[g.slug] !== false);
let cur = null; try { cur = localStorage.getItem('iap.gmGame'); } catch (e) {} let cur = null; try { cur = localStorage.getItem('iap.gmGame'); } catch (e) {}
const draw = () => { const draw = () => {
@@ -377,7 +357,6 @@ window.IAPPromo = (function () {
$('gmGeneric').hidden = !!g.kit; $('gmGeneric').hidden = !!g.kit;
if (!g.kit) { if (!g.kit) {
$('gmTitle').textContent = g.name; $('gmSub').textContent = g.sub || ''; $('gmTitle').textContent = g.name; $('gmSub').textContent = g.sub || '';
const gn = $('gmNote'); if (gn) { gn.textContent = g.note || ''; gn.hidden = !g.note; }
$('gmLink').textContent = link; $('gmLink').textContent = link;
$('gmLinkCopy').onclick = async () => { try { await navigator.clipboard.writeText(link); status('Link copied.', 'ok'); } catch (e) { status('Copy failed.', 'bad'); } }; $('gmLinkCopy').onclick = async () => { try { await navigator.clipboard.writeText(link); status('Link copied.', 'ok'); } catch (e) { status('Copy failed.', 'bad'); } };
const posts = g.posts.map(p => ({ name: p.name, text: p.text.replace('{L}', link) })), hook = posts[0].text.replace(link, '').trim(); const posts = g.posts.map(p => ({ name: p.name, text: p.text.replace('{L}', link) })), hook = posts[0].text.replace(link, '').trim();
@@ -396,13 +375,13 @@ window.IAPPromo = (function () {
for (const p of posts) pp.appendChild(block(p.text, '<span class="lab">' + esc(p.name) + '</span>', [linkBtn('https://x.com/intent/tweet?text=' + enc(p.text), 'X'), linkBtn('https://t.me/share/url?url=' + enc(link) + '&text=' + enc(p.text.replace(link, '').trim()), 'Telegram'), linkBtn('https://wa.me/?text=' + enc(p.text), 'WhatsApp')])); for (const p of posts) pp.appendChild(block(p.text, '<span class="lab">' + esc(p.name) + '</span>', [linkBtn('https://x.com/intent/tweet?text=' + enc(p.text), 'X'), linkBtn('https://t.me/share/url?url=' + enc(link) + '&text=' + enc(p.text.replace(link, '').trim()), 'Telegram'), linkBtn('https://wa.me/?text=' + enc(p.text), 'WhatsApp')]));
} }
const grid = $('gbGrid'); grid.innerHTML = ''; const grid = $('gbGrid'); grid.innerHTML = '';
for (const [s, n] of SIZES) { const w = s.split('x')[0], h = s.split('x')[1], src = CDN + g.slug + '/' + s + '.png'; for (const [s, n] of SIZES) { const w = s.split('x')[0], h = s.split('x')[1], src = CDN + g.slug + '/' + g.slug + '-' + s + '.png';
const code = '<a href="' + link + '" target="_blank" rel="noopener"><img src="' + src + '" width="' + w + '" height="' + h + '" alt="' + g.name + '"></a>'; const code = '<a href="' + link + '" target="_blank" rel="noopener"><img src="' + src + '" width="' + w + '" height="' + h + '" alt="' + g.name + '"></a>';
const d = document.createElement('div'); d.className = 'promo-block'; d.innerHTML = '<div class="pb-head"><span class="lab">' + s + '</span> <span class="muted small">' + esc(n) + '</span></div><div style="overflow:auto;margin:8px 0"><img loading="lazy" src="' + src + '" alt="' + esc(g.name) + ' ' + s + '" style="max-width:100%;height:auto;border-radius:6px"></div><div class="pb-text mono small" style="overflow-wrap:anywhere">' + esc(code) + '</div>'; const d = document.createElement('div'); d.className = 'promo-block'; d.innerHTML = '<div class="pb-head"><span class="lab">' + s + '</span> <span class="muted small">' + esc(n) + '</span></div><div style="overflow:auto;margin:8px 0"><img loading="lazy" src="' + src + '" alt="' + esc(g.name) + ' ' + s + '" style="max-width:100%;height:auto;border-radius:6px"></div><div class="pb-text mono small" style="overflow-wrap:anywhere">' + esc(code) + '</div>';
const row = document.createElement('div'); row.className = 'pb-actions'; row.appendChild(copyBtn(code, 'Copy embed code')); row.appendChild(copyBtn(src, 'Copy image URL')); row.appendChild(linkBtn(src, 'Open image')); d.appendChild(row); grid.appendChild(d); } const row = document.createElement('div'); row.className = 'pb-actions'; row.appendChild(copyBtn(code, 'Copy embed code')); row.appendChild(copyBtn(src, 'Copy image URL')); row.appendChild(linkBtn(src, 'Open image')); d.appendChild(row); grid.appendChild(d); }
}; };
window.__gmAvail = (slug, on) => { avail[slug] = !!on; draw(); }; window.__gmAvail = (slug, on) => { avail[slug] = !!on; draw(); };
fetch('/api/public/games').then(r => r.json()).then(d => { for (const sl of ['polybreak', 'polminer', 'warpwares', 'turkeydrop']) if ((d.games || []).some(g => g.slug === sl && (sl === 'turkeydrop' || g.live)) && !(sl === 'turkeydrop' && preLaunch(2026, 11, 2))) window.__gmAvail(sl, true); }).catch(() => {}); fetch('/api/public/games').then(r => r.json()).then(d => { for (const sl of ['polybreak', 'polminer', 'turkeydrop']) if ((d.games || []).some(g => g.slug === sl) && !(sl === 'turkeydrop' && preLaunch(2026, 11, 2))) window.__gmAvail(sl, true); }).catch(() => {});
$('gmPick').addEventListener('click', e => { const b = e.target.closest('[data-gm]'); if (!b) return; cur = b.dataset.gm; draw(); }); $('gmPick').addEventListener('click', e => { const b = e.target.closest('[data-gm]'); if (!b) return; cur = b.dataset.gm; draw(); });
draw(); draw();
} }
@@ -449,53 +428,5 @@ window.IAPPromo = (function () {
} }
} }
// ── BixPay partner kit (2026-10-29, docs/BIXPAY-INTEGRATION.md). me.bix from /api/me. The three posts are Marty's approved return { fill, POSTS, TEXTS, SWIPES, OBJECTIONS, VIDEOS };
// copy. {L} = the member's TRACKED link (/go/bixpay?s=promo&m=<member>: counted here, then the resolved partner link), so every
// asset carries the member's link and the Promo tab can show its clicks. Banners: text only, no BIX logo (brand rules unconfirmed).
const BIX_POSTS = [
{ name: 'Short post', net: 'X', text: 'I spend my crypto with a Visa card now. BixPay keeps the keys with you, loads from USDT or USDC with no load fee, and works with Apple Pay. Virtual card from $9.99: {L}' },
{ name: 'Friendly post', net: 'Facebook', text: 'Earning crypto is one thing. Spending it without jumping through hoops is another. BixPay fixed that for me: a self-custody wallet and a Visa card in one app. Here\'s where I got mine: {L}' },
{ name: 'Partner angle', net: 'LinkedIn', text: 'BixPay pays partners on every card and on card spending, ten levels deep. If you\'re building a team anyway, this fits right in: {L}' }
];
const BIX_SWIPE = { subject: 'A Visa card for the crypto you already earn', body: 'Hey,\n\nQuick one, because this solved something for me.\n\nI earn crypto in a few places, and for a long time the awkward part was spending it. Exchange, bank, waiting, fees. BixPay took that out of the loop: it is a self-custody wallet with a Visa card in one app. You send USDT or USDC to it on Polygon, load the card, and pay wherever Visa is accepted, Apple Pay and Google Pay included.\n\nThe parts I liked:\n- The keys stay with you. It is your wallet, not an account someone else holds.\n- No load fee. 3% per purchase, and BIX\'s terms cover the rest.\n- A virtual card is $9.99 and you can be using it the same day.\n- If you build a team, BixPay pays partners on every card and on card spending, ten levels deep.\n\nUS note: it is open in 31 states so far. If yours is not on the list yet, you can still get the wallet and build.\n\nHere is my link: {L}\n\nBixPay is a separate company. BIX issues the wallet and the card through its banking partners and sets its own fees, limits, eligibility and terms. Crypto assets can lose value.\n\nTalk soon,' };
const BIX_CDN = ((typeof SHARE_DOMAIN === 'string' && SHARE_DOMAIN) ? 'https://' + SHARE_DOMAIN : location.origin) + '/b/bixpay/'; // short image host, same files as the game-banners CDN (2026-11-03)
const BIX_SIZES = [['728x90', 'Leaderboard'], ['300x250', 'Medium rectangle'], ['468x60', 'Banner'], ['600x300', 'Traffic exchange / splash page']];
function fillBix(me) {
const b = (me && me.bix) || {}; const sec = $('promo-bixpay'); if (!sec) return;
if (!b.live || b.error || !b.go) { sec.hidden = true; return; }
const enc = encodeURIComponent, link = b.link, go = b.go.promo;
if (sec.dataset.filled === link + '|' + go + '|' + (b.clicks ? b.clicks.total : 0)) return;
sec.dataset.filled = link + '|' + go + '|' + (b.clicks ? b.clicks.total : 0);
$('bixPromoLink').textContent = link;
$('bixPromoUsing').textContent = b.using || '';
$('bixPromoSub').textContent = b.whose === 'you' ? 'every link and banner here carries your partner link' : 'add your own partner link in Profile and these switch to yours';
$('bixPromoCopy').onclick = async () => { try { await navigator.clipboard.writeText(link); status('Partner link copied.', 'ok'); } catch (e) { status('Copy failed.', 'bad'); } };
const sh = $('bixPromoShare'); if (sh) { sh.hidden = !navigator.share; sh.onclick = async () => { try { await navigator.share({ title: 'BixPay', text: 'A Visa card for your crypto: ' + go }); } catch (e) { if (!(e && e.name === 'AbortError')) status('Could not open the share sheet.', 'bad'); } }; }
$('bixPromoGo').textContent = go;
$('bixPromoGoCopy').onclick = async () => { try { await navigator.clipboard.writeText(go); status('Tracked link copied.', 'ok'); } catch (e) { status('Copy failed.', 'bad'); } };
const n = (b.clicks && b.clicks.promo) || 0; $('bixPromoClicks').textContent = n ? 'Clicks so far: ' + n.toLocaleString() + '.' : 'No clicks counted yet.';
const pp = $('bixPromoPosts'); pp.innerHTML = '';
for (const p of BIX_POSTS) {
const text = p.text.replace('{L}', go), lead = text.replace(go, '').trim();
const extras = [];
if (p.net === 'X') extras.push(linkBtn('https://twitter.com/intent/tweet?text=' + enc(text), 'Post on X'));
if (p.net === 'Facebook') extras.push(linkBtn('https://www.facebook.com/sharer/sharer.php?u=' + enc(go), 'Share on Facebook'));
if (p.net === 'LinkedIn') extras.push(linkBtn('https://www.linkedin.com/sharing/share-offsite/?url=' + enc(go), 'Share on LinkedIn'));
extras.push(linkBtn('https://t.me/share/url?url=' + enc(go) + '&text=' + enc(lead), 'Telegram'));
extras.push(linkBtn('https://wa.me/?text=' + enc(text), 'WhatsApp'));
pp.appendChild(block(text, '<span class="pb-net">' + esc(p.name) + '</span>', extras));
}
const sw = $('bixPromoSwipe'); sw.innerHTML = '';
sw.appendChild(block('Subject: ' + BIX_SWIPE.subject + '\n\n' + BIX_SWIPE.body.replace('{L}', go), '<span class="pb-net">Email</span> <b>' + esc(BIX_SWIPE.subject) + '</b>'));
const bg = $('bixPromoBanners'); bg.innerHTML = '';
for (const [s, nme] of BIX_SIZES) {
const w = s.split('x')[0], h = s.split('x')[1], src = BIX_CDN + 'bixpay-' + s + '.png';
const code = '<a href="' + go + '" target="_blank" rel="noopener"><img src="' + src + '" width="' + w + '" height="' + h + '" alt="A Visa card for your crypto"></a>';
const d = document.createElement('div'); d.className = 'promo-block';
d.innerHTML = '<div class="pb-head"><span class="lab">' + s + '</span> <span class="muted small">' + esc(nme) + '</span></div><div style="overflow:auto;margin:8px 0"><img loading="lazy" src="' + src + '" alt="BixPay banner ' + s + '" style="max-width:100%;height:auto;border-radius:6px"></div><div class="pb-text mono small" style="overflow-wrap:anywhere">' + esc(code) + '</div>';
const row = document.createElement('div'); row.className = 'pb-actions'; row.appendChild(copyBtn(code, 'Copy embed code')); row.appendChild(copyBtn(src, 'Copy image URL')); row.appendChild(linkBtn(src, 'Open image')); d.appendChild(row); bg.appendChild(d);
}
}
return { fill, fillBix, POSTS, TEXTS, SWIPES, OBJECTIONS, VIDEOS, BIX_POSTS, BIX_SWIPE };
})(); })();
+3 -3
View File
@@ -32,10 +32,10 @@
function answer(i) { function answer(i) {
api('/api/refuel/done', { n: nonce, answer: i }).then(function (r) { api('/api/refuel/done', { n: nonce, answer: i }).then(function (r) {
if (r.error) { if (r.retry) return challenge(); $('rfHint').textContent = r.error; $('rfCheck').hidden = true; return; } if (r.error) { if (r.retry) return challenge(); $('rfHint').textContent = r.error; $('rfCheck').hidden = true; return; }
done = true; $('rfCheck').hidden = true; var gk = GAME === 'Gem Kingdom', ch = GAME === 'ClutterHunt', sw = GAME === 'SpellWheel', ww = GAME === 'Warp & Wares', td = GAME === 'Turkey Drop'; done = true; $('rfCheck').hidden = true; var gk = GAME === 'Gem Kingdom', ch = GAME === 'ClutterHunt', sw = GAME === 'SpellWheel', td = GAME === 'Turkey Drop';
$('rfHint').textContent = gk ? 'Visit counted. Your heroes are back on their feet.' : (ch || sw) ? 'Visit counted. Your hint is ready.' : ww ? 'Visit counted. Your bonus turns are waiting on the bridge.' : td ? 'Visit counted. WFWL is back on the air.' : 'Visit counted. Your tank is full.'; $('rfHint').textContent = gk ? 'Visit counted. Your heroes are back on their feet.' : (ch || sw) ? 'Visit counted. Your hint is ready.' : td ? 'Visit counted. WFWL is back on the air.' : 'Visit counted. Your tank is full.';
if (gk && inGame) { try { window.parent.postMessage({ gkContinue: nonce, ok: true }, '*'); } catch (e) {} } if (gk && inGame) { try { window.parent.postMessage({ gkContinue: nonce, ok: true }, '*'); } catch (e) {} }
var b = $('rfDone'); b.disabled = false; b.textContent = gk ? 'Back to the battle' : ch ? 'Back to the room' : sw ? 'Back to the puzzle' : ww ? 'Back to the bridge' : td ? 'Back on the air' : 'Back to the run'; b.onclick = function () { location.href = r.ret; }; var b = $('rfDone'); b.disabled = false; b.textContent = gk ? 'Back to the battle' : ch ? 'Back to the room' : sw ? 'Back to the puzzle' : td ? 'Back on the air' : 'Back to the run'; b.onclick = function () { location.href = r.ret; };
setTimeout(function () { location.href = r.ret; }, 1200); setTimeout(function () { location.href = r.ret; }, 1200);
}); });
} }
+97 -174
View File
@@ -13,20 +13,6 @@
--mono:"Consolas","JetBrains Mono",monospace; --mono:"Consolas","JetBrains Mono",monospace;
--disp:"Sora","Segoe UI",system-ui,sans-serif; --disp:"Sora","Segoe UI",system-ui,sans-serif;
--radius:18px; --radius:18px;
/* 2026-11-01 theme tokens (mirrored from LinkSpin): every surface, text, border and soft fill that used to be a literal
in this file, the page inline styles and the UI-drawing scripts. Light values live in :root[data-theme="light"] at
the end of this file; themehead.js sets data-theme on <html> before the first paint. */
--mint-deep:#1fb894; --mint-pale:#8ffbe3;
--mint-faint:rgba(67,232,195,.06); --mint-soft-2:rgba(67,232,195,.16); --mint-line:rgba(67,232,195,.38); --mint-line-2:rgba(67,232,195,.6);
--ok:#22c55e; --ok-ink:#04140a; --ok-soft:rgba(34,197,94,.15); --warn:#f0a742; --bad-soft:rgba(255,143,125,.12);
--gold:#ffd15c; --gold-2:#f2c94c; --gold-ink:#1a1206; --gold-soft:rgba(242,201,76,.14); --gold-faint:rgba(242,201,76,.04); --gold-line:rgba(242,201,76,.55);
--amber-soft:rgba(255,178,56,.12); --amber-line:rgba(255,178,56,.4); --amber-ink:#1a1206;
--cyan-soft:rgba(84,204,255,.1); --cyan-line:rgba(84,204,255,.3); --violet-soft:rgba(157,125,255,.12); --violet-line:rgba(157,125,255,.32);
--muted-soft:rgba(139,166,156,.12); --muted-line:rgba(139,166,156,.4); --ink-faint:rgba(255,255,255,.04); --line-soft:rgba(84,150,128,.08);
--ground-soft:rgba(4,8,7,.5); --field-bg:rgba(4,8,7,.65); --nav-bg:rgba(4,8,7,.75); --side-bg:rgba(10,18,15,.92); --pill-bg:rgba(16,28,24,.7);
--panel-grad:linear-gradient(165deg,rgba(24,36,31,.6),rgba(13,19,17,.66)); --panel-grad-deep:linear-gradient(170deg,#0e1c17,#080f0c); --plate-grad:linear-gradient(160deg,#12241e,#0a1411);
--sh-lg:0 30px 80px rgba(0,0,0,.6),0 0 60px rgba(67,232,195,.08);
color-scheme:dark;
} }
*{box-sizing:border-box} *{box-sizing:border-box}
[hidden]{display:none!important} /* beats any display: set by a class (chat panel bug) */ [hidden]{display:none!important} /* beats any display: set by a class (chat panel bug) */
@@ -40,7 +26,7 @@ a:hover{text-decoration:underline}
.wrap{max-width:1100px;margin:0 auto;padding:0 22px} .wrap{max-width:1100px;margin:0 auto;padding:0 22px}
h1,h2,h3{font-family:var(--disp);letter-spacing:-.015em} h1,h2,h3{font-family:var(--disp);letter-spacing:-.015em}
/* ── nav: capsule pill ─────────────────────────────── */ /* ── nav: capsule pill ─────────────────────────────── */
nav{position:sticky;top:0;z-index:10;background:var(--nav-bg);backdrop-filter:blur(16px); nav{position:sticky;top:0;z-index:10;background:rgba(4,8,7,.7);backdrop-filter:blur(16px);
-webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--line)} -webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--line)}
nav .wrap{display:flex;align-items:center;gap:20px;min-height:66px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px} nav .wrap{display:flex;align-items:center;gap:20px;min-height:66px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px}
.logo{font-family:var(--disp);font-weight:800;font-size:20px;color:var(--ink)} .logo{font-family:var(--disp);font-weight:800;font-size:20px;color:var(--ink)}
@@ -50,13 +36,13 @@ nav .wrap{display:flex;align-items:center;gap:20px;min-height:66px;flex-wrap:wra
.byline b{color:var(--ink);font-weight:600} .byline b{color:var(--ink);font-weight:600}
.bo-side .byline{padding:4px 8px 10px;white-space:normal} .bo-side .byline{padding:4px 8px 10px;white-space:normal}
@media (max-width:560px){nav .byline{font-size:9.5px}} @media (max-width:560px){nav .byline{font-size:9.5px}}
nav .links{display:flex;gap:4px;flex:1;flex-wrap:wrap;background:var(--pill-bg);border:1px solid var(--line); nav .links{display:flex;gap:4px;flex:1;flex-wrap:wrap;background:rgba(16,28,24,.7);border:1px solid var(--line);
border-radius:999px;padding:5px 8px;width:fit-content;flex:0 1 auto;margin:0 auto} border-radius:999px;padding:5px 8px;width:fit-content;flex:0 1 auto;margin:0 auto}
nav .links a{color:var(--muted);font-size:13.5px;font-weight:600;padding:7px 14px;border-radius:999px} nav .links a{color:var(--muted);font-size:13.5px;font-weight:600;padding:7px 14px;border-radius:999px}
nav .links a:hover{color:var(--ink);text-decoration:none} nav .links a:hover{color:var(--ink);text-decoration:none}
nav .links a.active{color:var(--mint);background:var(--mint-soft)} nav .links a.active{color:var(--mint);background:rgba(67,232,195,.1)}
#navWallet{font-size:13px;margin-left:auto} #navWallet{font-size:13px;margin-left:auto}
.rehearsal{background:var(--mint-faint);border-bottom:1px solid var(--line);color:var(--muted); .rehearsal{background:rgba(67,232,195,.07);border-bottom:1px solid var(--line);color:var(--muted);
text-align:center;font-size:12.5px;padding:7px 12px} text-align:center;font-size:12.5px;padding:7px 12px}
.rehearsal b{color:var(--mint)} .rehearsal b{color:var(--mint)}
/* ── buttons ───────────────────────────────────────── */ /* ── buttons ───────────────────────────────────────── */
@@ -64,14 +50,14 @@ nav .links a.active{color:var(--mint);background:var(--mint-soft)}
padding:13px 26px;font-weight:700;font-size:15px;cursor:pointer;font-family:var(--disp); padding:13px 26px;font-weight:700;font-size:15px;cursor:pointer;font-family:var(--disp);
box-shadow:0 4px 30px rgba(67,232,195,.35);transition:transform .16s ease,box-shadow .16s ease,background .16s ease} box-shadow:0 4px 30px rgba(67,232,195,.35);transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.btn:hover{transform:translateY(-2px);background:var(--mint-hi);box-shadow:0 8px 44px rgba(67,232,195,.5);text-decoration:none} .btn:hover{transform:translateY(-2px);background:var(--mint-hi);box-shadow:0 8px 44px rgba(67,232,195,.5);text-decoration:none}
.btn.sec{background:transparent;color:var(--mint);border:1px solid var(--mint-line-2);box-shadow:none} .btn.sec{background:transparent;color:var(--mint);border:1px solid rgba(67,232,195,.6);box-shadow:none}
.btn.sec:hover{background:var(--mint-soft);box-shadow:0 4px 26px rgba(67,232,195,.2)} .btn.sec:hover{background:rgba(67,232,195,.08);box-shadow:0 4px 26px rgba(67,232,195,.2)}
.btn.small{padding:8px 17px;font-size:13px} .btn.small{padding:8px 17px;font-size:13px}
/* a third, quieter button for actions that are not the main move (Archive). NOT ".ghost": that is /* a third, quieter button for actions that are not the main move (Archive). NOT ".ghost": that is
the giant footer wordmark and it sets color:transparent, which made the Archive button invisible the giant footer wordmark and it sets color:transparent, which made the Archive button invisible
(Marty, 2026-09-23). */ (Marty, 2026-09-23). */
.btn.quiet{background:transparent;color:var(--muted);border:1px solid var(--line-strong);box-shadow:none} .btn.quiet{background:transparent;color:var(--muted);border:1px solid var(--line-strong);box-shadow:none}
.btn.quiet:hover{background:var(--muted-soft);color:var(--ink);border-color:var(--muted);box-shadow:none} .btn.quiet:hover{background:rgba(139,166,156,.1);color:var(--ink);border-color:var(--muted);box-shadow:none}
/* the member's campaign actions sat flush against each other on desktop; the mobile rule already /* the member's campaign actions sat flush against each other on desktop; the mobile rule already
had a gap, this gives the wide layout the same room */ had a gap, this gives the wide layout the same room */
/* Campaign actions (Marty, 2026-09-23): the column is narrow, so these stack. Left-aligned pills /* Campaign actions (Marty, 2026-09-23): the column is narrow, so these stack. Left-aligned pills
@@ -82,13 +68,6 @@ nav .links a.active{color:var(--mint);background:var(--mint-soft)}
text-align:center;line-height:1.25;white-space:normal} text-align:center;line-height:1.25;white-space:normal}
.camp-table td.act .btn:last-child{margin-bottom:0} .camp-table td.act .btn:last-child{margin-bottom:0}
.btn:disabled{opacity:.45;cursor:default;transform:none;box-shadow:none} .btn:disabled{opacity:.45;cursor:default;transform:none;box-shadow:none}
/* ── segmented control + the Light / Dark / Auto theme switch (2026-11-01): member-area header, Profile pane, admin header ── */
.seg{display:inline-flex;border:1px solid var(--line-strong);border-radius:999px;overflow:hidden;background:var(--pill-bg);vertical-align:middle}
.seg button{background:transparent;border:0;border-right:1px solid var(--line-strong);padding:6px 12px;font:700 12px var(--disp);color:var(--muted);cursor:pointer;line-height:1.2}
.seg button:last-child{border-right:0} .seg button:hover{color:var(--ink)} .seg button.on{background:var(--mint);color:var(--mint-ink)}
.theme-seg button{min-width:0}
.bo-top .theme-seg{margin-left:auto;flex:none} .bo-top .bo-rehearsal:not([hidden]) + .theme-seg{margin-left:0}
@media (max-width:560px){.bo-top .theme-seg button{padding:6px 9px;font-size:11px}}
/* ── hero: centered, light-trail set-piece ─────────── */ /* ── hero: centered, light-trail set-piece ─────────── */
.hero{position:relative;text-align:center;padding:120px 0 84px;overflow:visible} .hero{position:relative;text-align:center;padding:120px 0 84px;overflow:visible}
.hero h1{font-size:clamp(36px,5.4vw,62px);font-weight:700;line-height:1.08;margin:0 auto 18px;max-width:820px;text-wrap:balance} .hero h1{font-size:clamp(36px,5.4vw,62px);font-weight:700;line-height:1.08;margin:0 auto 18px;max-width:820px;text-wrap:balance}
@@ -120,7 +99,7 @@ section{padding:64px 0 8px}
.cmp{width:100%;border-collapse:separate;border-spacing:0;font-size:15px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden} .cmp{width:100%;border-collapse:separate;border-spacing:0;font-size:15px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.cmp th,.cmp td{padding:13px 16px;border-bottom:1px solid var(--line);vertical-align:top;text-align:left} .cmp th,.cmp td{padding:13px 16px;border-bottom:1px solid var(--line);vertical-align:top;text-align:left}
.cmp th{font-family:var(--disp);font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)} .cmp th{font-family:var(--disp);font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.cmp th:last-child,.cmp td:last-child{color:var(--ink);background:var(--mint-faint)} .cmp th:last-child,.cmp td:last-child{color:var(--ink);background:rgba(67,232,195,.06)}
.cmp td:first-child{font-weight:700;white-space:nowrap} .cmp td:first-child{font-weight:700;white-space:nowrap}
.cmp td:nth-child(2){color:var(--muted)} .cmp td:nth-child(2){color:var(--muted)}
.cmp tr:last-child td{border-bottom:0} .cmp tr:last-child td{border-bottom:0}
@@ -134,11 +113,11 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
/* icon-plate feature cards */ /* icon-plate feature cards */
.plates{display:grid;gap:16px;grid-template-columns:1fr} .plates{display:grid;gap:16px;grid-template-columns:1fr}
@media(min-width:760px){.plates{grid-template-columns:1fr 1fr 1fr}} @media(min-width:760px){.plates{grid-template-columns:1fr 1fr 1fr}}
.platecard{background:var(--panel-grad);border:1px solid var(--line); .platecard{background:linear-gradient(170deg,rgba(22,38,32,.6),rgba(10,18,15,.7));border:1px solid var(--line);
border-radius:var(--radius);padding:26px 22px;text-align:center;transition:border-color .2s ease,transform .2s ease} border-radius:var(--radius);padding:26px 22px;text-align:center;transition:border-color .2s ease,transform .2s ease}
.platecard:hover{border-color:var(--line-strong);transform:translateY(-4px)} .platecard:hover{border-color:var(--line-strong);transform:translateY(-4px)}
.plate{width:88px;height:88px;margin:0 auto 18px;border-radius:22px;display:grid;place-items:center; .plate{width:88px;height:88px;margin:0 auto 18px;border-radius:22px;display:grid;place-items:center;
background:var(--plate-grad);border:1px solid var(--line-strong); background:linear-gradient(160deg,#12241e,#0a1411);border:1px solid var(--line-strong);
box-shadow:0 0 34px rgba(67,232,195,.15),inset 0 1px 0 rgba(143,251,227,.15)} box-shadow:0 0 34px rgba(67,232,195,.15),inset 0 1px 0 rgba(143,251,227,.15)}
.plate svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round} .plate svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.platecard p{color:var(--muted);font-size:14px;margin:0} .platecard p{color:var(--muted);font-size:14px;margin:0}
@@ -150,15 +129,15 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.flankitem .plate svg{width:24px;height:24px} .flankitem .plate svg{width:24px;height:24px}
.flankitem p{color:var(--muted);font-size:13.5px;margin:0} .flankitem p{color:var(--muted);font-size:13.5px;margin:0}
/* ledger mockup frame */ /* ledger mockup frame */
.mockup{background:var(--panel-grad-deep);border:1px solid var(--line-strong);border-radius:20px; .mockup{background:linear-gradient(170deg,#0e1c17,#080f0c);border:1px solid var(--line-strong);border-radius:20px;
box-shadow:var(--sh-lg);overflow:hidden} box-shadow:0 30px 80px rgba(0,0,0,.6),0 0 60px rgba(67,232,195,.08);overflow:hidden}
.mockup .bar{display:flex;gap:6px;align-items:center;padding:11px 14px;border-bottom:1px solid var(--line)} .mockup .bar{display:flex;gap:6px;align-items:center;padding:11px 14px;border-bottom:1px solid var(--line)}
.mockup .bar i{width:9px;height:9px;border-radius:50%;background:var(--line-strong);display:inline-block} .mockup .bar i{width:9px;height:9px;border-radius:50%;background:#1e3a31;display:inline-block}
.mockup .bar .addr{font-family:var(--mono);font-size:11px;color:var(--muted);margin-left:8px;background:var(--ground-soft); .mockup .bar .addr{font-family:var(--mono);font-size:11px;color:var(--muted);margin-left:8px;background:rgba(4,8,7,.6);
border-radius:999px;padding:3px 12px} border-radius:999px;padding:3px 12px}
.mockup .body{padding:6px 0} .mockup .body{padding:6px 0}
.mockup .mrow{display:flex;justify-content:space-between;gap:10px;padding:9px 16px;font-family:var(--mono); .mockup .mrow{display:flex;justify-content:space-between;gap:10px;padding:9px 16px;font-family:var(--mono);
font-size:12px;border-bottom:1px solid var(--line-soft)} font-size:12px;border-bottom:1px solid rgba(84,150,128,.08)}
.mockup .mrow span:last-child{color:var(--mint)} .mockup .mrow span:last-child{color:var(--mint)}
.mockup .mrow.dim span:last-child{color:var(--muted)} .mockup .mrow.dim span:last-child{color:var(--muted)}
/* 2-col story block: iso illustration + checklist */ /* 2-col story block: iso illustration + checklist */
@@ -168,24 +147,24 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.checks li{padding:7px 0 7px 30px;position:relative;color:var(--muted);font-size:14.5px} .checks li{padding:7px 0 7px 30px;position:relative;color:var(--muted);font-size:14.5px}
.checks li::before{content:"✓";position:absolute;left:0;top:6px;width:20px;height:20px;border-radius:50%; .checks li::before{content:"✓";position:absolute;left:0;top:6px;width:20px;height:20px;border-radius:50%;
background:var(--mint-soft);color:var(--mint);font-size:12px;font-weight:700;display:grid;place-items:center; background:var(--mint-soft);color:var(--mint);font-size:12px;font-weight:700;display:grid;place-items:center;
border:1px solid var(--mint-line)} border:1px solid rgba(67,232,195,.35)}
.chips{display:flex;gap:8px;margin:14px 0 4px;flex-wrap:wrap} .chips{display:flex;gap:8px;margin:14px 0 4px;flex-wrap:wrap}
.chip-t{border:1px solid var(--line-strong);border-radius:999px;padding:5px 16px;font-size:12.5px;color:var(--muted);font-family:var(--disp);font-weight:600} .chip-t{border:1px solid var(--line-strong);border-radius:999px;padding:5px 16px;font-size:12.5px;color:var(--muted);font-family:var(--disp);font-weight:600}
.chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)} .chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)}
.iso{filter:drop-shadow(0 24px 50px rgba(0,0,0,.5))} .iso{filter:drop-shadow(0 24px 50px rgba(0,0,0,.5))}
/* level cycler: light the paying generation */ /* level cycler: light the paying generation */
#genViz .edge path{stroke:var(--line-strong);transition:stroke .5s ease} #genViz .edge path{stroke:#22523f;transition:stroke .5s ease}
#genViz .node-o{fill:var(--panel-solid);stroke:var(--mint-line);stroke-width:1.3;transition:stroke .5s ease,fill .5s ease} #genViz .node-o{fill:#122e25;stroke:#2f6b55;stroke-width:1.3;transition:stroke .5s ease,fill .5s ease}
#genViz .node-d{fill:var(--mint-deep);transition:fill .5s ease} #genViz .node-d{fill:#3f8f74;transition:fill .5s ease}
#genViz[data-lvl="1"] .e1 path,#genViz[data-lvl="2"] .e2 path,#genViz[data-lvl="3"] .e3 path{stroke:var(--mint)} #genViz[data-lvl="1"] .e1 path,#genViz[data-lvl="2"] .e2 path,#genViz[data-lvl="3"] .e3 path{stroke:#43e8c3}
#genViz[data-lvl="1"] .g1 .node-o,#genViz[data-lvl="2"] .g2 .node-o,#genViz[data-lvl="3"] .g3 .node-o{stroke:var(--mint);fill:var(--mint-soft-2)} #genViz[data-lvl="1"] .g1 .node-o,#genViz[data-lvl="2"] .g2 .node-o,#genViz[data-lvl="3"] .g3 .node-o{stroke:#43e8c3;fill:#11362b}
#genViz[data-lvl="1"] .g1 .node-d,#genViz[data-lvl="2"] .g2 .node-d,#genViz[data-lvl="3"] .g3 .node-d{fill:var(--mint)} #genViz[data-lvl="1"] .g1 .node-d,#genViz[data-lvl="2"] .g2 .node-d,#genViz[data-lvl="3"] .g3 .node-d{fill:#43e8c3}
.chips button{cursor:pointer;background:transparent;font:inherit} .chips button{cursor:pointer;background:transparent;font:inherit}
.chips button.chip-t{border:1px solid var(--line-strong);color:var(--muted)} .chips button.chip-t{border:1px solid var(--line-strong);color:var(--muted)}
.chips button.chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)} .chips button.chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)}
/* pricing tiles: mint discipline */ /* pricing tiles: mint discipline */
.tiles{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));align-items:stretch} .tiles{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));align-items:stretch}
.tile{position:relative;background:var(--panel-grad);border:1px solid var(--line); .tile{position:relative;background:linear-gradient(170deg,rgba(22,38,32,.55),rgba(10,18,15,.65));border:1px solid var(--line);
border-radius:var(--radius);padding:26px 18px;text-align:center;display:flex;flex-direction:column;gap:6px; border-radius:var(--radius);padding:26px 18px;text-align:center;display:flex;flex-direction:column;gap:6px;
transition:transform .2s ease,border-color .2s ease} transition:transform .2s ease,border-color .2s ease}
.tile:hover{transform:translateY(-5px);border-color:var(--line-strong)} .tile:hover{transform:translateY(-5px);border-color:var(--line-strong)}
@@ -194,7 +173,7 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.tile .cr{color:var(--mint);font-weight:700;font-size:14.5px} .tile .cr{color:var(--mint);font-weight:700;font-size:14.5px}
.tile .bonus{font-size:12px;color:var(--mint-hi)} .tile .bonus{font-size:12px;color:var(--mint-hi)}
.tile .pol{font-family:var(--mono);font-size:12px;color:var(--muted);flex:1} .tile .pol{font-family:var(--mono);font-size:12px;color:var(--muted);flex:1}
.tile.hot{border:1px solid var(--mint-line-2);box-shadow:0 0 44px rgba(67,232,195,.14)} .tile.hot{border:1px solid rgba(67,232,195,.65);box-shadow:0 0 44px rgba(67,232,195,.14)}
.tile.hot::before{content:"MOST POPULAR";position:absolute;top:-11px;left:50%;transform:translateX(-50%); .tile.hot::before{content:"MOST POPULAR";position:absolute;top:-11px;left:50%;transform:translateX(-50%);
background:var(--mint);color:var(--mint-ink);font-family:var(--disp);font-size:10px;font-weight:800; background:var(--mint);color:var(--mint-ink);font-family:var(--disp);font-size:10px;font-weight:800;
letter-spacing:.12em;border-radius:999px;padding:4px 14px} letter-spacing:.12em;border-radius:999px;padding:4px 14px}
@@ -202,14 +181,14 @@ h3{font-size:16.5px;margin:0 0 8px;font-weight:700}
.split{display:flex;gap:8px;margin:18px 0} .split{display:flex;gap:8px;margin:18px 0}
.split div{border-radius:12px;padding:16px 6px;text-align:center;font-size:13px;font-weight:700;font-family:var(--disp); .split div{border-radius:12px;padding:16px 6px;text-align:center;font-size:13px;font-weight:700;font-family:var(--disp);
border:1px solid var(--line-strong);color:var(--mint)} border:1px solid var(--line-strong);color:var(--mint)}
.split .s50{flex:5;background:var(--mint-soft-2);box-shadow:0 0 30px rgba(67,232,195,.12)} .split .s50{flex:5;background:rgba(67,232,195,.16);box-shadow:0 0 30px rgba(67,232,195,.12)}
.split .s20{flex:2;background:var(--mint-soft)} .split .s20{flex:2;background:rgba(67,232,195,.09)}
.split .s10{flex:1;background:var(--mint-faint)} .split .s10{flex:1;background:rgba(67,232,195,.05)}
.split .sa{flex:2;background:var(--muted-soft);color:var(--muted)} .split .sa{flex:2;background:rgba(139,166,156,.08);color:var(--muted)}
section[id]{scroll-margin-top:84px} /* anchored menu targets clear the sticky nav */ section[id]{scroll-margin-top:84px} /* anchored menu targets clear the sticky nav */
/* ticker */ /* ticker */
.ticker{overflow:hidden;contain:layout paint;border-top:1px solid var(--line);border-bottom:1px solid var(--line); .ticker{overflow:hidden;contain:layout paint;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
background:var(--mint-faint);white-space:nowrap;padding:10px 0; background:rgba(67,232,195,.04);white-space:nowrap;padding:10px 0;
-webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent); -webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)} mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)}
.ticker .inner{display:inline-block;font-family:var(--mono);font-size:12.5px;padding-left:100%;animation:tick 120s linear infinite} .ticker .inner{display:inline-block;font-family:var(--mono);font-size:12.5px;padding-left:100%;animation:tick 120s linear infinite}
@@ -237,32 +216,32 @@ tr:last-child td{border-bottom:0}
.feed .t-TierPaid{color:var(--mint)} .feed .t-TierPaid{color:var(--mint)}
.feed .t-AdminPaid{color:var(--muted)} .feed .t-AdminPaid{color:var(--muted)}
.feed .tx a{color:var(--muted);font-size:12px} .feed .tx a{color:var(--muted);font-size:12px}
.badge{display:inline-block;background:var(--mint-soft);color:var(--mint);border:1px solid var(--mint-line); .badge{display:inline-block;background:var(--mint-soft);color:var(--mint);border:1px solid rgba(67,232,195,.35);
border-radius:999px;padding:3px 13px;font-size:12px;font-weight:700} border-radius:999px;padding:3px 13px;font-size:12px;font-weight:700}
.spend-banner{background:linear-gradient(160deg,var(--gold-soft),var(--gold-faint));border-color:var(--gold-line);text-align:center;padding:22px 20px} .spend-banner{background:linear-gradient(160deg,rgba(242,201,76,.14),rgba(242,201,76,.04));border-color:rgba(242,201,76,.55);text-align:center;padding:22px 20px}
.spend-banner .lbl{font-family:var(--disp);font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:var(--gold-2)} .spend-banner .lbl{font-family:var(--disp);font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:#f2c94c}
.spend-banner .big{font-family:var(--disp);font-size:clamp(40px,6vw,64px);font-weight:800;color:var(--gold-2);line-height:1.05;margin:6px 0 4px;font-variant-numeric:tabular-nums} .spend-banner .big{font-family:var(--disp);font-size:clamp(40px,6vw,64px);font-weight:800;color:#f2c94c;line-height:1.05;margin:6px 0 4px;font-variant-numeric:tabular-nums}
.spend-banner .big .unit{font-size:20px;font-weight:700;color:var(--ink)} .spend-banner .big .unit{font-size:20px;font-weight:700;color:var(--ink)}
.spend-banner .sub{color:var(--ink);font-size:15px} .spend-banner .sub{color:var(--ink);font-size:15px}
.spend-banner .rates{display:flex;gap:8px 18px;flex-wrap:wrap;justify-content:center;margin-top:12px;font-size:12.5px;color:var(--muted)} .spend-banner .rates{display:flex;gap:8px 18px;flex-wrap:wrap;justify-content:center;margin-top:12px;font-size:12.5px;color:var(--muted)}
.spend-banner .rates b{color:var(--ink)} .spend-banner .rates b{color:var(--ink)}
.boot-spin{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:60vh} .boot-spin{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:60vh}
.boot-spin .ring{width:46px;height:46px;border-radius:50%;border:4px solid var(--mint-soft-2);border-top-color:var(--mint);animation:bootspin .9s linear infinite} .boot-spin .ring{width:46px;height:46px;border-radius:50%;border:4px solid rgba(67,232,195,.18);border-top-color:var(--mint);animation:bootspin .9s linear infinite}
@keyframes bootspin{to{transform:rotate(360deg)}} @keyframes bootspin{to{transform:rotate(360deg)}}
.bo-top{flex-wrap:wrap} .bo-top{flex-wrap:wrap}
.ad-strip{flex:1 1 100%;font-size:13.5px;padding:8px 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .ad-strip{flex:1 1 100%;font-size:13.5px;padding:8px 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ad-strip a{color:var(--ink)} .ad-strip a{color:var(--ink)}
.ad-strip b{color:var(--mint)} .ad-strip b{color:var(--mint)}
.ad-foot{text-align:center} .ad-foot{text-align:center}
.pv{border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:0 0 16px;background:var(--ground-soft)} .pv{border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:0 0 16px;background:rgba(4,8,7,.35)}
.pv-head b{display:block;font-size:18px;margin:4px 0 2px} .pv-head b{display:block;font-size:18px;margin:4px 0 2px}
.done-big{display:flex;flex-direction:column;align-items:center;gap:6px;padding:26px 16px;text-align:center} .done-big{display:flex;flex-direction:column;align-items:center;gap:6px;padding:26px 16px;text-align:center}
.done-big .tick{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font-size:48px;font-weight:800;color:var(--mint-ink);background:var(--mint);box-shadow:0 0 0 10px rgba(67,232,195,.15),0 10px 30px rgba(67,232,195,.35)} .done-big .tick{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font-size:48px;font-weight:800;color:var(--mint-ink);background:var(--mint);box-shadow:0 0 0 10px rgba(67,232,195,.15),0 10px 30px rgba(67,232,195,.35)}
.done-big b{font-family:var(--disp);font-size:22px;margin-top:8px} .done-big b{font-family:var(--disp);font-size:22px;margin-top:8px}
.badge.amber{background:var(--muted-soft);border-color:var(--muted-line);color:var(--muted)} .badge.amber{background:rgba(139,166,156,.1);border-color:rgba(139,166,156,.4);color:var(--muted)}
/* faq */ /* faq */
details{border:1px solid var(--line);border-radius:14px;margin:0 0 10px;background:var(--panel)} details{border:1px solid var(--line);border-radius:14px;margin:0 0 10px;background:var(--panel)}
details[open]{border-color:var(--mint-line)} details[open]{border-color:rgba(67,232,195,.45)}
summary{cursor:pointer;padding:16px 20px;font-weight:700;font-family:var(--disp);font-size:15px;list-style:none} summary{cursor:pointer;padding:16px 20px;font-weight:700;font-family:var(--disp);font-size:15px;list-style:none}
summary::before{content:"+";color:var(--mint);font-weight:800;margin-right:12px} summary::before{content:"+";color:var(--mint);font-weight:800;margin-right:12px}
details[open] summary::before{content:"−"} details[open] summary::before{content:"−"}
@@ -270,7 +249,7 @@ details p{margin:0;padding:0 20px 18px 42px;color:var(--muted);font-size:14.5px}
/* closing cta card */ /* closing cta card */
.closer{position:relative;display:grid;gap:26px;align-items:center;grid-template-columns:1fr; .closer{position:relative;display:grid;gap:26px;align-items:center;grid-template-columns:1fr;
padding:44px 36px;border-radius:24px;overflow:hidden;margin:80px 0 0; padding:44px 36px;border-radius:24px;overflow:hidden;margin:80px 0 0;
background:var(--panel-grad-deep);border:1px solid var(--line-strong)} background:linear-gradient(160deg,#0d1d17,#060c0a);border:1px solid var(--line-strong)}
@media(min-width:880px){.closer{grid-template-columns:1.2fr .8fr}} @media(min-width:880px){.closer{grid-template-columns:1.2fr .8fr}}
.closer::before{content:"";position:absolute;width:460px;height:460px;right:-140px;top:-260px;border-radius:50%; .closer::before{content:"";position:absolute;width:460px;height:460px;right:-140px;top:-260px;border-radius:50%;
background:radial-gradient(circle,rgba(67,232,195,.2),transparent 65%);pointer-events:none} background:radial-gradient(circle,rgba(67,232,195,.2),transparent 65%);pointer-events:none}
@@ -287,7 +266,7 @@ footer{border-top:1px solid var(--line);margin-top:90px;padding:34px 0 0;color:v
box-shadow:0 12px 40px rgba(0,0,0,.55)} box-shadow:0 12px 40px rgba(0,0,0,.55)}
#status.ok{border-color:var(--mint)} #status.ok{border-color:var(--mint)}
#status.bad{border-color:var(--bad)} #status.bad{border-color:var(--bad)}
input,select,textarea{background:var(--field-bg);border:1px solid var(--line-strong);color:var(--ink);border-radius:11px; input,select,textarea{background:rgba(4,8,7,.65);border:1px solid var(--line-strong);color:var(--ink);border-radius:11px;
padding:11px 14px;font-size:14.5px;font-family:inherit} padding:11px 14px;font-size:14.5px;font-family:inherit}
input[type=range]{padding:0;border:0;background:transparent;accent-color:var(--mint);height:28px;vertical-align:middle} input[type=range]{padding:0;border:0;background:transparent;accent-color:var(--mint);height:28px;vertical-align:middle}
input:focus,select:focus,textarea:focus{border-color:var(--mint)} input:focus,select:focus,textarea:focus{border-color:var(--mint)}
@@ -298,18 +277,18 @@ textarea{resize:vertical;font:inherit}
.bo-body{background:var(--ground)} .bo-body{background:var(--ground)}
.bo{display:grid;grid-template-columns:236px 1fr;min-height:100vh} .bo{display:grid;grid-template-columns:236px 1fr;min-height:100vh}
.bo-side{position:sticky;top:0;height:100vh;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;display:flex;flex-direction:column;gap:22px; .bo-side{position:sticky;top:0;height:100vh;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;display:flex;flex-direction:column;gap:22px;
padding:22px 16px;background:var(--side-bg);border-right:1px solid var(--line)} padding:22px 16px;background:rgba(10,18,15,.92);border-right:1px solid var(--line)}
.bo-side .logo{font-size:19px;padding:0 8px} .bo-side .logo{font-size:19px;padding:0 8px}
.bo-menu{display:flex;flex-direction:column;gap:4px} .bo-menu{display:flex;flex-direction:column;gap:4px}
.bo-menu button{display:flex;align-items:center;gap:11px;background:transparent;border:0;color:var(--muted); .bo-menu button{display:flex;align-items:center;gap:11px;background:transparent;border:0;color:var(--muted);
font:600 14px var(--disp);padding:11px 12px;border-radius:11px;cursor:pointer;text-align:left; font:600 14px var(--disp);padding:11px 12px;border-radius:11px;cursor:pointer;text-align:left;
border-left:3px solid transparent} border-left:3px solid transparent}
.bo-menu a{display:flex;align-items:center;gap:11px;color:var(--muted);font:600 14px var(--disp);padding:11px 12px;border-radius:11px;text-align:left;border-left:3px solid transparent;text-decoration:none} .bo-menu a{display:flex;align-items:center;gap:11px;color:var(--muted);font:600 14px var(--disp);padding:11px 12px;border-radius:11px;text-align:left;border-left:3px solid transparent;text-decoration:none}
.bo-menu a:hover{color:var(--ink);background:var(--mint-faint)} .bo-menu a:hover{color:var(--ink);background:rgba(67,232,195,.05)}
.bo-menu a svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto} .bo-menu a svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.bo-menu button svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto} .bo-menu button svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.bo-menu button:hover{color:var(--ink);background:var(--mint-faint)} .bo-menu button:hover{color:var(--ink);background:rgba(67,232,195,.05)}
.bo-menu button.on{color:var(--mint);background:var(--mint-soft);border-left-color:var(--mint)} .bo-menu button.on{color:var(--mint);background:rgba(67,232,195,.09);border-left-color:var(--mint)}
.bo-links{display:flex;flex-direction:column;gap:2px;padding:14px 12px;border-top:1px solid var(--line)} .bo-links{display:flex;flex-direction:column;gap:2px;padding:14px 12px;border-top:1px solid var(--line)}
.bo-cap{font-family:var(--mono);font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:6px} .bo-cap{font-family:var(--mono);font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
.bo-links a{color:var(--muted);font-size:13.5px;padding:5px 0} .bo-links a{color:var(--muted);font-size:13.5px;padding:5px 0}
@@ -321,7 +300,7 @@ textarea{resize:vertical;font:inherit}
.bo-pagefoot a{color:var(--muted)} .bo-pagefoot a{color:var(--muted)}
.bo-pagefoot a:hover{color:var(--ink);text-decoration:none} .bo-pagefoot a:hover{color:var(--ink);text-decoration:none}
.bo-top{display:flex;align-items:center;gap:16px;padding:16px 26px;border-bottom:1px solid var(--line); .bo-top{display:flex;align-items:center;gap:16px;padding:16px 26px;border-bottom:1px solid var(--line);
background:var(--nav-bg);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);position:sticky;top:0;z-index:5} background:rgba(6,10,8,.75);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);position:sticky;top:0;z-index:5}
.bo-top h2{font-size:20px} .bo-top h2{font-size:20px}
#boBurger{display:none;background:transparent;border:1px solid var(--line-strong);color:var(--ink); #boBurger{display:none;background:transparent;border:1px solid var(--line-strong);color:var(--ink);
border-radius:9px;font-size:17px;padding:5px 11px;cursor:pointer} border-radius:9px;font-size:17px;padding:5px 11px;cursor:pointer}
@@ -360,11 +339,11 @@ textarea{resize:vertical;font:inherit}
.feat-day .fd-occ{font-family:var(--mono);font-size:11px;color:var(--muted)} .feat-day .fd-occ{font-family:var(--mono);font-size:11px;color:var(--muted)}
.feat-day.open2 .fd-occ{color:var(--mint)} .feat-day.open2 .fd-occ{color:var(--mint)}
/* ── featured rotation strip ── */ /* ── featured rotation strip ── */
.feat-top{max-width:760px;margin:16px auto;border:1px solid var(--amber-line)} .feat-top{max-width:760px;margin:16px auto;border:1px solid rgba(255,177,56,.5)}
.feat-strip{display:flex;justify-content:center;margin-top:10px} .feat-strip{display:flex;justify-content:center;margin-top:10px}
.feat-strip a{max-width:728px;width:100%;display:flex;justify-content:space-between;gap:10px;padding:11px 14px;border-radius:10px; .feat-strip a{max-width:728px;width:100%;display:flex;justify-content:space-between;gap:10px;padding:11px 14px;border-radius:10px;
background:var(--panel);border:1px solid var(--amber);color:var(--ink);text-decoration:none;font-weight:600} background:var(--panel);border:1px solid #ffb238;color:var(--ink);text-decoration:none;font-weight:600}
.feat-strip a:hover{border-color:var(--gold);box-shadow:0 0 0 1px var(--amber-line)} .feat-strip a:hover{border-color:#ffd15c;box-shadow:0 0 0 1px rgba(255,177,56,.4)}
.feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap} .feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap}
.feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap} .feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap}
/* ── achievement badges ── */ /* ── achievement badges ── */
@@ -373,22 +352,22 @@ textarea{resize:vertical;font:inherit}
.badge-a .badge-img{width:150px;height:150px;border-radius:14px;object-fit:cover;border:1px solid var(--line-strong)} .badge-a .badge-img{width:150px;height:150px;border-radius:14px;object-fit:cover;border:1px solid var(--line-strong)}
.badge-a.locked .badge-img{filter:grayscale(.85) brightness(.5);opacity:.7} .badge-a.locked .badge-img{filter:grayscale(.85) brightness(.5);opacity:.7}
.badge-a .medal{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;position:relative; .badge-a .medal{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;position:relative;
background:radial-gradient(circle at 50% 35%,var(--mint-soft-2),var(--panel-solid)); background:radial-gradient(circle at 50% 35%,rgba(67,232,195,.28),rgba(9,26,19,.9));
border:2px solid var(--mint);box-shadow:0 0 18px rgba(67,232,195,.3)} border:2px solid var(--mint);box-shadow:0 0 18px rgba(67,232,195,.3)}
.badge-a.locked .medal{background:var(--muted-soft);border-color:var(--line-strong);box-shadow:none;filter:grayscale(1);opacity:.5} .badge-a.locked .medal{background:rgba(139,166,156,.08);border-color:var(--line-strong);box-shadow:none;filter:grayscale(1);opacity:.5}
.badge-a .medal svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round} .badge-a .medal svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.badge-a.locked .medal svg{stroke:var(--muted)} .badge-a.locked .medal svg{stroke:var(--muted)}
.badge-a .bl{font-size:12px;font-weight:700;line-height:1.2} .badge-a .bl{font-size:12px;font-weight:700;line-height:1.2}
.badge-a .bs{font-size:10.5px;color:var(--muted)} .badge-a .bs{font-size:10.5px;color:var(--muted)}
.badge-a .share{font-size:11px;color:var(--mint);cursor:pointer;background:none;border:0;padding:0;text-decoration:underline} .badge-a .share{font-size:11px;color:var(--mint);cursor:pointer;background:none;border:0;padding:0;text-decoration:underline}
/* ── "Your next move": milestone stepper card ── */ /* ── "Your next move": milestone stepper card ── */
.next-card{position:relative;overflow:hidden;border-color:var(--mint-line)} .next-card{position:relative;overflow:hidden;border-color:rgba(67,232,195,.28)}
.next-card::before{content:"";position:absolute;inset:0;pointer-events:none;background: .next-card::before{content:"";position:absolute;inset:0;pointer-events:none;background:
radial-gradient(420px 150px at 10% 0%,rgba(67,232,195,.12),transparent 70%), radial-gradient(420px 150px at 10% 0%,rgba(67,232,195,.12),transparent 70%),
radial-gradient(360px 130px at 90% 100%,rgba(157,125,255,.09),transparent 70%)} radial-gradient(360px 130px at 90% 100%,rgba(157,125,255,.09),transparent 70%)}
.nc-head{display:flex;gap:14px;align-items:flex-start;position:relative} .nc-head{display:flex;gap:14px;align-items:flex-start;position:relative}
.nc-head .pl{flex:0 0 auto;width:44px;height:44px;border-radius:12px;display:grid;place-items:center; .nc-head .pl{flex:0 0 auto;width:44px;height:44px;border-radius:12px;display:grid;place-items:center;
background:var(--mint-soft-2);border:1px solid var(--mint-line)} background:rgba(67,232,195,.12);border:1px solid rgba(67,232,195,.35)}
.nc-head .pl svg{width:20px;height:20px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round} .nc-head .pl svg{width:20px;height:20px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nc-steps{display:flex;margin-top:20px;position:relative;flex-wrap:wrap;row-gap:14px} .nc-steps{display:flex;margin-top:20px;position:relative;flex-wrap:wrap;row-gap:14px}
.nc-step{flex:1;min-width:88px;display:flex;flex-direction:column;align-items:center;gap:7px; .nc-step{flex:1;min-width:88px;display:flex;flex-direction:column;align-items:center;gap:7px;
@@ -409,20 +388,20 @@ textarea{resize:vertical;font:inherit}
.statx{display:flex;gap:14px;align-items:flex-start;background:var(--panel);border:1px solid var(--line); .statx{display:flex;gap:14px;align-items:flex-start;background:var(--panel);border:1px solid var(--line);
border-radius:var(--radius);padding:18px;position:relative;overflow:hidden} border-radius:var(--radius);padding:18px;position:relative;overflow:hidden}
.statx .pl{flex:0 0 auto;width:46px;height:46px;border-radius:13px;display:grid;place-items:center; .statx .pl{flex:0 0 auto;width:46px;height:46px;border-radius:13px;display:grid;place-items:center;
background:var(--mint-soft);border:1px solid var(--mint-line)} background:rgba(67,232,195,.1);border:1px solid rgba(67,232,195,.3)}
.statx .pl svg{width:22px;height:22px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round} .statx .pl svg{width:22px;height:22px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.statx.c-cyan .pl{background:var(--cyan-soft);border-color:var(--cyan-line)} .statx.c-cyan .pl{background:rgba(84,204,255,.1);border-color:rgba(84,204,255,.3)}
.statx.c-cyan .pl svg{stroke:var(--cyan)} .statx.c-cyan .pl svg{stroke:var(--cyan)}
.statx.c-violet .pl{background:var(--violet-soft);border-color:var(--violet-line)} .statx.c-violet .pl{background:rgba(157,125,255,.12);border-color:rgba(157,125,255,.32)}
.statx.c-violet .pl svg{stroke:var(--violet)} .statx.c-violet .pl svg{stroke:var(--violet)}
.statx.c-amber .pl{background:var(--amber-soft);border-color:var(--amber-line)} .statx.c-amber .pl{background:rgba(255,178,56,.1);border-color:rgba(255,178,56,.3)}
.statx.c-amber .pl svg{stroke:var(--amber)} .statx.c-amber .pl svg{stroke:var(--amber)}
.statx .nv{font-family:var(--disp);font-size:26px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1} .statx .nv{font-family:var(--disp);font-size:26px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1}
.statx .lb{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-top:2px} .statx .lb{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-top:2px}
.chip{display:inline-block;margin-top:7px;font-size:11.5px;font-weight:700;border-radius:999px;padding:2px 10px; .chip{display:inline-block;margin-top:7px;font-size:11.5px;font-weight:700;border-radius:999px;padding:2px 10px;
background:var(--mint-soft);color:var(--mint)} background:rgba(67,232,195,.1);color:var(--mint)}
.chip.flat{background:var(--muted-soft);color:var(--muted)} .chip.flat{background:rgba(139,166,156,.12);color:var(--muted)}
.chip.warm{background:var(--amber-soft);color:var(--amber)} .chip.warm{background:rgba(255,178,56,.12);color:var(--amber)}
.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px} .card-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.card-head .sub{font-size:12px;color:var(--muted)} .card-head .sub{font-size:12px;color:var(--muted)}
/* dismiss on the announcement cards at the top of the Overview (Marty, 2026-09-22): /* dismiss on the announcement cards at the top of the Overview (Marty, 2026-09-22):
@@ -430,16 +409,16 @@ textarea{resize:vertical;font:inherit}
.card-x{flex:none;align-self:center;margin:-4px -6px 0 2px;width:28px;height:28px;border-radius:50%; .card-x{flex:none;align-self:center;margin:-4px -6px 0 2px;width:28px;height:28px;border-radius:50%;
border:1px solid var(--line);background:transparent;color:var(--muted);font-size:19px;line-height:1; border:1px solid var(--line);background:transparent;color:var(--muted);font-size:19px;line-height:1;
cursor:pointer;display:grid;place-items:center;padding:0} cursor:pointer;display:grid;place-items:center;padding:0}
.card-x:hover{border-color:var(--line-strong);color:var(--ink);background:var(--muted-soft)} .card-x:hover{border-color:var(--line-strong);color:var(--ink);background:rgba(139,166,156,.1)}
/* bar chart (divs, real data) */ /* bar chart (divs, real data) */
.barchart{display:flex;align-items:flex-end;gap:6px;height:120px;margin-top:14px} .barchart{display:flex;align-items:flex-end;gap:6px;height:120px;margin-top:14px}
.barchart .bar{flex:1;min-width:6px;background:linear-gradient(180deg,var(--mint),var(--mint-line)); .barchart .bar{flex:1;min-width:6px;background:linear-gradient(180deg,var(--mint),rgba(67,232,195,.25));
border-radius:5px 5px 2px 2px;position:relative;transition:height .5s ease} border-radius:5px 5px 2px 2px;position:relative;transition:height .5s ease}
.barchart .bar.alt{background:linear-gradient(180deg,var(--violet),var(--violet-line))} .barchart .bar.alt{background:linear-gradient(180deg,var(--violet),rgba(157,125,255,.25))}
.barchart .bar:hover::after{content:attr(data-v);position:absolute;bottom:calc(100% + 4px);left:50%; .barchart .bar:hover::after{content:attr(data-v);position:absolute;bottom:calc(100% + 4px);left:50%;
transform:translateX(-50%);background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:7px; transform:translateX(-50%);background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:7px;
padding:2px 8px;font-family:var(--mono);font-size:11px;white-space:nowrap;z-index:3} padding:2px 8px;font-family:var(--mono);font-size:11px;white-space:nowrap;z-index:3}
.barchart .bar.empty{background:var(--muted-soft);height:4px!important} .barchart .bar.empty{background:rgba(139,166,156,.15);height:4px!important}
.chart-x{display:flex;gap:6px;margin-top:6px} .chart-x{display:flex;gap:6px;margin-top:6px}
.chart-x span{flex:1;text-align:center;font-family:var(--mono);font-size:10px;color:var(--muted);overflow:hidden;white-space:nowrap} .chart-x span{flex:1;text-align:center;font-family:var(--mono);font-size:10px;color:var(--muted);overflow:hidden;white-space:nowrap}
/* donut + ring (SVG) */ /* donut + ring (SVG) */
@@ -508,8 +487,7 @@ textarea{resize:vertical;font:inherit}
.lin-row .chat-msg-btn{justify-self:end} .lin-row .chat-msg-btn{justify-self:end}
.lin-row .sp.wrap{white-space:normal;line-height:1.7} .lin-row .sp.wrap{white-space:normal;line-height:1.7}
/* list toolbar: sort + filter chips shared by the tank, roster and downline (2026-09-29) */ /* list toolbar: sort + filter chips shared by the tank, roster and downline (2026-09-29) */
.lst-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:4px 0 10px;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:var(--ink-faint)} .lst-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:4px 0 10px;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.025)}
.lst-q{flex:1 1 100%;min-width:0;background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:6px 10px;font-size:13px}
.lst-sort{font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:6px} .lst-sort{font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:6px}
.lst-sort select{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:4px 8px;font-size:12.5px} .lst-sort select{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:4px 8px;font-size:12.5px}
.lst-dir{background:transparent;color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:4px 9px;font-size:12px;cursor:pointer;white-space:nowrap} .lst-dir{background:transparent;color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:4px 9px;font-size:12px;cursor:pointer;white-space:nowrap}
@@ -517,15 +495,13 @@ textarea{resize:vertical;font:inherit}
.lst-chip{font-size:12px;color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:999px;padding:3px 10px;cursor:pointer;white-space:nowrap} .lst-chip{font-size:12px;color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:999px;padding:3px 10px;cursor:pointer;white-space:nowrap}
.lst-chip.on{border-color:var(--mint);color:var(--ink);background:var(--mint-soft)} .lst-chip.on{border-color:var(--mint);color:var(--ink);background:var(--mint-soft)}
.lst-n{margin-left:auto;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums} .lst-n{margin-left:auto;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.roster-em{color:var(--mint);word-break:break-all;margin-top:2px}
.lst-copy{background:transparent;color:var(--muted);border:1px solid var(--line);border-radius:6px;padding:0 6px;font-size:11px;cursor:pointer;margin-left:4px}
.lchip{display:inline-block;font-size:11.5px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:1px 8px;white-space:nowrap;vertical-align:middle} .lchip{display:inline-block;font-size:11.5px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:1px 8px;white-space:nowrap;vertical-align:middle}
.lchip.on{border-color:var(--mint-line);color:var(--ink)} .lchip.warn{border-color:var(--gold-line);color:var(--gold)} .lchip.on{border-color:rgba(67,232,195,.45);color:var(--ink)} .lchip.warn{border-color:rgba(255,209,92,.55);color:#ffd15c}
.roster td:nth-child(3){white-space:normal;line-height:1.8} .roster td:nth-child(3){white-space:normal;line-height:1.8}
.lin-row .lin-act-btn{justify-self:end;white-space:nowrap} .lin-row .lin-act-btn{justify-self:end;white-space:nowrap}
.lin-act{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 10px 10px;margin:-1px 0 6px;border-bottom:1px solid var(--line);background:var(--ink-faint);border-radius:0 0 10px 10px} .lin-act{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 10px 10px;margin:-1px 0 6px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.025);border-radius:0 0 10px 10px}
.lin-chip{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap} .lin-chip b{font-weight:600;color:var(--ink);margin-right:5px} .lin-chip.on{border-color:var(--mint-line);color:var(--ink)} .lin-chip.warn{border-color:var(--gold-line)} .lin-chip{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap} .lin-chip b{font-weight:600;color:var(--ink);margin-right:5px} .lin-chip.on{border-color:rgba(67,232,195,.45);color:var(--ink)} .lin-chip.warn{border-color:rgba(255,209,92,.5)}
.lin-verdict{margin-left:auto;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gold)} .lin-verdict.on{color:var(--mint)} .lin-verdict{margin-left:auto;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#ffd15c} .lin-verdict.on{color:var(--mint)}
@media (max-width:560px){.lin-chip{white-space:normal}.lin-act{padding:8px 4px 10px}} @media (max-width:560px){.lin-chip{white-space:normal}.lin-act{padding:8px 4px 10px}}
@media (max-width:560px){.lin-row{grid-template-columns:1fr auto;gap:2px 10px} @media (max-width:560px){.lin-row{grid-template-columns:1fr auto;gap:2px 10px}
.lin-row .em{grid-column:1/2}.lin-row .dt{grid-column:1/2;text-align:left}.lin-row .chat-msg-btn{grid-row:1/3;grid-column:2} .lin-row .em{grid-column:1/2}.lin-row .dt{grid-column:1/2;text-align:left}.lin-row .chat-msg-btn{grid-row:1/3;grid-column:2}
@@ -535,7 +511,7 @@ textarea{resize:vertical;font:inherit}
.ed-bar button{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px; .ed-bar button{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;
padding:5px 11px;font-size:12.5px;cursor:pointer} padding:5px 11px;font-size:12.5px;cursor:pointer}
.ed-bar button:hover,.ed-bar button:focus-visible{border-color:var(--mint);outline:none} .ed-bar button:hover,.ed-bar button:focus-visible{border-color:var(--mint);outline:none}
.ed-body{background:var(--field-bg);border:1px solid var(--line-strong);border-radius:11px; .ed-body{background:rgba(4,8,7,.65);border:1px solid var(--line-strong);border-radius:11px;
min-height:180px;padding:12px 14px;outline:none;overflow-wrap:anywhere} min-height:180px;padding:12px 14px;outline:none;overflow-wrap:anywhere}
.ed-body:focus{border-color:var(--mint)} .ed-body:focus{border-color:var(--mint)}
.ed-body:empty::before{content:attr(data-ph);color:var(--muted)} .ed-body:empty::before{content:attr(data-ph);color:var(--muted)}
@@ -555,11 +531,11 @@ textarea.ed-body{width:100%;min-height:180px;resize:vertical}
.subtab.on{color:var(--mint);border-bottom-color:var(--mint)} .subtab.on{color:var(--mint);border-bottom-color:var(--mint)}
.subtab .pill{position:static} .subtab .pill{position:static}
/* ── solo-ads inbox ── */ /* ── solo-ads inbox ── */
.bo-menu .pill{margin-left:auto;background:var(--amber);color:var(--amber-ink);font-size:11px;font-weight:800; .bo-menu .pill{margin-left:auto;background:var(--amber);color:#1a1206;font-size:11px;font-weight:800;
border-radius:999px;padding:1px 8px;line-height:1.5} border-radius:999px;padding:1px 8px;line-height:1.5}
.ib-row{display:flex;gap:10px;align-items:baseline;padding:11px 6px;border-bottom:1px solid var(--line); .ib-row{display:flex;gap:10px;align-items:baseline;padding:11px 6px;border-bottom:1px solid var(--line);
cursor:pointer;flex-wrap:wrap} cursor:pointer;flex-wrap:wrap}
.ib-row:hover{background:var(--mint-faint)} .ib-row:hover{background:rgba(67,232,195,.05)}
.ib-row .sub{font-weight:700;flex:1;min-width:160px;overflow-wrap:anywhere} .ib-row .sub{font-weight:700;flex:1;min-width:160px;overflow-wrap:anywhere}
.ib-row.unread .sub{color:var(--mint)} .ib-row.unread .sub{color:var(--mint)}
.ib-row .from,.ib-row .when{font-size:12px;color:var(--muted);white-space:nowrap} .ib-row .from,.ib-row .when{font-size:12px;color:var(--muted);white-space:nowrap}
@@ -580,9 +556,9 @@ textarea.ed-body{width:100%;min-height:180px;resize:vertical}
#pane-earn .card h3::before,#pane-earnings .card h3::before{background:var(--violet)} #pane-earn .card h3::before,#pane-earnings .card h3::before{background:var(--violet)}
#pane-promo .card h3::before{background:var(--cyan)} #pane-promo .card h3::before{background:var(--cyan)}
#pane-wallet .card h3::before,#pane-profile .card h3::before{background:var(--mint)} #pane-wallet .card h3::before,#pane-profile .card h3::before{background:var(--mint)}
.bo .card{background:var(--panel-grad)} .bo .card{background:linear-gradient(165deg,rgba(24,36,31,.6),rgba(13,19,17,.66))}
#pane-line .qualbar,#nextCard{border-left:3px solid var(--mint-line)} #pane-line .qualbar,#nextCard{border-left:3px solid rgba(67,232,195,.4)}
.promo-block{background:var(--ground-soft);border:1px solid var(--line);border-radius:12px; .promo-block{background:rgba(4,8,7,.55);border:1px solid var(--line);border-radius:12px;
padding:14px 16px;margin:0 0 12px;font-size:13.5px;line-height:1.6;white-space:pre-wrap} padding:14px 16px;margin:0 0 12px;font-size:13.5px;line-height:1.6;white-space:pre-wrap}
.promo-block .btn{margin-top:10px} .promo-block .btn{margin-top:10px}
/* back-office polish: pane transitions, quick actions */ /* back-office polish: pane transitions, quick actions */
@@ -591,19 +567,19 @@ textarea.ed-body{width:100%;min-height:180px;resize:vertical}
@keyframes panein{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}} @keyframes panein{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
} }
.qa{display:flex;flex-direction:column;gap:8px} .qa{display:flex;flex-direction:column;gap:8px}
.qa button{display:flex;align-items:center;gap:10px;background:var(--mint-faint);border:1px solid var(--line); .qa button{display:flex;align-items:center;gap:10px;background:rgba(67,232,195,.05);border:1px solid var(--line);
color:var(--ink);font:600 14px var(--disp);padding:11px 14px;border-radius:11px;cursor:pointer;text-align:left; color:var(--ink);font:600 14px var(--disp);padding:11px 14px;border-radius:11px;cursor:pointer;text-align:left;
transition:border-color .15s ease,background .15s ease} transition:border-color .15s ease,background .15s ease}
.qa button:hover{border-color:var(--mint);background:var(--mint-soft)} .qa button:hover{border-color:var(--mint);background:rgba(67,232,195,.1)}
/* member sub-navigation */ /* member sub-navigation */
.subnav{display:flex;gap:6px;flex-wrap:wrap;background:var(--pill-bg);border:1px solid var(--line); .subnav{display:flex;gap:6px;flex-wrap:wrap;background:rgba(16,28,24,.7);border:1px solid var(--line);
border-radius:999px;padding:6px 8px;width:fit-content;margin:0 0 22px} border-radius:999px;padding:6px 8px;width:fit-content;margin:0 0 22px}
.subnav button{background:transparent;border:0;color:var(--muted);font:600 13.5px var(--disp); .subnav button{background:transparent;border:0;color:var(--muted);font:600 13.5px var(--disp);
padding:8px 16px;border-radius:999px;cursor:pointer} padding:8px 16px;border-radius:999px;cursor:pointer}
.subnav button:hover{color:var(--ink)} .subnav button:hover{color:var(--ink)}
.subnav button.on{color:var(--mint-ink);background:var(--mint)} .subnav button.on{color:var(--mint-ink);background:var(--mint)}
/* member dashboard: qualification progress + roster */ /* member dashboard: qualification progress + roster */
.qualbar{position:relative;height:12px;border-radius:999px;background:var(--ground-soft);border:1px solid var(--line-strong); .qualbar{position:relative;height:12px;border-radius:999px;background:rgba(4,8,7,.7);border:1px solid var(--line-strong);
margin:26px 0 30px;max-width:520px} margin:26px 0 30px;max-width:520px}
.qualbar #qualFill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--mint),var(--mint-hi)); .qualbar #qualFill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--mint),var(--mint-hi));
box-shadow:0 0 18px rgba(67,232,195,.4);width:0;transition:width .6s ease} box-shadow:0 0 18px rgba(67,232,195,.4);width:0;transition:width .6s ease}
@@ -629,8 +605,8 @@ img{max-width:100%}
font-size:22px;cursor:pointer;line-height:1} font-size:22px;cursor:pointer;line-height:1}
.ch-msgs{padding:14px;overflow-y:auto;max-height:340px;display:flex;flex-direction:column;gap:10px} .ch-msgs{padding:14px;overflow-y:auto;max-height:340px;display:flex;flex-direction:column;gap:10px}
.ch-m{border-radius:12px;padding:9px 13px;font-size:13.5px;line-height:1.5;max-width:86%} .ch-m{border-radius:12px;padding:9px 13px;font-size:13.5px;line-height:1.5;max-width:86%}
.ch-m.bot{background:var(--mint-soft);border:1px solid var(--mint-line);align-self:flex-start} .ch-m.bot{background:rgba(67,232,195,.08);border:1px solid rgba(67,232,195,.2);align-self:flex-start}
.ch-m.me{background:var(--muted-soft);border:1px solid var(--line);align-self:flex-end} .ch-m.me{background:rgba(130,148,196,.12);border:1px solid var(--line);align-self:flex-end}
.ch-m a{word-break:break-all} .ch-m a{word-break:break-all}
.ch-input{display:flex;gap:8px;padding:11px;border-top:1px solid var(--line)} .ch-input{display:flex;gap:8px;padding:11px;border-top:1px solid var(--line)}
.ch-input input{flex:1;min-width:0} .ch-input input{flex:1;min-width:0}
@@ -638,7 +614,7 @@ img{max-width:100%}
font-weight:700;cursor:pointer;font-family:var(--disp)} font-weight:700;cursor:pointer;font-family:var(--disp)}
@media(prefers-reduced-motion:no-preference){ @media(prefers-reduced-motion:no-preference){
.feed .row:first-child{animation:landed .9s ease} .feed .row:first-child{animation:landed .9s ease}
@keyframes landed{from{background:var(--mint-soft-2)}to{background:var(--mint-soft)}} @keyframes landed{from{background:rgba(67,232,195,.3)}to{background:var(--mint-soft)}}
} }
/* ── Sponsor chat: FAB, slide-in drawer, threads, bubbles, presence ── */ /* ── Sponsor chat: FAB, slide-in drawer, threads, bubbles, presence ── */
@@ -692,12 +668,12 @@ img{max-width:100%}
.lt-nodes{display:flex;gap:8px;flex-wrap:wrap} .lt-nodes{display:flex;gap:8px;flex-wrap:wrap}
.lt-node{background:var(--panel);border:1px solid var(--line-strong);border-radius:10px;padding:6px 12px;font-size:13px;font-weight:600;white-space:nowrap} .lt-node{background:var(--panel);border:1px solid var(--line-strong);border-radius:10px;padding:6px 12px;font-size:13px;font-weight:600;white-space:nowrap}
.lt-node.deep{color:var(--muted)} .lt-node.deep{color:var(--muted)}
.lt-node.qualified{border-color:var(--amber);color:var(--gold);box-shadow:0 0 0 1px var(--amber-line)} .lt-node.qualified{border-color:#ffb238;color:#ffd15c;box-shadow:0 0 0 1px rgba(255,177,56,.35)}
.lt-node.open{border-style:dashed;color:var(--muted);background:transparent} .lt-node.open{border-style:dashed;color:var(--muted);background:transparent}
.lt-node .lt-n{display:inline-block;font-style:normal;font-size:10px;line-height:16px;min-width:16px;text-align:center;border-radius:8px;background:var(--amber-soft);color:var(--gold);margin-left:6px;padding:0 4px;font-variant-numeric:tabular-nums} .lt-node .lt-n{display:inline-block;font-style:normal;font-size:10px;line-height:16px;min-width:16px;text-align:center;border-radius:8px;background:rgba(255,177,56,.18);color:#ffd15c;margin-left:6px;padding:0 4px;font-variant-numeric:tabular-nums}
.sh-report{display:block;text-align:center;margin-top:10px;color:var(--muted);font-size:12px} .sh-report{display:block;text-align:center;margin-top:10px;color:rgba(255,255,255,.45);font-size:12px}
.sh-report:hover{color:var(--ink)} .sh-report:hover{color:rgba(255,255,255,.8)}
/* ── promo tools (2026-09-09) ── */ /* ── promo tools (2026-09-09) ── */
.promo-strip{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;padding:16px 20px} .promo-strip{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;padding:16px 20px}
@@ -728,7 +704,7 @@ img{max-width:100%}
.promo-bv{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px;padding:14px 16px;border:1px dashed var(--line-strong);border-radius:12px} .promo-bv{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px;padding:14px 16px;border:1px dashed var(--line-strong);border-radius:12px}
.promo-bv b{font-family:var(--disp)} .promo-bv b{font-family:var(--disp)}
.obj-wrap{display:flex;flex-direction:column;gap:8px} .obj-wrap{display:flex;flex-direction:column;gap:8px}
.obj{border:1px solid var(--line);border-radius:12px;background:var(--ground-soft)} .obj{border:1px solid var(--line);border-radius:12px;background:rgba(4,8,7,.4)}
.obj summary{cursor:pointer;padding:12px 16px;font-family:var(--disp);font-weight:700;font-size:15px;list-style:none;display:flex;justify-content:space-between;gap:10px} .obj summary{cursor:pointer;padding:12px 16px;font-family:var(--disp);font-weight:700;font-size:15px;list-style:none;display:flex;justify-content:space-between;gap:10px}
.obj summary::after{content:"+";color:var(--mint);font-weight:800} .obj summary::after{content:"+";color:var(--mint);font-weight:800}
.obj[open] summary::after{content:"–"} .obj[open] summary::after{content:"–"}
@@ -750,12 +726,12 @@ img{max-width:100%}
.wo-slot img{max-width:100%;border-radius:8px} .wo-slot img{max-width:100%;border-radius:8px}
/* getting-started stepper on the Overview (Jim could not find the wallet step, 2026-09-14) */ /* getting-started stepper on the Overview (Jim could not find the wallet step, 2026-09-14) */
.gs{border-color:var(--mint-line)} .gs{border-color:rgba(67,232,195,.45)}
.gs-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:4px 0 12px} .gs-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:4px 0 12px}
.gs-step{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px 12px;color:var(--muted);font-size:14px} .gs-step{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px 12px;color:var(--muted);font-size:14px}
.gs-step .n{flex:0 0 26px;width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:700;border:1px solid var(--line);font-size:13px} .gs-step .n{flex:0 0 26px;width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:700;border:1px solid var(--line);font-size:13px}
.gs-step.done{color:var(--ink)} .gs-step.done .n{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)} .gs-step.done{color:var(--ink)} .gs-step.done .n{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)}
.gs-step.now{color:var(--ink);border-color:var(--mint);background:var(--mint-faint)} .gs-step.now .n{border-color:var(--mint);color:var(--mint)} .gs-step.now{color:var(--ink);border-color:var(--mint);background:rgba(67,232,195,.07)} .gs-step.now .n{border-color:var(--mint);color:var(--mint)}
.gs-now{display:flex;gap:14px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px} .gs-now{display:flex;gap:14px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px}
.gs-now p{margin:0;flex:1;min-width:240px;max-width:60ch} .gs-now p b{display:block;font-family:var(--disp);font-size:16px;margin-bottom:2px} .gs-now p{margin:0;flex:1;min-width:240px;max-width:60ch} .gs-now p b{display:block;font-family:var(--disp);font-size:16px;margin-bottom:2px}
@keyframes gsPulse{0%{box-shadow:0 0 0 0 rgba(67,232,195,.7)}70%{box-shadow:0 0 0 14px rgba(67,232,195,0)}100%{box-shadow:0 0 0 0 rgba(67,232,195,0)}} @keyframes gsPulse{0%{box-shadow:0 0 0 0 rgba(67,232,195,.7)}70%{box-shadow:0 0 0 14px rgba(67,232,195,0)}100%{box-shadow:0 0 0 0 rgba(67,232,195,0)}}
@@ -764,16 +740,16 @@ img{max-width:100%}
/* promo toolkit tiers */ /* promo toolkit tiers */
.tk-tiers{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px} .tk-tiers{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.tk-tier{border:1px solid var(--line);border-radius:12px;padding:12px 14px;font-size:13.5px;color:var(--muted)} .tk-tier{border:1px solid var(--line);border-radius:12px;padding:12px 14px;font-size:13.5px;color:var(--muted)}
.tk-tier.reached{border-color:var(--mint-line);color:var(--ink)} .tk-tier.current{background:var(--mint-faint)} .tk-tier.reached{border-color:rgba(67,232,195,.5);color:var(--ink)} .tk-tier.current{background:rgba(67,232,195,.07)}
.tk-tier b{display:block;font-family:var(--disp);font-size:15px;color:var(--ink)} .tk-tier .need{font-size:12px;margin:2px 0 8px;color:var(--muted)} .tk-tier b{display:block;font-family:var(--disp);font-size:15px;color:var(--ink)} .tk-tier .need{font-size:12px;margin:2px 0 8px;color:var(--muted)}
.tk-tier ul{margin:0;padding-left:16px} .tk-tier li{margin:3px 0} .tk-tier li.soon{opacity:.65} .tk-tier li.soon::after{content:' (coming)';font-size:11px;color:var(--muted)} .tk-tier ul{margin:0;padding-left:16px} .tk-tier li{margin:3px 0} .tk-tier li.soon{opacity:.65} .tk-tier li.soon::after{content:' (coming)';font-size:11px;color:var(--muted)}
.tk-tier .lock{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gold)} .tk-tier .lock{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#ffd15c}
.tk-hist{border-top:1px solid var(--line);padding:8px 0;font-size:13px} .tk-hist .muted{font-size:12px} .tk-hist{border-top:1px solid var(--line);padding:8px 0;font-size:13px} .tk-hist .muted{font-size:12px}
.tk-sec{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)} .tk-grid{display:flex;gap:8px;flex-wrap:wrap} .tk-sec{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)} .tk-grid{display:flex;gap:8px;flex-wrap:wrap}
.tk-vids{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px} .tk-vid{border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:13px} .tk-vid b{display:block;font-weight:600;margin-bottom:4px} .tk-vid .st{font-size:12px;color:var(--muted)} .tk-vids{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px} .tk-vid{border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:13px} .tk-vid b{display:block;font-weight:600;margin-bottom:4px} .tk-vid .st{font-size:12px;color:var(--muted)}
.tk-bar{height:8px;border-radius:99px;background:var(--muted-soft);overflow:hidden;margin:6px 0 4px} .tk-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--mint-deep),var(--mint));transition:width .6s ease;min-width:4px} .tk-bar{height:8px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden;margin:6px 0 4px} .tk-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#1fb894,#43e8c3);transition:width .6s ease;min-width:4px}
.tk-table{width:100%;border-collapse:collapse;font-size:13px} .tk-table th,.tk-table td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)} .tk-table th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)} .tk-table td.n{font-variant-numeric:tabular-nums;text-align:right} .tk-table th.n{text-align:right} .tk-table tr.best td{color:var(--mint)} .tk-table{width:100%;border-collapse:collapse;font-size:13px} .tk-table th,.tk-table td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)} .tk-table th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)} .tk-table td.n{font-variant-numeric:tabular-nums;text-align:right} .tk-table th.n{text-align:right} .tk-table tr.best td{color:var(--mint)}
.tk-team{border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:6px 0;font-size:13px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between} .tk-team .who b{font-weight:600} .tk-team .who span{color:var(--muted);font-size:12px} .tk-team.stalled{border-color:var(--gold-line)} .tk-team{border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:6px 0;font-size:13px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between} .tk-team .who b{font-weight:600} .tk-team .who span{color:var(--muted);font-size:12px} .tk-team.stalled{border-color:rgba(255,209,92,.45)}
.tk-nudge{width:100%;margin:8px 0 0;padding:8px 12px;border:1px dashed var(--line);border-radius:10px;font-size:13px} .tk-nudge{width:100%;margin:8px 0 0;padding:8px 12px;border:1px dashed var(--line);border-radius:10px;font-size:13px}
/* click sources stack one per line so the Clicks column stays narrow (Marty, 2026-09-15) */ /* click sources stack one per line so the Clicks column stays narrow (Marty, 2026-09-15) */
.clk-src span{display:block;white-space:nowrap} .camp-table td{white-space:normal} .camp-table td:first-child{max-width:260px} .clk-src span{display:block;white-space:nowrap} .camp-table td{white-space:normal} .camp-table td:first-child{max-width:260px}
@@ -796,11 +772,11 @@ img{max-width:100%}
/* Pipeline board (Marty, 2026-09-15): columns scroll sideways inside their own box, never the page */ /* Pipeline board (Marty, 2026-09-15): columns scroll sideways inside their own box, never the page */
.pipe-board{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity} .pipe-board{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity}
.pipe-col{flex:0 0 220px;scroll-snap-align:start;background:var(--ground-soft);border:1px solid var(--line);border-radius:12px;padding:10px;min-height:120px} .pipe-col{flex:0 0 220px;scroll-snap-align:start;background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:12px;padding:10px;min-height:120px}
.pipe-col h4{margin:0 0 2px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--mint);display:flex;justify-content:space-between;gap:8px} .pipe-col h4{margin:0 0 2px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--mint);display:flex;justify-content:space-between;gap:8px}
.pipe-col h4 span{color:var(--muted);font-variant-numeric:tabular-nums} .pipe-col h4 span{color:var(--muted);font-variant-numeric:tabular-nums}
.pipe-col .hint{font-size:11.5px;color:var(--muted);margin:0 0 8px;line-height:1.35} .pipe-col .hint{font-size:11.5px;color:var(--muted);margin:0 0 8px;line-height:1.35}
.pipe-card{background:var(--ink-faint);border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin:0 0 8px;cursor:pointer;transition:border-color .15s} .pipe-card{background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin:0 0 8px;cursor:pointer;transition:border-color .15s}
.pipe-card:hover,.pipe-card:focus-visible{border-color:var(--mint);outline:none} .pipe-card:hover,.pipe-card:focus-visible{border-color:var(--mint);outline:none}
.pipe-card.on{border-color:var(--gold,#e6c15a)} .pipe-card.on{border-color:var(--gold,#e6c15a)}
.pipe-card .nm{font-weight:700;font-size:14px;display:flex;justify-content:space-between;gap:6px;align-items:baseline} .pipe-card .nm{font-weight:700;font-size:14px;display:flex;justify-content:space-between;gap:6px;align-items:baseline}
@@ -811,23 +787,11 @@ img{max-width:100%}
.pipe-due{display:grid;gap:6px} .pipe-due{display:grid;gap:6px}
.pipe-due .pipe-card{margin:0} .pipe-due .pipe-card{margin:0}
@media (max-width:640px){.pipe-form{grid-template-columns:1fr !important}.pipe-col{flex-basis:200px}} @media (max-width:640px){.pipe-form{grid-template-columns:1fr !important}.pipe-col{flex-basis:200px}}
/* the pipeline board fits on one screen (2026-11-20, a member: "need a bottom slide rule so we can see the entire window to the right
without having to reduce the size"): a long column scrolls inside itself with its heading pinned, so the board's own sideways
scrollbar stays in view; both scrollbars are wide and visible instead of the thin overlay ones */
.pipe-col{max-height:min(68vh,760px);overflow-y:auto;overflow-x:hidden}
.pipe-col h4{position:sticky;top:-10px;z-index:1;background:inherit;margin:-10px -10px 2px;padding:10px 10px 2px}
.pipe-board{scrollbar-width:auto;scrollbar-color:var(--mint) transparent}
.pipe-col{scrollbar-width:thin}
.pipe-board::-webkit-scrollbar{height:14px}
.pipe-board::-webkit-scrollbar-thumb{background:var(--mint);border-radius:8px;border:3px solid transparent;background-clip:padding-box}
.pipe-board::-webkit-scrollbar-track{background:var(--line);border-radius:8px}
.pipe-col::-webkit-scrollbar{width:8px}
.pipe-col::-webkit-scrollbar-thumb{background:var(--line);border-radius:6px}
/* Overview chips drill down to My line (Marty, 2026-09-15) */ /* Overview chips drill down to My line (Marty, 2026-09-15) */
.lt-node.lt-go{cursor:pointer;transition:border-color .15s,transform .15s} .lt-node.lt-go:hover,.lt-node.lt-go:focus-visible{border-color:var(--mint);transform:translateY(-1px);outline:none} .lt-node.lt-go{cursor:pointer;transition:border-color .15s,transform .15s} .lt-node.lt-go:hover,.lt-node.lt-go:focus-visible{border-color:var(--mint);transform:translateY(-1px);outline:none}
.lin-row.lin-focus{box-shadow:0 0 0 2px var(--mint);border-radius:10px} .lin-row.lin-focus{box-shadow:0 0 0 2px var(--mint);border-radius:10px}
/* paged lists: 25 rows, then a control bar that reads as a control, not more list (Marty, 2026-09-19) */ /* paged lists: 25 rows, then a control bar that reads as a control, not more list (Marty, 2026-09-19) */
.pgr{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:12px 0 4px;padding:10px 12px;border:1px solid var(--line-strong);border-radius:12px;background:var(--mint-faint)} .pgr{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:12px 0 4px;padding:10px 12px;border:1px solid var(--line-strong);border-radius:12px;background:rgba(67,232,195,.07)}
.pgr-n{color:var(--ink);font-size:13px} .pgr-n b{color:var(--mint);font-variant-numeric:tabular-nums} .pgr-n{color:var(--ink);font-size:13px} .pgr-n b{color:var(--mint);font-variant-numeric:tabular-nums}
.pgr-b{display:flex;align-items:center;gap:8px;flex-wrap:wrap} .pgr-b{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pgr-pg{font-size:11px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap} .pgr-pg{font-size:11px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
@@ -837,12 +801,12 @@ img{max-width:100%}
#chatThreads .pgr{margin:8px 10px} #chatThreads .pgr{margin:8px 10px}
/* Five Dollar Friday strip (landing) */ /* Five Dollar Friday strip (landing) */
.fdf{margin:18px auto 0;max-width:760px;padding:12px 16px;border-radius:12px;background:var(--mint-soft);border:1px solid var(--mint-line);color:var(--ink);font-size:14px;line-height:1.5;text-align:center} .fdf{margin:18px auto 0;max-width:760px;padding:12px 16px;border-radius:12px;background:rgba(67,232,195,.08);border:1px solid rgba(67,232,195,.35);color:var(--ink,#eafffa);font-size:14px;line-height:1.5;text-align:center}
.fdf a{color:var(--mint);font-weight:600} .fdf a{color:#43e8c3;font-weight:600}
/* My line: section pills, sticky under the top bar (Marty, 2026-09-26) */ /* My line: section pills, sticky under the top bar (Marty, 2026-09-26) */
.line-jump{position:sticky;top:var(--jumpTop,64px);z-index:4;margin:0 0 14px;padding:10px 0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none; .line-jump{position:sticky;top:var(--jumpTop,64px);z-index:4;margin:0 0 14px;padding:10px 0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;
background:var(--nav-bg);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line)} background:rgba(6,10,8,.88);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.line-jump::-webkit-scrollbar{display:none} .line-jump::-webkit-scrollbar{display:none}
.line-jump .chip-t{flex:none;white-space:nowrap} .line-jump .chip-t{flex:none;white-space:nowrap}
#pane-line > .card[data-jump]{scroll-margin-top:calc(var(--jumpTop,64px) + 64px)} #pane-line > .card[data-jump]{scroll-margin-top:calc(var(--jumpTop,64px) + 64px)}
@@ -850,44 +814,3 @@ img{max-width:100%}
/* a game return bar sits at the bottom: lift the status toast above it (Marty 2026-10-08: the bar hid the purchase result) */ /* a game return bar sits at the bottom: lift the status toast above it (Marty 2026-10-08: the bar hid the purchase result) */
body.hasback #status{bottom:92px} body.hasback #status{bottom:92px}
/* ── Light theme (2026-11-01, mirrored from LinkSpin): light mint-grey ground, white panels, dark ink, the mint family
darkened to a teal that reads as text on white (every pair below clears WCAG AA 4.5:1, measured by qa/theme-contrast.mjs).
themehead.js resolves auto | light | dark to data-theme on <html> before the first paint; nothing stored keeps dark. ── */
:root[data-theme="light"]{
--ground:#E8F0EC; --ground2:#F2F7F4; --panel:#FFFFFF; --panel-solid:#FFFFFF;
--line:#C9D8D1; --line-strong:#A6BBB1; --line-soft:#DDE7E2; --ink:#0B1A14; --muted:#50665C;
--mint:#0A6B56; --mint-hi:#075744; --mint-deep:#064A3A; --mint-ink:#FFFFFF; --mint-pale:#075744;
--mint-faint:#EDF6F2; --mint-soft:#DDF0E8; --mint-soft-2:#C6E6DA; --mint-line:#8FC9B6; --mint-line-2:#3E9E85;
--cyan:#0A6F8C; --violet:#5B3FD6; --amber:#8A5200; --bad:#B42318; --bad-soft:#FDE8E6;
--ok:#0B7A52; --ok-ink:#FFFFFF; --ok-soft:#E3F6EC; --warn:#9A4A00;
--gold:#7A5200; --gold-2:#7F5C00; --gold-ink:#FFFFFF; --gold-soft:#FFF4D1; --gold-faint:#FFFBEB; --gold-line:#E6C25E;
--amber-soft:#FFF1D6; --amber-line:#E8C27A; --amber-ink:#FFFFFF;
--cyan-soft:#DDF1F8; --cyan-line:#9FD3E6; --violet-soft:#EEE9FF; --violet-line:#C4B5FF;
--muted-soft:rgba(80,102,92,.12); --muted-line:rgba(80,102,92,.45); --ink-faint:rgba(11,26,20,.05);
--ground-soft:#F2F7F4; --field-bg:#FFFFFF; --nav-bg:rgba(242,247,244,.88); --side-bg:rgba(242,247,244,.97); --pill-bg:rgba(255,255,255,.85);
--panel-grad:linear-gradient(180deg,#FFFFFF,#F5FAF7); --panel-grad-deep:linear-gradient(180deg,#F2F7F4,#E2ECE7); --plate-grad:linear-gradient(160deg,#FFFFFF,#E6F1EC);
--sh-lg:0 0 0 1px rgba(11,26,20,.04),0 14px 34px -20px rgba(11,26,20,.35);
color-scheme:light;
}
:root[data-theme="light"] body::before{opacity:.7}
:root[data-theme="light"] .ghost{background:linear-gradient(180deg,rgba(10,107,86,.22),transparent 78%);-webkit-background-clip:text;background-clip:text}
:root[data-theme="light"] .btn{box-shadow:0 4px 18px rgba(10,107,86,.22)} :root[data-theme="light"] .btn:hover{box-shadow:0 8px 26px rgba(10,107,86,.3)}
:root[data-theme="light"] .mockup,:root[data-theme="light"] .modal-card,:root[data-theme="light"] #status,:root[data-theme="light"] #iapChatPanel,:root[data-theme="light"] .chat-drawer{box-shadow:0 18px 50px -20px rgba(11,26,20,.35)}
:root[data-theme="light"] .bo.side-open .bo-side{box-shadow:0 0 60px rgba(11,26,20,.25)}
:root[data-theme="light"] .plate{box-shadow:0 0 24px rgba(10,107,86,.12),inset 0 1px 0 rgba(255,255,255,.8)}
/* ── holding-tank readiness (2026-11-18): stage chip, heat with its band, last action, how they got here. Theme tokens only. ── */
.rd-line{display:flex;flex-wrap:wrap;gap:4px 6px;align-items:center;margin-top:4px;font-weight:400;white-space:normal}
.rd-stage,.rd-heat{display:inline-block;font-size:11px;line-height:1.5;padding:0 7px;border-radius:999px;border:1px solid var(--line-strong);color:var(--muted);font-weight:600;font-variant-numeric:tabular-nums}
.rd-s-warming{color:var(--cyan);border-color:var(--cyan-line);background:var(--cyan-soft)}
.rd-s-engaged{color:var(--violet);border-color:var(--violet-line);background:var(--violet-soft)}
.rd-s-activated{color:var(--mint);border-color:var(--mint-line);background:var(--mint-soft)}
.rd-s-ready{color:var(--ok);border-color:var(--ok);background:var(--ok-soft)}
.rd-hot{color:var(--bad);border-color:var(--bad);background:var(--bad-soft)}
.rd-warm{color:var(--amber);border-color:var(--amber-line);background:var(--amber-soft)}
.rd-cooling{color:var(--cyan);border-color:var(--cyan-line);background:var(--cyan-soft)}
.rd-cold{color:var(--muted);border-color:var(--muted-line);background:var(--muted-soft)}
.rd-last{font-size:11.5px;color:var(--muted)}
.rd-entry{display:block;font-size:11.5px;color:var(--muted);font-weight:400;white-space:normal;margin-top:2px}
.lin-row .em .rd-line,.lin-row .em .rd-entry{white-space:normal}
.lin-row.rd-row .em{white-space:normal}
+5 -37
View File
@@ -18,15 +18,14 @@ window.IAPSupport = (function () {
if (document.getElementById('supCss')) return; if (document.getElementById('supCss')) return;
const st = document.createElement('style'); st.id = 'supCss'; const st = document.createElement('style'); st.id = 'supCss';
st.textContent = '.sup-form label{display:block;font-size:13px;color:var(--muted);margin:12px 0 4px}.sup-form input,.sup-form select,.sup-form textarea{width:100%;box-sizing:border-box}' st.textContent = '.sup-form label{display:block;font-size:13px;color:var(--muted);margin:12px 0 4px}.sup-form input,.sup-form select,.sup-form textarea{width:100%;box-sizing:border-box}'
+ '.sup-row{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:12px 4px;border-bottom:1px solid var(--line);cursor:pointer}.sup-row:last-child{border-bottom:0}.sup-row:hover{background:var(--mint-faint)}' + '.sup-row{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:12px 4px;border-bottom:1px solid var(--line);cursor:pointer}.sup-row:last-child{border-bottom:0}.sup-row:hover{background:rgba(67,232,195,.04)}'
+ '.sup-row .sr-main{min-width:0;flex:1}.sup-row .sr-sub{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sup-row .sr-meta{font-size:12px;color:var(--muted)}' + '.sup-row .sr-main{min-width:0;flex:1}.sup-row .sr-sub{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sup-row .sr-meta{font-size:12px;color:var(--muted)}'
+ '.sup-st{font-size:11.5px;font-weight:700;border-radius:999px;padding:2px 10px;border:1px solid var(--line-strong);white-space:nowrap}.sup-st.open{color:var(--mint);border-color:var(--mint-line-2)}.sup-st.waiting_on_member{color:var(--gold-2);border-color:var(--gold-line)}.sup-st.closed{color:var(--muted)}' + '.sup-st{font-size:11.5px;font-weight:700;border-radius:999px;padding:2px 10px;border:1px solid var(--line-strong);white-space:nowrap}.sup-st.open{color:var(--mint);border-color:rgba(67,232,195,.5)}.sup-st.waiting_on_member{color:#f2c94c;border-color:rgba(242,201,76,.5)}.sup-st.closed{color:var(--muted)}'
+ '.sup-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--amber,#ffb238);margin-right:6px;vertical-align:1px}' + '.sup-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--amber,#ffb238);margin-right:6px;vertical-align:1px}'
+ '.sup-msg{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:10px 0;background:var(--ground-soft)}.sup-msg.admin{border-color:var(--mint-line);background:var(--mint-faint)}.sup-msg.system{opacity:.8}' + '.sup-msg{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:10px 0;background:rgba(4,8,7,.35)}.sup-msg.admin{border-color:rgba(67,232,195,.45);background:rgba(67,232,195,.06)}.sup-msg.system{opacity:.8}'
+ '.sup-msg .sm-head{font-size:12px;color:var(--muted);margin:0 0 6px;display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.sup-msg .sm-body{white-space:pre-wrap;word-wrap:break-word;font-size:15px;line-height:1.5}' + '.sup-msg .sm-head{font-size:12px;color:var(--muted);margin:0 0 6px;display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.sup-msg .sm-body{white-space:pre-wrap;word-wrap:break-word;font-size:15px;line-height:1.5}'
+ '.sup-att{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}.sup-att img{max-width:160px;max-height:120px;border-radius:8px;border:1px solid var(--line)}' + '.sup-att{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}.sup-att img{max-width:160px;max-height:120px;border-radius:8px;border:1px solid var(--line)}'
+ '.sup-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:12px}' + '.sup-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:12px}';
+ '.sup-suggest{border:1px solid var(--mint-line);border-radius:12px;padding:10px 14px;margin:10px 0 0;background:var(--mint-faint)}.sup-sg{margin:4px 0}.sup-sg summary{cursor:pointer;font-weight:700;font-size:14px}.sup-sg .sm-body{white-space:pre-wrap;word-wrap:break-word;font-size:14px;line-height:1.5;margin:6px 0 8px}';
document.head.appendChild(st); document.head.appendChild(st);
})(); })();
const catOptions = sel => CATS.map(c => '<option' + (c === sel ? ' selected' : '') + '>' + esc(c) + '</option>').join(''); const catOptions = sel => CATS.map(c => '<option' + (c === sel ? ' selected' : '') + '>' + esc(c) + '</option>').join('');
@@ -92,11 +91,9 @@ window.IAPSupport = (function () {
+ '<label for="hnCat">What is it about?</label><select id="hnCat">' + catOptions('') + '</select>' + '<label for="hnCat">What is it about?</label><select id="hnCat">' + catOptions('') + '</select>'
+ '<label for="hnSubject">Subject</label><input id="hnSubject" maxlength="140" placeholder="A few words, like: my payout did not arrive">' + '<label for="hnSubject">Subject</label><input id="hnSubject" maxlength="140" placeholder="A few words, like: my payout did not arrive">'
+ '<label for="hnBody">Message</label><textarea id="hnBody" rows="6" maxlength="5000" placeholder="What happened, what you expected, and anything you already tried. Never send your recovery phrase or private key."></textarea>' + '<label for="hnBody">Message</label><textarea id="hnBody" rows="6" maxlength="5000" placeholder="What happened, what you expected, and anything you already tried. Never send your recovery phrase or private key."></textarea>'
+ '<div id="hnSuggest" class="sup-suggest" hidden aria-live="polite"></div>'
+ attachRow('hn') + attachRow('hn')
+ '<div class="sup-actions"><button class="btn small" type="button" id="hnSend">Send to support</button><button class="btn small sec" type="button" id="hnCancel">Cancel</button><span class="small muted" id="hnMsg"></span></div></div>'; + '<div class="sup-actions"><button class="btn small" type="button" id="hnSend">Send to support</button><button class="btn small sec" type="button" id="hnCancel">Cancel</button><span class="small muted" id="hnMsg"></span></div></div>';
const atts = wireAttach('hn'); const atts = wireAttach('hn');
wireSuggest();
document.getElementById('hnCancel').addEventListener('click', () => { box.hidden = true; box.innerHTML = ''; }); document.getElementById('hnCancel').addEventListener('click', () => { box.hidden = true; box.innerHTML = ''; });
const send = document.getElementById('hnSend'); const send = document.getElementById('hnSend');
send.addEventListener('click', async () => { send.addEventListener('click', async () => {
@@ -110,27 +107,6 @@ window.IAPSupport = (function () {
}); });
document.getElementById('hnSubject').focus(); document.getElementById('hnSubject').focus();
} }
// help answers while typing (2026-11-16): debounced, from the KB only (the hub's semantic match); a suggestion never blocks Send
function wireSuggest() {
const box = document.getElementById('hnSuggest'), subj = document.getElementById('hnSubject'), body = document.getElementById('hnBody');
if (!box || !subj || !body) return;
let timer = null, seq = 0, last = '';
const run = async () => {
const text = (subj.value + ' ' + body.value).replace(/\s+/g, ' ').trim();
if (text.replace(/[^A-Za-z0-9]/g, '').length < 10) { box.hidden = true; box.innerHTML = ''; last = ''; return; }
if (text === last) return; last = text; const mine = ++seq;
let r; try { r = await call('/api/my/support/suggest', { subject: subj.value, body: body.value }); } catch (e) { return; }
if (mine !== seq || !document.body.contains(box)) return;
const items = (r && r.items) || [];
if (!items.length) { box.hidden = true; box.innerHTML = ''; return; }
box.innerHTML = '<p class="small" style="margin:0 0 6px"><b>These answers may help</b> <span class="muted">You can still send your ticket.</span></p>'
+ items.map(i => '<details class="sup-sg"><summary>' + esc(i.title) + (i.site ? ' <span class="muted small">(' + esc(i.site) + ')</span>' : '') + (i.fromTicket ? ' <span class="muted small">from a past ticket</span>' : '') + '</summary>'
+ '<div class="sm-body">' + linkify(i.answer) + (i.link && i.site ? '<br><a href="' + esc(i.link) + '" target="_blank" rel="noopener">Open ' + esc(i.site) + '</a>' : '') + '</div></details>').join('');
box.hidden = false;
};
const kick = () => { clearTimeout(timer); timer = setTimeout(run, 700); };
subj.addEventListener('input', kick); body.addEventListener('input', kick);
}
async function openMine(ref) { async function openMine(ref) {
const host = document.getElementById('helpBody'); if (!host) return; const host = document.getElementById('helpBody'); if (!host) return;
helpState.open = ref; helpState.open = ref;
@@ -161,7 +137,7 @@ window.IAPSupport = (function () {
if (m) return tokenPage(host, m[1]); if (m) return tokenPage(host, m[1]);
let me = null; try { me = await (await fetch('/api/me')).json(); } catch (e) {} let me = null; try { me = await (await fetch('/api/me')).json(); } catch (e) {}
const signedIn = !!(me && me.signedIn && me.email); const signedIn = !!(me && me.signedIn && me.email);
host.innerHTML = (signedIn ? '<div class="card" style="border-color:var(--mint-line)"><p class="small" style="margin:0">You are signed in as <b>' + esc(me.username ? '@' + me.username : me.email) + '</b>. Your tickets and Marty\'s replies live in <a href="/my#help">Help in your dashboard</a>, which is the easiest place to follow up. This form works too and files the ticket under your account.</p></div>' : '') host.innerHTML = (signedIn ? '<div class="card" style="border-color:rgba(67,232,195,.45)"><p class="small" style="margin:0">You are signed in as <b>' + esc(me.username ? '@' + me.username : me.email) + '</b>. Your tickets and Marty\'s replies live in <a href="/my#help">Help in your dashboard</a>, which is the easiest place to follow up. This form works too and files the ticket under your account.</p></div>' : '')
+ '<div class="card"><form class="sup-form" id="supForm" novalidate autocomplete="on">' + '<div class="card"><form class="sup-form" id="supForm" novalidate autocomplete="on">'
+ '<input class="hp-field" type="text" name="website_url" id="supHp" tabindex="-1" aria-hidden="true" autocomplete="off">' + '<input class="hp-field" type="text" name="website_url" id="supHp" tabindex="-1" aria-hidden="true" autocomplete="off">'
+ (signedIn ? '' : '<label for="supName">Your name</label><input id="supName" maxlength="80" autocomplete="name">' + (signedIn ? '' : '<label for="supName">Your name</label><input id="supName" maxlength="80" autocomplete="name">'
@@ -172,14 +148,6 @@ window.IAPSupport = (function () {
+ '<div id="supCheck" hidden style="margin-top:12px"></div>' + '<div id="supCheck" hidden style="margin-top:12px"></div>'
+ '<div class="sup-actions"><button class="btn" type="submit" id="supSend">Send to support</button><span class="small muted" id="supMsg"></span></div>' + '<div class="sup-actions"><button class="btn" type="submit" id="supSend">Send to support</button><span class="small muted" id="supMsg"></span></div>'
+ '</form></div>'; + '</form></div>';
// hand-off from a network site's chat assistant (2026-11-15): ?from=<site id>&subject=<question> prefills the subject and names
// the site in the message, so the ticket says where it came from. Plain text only (value / textContent), never HTML.
try {
const qs = new URLSearchParams(location.search); const SITES = { viraladblitz: 'ViralAdBlitz', downlinehydra: 'DownlineHydra', fivex: '5xYourTeam', vbb: 'Viral Banner Blitz', bannerline: 'Downline Banners', stackpol: 'Stack POL' };
const from = SITES[String(qs.get('from') || '').toLowerCase()]; const subj = String(qs.get('subject') || '').replace(/[\u0000-\u001f<>]/g, ' ').trim().slice(0, 140);
if (subj) document.getElementById('supSubject').value = subj;
if (from) document.getElementById('supBody').value = 'About ' + from + ': ';
} catch (e) {}
const f = document.getElementById('supForm'); const f = document.getElementById('supForm');
f.addEventListener('submit', async e => { f.addEventListener('submit', async e => {
e.preventDefault(); e.preventDefault();
-39
View File
@@ -1,39 +0,0 @@
// "How to get fed leads" (holding tank batches, Marty 2026-11-15): the ladder and the member's own level and next step, on the
// Overview. Hidden while the tankBatches switch is off (/api/my/tank/feed answers { on:false }). Leads you can sponsor, never money.
(function () {
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
const day = t => t ? new Date(t).toLocaleString('en-US', { weekday: 'short', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', timeZone: 'America/Chicago' }) + ' CT' : '';
function mount() {
let el = document.getElementById('tankFeedCard'); if (el) return el;
el = document.createElement('div'); el.className = 'card'; el.id = 'tankFeedCard'; el.hidden = true; el.setAttribute('data-jump', 'How to get fed leads');
const notice = document.getElementById('tankNotice'); const host = notice && notice.closest('.card');
const tankCard = document.getElementById('tankCard');
if (host && host.parentNode) host.parentNode.insertBefore(el, host.nextSibling);
else if (tankCard && tankCard.parentNode) tankCard.parentNode.insertBefore(el, tankCard);
else return null;
return el;
}
function html(v) {
const me = v.me || {};
const rows = (v.ladder || []).map(r => '<li><b>' + esc(r.level) + '</b>: ' + (r.level === 'Streak' ? 'up to ' : '') + r.size + ' people at a time, with ' + esc(r.how) + '</li>').join('');
const mine = me.level
? '<p>Your level: <b>' + esc(me.label || me.level) + '</b>, ' + me.size + ' people at a time' + (me.active ? '' : ' (sign in at least once a week to receive them)') + '.'
+ (me.open ? ' You are helping ' + me.open + ' from your batches right now.' : '') + (me.nextBatchAt ? ' Next batch from ' + esc(day(me.nextBatchAt)) + '.' : '') + '</p>'
: '<p>You are not on the ladder yet.</p>';
return '<div class="card-head"><h3>How to get fed leads</h3><span class="sub">people from the holding tank you can sponsor</span></div>'
+ '<p class="small">Members who joined with no sponsor wait in the holding tank. Active members who bought their own package receive a batch of them every ' + esc(v.everyDays) + ' days, and they become your referrals to welcome and help. These are leads you can sponsor: what happens next depends on your follow-up, and nothing here is a promise of income.</p>'
+ '<ul class="small" style="margin:6px 0 8px 18px;padding:0">' + rows + '</ul>' + mine
+ (me.next ? '<p class="small"><b>Next step:</b> ' + esc(me.next) + '</p>' : '')
+ '<p class="muted small">Say hello to each new person within ' + esc(v.followDays) + ' days (a chat, or Contacted them on their row in My line). Anyone you have not contacted by then goes back to the tank for another member.</p>';
}
async function load() {
try {
const v = await (await fetch('/api/my/tank/feed', { cache: 'no-store' })).json();
const el = mount(); if (!el) return;
if (!v || !v.on) { el.hidden = true; return; }
el.innerHTML = html(v); el.hidden = false;
} catch (e) {}
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', load); else load();
setInterval(load, 600000);
})();
-51
View File
@@ -1,51 +0,0 @@
// Holding-tank readiness on the tank cards (Marty 2026-11-18, stage 1 of the tank warm-up). The server attaches `rd` to each waiting
// lead from the network hub: { entry: {reason, site, at, detail}, stage, heat: {score, band, label, trend}, last: {kind, site, at} }.
// A lead without `rd` (the hub is down) renders exactly as before. Shared by InstantAdPay and LinkSpin (same file in both).
(function () {
const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
const SITES = { iap: 'InstantAdPay', instantadpay: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', dlb: 'Downline Banners',
vbb: 'ViralBannerBlitz', vab: 'ViralAdBlitz', viraladblitz: 'ViralAdBlitz', fivex: '5xYourTeam', dh: 'DownlineHydra', downlinehydra: 'DownlineHydra', hydra: 'DownlineHydra',
ypb: 'YourProgramBuilder', yourprogrambuilder: 'YourProgramBuilder', vas: 'ViralAdSource', viraladsource: 'ViralAdSource', ctb: 'CryptoTeamBuild',
stackpol: 'Stack POL', earnerscorner: 'Earners Corner', polhunter: 'PolHunter', btc4hits: 'BTC4Hits' };
const site = s => (s ? SITES[String(s).toLowerCase()] || String(s) : '');
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const day = t => { if (!t) return ''; const d = new Date(t); return MON[d.getMonth()] + ' ' + d.getDate() + (d.getFullYear() !== new Date().getFullYear() ? ', ' + d.getFullYear() : ''); };
const month = t => { if (!t) return ''; const d = new Date(t); return MON[d.getMonth()] + ' ' + d.getFullYear(); };
const ago = t => { if (!t) return ''; const ms = Date.now() - t; if (ms < 3600e3) return Math.max(1, Math.round(ms / 60e3)) + ' min ago'; if (ms < 86400e3) return Math.round(ms / 3600e3) + 'h ago'; const d = Math.floor(ms / 86400e3); return d === 1 ? 'yesterday' : d + ' days ago'; };
const who = d => (d && d.from ? ' @' + d.from : '');
function entryText(e) {
if (!e || !e.reason || e.reason === 'unknown') return 'How they got here: unknown';
const d = e.detail || {};
switch (e.reason) {
case 'joined': {
const src = [d.via ? 'via ' + d.via : '', d.ref && d.ref !== 'direct' ? 'from ' + d.ref : d.ref === 'direct' ? 'typed in directly' : ''].filter(Boolean).join(', ');
return 'Joined ' + (site(e.site) || 'the network') + ' ' + day(e.at) + ' with no sponsor' + (src ? ' (' + src + ')' : '');
}
case 'imported': return 'Imported old member of ' + (site(d.oldSite) || 'an older network site') + (d.memberSince ? ', member since ' + month(d.memberSince) : '') + (d.lastSeenOld ? ', last seen there ' + month(d.lastSeenOld) : '') + (e.at ? ' (in the tank since ' + day(e.at) + ')' : '');
case 'rescued': return 'Moved here ' + day(e.at) + ': their sponsor' + who(d) + ' did not reach them in 14 days';
case 'released': return d.note ? 'Released ' + day(e.at) + ' by' + (who(d) || ' the member') + ' who had adopted them' : 'Released by their sponsor' + who(d) + ' ' + day(e.at);
case 'sponsor_gone': return 'Their sponsor left or was blocked (in the tank since ' + day(e.at) + ')';
case 'returned': return 'Back in the tank ' + day(e.at) + ': an adoption' + (d.from ? ' by @' + d.from : '') + ' ended before they got started';
default: return 'How they got here: unknown';
}
}
const STAGE = { new: ['New', 'Nothing yet beyond joining'], warming: ['Warming', 'Visited or clicked a tracked link'], engaged: ['Engaged', 'Signed in or replied'], activated: ['Activated', 'Wallet linked'], ready: ['Ready', 'Bought something'] };
const VERB = { signin: 'signed in', visit: 'visited', click: 'clicked a tracked link', wallet: 'linked a wallet', purchase: 'bought a package', upgrade: 'upgraded', message: 'replied to a message', share: 'shared a link' };
function lastText(l) {
if (!l) return 'no activity yet';
return (VERB[l.kind] || l.kind) + (l.site ? ' on ' + site(l.site) : '') + ', ' + ago(l.at);
}
// the block that goes under the lead's name: stage chip, heat, last action, entry reason
function html(rd) {
if (!rd) return '';
const st = STAGE[rd.stage] || STAGE.new; const h = rd.heat || { score: 0, band: 'cold', label: 'Cold' };
const tr = h.trend === 'up' ? ' &#8599;' : h.trend === 'down' ? ' &#8600;' : '';
return '<span class="rd-line"><span class="rd-stage rd-s-' + esc(rd.stage) + '" title="' + esc(st[1]) + '">' + esc(st[0]) + '</span>'
+ '<span class="rd-heat rd-' + esc(h.band) + '" title="Heat 0-100 from real actions across the network, recent ones count most. Hot 70+, Warm 40-69, Cooling 15-39, Cold under 15.">' + Number(h.score || 0) + ' &middot; ' + esc(h.label || '') + tr + '</span>'
+ '<span class="rd-last" title="Their newest real action on the network">' + esc(lastText(rd.last)) + '</span></span>'
+ '<span class="rd-entry">' + esc(entryText(rd.entry)) + '</span>';
}
const score = m => (m && m.rd && m.rd.heat ? Number(m.rd.heat.score) || 0 : -1);
window.TankReady = { html, entryText, lastText, score, stageLabel: s => (STAGE[s] || STAGE.new)[0] };
})();
+5 -8
View File
@@ -17,11 +17,9 @@
title.innerHTML = safeName; title.innerHTML = safeName;
if (hostEl) hostEl.innerHTML = safeName; if (hostEl) hostEl.innerHTML = safeName;
IAP.$('bioHead').hidden = false; IAP.$('bioHead').hidden = false;
// profile fields (avatar, bio, socials, intro video) are rendered only when the server says the member has bought (w.bought); if (w.avatarUrl) { const av = IAP.$('bioAvatar'); av.src = w.avatarUrl; av.hidden = false; }
// a free member's wall shows the name, the line's ads and the join call, nothing from the profile (2026-10-30)
if (w.bought && w.avatarUrl) { const av = IAP.$('bioAvatar'); av.src = w.avatarUrl; av.hidden = false; }
if (w.badge) { const bb = IAP.$('bioBadge'); if (bb) { bb.src = w.badge.img; bb.title = w.badge.label + ' badge'; bb.hidden = false; } } if (w.badge) { const bb = IAP.$('bioBadge'); if (bb) { bb.src = w.badge.img; bb.title = w.badge.label + ' badge'; bb.hidden = false; } }
IAP.$('bioText').textContent = (w.bought && w.bio) || 'Building a team on InstantAdPay. Join through this page and you are in my line.'; IAP.$('bioText').textContent = w.bio || 'Building a team on InstantAdPay — join through this page and you\'re in my line.';
if (w.qrUrl) IAP.$('bioQr').src = w.qrUrl; if (w.qrUrl) IAP.$('bioQr').src = w.qrUrl;
// social links // social links
const SOC = { facebook: 'Facebook', twitter: 'X', youtube: 'YouTube', instagram: 'Instagram', tiktok: 'TikTok', telegram: 'Telegram', linkedin: 'LinkedIn', website: 'Website' }; const SOC = { facebook: 'Facebook', twitter: 'X', youtube: 'YouTube', instagram: 'Instagram', tiktok: 'TikTok', telegram: 'Telegram', linkedin: 'LinkedIn', website: 'Website' };
@@ -38,15 +36,14 @@
website: svg('<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c3 3.5 3 14.5 0 18M12 3c-3 3.5-3 14.5 0 18"/>') website: svg('<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c3 3.5 3 14.5 0 18M12 3c-3 3.5-3 14.5 0 18"/>')
}; };
const sc = IAP.$('bioSocials'); const sc = IAP.$('bioSocials');
if (sc && w.bought && w.socials && typeof w.socials === 'object') { if (sc && w.socials && typeof w.socials === 'object') {
// paid placement: Google wants these marked sponsored (plus ugc), never a plain dofollow (2026-10-30)
const links = Object.keys(SOC).filter(k => w.socials[k]).map(k => const links = Object.keys(SOC).filter(k => w.socials[k]).map(k =>
'<a href="' + String(w.socials[k]).replace(/"/g, '%22') + '" target="_blank" rel="sponsored ugc noopener">' + (ICON[k] || '') + '<span>' + SOC[k] + '</span></a>'); '<a href="' + String(w.socials[k]).replace(/"/g, '%22') + '" target="_blank" rel="noopener nofollow me">' + (ICON[k] || '') + '<span>' + SOC[k] + '</span></a>');
sc.innerHTML = links.join(''); sc.innerHTML = links.join('');
} }
// intro video under the bio: YouTube / Vimeo embed, or a direct file // intro video under the bio: YouTube / Vimeo embed, or a direct file
const bv = IAP.$('bioVideo'); const bv = IAP.$('bioVideo');
const vurl = w.bought && w.socials && typeof w.socials === 'object' ? String(w.socials.video || '') : ''; const vurl = w.socials && typeof w.socials === 'object' ? String(w.socials.video || '') : '';
if (bv && vurl) { if (bv && vurl) {
let yt = /(?:youtube\.com\/(?:watch\?(?:.*&)?v=|shorts\/|embed\/)|youtu\.be\/)([A-Za-z0-9_-]{6,})/.exec(vurl); let yt = /(?:youtube\.com\/(?:watch\?(?:.*&)?v=|shorts\/|embed\/)|youtu\.be\/)([A-Za-z0-9_-]{6,})/.exec(vurl);
let vm = /vimeo\.com\/(?:video\/)?(\d+)/.exec(vurl); let vm = /vimeo\.com\/(?:video\/)?(\d+)/.exec(vurl);
-60
View File
@@ -1,60 +0,0 @@
// Network Weekend strip (Home, above the Five Dollar Friday strip) and Overview card (/my, above the Friday card), Marty 2026-11-17.
// Data: /api/promodays (promodays.js). Shown only while the weekend is live (Fri 11-27 00:00 CT to Tue 12-01 00:00 CT) and, as a
// heads-up, on Thanksgiving Thursday 11-26 Central; the page's own clock decides at the exact midnights, the server's `live` too.
// No inline styles (CSP), no native dialogs. Test clock: window.__NW_NOW (ms).
(function () {
if (window.__nwCard) return; window.__nwCard = 1;
var now = function () { return typeof window.__NW_NOW === 'number' ? window.__NW_NOW : Date.now(); };
var ctDay = function (ms) { return new Date(ms - 6 * 3600 * 1000).toISOString().slice(0, 10); };
var esc = function (s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]; }); };
var usd = function (n) { return '$' + (Number(n) % 1 ? Number(n).toFixed(2) : Number(n)); };
var hidden = function (k) { try { return localStorage.getItem('iap-hide-nw-' + k) === '1'; } catch (e) { return false; } };
var hide = function (k) { try { localStorage.setItem('iap-hide-nw-' + k, '1'); } catch (e) {} };
function dayLine(v) {
return (v.days || []).map(function (d) { return '<b>' + esc(d.name.replace(/^Network Weekend /, '')) + '</b> +' + d.pct + '% on ' + usd(d.minUsd) + '+'; }).join(' · ');
}
function state(v) {
var t = now(), s = Date.parse(v.startsAt), e = Date.parse(v.endsAt);
if (!v.on) return '';
if (t >= s && t < e) return 'live';
if (t >= s - 86400000 && t < s) return 'soon';
return '';
}
function extras(v) {
return 'Any $20+ pack also gets a 500-credit LinkSpin code' + (v.lsCode ? ' (<b>' + esc(v.lsCode) + '</b>)' : '') + ' on your purchase notice. Any $100+ pack also gets DownlineHydra Pro free, while the first ' + esc(v.builderCap) + ' comps last. Code <b>NETWORKWEEKEND</b>: 300 bonus ad credits, one per account.';
}
function paintStrip(v, st) {
var anchor = document.getElementById('fdfStrip'); if (!anchor) return;
var el = document.getElementById('nwStrip');
if (!st) { if (el) el.hidden = true; return; }
if (!el) { el = document.createElement('div'); el.className = 'fdf'; el.id = 'nwStrip'; anchor.parentNode.insertBefore(el, anchor); }
el.hidden = false;
el.innerHTML = st === 'live' && v.today
? '<b>\u{1F6CD}️ Network Weekend: it’s ' + esc(v.today.name.replace(/^Network Weekend /, '')) + '.</b> +' + v.today.pct + '% bonus ad credits on any ' + usd(v.today.minUsd) + '+ pack until midnight Central. ' + extras(v) + ' ' + esc(v.note) + ' <a href="/weekend">Every deal</a>'
: '<b>\u{1F6CD}️ Network Weekend starts at midnight Central.</b> ' + dayLine(v) + ', midnight to midnight through Cyber Monday. ' + esc(v.note) + ' <a href="/weekend">Every deal</a>';
}
function paintCard(v, st) {
var anchor = document.getElementById('fdfCard'); if (!anchor) return;
var card = document.getElementById('nwCard'); var key = st + '-' + ctDay(now());
if (!st || hidden(key)) { if (card) card.hidden = true; return; }
if (!card) { card = document.createElement('div'); card.className = 'card'; card.id = 'nwCard'; anchor.parentNode.insertBefore(card, anchor); }
card.hidden = false;
var live = st === 'live' && v.today;
card.innerHTML = '<div class="card-head"><h3>\u{1F6CD}️ ' + (live ? 'Network Weekend: ' + esc(v.today.name.replace(/^Network Weekend /, '')) : 'Network Weekend starts at midnight') + '</h3><span class="sub">'
+ (live ? '+' + v.today.pct + '% bonus ad credits on any ' + usd(v.today.minUsd) + '+ pack today' : 'Black Friday to Cyber Monday, Central') + '</span></div>'
+ '<p>' + (live && v.today.stats ? '<b>' + v.today.stats.packs + '</b> pack' + (v.today.stats.packs === 1 ? '' : 's') + ' so far today. ' : '') + dayLine(v) + ', each day midnight to midnight Central. ' + extras(v) + '</p>'
+ '<p class="muted small">' + esc(v.note) + ' Every pack pays its sponsor line in full, at the normal price.</p>'
+ '<button class="btn" type="button" id="nwBuy">' + (live ? 'Buy my weekend pack' : 'See the packages') + '</button> <a class="btn sec" href="/weekend" target="_blank" rel="noopener">Every network deal</a>';
var b = document.getElementById('nwBuy'); if (b) b.addEventListener('click', function () { var m = document.querySelector('.bo-menu [data-pane="buy"]'); if (m) m.click(); else location.href = '/my#buy'; });
var head = card.querySelector('.card-head'); var x = document.createElement('button');
x.type = 'button'; x.className = 'card-x'; x.setAttribute('aria-label', 'Hide for today'); x.textContent = '×';
x.addEventListener('click', function () { hide(key); card.hidden = true; }); head.appendChild(x);
}
var last = null;
function load() {
fetch('/api/promodays').then(function (r) { return r.ok ? r.json() : null; }).then(function (v) { if (!v) return; last = v; var st = state(v); paintStrip(v, st); paintCard(v, st); }).catch(function () {});
}
function run() { if (!document.getElementById('fdfStrip') && !document.getElementById('fdfCard')) return; load(); setInterval(load, 120000); }
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
window.__nwCardPaint = function (v) { last = v; var st = state(v); paintStrip(v, st); paintCard(v, st); return st; }; // tests
})();
-53
View File
@@ -1,53 +0,0 @@
/* /weekend, the Network Weekend deals page (Marty 2026-11-17). External file on purpose: the site's CSP blocks inline scripts.
Data: /api/promodays (InstantAdPay's own days, promodays.js) and /api/network-deals (every site's deal, from the hub).
Switches by the page's own clock at the exact Central midnights; before Thanksgiving Thursday both feeds are empty, so the page
says only that the weekend is coming. Test clock: window.__NW_NOW (ms). */
(function () {
var now = function () { return typeof window.__NW_NOW === 'number' ? window.__NW_NOW : Date.now(); };
var ctDay = function (ms) { return new Date(ms - 6 * 3600 * 1000).toISOString().slice(0, 10); };
var esc = function (s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]; }); };
var usd = function (n) { return '$' + (Number(n) % 1 ? Number(n).toFixed(2) : Number(n)); };
var label = function (k) { var p = k.split('-').map(Number); return new Date(Date.UTC(p[0], p[1] - 1, p[2], 12)).toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }); };
var stateEl = document.getElementById('nwState'), daysEl = document.getElementById('nwDays'), dealsEl = document.getElementById('nwDeals');
if (!stateEl) return;
// carry ?ref= onto the join button (the page is a member promo tool, like /friday)
try { var ref = new URLSearchParams(location.search).get('ref'); if (ref && /^[A-Za-z0-9_.-]{1,40}$/.test(ref)) document.getElementById('nwJoin').href = '/join?v=weekend&ref=' + encodeURIComponent(ref); } catch (e) {}
function renderIap(v) {
var t = now(), s = Date.parse(v.startsAt), e = Date.parse(v.endsAt), today = ctDay(t);
if (!v.on || !v.published) {
stateEl.className = 'nw-state'; stateEl.innerHTML = '<span class="nw-tag">Coming</span><span><b>Network Weekend: Black Friday to Cyber Monday.</b> The deals open here on Thanksgiving.</span>';
daysEl.innerHTML = ''; return;
}
if (t >= s && t < e) {
var d = v.today || {};
stateEl.className = 'nw-state live';
stateEl.innerHTML = '<span class="nw-tag">Live now</span><span><b>It is ' + esc((d.name || 'Network Weekend').replace(/^Network Weekend /, '')) + '.</b> +' + esc(d.pct) + '% bonus ad credits on any ' + usd(d.minUsd) + '+ InstantAdPay pack until midnight Central.</span>'
+ (d.stats ? '<span><b>' + Number(d.stats.packs || 0).toLocaleString('en-US') + '</b> pack' + (d.stats.packs === 1 ? '' : 's') + ' so far today</span>' : '');
} else if (t < s) {
var left = s - t, h = Math.floor(left / 3600000), m = Math.floor((left % 3600000) / 60000);
stateEl.className = 'nw-state'; stateEl.innerHTML = '<span class="nw-tag">Tonight</span><span><b>Network Weekend starts at midnight Central</b>, in ' + h + 'h ' + m + 'm.</span><span>Join now so your account is ready.</span>';
} else {
stateEl.className = 'nw-state'; stateEl.innerHTML = '<span class="nw-tag">Ended</span><span><b>Network Weekend is over.</b> Thank you for building with us. Five Dollar Friday is back every Friday.</span>';
}
daysEl.innerHTML = (v.days || []).map(function (x) {
return '<div class="nw-day' + (x.day === today && t >= s && t < e ? ' today' : '') + '"><div class="n">' + esc(label(x.day)) + '</div><h3>+' + esc(x.pct) + '% on ' + usd(x.minUsd) + '+</h3><p>' + esc(x.name) + ': bonus ad credits on any InstantAdPay pack of ' + usd(x.minUsd) + ' or more, midnight to midnight Central.</p></div>';
}).join('');
}
function renderDeals(b) {
var t = now(), today = ctDay(t);
var ev = ((b && b.events) || []).filter(function (e) { return t >= Date.parse(e.startsAt) - 86400000 && t < Date.parse(e.endsAt); })[0];
if (!ev) { if (!((b && b.events) || []).length) return; dealsEl.innerHTML = '<p class="muted">Network Weekend has ended.</p>'; return; }
var deals = (ev.deals || []).filter(function (d) { return t < Date.parse(d.endsAt || ev.endsAt); });
dealsEl.innerHTML = deals.map(function (d) {
var text = (d.byDay && d.byDay[today]) || d.text;
return '<div class="nw-deal"><h3>' + esc(d.name) + '</h3><p>' + esc(text) + '</p>' + (d.note ? '<p class="note">' + esc(d.note) + '</p>' : '')
+ (d.url ? '<a class="go" href="' + esc(d.url) + '"' + (/instantadpay\.com/.test(d.url) ? '' : ' target="_blank" rel="noopener"') + '>' + (/instantadpay\.com\/weekend/.test(d.url) ? 'Buy on InstantAdPay' : 'Open ' + esc(d.name)) + '</a>' : '') + '</div>';
}).join('');
dealsEl.querySelectorAll('a.go').forEach(function (a) { if (/instantadpay\.com\/weekend/.test(a.href)) a.href = '/my#buy'; });
}
function load() {
fetch('/api/promodays').then(function (r) { return r.ok ? r.json() : null; }).then(function (v) { if (v) renderIap(v); }).catch(function () {});
fetch('/api/network-deals').then(function (r) { return r.ok ? r.json() : null; }).then(renderDeals).catch(function () {});
}
load(); setInterval(load, 60000);
})();
+13 -15
View File
@@ -26,15 +26,13 @@
function fridayLine(f) { function fridayLine(f) {
if (!f || !f.on) return null; if (!f || !f.on) return null;
if (f.live) return { tag: 'TODAY', text: 'It is ' + (f.name || 'Five Dollar Friday') + ' right now. Every package of $5 or more gets <b>' + (f.pct || 20) + '% bonus credits</b>, automatically, until midnight Central.' }; // Black Friday 2026: +40% (promodays.js) if (f.live) return { tag: 'TODAY', text: 'It is Five Dollar Friday right now. Every package of $5 or more gets <b>20% bonus credits</b>, automatically, until midnight Central.' };
if (f.nextLabel) return { tag: f.nextLabel, text: (f.name || 'Five Dollar Friday') + ': any package of $5 or more gets <b>' + (f.pct || 20) + '% bonus credits</b>, automatically. No code, nothing to claim.' }; if (f.nextLabel) return { tag: f.nextLabel, text: 'Five Dollar Friday: any package of $5 or more gets <b>' + (f.pct || 20) + '% bonus credits</b>, automatically. No code, nothing to claim.' };
return null; return null;
} }
function show(f) { function show(f) {
if (document.querySelector('.iap-welcome')) return; if (document.querySelector('.iap-welcome')) return;
// the login ad has the screen (2026-11-15: it now shows on any dashboard load): wait until it closes, never on top of it
var lg = document.getElementById('loginGate'); if (lg && !lg.hidden) { setTimeout(function () { show(f); }, 1000); return; }
var fri = fridayLine(f); var fri = fridayLine(f);
var back = document.createElement('div'); var back = document.createElement('div');
@@ -47,32 +45,32 @@
'-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);'; '-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);';
var card = document.createElement('div'); var card = document.createElement('div');
card.style.cssText = 'position:relative;width:100%;max-width:470px;background:var(--panel-solid);color:var(--ink);' + card.style.cssText = 'position:relative;width:100%;max-width:470px;background:#0b1512;color:#eef7f3;' +
'border:1px solid var(--mint-line);border-radius:18px;padding:26px 24px 22px;' + 'border:1px solid rgba(67,232,195,.28);border-radius:18px;padding:26px 24px 22px;' +
'box-shadow:0 26px 70px rgba(0,0,0,.6);font-size:15px;line-height:1.55;'; 'box-shadow:0 26px 70px rgba(0,0,0,.6);font-size:15px;line-height:1.55;';
var html = var html =
'<button type="button" class="iap-w-x" aria-label="Close" style="position:absolute;top:10px;right:12px;' + '<button type="button" class="iap-w-x" aria-label="Close" style="position:absolute;top:10px;right:12px;' +
'background:none;border:0;color:var(--muted);font-size:26px;line-height:1;cursor:pointer;padding:4px 8px;">&times;</button>' + 'background:none;border:0;color:#8ba69c;font-size:26px;line-height:1;cursor:pointer;padding:4px 8px;">&times;</button>' +
'<div style="letter-spacing:2px;text-transform:uppercase;font-size:11px;font-weight:700;color:var(--mint);">InstantAdPay</div>' + '<div style="letter-spacing:2px;text-transform:uppercase;font-size:11px;font-weight:700;color:#43e8c3;">InstantAdPay</div>' +
'<h2 style="margin:8px 0 12px;font-size:25px;line-height:1.25;color:var(--ink);">The ad spend in your line pays you, in the same transaction.</h2>' + '<h2 style="margin:8px 0 12px;font-size:25px;line-height:1.25;color:#fff;">The ad spend in your line pays you, in the same transaction.</h2>' +
'<p style="margin:0 0 14px;color:var(--ink);">You buy advertising you were going to buy anyway. When someone in your line buys a package, the contract splits it and your share lands in your wallet before the page reloads. No back office, no payday to wait for.</p>' + '<p style="margin:0 0 14px;color:#c8d6e2;">You buy advertising you were going to buy anyway. When someone in your line buys a package, the contract splits it and your share lands in your wallet before the page reloads. No back office, no payday to wait for.</p>' +
'<ul style="margin:0 0 16px;padding-left:18px;color:var(--ink);">' + '<ul style="margin:0 0 16px;padding-left:18px;color:#c8d6e2;">' +
'<li style="margin-bottom:5px;">Every payout is on the public ledger, and you can read it yourself.</li>' + '<li style="margin-bottom:5px;">Every payout is on the public ledger, and you can read it yourself.</li>' +
'<li style="margin-bottom:5px;">Free members earn ad credits by viewing ads, videos and visits.</li>' + '<li style="margin-bottom:5px;">Free members earn ad credits by viewing ads, videos and visits.</li>' +
'<li>Credits buy your own advertising. They are delivery, not a balance to hoard.</li>' + '<li>Credits buy your own advertising. They are delivery, not a balance to hoard.</li>' +
'</ul>'; '</ul>';
if (fri) { if (fri) {
html += '<div style="margin:0 0 16px;padding:12px 14px;border:1px solid var(--amber-line);' + html += '<div style="margin:0 0 16px;padding:12px 14px;border:1px solid rgba(255,178,56,.38);' +
'background:var(--amber-soft);border-radius:12px;color:var(--ink);">' + 'background:rgba(255,178,56,.08);border-radius:12px;color:#eef7f3;">' +
'<div style="font-weight:800;color:var(--amber);font-size:12px;letter-spacing:1.4px;text-transform:uppercase;margin-bottom:4px;">' + fri.tag + '</div>' + '<div style="font-weight:800;color:#ffb238;font-size:12px;letter-spacing:1.4px;text-transform:uppercase;margin-bottom:4px;">' + fri.tag + '</div>' +
'<div>' + fri.text + '</div></div>'; '<div>' + fri.text + '</div></div>';
} }
html += '<div style="display:flex;gap:9px;flex-wrap:wrap;">' + html += '<div style="display:flex;gap:9px;flex-wrap:wrap;">' +
'<a class="iap-w-go" href="/my#buy" style="flex:1 1 auto;text-align:center;text-decoration:none;background:linear-gradient(180deg,#5ff0cf,#43e8c3);color:#04120e;font-weight:800;padding:12px 16px;border-radius:11px;">See the packages</a>' + '<a class="iap-w-go" href="/my#buy" style="flex:1 1 auto;text-align:center;text-decoration:none;background:linear-gradient(180deg,#5ff0cf,#43e8c3);color:#04120e;font-weight:800;padding:12px 16px;border-radius:11px;">See the packages</a>' +
'<a class="iap-w-go" href="/ledger" style="flex:0 1 auto;text-align:center;text-decoration:none;border:1px solid var(--mint-line-2);color:var(--mint);font-weight:700;padding:12px 16px;border-radius:11px;">Live ledger</a>' + '<a class="iap-w-go" href="/ledger" style="flex:0 1 auto;text-align:center;text-decoration:none;border:1px solid rgba(67,232,195,.4);color:#43e8c3;font-weight:700;padding:12px 16px;border-radius:11px;">Live ledger</a>' +
'</div>'; '</div>';
card.innerHTML = html; card.innerHTML = html;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

-171
View File
@@ -1,171 +0,0 @@
<!doctype html>
<html lang="en" data-theme-base="dark">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>BixPay: a Visa card for your POL | InstantAdPay</title>
<meta name="description" content="How InstantAdPay members spend their POL with a BixPay Visa card: what BixPay is, the 3% fee, how to turn POL into USDT or USDC and load the card on Polygon, the sign-up steps with screenshots, how the BixPay partner plan pays ten levels deep, and what to know before you start.">
<meta name="theme-color" content="#043b2f">
<link rel="canonical" href="https://instantadpay.com/bixpay">
<meta property="og:type" content="website"><meta property="og:site_name" content="InstantAdPay">
<meta property="og:title" content="BixPay: a Visa card for your POL">
<meta property="og:description" content="A self-custody wallet with a Visa card. Send USDT or USDC to it on Polygon, load the card, and spend it wherever Visa is accepted, including Apple Pay and Google Pay. Virtual cards from $9.99. 3% per purchase, no load fee.">
<meta property="og:url" content="https://instantadpay.com/bixpay">
<meta name="twitter:card" content="summary">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln">
<style>
.rg{max-width:900px}
.rg .hero{padding:44px 0 10px}
.rg h2{font-size:26px;margin:38px 0 6px}
.rg h3{font-size:17px;margin:0 0 6px}
.rg-eye{font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--amber);font-weight:700;margin:38px 0 0}
.rg-eye + h2{margin-top:6px}
.rg-cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:6px 0 10px}
.rg-cta .btn.big{font-size:17px;padding:14px 22px}
.rg-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:14px;margin:14px 0 0}
.rg-box{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:var(--ink-faint);min-width:0}
.rg-box p{margin:0;font-size:14.5px;color:var(--muted)}
.rg-box p + p{margin-top:8px}
.rg-note{font-size:14.5px;color:var(--muted);margin:8px 0 0}
.rg-route{list-style:none;counter-reset:s;margin:12px 0 0;padding:0;display:grid;gap:14px}
.rg-route > li{counter-increment:s;display:grid;grid-template-columns:42px minmax(0,1fr);gap:14px;align-items:start;border:1px solid var(--line);border-radius:14px;padding:14px 16px;background:var(--ink-faint);min-width:0}
.rg-route > li::before{content:counter(s);font-family:var(--disp);font-weight:800;font-size:20px;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:var(--amber);color:var(--amber-ink)}
.rg-route > li > div{min-width:0}
.rg-route p{margin:0 0 8px;font-size:14.5px;color:var(--muted)}
.rg-tbl{border:1px solid var(--line);border-radius:14px;overflow:hidden;margin:10px 0 8px}
.rg-tbl table{width:100%;border-collapse:collapse;font-size:14.5px;table-layout:fixed}
.rg-tbl th,.rg-tbl td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}
.rg-tbl th{font-family:var(--mono);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600}
.rg-tbl td:first-child{width:38%;font-weight:700}
.rg-tbl tr:last-child td{border-bottom:0}
.rg-faq{display:grid;gap:14px;margin:12px 0 0}
.rg-faq dt{font-family:var(--disp);font-weight:700}
.rg-faq dd{margin:4px 0 0;color:var(--muted);font-size:14.5px}
.rg-rule{border-left:4px solid var(--mint);background:var(--mint-soft);padding:14px 18px;border-radius:0 12px 12px 0;margin:30px 0 22px;font-size:14.5px}
.rg-warn{border-left:4px solid var(--amber);background:var(--amber-soft);padding:12px 16px;border-radius:0 12px 12px 0;margin:12px 0 0;font-size:14.5px}
.rg code.i{font-family:var(--mono);font-size:13px;color:var(--mint);background:var(--mint-soft);padding:1px 5px;border-radius:4px;overflow-wrap:anywhere}
/* phone screenshots: a row of app screens, each captioned; stacked on a phone */
.bx-shots{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:14px;margin:14px 0 0}
.bx-shot{min-width:0;text-align:center}
.bx-shot img{width:100%;max-width:240px;height:auto;border-radius:18px;border:1px solid var(--line-strong);background:#000;display:block;margin:0 auto}
.bx-shot figcaption{font-size:13px;color:var(--muted);margin:8px 0 0;line-height:1.45}
.bx-using{font-size:13.5px;color:var(--muted);margin:0}
.bx-flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;margin:12px 0 0}
.bx-flow div{border:1px solid var(--line-strong);border-radius:12px;padding:12px 13px;background:var(--ink-faint);font-size:13.5px;color:var(--muted);line-height:1.45}
.bx-flow b{display:block;font-family:var(--disp);color:var(--ink);margin-bottom:4px}
@media (max-width:640px){.rg .hero h1{font-size:30px}.rg-box{padding:14px}.rg-route > li{grid-template-columns:34px minmax(0,1fr);gap:10px;padding:12px}.rg-route > li::before{width:34px;height:34px;font-size:17px}}
</style>
</head>
<body>
<div class="wrap rg">
<section class="hero">
<p class="eyebrow">For InstantAdPay members · BixPay is a separate company</p>
<h1>Spend your POL anywhere with a <em>BixPay Visa card</em>.</h1>
<p class="lead">BixPay is a self-custody wallet with a Visa card. Send USDT or USDC to it on Polygon, load the card, and spend it wherever Visa is accepted, including Apple Pay and Google Pay. Virtual cards from $9.99. 3% per purchase, no load fee. See BIX's terms for other charges.</p>
</section>
<div class="rg-cta">
<a class="btn big" id="bixCta" href="/my#wallet" target="_blank" rel="noopener">Get your BixPay card</a>
<a class="btn sec" href="/join">Not a member yet? Join free by email</a>
</div>
<p class="bx-using" id="bixUsing">The button opens a BixPay partner sign-up link.</p>
<p class="rg-note" id="bixSignupNote"><b>Sign up on the page the button opens.</b> Don’t install the BIX app first and don’t use the portal’s own Sign Up menu: your sponsor is lost and BIX shows the referrer as N/A.</p>
<div class="rg-note" id="bixInApp" hidden style="border:1px solid var(--amber-line);background:var(--amber-soft);border-radius:10px;padding:10px 12px"><b>You’re in an app’s built-in browser.</b> BIX’s security check often fails here and your sponsor gets dropped. Open this page in Chrome or Safari first (menu > Open in browser), or copy the sign-up link and paste it there: <span id="bixInAppLink" style="word-break:break-all;font-family:ui-monospace,monospace;font-size:12px"></span> <button type="button" class="btn small sec" id="bixInAppCopy" style="margin-left:6px">Copy link</button></div>
<p class="rg-note" id="bixSoon" hidden>The BixPay card is not switched on for InstantAdPay members yet. Check back soon.</p>
<p class="rg-note">Available in 31 US states so far. Not in your state yet? You can still get the wallet and build. Elsewhere, availability varies by country.</p>
<p class="rg-eye">What it is</p>
<h2>A wallet you hold, a card you can actually use</h2>
<div class="rg-two">
<div class="rg-box"><h3>Self-custody</h3><p>The BIX app is a wallet where the keys stay with you. It is not an exchange account. You hold the USDT or USDC that backs your card.</p></div>
<div class="rg-box"><h3>A Visa card on top</h3><p>Create a virtual card in the app for $9.99 and it works wherever Visa is accepted, online and in stores through Apple Pay and Google Pay. Plastic, metal and gold cards cost more.</p></div>
<div class="rg-box"><h3>Loads on Polygon</h3><p>Your InstantAdPay payouts land as POL on Polygon. Turn them into USDT or USDC, send that to your BixPay wallet on Polygon, and top up the card. No bridge, no bank wait.</p></div>
<div class="rg-box"><h3>What it costs</h3><p>3% per purchase, no load fee. Other charges, limits and eligibility are set by BIX; read BIX's terms before you start. We quote only the fee we can stand behind.</p></div>
</div>
<p class="rg-eye">Why we added it</p>
<h2>How BixPay pays you, in plain words</h2>
<p class="rg-note">BixPay runs a partner plan on top of the card, and InstantAdPay members plug into it with one link. Nothing here is paid by InstantAdPay: BIX tracks and pays its partners in the BIX portal, and InstantAdPay earns a referral commission when someone signs up through a partner link. Here is the plan as BIX describes it.</p>
<div class="rg-tbl">
<table>
<thead><tr><th>Piece</th><th>What BIX says it does</th></tr></thead>
<tbody>
<tr><td>The fee</td><td>3% of each card purchase. That is the only fee we quote; BIX's terms cover the rest.</td></tr>
<tr><td>What goes into the plan</td><td>Half of the purchase fees and half of card sales (the $9.99 virtual card and the others) go to partners.</td></tr>
<tr><td>Ten levels</td><td>Level 1 gets 15% of the fee, level 2 gets 10%, and levels 3 to 10 get 2.5% each.</td></tr>
<tr><td>The pool</td><td>The remaining 5% goes into a pool shared by partners with large networks, on BIX's own rules.</td></tr>
<tr><td>Card sales count too</td><td>A card bought by someone in your BixPay network pays the same way as spending does.</td></tr>
</tbody>
</table>
</div>
<div class="rg-box" style="margin-top:12px"><h3>A hypothetical, not a typical result</h3><p>If someone in your BixPay network spends $1,000 on their card in a month, the fee on that is $30. BIX says it pays the level-1 partner 15% of that fee ($4.50), the level-2 partner 10% ($3.00) and each of levels 3 to 10 a quarter of one percent of the spend ($0.75 each). That is arithmetic on BIX's published percentages, not a prediction. What anyone earns depends on how many people in their network get and use a card, and on BIX paying as described. Nobody at InstantAdPay promises any amount.</p></div>
<p class="rg-eye">Who gets the credit</p>
<h2>One link, and your sponsor follows</h2>
<div class="bx-flow">
<div><b>Your own link</b>Save your BixPay partner link in Members &gt; Profile &gt; BixPay card. Every BixPay button on your pages, your promo kit and the line in your payout emails then carry it.</div>
<div><b>Else, your sponsor's</b>Until you add yours, your pages carry the link of the first sponsor up your line (up to ten levels) who has one. Every card says so: "Using: @name's link".</div>
<div><b>Else, the network's</b>If nobody up the line has one yet, the network link is used. Add yours and the credit is yours from then on.</div>
</div>
<p class="rg-note">Sign-ups and commissions are counted inside the BIX portal, where each partner sees their directs and levels. InstantAdPay only counts the clicks on its own buttons, so you can see which page or post is working.</p>
<p class="rg-eye">Get the card</p>
<h2>Sign up as a partner, then create the card</h2>
<ol class="rg-route">
<li><div><h3>Open a partner link</h3><p>Tap <b>Get your BixPay card</b> above (or on your Wallet tab). It opens a BixPay <b>partner</b> sign-up, not the plain card-customer one, so the referral plan comes with the card. <b>Register on that page.</b> If you opened this from Gmail or Telegram, open it in Chrome or Safari first; don’t install the app first and don’t use the portal’s own Sign Up menu, or your sponsor is lost (BIX then shows the referrer as N/A, and only BIX support can fix it).</p></div></li>
<li><div><h3>Create your BIX portal account</h3><p>Register on the page that opens (bix.ibportal.io). This is your partner back office: it shows your directs and levels and, under Profile, your own two links. The second one, labelled <b>Partner</b>, is the one you will paste into InstantAdPay later.</p></div></li>
<li><div><h3>Download the BIX app and create your wallet</h3><p>Install BixPay from your phone's app store and create the wallet in the app. Write the recovery phrase down and keep it offline: self-custody means nobody can reset it for you.</p></div></li>
<li><div><h3>Link the app to your portal</h3><p>In the app open <b>Settings &gt; Scan QR</b> and scan the QR code shown in your portal profile. That ties the wallet and card to your partner account so your activity counts.</p></div></li>
<li><div><h3>Create your card</h3><p>In the app, <b>Cards &gt; Create Card</b>. The virtual Visa is $9.99 and is ready as soon as you have passed BIX's identity check (KYC). Add it to Apple Pay or Google Pay from the card screen.</p></div></li>
</ol>
<div class="bx-shots">
<figure class="bx-shot"><img src="/assets/bixpay/bix-cards.webp" width="540" height="1115" alt="The BIX app Cards screen: a virtual Visa card with TOPUP, CARD INFO and MANAGE buttons and recent purchases at Walmart, Raceway and Pizza Hut" loading="lazy"><figcaption>The Cards screen after a few purchases. Balances and card numbers are hidden in this screenshot.</figcaption></figure>
</div>
<p class="rg-eye">Funding your card</p>
<h2>From POL to a card you can swipe</h2>
<p class="rg-note">The card spends USDT or USDC, so the one extra step is turning POL into one of those. Three ways:</p>
<ol class="rg-route">
<li><div><h3>Swap on an exchange, then send on Polygon</h3><p>Swap your POL for USDT or USDC on any exchange or on-ramp you already use. Then in the BIX app open <b>Wallet &gt; Receive</b>, pick USDT or USDC, choose the <b>Polygon</b> network and send to that address. A minute later it shows in the wallet's Cash tab; tap <b>TOPUP</b> on your card to load it.</p><p class="rg-warn" style="margin:0">Pick Polygon on both ends. Sending on another network to a Polygon address can lose the funds, and nobody can reverse it.</p></div></li>
<li><div><h3>Cash App (US)</h3><p>If you use Cash App, it can send crypto straight to your BixPay wallet. Handy for topping up from dollars without an exchange account. Cash App sets its own limits.</p></div></li>
<li><div><h3>The in-app swap, once BIX ships it</h3><p>BIX has said a swap inside the app is coming. The wallet already receives POL ("MATIC (migrated to POL)" in the Receive list), so once the swap is live you will be able to send POL straight in and swap there. We will update this page when it ships; until then use one of the two paths above.</p></div></li>
</ol>
<div class="bx-shots">
<figure class="bx-shot"><img src="/assets/bixpay/bix-receive.webp" width="540" height="1115" alt="The BIX app Receive screen listing USDT, USDC, Ethereum, SOL, BNB, MATIC (migrated to POL), TRON, Avalanche and Optimism" loading="lazy"><figcaption>Wallet &gt; Receive: pick USDT or USDC, then the Polygon network.</figcaption></figure>
<figure class="bx-shot"><img src="/assets/bixpay/bix-wallet.webp" width="540" height="1115" alt="The BIX app Wallet screen, Cash tab, showing USDT and a list of Received and Sent transactions" loading="lazy"><figcaption>Cash tab: each Received is a deposit to the wallet, each Sent right after it is the top-up to the card. Amounts hidden.</figcaption></figure>
</div>
<p class="rg-eye">If something goes wrong</p>
<h2>Disputes and protection</h2>
<div class="rg-two">
<div class="rg-box"><h3>Disputing a charge</h3><p>Every transaction in the app shows the merchant, the date, the category code and a <b>Dispute support</b> box. BIX accepts a dispute for 120 days after a transaction posts, and says a dispute can take 30 to 60 business days.</p></div>
<div class="rg-box"><h3>What InstantAdPay can and cannot do</h3><p>We can help you find your partner link, explain the steps and point you to the right screen. We cannot see your BixPay wallet, your card or your balance, and we cannot file a dispute for you. Card problems go to BIX support inside the app.</p></div>
</div>
<div class="bx-shots">
<figure class="bx-shot"><img src="/assets/bixpay/bix-dispute.webp" width="540" height="1115" alt="The BIX app Transaction Details screen for a Walmart purchase with the Dispute support note at the bottom" loading="lazy"><figcaption>Transaction details with the dispute window. Amount, location and card number hidden.</figcaption></figure>
</div>
<p class="rg-eye">Quick answers</p>
<h2>Questions members ask</h2>
<dl class="rg-faq">
<div><dt>Do I have to be a partner to get the card?</dt><dd>Our buttons open a partner link, so you register as a partner and get the card through the same app. There is no extra cost to being a partner; it just means card sign-ups through your own link are credited to you.</dd></div>
<div><dt>Where do I put my partner link on InstantAdPay?</dt><dd>Members &gt; Profile &gt; BixPay card. Copy the <b>Partner</b> link from your BIX portal profile (the second box). The field refuses the first box's referral link (it ends in appId=3) because that one only makes a card customer.</dd></div>
<div><dt>Can I send POL straight to the card?</dt><dd>Not yet. Turn it into USDT or USDC first (any exchange, or Cash App in the US), then send on Polygon. When BIX ships its in-app swap we will add that path here.</dd></div>
<div><dt>Is my money safe there?</dt><dd>It is a self-custody wallet, so it is as safe as your recovery phrase. Keep the phrase offline and never type it into a website. And remember that USDT, USDC and POL are crypto assets: they can lose value.</dd></div>
<div><dt>What does InstantAdPay get out of it?</dt><dd>A referral commission from BIX when someone signs up through a partner link, the same plan every partner is on. We are not the card issuer and we do not hold any of your funds.</dd></div>
<div><dt>Can I share this page with my own link?</dt><dd>Yes. Members &gt; Promo tools &gt; BixPay has your link, three posts, an email swipe and four banners, plus a click count. Promo tools &gt; Viral links turns this page into <code class="i">instantadpay.com/bixpay?ref=yourname</code>, and the button on it then carries your link.</dd></div>
</dl>
<div class="rg-rule"><b>Compliance.</b> BixPay is a separate company. BIX issues the wallet and the card through its banking partners and sets its own fees, limits, eligibility and terms. InstantAdPay is not the card issuer and earns a referral commission when you sign up through a partner link. Card availability varies by country. Crypto assets can lose value.</div>
<p class="muted small" style="margin-top:10px">The partner plan figures on this page are BIX's published percentages as of October 2026 and can change at BIX's discretion. Any example is arithmetic, not a prediction; no income is guaranteed or implied, and any commission depends on real card sign-ups and spending in your network. InstantAdPay sells advertising; it is not an investment product and does not hold customer funds.</p>
<footer>
<div>InstantAdPay · <a href="/">Home</a> · <a href="/wallets">Wallet guide</a> · <a href="/earning">How earning works</a> · <a href="/my#wallet">Your Wallet tab</a></div>
<div class="small">InstantAdPay is the Polygon hub of the <a href="https://cryptoteambuild.com" target="_blank" rel="noopener">Crypto Team Build Network</a>.</div>
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer>
</div>
<script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/bixpay-guide.js?v=20261029bz"></script>
</body>
</html>
-208
View File
@@ -1,208 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title>Chasing Unicorns: spot the scam before it spots you</title>
<meta name="description" content="A fake earnings dashboard with a ticking balance, a countdown and people cashing out every few seconds. Click anything and see the red flag behind it. A free training simulation from InstantAdPay.">
<meta property="og:type" content="website">
<meta property="og:title" content="Chasing Unicorns: can you spot all 8 red flags?">
<meta property="og:description" content="A fake earnings dashboard that looks like the real thing. Click anything on it and see the red flag behind it. Free, takes two minutes.">
<meta property="og:url" content="https://instantadpay.com/chasing-unicorns">
<meta property="og:image" content="https://instantadpay.com/assets/chasing-unicorns-og.png?v=20261112">
<meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<link rel="canonical" href="https://instantadpay.com/chasing-unicorns">
<link rel="icon" href="/favicon.ico">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@400;600;800&family=JetBrains+Mono:wght@500;700&display=swap">
<style>
/* Layout: an honest frame (training bar, scam radar, the ending) wrapped around a deliberately over-the-top fake console. Single dark look. */
:root {
--bg: #090a12; --panel: #121527; --panel2: #191d35; --line: #262c4d; --ink: #f1f2fb; --muted: #969cbf;
--uni: #c084fc; --uni2: #f472b6; --gold: #f8cf4f; --mint: #34e3a0; --warn: #ff5d6c; --warn-ink: #fff; --ok: #34e3a0;
--display: 'Sora', 'Segoe UI', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--display); font-size: 15px; line-height: 1.5; }
a { color: var(--mint); }
button { font-family: var(--display); cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.sim { position: sticky; top: 0; z-index: 30; background: #1b1030; border-bottom: 1px solid #3b2463; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; font-size: 13px; }
.sim b { color: var(--uni); }
.radar { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; }
.radar .dots { display: flex; gap: 4px; }
.radar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #3b3460; display: block; }
.radar .dots i.on { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.wrap { max-width: 1000px; margin: 0 auto; padding-block: 22px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 16px; }
.intro { display: grid; gap: 6px; }
.intro h1 { margin: 0; font-size: clamp(24px, 4.4vw, 38px); line-height: 1.15; text-wrap: balance; }
.intro h1 span { background: linear-gradient(90deg, var(--uni), var(--uni2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro p { margin: 0; color: var(--muted); max-width: 66ch; }
/* the fake console */
.console { border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(140% 120% at 0% 0%, #22184a 0%, var(--panel) 50%); padding: 18px; display: grid; gap: 14px; }
.ctop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.brand svg { width: 28px; height: 28px; }
.brand em { font-style: normal; background: linear-gradient(90deg, var(--uni), var(--uni2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tier { font-family: var(--mono); font-size: 12px; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 3px 11px; }
.bal { display: grid; gap: 4px; }
.lbl { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.big { font-family: var(--mono); font-weight: 700; font-size: clamp(30px, 7vw, 60px); color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.05; word-break: break-all; text-shadow: 0 0 26px rgba(248, 207, 79, .35); }
.rate { font-family: var(--mono); color: var(--mint); font-size: 14px; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.tile { background: rgba(9, 10, 18, .55); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; min-width: 0; text-align: left; color: var(--ink); }
.tile .v { font-family: var(--mono); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; color: var(--mint); }
.tile .s { font-size: 12px; color: var(--muted); }
button.tile { cursor: pointer; }
.timer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; background: linear-gradient(90deg, #3b0d1c, #1e0b16); border: 1px solid var(--warn); border-radius: 14px; padding: 12px 14px; }
.timer .m { font-weight: 800; min-width: 0; }
.timer .m small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.clock { font-family: var(--mono); font-weight: 700; font-size: 28px; color: var(--warn); font-variant-numeric: tabular-nums; }
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.act { border: 0; border-radius: 13px; padding: 13px 14px; font-weight: 800; font-size: 15px; text-align: left; display: grid; gap: 2px; color: #170f00; background: linear-gradient(180deg, #ffe07a, var(--gold)); }
.act small { font-weight: 600; font-size: 12px; opacity: .75; }
.act.alt { background: var(--panel2); color: var(--ink); border: 1px solid var(--uni); }
.act.alt small { color: var(--muted); opacity: 1; }
.act.hot { background: linear-gradient(180deg, #ff8fa0, var(--warn)); color: #fff; }
.act.done, .tile.done { outline: 2px solid var(--warn); outline-offset: -2px; }
/* fake social proof */
.proof { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(330px, calc(100vw - 32px)); background: #fff; color: #11131d; border-radius: 12px; padding: 11px 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; transform: translateY(150%); opacity: 0; transition: transform .35s ease, opacity .35s ease; z-index: 25; border: 0; text-align: left; font-family: var(--display); }
.proof.on { transform: none; opacity: 1; }
.proof .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--uni), var(--uni2)); color: #fff; display: grid; place-items: center; font-weight: 800; grid-row: span 2; }
.proof .t { font-size: 13.5px; line-height: 1.35; }
.proof .t b { color: #0a8f55; }
.proof .f { font-size: 11px; color: #6b6f85; }
/* the reveal */
.veil { position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 12, .78); display: grid; place-items: center; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 16px; }
.card { background: var(--panel); border: 1px solid var(--warn); border-radius: 18px; max-width: 560px; width: 100%; padding: 20px; display: grid; gap: 10px; max-height: calc(100vh - 32px); overflow: auto; }
.card .k { font-family: var(--mono); font-size: 12px; color: var(--warn); letter-spacing: .1em; text-transform: uppercase; }
.card h2 { margin: 0; font-size: 22px; line-height: 1.25; text-wrap: balance; }
.card p { margin: 0; }
.card .tell { background: rgba(255, 93, 108, .08); border-left: 3px solid var(--warn); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.card .do { background: rgba(52, 227, 160, .08); border-left: 3px solid var(--ok); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.card .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.btn { border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 800; font-size: 14.5px; text-decoration: none; display: inline-block; }
.btn.go { background: var(--mint); color: #04130d; }
.btn.sec { background: transparent; color: var(--ink); border: 1px solid var(--line); }
/* the ending */
.end { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); padding: 22px 18px; }
.end h2 { margin: 0; font-size: clamp(22px, 3.6vw, 30px); text-wrap: balance; }
.end p { margin: 0; max-width: 68ch; }
.flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.flags li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; display: grid; gap: 2px; background: var(--panel2); }
.flags li b { font-size: 14px; }
.flags li.on { border-color: var(--warn); }
.flags li.on b::before { content: "SPOTTED "; color: var(--warn); font-family: var(--mono); font-size: 11px; }
.flags li:not(.on) { opacity: .6; }
.vs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.vs > div { border-radius: 14px; padding: 14px; display: grid; gap: 6px; align-content: start; }
.vs .bad { background: rgba(255, 93, 108, .07); border: 1px solid rgba(255, 93, 108, .4); }
.vs .good { background: rgba(52, 227, 160, .07); border: 1px solid rgba(52, 227, 160, .4); }
.vs h3 { margin: 0; font-size: 16px; }
.vs ul { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.agit { display: grid; gap: 10px; border: 1px solid rgba(255, 93, 108, .45); background: linear-gradient(180deg, rgba(255, 93, 108, .08), transparent); border-radius: 16px; padding: 16px; }
.agit ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; max-width: 70ch; }
.agit li b { color: var(--warn); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fine { font-size: 12.5px; color: var(--muted); }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share code { font-family: var(--mono); font-size: 12.5px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; word-break: break-all; }
.foot { font-size: 12px; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: reduce) { .proof { transition: none; } .big { text-shadow: none; } }
</style>
</head>
<body>
<div class="sim" role="note"><span><b>Training simulation.</b> Nothing on this dashboard is real. Click anything to see the red flag behind it.</span>
<span class="radar" aria-label="Red flags spotted">Scam radar <span class="dots" id="dots"></span> <span id="score">0 of 8</span></span></div>
<main class="wrap">
<div class="intro">
<h1>Still waiting on a payout? <span>Let's go chasing unicorns.</span></h1>
<p>You signed up, you watched the balance grow, you maybe even brought a friend. Then you hit Withdraw, and you are still waiting. Below is the kind of dashboard those sites show you: a balance that never stops climbing, a countdown, people cashing out every few seconds. It looks great. That is the point. Click anything on it, the way you would on the real thing, and see what is really going on.</p>
</div>
<section class="console" aria-label="Fake earnings dashboard">
<div class="ctop">
<div class="brand"><svg viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="ug" x1="0" x2="1"><stop offset="0" stop-color="#c084fc"/><stop offset="1" stop-color="#f472b6"/></linearGradient></defs><path d="M6 26c2-7 6-11 11-12l3-9 2 8c3 1 5 4 5 7-2 0-4-1-5-2-1 4-4 7-9 8H6z" fill="url(#ug)"/></svg>Unicorn<em>Yield</em> Pro</div>
<button type="button" class="tier" data-flag="vip">VIP DIAMOND · Upgrade</button>
</div>
<div class="bal">
<div class="lbl">Your balance</div>
<div class="big" id="bal">$25,000.00</div>
<div class="rate" id="rate">+3.00% daily compound interest · +$0.00 since you opened this page</div>
</div>
<div class="tiles">
<button type="button" class="tile" data-flag="daily"><span class="lbl">Interest today</span><span class="v" id="today">$0.00</span><span class="s">Fixed 3% a day, guaranteed</span></button>
<button type="button" class="tile" data-flag="team"><span class="lbl">Team bonus</span><span class="v" id="team">$1,240.00</span><span class="s">12 people under you</span></button>
<button type="button" class="tile" data-flag="coin"><span class="lbl">UYP token holdings</span><span class="v">48,000 UYP</span><span class="s">Value: $4,800.00 (soon x100)</span></button>
</div>
<div class="timer">
<div class="m">BONUS DOUBLER ENDS SOON! Lock in 6% a day.<small><span id="spots">Only 3 VIP spots left</span> · tell your friends before it closes</small></div>
<div class="clock" id="clock">09:59</div>
<button type="button" class="act hot" data-flag="clock">Lock it in now<small>before the timer hits zero</small></button>
</div>
<div class="acts">
<button type="button" class="act" data-flag="withdraw">Withdraw $25,000<small>Fast and easy</small></button>
<button type="button" class="act alt" data-flag="vip">Unlock withdrawals<small>VIP upgrade, $199 one time</small></button>
<button type="button" class="act alt" data-flag="team">Invite friends<small>+$500 per sign-up</small></button>
<button type="button" class="act alt" data-flag="keys">Connect wallet to claim<small>Claim 48,000 UYP airdrop</small></button>
</div>
</section>
<section class="end" id="end" aria-label="Your scam radar">
<h2 id="endH">Your scam radar: 0 of 8 red flags spotted</h2>
<p id="endP">Every button, tile and popup on that dashboard is one of the classic warning signs. Find them all, or <button type="button" class="btn sec" id="showAll" style="padding:4px 10px;font-size:13px">show me all 8</button></p>
<ul class="flags" id="flags"></ul>
<div id="after" hidden style="display:grid;gap:14px">
<div class="agit">
<h2>Here is what chasing unicorns really costs you</h2>
<ul>
<li><b>The deposit.</b> The number on the screen was never your money. The money you sent in was, and it is already gone.</li>
<li><b>The "free" ones.</b> Some never ask for a penny up front. Free to join, free to "earn", a big withdrawal promised for later, knowing it is never coming. Everybody piles in for free while the countdown runs, inviting friends to grow their balance. When the timer hits zero, the fee shows up, and now thousands of people are lined up to pay it.</li>
<li><b>The "release fee".</b> When withdrawals stall, the next message asks you to pay something small to unlock the big balance: a miner fee, a gas fee, an admin fee, a tax, a verification fee, a VIP upgrade. It always sounds minor next to what is "waiting" for you. Pay it, and another one appears.</li>
<li><b>Your friends.</b> Everyone you invited is now asking you where their money is. You did not mean to, but you sold them the unicorn.</li>
<li><b>Your time.</b> Months of checking a dashboard, waiting on a Telegram admin, hoping this week is the week.</li>
<li><b>The next one.</b> When this site goes dark, a "recovery service" shows up offering to get your money back, for a fee. Then a new unicorn with a new countdown.</li>
</ul>
<p>And the worst part: after enough of these, people stop trusting anything online, including the things that actually work.</p>
</div>
<h2>Quit chasing unicorns. Look for receipts.</h2>
<p>A real program does not need a magic number on a screen. It needs a product people actually buy, and payments you can check yourself without asking anyone. That is how we built InstantAdPay.</p>
<div class="vs">
<div class="bad"><h3>The unicorn</h3><ul>
<li>A fixed daily return on your deposit</li><li>Withdrawals always "processing"</li><li>Pay a fee to unlock your own money</li><li>Paid in their own coin</li><li>A countdown that never ends</li></ul></div>
<div class="good"><h3>What InstantAdPay does instead</h3><ul>
<li>Sells real advertising: ad packages from $5 buy text ads, banners, visits and more across the network</li>
<li>When a package sells, the sponsor line is paid by smart contract in the same transaction. Nothing is held by the company.</li>
<li>Every payment is on the Polygon blockchain, so you can look it up yourself</li>
<li>Joining is free and starts with just your email. No card, no wallet needed to look around.</li>
<li>No balance to "unlock" and no countdown</li></ul></div>
</div>
<div class="cta"><a class="btn go" id="joinBtn" href="/join?src=chasing-unicorns">Look around InstantAdPay free</a><a class="btn sec" href="/ledger" id="ledgerBtn">See the public payment ledger</a></div>
<p class="fine">Ad credits buy advertising, not income. No income is promised: what you earn depends on the packages bought by people you bring in.</p>
<div class="share" id="shareRow"><span class="fine">Know someone still waiting on a payout? Send them this:</span> <code id="shareLink">https://instantadpay.com/chasing-unicorns</code> <button type="button" class="btn sec" id="copyShare" style="padding:6px 12px;font-size:13px">Copy link</button></div>
<p class="fine">The full checklist, with a 3 minute video: <a href="https://earnerscorner.com/t/what-do-you-check-before-joining-a-new-program/25/6" target="_blank" rel="noopener">Spot a scam before it spots you, on Earners Corner</a>.</p>
</div>
</section>
<p class="foot">Training simulation by InstantAdPay. UnicornYield Pro, its balance, token, team, countdown and every "withdrawal" popup are made up, and nothing on the dashboard can be deposited, earned or withdrawn.</p>
</main>
<button type="button" class="proof" id="proof" data-flag="proof" aria-live="polite"><span class="av" id="pAv">J</span><span class="t" id="pT"></span><span class="f">Tap to check this one</span></button>
<div class="veil" id="veil" hidden><div class="card" role="dialog" aria-modal="true" aria-labelledby="cardH">
<div class="k" id="cardK">Red flag 1 of 8</div>
<h2 id="cardH"></h2>
<p id="cardP"></p>
<div class="tell" id="cardTell"></div>
<div class="do" id="cardDo"></div>
<div class="row"><button type="button" class="btn go" id="cardNext">Keep hunting</button><button type="button" class="btn sec" id="cardEnd">Show my scam radar</button></div>
</div></div>
<script src="/assets/chasing-unicorns.js?v=20261112d"></script>
</body>
</html>
+3 -4
View File
@@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>The contract | InstantAdPay</title> <title>The contract | InstantAdPay</title>
@@ -15,10 +15,9 @@
<meta name="twitter:description" content="Immutable 50-20-10 splits, no withdrawal button, verify it yourself."> <meta name="twitter:description" content="Immutable 50-20-10 splits, no withdrawal button, verify it yourself.">
<meta name="twitter:image" content="https://instantadpay.com/banners/iap-hero-1200x630.png"> <meta name="twitter:image" content="https://instantadpay.com/banners/iap-hero-1200x630.png">
<meta name="theme-color" content="#043b2f"> <meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260910h">
</head> </head>
<body> <body>
<div class="wrap"> <div class="wrap">
@@ -143,7 +142,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.</div> <div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.</div>
</footer> </footer>
</div> </div>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/welcome.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/contract.js?v=20260908p"></script> <script src="/assets/contract.js?v=20260908p"></script>
<script src="/assets/chat.js?v=20261016n"></script> <script src="/assets/chat.js?v=20261016n"></script>
</body> </body>
+22 -26
View File
@@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Conversion tracking: see which ad brings sign-ups and sales | InstantAdPay</title> <title>Conversion tracking: see which ad brings sign-ups and sales | InstantAdPay</title>
@@ -11,10 +11,9 @@
<meta property="og:description" content="Clicks tell you who looked. Conversion tracking tells you which ad, page and source actually brought a subscriber or a sale, with a cost per goal in credits. Free for every member. Set it up in four steps."> <meta property="og:description" content="Clicks tell you who looked. Conversion tracking tells you which ad, page and source actually brought a subscriber or a sale, with a cost per goal in credits. Free for every member. Set it up in four steps.">
<meta property="og:url" content="https://instantadpay.com/conversion-tracking"> <meta property="og:url" content="https://instantadpay.com/conversion-tracking">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260912b">
<style> <style>
.rg{max-width:900px} .rg{max-width:900px}
.rg .hero{padding:44px 0 10px} .rg .hero{padding:44px 0 10px}
@@ -25,19 +24,19 @@
.rg-cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:6px 0 10px} .rg-cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:6px 0 10px}
.rg-cta .btn.big{font-size:17px;padding:14px 22px} .rg-cta .btn.big{font-size:17px;padding:14px 22px}
.rg-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:14px;margin:14px 0 0} .rg-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:14px;margin:14px 0 0}
.rg-box{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:var(--ink-faint);min-width:0} .rg-box{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:rgba(255,255,255,.02);min-width:0}
.rg-box p{margin:0;font-size:14.5px;color:var(--muted)} .rg-box p{margin:0;font-size:14.5px;color:var(--muted)}
.rg-box p + p{margin-top:8px} .rg-box p + p{margin-top:8px}
.rg-note{font-size:14.5px;color:var(--muted);margin:8px 0 0} .rg-note{font-size:14.5px;color:var(--muted);margin:8px 0 0}
/* the flow: across on a wide screen, down on a phone */ /* the flow: across on a wide screen, down on a phone */
.cg-flow{list-style:none;margin:16px 0 8px;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:26px} .cg-flow{list-style:none;margin:16px 0 8px;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:26px}
.cg-flow li{position:relative;border:1px solid var(--line-strong);border-radius:12px;padding:12px 13px;background:var(--ink-faint);font-size:13.5px;line-height:1.45;color:var(--muted);min-width:0} .cg-flow li{position:relative;border:1px solid var(--line-strong);border-radius:12px;padding:12px 13px;background:rgba(255,255,255,.02);font-size:13.5px;line-height:1.45;color:var(--muted);min-width:0}
.cg-flow li b{display:block;font-family:var(--disp);font-size:14.5px;color:var(--ink);margin-bottom:4px} .cg-flow li b{display:block;font-family:var(--disp);font-size:14.5px;color:var(--ink);margin-bottom:4px}
.cg-flow li .k{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;font-family:var(--mono);font-size:12px;font-weight:700;margin-bottom:6px;background:var(--ink);color:var(--ground)} .cg-flow li .k{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;font-family:var(--mono);font-size:12px;font-weight:700;margin-bottom:6px;background:var(--ink);color:#04120e}
.cg-flow li code{font-family:var(--mono);font-size:12px;color:var(--mint);overflow-wrap:anywhere} .cg-flow li code{font-family:var(--mono);font-size:12px;color:var(--mint);overflow-wrap:anywhere}
.cg-flow li.f-ad{border-color:var(--cyan-line);background:var(--cyan-soft)} .cg-flow li.f-ad{border-color:rgba(84,204,255,.55);background:rgba(84,204,255,.07)}
.cg-flow li.f-tag{border-color:var(--mint-line-2);background:var(--mint-soft)} .cg-flow li.f-tag{border-color:rgba(67,232,195,.6);background:rgba(67,232,195,.08)}
.cg-flow li.f-px{border-color:var(--amber-line);background:var(--amber-soft)} .cg-flow li.f-px{border-color:rgba(255,178,56,.7);background:rgba(255,178,56,.09)}
.cg-flow li.f-win{border-color:var(--mint);background:var(--mint-soft)} .cg-flow li.f-win{border-color:var(--mint);background:var(--mint-soft)}
.cg-flow li:not(:last-child)::after{content:"";position:absolute;right:-20px;top:50%;margin-top:-7px;border:7px solid transparent;border-left:9px solid var(--line-strong);border-right:0} .cg-flow li:not(:last-child)::after{content:"";position:absolute;right:-20px;top:50%;margin-top:-7px;border:7px solid transparent;border-left:9px solid var(--line-strong);border-right:0}
@media (max-width:820px){ @media (max-width:820px){
@@ -46,25 +45,25 @@
} }
/* steps */ /* steps */
.rg-route{list-style:none;counter-reset:s;margin:12px 0 0;padding:0;display:grid;gap:14px} .rg-route{list-style:none;counter-reset:s;margin:12px 0 0;padding:0;display:grid;gap:14px}
.rg-route > li{counter-increment:s;display:grid;grid-template-columns:42px minmax(0,1fr);gap:14px;align-items:start;border:1px solid var(--line);border-radius:14px;padding:14px 16px;background:var(--ink-faint);min-width:0} .rg-route > li{counter-increment:s;display:grid;grid-template-columns:42px minmax(0,1fr);gap:14px;align-items:start;border:1px solid var(--line);border-radius:14px;padding:14px 16px;background:rgba(255,255,255,.02);min-width:0}
.rg-route > li::before{content:counter(s);font-family:var(--disp);font-weight:800;font-size:20px;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:var(--amber);color:var(--amber-ink)} .rg-route > li::before{content:counter(s);font-family:var(--disp);font-weight:800;font-size:20px;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:var(--amber);color:#1b1203}
.rg-route > li > div{min-width:0} .rg-route > li > div{min-width:0}
.rg-route p{margin:0 0 8px;font-size:14.5px;color:var(--muted)} .rg-route p{margin:0 0 8px;font-size:14.5px;color:var(--muted)}
.rg-where{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px} .rg-where{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.rg-chip{font-size:12.5px;font-weight:600;padding:3px 10px;border-radius:999px;background:var(--mint-soft);color:var(--mint);border:1px solid var(--mint-line)} .rg-chip{font-size:12.5px;font-weight:600;padding:3px 10px;border-radius:999px;background:var(--mint-soft);color:var(--mint);border:1px solid rgba(67,232,195,.35)}
.rg-chip.ls{background:var(--cyan-soft);color:var(--cyan);border-color:var(--cyan-line)} .rg-chip.ls{background:rgba(84,204,255,.08);color:var(--cyan);border-color:rgba(84,204,255,.35)}
/* code */ /* code */
.cg-code{position:relative;margin:8px 0 10px;border:1px solid var(--line-strong);border-radius:10px;background:var(--ground-soft);padding:12px 14px 12px;min-width:0} .cg-code{position:relative;margin:8px 0 10px;border:1px solid var(--line-strong);border-radius:10px;background:#02100b;padding:12px 14px 12px;min-width:0}
.cg-code pre{margin:0;font-family:var(--mono);font-size:12.5px;line-height:1.6;color:var(--mint-hi);white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word} .cg-code pre{margin:0;font-family:var(--mono);font-size:12.5px;line-height:1.6;color:var(--mint-hi);white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
.cg-code .cg-lbl{display:flex;justify-content:space-between;align-items:center;gap:8px;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 6px} .cg-code .cg-lbl{display:flex;justify-content:space-between;align-items:center;gap:8px;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 6px}
.cg-copy{font:600 12px var(--disp);background:transparent;color:var(--mint);border:1px solid var(--mint-line-2);border-radius:999px;padding:3px 12px;cursor:pointer} .cg-copy{font:600 12px var(--disp);background:transparent;color:var(--mint);border:1px solid rgba(67,232,195,.5);border-radius:999px;padding:3px 12px;cursor:pointer}
.cg-copy:hover{background:var(--mint-soft)} .cg-copy:hover{background:rgba(67,232,195,.1)}
.cg-ph{color:var(--amber);font-weight:700} .cg-ph{color:var(--amber);font-weight:700}
.cg-ex{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:var(--ink-faint);margin:14px 0 0;min-width:0} .cg-ex{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:rgba(255,255,255,.02);margin:14px 0 0;min-width:0}
.cg-ex > p,.cg-ex li{font-size:14.5px;color:var(--muted)} .cg-ex > p,.cg-ex li{font-size:14.5px;color:var(--muted)}
.cg-ex > p{margin:0 0 8px} .cg-ex > p{margin:0 0 8px}
.cg-ex ol,.cg-ex ul{margin:0 0 8px;padding-left:20px;display:grid;gap:4px} .cg-ex ol,.cg-ex ul{margin:0 0 8px;padding-left:20px;display:grid;gap:4px}
.rg code.i{font-family:var(--mono);font-size:13px;color:var(--mint);background:var(--mint-soft);padding:1px 5px;border-radius:4px;overflow-wrap:anywhere} .rg code.i{font-family:var(--mono);font-size:13px;color:var(--mint);background:rgba(67,232,195,.08);padding:1px 5px;border-radius:4px;overflow-wrap:anywhere}
/* report table */ /* report table */
.rg-tbl{border:1px solid var(--line);border-radius:14px;overflow:hidden;margin:10px 0 8px} .rg-tbl{border:1px solid var(--line);border-radius:14px;overflow:hidden;margin:10px 0 8px}
.rg-tbl table{width:100%;border-collapse:collapse;font-size:14.5px;table-layout:fixed} .rg-tbl table{width:100%;border-collapse:collapse;font-size:14.5px;table-layout:fixed}
@@ -75,14 +74,14 @@
.rg-tbl tr:last-child td{border-bottom:0} .rg-tbl tr:last-child td{border-bottom:0}
/* checklist */ /* checklist */
.cg-check{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:10px} .cg-check{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:10px}
.cg-check li{position:relative;padding:12px 14px 12px 44px;border:1px solid var(--line);border-radius:12px;background:var(--ink-faint);font-size:14.5px;color:var(--muted)} .cg-check li{position:relative;padding:12px 14px 12px 44px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.02);font-size:14.5px;color:var(--muted)}
.cg-check li::before{content:"";position:absolute;left:14px;top:14px;width:16px;height:16px;border-radius:4px;border:2px solid var(--mint)} .cg-check li::before{content:"";position:absolute;left:14px;top:14px;width:16px;height:16px;border-radius:4px;border:2px solid var(--mint)}
.cg-check li b{color:var(--ink)} .cg-check li b{color:var(--ink)}
.rg-faq{display:grid;gap:14px;margin:12px 0 0} .rg-faq{display:grid;gap:14px;margin:12px 0 0}
.rg-faq dt{font-family:var(--disp);font-weight:700} .rg-faq dt{font-family:var(--disp);font-weight:700}
.rg-faq dd{margin:4px 0 0;color:var(--muted);font-size:14.5px} .rg-faq dd{margin:4px 0 0;color:var(--muted);font-size:14.5px}
.rg-rule{border-left:4px solid var(--mint);background:var(--mint-soft);padding:14px 18px;border-radius:0 12px 12px 0;margin:30px 0 22px;font-size:14.5px} .rg-rule{border-left:4px solid var(--mint);background:rgba(67,232,195,.07);padding:14px 18px;border-radius:0 12px 12px 0;margin:30px 0 22px;font-size:14.5px}
.rg-warn{border-left:4px solid var(--amber);background:var(--amber-soft);padding:12px 16px;border-radius:0 12px 12px 0;margin:12px 0 0;font-size:14.5px} .rg-warn{border-left:4px solid var(--amber);background:rgba(255,178,56,.07);padding:12px 16px;border-radius:0 12px 12px 0;margin:12px 0 0;font-size:14.5px}
@media (max-width:640px){.rg .hero h1{font-size:30px}.cg-ex,.rg-box{padding:14px}.rg-route > li{grid-template-columns:34px minmax(0,1fr);gap:10px;padding:12px}.rg-route > li::before{width:34px;height:34px;font-size:17px}} @media (max-width:640px){.rg .hero h1{font-size:30px}.cg-ex,.rg-box{padding:14px}.rg-route > li{grid-template-columns:34px minmax(0,1fr);gap:10px;padding:12px}.rg-route > li::before{width:34px;height:34px;font-size:17px}}
</style> </style>
</head> </head>
@@ -119,7 +118,6 @@
<li class="f-win"><span class="k">5</span><b>Counted on your campaign</b>The goal shows on the ad that sent them, with its cost per goal in credits.</li> <li class="f-win"><span class="k">5</span><b>Counted on your campaign</b>The goal shows on the ad that sent them, with its cost per goal in credits.</li>
</ol> </ol>
<p class="rg-note">The id is random. It identifies the click, not the person. Nothing personal is read from your page or sent anywhere.</p> <p class="rg-note">The id is random. It identifies the click, not the person. Nothing personal is read from your page or sent anywhere.</p>
<p class="rg-note"><b>Sending people to InstantAdPay or LinkSpin?</b> Those two count by themselves, with no goal and no pixel. The landing tag adds the click id to your links to either site, also when the address sits inside a redirect link of your own. A LinkSpin spin link or Banner Spin pointed straight at either site carries it too. Their sign-up, wallet link and each package they buy within 30 days of the click then show on your Conversion tracking card and in LinkSpin under Reports, Conversions, purchases with their USD price. This is reporting only. It never changes who a sponsor is or what anyone is paid.</p>
<p class="rg-eye">Set it up</p> <p class="rg-eye">Set it up</p>
<h2>Four steps, one time</h2> <h2>Four steps, one time</h2>
@@ -253,8 +251,7 @@
<div><dt>Will the tags slow down or break my page?</dt><dd>No. Both load in the background, never stop your page from showing, and do nothing visible. If LinkSpin cannot be reached, your page works exactly as before.</dd></div> <div><dt>Will the tags slow down or break my page?</dt><dd>No. Both load in the background, never stop your page from showing, and do nothing visible. If LinkSpin cannot be reached, your page works exactly as before.</dd></div>
<div><dt>Do I need a separate goal for each ad?</dt><dd>No. One goal covers all your ads. Each conversion is counted against whichever ad sent that visitor.</dd></div> <div><dt>Do I need a separate goal for each ad?</dt><dd>No. One goal covers all your ads. Each conversion is counted against whichever ad sent that visitor.</dd></div>
<div><dt>Do my ads get the click id automatically?</dt><dd>Yes. Every click through your InstantAdPay ads carries one. Your page address keeps all its own parameters; the click id is added to the end.</dd></div> <div><dt>Do my ads get the click id automatically?</dt><dd>Yes. Every click through your InstantAdPay ads carries one. Your page address keeps all its own parameters; the click id is added to the end.</dd></div>
<div><dt>Is any personal data sent?</dt><dd>No. The click id is random. No name or email from your page is read or sent. When someone joins here on your click, the two sites match the event to your click server to server, and your reports show counts and values, never who the person is.</dd></div> <div><dt>Is any personal data sent?</dt><dd>No. The click id is random. No name or email from your page is read or sent.</dd></div>
<div><dt>Why does a sign-up I sent not show?</dt><dd>The click has to reach the join page. Check that your landing tag is on the page and the link is a real link (a button that only runs a script cannot carry it), and that the visitor opened it from your click within the last 30 days. A sign-up and a wallet count once per click, each package counts on its own, and your own account is left out. People who joined before this was switched on on 2026-11-07 cannot be matched afterwards.</dd></div>
</dl> </dl>
<div class="rg-rule"><b>What a credit is.</b> One credit is one cent of ad delivery across the network. Credits are not money and cannot be withdrawn. Cost per goal is shown in credits for that reason.</div> <div class="rg-rule"><b>What a credit is.</b> One credit is one cent of ad delivery across the network. Credits are not money and cannot be withdrawn. Cost per goal is shown in credits for that reason.</div>
@@ -265,8 +262,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div> <div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer> </footer>
</div> </div>
<script src="/assets/common.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/conversion-guide.js?v=20261024ct"></script> <script src="/assets/conversion-guide.js?v=20261024ct"></script>
<script src="/assets/netline.js?v=20261117nw" data-site="iap"></script>
</body> </body>
</html> </html>
+3 -4
View File
@@ -1,12 +1,11 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Disclaimer | InstantAdPay</title> <title>Disclaimer | InstantAdPay</title>
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260910h">
</head> </head>
<body> <body>
<div id="nav"></div> <div id="nav"></div>
@@ -27,7 +26,7 @@
<p class="muted small">You decide whether, and how much, to spend. Never spend more than you can afford to lose.</p> <p class="muted small">You decide whether, and how much, to spend. Never spend more than you can afford to lose.</p>
</div> </div>
</div></section> </div></section>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/welcome.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/legal.js?v=20260908a"></script> <script src="/assets/legal.js?v=20260908a"></script>
</body> </body>
</html> </html>
+4 -6
View File
@@ -1,15 +1,14 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>How earning works: credits and POL payouts | InstantAdPay</title> <title>How earning works: credits and POL payouts | InstantAdPay</title>
<meta name="description" content="The two ways members earn on InstantAdPay: ad credits (the daily set, the claim streak, visits, videos, inbox ads, sign-in bonus, milestones) and POL paid to your wallet from ad packages bought in your line, on chain, in the same transaction."> <meta name="description" content="The two ways members earn on InstantAdPay: ad credits (the daily set, the claim streak, visits, videos, inbox ads, sign-in bonus, milestones) and POL paid to your wallet from ad packages bought in your line, on chain, in the same transaction.">
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<meta name="theme-color" content="#043b2f"> <meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260912b">
<style> <style>
.eg{max-width:820px} .eg{max-width:820px}
.eg h2{font-size:23px;margin:40px 0 10px;padding-top:18px;border-top:1px solid var(--line)} .eg h2{font-size:23px;margin:40px 0 10px;padding-top:18px;border-top:1px solid var(--line)}
@@ -18,7 +17,7 @@
table{border-collapse:collapse;width:100%;max-width:560px;margin:10px 0 16px;font-variant-numeric:tabular-nums;font-size:15px} table{border-collapse:collapse;width:100%;max-width:560px;margin:10px 0 16px;font-variant-numeric:tabular-nums;font-size:15px}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line)} th{color:var(--muted);font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:500} th,td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line)} th{color:var(--muted);font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:500}
td:last-child,th:last-child{text-align:right} td:last-child,th:last-child{text-align:right}
.rule{border-left:4px solid var(--mint);background:var(--mint-soft);padding:14px 18px;border-radius:0 12px 12px 0;margin:0 0 20px} .rule{border-left:4px solid var(--mint);background:rgba(67,232,195,.07);padding:14px 18px;border-radius:0 12px 12px 0;margin:0 0 20px}
.rule b{font-family:var(--disp);display:block;margin-bottom:4px} .rule b{font-family:var(--disp);display:block;margin-bottom:4px}
</style> </style>
</head> </head>
@@ -97,7 +96,6 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div> <div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer> </footer>
</div> </div>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/welcome.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/netline.js?v=20261117nw" data-site="iap"></script>
</body> </body>
</html> </html>
+3 -4
View File
@@ -1,14 +1,13 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Platform Facts | InstantAdPay</title> <title>Platform Facts | InstantAdPay</title>
<meta name="description" content="Verified facts about InstantAdPay: the Polygon smart contract, the fixed 50/20/10 referral split with two 10% platform fees, how ad credits are minted and burned, anti-fraud rules, and the games in the network."> <meta name="description" content="Verified facts about InstantAdPay: the Polygon smart contract, the fixed 50/20/10 referral split with two 10% platform fees, how ad credits are minted and burned, anti-fraud rules, and the games in the network.">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="alternate" type="text/plain" href="/llms.txt" title="Plain-text summary for AI systems"> <link rel="alternate" type="text/plain" href="/llms.txt" title="Plain-text summary for AI systems">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260910h">
<style> <style>
.facts h3 { margin-top: 18px; } .facts h3 { margin-top: 18px; }
.facts table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 4px; } .facts table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 4px; }
@@ -127,7 +126,7 @@
</ul> </ul>
</div> </div>
</div></section> </div></section>
<script src="/assets/common.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/legal.js?v=20260908a"></script> <script src="/assets/legal.js?v=20260908a"></script>
</body> </body>
</html> </html>
+9 -11
View File
@@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Five Dollar Friday: 20% bonus credits on every $5+ ad package | InstantAdPay</title> <title>Five Dollar Friday: 20% bonus credits on every $5+ ad package | InstantAdPay</title>
@@ -11,28 +11,27 @@
<meta property="og:image" content="https://instantadpay.com/banners/iap-five-dollar-friday-v2-1200x630.jpg"> <meta property="og:image" content="https://instantadpay.com/banners/iap-five-dollar-friday-v2-1200x630.jpg">
<meta property="og:url" content="https://instantadpay.com/friday"> <meta property="og:url" content="https://instantadpay.com/friday">
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:card" content="summary_large_image">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260912b">
<style> <style>
.fr{max-width:860px} .fr{max-width:860px}
.fr .hero{padding:44px 0 10px} .fr .hero{padding:44px 0 10px}
.fr-banner{display:block;width:100%;height:auto;max-width:860px;border-radius:16px;border:1px solid var(--line);margin:18px 0 14px} .fr-banner{display:block;width:100%;height:auto;max-width:860px;border-radius:16px;border:1px solid var(--line);margin:18px 0 14px}
.fr-state{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;padding:14px 18px;border-radius:14px;border:1px solid var(--line);background:var(--mint-faint);margin:0 0 26px;font-size:15px} .fr-state{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;padding:14px 18px;border-radius:14px;border:1px solid var(--line);background:rgba(67,232,195,.06);margin:0 0 26px;font-size:15px}
.fr-state.live{border-color:var(--amber-line);background:var(--amber-soft)} .fr-state.live{border-color:rgba(255,178,56,.55);background:rgba(255,178,56,.09)}
.fr-tag{font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:700;padding:4px 9px;border-radius:999px;background:var(--mint);color:var(--mint-ink)} .fr-tag{font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:700;padding:4px 9px;border-radius:999px;background:var(--mint);color:#04120e}
.fr-state.live .fr-tag{background:var(--amber)} .fr-state.live .fr-tag{background:#ffb238}
.fr-state b{font-family:var(--disp)} .fr-state b{font-family:var(--disp)}
.fr-num{font-family:var(--mono);font-variant-numeric:tabular-nums} .fr-num{font-family:var(--mono);font-variant-numeric:tabular-nums}
.fr-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:8px 0 26px} .fr-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin:8px 0 26px}
.fr-step{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:var(--ink-faint)} .fr-step{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:rgba(255,255,255,.02)}
.fr-step .n{font-family:var(--mono);font-size:11px;letter-spacing:.12em;color:var(--mint);text-transform:uppercase} .fr-step .n{font-family:var(--mono);font-size:11px;letter-spacing:.12em;color:var(--mint);text-transform:uppercase}
.fr-step h3{font-family:var(--disp);font-size:17px;margin:6px 0 6px} .fr-step h3{font-family:var(--disp);font-size:17px;margin:6px 0 6px}
.fr-step p{margin:0;font-size:14.5px;color:var(--muted)} .fr-step p{margin:0;font-size:14.5px;color:var(--muted)}
.fr-cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:6px 0 30px} .fr-cta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:6px 0 30px}
.fr-cta .btn.big{font-size:17px;padding:14px 22px} .fr-cta .btn.big{font-size:17px;padding:14px 22px}
.fr-rule{border-left:4px solid var(--mint);background:var(--mint-soft);padding:14px 18px;border-radius:0 12px 12px 0;margin:0 0 22px;font-size:14.5px} .fr-rule{border-left:4px solid var(--mint);background:rgba(67,232,195,.07);padding:14px 18px;border-radius:0 12px 12px 0;margin:0 0 22px;font-size:14.5px}
.fr-share{border:1px dashed var(--line);border-radius:14px;padding:16px 18px;margin:0 0 30px;font-size:14.5px;color:var(--muted)} .fr-share{border:1px dashed var(--line);border-radius:14px;padding:16px 18px;margin:0 0 30px;font-size:14.5px;color:var(--muted)}
.fr-share b{color:var(--ink)} .fr-share b{color:var(--ink)}
</style> </style>
@@ -72,7 +71,6 @@
</footer> </footer>
</div> </div>
<script src="/assets/friday.js?v=20260925a"></script> <script src="/assets/friday.js?v=20260925a"></script>
<script src="/assets/common.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script>
<script src="/assets/netline.js?v=20261117nw" data-site="iap"></script>
</body> </body>
</html> </html>
+10 -12
View File
@@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Games that pay POL | InstantAdPay</title> <title>Games that pay POL | InstantAdPay</title>
@@ -12,20 +12,19 @@
<meta property="og:url" content="https://instantadpay.com/games"> <meta property="og:url" content="https://instantadpay.com/games">
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:card" content="summary_large_image">
<link rel="canonical" href="https://instantadpay.com/games"> <link rel="canonical" href="https://instantadpay.com/games">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260912b">
<style> <style>
.gp{max-width:1040px} .gp{max-width:1040px}
.gp .hero{padding:56px 0 10px} .gp .hero{padding:56px 0 10px}
.gp .lead{max-width:62ch} .gp .lead{max-width:62ch}
.gsec{font-family:var(--mono);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin:34px 0 12px;padding-top:18px;border-top:1px solid var(--line)} .gsec{font-family:var(--mono);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin:34px 0 12px;padding-top:18px;border-top:1px solid var(--line)}
.ggrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px} .ggrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px}
.gcard{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--ink-faint)} .gcard{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:rgba(255,255,255,.03)}
.gcard .art{position:relative;aspect-ratio:1.91/1;background:#07201c center/cover no-repeat} .gcard .art{position:relative;aspect-ratio:1.91/1;background:#07201c center/cover no-repeat}
.gcard .art img{width:100%;height:100%;object-fit:cover;display:block} .gcard .art img{width:100%;height:100%;object-fit:cover;display:block}
.gcard .ribbon{position:absolute;left:12px;top:12px;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:5px 9px;border-radius:999px;background:rgba(4,59,47,.9);color:#dffbf3;border:1px solid var(--mint-line)} .gcard .ribbon{position:absolute;left:12px;top:12px;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:5px 9px;border-radius:999px;background:rgba(4,59,47,.9);color:#dffbf3;border:1px solid rgba(67,232,195,.35)}
.gcard .ribbon.soon{background:rgba(226,176,74,.92);color:#2a1d04;border-color:rgba(255,255,255,.3)} .gcard .ribbon.soon{background:rgba(226,176,74,.92);color:#2a1d04;border-color:rgba(255,255,255,.3)}
.gcard .body{padding:14px 16px 16px;display:flex;flex-direction:column;gap:8px;flex:1} .gcard .body{padding:14px 16px 16px;display:flex;flex-direction:column;gap:8px;flex:1}
.gcard .tag{font-family:var(--mono);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--mint)} .gcard .tag{font-family:var(--mono);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--mint)}
@@ -34,22 +33,22 @@
.gcard .pays{font-size:13px;color:var(--text)} .gcard .pays{font-size:13px;color:var(--text)}
.gcard .pays b{color:var(--gold,#e2b04a)} .gcard .pays b{color:var(--gold,#e2b04a)}
.gcard .row{display:flex;gap:10px;align-items:center;margin-top:auto;padding-top:6px;flex-wrap:wrap} .gcard .row{display:flex;gap:10px;align-items:center;margin-top:auto;padding-top:6px;flex-wrap:wrap}
.gcard .btn{display:inline-block;padding:10px 16px;border-radius:12px;background:var(--mint);color:var(--mint-ink);font-weight:800;text-decoration:none;font-family:var(--disp)} .gcard .btn{display:inline-block;padding:10px 16px;border-radius:12px;background:var(--mint);color:#04261f;font-weight:800;text-decoration:none;font-family:var(--disp)}
.gcard .btn.ghost{background:transparent;color:var(--text);border:1px solid var(--line)} .gcard .btn.ghost{background:transparent;color:var(--text);border:1px solid var(--line)}
.gcard .btn[aria-disabled="true"]{opacity:.55;pointer-events:none} .gcard .btn[aria-disabled="true"]{opacity:.55;pointer-events:none}
.gcard .host{font-family:var(--mono);font-size:12px;color:var(--muted)} .gcard .host{font-family:var(--mono);font-size:12px;color:var(--muted)}
.howbox{border-left:4px solid var(--mint);background:var(--mint-soft);padding:14px 18px;border-radius:0 12px 12px 0;margin:22px 0 6px;max-width:72ch} .howbox{border-left:4px solid var(--mint);background:rgba(67,232,195,.07);padding:14px 18px;border-radius:0 12px 12px 0;margin:22px 0 6px;max-width:72ch}
.howbox b{font-family:var(--disp);display:block;margin-bottom:4px} .howbox b{font-family:var(--disp);display:block;margin-bottom:4px}
.cta{margin:36px 0 10px;padding:22px;border:1px solid var(--line);border-radius:18px;display:flex;gap:16px;align-items:center;flex-wrap:wrap;justify-content:space-between} .cta{margin:36px 0 10px;padding:22px;border:1px solid var(--line);border-radius:18px;display:flex;gap:16px;align-items:center;flex-wrap:wrap;justify-content:space-between}
.cta h2{margin:0 0 4px;font-size:22px} .cta h2{margin:0 0 4px;font-size:22px}
.cta p{margin:0;color:var(--muted);max-width:60ch} .cta p{margin:0;color:var(--muted);max-width:60ch}
.cta .btn{display:inline-block;padding:12px 18px;border-radius:12px;background:var(--mint);color:var(--mint-ink);font-weight:800;text-decoration:none;font-family:var(--disp)} .cta .btn{display:inline-block;padding:12px 18px;border-radius:12px;background:var(--mint);color:#04261f;font-weight:800;text-decoration:none;font-family:var(--disp)}
#gEmpty{color:var(--muted)} #gEmpty{color:var(--muted)}
.fgrid{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr);gap:12px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x mandatory} .fgrid{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr);gap:12px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x mandatory}
.fcard{scroll-snap-align:start;border-radius:16px;overflow:hidden;background:var(--ink-faint);border:1px solid var(--line);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--rc) 35%,transparent);text-decoration:none;color:var(--text);display:flex;flex-direction:column} .fcard{scroll-snap-align:start;border-radius:16px;overflow:hidden;background:rgba(255,255,255,.03);border:1px solid var(--line);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--rc) 35%,transparent);text-decoration:none;color:var(--text);display:flex;flex-direction:column}
.fpic{aspect-ratio:3/4;background:#061417;position:relative}.fpic img{width:100%;height:100%;object-fit:cover;display:block} .fpic{aspect-ratio:3/4;background:#061417;position:relative}.fpic img{width:100%;height:100%;object-fit:cover;display:block}
.ftag{position:absolute;left:8px;bottom:8px;font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;padding:3px 7px;border-radius:999px;background:rgba(0,0,0,.6);color:var(--rc);border:1px solid var(--rc)} .ftag{position:absolute;left:8px;bottom:8px;font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;padding:3px 7px;border-radius:999px;background:rgba(0,0,0,.6);color:var(--rc);border:1px solid var(--rc)}
.fsale{position:absolute;right:8px;bottom:8px;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;padding:3px 7px;border-radius:999px;background:var(--mint);color:var(--mint-ink);font-weight:800} .fsale{position:absolute;right:8px;bottom:8px;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;padding:3px 7px;border-radius:999px;background:var(--mint);color:#04261f;font-weight:800}
.fb{padding:8px 10px 10px;display:grid;gap:2px}.fb b{font-size:14px}.fb small{color:var(--muted);font-size:11px}.fb .fp{color:var(--gold,#e2b04a);font-weight:800;font-size:13px} .fb{padding:8px 10px 10px;display:grid;gap:2px}.fb b{font-size:14px}.fb small{color:var(--muted);font-size:11px}.fb .fp{color:var(--gold,#e2b04a);font-weight:800;font-size:13px}
</style> </style>
</head> </head>
@@ -79,7 +78,6 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div> <div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer> </footer>
</div> </div>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/games-page.js?v=20261012b"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/games-page.js?v=20261012b"></script>
<script src="/assets/netline.js?v=20261117nw" data-site="iap"></script>
</body> </body>
</html> </html>
+3 -4
View File
@@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="google-site-verification" content="9Qh7dv8AYdNjzIySFfcY975QiJRov_Zju2kkgEZoZik"> <meta name="google-site-verification" content="9Qh7dv8AYdNjzIySFfcY975QiJRov_Zju2kkgEZoZik">
@@ -19,10 +19,9 @@
<meta name="twitter:description" content="Instant on-chain ad payouts, verifiable on a public ledger. Seven ad formats. Earn credits back for your attention."> <meta name="twitter:description" content="Instant on-chain ad payouts, verifiable on a public ledger. Seven ad formats. Earn credits back for your attention.">
<meta name="twitter:image" content="https://instantadpay.com/banners/iap-hero-1200x630.png"> <meta name="twitter:image" content="https://instantadpay.com/banners/iap-hero-1200x630.png">
<meta name="theme-color" content="#043b2f"> <meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260923e">
</head> </head>
<body> <body>
@@ -506,7 +505,7 @@
</div> </div>
</section> </section>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/welcome.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/wallet.js?v=20260909c"></script> <script src="/assets/wallet.js?v=20260909c"></script>
<script src="/assets/home.js?v=20261027tb"></script> <script src="/assets/home.js?v=20261027tb"></script>
<script src="/assets/chat.js?v=20261016n"></script> <script src="/assets/chat.js?v=20261016n"></script>
+5 -6
View File
@@ -1,13 +1,12 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="noindex,follow"> <meta name="robots" content="noindex,follow">
<title>You're invited | InstantAdPay</title> <title>You're invited | InstantAdPay</title>
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260910h">
<style> <style>
.jn-nav{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 0} .jn-nav{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 0}
.jn-nav>a{white-space:nowrap;flex:0 0 auto;padding-top:8px} .jn-nav>a{white-space:nowrap;flex:0 0 auto;padding-top:8px}
@@ -70,7 +69,7 @@
.jn-pk .n{color:var(--muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.1em} .jn-pk .n{color:var(--muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.1em}
.jn-foot{color:var(--muted);font-size:13px;border-top:1px solid var(--line);margin-top:40px;padding:22px 0 50px} .jn-foot{color:var(--muted);font-size:13px;border-top:1px solid var(--line);margin-top:40px;padding:22px 0 50px}
.jn-err{color:var(--bad)} .jn-err{color:var(--bad)}
.jn-spon.cobrand{border:1px solid var(--mint-line);border-radius:14px;padding:10px 14px;margin-bottom:12px}.jn-spon.cobrand img{width:56px;height:56px;border-radius:50%}.jn-bio{display:block;margin-top:4px;color:var(--ink);font-size:14px;max-width:60ch} .jn-spon.cobrand{border:1px solid rgba(67,232,195,.4);border-radius:14px;padding:10px 14px;margin-bottom:12px}.jn-spon.cobrand img{width:56px;height:56px;border-radius:50%}.jn-bio{display:block;margin-top:4px;color:var(--ink);font-size:14px;max-width:60ch}
</style> </style>
</head> </head>
<body> <body>
@@ -158,7 +157,7 @@
InstantAdPay · <a href="/contract">Contract</a> · <a href="/terms">Terms</a> · <a href="/privacy">Privacy</a> · <a href="/disclaimer">Disclaimer</a> InstantAdPay · <a href="/contract">Contract</a> · <a href="/terms">Terms</a> · <a href="/privacy">Privacy</a> · <a href="/disclaimer">Disclaimer</a>
</div> </div>
</div> </div>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/welcome.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/join.js?v=20261107nc"></script> <script src="/assets/join.js?v=20261016p"></script>
</body> </body>
</html> </html>
+11 -12
View File
@@ -1,42 +1,41 @@
<!doctype html> <!doctype html>
<html lang="en" data-theme-base="dark"> <html lang="en">
<head> <head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Founding week checklist | InstantAdPay</title> <title>Founding week checklist | InstantAdPay</title>
<meta name="description" content="The eight things a leader gets done before launch, and why the order matters. Member training."> <meta name="description" content="The eight things a leader gets done before launch, and why the order matters. Member training.">
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<meta name="theme-color" content="#043b2f"> <meta name="theme-color" content="#043b2f">
<!--theme-head--><script>(function(){var A=0,h=document.documentElement,b=h.getAttribute("data-theme-base")||"dark",m=window.matchMedia?matchMedia("(prefers-color-scheme: dark)"):{matches:false},v;function g(){try{v=localStorage.getItem("iap.theme")}catch(e){v=null}return v==="light"||v==="dark"||v==="auto"?v:(A?"auto":b)}function ap(){var c=g();h.setAttribute("data-theme",c==="auto"?(m.matches?"dark":"light"):c);h.setAttribute("data-theme-choice",c)}ap();if(m.addEventListener)m.addEventListener("change",ap);else if(m.addListener)m.addListener(ap);window.IAPTheme={base:b,get:g,apply:ap,set:function(c,quiet){try{if(c==="light"||c==="dark"||c==="auto")localStorage.setItem("iap.theme",c);else localStorage.removeItem("iap.theme")}catch(e){}ap();if(!quiet)try{dispatchEvent(new CustomEvent("iap-theme",{detail:g()}))}catch(e){}}}})()</script><!--/theme-head-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
<link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="/assets/site.css?v=20261112ln"> <link rel="stylesheet" href="/assets/site.css?v=20260911c">
<style> <style>
.lw-rule{border-left:4px solid var(--gold-2);background:var(--gold-soft);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 24px} .lw-rule{border-left:4px solid #f2c94c;background:rgba(242,201,76,.08);padding:16px 20px;border-radius:0 12px 12px 0;margin:0 0 24px}
.lw-rule b{font-family:var(--disp);font-size:17px;display:block;margin-bottom:6px} .lw-rule b{font-family:var(--disp);font-size:17px;display:block;margin-bottom:6px}
.lw-top{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px} .lw-top{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.lw-count{font-family:var(--disp);font-weight:800;font-size:15px} .lw-count{font-family:var(--disp);font-weight:800;font-size:15px}
.lw-count b{color:var(--mint);font-size:22px} .lw-count b{color:var(--mint);font-size:22px}
.lw-bar{height:10px;border-radius:99px;background:var(--muted-soft);overflow:hidden;margin:8px 0 0;width:100%} .lw-bar{height:10px;border-radius:99px;background:rgba(255,255,255,.06);overflow:hidden;margin:8px 0 0;width:100%}
.lw-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--mint),var(--mint-pale));width:0;transition:width .4s} .lw-bar i{display:block;height:100%;background:linear-gradient(90deg,var(--mint),#9ff2dc);width:0;transition:width .4s}
.lw-when{font-family:var(--mono);font-size:12px;color:var(--muted)} .lw-when{font-family:var(--mono);font-size:12px;color:var(--muted)}
.lw-when b{color:var(--ink);font-family:var(--disp);font-size:18px;display:block} .lw-when b{color:var(--ink);font-family:var(--disp);font-size:18px;display:block}
.chk{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px} .chk{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.chk li{display:grid;grid-template-columns:34px 1fr auto;gap:14px;align-items:start;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 16px} .chk li{display:grid;grid-template-columns:34px 1fr auto;gap:14px;align-items:start;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 16px}
.chk li.done{border-color:var(--mint-line)} .chk li.done{border-color:rgba(67,232,195,.45)}
.chk .box{width:30px;height:30px;border-radius:9px;border:2px solid var(--line-strong);display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--mint);font-size:18px} .chk .box{width:30px;height:30px;border-radius:9px;border:2px solid var(--line-strong);display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--mint);font-size:18px}
.chk li.done .box{background:var(--mint-soft-2);border-color:var(--mint)} .chk li.done .box{background:rgba(67,232,195,.14);border-color:var(--mint)}
.chk h3{margin:0 0 3px;font-size:16px} .chk h3{margin:0 0 3px;font-size:16px}
.chk p{margin:0;color:var(--muted);font-size:14px} .chk p{margin:0;color:var(--muted);font-size:14px}
.chk .why{margin-top:6px;font-size:13px;color:var(--ink)} .chk .why{margin-top:6px;font-size:13px;color:var(--ink)}
.chk .act{white-space:nowrap} .chk .act{white-space:nowrap}
.chk .act .btn{margin-top:0} .chk .act .btn{margin-top:0}
.days{display:grid;grid-template-columns:repeat(4,1fr);gap:10px} .days{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.days>div{background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px} .days>div{background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 14px;font-size:14px}
.days .k{font-family:var(--disp);font-weight:800;color:var(--mint);margin-bottom:6px} .days .k{font-family:var(--disp);font-weight:800;color:var(--mint);margin-bottom:6px}
.days ul{margin:0;padding-left:18px} .days ul{margin:0;padding-left:18px}
blockquote{margin:0 0 10px;background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 16px;color:var(--muted)} blockquote{margin:0 0 10px;background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 16px;color:var(--muted)}
blockquote span{display:block;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint);margin-bottom:6px} blockquote span{display:block;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint);margin-bottom:6px}
.swipe{margin:0 0 12px;background:var(--ground-soft);border:1px solid var(--line);border-radius:10px;padding:12px 16px} .swipe{margin:0 0 12px;background:rgba(4,8,7,.45);border:1px solid var(--line);border-radius:10px;padding:12px 16px}
.swipe .cap{font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint);margin-bottom:6px;display:flex;justify-content:space-between;gap:10px;align-items:center} .swipe .cap{font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint);margin-bottom:6px;display:flex;justify-content:space-between;gap:10px;align-items:center}
.swipe .subj{font-weight:700;margin:0 0 8px} .swipe .subj{font-weight:700;margin:0 0 8px}
.swipe pre{white-space:pre-wrap;font:inherit;color:var(--muted);margin:0;line-height:1.5} .swipe pre{white-space:pre-wrap;font:inherit;color:var(--muted);margin:0;line-height:1.5}
@@ -106,7 +105,7 @@
<div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div> <div class="small">Advertising services with a performance referral program. Not an investment product; no income guarantees.</div>
</footer> </footer>
</div> </div>
<script src="/assets/common.js?v=20261117nw"></script><script src="/assets/welcome.js?v=20261117nw"></script> <script src="/assets/common.js?v=20261023ov"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/launch.js?v=20260915b"></script> <script src="/assets/launch.js?v=20260915b"></script>
</body> </body>
</html> </html>

Some files were not shown because too many files have changed in this diff Show More