cfpilot 0.13.1 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/assets/control.js +1 -1
- package/assets/dataplane.js +5 -5
- package/assets/worker.js +18 -16
- package/dist/cli.js +1181 -141
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,6 +64,28 @@ cfpilot config --token <TOKEN> # 配置管理
|
|
|
64
64
|
|
|
65
65
|
完整参数见 `cfpilot scan --help`。
|
|
66
66
|
|
|
67
|
+
### 实验性出口识别
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cfpilot egress-identify --url https://identity.example.com/identify --proxy socks5://127.0.0.1:10808
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
仅调用用户自有 HTTPS 识别服务,返回**指定传输路径**观察到的公网出口;省略 `--proxy` 时仅测 CLI 本机直连基线。不绑定候选 IP,不参与默认 `scan`、排序或回填,也不代表逐入口 IP 或 Worker 出口差异。
|
|
74
|
+
|
|
75
|
+
服务返回 `application/json`,必填 `remote_ip`(实际 TCP 对端的公网 IPv4/IPv6)、`observed_at`(带时区 RFC3339),可选 `egress_kind`、`colo`。不得直接信任客户端 XFF。观察超过五分钟或未来超过 30 秒则拒绝;总超时八秒、响应体最多 16 KiB,不接受压缩或重定向。
|
|
76
|
+
|
|
77
|
+
可选专用短期 Bearer token 通过 `CFPILOT_EGRESS_TOKEN` 提供,同时设置 `CFPILOT_EGRESS_TOKEN_EXPIRES_AT`(剩余有效期须在五分钟以内);服务端仍须独立校验真实有效期和专用权限。代理凭据可用 `CFPILOT_EGRESS_PROXY`,凭据不落盘、不输出,代理失败不回退直连。完整命令见 `cfpilot egress-identify --help`,服务协议见源码包内 `EXPERIMENTAL-EGRESS.md`。
|
|
78
|
+
|
|
79
|
+
### 实验性网站兼容性
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
cfpilot website-check --url https://site.example.com/check --label site --expected-text ready --proxy socks5://127.0.0.1:10808
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
仅检测用户明确指定的 HTTPS 目标,省略代理时是直连基线,不登录、不执行脚本、不发送识别 token,不宣称账号权限或完整解锁。默认只判定 2xx;可用 `--expected-text` 要求正文包含标记。挑战、403 禁止、429 限流、TLS 错误、超时和其他 HTTP 错误分别输出,不跟随重定向;响应最多 16 KiB、总超时八秒。
|
|
86
|
+
|
|
87
|
+
命令输出 `{targets:[...]}`,目标字段与质量报告兼容,不接入默认 `scan` 或排序,不读写扫描历史。模块支持最多十个目标串行检测;完整说明见源码包内 `EXPERIMENTAL-WEBSITES.md` 和 `cfpilot website-check --help`。
|
|
88
|
+
|
|
67
89
|
## 部署代码可以独立更新
|
|
68
90
|
|
|
69
91
|
部署用的内核产物(数据面 / 控制面)**不随应用版本绑死**:
|
package/assets/control.js
CHANGED
|
@@ -3,7 +3,7 @@ const __sfx=(()=>{const __t=new TextDecoder(),__c=new Map();return b=>{let v=__c
|
|
|
3
3
|
`))),a){let O=""+w+__sfx("IFRyb2phbg==");r.push(O),n.push([__sfx("ICAtIG5hbWU6IA==")+B(O)+"",__sfx("ICAgIHR5cGU6IHRyb2phbg=="),__sfx("ICAgIHBhc3N3b3JkOiA=")+B(t.config.trojanPassword)+"",__sfx("ICAgIHNlcnZlcjog")+d.ip+"",__sfx("ICAgIHBvcnQ6IA==")+F+"",__sfx("ICAgIG5ldHdvcms6IHdz"),__sfx("ICAgIHRsczogdHJ1ZQ=="),__sfx("ICAgIHNuaTog")+t.domain+"",__sfx("ICAgIGNsaWVudC1maW5nZXJwcmludDog")+t.config.clientFingerprint+"",...l()," ws-opts:",__sfx("ICAgICAgcGF0aDog")+B(t.config.trojanPath)+""," headers:",` Host: ${t.domain}`].join(`
|
|
4
4
|
`))}}});e.push(__sfx("IyBDRlBpbG90IOiHquWKqOeUn+aIkOiuoumYhQ==")),e.push(__sfx("bWl4ZWQtcG9ydDogNzg5MA==")),e.push(__sfx("YWxsb3ctbGFuOiBmYWxzZQ==")),e.push(__sfx("bW9kZTogcnVsZQ==")),e.push(__sfx("bG9nLWxldmVsOiBpbmZv")),e.push(__sfx("dW5pZmllZC1kZWxheTogdHJ1ZQ==")),e.push(__sfx("dGNwLWNvbmN1cnJlbnQ6IHRydWU=")),e.push(""),e.push("dns:"),e.push(__sfx("ICBlbmFibGU6IHRydWU=")),e.push(__sfx("ICBpcHY2OiBmYWxzZQ==")),e.push(__sfx("ICBlbmhhbmNlZC1tb2RlOiBmYWtlLWlw")),e.push(__sfx("ICBmYWtlLWlwLXJhbmdlOiAxOTguMTguMC4xLzE2")),e.push(" default-nameserver:"),e.push(" - 223.5.5.5"),e.push(" - 119.29.29.29"),e.push(" nameserver:"),e.push(" - https://223.5.5.5/dns-query"),e.push(" - https://dns.alidns.com/dns-query"),e.push(" fallback:"),e.push(" - 8.8.4.4"),e.push(" - 1.1.1.1"),e.push(" fallback-filter:"),e.push(__sfx("ICAgIGdlb2lwOiB0cnVl")),e.push(__sfx("ICAgIGdlb2lwLWNvZGU6IENO")),e.push(""),i&&(e.push(" nameserver-policy:"),e.push(` ${B(c)}: ${p?B(p):"https://223.5.5.5/dns-query"}`),e.push(""));let u=Me(t.routeProfile??"",{mainGroup:__sfx("Q0ZQaWxvdA=="),autoGroup:__sfx("6Ieq5Yqo6YCJ5oup")});if(e.push("proxies:"),n.length===0?e.push(" []"):e.push(...n),e.push(""),e.push(__sfx("cHJveHktZ3JvdXBzOg==")),e.push(__sfx("ICAtIG5hbWU6ICJDRlBpbG90Ig==")),e.push(__sfx("ICAgIHR5cGU6IHNlbGVjdA==")),e.push(" proxies:"),e.push(__sfx("ICAgICAgLSAi6Ieq5Yqo6YCJ5oupIg==")),e.push(__sfx("ICAgICAgLSAi5pWF6Zqc6L2s56e7Ig==")),r.length===0)e.push(" []");else for(let f of r)e.push(` - ${B(f)}`);if(r.length>0){e.push(""),e.push(__sfx("ICAtIG5hbWU6ICLoh6rliqjpgInmi6ki")),e.push(__sfx("ICAgIHR5cGU6IHVybC10ZXN0")),e.push(__sfx("ICAgIHVybDogImh0dHA6Ly93d3cuZ3N0YXRpYy5jb20vZ2VuZXJhdGVfMjA0Ig==")),e.push(__sfx("ICAgIGludGVydmFsOiAzMDA=")),e.push(__sfx("ICAgIHRvbGVyYW5jZTogNTA=")),e.push(" proxies:");for(let f of r)e.push(` - ${B(f)}`);e.push(""),e.push(__sfx("ICAtIG5hbWU6ICLmlYXpmpzovaznp7si")),e.push(__sfx("ICAgIHR5cGU6IGZhbGxiYWNr")),e.push(__sfx("ICAgIHVybDogImh0dHA6Ly93d3cuZ3N0YXRpYy5jb20vZ2VuZXJhdGVfMjA0Ig==")),e.push(__sfx("ICAgIGludGVydmFsOiAzMDA=")),e.push(" proxies:");for(let f of r)e.push(` - ${B(f)}`)}return u.groups.length>0&&(e.push(""),e.push(...u.groups)),e.push(""),e.push("rules:"),u.rules.length>0?(e.push(...u.rules),u.rules.some(f=>f.includes("MATCH,"))||e.push(__sfx("ICAtIE1BVENILENGUGlsb3Q="))):e.push(...Ue(__sfx("Q0ZQaWxvdA=="))),e.push(""),e.join(`
|
|
5
5
|
`)}function Br(t){let e=[],n=[],r=Vt(t.config.subVariants,t.config,Qe),o=r.some(l=>l===__sfx("dmxlc3Mtd3M=")),s=r.includes(__sfx("dHJvamFu")),a=t.config.ech,i=t.config.echHost.trim()||__sfx("Y2xvdWRmbGFyZS1lY2guY29t"),c=()=>a?{ech:{enabled:!0,query_server_name:i}}:{};for(let l of qt(t)){let u=[];l.entries.forEach((f,d)=>{let m=`${l.name} ${mt(f,"vless",d,"")}`;for(let h of Zt(f,t)){let F=t.ports.length>1?`:${h}`:"",N=`${m}${F}`,w=""+N+__sfx("IFRyb2phbg==");o&&u.push(N),s&&u.push(w),o&&e.push({type:__sfx("dmxlc3M="),tag:N,server:f.ip,server_port:h,uuid:t.config.uuid,tls:{enabled:!0,server_name:t.domain,insecure:!1,utls:{enabled:!0,fingerprint:t.config.clientFingerprint},...c()},transport:{type:"ws",path:t.config.wsPath,headers:{Host:t.domain}}}),s&&e.push({type:__sfx("dHJvamFu"),tag:w,server:f.ip,server_port:h,password:t.config.trojanPassword,tls:{enabled:!0,server_name:t.domain,insecure:!1,utls:{enabled:!0,fingerprint:t.config.clientFingerprint},...c()},transport:{type:"ws",path:t.config.trojanPath,headers:{Host:t.domain}}})}}),u.length>0&&n.push({tag:l.name,members:u})}e.push({type:"direct",tag:"direct"});for(let l of n)e.push({type:"selector",tag:l.tag,outbounds:l.members,default:l.members[0]});return e.push({type:"selector",tag:__sfx("Q0ZQaWxvdA=="),outbounds:n.length>0?n.map(l=>l.tag):["direct"],default:n.length>0?n[0].tag:"direct"}),JSON.stringify({log:{level:"info",timestamp:!0},dns:{servers:[{tag:"dns-out",address:"https://1.1.1.1/dns-query"},{tag:"local",address:"local"}],rules:[{domain_suffix:qe,server:"local"}]},inbounds:[{type:"mixed",tag:"mixed-in",listen:__sfx("MTI3LjAuMC4x"),listen_port:2080}],outbounds:e,route:{rules:[{ip_is_private:!0,outbound:"direct"},{domain_suffix:qe,outbound:"direct"}],final:__sfx("Q0ZQaWxvdA=="),auto_detect_interface:!0}},null,2)}function jr(t){let e=[],n=Vt(t.config.subVariants,t.config);for(let r of qt(t))r.entries.forEach((o,s)=>{let a=mt(o,__sfx("dmxlc3M="),s,r.name);for(let i of Zt(o,t)){let c=t.ports.length>1?`:${i}`:"",p=`${a}${c}`,l={...o,port:i};for(let u of n)u===__sfx("dmxlc3Mtd3M=")?e.push(Ve(l,t,"ws",`${p} WS`)):u===__sfx("dmxlc3MteGh0dHA=")?e.push(Ve(l,t,__sfx("eGh0dHA="),""+p+__sfx("IFhIVFRQ"))):e.push(Ur(l,t,""+p+__sfx("IFRyb2phbg==")))}});return Ee(e.join(`
|
|
6
|
-
`))}function en(t,e){let n=Qt(e.config.subName);switch(t){case __sfx("Y2xhc2g="):return{body:Mr(e),contentType:"text/yaml; charset=utf-8",fileName:n};case"singbox":return{body:Br(e),contentType:"application/json; charset=utf-8",fileName:n};default:return{body:jr(e),contentType:"text/plain; charset=utf-8",fileName:n}}}var $,gr,mr,je,He,Ke,hr,br,yr,Rr,Or,vr,_,kr,Ye,Qe,Lr,qe,Jt=R(()=>{"use strict";Ne();G();zt();Be();$=443;gr=[__sfx("aXDlnLDlnYA="),__sfx("aXAg5Zyw5Z2A"),"ip",__sfx("5Zyw5Z2A"),__sfx("5pyN5Yqh5Zmo"),"server","host"],mr=[__sfx("56uv5Y+j"),"port"],je=[__sfx("5LiL6L296YCf5bqm"),__sfx("6YCf5bqm"),"speed","download"],He=[__sfx("5bmz5Z2H5bu26L+f"),__sfx("5bu26L+f"),"latency","delay",__sfx("5ZON5bqU5pe26Ze0"),"rtt"],Ke=["colo",__sfx("5py65oi/"),__sfx("5pWw5o2u5Lit5b+D"),__sfx("5Zyw5Yy6"),"region"],hr=[__sfx("5Zu95a62"),"country",__sfx("5Zu95Yir")],br=[__sfx("5Z+O5biC"),"city"],yr=["tls",__sfx("5piv5ZCm5pSv5oyBdGxz"),__sfx("5pSv5oyBdGxz")];Rr={official:__sfx("5a6Y5pa55LyY6YCJSVA="),domain:__sfx("5LyY6YCJ5Z+f5ZCN"),manual:__sfx("5omL5Yqo5LyY6YCJSVA="),api:__sfx("6L+c56iLQVBJ"),csv:__sfx("5rWL6YCfQ1NW")};Or=12e4,vr=32,_=new Map,kr="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36";Ye=[__sfx("dmxlc3Mtd3M="),__sfx("dmxlc3MteGh0dHA="),__sfx("dHJvamFu")];Qe=[__sfx("dmxlc3Mtd3M="),__sfx("dHJvamFu")];Lr=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;qe=".cn,qq.com,tencent.com,weixin.qq.com,baidu.com,bdstatic.com,bilibili.com,hdslb.com,taobao.com,tmall.com,jd.com,aliyun.com,alicdn.com,alipay.com,163.com,126.net,zhihu.com,weibo.com,sina.com.cn,youku.com,iqiyi.com,douyin.com,xiaohongshu.com,mi.com,huawei.com,csdn.net,gitee.com,cnblogs.com".split(",")});function Vr(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function un(t,e){let n=await crypto.subtle.importKey("raw",an.encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=await crypto.subtle.sign("HMAC",n,an.encode(e));return Vr(new Uint8Array(r))}async function It(t){let e=(await t.get(Dt))?.trim();if(e)return e;let n=ln();return t instanceof X&&await t.put(Dt,n),n}async function cn(t){let e=ln();return t instanceof X?await t.put(Dt,e):await t.put(Dt,e),e}async function fn(t,e={}){let n=e.ttlDays??0,r=Math.floor((e.now??Date.now())/1e3),o=n>0?r+Math.round(n*86400):0,s=Math.floor(Math.random()*36**8).toString(36).padStart(8,"0"),a=`${te}.${o.toString(36)}.${s}`,i=(await un(t,a)).slice(0,ee);return`${a}.${i}`}async function Rt(t,e,n=Date.now()){if(!t||!e)return{ok:!1,reason:"format"};let r=e.split(".");if(r.length!==4||r[0]!==te)return{ok:!1,reason:"format"};let o=r[1],s=r[2],a=r[3];if(!o||!s||a.length!==ee)return{ok:!1,reason:"format"};let i=Number.parseInt(o,36);if(!Number.isFinite(i)||i<0)return{ok:!1,reason:"format"};let c=(await un(t,`${te}.${o}.${s}`)).slice(0,ee);return W(a,c)?i>0&&Math.floor(n/1e3)>=i?{ok:!1,reason:"expired",exp:i}:{ok:!0,exp:i}:{ok:!1,reason:"signature"}}var Dt,te,ee,an,ln,ne=R(()=>{"use strict";bt();G();Dt="SUB_TOKEN_SECRET",te="v1",ee=22,an=new TextEncoder;ln=()=>k(32)});function Zr(t){let e="";for(let n of t)e+=(n<16?"0":"")+n.toString(16);return e}function Jr(t){if(!/^[0-9a-f]*$/.test(t)||t.length%2!==0)return null;let e=new Uint8Array(new ArrayBuffer(t.length/2));for(let n=0;n<e.length;n++)e[n]=Number.parseInt(t.slice(n*2,n*2+2),16);return e}async function yn(t,e,n){let r=Jr(e);if(!r)return null;let o=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),"PBKDF2",!1,["deriveBits"]),s=await crypto.subtle.deriveBits({name:"PBKDF2",salt:r,iterations:n,hash:"SHA-256"},o,256);return Zr(new Uint8Array(s))}function Pn(t){if(t.startsWith(`${oe}$`)){let[r,o,s,a]=t.split("$");if(r!==oe||!s||!a)return null;let i=Number.parseInt(o??"",10);return!Number.isFinite(i)||i<1||i>1e6?null:{scheme:"pbkdf2",salt:s,iterations:i,expected:a}}let[e,n]=t.split(":");return!e||!n?null:{scheme:"sha256",salt:e,iterations:0,expected:n}}async function wn(t,e){return t.scheme==="pbkdf2"?await yn(e,t.salt,t.iterations):await Mt(`${t.salt}:${e}`)}async function se(t,e){let n=await yn(t,e,mn);return n?`${oe}$${mn}$${e}$${n}`:`${e}:${await Mt(`${e}:${t}`)}`}async function _r(t,e){let n=Pn(t);if(!n)return!1;let r=await wn(n,e);return r?W(r,n.expected):!1}function hn(t){return`/${t.trim().replace(/^\/+/,"")}`}async function En(t,e,n){let r=await t.get(wt)??"",o=n&&n.trim()?hn(n):"";o?r!==o&&(r=o,await t.put(wt,r)):r||(r=hn(`${Se}-${we(6)}`),await t.put(wt,r));let s=await t.get(it)??"",a=null,i=e&&e.trim()?e.trim():"";if(i){if(!s||!await _r(s,i)){let p=k(8);s=await se(i,p),await t.put(it,s)}await t.get(nt)&&await t.delete(nt)}else if(!s){let c=`cfp-${k(8)}`,p=k(8);s=await se(c,p),await t.put(it,s),a=c,await t.put(nt,c)}return{panelPath:r,passwordHash:s,generatedPassword:a}}async function An(t,e){let n=Pn(t.passwordHash);if(!n)return{ok:!1,legacy:!1};let r=await wn(n,e);if(!r)return{ok:!1,legacy:!1};let o=W(r,n.expected);return{ok:o,legacy:o&&n.scheme==="sha256"}}async function Cn(t,e){let n=k(8);await t.put(it,await se(e,n))}async function xn(t){await t.get(nt)&&await t.delete(nt)}function Sn(t){let e=t.headers.get("Cookie")??"",n={};for(let r of e.split(";")){let o=r.indexOf("=");if(o<0)continue;let s=r.slice(0,o).trim(),a=r.slice(o+1).trim();s&&(n[s]=decodeURIComponent(a))}return n}async function Tn(t){let e=k(24);return await t.put(`${Pt}${e}`,JSON.stringify({ua:"",t:Date.now()}),bn),e}async function ie(t,e){let n=Sn(e)[Ot];return n?!!await t.get(`${Pt}${n}`):!1}function Dn(t,e=bn){return`${Ot}=${t}; Path=/; HttpOnly; Secure; SameSite=Strict; Max-Age=${e}`}function In(){return`${Ot}=; Path=/; HttpOnly; Secure; SameSite=Strict; Max-Age=0`}async function Rn(t,e){let n=Sn(e)[Ot];n&&await t.delete(`${Pt}${n}`)}async function Nn(t){let e=k(20);return await t.put(`${yt}${e}`,"1",Qr),e}async function On(t,e){if(!e)return!1;let n=await t.get("SCANNER_TOKEN");return n&&W(n,e)?!0:await t.get(`${yt}${e}`)?(await t.delete(`${yt}${e}`),!0):!1}var Ot,bn,Qr,mn,oe,ae=R(()=>{"use strict";ft();G();Ot=__sfx("Y2ZwaWxvdF9zZXNz"),bn=3600*24,Qr=600,mn=3e4,oe="pbkdf2"});function vn(t){return Ae(t)}async function ue(t,e){if(L.config&&Date.now()-L.configAt<$r)return L.config;let n=await Ie(t,e);return L.config=n,L.configAt=Date.now(),n}function kn(){L.config=null,L.configAt=0}async function le(t,e){if(L.auth&&Date.now()-L.authAt<to)return L.auth;let n=await En(t,e.PANEL_PASSWORD,e.PANEL_PATH);return L.auth=n,L.authAt=Date.now(),n}function ce(t){switch((t??"").toLowerCase()){case __sfx("Y2xhc2g="):case"mihomo":case"yaml":return __sfx("Y2xhc2g=");case"singbox":case"sing-box":case"json":return"singbox";case"v2ray":return"v2ray";case"base64":return"base64";default:return"base64"}}function ht(t){let e=String(t??"").trim();if(!e)return e;e=e.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,""),e=e.replace(/[/?#].*$/,"");let n=e.lastIndexOf("@");if(n>=0&&(e=e.slice(n+1)),e.startsWith("[")){let r=e.indexOf("]");r>0&&(e=e.slice(1,r))}else{let r=e.indexOf(":");r>=0&&e.indexOf(":",r+1)<0&&(e=e.slice(0,r))}return e.trim()}function Ln(t){let e=(t??"").toLowerCase();return e?e.includes(__sfx("Y2xhc2g="))||e.includes("mihomo")||e.includes(__sfx("ZmxjbGFzaA=="))||e.includes(__sfx("Y2xhc2h4"))||e.includes("stash")?__sfx("Y2xhc2g="):e.includes("sing-box")||e.includes("singbox")?"singbox":e.includes("v2ray")||e.includes("v2rayng")||e.includes("shadowrocket")||e.includes("nekobox")||e.includes("surge")||e.includes("loon")||e.includes("quantumult")?"base64":null:null}var $r,to,L,vt=R(()=>{"use strict";bt();ft();ae();$r=15e3,to=6e4,L={config:null,configAt:0,auth:null,authAt:0}});function fe(t,e,n){if(!t){n.push({field:e,message:""+e+__sfx("IOS4jeiDveS4uuepug==")});return}if(!t.startsWith("/")){n.push({field:e,message:""+e+__sfx("IOW/hemhu+S7pSAvIOW8gOWktA==")});return}if(t.length>128){n.push({field:e,message:""+e+__sfx("IOi/h+mVv++8iOacgOWkmiAxMjgg5a2X56ym77yJ")});return}/[\s\u0000-\u001f]/.test(t)&&n.push({field:e,message:""+e+__sfx("IOS4jeiDveWMheWQq+epuuagvOaIluaOp+WItuWtl+espg==")})}function tt(t,e,n,r,o){if(!Number.isFinite(t)){o.push({field:e,message:""+e+__sfx("IOW/hemhu+aYr+aVsOWtlw==")});return}(t<n||t>r)&&o.push({field:e,message:""+e+__sfx("IOW/hemhu+WcqCA=")+n+" ~ "+r+__sfx("IOS5i+mXtO+8iOW9k+WJjSA=")+t+")"})}function kt(t,e,n){let r=t.split(/\r?\n|,/).map(o=>o.trim()).filter(Boolean);if(r.length>20){n.push({field:e,message:""+e+__sfx("IOacgOWkmiAyMCDmnaHvvIjlvZPliY0g")+r.length+")"});return}for(let o of r)if(!no.test(o)){n.push({field:e,message:""+e+__sfx("IOmHjOacieaXoOazleivhuWIq+eahOadoeebru+8mg==")+o.slice(0,40)+""});return}}function Fn(t,e,n){let r=t.split(/\r?\n|,/).map(o=>o.trim()).filter(Boolean);if(r.length>10){n.push({field:e,message:""+e+__sfx("IOacgOWkmiAxMCDmnaHvvIjlvZPliY0g")+r.length+")"});return}for(let o of r)if(!/^https?:\/\/\S+$/i.test(o)){n.push({field:e,message:""+e+__sfx("IOW/hemhu+aYryBodHRwKHMpIOWcsOWdgO+8mg==")+o.slice(0,40)+""});return}}function pe(t){let e=[],n=o=>Object.prototype.hasOwnProperty.call(t,o);n("wsPath")&&fe(String(t.wsPath??""),"wsPath",e),n(__sfx("dHJvamFuUGF0aA=="))&&fe(String(t.trojanPath??""),__sfx("dHJvamFuUGF0aA=="),e),n(__sfx("eGh0dHBQYXRo"))&&fe(String(t.xhttpPath??""),__sfx("eGh0dHBQYXRo"),e);let r=["wsPath",__sfx("dHJvamFuUGF0aA=="),__sfx("eGh0dHBQYXRo")].filter(o=>n(o)).map(o=>`${o}=${String(t[o]??"")}`);if(r.length>=2){let o=r.map(s=>s.slice(s.indexOf("=")+1));new Set(o).size!==o.length&&e.push({field:"paths",message:__sfx("d3NQYXRoIC8gdHJvamFuUGF0aCAvIHhodHRwUGF0aCDkuI3og73ph43lpI0=")})}if(n("subDomain")){let o=String(t.subDomain??"").trim();o&&(!eo.test(o)||o.includes("/"))&&e.push({field:"subDomain",message:__sfx("c3ViRG9tYWluIOW/hemhu+aYr+WQiOazleS4u+acuuWQje+8iOS4jeWQq+WNj+iuruS4jui3r+W+hO+8iQ==")})}if(n(__sfx("cHJveHlJcA=="))&&kt(String(t.proxyIp??""),__sfx("cHJveHlJcA=="),e),n(__sfx("c29ja3M1"))&&kt(String(t.socks5??""),__sfx("c29ja3M1"),e),n("httpProxy")&&kt(String(t.httpProxy??""),"httpProxy",e),n("relayPool")&&kt(String(t.relayPool??""),"relayPool",e),n("officialCount")&&tt(Number(t.officialCount),"officialCount",1,200,e),n("domainCount")&&tt(Number(t.domainCount),"domainCount",1,200,e),n("maxNodes")&&tt(Number(t.maxNodes),"maxNodes",0,500,e),n("dls")&&tt(Number(t.dls),"dls",0,1e3,e),n("maxLatency")&&tt(Number(t.maxLatency),"maxLatency",0,1e4,e),n("dataBudgetMB")&&tt(Number(t.dataBudgetMB),"dataBudgetMB",0,102400,e),n("subTokenTtlDays")&&tt(Number(t.subTokenTtlDays),"subTokenTtlDays",0,3650,e),n("subPorts")){let o=String(t.subPorts??"").trim();if(o){let s=o.split(/[\n,;\s]+/).filter(Boolean);s.length>6?e.push({field:"subPorts",message:__sfx("c3ViUG9ydHMg5pyA5aSaIDYg5Liq56uv5Y+j")}):s.every(a=>/^\d{1,5}$/.test(a)&&Number(a)>=1&&Number(a)<=65535)||e.push({field:"subPorts",message:__sfx("c3ViUG9ydHMg6YeM5q+P5Liq56uv5Y+j6YO95b+F6aG75pivIDF+NjU1MzUg55qE5pWw5a2X")})}}if(n("subName")){let o=String(t.subName??"");o.length>40&&e.push({field:"subName",message:__sfx("c3ViTmFtZSDmnIDlpJogNDAg5a2X56ym")}),/[\u0000-\u001f]/.test(o)&&e.push({field:"subName",message:__sfx("c3ViTmFtZSDkuI3og73ljIXlkKvmjqfliLblrZfnrKY=")})}if(n("addApi")&&Fn(String(t.addApi??""),"addApi",e),n("addCsv")&&Fn(String(t.addCsv??""),"addCsv",e),n("uuid")){let o=String(t.uuid??"").trim();o&&!/^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$/.test(o)&&e.push({field:"uuid",message:__sfx("dXVpZCDlv4XpobvmmK/moIflh4YgVVVJRO+8iDM2IOS9je+8jOWPr+W4pui/nuWtl+espu+8iQ==")})}if(n("poolCountries")){let o=String(t.poolCountries??"").trim();if(o){let s=o.split(/[\n,;\s]+/).filter(Boolean);s.length>30?e.push({field:"poolCountries",message:__sfx("cG9vbENvdW50cmllcyDmnIDlpJogMzAg5Liq5Zu95a62L+WcsOWMug==")}):s.every(a=>/^[A-Za-z]{2,3}$/.test(a))||e.push({field:"poolCountries",message:__sfx("cG9vbENvdW50cmllcyDlj6rog73mmK8gMn4zIOS9jeWtl+avjeS7o+eggQ==")})}}if(n("udpDnsEndpoint")){let o=String(t.udpDnsEndpoint??"").trim();o&&!/^https:\/\/\S+$/i.test(o)&&e.push({field:"udpDnsEndpoint",message:__sfx("dWRwRG5zRW5kcG9pbnQg5b+F6aG75pivIGh0dHBzIOWcsOWdgA==")})}return e}function de(t){return t.length===0?"":t.length===1?t[0].message:"有 "+t.length+__sfx("IOmhuemFjee9ruS4jeWQiOazle+8mg==")+t.map(e=>e.message).join("\uFF1B")+""}var eo,no,Un=R(()=>{"use strict";eo=/^(?=.{1,253}$)([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)(\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,no=/^(?:(?:socks5|socks|socks5h|http|https):\/\/)?(?:[^\s@/]+@)?(?:\[[0-9a-fA-F:]+\]|[A-Za-z0-9._-]+)(?::\d{1,5})?$/});function jn(t,e=Date.now()){let n={};for(let o of Bn){let s=t[o];s!==void 0&&(n[o]=s)}let r=ro.map(o=>({field:o.field,reason:o.reason}));for(let o of[__sfx("c29ja3M1"),"httpProxy"]){let s=String(t[o]??"");if(!s){n[o]="";continue}if(s.includes("@")){r.push({field:o,reason:__sfx("5ZCr55So5oi35ZCNL+WPo+S7pO+8jOmcgOaJi+W3pemHjeaWsOWhq+WGmQ==")});continue}n[o]=s}return{schemaVersion:1,exportedAt:new Date(e).toISOString(),config:n,omitted:r}}function Hn(t){let e=new Set([...Bn.map(String),__sfx("c29ja3M1"),"httpProxy"]),n={};for(let[r,o]of Object.entries(t))e.has(r)&&(n[r]=o);return n}function Mn(t){if(t==null)return"\uFF08\u7A7A\uFF09";if(typeof t=="string"){let e=t.replace(/\s+/g," ").trim();return e.length>60?`${e.slice(0,60)}\u2026`:e||"\uFF08\u7A7A\uFF09"}return String(t)}function Kn(t,e){let n=[];for(let[r,o]of Object.entries(e)){let s=t[r];String(s)!==String(o)&&n.push({field:r,from:Mn(s),to:Mn(o)})}return n}var Bn,ro,Wn=R(()=>{"use strict";Bn=["poolOfficial","officialCount","poolDomain","domainCount","poolManual","poolCountries","add","dls","maxLatency","maxNodes",__sfx("cHJveHlJcA=="),"relayPool","useBuiltinRelay","proxyMode","nat64","concurrentDial","dataBudgetMB","resolvePreferred",__sfx("ZW5hYmxlVHJvamFu"),__sfx("ZW5hYmxlWGh0dHA="),"subProtocol","subTransport","subVariants","subName","subPorts","clientFingerprint","ech","echHost","echDns","tlsFragment","tlsFragmentSize","tlsFragmentDelay","subToken","subTokenTtlDays","unlockProbe","udpDns","udpDnsEndpoint"],ro=[{field:"uuid",reason:__sfx("5YWl56uZ5Yet5o2u")},{field:__sfx("dHJvamFuUGFzc3dvcmQ="),reason:__sfx("5YWl56uZ5Yet5o2u")},{field:"wsPath",reason:__sfx("5a6e5L6L5qCH6K+G77yI6K6i6ZiF6ZO+5o6l6YeM5Y+v6KeB77yM5a+85Ye65Y2z5pq06Zyy5YWl5Y+j77yJ")},{field:__sfx("dHJvamFuUGF0aA=="),reason:__sfx("5a6e5L6L5qCH6K+G")},{field:__sfx("eGh0dHBQYXRo"),reason:__sfx("5a6e5L6L5qCH6K+G")},{field:"subDomain",reason:__sfx("5a6e5L6L5qCH6K+G")},{field:"addApi",reason:__sfx("VVJMIOWPr+iDveWQq+engeaciSB0b2tlbg==")},{field:"addCsv",reason:__sfx("VVJMIOWPr+iDveWQq+engeaciSB0b2tlbg==")}]});function Gn(){return new Response(JSON.stringify({build:ge,version:me,ts:Date.now()}),{status:200,headers:{"Content-Type":"application/json","Cache-Control":"no-store","Access-Control-Allow-Origin":"*"}})}var ge,me,zn,he=R(()=>{"use strict";ge="1a5d653-2d5c8203",me=__sfx("MC4xMy4x"),zn=__sfx("L19fY2ZwX3ZlcnNpb24=")});var Vn={};tr(Vn,{API_PREFIX:()=>be,getScannerToken:()=>uo,handleApi:()=>lo});function so(t){return t.headers.get("CF-Connecting-IP")??t.headers.get("x-forwarded-for")?.split(",")[0]?.trim()??"unknown"}function io(t,e){let n=K.get(t);return n?e>=n.resetAt?(K.delete(t),!1):n.count>=oo:!1}function ao(t,e){let n=K.get(t);if(!n||e>=n.resetAt){if(K.size>=Xn){for(let[r,o]of K)e>=o.resetAt&&K.delete(r);K.size>=Xn&&K.clear()}K.set(t,{count:1,resetAt:e+Yn});return}n.count+=1}function C(t,e=200,n={}){return new Response(JSON.stringify(t),{status:e,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store",...n}})}function S(t,e){return C({ok:!1,error:t},e)}async function uo(t,e){let n=await t.get(Ht);if(n)return n;if(typeof e.SCANNER_TOKEN=="string"&&e.SCANNER_TOKEN)return e.SCANNER_TOKEN;let r=k(24);return await t.put(Ht,r),r}async function lo(t,e,n){if(!e.pathname.startsWith(be))return null;let{store:r,env:o,config:s,auth:a}=n,i=e.pathname.slice(be.length)||"/",c=t.method.toUpperCase();if(i==="/session"&&c==="GET"){let l=await ie(r,t);return C({ok:!0,authenticated:l,panelPath:a.panelPath})}if(i==="/login"&&c==="POST"){let l="";try{let h=await t.json();l=String(h.password??"")}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}if(!l)return S(__sfx("6K+36L6T5YWl5a+G56CB"),400);let u=so(t),f=Date.now();if(io(u,f))return new Response(JSON.stringify({ok:!1,error:__sfx("5bCd6K+V6L+H5LqO6aKR57mB77yM6K+356iN5ZCO5YaN6K+V")}),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(Yn/1e3))}});let d=await An(a,l);if(!d.ok)return ao(u,f),S(__sfx("5a+G56CB6ZSZ6K+v"),401);K.delete(u),d.legacy&&await Cn(r,l).catch(()=>{}),await xn(r).catch(()=>{});let m=await Tn(r);return C({ok:!0},200,{"Set-Cookie":Dn(m)})}if(i==="/logout"&&c==="POST")return await Rn(r,t),C({ok:!0},200,{"Set-Cookie":In()});if(i==="/preferred-ips"&&c==="POST"){let l=t.headers.get("Authorization")??"",u=l.startsWith("Bearer ")?l.slice(7).trim():l.trim();if(!await On(r,u))return S(__sfx("VG9rZW4g5qCh6aqM5aSx6LSl"),401);let d;try{d=await t.json()}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}let m=Array.isArray(d.ips)?d.ips.map(U=>String(U)):[],h=m.map(U=>U.trim()).filter(U=>U.length>0).join(`
|
|
6
|
+
`))}function en(t,e){let n=Qt(e.config.subName);switch(t){case __sfx("Y2xhc2g="):return{body:Mr(e),contentType:"text/yaml; charset=utf-8",fileName:n};case"singbox":return{body:Br(e),contentType:"application/json; charset=utf-8",fileName:n};default:return{body:jr(e),contentType:"text/plain; charset=utf-8",fileName:n}}}var $,gr,mr,je,He,Ke,hr,br,yr,Rr,Or,vr,_,kr,Ye,Qe,Lr,qe,Jt=R(()=>{"use strict";Ne();G();zt();Be();$=443;gr=[__sfx("aXDlnLDlnYA="),__sfx("aXAg5Zyw5Z2A"),"ip",__sfx("5Zyw5Z2A"),__sfx("5pyN5Yqh5Zmo"),"server","host"],mr=[__sfx("56uv5Y+j"),"port"],je=[__sfx("5LiL6L296YCf5bqm"),__sfx("6YCf5bqm"),"speed","download"],He=[__sfx("5bmz5Z2H5bu26L+f"),__sfx("5bu26L+f"),"latency","delay",__sfx("5ZON5bqU5pe26Ze0"),"rtt"],Ke=["colo",__sfx("5py65oi/"),__sfx("5pWw5o2u5Lit5b+D"),__sfx("5Zyw5Yy6"),"region"],hr=[__sfx("5Zu95a62"),"country",__sfx("5Zu95Yir")],br=[__sfx("5Z+O5biC"),"city"],yr=["tls",__sfx("5piv5ZCm5pSv5oyBdGxz"),__sfx("5pSv5oyBdGxz")];Rr={official:__sfx("5a6Y5pa55LyY6YCJSVA="),domain:__sfx("5LyY6YCJ5Z+f5ZCN"),manual:__sfx("5omL5Yqo5LyY6YCJSVA="),api:__sfx("6L+c56iLQVBJ"),csv:__sfx("5rWL6YCfQ1NW")};Or=12e4,vr=32,_=new Map,kr="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36";Ye=[__sfx("dmxlc3Mtd3M="),__sfx("dmxlc3MteGh0dHA="),__sfx("dHJvamFu")];Qe=[__sfx("dmxlc3Mtd3M="),__sfx("dHJvamFu")];Lr=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;qe=".cn,qq.com,tencent.com,weixin.qq.com,baidu.com,bdstatic.com,bilibili.com,hdslb.com,taobao.com,tmall.com,jd.com,aliyun.com,alicdn.com,alipay.com,163.com,126.net,zhihu.com,weibo.com,sina.com.cn,youku.com,iqiyi.com,douyin.com,xiaohongshu.com,mi.com,huawei.com,csdn.net,gitee.com,cnblogs.com".split(",")});function Vr(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function un(t,e){let n=await crypto.subtle.importKey("raw",an.encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=await crypto.subtle.sign("HMAC",n,an.encode(e));return Vr(new Uint8Array(r))}async function It(t){let e=(await t.get(Dt))?.trim();if(e)return e;let n=ln();return t instanceof X&&await t.put(Dt,n),n}async function cn(t){let e=ln();return t instanceof X?await t.put(Dt,e):await t.put(Dt,e),e}async function fn(t,e={}){let n=e.ttlDays??0,r=Math.floor((e.now??Date.now())/1e3),o=n>0?r+Math.round(n*86400):0,s=Math.floor(Math.random()*36**8).toString(36).padStart(8,"0"),a=`${te}.${o.toString(36)}.${s}`,i=(await un(t,a)).slice(0,ee);return`${a}.${i}`}async function Rt(t,e,n=Date.now()){if(!t||!e)return{ok:!1,reason:"format"};let r=e.split(".");if(r.length!==4||r[0]!==te)return{ok:!1,reason:"format"};let o=r[1],s=r[2],a=r[3];if(!o||!s||a.length!==ee)return{ok:!1,reason:"format"};let i=Number.parseInt(o,36);if(!Number.isFinite(i)||i<0)return{ok:!1,reason:"format"};let c=(await un(t,`${te}.${o}.${s}`)).slice(0,ee);return W(a,c)?i>0&&Math.floor(n/1e3)>=i?{ok:!1,reason:"expired",exp:i}:{ok:!0,exp:i}:{ok:!1,reason:"signature"}}var Dt,te,ee,an,ln,ne=R(()=>{"use strict";bt();G();Dt="SUB_TOKEN_SECRET",te="v1",ee=22,an=new TextEncoder;ln=()=>k(32)});function Zr(t){let e="";for(let n of t)e+=(n<16?"0":"")+n.toString(16);return e}function Jr(t){if(!/^[0-9a-f]*$/.test(t)||t.length%2!==0)return null;let e=new Uint8Array(new ArrayBuffer(t.length/2));for(let n=0;n<e.length;n++)e[n]=Number.parseInt(t.slice(n*2,n*2+2),16);return e}async function yn(t,e,n){let r=Jr(e);if(!r)return null;let o=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),"PBKDF2",!1,["deriveBits"]),s=await crypto.subtle.deriveBits({name:"PBKDF2",salt:r,iterations:n,hash:"SHA-256"},o,256);return Zr(new Uint8Array(s))}function Pn(t){if(t.startsWith(`${oe}$`)){let[r,o,s,a]=t.split("$");if(r!==oe||!s||!a)return null;let i=Number.parseInt(o??"",10);return!Number.isFinite(i)||i<1||i>1e6?null:{scheme:"pbkdf2",salt:s,iterations:i,expected:a}}let[e,n]=t.split(":");return!e||!n?null:{scheme:"sha256",salt:e,iterations:0,expected:n}}async function wn(t,e){return t.scheme==="pbkdf2"?await yn(e,t.salt,t.iterations):await Mt(`${t.salt}:${e}`)}async function se(t,e){let n=await yn(t,e,mn);return n?`${oe}$${mn}$${e}$${n}`:`${e}:${await Mt(`${e}:${t}`)}`}async function _r(t,e){let n=Pn(t);if(!n)return!1;let r=await wn(n,e);return r?W(r,n.expected):!1}function hn(t){return`/${t.trim().replace(/^\/+/,"")}`}async function En(t,e,n){let r=await t.get(wt)??"",o=n&&n.trim()?hn(n):"";o?r!==o&&(r=o,await t.put(wt,r)):r||(r=hn(`${Se}-${we(6)}`),await t.put(wt,r));let s=await t.get(it)??"",a=null,i=e&&e.trim()?e.trim():"";if(i){if(!s||!await _r(s,i)){let p=k(8);s=await se(i,p),await t.put(it,s)}await t.get(nt)&&await t.delete(nt)}else if(!s){let c=`cfp-${k(8)}`,p=k(8);s=await se(c,p),await t.put(it,s),a=c,await t.put(nt,c)}return{panelPath:r,passwordHash:s,generatedPassword:a}}async function An(t,e){let n=Pn(t.passwordHash);if(!n)return{ok:!1,legacy:!1};let r=await wn(n,e);if(!r)return{ok:!1,legacy:!1};let o=W(r,n.expected);return{ok:o,legacy:o&&n.scheme==="sha256"}}async function Cn(t,e){let n=k(8);await t.put(it,await se(e,n))}async function xn(t){await t.get(nt)&&await t.delete(nt)}function Sn(t){let e=t.headers.get("Cookie")??"",n={};for(let r of e.split(";")){let o=r.indexOf("=");if(o<0)continue;let s=r.slice(0,o).trim(),a=r.slice(o+1).trim();s&&(n[s]=decodeURIComponent(a))}return n}async function Tn(t){let e=k(24);return await t.put(`${Pt}${e}`,JSON.stringify({ua:"",t:Date.now()}),bn),e}async function ie(t,e){let n=Sn(e)[Ot];return n?!!await t.get(`${Pt}${n}`):!1}function Dn(t,e=bn){return`${Ot}=${t}; Path=/; HttpOnly; Secure; SameSite=Strict; Max-Age=${e}`}function In(){return`${Ot}=; Path=/; HttpOnly; Secure; SameSite=Strict; Max-Age=0`}async function Rn(t,e){let n=Sn(e)[Ot];n&&await t.delete(`${Pt}${n}`)}async function Nn(t){let e=k(20);return await t.put(`${yt}${e}`,"1",Qr),e}async function On(t,e){if(!e)return!1;let n=await t.get("SCANNER_TOKEN");return n&&W(n,e)?!0:await t.get(`${yt}${e}`)?(await t.delete(`${yt}${e}`),!0):!1}var Ot,bn,Qr,mn,oe,ae=R(()=>{"use strict";ft();G();Ot=__sfx("Y2ZwaWxvdF9zZXNz"),bn=3600*24,Qr=600,mn=3e4,oe="pbkdf2"});function vn(t){return Ae(t)}async function ue(t,e){if(L.config&&Date.now()-L.configAt<$r)return L.config;let n=await Ie(t,e);return L.config=n,L.configAt=Date.now(),n}function kn(){L.config=null,L.configAt=0}async function le(t,e){if(L.auth&&Date.now()-L.authAt<to)return L.auth;let n=await En(t,e.PANEL_PASSWORD,e.PANEL_PATH);return L.auth=n,L.authAt=Date.now(),n}function ce(t){switch((t??"").toLowerCase()){case __sfx("Y2xhc2g="):case"mihomo":case"yaml":return __sfx("Y2xhc2g=");case"singbox":case"sing-box":case"json":return"singbox";case"v2ray":return"v2ray";case"base64":return"base64";default:return"base64"}}function ht(t){let e=String(t??"").trim();if(!e)return e;e=e.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,""),e=e.replace(/[/?#].*$/,"");let n=e.lastIndexOf("@");if(n>=0&&(e=e.slice(n+1)),e.startsWith("[")){let r=e.indexOf("]");r>0&&(e=e.slice(1,r))}else{let r=e.indexOf(":");r>=0&&e.indexOf(":",r+1)<0&&(e=e.slice(0,r))}return e.trim()}function Ln(t){let e=(t??"").toLowerCase();return e?e.includes(__sfx("Y2xhc2g="))||e.includes("mihomo")||e.includes(__sfx("ZmxjbGFzaA=="))||e.includes(__sfx("Y2xhc2h4"))||e.includes("stash")?__sfx("Y2xhc2g="):e.includes("sing-box")||e.includes("singbox")?"singbox":e.includes("v2ray")||e.includes("v2rayng")||e.includes("shadowrocket")||e.includes("nekobox")||e.includes("surge")||e.includes("loon")||e.includes("quantumult")?"base64":null:null}var $r,to,L,vt=R(()=>{"use strict";bt();ft();ae();$r=15e3,to=6e4,L={config:null,configAt:0,auth:null,authAt:0}});function fe(t,e,n){if(!t){n.push({field:e,message:""+e+__sfx("IOS4jeiDveS4uuepug==")});return}if(!t.startsWith("/")){n.push({field:e,message:""+e+__sfx("IOW/hemhu+S7pSAvIOW8gOWktA==")});return}if(t.length>128){n.push({field:e,message:""+e+__sfx("IOi/h+mVv++8iOacgOWkmiAxMjgg5a2X56ym77yJ")});return}/[\s\u0000-\u001f]/.test(t)&&n.push({field:e,message:""+e+__sfx("IOS4jeiDveWMheWQq+epuuagvOaIluaOp+WItuWtl+espg==")})}function tt(t,e,n,r,o){if(!Number.isFinite(t)){o.push({field:e,message:""+e+__sfx("IOW/hemhu+aYr+aVsOWtlw==")});return}(t<n||t>r)&&o.push({field:e,message:""+e+__sfx("IOW/hemhu+WcqCA=")+n+" ~ "+r+__sfx("IOS5i+mXtO+8iOW9k+WJjSA=")+t+")"})}function kt(t,e,n){let r=t.split(/\r?\n|,/).map(o=>o.trim()).filter(Boolean);if(r.length>20){n.push({field:e,message:""+e+__sfx("IOacgOWkmiAyMCDmnaHvvIjlvZPliY0g")+r.length+")"});return}for(let o of r)if(!no.test(o)){n.push({field:e,message:""+e+__sfx("IOmHjOacieaXoOazleivhuWIq+eahOadoeebru+8mg==")+o.slice(0,40)+""});return}}function Fn(t,e,n){let r=t.split(/\r?\n|,/).map(o=>o.trim()).filter(Boolean);if(r.length>10){n.push({field:e,message:""+e+__sfx("IOacgOWkmiAxMCDmnaHvvIjlvZPliY0g")+r.length+")"});return}for(let o of r)if(!/^https?:\/\/\S+$/i.test(o)){n.push({field:e,message:""+e+__sfx("IOW/hemhu+aYryBodHRwKHMpIOWcsOWdgO+8mg==")+o.slice(0,40)+""});return}}function pe(t){let e=[],n=o=>Object.prototype.hasOwnProperty.call(t,o);n("wsPath")&&fe(String(t.wsPath??""),"wsPath",e),n(__sfx("dHJvamFuUGF0aA=="))&&fe(String(t.trojanPath??""),__sfx("dHJvamFuUGF0aA=="),e),n(__sfx("eGh0dHBQYXRo"))&&fe(String(t.xhttpPath??""),__sfx("eGh0dHBQYXRo"),e);let r=["wsPath",__sfx("dHJvamFuUGF0aA=="),__sfx("eGh0dHBQYXRo")].filter(o=>n(o)).map(o=>`${o}=${String(t[o]??"")}`);if(r.length>=2){let o=r.map(s=>s.slice(s.indexOf("=")+1));new Set(o).size!==o.length&&e.push({field:"paths",message:__sfx("d3NQYXRoIC8gdHJvamFuUGF0aCAvIHhodHRwUGF0aCDkuI3og73ph43lpI0=")})}if(n("subDomain")){let o=String(t.subDomain??"").trim();o&&(!eo.test(o)||o.includes("/"))&&e.push({field:"subDomain",message:__sfx("c3ViRG9tYWluIOW/hemhu+aYr+WQiOazleS4u+acuuWQje+8iOS4jeWQq+WNj+iuruS4jui3r+W+hO+8iQ==")})}if(n(__sfx("cHJveHlJcA=="))&&kt(String(t.proxyIp??""),__sfx("cHJveHlJcA=="),e),n(__sfx("c29ja3M1"))&&kt(String(t.socks5??""),__sfx("c29ja3M1"),e),n("httpProxy")&&kt(String(t.httpProxy??""),"httpProxy",e),n("relayPool")&&kt(String(t.relayPool??""),"relayPool",e),n("officialCount")&&tt(Number(t.officialCount),"officialCount",1,200,e),n("domainCount")&&tt(Number(t.domainCount),"domainCount",1,200,e),n("maxNodes")&&tt(Number(t.maxNodes),"maxNodes",0,500,e),n("dls")&&tt(Number(t.dls),"dls",0,1e3,e),n("maxLatency")&&tt(Number(t.maxLatency),"maxLatency",0,1e4,e),n("dataBudgetMB")&&tt(Number(t.dataBudgetMB),"dataBudgetMB",0,102400,e),n("subTokenTtlDays")&&tt(Number(t.subTokenTtlDays),"subTokenTtlDays",0,3650,e),n("subPorts")){let o=String(t.subPorts??"").trim();if(o){let s=o.split(/[\n,;\s]+/).filter(Boolean);s.length>6?e.push({field:"subPorts",message:__sfx("c3ViUG9ydHMg5pyA5aSaIDYg5Liq56uv5Y+j")}):s.every(a=>/^\d{1,5}$/.test(a)&&Number(a)>=1&&Number(a)<=65535)||e.push({field:"subPorts",message:__sfx("c3ViUG9ydHMg6YeM5q+P5Liq56uv5Y+j6YO95b+F6aG75pivIDF+NjU1MzUg55qE5pWw5a2X")})}}if(n("subName")){let o=String(t.subName??"");o.length>40&&e.push({field:"subName",message:__sfx("c3ViTmFtZSDmnIDlpJogNDAg5a2X56ym")}),/[\u0000-\u001f]/.test(o)&&e.push({field:"subName",message:__sfx("c3ViTmFtZSDkuI3og73ljIXlkKvmjqfliLblrZfnrKY=")})}if(n("addApi")&&Fn(String(t.addApi??""),"addApi",e),n("addCsv")&&Fn(String(t.addCsv??""),"addCsv",e),n("uuid")){let o=String(t.uuid??"").trim();o&&!/^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$/.test(o)&&e.push({field:"uuid",message:__sfx("dXVpZCDlv4XpobvmmK/moIflh4YgVVVJRO+8iDM2IOS9je+8jOWPr+W4pui/nuWtl+espu+8iQ==")})}if(n("poolCountries")){let o=String(t.poolCountries??"").trim();if(o){let s=o.split(/[\n,;\s]+/).filter(Boolean);s.length>30?e.push({field:"poolCountries",message:__sfx("cG9vbENvdW50cmllcyDmnIDlpJogMzAg5Liq5Zu95a62L+WcsOWMug==")}):s.every(a=>/^[A-Za-z]{2,3}$/.test(a))||e.push({field:"poolCountries",message:__sfx("cG9vbENvdW50cmllcyDlj6rog73mmK8gMn4zIOS9jeWtl+avjeS7o+eggQ==")})}}if(n("udpDnsEndpoint")){let o=String(t.udpDnsEndpoint??"").trim();o&&!/^https:\/\/\S+$/i.test(o)&&e.push({field:"udpDnsEndpoint",message:__sfx("dWRwRG5zRW5kcG9pbnQg5b+F6aG75pivIGh0dHBzIOWcsOWdgA==")})}return e}function de(t){return t.length===0?"":t.length===1?t[0].message:"有 "+t.length+__sfx("IOmhuemFjee9ruS4jeWQiOazle+8mg==")+t.map(e=>e.message).join("\uFF1B")+""}var eo,no,Un=R(()=>{"use strict";eo=/^(?=.{1,253}$)([A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)(\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,no=/^(?:(?:socks5|socks|socks5h|http|https):\/\/)?(?:[^\s@/]+@)?(?:\[[0-9a-fA-F:]+\]|[A-Za-z0-9._-]+)(?::\d{1,5})?$/});function jn(t,e=Date.now()){let n={};for(let o of Bn){let s=t[o];s!==void 0&&(n[o]=s)}let r=ro.map(o=>({field:o.field,reason:o.reason}));for(let o of[__sfx("c29ja3M1"),"httpProxy"]){let s=String(t[o]??"");if(!s){n[o]="";continue}if(s.includes("@")){r.push({field:o,reason:__sfx("5ZCr55So5oi35ZCNL+WPo+S7pO+8jOmcgOaJi+W3pemHjeaWsOWhq+WGmQ==")});continue}n[o]=s}return{schemaVersion:1,exportedAt:new Date(e).toISOString(),config:n,omitted:r}}function Hn(t){let e=new Set([...Bn.map(String),__sfx("c29ja3M1"),"httpProxy"]),n={};for(let[r,o]of Object.entries(t))e.has(r)&&(n[r]=o);return n}function Mn(t){if(t==null)return"\uFF08\u7A7A\uFF09";if(typeof t=="string"){let e=t.replace(/\s+/g," ").trim();return e.length>60?`${e.slice(0,60)}\u2026`:e||"\uFF08\u7A7A\uFF09"}return String(t)}function Kn(t,e){let n=[];for(let[r,o]of Object.entries(e)){let s=t[r];String(s)!==String(o)&&n.push({field:r,from:Mn(s),to:Mn(o)})}return n}var Bn,ro,Wn=R(()=>{"use strict";Bn=["poolOfficial","officialCount","poolDomain","domainCount","poolManual","poolCountries","add","dls","maxLatency","maxNodes",__sfx("cHJveHlJcA=="),"relayPool","useBuiltinRelay","proxyMode","nat64","concurrentDial","dataBudgetMB","resolvePreferred",__sfx("ZW5hYmxlVHJvamFu"),__sfx("ZW5hYmxlWGh0dHA="),"subProtocol","subTransport","subVariants","subName","subPorts","clientFingerprint","ech","echHost","echDns","tlsFragment","tlsFragmentSize","tlsFragmentDelay","subToken","subTokenTtlDays","unlockProbe","udpDns","udpDnsEndpoint"],ro=[{field:"uuid",reason:__sfx("5YWl56uZ5Yet5o2u")},{field:__sfx("dHJvamFuUGFzc3dvcmQ="),reason:__sfx("5YWl56uZ5Yet5o2u")},{field:"wsPath",reason:__sfx("5a6e5L6L5qCH6K+G77yI6K6i6ZiF6ZO+5o6l6YeM5Y+v6KeB77yM5a+85Ye65Y2z5pq06Zyy5YWl5Y+j77yJ")},{field:__sfx("dHJvamFuUGF0aA=="),reason:__sfx("5a6e5L6L5qCH6K+G")},{field:__sfx("eGh0dHBQYXRo"),reason:__sfx("5a6e5L6L5qCH6K+G")},{field:"subDomain",reason:__sfx("5a6e5L6L5qCH6K+G")},{field:"addApi",reason:__sfx("VVJMIOWPr+iDveWQq+engeaciSB0b2tlbg==")},{field:"addCsv",reason:__sfx("VVJMIOWPr+iDveWQq+engeaciSB0b2tlbg==")}]});function Gn(){return new Response(JSON.stringify({build:ge,version:me,ts:Date.now()}),{status:200,headers:{"Content-Type":"application/json","Cache-Control":"no-store","Access-Control-Allow-Origin":"*"}})}var ge,me,zn,he=R(()=>{"use strict";ge="419276c-4511180c",me=__sfx("MC4xMy42"),zn=__sfx("L19fY2ZwX3ZlcnNpb24=")});var Vn={};tr(Vn,{API_PREFIX:()=>be,getScannerToken:()=>uo,handleApi:()=>lo});function so(t){return t.headers.get("CF-Connecting-IP")??t.headers.get("x-forwarded-for")?.split(",")[0]?.trim()??"unknown"}function io(t,e){let n=K.get(t);return n?e>=n.resetAt?(K.delete(t),!1):n.count>=oo:!1}function ao(t,e){let n=K.get(t);if(!n||e>=n.resetAt){if(K.size>=Xn){for(let[r,o]of K)e>=o.resetAt&&K.delete(r);K.size>=Xn&&K.clear()}K.set(t,{count:1,resetAt:e+Yn});return}n.count+=1}function C(t,e=200,n={}){return new Response(JSON.stringify(t),{status:e,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store",...n}})}function S(t,e){return C({ok:!1,error:t},e)}async function uo(t,e){let n=await t.get(Ht);if(n)return n;if(typeof e.SCANNER_TOKEN=="string"&&e.SCANNER_TOKEN)return e.SCANNER_TOKEN;let r=k(24);return await t.put(Ht,r),r}async function lo(t,e,n){if(!e.pathname.startsWith(be))return null;let{store:r,env:o,config:s,auth:a}=n,i=e.pathname.slice(be.length)||"/",c=t.method.toUpperCase();if(i==="/session"&&c==="GET"){let l=await ie(r,t);return C({ok:!0,authenticated:l,panelPath:a.panelPath})}if(i==="/login"&&c==="POST"){let l="";try{let h=await t.json();l=String(h.password??"")}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}if(!l)return S(__sfx("6K+36L6T5YWl5a+G56CB"),400);let u=so(t),f=Date.now();if(io(u,f))return new Response(JSON.stringify({ok:!1,error:__sfx("5bCd6K+V6L+H5LqO6aKR57mB77yM6K+356iN5ZCO5YaN6K+V")}),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(Yn/1e3))}});let d=await An(a,l);if(!d.ok)return ao(u,f),S(__sfx("5a+G56CB6ZSZ6K+v"),401);K.delete(u),d.legacy&&await Cn(r,l).catch(()=>{}),await xn(r).catch(()=>{});let m=await Tn(r);return C({ok:!0},200,{"Set-Cookie":Dn(m)})}if(i==="/logout"&&c==="POST")return await Rn(r,t),C({ok:!0},200,{"Set-Cookie":In()});if(i==="/preferred-ips"&&c==="POST"){let l=t.headers.get("Authorization")??"",u=l.startsWith("Bearer ")?l.slice(7).trim():l.trim();if(!await On(r,u))return S(__sfx("VG9rZW4g5qCh6aqM5aSx6LSl"),401);let d;try{d=await t.json()}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}let m=Array.isArray(d.ips)?d.ips.map(U=>String(U)):[],h=m.map(U=>U.trim()).filter(U=>U.length>0).join(`
|
|
7
7
|
`);await r.get(H)!==h&&await r.put(H,h);let w={};(s.add??"").trim()!==""&&(w.add=""),s.poolManual||(w.poolManual=!0);let O=!1;return Object.keys(w).length>0&&(await ut(r,at(s,w)),n.onConfigChanged(),O=w.add!==void 0),C({ok:!0,count:m.length,clearedManual:O,enabledManual:w.poolManual===!0})}if(!await ie(r,t))return S(__sfx("5pyq55m75b2V5oiW5Lya6K+d5bey6L+H5pyf"),401);if(i==="/status"&&c==="GET"){let l=await lt(r),u=gt(l),f=ht(s.subDomain||o.DATA_HOST||e.hostname);return C({ok:!0,panelPath:a.panelPath,domain:e.hostname,nodeDomain:f,dataHost:o.DATA_HOST??"",colo:t.cf?.colo??"UNK",coloLabel:dt(t.cf?.colo??""),localIps:u.length,generatedPassword:a.generatedPassword,version:ge,pkgVersion:me,readAt:Date.now()})}if(i==="/config"&&c==="GET")return C({ok:!0,config:s});if(i==="/config"&&c==="PUT"){let l;try{l=await t.json()}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}if(!l.config||typeof l.config!="object")return S(__sfx("57y65bCR6YWN572u5a+56LGh"),400);let u=pe(l.config);if(u.length>0)return S(de(u),400);let f=at(s,l.config);return await ut(r,f),n.onConfigChanged(),C({ok:!0,config:f})}if(i==="/config/export"&&c==="GET")return C({ok:!0,...jn(s)});if(i==="/config/import"&&c==="POST"){let l;try{l=await t.json()}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}if(!l.config||typeof l.config!="object")return S(__sfx("57y65bCR6YWN572u5a+56LGh"),400);let u=Hn(l.config);if(Object.keys(u).length===0)return S(__sfx("5rKh5pyJ5Y+v5a+85YWl55qE5a2X5q6177yI56Gu6K6k5piv5pys6aG555uu5a+85Ye655qE6YWN572u5paH5Lu277yf77yJ"),400);let f=pe(u);if(f.length>0)return S(de(f),400);let d=Kn(s,u);if(l.dryRun)return C({ok:!0,dryRun:!0,diff:d,count:d.length});if(d.length===0)return C({ok:!0,applied:0,diff:[],config:s});let m=at(s,u);return await ut(r,m),n.onConfigChanged(),C({ok:!0,applied:d.length,diff:d,config:m})}if(i==="/ips"&&c==="GET"){let l=await lt(r),u=gt(l);return C({ok:!0,raw:l,count:u.length,entries:u})}if(i==="/ips"&&c==="DELETE")return await r.delete(H),C({ok:!0});if(i==="/ips"&&c==="PUT"){let l;try{l=await t.json()}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}if(typeof l.raw!="string")return S(__sfx("57y65bCRIHJhdyDlrZfmrrU="),400);let u=l.raw.split(/\r?\n/).map(f=>f.trim()).filter(f=>f.length>0).join(`
|
|
8
8
|
`);return u?await r.put(H,u):await r.get(H)!==null&&await r.delete(H),C({ok:!0,count:u?u.split(`
|
|
9
9
|
`).length:0})}if(i==="/nodes"&&c==="GET"){let l=await lt(r),u=await ct(r),f=new rt(8),d=await Tt(s,l,{budget:f,domainPool:u.length>0?u:void 0,bypassRemoteCache:!0});return C({ok:!0,count:d.nodes.length,nodes:d.nodes.slice(0,200).map(m=>({...m,coloLabel:m.colo?dt(m.colo):""})),groups:d.groups.map(m=>({key:m.key,name:m.name,count:m.entries.length})),stats:d.stats})}if(i==="/pool/meta"&&c==="GET"){let l=await ct(r);return C({ok:!0,countries:Fe.map(u=>({code:u,name:ve[u]??u})),limits:{officialCount:200,domainCount:100},builtin:{cidrs:Et.length,domains:pt.length},customDomains:l})}if(i==="/pool/library"&&c==="PUT"){let l;try{l=await t.json()}catch{return S(__sfx("6K+35rGC5L2T6Kej5p6Q5aSx6LSl"),400)}let u=Array.isArray(l.domains)?l.domains.map(f=>String(f)):[];return await Re(r,u),C({ok:!0,count:u.filter(f=>f.trim()).length})}if(i==="/scanner-token"&&c==="POST"){let l=await Nn(r);return C({ok:!0,token:l,expiresIn:600})}if(i==="/sub-token"&&(c==="GET"||c==="POST")){let l=c==="POST",u=l?await cn(r):await It(r),f=await fn(u,{ttlDays:s.subTokenTtlDays}),d=await Rt(u,f);return C({ok:!0,rotated:l,mode:s.subToken,ttlDays:s.subTokenTtlDays,token:f,link:`${e.origin}/sub/${f}`,expiresAt:(d.exp??0)*1e3})}return i==="/events"&&c==="GET"?await co(t,r):S(__sfx("5o6l5Y+j5LiN5a2Y5Zyo"),404)}async function co(t,e){let n=new TextEncoder,r="",o,s=new ReadableStream({async start(a){let i=()=>{o&&clearTimeout(o);try{a.close()}catch{}};t.signal.addEventListener("abort",i);let c=async()=>{try{let p=await lt(e);if(p!==r){r=p;let l=gt(p).length;a.enqueue(n.encode(__sfx("ZXZlbnQ6IGlwcwpkYXRhOiA=")+JSON.stringify({count:l})+"\n\n"))}else a.enqueue(n.encode(`: keepalive
|
package/assets/dataplane.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __sfx=(()=>{const __t=new TextDecoder(),__c=new Map();return b=>{let v=__c.get(b);if(v===void 0){const s=atob(b),u=new Uint8Array(s.length);for(let i=0;i<s.length;i++)u[i]=s.charCodeAt(i);v=__t.decode(u);__c.set(b,v)}return v}})();var Fn=Object.defineProperty;var E=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var he=(e,t)=>{for(var n in t)Fn(e,n,{get:t[n],enumerable:!0})};function ye(e){let t=new Uint8Array(e);crypto.getRandomValues(t);let n="";for(let o of t)n+=ge[o>>4]+ge[o&15];return n}function Me(){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[];for(let n of e)t.push(ge[n>>4]+ge[n&15]);return[t.slice(0,4).join(""),t.slice(4,6).join(""),t.slice(6,8).join(""),t.slice(8,10).join(""),t.slice(10,16).join("")].join("-")}function re(e,t){if(e.length!==t.length)return!1;let n=0;for(let o=0;o<e.length;o++)n|=e.charCodeAt(o)^t.charCodeAt(o);return n===0}var ge,z=E(()=>{"use strict";ge="0123456789abcdef"});function O(e){let t=Yn.exec(e);if(!t)return!1;for(let n=1;n<=4;n++){let o=Number(t[n]);if(!Number.isInteger(o)||o<0||o>255)return!1}return!0}function Y(e){return!e.includes(":")||!/^[0-9a-fA-F:.]+$/.test(e)?!1:Vn(e)!==null}function Vn(e){if(!e.includes(":"))return null;let t=e,n=t.lastIndexOf(":"),o=t.slice(n+1);if(o.includes(".")){if(!O(o))return null;let u=o.split(".").map(d=>Number(d));t=`${t.slice(0,n+1)}${(u[0]<<8|u[1]).toString(16)}:${(u[2]<<8|u[3]).toString(16)}`}let r=t.indexOf("::"),s,i;if(r>=0){if(t.indexOf("::",r+1)>=0)return null;let u=t.slice(0,r),d=t.slice(r+2);s=u?u.split(":"):[],i=d?d.split(":"):[]}else s=t.split(":"),i=[];let a=s.length+i.length;if(a>8)return null;let c=[],f=u=>/^[0-9a-fA-F]{1,4}$/.test(u)?parseInt(u,16):null;for(let u of s){let d=f(u);if(d===null)return null;c.push(d)}let l=8-a;for(let u=0;u<l;u++)c.push(0);for(let u of i){let d=f(u);if(d===null)return null;c.push(d)}return c.length===8?c:null}function qn(e){let t=e.map(c=>(c&65535).toString(16)),n=-1,o=0,r=-1,s=0;for(let c=0;c<t.length;c++)t[c]==="0"?(r<0&&(r=c),s++,s>o&&(o=s,n=r)):(r=-1,s=0);if(o<2)return t.join(":");let i=t.slice(0,n).join(":"),a=t.slice(n+o).join(":");return`${i}::${a}`}function Qn(e,t,n,o){if(t<0||t>=e.length)return null;if(n===1)return t+5>e.length?null:{hostname:`${e[t+1]}.${e[t+2]}.${e[t+3]}.${e[t+4]}`,next:t+5};if(o?n===2:n===3){if(t+2>e.length)return null;let r=e[t+1];return t+2+r>e.length?null:{hostname:Xn.decode(e.subarray(t+2,t+2+r)),next:t+2+r}}if(o?n===3:n===4){if(t+17>e.length)return null;let r=new DataView(e.buffer,e.byteOffset+t+1,16),s=[];for(let i=0;i<8;i++)s.push(r.getUint16(i*2,!1));return{hostname:qn(s),next:t+17}}return null}async function Ke(e,t){let n=await e.peekExactly(1);if(!n)return null;let o=n[0],r;if(o===1)r=5;else if(t?o===2:o===3){let a=await e.peekExactly(2);if(!a)return null;r=2+a[1]}else if(t?o===3:o===4)r=17;else return null;let s=await e.peekExactly(r);if(!s)return null;let i=Qn(s,0,o,t);return i?(e.skip(r),{hostname:i.hostname,addressType:o,consumed:r}):null}var Xn,Yn,j=E(()=>{"use strict";Xn=new TextDecoder,Yn=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/});function St(e){let t=e.replace(/-/g,"").trim().toLowerCase();if(!/^[0-9a-f]{32}$/.test(t))return null;let n=new Uint8Array(16);for(let o=0;o<16;o++)n[o]=parseInt(t.slice(o*2,o*2+2),16);return n}async function Ct(e,t){let n=await e.readExactly(1);if(!n)return null;let o=await e.readExactly(16);if(!o)return null;let r=St(t);if(!r)return null;for(let d=0;d<16;d++)if(o[d]!==r[d])return null;let s=await e.readExactly(1);if(!s)return null;let i=s[0],a=i>0?await e.readExactly(i):new Uint8Array(0);if(!a)return null;let c=await e.readExactly(1);if(!c)return null;let f=await e.readExactly(2);if(!f)return null;let l=await Ke(e,!0);if(!l)return null;let u=f[0]<<8|f[1];return{header:{version:n[0],command:c[0],port:u,hostname:l.hostname,addressType:l.addressType,addons:a},payload:e.release()}}function Tt(e,t){if(e.byteLength<18)return null;let n=St(t);if(!n)return null;for(let f=0;f<16;f++)if(e[1+f]!==n[f])return null;let o=e[17],r=18+o;if(e.byteLength<r+4)return null;let s=e[r];r+=1;let i=e[r]<<8|e[r+1];r+=2;let a=e[r];r+=1;let c="";if(a===1){if(e.byteLength<r+4)return null;c=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(a===2){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;c=Jn.decode(e.subarray(r,r+f)),r+=f}else if(a===3){if(e.byteLength<r+16)return null;let f=[];for(let l=0;l<8;l++)f.push((e[r+l*2]<<8|e[r+l*2+1]).toString(16));c=f.join(":"),r+=16}else return null;return{header:{version:e[0],command:s,port:i,hostname:c,addressType:a,addons:e.subarray(18,18+o)},consumed:r}}var Et,Pt,Jn,We=E(()=>{"use strict";j();Et=1,Pt=2,Jn=new TextDecoder});function B(e,t){return e>>>t|e<<32-t}function _n(e){let t=new Uint32Array([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),n=e.length*8,o=Math.ceil((e.length+9)/64)*64,r=new Uint8Array(o);r.set(e),r[e.length]=128;let s=new DataView(r.buffer);s.setUint32(o-8,Math.floor(n/4294967296),!1),s.setUint32(o-4,n>>>0,!1);let i=new Uint32Array(64);for(let c=0;c<o;c+=64){for(let p=0;p<16;p++)i[p]=s.getUint32(c+p*4,!1);for(let p=16;p<64;p++){let b=B(i[p-15],7)^B(i[p-15],18)^i[p-15]>>>3,S=B(i[p-2],17)^B(i[p-2],19)^i[p-2]>>>10;i[p]=i[p-16]+b+i[p-7]+S>>>0}let f=t[0],l=t[1],u=t[2],d=t[3],h=t[4],g=t[5],T=t[6],x=t[7];for(let p=0;p<64;p++){let b=B(h,6)^B(h,11)^B(h,25),S=h&g^~h&T,R=x+b+S+Zn[p]+i[p]>>>0,X=B(f,2)^B(f,13)^B(f,22),k=f&l^f&u^l&u,H=X+k>>>0;x=T,T=g,g=h,h=d+R>>>0,d=u,u=l,l=f,f=R+H>>>0}t[0]=t[0]+f>>>0,t[1]=t[1]+l>>>0,t[2]=t[2]+u>>>0,t[3]=t[3]+d>>>0,t[4]=t[4]+h>>>0,t[5]=t[5]+g>>>0,t[6]=t[6]+T>>>0,t[7]=t[7]+x>>>0}let a=new Uint8Array(28);for(let c=0;c<7;c++)a[c*4]=t[c]>>>24&255,a[c*4+1]=t[c]>>>16&255,a[c*4+2]=t[c]>>>8&255,a[c*4+3]=t[c]&255;return a}function Dt(e){let t=_n(e),n="";for(let o of t)n+=Rt[o>>4]+Rt[o&15];return n}var Zn,Rt,vt=E(()=>{"use strict";Zn=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Rt="0123456789abcdef"});function er(e){return Dt($n.encode(e))}function Lt(e,t){if(e.byteLength<58||!t)return null;let n=er(t);if(It.decode(e.subarray(0,56)).trim().toLowerCase()!==n||e[56]!==13||e[57]!==10)return null;let r=58;if(e.byteLength<r+2)return null;let s=e[r];r+=1;let i=e[r];r+=1;let a="";if(i===1){if(e.byteLength<r+4)return null;a=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(i===3){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;a=It.decode(e.subarray(r,r+f)),r+=f}else if(i===4){if(e.byteLength<r+16)return null;let f=[];for(let l=0;l<8;l++)f.push((e[r+l*2]<<8|e[r+l*2+1]).toString(16));a=f.join(":"),r+=16}else return null;if(e.byteLength<r+4)return null;let c=e[r]<<8|e[r+1];return r+=2,e[r]!==13||e[r+1]!==10?null:(r+=2,{header:{command:s,port:c,hostname:a,addressType:i},consumed:r})}var Ut,$n,It,kt=E(()=>{"use strict";j();vt();Ut=3,$n=new TextEncoder,It=new TextDecoder});function tr(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}function ze(e){if(e.byteLength<12)return new Uint8Array(0);let t=e.slice();return t[2]=128|e[2]&1,t[3]=130,t}var be,Ot=E(()=>{"use strict";be=class{constructor(t){this.options=t}options;pending=new Uint8Array(0);queue=Promise.resolve();dropped=0;push(t){if(t.byteLength!==0){if(this.pending=tr(this.pending,t),this.pending.byteLength>262144){this.pending=new Uint8Array(0);return}this.drain()}}get droppedCount(){return this.dropped}drain(){for(;this.pending.byteLength>=2;){let t=this.pending[0]<<8|this.pending[1];if(t===0||t>65535){this.dropped+=1,this.pending=this.pending.subarray(2);continue}if(this.pending.byteLength<2+t)return;let n=this.pending.slice(2,2+t);this.pending=this.pending.subarray(2+t),this.queue=this.queue.then(()=>this.resolve(n)).catch(()=>{})}}async resolve(t){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeoutMs??5e3);try{let r=await fetch(this.options.endpoint,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:t.slice().buffer,signal:n.signal});if(!r.ok){this.reply(ze(t));return}let s=new Uint8Array(await r.arrayBuffer());if(s.byteLength===0){this.reply(ze(t));return}this.reply(s)}catch{this.reply(ze(t))}finally{clearTimeout(o)}}reply(t){if(t.byteLength===0||t.byteLength>65535)return;let n=new Uint8Array(2+t.byteLength);n[0]=t.byteLength>>8&255,n[1]=t.byteLength&255,n.set(t,2),this.options.send(n)}}});function je(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(new ArrayBuffer(e.byteLength+t.byteLength));return n.set(e,0),n.set(t,e.byteLength),n}var G,oe=E(()=>{"use strict";G=class{reader;chunks=[];size=0;done=!1;constructor(t){this.reader=t.getReader()}async cancel(t){if(!this.done){this.done=!0,this.chunks=[],this.size=0;try{await this.reader.cancel(t)}catch{}}}async fill(){for(;;){if(this.done)return null;let{done:t,value:n}=await this.reader.read();if(t)return this.done=!0,null;if(n&&n.byteLength>0)return this.chunks.push(n),this.size+=n.byteLength,n.byteLength}}async readExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.take(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.take(t)}take(t){let n=new Uint8Array(t),o=0;for(;o<t;){let r=this.chunks[0],s=t-o;r.byteLength<=s?(n.set(r,o),o+=r.byteLength,this.chunks.shift()):(n.set(r.subarray(0,s),o),this.chunks[0]=r.subarray(s),o+=s)}return this.size-=t,n}async peekExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.slice(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.slice(t)}skip(t){return this.size<t?null:this.take(t)}slice(t){let n=new Uint8Array(t),o=0;for(let r of this.chunks){if(o>=t)break;let s=Math.min(r.byteLength,t-o);n.set(r.subarray(0,s),o),o+=s}return n}peek(){if(this.chunks.length===0)return new Uint8Array(0);let t=this.chunks.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t),o=0;for(let r of this.chunks)n.set(r,o),o+=r.byteLength;return n}release(){let t=this.peek();this.chunks=[],this.size=0;let n=this.reader,o=this,r=!1;return new ReadableStream({async pull(s){if(!r&&(r=!0,t.byteLength>0)){s.enqueue(t);return}if(o.done){s.close();return}try{let{done:i,value:a}=await n.read();i?(o.done=!0,s.close()):a&&a.byteLength>0&&s.enqueue(a)}catch(i){s.error(i)}},cancel(s){n.cancel(s)}})}}});async function V(e,t,n,o){let r=Date.now()+n,s=await Promise.race([e.readExactly(t),new Promise(i=>setTimeout(()=>i(null),Math.max(1,r-Date.now())))]);if(s===null)throw new Error(""+o+__sfx("6LaF5pe277yI")+n+__sfx("bXMg5peg5ZON5bqU77yJ"));return s}async function Nt(e,t,n,o,r={}){let s=new G(e),i=t.getWriter(),a=r.handshakeTimeoutMs??nr,c=async f=>{await i.write(f)};try{let f=[0];r.username&&f.push(2);let l=new Uint8Array(2+f.length);l[0]=5,l[1]=f.length,l.set(f,2),await c(l);let u=await V(s,2,a,__sfx("U09DS1M1IOaPoeaJiw=="));if(!u||u[0]!==5)throw new Error(__sfx("U09DS1M1IOaPoeaJi+Wksei0pe+8mumdnuazleWTjeW6lA=="));let d=u[1];if(d===2){let p=new TextEncoder().encode(r.username??""),b=new TextEncoder().encode(r.password??""),S=new Uint8Array(3+p.length+b.length);S[0]=1,S[1]=p.length,S.set(p,2),S[2+p.length]=b.length,S.set(b,3+p.length),await c(S);let R=await V(s,2,a,__sfx("U09DS1M1IOiupOivgQ=="));if(!R||R[1]!==0)throw new Error(__sfx("U09DS1M1IOeUqOaIt+WQjS/lr4bnoIHorqTor4HlpLHotKU="))}else if(d!==0)throw new Error(__sfx("U09DS1M1IOS4jeaUr+aMgeeahOiupOivgeaWueW8j++8mjB4")+d.toString(16)+"");let h=rr(n,o),g=new Uint8Array(3+h.length);g[0]=5,g[1]=1,g[2]=0,g.set(h,3),await c(g);let T=await V(s,4,a,__sfx("U09DS1M1IENPTk5FQ1Q="));if(!T||T[0]!==5)throw new Error(__sfx("U09DS1M1IENPTk5FQ1Qg5ZON5bqU6Z2e5rOV"));if(T[1]!==0)throw new Error(__sfx("U09DS1M1IENPTk5FQ1Qg5aSx6LSl77yaMHg=")+T[1].toString(16)+"");let x=T[3];if(x===1)await V(s,4,a,__sfx("U09DS1M1IOWTjeW6lA=="));else if(x===3){let p=await V(s,1,a,__sfx("U09DS1M1IOWTjeW6lA=="));if(!p)throw new Error(__sfx("U09DS1M1IOWTjeW6lOaIquaWrQ=="));await V(s,p[0],a,__sfx("U09DS1M1IOWTjeW6lA=="))}else if(x===4)await s.readExactly(16);else throw new Error(__sfx("U09DS1M1IOWTjeW6lOWcsOWdgOexu+Wei+mdnuazlQ=="));return await V(s,2,a,__sfx("U09DS1M1IOWTjeW6lA==")),s.release()}finally{try{i.releaseLock()}catch{}}}function rr(e,t){if(O(e)){let r=e.split(".").map(i=>Number(i)),s=new Uint8Array(7);return s[0]=1,s.set(r,1),s[5]=t>>8&255,s[6]=t&255,s}if(Y(e)){let r=new Uint8Array(19);r[0]=4;let s=e.split(":").filter(Boolean);for(let i=0;i<8;i++){let a=parseInt(s[i]??"0",16)||0;r[1+i*2]=a>>8&255,r[2+i*2]=a&255}return r[17]=t>>8&255,r[18]=t&255,r}let n=new TextEncoder().encode(e),o=new Uint8Array(2+n.length+2);return o[0]=3,o[1]=n.length,o.set(n,2),o[o.length-2]=t>>8&255,o[o.length-1]=t&255,o}var nr,Mt=E(()=>{"use strict";oe();j();nr=6e3});function sr(e){let t=e.byteLength;for(let n=0;n+3<t;n++)if(or.every((o,r)=>e[n+r]===o))return n;return-1}async function Ft(e,t,n,o,r={}){let s=new G(e),i=t.getWriter(),a=`${n}:${o}`;try{let c=r.username&&r.password?__sfx("UHJveHktQXV0aG9yaXphdGlvbjogQmFzaWMg")+btoa(`${r.username}:${r.password}`)+"\r\n":"",f=[__sfx("Q09OTkVDVCA=")+a+" HTTP/1.1",`Host: ${a}`,__sfx("UHJveHktQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ=="),__sfx("VXNlci1BZ2VudDogQ0ZQaWxvdC8xLjA="),c,"",""].join(`\r
|
|
2
|
-
`);await i.write(new TextEncoder().encode(f));let l=Date.now()+
|
|
3
|
-
`)[0]??"",g=/^HTTP\/1\.[01]\s+(\d{3})/.exec(h);if(!g)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTpnZ7ms5U="));if(g[1]!=="200")throw new Error(__sfx("SFRUUCDku6PnkIYgQ09OTkVDVCDlpLHotKXvvJo=")+g[1]+"");return s.release()}finally{try{i.releaseLock()}catch{}}}var or,Ge,Bt=E(()=>{"use strict";oe();or=[13,10,13,10];Ge=6e3});function lr(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)?!0:e.includes(":")&&/^[0-9a-fA-F:.]+$/.test(e)}function cr(e,t){let n=e.trim(),o=/^\[([^\]]+)\](?::(\d+))?$/.exec(n);if(o)return{host:o[1],port:Number(o[2]??t)};if(n.includes(":")&&n.split(":").length>2)return{host:n,port:t};let r=n.lastIndexOf(":");if(r<0)return{host:n,port:t};let s=n.slice(0,r),i=Number(n.slice(r+1));return s?{host:s,port:Number.isInteger(i)&&i>0?i:t}:{host:n,port:t}}async function ur(e,t,n,o=zt){try{let r=`${e}?name=${encodeURIComponent(t)}&type=${n}`,s=await fetch(r,{headers:{accept:"application/dns-json"},signal:AbortSignal.timeout(o)});if(!s.ok)return[];let i=await s.json();if(!i||i.Status!==0||!Array.isArray(i.Answer))return[];let a=n==="TXT"?16:n==="A"?1:28;return i.Answer.filter(c=>c.type===a).map(c=>String(c.data))}catch{return[]}}async function Kt(e,t,n={}){for(let o of ir){if(n.deadline!==void 0&&Date.now()>=n.deadline)break;let r=n.timeoutMs??zt,s=n.deadline!==void 0?n.deadline-Date.now():Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")],i=Math.max(50,Math.min(r,s)),a=await ur(o,e,t,i);if(a.length>0)return a}return[]}function fr(e,t){let n=[],o=String(e).replace(/^"|"$/g,"").replace(/\\010/g,",").replace(/\\n/g,",").trim();if(!o||o===Wt)return n;let r=o.split(/[,;\s]+/).filter(Boolean);if(r.length===0)return n;for(let s of r){let i=s.trim();if(!i)continue;let{host:a,port:c}=cr(i,t);if(!O(a)&&!Y(a))return[];n.push({hostname:a,port:c})}return n}async function we(e,t,n={}){let o=e.trim();if(!o)return[];if(lr(o))return[{hostname:o,port:t}];let r=`${o}:${t}`,s=Ht.get(r);if(s&&Date.now()-s.at<ar)return s.ips;let i=[],[a,c]=await Promise.all([n.skipTxt?Promise.resolve([]):Kt(o,"TXT",n),Kt(o,"A",n)]);if(!n.skipTxt)for(let u of a){let d=fr(u,t);if(d.length>0){i.push(...d);break}if(String(u).replace(/^"|"$/g,"").replace(/\\010/g,",").trim()===Wt)break}if(i.length===0)for(let u of c)O(u)&&i.push({hostname:u,port:t});let f=[],l=new Set;for(let u of i){let d=`${u.hostname}:${u.port}`;l.has(d)||(l.add(d),f.push(u))}return f.length>0&&Ht.set(r,{at:Date.now(),ips:f}),f}var Wt,ir,zt,ar,Ht,Xe=E(()=>{"use strict";j();Wt=__sfx("QGVkZ2V0dW5uZWw="),ir=["https://cloudflare-dns.com/dns-query","https://dns.alidns.com/resolve","https://doh.pub/dns-query"],zt=4e3,ar=300*1e3,Ht=new Map});var _e={};he(_e,{[__sfx("QlVJTFRJTl9SRUxBWV9ET01BSU5T")]:()=>Yt,[__sfx("QlVJTFRJTl9SRUxBWV9SRUdJT04=")]:()=>Ae,[__sfx("Q09MT19UT19DT1VOVFJZ")]:()=>Vt,[__sfx("UkVHSU9OX0FESkFDRU5DWQ==")]:()=>Gt,[__sfx("UkVHSU9OX09SREVS")]:()=>Ve,[__sfx("UkVMQVlfQkFUQ0hfU0laRQ==")]:()=>J,[__sfx("UkVMQVlfRE9NQUlOX0xJTUlU")]:()=>Ze,[__sfx("VU5LTk9XTl9SRUdJT04=")]:()=>jt,clearRelayCache:()=>hr,collectRelayEndpoints:()=>se,coloToCountry:()=>xe,rankRegions:()=>Je,regionOfEntry:()=>Ye,resolveRelayEntry:()=>Qe,selectRelayDomains:()=>Qt,sortEndpointsByRegion:()=>Xt});function Ye(e){let n=e.trim().toLowerCase().replace(/:\d{1,5}$/,"");return Ae[n]??jt}function Je(e){let t=(e??"").trim().toUpperCase();if(!t)return[...Ve];let n=Gt[t]??[],o=Ve.filter(r=>r!==t&&!n.includes(r));return[t,...n,...o]}function Xt(e,t){let n=Je(t),o=r=>{let s=n.indexOf(r);return s>=0?s:n.length};return e.map((r,s)=>({e:r,i:s})).sort((r,s)=>{let i=o(r.e.regionCode),a=o(s.e.regionCode);return i!==a?i-a:r.i-s.i}).map(r=>r.e)}function xe(e){let t=String(e??"").toUpperCase();return t?Vt[t]??(/^[A-Z]{2}$/.test(t)?t:"US"):"US"}async function Qe(e,t=443,n=qt,o={}){let r=e.trim();if(!r)return[];let s=`${r}:${t}:${n}`,i=qe.get(s);if(i&&Date.now()-i.at<mr)return i.ips;let a=r,c=t,f=(r.match(/:/g)??[]).length;if(f===1){let u=/^(.*):(\d{1,5})$/.exec(r);u&&(a=u[1],c=Number(u[2]))}else if(f>1&&r.startsWith("[")){let u=/^\[([^\]]+)\]:(\d{1,5})$/.exec(r);u&&(a=u[1],c=Number(u[2]))}let l=[];if(O(a)||Y(a))l=[{ip:a,port:Number.isInteger(c)&&c>0?c:t,label:r,regionCode:Ye(r)}];else try{l=(await we(a,c,{skipTxt:o.skipTxt,deadline:o.deadline,timeoutMs:o.timeoutMs})).slice(0,n).map(d=>({ip:d.hostname,port:d.port,label:`${a} \u2192 ${d.hostname}`,regionCode:Ye(r)}))}catch{l=[]}return l.length>0&&qe.set(s,{at:Date.now(),ips:l}),l}function Qt(e,t=Ze){let n=xe(e),o=Je(n),r=s=>{let i=Ae[s];if(!i)return o.length+1;let a=o.indexOf(i);return a>=0?a:o.length};return Yt.map((s,i)=>({d:s,i,rank:r(s)})).sort((s,i)=>s.rank!==i.rank?s.rank-i.rank:s.i-i.i).map(s=>s.d).slice(0,Math.max(0,t))}async function se(e={}){let t=e.perDomain??qt,n=[],o=new Set,r=p=>{for(let b of p){let S=`${b.ip}:${b.port}`;o.has(S)||(o.add(S),n.push(b))}},s=(e.userEntries??"").trim(),i=s?s.split(/[\n,;]+/).map(p=>p.trim()).filter(Boolean):[],a=e.domainLimit??Ze,c=e.useBuiltin!==!1?Qt(e.colo,a):[],f=p=>e.perDomain!==void 0?t:Ae[p]===xe(e.colo)?pr:dr,l=await Promise.all([...i.map(p=>Qe(p,443,t,{deadline:e.deadline,timeoutMs:e.timeoutMs})),...c.map(p=>Qe(p,443,f(p),{skipTxt:!0,deadline:e.deadline,timeoutMs:e.timeoutMs}))]),u=n.length;for(let p=0;p<i.length;p++)r(l[p]);let d=n.length-u,h=l.slice(i.length),g=h.reduce((p,b)=>Math.max(p,b.length),0);for(let p=0;p<g;p++)for(let b of h)p<b.length&&r([b[p]]);let T=n.slice(0,d),x=Xt(n.slice(d),xe(e.colo));return[...T,...x]}function hr(){qe.clear()}var jt,Gt,Ve,Ae,Yt,Vt,qt,J,Ze,pr,dr,mr,qe,ie=E(()=>{"use strict";j();Xe();jt="??";Gt={[__sfx("VVM=")]:["SG","JP","KR"],[__sfx("U0c=")]:["JP","KR","US"],[__sfx("SlA=")]:["SG","KR","US"],[__sfx("S1I=")]:["JP","SG","US"],[__sfx("REU=")]:["NL","GB","SE","FI"],[__sfx("U0U=")]:["DE","NL","FI","GB"],[__sfx("Tkw=")]:["DE","GB","SE","FI"],[__sfx("Rkk=")]:["SE","DE","NL","GB"],[__sfx("R0I=")]:["DE","NL","SE","FI"]},Ve=["US","SG","JP","KR","DE","SE","NL","FI","GB"];Ae={[__sfx("cHJveHlpcC5oay5jbWxpdXNzc3MubmV0")]:"HK",[__sfx("cHJveHlpcC51cy5jbWxpdXNzc3MubmV0")]:"US",[__sfx("cHJveHlpcC5zZy5jbWxpdXNzc3MubmV0")]:"SG",[__sfx("cHJveHlpcC5qcC5jbWxpdXNzc3MubmV0")]:"JP",[__sfx("cHJveHlpcC5rci5jbWxpdXNzc3MubmV0")]:"KR",[__sfx("cHJveHlpcC5kZS5jbWxpdXNzc3MubmV0")]:"DE",[__sfx("cHJveHlpcC5zZS5jbWxpdXNzc3MubmV0")]:"SE",[__sfx("cHJveHlpcC5ubC5jbWxpdXNzc3MubmV0")]:"NL",[__sfx("cHJveHlpcC5maS5jbWxpdXNzc3MubmV0")]:"FI",[__sfx("cHJveHlpcC5nYi5jbWxpdXNzc3MubmV0")]:"GB",[__sfx("cHJveHlpcC5vcmFjbGUuY21saXVzc3NzLm5ldA==")]:"Oracle",[__sfx("cHJveHlpcC5kaWdpdGFsb2NlYW4uY21saXVzc3NzLm5ldA==")]:"DigitalOcean",[__sfx("cHJveHlpcC52dWx0ci5jbWxpdXNzc3MubmV0")]:"Vultr",[__sfx("cHJveHlpcC5tdWx0YWNvbS5jbWxpdXNzc3MubmV0")]:"Multacom"},Yt=[__sfx("cHJveHlpcC5oay5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5qcC5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5zZy5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC51cy5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5kZS5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5nYi5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5rci5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5ubC5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5zZS5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5maS5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5vcmFjbGUuY21saXVzc3NzLm5ldA=="),__sfx("cHJveHlpcC5kaWdpdGFsb2NlYW4uY21saXVzc3NzLm5ldA=="),__sfx("cHJveHlpcC52dWx0ci5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5tdWx0YWNvbS5jbWxpdXNzc3MubmV0")],Vt={[__sfx("SEtH")]:"HK",[__sfx("U1lE")]:"AU",[__sfx("TUVM")]:"AU",[__sfx("Qk5F")]:"AU",[__sfx("UEVS")]:"AU",[__sfx("QURM")]:"AU",[__sfx("Q0JS")]:"AU",[__sfx("U0lO")]:"SG",[__sfx("TlJU")]:"JP",[__sfx("SE5E")]:"JP",[__sfx("S0lY")]:"JP",[__sfx("VFlP")]:"JP",[__sfx("T1NB")]:"JP",[__sfx("TkdP")]:"JP",[__sfx("Q1RT")]:"JP",[__sfx("RlVL")]:"JP",[__sfx("T0tB")]:"JP",[__sfx("SUNO")]:"KR",[__sfx("U0VM")]:"KR",[__sfx("UFVT")]:"KR",[__sfx("RlJB")]:"DE",[__sfx("TVVD")]:"DE",[__sfx("RFVT")]:"DE",[__sfx("QkVS")]:"DE",[__sfx("SEFN")]:"DE",[__sfx("U1RS")]:"DE",[__sfx("VklF")]:"DE",[__sfx("WlJI")]:"DE",[__sfx("Q0RH")]:"FR",[__sfx("TUFE")]:"ES",[__sfx("TVhQ")]:"IT",[__sfx("RkNP")]:"IT",[__sfx("UFJH")]:"CZ",[__sfx("V0FX")]:"PL",[__sfx("QVJO")]:"SE",[__sfx("QU1T")]:"NL",[__sfx("SEVM")]:"FI",[__sfx("TEhS")]:"GB",[__sfx("TEdX")]:"GB",[__sfx("TUFO")]:"GB",[__sfx("RURJ")]:"GB",[__sfx("TEFY")]:"US",[__sfx("U0pD")]:"US",[__sfx("U0ZP")]:"US",[__sfx("U0VB")]:"US",[__sfx("UERY")]:"US",[__sfx("U0FO")]:"US",[__sfx("TEFT")]:"US",[__sfx("UEhY")]:"US",[__sfx("U0xD")]:"US",[__sfx("REVO")]:"US",[__sfx("REZX")]:"US",[__sfx("SUFI")]:"US",[__sfx("QVVT")]:"US",[__sfx("T1JE")]:"US",[__sfx("TVNQ")]:"US",[__sfx("RFRX")]:"US",[__sfx("U1RM")]:"US",[__sfx("TUNJ")]:"US",[__sfx("QVRM")]:"US",[__sfx("TUlB")]:"US",[__sfx("TUNP")]:"US",[__sfx("Qk5B")]:"US",[__sfx("Q0xU")]:"US",[__sfx("SUFE")]:"US",[__sfx("Qk9T")]:"US",[__sfx("RVdS")]:"US",[__sfx("SkZL")]:"US",[__sfx("UEhM")]:"US",[__sfx("WVla")]:"CA",[__sfx("WVZS")]:"CA",[__sfx("WVVM")]:"CA",[__sfx("TUVY")]:"MX",[__sfx("R1JV")]:"BR",[__sfx("VFBF")]:"TW",[__sfx("S0hI")]:"TW",[__sfx("VFNB")]:"TW",[__sfx("Uk1R")]:"TW"};qt=4,J=6,Ze=3,pr=2,dr=1,mr=30*1e3,qe=new Map});function Jt(e){let t=e.split(".");if(t.length!==4)return null;let n=0;for(let o of t){if(!/^\d{1,3}$/.test(o))return null;let r=Number(o);if(r>255)return null;n=n*256+r}return n>>>0}function Z(e){let t=Jt(e);if(t===null)return!1;for(let[n,o]of gr){let r=Jt(n);if(r===null)continue;let s=o===0?0:4294967295<<32-o>>>0;if((t&s)===(r&s))return!0}return!1}function Zt(e){let t=[],n=new Set,o=l=>{let u=`${l.source}|${l.host}|${l.port}`;n.has(u)||(n.add(u),t.push(l))};for(let l of e.proxies??[])l.kind==="direct"?o({source:"proxy",host:l.host,port:l.port,label:__sfx("UHJveHlJUCA=")+l.host+":"+l.port+"",via:{kind:"direct",host:l.host,port:l.port}}):o({source:"proxy",host:l.host,port:l.port,label:`${l.kind.toUpperCase()} ${l.host}:${l.port}`,via:{kind:l.kind,host:l.host,port:l.port,username:l.username,password:l.password,serverName:l.serverName}});let s=Z(e.targetHost)||e.deprioritizeDirect===!0;o({source:"direct",host:e.targetHost,port:e.targetPort,label:__sfx("55u06L+eIA==")+e.targetHost+":"+e.targetPort+"",deprioritized:s});let i=e.optimizedIps??[],a=i.filter(l=>!Z(l.ip)),c=i.filter(l=>Z(l.ip));for(let l of a)o({source:"optimized",host:l.ip,port:l.port,label:__sfx("5LyY6YCJIA==")+l.ip+":"+l.port+""});for(let l of c)o({source:"optimized",host:l.ip,port:l.port,label:__sfx("5LyY6YCJIA==")+l.ip+":"+l.port+__sfx("77yIQ2xvdWRmbGFyZSDnvZHmrrXvvIzlj6/og73kuI3lj6/ovr7vvIk="),deprioritized:!0});let f=e.relay??[];for(let l of f)o({source:"relay",host:l.ip,port:l.port,label:__sfx("5Y+N5LujIA==")+l.label+"",deprioritized:!e.relayAsPrimary});return t.map((l,u)=>({candidate:l,index:u})).sort((l,u)=>{let d=+!!l.candidate.deprioritized-+!!u.candidate.deprioritized;return d!==0?d:l.index-u.index}).map(l=>l.candidate)}function _t(e){let t=e.filter(o=>!o.deprioritized),n=t.filter(o=>o.source==="proxy");return{landing:n.filter(o=>o.via?.kind!=="direct"),[__sfx("cHJveHlJcA==")]:n.filter(o=>o.via?.kind==="direct"),direct:t.filter(o=>o.source!=="proxy"),fallback:e.filter(o=>o.deprioritized)}}function $t(e,t){let n=e instanceof Error?e.message:String(e);return/proxy request failed|cannot connect to the specified address|TCP Loop/i.test(n)?{kind:"blocked",message:n,candidate:t}:/timeout|超时|timed out|abort/i.test(n)?{kind:"timeout",message:n,candidate:t}:{kind:"other",message:n,candidate:t}}function en(e){switch(e.kind){case"blocked":return __sfx("5Ye656uZ6KKrIENsb3VkZmxhcmUg5ouS57ud77yI")+e.candidate+"):"+e.message+__sfx("CiAg5bi46KeB5Y6f5Zug77ya55uu5qCH5Zyw5Z2A5ZyoIENsb3VkZmxhcmUg6Ieq5a62572R5q6177yIV29ya2VyIOS4jeiDveS4u+WKqOi/nuWbniBDRiDoh6rlt7HnmoTlhaXlj6PvvInjgIIKICDihpIg5o2i5LiA5Liq56ys5LiJ5pa5IElQ77yM5oiW5pS555So5Luj55CG6JC95Zyw44CC");case"timeout":return __sfx("5Ye656uZ6LaF5pe277yI")+e.candidate+"):"+e.message+__sfx("CiAg4oaSIOivpeWcsOWdgOW9k+WJjeS4jeWPr+i+vu+8jOWPr+aNouS4gOadoeWAmemAieaIluWQr+eUqOS7o+eQhuiQveWcsOOAgg==");default:return __sfx("5Ye656uZ5aSx6LSl77yI")+e.candidate+"):"+e.message+""}}var gr,$e=E(()=>{"use strict";gr=[[__sfx("MTA0LjE2LjAuMA=="),13],[__sfx("MTA0LjI0LjAuMA=="),14],[__sfx("MTA0LjMxLjAuMA=="),15],[__sfx("MTcyLjY0LjAuMA=="),13],[__sfx("MTYyLjE1OC4wLjA="),15],[__sfx("MTg4LjExNC45Ni4w"),20],[__sfx("MTQxLjEwMS42NC4w"),18],[__sfx("MTA4LjE2Mi4xOTIuMA=="),18],[__sfx("MTAzLjIxLjI0NC4w"),22],[__sfx("MTAzLjIyLjIwMC4w"),22],[__sfx("MTAzLjMxLjQuMA=="),22],[__sfx("MTMxLjAuNzIuMA=="),22],[__sfx("MTk3LjIzNC4yNDAuMA=="),22],[__sfx("MTk4LjQxLjEyOC4w"),17],[__sfx("MTkyLjAuMC4w"),24],[__sfx("MTkyLjAuMi4w"),24],[__sfx("MTkyLjg4Ljk5LjA="),24],[__sfx("MTk5LjI3LjEyOC4w"),21],[__sfx("MjIzLjUuNS4w"),24],[__sfx("MS4wLjAuMA=="),24],[__sfx("MS4xLjEuMA=="),24]]});function tn(e,t="direct"){let n=e.trim();if(!n)return null;let o=t,r=n,s=/^([a-z0-9+.-]+):\/\//i.exec(n);if(s){let h=s[1].toLowerCase();r=n.slice(s[0].length),h===__sfx("c29ja3M1")||h===__sfx("c29ja3M=")||h===__sfx("c29ja3M1aA==")?o=__sfx("c29ja3M1"):h==="https"?o="https":h==="http"&&(o="http")}let i=r.lastIndexOf("@"),a={};if(i>=0){let h=r.slice(0,i);r=r.slice(i+1);let g=h.indexOf(":");g>=0?a={username:h.slice(0,g),password:h.slice(g+1)}:a={username:h}}let c,f=/#sni=([^/#]+)/i.exec(r);f&&(c=f[1].trim(),r=r.slice(0,f.index)+r.slice(f.index+f[0].length));let l=r.lastIndexOf(":");if(l<0)return null;let u=r.slice(0,l).replace(/^\[|\]$/g,""),d=Number(r.slice(l+1));return!u||!Number.isInteger(d)||d<=0||d>65535?null:(!c&&o==="https"&&!yr(u)&&(c=u),{host:u,port:d,kind:o,...a,...c?{serverName:c}:{}})}function yr(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)}function ae(e,t="direct"){let n=[];for(let o of e.split(/[\n,;]+/)){let r=o.trim();if(!r)continue;let s=tn(r,t);s&&n.push(s)}return n}var et=E(()=>{"use strict"});async function br(){return tt||(tt=(async()=>(await import("cloudflare:sockets")).connect)()),await tt}function xr(e,t){if(!O(e))return null;let n=e.split(".").map(i=>Number(i)),o=(n[0]<<8|n[1]).toString(16),r=(n[2]<<8|n[3]).toString(16);return`${t.replace(/:+$/,"")}::${o}:${r}`}async function Ee(e,t,n,o,r){let i=(await br())({hostname:e,port:t},o?{secureTransport:o}:void 0),a=async(f,l)=>{let u,d=new Promise((h,g)=>{u=setTimeout(()=>g(new Error(""+l+__sfx("6LaF5pe277ya")+e+":"+t+"")),n)});try{return await Promise.race([f,d])}finally{u&&clearTimeout(u)}},c;try{if(await a(i.opened,__sfx("6L+e5o6l")),o==="starttls"){if(c=i.startTls?.(r?{expectedServerHostname:r}:void 0),!c)throw new Error(__sfx("5b2T5YmN6L+Q6KGM5pe25LiN5pSv5oyBIHN0YXJ0VGxz"));return await a(c.opened,__sfx("VExTIOaPoeaJiw==")),c}return i}catch(f){try{await(c??i).close()}catch{}throw f}}async function Ar(e){let t=e.timeoutMs??ot;try{let n=await Ee(e.hostname,e.port,t);return{readable:n.readable,writable:n.writable,via:"direct",endpoint:`${e.hostname}:${e.port}`,close:()=>{try{n.close()}catch{}}}}catch(n){if(e.nat64&&O(e.hostname)){let o=xr(e.hostname,e.nat64);if(o){let r=await Ee(o,e.port,t);return{readable:r.readable,writable:r.writable,via:"nat64",endpoint:`${o}:${e.port}`,close:()=>{try{r.close()}catch{}}}}}throw n}}async function Er(e,t){let n=e.timeoutMs??ot;if(t.kind==="direct"){let s=await Ee(t.host,t.port,n);return{readable:s.readable,writable:s.writable,via:"direct",endpoint:`${t.host}:${t.port}`,close:()=>{try{s.close()}catch{}}}}let o=t.kind==="https"?"starttls":void 0,r=await Ee(t.host,t.port,n,o,t.kind==="https"?t.serverName:void 0);try{return t.kind==="http"||t.kind==="https"?{readable:await Ft(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:t.kind,endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}:{readable:await Nt(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:__sfx("c29ja3M1"),endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}}catch(s){try{await r.close()}catch{}throw s}}function rn(e){return e instanceof Error?e.message:typeof e=="string"?e:String(e)}function Sr(e){if(e.length===0)return __sfx("5pyq55+l5Y6f5Zug");let t=e.map(rn),n=t.slice(-Pr),o=t.length-n.length;return`${o>0?`\uFF08\u5171 ${t.length} \u6761\uFF0C\u7701\u7565\u524D ${o} \u6761\uFF09`:""}${n.join("\uFF1B")}`}function Cr(e){return e.length===0?Promise.reject(new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"))):new Promise((t,n)=>{let o=e.length,r=!1,s=[];for(let i of e)i().then(a=>{if(r){try{a.writable.getWriter().close()}catch{}return}r=!0,t(a)},a=>{s.push(a),o-=1,o===0&&!r&&(r=!0,n(new Error(__sfx("5pys5om5IA==")+e.length+__sfx("IOS4quWAmemAieWFqOmDqOWksei0pe+8mg==")+Sr(s)+"")))})})}async function rt(e,t){if(e.length===0)throw new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"));if(!t||e.length<=1){let s=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let i of e)try{return await i()}catch(a){s=a}throw s}let n=[],o=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let s=0;s<e.length;s+=nt){let i=e.slice(s,s+nt);try{return await Cr(i)}catch(a){o=a,n.push(rn(a))}}throw new Error(__sfx("5YWo6YOoIA==")+e.length+__sfx("IOS4quWAmemAieWdh+Wksei0pe+8iOWIhiA=")+n.length+__sfx("IOaJue+8jOavj+aJueacgOWkmiA=")+nt+__sfx("IOS4quW5tuWPke+8ie+8mgo=")+n.join(`
|
|
4
|
-
`),{cause:o})}async function
|
|
5
|
-
`):__sfx("5Ye656uZ6L+e5o6l5aSx6LSl77ya")+String(L)+"";$(`${m.hostname}:${m.port}`,P,U),R(1011,U);return}u=l.writable.getWriter();let I=c.byteLength>m.headerLength?c.subarray(m.headerLength):new Uint8Array(0);I.byteLength>0&&(K(I),await Oe(I)),c=new Uint8Array(0),r?.waitUntil(v())},Mn=async()=>{let m=x;if(!m){R(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55uu5qCH5pyq6Kej5p6Q"));return}if(Q>=ln){R(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55u06L+e5LiO5Y+N5Luj5YWl5Y+j5Z2H5peg5ZON5bqU"));return}Q++;let A=[];try{A=await se({userEntries:n.relayPool||void 0,useBuiltin:n.useBuiltinRelay,colo:typeof e.cf?.colo=="string"?e.cf.colo:void 0})}catch{A=[]}let P=A.filter(L=>!H.has(`${L.ip}:${L.port}`));if(P.length===0){R(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5peg5Y+N5Luj5YWl5Y+j5Y+v55So"));return}for(let L of P.slice(0,ln)){if(H.add(`${L.ip}:${L.port}`),C(),l){let I=l;if(I.close)try{I.close()}catch{}}u=null,W=0;try{let I=await le({hostname:L.ip,port:L.port,timeoutMs:sn,resolvePreferred:!1});if(!I)continue;if(l=I,u=I.writable.getWriter(),M.length>0){let U=0;for(let me of M)U+=me.byteLength;let de=new Uint8Array(U),bt=0;for(let me of M)de.set(me,bt),bt+=me.byteLength;await u.write(de)}await kn(),$(`${m.hostname}:${m.port}`,[],__sfx("5bey5YiH5o2i5Y+N5Luj5YWl5Y+jIA==")+L.ip+":"+L.port+""),r?.waitUntil(v());return}catch(I){$(`${m.hostname}:${m.port}`,[],__sfx("5Y+N5Luj5YWl5Y+jIA==")+L.ip+":"+L.port+__sfx("IOWksei0pe+8mg==")+String(I)+"")}}R(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5omA5pyJ5Y+N5Luj5YWl5Y+j5Z2H5aSx6LSl"))};a.addEventListener("message",m=>{(async()=>{let A=m.data,P=typeof A=="string"?new TextEncoder().encode(A):new Uint8Array(A);if(P.byteLength!==0){if(ne.add(P.byteLength)){pe();return}if(!f){if(c=je(c,P),c.byteLength>Rr){R(1009,__sfx("5o+h5omL5aS06LaF6L+HIDY0S0I="));return}await Ne();return}if(p){p.push(P);return}if(!u){if(c=je(c,P),c.byteLength>cn){R(1009,__sfx("5ouo5Y+35pyf6Ze05pWw5o2u6L+H5aSa"));return}return}K(P),await Oe(P)}})()});let yt=()=>{X()};a.addEventListener("close",yt),a.addEventListener("error",yt),c.byteLength>0&&Ne().catch(m=>R(1011,String(m)));try{return new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:i})}catch(m){return console.error(__sfx("W+iHqueglOaVsOaNrumdol0gMTAxIOWTjeW6lOaehOmAoOWksei0pe+8mg=="),m),new Response(null,{status:200})}}var sn,an,ln,Rr,cn,Dr,Se,Ce,un,Ir,it=E(()=>{"use strict";We();kt();Ot();oe();st();Pe();$e();ie();sn=5e3,an=2500,ln=2,Rr=64*1024,cn=8*1024*1024,Dr=32*1024*1024,Se=0;Ce=[],un=20;Ir=2e3});var dn={};he(dn,{[__sfx("aGFuZGxlWGh0dHA=")]:()=>at,[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:()=>Or,[__sfx("cmVjb3JkWGh0dHBEaWFnbm9zdGljcw==")]:()=>De});function kr(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}function De(e,t,n){Re.unshift({at:Date.now(),target:e,...t,summary:n}),Re.length>20&&(Re.length=20)}function Or(){return Re}async function at(e,t,n){let o=e.body;if(!o)return new Response(__sfx("57y65bCR6K+35rGC5L2T"),{status:400});let r=new G(o),s=await kr(Ct(r,t.uuid),Lr);if(!s)return await r.cancel("header timeout"),new Response(__sfx("VkxFU1Mg5aS06Kej5p6Q5aSx6LSl"),{status:400});if(s.header.command!==Et)return await s.payload.cancel("unsupported UDP"),new Response(__sfx("WEhUVFAg5pqC5LiN5pSv5oyBIFVEUA=="),{status:400});let i;try{i=await le({hostname:s.header.hostname,port:s.header.port,proxies:n,nat64:t.nat64,concurrent:t.concurrentDial,proxyMode:t.proxyMode,resolvePreferred:t.resolvePreferred,relayPool:{userEntries:t.relayPool||void 0,useBuiltin:t.useBuiltinRelay},onFailure:p=>{De(`${s.header.hostname}:${s.header.port}`,p,__sfx("WEhUVFAg5Ye656uZ5aSx6LSl77yI")+p.candidate+"):"+p.message+"")}})}catch(p){De(`${s.header.hostname}:${s.header.port}`,{kind:"dial",message:String(p),candidate:"all"},__sfx("WEhUVFAg5Ye656uZ5YWo6YOo5aSx6LSl77ya")+String(p)+"");try{s.payload.cancel("dial failed").catch(()=>{})}catch{}return new Response(__sfx("5Ye656uZ5LiN5Y+v55So"),{status:502})}let a=s.header.addons;if(a.byteLength>255)return new Response(__sfx("QWRkb25zIOmVv+W6pui2heWHuiBWTEVTUyDljY/orq7kuIrpmZA="),{status:400});let c=new Uint8Array(2+a.byteLength);c[0]=s.header.version,c[1]=a.byteLength,c.set(a,2);let f=!1,l=null,u=!1,d=new _((t.dataBudgetMB||0)*1024*1024),h=null,g=()=>{if(u)return;u=!0;let p=__sfx("5Y2V6L+e5o6l5rWB6YeP6LaF6L+HIA==")+t.dataBudgetMB+__sfx("TUIg5LiK6ZmQ");if(De(`${s.header.hostname}:${s.header.port}`,{kind:"budget",message:p,candidate:"traffic"},p),i.close)try{i.close()}catch{}try{h?.close()}catch{}},T=p=>d.add(p)?(g(),!0):!1;on(s.payload,i.writable,void 0,!1,T).catch(()=>{});let x=new ReadableStream({start(p){h=p,p.enqueue(c),f=!0},async pull(p){if(!(u||!f)){l||(l=i.readable.getReader());try{let{done:b,value:S}=await l.read();if(u)return;if(b){if(i.close)try{i.close()}catch{}p.close();return}if(S&&S.byteLength>0){if(d.add(S.byteLength)){g();return}p.enqueue(S)}}catch(b){if(u)return;if(i.close)try{i.close()}catch{}try{p.error(b)}catch{}}}},cancel(p){u=!0;try{i.readable.cancel(p)}catch{}if(i.close)try{i.close()}catch{}}});return new Response(x,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-store","X-Accel-Buffering":"no"}})}var Lr,Re,lt=E(()=>{"use strict";oe();We();Pe();st();Lr=2e3;Re=[]});function Ie(){return new Response(JSON.stringify({build:ct,version:Nr,ts:Date.now()}),{status:200,headers:{"Content-Type":"application/json","Cache-Control":"no-store","Access-Control-Allow-Origin":"*"}})}var ct,Nr,ve,ut=E(()=>{"use strict";ct="1a5d653-2d5c8203",Nr=__sfx("MC4xMy4x"),ve=__sfx("L19fY2ZwX3ZlcnNpb24=")});function mn(e){return e[__sfx("S1Y=")]?new ee(e[__sfx("S1Y=")]):new ft}var ee,ft,Ue=E(()=>{"use strict";ee=class{constructor(t){this.kv=t}kv;async get(t){return await this.kv.get(t)}async put(t,n,o){o&&o>=60?await this.kv.put(t,n,{expirationTtl:o}):await this.kv.put(t,n)}async delete(t){await this.kv.delete(t)}async list(t){let n=[],o;do{let r=await this.kv.list({prefix:t,cursor:o});for(let s of r.keys)n.push(s.name);o=r.list_complete?void 0:r.cursor}while(o);return n}},ft=class{data=new Map;async get(t){let n=this.data.get(t);return n?n.expiresAt>0&&n.expiresAt<=Date.now()?(this.data.delete(t),null):n.value:null}async put(t,n,o){let r=o?Date.now()+o*1e3:0;this.data.set(t,{value:n,expiresAt:r})}async delete(t){this.data.delete(t)}async list(t){return[...this.data.keys()].filter(n=>n.startsWith(t))}}});function q(e,t){if(e==null)return t;let n=String(e).trim();if(n==="")return t;let o=Number(n);return Number.isFinite(o)?o:t}function N(e,t){if(e==null||e==="")return t;let n=String(e).trim().toLowerCase();return["1","true","yes","on"].includes(n)?!0:["0","false","no","off"].includes(n)?!1:t}function Mr(e){let t=e.trim().toLowerCase();return t==="global"||t==="fallback"||t==="smart"?t:"only"}function gn(e){return e.trim().toLowerCase()==="signed"?"signed":"legacy"}function yn(e){return e.trim().toLowerCase()==="doh"?"doh":"off"}function D(e,t){return e==null?t:String(e)}function Fr(e){return{uuid:D(e[__sfx("VVVJRA==")],""),[__sfx("dHJvamFuUGFzc3dvcmQ=")]:D(e[__sfx("VFJPSkFOX1BBU1NXT1JE")],""),wsPath:D(e[__sfx("V1NfUEFUSA==")]||e[__sfx("UEFUSA==")],w.wsPath),[__sfx("dHJvamFuUGF0aA==")]:w[__sfx("dHJvamFuUGF0aA==")],[__sfx("eGh0dHBQYXRo")]:w[__sfx("eGh0dHBQYXRo")],add:D(e[__sfx("QURE")],""),addApi:D(e[__sfx("QUREQVBJ")],""),addCsv:D(e[__sfx("QUREX0NTVg==")],""),poolOfficial:N(e[__sfx("T0ZGSUNJQUxfSVA=")],w.poolOfficial),officialCount:q(e[__sfx("T0ZGSUNJQUxfSVBfQ09VTlQ=")],w.officialCount),poolDomain:N(e[__sfx("UFJFRkVSUkVEX0RPTUFJTg==")],w.poolDomain),domainCount:q(e[__sfx("UFJFRkVSUkVEX0RPTUFJTl9DT1VOVA==")],w.domainCount),poolManual:N(e[__sfx("TUFOVUFMX0lQ")],w.poolManual),poolCountries:D(e[__sfx("UE9PTF9DT1VOVFJJRVM=")],w.poolCountries),dls:q(e[__sfx("RExT")],0),maxLatency:q(e[__sfx("TUFYX0xBVEVOQ1k=")],0),maxNodes:0,[__sfx("cHJveHlJcA==")]:D(e[__sfx("UFJPWFlJUA==")],""),[__sfx("c29ja3M1")]:D(e[__sfx("U09DS1M1")],""),httpProxy:D(e[__sfx("SFRUUF9QUk9YWQ==")],""),proxyMode:Mr(D(e[__sfx("UFJPWFlfTU9ERQ==")],"")),nat64:D(e[__sfx("TkFUNjQ=")],""),concurrentDial:N(e[__sfx("VENQX0NPTkNVUlJFTlRfRElBTA==")],!0),dataBudgetMB:q(e[__sfx("REFUQV9CVURHRVRfTUI=")],w.dataBudgetMB),resolvePreferred:N(e[__sfx("UkVTT0xWRV9QUkVGRVJSRUQ=")],w.resolvePreferred),relayPool:D(e[__sfx("UkVMQVlfUE9PTA==")],""),useBuiltinRelay:N(e[__sfx("VVNFX0JVSUxUSU5fUkVMQVk=")],w.useBuiltinRelay),[__sfx("ZW5hYmxlVHJvamFu")]:N(e[__sfx("RU5BQkxFX1RST0pBTg==")]??e[__sfx("VFJPSkFO")],w[__sfx("ZW5hYmxlVHJvamFu")]),[__sfx("ZW5hYmxlWGh0dHA=")]:N(e[__sfx("RU5BQkxFX1hIVFRQ")]??e[__sfx("WEhUVFA=")],w[__sfx("ZW5hYmxlWGh0dHA=")]),subDomain:"",subProtocol:"both",subTransport:"both",subVariants:D(e[__sfx("U1VCX1ZBUklBTlRT")],w.subVariants),subName:D(e[__sfx("U1VCX05BTUU=")],w.subName).trim()||w.subName,subPorts:D(e[__sfx("U1VCX1BPUlRT")],w.subPorts),clientFingerprint:w.clientFingerprint,ech:N(e[__sfx("RUNI")],w.ech),echHost:D(e[__sfx("RUNIX0hPU1Q=")],w.echHost),echDns:D(e[__sfx("RUNIX0ROUw==")],w.echDns),tlsFragment:!1,tlsFragmentSize:w.tlsFragmentSize,tlsFragmentDelay:w.tlsFragmentDelay,subToken:gn(D(e[__sfx("U1VCX1RPS0VOX01PREU=")],"")),subTokenTtlDays:q(e[__sfx("U1VCX1RPS0VOX1RUTF9EQVlT")],w.subTokenTtlDays),unlockProbe:N(e[__sfx("VU5MT0NLX1BST0JF")],w.unlockProbe),udpDns:yn(D(e[__sfx("VURQX0ROUw==")],"")),udpDnsEndpoint:D(e[__sfx("VURQX0ROU19FTkRQT0lOVA==")],w.udpDnsEndpoint)}}function Br(e,t){let n={...e};for(let[o,r]of Object.entries(t))if(r!=null)if(o==="dls"||o==="maxLatency"||o==="maxNodes"||o==="officialCount"||o==="domainCount"||o==="dataBudgetMB"||o==="subTokenTtlDays")n[o]=q(r,0);else if(o==="concurrentDial"||o==="resolvePreferred"||o==="useBuiltinRelay"||o===__sfx("ZW5hYmxlVHJvamFu")||o===__sfx("ZW5hYmxlWGh0dHA=")||o==="tlsFragment"||o==="ech"||o==="poolOfficial"||o==="poolDomain"||o==="poolManual"||o==="unlockProbe")n[o]=N(r,!1);else if(o==="subProtocol"){let s=String(r);n[o]=s===__sfx("dmxlc3M=")||s===__sfx("dHJvamFu")||s==="both"?s:"both"}else if(o==="subTransport"){let s=String(r);n[o]=s==="ws"||s===__sfx("eGh0dHA=")||s==="both"?s:"both"}else o==="subToken"?n[o]=gn(String(r)):o==="udpDns"?n[o]=yn(String(r)):n[o]=String(r);return n}async function bn(e,t){let n=Fr(t),o=await e.get(hn),r={};if(o)try{r=JSON.parse(o)}catch{r={}}let s=Br(n,r),i=!1,a=e instanceof ee;return!s.uuid&&a&&(s.uuid=Me(),i=!0),!s[__sfx("dHJvamFuUGFzc3dvcmQ=")]&&a&&(s[__sfx("dHJvamFuUGFzc3dvcmQ=")]=Me().replace(/-/g,"").slice(0,16),i=!0),s.officialCount<1&&(s.officialCount=w.officialCount,i=!0),s.domainCount<1&&(s.domainCount=w.domainCount,i=!0),i&&await Hr(e,s),s}async function Hr(e,t){await e.put(hn,JSON.stringify(t))}var hn,w,Le=E(()=>{"use strict";z();Ue();hn="CONFIG",w={uuid:"",[__sfx("dHJvamFuUGFzc3dvcmQ=")]:"",wsPath:__sfx("L3ZsZXNz"),[__sfx("dHJvamFuUGF0aA==")]:__sfx("L3Ryb2phbg=="),[__sfx("eGh0dHBQYXRo")]:__sfx("L3hodHRw"),add:"",addApi:"",addCsv:"",poolOfficial:!0,officialCount:20,poolDomain:!0,domainCount:10,poolManual:!0,poolCountries:"",dls:0,maxLatency:0,maxNodes:0,[__sfx("cHJveHlJcA==")]:"",[__sfx("c29ja3M1")]:"",httpProxy:"",proxyMode:"only",nat64:"",concurrentDial:!0,dataBudgetMB:0,resolvePreferred:!0,relayPool:"",useBuiltinRelay:!0,[__sfx("ZW5hYmxlVHJvamFu")]:!0,[__sfx("ZW5hYmxlWGh0dHA=")]:!0,subDomain:"",subProtocol:__sfx("dmxlc3M="),subTransport:"ws",subVariants:__sfx("dmxlc3Mtd3M="),subName:__sfx("Q0ZQaWxvdA=="),subPorts:"443",clientFingerprint:"chrome",ech:!1,echHost:__sfx("Y2xvdWRmbGFyZS1lY2guY29t"),echDns:"",tlsFragment:!1,tlsFragmentSize:"10-20",tlsFragmentDelay:"10-20",subToken:"legacy",subTokenTtlDays:0,unlockProbe:!1,udpDns:"off",udpDnsEndpoint:"https://dns.google/dns-query"}});var wn,Kr,Zo,Wr,_o,xn=E(()=>{"use strict";wn={[__sfx("SEs=")]:["HKG"],[__sfx("VFc=")]:["TPE","KHH"],[__sfx("SlA=")]:["NRT","KIX","CTS","FUK"],[__sfx("S1I=")]:["ICN","PUS"],[__sfx("U0c=")]:["SIN"],[__sfx("TVk=")]:["KUL"],[__sfx("VEg=")]:["BKK"],[__sfx("Vk4=")]:["SGN","HAN"],[__sfx("SUQ=")]:["CGK","DPS"],[__sfx("UEg=")]:["MNL"],[__sfx("SU4=")]:["BOM","MAA","DEL"],[__sfx("QVU=")]:["SYD","MEL","BNE","PER"],[__sfx("Tlo=")]:["AKL"],[__sfx("VVM=")]:["LAX","SJC","SEA","ORD","DFW","IAD","EWR","ATL","MIA","DEN","PHX","BOS"],[__sfx("Q0E=")]:["YYZ","YVR","YYC"],[__sfx("R0I=")]:["LHR","MAN"],[__sfx("REU=")]:["FRA","MUC","BER"],[__sfx("RlI=")]:["CDG","MRS"],[__sfx("Tkw=")]:["AMS"],[__sfx("SVQ=")]:["MXP","FCO"],[__sfx("RVM=")]:["MAD","BCN"],[__sfx("U0U=")]:["ARN"],[__sfx("Q0g=")]:["ZRH"],[__sfx("QVQ=")]:["VIE"],[__sfx("UEw=")]:["WAW"],[__sfx("UlU=")]:["DME","SVO"],[__sfx("VFI=")]:["IST"],[__sfx("QUU=")]:["DXB"],[__sfx("SUw=")]:["TLV"],[__sfx("WkE=")]:["JNB"],[__sfx("QlI=")]:["GRU","GIG"],[__sfx("QVI=")]:["EZE"],[__sfx("Q0w=")]:["SCL"],[__sfx("TVg=")]:["MEX"]},Kr=__sfx("SEtH6aaZ5rivLFRQReWPsOWMlyxOUlTkuJzkuqwsS0lY5aSn6ZiqLElDTummluWwlCxTSU7mlrDliqDlnaEsS1VM5ZCJ6ZqG5Z2hLEJLS+abvOiwtyxTR07og6Hlv5fmmI7luIIsTU5M6ams5bC85ouJLFNZROaCieWwvCxNRUzloqjlsJTmnKwsTEFY5rSb5p2J55+2LFNKQ+Wco+S9leWhnixTRUHopb/pm4Xlm74sT1JE6Iqd5Yqg5ZOlLElBROWNjuebm+mhvyxFV1Lnur3nk6blhYssWVla5aSa5Lym5aSaLFlWUua4qeWTpeWNjixMSFLkvKbmlaYsRlJB5rOV5YWw5YWL56aPLENER+W3tOm7jixBTVPpmL/lp4bmlq/nibnkuLksTUFE6ams5b636YeMLEFSTuaWr+W+t+WTpeWwlOaRqSxJU1TkvIrmlq/lnabluIPlsJQsRFhC6L+q5ouc"),Zo=(()=>{let e={};for(let t of Kr.split(","))t.length>3&&(e[t.slice(0,3)]=t.slice(3));return e})(),Wr=new Map;for(let[e,t]of Object.entries(wn))for(let n of t)Wr.set(n,e);_o=Object.keys(wn)});var An=E(()=>{"use strict"});var ms,En=E(()=>{"use strict";j();z();xn();An();ms=".cn,qq.com,tencent.com,weixin.qq.com,baidu.com,bdstatic.com,bilibili.com,hdslb.com,taobao.com,tmall.com,jd.com,aliyun.com,alicdn.com,alipay.com,163.com,126.net,zhihu.com,weibo.com,sina.com.cn,youku.com,iqiyi.com,douyin.com,xiaohongshu.com,mi.com,huawei.com,csdn.net,gitee.com,cnblogs.com".split(",")});var bs,Pn=E(()=>{"use strict";Ue();z();bs=new TextEncoder});var Ns,Sn=E(()=>{"use strict";Le();z();Ns=3600*24});function Cn(e){return mn(e)}async function Tn(e,t){if(ce.config&&Date.now()-ce.configAt<zr)return ce.config;let n=await bn(e,t);return ce.config=n,ce.configAt=Date.now(),n}var zr,ce,dt=E(()=>{"use strict";Ue();Le();Sn();zr=15e3,ce={config:null,configAt:0,auth:null,authAt:0}});var Dn={};he(Dn,{clearUnlockCache:()=>Zr,runUnlockProbe:()=>Jr});function qr(e,t,n){return e===200?"ok":e===404?t==="status"?"region":"unknown":e===403||e===451?"blocked":t==="trace"&&/\bloc=[A-Z]{2}\b/.test(n)?"ok":"unknown"}async function Qr(e){let t=Date.now(),n=new AbortController,o=setTimeout(()=>n.abort(),Xr);try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:n.signal,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36",Accept:"text/html,application/xhtml+xml,*/*"}}),s="";e.mode==="trace"&&(s=(await r.text()).slice(0,512));let i=/\bloc=([A-Z]{2})\b/.exec(s)?.[1];return{id:e.id,status:r.status,verdict:qr(r.status,e.mode,s),ms:Date.now()-t,...i?{loc:i}:{}}}catch(r){let s=r instanceof Error?r.message:String(r);return{id:e.id,status:0,verdict:"unknown",ms:Date.now()-t,error:/abort/i.test(s)?"timeout":"fetch-failed"}}finally{clearTimeout(o)}}async function Jr(e,t){let n=e||"UNK",o=Date.now(),r=te.get(n);if(r&&o-r.at<Yr)return{...r.data,cached:!0};let s=await Promise.all(Gr.map(a=>Qr(a))),i={colo:n,region:t,cached:!1,at:o,targets:s};if(te.size>=Vr){let a="",c=Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")];for(let[f,l]of te)l.at<c&&(c=l.at,a=f);a&&te.delete(a)}return te.set(n,{at:o,data:i}),i}function Zr(){te.clear()}var Gr,Xr,Yr,Vr,te,vn=E(()=>{"use strict";Gr=[{id:"netflix",url:"https://www.netflix.com/title/81215567",mode:"status"},{id:"youtube",url:"https://www.youtube.com/premium",mode:"status"},{id:"gemini",url:"https://gemini.google.com/",mode:"status"}],Xr=4e3,Yr=600*1e3,Vr=16,te=new Map});z();var Bn=8*1024*1024,Hn=2*1024*1024,xt=600*1e3,Kn=6*1024*1024*1024,Fe=Date.now(),Be=0;function At(e){e-Fe>=xt&&(Fe=e,Be=0)}function Wn(e,t=Date.now()){At(t),Be+=e}function wt(e){return At(e),Kn-Be}var zn=(()=>{let e=new Uint8Array(65536),t=2654435769;for(let n=0;n<e.length;n++)t^=t<<13,t^=t>>>17,t^=t<<5,e[n]=t&255;return e})(),jn=5e3;function Gn(e,t=jn){let n=!1,o=setTimeout(()=>{if(!n){n=!0;try{e(1e3,"Probe idle timeout")}catch{}}},t),r=o;return typeof r?.unref=="function"&&r.unref(),{cancel:()=>{n||(n=!0,clearTimeout(o))}}}async function He(e){let t=new URL(e.url);if(e.headers.get("Upgrade")?.toLowerCase()===__sfx("d2Vic29ja2V0")){let f=new WebSocketPair,[l,u]=Object.values(f);u.accept();let d=Gn((h,g)=>u.close(h,g));return u.addEventListener("message",h=>{let g=typeof h.data=="string"?h.data:"";if(g==="PING"||g==="ping"){d.cancel(),u.send(JSON.stringify({pong:!0,colo:e.cf?.colo??"UNK",clientIp:e.headers.get("CF-Connecting-IP")??""}));try{u.close(1e3,"Probe complete")}catch{}return}d.cancel();try{u.close(1e3,"Probe aborted")}catch{}}),u.addEventListener("close",()=>d.cancel()),u.addEventListener("error",()=>d.cancel()),new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:l})}let o=Number.parseInt(t.searchParams.get("bytes")??"",10),r=Number.isFinite(o)&&o>0?Math.min(o,Bn):Hn,s=Date.now();if(wt(s)<=0){let f=Math.max(1e3,Fe+xt-s);return new Response(JSON.stringify({ok:!1,error:"probe budget exhausted"}),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(f/1e3))}})}let i=zn,a=0,c=new ReadableStream({pull(f){let l=wt(Date.now());if(a>=r||l<=0){f.close();return}let u=Math.min(i.byteLength,r-a,l);f.enqueue(i.subarray(0,u)),a+=u,Wn(u)}});return new Response(c,{status:200,headers:{"Content-Type":"application/octet-stream","Content-Encoding":"identity","Cache-Control":"no-store","Access-Control-Allow-Origin":"*","X-Probe-Bytes":String(r),"X-Probe-Nonce":ye(4)}})}it();lt();et();ut();z();Le();Pe();En();Pn();z();function pt(e){let t=e===200?"Welcome":e===404?"Not Found":"Service Unavailable",n=`<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${t}</title><style>body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f7f8fa;color:#333;font-family:-apple-system,"Segoe UI","PingFang SC",sans-serif}.c{text-align:center}h1{font-size:22px;font-weight:600;margin:0 0 10px}p{color:#888;font-size:14px;margin:0}</style></head><body><div class="c"><h1>${t}</h1><p>This site is up and running.</p></div></body></html>`;return new Response(n,{status:e,headers:{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}})}dt();dt();async function Rn(e){let t=Cn(e);return await Tn(t,e)}function mt(e){let t=[];return t.push(...ae(e[__sfx("cHJveHlJcA==")],"direct")),t.push(...ae(e[__sfx("c29ja3M1")],__sfx("c29ja3M1"))),t.push(...ae(e.httpProxy,"http")),t}var ht=6e4,_r=10,ue=0,ke=0;function In(e){return e>=ke?(ue=0,ke=e+ht,!1):ue>=_r}function Un(e,t,n){if(!n)return!1;let o=(e.headers.get(__sfx("eC1jZnBpbG90LXRva2Vu"))??t.searchParams.get("token")??"").trim();if(!o)return!1;let r=Date.now();return re(o,n)?(ue=0,!0):(r>=ke&&(ke=r+ht,ue=0),ue+=1,!1)}async function Ln(e,t,n){let o=new URL(e.url);if(o.pathname===__sfx("L19fZWRnZV9wcm9iZQ=="))return He(e);if(o.pathname===ve||o.pathname===__sfx("L19fdmVyc2lvbg=="))return Ie();if(o.pathname==="/region"&&e.method==="GET"){let{coloToCountry:i,rankRegions:a}=await Promise.resolve().then(()=>(ie(),_e)),c=e.cf?.colo??"",f=c?i(c):"";return new Response(JSON.stringify({ok:!0,colo:c,region:f,relayPreference:f?a(f):[],timestamp:new Date().toISOString()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8"}})}let r=await Rn(t);if(o.pathname===__sfx("L19fZGlhZw==")){if(In(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(ht/1e3))}});if(!Un(e,o,r.uuid))return null;let{recentDiagnostics:i}=await Promise.resolve().then(()=>(it(),pn)),{[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:a}=await Promise.resolve().then(()=>(lt(),dn));return new Response(JSON.stringify({ok:!0,impl:"self",build:ct,recent:i(),[__sfx("eGh0dHA=")]:a()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}if(o.pathname==="/__unlock_probe"){if(!r.unlockProbe)return null;if(In(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}});if(!Un(e,o,r.uuid))return null;let{coloToCountry:i}=await Promise.resolve().then(()=>(ie(),_e)),{runUnlockProbe:a}=await Promise.resolve().then(()=>(vn(),Dn)),c=e.cf?.colo??"",f=c?i(c):"",l=await a(c,f);return new Response(JSON.stringify({ok:!0,...l},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}let s=e.headers.get("Upgrade")?.toLowerCase();return o.pathname===r.wsPath?s!==__sfx("d2Vic29ja2V0")?null:await Te(e,__sfx("dmxlc3M="),r,mt(r),n):r[__sfx("ZW5hYmxlVHJvamFu")]&&o.pathname===r[__sfx("dHJvamFuUGF0aA==")]?s!==__sfx("d2Vic29ja2V0")?null:await Te(e,__sfx("dHJvamFu"),r,mt(r),n):r[__sfx("ZW5hYmxlWGh0dHA=")]&&o.pathname===r[__sfx("eGh0dHBQYXRo")]?e.method!=="POST"?null:await at(e,r,mt(r)):null}ut();var Ri={async fetch(e,t,n){try{return new URL(e.url).pathname===ve?Ie():await Ln(e,t,n)??pt(200)}catch{return pt(500)}}};export{Ri as default};
|
|
1
|
+
const __sfx=(()=>{const __t=new TextDecoder(),__c=new Map();return b=>{let v=__c.get(b);if(v===void 0){const s=atob(b),u=new Uint8Array(s.length);for(let i=0;i<s.length;i++)u[i]=s.charCodeAt(i);v=__t.decode(u);__c.set(b,v)}return v}})();var qn=Object.defineProperty;var x=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var ge=(e,t)=>{for(var n in t)qn(e,n,{get:t[n],enumerable:!0})};function be(e){let t=new Uint8Array(e);crypto.getRandomValues(t);let n="";for(let o of t)n+=ye[o>>4]+ye[o&15];return n}function Fe(){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[];for(let n of e)t.push(ye[n>>4]+ye[n&15]);return[t.slice(0,4).join(""),t.slice(4,6).join(""),t.slice(6,8).join(""),t.slice(8,10).join(""),t.slice(10,16).join("")].join("-")}function se(e,t){if(e.length!==t.length)return!1;let n=0;for(let o=0;o<e.length;o++)n|=e.charCodeAt(o)^t.charCodeAt(o);return n===0}var ye,K=x(()=>{"use strict";ye="0123456789abcdef"});function N(e){let t=rr.exec(e);if(!t)return!1;for(let n=1;n<=4;n++){let o=Number(t[n]);if(!Number.isInteger(o)||o<0||o>255)return!1}return!0}function Y(e){return!e.includes(":")||!/^[0-9a-fA-F:.]+$/.test(e)?!1:or(e)!==null}function or(e){if(!e.includes(":"))return null;let t=e,n=t.lastIndexOf(":"),o=t.slice(n+1);if(o.includes(".")){if(!N(o))return null;let u=o.split(".").map(d=>Number(d));t=`${t.slice(0,n+1)}${(u[0]<<8|u[1]).toString(16)}:${(u[2]<<8|u[3]).toString(16)}`}let r=t.indexOf("::"),s,i;if(r>=0){if(t.indexOf("::",r+1)>=0)return null;let u=t.slice(0,r),d=t.slice(r+2);s=u?u.split(":"):[],i=d?d.split(":"):[]}else s=t.split(":"),i=[];let a=s.length+i.length;if(a>8)return null;let c=[],f=u=>/^[0-9a-fA-F]{1,4}$/.test(u)?parseInt(u,16):null;for(let u of s){let d=f(u);if(d===null)return null;c.push(d)}let l=8-a;for(let u=0;u<l;u++)c.push(0);for(let u of i){let d=f(u);if(d===null)return null;c.push(d)}return c.length===8?c:null}function sr(e){let t=e.map(c=>(c&65535).toString(16)),n=-1,o=0,r=-1,s=0;for(let c=0;c<t.length;c++)t[c]==="0"?(r<0&&(r=c),s++,s>o&&(o=s,n=r)):(r=-1,s=0);if(o<2)return t.join(":");let i=t.slice(0,n).join(":"),a=t.slice(n+o).join(":");return`${i}::${a}`}function ir(e,t,n,o){if(t<0||t>=e.length)return null;if(n===1)return t+5>e.length?null:{hostname:`${e[t+1]}.${e[t+2]}.${e[t+3]}.${e[t+4]}`,next:t+5};if(o?n===2:n===3){if(t+2>e.length)return null;let r=e[t+1];return t+2+r>e.length?null:{hostname:nr.decode(e.subarray(t+2,t+2+r)),next:t+2+r}}if(o?n===3:n===4){if(t+17>e.length)return null;let r=new DataView(e.buffer,e.byteOffset+t+1,16),s=[];for(let i=0;i<8;i++)s.push(r.getUint16(i*2,!1));return{hostname:sr(s),next:t+17}}return null}async function ze(e,t){let n=await e.peekExactly(1);if(!n)return null;let o=n[0],r;if(o===1)r=5;else if(t?o===2:o===3){let a=await e.peekExactly(2);if(!a)return null;r=2+a[1]}else if(t?o===3:o===4)r=17;else return null;let s=await e.peekExactly(r);if(!s)return null;let i=ir(s,0,o,t);return i?(e.skip(r),{hostname:i.hostname,addressType:o,consumed:r}):null}var nr,rr,z=x(()=>{"use strict";nr=new TextDecoder,rr=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/});function It(e){let t=e.replace(/-/g,"").trim().toLowerCase();if(!/^[0-9a-f]{32}$/.test(t))return null;let n=new Uint8Array(16);for(let o=0;o<16;o++)n[o]=parseInt(t.slice(o*2,o*2+2),16);return n}async function Ut(e,t){let n=await e.readExactly(1);if(!n)return null;let o=await e.readExactly(16);if(!o)return null;let r=It(t);if(!r)return null;for(let d=0;d<16;d++)if(o[d]!==r[d])return null;let s=await e.readExactly(1);if(!s)return null;let i=s[0],a=i>0?await e.readExactly(i):new Uint8Array(0);if(!a)return null;let c=await e.readExactly(1);if(!c)return null;let f=await e.readExactly(2);if(!f)return null;let l=await ze(e,!0);if(!l)return null;let u=f[0]<<8|f[1];return{header:{version:n[0],command:c[0],port:u,hostname:l.hostname,addressType:l.addressType,addons:a},payload:e.release()}}function Lt(e,t){if(e.byteLength<18)return null;let n=It(t);if(!n)return null;for(let f=0;f<16;f++)if(e[1+f]!==n[f])return null;let o=e[17],r=18+o;if(e.byteLength<r+4)return null;let s=e[r];r+=1;let i=e[r]<<8|e[r+1];r+=2;let a=e[r];r+=1;let c="";if(a===1){if(e.byteLength<r+4)return null;c=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(a===2){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;c=ar.decode(e.subarray(r,r+f)),r+=f}else if(a===3){if(e.byteLength<r+16)return null;let f=[];for(let l=0;l<8;l++)f.push((e[r+l*2]<<8|e[r+l*2+1]).toString(16));c=f.join(":"),r+=16}else return null;return{header:{version:e[0],command:s,port:i,hostname:c,addressType:a,addons:e.subarray(18,18+o)},consumed:r}}var vt,kt,ar,je=x(()=>{"use strict";z();vt=1,kt=2,ar=new TextDecoder});function H(e,t){return e>>>t|e<<32-t}function cr(e){let t=new Uint32Array([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),n=e.length*8,o=Math.ceil((e.length+9)/64)*64,r=new Uint8Array(o);r.set(e),r[e.length]=128;let s=new DataView(r.buffer);s.setUint32(o-8,Math.floor(n/4294967296),!1),s.setUint32(o-4,n>>>0,!1);let i=new Uint32Array(64);for(let c=0;c<o;c+=64){for(let p=0;p<16;p++)i[p]=s.getUint32(c+p*4,!1);for(let p=16;p<64;p++){let w=H(i[p-15],7)^H(i[p-15],18)^i[p-15]>>>3,E=H(i[p-2],17)^H(i[p-2],19)^i[p-2]>>>10;i[p]=i[p-16]+w+i[p-7]+E>>>0}let f=t[0],l=t[1],u=t[2],d=t[3],h=t[4],y=t[5],T=t[6],C=t[7];for(let p=0;p<64;p++){let w=H(h,6)^H(h,11)^H(h,25),E=h&y^~h&T,O=C+w+E+lr[p]+i[p]>>>0,D=H(f,2)^H(f,13)^H(f,22),X=f&l^f&u^l&u,U=D+X>>>0;C=T,T=y,y=h,h=d+O>>>0,d=u,u=l,l=f,f=O+U>>>0}t[0]=t[0]+f>>>0,t[1]=t[1]+l>>>0,t[2]=t[2]+u>>>0,t[3]=t[3]+d>>>0,t[4]=t[4]+h>>>0,t[5]=t[5]+y>>>0,t[6]=t[6]+T>>>0,t[7]=t[7]+C>>>0}let a=new Uint8Array(28);for(let c=0;c<7;c++)a[c*4]=t[c]>>>24&255,a[c*4+1]=t[c]>>>16&255,a[c*4+2]=t[c]>>>8&255,a[c*4+3]=t[c]&255;return a}function Nt(e){let t=cr(e),n="";for(let o of t)n+=Ot[o>>4]+Ot[o&15];return n}var lr,Ot,Mt=x(()=>{"use strict";lr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ot="0123456789abcdef"});function fr(e){return Nt(ur.encode(e))}function Ht(e,t){if(e.byteLength<58||!t)return null;let n=fr(t);if(Bt.decode(e.subarray(0,56)).trim().toLowerCase()!==n||e[56]!==13||e[57]!==10)return null;let r=58;if(e.byteLength<r+2)return null;let s=e[r];r+=1;let i=e[r];r+=1;let a="";if(i===1){if(e.byteLength<r+4)return null;a=`${e[r]}.${e[r+1]}.${e[r+2]}.${e[r+3]}`,r+=4}else if(i===3){if(e.byteLength<r+1)return null;let f=e[r];if(r+=1,e.byteLength<r+f)return null;a=Bt.decode(e.subarray(r,r+f)),r+=f}else if(i===4){if(e.byteLength<r+16)return null;let f=[];for(let l=0;l<8;l++)f.push((e[r+l*2]<<8|e[r+l*2+1]).toString(16));a=f.join(":"),r+=16}else return null;if(e.byteLength<r+4)return null;let c=e[r]<<8|e[r+1];return r+=2,e[r]!==13||e[r+1]!==10?null:(r+=2,{header:{command:s,port:c,hostname:a,addressType:i},consumed:r})}var Ft,ur,Bt,Wt=x(()=>{"use strict";z();Mt();Ft=3,ur=new TextEncoder,Bt=new TextDecoder});function pr(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}function Ge(e){if(e.byteLength<12)return new Uint8Array(0);let t=e.slice();return t[2]=128|e[2]&1,t[3]=130,t}var we,Kt=x(()=>{"use strict";we=class{constructor(t){this.options=t}options;pending=new Uint8Array(0);queue=Promise.resolve();dropped=0;push(t){if(t.byteLength!==0){if(this.pending=pr(this.pending,t),this.pending.byteLength>262144){this.pending=new Uint8Array(0);return}this.drain()}}get droppedCount(){return this.dropped}drain(){for(;this.pending.byteLength>=2;){let t=this.pending[0]<<8|this.pending[1];if(t===0||t>65535){this.dropped+=1,this.pending=this.pending.subarray(2);continue}if(this.pending.byteLength<2+t)return;let n=this.pending.slice(2,2+t);this.pending=this.pending.subarray(2+t),this.queue=this.queue.then(()=>this.resolve(n)).catch(()=>{})}}async resolve(t){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeoutMs??5e3);try{let r=await fetch(this.options.endpoint,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:t.slice().buffer,signal:n.signal});if(!r.ok){this.reply(Ge(t));return}let s=new Uint8Array(await r.arrayBuffer());if(s.byteLength===0){this.reply(Ge(t));return}this.reply(s)}catch{this.reply(Ge(t))}finally{clearTimeout(o)}}reply(t){if(t.byteLength===0||t.byteLength>65535)return;let n=new Uint8Array(2+t.byteLength);n[0]=t.byteLength>>8&255,n[1]=t.byteLength&255,n.set(t,2),this.options.send(n)}}});function Xe(e,t){if(e.byteLength===0)return t;if(t.byteLength===0)return e;let n=new Uint8Array(new ArrayBuffer(e.byteLength+t.byteLength));return n.set(e,0),n.set(t,e.byteLength),n}var j,ie=x(()=>{"use strict";j=class{reader;chunks=[];size=0;done=!1;constructor(t){this.reader=t.getReader()}async cancel(t){if(!this.done){this.done=!0,this.chunks=[],this.size=0;try{await this.reader.cancel(t)}catch{}}}async fill(){for(;;){if(this.done)return null;let{done:t,value:n}=await this.reader.read();if(t)return this.done=!0,null;if(n&&n.byteLength>0)return this.chunks.push(n),this.size+=n.byteLength,n.byteLength}}async readExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.take(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.take(t)}take(t){let n=new Uint8Array(t),o=0;for(;o<t;){let r=this.chunks[0],s=t-o;r.byteLength<=s?(n.set(r,o),o+=r.byteLength,this.chunks.shift()):(n.set(r.subarray(0,s),o),this.chunks[0]=r.subarray(s),o+=s)}return this.size-=t,n}async peekExactly(t){if(t===0)return new Uint8Array(0);for(;this.size<t;){if(this.done)return null;let{done:n,value:o}=await this.reader.read();if(n)return this.done=!0,this.size>=t?this.slice(t):null;o&&o.byteLength>0&&(this.chunks.push(o),this.size+=o.byteLength)}return this.slice(t)}skip(t){return this.size<t?null:this.take(t)}slice(t){let n=new Uint8Array(t),o=0;for(let r of this.chunks){if(o>=t)break;let s=Math.min(r.byteLength,t-o);n.set(r.subarray(0,s),o),o+=s}return n}peek(){if(this.chunks.length===0)return new Uint8Array(0);let t=this.chunks.reduce((r,s)=>r+s.byteLength,0),n=new Uint8Array(t),o=0;for(let r of this.chunks)n.set(r,o),o+=r.byteLength;return n}release(){let t=this.peek();this.chunks=[],this.size=0;let n=this.reader,o=this,r=!1;return new ReadableStream({async pull(s){if(!r&&(r=!0,t.byteLength>0)){s.enqueue(t);return}if(o.done){s.close();return}try{let{done:i,value:a}=await n.read();i?(o.done=!0,s.close()):a&&a.byteLength>0&&s.enqueue(a)}catch(i){s.error(i)}},cancel(s){n.cancel(s)}})}}});var xe,zt=x(()=>{"use strict";xe=class{tail=Promise.resolve();run(t){let n=this.tail.then(t);return this.tail=n.catch(()=>{}),n}write(t,n){return this.run(async()=>{let o=t();o&&await o.write(n)})}}});async function G(e,t,n,o){let r=Date.now()+n,s=null;try{let i=await Promise.race([e.readExactly(t),new Promise(a=>{s=setTimeout(()=>a(null),Math.max(1,r-Date.now()))})]);if(i===null)throw new Error(""+o+__sfx("6LaF5pe277yI")+n+__sfx("bXMg5peg5ZON5bqU77yJ"));return i}finally{s&&clearTimeout(s)}}async function jt(e,t,n,o,r={}){let s=new j(e),i=t.getWriter(),a=r.handshakeTimeoutMs??dr,c=async f=>{await i.write(f)};try{let f=[0];r.username&&f.push(2);let l=new Uint8Array(2+f.length);l[0]=5,l[1]=f.length,l.set(f,2),await c(l);let u=await G(s,2,a,__sfx("U09DS1M1IOaPoeaJiw=="));if(!u||u[0]!==5)throw new Error(__sfx("U09DS1M1IOaPoeaJi+Wksei0pe+8mumdnuazleWTjeW6lA=="));let d=u[1];if(d===2){let p=new TextEncoder().encode(r.username??""),w=new TextEncoder().encode(r.password??""),E=new Uint8Array(3+p.length+w.length);E[0]=1,E[1]=p.length,E.set(p,2),E[2+p.length]=w.length,E.set(w,3+p.length),await c(E);let O=await G(s,2,a,__sfx("U09DS1M1IOiupOivgQ=="));if(!O||O[1]!==0)throw new Error(__sfx("U09DS1M1IOeUqOaIt+WQjS/lr4bnoIHorqTor4HlpLHotKU="))}else if(d!==0)throw new Error(__sfx("U09DS1M1IOS4jeaUr+aMgeeahOiupOivgeaWueW8j++8mjB4")+d.toString(16)+"");let h=mr(n,o),y=new Uint8Array(3+h.length);y[0]=5,y[1]=1,y[2]=0,y.set(h,3),await c(y);let T=await G(s,4,a,__sfx("U09DS1M1IENPTk5FQ1Q="));if(!T||T[0]!==5)throw new Error(__sfx("U09DS1M1IENPTk5FQ1Qg5ZON5bqU6Z2e5rOV"));if(T[1]!==0)throw new Error(__sfx("U09DS1M1IENPTk5FQ1Qg5aSx6LSl77yaMHg=")+T[1].toString(16)+"");let C=T[3];if(C===1)await G(s,4,a,__sfx("U09DS1M1IOWTjeW6lA=="));else if(C===3){let p=await G(s,1,a,__sfx("U09DS1M1IOWTjeW6lA=="));if(!p)throw new Error(__sfx("U09DS1M1IOWTjeW6lOaIquaWrQ=="));await G(s,p[0],a,__sfx("U09DS1M1IOWTjeW6lA=="))}else if(C===4)await G(s,16,a,__sfx("U09DS1M1IOWTjeW6lA=="));else throw new Error(__sfx("U09DS1M1IOWTjeW6lOWcsOWdgOexu+Wei+mdnuazlQ=="));return await G(s,2,a,__sfx("U09DS1M1IOWTjeW6lA==")),s.release()}finally{try{i.releaseLock()}catch{}}}function mr(e,t){if(N(e)){let r=e.split(".").map(i=>Number(i)),s=new Uint8Array(7);return s[0]=1,s.set(r,1),s[5]=t>>8&255,s[6]=t&255,s}if(Y(e)){let r=new Uint8Array(19);r[0]=4;let s=e.split(":").filter(Boolean);for(let i=0;i<8;i++){let a=parseInt(s[i]??"0",16)||0;r[1+i*2]=a>>8&255,r[2+i*2]=a&255}return r[17]=t>>8&255,r[18]=t&255,r}let n=new TextEncoder().encode(e),o=new Uint8Array(2+n.length+2);return o[0]=3,o[1]=n.length,o.set(n,2),o[o.length-2]=t>>8&255,o[o.length-1]=t&255,o}var dr,Gt=x(()=>{"use strict";ie();z();dr=6e3});function gr(e){let t=e.byteLength;for(let n=0;n+3<t;n++)if(hr.every((o,r)=>e[n+r]===o))return n;return-1}async function Xt(e,t,n,o,r={}){let s=new j(e),i=t.getWriter(),a=`${n}:${o}`;try{let c=r.username&&r.password?__sfx("UHJveHktQXV0aG9yaXphdGlvbjogQmFzaWMg")+btoa(`${r.username}:${r.password}`)+"\r\n":"",f=[__sfx("Q09OTkVDVCA=")+a+" HTTP/1.1",`Host: ${a}`,__sfx("UHJveHktQ29ubmVjdGlvbjoga2VlcC1hbGl2ZQ=="),__sfx("VXNlci1BZ2VudDogQ0ZQaWxvdC8xLjA="),c,"",""].join(`\r
|
|
2
|
+
`);await i.write(new TextEncoder().encode(f));let l=Date.now()+Ve,u="";for(;;){let T=s.peek(),C=gr(T);if(C>=0){u=new TextDecoder().decode(T.subarray(0,C)),s.skip(C+4);break}if(T.byteLength>8192)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTlpLTotoXov4cgODE5MiDlrZfoioI="));let p=l-Date.now();if(p<=0)throw new Error(__sfx("SFRUUCDku6PnkIbmj6HmiYvotoXml7bvvIg=")+Ve+__sfx("bXMg5peg5ZON5bqU77yJ"));let w=null,E;try{E=await Promise.race([s.fill(),new Promise(O=>{w=setTimeout(()=>O("timeout"),p)})])}finally{w&&clearTimeout(w)}if(E==="timeout")throw new Error(__sfx("SFRUUCDku6PnkIbmj6HmiYvotoXml7bvvIg=")+Ve+__sfx("bXMg5peg5ZON5bqU77yJ"));if(E===null)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTkuI3lrozmlbTvvIjov57mjqXooqvmj5DliY3lhbPpl63vvIk="))}let h=u.split(`\r
|
|
3
|
+
`)[0]??"",y=/^HTTP\/1\.[01]\s+(\d{3})/.exec(h);if(!y)throw new Error(__sfx("SFRUUCDku6PnkIblk43lupTpnZ7ms5U="));if(y[1]!=="200")throw new Error(__sfx("SFRUUCDku6PnkIYgQ09OTkVDVCDlpLHotKXvvJo=")+y[1]+"");return s.release()}finally{try{i.releaseLock()}catch{}}}var hr,Ve,Vt=x(()=>{"use strict";ie();hr=[13,10,13,10];Ve=6e3});function Ye(e){if(e instanceof J||(e instanceof Error?e.message:String(e)).includes(qt))return!0;let n=e instanceof Error?e.cause:void 0;return n!==void 0&&n!==e&&Ye(n)}function Yt(e){let t=e.split(".");if(t.length!==4)return null;let n=0;for(let o of t){if(!/^\d{1,3}$/.test(o))return null;let r=Number(o);if(r>255)return null;n=n*256+r}return n>>>0}function Qt(e){let t=Yt(e);if(t===null)return null;for(let[n,o,r,s]of yr){let i=Yt(n);if(i===null)continue;let a=o===0?0:4294967295<<32-o>>>0;if((t&a)===(i&a))return{kind:r,reason:s}}return null}function br(e){let t=e.split("%")[0]??"";if(!t.includes(":"))return null;if(t.startsWith("::"))return 0;let n=t.split(":")[0]??"";if(n==="")return 0;let o=Number.parseInt(n,16);return Number.isFinite(o)?o:null}function wr(e){let t=(e.split("%")[0]??"").toLowerCase();if(!t.includes(":"))return null;if(/ffff:/i.test(t)){let o=/(\d{1,3}(?:\.\d{1,3}){3})$/.exec(t);if(o){let r=Qt(o[1]);return r||null}}let n=br(t);return n===null?null:t==="::"||n===0?t==="::1"?{kind:"loopback",reason:__sfx("546v5Zue5Zyw5Z2A")}:t==="::"?{kind:"unspecified",reason:__sfx("5pyq5oyH5a6a5Zyw5Z2A")}:null:(n&65024)===64512?{kind:"ula",reason:__sfx("SVB2NiDllK/kuIDmnKzlnLDlnLDlnYA=")}:(n&65472)===65152?{kind:"link-local",reason:__sfx("SVB2NiDpk77ot6/mnKzlnLDlnLDlnYA=")}:(n&65280)===65280?{kind:"multicast",reason:__sfx("SVB2NiDnu4Tmkq3lnLDlnYA=")}:null}function qe(e){let t=e.trim().toLowerCase().replace(/^\[|\]$/g,"");if(t==="")return null;if(t.includes(":"))return wr(t);if(/^\d{1,3}(?:\.\d{1,3}){3}$/.test(t))return Qt(t);if(t==="localhost"||t.endsWith(".localhost"))return{kind:"loopback",reason:__sfx("546v5Zue5Li75py65ZCN")};for(let n of xr)if(t.endsWith(n))return{kind:"internal-name",reason:__sfx("5YaF572R5Z+f5ZCN5ZCO57yA")};return null}var qt,J,yr,xr,Qe=x(()=>{"use strict";qt=__sfx("55uu5qCH5Zyw5Z2A6KKr562W55Wl5oum5oiq"),J=class extends Error{kind;constructor(t,n){super(`${qt}\uFF1A${t}\uFF08${n.reason}\uFF09`),this.name="TargetBlockedError",this.kind=n.kind}};yr=[[__sfx("MC4wLjAuMA=="),8,"unspecified",__sfx("5pyq5oyH5a6a5Zyw5Z2A")],[__sfx("MTAuMC4wLjA="),8,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MTAwLjY0LjAuMA=="),10,"cgnat",__sfx("6L+Q6JCl5ZWG57qnIE5BVCDnvZHmrrU=")],[__sfx("MTI3LjAuMC4w"),8,"loopback",__sfx("546v5Zue5Zyw5Z2A")],[__sfx("MTY5LjI1NC4wLjA="),16,"link-local",__sfx("6ZO+6Lev5pys5ZywIC8g5LqR5YWD5pWw5o2u5Zyw5Z2A")],[__sfx("MTcyLjE2LjAuMA=="),12,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MTkyLjE2OC4wLjA="),16,"private",__sfx("56eB5pyJ572R5q61")],[__sfx("MjI0LjAuMC4w"),4,"multicast",__sfx("57uE5pKt5Zyw5Z2A")],[__sfx("MjQwLjAuMC4w"),4,"reserved",__sfx("5L+d55WZ5Zyw5Z2A")]];xr=[".local",".internal"]});function Pr(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)?!0:e.includes(":")&&/^[0-9a-fA-F:.]+$/.test(e)}function Sr(e,t){let n=e.trim(),o=/^\[([^\]]+)\](?::(\d+))?$/.exec(n);if(o)return{host:o[1],port:Number(o[2]??t)};if(n.includes(":")&&n.split(":").length>2)return{host:n,port:t};let r=n.lastIndexOf(":");if(r<0)return{host:n,port:t};let s=n.slice(0,r),i=Number(n.slice(r+1));return s?{host:s,port:Number.isInteger(i)&&i>0?i:t}:{host:n,port:t}}async function Tr(e,t,n,o=$t){try{let r=`${e}?name=${encodeURIComponent(t)}&type=${n}`,s=await fetch(r,{headers:{accept:"application/dns-json"},signal:AbortSignal.timeout(o)});if(!s.ok)return[];let i=await s.json();if(!i||i.Status!==0||!Array.isArray(i.Answer))return[];let a=n==="TXT"?16:n==="A"?1:28;return i.Answer.filter(c=>c.type===a).map(c=>String(c.data))}catch{return[]}}async function Zt(e,t,n={}){for(let o of Ar){if(n.deadline!==void 0&&Date.now()>=n.deadline)break;let r=n.timeoutMs??$t,s=n.deadline!==void 0?n.deadline-Date.now():Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")],i=Math.max(50,Math.min(r,s)),a=await Tr(o,e,t,i);if(a.length>0)return a}return[]}function Cr(e,t){let n=[],o=String(e).replace(/^"|"$/g,"").replace(/\\010/g,",").replace(/\\n/g,",").trim();if(!o||o===_t)return n;let r=o.split(/[,;\s]+/).filter(Boolean);if(r.length===0)return n;for(let s of r){let i=s.trim();if(!i)continue;let{host:a,port:c}=Sr(i,t);if(!N(a)&&!Y(a))return[];n.push({hostname:a,port:c})}return n}async function Ae(e,t,n={}){let o=e.trim();if(!o)return[];if(Pr(o))return[{hostname:o,port:t}];let r=`${o}:${t}`,s=Jt.get(r);if(s&&Date.now()-s.at<Er)return s.ips;let i=[],[a,c]=await Promise.all([n.skipTxt?Promise.resolve([]):Zt(o,"TXT",n),Zt(o,"A",n)]);if(!n.skipTxt)for(let u of a){let d=Cr(u,t);if(d.length>0){i.push(...d);break}if(String(u).replace(/^"|"$/g,"").replace(/\\010/g,",").trim()===_t)break}if(i.length===0)for(let u of c)N(u)&&i.push({hostname:u,port:t});let f=[],l=new Set;for(let u of i){let d=`${u.hostname}:${u.port}`;l.has(d)||(l.add(d),f.push(u))}return f.length>0&&Jt.set(r,{at:Date.now(),ips:f}),f}var _t,Ar,$t,Er,Jt,Je=x(()=>{"use strict";z();_t=__sfx("QGVkZ2V0dW5uZWw="),Ar=["https://cloudflare-dns.com/dns-query","https://dns.alidns.com/resolve","https://doh.pub/dns-query"],$t=4e3,Er=300*1e3,Jt=new Map});var rt={};ge(rt,{[__sfx("QlVJTFRJTl9SRUxBWV9ET01BSU5T")]:()=>rn,[__sfx("QlVJTFRJTl9SRUxBWV9SRUdJT04=")]:()=>Pe,[__sfx("Q09MT19UT19DT1VOVFJZ")]:()=>on,[__sfx("UkVHSU9OX0FESkFDRU5DWQ==")]:()=>tn,[__sfx("UkVHSU9OX09SREVS")]:()=>_e,[__sfx("UkVMQVlfQkFUQ0hfU0laRQ==")]:()=>Z,[__sfx("UkVMQVlfRE9NQUlOX0xJTUlU")]:()=>nt,[__sfx("VU5LTk9XTl9SRUdJT04=")]:()=>en,clearRelayCache:()=>kr,collectRelayEndpoints:()=>ae,coloToCountry:()=>Ee,rankRegions:()=>tt,regionOfEntry:()=>Ze,resolveRelayEntry:()=>et,selectRelayDomains:()=>an,sortEndpointsByRegion:()=>nn});function Ze(e){let n=e.trim().toLowerCase().replace(/:\d{1,5}$/,"");return Pe[n]??en}function tt(e){let t=(e??"").trim().toUpperCase();if(!t)return[..._e];let n=tn[t]??[],o=_e.filter(r=>r!==t&&!n.includes(r));return[t,...n,...o]}function nn(e,t){let n=tt(t),o=r=>{let s=n.indexOf(r);return s>=0?s:n.length};return e.map((r,s)=>({e:r,i:s})).sort((r,s)=>{let i=o(r.e.regionCode),a=o(s.e.regionCode);return i!==a?i-a:r.i-s.i}).map(r=>r.e)}function Ee(e){let t=String(e??"").toUpperCase();return t?on[t]??(/^[A-Z]{2}$/.test(t)?t:"US"):"US"}async function et(e,t=443,n=sn,o={}){let r=e.trim();if(!r)return[];let s=`${r}:${t}:${n}`,i=$e.get(s);if(i&&Date.now()-i.at<vr)return i.ips;let a=r,c=t,f=(r.match(/:/g)??[]).length;if(f===1){let u=/^(.*):(\d{1,5})$/.exec(r);u&&(a=u[1],c=Number(u[2]))}else if(f>1&&r.startsWith("[")){let u=/^\[([^\]]+)\]:(\d{1,5})$/.exec(r);u&&(a=u[1],c=Number(u[2]))}let l=[];if(N(a)||Y(a))l=[{ip:a,port:Number.isInteger(c)&&c>0?c:t,label:r,regionCode:Ze(r)}];else try{l=(await Ae(a,c,{skipTxt:o.skipTxt,deadline:o.deadline,timeoutMs:o.timeoutMs})).slice(0,n).map(d=>({ip:d.hostname,port:d.port,label:`${a} \u2192 ${d.hostname}`,regionCode:Ze(r)}))}catch{l=[]}return l.length>0&&$e.set(s,{at:Date.now(),ips:l}),l}function an(e,t=nt){let n=Ee(e),o=tt(n),r=s=>{let i=Pe[s];if(!i)return o.length+1;let a=o.indexOf(i);return a>=0?a:o.length};return rn.map((s,i)=>({d:s,i,rank:r(s)})).sort((s,i)=>s.rank!==i.rank?s.rank-i.rank:s.i-i.i).map(s=>s.d).slice(0,Math.max(0,t))}async function ae(e={}){let t=e.perDomain??sn,n=[],o=new Set,r=p=>{for(let w of p){let E=`${w.ip}:${w.port}`;o.has(E)||(o.add(E),n.push(w))}},s=(e.userEntries??"").trim(),i=s?s.split(/[\n,;]+/).map(p=>p.trim()).filter(Boolean):[],a=e.domainLimit??nt,c=e.useBuiltin!==!1?an(e.colo,a):[],f=p=>e.perDomain!==void 0?t:Pe[p]===Ee(e.colo)?Rr:Dr,l=await Promise.all([...i.map(p=>et(p,443,t,{deadline:e.deadline,timeoutMs:e.timeoutMs})),...c.map(p=>et(p,443,f(p),{skipTxt:!0,deadline:e.deadline,timeoutMs:e.timeoutMs}))]),u=n.length;for(let p=0;p<i.length;p++)r(l[p]);let d=n.length-u,h=l.slice(i.length),y=h.reduce((p,w)=>Math.max(p,w.length),0);for(let p=0;p<y;p++)for(let w of h)p<w.length&&r([w[p]]);let T=n.slice(0,d),C=nn(n.slice(d),Ee(e.colo));return[...T,...C]}function kr(){$e.clear()}var en,tn,_e,Pe,rn,on,sn,Z,nt,Rr,Dr,vr,$e,le=x(()=>{"use strict";z();Je();en="??";tn={[__sfx("VVM=")]:["SG","JP","KR"],[__sfx("U0c=")]:["JP","KR","US"],[__sfx("SlA=")]:["SG","KR","US"],[__sfx("S1I=")]:["JP","SG","US"],[__sfx("REU=")]:["NL","GB","SE","FI"],[__sfx("U0U=")]:["DE","NL","FI","GB"],[__sfx("Tkw=")]:["DE","GB","SE","FI"],[__sfx("Rkk=")]:["SE","DE","NL","GB"],[__sfx("R0I=")]:["DE","NL","SE","FI"]},_e=["US","SG","JP","KR","DE","SE","NL","FI","GB"];Pe={[__sfx("cHJveHlpcC5oay5jbWxpdXNzc3MubmV0")]:"HK",[__sfx("cHJveHlpcC51cy5jbWxpdXNzc3MubmV0")]:"US",[__sfx("cHJveHlpcC5zZy5jbWxpdXNzc3MubmV0")]:"SG",[__sfx("cHJveHlpcC5qcC5jbWxpdXNzc3MubmV0")]:"JP",[__sfx("cHJveHlpcC5rci5jbWxpdXNzc3MubmV0")]:"KR",[__sfx("cHJveHlpcC5kZS5jbWxpdXNzc3MubmV0")]:"DE",[__sfx("cHJveHlpcC5zZS5jbWxpdXNzc3MubmV0")]:"SE",[__sfx("cHJveHlpcC5ubC5jbWxpdXNzc3MubmV0")]:"NL",[__sfx("cHJveHlpcC5maS5jbWxpdXNzc3MubmV0")]:"FI",[__sfx("cHJveHlpcC5nYi5jbWxpdXNzc3MubmV0")]:"GB",[__sfx("cHJveHlpcC5vcmFjbGUuY21saXVzc3NzLm5ldA==")]:"Oracle",[__sfx("cHJveHlpcC5kaWdpdGFsb2NlYW4uY21saXVzc3NzLm5ldA==")]:"DigitalOcean",[__sfx("cHJveHlpcC52dWx0ci5jbWxpdXNzc3MubmV0")]:"Vultr",[__sfx("cHJveHlpcC5tdWx0YWNvbS5jbWxpdXNzc3MubmV0")]:"Multacom"},rn=[__sfx("cHJveHlpcC5oay5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5qcC5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5zZy5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC51cy5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5kZS5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5nYi5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5rci5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5ubC5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5zZS5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5maS5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5vcmFjbGUuY21saXVzc3NzLm5ldA=="),__sfx("cHJveHlpcC5kaWdpdGFsb2NlYW4uY21saXVzc3NzLm5ldA=="),__sfx("cHJveHlpcC52dWx0ci5jbWxpdXNzc3MubmV0"),__sfx("cHJveHlpcC5tdWx0YWNvbS5jbWxpdXNzc3MubmV0")],on={[__sfx("SEtH")]:"HK",[__sfx("U1lE")]:"AU",[__sfx("TUVM")]:"AU",[__sfx("Qk5F")]:"AU",[__sfx("UEVS")]:"AU",[__sfx("QURM")]:"AU",[__sfx("Q0JS")]:"AU",[__sfx("U0lO")]:"SG",[__sfx("TlJU")]:"JP",[__sfx("SE5E")]:"JP",[__sfx("S0lY")]:"JP",[__sfx("VFlP")]:"JP",[__sfx("T1NB")]:"JP",[__sfx("TkdP")]:"JP",[__sfx("Q1RT")]:"JP",[__sfx("RlVL")]:"JP",[__sfx("T0tB")]:"JP",[__sfx("SUNO")]:"KR",[__sfx("U0VM")]:"KR",[__sfx("UFVT")]:"KR",[__sfx("RlJB")]:"DE",[__sfx("TVVD")]:"DE",[__sfx("RFVT")]:"DE",[__sfx("QkVS")]:"DE",[__sfx("SEFN")]:"DE",[__sfx("U1RS")]:"DE",[__sfx("VklF")]:"DE",[__sfx("WlJI")]:"DE",[__sfx("Q0RH")]:"FR",[__sfx("TUFE")]:"ES",[__sfx("TVhQ")]:"IT",[__sfx("RkNP")]:"IT",[__sfx("UFJH")]:"CZ",[__sfx("V0FX")]:"PL",[__sfx("QVJO")]:"SE",[__sfx("QU1T")]:"NL",[__sfx("SEVM")]:"FI",[__sfx("TEhS")]:"GB",[__sfx("TEdX")]:"GB",[__sfx("TUFO")]:"GB",[__sfx("RURJ")]:"GB",[__sfx("TEFY")]:"US",[__sfx("U0pD")]:"US",[__sfx("U0ZP")]:"US",[__sfx("U0VB")]:"US",[__sfx("UERY")]:"US",[__sfx("U0FO")]:"US",[__sfx("TEFT")]:"US",[__sfx("UEhY")]:"US",[__sfx("U0xD")]:"US",[__sfx("REVO")]:"US",[__sfx("REZX")]:"US",[__sfx("SUFI")]:"US",[__sfx("QVVT")]:"US",[__sfx("T1JE")]:"US",[__sfx("TVNQ")]:"US",[__sfx("RFRX")]:"US",[__sfx("U1RM")]:"US",[__sfx("TUNJ")]:"US",[__sfx("QVRM")]:"US",[__sfx("TUlB")]:"US",[__sfx("TUNP")]:"US",[__sfx("Qk5B")]:"US",[__sfx("Q0xU")]:"US",[__sfx("SUFE")]:"US",[__sfx("Qk9T")]:"US",[__sfx("RVdS")]:"US",[__sfx("SkZL")]:"US",[__sfx("UEhM")]:"US",[__sfx("WVla")]:"CA",[__sfx("WVZS")]:"CA",[__sfx("WVVM")]:"CA",[__sfx("TUVY")]:"MX",[__sfx("R1JV")]:"BR",[__sfx("VFBF")]:"TW",[__sfx("S0hI")]:"TW",[__sfx("VFNB")]:"TW",[__sfx("Uk1R")]:"TW"};sn=4,Z=6,nt=3,Rr=2,Dr=1,vr=30*1e3,$e=new Map});function ln(e){let t=e.split(".");if(t.length!==4)return null;let n=0;for(let o of t){if(!/^\d{1,3}$/.test(o))return null;let r=Number(o);if(r>255)return null;n=n*256+r}return n>>>0}function _(e){let t=ln(e);if(t===null)return!1;for(let[n,o]of Ir){let r=ln(n);if(r===null)continue;let s=o===0?0:4294967295<<32-o>>>0;if((t&s)===(r&s))return!0}return!1}function cn(e){let t=[],n=new Set,o=l=>{let u=`${l.source}|${l.host}|${l.port}`;n.has(u)||(n.add(u),t.push(l))};for(let l of e.proxies??[])l.kind==="direct"?o({source:"proxy",host:l.host,port:l.port,label:__sfx("UHJveHlJUCA=")+l.host+":"+l.port+"",via:{kind:"direct",host:l.host,port:l.port}}):o({source:"proxy",host:l.host,port:l.port,label:`${l.kind.toUpperCase()} ${l.host}:${l.port}`,via:{kind:l.kind,host:l.host,port:l.port,username:l.username,password:l.password,serverName:l.serverName}});let s=_(e.targetHost)||e.deprioritizeDirect===!0;o({source:"direct",host:e.targetHost,port:e.targetPort,label:__sfx("55u06L+eIA==")+e.targetHost+":"+e.targetPort+"",deprioritized:s});let i=e.optimizedIps??[],a=i.filter(l=>!_(l.ip)),c=i.filter(l=>_(l.ip));for(let l of a)o({source:"optimized",host:l.ip,port:l.port,label:__sfx("5LyY6YCJIA==")+l.ip+":"+l.port+""});for(let l of c)o({source:"optimized",host:l.ip,port:l.port,label:__sfx("5LyY6YCJIA==")+l.ip+":"+l.port+__sfx("77yIQ2xvdWRmbGFyZSDnvZHmrrXvvIzlj6/og73kuI3lj6/ovr7vvIk="),deprioritized:!0});let f=e.relay??[];for(let l of f)o({source:"relay",host:l.ip,port:l.port,label:__sfx("5Y+N5LujIA==")+l.label+"",deprioritized:!e.relayAsPrimary});return t.map((l,u)=>({candidate:l,index:u})).sort((l,u)=>{let d=+!!l.candidate.deprioritized-+!!u.candidate.deprioritized;return d!==0?d:l.index-u.index}).map(l=>l.candidate)}function un(e){let t=e.filter(o=>!o.deprioritized),n=t.filter(o=>o.source==="proxy");return{landing:n.filter(o=>o.via?.kind!=="direct"),[__sfx("cHJveHlJcA==")]:n.filter(o=>o.via?.kind==="direct"),direct:t.filter(o=>o.source!=="proxy"),fallback:e.filter(o=>o.deprioritized)}}function fn(e,t){let n=e instanceof Error?e.message:String(e);return Ye(e)?{kind:"policy",message:n,candidate:t}:/proxy request failed|cannot connect to the specified address|TCP Loop/i.test(n)?{kind:"blocked",message:n,candidate:t}:/timeout|超时|timed out|abort/i.test(n)?{kind:"timeout",message:n,candidate:t}:{kind:"other",message:n,candidate:t}}function pn(e){switch(e.kind){case"blocked":return __sfx("5Ye656uZ6KKrIENsb3VkZmxhcmUg5ouS57ud77yI")+e.candidate+"):"+e.message+__sfx("CiAg5bi46KeB5Y6f5Zug77ya55uu5qCH5Zyw5Z2A5ZyoIENsb3VkZmxhcmUg6Ieq5a62572R5q6177yIV29ya2VyIOS4jeiDveS4u+WKqOi/nuWbniBDRiDoh6rlt7HnmoTlhaXlj6PvvInjgIIKICDihpIg5o2i5LiA5Liq56ys5LiJ5pa5IElQ77yM5oiW5pS555So5Luj55CG6JC95Zyw44CC");case"policy":return __sfx("5Ye656uZ6KKr562W55Wl5ouS57ud77yI")+e.candidate+"):"+e.message+__sfx("CiAg55uu5qCH5bGe5LqO546v5ZueIC8g5YaF572RIC8g6ZO+6Lev5pys5ZywIC8g5L+d55WZ5Zyw5Z2A77yMV29ya2VyIOebtOi/nuaXoOazleWIsOi+vuOAggogIOKGkiDopoHorr/pl67lsYDln5/nvZHorr7lpIfvvIzor7fphY3nva7okL3lnLDku6PnkIbvvIjnlLHku6PnkIbkvqflu7rov57vvInjgII=");case"timeout":return __sfx("5Ye656uZ6LaF5pe277yI")+e.candidate+"):"+e.message+__sfx("CiAg4oaSIOivpeWcsOWdgOW9k+WJjeS4jeWPr+i+vu+8jOWPr+aNouS4gOadoeWAmemAieaIluWQr+eUqOS7o+eQhuiQveWcsOOAgg==");default:return __sfx("5Ye656uZ5aSx6LSl77yI")+e.candidate+"):"+e.message+""}}var Ir,ot=x(()=>{"use strict";Qe();Ir=[[__sfx("MTA0LjE2LjAuMA=="),13],[__sfx("MTA0LjI0LjAuMA=="),14],[__sfx("MTA0LjMxLjAuMA=="),15],[__sfx("MTcyLjY0LjAuMA=="),13],[__sfx("MTYyLjE1OC4wLjA="),15],[__sfx("MTg4LjExNC45Ni4w"),20],[__sfx("MTQxLjEwMS42NC4w"),18],[__sfx("MTA4LjE2Mi4xOTIuMA=="),18],[__sfx("MTAzLjIxLjI0NC4w"),22],[__sfx("MTAzLjIyLjIwMC4w"),22],[__sfx("MTAzLjMxLjQuMA=="),22],[__sfx("MTMxLjAuNzIuMA=="),22],[__sfx("MTk3LjIzNC4yNDAuMA=="),22],[__sfx("MTk4LjQxLjEyOC4w"),17],[__sfx("MTkyLjAuMC4w"),24],[__sfx("MTkyLjAuMi4w"),24],[__sfx("MTkyLjg4Ljk5LjA="),24],[__sfx("MTk5LjI3LjEyOC4w"),21],[__sfx("MjIzLjUuNS4w"),24],[__sfx("MS4wLjAuMA=="),24],[__sfx("MS4xLjEuMA=="),24]]});function dn(e,t="direct"){let n=e.trim();if(!n)return null;let o=t,r=n,s=/^([a-z0-9+.-]+):\/\//i.exec(n);if(s){let h=s[1].toLowerCase();r=n.slice(s[0].length),h===__sfx("c29ja3M1")||h===__sfx("c29ja3M=")||h===__sfx("c29ja3M1aA==")?o=__sfx("c29ja3M1"):h==="https"?o="https":h==="http"&&(o="http")}let i=r.lastIndexOf("@"),a={};if(i>=0){let h=r.slice(0,i);r=r.slice(i+1);let y=h.indexOf(":");y>=0?a={username:h.slice(0,y),password:h.slice(y+1)}:a={username:h}}let c,f=/#sni=([^/#]+)/i.exec(r);f&&(c=f[1].trim(),r=r.slice(0,f.index)+r.slice(f.index+f[0].length));let l=r.lastIndexOf(":");if(l<0)return null;let u=r.slice(0,l).replace(/^\[|\]$/g,""),d=Number(r.slice(l+1));return!u||!Number.isInteger(d)||d<=0||d>65535?null:(!c&&o==="https"&&!Ur(u)&&(c=u),{host:u,port:d,kind:o,...a,...c?{serverName:c}:{}})}function Ur(e){return/^\d{1,3}(\.\d{1,3}){3}$/.test(e)}function ce(e,t="direct"){let n=[];for(let o of e.split(/[\n,;]+/)){let r=o.trim();if(!r)continue;let s=dn(r,t);s&&n.push(s)}return n}var st=x(()=>{"use strict"});async function Lr(){return it||(it=(async()=>(await import("cloudflare:sockets")).connect)()),await it}function Nr(e,t){if(!N(e))return null;let n=e.split(".").map(i=>Number(i)),o=(n[0]<<8|n[1]).toString(16),r=(n[2]<<8|n[3]).toString(16);return`${t.replace(/:+$/,"")}::${o}:${r}`}async function Se(e,t,n,o,r){let i=(await Lr())({hostname:e,port:t},o?{secureTransport:o}:void 0),a=async(f,l)=>{let u,d=new Promise((h,y)=>{u=setTimeout(()=>y(new Error(""+l+__sfx("6LaF5pe277ya")+e+":"+t+"")),n)});try{return await Promise.race([f,d])}finally{u&&clearTimeout(u)}},c;try{if(await a(i.opened,__sfx("6L+e5o6l")),o==="starttls"){if(c=i.startTls?.(r?{expectedServerHostname:r}:void 0),!c)throw new Error(__sfx("5b2T5YmN6L+Q6KGM5pe25LiN5pSv5oyBIHN0YXJ0VGxz"));return await a(c.opened,__sfx("VExTIOaPoeaJiw==")),c}return i}catch(f){try{await(c??i).close()}catch{}throw f}}async function Mr(e){let t=e.timeoutMs??ct;try{let n=await Se(e.hostname,e.port,t);return{readable:n.readable,writable:n.writable,via:"direct",endpoint:`${e.hostname}:${e.port}`,close:()=>{try{n.close()}catch{}}}}catch(n){if(e.nat64&&N(e.hostname)){let o=Nr(e.hostname,e.nat64);if(o){let r=await Se(o,e.port,t);return{readable:r.readable,writable:r.writable,via:"nat64",endpoint:`${o}:${e.port}`,close:()=>{try{r.close()}catch{}}}}}throw n}}async function Br(e,t){let n=e.timeoutMs??ct;if(t.kind==="direct"){let s=await Se(t.host,t.port,n);return{readable:s.readable,writable:s.writable,via:"direct",endpoint:`${t.host}:${t.port}`,close:()=>{try{s.close()}catch{}}}}let o=t.kind==="https"?"starttls":void 0,r=await Se(t.host,t.port,n,o,t.kind==="https"?t.serverName:void 0);try{return t.kind==="http"||t.kind==="https"?{readable:await Xt(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:t.kind,endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}:{readable:await jt(r.readable,r.writable,e.hostname,e.port,{username:t.username,password:t.password}),writable:r.writable,via:__sfx("c29ja3M1"),endpoint:`${t.host}:${t.port}`,close:()=>{try{r.close()}catch{}}}}catch(s){try{await r.close()}catch{}throw s}}function hn(e){return e instanceof Error?e.message:typeof e=="string"?e:String(e)}function Hr(e){if(e.length===0)return __sfx("5pyq55+l5Y6f5Zug");let t=e.map(hn),n=t.slice(-Fr),o=t.length-n.length;return`${o>0?`\uFF08\u5171 ${t.length} \u6761\uFF0C\u7701\u7565\u524D ${o} \u6761\uFF09`:""}${n.join("\uFF1B")}`}function Wr(e){return e.length===0?Promise.reject(new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"))):new Promise((t,n)=>{let o=e.length,r=!1,s=[];for(let i of e)i().then(a=>{if(r){try{a.writable.getWriter().close()}catch{}return}r=!0,t(a)},a=>{s.push(a),o-=1,o===0&&!r&&(r=!0,n(new Error(__sfx("5pys5om5IA==")+e.length+__sfx("IOS4quWAmemAieWFqOmDqOWksei0pe+8mg==")+Hr(s)+"")))})})}async function lt(e,t){if(e.length===0)throw new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"));if(!t||e.length<=1){let s=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let i of e)try{return await i()}catch(a){s=a}throw s}let n=[],o=new Error(__sfx("5ouo5Y+35aSx6LSl"));for(let s=0;s<e.length;s+=at){let i=e.slice(s,s+at);try{return await Wr(i)}catch(a){o=a,n.push(hn(a))}}throw new Error(__sfx("5YWo6YOoIA==")+e.length+__sfx("IOS4quWAmemAieWdh+Wksei0pe+8iOWIhiA=")+n.length+__sfx("IOaJue+8jOavj+aJueacgOWkmiA=")+at+__sfx("IOS4quW5tuWPke+8ie+8mgo=")+n.join(`
|
|
4
|
+
`),{cause:o})}async function mn(e,t){let n=[...e];if(!t)return n;try{let o=await ae(t),r=new Set(n.map(s=>`${s.ip}:${s.port}`));for(let s of o){let i=`${s.ip}:${s.port}`;r.has(i)||(r.add(i),n.push(s))}}catch{}return n}async function Kr(e,t,n){if(e.length===0)return null;for(let o=0;o<e.length;o+=Z){let s=e.slice(o,o+Z).map(i=>t({source:"relay",host:i.ip,port:i.port,label:__sfx("5Y+N5LujIA==")+i.label+""}));try{return await lt(s,n)}catch{}}return null}async function ue(e){let t=e.proxies??[],n=e.concurrent??!0;if(!e.skipTargetPolicy&&t.length===0){let g=qe(e.hostname);if(g)throw new J(e.hostname,g)}let o=e.budgetMs??Or,r=Date.now()+o,s=[...e.optimizedIps??[]],i=!1;if(e.resolvePreferred)try{let g=await Ae(e.hostname,e.port,{deadline:r});if(g.length>0){i=!0;for(let P of g)s.push({ip:P.hostname,port:P.port})}}catch{}let a=_(e.hostname),c=i&&s.length>0&&s.every(g=>_(g.ip)),f=[...e.relay??[]],l=c||a;l&&e.relayPool&&(f=await mn(f,{...e.relayPool,deadline:r}));let u=l?f.slice(0,Z):[],d=l?f.slice(Z):[],h=cn({targetHost:e.hostname,targetPort:e.port,optimizedIps:s,proxies:t,deprioritizeDirect:a||c,relay:u,relayAsPrimary:u.length>0});if(h.length===0)throw new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Ye656uZ5ouo5Y+35pa55byP"));let y=g=>async()=>{let P=r-Date.now();if(P<=0)throw new Error(__sfx("5ouo5Y+36aKE566X5bey55So5bC977yI")+o+"ms):"+e.hostname+":"+e.port+"");let I=Math.max(200,Math.min(e.timeoutMs??ct,P)),oe={...e,timeoutMs:I};try{if(!e.skipTargetPolicy&&g.source!=="proxy"&&g.source!=="relay"){let M=qe(g.host);if(M)throw new J(g.host,M)}return g.source==="proxy"&&g.via?await Br(oe,{host:g.via.host,port:g.via.port,kind:g.via.kind,username:g.via.username,password:g.via.password,serverName:g.via.serverName}):await Mr({...oe,hostname:g.host,port:g.port})}catch(M){let de=fn(M,g.label);throw e.onFailure?.(de),M}},T=un(h),{landing:C,[__sfx("cHJveHlJcA==")]:p,direct:w,fallback:E}=T,O=C.length>0||p.length>0,D=async()=>{if(C.length===0)throw new Error(__sfx("5pyq6YWN572u6JC95Zyw5Luj55CG"));let g;for(let P of C)try{return await y(P)()}catch(I){g=I}throw g??new Error(__sfx("6JC95Zyw5Luj55CG5YWo6YOo5aSx6LSl"))},X=async()=>{if(p.length===0)throw new Error(__sfx("5pyq6YWN572uIFByb3h5SVA="));return await lt(p.map(y),!0)},U=async()=>{let g;if(C.length>0)try{return await D()}catch(P){g=P}if(p.length>0)try{return await X()}catch(P){g=P}throw g??new Error(__sfx("5rKh5pyJ5Y+v55So55qE5Luj55CG"))},Q=async()=>await lt(w.map(y),n),V=async()=>{let g=d;return g.length===0&&e.relayPool&&(g=await mn([],{...e.relayPool,deadline:r})),await Kr(g,y,n)},W=async()=>{for(let g of E)try{return await y(g)()}catch{}return null};if(!O)try{return await Q()}catch(g){let P=await V();if(P)return P;let I=await W();if(I)return I;throw g}let F=e.proxyMode??"only",re=a||c;if(F==="only")try{return await U()}catch(g){let P=await V();if(P)return P;let I=await W();if(I)return I;throw g}if(F==="global"||F==="smart"&&re)try{return await U()}catch(g){if(F==="global")try{return await Q()}catch{}let P=await V();if(P)return P;let I=await W();if(I)return I;throw g}try{return await Q()}catch(g){try{return await U()}catch{}let P=await V();if(P)return P;let I=await W();if(I)return I;throw g}}var it,ct,Or,at,Fr,ut=x(()=>{"use strict";Gt();Vt();Qe();z();Je();le();ot();st();it=null;ct=8e3,Or=15e3;at=6,Fr=8});async function gn(e,t,n,o=!0,r){let s=e.getReader(),i=t.getWriter();try{for(;!n?.exhausted;){let{done:a,value:c}=await s.read();if(a)break;if(!(!c||c.byteLength===0)){if(r?.(c.byteLength))break;await i.write(c)}}}catch{}finally{if(o)try{await i.close()}catch{}else try{i.releaseLock()}catch{}try{s.releaseLock()}catch{}}}var $,Te=x(()=>{"use strict";$=class{constructor(t){this.limitBytes=t}limitBytes;total=0;get enabled(){return this.limitBytes>0}get bytes(){return this.total}add(t){return this.limitBytes<=0||t<=0?!1:(this.total+=t,this.total>this.limitBytes)}}});var Pn={};ge(Pn,{[__sfx("aGFuZGxlV2ViU29ja2V0")]:()=>De,recentDiagnostics:()=>Gr,recordDiagnostics:()=>ee,truncateCloseReason:()=>En});function En(e,t=123){let n=new TextEncoder;if(n.encode(e).length<=t)return e;let o=e.slice(0,t);for(;n.encode(o).length>t;)o=o.slice(0,-1);o=o.replace(/\uFFFD+$/,"");let r="\u2026";for(;o.length>0&&n.encode(o+r).length>t;)o=o.slice(0,-1);return o+r}function ee(e,t,n){Re.unshift({at:Date.now(),target:e,failures:t,summary:n}),Re.length>An&&(Re.length=An)}function Gr(){return Re}function Vr(e){if(!e)return new Uint8Array(0);let t=e.trim();if(!t||t.length>16384)return new Uint8Array(0);try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),o=n.length%4===0?"":"=".repeat(4-n.length%4),r=atob(n+o);if(r.length<17||r.length>8192)return new Uint8Array(0);let s=new Uint8Array(r.length);for(let i=0;i<r.length;i++)s[i]=r.charCodeAt(i);return s}catch{return new Uint8Array(0)}}async function De(e,t,n,o,r,s){let[i,a]=Object.values(new WebSocketPair);try{a.accept({allowHalfOpen:!0})}catch{a.accept()}a.binaryType="arraybuffer";let c=Vr(e.headers.get(__sfx("c2VjLXdlYnNvY2tldC1wcm90b2NvbA=="))),f=!1,l=null,u=null,d=new xe,h=null,y=null,T=!1,C=!1,p=null,w=null,E=m=>{try{a.send(m)}catch{}},O=m=>{let b=new Uint8Array(2+m.byteLength);b[0]=0,b[1]=m.byteLength,b.set(m,2),E(b)},D=(m,b)=>{T=!0;try{a.close(m,En(b))}catch{}X()},X=()=>{if(!C){if(C=!0,g(),h&&(clearTimeout(h),h=null),U&&(clearTimeout(U),U=null),y){let m=y;y=null;try{m.cancel()}catch{}}if(l){let m=l.close;if(m)try{m()}catch{}else try{l.writable.close()}catch{}}}},U=null,Q=new Set,V=0,W=[],F=0,re=m=>{if(!(m.byteLength===0||M>0)){if(F+m.byteLength>xn){D(1009,__sfx("5pyq56Gu6K6k6YCa6Lev55qE5LiK6KGM5pWw5o2u6L+H5aSa"));return}if(Ce+m.byteLength>jr){D(1009,__sfx("5a6e5L6L5YaF5a2Y6aKE566X5bey5ruh77yM6K+36YeN6K+V"));return}W.push(m),F+=m.byteLength,Ce+=m.byteLength}},g=()=>{Ce=Math.max(0,Ce-F),W=[],F=0},P=0,I=()=>{P+=1},oe=async()=>{if(!l)return;let m=++P,b=l.readable.getReader();y=b,U&&clearTimeout(U);let S=setTimeout(()=>{U===S&&(U=null),!(M>0)&&F!==0&&(ee(`${p.hostname}:${p.port}`,[],__sfx("55u06L+eIA==")+bn+__sfx("bXMg5peg5LiL6KGM5pWw5o2u77yM5pS56LWw5Y+N5Luj5YWl5Y+j")),Yn())},bn);U=S;try{for(;;){let{done:L,value:v}=await b.read();if(L)break;if(v&&v.byteLength>0){let k=M===0;if(M+=v.byteLength,k&&g(),de.add(v.byteLength)){At();return}E(v)}}}catch{}finally{try{b.releaseLock()}catch{}clearTimeout(S),U===S&&(U=null),y===b&&(y=null),m===P&&!T&&D(1e3,"done")}},M=0,de=new $((n.dataBudgetMB||0)*1024*1024),At=()=>{let m=__sfx("5Y2V6L+e5o6l5rWB6YeP6LaF6L+HIA==")+n.dataBudgetMB+__sfx("TUIg5LiK6ZmQ");ee(p?`${p.hostname}:${p.port}`:__sfx("5pyq5bu656uL5Ye656uZ"),[],m),D(1009,m)},Et=async m=>{let b=u;if(b)try{await d.write(()=>u===b?b:null,m)}catch{X()}},Gn=async m=>{if(c.byteLength===0)return;let b=c;c=new Uint8Array(0),re(b),await m.write(b)},Pt=m=>{if(t===__sfx("dmxlc3M=")){let S=Lt(m,n.uuid);return S?{command:S.header.command,port:S.header.port,hostname:S.header.hostname,headerLength:S.consumed}:null}let b=Ht(m,n[__sfx("dHJvamFuUGFzc3dvcmQ=")]);return b?{command:b.header.command,port:b.header.port,hostname:b.header.hostname,headerLength:b.consumed}:null},Xn=()=>{h&&(clearTimeout(h),h=null)},Vn=async()=>{if(!(T||f)){if(Pt(c)){await Me();return}D(1008,c.byteLength===0?__sfx("5o+h5omL6LaF5pe277ya5pyq5pS25Yiw5Y2P6K6u5aS0"):__sfx("5o+h5omL6LaF5pe277ya5Y2P6K6u5aS05LiN5a6M5pW05oiW6K6k6K+B5aSx6LSl"))}},Me=async()=>{if(T||f)return;let m=Pt(c);if(!m){c.byteLength>0&&!h&&(h=setTimeout(()=>{h=null,Vn().catch(k=>D(1011,String(k)))},Xr));return}if(Xn(),f)return;f=!0,p=m;let b=t===__sfx("dmxlc3M=")?kt:Ft;if(m.command===b){if(t===__sfx("dmxlc3M=")&&n.udpDns==="doh"&&m.port===53){O(new Uint8Array(0)),w=new we({endpoint:n.udpDnsEndpoint,send:E});let k=c.subarray(m.headerLength);k.byteLength>0&&w.push(k);return}D(1002,n.udpDns==="doh"?__sfx("VURQIOS7heaUr+aMgSBETlPvvIg1MyDnq6/lj6PvvIk="):__sfx("VURQIOacquWQr+eUqO+8iOmdouadv+WPr+W8gOWQryBETlMgb3ZlciBEb0jvvIk="));return}t===__sfx("dmxlc3M=")&&O(new Uint8Array(0));let S=[],L=null;try{l=await ue({hostname:m.hostname,port:m.port,proxies:o,timeoutMs:yn,concurrent:n.concurrentDial,nat64:n.nat64||void 0,proxyMode:n.proxyMode,resolvePreferred:n.resolvePreferred,relayPool:{userEntries:n.relayPool||void 0,useBuiltin:n.useBuiltinRelay,colo:typeof e.cf?.colo=="string"?e.cf.colo:void 0},onFailure:k=>{S.push(k),s?.failures.push(k)}})}catch(k){L=k}if(!l){let k=S.length>0?S.map(me=>pn(me)).join(`
|
|
5
|
+
`):__sfx("5Ye656uZ6L+e5o6l5aSx6LSl77ya")+String(L)+"";ee(`${m.hostname}:${m.port}`,S,k),D(1011,k);return}u=l.writable.getWriter();let v=c.byteLength>m.headerLength?c.subarray(m.headerLength):new Uint8Array(0);v.byteLength>0&&(re(v),await Et(v)),c=new Uint8Array(0),r?.waitUntil(oe())},Yn=async()=>{let m=p;if(!m){D(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55uu5qCH5pyq6Kej5p6Q"));return}if(V>=wn){D(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya55u06L+e5LiO5Y+N5Luj5YWl5Y+j5Z2H5peg5ZON5bqU"));return}V++;let b=[];try{b=await ae({userEntries:n.relayPool||void 0,useBuiltin:n.useBuiltinRelay,colo:typeof e.cf?.colo=="string"?e.cf.colo:void 0})}catch{b=[]}let S=b.filter(L=>!Q.has(`${L.ip}:${L.port}`));if(S.length===0){D(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5peg5Y+N5Luj5YWl5Y+j5Y+v55So"));return}for(let L of S.slice(0,wn)){if(Q.add(`${L.ip}:${L.port}`),I(),l){let v=l;if(v.close)try{v.close()}catch{}}u=null,M=0;try{let v=await ue({hostname:L.ip,port:L.port,timeoutMs:yn,resolvePreferred:!1,skipTargetPolicy:!0});if(!v)continue;l=v;let k=v.writable.getWriter();u=k;let me=0;for(let he of W)me+=he.byteLength;let Be=new Uint8Array(me),Tt=0;for(let he of W)Be.set(he,Tt),Tt+=he.byteLength;await d.run(async()=>{Be.byteLength>0&&await k.write(Be),await Gn(k)}),ee(`${m.hostname}:${m.port}`,[],__sfx("5bey5YiH5o2i5Y+N5Luj5YWl5Y+jIA==")+L.ip+":"+L.port+""),r?.waitUntil(oe());return}catch(v){ee(`${m.hostname}:${m.port}`,[],__sfx("5Y+N5Luj5YWl5Y+jIA==")+L.ip+":"+L.port+__sfx("IOWksei0pe+8mg==")+String(v)+"")}}D(1011,__sfx("5Ye656uZ5peg5pWw5o2u77ya5omA5pyJ5Y+N5Luj5YWl5Y+j5Z2H5aSx6LSl"))};a.addEventListener("message",m=>{(async()=>{let b=m.data,S=typeof b=="string"?new TextEncoder().encode(b):new Uint8Array(b);if(S.byteLength!==0){if(de.add(S.byteLength)){At();return}if(!f){if(c=Xe(c,S),c.byteLength>zr){D(1009,__sfx("5o+h5omL5aS06LaF6L+HIDY0S0I="));return}await Me();return}if(w){w.push(S);return}if(!u){if(c=Xe(c,S),c.byteLength>xn){D(1009,__sfx("5ouo5Y+35pyf6Ze05pWw5o2u6L+H5aSa"));return}return}re(S),await Et(S)}})()});let St=()=>{X()};a.addEventListener("close",St),a.addEventListener("error",St),c.byteLength>0&&Me().catch(m=>D(1011,String(m)));try{return new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:i})}catch(m){return console.error(__sfx("W+iHqueglOaVsOaNrumdol0gMTAxIOWTjeW6lOaehOmAoOWksei0pe+8mg=="),m),new Response(null,{status:200})}}var yn,bn,wn,zr,xn,jr,Ce,Re,An,Xr,ft=x(()=>{"use strict";je();Wt();Kt();ie();zt();ut();Te();ot();le();yn=5e3,bn=2500,wn=2,zr=64*1024,xn=8*1024*1024,jr=32*1024*1024,Ce=0;Re=[],An=20;Xr=2e3});var Sn={};ge(Sn,{[__sfx("aGFuZGxlWGh0dHA=")]:()=>pt,[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:()=>Qr,[__sfx("cmVjb3JkWGh0dHBEaWFnbm9zdGljcw==")]:()=>ke});function qr(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}function ke(e,t,n){ve.unshift({at:Date.now(),target:e,...t,summary:n}),ve.length>20&&(ve.length=20)}function Qr(){return ve}async function pt(e,t,n){let o=e.body;if(!o)return new Response(__sfx("57y65bCR6K+35rGC5L2T"),{status:400});let r=new j(o),s=await qr(Ut(r,t.uuid),Yr);if(!s)return await r.cancel("header timeout"),new Response(__sfx("VkxFU1Mg5aS06Kej5p6Q5aSx6LSl"),{status:400});if(s.header.command!==vt)return await s.payload.cancel("unsupported UDP"),new Response(__sfx("WEhUVFAg5pqC5LiN5pSv5oyBIFVEUA=="),{status:400});let i;try{i=await ue({hostname:s.header.hostname,port:s.header.port,proxies:n,nat64:t.nat64,concurrent:t.concurrentDial,proxyMode:t.proxyMode,resolvePreferred:t.resolvePreferred,relayPool:{userEntries:t.relayPool||void 0,useBuiltin:t.useBuiltinRelay},onFailure:p=>{ke(`${s.header.hostname}:${s.header.port}`,p,__sfx("WEhUVFAg5Ye656uZ5aSx6LSl77yI")+p.candidate+"):"+p.message+"")}})}catch(p){ke(`${s.header.hostname}:${s.header.port}`,{kind:"dial",message:String(p),candidate:"all"},__sfx("WEhUVFAg5Ye656uZ5YWo6YOo5aSx6LSl77ya")+String(p)+"");try{s.payload.cancel("dial failed").catch(()=>{})}catch{}return new Response(__sfx("5Ye656uZ5LiN5Y+v55So"),{status:502})}let a=s.header.addons;if(a.byteLength>255)return new Response(__sfx("QWRkb25zIOmVv+W6pui2heWHuiBWTEVTUyDljY/orq7kuIrpmZA="),{status:400});let c=new Uint8Array(2+a.byteLength);c[0]=s.header.version,c[1]=a.byteLength,c.set(a,2);let f=!1,l=null,u=!1,d=new $((t.dataBudgetMB||0)*1024*1024),h=null,y=()=>{if(u)return;u=!0;let p=__sfx("5Y2V6L+e5o6l5rWB6YeP6LaF6L+HIA==")+t.dataBudgetMB+__sfx("TUIg5LiK6ZmQ");if(ke(`${s.header.hostname}:${s.header.port}`,{kind:"budget",message:p,candidate:"traffic"},p),i.close)try{i.close()}catch{}try{h?.close()}catch{}},T=p=>d.add(p)?(y(),!0):!1;gn(s.payload,i.writable,void 0,!1,T).catch(()=>{});let C=new ReadableStream({start(p){h=p,p.enqueue(c),f=!0},async pull(p){if(!(u||!f)){l||(l=i.readable.getReader());try{let{done:w,value:E}=await l.read();if(u)return;if(w){if(i.close)try{i.close()}catch{}p.close();return}if(E&&E.byteLength>0){if(d.add(E.byteLength)){y();return}p.enqueue(E)}}catch(w){if(u)return;if(i.close)try{i.close()}catch{}try{p.error(w)}catch{}}}},cancel(p){u=!0;try{i.readable.cancel(p)}catch{}if(i.close)try{i.close()}catch{}}});return new Response(C,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-store","X-Accel-Buffering":"no"}})}var Yr,ve,dt=x(()=>{"use strict";ie();je();Te();ut();Yr=2e3;ve=[]});function Ue(){return new Response(JSON.stringify({build:mt,version:Jr,ts:Date.now()}),{status:200,headers:{"Content-Type":"application/json","Cache-Control":"no-store","Access-Control-Allow-Origin":"*"}})}var mt,Jr,Ie,ht=x(()=>{"use strict";mt="419276c-4511180c",Jr=__sfx("MC4xMy42"),Ie=__sfx("L19fY2ZwX3ZlcnNpb24=")});function Tn(e){return e[__sfx("S1Y=")]?new te(e[__sfx("S1Y=")]):new gt}var te,gt,Le=x(()=>{"use strict";te=class{constructor(t){this.kv=t}kv;async get(t){return await this.kv.get(t)}async put(t,n,o){o&&o>=60?await this.kv.put(t,n,{expirationTtl:o}):await this.kv.put(t,n)}async delete(t){await this.kv.delete(t)}async list(t){let n=[],o;do{let r=await this.kv.list({prefix:t,cursor:o});for(let s of r.keys)n.push(s.name);o=r.list_complete?void 0:r.cursor}while(o);return n}},gt=class{data=new Map;async get(t){let n=this.data.get(t);return n?n.expiresAt>0&&n.expiresAt<=Date.now()?(this.data.delete(t),null):n.value:null}async put(t,n,o){let r=o?Date.now()+o*1e3:0;this.data.set(t,{value:n,expiresAt:r})}async delete(t){this.data.delete(t)}async list(t){return[...this.data.keys()].filter(n=>n.startsWith(t))}}});function q(e,t){if(e==null)return t;let n=String(e).trim();if(n==="")return t;let o=Number(n);return Number.isFinite(o)?o:t}function B(e,t){if(e==null||e==="")return t;let n=String(e).trim().toLowerCase();return["1","true","yes","on"].includes(n)?!0:["0","false","no","off"].includes(n)?!1:t}function Zr(e){let t=e.trim().toLowerCase();return t==="global"||t==="fallback"||t==="smart"?t:"only"}function Rn(e){return e.trim().toLowerCase()==="signed"?"signed":"legacy"}function Dn(e){return e.trim().toLowerCase()==="doh"?"doh":"off"}function R(e,t){return e==null?t:String(e)}function _r(e){return{uuid:R(e[__sfx("VVVJRA==")],""),[__sfx("dHJvamFuUGFzc3dvcmQ=")]:R(e[__sfx("VFJPSkFOX1BBU1NXT1JE")],""),wsPath:R(e[__sfx("V1NfUEFUSA==")]||e[__sfx("UEFUSA==")],A.wsPath),[__sfx("dHJvamFuUGF0aA==")]:A[__sfx("dHJvamFuUGF0aA==")],[__sfx("eGh0dHBQYXRo")]:A[__sfx("eGh0dHBQYXRo")],add:R(e[__sfx("QURE")],""),addApi:R(e[__sfx("QUREQVBJ")],""),addCsv:R(e[__sfx("QUREX0NTVg==")],""),poolOfficial:B(e[__sfx("T0ZGSUNJQUxfSVA=")],A.poolOfficial),officialCount:q(e[__sfx("T0ZGSUNJQUxfSVBfQ09VTlQ=")],A.officialCount),poolDomain:B(e[__sfx("UFJFRkVSUkVEX0RPTUFJTg==")],A.poolDomain),domainCount:q(e[__sfx("UFJFRkVSUkVEX0RPTUFJTl9DT1VOVA==")],A.domainCount),poolManual:B(e[__sfx("TUFOVUFMX0lQ")],A.poolManual),poolCountries:R(e[__sfx("UE9PTF9DT1VOVFJJRVM=")],A.poolCountries),dls:q(e[__sfx("RExT")],0),maxLatency:q(e[__sfx("TUFYX0xBVEVOQ1k=")],0),maxNodes:0,[__sfx("cHJveHlJcA==")]:R(e[__sfx("UFJPWFlJUA==")],""),[__sfx("c29ja3M1")]:R(e[__sfx("U09DS1M1")],""),httpProxy:R(e[__sfx("SFRUUF9QUk9YWQ==")],""),proxyMode:Zr(R(e[__sfx("UFJPWFlfTU9ERQ==")],"")),nat64:R(e[__sfx("TkFUNjQ=")],""),concurrentDial:B(e[__sfx("VENQX0NPTkNVUlJFTlRfRElBTA==")],!0),dataBudgetMB:q(e[__sfx("REFUQV9CVURHRVRfTUI=")],A.dataBudgetMB),resolvePreferred:B(e[__sfx("UkVTT0xWRV9QUkVGRVJSRUQ=")],A.resolvePreferred),relayPool:R(e[__sfx("UkVMQVlfUE9PTA==")],""),useBuiltinRelay:B(e[__sfx("VVNFX0JVSUxUSU5fUkVMQVk=")],A.useBuiltinRelay),[__sfx("ZW5hYmxlVHJvamFu")]:B(e[__sfx("RU5BQkxFX1RST0pBTg==")]??e[__sfx("VFJPSkFO")],A[__sfx("ZW5hYmxlVHJvamFu")]),[__sfx("ZW5hYmxlWGh0dHA=")]:B(e[__sfx("RU5BQkxFX1hIVFRQ")]??e[__sfx("WEhUVFA=")],A[__sfx("ZW5hYmxlWGh0dHA=")]),subDomain:"",subProtocol:"both",subTransport:"both",subVariants:R(e[__sfx("U1VCX1ZBUklBTlRT")],A.subVariants),subName:R(e[__sfx("U1VCX05BTUU=")],A.subName).trim()||A.subName,subPorts:R(e[__sfx("U1VCX1BPUlRT")],A.subPorts),clientFingerprint:A.clientFingerprint,ech:B(e[__sfx("RUNI")],A.ech),echHost:R(e[__sfx("RUNIX0hPU1Q=")],A.echHost),echDns:R(e[__sfx("RUNIX0ROUw==")],A.echDns),tlsFragment:!1,tlsFragmentSize:A.tlsFragmentSize,tlsFragmentDelay:A.tlsFragmentDelay,subToken:Rn(R(e[__sfx("U1VCX1RPS0VOX01PREU=")],"")),subTokenTtlDays:q(e[__sfx("U1VCX1RPS0VOX1RUTF9EQVlT")],A.subTokenTtlDays),unlockProbe:B(e[__sfx("VU5MT0NLX1BST0JF")],A.unlockProbe),udpDns:Dn(R(e[__sfx("VURQX0ROUw==")],"")),udpDnsEndpoint:R(e[__sfx("VURQX0ROU19FTkRQT0lOVA==")],A.udpDnsEndpoint)}}function $r(e,t){let n={...e};for(let[o,r]of Object.entries(t))if(r!=null)if(o==="dls"||o==="maxLatency"||o==="maxNodes"||o==="officialCount"||o==="domainCount"||o==="dataBudgetMB"||o==="subTokenTtlDays")n[o]=q(r,0);else if(o==="concurrentDial"||o==="resolvePreferred"||o==="useBuiltinRelay"||o===__sfx("ZW5hYmxlVHJvamFu")||o===__sfx("ZW5hYmxlWGh0dHA=")||o==="tlsFragment"||o==="ech"||o==="poolOfficial"||o==="poolDomain"||o==="poolManual"||o==="unlockProbe")n[o]=B(r,!1);else if(o==="subProtocol"){let s=String(r);n[o]=s===__sfx("dmxlc3M=")||s===__sfx("dHJvamFu")||s==="both"?s:"both"}else if(o==="subTransport"){let s=String(r);n[o]=s==="ws"||s===__sfx("eGh0dHA=")||s==="both"?s:"both"}else o==="subToken"?n[o]=Rn(String(r)):o==="udpDns"?n[o]=Dn(String(r)):n[o]=String(r);return n}async function vn(e,t){let n=_r(t),o=await e.get(Cn),r={};if(o)try{r=JSON.parse(o)}catch{r={}}let s=$r(n,r),i=!1,a=e instanceof te;return!s.uuid&&a&&(s.uuid=Fe(),i=!0),!s[__sfx("dHJvamFuUGFzc3dvcmQ=")]&&a&&(s[__sfx("dHJvamFuUGFzc3dvcmQ=")]=Fe().replace(/-/g,"").slice(0,16),i=!0),s.officialCount<1&&(s.officialCount=A.officialCount,i=!0),s.domainCount<1&&(s.domainCount=A.domainCount,i=!0),i&&await eo(e,s),s}async function eo(e,t){await e.put(Cn,JSON.stringify(t))}var Cn,A,Oe=x(()=>{"use strict";K();Le();Cn="CONFIG",A={uuid:"",[__sfx("dHJvamFuUGFzc3dvcmQ=")]:"",wsPath:__sfx("L3ZsZXNz"),[__sfx("dHJvamFuUGF0aA==")]:__sfx("L3Ryb2phbg=="),[__sfx("eGh0dHBQYXRo")]:__sfx("L3hodHRw"),add:"",addApi:"",addCsv:"",poolOfficial:!0,officialCount:20,poolDomain:!0,domainCount:10,poolManual:!0,poolCountries:"",dls:0,maxLatency:0,maxNodes:0,[__sfx("cHJveHlJcA==")]:"",[__sfx("c29ja3M1")]:"",httpProxy:"",proxyMode:"only",nat64:"",concurrentDial:!0,dataBudgetMB:0,resolvePreferred:!0,relayPool:"",useBuiltinRelay:!0,[__sfx("ZW5hYmxlVHJvamFu")]:!0,[__sfx("ZW5hYmxlWGh0dHA=")]:!0,subDomain:"",subProtocol:__sfx("dmxlc3M="),subTransport:"ws",subVariants:__sfx("dmxlc3Mtd3M="),subName:__sfx("Q0ZQaWxvdA=="),subPorts:"443",clientFingerprint:"chrome",ech:!1,echHost:__sfx("Y2xvdWRmbGFyZS1lY2guY29t"),echDns:"",tlsFragment:!1,tlsFragmentSize:"10-20",tlsFragmentDelay:"10-20",subToken:"legacy",subTokenTtlDays:0,unlockProbe:!1,udpDns:"off",udpDnsEndpoint:"https://dns.google/dns-query"}});var kn,to,ys,no,bs,In=x(()=>{"use strict";kn={[__sfx("SEs=")]:["HKG"],[__sfx("VFc=")]:["TPE","KHH"],[__sfx("SlA=")]:["NRT","KIX","CTS","FUK"],[__sfx("S1I=")]:["ICN","PUS"],[__sfx("U0c=")]:["SIN"],[__sfx("TVk=")]:["KUL"],[__sfx("VEg=")]:["BKK"],[__sfx("Vk4=")]:["SGN","HAN"],[__sfx("SUQ=")]:["CGK","DPS"],[__sfx("UEg=")]:["MNL"],[__sfx("SU4=")]:["BOM","MAA","DEL"],[__sfx("QVU=")]:["SYD","MEL","BNE","PER"],[__sfx("Tlo=")]:["AKL"],[__sfx("VVM=")]:["LAX","SJC","SEA","ORD","DFW","IAD","EWR","ATL","MIA","DEN","PHX","BOS"],[__sfx("Q0E=")]:["YYZ","YVR","YYC"],[__sfx("R0I=")]:["LHR","MAN"],[__sfx("REU=")]:["FRA","MUC","BER"],[__sfx("RlI=")]:["CDG","MRS"],[__sfx("Tkw=")]:["AMS"],[__sfx("SVQ=")]:["MXP","FCO"],[__sfx("RVM=")]:["MAD","BCN"],[__sfx("U0U=")]:["ARN"],[__sfx("Q0g=")]:["ZRH"],[__sfx("QVQ=")]:["VIE"],[__sfx("UEw=")]:["WAW"],[__sfx("UlU=")]:["DME","SVO"],[__sfx("VFI=")]:["IST"],[__sfx("QUU=")]:["DXB"],[__sfx("SUw=")]:["TLV"],[__sfx("WkE=")]:["JNB"],[__sfx("QlI=")]:["GRU","GIG"],[__sfx("QVI=")]:["EZE"],[__sfx("Q0w=")]:["SCL"],[__sfx("TVg=")]:["MEX"]},to=__sfx("SEtH6aaZ5rivLFRQReWPsOWMlyxOUlTkuJzkuqwsS0lY5aSn6ZiqLElDTummluWwlCxTSU7mlrDliqDlnaEsS1VM5ZCJ6ZqG5Z2hLEJLS+abvOiwtyxTR07og6Hlv5fmmI7luIIsTU5M6ams5bC85ouJLFNZROaCieWwvCxNRUzloqjlsJTmnKwsTEFY5rSb5p2J55+2LFNKQ+Wco+S9leWhnixTRUHopb/pm4Xlm74sT1JE6Iqd5Yqg5ZOlLElBROWNjuebm+mhvyxFV1Lnur3nk6blhYssWVla5aSa5Lym5aSaLFlWUua4qeWTpeWNjixMSFLkvKbmlaYsRlJB5rOV5YWw5YWL56aPLENER+W3tOm7jixBTVPpmL/lp4bmlq/nibnkuLksTUFE6ams5b636YeMLEFSTuaWr+W+t+WTpeWwlOaRqSxJU1TkvIrmlq/lnabluIPlsJQsRFhC6L+q5ouc"),ys=(()=>{let e={};for(let t of to.split(","))t.length>3&&(e[t.slice(0,3)]=t.slice(3));return e})(),no=new Map;for(let[e,t]of Object.entries(kn))for(let n of t)no.set(n,e);bs=Object.keys(kn)});var Un=x(()=>{"use strict"});var Os,Ln=x(()=>{"use strict";z();K();In();Un();Os=".cn,qq.com,tencent.com,weixin.qq.com,baidu.com,bdstatic.com,bilibili.com,hdslb.com,taobao.com,tmall.com,jd.com,aliyun.com,alicdn.com,alipay.com,163.com,126.net,zhihu.com,weibo.com,sina.com.cn,youku.com,iqiyi.com,douyin.com,xiaohongshu.com,mi.com,huawei.com,csdn.net,gitee.com,cnblogs.com".split(",")});var Fs,On=x(()=>{"use strict";Le();K();Fs=new TextEncoder});var ti,Nn=x(()=>{"use strict";Oe();K();ti=3600*24});function Mn(e){return Tn(e)}async function Bn(e,t){if(fe.config&&Date.now()-fe.configAt<ro)return fe.config;let n=await vn(e,t);return fe.config=n,fe.configAt=Date.now(),n}var ro,fe,bt=x(()=>{"use strict";Le();Oe();Nn();ro=15e3,fe={config:null,configAt:0,auth:null,authAt:0}});var Hn={};ge(Hn,{clearUnlockCache:()=>po,runUnlockProbe:()=>fo});function co(e,t,n){return e===200?"ok":e===404?t==="status"?"region":"unknown":e===403||e===451?"blocked":t==="trace"&&/\bloc=[A-Z]{2}\b/.test(n)?"ok":"unknown"}async function uo(e){let t=Date.now(),n=new AbortController,o=setTimeout(()=>n.abort(),io);try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:n.signal,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36",Accept:"text/html,application/xhtml+xml,*/*"}}),s="";e.mode==="trace"&&(s=(await r.text()).slice(0,512));let i=/\bloc=([A-Z]{2})\b/.exec(s)?.[1];return{id:e.id,status:r.status,verdict:co(r.status,e.mode,s),ms:Date.now()-t,...i?{loc:i}:{}}}catch(r){let s=r instanceof Error?r.message:String(r);return{id:e.id,status:0,verdict:"unknown",ms:Date.now()-t,error:/abort/i.test(s)?"timeout":"fetch-failed"}}finally{clearTimeout(o)}}async function fo(e,t){let n=e||"UNK",o=Date.now(),r=ne.get(n);if(r&&o-r.at<ao)return{...r.data,cached:!0};let s=await Promise.all(so.map(a=>uo(a))),i={colo:n,region:t,cached:!1,at:o,targets:s};if(ne.size>=lo){let a="",c=Number[__sfx("UE9TSVRJVkVfSU5GSU5JVFk=")];for(let[f,l]of ne)l.at<c&&(c=l.at,a=f);a&&ne.delete(a)}return ne.set(n,{at:o,data:i}),i}function po(){ne.clear()}var so,io,ao,lo,ne,Wn=x(()=>{"use strict";so=[{id:"netflix",url:"https://www.netflix.com/title/81215567",mode:"status"},{id:"youtube",url:"https://www.youtube.com/premium",mode:"status"},{id:"gemini",url:"https://gemini.google.com/",mode:"status"}],io=4e3,ao=600*1e3,lo=16,ne=new Map});K();var Qn=8*1024*1024,Jn=2*1024*1024,Rt=600*1e3,Zn=6*1024*1024*1024,He=Date.now(),We=0;function Dt(e){e-He>=Rt&&(He=e,We=0)}function _n(e,t=Date.now()){Dt(t),We+=e}function Ct(e){return Dt(e),Zn-We}var $n=(()=>{let e=new Uint8Array(65536),t=2654435769;for(let n=0;n<e.length;n++)t^=t<<13,t^=t>>>17,t^=t<<5,e[n]=t&255;return e})(),er=5e3;function tr(e,t=er){let n=!1,o=setTimeout(()=>{if(!n){n=!0;try{e(1e3,"Probe idle timeout")}catch{}}},t),r=o;return typeof r?.unref=="function"&&r.unref(),{cancel:()=>{n||(n=!0,clearTimeout(o))}}}async function Ke(e){let t=new URL(e.url);if(e.headers.get("Upgrade")?.toLowerCase()===__sfx("d2Vic29ja2V0")){let f=new WebSocketPair,[l,u]=Object.values(f);u.accept();let d=tr((h,y)=>u.close(h,y));return u.addEventListener("message",h=>{let y=typeof h.data=="string"?h.data:"";if(y==="PING"||y==="ping"){d.cancel(),u.send(JSON.stringify({pong:!0,colo:e.cf?.colo??"UNK",clientIp:e.headers.get("CF-Connecting-IP")??""}));try{u.close(1e3,"Probe complete")}catch{}return}d.cancel();try{u.close(1e3,"Probe aborted")}catch{}}),u.addEventListener("close",()=>d.cancel()),u.addEventListener("error",()=>d.cancel()),new Response(null,{status:101,[__sfx("d2ViU29ja2V0")]:l})}let o=Number.parseInt(t.searchParams.get("bytes")??"",10),r=Number.isFinite(o)&&o>0?Math.min(o,Qn):Jn,s=Date.now();if(Ct(s)<=0){let f=Math.max(1e3,He+Rt-s);return new Response(JSON.stringify({ok:!1,error:"probe budget exhausted"}),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(f/1e3))}})}let i=$n,a=0,c=new ReadableStream({pull(f){let l=Ct(Date.now());if(a>=r||l<=0){f.close();return}let u=Math.min(i.byteLength,r-a,l);f.enqueue(i.subarray(0,u)),a+=u,_n(u)}});return new Response(c,{status:200,headers:{"Content-Type":"application/octet-stream","Content-Encoding":"identity","Cache-Control":"no-store","Access-Control-Allow-Origin":"*","X-Probe-Bytes":String(r),"X-Probe-Nonce":be(4)}})}ft();dt();st();ht();K();Oe();Te();Ln();On();K();function yt(e){let t=e===200?"Welcome":e===404?"Not Found":"Service Unavailable",n=`<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${t}</title><style>body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f7f8fa;color:#333;font-family:-apple-system,"Segoe UI","PingFang SC",sans-serif}.c{text-align:center}h1{font-size:22px;font-weight:600;margin:0 0 10px}p{color:#888;font-size:14px;margin:0}</style></head><body><div class="c"><h1>${t}</h1><p>This site is up and running.</p></div></body></html>`;return new Response(n,{status:e,headers:{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}})}bt();bt();async function Fn(e){let t=Mn(e);return await Bn(t,e)}function wt(e){let t=[];return t.push(...ce(e[__sfx("cHJveHlJcA==")],"direct")),t.push(...ce(e[__sfx("c29ja3M1")],__sfx("c29ja3M1"))),t.push(...ce(e.httpProxy,"http")),t}var xt=6e4,mo=10,pe=0,Ne=0;function Kn(e){return e>=Ne?(pe=0,Ne=e+xt,!1):pe>=mo}function zn(e,t,n){if(!n)return!1;let o=(e.headers.get(__sfx("eC1jZnBpbG90LXRva2Vu"))??t.searchParams.get("token")??"").trim();if(!o)return!1;let r=Date.now();return se(o,n)?(pe=0,!0):(r>=Ne&&(Ne=r+xt,pe=0),pe+=1,!1)}async function jn(e,t,n){let o=new URL(e.url);if(o.pathname===__sfx("L19fZWRnZV9wcm9iZQ=="))return Ke(e);if(o.pathname===Ie||o.pathname===__sfx("L19fdmVyc2lvbg=="))return Ue();if(o.pathname==="/region"&&e.method==="GET"){let{coloToCountry:i,rankRegions:a}=await Promise.resolve().then(()=>(le(),rt)),c=e.cf?.colo??"",f=c?i(c):"";return new Response(JSON.stringify({ok:!0,colo:c,region:f,relayPreference:f?a(f):[],timestamp:new Date().toISOString()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8"}})}let r=await Fn(t);if(o.pathname===__sfx("L19fZGlhZw==")){if(Kn(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store","Retry-After":String(Math.ceil(xt/1e3))}});if(!zn(e,o,r.uuid))return null;let{recentDiagnostics:i}=await Promise.resolve().then(()=>(ft(),Pn)),{[__sfx("cmVjZW50WGh0dHBEaWFnbm9zdGljcw==")]:a}=await Promise.resolve().then(()=>(dt(),Sn));return new Response(JSON.stringify({ok:!0,impl:"self",build:mt,recent:i(),[__sfx("eGh0dHA=")]:a()},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}if(o.pathname==="/__unlock_probe"){if(!r.unlockProbe)return null;if(Kn(Date.now()))return new Response(JSON.stringify({ok:!1,error:"token attempts throttled"},null,2),{status:429,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}});if(!zn(e,o,r.uuid))return null;let{coloToCountry:i}=await Promise.resolve().then(()=>(le(),rt)),{runUnlockProbe:a}=await Promise.resolve().then(()=>(Wn(),Hn)),c=e.cf?.colo??"",f=c?i(c):"",l=await a(c,f);return new Response(JSON.stringify({ok:!0,...l},null,2),{status:200,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}let s=e.headers.get("Upgrade")?.toLowerCase();return o.pathname===r.wsPath?s!==__sfx("d2Vic29ja2V0")?null:await De(e,__sfx("dmxlc3M="),r,wt(r),n):r[__sfx("ZW5hYmxlVHJvamFu")]&&o.pathname===r[__sfx("dHJvamFuUGF0aA==")]?s!==__sfx("d2Vic29ja2V0")?null:await De(e,__sfx("dHJvamFu"),r,wt(r),n):r[__sfx("ZW5hYmxlWGh0dHA=")]&&o.pathname===r[__sfx("eGh0dHBQYXRo")]?e.method!=="POST"?null:await pt(e,r,wt(r)):null}ht();var Yi={async fetch(e,t,n){try{return new URL(e.url).pathname===Ie?Ue():await jn(e,t,n)??yt(200)}catch{return yt(500)}}};export{Yi as default};
|