// LinkSpin Help (2026-10-16): the member's support tickets. List, new ticket (same categories as the desk), thread, // reply; a dot marks a ticket Marty answered that the member has not opened, and the rail badge counts them. // Server: /api/my/support* in server.js, which proxy to the one shared desk on InstantAdPay (helpdesk.js). // #t=LS-1042 opens that ticket (the link in reply emails); #new opens the form. Times in US Central. (function () { const $ = id => document.getElementById(id); const esc = CR.esc; const CATS = ['Account & sign-in', 'Wallet & payouts', 'Buying packages', 'Ads & campaigns', 'Earning credits & games', 'Team & referrals', 'Other']; const STATUS = { open: ['Open', 't'], waiting_on_member: ['Waiting on you', 'warn'], closed: ['Closed', 'dim'] }; const AUTHOR = { member: 'You', admin: 'Marty, LinkSpin support', system: 'LinkSpin' }; const when = ts => ts ? new Date(Number(ts)).toLocaleString('en-US', { timeZone: 'America/Chicago', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' }) + ' CT' : ''; const linkify = s => esc(s).replace(/(https?:\/\/[^\s<]+[^\s<.,;:!?)\]])/g, '$1'); const st = s => { const x = STATUS[s] || [s, 'dim']; return '' + esc(x[0]) + ''; }; const host = () => $('helpBody'); CR.mount({ active: 'help', title: 'Help', sub: 'support tickets' }); async function list(openNew) { host().innerHTML = '
loading your tickets
'; let r; try { r = await CR.get('/api/my/support'); } catch (e) { host().innerHTML = '
Could not load your tickets. ' + esc(e.message) + '
'; return; } const ts = r.tickets || []; CR.helpBadge(); // the list just refreshed the server's badge count (the rail's first paint may be up to a minute old) CR.sub(ts.length + ' ticket' + (ts.length === 1 ? '' : 's') + (r.unread ? ' · ' + r.unread + ' new repl' + (r.unread === 1 ? 'y' : 'ies') : '')); host().innerHTML = '

Help and support

Stuck on something? Send Marty a ticket. He reads every one and replies here, and you get an email when he does. Quick answers to common questions are in the chat bubble on More and in Training.
' + '
Public support page
' + '' + '
Your ticketsUpdatedStatus
' + (ts.length ? ts.map(t => '
' + (t.unread ? '' : '') + esc(t.subject) + '
' + esc(t.ref) + ' · ' + esc(t.category) + '
' + '' + esc(when(t.updated)) + '' + st(t.status) + '
').join('') : '
No tickets yet. When you send one, it shows up here with Marty\'s replies.
') + '
one shared desk for the Crypto Team Build Network · Marty answers every ticket himself
'; host().querySelectorAll('.rw[data-ref]').forEach(el => el.addEventListener('click', () => { history.replaceState(null, '', '#t=' + el.dataset.ref); open(el.dataset.ref); })); $('hNew').addEventListener('click', form); if (openNew) form(); } function form() { const box = $('hForm'); box.hidden = false; box.innerHTML = '

New ticket

' + '' + '' + '' + '
'; $('hnCancel').addEventListener('click', () => { box.hidden = true; box.innerHTML = ''; }); const send = $('hnSend'); send.addEventListener('click', async () => { if (send.disabled) return; send.disabled = true; try { const r = await CR.api('/api/my/support', { category: $('hnCat').value, subject: $('hnSubject').value, body: $('hnBody').value }); CR.toast('Sent: ticket ' + r.ref); history.replaceState(null, '', '#t=' + r.ref); open(r.ref); } catch (e) { const m = $('hnMsg'); m.className = 'hmsg bad'; m.textContent = e.message; send.disabled = false; } }); $('hnSubject').focus(); } async function open(ref) { host().innerHTML = '
loading
'; let v; try { v = await CR.get('/api/my/support/' + encodeURIComponent(ref)); } catch (e) { host().innerHTML = '
' + esc(e.message) + '
Back to your tickets
'; wireBack(); return; } draw(v); CR.helpBadge(); } const wireBack = () => { const a = $('hBack'); if (a) a.addEventListener('click', e => { e.preventDefault(); history.replaceState(null, '', location.pathname); list(); }); }; function draw(v) { const t = v.ticket; CR.sub(t.ref + ' · ' + (STATUS[t.status] || [t.status])[0].toLowerCase()); host().innerHTML = '
‹ All your tickets
' + '

' + esc(t.subject) + '

' + st(t.status) + '' + esc(t.ref) + ' · ' + esc(t.category) + ' · opened ' + esc(when(t.created)) + '
' + v.messages.map(m => '
' + esc(AUTHOR[m.author] || m.author) + '' + esc(when(m.created)) + '
' + linkify(m.body) + '
').join('') + (t.status === 'closed' ? 'This ticket is closed. Write below and it opens again.' : '') + '
' + '

Your reply

' + '
'; wireBack(); const btn = $('hrSend'); btn.addEventListener('click', async () => { if (btn.disabled) return; btn.disabled = true; try { const nv = await CR.api('/api/my/support/' + encodeURIComponent(t.ref) + '/reply', { body: $('hrBody').value }); draw(nv); CR.toast('Reply sent'); } catch (e) { const m = $('hrMsg'); m.className = 'hmsg bad'; m.textContent = e.message; btn.disabled = false; } }); } function route() { const ref = (/(?:^#|&)t=(LS-\d{4,9})/.exec(location.hash) || [])[1]; if (ref) return open(ref); list(/^#new\b/.test(location.hash)); } CR.requireSession(() => { route(); window.addEventListener('hashchange', route); }); })();