File: /www/server/panel/BTPanel/static/js/useController24.js
import{u as e,R as f,e as y,_ as h,M as T}from"./utils-lib.js?v=1777008528";import{r as c}from"./base-lib.js?v=1777008528";import{b as v,e as x}from"./ai.js?v=1777008528";const P=t=>e.post("/mod/agent/com/get_models",{data:t,customType:"model"}),R=()=>e.post("/mod/agent/com/get_tool_list",{data:{type:"aics"},customType:"model"}),A=t=>e.post("/mod/agent/com/get_chat_historys",{data:t,customType:"model"}),E=t=>e.post("/mod/agent/com/get_chat",{data:t,customType:"model"}),S=t=>e.post("/mod/agent/com/del_chat",{data:t,check:"boolean",customType:"model"}),j=t=>e.post("/mod/agent/com/del_chat_msg",{data:t,check:"boolean",customType:"model"}),C=t=>e.post("/mod/agent/com/get_config",{data:t,check:"object",customType:"model"}),$=t=>e.post("/mod/agent/com/set_config",{data:t,check:"boolean",customType:"model"}),F=()=>e.post("/mod/agent/com/get_skill_list",{customType:"model"}),G=t=>e.post("/mod/agent/com/set_skill_status",{data:t,check:"boolean",customType:"model"}),H=()=>e.post("/mod/agent/com/get_tool_list",{customType:"model"}),O=t=>e.post("/mod/agent/com/set_tool_show_status",{data:t,check:"boolean",customType:"model"});c(!1);const w=c(!0),b=c(!0),k=c({remain:0,total:50,desc:"有效期1个月",expire:"",percentage:0}),M=c({remain:0,total:0,desc:"优先使用每日免费额度",percentage:0}),D=()=>{y({title:!1,area:[42,42],component:()=>h(()=>import("./creadit-dialog.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),compData:{title:"恭喜您获得:20次每日免费额度(15天)",confirmText:"我知道了"}})},Q=async()=>{const{data:t}=await C({type:""});if(b.value=!1,t.data&&t.data.daily_quota){const{used:o,total:a,common_packages:s,reset_time:n,gift:d,service_gift:r,expire_at:u}=t.data.daily_quota,l=Math.max(0,a-o),g=a>0?Math.round(l/a*100):0;k.value={remain:l,total:a,desc:a?"可用次数于"+n+"刷新":"",expire:a?"有效期至 ".concat(f(new Date(u).getTime(),"yyyy-MM-dd")):"已过期",percentage:g};const p=(s==null?void 0:s.used_count)||0,i=(s==null?void 0:s.total_count)||0,m=i-p,_=i>0?Math.round(m/i*100):0;M.value={remain:m,total:i,desc:a?"优先使用每日免费额度":"",percentage:_},d&&D(),w.value=!r}},U=async t=>{const{data:o}=await v(t);if(o.status&&o.data){const{items:a,pagination:s}=o.data;return{data:a.map(n=>({id:n.id,time:n.create_at,model:n.model,scenario:n.scenario,consume:n.consumed_count})),total:s.total}}return{data:[],total:0}},V=async t=>{const o=await x(t);o.data.status&&o.data.output_file?window.open("/download?filename=".concat(o.data.output_file),"_blank","noopener,noreferrer"):T.error(o.msg||"导出失败")},z=async(t,o)=>{o.value.p=1,o.value.limit=10,await Q()};export{M as a,A as b,E as c,k as d,S as e,Q as f,U as g,V as h,z as i,P as j,O as k,G as l,H as m,F as n,C as o,R as p,b as q,$ as r,w as s,D as t,j as u};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = []
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}