// Webinar replays β€” members-area page. The list comes from /api/public/replays: // locked responses carry titles/dates only (prospects see the shape of the // product), a member session gets the video URLs. Unlock is the same // one-signature SIWE flow as the training page (msg-challenge/msg-verify via // RMCWallet); Mini App visitors already carry a session and see no lock. (function () { 'use strict'; function $(id) { return document.getElementById(id); } function esc(s) { return String(s == null ? '' : s).replace(/[&<>'"]/g, function (c) { return ({ '&': '&', '<': '<', '>': '>', "'": ''', '"': '"' })[c]; }); } function card(r, locked) { var head = '
' + esc(r.date || '') + (r.minutes ? ' Β· ' + esc(r.minutes) + ' min' : '') + '
' + '

' + esc(r.title || 'Team webinar') + '

' + (r.blurb ? '

' + esc(r.blurb) + '

' : '') + '
'; if (locked || !r.url) { return '
' + head + '
' + '

πŸ”’ Replays come with every team position. Sign in with the wallet that owns your position β€” one free signature, it can\'t move funds. Linked on Telegram? The ☰ Mini App in @RMCircleBot unlocks everything automatically.

' + ' ' + 'Not a member? See how to join' + '
'; } return '
' + head + '
'; } var UNLOCK_LABEL = 'πŸ”“ I\'m a member β€” connect & unlock'; function wireUnlock() { document.querySelectorAll('button.rmc-unlock').forEach(function (b) { b.addEventListener('click', function (ev) { var btn = ev.currentTarget, err = btn.closest('.rmc-lock').querySelector('.rmc-lock-err'); btn.disabled = true; btn.textContent = 'Connecting…'; (async function () { try { var eth = window.RMCWallet && await window.RMCWallet.pick(); if (!eth) { err.textContent = 'No wallet in this browser. On a phone, open this page inside your wallet app\'s browser β€” or use the Telegram Mini App.'; btn.disabled = false; btn.textContent = UNLOCK_LABEL; return; } var accounts = await eth.request({ method: 'eth_requestAccounts' }); var account = accounts && accounts[0]; try { await window.RMCWallet.ensureChain(eth); } catch (ce) { err.textContent = 'Switch your wallet to the Polygon network, then tap unlock again.'; btn.disabled = false; btn.textContent = UNLOCK_LABEL; return; } var ch = await (await fetch('/api/public/msg-challenge', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address: account }) })).json(); if (ch.error) throw new Error(ch.error); var sig = await eth.request({ method: 'personal_sign', params: [ch.message, account] }); var vr = await (await fetch('/api/public/msg-verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address: account, signature: sig }) })).json(); if (vr.error) throw new Error(vr.error); load(); } catch (e) { err.textContent = e.message || String(e); btn.disabled = false; btn.textContent = UNLOCK_LABEL; } })(); }); }); } function load() { fetch('/api/public/replays').then(function (r) { return r.json(); }).then(function (d) { var list = d.replays || []; if (!list.length) { $('replayList').innerHTML = '
The first replay is on its way β€” check back after this week\'s webinar.
'; return; } if (!d.locked) { $('replayStatus').innerHTML = '

βœ… Members area unlocked β€” position #' + esc(d.id) + '

'; } else { $('replayStatus').innerHTML = ''; } $('replayList').innerHTML = list.map(function (r) { return card(r, d.locked); }).join(''); if (d.locked) wireUnlock(); }).catch(function () { $('replayList').innerHTML = '
Could not load the replay list β€” refresh to try again.
'; }); } load(); })();