Стартовый контент kb-seed и макеты new_design

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deonisii
2026-10-04 12:09:44 +03:00
co-authored by Claude Opus 5.5
commit 9ed4d4ce43
100 changed files with 4694 additions and 0 deletions
+170
View File
@@ -0,0 +1,170 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="./support.js"></script>
</head>
<body>
<x-dc>
<div style="display:flex;flex-direction:column;gap:20px;font-family:'Onest',system-ui,sans-serif;color:var(--ink);font-size:18px;line-height:1.6;font-weight:var(--wb);text-wrap:pretty">
<sc-for list="{{ blocks }}" as="b" hint-placeholder-count="0">
<sc-if value="{{ b.isH2 }}"><h2 data-h="{{ b.hid }}" style="margin:14px 0 -4px;padding-top:22px;border-top:2px solid var(--ln);font-size:22px;line-height:1.25;font-weight:700">{{ b.t }}</h2></sc-if>
<sc-if value="{{ b.isH3 }}"><h3 style="margin:4px 0 -8px;font-size:19px;line-height:1.3;font-weight:700;color:var(--acc)">{{ b.t }}</h3></sc-if>
<sc-if value="{{ b.isP }}"><p style="margin:0"><sc-for list="{{ b.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><a href="#" onClick="{{ s.go }}" style="display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:2px 12px;margin:3px 0;border:var(--bw) solid var(--ink);border-radius:999px;background:var(--sf);color:var(--ink);font-size:15px;font-weight:600;text-decoration:none;vertical-align:middle;line-height:1.2"><span style="font-family:'Onest',system-ui,sans-serif">→</span><span>{{ s.t }}</span></a></sc-if></sc-for></p></sc-if>
<sc-if value="{{ b.isKey }}">
<section style="border:2px solid var(--ink);border-radius:16px;overflow:hidden;background:var(--sf)">
<div style="height:10px;background:repeating-linear-gradient(-45deg,#F5C400 0 10px,#141414 10px 20px)"></div>
<div style="display:flex;align-items:baseline;justify-content:space-between;padding:12px 16px 2px"><div style="font-size:15px;font-weight:700;letter-spacing:0.1em;text-transform:uppercase">Главное</div><div style="font-family:'Onest',system-ui,sans-serif;font-size:13px;color:var(--ink2)">{{ b.count }}</div></div>
<div style="display:grid;grid-template-columns:1fr 1fr;grid-auto-flow:dense;gap:8px;padding:10px 10px 10px">
<sc-for list="{{ b.items }}" as="k">
<sc-if value="{{ k.wide }}"><div style="grid-column:1 / -1;display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-radius:10px;background:var(--sf2);border:var(--bw) solid var(--ln)"><div style="font-size:15px;font-weight:600;color:var(--ink2);line-height:1.3">{{ k.label }}</div><div style="font-size:17px;line-height:1.45"><sc-for list="{{ k.segs }}" as="s"><sc-if value="{{ s.bold }}"><span style="font-size:19px;font-weight:700;color:var(--acc)">{{ s.t }}</span></sc-if><sc-if value="{{ s.notBold }}"><span style="color:var(--ink)">{{ s.t }}</span></sc-if></sc-for></div></div></sc-if>
<sc-if value="{{ k.narrow }}"><div style="display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-radius:10px;background:var(--sf2);border:var(--bw) solid var(--ln)"><div style="font-size:15px;font-weight:600;color:var(--ink2);line-height:1.3">{{ k.label }}</div><div style="line-height:1.35"><sc-for list="{{ k.segs }}" as="s"><sc-if value="{{ s.bold }}"><span style="font-size:21px;font-weight:700;color:var(--acc);line-height:1.25">{{ s.t }}</span></sc-if><sc-if value="{{ s.notBold }}"><span style="font-size:16px;color:var(--ink)">{{ s.t }}</span></sc-if></sc-for></div></div></sc-if>
</sc-for>
</div>
</section>
</sc-if>
<sc-if value="{{ b.isDanger }}">
<section role="alert" style="border:2px solid var(--redS);border-radius:14px;overflow:hidden;background:var(--redbg)">
<div style="display:flex;align-items:center;gap:10px;min-height:48px;padding:0 16px;background:var(--redS);color:#FFFFFF;font-size:15px;font-weight:700;letter-spacing:0.1em"><span style="flex:none;width:24px;height:24px;border-radius:50%;background:#FFFFFF;display:flex;align-items:center;justify-content:center"><span style="width:13px;height:4px;border-radius:1px;background:var(--redS)"></span></span>ЗАПРЕЩЕНО</div>
<div style="display:flex;flex-direction:column;gap:8px;padding:12px 16px 14px;color:var(--ink)"><sc-for list="{{ b.paras }}" as="p"><p style="margin:0"><sc-for list="{{ p.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--red)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><span style="font-weight:600;text-decoration:underline">{{ s.t }}</span></sc-if></sc-for></p></sc-for></div>
</section>
</sc-if>
<sc-if value="{{ b.isWarning }}">
<section style="border:2px solid var(--ambln);border-radius:14px;overflow:hidden;background:var(--ambbg)">
<div style="display:flex;align-items:center;gap:10px;min-height:48px;padding:0 16px;background:#F5C400;color:#141414;font-size:15px;font-weight:700;letter-spacing:0.1em"><span style="flex:none;position:relative;width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;border-bottom:20px solid #141414"><span style="position:absolute;left:-2px;top:6px;width:4px;height:8px;background:#F5C400;border-radius:1px"></span></span>ВНИМАНИЕ</div>
<div style="display:flex;flex-direction:column;gap:8px;padding:12px 16px 14px;color:var(--ink)"><sc-for list="{{ b.paras }}" as="p"><p style="margin:0"><sc-for list="{{ p.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><span style="font-weight:600;text-decoration:underline">{{ s.t }}</span></sc-if></sc-for></p></sc-for></div>
</section>
</sc-if>
<sc-if value="{{ b.isTip }}">
<section style="border:2px solid var(--grnS);border-radius:14px;background:var(--grnbg);padding:12px 16px 14px;display:flex;flex-direction:column;gap:6px">
<div style="display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;letter-spacing:0.1em;color:var(--grn)"><span style="flex:none;width:22px;height:22px;border-radius:6px;background:var(--grnS);display:flex;align-items:center;justify-content:center"><span style="width:6px;height:11px;border:solid #FFFFFF;border-width:0 2.5px 2.5px 0;transform:rotate(45deg) translate(-1px,-1px)"></span></span>СОВЕТ</div>
<sc-for list="{{ b.paras }}" as="p"><p style="margin:0"><sc-for list="{{ p.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><span style="font-weight:600;text-decoration:underline">{{ s.t }}</span></sc-if></sc-for></p></sc-for>
</section>
</sc-if>
<sc-if value="{{ b.isInfo }}">
<section style="border:2px solid var(--blu);border-radius:14px;background:var(--blubg);padding:12px 16px 14px;display:flex;flex-direction:column;gap:6px">
<div style="display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;letter-spacing:0.1em;color:var(--blu)"><span style="flex:none;width:22px;height:22px;border-radius:50%;border:2px solid var(--blu);display:flex;align-items:center;justify-content:center;font-family:'Onest',system-ui,sans-serif;font-size:13px;font-weight:700;letter-spacing:0">i</span>СПРАВКА</div>
<sc-for list="{{ b.paras }}" as="p"><p style="margin:0"><sc-for list="{{ p.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><span style="font-weight:600;text-decoration:underline">{{ s.t }}</span></sc-if></sc-for></p></sc-for>
</section>
</sc-if>
<sc-if value="{{ b.isUl }}">
<ul style="margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:10px"><sc-for list="{{ b.items }}" as="it"><li style="display:flex;gap:12px"><span style="flex:none;width:8px;height:8px;margin-top:10px;background:var(--ink)"></span><span><sc-for list="{{ it.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><a href="#" onClick="{{ s.go }}" style="display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:2px 12px;margin:3px 0;border:var(--bw) solid var(--ink);border-radius:999px;background:var(--sf);color:var(--ink);font-size:15px;font-weight:600;text-decoration:none;vertical-align:middle;line-height:1.2"><span style="font-family:'Onest',system-ui,sans-serif">→</span><span>{{ s.t }}</span></a></sc-if></sc-for></span></li></sc-for></ul>
</sc-if>
<sc-if value="{{ b.isCheck }}">
<section style="border:var(--bw) solid var(--ln);border-radius:14px;background:var(--sf);overflow:hidden;box-shadow:var(--sh)">
<div style="display:flex;align-items:center;gap:10px;padding:6px 6px 6px 16px">
<div style="flex:1;font-size:14px;font-weight:700;letter-spacing:0.1em;text-transform:uppercase">Чек-лист</div>
<div style="font-family:'Onest',system-ui,sans-serif;font-size:18px;font-weight:600">{{ b.doneN }} из {{ b.total }}</div>
<button onClick="{{ b.reset }}" style="min-height:48px;padding:0 12px;border:0;background:transparent;color:var(--ink2);font-size:15px;font-weight:600;text-decoration:underline;cursor:pointer">Сбросить</button>
</div>
<div style="height:4px;background:var(--sf2)"><div style="{{ b.barStyle }}"></div></div>
<sc-for list="{{ b.items }}" as="it">
<button onClick="{{ it.toggle }}" style="display:flex;align-items:flex-start;gap:14px;width:100%;min-height:60px;padding:15px 16px;border:0;border-top:var(--bw) solid var(--ln);background:transparent;text-align:left;cursor:pointer;font-size:18px;line-height:1.5;color:var(--ink)">
<sc-if value="{{ it.off }}"><span style="flex:none;width:30px;height:30px;border:2px solid var(--ink);border-radius:8px;background:var(--sf)"></span></sc-if>
<sc-if value="{{ it.on }}"><span style="flex:none;width:30px;height:30px;border-radius:8px;background:var(--grnS);display:flex;align-items:center;justify-content:center"><span style="width:8px;height:15px;border:solid #FFFFFF;border-width:0 3px 3px 0;transform:rotate(45deg) translate(-1px,-2px)"></span></span></sc-if>
<span style="{{ it.rowStyle }}"><sc-for list="{{ it.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><span style="font-weight:600;text-decoration:underline">{{ s.t }}</span></sc-if></sc-for></span>
</button>
</sc-for>
</section>
</sc-if>
<sc-if value="{{ b.isOl }}">
<ol style="margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:10px"><sc-for list="{{ b.items }}" as="it"><li style="display:flex;gap:14px;padding:16px 16px 16px 14px;background:var(--sf);border:var(--bw) solid var(--ln);border-radius:14px;box-shadow:var(--sh)"><span style="flex:none;width:44px;height:44px;border-radius:4px;background:var(--hl);color:#141414;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700">{{ it.n }}</span><div style="display:flex;flex-direction:column;gap:4px;min-width:0"><div style="font-size:18px;font-weight:700;line-height:1.3">{{ it.title }}</div><div><sc-for list="{{ it.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-weight:var(--ws);color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><span style="font-weight:600;text-decoration:underline">{{ s.t }}</span></sc-if></sc-for></div></div></li></sc-for></ol>
</sc-if>
<sc-if value="{{ b.isKv }}">
<div style="border:var(--bw) solid var(--ln);border-radius:14px;background:var(--sf);overflow:hidden">
<div style="display:flex;justify-content:space-between;padding:10px 16px;background:var(--sf2);font-size:14px;font-weight:700;color:var(--ink2)"><span>{{ b.h0 }}</span><span>{{ b.h1 }}</span></div>
<sc-for list="{{ b.rows }}" as="r"><div style="display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:10px 16px;border-top:var(--bw) solid var(--ln)"><span style="flex:1;min-width:0;line-height:1.35"><sc-for list="{{ r.k }}" as="s"><span>{{ s.t }}</span></sc-for></span><span style="font-size:19px;font-weight:700;white-space:nowrap;color:var(--acc)"><sc-for list="{{ r.v }}" as="s"><span>{{ s.t }}</span></sc-for></span></div></sc-for>
</div>
</sc-if>
<sc-if value="{{ b.isCards }}">
<div style="display:flex;flex-direction:column;gap:8px"><sc-for list="{{ b.rows }}" as="r"><div style="padding:14px 16px;border:var(--bw) solid var(--ln);border-radius:14px;background:var(--sf);display:flex;flex-direction:column;gap:8px"><div style="font-weight:700;line-height:1.3">{{ r.title }}</div><sc-for list="{{ r.cells }}" as="c"><div style="display:flex;gap:12px;align-items:baseline"><span style="flex:none;width:84px;font-size:14px;color:var(--ink2)">{{ c.label }}</span><span><sc-for list="{{ c.segs }}" as="s"><sc-if value="{{ s.plain }}"><span>{{ s.t }}</span></sc-if><sc-if value="{{ s.bold }}"><strong style="font-size:18px;font-weight:700;color:var(--acc)">{{ s.t }}</strong></sc-if><sc-if value="{{ s.link }}"><span style="font-weight:600;text-decoration:underline">{{ s.t }}</span></sc-if></sc-for></span></div></sc-for></div></sc-for></div>
</sc-if>
<sc-if value="{{ b.isFigs }}">
<div style="display:flex;flex-direction:column;gap:14px">
<sc-for list="{{ b.first }}" as="f">
<figure style="margin:0;display:flex;flex-direction:column;gap:8px">
<button onClick="{{ f.open }}" style="position:relative;display:block;width:100%;padding:0;border:var(--bw) solid var(--ln);border-radius:12px;overflow:hidden;background:var(--sf2);cursor:zoom-in">
<sc-if value="{{ f.has }}"><img src="{{ f.src }}" alt="{{ f.cap }}" style="display:block;width:100%;height:auto"></sc-if>
<sc-if value="{{ f.miss }}"><div style="aspect-ratio:4 / 3;display:flex;align-items:center;justify-content:center;background:repeating-linear-gradient(135deg,var(--sf2) 0 12px,var(--sf) 12px 24px);font-family:'Onest',system-ui,sans-serif;font-size:13px;color:var(--ink2)">фото · {{ f.file }}</div></sc-if>
<span style="position:absolute;right:10px;bottom:10px;min-height:36px;padding:0 14px;display:flex;align-items:center;border-radius:999px;background:rgba(0,0,0,0.75);color:#FFFFFF;font-size:14px;font-weight:600">Увеличить</span>
</button>
<figcaption style="font-size:15px;line-height:1.4;color:var(--ink2)">{{ f.cap }}</figcaption>
</figure>
</sc-for>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:12px">
<sc-for list="{{ b.rest }}" as="f">
<figure style="margin:0;display:flex;flex-direction:column;gap:6px">
<button onClick="{{ f.open }}" style="display:block;width:100%;padding:0;border:var(--bw) solid var(--ln);border-radius:10px;overflow:hidden;background:var(--sf2);cursor:zoom-in">
<sc-if value="{{ f.has }}"><img src="{{ f.src }}" alt="{{ f.cap }}" style="display:block;width:100%;aspect-ratio:1 / 1;object-fit:cover"></sc-if>
<sc-if value="{{ f.miss }}"><div style="aspect-ratio:1 / 1;display:flex;align-items:center;justify-content:center;background:repeating-linear-gradient(135deg,var(--sf2) 0 10px,var(--sf) 10px 20px);font-family:'Onest',system-ui,sans-serif;font-size:12px;color:var(--ink2)">{{ f.file }}</div></sc-if>
</button>
<figcaption style="font-size:14px;line-height:1.35;color:var(--ink2)">{{ f.cap }}</figcaption>
</figure>
</sc-for>
</div>
</div>
</sc-if>
</sc-for>
</div>
</x-dc>
<script type="text/x-dc" data-dc-script data-props="{&quot;$preview&quot;:{&quot;width&quot;:390,&quot;height&quot;:900},&quot;md&quot;:{&quot;editor&quot;:&quot;text&quot;,&quot;default&quot;:&quot;&quot;,&quot;tsType&quot;:&quot;string&quot;},&quot;onImage&quot;:{&quot;editor&quot;:null,&quot;tsType&quot;:&quot;(i:number, figs:any[])=&gt;void&quot;},&quot;keyLayout&quot;:{&quot;editor&quot;:&quot;enum&quot;,&quot;options&quot;:[&quot;grid&quot;,&quot;list&quot;],&quot;default&quot;:&quot;grid&quot;,&quot;tsType&quot;:&quot;'grid'|'list'&quot;}}">
const TITLES={'stoyka-vezda-slabotochka':'Слаботочка, MOXA, SIP, камеры','stoyka-vezda-silovoe':'Силовое расключение и УЗИП','stoyka-vezda-razmeshenie':'Где что стоит','shkon':'ШКОН — монтаж и сварка','shkos':'ШКОС 1U — монтаж и сварка','uzly-krepleniya-vok':'Узлы крепления ВОК','uzel-fotoelementa':'Узел фотоэлемента','kreplenie-tablo':'Крепление табло','fundament-ostrova':'Фундамент острова','navesy-terminala':'Навесы терминала'};
const IMG={'assets/rack-lowcurrent/fig-4.jpg':'assets/rack-fig-4.jpg','assets/shkon/fig-2.jpg':'assets/shkon-fig-2.jpg'};
const stop=e=>e.preventDefault();
function inl(s){const out=[];const re=/\*\*(.+?)\*\*|\[\[([a-z0-9-]+)\]\]/g;let m,last=0;
while((m=re.exec(s))){if(m.index>last)out.push({t:s.slice(last,m.index),plain:true,notBold:true});
if(m[1])out.push({t:m[1],bold:true});else out.push({t:TITLES[m[2]]||m[2],link:true,notBold:true,go:stop});last=re.lastIndex}
if(last<s.length)out.push({t:s.slice(last),plain:true,notBold:true});return out}
const txt=segs=>segs.map(x=>x.t).join('');
function parse(md,open){
md=md.replace(/^---[\s\S]*?\n---\n/,'');const L=md.split('\n');const B=[];const figs=[];let i=0,g=0,h=0;
while(i<L.length){const l=L[i];let m;
if(!l.trim()){i++;continue}
if((m=l.match(/^:::(\w+)/))){const kind=m[1];const body=[];i++;while(i<L.length&&!L[i].startsWith(':::')){if(L[i].trim())body.push(L[i]);i++}i++;
if(kind==='keyfacts'){const items=body.map(x=>x.replace(/^- /,'')).map(x=>{const c=x.indexOf(':');const has=c>-1&&c<44;const segs=inl(has?x.slice(c+1).trim():x);const w=txt(segs).length>24;return{label:has?x.slice(0,c):'',segs,wide:w,narrow:!w}});
B.push({isKey:true,items,count:items.length+(items.length<5?' пункта':' пунктов')})}
else B.push({['is'+kind[0].toUpperCase()+kind.slice(1)]:true,paras:body.map(x=>({segs:inl(x.replace(/^- /,''))}))});continue}
if(l.startsWith('### ')){B.push({isH3:true,t:l.slice(4)});i++;continue}
if(l.startsWith('## ')){B.push({isH2:true,t:l.slice(3),hid:String(h++)});i++;continue}
if(/^- \[[ x]\] /.test(l)){const items=[];while(i<L.length&&/^- \[[ x]\] /.test(L[i])){items.push({segs:inl(L[i].slice(6))});i++}B.push({isCheck:true,gid:g++,items});continue}
if(l.startsWith('- ')){const items=[];while(i<L.length&&L[i].startsWith('- ')){items.push({segs:inl(L[i].slice(2))});i++}B.push({isUl:true,items});continue}
if(/^\d+\. /.test(l)){const items=[];while(i<L.length&&/^\d+\. /.test(L[i])){const n=L[i].match(/^(\d+)\. /)[1];let t=L[i].replace(/^\d+\. /,'');let title='';const mm=t.match(/^\*\*(.+?)\*\*\s*/);if(mm){title=mm[1];t=t.slice(mm[0].length)}items.push({n,title,segs:inl(t)});i++}B.push({isOl:true,items});continue}
if(l.startsWith('|')){const rows=[];while(i<L.length&&L[i].startsWith('|')){if(!/^\|[\s\-:|]+\|\s*$/.test(L[i]))rows.push(L[i].trim().slice(1,-1).split('|').map(c=>c.trim()));i++}
const head=rows[0]||[],body=rows.slice(1);
if(head.length===2)B.push({isKv:true,h0:head[0],h1:head[1],rows:body.map(r=>({k:inl(r[0]||''),v:inl(r[1]||'')}))});
else B.push({isCards:true,rows:body.map(r=>({title:r[0],cells:r.slice(1).map((c,j)=>({label:head[j+1],segs:inl(c)}))}))});continue}
if(l.startsWith('![')){const items=[];while(i<L.length&&L[i].startsWith('![')){const mm=L[i].match(/^!\[(.*?)\]\((.*?)\)/);if(mm){const raw=mm[2];const src=IMG[raw]||(/^(blob:|data:|assets\/(rack|shkon)-fig)/.test(raw)?raw:'');const f={cap:mm[1],src,has:!!src,miss:!src,file:raw.startsWith('blob:')?'загружено':raw.split('/').pop(),idx:figs.length};f.open=()=>open(f.idx,figs);figs.push(f);items.push(f)}i++}
B.push({isFigs:true,first:items.slice(0,1),rest:items.slice(1)});continue}
B.push({isP:true,segs:inl(l)});i++}
return B}
class Component extends DCLogic{
state={done:{}};
renderVals(){
const md=this.props.md||'';
if(md!==this._md){this._md=md;this._b=parse(md,(i,f)=>this.props.onImage&&this.props.onImage(i,f))}
const list=this.props.keyLayout==='list';const done=this.state.done;
const blocks=this._b.map(b=>{
if(b.isKey&&list)return{...b,items:b.items.map(k=>({...k,wide:true,narrow:false}))};
if(!b.isCheck)return b;
const items=b.items.map((it,j)=>{const k=b.gid+'-'+j;const on=!!done[k];return{...it,on,off:!on,toggle:()=>this.setState(s=>({done:{...s.done,[k]:!s.done[k]}})),rowStyle:{opacity:on?0.5:1,textDecoration:on?'line-through':'none',paddingTop:'2px'}}});
const n=items.filter(x=>x.on).length;
return{...b,items,doneN:n,total:items.length,barStyle:{width:(n/items.length*100)+'%',height:'100%',background:'var(--grnS)',transition:'width .2s'},
reset:()=>this.setState(s=>{const d={...s.done};items.forEach((_,j)=>delete d[b.gid+'-'+j]);return{done:d}})}});
return{blocks};
}
}
</script>
</body>
</html>