{"html":"<!DOCTYPE html><html lang=\"en\"><head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n    <meta name=\"robots\" content=\"noindex, nofollow, noarchive\">\n    <meta http-equiv=\"Cache-Control\" content=\"no-cache, no-store, must-revalidate\">\n    <meta http-equiv=\"Pragma\" content=\"no-cache\">\n    <meta http-equiv=\"Expires\" content=\"0\">\n    <title>Verifying your browser...</title>\n    <style>\n        html, body { height: 100%; width: 100%; margin: 0; padding: 0; }\n        body {\n            font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n            background-color: #fff;\n            background-image: radial-gradient(at 13% 99%, hsla(258,0%,100%,1) 0px,transparent 50%),radial-gradient(at 72% 96%, hsla(32,0%,100%,1) 0px,transparent 50%),radial-gradient(at 87% 63%, hsla(122,0%,100%,1) 0px,transparent 50%),radial-gradient(at 49% 55%, hsla(126,0%,100%,1) 0px,transparent 50%),radial-gradient(at 51% 14%, hsla(202,0%,100%,1) 0px,transparent 50%),radial-gradient(at 13% 5%, hsla(242,0%,100%,1) 0px,transparent 50%),radial-gradient(at 37% 27%, hsla(323,100%,41%,1) 0px,transparent 50%),radial-gradient(at 11% 36%, hsla(225,73%,22%,1) 0px,transparent 50%),radial-gradient(at 85% 48%, hsla(323,100%,41%,1) 0px,transparent 50%),radial-gradient(at 84% 37%, hsla(225,73%,22%,1) 0px,transparent 50%);\n            position: relative;\n        }\n        #title {\n            -webkit-background-clip: text; -webkit-text-fill-color: transparent;\n            background-clip: text; background-image: linear-gradient(135deg,#d30082,#0f2463);\n            padding: 0; margin: 0; font-size: 21px;\n        }\n        #subtitle { text-align: center; font-size: 16px; padding: 10px 0; margin: 0; font-weight: 500; overflow-wrap: anywhere; }\n        #container {\n            width: 30em; max-width: calc(100% - 56px); box-sizing: border-box;\n            margin: 0 auto; box-shadow: rgba(255,255,255,.1) 0 1px 1px 0 inset,rgba(50,50,93,.25) 0 50px 100px -20px,rgba(0,0,0,.3) 0 30px 60px -30px;\n            background: #fff; border-radius: 5px; position: absolute; top: 50%; left: 50%;\n            transform: translate(-50%,-50%); text-align: center; padding: 35px 20px 30px;\n        }\n        #container p { font-size: 13px; }\n        hr { border: 0; border-top: .1em solid #f0f0f0; }\n        #status { color: #777; }\n        .spinner-container { display: flex; justify-content: center; align-items: center; }\n        .spinner { width: 32px; height: 32px; border: 3px solid #e5e9ef; border-top-color: #d30082; border-radius: 50%; margin-bottom: 24px; animation: spin .8s linear infinite; }\n        @keyframes spin { to { transform: rotate(360deg); } }\n        @media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }\n    </style>\n</head>\n<body>\n    <div id=\"container\">\n        <div class=\"spinner-container\"><div class=\"spinner\" aria-hidden=\"true\"></div></div>\n        <h1 id=\"title\">Verifying your browser...</h1>\n        <h2 id=\"subtitle\">www.iampsychiatry.uk</h2>\n        <hr>\n        <p>Your browser will redirect to your requested content shortly.</p>\n        <p id=\"status\" role=\"status\">Verifying your browser...</p>\n    </div>\n    <script>\n    (async function () {\n        'use strict';\n        const initUrl = \"/.well-known/challenge/pow/init\";\n        const verifyUrl = \"/.well-known/challenge/pow/verify\";\n        const returnTarget = \"/adult-adhd-assessments-and-treatments/\";\n        const sessionId = \"10cfc569c6c10d00da5dedd7\";\n        const status = document.getElementById('status');\n        document.getElementById('subtitle').textContent = window.location.hostname;\n\n        const workerSource = `\n            'use strict';\n            // Challenge tokens and nonces contain ASCII only.\n            // Avoid TextEncoder, which is unavailable in some older browsers.\n            function encodeAscii(value) {\n                const bytes = new Uint8Array(value.length);\n                for (let i = 0; i < value.length; i++) bytes[i] = value.charCodeAt(i);\n                return bytes;\n            }\n            const K = new Int32Array([\n                0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,\n                0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,\n                0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,\n                0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967,\n                0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,\n                0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,\n                0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,\n                0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2\n            ]);\n            const INITIAL = new Int32Array([\n                0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,\n                0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19\n            ]);\n            function rotr(x,n) { return (x >>> n) | (x << (32-n)); }\n            function sha256(bytes) {\n                const length = bytes.length;\n                const paddedLength = Math.ceil((length+9)/64)*64;\n                const data = new Uint8Array(paddedLength);\n                data.set(bytes);\n                data[length] = 0x80;\n                const bitLength = length*8;\n                const view = new DataView(data.buffer);\n                view.setUint32(paddedLength-8, Math.floor(bitLength/4294967296));\n                view.setUint32(paddedLength-4, bitLength >>> 0);\n                const H = new Int32Array(INITIAL);\n                const W = new Int32Array(64);\n                for(let offset=0;offset<paddedLength;offset+=64) {\n                    for(let i=0;i<16;i++) W[i]=view.getInt32(offset+i*4);\n                    for(let i=16;i<64;i++) {\n                        const x=W[i-15],y=W[i-2];\n                        const s0=rotr(x,7)^rotr(x,18)^(x>>>3);\n                        const s1=rotr(y,17)^rotr(y,19)^(y>>>10);\n                        W[i]=(W[i-16]+s0+W[i-7]+s1)|0;\n                    }\n                    let a=H[0],b=H[1],c=H[2],d=H[3];\n                    let e=H[4],f=H[5],g=H[6],hh=H[7];\n                    for(let i=0;i<64;i++) {\n                        const s1=rotr(e,6)^rotr(e,11)^rotr(e,25);\n                        const ch=(e&f)^(~e&g);\n                        const t1=(hh+s1+ch+K[i]+W[i])|0;\n                        const s0=rotr(a,2)^rotr(a,13)^rotr(a,22);\n                        const maj=(a&b)^(a&c)^(b&c);\n                        const t2=(s0+maj)|0;\n                        hh=g;g=f;f=e;e=(d+t1)|0;\n                        d=c;c=b;b=a;a=(t1+t2)|0;\n                    }\n                    H[0]=(H[0]+a)|0;H[1]=(H[1]+b)|0;\n                    H[2]=(H[2]+c)|0;H[3]=(H[3]+d)|0;\n                    H[4]=(H[4]+e)|0;H[5]=(H[5]+f)|0;\n                    H[6]=(H[6]+g)|0;H[7]=(H[7]+hh)|0;\n                }\n                const result=new Uint8Array(32);\n                const output=new DataView(result.buffer);\n                for(let i=0;i<8;i++) output.setInt32(i*4,H[i]);\n                return result;\n            }\n            function meetsDifficulty(hash,bits) {\n                for(let i=0;bits>0;i++) {\n                    const take=Math.min(8,bits);\n                    if((hash[i] >>> (8-take)) !== 0) return false;\n                    bits-=take;\n                }\n                return true;\n            }\n            self.onmessage=function(event) {\n                try {\n                    const data=event.data;\n                    if(data.action==='benchmark') {\n                        // Match the approximate length of the signed challenge token.\n                        const prefix=Array(221).join('a')+':';\n                        const start=performance.now();\n                        let count=0;\n                        do {\n                            sha256(encodeAscii(prefix+count.toString(16)));\n                            count++;\n                        } while(performance.now()-start<200 && count<1000000);\n                        const elapsed=Math.max(1,performance.now()-start);\n                        postMessage({action:'benchmark',hashes_per_second:Math.round(count*1000/elapsed),hashes:count,duration_ms:Math.round(elapsed)});\n                        return;\n                    }\n                    if(data.action==='solve') {\n                        const start=performance.now();\n                        const prefix=data.challenge+':';\n                        for(let i=0;i<=0xFFFFFFFF;i++) {\n                            const nonce=i.toString(16);\n                            if(meetsDifficulty(sha256(encodeAscii(prefix+nonce)),data.difficulty)) {\n                                postMessage({action:'solved',nonce:nonce,attempts:i+1,duration_ms:Math.round(performance.now()-start)});\n                                return;\n                            }\n                        }\n                        throw new Error('Nonce search exhausted');\n                    }\n                    throw new Error('Unknown worker action');\n                } catch(error) {\n                    postMessage({action:'error',message:String(error)});\n                }\n            };\n        `;\n\n        let worker = null;\n        let workerUrl = null;\n        function terminateWorker() {\n            if (worker) worker.terminate();\n            if (workerUrl) URL.revokeObjectURL(workerUrl);\n            worker = null;\n            workerUrl = null;\n        }\n        function createWorker() {\n            terminateWorker();\n            workerUrl = URL.createObjectURL(new Blob([workerSource], {type: 'text/javascript'}));\n            worker = new Worker(workerUrl);\n        }\n        function runWorker(message, timeoutMs) {\n            return new Promise(function (resolve, reject) {\n                let finished = false;\n                const timer = setTimeout(function () {\n                    finish(new Error('Worker timeout'));\n                }, timeoutMs);\n                function finish(error, result) {\n                    if (finished) return;\n                    finished = true;\n                    clearTimeout(timer);\n                    terminateWorker();\n                    if (error) reject(error);\n                    else resolve(result);\n                }\n                worker.onmessage = function (event) {\n                    if (event.data.action === 'error') finish(new Error(event.data.message));\n                    else finish(null, event.data);\n                };\n                worker.onerror = function () { finish(new Error('Worker execution failed')); };\n                try { worker.postMessage(message); }\n                catch (error) { finish(error); }\n            });\n        }\n\n        async function postJson(url, data) {\n            const response = await fetch(url, {\n                method: 'POST',\n                headers: {\n                    'Content-Type': 'application/json',\n                    'Cache-Control': 'no-cache'\n                },\n                cache: 'no-store',\n                credentials: 'same-origin',\n                body: JSON.stringify(data)\n            });\n        \n            if (!response.ok) {\n                throw new Error('HTTP ' + response.status);\n            }\n        \n            return response;\n        }\n        function deviceInfo() {\n            return {\n                screen_width: screen.width,\n                screen_height: screen.height,\n                viewport_width: window.innerWidth,\n                viewport_height: window.innerHeight,\n                pixel_ratio: window.devicePixelRatio || 1,\n                cpu_cores: navigator.hardwareConcurrency || null,\n                device_memory: navigator.deviceMemory || null,\n                touch_points: navigator.maxTouchPoints || 0\n            };\n        }\n\n        try {\n            status.textContent = 'Checking browser performance...';\n            createWorker();\n            let hashesPerSecond = 0;\n            try {\n                const benchmark = await runWorker({action: 'benchmark'}, 10000);\n                hashesPerSecond = benchmark.hashes_per_second;\n            } catch (error) {\n                // A failed benchmark should not prevent a challenge at minimum difficulty.\n                terminateWorker();\n            }\n            status.textContent = 'Preparing security verification...';\n            const initResponse = await postJson(initUrl, {\n                target: returnTarget,\n                session_id: sessionId,\n                hashes_per_second: hashesPerSecond,\n                device: deviceInfo()\n            });\n            const challenge = await initResponse.json();\n            \n            status.textContent = 'Verifying your browser...';\n            createWorker();\n            const solution = await runWorker({\n                action: 'solve', challenge: challenge.challenge, difficulty: challenge.difficulty\n            }, 240000);\n            \n            status.textContent = 'Completing verification...';\n            await postJson(verifyUrl, {\n                session_id: sessionId,\n                challenge: challenge.challenge,\n                nonce: solution.nonce,\n                solve_ms: solution.duration_ms\n            });\n            status.textContent = 'Verification complete. Redirecting...';\n            // Reload the original URL, not the internal challenge endpoint.\n            window.location.reload();\n        } catch (error) {\n            console.error('PoW verification failed:', error);\n            status.textContent = 'Verification could not be completed. Please refresh the page.';\n        } finally {\n            terminateWorker();\n        }\n    })();\n    </script>\n\n</body></html>"}