import { chromium } from 'playwright';
const b = await chromium.launch({ executablePath:'/usr/bin/chromium-browser', args:['--no-sandbox'] });
const ctx = await b.newContext({ viewport:{ width:390, height:1200 }, deviceScaleFactor:1.5, serviceWorkers:'block' });
await ctx.addInitScript(()=>{localStorage.setItem('sz_theme','dark');localStorage.setItem('sz_accent','green');});
const p = await ctx.newPage();
await p.goto('https://poly-dev.szhub.space/', { waitUntil:'domcontentloaded', timeout:35000 });
await p.waitForTimeout(5500);
const t1 = await p.evaluate(()=>document.querySelector('.pk-hh h1')?.innerText);
await p.click('.pk-ltoggle .pk-f', { timeout:6000 }).catch(e=>console.log('click',e.message));
await p.waitForTimeout(1200);
const t2 = await p.evaluate(()=>document.querySelector('.pk-hh h1')?.innerText);
const side = await p.evaluate(()=>document.querySelector('.pk-ltoggle')?.getAttribute('data-side'));
const av = await p.evaluate(()=>{const e=document.querySelector('.pk-cav');return e?getComputedStyle(e).backgroundImage:''});
await p.screenshot({ path:'_tg.png' });
console.log('title copyβfade:', t1, 'β', t2, '| data-side:', side, '| avatar:', av.includes('skull')?'skull':av.includes('shark')?'shark':av.slice(0,30));
await b.close();