ChatGPT Tools

ChatGPT 工具箱 - Token 获取、Plus 支付链接、全自动注册与账号管理

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey, Greasemonkey или Violentmonkey.

Для установки этого скрипта вам необходимо установить расширение, такое как Tampermonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Violentmonkey.

Чтобы установить этот скрипт, вы сначала должны установить расширение браузера, например Tampermonkey или Userscripts.

Чтобы установить этот скрипт, сначала вы должны установить расширение браузера, например Tampermonkey.

Чтобы установить этот скрипт, вы должны установить расширение — менеджер скриптов.

(у меня уже есть менеджер скриптов, дайте мне установить скрипт!)

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение браузера, например Stylus.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

Чтобы установить этот стиль, сначала вы должны установить расширение — менеджер стилей.

(у меня уже есть менеджер стилей, дайте мне установить скрипт!)

// ==UserScript==
// @name         ChatGPT Tools
// @namespace    https://linux.do/u/npc1
// @version      8.3
// @description  ChatGPT 工具箱 - Token 获取、Plus 支付链接、全自动注册与账号管理
// @author       npc1
// @match        https://chatgpt.com/*
// @match        https://*.chatgpt.com/*
// @match        https://auth.openai.com/*
// @match        https://auth0.openai.com/*
// @match        https://pay.openai.com/*
// @icon         https://chatgpt.com/favicon.ico
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_deleteValue
// @grant        GM_xmlhttpRequest
// @grant        GM_setClipboard
// @grant        GM_addStyle
// @connect      dash.xphdfs.me
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function(){
'use strict';
const _0xb=s=>atob(s);const _0x8d=['tm-app-root','npcmail_api_key','registered_accounts','auto_reg_data','auto_reg_step','tm_auto_redirect_team'];const _0xg=i=>_0x8d[i];
const _0x3c=_0xb('aHR0cHM6Ly9kYXNoLnhwaGRmcy5tZQ==');
const _0x4e={API_KEY:_0xg(0x1),ACCOUNTS:_0xg(0x2),AUTO_REG:_0xg(0x3),AUTO_REG_STEP:_0xg(0x4),AUTO_REDIRECT_TEAM:_0xg(0x5)};
const _0x5f={IDLE:'idle',GOTO_SIGNUP:'goto_signup',FILL_EMAIL:'fill_email',FILL_PASSWORD:'fill_password',WAIT_CODE:'wait_code',FILL_CODE:'fill_code',FILL_PROFILE:'fill_profile',COMPLETE:'complete'};
GM_addStyle(`#tm-app-root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;position:fixed;bottom:30px;right:30px;z-index:2147483647;display:flex;flex-direction:column-reverse;align-items:flex-end;gap:16px;pointer-events:none}.tm-app-trigger{width:56px;height:56px;border-radius:20px;background:#10a37f;box-shadow:0 8px 20px rgba(16,163,127,0.4);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all 0.3s cubic-bezier(0.34,1.56,0.64,1);color:white;font-size:24px;pointer-events:auto}.tm-app-trigger:hover{transform:scale(1.05);background:#0d8a6a}.tm-app-trigger:active{transform:scale(0.95)}.tm-app-trigger.is-open{transform:rotate(45deg);background:#333}.tm-app-panel{width:300px;background:rgba(255,255,255,0.95);backdrop-filter:blur(12px);border-radius:24px;box-shadow:0 20px 40px rgba(0,0,0,0.15);overflow:hidden;opacity:0;transform:translateY(20px) scale(0.95);pointer-events:none;transform-origin:bottom right;transition:all 0.3s cubic-bezier(0.2,0.8,0.2,1)}.tm-app-panel.is-visible{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}.tm-panel-header{padding:20px 20px 10px;display:flex;justify-content:space-between;align-items:flex-end}.tm-panel-title{font-size:18px;font-weight:700;color:#1a1a1a}.tm-panel-ver{font-size:12px;font-weight:500;color:#9ca3af;background:#f3f4f6;padding:2px 8px;border-radius:10px}.tm-panel-body{padding:10px;display:flex;flex-direction:column;gap:6px}.tm-action-item{display:flex;align-items:center;gap:12px;padding:12px 16px;border-radius:16px;border:none;background:transparent;cursor:pointer;transition:all 0.2s;text-align:left;width:100%;color:#374151}.tm-action-item:hover{background:#f3f4f6;color:#000}.tm-action-item:active{transform:scale(0.98);background:#e5e7eb}.tm-icon-box{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}.tm-icon-key{background:#d1fae5;color:#059669}.tm-icon-card{background:#dbeafe;color:#2563eb}.tm-icon-reg{background:#fef3c7;color:#d97706}.tm-icon-list{background:#e0e7ff;color:#4f46e5}.tm-icon-settings{background:#f3f4f6;color:#6b7280}.tm-icon-about{background:#ede9fe;color:#7c3aed}.tm-text-box{display:flex;flex-direction:column;gap:2px}.tm-action-title{font-size:14px;font-weight:600}.tm-action-desc{font-size:11px;color:#9ca3af}.tm-divider{height:1px;background:#f3f4f6;margin:4px 16px}.tm-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.4);backdrop-filter:blur(4px);z-index:2147483648;display:flex;justify-content:center;align-items:center;opacity:0;visibility:hidden;transition:0.3s}.tm-modal-overlay.show{opacity:1;visibility:visible}.tm-modal{background:white;width:450px;max-width:90vw;max-height:80vh;border-radius:20px;padding:24px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.25);transform:scale(0.9);transition:0.3s cubic-bezier(0.16,1,0.3,1);overflow-y:auto}.tm-modal-overlay.show .tm-modal{transform:scale(1)}.tm-modal h3{margin:0 0 16px;font-size:18px;color:#111827;display:flex;align-items:center;gap:8px}.tm-code-box{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:12px;font-family:monospace;font-size:12px;color:#334155;word-break:break-all;max-height:100px;overflow-y:auto}.tm-modal-tip{margin-top:12px;font-size:12px;color:#ef4444;background:#fef2f2;padding:8px;border-radius:6px}.tm-modal-actions{margin-top:20px;display:flex;justify-content:flex-end;gap:8px}.tm-btn{border:none;padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;transition:all 0.2s}.tm-btn:hover{filter:brightness(0.95)}.tm-btn-close{background:#f1f5f9;color:#475569}.tm-btn-primary{background:#10a37f;color:white}.tm-btn-danger{background:#ef4444;color:white}.tm-btn-small{padding:4px 10px;font-size:11px}.tm-input{width:100%;padding:12px 14px;border:1px solid #e2e8f0;border-radius:10px;font-size:14px;outline:none;transition:all 0.2s;box-sizing:border-box;color:#1f2937;background-color:#ffffff}.tm-input:focus{border-color:#10a37f;box-shadow:0 0 0 3px rgba(16,163,127,0.1)}.tm-input::placeholder{color:#9ca3af}.tm-label{display:block;margin-bottom:6px;font-size:13px;font-weight:600;color:#374151}.tm-account-list{max-height:300px;overflow-y:auto}.tm-account-item{padding:12px;border:1px solid #e5e7eb;border-radius:12px;margin-bottom:8px;background:#fafafa}.tm-account-item:hover{background:#f3f4f6}.tm-account-email{font-weight:600;color:#111827;font-size:13px;word-break:break-all}.tm-account-password{font-family:monospace;font-size:12px;color:#6b7280;margin-top:4px}.tm-account-actions{margin-top:8px;display:flex;gap:6px;flex-wrap:wrap}.tm-account-status{font-size:11px;color:#9ca3af;margin-top:4px}.tm-empty-state{text-align:center;padding:40px 20px;color:#9ca3af}.tm-status-bar{position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:2147483649;background:linear-gradient(135deg,#10a37f,#0d8a6a);color:white;padding:12px 24px;border-radius:12px;font-size:14px;font-weight:600;box-shadow:0 10px 30px rgba(16,163,127,0.4);display:none;align-items:center;gap:10px}.tm-status-bar.show{display:flex}.tm-status-bar .spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,0.3);border-top-color:white;border-radius:50%;animation:spin 1s linear infinite}.tm-status-bar .tm-stop-btn{background:rgba(255,255,255,0.2);border:none;color:white;padding:4px 12px;border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;margin-left:12px}.tm-status-bar .tm-stop-btn:hover{background:rgba(255,255,255,0.3)}@keyframes spin{to{transform:rotate(360deg)}}.tm-modal-about{text-align:center}.tm-about-header{display:flex;align-items:center;justify-content:center;gap:16px;margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid #e5e7eb}.tm-about-logo{width:64px;height:64px;border-radius:16px;background:linear-gradient(135deg,#10a37f,#0d8a6a);display:flex;align-items:center;justify-content:center;font-size:32px;box-shadow:0 8px 20px rgba(16,163,127,0.3)}.tm-about-title-box{text-align:left}.tm-about-title-box h3{font-size:22px;color:#111827;margin:0 0 4px 0}.tm-about-version{display:inline-block;background:linear-gradient(135deg,#10a37f,#0d8a6a);color:white;padding:4px 12px;border-radius:20px;font-size:12px;font-weight:600}.tm-about-desc{font-size:14px;color:#6b7280;line-height:1.6;margin-bottom:20px;text-align:left}.tm-about-section{margin-bottom:16px;text-align:left}.tm-about-section-title{font-size:14px;font-weight:600;color:#374151;margin-bottom:10px}.tm-about-features{display:grid;grid-template-columns:1fr 1fr;gap:8px}.tm-about-feature{font-size:12px;color:#6b7280;padding:8px 12px;background:#f9fafb;border-radius:8px;transition:all 0.2s}.tm-about-feature:hover{background:#f3f4f6;color:#374151}.tm-about-tips{display:flex;flex-direction:column;gap:6px}.tm-about-tip{font-size:12px;color:#6b7280;padding:8px 12px;background:#fffbeb;border-radius:8px;border-left:3px solid #f59e0b}.tm-about-footer{margin-top:20px;padding-top:16px;border-top:1px solid #e5e7eb}.tm-about-developer{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 16px;background:linear-gradient(135deg,#f0fdf4,#dcfce7);border:1px solid #bbf7d0;border-radius:10px;margin-bottom:12px;text-decoration:none;color:#166534;font-size:13px;font-weight:500;transition:all 0.2s;cursor:pointer}.tm-about-developer:hover{background:linear-gradient(135deg,#dcfce7,#bbf7d0);transform:translateY(-1px);box-shadow:0 4px 12px rgba(22,101,52,0.15)}.tm-developer-icon{font-size:16px}.tm-developer-text{flex:1}.tm-developer-arrow{font-size:14px;opacity:0.6;transition:transform 0.2s}.tm-about-developer:hover .tm-developer-arrow{transform:translateX(3px);opacity:1}.tm-about-copyright{font-size:11px;color:#9ca3af}.tm-modal-success{padding:28px !important}.tm-success-icon{width:80px;height:80px;margin:0 auto;background:linear-gradient(135deg,#d1fae5,#a7f3d0);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:40px;box-shadow:0 8px 24px rgba(16,185,129,0.25);animation:tm-success-bounce 0.6s ease-out}@keyframes tm-success-bounce{0%{transform:scale(0);opacity:0}50%{transform:scale(1.1)}100%{transform:scale(1);opacity:1}}.tm-success-subtitle{font-size:13px;color:#6b7280;margin-bottom:20px}.tm-success-info{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:16px;margin-bottom:16px}.tm-success-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0}.tm-success-row:first-child{border-bottom:1px solid #e2e8f0}.tm-success-label{font-size:12px;color:#9ca3af;font-weight:500}.tm-success-value{font-size:13px;color:#1f2937;font-weight:600;font-family:monospace;word-break:break-all;max-width:200px;text-align:right}.tm-success-redirect{background:linear-gradient(135deg,#ecfdf5,#d1fae5);border-radius:10px;padding:12px 16px;margin-bottom:4px}.tm-success-redirect-text{font-size:13px;color:#059669;font-weight:500;margin-bottom:10px}.tm-success-redirect-text span{display:inline-block;width:20px;height:20px;background:#059669;color:white;border-radius:50%;font-size:12px;line-height:20px;text-align:center;font-weight:700}.tm-success-progress{height:4px;background:rgba(5,150,105,0.2);border-radius:2px;overflow:hidden}.tm-success-progress-bar{height:100%;background:linear-gradient(90deg,#10b981,#059669);border-radius:2px;width:100%}`);
function _0x7b(t){GM_setClipboard(t,'text');return!0;}
const _0x8c=['James','John','Robert','Michael','William','David','Richard','Joseph','Thomas','Charles','Mary','Patricia','Jennifer','Linda','Barbara','Elizabeth','Susan','Jessica','Sarah','Karen','Emma','Olivia','Ava','Sophia','Isabella','Liam','Noah','Oliver','Elijah','Lucas'];
const _0x9d=['Smith','Johnson','Williams','Brown','Jones','Garcia','Miller','Davis','Rodriguez','Martinez','Hernandez','Lopez','Gonzalez','Wilson','Anderson','Thomas','Taylor','Moore','Jackson','Martin','Lee','Thompson','White','Harris','Clark'];
function _0xae(l=0x10){const c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%';let p='';p+='ABCDEFGHIJKLMNOPQRSTUVWXYZ'[Math.floor(Math.random()*0x1a)];p+='abcdefghijklmnopqrstuvwxyz'[Math.floor(Math.random()*0x1a)];p+='0123456789'[Math.floor(Math.random()*0xa)];p+='!@#$%'[Math.floor(Math.random()*0x5)];for(let i=0x4;i<l;i++){p+=c[Math.floor(Math.random()*c.length)];}return p.split('').sort(()=>Math.random()-0.5).join('');}
function _0xbf(){return{firstName:_0x8c[Math.floor(Math.random()*_0x8c.length)],lastName:_0x9d[Math.floor(Math.random()*_0x9d.length)]};}
function _0xc0(){const y=new Date().getFullYear();const yr=y-0x12-Math.floor(Math.random()*0x1e);const m=Math.floor(Math.random()*0xc)+0x1;const d=Math.floor(Math.random()*0x1c)+0x1;return{year:yr,month:m,day:d};}
function _0xd1(e,o={}){const k=GM_getValue(_0x4e.API_KEY,'');if(!k){return Promise.reject(new Error('请先配置 API Key'));}return new Promise((r,j)=>{GM_xmlhttpRequest({method:o.method||'GET',url:_0x3c+e,headers:{'X-API-Key':k,'Content-Type':_0xb('YXBwbGljYXRpb24vanNvbg==')},data:o.body?JSON.stringify(o.body):undefined,onload:function(rs){try{const d=JSON.parse(rs.responseText);if(rs.status>=0xc8&&rs.status<0x12c){r(d);}else{j(new Error(d.error||d.message||'HTTP '+rs.status));}}catch(x){j(new Error('JSON 解析失败'));}},onerror:function(x){j(new Error('网络请求失败'));}});});}
async function _0xe2(){return await _0xd1(_0xb('L2FwaS9wdWJsaWMvYXBpLWtleS9pbmZv'));}
async function _0xf3(d=null,p=null){const b={count:0x1,expiryDays:0x7};d&&(b.domain=d);p&&(b.prefix=p);const r=await _0xd1(_0xb('L2FwaS9wdWJsaWMvYmF0Y2gtY3JlYXRlLWVtYWlscw=='),{method:'POST',body:b});if(r.emails&&r.emails.length>0x0)return r.emails[0x0];throw new Error('创建邮箱失败');}
async function _0x115(a){const r=await _0xd1(_0xb('L2FwaS9wdWJsaWMvZXh0cmFjdC1jb2Rlcw=='),{method:'POST',body:{addresses:[a]}});if(r&&r.length>0x0&&r[0x0].code)return r[0x0].code;return null;}
function _0x126(){return GM_getValue(_0x4e.ACCOUNTS,[]);}
function _0x137(a){const ac=_0x126();const i=ac.findIndex(x=>x.email===a.email);i>=0x0?ac[i]={...ac[i],...a}:ac.unshift(a);GM_setValue(_0x4e.ACCOUNTS,ac);}
function _0x148(e){GM_setValue(_0x4e.ACCOUNTS,_0x126().filter(a=>a.email!==e));}
function _0x159(){return GM_getValue(_0x4e.AUTO_REG,null);}
function _0x16a(d){GM_setValue(_0x4e.AUTO_REG,d);}
function _0x17b(){return GM_getValue(_0x4e.AUTO_REG_STEP,_0x5f.IDLE);}
function _0x18c(s){GM_setValue(_0x4e.AUTO_REG_STEP,s);console.log('[AutoReg] Step:',s);}
function _0x19d(){GM_deleteValue(_0x4e.AUTO_REG);GM_deleteValue(_0x4e.AUTO_REG_STEP);}
function _0x1ae(m){return new Promise(r=>setTimeout(r,m));}
function _0x1bf(s,t=0x2710){return new Promise((r,j)=>{const e=document.querySelector(s);if(e){r(e);return;}const o=new MutationObserver(()=>{const el=document.querySelector(s);if(el){o.disconnect();r(el);}});o.observe(document.body,{childList:!0,subtree:!0});setTimeout(()=>{o.disconnect();j(new Error('元素未找到: '+s));},t);});}
function _0x1c0(i,v){i.focus();const n=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value').set;n.call(i,v);i.dispatchEvent(new Event('input',{bubbles:!0,composed:!0}));i.dispatchEvent(new Event('change',{bubbles:!0,composed:!0}));for(const c of v){i.dispatchEvent(new KeyboardEvent('keydown',{key:c,bubbles:!0}));i.dispatchEvent(new KeyboardEvent('keypress',{key:c,bubbles:!0}));i.dispatchEvent(new KeyboardEvent('keyup',{key:c,bubbles:!0}));}i.dispatchEvent(new Event('blur',{bubbles:!0}));i.focus();}
async function _0x1d1(e,v){console.log('[AutoReg] Setting spinbutton:',v);e.focus();e.click();await _0x1ae(0xc8);if(!e.textContent.match(/\d/)){e.dispatchEvent(new KeyboardEvent('keydown',{key:'ArrowDown',bubbles:!0}));await _0x1ae(0x64);}let m=0x64;while(m-->0x0){let t=e.textContent||e.getAttribute('aria-valuenow')||'';let c=parseInt(t.replace(/\D/g,''));if(isNaN(c)){e.dispatchEvent(new KeyboardEvent('keydown',{key:'ArrowDown',bubbles:!0}));await _0x1ae(0x64);continue;}let d=v-c;if(d===0x0)break;const k=d>0x0?'ArrowUp':'ArrowDown';e.dispatchEvent(new KeyboardEvent('keydown',{key:k,bubbles:!0}));await _0x1ae(0x50);}e.setAttribute('aria-valuenow',v);e.dispatchEvent(new Event('change',{bubbles:!0}));e.dispatchEvent(new Event('blur',{bubbles:!0}));await _0x1ae(0x64);}
function _0x1e2(e){e.click();e.dispatchEvent(new MouseEvent('click',{bubbles:!0,cancelable:!0}));}
function _0x1f3(s,ts){const es=document.querySelectorAll(s);for(const e of es){const t=e.textContent.toLowerCase();for(const x of ts){if(t.includes(x.toLowerCase()))return e;}}return null;}
function _0x437(){if(document.getElementById('tm-status-bar'))return;const b=document.createElement('div');b.id='tm-status-bar';b.className='tm-status-bar';b.innerHTML='<div class="spinner"></div><span id="tm-status-text">自动注册中...</span><button class="tm-stop-btn" id="tm-stop-reg">✕ 终止</button>';document.body.appendChild(b);document.getElementById('tm-stop-reg').onclick=_0x98c;}
function _0x98c(){_0x19d();_0xa9d();alert('已终止自动注册');}
function _0xbae(t){const b=document.getElementById('tm-status-bar');const e=document.getElementById('tm-status-text');if(b&&e){e.innerText=t;b.classList.add('show');}}
function _0xa9d(){const b=document.getElementById('tm-status-bar');if(b)b.classList.remove('show');}
function _0x204(){if(document.getElementById(_0xg(0x0)))return;_0x215();_0x326();_0x437();_0x548();}
function _0x215(){const r=document.createElement('div');r.id=_0xg(0x0);const p=document.createElement('div');p.className='tm-app-panel';p.innerHTML='<div class="tm-panel-header"><div class="tm-panel-title">ChatGPT Tools</div><div class="tm-panel-ver">v8.3</div></div><div class="tm-divider"></div><div class="tm-panel-body"><button class="tm-action-item" id="tm-act-token"><div class="tm-icon-box tm-icon-key">🔑</div><div class="tm-text-box"><div class="tm-action-title">复制 Access Token</div><div class="tm-action-desc">一键获取当前会话凭证</div></div></button><button class="tm-action-item" id="tm-act-pay"><div class="tm-icon-box tm-icon-card">💳</div><div class="tm-text-box"><div class="tm-action-title">生成 Plus 支付链接</div><div class="tm-action-desc">个人版 Hosted 链接 (防风控)</div></div></button><button class="tm-action-item" id="tm-act-team-short"><div class="tm-icon-box" style="background:linear-gradient(135deg,#f59e0b,#d97706)">🔗</div><div class="tm-text-box"><div class="tm-action-title">Team 短链接</div><div class="tm-action-desc">生成链接并复制</div></div></button><div class="tm-divider"></div><button class="tm-action-item" id="tm-act-register"><div class="tm-icon-box tm-icon-reg">🚀</div><div class="tm-text-box"><div class="tm-action-title">全自动注册</div><div class="tm-action-desc">一键完成注册全流程</div></div></button><button class="tm-action-item" id="tm-act-accounts"><div class="tm-icon-box tm-icon-list">📋</div><div class="tm-text-box"><div class="tm-action-title">账号列表</div><div class="tm-action-desc">管理已注册的账号</div></div></button><div class="tm-divider"></div><button class="tm-action-item" id="tm-act-settings"><div class="tm-icon-box tm-icon-settings">⚙️</div><div class="tm-text-box"><div class="tm-action-title">设置</div><div class="tm-action-desc">配置 API Key</div></div></button><button class="tm-action-item" id="tm-act-about"><div class="tm-icon-box tm-icon-about">ℹ️</div><div class="tm-text-box"><div class="tm-action-title">关于</div><div class="tm-action-desc">版本信息与帮助</div></div></button></div>';const g=document.createElement('button');g.className='tm-app-trigger';g.innerHTML='<svg width="24" height="24" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/></svg>';g.onclick=(e)=>{e.stopPropagation();p.classList.toggle('is-visible');g.classList.toggle('is-open');};document.addEventListener('click',(e)=>{if(!r.contains(e.target)&&p.classList.contains('is-visible')){p.classList.remove('is-visible');g.classList.remove('is-open');}});r.appendChild(p);r.appendChild(g);document.body.appendChild(r);p.addEventListener('click',async(e)=>{e.stopPropagation();const b=e.target.closest('.tm-action-item');if(!b)return;const i=b.id;switch(i){case'tm-act-token':_0xcbf();break;case'tm-act-pay':_0xdd0();break;case'tm-act-team-short':_0xee1();break;case'tm-act-register':_0x659();break;case'tm-act-accounts':_0xff2();break;case'tm-act-settings':_0x76a();break;case'tm-act-about':_0x103();}});}
function _0x326(){if(!document.getElementById('tm-modal-pay')){const m=document.createElement('div');m.id='tm-modal-pay';m.className='tm-modal-overlay';m.innerHTML='<div class="tm-modal"><h3><span style="color:#10a37f">✅</span> 生成成功</h3><div style="font-size:13px;color:#666;margin-bottom:8px">Plus 支付长链接已复制:</div><div class="tm-code-box" id="tm-modal-pay-code"></div><div class="tm-modal-tip">⚠️ 警告:请在【无痕模式】+【全局节点】下打开</div><div class="tm-modal-actions"><button class="tm-btn tm-btn-close" id="tm-modal-pay-close">关闭</button><button class="tm-btn tm-btn-primary" id="tm-modal-pay-copy">再次复制</button></div></div>';document.body.appendChild(m);document.getElementById('tm-modal-pay-close').onclick=()=>document.getElementById('tm-modal-pay').classList.remove('show');document.getElementById('tm-modal-pay-copy').onclick=function(){_0x7b(document.getElementById('tm-modal-pay-code').innerText);this.innerText='已复制!';setTimeout(()=>this.innerText='再次复制',0x7d0);};}if(!document.getElementById('tm-modal-settings')){const m=document.createElement('div');m.id='tm-modal-settings';m.className='tm-modal-overlay';m.innerHTML='<div class="tm-modal" style="max-width:420px"><h3>⚙️ 设置</h3><div style="margin-bottom:16px"><label class="tm-label">NPCmail API Key</label><input type="text" class="tm-input" id="tm-settings-apikey" placeholder="输入您的 API Key"><div style="font-size:11px;color:#9ca3af;margin-top:6px">API: '+_0x3c+'</div></div><div style="border-top:1px solid #e5e7eb;margin:16px 0;padding-top:16px"><label class="tm-label">📧 自定义邮箱配置 (可选)</label><div style="margin-bottom:8px"><input type="text" class="tm-input" id="tm-settings-reg-prefix" placeholder="邮箱前缀 (留空随机)"></div><div><select class="tm-input" id="tm-settings-reg-domain"><option value="">随机域名</option><option value="LOADING" disabled>加载中...</option></select></div></div><div style="border-top:1px solid #e5e7eb;margin:16px 0;padding-top:16px"><label class="tm-label">🔗 注册完成后操作</label><label style="display:flex;align-items:center;gap:8px;cursor:pointer;margin-top:8px"><input type="checkbox" id="tm-settings-auto-redirect" style="width:18px;height:18px"><span style="font-size:13px;color:#1f2937">自动跳转 Team 短链接</span></label><div style="font-size:11px;color:#9ca3af;margin-top:6px;margin-left:26px">开启后,注册完成将自动生成 Team 短链接并跳转</div></div><div id="tm-settings-status" style="display:none;padding:10px;border-radius:8px;font-size:13px;margin-bottom:16px"></div><div class="tm-modal-actions"><button class="tm-btn tm-btn-close" id="tm-settings-close">关闭</button><button class="tm-btn" style="background:#dbeafe;color:#2563eb" id="tm-settings-test">测试连接</button><button class="tm-btn tm-btn-primary" id="tm-settings-save">保存</button></div></div>';document.body.appendChild(m);document.getElementById('tm-settings-close').onclick=()=>document.getElementById('tm-modal-settings').classList.remove('show');document.getElementById('tm-settings-test').onclick=async function(){const st=document.getElementById('tm-settings-status');const k=document.getElementById('tm-settings-apikey').value.trim();if(!k){st.style.display='block';st.style.background='#fef2f2';st.style.color='#ef4444';st.innerText='❌ 请输入 API Key';return;}GM_setValue(_0x4e.API_KEY,k);this.innerText='测试中...';try{const i=await _0xe2();st.style.display='block';st.style.background='#d1fae5';st.style.color='#059669';st.innerText='✅ 连接成功!剩余: '+i.remaining_calls;}catch(e){st.style.display='block';st.style.background='#fef2f2';st.style.color='#ef4444';st.innerText='❌ '+e.message;}this.innerText='测试连接';};document.getElementById('tm-settings-save').onclick=function(){GM_setValue(_0x4e.API_KEY,document.getElementById('tm-settings-apikey').value.trim());GM_setValue(_0x4e.AUTO_REDIRECT_TEAM,document.getElementById('tm-settings-auto-redirect').checked);GM_setValue('tm_reg_prefix',document.getElementById('tm-settings-reg-prefix').value.trim());GM_setValue('tm_reg_domain',document.getElementById('tm-settings-reg-domain').value);document.getElementById('tm-modal-settings').classList.remove('show');};}if(!document.getElementById('tm-modal-accounts')){const m=document.createElement('div');m.id='tm-modal-accounts';m.className='tm-modal-overlay';m.innerHTML='<div class="tm-modal"><h3>📋 账号列表</h3><div id="tm-accounts-list" class="tm-account-list"></div><div class="tm-modal-actions"><button class="tm-btn tm-btn-close" id="tm-accounts-close">关闭</button></div></div>';document.body.appendChild(m);document.getElementById('tm-accounts-close').onclick=()=>document.getElementById('tm-modal-accounts').classList.remove('show');}if(!document.getElementById('tm-modal-about')){const m=document.createElement('div');m.id='tm-modal-about';m.className='tm-modal-overlay';m.innerHTML='<div class="tm-modal tm-modal-about" style="max-width:400px"><div class="tm-about-header"><div class="tm-about-logo">🛠️</div><div class="tm-about-title-box"><h3 style="margin:0">ChatGPT Tools</h3><div class="tm-about-version">v8.3</div></div></div><div class="tm-about-desc">一个功能强大的 ChatGPT 工具脚本,提供 Token 获取、Plus 支付链接生成、全自动注册与账号管理等功能。</div><div class="tm-about-section"><div class="tm-about-section-title">✨ 功能特性</div><div class="tm-about-features"><div class="tm-about-feature">🔑 复制 Access Token</div><div class="tm-about-feature">💳 生成 Plus 支付链接</div><div class="tm-about-feature">🔗 Team 短链接生成</div><div class="tm-about-feature">🚀 全自动注册</div><div class="tm-about-feature">📋 账号列表管理</div><div class="tm-about-feature">⚙️ 自定义邮箱配置</div></div></div><div class="tm-about-section"><div class="tm-about-section-title">📝 使用说明</div><div class="tm-about-tips"><div class="tm-about-tip">1. 首次使用请在设置中配置 NPCmail API Key</div><div class="tm-about-tip">2. 支付链接请在无痕模式 + 全局节点下使用</div><div class="tm-about-tip">3. 本脚本仅在 ChatGPT 相关域名下运行</div></div></div><div class="tm-about-footer"><a href="https://linux.do/u/npc1/summary" target="_blank" class="tm-about-developer"><span class="tm-developer-icon">👨‍💻</span><span class="tm-developer-text">开发者: npc1</span><span class="tm-developer-arrow">→</span></a><div class="tm-about-copyright">仅供学习研究使用</div></div><div class="tm-modal-actions"><button class="tm-btn tm-btn-close" id="tm-about-close">关闭</button></div></div>';document.body.appendChild(m);document.getElementById('tm-about-close').onclick=()=>document.getElementById('tm-modal-about').classList.remove('show');}if(!document.getElementById('tm-modal-success')){const m=document.createElement('div');m.id='tm-modal-success';m.className='tm-modal-overlay';m.innerHTML='<div class="tm-modal tm-modal-success" style="max-width:380px;text-align:center"><div class="tm-success-icon">🎉</div><h3 style="margin:16px 0 8px;font-size:22px;color:#059669">注册成功!</h3><div class="tm-success-subtitle">账号信息已保存到列表</div><div class="tm-success-info"><div class="tm-success-row"><span class="tm-success-label">邮箱</span><span class="tm-success-value" id="tm-success-email"></span></div><div class="tm-success-row"><span class="tm-success-label">密码</span><span class="tm-success-value" id="tm-success-password"></span></div></div><div class="tm-success-redirect"><div class="tm-success-redirect-text"><span id="tm-success-countdown">3</span> 秒后自动跳转 Team 支付页面...</div><div class="tm-success-progress"><div class="tm-success-progress-bar" id="tm-success-progress-bar"></div></div></div><div class="tm-modal-actions" style="margin-top:16px"><button class="tm-btn" style="background:#fee2e2;color:#dc2626" id="tm-success-cancel">取消跳转</button><button class="tm-btn tm-btn-primary" id="tm-success-copy">📋 复制账号</button></div></div>';document.body.appendChild(m);}}
function _0x214(e,pw,oc,cn){document.getElementById('tm-success-email').innerText=e;document.getElementById('tm-success-password').innerText=pw;const rs=document.querySelector('.tm-success-redirect');const cb=document.getElementById('tm-success-cancel');const ce=document.getElementById('tm-success-countdown');const pb=document.getElementById('tm-success-progress-bar');const wr=typeof oc==='function';if(wr){rs.style.display='block';cb.style.display='inline-block';cb.innerText='取消跳转';}else{rs.style.display='none';cb.style.display='inline-block';cb.innerText='关闭';}document.getElementById('tm-modal-success').classList.add('show');let cd=0x3;let cl=!1;let tm=null;if(wr){ce.innerText=cd;pb.style.width='100%';pb.style.transition='none';setTimeout(()=>{pb.style.transition='width 3s linear';pb.style.width='0%';},0x32);tm=setInterval(()=>{if(cl){clearInterval(tm);return;}cd--;ce.innerText=cd;if(cd<=0x0){clearInterval(tm);document.getElementById('tm-modal-success').classList.remove('show');oc();}},0x3e8);}cb.onclick=function(){cl=!0;if(tm)clearInterval(tm);document.getElementById('tm-modal-success').classList.remove('show');if(cn)cn();};document.getElementById('tm-success-copy').onclick=function(){_0x7b('邮箱: '+e+'\n密码: '+pw);this.innerText='✅ 已复制';setTimeout(()=>this.innerText='📋 复制账号',0x5dc);};}
async function _0x325(){const r=await fetch(_0xb('L2FwaS9hdXRoL3Nlc3Npb24='));if(r.status===0x193)throw new Error('403 Forbidden');const d=await r.json();if(!d.accessToken)throw new Error('未登录');return d.accessToken;}
async function _0xcbf(){const b=document.getElementById('tm-act-token');const t=b.querySelector('.tm-action-title');const o=t.innerText;try{t.innerText='获取中...';_0x7b(await _0x325());t.innerText='✅ 已复制';}catch(e){t.innerText='❌ '+e.message;}setTimeout(()=>t.innerText=o,0x7d0);}
async function _0xdd0(){const b=document.getElementById('tm-act-pay');const t=b.querySelector('.tm-action-title');const o=t.innerText;try{t.innerText='请求中...';const tk=await _0x325();const r=await fetch(_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS9iYWNrZW5kLWFwaS9wYXltZW50cy9jaGVja291dA=='),{method:'POST',headers:{'Authorization':'Bearer '+tk,'Content-Type':_0xb('YXBwbGljYXRpb24vanNvbg==')},body:JSON.stringify({plan_type:'plus',checkout_ui_mode:'hosted',cancel_url:_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS8='),success_url:_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS8=')})});const d=await r.json();if(d.url){_0x7b(d.url);document.getElementById('tm-modal-pay-code').innerText=d.url;document.getElementById('tm-modal-pay').classList.add('show');t.innerText='✅ 成功';}else throw new Error(d.detail||'API 错误');}catch(e){alert('错误: '+e);t.innerText='❌ 出错';}setTimeout(()=>t.innerText=o,0x7d0);}
async function _0xee1(){const b=document.getElementById('tm-act-team-short');const t=b.querySelector('.tm-action-title');const o=t.innerText;try{t.innerText='请求中...';const sr=await fetch(_0xb('L2FwaS9hdXRoL3Nlc3Npb24='));const ct=sr.headers.get('content-type');if(!ct||!ct.includes(_0xb('YXBwbGljYXRpb24vanNvbg=='))){alert('请先登录 ChatGPT!');t.innerText=o;return;}const tk=await sr.json();if(!tk.accessToken){alert('请先登录 ChatGPT!');t.innerText=o;return;}const p={plan_name:'chatgptteamplan',team_plan_data:{workspace_name:'MyTeam',price_interval:'month',seat_quantity:0x5},promo_campaign:{promo_campaign_id:'team-1-month-free',is_coupon_from_query_param:!0},checkout_ui_mode:'custom'};const r=await fetch(_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS9iYWNrZW5kLWFwaS9wYXltZW50cy9jaGVja291dA=='),{method:'POST',headers:{Authorization:'Bearer '+tk.accessToken,'Content-Type':_0xb('YXBwbGljYXRpb24vanNvbg==')},body:JSON.stringify(p)});const d=await r.json();if(d.checkout_session_id){const su=_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS9jaGVja291dC9vcGVuYWlfbGxjLw==')+d.checkout_session_id;_0x7b(su);document.getElementById('tm-modal-pay-code').innerText=su;document.getElementById('tm-modal-pay').classList.add('show');t.innerText='✅ 成功';}else{alert('提取失败:'+(d.detail||JSON.stringify(d)));t.innerText='❌ 出错';}}catch(e){alert('发生错误:'+e);t.innerText='❌ 出错';}setTimeout(()=>t.innerText=o,0x7d0);}
async function _0x436(e,pw){try{const sr=await fetch(_0xb('L2FwaS9hdXRoL3Nlc3Npb24='));const ct=sr.headers.get('content-type');if(!ct||!ct.includes(_0xb('YXBwbGljYXRpb24vanNvbg=='))){_0xa9d();alert('获取会话失败,请手动操作');return;}const tk=await sr.json();if(!tk.accessToken){_0xa9d();alert('获取 Token 失败,请手动操作');return;}_0xbae('正在生成 Team 短链接...');const p={plan_name:'chatgptteamplan',team_plan_data:{workspace_name:'MyTeam',price_interval:'month',seat_quantity:0x5},promo_campaign:{promo_campaign_id:'team-1-month-free',is_coupon_from_query_param:!0},checkout_ui_mode:'custom'};const r=await fetch(_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS9iYWNrZW5kLWFwaS9wYXltZW50cy9jaGVja291dA=='),{method:'POST',headers:{Authorization:'Bearer '+tk.accessToken,'Content-Type':_0xb('YXBwbGljYXRpb24vanNvbg==')},body:JSON.stringify(p)});const d=await r.json();if(d.checkout_session_id){const su=_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS9jaGVja291dC9vcGVuYWlfbGxjLw==')+d.checkout_session_id;_0xa9d();_0x214(e,pw,()=>{window.location.href=su;},()=>{console.log('[AutoReg] 用户取消跳转');});}else{_0xa9d();alert('生成 Team 短链接失败:'+(d.detail||JSON.stringify(d)));}}catch(ex){_0xa9d();alert('生成 Team 短链接出错:'+ex);}}
async function _0x547(){const dd=['git-hub.email','hccc.edu.kg','xphdfs.me','kiroxubei.tech','xpzsd.codes','zhurunqi.love','geminikey.app','geminikey.email','880070.xyz','880333.xyz','ghukr.cn','292998.xyz'];let ad=[];try{const d=await _0xd1(_0xb('L2FwaS9wdWJsaWMvZG9tYWlucw=='));if(Array.isArray(d))ad=d;else if(d&&d.domains)ad=d.domains;}catch(e){console.warn('获取域名失败:',e);}return[...new Set([...ad,...dd])];}
async function _0x76a(){document.getElementById('tm-settings-apikey').value=GM_getValue(_0x4e.API_KEY,'');document.getElementById('tm-settings-auto-redirect').checked=GM_getValue(_0x4e.AUTO_REDIRECT_TEAM,!1);document.getElementById('tm-settings-reg-prefix').value=GM_getValue('tm_reg_prefix','');const sd=GM_getValue('tm_reg_domain','');const ds=document.getElementById('tm-settings-reg-domain');if(ds.options.length<=0x2){const dm=await _0x547();const lo=ds.querySelector('option[value="LOADING"]');if(lo)lo.remove();dm.forEach(d=>{const dn=typeof d==='string'?d:d.domain;if(!ds.querySelector('option[value="'+dn+'"]')){const o=document.createElement('option');o.value=dn;o.innerText=dn;ds.appendChild(o);}});}ds.value=sd||'';document.getElementById('tm-settings-status').style.display='none';document.getElementById('tm-modal-settings').classList.add('show');}
function _0x103(){document.getElementById('tm-modal-about').classList.add('show');}
function _0xff2(){const ac=_0x126();const ls=document.getElementById('tm-accounts-list');if(ac.length===0x0){ls.innerHTML='<div class="tm-empty-state">📭 暂无账号</div>';}else{ls.innerHTML=ac.map((a,i)=>'<div class="tm-account-item"><div class="tm-account-email">'+a.email+'</div><div class="tm-account-password">密码: '+a.password+'</div><div class="tm-account-status">'+(a.status||'已创建')+' · '+new Date(a.createdAt).toLocaleString()+'</div><div class="tm-account-actions"><button class="tm-btn tm-btn-primary tm-btn-small" data-action="copy" data-index="'+i+'">📋 复制</button><button class="tm-btn tm-btn-small" style="background:#dbeafe;color:#2563eb" data-action="code" data-email="'+a.email+'">📨 验证码</button><button class="tm-btn tm-btn-danger tm-btn-small" data-action="del" data-email="'+a.email+'">🗑️</button></div></div>').join('');}document.getElementById('tm-modal-accounts').classList.add('show');}
document.addEventListener('click',async function(e){const b=e.target.closest('[data-action]');if(!b)return;const a=b.dataset.action;if(a==='copy'){const i=parseInt(b.dataset.index);const ac=_0x126()[i];if(ac){_0x7b('邮箱: '+ac.email+'\n密码: '+ac.password);alert('已复制!');}}else if(a==='code'){const em=b.dataset.email;try{b.innerText='加载中...';const c=await _0x115(em);if(c){_0x7b(c);alert('验证码: '+c+'\n已复制');}else alert('未找到验证码');}catch(ex){alert('错误: '+ex.message);}b.innerText='📨 验证码';}else if(a==='del'){const em=b.dataset.email;if(confirm('确定删除?')){_0x148(em);_0xff2();}}});
async function _0x659(){const k=GM_getValue(_0x4e.API_KEY,'');if(!k){alert('请先在设置中配置 NPCmail API Key');_0x76a();return;}const p=GM_getValue('tm_reg_prefix','');const d=GM_getValue('tm_reg_domain','');await _0x87b({prefix:p,domain:d});}
async function _0x87b(c={}){try{_0xbae('正在创建邮箱...');const ed=await _0xf3(c.domain||null,c.prefix||null);const rd={email:ed.address,password:_0xae(),..._0xbf(),birthday:_0xc0(),createdAt:new Date().toISOString(),status:'注册中'};_0x16a(rd);_0x18c(_0x5f.GOTO_SIGNUP);_0x137(rd);_0xbae('正在跳转注册页面...');await _0x1ae(0x1f4);window.location.href=_0xb('aHR0cHM6Ly9jaGF0Z3B0LmNvbS9hdXRoL2xvZ2lu');}catch(e){_0xa9d();alert('创建邮箱失败: '+e.message);_0x19d();}}
async function _0x98d(d){_0xbae('正在填写密码...');const pi=await _0x1bf('input[type="password"], input[name="password"]',0x3a98);_0x1c0(pi,d.password);await _0x1ae(0x3e8);let cb=document.querySelector('button[type="submit"]')||_0x1f3('button',['Continue','继续','Next']);if(cb){_0x1e2(cb);_0x18c(_0x5f.WAIT_CODE);_0xbae('等待验证码...');await _0x1ae(0x7d0);await _0xa9e(d);}}
async function _0xa9e(d){_0xbae('等待验证码邮件...');let c=null;for(let i=0x0;i<0x3c;i++){_0xbae('等待验证码... ('+(i+0x1)+'/60)');c=await _0x115(d.email);if(c)break;await _0x1ae(0xbb8);}if(c){_0x16a({...d,verificationCode:c});_0x18c(_0x5f.FILL_CODE);await _0xbaf(c,d);}else{throw new Error('验证码获取超时');}}
async function _0xbaf(c,d){_0xbae('正在填写验证码...');await _0x1ae(0x3e8);const ci=document.querySelectorAll('input[type="text"][maxlength="1"], input[autocomplete="one-time-code"]');if(ci.length>=0x6){for(let i=0x0;i<Math.min(c.length,ci.length);i++){_0x1c0(ci[i],c[i]);await _0x1ae(0x64);}}else{const si=document.querySelector('input[name="code"], input[id*="code"], input[autocomplete="one-time-code"]');if(si)_0x1c0(si,c);}await _0x1ae(0x3e8);let cb=document.querySelector('button[type="submit"]')||_0x1f3('button',['Continue','继续','Verify']);if(cb){_0x1e2(cb);_0x18c(_0x5f.FILL_PROFILE);_0xbae('等待个人信息页面加载...');let s=0x0;let ni=null;const ns='input[name="firstName"], input[name="first_name"], input[id="firstName"], input[id="first-name"]';while(!ni&&s<0x3c){s++;_0xbae('等待姓名输入框出现... ('+s+'s)');await _0x1ae(0x3e8);ni=document.querySelector(ns);if(!ni){ni=document.querySelector('input[name="name"], input[name="fullName"]');}}if(ni){_0xbae('检测到姓名输入框,等待页面稳定...');await _0x1ae(0x5dc);await _0xcc0(d);}else{_0xbae('等待超时,请手动填写...');}}}
async function _0xcc0(d){_0xbae('正在填写个人信息...');await _0x1ae(0x3e8);const ai=document.querySelectorAll('input[type="text"], input:not([type])');const fi=document.querySelector('input[name="firstName"], input[name="first_name"], input[id*="firstName"], input[id*="first-name"]');const li=document.querySelector('input[name="lastName"], input[name="last_name"], input[id*="lastName"], input[id*="last-name"]');if(fi&&li){_0x1c0(fi,d.firstName);_0x1c0(li,d.lastName);}else{const ni=document.querySelector('input[name="name"], input[name="fullName"], input[id*="name"]');if(ni){_0x1c0(ni,d.firstName+' '+d.lastName);}else if(ai.length>0x0){_0x1c0(ai[0x0],d.firstName+' '+d.lastName);}}await _0x1ae(0x1f4);const bd=d.birthday;const sb=document.querySelectorAll('[role="spinbutton"]');if(sb.length>=0x3){await _0x1d1(sb[0x0],bd.year);await _0x1d1(sb[0x1],bd.month);await _0x1d1(sb[0x2],bd.day);}else{const vi=Array.from(document.querySelectorAll('input')).filter(el=>{const r=el.getBoundingClientRect();return r.width>0x0&&r.height>0x0&&el.type!=='hidden';});if(vi.length>0x1){const bs=bd.year+'/'+String(bd.month).padStart(0x2,'0')+'/'+String(bd.day).padStart(0x2,'0');_0x1c0(vi[0x1],bs);}}await _0x1ae(0x3e8);let cb=document.querySelector('button[type="submit"]')||_0x1f3('button',['Continue','继续','Agree','同意']);if(cb){_0x1e2(cb);const cu=window.location.href;let s=0x0;while(window.location.href===cu){s++;_0xbae('正在等待页面加载... ('+s+'s)');await _0x1ae(0x3e8);if(!document.querySelector('[role="spinbutton"]'))break;}_0x18c(_0x5f.COMPLETE);_0xa9d();_0x137({...d,status:'注册完成'});_0x19d();const ar=GM_getValue(_0x4e.AUTO_REDIRECT_TEAM,!1);if(ar){_0xbae('注册完成,正在生成 Team 短链接...');await _0x1ae(0x5dc);await _0x436(d.email,d.password);}else{_0x214(d.email,d.password,null,null);}}}
async function _0x548(){let st=_0x17b();const d=_0x159();if(st===_0x5f.IDLE||!d)return;const u=window.location.href;const ia=u.includes('auth.openai.com')||u.includes('/auth/');if(!ia&&st!==_0x5f.IDLE&&st!==_0x5f.COMPLETE){_0x18c(_0x5f.COMPLETE);_0xa9d();_0x137({...d,status:'注册完成'});_0x19d();const ar=GM_getValue(_0x4e.AUTO_REDIRECT_TEAM,!1);if(ar){_0xbae('注册完成,正在生成 Team 短链接...');await _0x1ae(0x5dc);await _0x436(d.email,d.password);}else{_0x214(d.email,d.password,null,null);}return;}await _0x1ae(0x7d0);try{const hp=document.querySelector('input[type="password"]');const he=document.querySelector('input[type="email"], input[name="email"]')&&!hp;const hc=document.querySelector('input[maxlength="1"], input[autocomplete="one-time-code"], input[name="code"]');const hpi=document.querySelector('input[name="firstName"], input[name="first_name"], input[id*="firstName"]');if(hc&&st!==_0x5f.FILL_CODE&&st!==_0x5f.WAIT_CODE){st=_0x5f.FILL_CODE;_0x18c(st);}else if(hpi&&st!==_0x5f.FILL_PROFILE){st=_0x5f.FILL_PROFILE;_0x18c(st);}else if(hp&&(st===_0x5f.FILL_EMAIL||st===_0x5f.GOTO_SIGNUP)){st=_0x5f.FILL_PASSWORD;_0x18c(st);}if(st===_0x5f.GOTO_SIGNUP){_0xbae('正在准备注册...');await _0x1ae(0x3e8);let sl=document.querySelector('a[href*="signup"], [data-testid="signup-link"]')||_0x1f3('a, button',['Sign up','注册','Create account']);if(sl){_0x18c(_0x5f.FILL_EMAIL);_0x1e2(sl);}else{_0x18c(_0x5f.FILL_EMAIL);await _0x548();}}else if(st===_0x5f.FILL_EMAIL){_0xbae('正在填写邮箱...');await _0x1ae(0x3e8);const ei=await _0x1bf('input[type="email"], input[name="email"], input[id*="email"], input[autocomplete="email"], input[inputmode="email"], input[name="username"], #username',0x3a98);_0x1c0(ei,d.email);await _0x1ae(0x3e8);let cb=document.querySelector('button[type="submit"]')||_0x1f3('button',['Continue','继续','Next']);if(cb){_0x1e2(cb);_0x18c(_0x5f.FILL_PASSWORD);let s=0x0;let pi=null;while(!pi){s++;_0xbae('等待页面加载... ('+s+'s)');await _0x1ae(0x3e8);pi=document.querySelector('input[type="password"], input[name="password"]');if(s>=0x3c){_0xbae('等待超时,请手动检查...');return;}}await _0x98d(d);}}else if(st===_0x5f.FILL_PASSWORD){await _0x98d(d);}else if(st===_0x5f.WAIT_CODE){await _0xa9e(d);}else if(st===_0x5f.FILL_CODE){const ud=_0x159();await _0xbaf(ud.verificationCode,d);}else if(st===_0x5f.FILL_PROFILE){await _0xcc0(d);}else if(st===_0x5f.COMPLETE){_0xa9d();_0x137({...d,status:'注册完成'});_0x19d();const ar=GM_getValue(_0x4e.AUTO_REDIRECT_TEAM,!1);if(ar){_0xbae('注册完成,正在生成 Team 短链接...');await _0x1ae(0x5dc);await _0x436(d.email,d.password);}else{_0x214(d.email,d.password,null,null);}}}catch(e){console.error('[AutoReg] Error:',e);_0xbae('错误: '+e.message);setTimeout(()=>{_0xa9d();if(confirm('自动注册出错: '+e.message+'\n\n是否重试?')){_0x548();}else{_0x19d();}},0x7d0);}}
setInterval(_0x204,0x5dc);setTimeout(_0x204,0x3e8);
})();