<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8">
<title>Weryfikacja bezpiecze&#324;stwa &middot; JDM Shield</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<style>
:root{
--teal:#1accc2;--ink:#16242a;--muted:#5c7078;--faint:#93a6ac;--ok:#22c55e;--bad:#ef4444;
}
*{margin:0;padding:0;box-sizing:border-box}
html{font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
body{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;color:var(--ink);padding:24px 24px 0;background:#fff}
main{flex:1;width:100%;max-width:440px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:16px 0}
.card{width:100%;padding:8px 24px;display:flex;flex-direction:column;align-items:center}
#hero{width:84px;height:84px;display:flex;align-items:center;justify-content:center;margin-bottom:20px}
.ring{width:76px;height:76px;border-radius:50%;border:5px solid rgba(26,204,194,.16);border-top-color:var(--teal);animation:spin .9s linear infinite}
.badge{width:76px;height:76px;border-radius:50%;display:none;align-items:center;justify-content:center;animation:pop .36s cubic-bezier(.2,.9,.3,1.4)}
.badge svg{width:34px;height:34px}
.ok{background:var(--ok)}.bad{background:var(--bad)}
body[data-state="success"] .ring,body[data-state="error"] .ring{display:none}
body[data-state="success"] .ok{display:flex}
body[data-state="error"] .bad{display:flex}
h1{font-size:21px;line-height:28px;font-weight:700;margin-bottom:7px}
#sub{font-size:14.5px;line-height:22px;color:var(--muted)}
.note{margin-top:18px;font-size:12.5px;line-height:19px;color:var(--faint);max-width:380px}
footer{flex-shrink:0;padding:14px 0;padding-bottom:calc(14px + env(safe-area-inset-bottom));font-size:12px;color:var(--faint)}
noscript{display:block;margin-bottom:16px;padding:11px 16px;background:#fff4f4;color:#d33;border:1px solid #f6d4d4;border-radius:10px;font-size:13.5px}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pop{0%{transform:scale(.5);opacity:0}100%{transform:scale(1);opacity:1}}
@media(max-width:480px){body{padding:16px 16px 0}.card{padding:8px 16px}h1{font-size:19px}.note{display:none}}
@media(prefers-reduced-motion:reduce){
.ring{animation:none}
.badge{animation:none}
}
@media(prefers-color-scheme:dark){
:root{--ink:#e8f2f1;--muted:#9fb3b8;--faint:#7c9196}
body{background:#0d1416}
noscript{background:#2a1516;color:#f7a5a5;border-color:#4a2224}
}
</style>
</head>
<body data-state="verifying">
<main>
<noscript>Ta strona wymaga w&#322;&#261;czonego JavaScript. / This page requires JavaScript.</noscript>

<div class="card">
<div id="hero">
<div class="ring"></div>
<div class="badge ok"><svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg></div>
<div class="badge bad"><svg viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/></svg></div>
</div>
<h1 id="title">Weryfikacja bezpiecze&#324;stwa</h1>
<p id="sub">Sprawdzamy Twoje po&#322;&#261;czenie&hellip;</p>
</div>

<p class="note">Ten proces jest automatyczny i&nbsp;trwa kilka sekund. / This process is automatic and takes a few seconds.</p>
</main>

<footer>Ochrona JDM Shield</footer>

<script id="worker-src" type="javascript/worker">
self.onmessage=function(e){
var d=e.data;
var nonce=d.nonce;
var difficulty=d.difficulty;
var start=d.start;
var step=d.step;
var max=d.max;

function checkZeros(hex,bits){
var fc=Math.floor(bits/4);
var rb=bits%4;
for(var i=0;i<fc;i++){if(hex.charAt(i)!=='0')return false;}
if(rb>0){var n=parseInt(hex.charAt(fc),16);if(n>=(1<<(4-rb)))return false;}
return true;
}

var counter=start;
var batch=500;

async function run(){
while(counter<max){
for(var i=0;i<batch;i++){
var msg=nonce+counter.toString();
var buf=await crypto.subtle.digest('SHA-256',new TextEncoder().encode(msg));
var arr=new Uint8Array(buf);
var hex='';
for(var j=0;j<arr.length;j++){hex+=arr[j].toString(16).padStart(2,'0');}
if(checkZeros(hex,difficulty)){
self.postMessage({found:true,solution:counter.toString()});
return;
}
counter+=step;
}
self.postMessage({found:false,progress:counter});
}
self.postMessage({found:false,timeout:true});
}
run();
};
</script>

<script>
(function(){
var NONCE='a3b0cb1ce5680c96f016564b8c8224a5';
var TIMESTAMP='1796244153';
var TOKEN='0f0fca803ac493ef06786881df2d5701a158496034a189e81c751a140d49ba1c';
var DIFFICULTY=parseInt('19');
var REDIRECT=window.location.pathname+window.location.search;

var body=document.body;
var titleEl=document.getElementById('title');
var subEl=document.getElementById('sub');
var noteEl=document.querySelector('.note');

// Język: polski dla przeglądarek pl*, angielski dla pozostałych.
var LANG=((navigator.language||navigator.userLanguage||'en').toLowerCase().indexOf('pl')===0)?'pl':'en';

// [tytuł, opis] per stan, per język
var T={
verifying:{pl:['Weryfikacja bezpieczeństwa','Sprawdzamy Twoje połączenie…'],en:['Security check','Checking your connection…']},
success:{pl:['Zweryfikowano','Wszystko gotowe.'],en:['Verified','All done.']},
redirecting:{pl:['Otwieramy stronę…','Trwa ładowanie, nie zamykaj tej karty.'],en:['Opening the site…','Loading, please keep this tab open.']}
};
var ERR_TITLE={pl:'Nie udało się zweryfikować',en:'Verification failed'};
var ERR={
timeout:{pl:'Przekroczono limit czasu',en:'Verification timed out'},
nosupport:{pl:'Przeglądarka nie wspiera weryfikacji',en:'Browser does not support verification'}
};
var NOTE={pl:'Ten proces jest automatyczny i trwa kilka sekund.',en:'This process is automatic and takes a few seconds.'};

function setState(s){
body.dataset.state=s;
var t=T[s]&&T[s][LANG];
if(t){titleEl.textContent=t[0];subEl.textContent=t[1];}
}

function showError(key){
body.dataset.state='error';
titleEl.textContent=ERR_TITLE[LANG];
subEl.textContent=(ERR[key]&&ERR[key][LANG])||'';
}

if(noteEl){noteEl.textContent=NOTE[LANG];}
setState('verifying');

function submitSolution(solution){
setState('success');
setTimeout(function(){
// Switch to an animated "loading" state BEFORE navigating. CSS animations keep
// running until the target page paints, so the user sees continuous motion
// (spinner) instead of a frozen "success" screen.
setState('redirecting');
var f=document.createElement('form');
f.method='POST';
f.action='/_jdm_challenge/verify';
f.style.display='none';
var fields={nonce:NONCE,ts:TIMESTAMP,token:TOKEN,solution:solution,redirect_to:REDIRECT};
for(var k in fields){
var inp=document.createElement('input');
inp.type='hidden';
inp.name=k;
inp.value=fields[k];
f.appendChild(inp);
}
document.body.appendChild(f);
f.submit();
},700);
}

function solveWithWorkers(){
var workerSrc=document.getElementById('worker-src').textContent;
var blob=new Blob([workerSrc],{type:'text/javascript'});
var url=URL.createObjectURL(blob);
var cores=Math.min(Math.max(Math.floor((navigator.hardwareConcurrency||2)/2),1),8);
var workers=[];
var solved=false;
var max=20000000;

for(var i=0;i<cores;i++){
(function(idx){
var w=new Worker(url);
w.onmessage=function(e){
if(solved)return;
if(e.data.found){
solved=true;
for(var j=0;j<workers.length;j++){workers[j].terminate();}
URL.revokeObjectURL(url);
submitSolution(e.data.solution);
}else if(e.data.timeout){
solved=true;
for(var j=0;j<workers.length;j++){workers[j].terminate();}
URL.revokeObjectURL(url);
showError('timeout');
}
};
w.postMessage({nonce:NONCE,difficulty:DIFFICULTY,start:idx,step:cores,max:max});
workers.push(w);
})(i);
}
}

function solveSingleThread(){
var counter=0;
var batch=2000;
var max=20000000; // jak w sciezce wielowatkowej — 10M przy trudnosci 21 dawalo falszywe timeouty

async function sha256(msg){
var buf=await crypto.subtle.digest('SHA-256',new TextEncoder().encode(msg));
var arr=new Uint8Array(buf);
var hex='';
for(var i=0;i<arr.length;i++){hex+=arr[i].toString(16).padStart(2,'0');}
return hex;
}

function checkZeros(hex,bits){
var fc=Math.floor(bits/4);
var rb=bits%4;
for(var i=0;i<fc;i++){if(hex.charAt(i)!=='0')return false;}
if(rb>0){var n=parseInt(hex.charAt(fc),16);if(n>=(1<<(4-rb)))return false;}
return true;
}

async function run(){
while(counter<max){
for(var i=0;i<batch;i++){
var hash=await sha256(NONCE+counter.toString());
if(checkZeros(hash,DIFFICULTY)){
submitSolution(counter.toString());
return;
}
counter++;
}
await new Promise(function(r){setTimeout(r,0);});
}
showError('timeout');
}
run();
}

function start(){
if(!(window.crypto&&window.crypto.subtle)){
showError('nosupport');
return;
}
try{
if(typeof Worker!=='undefined'){
solveWithWorkers();
}else{
solveSingleThread();
}
}catch(e){
solveSingleThread();
}
}

setTimeout(start,200);
})();
</script>
</body>
</html>
