// Draws a check: progress steps while it runs, then the scorecard (free) or the full report (deep).
// Facts (tagged, linked) and opinion (scores, grade, verdict) are kept apart, with the opinion line under every scorecard and grade.
// No ad is ever drawn inside this output.
var Render = (function () {
'use strict';
var esc = WWI.esc;
var CATS = [['control', 'Control and upgradeability', 25], ['custody', 'Custody and exit paths', 25], ['economics', 'Economic design', 20], ['insiders', 'Insider flows', 15], ['disclosure', 'Disclosure vs code', 10], ['trajectory', 'Trajectory', 5]];
var OPINION = 'Scores and grade are our opinion, based on our published rubric applied to the public facts below.';
function link(text, ex) {
var s = esc(text);
if (!ex) return s;
return s.replace(/0x[0-9a-fA-F]{64}(?![0-9a-fA-F])/g, function (h) { return '' + h.slice(0, 10) + '...' + h.slice(-6) + ''; })
.replace(/0x[0-9a-fA-F]{40}(?![0-9a-fA-F])/g, function (a) { return '' + a.slice(0, 6) + '...' + a.slice(-4) + ''; });
}
function steps(v) {
return '
' + (g.forced_by_flag ? 'One critical flag caps the grade at High, whatever the other scores. ' : '') + 'Our opinion, from the published rubric applied to the public facts.
' : '') + '
';
var main = '';
if (v.report) main += scorecard(v, ex);
else main += '
' + esc((v.factcheck && v.factcheck.note) || 'No written report for this check.') + '
';
main += factsBlock(v, ex);
if (v.pickedNote) main += '
Contract: ' + link(v.pickedNote, ex) + '
';
if (v.chainRead && v.chainRead.window) main += '
Range read: blocks ' + v.chainRead.window.from + ' to ' + v.chainRead.window.to + (v.chainRead.window.complete_history ? ', the complete history since deployment.' : ', a partial window (' + esc(v.chainRead.window.from_time_ct || '') + ' onward).') + ((v.chainRead.gaps || []).length ? ' Some ranges could not be read: see the facts marked UNKNOWN.' : '') + '
';
var side = '
' + (v.hasShot ? '' : '[No website screenshot for this check]') + '
'
+ '
Website claims vs code' + (v.report && v.report.site_vs_code ? link(v.report.site_vs_code, ex) : v.website ? 'No comparison in this check.' : 'No website was entered.') + ''
+ (v.website ? '' + esc(v.website) + '' : '') + '
';
if (v.kind === 'free') side += '
In the deep reportEvery exit path ranked · the full money trail with named wallets · the operator wallet ring · the promise math worked out · wallet approvals at risk · the upgrade timeline with transaction links · what the evidence cannot answer