Files
DinQuant/frontend/dist/js/177-legacy.2b7663a7.js
T
TIANHE efae3480bf feat: Remove test connection button from strategy creation page and fix dark theme styles in profile page
- Remove test connection button and related code from strategy creation page
- Fix text colors in profile page dark theme (credits log, notification settings, exchange config, referral list)
- Update frontend build files
2026-03-12 00:37:11 +08:00

1 line
50 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";(self["webpackChunkvue_antd_pro"]=self["webpackChunkvue_antd_pro"]||[]).push([[177],{42430:function(e,t,a){a.d(t,{IA:function(){return o},PR:function(){return s},kI:function(){return l}});var r=a(76338),i=a(75769),n={list:"/api/credentials/list",get:"/api/credentials/get",create:"/api/credentials/create",delete:"/api/credentials/delete"};function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,i.Ay)({url:n.list,method:"get",params:e})}function s(e){return(0,i.Ay)({url:n.create,method:"post",data:e})}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.Ay)({url:n.delete,method:"delete",params:(0,r.A)({id:e},t)})}},49177:function(e,t,a){a.r(t),a.d(t,{default:function(){return v}});a(62010);var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"profile-page",class:{"theme-dark":e.isDarkTheme}},[t("div",{staticClass:"page-header"},[t("h2",{staticClass:"page-title"},[t("a-icon",{attrs:{type:"user"}}),t("span",[e._v(e._s(e.$t("profile.title")||"My Profile"))])],1),t("p",{staticClass:"page-desc"},[e._v(e._s(e.$t("profile.description")||"Manage your account settings and preferences"))])]),t("a-row",{staticClass:"profile-cards-row",attrs:{gutter:24}},[t("a-col",{staticClass:"profile-card-col",attrs:{xs:24,md:8}},[t("a-card",{staticClass:"profile-card",attrs:{bordered:!1}},[t("div",{staticClass:"avatar-section"},[t("a-avatar",{attrs:{size:100,src:e.profile.avatar||"/avatar2.jpg"}}),t("h3",{staticClass:"username"},[e._v(e._s(e.profile.nickname||e.profile.username))]),t("p",{staticClass:"user-role"},[t("a-tag",{attrs:{color:e.getRoleColor(e.profile.role)}},[e._v(" "+e._s(e.getRoleLabel(e.profile.role))+" ")]),e.isVip?t("a-tag",{attrs:{color:"gold"}},[t("a-icon",{attrs:{type:"crown"}}),e._v(" VIP ")],1):e._e()],1)],1),t("a-divider"),t("div",{staticClass:"profile-info"},[t("div",{staticClass:"info-item"},[t("a-icon",{attrs:{type:"user"}}),t("span",{staticClass:"label"},[e._v(e._s(e.$t("profile.username")||"Username")+":")]),t("span",{staticClass:"value"},[e._v(e._s(e.profile.username))])],1),t("div",{staticClass:"info-item"},[t("a-icon",{attrs:{type:"mail"}}),t("span",{staticClass:"label"},[e._v(e._s(e.$t("profile.email")||"Email")+":")]),t("span",{staticClass:"value"},[e._v(e._s(e.profile.email||"-"))])],1),t("div",{staticClass:"info-item"},[t("a-icon",{attrs:{type:"calendar"}}),t("span",{staticClass:"label"},[e._v(e._s(e.$t("profile.lastLogin")||"Last Login")+":")]),t("span",{staticClass:"value"},[e._v(e._s(e.formatTime(e.profile.last_login_at)||"-"))])],1)])],1)],1),t("a-col",{staticClass:"right-cards-col",attrs:{xs:24,md:16}},[t("a-row",{staticClass:"right-cards-row",attrs:{gutter:16}},[t("a-col",{attrs:{xs:24,md:12}},[t("a-card",{staticClass:"credits-card",attrs:{bordered:!1}},[t("div",{staticClass:"credits-header"},[t("h3",{staticClass:"credits-title"},[t("a-icon",{attrs:{type:"wallet"}}),e._v(" "+e._s(e.$t("profile.credits.title")||"我的积分")+" ")],1)]),t("div",{staticClass:"credits-body"},[t("div",{staticClass:"credits-amount"},[t("span",{staticClass:"amount-value"},[e._v(e._s(e.formatCredits(e.billing.credits)))]),t("span",{staticClass:"amount-label"},[e._v(e._s(e.$t("profile.credits.unit")||"积分"))])]),e.billing.vip_expires_at?t("div",{staticClass:"vip-status"},[t("a-icon",{style:{color:e.isVip?"#faad14":"#999"},attrs:{type:"crown"}}),e.isVip?t("span",{staticClass:"vip-active"},[e._v(" "+e._s(e.$t("profile.credits.vipExpires")||"VIP有效期至")+": "+e._s(e.formatDate(e.billing.vip_expires_at))+" ")]):t("span",{staticClass:"vip-expired"},[e._v(" "+e._s(e.$t("profile.credits.vipExpired")||"VIP已过期")+" ")])],1):e.billing.is_vip?e._e():t("div",{staticClass:"vip-status"},[t("span",{staticClass:"no-vip"},[e._v(e._s(e.$t("profile.credits.noVip")||"非VIP用户"))])])]),t("a-divider"),t("div",{staticClass:"credits-actions"},[t("a-button",{attrs:{type:"primary",icon:"shopping"},on:{click:e.handleRecharge}},[e._v(" "+e._s(e.$t("profile.credits.recharge")||"开通/充值")+" ")])],1),e.billing.billing_enabled?t("div",{staticClass:"credits-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.credits.hint")||"使用AI分析/回测/监控等功能会消耗积分;VIP仅可免费使用VIP免费指标。"))])],1):e._e()],1)],1),t("a-col",{attrs:{xs:24,md:12}},[t("a-card",{staticClass:"referral-card",attrs:{bordered:!1}},[t("div",{staticClass:"referral-header"},[t("h3",{staticClass:"referral-title"},[t("a-icon",{attrs:{type:"team"}}),e._v(" "+e._s(e.$t("profile.referral.title")||"邀请好友")+" ")],1)]),t("div",{staticClass:"referral-body"},[t("div",{staticClass:"referral-stats"},[t("div",{staticClass:"stat-item"},[t("span",{staticClass:"stat-value"},[e._v(e._s(e.referralData.total||0))]),t("span",{staticClass:"stat-label"},[e._v(e._s(e.$t("profile.referral.totalInvited")||"已邀请"))])]),e.referralData.referral_bonus>0?t("div",{staticClass:"stat-item"},[t("span",{staticClass:"stat-value"},[e._v("+"+e._s(e.referralData.referral_bonus))]),t("span",{staticClass:"stat-label"},[e._v(e._s(e.$t("profile.referral.bonusPerInvite")||"每邀请获得"))])]):e._e()]),t("a-divider",{staticStyle:{margin:"12px 0"}}),t("div",{staticClass:"referral-link-section"},[t("div",{staticClass:"link-label"},[e._v(e._s(e.$t("profile.referral.yourLink")||"您的邀请链接"))]),t("div",{staticClass:"link-box"},[t("a-input",{attrs:{value:e.referralLink,readonly:"",size:"small"}},[t("a-tooltip",{attrs:{slot:"suffix",title:e.$t("profile.referral.copyLink")||"复制链接"},slot:"suffix"},[t("a-icon",{staticStyle:{cursor:"pointer"},attrs:{type:"copy"},on:{click:e.copyReferralLink}})],1)],1)],1)]),e.referralData.register_bonus>0?t("div",{staticClass:"referral-hint"},[t("a-icon",{attrs:{type:"gift"}}),t("span",[e._v(e._s(e.$t("profile.referral.newUserBonus")||"新用户注册获得")+" "+e._s(e.referralData.register_bonus)+" "+e._s(e.$t("profile.credits.unit")||"积分"))])],1):e._e()],1)])],1)],1)],1)],1),t("a-row",{staticStyle:{"margin-top":"24px"},attrs:{gutter:24}},[t("a-col",{attrs:{xs:24}},[t("a-card",{staticClass:"edit-card",attrs:{bordered:!1}},[t("a-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[t("a-tab-pane",{key:"basic",attrs:{tab:e.$t("profile.basicInfo")||"Basic Info"}},[t("a-form",{staticClass:"profile-form",attrs:{form:e.profileForm,layout:"vertical"}},[t("a-form-item",{attrs:{label:e.$t("profile.nickname")||"Nickname"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["nickname",{initialValue:e.profile.nickname}],expression:"['nickname', { initialValue: profile.nickname }]"}],attrs:{placeholder:e.$t("profile.nicknamePlaceholder")||"Enter your nickname"}},[t("a-icon",{attrs:{slot:"prefix",type:"smile"},slot:"prefix"})],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.email")||"Email"}},[t("a-input",{attrs:{value:e.profile.email||"-",disabled:""}},[t("a-icon",{attrs:{slot:"prefix",type:"mail"},slot:"prefix"}),t("a-tooltip",{attrs:{slot:"suffix",title:e.$t("profile.emailCannotChange")||"Email cannot be changed after registration"},slot:"suffix"},[t("a-icon",{staticStyle:{color:"rgba(0,0,0,.45)"},attrs:{type:"info-circle"}})],1)],1)],1),t("a-form-item",[t("a-button",{attrs:{type:"primary",loading:e.saving},on:{click:e.handleSaveProfile}},[t("a-icon",{attrs:{type:"save"}}),e._v(" "+e._s(e.$t("common.save")||"Save")+" ")],1)],1)],1)],1),t("a-tab-pane",{key:"password",attrs:{tab:e.$t("profile.changePassword")||"Change Password"}},[t("a-form",{staticClass:"password-form",attrs:{form:e.passwordForm,layout:"vertical"}},[t("a-alert",{staticStyle:{"margin-bottom":"24px"},attrs:{message:e.$t("profile.passwordHintNew")||"For security, email verification is required to change password. Password must be at least 8 characters with uppercase, lowercase, and number.",type:"info",showIcon:""}}),t("a-form-item",{attrs:{label:e.$t("profile.verificationCode")||"Verification Code"}},[t("a-row",{attrs:{gutter:12}},[t("a-col",{attrs:{span:16}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["code",{rules:[{required:!0,message:e.$t("profile.codeRequired")||"Please enter verification code"}]}],expression:"['code', {\n rules: [{ required: true, message: $t('profile.codeRequired') || 'Please enter verification code' }]\n }]"}],attrs:{placeholder:e.$t("profile.codePlaceholder")||"Enter verification code"}},[t("a-icon",{attrs:{slot:"prefix",type:"safety-certificate"},slot:"prefix"})],1)],1),t("a-col",{attrs:{span:8}},[t("a-button",{attrs:{block:"",loading:e.sendingPwdCode,disabled:e.sendingPwdCode||e.pwdCodeCountdown>0||!e.profile.email},on:{click:e.handleSendPwdCode}},[e._v(" "+e._s(e.pwdCodeCountdown>0?"".concat(e.pwdCodeCountdown,"s"):e.$t("profile.sendCode")||"Send Code")+" ")])],1)],1),e.profile.email?t("div",{staticClass:"email-hint"},[e._v(" "+e._s(e.$t("profile.codeWillSendTo")||"Code will be sent to")+": "+e._s(e.profile.email)+" ")]):t("div",{staticClass:"email-hint email-warning"},[e._v(" "+e._s(e.$t("profile.noEmailWarning")||"Please set your email first in Basic Info tab")+" ")])],1),t("a-form-item",{attrs:{label:e.$t("profile.newPassword")||"New Password"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["new_password",{rules:[{required:!0,message:e.$t("profile.newPasswordRequired")||"Please enter new password"},{validator:e.validateNewPassword}]}],expression:"['new_password', {\n rules: [\n { required: true, message: $t('profile.newPasswordRequired') || 'Please enter new password' },\n { validator: validateNewPassword }\n ]\n }]"}],attrs:{placeholder:e.$t("profile.newPasswordPlaceholder")||"Enter new password"}},[t("a-icon",{attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.confirmPassword")||"Confirm Password"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["confirm_password",{rules:[{required:!0,message:e.$t("profile.confirmPasswordRequired")||"Please confirm password"},{validator:e.validateConfirmPassword}]}],expression:"['confirm_password', {\n rules: [\n { required: true, message: $t('profile.confirmPasswordRequired') || 'Please confirm password' },\n { validator: validateConfirmPassword }\n ]\n }]"}],attrs:{placeholder:e.$t("profile.confirmPasswordPlaceholder")||"Confirm new password"}},[t("a-icon",{attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),t("a-form-item",[t("a-button",{attrs:{type:"primary",loading:e.changingPassword,disabled:!e.profile.email},on:{click:e.handleChangePassword}},[t("a-icon",{attrs:{type:"key"}}),e._v(" "+e._s(e.$t("profile.changePassword")||"Change Password")+" ")],1)],1)],1)],1),t("a-tab-pane",{key:"credits",attrs:{tab:e.$t("profile.creditsLog")||"消费记录"}},[t("a-table",{attrs:{columns:e.creditsLogColumns,dataSource:e.creditsLog,loading:e.creditsLogLoading,pagination:e.creditsLogPagination,rowKey:function(e){return e.id},size:"small"},on:{change:e.handleCreditsLogChange},scopedSlots:e._u([{key:"action",fn:function(a){return[t("a-tag",{attrs:{color:e.getActionColor(a)}},[e._v(" "+e._s(e.getActionLabel(a))+" ")])]}},{key:"amount",fn:function(a){return[t("span",{class:a>=0?"amount-positive":"amount-negative"},[e._v(" "+e._s(a>=0?"+":"")+e._s(a)+" ")])]}},{key:"created_at",fn:function(t){return[e._v(" "+e._s(e.formatTime(t))+" ")]}}])})],1),t("a-tab-pane",{key:"notifications",attrs:{tab:e.$t("profile.notifications.title")||"通知设置"}},[t("div",{staticClass:"notification-settings-form"},[t("a-alert",{staticStyle:{"margin-bottom":"24px"},attrs:{message:e.$t("profile.notifications.hint")||"配置您的默认通知方式,在创建资产监控和预警时将自动使用这些设置",type:"info",showIcon:""}}),t("a-form",{staticStyle:{"max-width":"600px"},attrs:{form:e.notificationForm,layout:"vertical"}},[t("a-form-item",{attrs:{label:e.$t("profile.notifications.defaultChannels")||"默认通知渠道"}},[t("a-checkbox-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["default_channels",{initialValue:e.notificationSettings.default_channels||["browser"]}],expression:"['default_channels', { initialValue: notificationSettings.default_channels || ['browser'] }]"}]},[t("a-row",{attrs:{gutter:16}},[t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"browser"}},[t("a-icon",{attrs:{type:"bell"}}),e._v(" "+e._s(e.$t("profile.notifications.browser")||"站内通知")+" ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"telegram"}},[t("a-icon",{attrs:{type:"send"}}),e._v(" Telegram ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"email"}},[t("a-icon",{attrs:{type:"mail"}}),e._v(" "+e._s(e.$t("profile.notifications.email")||"邮件")+" ")],1)],1)],1),t("a-row",{staticStyle:{"margin-top":"8px"},attrs:{gutter:16}},[t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"phone"}},[t("a-icon",{attrs:{type:"phone"}}),e._v(" "+e._s(e.$t("profile.notifications.phone")||"短信")+" ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"discord"}},[t("a-icon",{attrs:{type:"message"}}),e._v(" Discord ")],1)],1),t("a-col",{attrs:{span:8}},[t("a-checkbox",{attrs:{value:"webhook"}},[t("a-icon",{attrs:{type:"api"}}),e._v(" Webhook ")],1)],1)],1)],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.telegramBotToken")||"Telegram Bot Token"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["telegram_bot_token",{initialValue:e.notificationSettings.telegram_bot_token}],expression:"['telegram_bot_token', { initialValue: notificationSettings.telegram_bot_token }]"}],attrs:{placeholder:e.$t("profile.notifications.telegramBotTokenPlaceholder")||"请输入您的 Telegram Bot Token"}},[t("a-icon",{attrs:{slot:"prefix",type:"robot"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(" "+e._s(e.$t("profile.notifications.telegramBotTokenHint")||"通过 @BotFather 创建机器人获取 Token")+" "),t("a",{attrs:{href:"https://t.me/BotFather",target:"_blank",rel:"noopener noreferrer"}},[e._v("@BotFather")])])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.telegramChatId")||"Telegram Chat ID"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["telegram_chat_id",{initialValue:e.notificationSettings.telegram_chat_id}],expression:"['telegram_chat_id', { initialValue: notificationSettings.telegram_chat_id }]"}],attrs:{placeholder:e.$t("profile.notifications.telegramPlaceholder")||"请输入您的 Telegram Chat ID(如 123456789"}},[t("a-icon",{attrs:{slot:"prefix",type:"message"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.telegramHint")||"发送 /start 给 @userinfobot 可获取您的 Chat ID"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.notifyEmail")||"通知邮箱"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{initialValue:e.notificationSettings.email||e.profile.email}],expression:"['email', { initialValue: notificationSettings.email || profile.email }]"}],attrs:{placeholder:e.$t("profile.notifications.emailPlaceholder")||"接收通知的邮箱地址"}},[t("a-icon",{attrs:{slot:"prefix",type:"mail"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.emailHint")||"默认使用账户邮箱,可设置其他邮箱接收通知"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.phone")||"手机号(短信通知)"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["phone",{initialValue:e.notificationSettings.phone}],expression:"['phone', { initialValue: notificationSettings.phone }]"}],attrs:{placeholder:e.$t("profile.notifications.phonePlaceholder")||"请输入手机号(如 +8613800138000"}},[t("a-icon",{attrs:{slot:"prefix",type:"phone"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.phoneHint")||"需要管理员配置 Twilio 服务后才能使用短信通知"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.discordWebhook")||"Discord Webhook"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["discord_webhook",{initialValue:e.notificationSettings.discord_webhook}],expression:"['discord_webhook', { initialValue: notificationSettings.discord_webhook }]"}],attrs:{placeholder:e.$t("profile.notifications.discordPlaceholder")||"https://discord.com/api/webhooks/..."}},[t("a-icon",{attrs:{slot:"prefix",type:"message"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.discordHint")||"在 Discord 服务器设置中创建 Webhook"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.webhookUrl")||"Webhook URL"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["webhook_url",{initialValue:e.notificationSettings.webhook_url}],expression:"['webhook_url', { initialValue: notificationSettings.webhook_url }]"}],attrs:{placeholder:e.$t("profile.notifications.webhookPlaceholder")||"https://your-server.com/webhook"}},[t("a-icon",{attrs:{slot:"prefix",type:"api"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.webhookHint")||"自定义 Webhook 地址,将以 POST JSON 方式推送通知"))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.notifications.webhookToken")||"Webhook Token(可选)"}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["webhook_token",{initialValue:e.notificationSettings.webhook_token}],expression:"['webhook_token', { initialValue: notificationSettings.webhook_token }]"}],attrs:{placeholder:e.$t("profile.notifications.webhookTokenPlaceholder")||"用于验证请求的 Bearer Token"}},[t("a-icon",{attrs:{slot:"prefix",type:"key"},slot:"prefix"})],1),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.notifications.webhookTokenHint")||"将作为 Authorization: Bearer Token 发送到 Webhook"))])],1)],1),t("a-form-item",[t("a-button",{attrs:{type:"primary",loading:e.savingNotifications},on:{click:e.handleSaveNotifications}},[t("a-icon",{attrs:{type:"save"}}),e._v(" "+e._s(e.$t("common.save")||"保存")+" ")],1),t("a-button",{staticStyle:{"margin-left":"12px"},attrs:{loading:e.testingNotification},on:{click:e.handleTestNotification}},[t("a-icon",{attrs:{type:"experiment"}}),e._v(" "+e._s(e.$t("profile.notifications.testBtn")||"发送测试通知")+" ")],1)],1)],1)],1)]),t("a-tab-pane",{key:"exchange",attrs:{tab:e.$t("profile.exchange.title")||"交易所配置"}},[t("div",{staticClass:"exchange-config-section"},[t("a-alert",{staticStyle:{"margin-bottom":"16px"},attrs:{message:e.$t("profile.exchange.hint"),type:"info",showIcon:""}}),t("div",{staticStyle:{"margin-bottom":"16px","text-align":"right"}},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.showAddExchangeModal=!0}}},[e._v(" "+e._s(e.$t("profile.exchange.addAccount"))+" ")])],1),t("a-table",{attrs:{columns:e.exchangeColumns,dataSource:e.exchangeCredentials,loading:e.exchangeLoading,rowKey:function(e){return e.id},size:"small"},scopedSlots:e._u([{key:"exchange_id",fn:function(a){return[t("span",{staticStyle:{"text-transform":"capitalize","font-weight":"500"}},[e._v(e._s(e.getExchangeDisplayName(a)))])]}},{key:"api_key_hint",fn:function(a,r){return[t("span",{staticClass:"credential-hint"},[e._v(e._s(a||r.name||"-"))])]}},{key:"created_at",fn:function(t){return[e._v(" "+e._s(e.formatTime(t))+" ")]}},{key:"action",fn:function(a,r){return[t("a-popconfirm",{attrs:{title:e.$t("profile.exchange.deleteConfirm"),okText:e.$t("common.confirm"),cancelText:e.$t("common.cancel")},on:{confirm:function(t){return e.handleDeleteCredential(r.id)}}},[t("a-button",{attrs:{type:"danger",size:"small",ghost:"",icon:"delete"}},[e._v(" "+e._s(e.$t("common.delete"))+" ")])],1)]}}])}),e.exchangeLoading||0!==e.exchangeCredentials.length?e._e():t("a-empty",{staticStyle:{"margin-top":"20px"}},[t("span",{attrs:{slot:"description"},slot:"description"},[e._v(e._s(e.$t("profile.exchange.noAccounts")))])])],1)]),t("a-tab-pane",{key:"referrals",attrs:{tab:e.$t("profile.referral.listTab")||"邀请列表"}},[t("a-table",{attrs:{columns:e.referralColumns,dataSource:e.referralData.list||[],loading:e.referralLoading,pagination:e.referralPagination,rowKey:function(e){return e.id},size:"small"},on:{change:e.handleReferralChange},scopedSlots:e._u([{key:"user",fn:function(a,r){return[t("div",{staticClass:"referral-user-cell"},[t("a-avatar",{attrs:{size:32,src:r.avatar||"/avatar2.jpg"}}),t("div",{staticClass:"user-info"},[t("span",{staticClass:"nickname"},[e._v(e._s(r.nickname||r.username))]),t("span",{staticClass:"username"},[e._v("@"+e._s(r.username))])])],1)]}},{key:"created_at",fn:function(t){return[e._v(" "+e._s(e.formatTime(t))+" ")]}}])}),e.referralLoading||e.referralData.list&&0!==e.referralData.list.length?e._e():t("a-empty",[t("span",{attrs:{slot:"description"},slot:"description"},[e._v(e._s(e.$t("profile.referral.noReferrals")||"暂无邀请记录"))]),t("a-button",{attrs:{type:"primary"},on:{click:e.copyReferralLink}},[e._v(" "+e._s(e.$t("profile.referral.shareNow")||"立即分享邀请")+" ")])],1)],1)],1)],1)],1)],1),t("a-modal",{attrs:{title:e.$t("profile.exchange.addTitle"),visible:e.showAddExchangeModal,confirmLoading:e.savingExchange,okText:e.$t("common.save"),cancelText:e.$t("common.cancel"),maskClosable:!1,width:"520px"},on:{ok:e.handleSaveExchange,cancel:function(t){e.showAddExchangeModal=!1}}},[t("a-form",{attrs:{form:e.exchangeForm,layout:"vertical"}},[t("a-form-item",{attrs:{label:e.$t("profile.exchange.selectExchange")}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["exchange_id",{rules:[{required:!0,message:e.$t("profile.exchange.selectExchange")}]}],expression:"['exchange_id', { rules: [{ required: true, message: $t('profile.exchange.selectExchange') }] }]"}],attrs:{placeholder:e.$t("profile.exchange.selectExchange")},on:{change:e.handleExchangeTypeChange}},[t("a-select-opt-group",{attrs:{label:e.$t("profile.exchange.typeCrypto")}},e._l(e.cryptoExchangeList,function(a){return t("a-select-option",{key:a.id,attrs:{value:a.id}},[e._v(" "+e._s(a.name)+" ")])}),1),t("a-select-opt-group",{attrs:{label:e.$t("profile.exchange.typeIBKR")}},[t("a-select-option",{attrs:{value:"ibkr"}},[e._v("Interactive Brokers (IBKR)")])],1),t("a-select-opt-group",{attrs:{label:e.$t("profile.exchange.typeMT5")}},[t("a-select-option",{attrs:{value:"mt5"}},[e._v("MetaTrader 5")])],1)],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.accountName")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name"],expression:"['name']"}],attrs:{placeholder:e.$t("profile.exchange.accountNamePlaceholder")}})],1),"crypto"===e.addExchangeType?[t("a-form-item",{attrs:{label:e.$t("profile.exchange.apiKey")}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["api_key",{rules:[{required:!0,message:"API Key is required"}]}],expression:"['api_key', { rules: [{ required: true, message: 'API Key is required' }] }]"}],attrs:{placeholder:"API Key",autocomplete:"new-password"}})],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.secretKey")}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["secret_key",{rules:[{required:!0,message:"Secret Key is required"}]}],expression:"['secret_key', { rules: [{ required: true, message: 'Secret Key is required' }] }]"}],attrs:{placeholder:"Secret Key",autocomplete:"new-password"}})],1),e.addExchangeNeedsPassphrase?t("a-form-item",{attrs:{label:e.$t("profile.exchange.passphrase")}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["passphrase"],expression:"['passphrase']"}],attrs:{placeholder:"Passphrase",autocomplete:"new-password"}})],1):e._e(),e.addExchangeShowDemo?t("a-form-item",[t("a-checkbox",{directives:[{name:"decorator",rawName:"v-decorator",value:["enable_demo_trading",{valuePropName:"checked",initialValue:!1}],expression:"['enable_demo_trading', { valuePropName: 'checked', initialValue: false }]"}]},[e._v(" "+e._s(e.$t("profile.exchange.demoTrading"))+" ")])],1):e._e()]:e._e(),"ibkr"===e.addExchangeType?[t("a-alert",{staticStyle:{"margin-bottom":"16px"},attrs:{type:"warning",showIcon:"",message:e.$t("profile.exchange.localDeploymentRequired"),description:e.$t("profile.exchange.localDeploymentHint")}}),t("a-form-item",{attrs:{label:e.$t("profile.exchange.ibkrHost")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["ibkr_host",{initialValue:"127.0.0.1"}],expression:"['ibkr_host', { initialValue: '127.0.0.1' }]"}],attrs:{placeholder:"127.0.0.1"}})],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.ibkrPort")}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["ibkr_port",{initialValue:7497}],expression:"['ibkr_port', { initialValue: 7497 }]"}],staticStyle:{width:"100%"},attrs:{min:1,max:65535}}),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.exchange.ibkrPortHint")))])],1)],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.ibkrClientId")}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["ibkr_client_id",{initialValue:1}],expression:"['ibkr_client_id', { initialValue: 1 }]"}],staticStyle:{width:"100%"},attrs:{min:1,max:999}})],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.ibkrAccount")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["ibkr_account"],expression:"['ibkr_account']"}],attrs:{placeholder:"DU123456"}})],1)]:e._e(),"mt5"===e.addExchangeType?[t("a-alert",{staticStyle:{"margin-bottom":"16px"},attrs:{type:"warning",showIcon:"",message:e.$t("profile.exchange.localDeploymentRequired"),description:e.$t("profile.exchange.localDeploymentHint")}}),t("a-form-item",{attrs:{label:e.$t("profile.exchange.mt5Server")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["mt5_server",{rules:[{required:!0,message:"Server is required"}]}],expression:"['mt5_server', { rules: [{ required: true, message: 'Server is required' }] }]"}],attrs:{placeholder:"MetaQuotes-Demo"}})],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.mt5Login")}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["mt5_login",{rules:[{required:!0,message:"Login is required"}]}],expression:"['mt5_login', { rules: [{ required: true, message: 'Login is required' }] }]"}],staticStyle:{width:"100%"},attrs:{min:1,placeholder:"12345678"}})],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.mt5Password")}},[t("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["mt5_password",{rules:[{required:!0,message:"Password is required"}]}],expression:"['mt5_password', { rules: [{ required: true, message: 'Password is required' }] }]"}],attrs:{placeholder:"Password",autocomplete:"new-password"}})],1),t("a-form-item",{attrs:{label:e.$t("profile.exchange.mt5TerminalPath")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["mt5_terminal_path"],expression:"['mt5_terminal_path']"}],attrs:{placeholder:"C:\\Program Files\\MetaTrader 5\\terminal64.exe"}}),t("div",{staticClass:"field-hint"},[t("a-icon",{attrs:{type:"info-circle"}}),t("span",[e._v(e._s(e.$t("profile.exchange.mt5TerminalPathHint")))])],1)],1)]:e._e(),e.addExchangeType?t("a-form-item",[t("a-button",{attrs:{block:"",loading:e.testingExchange},on:{click:e.handleTestExchangeConnection}},[t("a-icon",{attrs:{type:"api"}}),e._v(" "+e._s(e.$t("profile.exchange.testConnection"))+" ")],1),e.exchangeTestResult?t("div",{staticClass:"test-result-msg",class:e.exchangeTestResult.success?"success":"error"},[t("a-icon",{attrs:{type:e.exchangeTestResult.success?"check-circle":"close-circle"}}),e._v(" "+e._s(e.exchangeTestResult.message)+" ")],1):e._e()],1):e._e()],2)],1)],1)},i=[],n=a(76338),o=a(81127),s=a(56252),l=(a(28706),a(74423),a(62062),a(2892),a(26099),a(27495),a(21699),a(47764),a(62953),a(84841)),c=a(53003),d=a(42430),u=a(36911),p=a(55434),f={name:"Profile",mixins:[p.t],data:function(){return{loading:!1,saving:!1,changingPassword:!1,sendingPwdCode:!1,pwdCodeCountdown:0,pwdCodeTimer:null,activeTab:"basic",profile:{id:null,username:"",nickname:"",email:"",avatar:"",role:"user",last_login_at:null},creditsLog:[],creditsLogLoading:!1,creditsLogPagination:{current:1,pageSize:10,total:0},referralData:{list:[],total:0,referral_code:"",referral_bonus:0,register_bonus:0},referralLoading:!1,referralPagination:{current:1,pageSize:10,total:0},billing:{credits:0,is_vip:!1,vip_expires_at:null,billing_enabled:!1,vip_bypass:!0,feature_costs:{},recharge_telegram_url:""},rechargeTelegramUrl:"https://t.me/your_support_bot",notificationSettings:{default_channels:["browser"],telegram_bot_token:"",telegram_chat_id:"",email:"",phone:"",discord_webhook:"",webhook_url:"",webhook_token:""},savingNotifications:!1,testingNotification:!1,exchangeCredentials:[],exchangeLoading:!1,showAddExchangeModal:!1,savingExchange:!1,testingExchange:!1,exchangeTestResult:null,addExchangeType:"",selectedExchangeId:"",cryptoExchangeList:[{id:"binance",name:"Binance"},{id:"okx",name:"OKX"},{id:"bitget",name:"Bitget"},{id:"bybit",name:"Bybit"},{id:"coinbaseexchange",name:"Coinbase"},{id:"kraken",name:"Kraken"},{id:"kucoin",name:"KuCoin"},{id:"gate",name:"Gate.io"},{id:"bitfinex",name:"Bitfinex"}]}},computed:{isDarkTheme:function(){return"dark"===this.navTheme||"realdark"===this.navTheme},isVip:function(){if(!this.billing.vip_expires_at)return!1;var e=new Date(this.billing.vip_expires_at);return e>new Date},creditsLogColumns:function(){return[{title:this.$t("profile.creditsLog.time")||"时间",dataIndex:"created_at",width:160,scopedSlots:{customRender:"created_at"}},{title:this.$t("profile.creditsLog.action")||"类型",dataIndex:"action",width:100,scopedSlots:{customRender:"action"}},{title:this.$t("profile.creditsLog.amount")||"变动",dataIndex:"amount",width:100,scopedSlots:{customRender:"amount"}},{title:this.$t("profile.creditsLog.balance")||"余额",dataIndex:"balance_after",width:100},{title:this.$t("profile.creditsLog.remark")||"备注",dataIndex:"remark",ellipsis:!0}]},referralColumns:function(){return[{title:this.$t("profile.referral.user")||"用户",dataIndex:"username",scopedSlots:{customRender:"user"}},{title:this.$t("profile.referral.registerTime")||"注册时间",dataIndex:"created_at",width:180,scopedSlots:{customRender:"created_at"}}]},referralLink:function(){var e=window.location.origin+window.location.pathname,t=this.referralData.referral_code||this.profile.id;return"".concat(e,"#/user/login?ref=").concat(t)},exchangeColumns:function(){return[{title:this.$t("profile.exchange.colExchange")||"Exchange",dataIndex:"exchange_id",width:140,scopedSlots:{customRender:"exchange_id"}},{title:this.$t("profile.exchange.colName")||"Name",dataIndex:"name",width:140,customRender:function(e){return e||"-"}},{title:this.$t("profile.exchange.colHint")||"Connection Info",dataIndex:"api_key_hint",scopedSlots:{customRender:"api_key_hint"}},{title:this.$t("profile.exchange.colCreatedAt")||"Created At",dataIndex:"created_at",width:180,scopedSlots:{customRender:"created_at"}},{title:this.$t("profile.exchange.colActions")||"Actions",width:120,scopedSlots:{customRender:"action"}}]},addExchangeNeedsPassphrase:function(){var e=["okx","bitget","kucoin"];return e.includes(this.selectedExchangeId)},addExchangeShowDemo:function(){return"binance"===this.selectedExchangeId}},watch:{activeTab:function(e){"credits"===e&&0===this.creditsLog.length&&this.loadCreditsLog(),"referrals"!==e||this.referralData.list&&0!==this.referralData.list.length||this.loadReferrals(),"notifications"!==e||this.notificationSettings.telegram_chat_id||this.notificationSettings.discord_webhook||this.loadNotificationSettings(),"exchange"===e&&0===this.exchangeCredentials.length&&this.loadExchangeCredentials()}},beforeCreate:function(){this.profileForm=this.$form.createForm(this,{name:"profile"}),this.passwordForm=this.$form.createForm(this,{name:"password"}),this.notificationForm=this.$form.createForm(this,{name:"notification"}),this.exchangeForm=this.$form.createForm(this,{name:"exchange"})},mounted:function(){this.loadProfile(),this.loadReferrals()},beforeDestroy:function(){this.pwdCodeTimer&&clearInterval(this.pwdCodeTimer)},methods:{loadProfile:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.loading=!0,t.p=1,t.n=2,(0,l.E$)();case 2:a=t.v,1===a.code?(e.profile=a.data,a.data.billing&&(e.billing=a.data.billing,e.billing.recharge_telegram_url&&(e.rechargeTelegramUrl=e.billing.recharge_telegram_url)),a.data.notification_settings&&(e.notificationSettings={default_channels:a.data.notification_settings.default_channels||["browser"],telegram_bot_token:a.data.notification_settings.telegram_bot_token||"",telegram_chat_id:a.data.notification_settings.telegram_chat_id||"",email:a.data.notification_settings.email||a.data.email||"",phone:a.data.notification_settings.phone||"",discord_webhook:a.data.notification_settings.discord_webhook||"",webhook_url:a.data.notification_settings.webhook_url||"",webhook_token:a.data.notification_settings.webhook_token||""}),e.$nextTick(function(){e.profileForm.setFieldsValue({nickname:e.profile.nickname,email:e.profile.email})})):e.$message.error(a.msg||"Failed to load profile"),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load profile");case 4:return t.p=4,e.loading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},loadRechargeUrl:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if("admin"!==e.profile.role){t.n=4;break}return t.p=1,t.n=2,(0,c.YT)();case 2:a=t.v,1===a.code&&a.data&&a.data.billing&&(e.rechargeTelegramUrl=a.data.billing.RECHARGE_TELEGRAM_URL||e.rechargeTelegramUrl),t.n=4;break;case 3:t.p=3,t.v;case 4:return t.a(2)}},t,null,[[1,3]])}))()},handleRecharge:function(){this.$router.push("/billing")},formatCredits:function(e){return e||0===e?Number(e).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}):"0"},formatDate:function(e){if(!e)return"";var t=new Date(e);return t.toLocaleDateString()},handleSaveProfile:function(){var e=this;this.profileForm.validateFields(function(){var t=(0,s.A)((0,o.A)().m(function t(a,r){var i;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(!a){t.n=1;break}return t.a(2);case 1:return e.saving=!0,t.p=2,t.n=3,(0,l.r7)(r);case 3:i=t.v,1===i.code?(e.$message.success(i.msg||"Profile updated successfully"),e.loadProfile()):e.$message.error(i.msg||"Update failed"),t.n=5;break;case 4:t.p=4,t.v,e.$message.error("Update failed");case 5:return t.p=5,e.saving=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e,a){return t.apply(this,arguments)}}())},validateConfirmPassword:function(e,t,a){var r=this.passwordForm.getFieldValue("new_password");t&&t!==r?a(this.$t("profile.passwordMismatch")||"Passwords do not match"):a()},handleSendPwdCode:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var r,i,n,s,l;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(e.profile.email){t.n=1;break}return e.$message.error(e.$t("profile.noEmailWarning")||"Please set your email first"),t.a(2);case 1:return e.sendingPwdCode=!0,t.p=2,t.n=3,a.e(824).then(a.bind(a,95824));case 3:return r=t.v,i=r.sendVerificationCode,t.n=4,i({email:e.profile.email,type:"change_password"});case 4:n=t.v,1===n.code?(e.$message.success(e.$t("profile.codeSent")||"Verification code sent"),e.startPwdCodeCountdown()):e.$message.error(n.msg||"Failed to send code"),t.n=6;break;case 5:t.p=5,l=t.v,e.$message.error((null===(s=l.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.msg)||"Failed to send code");case 6:return t.p=6,e.sendingPwdCode=!1,t.f(6);case 7:return t.a(2)}},t,null,[[2,5,6,7]])}))()},startPwdCodeCountdown:function(){var e=this;this.pwdCodeCountdown=60,this.pwdCodeTimer=setInterval(function(){e.pwdCodeCountdown--,e.pwdCodeCountdown<=0&&(clearInterval(e.pwdCodeTimer),e.pwdCodeTimer=null)},1e3)},validateNewPassword:function(e,t,a){t?t.length<8?a(new Error(this.$t("user.register.pwdMinLength")||"At least 8 characters")):/[A-Z]/.test(t)?/[a-z]/.test(t)?/[0-9]/.test(t)?a():a(new Error(this.$t("user.register.pwdNumber")||"At least one number")):a(new Error(this.$t("user.register.pwdLowercase")||"At least one lowercase letter")):a(new Error(this.$t("user.register.pwdUppercase")||"At least one uppercase letter")):a()},handleChangePassword:function(){var e=this;this.passwordForm.validateFields(function(){var t=(0,s.A)((0,o.A)().m(function t(r,i){var n,s,l,c,d;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(!r){t.n=1;break}return t.a(2);case 1:return e.changingPassword=!0,t.p=2,t.n=3,a.e(824).then(a.bind(a,95824));case 3:return n=t.v,s=n.changePassword,t.n=4,s({code:i.code,new_password:i.new_password});case 4:l=t.v,1===l.code?(e.$message.success(l.msg||"Password changed successfully"),e.passwordForm.resetFields()):e.$message.error(l.msg||"Change password failed"),t.n=6;break;case 5:t.p=5,d=t.v,e.$message.error((null===(c=d.response)||void 0===c||null===(c=c.data)||void 0===c?void 0:c.msg)||"Change password failed");case 6:return t.p=6,e.changingPassword=!1,t.f(6);case 7:return t.a(2)}},t,null,[[2,5,6,7]])}));return function(e,a){return t.apply(this,arguments)}}())},getRoleColor:function(e){var t={admin:"red",manager:"orange",user:"blue",viewer:"default"};return t[e]||"default"},getRoleLabel:function(e){var t={admin:this.$t("userManage.roleAdmin")||"Admin",manager:this.$t("userManage.roleManager")||"Manager",user:this.$t("userManage.roleUser")||"User",viewer:this.$t("userManage.roleViewer")||"Viewer"};return t[e]||e},formatTime:function(e){if(!e)return"";var t=new Date("number"===typeof e?1e3*e:e);return t.toLocaleString()},loadCreditsLog:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.creditsLogLoading=!0,t.p=1,t.n=2,(0,l.v9)({page:e.creditsLogPagination.current,page_size:e.creditsLogPagination.pageSize});case 2:a=t.v,1===a.code&&(e.creditsLog=a.data.items||[],e.creditsLogPagination.total=a.data.total||0),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load credits log");case 4:return t.p=4,e.creditsLogLoading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},handleCreditsLogChange:function(e){this.creditsLogPagination.current=e.current,this.loadCreditsLog()},loadReferrals:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.referralLoading=!0,t.p=1,t.n=2,(0,l.rx)({page:e.referralPagination.current,page_size:e.referralPagination.pageSize});case 2:a=t.v,1===a.code&&(e.referralData={list:a.data.list||[],total:a.data.total||0,referral_code:a.data.referral_code||"",referral_bonus:a.data.referral_bonus||0,register_bonus:a.data.register_bonus||0},e.referralPagination.total=a.data.total||0),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load referral data");case 4:return t.p=4,e.referralLoading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},handleReferralChange:function(e){this.referralPagination.current=e.current,this.loadReferrals()},copyReferralLink:function(){var e=this,t=this.referralLink;navigator.clipboard?navigator.clipboard.writeText(t).then(function(){e.$message.success(e.$t("profile.referral.linkCopied")||"邀请链接已复制")}).catch(function(){e.fallbackCopy(t)}):this.fallbackCopy(t)},fallbackCopy:function(e){var t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{document.execCommand("copy"),this.$message.success(this.$t("profile.referral.linkCopied")||"邀请链接已复制")}catch(a){this.$message.error("Copy failed")}document.body.removeChild(t)},getActionColor:function(e){var t={consume:"red",recharge:"green",admin_adjust:"blue",refund:"orange",vip_grant:"gold",vip_revoke:"default",register_bonus:"cyan",referral_bonus:"purple",indicator_purchase:"volcano",indicator_sale:"lime"};return t[e]||"default"},getActionLabel:function(e){var t={consume:this.$t("profile.creditsLog.actionConsume")||"消费",recharge:this.$t("profile.creditsLog.actionRecharge")||"充值",admin_adjust:this.$t("profile.creditsLog.actionAdjust")||"调整",refund:this.$t("profile.creditsLog.actionRefund")||"退款",vip_grant:this.$t("profile.creditsLog.actionVipGrant")||"VIP授予",vip_revoke:this.$t("profile.creditsLog.actionVipRevoke")||"VIP取消",register_bonus:this.$t("profile.creditsLog.actionRegisterBonus")||"注册奖励",referral_bonus:this.$t("profile.creditsLog.actionReferralBonus")||"邀请奖励",indicator_purchase:this.$t("profile.creditsLog.actionIndicatorPurchase")||"购买指标",indicator_sale:this.$t("profile.creditsLog.actionIndicatorSale")||"出售指标"};return t[e]||e},loadExchangeCredentials:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return e.exchangeLoading=!0,t.p=1,t.n=2,(0,d.IA)();case 2:a=t.v,1===a.code&&a.data&&(e.exchangeCredentials=a.data.items||[]),t.n=4;break;case 3:t.p=3,t.v,e.$message.error("Failed to load exchange accounts");case 4:return t.p=4,e.exchangeLoading=!1,t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}))()},handleExchangeTypeChange:function(e){this.selectedExchangeId=e,this.exchangeTestResult=null;var t=this.cryptoExchangeList.map(function(e){return e.id});t.includes(e)?this.addExchangeType="crypto":this.addExchangeType="ibkr"===e?"ibkr":"mt5"===e?"mt5":""},getExchangeDisplayName:function(e){var t={binance:"Binance",okx:"OKX",bitget:"Bitget",bybit:"Bybit",coinbaseexchange:"Coinbase",kraken:"Kraken",kucoin:"KuCoin",gate:"Gate.io",bitfinex:"Bitfinex",ibkr:"IBKR",mt5:"MetaTrader 5"};return t[e]||e},handleSaveExchange:function(){var e=this;this.exchangeForm.validateFields(function(){var t=(0,s.A)((0,o.A)().m(function t(a,r){var i,s,l;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(!a){t.n=1;break}return t.a(2);case 1:return e.savingExchange=!0,t.p=2,i=(0,n.A)({},r),t.n=3,(0,d.PR)(i);case 3:s=t.v,1===s.code?(e.$message.success(e.$t("profile.exchange.saveSuccess")),e.showAddExchangeModal=!1,e.exchangeForm.resetFields(),e.addExchangeType="",e.selectedExchangeId="",e.exchangeTestResult=null,e.loadExchangeCredentials()):e.$message.error(s.msg||e.$t("profile.exchange.saveFailed")),t.n=5;break;case 4:t.p=4,l=t.v,e.$message.error(l.message||e.$t("profile.exchange.saveFailed"));case 5:return t.p=5,e.savingExchange=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e,a){return t.apply(this,arguments)}}())},handleDeleteCredential:function(e){var t=this;return(0,s.A)((0,o.A)().m(function a(){var r;return(0,o.A)().w(function(a){while(1)switch(a.p=a.n){case 0:return a.p=0,a.n=1,(0,d.kI)(e);case 1:r=a.v,1===r.code?(t.$message.success(t.$t("profile.exchange.deleteSuccess")),t.loadExchangeCredentials()):t.$message.error(r.msg||"Delete failed"),a.n=3;break;case 2:a.p=2,a.v,t.$message.error("Delete failed");case 3:return a.a(2)}},a,null,[[0,2]])}))()},handleTestExchangeConnection:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a,r,i,s,l;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(a=e.exchangeForm.getFieldsValue(),r=a.exchange_id,r){t.n=1;break}return t.a(2);case 1:return e.testingExchange=!0,e.exchangeTestResult=null,t.p=2,i=(0,n.A)({},a),t.n=3,(0,u.kv)(i);case 3:s=t.v,1===s.code?e.exchangeTestResult={success:!0,message:e.$t("profile.exchange.testSuccess")}:e.exchangeTestResult={success:!1,message:"".concat(e.$t("profile.exchange.testFailed"),": ").concat(s.msg||"Unknown error")},t.n=5;break;case 4:t.p=4,l=t.v,e.exchangeTestResult={success:!1,message:"".concat(e.$t("profile.exchange.testFailed"),": ").concat(l.message||"Network error")};case 5:return t.p=5,e.testingExchange=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}))()},loadNotificationSettings:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,(0,l.vF)();case 1:a=t.v,1===a.code&&a.data&&(e.notificationSettings={default_channels:a.data.default_channels||["browser"],telegram_bot_token:a.data.telegram_bot_token||"",telegram_chat_id:a.data.telegram_chat_id||"",email:a.data.email||e.profile.email||"",phone:a.data.phone||"",discord_webhook:a.data.discord_webhook||"",webhook_url:a.data.webhook_url||"",webhook_token:a.data.webhook_token||""},e.$nextTick(function(){e.notificationForm.setFieldsValue({default_channels:e.notificationSettings.default_channels,telegram_bot_token:e.notificationSettings.telegram_bot_token,telegram_chat_id:e.notificationSettings.telegram_chat_id,email:e.notificationSettings.email,phone:e.notificationSettings.phone,discord_webhook:e.notificationSettings.discord_webhook,webhook_url:e.notificationSettings.webhook_url,webhook_token:e.notificationSettings.webhook_token})})),t.n=3;break;case 2:t.p=2,t.v;case 3:return t.a(2)}},t,null,[[0,2]])}))()},handleSaveNotifications:function(){var e=this;this.notificationForm.validateFields(function(){var t=(0,s.A)((0,o.A)().m(function t(a,r){var i;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(!a){t.n=1;break}return t.a(2);case 1:return e.savingNotifications=!0,t.p=2,t.n=3,(0,l.Gl)({default_channels:r.default_channels||["browser"],telegram_bot_token:r.telegram_bot_token||"",telegram_chat_id:r.telegram_chat_id||"",email:r.email||"",phone:r.phone||"",discord_webhook:r.discord_webhook||"",webhook_url:r.webhook_url||"",webhook_token:r.webhook_token||""});case 3:i=t.v,1===i.code?(e.$message.success(e.$t("profile.notifications.saveSuccess")||"通知设置保存成功"),e.notificationSettings=i.data||e.notificationSettings):e.$message.error(i.msg||"保存失败"),t.n=5;break;case 4:t.p=4,t.v,e.$message.error("保存失败");case 5:return t.p=5,e.savingNotifications=!1,t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e,a){return t.apply(this,arguments)}}())},handleTestNotification:function(){var e=this;return(0,s.A)((0,o.A)().m(function t(){var a,r,i;return(0,o.A)().w(function(t){while(1)switch(t.p=t.n){case 0:if(a=e.notificationForm.getFieldsValue(),r=a.default_channels||[],0!==r.length){t.n=1;break}return e.$message.warning(e.$t("profile.notifications.selectChannel")||"请至少选择一个通知渠道"),t.a(2);case 1:if(!r.includes("telegram")){t.n=3;break}if(a.telegram_bot_token){t.n=2;break}return e.$message.warning(e.$t("profile.notifications.fillTelegramToken")||"请填写 Telegram Bot Token"),t.a(2);case 2:if(a.telegram_chat_id){t.n=3;break}return e.$message.warning(e.$t("profile.notifications.fillTelegram")||"请填写 Telegram Chat ID"),t.a(2);case 3:if(!r.includes("email")||a.email){t.n=4;break}return e.$message.warning(e.$t("profile.notifications.fillEmail")||"请填写通知邮箱"),t.a(2);case 4:return e.testingNotification=!0,t.p=5,t.n=6,(0,l.Gl)({default_channels:r,telegram_bot_token:a.telegram_bot_token||"",telegram_chat_id:a.telegram_chat_id||"",email:a.email||"",phone:a.phone||"",discord_webhook:a.discord_webhook||"",webhook_url:a.webhook_url||"",webhook_token:a.webhook_token||""});case 6:if(i=t.v,1===i.code){t.n=7;break}return e.$message.error(i.msg||"保存设置失败"),t.a(2);case 7:e.$message.info(e.$t("profile.notifications.testSent")||"测试通知已发送,请检查您的通知渠道"),t.n=9;break;case 8:t.p=8,t.v,e.$message.error("发送测试通知失败");case 9:return t.p=9,e.testingNotification=!1,t.f(9);case 10:return t.a(2)}},t,null,[[5,8,9,10]])}))()}}},m=f,g=a(81656),h=(0,g.A)(m,r,i,!1,null,"2b760d50",null),v=h.exports},53003:function(e,t,a){a.d(t,{DZ:function(){return o},YT:function(){return n},_d:function(){return s},lo:function(){return i}});a(76338);var r=a(75769);function i(){return(0,r.Ay)({url:"/api/settings/schema",method:"get"})}function n(){return(0,r.Ay)({url:"/api/settings/values",method:"get"})}function o(e){return(0,r.Ay)({url:"/api/settings/save",method:"post",data:e})}function s(){return(0,r.Ay)({url:"/api/settings/openrouter-balance",method:"get"})}},84841:function(e,t,a){a.d(t,{DK:function(){return _},E$:function(){return d},Gl:function(){return f},O0:function(){return c},TK:function(){return o},aU:function(){return i},cw:function(){return l},d$:function(){return b},hG:function(){return s},kg:function(){return n},nY:function(){return v},r7:function(){return u},rx:function(){return g},v9:function(){return m},vF:function(){return p},vi:function(){return w},wq:function(){return h}});var r=a(75769);function i(e){return(0,r.Ay)({url:"/api/users/list",method:"get",params:e})}function n(e){return(0,r.Ay)({url:"/api/users/create",method:"post",data:e})}function o(e,t){return(0,r.Ay)({url:"/api/users/update",method:"put",params:{id:e},data:t})}function s(e){return(0,r.Ay)({url:"/api/users/delete",method:"delete",params:{id:e}})}function l(e){return(0,r.Ay)({url:"/api/users/reset-password",method:"post",data:e})}function c(){return(0,r.Ay)({url:"/api/users/roles",method:"get"})}function d(){return(0,r.Ay)({url:"/api/users/profile",method:"get"})}function u(e){return(0,r.Ay)({url:"/api/users/profile/update",method:"put",data:e})}function p(){return(0,r.Ay)({url:"/api/users/notification-settings",method:"get"})}function f(e){return(0,r.Ay)({url:"/api/users/notification-settings",method:"put",data:e})}function m(e){return(0,r.Ay)({url:"/api/users/my-credits-log",method:"get",params:e})}function g(e){return(0,r.Ay)({url:"/api/users/my-referrals",method:"get",params:e})}function h(e){return(0,r.Ay)({url:"/api/users/set-credits",method:"post",data:e})}function v(e){return(0,r.Ay)({url:"/api/users/set-vip",method:"post",data:e})}function _(e){return(0,r.Ay)({url:"/api/users/system-strategies",method:"get",params:e})}function w(e){return(0,r.Ay)({url:"/api/users/admin-orders",method:"get",params:e})}function b(e){return(0,r.Ay)({url:"/api/users/admin-ai-stats",method:"get",params:e})}}}]);