export const torrentGeneralDetailsSource = " function formatDateTime(seconds){ const n=Number(seconds||0); if(!n) return '-'; try{ return new Date(n*1000).toLocaleString(); }catch(e){ return '-'; } }\n function joinRemotePath(base,name){\n const b=String(base||'').trim();\n const n=String(name||'').trim();\n if(!b && !n) return '-';\n if(!n) return b || '-';\n if(!b) return n;\n return `${b.replace(/\\/+$/,'')}/${n.replace(/^\\/+/,'')}`;\n }\n function generalInfoItem(label, value, className=''){\n const modifier = className ? ` ${className}` : '';\n return `
${esc(value || '-')}`;\n }\n function renderGeneral(){\n const t=torrents.get(selectedHash);\n if(!t){ $('detailPane').innerHTML='Select a torrent.'; return; }\n const labels=labelNames(t.label).map(l=>` ${esc(l)}`).join(' ') || '-';\n const ratioGroup=t.ratio_group ? `${esc(t.ratio_group)}` : 'Not assigned';\n const statusClass=t.status==='Seeding'?'success':t.status==='Downloading'?'primary':t.status==='Checking'?'warning':t.status==='Paused'?'secondary':t.status==='Stopped'?'dark':'secondary';\n const fullPath=joinRemotePath(t.path,t.name);\n const stats=[\n ['Size', esc(t.size_h||'-')],\n ['Done', `${esc(t.progress??0)}%`],\n ['Downloaded', esc(t.down_total_h||'-')],\n ['Uploaded', esc(t.up_total_h||'-')],\n ['Ratio', esc(t.ratio??'-')],\n ['DL / UL', `${esc(t.down_rate_h||'-')} / ${esc(t.up_rate_h||'-')}`],\n ['Seeds / Peers', `${esc(t.seeds??0)} / ${esc(t.peers??0)}`],\n ['ETA', esc(t.eta_h||'-')],\n ['Priority', esc(t.priority??'-')],\n ['Created', esc(formatDateTime(t.created))],\n ['Last activity', esc(formatDateTime(t.last_activity))],\n ].map(([label,value])=>generalInfoItem(label,value)).join('');\n const meta=[\n generalInfoItem('Directory', generalCodeValue(t.path)),\n generalInfoItem('Full data path', generalCodeValue(fullPath)),\n generalInfoItem('Hash', generalCodeValue(t.hash)),\n generalInfoItem('Labels', labels),\n generalInfoItem('Ratio rule', ratioGroup),\n ].join('');\n // Note: General details keep path-like values in code blocks for easier copying and omit tracker message because it is shown in Log.\n $('detailPane').innerHTML=`\n