fogact 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/web-server.js +557 -141
- package/frontend/user/assets/AnnouncementDetail-Dvxmwz0A-fogact-live.js +12 -0
- package/frontend/user/assets/Announcements-CS1tF2mx-fogact-live.js +11 -0
- package/frontend/user/assets/CardBind-CsCxihhP-fogact-live.js +21 -0
- package/frontend/user/assets/CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl-fogact-live.js +1 -0
- package/frontend/user/assets/CardDescription.vue_vue_type_script_setup_true_lang-D-v5Pl7F-fogact-live.js +1 -0
- package/frontend/user/assets/CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5-fogact-live.js +1 -0
- package/frontend/user/assets/Dashboard-rPsmltm5-fogact-live.js +51 -0
- package/frontend/user/assets/DashboardLayout-DDkxHYFj-fogact-live.js +80 -0
- package/frontend/user/assets/Input.vue_vue_type_script_setup_true_lang-B0SyPmYb-fogact-live.js +6 -0
- package/frontend/user/assets/Label.vue_vue_type_script_setup_true_lang-CxYORSgN-fogact-live.js +1 -0
- package/frontend/user/assets/Progress.vue_vue_type_script_setup_true_lang-2_QbPsEQ-fogact-live.js +1 -0
- package/frontend/user/assets/QuotaPack-B_tJ7Psm-fogact-live.js +6 -0
- package/frontend/user/assets/Renewal-BSDhDmwv-fogact-live.js +6 -0
- package/frontend/user/assets/ScrollArea.vue_vue_type_script_setup_true_lang-DMYwcfpz-fogact-live.js +1 -0
- package/frontend/user/assets/Separator.vue_vue_type_script_setup_true_lang-Ckg8EXj_-fogact-live.js +1 -0
- package/frontend/user/assets/Settings-CBdAa3lw-fogact-live.js +11 -0
- package/frontend/user/assets/TooltipTrigger.vue_vue_type_script_setup_true_lang-DtSBjzGo-fogact-live.js +16 -0
- package/frontend/user/assets/Welcome-Dtfp6oER-fogact-live.js +1 -0
- package/frontend/user/assets/_plugin-vue_export-helper-5cjT4u0R-fogact-live.js +16 -0
- package/frontend/user/assets/activity-wYWtyqTJ-fogact-live.js +6 -0
- package/frontend/user/assets/announcement-35mOnjRL-fogact-live.js +16 -0
- package/frontend/user/assets/calendar-BFNuCata-fogact-live.js +6 -0
- package/frontend/user/assets/chevron-down-kDbuU1Py-fogact-live.js +6 -0
- package/frontend/user/assets/chevron-right-BayASIm0-fogact-live.js +6 -0
- package/frontend/user/assets/eye-CY62vip0-fogact-live.js +6 -0
- package/frontend/user/assets/gauge-C5NQ-mV8-fogact-live.js +6 -0
- package/frontend/user/assets/index-fogact-live.js +91 -0
- package/frontend/user/assets/link-2-DT5R5nGO-fogact-live.js +6 -0
- package/frontend/user/assets/package-rUbExUEn-fogact-live.js +6 -0
- package/frontend/user/assets/plus-CQc6C8wG-fogact-live.js +11 -0
- package/frontend/user/assets/refresh-cw-Y9hCloPL-fogact-live.js +6 -0
- package/frontend/user/assets/useUserPageRefresh-BYZvpNR9-fogact-live.js +1 -0
- package/frontend/user/assets/zap-l5zbZqrM-fogact-live.js +11 -0
- package/frontend/user/index.html +1 -1
- package/lib/index.js +53 -13
- package/lib/services/database.js +47 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{c as Vt,a1 as gn,b as hn,_ as Tn,J as It,ay as An,t as En}from"./index-fogact-live.js";import{a as J,_ as de}from"./CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl-fogact-live.js";import{a as Mt,_ as kt}from"./CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5-fogact-live.js";import{_ as Pt}from"./Separator.vue_vue_type_script_setup_true_lang-Ckg8EXj_-fogact-live.js";import{u as yn,M as Sn,P as bn,C as xn}from"./announcement-35mOnjRL-fogact-live.js";import{j as lt,x as le,y as W,D as Ce,u as m,E as x,A as p,F as Kt,B as vn,J as Rn,Q as X,r as _e,d as Je,w as Ut,L as wn,M as Ln,z as Qe,H as d,P as te,n as Ft}from"./chart-vendor-CULJE59K.js";import{_ as Dn}from"./ScrollArea.vue_vue_type_script_setup_true_lang-DMYwcfpz-fogact-live.js";import{a as On}from"./useUserPageRefresh-BYZvpNR9-fogact-live.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Cn=Vt("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Nn=Vt("HistoryIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/*! @license DOMPurify 3.3.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.2/LICENSE */const{entries:Zt,setPrototypeOf:Ht,isFrozen:In,getPrototypeOf:Mn,getOwnPropertyDescriptor:kn}=Object;let{freeze:C,seal:H,create:Ne}=Object,{apply:rt,construct:it}=typeof Reflect<"u"&&Reflect;C||(C=function(n){return n});H||(H=function(n){return n});rt||(rt=function(n,i){for(var s=arguments.length,l=new Array(s>2?s-2:0),_=2;_<s;_++)l[_-2]=arguments[_];return n.apply(i,l)});it||(it=function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];return new n(...s)});const De=N(Array.prototype.forEach),Pn=N(Array.prototype.lastIndexOf),zt=N(Array.prototype.pop),ge=N(Array.prototype.push),Un=N(Array.prototype.splice),Ie=N(String.prototype.toLowerCase),et=N(String.prototype.toString),tt=N(String.prototype.match),he=N(String.prototype.replace),Fn=N(String.prototype.indexOf),Hn=N(String.prototype.trim),F=N(Object.prototype.hasOwnProperty),O=N(RegExp.prototype.test),Te=zn(TypeError);function N(a){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),l=1;l<i;l++)s[l-1]=arguments[l];return rt(a,n,s)}}function zn(a){return function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return it(a,i)}}function u(a,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ie;Ht&&Ht(a,null);let s=n.length;for(;s--;){let l=n[s];if(typeof l=="string"){const _=i(l);_!==l&&(In(n)||(n[s]=_),l=_)}a[l]=!0}return a}function Bn(a){for(let n=0;n<a.length;n++)F(a,n)||(a[n]=null);return a}function G(a){const n=Ne(null);for(const[i,s]of Zt(a))F(a,i)&&(Array.isArray(s)?n[i]=Bn(s):s&&typeof s=="object"&&s.constructor===Object?n[i]=G(s):n[i]=s);return n}function Ae(a,n){for(;a!==null;){const s=kn(a,n);if(s){if(s.get)return N(s.get);if(typeof s.value=="function")return N(s.value)}a=Mn(a)}function i(){return null}return i}const Bt=C(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),nt=C(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ot=C(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Gn=C(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),at=C(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wn=C(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Gt=C(["#text"]),Wt=C(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),st=C(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$t=C(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Oe=C(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$n=H(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yn=H(/<%[\w\W]*|[\w\W]*%>/gm),jn=H(/\$\{[\w\W]*/gm),qn=H(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xn=H(/^aria-[\-\w]+$/),Jt=H(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vn=H(/^(?:\w+script|data):/i),Kn=H(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qt=H(/^html$/i),Zn=H(/^[a-z][.\w]*(-[.\w]+)+$/i);var Yt=Object.freeze({__proto__:null,ARIA_ATTR:Xn,ATTR_WHITESPACE:Kn,CUSTOM_ELEMENT:Zn,DATA_ATTR:qn,DOCTYPE_NAME:Qt,ERB_EXPR:Yn,IS_ALLOWED_URI:Jt,IS_SCRIPT_OR_DATA:Vn,MUSTACHE_EXPR:$n,TMPLIT_EXPR:jn});const Ee={element:1,text:3,progressingInstruction:7,comment:8,document:9},Jn=function(){return typeof window>"u"?null:window},Qn=function(n,i){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let s=null;const l="data-tt-policy-suffix";i&&i.hasAttribute(l)&&(s=i.getAttribute(l));const _="dompurify"+(s?"#"+s:"");try{return n.createPolicy(_,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+_+" could not be created."),null}},jt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function en(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jn();const n=r=>en(r);if(n.version="3.3.2",n.removed=[],!a||!a.document||a.document.nodeType!==Ee.document||!a.Element)return n.isSupported=!1,n;let{document:i}=a;const s=i,l=s.currentScript,{DocumentFragment:_,HTMLTemplateElement:h,Node:k,Element:w,NodeFilter:A,NamedNodeMap:P=a.NamedNodeMap||a.MozNamedAttrMap,HTMLFormElement:ce,DOMParser:ue,trustedTypes:$}=a,U=w.prototype,Me=Ae(U,"cloneNode"),ke=Ae(U,"remove"),Pe=Ae(U,"nextSibling"),Ue=Ae(U,"childNodes"),V=Ae(U,"parentNode");if(typeof h=="function"){const r=i.createElement("template");r.content&&r.content.ownerDocument&&(i=r.content.ownerDocument)}let f,c="";const{implementation:I,createNodeIterator:K,createDocumentFragment:y,getElementsByTagName:tn}=i,{importNode:nn}=s;let D=jt();n.isSupported=typeof Zt=="function"&&typeof V=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Fe,ERB_EXPR:He,TMPLIT_EXPR:ze,DATA_ATTR:on,ARIA_ATTR:an,IS_SCRIPT_OR_DATA:sn,ATTR_WHITESPACE:ct,CUSTOM_ELEMENT:rn}=Yt;let{IS_ALLOWED_URI:ut}=Yt,b=null;const ft=u({},[...Bt,...nt,...ot,...at,...Gt]);let v=null;const mt=u({},[...Wt,...st,...$t,...Oe]);let T=Object.seal(Ne(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,ye=null;const Z=Object.seal(Ne(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pt=!0,Be=!0,dt=!1,_t=!0,ne=!1,Se=!0,Q=!1,Ge=!1,We=!1,oe=!1,be=!1,xe=!1,gt=!0,ht=!1;const ln="user-content-";let $e=!0,me=!1,ae={},z=null;const Ye=u({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Tt=null;const At=u({},["audio","video","img","source","image","track"]);let je=null;const Et=u({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ve="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",Y="http://www.w3.org/1999/xhtml";let se=Y,qe=!1,Xe=null;const cn=u({},[ve,Re,Y],et);let we=u({},["mi","mo","mn","ms","mtext"]),Le=u({},["annotation-xml"]);const un=u({},["title","style","font","a","script"]);let pe=null;const fn=["application/xhtml+xml","text/html"],mn="text/html";let S=null,re=null;const pn=i.createElement("form"),yt=function(e){return e instanceof RegExp||e instanceof Function},Ve=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(re&&re===e)){if((!e||typeof e!="object")&&(e={}),e=G(e),pe=fn.indexOf(e.PARSER_MEDIA_TYPE)===-1?mn:e.PARSER_MEDIA_TYPE,S=pe==="application/xhtml+xml"?et:Ie,b=F(e,"ALLOWED_TAGS")?u({},e.ALLOWED_TAGS,S):ft,v=F(e,"ALLOWED_ATTR")?u({},e.ALLOWED_ATTR,S):mt,Xe=F(e,"ALLOWED_NAMESPACES")?u({},e.ALLOWED_NAMESPACES,et):cn,je=F(e,"ADD_URI_SAFE_ATTR")?u(G(Et),e.ADD_URI_SAFE_ATTR,S):Et,Tt=F(e,"ADD_DATA_URI_TAGS")?u(G(At),e.ADD_DATA_URI_TAGS,S):At,z=F(e,"FORBID_CONTENTS")?u({},e.FORBID_CONTENTS,S):Ye,fe=F(e,"FORBID_TAGS")?u({},e.FORBID_TAGS,S):G({}),ye=F(e,"FORBID_ATTR")?u({},e.FORBID_ATTR,S):G({}),ae=F(e,"USE_PROFILES")?e.USE_PROFILES:!1,pt=e.ALLOW_ARIA_ATTR!==!1,Be=e.ALLOW_DATA_ATTR!==!1,dt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,_t=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,Q=e.WHOLE_DOCUMENT||!1,oe=e.RETURN_DOM||!1,be=e.RETURN_DOM_FRAGMENT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,We=e.FORCE_BODY||!1,gt=e.SANITIZE_DOM!==!1,ht=e.SANITIZE_NAMED_PROPS||!1,$e=e.KEEP_CONTENT!==!1,me=e.IN_PLACE||!1,ut=e.ALLOWED_URI_REGEXP||Jt,se=e.NAMESPACE||Y,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,Le=e.HTML_INTEGRATION_POINTS||Le,T=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&yt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(T.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&yt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(T.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ne&&(Be=!1),be&&(oe=!0),ae&&(b=u({},Gt),v=Ne(null),ae.html===!0&&(u(b,Bt),u(v,Wt)),ae.svg===!0&&(u(b,nt),u(v,st),u(v,Oe)),ae.svgFilters===!0&&(u(b,ot),u(v,st),u(v,Oe)),ae.mathMl===!0&&(u(b,at),u(v,$t),u(v,Oe))),F(e,"ADD_TAGS")||(Z.tagCheck=null),F(e,"ADD_ATTR")||(Z.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?Z.tagCheck=e.ADD_TAGS:(b===ft&&(b=G(b)),u(b,e.ADD_TAGS,S))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?Z.attributeCheck=e.ADD_ATTR:(v===mt&&(v=G(v)),u(v,e.ADD_ATTR,S))),e.ADD_URI_SAFE_ATTR&&u(je,e.ADD_URI_SAFE_ATTR,S),e.FORBID_CONTENTS&&(z===Ye&&(z=G(z)),u(z,e.FORBID_CONTENTS,S)),e.ADD_FORBID_CONTENTS&&(z===Ye&&(z=G(z)),u(z,e.ADD_FORBID_CONTENTS,S)),$e&&(b["#text"]=!0),Q&&u(b,["html","head","body"]),b.table&&(u(b,["tbody"]),delete fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Te('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Te('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');f=e.TRUSTED_TYPES_POLICY,c=f.createHTML("")}else f===void 0&&(f=Qn($,l)),f!==null&&typeof c=="string"&&(c=f.createHTML(""));C&&C(e),re=e}},St=u({},[...nt,...ot,...Gn]),bt=u({},[...at,...Wn]),dn=function(e){let t=V(e);(!t||!t.tagName)&&(t={namespaceURI:se,tagName:"template"});const o=Ie(e.tagName),g=Ie(t.tagName);return Xe[e.namespaceURI]?e.namespaceURI===Re?t.namespaceURI===Y?o==="svg":t.namespaceURI===ve?o==="svg"&&(g==="annotation-xml"||we[g]):!!St[o]:e.namespaceURI===ve?t.namespaceURI===Y?o==="math":t.namespaceURI===Re?o==="math"&&Le[g]:!!bt[o]:e.namespaceURI===Y?t.namespaceURI===Re&&!Le[g]||t.namespaceURI===ve&&!we[g]?!1:!bt[o]&&(un[o]||!St[o]):!!(pe==="application/xhtml+xml"&&Xe[e.namespaceURI]):!1},B=function(e){ge(n.removed,{element:e});try{V(e).removeChild(e)}catch{ke(e)}},ee=function(e,t){try{ge(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{ge(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(oe||be)try{B(t)}catch{}else try{t.setAttribute(e,"")}catch{}},xt=function(e){let t=null,o=null;if(We)e="<remove></remove>"+e;else{const E=tt(e,/^[\r\n\t ]+/);o=E&&E[0]}pe==="application/xhtml+xml"&&se===Y&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const g=f?f.createHTML(e):e;if(se===Y)try{t=new ue().parseFromString(g,pe)}catch{}if(!t||!t.documentElement){t=I.createDocument(se,"template",null);try{t.documentElement.innerHTML=qe?c:g}catch{}}const L=t.body||t.documentElement;return e&&o&&L.insertBefore(i.createTextNode(o),L.childNodes[0]||null),se===Y?tn.call(t,Q?"html":"body")[0]:Q?t.documentElement:L},vt=function(e){return K.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT|A.SHOW_PROCESSING_INSTRUCTION|A.SHOW_CDATA_SECTION,null)},Ke=function(e){return e instanceof ce&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof P)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Rt=function(e){return typeof k=="function"&&e instanceof k};function j(r,e,t){De(r,o=>{o.call(n,e,t,re)})}const wt=function(e){let t=null;if(j(D.beforeSanitizeElements,e,null),Ke(e))return B(e),!0;const o=S(e.nodeName);if(j(D.uponSanitizeElement,e,{tagName:o,allowedTags:b}),Se&&e.hasChildNodes()&&!Rt(e.firstElementChild)&&O(/<[/\w!]/g,e.innerHTML)&&O(/<[/\w!]/g,e.textContent)||e.nodeType===Ee.progressingInstruction||Se&&e.nodeType===Ee.comment&&O(/<[/\w]/g,e.data))return B(e),!0;if(!(Z.tagCheck instanceof Function&&Z.tagCheck(o))&&(!b[o]||fe[o])){if(!fe[o]&&Dt(o)&&(T.tagNameCheck instanceof RegExp&&O(T.tagNameCheck,o)||T.tagNameCheck instanceof Function&&T.tagNameCheck(o)))return!1;if($e&&!z[o]){const g=V(e)||e.parentNode,L=Ue(e)||e.childNodes;if(L&&g){const E=L.length;for(let M=E-1;M>=0;--M){const q=Me(L[M],!0);q.__removalCount=(e.__removalCount||0)+1,g.insertBefore(q,Pe(e))}}}return B(e),!0}return e instanceof w&&!dn(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&O(/<\/no(script|embed|frames)/i,e.innerHTML)?(B(e),!0):(ne&&e.nodeType===Ee.text&&(t=e.textContent,De([Fe,He,ze],g=>{t=he(t,g," ")}),e.textContent!==t&&(ge(n.removed,{element:e.cloneNode()}),e.textContent=t)),j(D.afterSanitizeElements,e,null),!1)},Lt=function(e,t,o){if(ye[t]||gt&&(t==="id"||t==="name")&&(o in i||o in pn))return!1;if(!(Be&&!ye[t]&&O(on,t))){if(!(pt&&O(an,t))){if(!(Z.attributeCheck instanceof Function&&Z.attributeCheck(t,e))){if(!v[t]||ye[t]){if(!(Dt(e)&&(T.tagNameCheck instanceof RegExp&&O(T.tagNameCheck,e)||T.tagNameCheck instanceof Function&&T.tagNameCheck(e))&&(T.attributeNameCheck instanceof RegExp&&O(T.attributeNameCheck,t)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(t,e))||t==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&O(T.tagNameCheck,o)||T.tagNameCheck instanceof Function&&T.tagNameCheck(o))))return!1}else if(!je[t]){if(!O(ut,he(o,ct,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Fn(o,"data:")===0&&Tt[e])){if(!(dt&&!O(sn,he(o,ct,"")))){if(o)return!1}}}}}}}return!0},Dt=function(e){return e!=="annotation-xml"&&tt(e,rn)},Ot=function(e){j(D.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ke(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:v,forceKeepAttr:void 0};let g=t.length;for(;g--;){const L=t[g],{name:E,namespaceURI:M,value:q}=L,ie=S(E),Ze=q;let R=E==="value"?Ze:Hn(Ze);if(o.attrName=ie,o.attrValue=R,o.keepAttr=!0,o.forceKeepAttr=void 0,j(D.uponSanitizeAttribute,e,o),R=o.attrValue,ht&&(ie==="id"||ie==="name")&&(ee(E,e),R=ln+R),Se&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,R)){ee(E,e);continue}if(ie==="attributename"&&tt(R,"href")){ee(E,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){ee(E,e);continue}if(!_t&&O(/\/>/i,R)){ee(E,e);continue}ne&&De([Fe,He,ze],Nt=>{R=he(R,Nt," ")});const Ct=S(e.nodeName);if(!Lt(Ct,ie,R)){ee(E,e);continue}if(f&&typeof $=="object"&&typeof $.getAttributeType=="function"&&!M)switch($.getAttributeType(Ct,ie)){case"TrustedHTML":{R=f.createHTML(R);break}case"TrustedScriptURL":{R=f.createScriptURL(R);break}}if(R!==Ze)try{M?e.setAttributeNS(M,E,R):e.setAttribute(E,R),Ke(e)?B(e):zt(n.removed)}catch{ee(E,e)}}j(D.afterSanitizeAttributes,e,null)},_n=function r(e){let t=null;const o=vt(e);for(j(D.beforeSanitizeShadowDOM,e,null);t=o.nextNode();)j(D.uponSanitizeShadowNode,t,null),wt(t),Ot(t),t.content instanceof _&&r(t.content);j(D.afterSanitizeShadowDOM,e,null)};return n.sanitize=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,o=null,g=null,L=null;if(qe=!r,qe&&(r="<!-->"),typeof r!="string"&&!Rt(r))if(typeof r.toString=="function"){if(r=r.toString(),typeof r!="string")throw Te("dirty is not a string, aborting")}else throw Te("toString is not a function");if(!n.isSupported)return r;if(Ge||Ve(e),n.removed=[],typeof r=="string"&&(me=!1),me){if(r.nodeName){const q=S(r.nodeName);if(!b[q]||fe[q])throw Te("root node is forbidden and cannot be sanitized in-place")}}else if(r instanceof k)t=xt("<!---->"),o=t.ownerDocument.importNode(r,!0),o.nodeType===Ee.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?t=o:t.appendChild(o);else{if(!oe&&!ne&&!Q&&r.indexOf("<")===-1)return f&&xe?f.createHTML(r):r;if(t=xt(r),!t)return oe?null:xe?c:""}t&&We&&B(t.firstChild);const E=vt(me?r:t);for(;g=E.nextNode();)wt(g),Ot(g),g.content instanceof _&&_n(g.content);if(me)return r;if(oe){if(be)for(L=y.call(t.ownerDocument);t.firstChild;)L.appendChild(t.firstChild);else L=t;return(v.shadowroot||v.shadowrootmode)&&(L=nn.call(s,L,!0)),L}let M=Q?t.outerHTML:t.innerHTML;return Q&&b["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&O(Qt,t.ownerDocument.doctype.name)&&(M="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
12
|
+
`+M),ne&&De([Fe,He,ze],q=>{M=he(M,q," ")}),f&&xe?f.createHTML(M):M},n.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ve(r),Ge=!0},n.clearConfig=function(){re=null,Ge=!1},n.isValidAttribute=function(r,e,t){re||Ve({});const o=S(r),g=S(e);return Lt(o,g,t)},n.addHook=function(r,e){typeof e=="function"&&ge(D[r],e)},n.removeHook=function(r,e){if(e!==void 0){const t=Pn(D[r],e);return t===-1?void 0:Un(D[r],t,1)[0]}return zt(D[r])},n.removeHooks=function(r){D[r]=[]},n.removeAllHooks=function(){D=jt()},n}var eo=en();const qt=/^(#[0-9a-fA-F]{3,8}|rgb(a)?\([^)]{1,64}\)|hsl(a)?\([^)]{1,64}\)|var\(--[a-zA-Z0-9-_]+\))$/,to=/^(https?:|mailto:|tel:|\/|#)/i;function no(a){var s;const n=((s=a.getAttribute("href"))==null?void 0:s.trim())||"";if(!n||!to.test(n)){a.removeAttribute("href"),a.removeAttribute("target"),a.removeAttribute("rel");return}/^https?:/i.test(n)?(a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer nofollow")):(a.removeAttribute("target"),a.removeAttribute("rel"))}function oo(a){const n=a.style.color.trim(),i=a.style.backgroundColor.trim(),s=[];n&&qt.test(n)&&s.push(`color: ${n}`),i&&qt.test(i)&&s.push(`background-color: ${i}`),s.length>0?a.setAttribute("style",s.join("; ")):a.removeAttribute("style")}function ao(a){var w;const n=eo.sanitize(a||"",{USE_PROFILES:{html:!0},FORBID_TAGS:["script","style","iframe","object","embed"],ADD_ATTR:["target","rel","style","data-color","class"]});if(typeof window>"u"||typeof DOMParser>"u")return{html:n,plainText:"",headings:[],readingMinutes:1};const l=new DOMParser().parseFromString(`<div data-announcement-root="true">${n}</div>`,"text/html").body.querySelector('[data-announcement-root="true"]');if(!l)return{html:n,plainText:"",headings:[],readingMinutes:1};l.querySelectorAll("[style]").forEach(oo),l.querySelectorAll("a").forEach(no),l.querySelectorAll('[data-type="taskItem"] > label input[type="checkbox"]').forEach(A=>{A.disabled=!0,A.tabIndex=-1,A.setAttribute("aria-disabled","true")});const _=[];l.querySelectorAll("h1, h2, h3, h4").forEach((A,P)=>{var U;const ce=((U=A.textContent)==null?void 0:U.replace(/\s+/g," ").trim())||`章节 ${P+1}`,ue=Number(A.tagName.slice(1)),$=`announcement-heading-${P+1}`;A.id=$,A.dataset.announcementHeading="true",_.push({id:$,text:ce,level:ue})});const h=((w=l.textContent)==null?void 0:w.replace(/\s+/g," ").trim())||"",k=Math.max(1,Math.ceil(h.length/320));return{html:l.innerHTML,plainText:h,headings:_,readingMinutes:k}}const so=["innerHTML"],ro=lt({__name:"AnnouncementHtmlContent",props:{html:{}},setup(a){return(n,i)=>(W(),le("article",{class:"announcement-content",innerHTML:a.html},null,8,so))}}),io={class:"space-y-1.5"},lo=["onClick"],co={class:"line-clamp-2 block"},uo=lt({__name:"AnnouncementTocCard",props:{headings:{},activeId:{}},emits:["select"],setup(a,{emit:n}){const i=a,s=n;function l(h){switch(h){case 1:return"pl-3.5";case 2:return"pl-7";case 3:return"pl-10";default:return"pl-12"}}function _(h){return h===1?"font-medium":"font-normal"}return(h,k)=>(W(),Ce(m(Dn),{class:"max-h-[360px] pr-2"},{default:x(()=>[p("div",io,[(W(!0),le(Kt,null,vn(i.headings,w=>(W(),le("button",{key:w.id,type:"button",class:Rn(["block w-full rounded-md px-3.5 py-2.5 text-left text-sm leading-5 transition-colors duration-150",[l(w.level),_(w.level),i.activeId===w.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/35 hover:text-foreground"]]),onClick:A=>s("select",w.id)},[p("span",co,X(w.text),1)],10,lo))),128))])]),_:1}))}}),fo={class:"mx-auto flex w-full max-w-7xl flex-col gap-5"},mo={key:0,class:"space-y-4"},po={class:"grid gap-6 xl:grid-cols-[minmax(0,1fr)_280px]"},_o={class:"mt-2 text-sm text-muted-foreground"},go={class:"space-y-3"},ho={class:"flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border/50 bg-background/30 px-5 py-3.5 text-[11px] text-muted-foreground sm:px-6 sm:text-xs"},To={class:"inline-flex items-center gap-1"},Ao={class:"inline-flex items-center gap-1"},Eo={class:"space-y-3 px-5 py-5 sm:px-6 sm:py-6"},yo={class:"break-words text-xl font-semibold leading-tight tracking-tight text-foreground sm:text-2xl"},So={class:"break-words text-sm leading-6 text-muted-foreground"},bo={class:"grid gap-6 xl:grid-cols-[minmax(0,1fr)_280px] xl:items-start"},xo={class:"min-w-0"},vo={class:"space-y-4 self-start xl:sticky xl:top-24"},Ro={class:"overflow-hidden rounded-xl border border-border/60 bg-background/40"},wo={class:"flex items-center justify-between gap-4 px-4 py-3.5"},Lo={class:"text-sm font-semibold text-foreground"},Do={class:"flex items-center justify-between gap-4 px-4 py-3.5"},Oo={class:"text-sm font-semibold text-foreground"},Co={class:"flex items-start justify-between gap-4 px-4 py-3.5"},No={class:"text-right text-xs font-medium leading-5 text-foreground sm:text-sm"},Xt=140,Bo=lt({__name:"AnnouncementDetail",setup(a){const n=gn(),i=hn(),s=yn(),l=_e(null),_=_e(!1),h=_e(""),k=_e(""),w=_e(null);let A=0;s.hydrate();const P=Je(()=>{var f;return ao(((f=l.value)==null?void 0:f.content_html)||"")}),ce=Je(()=>P.value.readingMinutes),ue=Je(()=>P.value.headings.length>1);function $(){const f=w.value;return f?P.value.headings.map(c=>{const I=f.querySelector(`#${c.id}`);return I?{id:c.id,top:I.getBoundingClientRect().top+window.scrollY}:null}).filter(c=>c!==null):[]}function U(){if(P.value.headings.length===0){k.value="";return}const f=$();if(f.length===0){k.value="";return}const c=window.scrollY+Xt,I=f.reduce((K,y)=>y.top<=c?y.id:K,f[0].id);k.value=I}function Me(f){const c=w.value;if(!c)return;const I=c.querySelector(`#${f}`);if(!I)return;const K=I.getBoundingClientRect().top+window.scrollY-(Xt-20);window.scrollTo({top:Math.max(0,K),behavior:"smooth"}),k.value=f}async function ke(){var c,I,K;const f=++A;_.value=!0,h.value="";try{const y=await An.getById(n.params.id);if(f!==A)return;l.value=y,s.trackAnnouncements([y]),s.markAsRead(y.id,y),await Ft(),window.scrollTo({top:0,behavior:"auto"}),U()}catch(y){f===A&&(l.value=null,h.value=((I=(c=y==null?void 0:y.response)==null?void 0:c.data)==null?void 0:I.error)||(y==null?void 0:y.message)||"请稍后重试",((K=y==null?void 0:y.response)==null?void 0:K.status)!==404&&En.error("加载公告失败",h.value))}finally{f===A&&(_.value=!1)}}const{reload:Pe}=On(async()=>{await ke()},{resetBeforeLoad:()=>{_.value=!0,l.value=null,h.value="",k.value=""}});function Ue(){if(window.history.length>1){i.back();return}i.push({name:"announcements"})}function V(f){return new Date(f).toLocaleString("zh-CN",{hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}return Ut(()=>P.value.html,async()=>{await Ft(),U()}),Ut(()=>n.params.id,()=>{Pe("route-change")}),wn(()=>{window.addEventListener("scroll",U,{passive:!0})}),Ln(()=>{window.removeEventListener("scroll",U)}),(f,c)=>(W(),le("div",fo,[_.value&&!l.value?(W(),le("div",mo,[c[0]||(c[0]=p("div",{class:"h-8 w-32 rounded-md bg-muted/70 animate-pulse"},null,-1)),d(m(J),{class:"glass min-h-[180px] animate-pulse"}),p("div",po,[d(m(J),{class:"glass min-h-[60vh] animate-pulse"}),d(m(J),{class:"glass hidden min-h-[280px] animate-pulse xl:block"})])])):h.value?(W(),Ce(m(J),{key:1,class:"glass shadow-none"},{default:x(()=>[d(m(de),{class:"py-16 text-center"},{default:x(()=>[d(m(Sn),{class:"mx-auto mb-3 h-10 w-10 text-muted-foreground/50"}),c[1]||(c[1]=p("h2",{class:"text-base font-medium"},"公告不存在或已禁用",-1)),p("p",_o,X(h.value),1)]),_:1})]),_:1})):l.value?(W(),le(Kt,{key:2},[p("div",go,[d(m(Tn),{variant:"ghost",size:"sm",class:"-ml-1.5 h-8 w-fit px-1.5 text-muted-foreground hover:text-foreground",onClick:Ue},{default:x(()=>[d(m(Cn),{class:"mr-1 h-3.5 w-3.5"}),c[2]||(c[2]=te("返回公告列表 ",-1))]),_:1}),d(m(J),{class:"glass overflow-hidden shadow-none"},{default:x(()=>[d(m(de),{class:"p-0"},{default:x(()=>[p("div",ho,[d(m(It),{variant:"outline",class:"rounded-full border-primary/20 bg-primary/10 text-[11px] text-primary"},{default:x(()=>[...c[3]||(c[3]=[te(" 系统公告 ",-1)])]),_:1}),l.value.is_pinned?(W(),Ce(m(It),{key:0,variant:"outline",class:"rounded-full border-orange-500/30 bg-orange-500/10 text-[11px] font-medium text-orange-600"},{default:x(()=>[d(m(bn),{class:"h-3 w-3"}),c[4]||(c[4]=te("置顶 ",-1))]),_:1})):Qe("",!0),p("span",To,[d(m(xn),{class:"h-3.5 w-3.5"}),te(" "+X(V(l.value.published_at)),1)]),p("span",Ao,[d(m(Nn),{class:"h-3.5 w-3.5"}),te(" 更新于 "+X(V(l.value.updated_at)),1)])]),p("div",Eo,[p("h1",yo,X(l.value.title),1),p("p",So,X(l.value.intro||"暂无简介"),1)])]),_:1})]),_:1})]),p("div",bo,[p("div",xo,[d(m(J),{class:"glass shadow-none"},{default:x(()=>[d(m(de),{class:"p-5 sm:p-6"},{default:x(()=>[p("div",{ref_key:"contentScrollElement",ref:w,class:"pr-1 sm:pr-2"},[d(ro,{html:P.value.html},null,8,["html"])],512)]),_:1})]),_:1})]),p("div",vo,[ue.value?(W(),Ce(m(J),{key:0,class:"glass overflow-hidden shadow-none"},{default:x(()=>[d(m(Mt),{class:"pb-3"},{default:x(()=>[d(m(kt),{class:"text-sm sm:text-base"},{default:x(()=>[...c[5]||(c[5]=[te("章节定位",-1)])]),_:1})]),_:1}),d(m(de),{class:"pt-0"},{default:x(()=>[d(uo,{headings:P.value.headings,"active-id":k.value,onSelect:Me},null,8,["headings","active-id"])]),_:1})]),_:1})):Qe("",!0),d(m(J),{class:"glass overflow-hidden shadow-none"},{default:x(()=>[d(m(Mt),{class:"pb-3"},{default:x(()=>[d(m(kt),{class:"text-sm sm:text-base"},{default:x(()=>[...c[6]||(c[6]=[te("文章信息",-1)])]),_:1})]),_:1}),d(m(de),{class:"pt-0"},{default:x(()=>[p("div",Ro,[p("div",wo,[c[7]||(c[7]=p("p",{class:"text-xs font-medium text-muted-foreground"},"阅读时长",-1)),p("p",Lo,X(ce.value)+" 分钟",1)]),d(m(Pt),{class:"opacity-60"}),p("div",Do,[c[8]||(c[8]=p("p",{class:"text-xs font-medium text-muted-foreground"},"章节数",-1)),p("p",Oo,X(P.value.headings.length)+" 个章节",1)]),d(m(Pt),{class:"opacity-60"}),p("div",Co,[c[9]||(c[9]=p("p",{class:"pt-0.5 text-xs font-medium text-muted-foreground"},"最后更新",-1)),p("p",No,X(V(l.value.updated_at)),1)])])]),_:1})]),_:1})])])],64)):Qe("",!0)]))}});export{Bo as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as I,a0 as J,J as A,A as U,_ as H,ay as Q,t as G}from"./index-fogact-live.js";import{_ as y,a as w}from"./CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl-fogact-live.js";import{a as K,_ as O}from"./CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5-fogact-live.js";import{_ as W}from"./CardDescription.vue_vue_type_script_setup_true_lang-D-v5Pl7F-fogact-live.js";import{u as X,M as j,P as Y,C as Z}from"./announcement-35mOnjRL-fogact-live.js";import{a as ee}from"./useUserPageRefresh-BYZvpNR9-fogact-live.js";import{R as te}from"./refresh-cw-Y9hCloPL-fogact-live.js";import{j as se,r as f,d as ae,x as u,A as t,H as a,E as l,u as s,y as d,Q as c,P as m,z as k,F as $,B as T,D as C,J as oe}from"./chart-vendor-CULJE59K.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ne=I("BellRingIcon",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const re=I("Clock3Icon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]),le={class:"mx-auto flex w-full max-w-7xl flex-col gap-5"},de={class:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3"},ie={class:"flex items-start gap-4 sm:items-center"},ue={class:"min-w-0 flex-1"},ce={class:"mt-1.5 text-xl font-semibold text-foreground sm:text-2xl"},me={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-chart-1/10"},fe={class:"flex items-start gap-4 sm:items-center"},xe={class:"min-w-0 flex-1"},ge={class:"mt-1.5 text-xl font-semibold text-foreground sm:text-2xl"},_e={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-destructive/10"},pe={class:"flex items-start gap-4 sm:items-center"},be={class:"min-w-0 flex-1"},ve={class:"mt-1.5 text-sm font-semibold leading-6 text-foreground sm:text-base"},he={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-chart-2/10"},ye={key:0,class:"min-h-96 overflow-hidden rounded-xl border border-border/60 bg-background/40"},we={key:1,class:"flex min-h-96 flex-col items-center justify-center rounded-xl border border-dashed border-border/70 bg-background/40 py-14 text-center"},ke={class:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl border border-border/60 bg-background/80 text-destructive"},Ce={class:"mt-2 max-w-md text-sm leading-6 text-muted-foreground"},Ae={key:2,class:"flex min-h-96 flex-col items-center justify-center rounded-xl border border-dashed border-border/70 bg-background/40 py-14 text-center"},je={class:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl border border-border/60 bg-background/80 text-primary"},De={key:3,class:"overflow-hidden rounded-xl border border-border/60 bg-background/40"},Me={class:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-6"},Re={class:"min-w-0 flex-1 space-y-2"},Be={class:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground sm:text-xs"},Le={class:"inline-flex items-center gap-1 text-muted-foreground"},Se={class:"space-y-1.5"},$e={class:"break-words text-sm font-medium leading-6 text-foreground transition-colors group-hover:text-foreground sm:text-base"},Te={class:"break-words text-xs leading-6 text-muted-foreground sm:text-sm"},Ie={class:"hidden shrink-0 items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors group-hover:text-foreground sm:inline-flex"},Ne={key:4,class:"flex justify-center pt-5"},Pe={key:1},qe={key:2},Ke=se({__name:"Announcements",setup(Ve){const _=X(),i=f([]),p=f(!1),b=f(!1),v=f(""),x=f(!1),g=f("");let h=0;_.hydrate();function N(n,e){if(n.is_pinned!==e.is_pinned)return n.is_pinned?-1:1;const o=new Date(e.published_at).getTime()-new Date(n.published_at).getTime();return o!==0?o:e.id.localeCompare(n.id)}function P(n){return[...n].sort(N)}const q=ae(()=>{if(i.value.length===0)return"暂无公告";const n=i.value.reduce((e,o)=>e?new Date(o.published_at).getTime()>new Date(e).getTime()?o.published_at:e:o.published_at,"");return n?M(n):"暂无公告"});async function D(n=!1){var o,R,B,L;const e=++h;n?b.value=!0:p.value=!0;try{const r=await Q.getList({cursor:n?v.value:void 0,limit:10}),F=n?[...i.value,...r.items]:r.items,S=P(F);if(e!==h)return;_.trackAnnouncements(S),i.value=S,v.value=r.next_cursor||"",x.value=r.has_more,g.value=""}catch(r){e===h&&(g.value=((R=(o=r==null?void 0:r.response)==null?void 0:o.data)==null?void 0:R.error)||(r==null?void 0:r.message)||"请稍后重试",G.error("加载公告失败",((L=(B=r==null?void 0:r.response)==null?void 0:B.data)==null?void 0:L.error)||(r==null?void 0:r.message)||"请稍后重试"))}finally{e===h&&(p.value=!1,b.value=!1)}}ee(async()=>{await D(!1)},{resetBeforeLoad:()=>{p.value=!0,i.value=[],v.value="",x.value=!1,g.value=""}});async function V(){!x.value||!v.value||await D(!0)}function M(n){return new Date(n).toLocaleString("zh-CN",{hour12:!1})}function z(n){return!_.isAnnouncementRead(n)}function E(n){return"hover:bg-muted/35"}return(n,e)=>(d(),u("div",le,[t("div",de,[a(s(w),{class:"glass shadow-none"},{default:l(()=>[a(s(y),{class:"p-5"},{default:l(()=>[t("div",ie,[t("div",ue,[e[0]||(e[0]=t("p",{class:"text-xs font-medium text-muted-foreground"},"已发布公告",-1)),t("h3",ce,c(i.value.length),1)]),t("div",me,[a(s(j),{class:"h-5 w-5 text-chart-1"})])])]),_:1})]),_:1}),a(s(w),{class:"glass shadow-none"},{default:l(()=>[a(s(y),{class:"p-5"},{default:l(()=>[t("div",fe,[t("div",xe,[e[1]||(e[1]=t("p",{class:"text-xs font-medium text-muted-foreground"},"未读公告",-1)),t("h3",ge,c(s(_).unreadCount),1)]),t("div",_e,[a(s(ne),{class:"h-5 w-5 text-destructive"})])])]),_:1})]),_:1}),a(s(w),{class:"glass shadow-none sm:col-span-2 xl:col-span-1"},{default:l(()=>[a(s(y),{class:"p-5"},{default:l(()=>[t("div",pe,[t("div",be,[e[2]||(e[2]=t("p",{class:"text-xs font-medium text-muted-foreground"},"最新发布时间",-1)),t("h3",ve,c(q.value),1)]),t("div",he,[a(s(re),{class:"h-5 w-5 text-chart-2"})])])]),_:1})]),_:1})]),a(s(w),{class:"glass shadow-none"},{default:l(()=>[a(s(K),{class:"pb-4"},{default:l(()=>[a(s(O),{class:"text-base sm:text-lg"},{default:l(()=>[...e[3]||(e[3]=[m("公告列表",-1)])]),_:1}),a(s(W),{class:"text-xs sm:text-sm"},{default:l(()=>[...e[4]||(e[4]=[m("置顶公告优先展示,其余公告按发布时间倒序排列",-1)])]),_:1})]),_:1}),a(s(y),null,{default:l(()=>[p.value&&i.value.length===0?(d(),u("div",ye,[(d(),u($,null,T(3,o=>t("div",{key:o,class:"animate-pulse space-y-3 border-b border-border/60 px-4 py-4 last:border-b-0 sm:px-5"},[...e[5]||(e[5]=[t("div",{class:"flex items-center gap-2"},[t("div",{class:"h-5 w-16 rounded-full bg-muted"}),t("div",{class:"h-3 w-28 rounded-full bg-muted"})],-1),t("div",{class:"h-4 w-2/5 rounded bg-muted"},null,-1),t("div",{class:"h-3 w-full rounded bg-muted"},null,-1),t("div",{class:"h-3 w-3/4 rounded bg-muted"},null,-1)])])),64))])):g.value&&i.value.length===0?(d(),u("div",we,[t("div",ke,[a(s(j),{class:"h-5 w-5"})]),e[6]||(e[6]=t("h2",{class:"text-base font-semibold"},"公告加载失败",-1)),t("p",Ce,c(g.value),1)])):i.value.length===0?(d(),u("div",Ae,[t("div",je,[a(s(j),{class:"h-5 w-5"})]),e[7]||(e[7]=t("h2",{class:"text-base font-semibold"},"暂时还没有公告",-1)),e[8]||(e[8]=t("p",{class:"mt-2 max-w-md text-sm leading-6 text-muted-foreground"}," 当前没有已发布的公告内容,稍后再来看看吧。 ",-1))])):(d(),u("div",De,[(d(!0),u($,null,T(i.value,o=>(d(),C(s(J),{key:o.id,to:{name:"announcement-detail",params:{id:o.id}},class:oe(["group block border-b border-border/60 px-4 py-4 transition-colors last:border-b-0 sm:px-5",E(o)])},{default:l(()=>[t("div",Me,[t("div",Re,[t("div",Be,[a(s(A),{variant:"outline",class:"rounded-full border-primary/20 bg-primary/10 text-[11px] text-primary"},{default:l(()=>[...e[9]||(e[9]=[m(" 系统公告 ",-1)])]),_:1}),o.is_pinned?(d(),C(s(A),{key:0,variant:"outline",class:"rounded-full border-orange-500/30 bg-orange-500/10 text-[11px] font-medium text-orange-600"},{default:l(()=>[a(s(Y),{class:"h-3 w-3"}),e[10]||(e[10]=m("置顶 ",-1))]),_:1})):k("",!0),z(o.id)?(d(),C(s(A),{key:1,variant:"outline",class:"rounded-full border-destructive/20 bg-destructive/10 text-[11px] text-destructive"},{default:l(()=>[...e[11]||(e[11]=[m(" 未读 ",-1)])]),_:1})):k("",!0),t("span",Le,[a(s(Z),{class:"h-3.5 w-3.5"}),m(" "+c(M(o.published_at)),1)])]),t("div",Se,[t("h2",$e,c(o.title),1),t("p",Te,c(o.intro||"暂无简介"),1)])]),t("div",Ie,[e[12]||(e[12]=m(" 查看详情 ",-1)),a(s(U),{class:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})])])]),_:2},1032,["to","class"]))),128))])),i.value.length>0?(d(),u("div",Ne,[a(s(H),{variant:"outline",disabled:!x.value||b.value,onClick:V},{default:l(()=>[b.value?(d(),C(s(te),{key:0,class:"mr-2 h-4 w-4 animate-spin"})):k("",!0),x.value?(d(),u("span",Pe,"加载更多")):(d(),u("span",qe,"没有更多公告了"))]),_:1},8,["disabled"])])):k("",!0)]),_:1})]),_:1})]))}});export{Ke as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{j as Xe,r as _,d as h,x,A as t,D as v,H as n,u as a,E as i,F as se,z as g,P as u,Q as d,y as r,I as Fe,J as P,B as ge,Z as Ge}from"./chart-vendor-CULJE59K.js";import{c as Z,u as Je,aq as Qe,L as K,ac as H,_ as k,aa as Oe,ar as _e,ag as ye,aj as he,J as q,$ as ke,ai as we,as as We,C as Ce,E as $e,G as qe,H as je,M as Ie,N as Ee,X as M,W as ae,a2 as Ze,at as X,t as w}from"./index-fogact-live.js";import{_ as D,a as S}from"./CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl-fogact-live.js";import{_ as Ye,E as et}from"./Input.vue_vue_type_script_setup_true_lang-B0SyPmYb-fogact-live.js";import{_ as le}from"./Progress.vue_vue_type_script_setup_true_lang-2_QbPsEQ-fogact-live.js";import{_ as tt}from"./Separator.vue_vue_type_script_setup_true_lang-Ckg8EXj_-fogact-live.js";import{a as st}from"./useUserPageRefresh-BYZvpNR9-fogact-live.js";import{L as Pe,P as Ke}from"./plus-CQc6C8wG-fogact-live.js";import{A as at}from"./activity-wYWtyqTJ-fogact-live.js";import{C as lt}from"./calendar-BFNuCata-fogact-live.js";import{L as ne}from"./link-2-DT5R5nGO-fogact-live.js";import{E as nt}from"./eye-CY62vip0-fogact-live.js";import{C as ot}from"./chevron-right-BayASIm0-fogact-live.js";import{C as it}from"./chevron-down-kDbuU1Py-fogact-live.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const rt=Z("ArrowDownIcon",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const dt=Z("ArrowUpIcon",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
12
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const ut=Z("ListIcon",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
17
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const De=Z("UnlinkIcon",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),ct={class:"max-w-7xl mx-auto space-y-6"},mt={key:0,class:"flex items-center justify-center py-20"},ft={class:"mx-auto max-w-md text-center space-y-4"},vt={class:"w-14 h-14 rounded-2xl bg-red-500/10 flex items-center justify-center mx-auto"},pt={class:"space-y-2"},xt={class:"text-sm text-muted-foreground"},bt={key:0,class:"rounded-lg border border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-500/5 p-4"},gt={class:"flex gap-3"},_t={class:"shrink-0 mt-0.5"},yt={class:"text-sm"},ht={class:"font-medium text-blue-800 dark:text-blue-400"},kt={class:"font-mono"},wt={key:1,class:"rounded-lg border border-red-200 dark:border-red-500/20 bg-red-50 dark:bg-red-500/5 p-4"},Ct={class:"flex gap-3"},$t={class:"shrink-0 mt-0.5"},qt={key:2,class:"rounded-lg border border-amber-200 dark:border-amber-500/20 bg-amber-50 dark:bg-amber-500/5 p-4"},jt={class:"flex gap-3"},It={class:"shrink-0 mt-0.5"},Et={class:"flex items-center gap-2 text-base font-semibold"},Pt={class:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center"},Kt={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},Dt={class:"rounded-xl border border-border/60 bg-muted/20 p-4"},St={class:"flex items-center justify-between mb-2"},Ut={class:"relative flex items-center justify-center"},Bt={class:"w-10 h-10 -rotate-90"},Mt={class:"absolute text-[9px] font-bold text-primary"},At={class:"text-lg font-bold tabular-nums"},zt={class:"text-xs text-muted-foreground mt-0.5"},Vt={class:"rounded-xl border border-border/60 bg-muted/20 p-4"},Lt={class:"flex items-center justify-between mb-2"},Nt={class:"w-10 h-10 rounded-lg bg-emerald-500/10 flex items-center justify-center"},Rt={class:"text-lg font-bold tabular-nums"},Tt={class:"text-sm text-muted-foreground font-normal"},Ht={class:"rounded-xl border border-border/60 bg-muted/20 p-4"},Xt={class:"flex items-center justify-between mb-2"},Ft={class:"w-10 h-10 rounded-lg bg-amber-500/10 flex items-center justify-center"},Gt={class:"text-lg font-bold tabular-nums"},Jt={class:"text-xs text-muted-foreground mt-0.5"},Qt={class:"rounded-xl border border-border/60 bg-muted/20 p-4"},Ot={class:"flex items-center justify-between mb-2"},Wt={class:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center"},Zt={class:"text-lg font-bold tabular-nums"},Yt={class:"text-xs text-muted-foreground mt-0.5"},es={class:"space-y-2"},ts={class:"flex items-center justify-between text-sm"},ss={class:"font-semibold tabular-nums"},as={class:"flex items-center gap-2 text-base font-semibold"},ls={class:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center"},ns={class:"relative"},os={class:"rounded-xl border border-border/60 bg-muted/20 p-4"},is={class:"flex items-start gap-3"},rs={class:"flex-1 min-w-0"},ds={class:"flex items-center gap-2 flex-wrap"},us={class:"font-mono text-sm font-medium"},cs={class:"mt-2 flex items-center gap-2 flex-wrap"},ms={class:"truncate"},fs={class:"border-t border-border/30 mt-2 pt-2 space-y-1.5"},vs={class:"flex items-center justify-between gap-2 text-xs"},ps={class:"text-muted-foreground"},xs={class:"flex items-center gap-3"},bs={class:"flex-1"},gs={class:"text-xs font-medium tabular-nums text-muted-foreground"},_s={key:0},ys={class:"flex items-start gap-3"},hs={class:"w-7 h-7 rounded-full bg-muted flex items-center justify-center text-xs font-bold text-muted-foreground shrink-0 mt-0.5"},ks={class:"flex-1 min-w-0"},ws={class:"flex items-center justify-between gap-2"},Cs={class:"flex items-center gap-2 flex-wrap min-w-0"},$s={class:"font-mono text-sm"},qs={class:"flex items-center shrink-0"},js={class:"flex items-center gap-0.5"},Is={class:"mt-2 flex items-center gap-2 flex-wrap"},Es={class:"truncate"},Ps={key:0,class:"border-t border-border/30 mt-2 pt-2"},Ks={key:1,class:"border-t border-border/30 mt-2 pt-2 space-y-1.5"},Ds={class:"flex items-center justify-between gap-2 text-xs"},Ss={class:"text-muted-foreground"},Us={class:"flex items-center gap-3"},Bs={class:"flex-1"},Ms={class:"text-xs font-medium tabular-nums text-muted-foreground"},As={key:1,class:"text-xs text-muted-foreground flex items-center gap-1.5 mt-3 ml-10"},zs={class:"text-center"},Vs={class:"w-14 h-14 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-3"},Ls={class:"flex items-center gap-2 text-base font-semibold"},Ns={class:"w-8 h-8 rounded-lg bg-blue-500/10 flex items-center justify-center"},Rs={class:"rounded-xl border border-blue-200/60 dark:border-blue-500/20 bg-blue-50/50 dark:bg-blue-500/5 p-4"},Ts={class:"font-mono text-base font-semibold"},Hs={key:0,class:"mt-2 text-xs leading-5 text-amber-700 dark:text-amber-300"},Xs={class:"flex items-center justify-between gap-3 rounded-xl border border-border/60 bg-background/70 p-4"},Fs={class:"flex items-center gap-2 text-base font-semibold"},Gs={class:"w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center"},Js={class:"flex gap-2"},Qs={class:"relative flex-1"},Os={key:0,class:"space-y-3"},Ws={class:"text-sm font-medium text-muted-foreground"},Zs={class:"flex flex-wrap gap-2"},Ys={class:"font-mono text-xs"},ea=["onClick"],ta={class:"font-mono font-medium"},sa={class:"font-mono font-medium"},Se=10,ga=Xe({__name:"CardBind",setup(aa){const F=Je(),C=_(null),A=_(!1),z=_(null),V=_(""),G=_(!1),y=_([]),U=_(!1),B=_(!1),j=_(!1),I=_(!1),L=_(!1),J=_(null),Y=_(""),N=_(!1),Q=_(!1),$=h(()=>F.apiKeyInfo),ee=h(()=>{var s;return((s=C.value)==null?void 0:s.role)||"independent"}),p=h(()=>{var s;return((s=C.value)==null?void 0:s.chain)||[]}),te=h(()=>{var s;return((s=C.value)==null?void 0:s.primary_key_preview)||""}),Ue=h(()=>{var s;return!!((s=C.value)!=null&&s.orphaned_primary)}),oe=h(()=>!!z.value&&!C.value),ie=h(()=>ee.value==="independent"),R=h(()=>ee.value==="primary"),re=h(()=>ee.value==="child"),E=h(()=>R.value?p.value.slice(1):[]),de=h(()=>y.value.length<Se),Be=h(()=>{var s,e;return!oe.value&&(ie.value||R.value)&&((s=$.value)==null?void 0:s.status)!=="disabled"&&((e=$.value)==null?void 0:e.status)!=="expired"}),b=h(()=>{var s;return!R.value||p.value.length===0?null:Qe(p.value,((s=$.value)==null?void 0:s.billing_type)||"quota")});function ue(s){return s==="active"?"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-300":s==="disabled"?"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300":"border-border bg-muted text-muted-foreground"}function ce(s){return s.status_label?s.status_label:{active:"正常",disabled:"已禁用"}[s.status]||s.status}function me(s){var c;const e=s.billing_type||((c=$.value)==null?void 0:c.billing_type)||"";if(e==="duration"){const m=s.daily_remaining??0,l=s.daily_quota||0;let o=`今日剩余 ${M(m)} / ${M(l)} 每日`;const f=ae(s.quota_pack_expires_at)&&s.quota_pack_remaining||0;return f>0&&(o+=` · 配额包 ${M(f)}`),o}if(e==="quota"){const m=s.remaining_quota??0,l=s.total_quota??0;let o=`剩余 ${M(m)} / ${M(l)}`;const f=ae(s.quota_pack_expires_at)&&s.quota_pack_remaining||0;return f>0&&(o+=` · 配额包 ${M(f)}`),o}if(e==="count"){const m=s.remaining_requests??s.remaining_count??0,l=s.max_requests??0;let o=`剩余 ${m} / ${l} 次`;const f=ae(s.requests_pack_expires_at)&&s.requests_pack_remaining||0;return f>0&&(o+=` · 请求包 ${f} 次`),o}return"-"}function O(s){if(s.total_quota!==void 0&&s.total_quota>0){const e=s.remaining_quota||0;return Math.round((s.total_quota-e)/s.total_quota*100)}if(s.max_requests!==void 0&&s.max_requests>0){const e=s.remaining_requests??s.remaining_count??0;return Math.round((s.max_requests-e)/s.max_requests*100)}if(s.daily_quota!==void 0&&s.daily_quota>0){const e=s.daily_remaining??0;return Math.round((s.daily_quota-e)/s.daily_quota*100)}return 0}function fe(s){if(s.expires_at){const e=ye(s.expires_at);return e==="已过期"?"已过期":`${he(s.expires_at,"yyyy-MM-dd")} 到期 (${e})`}return s.validity_days&&s.validity_days>0?`${s.validity_days} 天(激活后计算)`:"永久有效"}function ve(s){if(!s.expires_at)return!1;const e=new Date(s.expires_at).getTime()-Date.now();return e>0&&e<7*86400*1e3}function pe(s){return s.status_label==="未激活"||!s.activated&&s.status!=="active"}function W(s){return Ze(s.service_type||"",s.sub_service_type_name)}async function Me({isLatest:s}){var e,c,m,l;A.value=!0;try{const o=await X.getBindInfo();if(!s())return;z.value=null,C.value=o}catch(o){if(s()){const f=((c=(e=o==null?void 0:o.response)==null?void 0:e.data)==null?void 0:c.message)||((l=(m=o==null?void 0:o.response)==null?void 0:m.data)==null?void 0:l.error)||(o==null?void 0:o.message)||"获取绑定信息失败";z.value=f,w.error("加载失败",f)}}finally{s()&&(A.value=!1)}}const{reload:T}=st(Me,{resetBeforeLoad:s=>{A.value=!0,(s==="initial"||s==="active-key-change"||s==="manual-refresh")&&(C.value=null),z.value=null}});function xe(){const s=V.value.trim();if(!s)return;if(y.value.includes(s)){w.warning("该卡已在列表中");return}const e=F.activeKey;if(e&&e.key===s){w.error("不能绑定自己");return}if(!de.value){w.warning(`单次最多绑定 ${Se} 张卡`);return}y.value.push(s),V.value=""}function Ae(s){y.value.splice(s,1)}async function ze(){var s,e,c,m;if(y.value.length!==0){U.value=!0;try{const l=await X.cardBind(y.value);w.success("绑定成功",l.message||`成功绑定 ${y.value.length} 张卡`),y.value=[],await F.fetchInfo(),await T("bind-mutation")}catch(l){const o=((e=(s=l==null?void 0:l.response)==null?void 0:s.data)==null?void 0:e.message)||((m=(c=l==null?void 0:l.response)==null?void 0:c.data)==null?void 0:m.error)||(l==null?void 0:l.message)||"绑定失败";w.error("绑定失败",o)}finally{U.value=!1}}}function Ve(s){J.value=s.id,Y.value=s.key_preview,L.value=!0}async function Le(){var s,e,c,m;if(J.value){B.value=!0;try{const l=await X.cardUnbind([J.value]);w.success("解绑成功",l.message||"已成功解绑"),L.value=!1,J.value=null,Y.value="",await T("unbind-mutation")}catch(l){const o=((e=(s=l==null?void 0:l.response)==null?void 0:s.data)==null?void 0:e.message)||((m=(c=l==null?void 0:l.response)==null?void 0:c.data)==null?void 0:m.error)||(l==null?void 0:l.message)||"解绑失败";w.error("解绑失败",o)}finally{B.value=!1}}}async function Ne(){var s,e,c,m;I.value=!0;try{const l=await X.cardUnbindSelf();w.success("解绑成功",l.message||"已从主卡解绑"),N.value=!1,await F.fetchInfo(),await T("unbind-self-mutation")}catch(l){const o=((e=(s=l==null?void 0:l.response)==null?void 0:s.data)==null?void 0:e.message)||((m=(c=l==null?void 0:l.response)==null?void 0:c.data)==null?void 0:m.error)||(l==null?void 0:l.message)||"解绑失败";w.error("解绑失败",o)}finally{I.value=!1}}async function Re(s){if(s<=0||j.value)return;const e=[...E.value],c=e[s];e[s]=e[s-1],e[s-1]=c,await be(e)}async function Te(s){if(s>=E.value.length-1||j.value)return;const e=[...E.value],c=e[s];e[s]=e[s+1],e[s+1]=c,await be(e)}async function be(s){var e,c,m,l;j.value=!0;try{const o=s.map(f=>f.id);await X.cardBindReorder(o),await T("reorder-mutation")}catch(o){const f=((c=(e=o==null?void 0:o.response)==null?void 0:e.data)==null?void 0:c.message)||((l=(m=o==null?void 0:o.response)==null?void 0:m.data)==null?void 0:l.error)||(o==null?void 0:o.message)||"排序失败";w.error("排序失败",f)}finally{j.value=!1}}function He(s){return s.length<=8?s:s.substring(0,6)+"****"+s.substring(s.length-4)}return(s,e)=>{var c,m;return r(),x("div",ct,[e[55]||(e[55]=t("div",{class:"space-y-1"},[t("h1",{class:"text-2xl font-semibold tracking-tight"},"叠卡"),t("p",{class:"text-sm text-muted-foreground"}," 管理 API Key 绑定关系,查看聚合资源池 ")],-1)),A.value&&!C.value?(r(),x("div",mt,[n(a(K),{class:"h-6 w-6 animate-spin text-muted-foreground"})])):oe.value?(r(),v(a(S),{key:1,class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:i(()=>[n(a(D),{class:"p-8"},{default:i(()=>[t("div",ft,[t("div",vt,[n(a(H),{class:"h-7 w-7 text-red-500"})]),t("div",pt,[e[9]||(e[9]=t("h3",{class:"text-base font-semibold"},"绑定信息加载失败",-1)),t("p",xt,d(z.value),1),e[10]||(e[10]=t("p",{class:"text-xs text-muted-foreground"}," 当前无法确认这张卡的真实绑定状态,已暂时隐藏绑定入口,请稍后重试。 ",-1))]),n(a(k),{variant:"outline",onClick:e[0]||(e[0]=l=>a(T)("manual-refresh"))},{default:i(()=>[A.value?(r(),v(a(K),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):g("",!0),e[11]||(e[11]=u(" 重新加载 ",-1))]),_:1})])]),_:1})]),_:1})):(r(),x(se,{key:2},[re.value?(r(),x("div",bt,[t("div",gt,[t("div",_t,[n(a(Oe),{class:"h-5 w-5 text-blue-500"})]),t("div",yt,[t("p",ht,[e[12]||(e[12]=u(" 此卡已绑定到主卡 ",-1)),t("span",kt,d(te.value),1),e[13]||(e[13]=u(",通过主卡消耗额度 ",-1))]),e[14]||(e[14]=t("p",{class:"mt-1 text-blue-700/80 dark:text-blue-400/70"}," 子卡不能独立消耗额度,所有请求将通过主卡的消耗链进行扣费。 ",-1))])])])):g("",!0),((c=$.value)==null?void 0:c.status)==="disabled"?(r(),x("div",wt,[t("div",Ct,[t("div",$t,[n(a(H),{class:"h-5 w-5 text-red-500"})]),e[15]||(e[15]=t("div",{class:"text-sm"},[t("p",{class:"font-medium text-red-800 dark:text-red-400"}," 当前 Key 已被禁用 "),t("p",{class:"mt-1 text-red-700/80 dark:text-red-400/70"}," 已禁用的 Key 无法进行绑定操作。 ")],-1))])])):((m=$.value)==null?void 0:m.status)==="expired"?(r(),x("div",qt,[t("div",jt,[t("div",It,[n(a(H),{class:"h-5 w-5 text-amber-500"})]),e[16]||(e[16]=t("div",{class:"text-sm"},[t("p",{class:"font-medium text-amber-800 dark:text-amber-400"}," 当前 Key 已过期 "),t("p",{class:"mt-1 text-amber-700/80 dark:text-amber-400/70"}," 已过期的 Key 无法进行绑定操作。 ")],-1))])])):g("",!0),R.value&&b.value?(r(),v(a(S),{key:3,class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:i(()=>[n(a(D),{class:"p-6 space-y-5"},{default:i(()=>{var l,o;return[t("div",Et,[t("div",Pt,[n(a(Pe),{class:"h-4 w-4 text-primary"})]),e[17]||(e[17]=u(" 聚合资源概览 ",-1))]),t("div",Kt,[t("div",Dt,[t("div",St,[e[19]||(e[19]=t("p",{class:"text-xs text-muted-foreground font-medium"},"总额度",-1)),t("div",Ut,[(r(),x("svg",Bt,[e[18]||(e[18]=t("circle",{cx:"20",cy:"20",r:"16",stroke:"currentColor","stroke-width":"3",fill:"none",class:"text-primary/15"},null,-1)),t("circle",{cx:"20",cy:"20",r:"16",stroke:"currentColor","stroke-width":"3",fill:"none","stroke-linecap":"round",class:"text-primary",style:Fe({strokeDasharray:`${b.value.usagePercent*1.005} 100.5`,transition:"stroke-dasharray 600ms ease"})},null,4)])),t("span",Mt,d(b.value.usagePercent)+"%",1)])]),t("p",At,d(a(_e)(b.value.totalRemaining,((l=$.value)==null?void 0:l.billing_type)||"")),1),t("p",zt," / "+d(a(_e)(b.value.totalCapacity,((o=$.value)==null?void 0:o.billing_type)||"")),1)]),t("div",Vt,[t("div",Lt,[e[20]||(e[20]=t("p",{class:"text-xs text-muted-foreground font-medium"}," 活跃卡数 ",-1)),t("div",Nt,[n(a(at),{class:"h-4 w-4 text-emerald-500"})])]),t("p",Rt,[u(d(b.value.activeCount),1),t("span",Tt," / "+d(b.value.totalCount)+" 张",1)]),e[21]||(e[21]=t("p",{class:"text-xs text-muted-foreground mt-0.5"},"活跃 / 总数",-1))]),t("div",Ht,[t("div",Xt,[e[22]||(e[22]=t("p",{class:"text-xs text-muted-foreground font-medium"}," 最远到期 ",-1)),t("div",Ft,[n(a(lt),{class:"h-4 w-4 text-amber-500"})])]),t("p",Gt,d(b.value.latestExpiry?a(ye)(b.value.latestExpiry):b.value.latestValidityDays?`${b.value.latestValidityDays}天`:"永久"),1),t("p",Jt,d(b.value.latestExpiry?a(he)(b.value.latestExpiry,"yyyy-MM-dd HH:mm:ss"):b.value.latestValidityDays?"激活后计算":"无过期时间"),1)]),t("div",Qt,[t("div",Ot,[e[23]||(e[23]=t("p",{class:"text-xs text-muted-foreground font-medium"},"消耗链",-1)),t("div",Wt,[n(a(ut),{class:"h-4 w-4 text-blue-500"})])]),t("p",Zt,[u(d(p.value.length),1),e[24]||(e[24]=t("span",{class:"text-sm text-muted-foreground font-normal"}," 张卡",-1))]),t("p",Yt," 1 主卡 + "+d(E.value.length)+" 子卡 ",1)])]),t("div",es,[t("div",ts,[e[25]||(e[25]=t("span",{class:"text-muted-foreground"},"使用率",-1)),t("span",ss,d(b.value.usagePercent)+"%",1)]),n(a(le),{"model-value":b.value.usagePercent,class:"h-2"},null,8,["model-value"])])]}),_:1})]),_:1})):g("",!0),R.value&&p.value.length>0?(r(),v(a(S),{key:4,class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:i(()=>[n(a(D),{class:"p-6 space-y-4"},{default:i(()=>[t("div",null,[t("div",as,[t("div",ls,[n(a(ne),{class:"h-4 w-4 text-primary"})]),e[26]||(e[26]=u(" 消耗链 ",-1))]),e[27]||(e[27]=t("p",{class:"text-sm text-muted-foreground mt-1 ml-10"}," 请求按此顺序依次消耗各卡额度 ",-1))]),t("div",ns,[t("div",os,[t("div",is,[e[29]||(e[29]=t("div",{class:"w-7 h-7 rounded-full bg-muted flex items-center justify-center text-xs font-bold text-muted-foreground shrink-0 mt-0.5"}," 1 ",-1)),t("div",rs,[t("div",ds,[t("span",us,d(p.value[0].key_preview),1),n(a(q),{variant:"outline",class:"text-[10px] px-1.5 py-0 h-[18px]"},{default:i(()=>[...e[28]||(e[28]=[u(" 主卡 ",-1)])]),_:1}),n(a(q),{variant:"outline",class:P(["text-[10px] px-1.5 py-0 h-[18px]",ue(p.value[0].status)])},{default:i(()=>[u(d(ce(p.value[0])),1)]),_:1},8,["class"])]),t("div",cs,[n(a(q),{variant:"outline",class:P(["max-w-full text-[10px] px-1.5 py-0 h-[18px]",a(ke)(p.value[0].service_type||"").badge]),title:W(p.value[0])},{default:i(()=>[t("span",ms,d(W(p.value[0])),1)]),_:1},8,["class","title"]),n(a(q),{variant:"outline",class:"text-[10px] px-1.5 py-0 h-[18px]"},{default:i(()=>[u(d(a(we)(p.value[0].billing_type||"")),1)]),_:1})]),t("div",fs,[t("div",vs,[t("span",ps,d(me(p.value[0])),1),t("span",{class:P(ve(p.value[0])?"text-red-500":"text-muted-foreground")},d(fe(p.value[0])),3)]),t("div",xs,[t("div",bs,[n(a(le),{"model-value":O(p.value[0]),class:"h-1.5"},null,8,["model-value"])]),t("span",gs,d(O(p.value[0]))+"%",1)])])])])]),E.value.length>0?(r(),x("div",_s,[(r(!0),x(se,null,ge(E.value,(l,o)=>(r(),x("div",{key:l.id},[e[32]||(e[32]=t("div",{class:"border-l-2 border-dashed border-primary/30 h-3 ml-4"},null,-1)),t("div",{class:P(["rounded-xl border p-4 transition-colors",pe(l)?"border-dashed border-border/50 bg-muted/10":"border-border/60 bg-muted/20 hover:bg-muted/30"])},[t("div",ys,[t("div",hs,d(o+2),1),t("div",ks,[t("div",ws,[t("div",Cs,[t("span",$s,d(l.key_preview),1),n(a(q),{variant:"outline",class:"text-[10px] px-1.5 py-0 h-[18px]"},{default:i(()=>[...e[30]||(e[30]=[u(" 子卡 ",-1)])]),_:1}),n(a(q),{variant:"outline",class:P(["text-[10px] px-1.5 py-0 h-[18px]",ue(l.status)])},{default:i(()=>[u(d(ce(l)),1)]),_:2},1032,["class"])]),t("div",qs,[t("div",js,[n(a(k),{variant:"ghost",size:"icon",class:"h-7 w-7",disabled:o===0||j.value,onClick:f=>Re(o),title:"上移"},{default:i(()=>[n(a(dt),{class:"h-3.5 w-3.5"})]),_:1},8,["disabled","onClick"]),n(a(k),{variant:"ghost",size:"icon",class:"h-7 w-7",disabled:o===E.value.length-1||j.value,onClick:f=>Te(o),title:"下移"},{default:i(()=>[n(a(rt),{class:"h-3.5 w-3.5"})]),_:1},8,["disabled","onClick"])]),n(a(tt),{orientation:"vertical",class:"mx-1.5 h-4"}),n(a(k),{variant:"ghost",size:"icon",class:"h-7 w-7 text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-500/10",disabled:B.value,onClick:f=>Ve(l),title:"解绑"},{default:i(()=>[n(a(De),{class:"h-3.5 w-3.5"})]),_:1},8,["disabled","onClick"])])]),t("div",Is,[n(a(q),{variant:"outline",class:P(["max-w-full text-[10px] px-1.5 py-0 h-[18px]",a(ke)(l.service_type||"").badge]),title:W(l)},{default:i(()=>[t("span",Es,d(W(l)),1)]),_:2},1032,["class","title"]),n(a(q),{variant:"outline",class:"text-[10px] px-1.5 py-0 h-[18px]"},{default:i(()=>[u(d(a(we)(l.billing_type||"")),1)]),_:2},1024)]),pe(l)?(r(),x("div",Ps,[...e[31]||(e[31]=[t("p",{class:"text-xs text-muted-foreground"}," 排到时自动激活,开始计算有效期 ",-1)])])):(r(),x("div",Ks,[t("div",Ds,[t("span",Ss,d(me(l)),1),t("span",{class:P(ve(l)?"text-red-500":"text-muted-foreground")},d(fe(l)),3)]),t("div",Us,[t("div",Bs,[n(a(le),{"model-value":O(l),class:"h-1.5"},null,8,["model-value"])]),t("span",Ms,d(O(l))+"%",1)])]))])])],2)]))),128))])):g("",!0),j.value?(r(),x("p",As,[n(a(K),{class:"h-3.5 w-3.5 animate-spin"}),e[33]||(e[33]=u(" 正在更新排序... ",-1))])):g("",!0)])]),_:1})]),_:1})):g("",!0),ie.value?(r(),v(a(S),{key:5,class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:i(()=>[n(a(D),{class:"p-8"},{default:i(()=>[t("div",zs,[t("div",Vs,[n(a(Pe),{class:"h-7 w-7 text-primary/60"})]),e[34]||(e[34]=t("h3",{class:"text-base font-semibold"},"独立卡模式",-1)),e[35]||(e[35]=t("p",{class:"text-sm text-muted-foreground mt-1"}," 尚未绑定任何卡片,在下方添加子卡建立消耗链 ",-1))])]),_:1})]),_:1})):g("",!0),re.value?(r(),v(a(S),{key:6,class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:i(()=>[n(a(D),{class:"p-6 space-y-4"},{default:i(()=>[t("div",Ls,[t("div",Ns,[n(a(ne),{class:"h-4 w-4 text-blue-500"})]),e[36]||(e[36]=u(" 绑定信息 ",-1))]),t("div",Rs,[e[37]||(e[37]=t("p",{class:"text-sm text-muted-foreground mb-1"},"绑定的主卡",-1)),t("p",Ts,d(te.value),1),Ue.value?(r(),x("p",Hs," 主卡记录已不存在,请手动点击下方“解除绑定”清理当前绑定关系。 ")):g("",!0)]),t("div",Xs,[e[39]||(e[39]=t("div",{class:"space-y-1"},[t("p",{class:"text-sm font-medium text-foreground"},"解除绑定"),t("p",{class:"text-xs leading-5 text-muted-foreground"}," 解除后此卡将恢复为独立卡,可单独使用和管理。 ")],-1)),n(a(k),{variant:"secondary",size:"sm",class:"shrink-0",disabled:I.value,onClick:e[1]||(e[1]=l=>N.value=!0)},{default:i(()=>[I.value?(r(),v(a(K),{key:0,class:"h-4 w-4 animate-spin"})):(r(),v(a(De),{key:1,class:"h-4 w-4"})),e[38]||(e[38]=u(" 解除绑定 ",-1))]),_:1},8,["disabled"])])]),_:1})]),_:1})):g("",!0),Be.value?(r(),v(a(S),{key:7,class:"border-border/60 bg-card/80 backdrop-blur-xl"},{default:i(()=>[n(a(D),{class:"p-6 space-y-4"},{default:i(()=>[t("div",null,[t("div",Fs,[t("div",Gs,[n(a(Ke),{class:"h-4 w-4 text-emerald-500"})]),e[40]||(e[40]=u(" 绑定新卡 ",-1))]),e[41]||(e[41]=t("p",{class:"text-sm text-muted-foreground mt-1 ml-10"}," 输入子卡 API Key 进行绑定,子卡必须与主卡的服务类型、子服务类型和计费方式一致,且未绑定 ",-1))]),t("div",Js,[t("div",Qs,[n(a(Ye),{modelValue:V.value,"onUpdate:modelValue":e[2]||(e[2]=l=>V.value=l),type:G.value?"text":"password",placeholder:"请输入子卡 API Key",autocomplete:"off",spellcheck:"false",class:"pr-9 font-mono text-sm",disabled:U.value,onKeydown:Ge(xe,["enter"])},null,8,["modelValue","type","disabled"]),t("button",{type:"button",class:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",onClick:e[3]||(e[3]=l=>G.value=!G.value)},[G.value?(r(),v(a(nt),{key:0,class:"h-4 w-4"})):(r(),v(a(et),{key:1,class:"h-4 w-4"}))])]),n(a(k),{disabled:!V.value.trim()||!de.value||U.value,onClick:xe},{default:i(()=>[n(a(Ke),{class:"h-4 w-4 mr-1"}),e[42]||(e[42]=u(" 添加 ",-1))]),_:1},8,["disabled"])]),y.value.length>0?(r(),x("div",Os,[t("p",Ws," 待绑定("+d(y.value.length)+" 张) ",1),t("div",Zs,[(r(!0),x(se,null,ge(y.value,(l,o)=>(r(),x("div",{key:o,class:"inline-flex items-center gap-1.5 rounded-full border border-border/60 bg-muted/30 px-3 py-1 text-sm"},[t("span",Ys,d(He(l)),1),t("button",{type:"button",class:"text-muted-foreground hover:text-red-500 transition-colors",onClick:f=>Ae(o)},[n(a(We),{class:"h-3 w-3"})],8,ea)]))),128))])])):g("",!0),y.value.length>0?(r(),v(a(k),{key:1,class:"w-full",disabled:U.value,onClick:ze},{default:i(()=>[U.value?(r(),v(a(K),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):(r(),v(a(ne),{key:1,class:"h-4 w-4 mr-2"})),u(" 绑定 "+d(y.value.length)+" 张卡 ",1)]),_:1},8,["disabled"])):g("",!0)]),_:1})]),_:1})):g("",!0),t("button",{type:"button",class:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",onClick:e[4]||(e[4]=l=>Q.value=!Q.value)},[Q.value?(r(),v(a(it),{key:1,class:"h-4 w-4"})):(r(),v(a(ot),{key:0,class:"h-4 w-4"})),e[43]||(e[43]=u(" 绑定规则说明 ",-1))]),Q.value?(r(),v(a(S),{key:8,class:"border-border/40"},{default:i(()=>[n(a(D),{class:"p-5"},{default:i(()=>[...e[44]||(e[44]=[t("ul",{class:"space-y-2 text-sm text-muted-foreground"},[t("li",null,"1. 子卡必须与主卡类型(服务类型、子服务类型、计费方式)一致"),t("li",null,"2. 子卡不能是已绑定或已过期的卡"),t("li",null,'3. 绑定后子卡状态变为"已绑定",不再独立消耗额度'),t("li",null,"4. 消耗链按顺序使用,主卡额度耗尽后自动使用下一张子卡")],-1)])]),_:1})]),_:1})):g("",!0)],64)),n(a(Ee),{open:L.value,"onUpdate:open":e[6]||(e[6]=l=>L.value=l)},{default:i(()=>[n(a(Ce),{class:"sm:max-w-md"},{default:i(()=>[n(a($e),null,{default:i(()=>[n(a(qe),{class:"flex items-center gap-2"},{default:i(()=>[n(a(H),{class:"h-5 w-5 text-amber-500"}),e[45]||(e[45]=u(" 确认解绑 ",-1))]),_:1}),n(a(je),null,{default:i(()=>[e[46]||(e[46]=u(" 确定要解绑子卡 ",-1)),t("span",ta,d(Y.value),1),e[47]||(e[47]=u(" 吗?解绑后该卡将恢复为独立卡。 ",-1))]),_:1})]),_:1}),n(a(Ie),{class:"gap-2 sm:gap-3"},{default:i(()=>[n(a(k),{variant:"outline",disabled:B.value,onClick:e[5]||(e[5]=l=>L.value=!1)},{default:i(()=>[...e[48]||(e[48]=[u("取消",-1)])]),_:1},8,["disabled"]),n(a(k),{variant:"destructive",disabled:B.value,onClick:Le},{default:i(()=>[B.value?(r(),v(a(K),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):g("",!0),e[49]||(e[49]=u(" 确认解绑 ",-1))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]),n(a(Ee),{open:N.value,"onUpdate:open":e[8]||(e[8]=l=>N.value=l)},{default:i(()=>[n(a(Ce),{class:"sm:max-w-md"},{default:i(()=>[n(a($e),null,{default:i(()=>[n(a(qe),{class:"flex items-center gap-2"},{default:i(()=>[n(a(H),{class:"h-5 w-5 text-amber-500"}),e[50]||(e[50]=u(" 确认解绑 ",-1))]),_:1}),n(a(je),null,{default:i(()=>[e[51]||(e[51]=u(" 确定要从主卡 ",-1)),t("span",sa,d(te.value),1),e[52]||(e[52]=u(" 解绑吗?解绑后此卡将恢复为独立卡。 ",-1))]),_:1})]),_:1}),n(a(Ie),{class:"gap-2 sm:gap-3"},{default:i(()=>[n(a(k),{variant:"outline",disabled:I.value,onClick:e[7]||(e[7]=l=>N.value=!1)},{default:i(()=>[...e[53]||(e[53]=[u("取消",-1)])]),_:1},8,["disabled"]),n(a(k),{variant:"destructive",disabled:I.value,onClick:Ne},{default:i(()=>[I.value?(r(),v(a(K),{key:0,class:"h-4 w-4 mr-2 animate-spin"})):g("",!0),e[54]||(e[54]=u(" 确认解绑 ",-1))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])])}}});export{ga as default};
|
package/frontend/user/assets/CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl-fogact-live.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as o}from"./index-fogact-live.js";import{j as n,d as c,x as d,y as l,G as p,C as u,u as _}from"./chart-vendor-CULJE59K.js";const g=n({__name:"Card",props:{class:{}},setup(a){const e=a,t=c(()=>{const{class:s,...r}=e;return r});return(s,r)=>(l(),d("div",u(t.value,{class:_(o)("rounded-xl border border-border/50 bg-card text-card-foreground",e.class)}),[p(s.$slots,"default")],16))}}),i=n({__name:"CardContent",props:{class:{}},setup(a){const e=a,t=c(()=>{const{class:s,...r}=e;return r});return(s,r)=>(l(),d("div",u(t.value,{class:_(o)("p-6 pt-0",e.class)}),[p(s.$slots,"default")],16))}});export{i as _,g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as a}from"./index-fogact-live.js";import{j as n,d as c,x as p,y as l,C as d,u as m,G as u}from"./chart-vendor-CULJE59K.js";const i=n({__name:"CardDescription",props:{class:{}},setup(o){const e=o,r=c(()=>{const{class:s,...t}=e;return t});return(s,t)=>(l(),p("p",d(r.value,{class:m(a)("text-sm text-muted-foreground",e.class)}),[u(s.$slots,"default")],16))}});export{i as _};
|
package/frontend/user/assets/CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5-fogact-live.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as r}from"./index-fogact-live.js";import{j as n,d as c,x as l,y as p,G as d,C as u,u as m}from"./chart-vendor-CULJE59K.js";const i=n({__name:"CardHeader",props:{class:{}},setup(t){const e=t,o=c(()=>{const{class:s,...a}=e;return a});return(s,a)=>(p(),l("div",u(o.value,{class:m(r)("flex flex-col space-y-1.5 p-6",e.class)}),[d(s.$slots,"default")],16))}}),g=n({__name:"CardTitle",props:{class:{}},setup(t){const e=t,o=c(()=>{const{class:s,...a}=e;return a});return(s,a)=>(p(),l("h3",u(o.value,{class:m(r)("font-semibold leading-none tracking-tight",e.class)}),[d(s.$slots,"default")],16))}});export{g as _,i as a};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import{c as le,O as st,a6 as at,Q as He,a7 as ot,a8 as lt,a9 as nt,a as rt,aa as ve,L as Te,J as xe,X,ab as Qe,ac as Ie,Z as it,ad as ut,ae as fe,u as dt,af as ct,ag as mt,W as Ce,ah as pt,_ as ft,a2 as Ke,$ as vt,a4 as xt,V as gt,a3 as ht,ai as _t,aj as Se}from"./index-fogact-live.js";import{j as ae,D as H,y as c,E as u,G as Le,C as Be,u as t,d as l,aw as ye,ax as ze,ay as Oe,az as We,aA as Ge,aB as Ve,aC as be,aD as Me,aE as Ye,H as o,A as e,P as A,I as Z,Q as i,x as y,z as E,aF as Ze,aG as yt,aH as bt,aI as Xe,r as ne,w as Je,aJ as et,F as re,B as _e,J as F,N as kt,aK as wt,aL as $t}from"./chart-vendor-CULJE59K.js";import{_ as W,a as G}from"./CardContent.vue_vue_type_script_setup_true_lang-D2L-uqSl-fogact-live.js";import{_ as ke,a as we}from"./CardTitle.vue_vue_type_script_setup_true_lang-a0CCN6D5-fogact-live.js";import{_ as Ae,d as Re,e as De,f as Pe,C as je,S as qt,g as Ct}from"./TooltipTrigger.vue_vue_type_script_setup_true_lang-DtSBjzGo-fogact-live.js";import{A as Tt}from"./activity-wYWtyqTJ-fogact-live.js";import{G as Mt}from"./gauge-C5NQ-mV8-fogact-live.js";import{_ as It}from"./Progress.vue_vue_type_script_setup_true_lang-2_QbPsEQ-fogact-live.js";import{P as St}from"./package-rUbExUEn-fogact-live.js";import{S as At,Z as Rt}from"./zap-l5zbZqrM-fogact-live.js";import{a as Dt}from"./useUserPageRefresh-BYZvpNR9-fogact-live.js";import{R as Fe}from"./refresh-cw-Y9hCloPL-fogact-live.js";import{C as Pt}from"./calendar-BFNuCata-fogact-live.js";import{E as jt}from"./eye-CY62vip0-fogact-live.js";/**
|
|
2
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ht=le("ArrowRightLeftIcon",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
|
|
7
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Lt=le("ChartColumnIcon",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
12
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Bt=le("ChartLineIcon",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
|
|
17
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const zt=le("DollarSignIcon",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
22
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Ot=le("HourglassIcon",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
|
|
27
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const tt=le("InboxIcon",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
32
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Vt=le("MessageCircleQuestionIcon",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
37
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Nt=le("MessageSquareIcon",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
42
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Et=le("TrendingUpIcon",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
47
|
+
* @license lucide-vue-next v0.468.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Kt=le("WifiOffIcon",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Ft=ae({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:modelValue"],setup(d,{emit:a}){const g=d,v=a,C=st(g,"class"),k=at(C,v);return(w,n)=>(c(),H(t(ot),Be(t(k),{class:t(He)("",g.class)}),{default:u(()=>[Le(w.$slots,"default")]),_:3},16,["class"]))}}),Ut=ae({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(d){const a=d;return(g,v)=>(c(),H(t(lt),Be(a,{class:t(He)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a.class)}),{default:u(()=>[Le(g.$slots,"default")]),_:3},16,["class"]))}}),Qt=ae({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(d){const a=d;return(g,v)=>(c(),H(t(nt),Be(a,{class:t(He)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a.class)}),{default:u(()=>[Le(g.$slots,"default")]),_:3},16,["class"]))}}),Wt=["hsl(221, 83%, 53%)","hsl(142, 76%, 36%)","hsl(38, 92%, 50%)","hsl(280, 65%, 60%)","hsl(350, 89%, 60%)","hsl(188, 85%, 45%)","hsl(239, 84%, 67%)","hsl(168, 76%, 42%)"],Gt=["hsl(217, 91%, 60%)","hsl(142, 70%, 45%)","hsl(38, 92%, 55%)","hsl(280, 65%, 65%)","hsl(350, 89%, 60%)","hsl(188, 85%, 50%)","hsl(239, 84%, 67%)","hsl(168, 76%, 42%)"];function $e(){const d=rt(),a=l(()=>{const I=d.isDark;return{tooltipBg:I?"#27272a":"#ffffff",tooltipTitle:I?"#fafafa":"#09090b",tooltipBody:I?"#d4d4d8":"#52525b",tooltipBorder:I?"#3f3f46":"#e4e4e7",grid:I?"#27272a":"#e4e4e7",ticks:I?"#a1a1aa":"#71717a"}}),g=l(()=>({backgroundColor:a.value.tooltipBg,titleColor:a.value.tooltipTitle,bodyColor:a.value.tooltipBody,borderColor:a.value.tooltipBorder,borderWidth:1,padding:12,cornerRadius:8})),v=l(()=>({border:{display:!1},grid:{display:!1},ticks:{color:a.value.ticks,font:{size:11}}})),C=l(()=>({beginAtZero:!0,border:{display:!1},grid:{color:a.value.grid},ticks:{color:a.value.ticks,font:{size:11}}})),k=l(()=>d.isDark),w=l(()=>k.value?Gt:Wt);function n(I){return w.value[I%w.value.length]}function T(I,z=.1){return n(I).replace("hsl(","hsla(").replace(")",`, ${z})`)}return{colors:a,tooltipOptions:g,xScaleOptions:v,yScaleOptions:C,isDark:k,palette:w,getColor:n,getFillColor:T,chartAnimation:{duration:200,easing:"easeOutQuart"}}}function P(d){const a=Number(d);return!Number.isFinite(a)||a<=0?0:a}function Ne(d,a){const g=a==="24h";return d.map(v=>{if(g){const n=v.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2})/);return n?`${Number(n[4])}:00`:v}const C=v.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(C)return`${Number(C[2])}/${Number(C[3])}`;const w=v.split("T")[0].match(/^(\d{4})-(\d{2})-(\d{2})$/);return w?`${Number(w[2])}/${Number(w[3])}`:v})}const Yt={class:"flex flex-wrap justify-between items-center gap-2"},Zt={class:"flex items-center gap-2"},Xt={class:"flex flex-wrap gap-3 text-xs"},Jt={class:"flex items-center gap-1.5"},es={class:"text-muted-foreground"},ts={class:"font-medium text-foreground"},ss={class:"flex items-center gap-1.5"},as={class:"text-muted-foreground"},os={class:"font-medium text-foreground"},ls={class:"flex items-center gap-1.5"},ns={class:"text-muted-foreground"},rs={class:"font-medium text-foreground"},is={class:"flex items-center gap-1.5"},us={class:"text-muted-foreground"},ds={class:"font-medium text-foreground"},cs={class:"h-56"},ms={key:0,class:"flex items-center justify-center h-full"},ps={key:1,class:"flex flex-col items-center justify-center h-full text-muted-foreground"},fs=ae({__name:"TokenTrend",props:{data:{},period:{},loading:{type:Boolean}},setup(d){ye.register(ze,Oe,We,Ge,Ve,be,Me,Ye);const a=d,{tooltipOptions:g,xScaleOptions:v,yScaleOptions:C,getColor:k,getFillColor:w,chartAnimation:n}=$e(),T=l(()=>a.data.some(p=>P(p.input_tokens)>0||P(p.output_tokens)>0||P(p.cache_read_tokens)>0||P(p.cache_create_tokens)>0)),b=l(()=>({labels:Ne(a.data.map(m=>m.date),a.period),datasets:[{label:"输入",data:a.data.map(m=>P(m.input_tokens)),borderColor:k(0),backgroundColor:w(0),fill:!0,tension:.4,borderWidth:2,pointRadius:0,pointHoverRadius:4},{label:"输出",data:a.data.map(m=>P(m.output_tokens)),borderColor:k(1),backgroundColor:w(1),fill:!0,tension:.4,borderWidth:2,pointRadius:0,pointHoverRadius:4},{label:"缓存读取",data:a.data.map(m=>P(m.cache_read_tokens)),borderColor:k(2),backgroundColor:w(2),fill:!0,tension:.4,borderWidth:2,pointRadius:0,pointHoverRadius:4},{label:"缓存创建",data:a.data.map(m=>P(m.cache_create_tokens)),borderColor:k(3),backgroundColor:w(3),fill:!0,tension:.4,borderWidth:2,pointRadius:0,pointHoverRadius:4}]})),I=l(()=>({responsive:!0,maintainAspectRatio:!1,animation:n,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{...g.value,callbacks:{label:p=>{const m=P(p.raw);return`${p.dataset.label}: ${m.toLocaleString()}`}}}},scales:{x:v.value,y:{...C.value,ticks:{...C.value.ticks,callback:p=>p>=1e6?`${(p/1e6).toFixed(1)}M`:p>=1e3?`${(p/1e3).toFixed(1)}K`:p}}}})),z=l(()=>a.data.reduce((p,m)=>p+P(m.input_tokens),0)),$=l(()=>a.data.reduce((p,m)=>p+P(m.output_tokens),0)),S=l(()=>a.data.reduce((p,m)=>p+P(m.cache_read_tokens),0)),x=l(()=>a.data.reduce((p,m)=>p+P(m.cache_create_tokens),0));function _(p){return p>=1e6?`${(p/1e6).toFixed(1)}M`:p>=1e3?`${(p/1e3).toFixed(1)}K`:p.toString()}return(p,m)=>(c(),H(t(G),{class:"h-full"},{default:u(()=>[o(t(we),{class:"pb-2"},{default:u(()=>[e("div",Yt,[e("div",Zt,[o(t(Et),{class:"h-5 w-5 text-muted-foreground"}),o(t(ke),{class:"text-base"},{default:u(()=>[...m[0]||(m[0]=[A("Token 使用趋势",-1)])]),_:1}),o(t(Ae),null,{default:u(()=>[o(t(Re),null,{default:u(()=>[o(t(De),null,{default:u(()=>[o(t(ve),{class:"h-4 w-4 text-muted-foreground"})]),_:1}),o(t(Pe),{side:"right",class:"max-w-xs"},{default:u(()=>[...m[1]||(m[1]=[e("p",{class:"text-xs"},[e("strong",null,"输入:"),A(" 发送给 AI 的 token 数"),e("br"),e("strong",null,"输出:"),A(" AI 生成的 token 数"),e("br"),e("strong",null,"缓存读取:"),A(" 从缓存读取的 token 数(节省成本)"),e("br"),e("strong",null,"缓存创建:"),A(" 创建缓存使用的 token 数 ")],-1)])]),_:1})]),_:1})]),_:1})]),e("div",Xt,[e("div",Jt,[e("span",{class:"w-2.5 h-2.5 rounded-full",style:Z({background:t(k)(0)})},null,4),e("span",es,[m[2]||(m[2]=A("输入: ",-1)),e("span",ts,i(_(z.value)),1)])]),e("div",ss,[e("span",{class:"w-2.5 h-2.5 rounded-full",style:Z({background:t(k)(1)})},null,4),e("span",as,[m[3]||(m[3]=A("输出: ",-1)),e("span",os,i(_($.value)),1)])]),e("div",ls,[e("span",{class:"w-2.5 h-2.5 rounded-full",style:Z({background:t(k)(2)})},null,4),e("span",ns,[m[4]||(m[4]=A("缓存读: ",-1)),e("span",rs,i(_(S.value)),1)])]),e("div",is,[e("span",{class:"w-2.5 h-2.5 rounded-full",style:Z({background:t(k)(3)})},null,4),e("span",us,[m[5]||(m[5]=A("缓存创: ",-1)),e("span",ds,i(_(x.value)),1)])])])])]),_:1}),o(t(W),null,{default:u(()=>[e("div",cs,[d.loading?(c(),y("div",ms,[o(t(Te),{class:"h-8 w-8 animate-spin text-primary"})])):T.value?T.value?(c(),H(t(Ze),{key:2,data:b.value,options:I.value},null,8,["data","options"])):E("",!0):(c(),y("div",ps,[...m[6]||(m[6]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-12 w-12 mb-2 opacity-50",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})],-1),e("p",{class:"text-sm"},"暂无数据",-1),e("p",{class:"text-xs mt-1"},"该时间段内没有使用记录",-1)])]))])]),_:1})]),_:1}))}}),vs={class:"flex flex-wrap justify-between items-center gap-2"},xs={class:"flex items-center gap-2"},gs={class:"flex flex-col sm:flex-row sm:items-center flex-wrap gap-2 sm:gap-6 text-xs sm:text-sm"},hs={class:"flex items-center gap-2"},_s={class:"text-muted-foreground"},ys={class:"font-medium text-foreground tabular-nums"},bs={class:"text-muted-foreground"},ks={class:"font-medium text-foreground tabular-nums"},ws={class:"h-44"},$s={key:0,class:"flex items-center justify-center h-full"},qs={key:1,class:"flex flex-col items-center justify-center h-full text-muted-foreground"},Cs=ae({__name:"RequestBar",props:{data:{},period:{},loading:{type:Boolean}},setup(d){ye.register(ze,Oe,yt,Ve,be,Me);const a=d,{tooltipOptions:g,xScaleOptions:v,yScaleOptions:C,getColor:k,chartAnimation:w}=$e(),n=l(()=>a.period==="24h"),T=l(()=>({labels:Ne(a.data.map(x=>x.date),a.period),datasets:[{label:"请求次数",data:a.data.map(x=>P(x.requests)),backgroundColor:k(0),borderRadius:6,maxBarThickness:32}]})),b=l(()=>({responsive:!0,maintainAspectRatio:!1,animation:w,plugins:{legend:{display:!1},tooltip:{...g.value,callbacks:{label:S=>`请求次数: ${P(S.raw)}`}}},scales:{x:v.value,y:{...C.value,ticks:{...C.value.ticks,stepSize:1,callback:S=>Number.isInteger(S)?S:null}}}})),I=l(()=>a.data.reduce((S,x)=>S+P(x.requests),0)),z=l(()=>a.data.length===0?0:Math.round(I.value/a.data.length)),$=l(()=>I.value>0);return(S,x)=>(c(),H(t(G),null,{default:u(()=>[o(t(we),{class:"pb-2"},{default:u(()=>[e("div",vs,[e("div",xs,[o(t(Tt),{class:"h-5 w-5 text-muted-foreground"}),o(t(ke),{class:"text-base"},{default:u(()=>[...x[0]||(x[0]=[A("请求次数统计",-1)])]),_:1})]),e("div",gs,[e("div",hs,[e("div",{class:"w-3 h-3 rounded-full",style:Z({background:t(k)(0)})},null,4),e("span",_s,[x[1]||(x[1]=A("总计: ",-1)),e("span",ys,i(I.value),1)])]),e("span",bs,[A(i(n.value?"时均":"日均")+": ",1),e("span",ks,i(z.value),1)])])])]),_:1}),o(t(W),null,{default:u(()=>[e("div",ws,[d.loading?(c(),y("div",$s,[o(t(Te),{class:"h-8 w-8 animate-spin text-primary"})])):$.value?$.value?(c(),H(t(bt),{key:2,data:T.value,options:b.value},null,8,["data","options"])):E("",!0):(c(),y("div",qs,[...x[2]||(x[2]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 mb-2 opacity-50",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),e("p",{class:"text-sm"},"暂无请求记录",-1)])]))])]),_:1})]),_:1}))}}),Ts={class:"flex items-center justify-between"},Ms={class:"flex items-center gap-2"},Is={key:0,class:"flex flex-col items-center justify-center h-40 text-muted-foreground"},Ss={class:"relative h-40"},As={class:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none z-0"},Rs={class:"text-2xl font-bold text-foreground"},Ds={class:"relative z-10 h-full"},Ps={class:"grid grid-cols-2 sm:grid-cols-4 gap-3 mt-4 pt-4 border-t"},js={class:"text-center"},Hs={class:"text-xs text-muted-foreground mb-1"},Ls={class:"font-bold tabular-nums text-sm text-primary"},Bs={class:"text-center"},zs={class:"font-bold tabular-nums text-sm"},Os={class:"text-center"},Vs={class:"text-center"},Ns=ae({__name:"QuotaChart",props:{used:{},remaining:{},total:{},unit:{},type:{},dailyQuota:{}},setup(d){ye.register(Xe,be,Me);const a=d,{tooltipOptions:g,getColor:v,chartAnimation:C,isDark:k}=$e(),w=ne(null);Je(k,()=>{var x,_;(_=(x=w.value)==null?void 0:x.chart)==null||_.update("none")});const n=l(()=>a.type!=="count"),T=x=>n.value?X(x):x.toString(),b=l(()=>{const x=P(a.total),_=Math.min(P(a.used),x),p=Math.max(x-_,0);return{total:x,used:_,remaining:p}}),I=l(()=>({labels:["已使用","剩余"],datasets:[{data:[b.value.used,b.value.remaining],backgroundColor:[v(2),v(1)],borderWidth:0,cutout:"75%",borderRadius:4}]})),z=l(()=>({responsive:!0,maintainAspectRatio:!1,animation:C,plugins:{legend:{display:!1},tooltip:{...g.value,titleFont:{size:13},bodyFont:{size:12},callbacks:{label:x=>{const _=P(x.raw),p=b.value.total>0?(_/b.value.total*100).toFixed(1):"0",m=n.value?X(_):_;return`${x.label}: ${m} (${p}%)`}}}}})),$=l(()=>b.value.total===0?0:Math.round(b.value.used/b.value.total*100)),S=l(()=>b.value.total>0);return(x,_)=>(c(),H(t(G),{class:"h-full"},{default:u(()=>[o(t(we),{class:"pb-2"},{default:u(()=>[e("div",Ts,[e("div",Ms,[o(t(Mt),{class:"h-5 w-5 text-muted-foreground"}),o(t(ke),{class:"text-base"},{default:u(()=>[..._[0]||(_[0]=[A("额度使用",-1)])]),_:1})]),d.unit?(c(),H(t(xe),{key:0,variant:"secondary",class:"text-xs font-normal"},{default:u(()=>[A(i(d.unit),1)]),_:1})):E("",!0)])]),_:1}),o(t(W),null,{default:u(()=>[S.value?(c(),y(re,{key:1},[e("div",Ss,[e("div",As,[e("span",Rs,i($.value)+"% ",1),_[2]||(_[2]=e("span",{class:"text-xs text-muted-foreground"},"已使用",-1))]),e("div",Ds,[o(t(et),{ref_key:"chartRef",ref:w,data:I.value,options:z.value},null,8,["data","options"])])]),e("div",Ps,[e("div",js,[e("div",Hs,i(d.type==="duration"?"每日额度":d.type==="count"?"基础次数":"基础额度"),1),e("div",Ls,i(d.type==="count"?t(P)(d.dailyQuota??0):T(t(P)(d.dailyQuota??0))),1)]),e("div",Bs,[_[3]||(_[3]=e("div",{class:"text-xs text-muted-foreground mb-1"},"总额度",-1)),e("div",zs,i(T(b.value.total)),1)]),e("div",Os,[_[4]||(_[4]=e("div",{class:"text-xs text-muted-foreground mb-1"},"已使用",-1)),e("div",{class:"font-bold tabular-nums text-sm",style:Z({color:t(v)(2)})},i(T(b.value.used)),5)]),e("div",Vs,[_[5]||(_[5]=e("div",{class:"text-xs text-muted-foreground mb-1"},"剩余",-1)),e("div",{class:"font-bold tabular-nums text-sm",style:Z({color:t(v)(1)})},i(T(b.value.remaining)),5)])])],64)):(c(),y("div",Is,[..._[1]||(_[1]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 mb-2 opacity-50",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})],-1),e("p",{class:"text-sm"},"暂无配额信息",-1)])]))]),_:1})]),_:1}))}}),Es={class:"flex flex-wrap justify-between items-center gap-2"},Ks={class:"flex items-center gap-2"},Fs={key:0,class:"flex rounded-lg bg-muted p-0.5 gap-0.5"},Us=["onClick"],Qs={class:"h-56"},Ws={key:0,class:"flex items-center justify-center h-full"},Gs={key:1,class:"flex flex-col items-center justify-center h-full text-muted-foreground"},Ys={class:"text-xs text-muted-foreground"},Zs={key:0,class:"flex items-center gap-1.5"},Xs={class:"text-xs text-muted-foreground"},Ue=8,Js=ae({__name:"ModelTrend",props:{data:{},period:{},loading:{type:Boolean}},setup(d){ye.register(ze,Oe,We,Ge,Ve,be,Me,Ye);const a=d,g=ne("tokens"),{tooltipOptions:v,xScaleOptions:C,yScaleOptions:k,isDark:w,getColor:n,getFillColor:T,chartAnimation:b}=$e();function I(f,h){return P(h==="tokens"?f.total_tokens:h==="cost"?f.cost:f.requests)}const z=l(()=>{const f=new Map;for(const h of a.data)for(const D of h.models)f.set(D.model,(f.get(D.model)||0)+I(D,g.value));return Array.from(f.entries()).sort((h,D)=>D[1]-h[1]).map(([h])=>h)}),$=l(()=>z.value.slice(0,Ue)),S=l(()=>z.value.slice(Ue)),x=l(()=>S.value.length>0),_=l(()=>`其他 (${S.value.length} 个模型)`),p=l(()=>w.value?"hsl(240, 5%, 46%)":"hsl(240, 5%, 64%)"),m=l(()=>a.data.length>0&&z.value.length>0);function R(f,h,D){const N=f.models.find(ee=>ee.model===h);return N?I(N,D):0}const M=l(()=>{const f=Ne(a.data.map(D=>D.date),a.period),h=$.value.map((D,N)=>({label:D,data:a.data.map(ee=>R(ee,D,g.value)),borderColor:n(N),backgroundColor:T(N,.15),fill:!0,tension:.4,borderWidth:2,pointRadius:0,pointHoverRadius:4}));if(x.value){const D=S.value;h.push({label:_.value,data:a.data.map(N=>{let ee=0;for(const r of D)ee+=R(N,r,g.value);return ee}),borderColor:p.value,backgroundColor:p.value.replace("hsl(","hsla(").replace(")",", 0.15)"),fill:!0,tension:.4,borderWidth:2,pointRadius:0,pointHoverRadius:4})}return{labels:f,datasets:h}});function L(f){return g.value==="tokens"?f>=1e6?`${(f/1e6).toFixed(1)}M`:f>=1e3?`${(f/1e3).toFixed(1)}K`:f.toString():g.value==="cost"?X(f):f.toString()}function B(f){return g.value==="tokens"?f.toLocaleString():g.value==="cost"?X(f):`${f} 次`}const J=l(()=>({responsive:!0,maintainAspectRatio:!1,animation:b,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{...v.value,callbacks:{label:f=>{const h=P(f.raw);return h===0?"":`${f.dataset.label}: ${B(h)}`}},filter:f=>P(f.raw)>0}},scales:{x:C.value,y:{...k.value,ticks:{...k.value.ticks,callback:f=>L(f)}}}})),Y=[{value:"tokens",label:"Tokens"},{value:"cost",label:"消费"},{value:"requests",label:"请求"}];return(f,h)=>(c(),H(t(G),{class:"h-full"},{default:u(()=>[o(t(we),{class:"pb-2"},{default:u(()=>[e("div",Es,[e("div",Ks,[o(t(Bt),{class:"h-5 w-5 text-muted-foreground"}),o(t(ke),{class:"text-base"},{default:u(()=>[...h[0]||(h[0]=[A("模型使用趋势",-1)])]),_:1})]),m.value||d.loading?(c(),y("div",Fs,[(c(),y(re,null,_e(Y,D=>e("button",{key:D.value,class:F(["px-3 py-1 text-xs font-medium rounded-md transition-colors",g.value===D.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"]),onClick:N=>g.value=D.value},i(D.label),11,Us)),64))])):E("",!0)])]),_:1}),o(t(W),null,{default:u(()=>[e("div",Qs,[d.loading?(c(),y("div",Ws,[o(t(Te),{class:"h-8 w-8 animate-spin text-primary"})])):m.value?m.value?(c(),H(t(Ze),{key:2,data:M.value,options:J.value},null,8,["data","options"])):E("",!0):(c(),y("div",Gs,[o(t(tt),{class:"h-12 w-12 mb-2 opacity-50"}),h[1]||(h[1]=e("p",{class:"text-sm"},"暂无模型使用数据",-1)),h[2]||(h[2]=e("p",{class:"text-xs mt-1"},"该时间段内没有模型使用记录",-1))]))]),m.value||d.loading?(c(),y("div",{key:0,class:F(["flex flex-wrap gap-x-4 gap-y-1.5 mt-3 pt-3 border-t border-border",{invisible:d.loading}]),style:{"min-height":"28px"}},[(c(!0),y(re,null,_e($.value,(D,N)=>(c(),y("div",{key:D,class:"flex items-center gap-1.5"},[e("span",{class:"w-2.5 h-2.5 rounded-full shrink-0",style:Z({background:t(n)(N)})},null,4),e("span",Ys,i(D),1)]))),128)),x.value?(c(),y("div",Zs,[e("span",{class:"w-2.5 h-2.5 rounded-full shrink-0",style:Z({background:p.value})},null,4),e("span",Xs,i(_.value),1)])):E("",!0)],2)):E("",!0)]),_:1})]),_:1}))}}),ea={class:"space-y-4"},ta={class:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3"},sa={class:"grid grid-cols-1 lg:grid-cols-3 gap-4"},aa={key:0,class:"lg:col-span-1"},oa=ae({__name:"UsageTrends",props:{usageHistory:{},selectedPeriod:{},isLoading:{type:Boolean},quotaUsed:{},quotaRemaining:{},quotaTotal:{},quotaUnit:{},quotaType:{},quotaDailyQuota:{},modelTrendData:{}},emits:["update:selectedPeriod"],setup(d,{emit:a}){const g=d,v=a,C=[{value:"24h",label:"24小时"},{value:"7d",label:"7天"},{value:"14d",label:"14天"},{value:"30d",label:"30天"}];function k(n){const T=String(n);C.some(b=>b.value===T)&&T!==g.selectedPeriod&&v("update:selectedPeriod",T)}const w=l(()=>(g.quotaTotal??0)>0);return(n,T)=>(c(),y("div",ea,[e("div",ta,[T[0]||(T[0]=e("div",null,[e("h2",{class:"text-lg font-semibold"},"使用趋势"),e("p",{class:"text-sm text-muted-foreground"},"查看 API 使用统计")],-1)),o(t(Ft),{"model-value":d.selectedPeriod,class:"w-full sm:w-auto","onUpdate:modelValue":k},{default:u(()=>[o(t(Ut),{class:"flex-wrap h-auto w-full sm:w-auto justify-start"},{default:u(()=>[(c(),y(re,null,_e(C,b=>o(t(Qt),{key:b.value,value:b.value},{default:u(()=>[A(i(b.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),e("div",sa,[w.value?(c(),y("div",aa,[o(Ns,{used:d.quotaUsed||0,remaining:d.quotaRemaining||0,total:d.quotaTotal||0,unit:d.quotaUnit||"",type:d.quotaType||"","daily-quota":d.quotaDailyQuota||0},null,8,["used","remaining","total","unit","type","daily-quota"])])):E("",!0),e("div",{class:F(w.value?"lg:col-span-2":"lg:col-span-3")},[o(fs,{data:d.usageHistory,period:d.selectedPeriod,loading:d.isLoading},null,8,["data","period","loading"])],2)]),e("div",null,[o(Cs,{data:d.usageHistory,period:d.selectedPeriod,loading:d.isLoading},null,8,["data","period","loading"])]),e("div",null,[d.isLoading||d.modelTrendData&&d.modelTrendData.length>0?(c(),H(Js,{key:0,data:d.modelTrendData||[],period:d.selectedPeriod,loading:d.isLoading},null,8,["data","period","loading"])):E("",!0)])]))}}),la={class:"flex flex-col md:flex-row md:gap-5"},na={class:"md:w-[45%] lg:w-[40%] shrink-0 space-y-2"},ra={class:"flex flex-wrap items-center gap-2"},ia={class:"w-8 h-8 rounded-lg bg-amber-500/10 dark:bg-amber-400/10 flex items-center justify-center"},ua={class:"text-sm font-medium"},da={class:"text-xs"},ca={class:"flex items-baseline gap-1"},ma={class:"text-lg font-bold tabular-nums text-primary"},pa={class:"text-sm text-muted-foreground"},fa={class:"flex items-center gap-3"},va={class:"text-xs font-medium tabular-nums text-muted-foreground shrink-0"},xa={class:"flex-1 min-w-0"},ga={class:"flex items-center gap-1.5 mb-2"},ha={class:"space-y-1.5"},_a=ae({__name:"QuotaPackBar",props:{packInfo:{}},setup(d){const a=d,g=ne(Date.now());Qe(()=>{g.value=Date.now()},6e4);const v=l(()=>a.packInfo.total<=0?0:Math.round(a.packInfo.used/a.packInfo.total*100)),C=l(()=>100-v.value),k=l(()=>{const $=C.value;return $>50?"bg-emerald-500":$>20?"bg-amber-500":"bg-red-500"}),w=l(()=>(g.value,it(a.packInfo.expiresAt))),n=l(()=>{if(g.value,!a.packInfo.expiresAt)return!1;const $=new Date(a.packInfo.expiresAt);return ut($,new Date)<24}),T=l(()=>a.packInfo.type==="count"?`${a.packInfo.remaining} 次`:X(a.packInfo.remaining)),b=l(()=>a.packInfo.type==="count"?`${a.packInfo.total} 次`:X(a.packInfo.total)),I=l(()=>a.packInfo.status==="active"?{label:"生效中",class:"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400"}:{label:"已耗尽",class:"border-gray-300 bg-gray-100 text-gray-600 dark:border-gray-500/30 dark:bg-gray-500/10 dark:text-gray-400"}),z=l(()=>{const $=[];return n.value&&a.packInfo.status==="active"&&$.push({icon:Ie,text:"配额包即将过期,请尽快使用剩余额度",class:"text-red-500 dark:text-red-400"}),a.packInfo.status==="used_up"&&$.push({icon:Ie,text:"配额包已耗尽,如需继续使用请联系管理员增购",class:"text-muted-foreground/50"}),$.push({icon:Ht,text:`基础配额用完后自动使用${a.packInfo.label}`},{icon:At,text:"有效期内未使用完的额度不会退还"},{icon:je,text:"配额包到期后剩余额度将自动失效"},{icon:Vt,text:"如需续期或增购请联系管理员"}),$});return($,S)=>(c(),H(t(G),null,{default:u(()=>[o(t(W),{class:"py-3 px-5"},{default:u(()=>[e("div",la,[e("div",na,[e("div",ra,[e("div",ia,[o(t(St),{class:"h-4 w-4 text-amber-600 dark:text-amber-400"})]),e("span",ua,i(d.packInfo.label),1),o(t(xe),{variant:"outline",class:F(["text-xs",I.value.class])},{default:u(()=>[A(i(I.value.label),1)]),_:1},8,["class"]),w.value?(c(),y("div",{key:0,class:F(["flex items-center gap-1 ml-auto md:ml-0",n.value?"text-red-500":"text-muted-foreground"])},[n.value?(c(),H(t(Ie),{key:0,class:"h-3.5 w-3.5"})):(c(),H(t(je),{key:1,class:"h-3.5 w-3.5"})),e("span",da,i(w.value),1)],2)):E("",!0)]),e("div",ca,[e("span",ma,i(T.value),1),e("span",pa," / "+i(b.value),1)]),e("div",fa,[o(t(It),{"model-value":v.value,class:"h-1.5 flex-1","indicator-class":k.value},null,8,["model-value","indicator-class"]),e("span",va,i(v.value)+"% ",1)])]),S[1]||(S[1]=e("div",{class:"my-3 border-t border-dashed border-border/40 md:hidden"},null,-1)),S[2]||(S[2]=e("div",{class:"hidden md:block border-l border-dashed border-border/40"},null,-1)),e("div",xa,[e("div",ga,[o(t(ve),{class:"h-3.5 w-3.5 text-amber-500/70 dark:text-amber-400/70"}),S[0]||(S[0]=e("span",{class:"text-xs font-medium text-amber-600/80 dark:text-amber-400/70"}," 注意事项 ",-1))]),e("ul",ha,[(c(!0),y(re,null,_e(z.value,(x,_)=>(c(),y("li",{key:_,class:"flex items-start gap-1.5"},[(c(),H(kt(x.icon),{class:F(["h-3 w-3 mt-0.5 shrink-0",x.class||"text-amber-500/70 dark:text-amber-400/70"])},null,8,["class"])),e("span",{class:F(["text-xs leading-relaxed",x.class||"text-muted-foreground"])},i(x.text),3)]))),128))])])])]),_:1})]),_:1}))}}),ya={class:"flex items-center justify-between"},ba={class:"flex items-center gap-2"},ka={key:0,class:"flex items-center justify-center min-h-[200px] text-muted-foreground"},wa={key:1,class:"flex flex-col items-center justify-center py-10 text-muted-foreground"},$a={key:2,class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},qa={class:"flex items-center justify-center lg:col-span-1"},Ca={class:"relative"},Ta={class:"relative w-40 h-40"},Ma={class:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none z-0"},Ia={class:"text-lg font-bold text-foreground tabular-nums"},Sa={class:"relative z-10 h-full"},Aa={class:"font-medium"},Ra={class:"text-muted-foreground"},Da={class:"lg:col-span-2 space-y-4"},Pa={class:"flex items-center justify-between gap-2"},ja={class:"flex items-center gap-2 min-w-0"},Ha={class:"text-sm font-medium truncate"},La={class:"flex items-center gap-3 shrink-0"},Ba={class:"text-sm font-bold tabular-nums"},za={class:"text-xs text-muted-foreground tabular-nums w-12 text-right"},Oa={class:"w-full h-2 rounded-full bg-muted overflow-hidden"},Va={class:"flex items-center gap-3 text-[11px] text-muted-foreground"},ge=5,Na=ae({__name:"ModelCostBreakdown",props:{modelCosts:{},loading:{type:Boolean},period:{}},setup(d){ye.register(Xe,be);const a=d,{isDark:g,palette:v}=$e(),C=l(()=>({"24h":"24小时","7d":"近7天","14d":"近14天","30d":"近30天"})[a.period||""]||"累计"),k=ne(!1),w=ne({title:"",body:""}),n=ne({x:0,y:0}),T=l(()=>[...a.modelCosts].sort((R,M)=>M.cost-R.cost)),b=l(()=>{if(T.value.length<=ge)return T.value;const R=T.value.slice(0,ge),M=T.value.slice(ge),L=M.reduce((Y,f)=>Y+f.cost,0),B=M.reduce((Y,f)=>Y+f.tokens,0),J=M.reduce((Y,f)=>Y+f.requests,0);return[...R,{model:`其他 (${M.length} 个模型)`,cost:L,tokens:B,requests:J,percentage:0}]}),I=l(()=>a.modelCosts.length>0),z=l(()=>a.modelCosts.reduce((R,M)=>R+M.cost,0));function $(R){return z.value<=0?0:R/z.value*100}const S=l(()=>{const R=v.value.slice(0,ge);if(T.value.length>ge){const M=g.value?"hsl(240, 5%, 46%)":"hsl(240, 5%, 64%)";return[...R,M]}return v.value.slice(0,T.value.length)}),x=l(()=>({labels:b.value.map(R=>R.model),datasets:[{data:b.value.map(R=>R.cost),backgroundColor:S.value.slice(0,b.value.length),borderWidth:0,borderRadius:3}]})),_=l(()=>({responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1},tooltip:{enabled:!1,external:R=>{var h,D,N,ee;const{chart:M,tooltip:L}=R;if(L.opacity===0){k.value=!1;return}const B=((h=L.title)==null?void 0:h[0])||"",J=((ee=(N=(D=L.body)==null?void 0:D[0])==null?void 0:N.lines)==null?void 0:ee[0])||"";w.value={title:B,body:J};const{offsetLeft:Y,offsetTop:f}=M.canvas;n.value={x:Y+L.caretX,y:f+L.caretY},k.value=!0},callbacks:{label:R=>{const M=R.raw,L=z.value,B=L>0?(M/L*100).toFixed(1):"0";return`${X(M)} (${B}%)`}}}}})),p=["bg-chart-1","bg-chart-2","bg-chart-3","bg-chart-4","bg-rose-500"];function m(R){return R>=ge?"bg-zinc-400":p[R%p.length]}return(R,M)=>(c(),H(t(G),null,{default:u(()=>[o(t(we),{class:"pb-3"},{default:u(()=>[e("div",ya,[e("div",ba,[o(t(Lt),{class:"h-5 w-5 text-muted-foreground"}),o(t(ke),{class:"text-base"},{default:u(()=>[...M[0]||(M[0]=[A("模型消费明细",-1)])]),_:1})]),o(t(xe),{variant:"outline",class:"text-xs text-muted-foreground"},{default:u(()=>[A(i(C.value),1)]),_:1})])]),_:1}),o(t(W),{class:"pt-0"},{default:u(()=>[d.loading?(c(),y("div",ka,[o(t(Te),{class:"h-8 w-8 animate-spin text-primary"})])):I.value?(c(),y("div",$a,[e("div",qa,[e("div",Ca,[e("div",Ta,[e("div",Ma,[e("span",Ia,i(t(X)(z.value)),1),M[3]||(M[3]=e("span",{class:"text-[11px] text-muted-foreground"},"总消费",-1))]),e("div",Sa,[o(t(et),{data:x.value,options:_.value},null,8,["data","options"])])]),wt(e("div",{class:"absolute z-50 pointer-events-none px-3 py-2 rounded-lg border text-xs shadow-md whitespace-nowrap bg-popover text-popover-foreground border-border",style:Z({left:`${n.value.x}px`,top:`${n.value.y}px`,transform:"translate(-50%, -120%)"})},[e("div",Aa,i(w.value.title),1),e("div",Ra,i(w.value.body),1)],4),[[$t,k.value]])])]),e("div",Da,[(c(!0),y(re,null,_e(b.value,(L,B)=>(c(),y("div",{key:L.model,class:"space-y-2"},[e("div",Pa,[e("div",ja,[e("span",{class:F(["w-2.5 h-2.5 rounded-full shrink-0",m(B)])},null,2),e("span",Ha,i(L.model),1)]),e("div",La,[e("span",Ba,i(t(X)(L.cost)),1),e("span",za,i($(L.cost).toFixed(1))+"% ",1)])]),e("div",Oa,[e("div",{class:F(["h-full rounded-full transition-all duration-500",m(B)]),style:Z({width:`${Math.max($(L.cost),1)}%`})},null,6)]),e("div",Va,[e("span",null,i(t(fe)(L.tokens))+" tokens",1),M[4]||(M[4]=e("span",null,"·",-1)),e("span",null,i(L.requests)+" 次请求",1)])]))),128))])])):(c(),y("div",wa,[o(t(tt),{class:"h-10 w-10 mb-2 opacity-50"}),M[1]||(M[1]=e("p",{class:"text-sm"},"暂无模型消费数据",-1)),M[2]||(M[2]=e("p",{class:"text-xs mt-1 text-muted-foreground/70"}," 使用 API 后将在此展示各模型消费占比 ",-1))]))]),_:1})]),_:1}))}}),Ea={class:"max-w-7xl mx-auto"},Ka={key:0,class:"py-10"},Fa={class:"mt-4 text-xl font-semibold tracking-tight text-foreground"},Ua={class:"mt-2 max-w-xl text-sm leading-6 text-muted-foreground"},Qa={class:"sm:hidden mb-4"},Wa={class:"flex items-center justify-between"},Ga={class:"flex items-center gap-1.5"},Ya={class:"truncate"},Za={key:0,class:"mb-6 rounded-lg border border-amber-200 dark:border-amber-500/20 bg-amber-50 dark:bg-amber-500/5 p-4"},Xa={class:"flex gap-3"},Ja={class:"shrink-0 mt-0.5"},eo={key:1,class:"mb-6 rounded-lg border border-red-200 dark:border-red-500/20 bg-red-50 dark:bg-red-500/5 p-4"},to={class:"flex gap-3"},so={class:"shrink-0 mt-0.5"},ao={key:2,class:"mb-6 rounded-lg border border-red-200 dark:border-red-500/20 bg-red-50 dark:bg-red-500/5 p-4"},oo={class:"flex gap-3"},lo={class:"shrink-0 mt-0.5"},no={key:3,class:"mb-6 rounded-lg border border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-500/5 p-4"},ro={class:"flex gap-3"},io={class:"shrink-0 mt-0.5"},uo={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8"},co={class:"flex items-start justify-between"},mo={class:"space-y-1"},po={class:"flex items-center gap-1.5"},fo={class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"},vo={class:"text-xs text-white"},xo={class:"text-xs text-white/70"},go={class:"text-2xl font-bold tabular-nums text-primary"},ho={class:"text-xs text-muted-foreground"},_o={key:0,class:"text-amber-500"},yo={class:"relative flex items-center justify-center"},bo={class:"w-14 h-14 -rotate-90"},ko={class:"absolute text-xs font-semibold text-primary transition-colors duration-200"},wo={class:"flex items-start justify-between"},$o={class:"space-y-1"},qo={class:"flex items-center gap-1.5"},Co={class:"text-xs space-y-1"},To={class:"text-2xl font-bold tabular-nums text-chart-2"},Mo={class:"text-xs text-muted-foreground"},Io={class:"w-12 h-12 rounded-xl bg-chart-2/10 flex items-center justify-center"},So={class:"flex items-start justify-between"},Ao={class:"space-y-1"},Ro={class:"text-2xl font-bold tabular-nums text-chart-4"},Do={class:"text-xs text-muted-foreground"},Po={class:"w-12 h-12 rounded-xl bg-chart-4/10 flex items-center justify-center"},jo={class:"flex items-start justify-between"},Ho={class:"space-y-1"},Lo={class:"text-2xl font-bold tabular-nums text-chart-3"},Bo={class:"text-xs text-muted-foreground"},zo={class:"w-12 h-12 rounded-xl bg-chart-3/10 flex items-center justify-center"},Oo={class:"mb-6"},Vo={class:"mb-6"},No={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 text-sm"},Eo={class:"flex items-center gap-3"},Ko={class:"w-9 h-9 rounded-lg bg-muted flex items-center justify-center flex-shrink-0"},Fo={class:"font-medium"},Uo={class:"flex items-center gap-3"},Qo={class:"w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(245, 158, 11, 0.1)"}},Wo={class:"font-medium"},Go={class:"flex items-center gap-3"},Yo={class:"w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(59, 130, 246, 0.1)"}},Zo={class:"flex items-center gap-3"},Xo={class:"w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(34, 197, 94, 0.1)"}},Jo={class:"font-medium"},fl=ae({__name:"Dashboard",setup(d){const a=dt(),g=ne(Date.now());Qe(()=>{g.value=Date.now()},6e4);const v=ne("24h"),C=ne(!1);let k=0;const w=l(()=>{var r,s;return((r=a.usageHistory)==null?void 0:r.period)===v.value&&((s=a.modelTrends)==null?void 0:s.period)===v.value}),n=l(()=>a.apiKeyInfo),T=l(()=>{var r;return((r=a.usageHistory)==null?void 0:r.data)||[]}),b=l(()=>{var r;return((r=a.modelTrends)==null?void 0:r.data)||[]}),I=l(()=>a.isBootstrapping),z=l(()=>!I.value&&!n.value),$=l(()=>!I.value&&!n.value?a.error:null),S=l(()=>{var r;return((r=a.invalidKeyRecovery)==null?void 0:r.mode)==="relogin"}),x=l(()=>$.value?"当前 FogAct Key 信息加载失败":S.value?"当前 Key 已失效":"暂无可展示的 Key 信息"),_=l(()=>$.value?$.value:S.value?"请先确认恢复弹窗,系统会带您返回欢迎页重新添加可用 Key。":"请从左侧切换其他可用 Key,或稍后重试。"),p=l(()=>{const r=new Map;for(const j of b.value)for(const q of j.models){const V=r.get(q.model);V?(V.cost+=q.cost,V.tokens+=q.total_tokens,V.requests+=q.requests):r.set(q.model,{cost:q.cost,tokens:q.total_tokens,requests:q.requests})}const s=[...r.values()].reduce((j,q)=>j+q.cost,0);return[...r.entries()].map(([j,q])=>({model:j,cost:q.cost,tokens:q.tokens,requests:q.requests,percentage:s>0?q.cost/s*100:0}))}),m=l(()=>{g.value;const r=n.value;return!(r!=null&&r.quota)||r.billing_type!=="duration"?"":ct(r.quota.next_reset_at)}),R=l(()=>{var q;const r=n.value,s=((q=r==null?void 0:r.quota)==null?void 0:q.reset_timezone)||"Asia/Shanghai";return{"Asia/Shanghai":"北京时间",UTC:"UTC","America/New_York":"纽约时间","Europe/London":"伦敦时间"}[s]||s}),M=l(()=>{var s,j,q,V,U;if(((s=n.value)==null?void 0:s.status)==="disabled")return"已禁用";g.value;const r=(q=(j=n.value)==null?void 0:j.timestamps)==null?void 0:q.expires_at;if(!r){const K=(U=(V=n.value)==null?void 0:V.timestamps)==null?void 0:U.validity_days;return K&&K>0?`${K} 天(激活后计算)`:"永久有效"}return mt(r)}),L=l(()=>M.value==="已过期"),B=l(()=>{const r=n.value;if(!(r!=null&&r.quota))return null;const s=r.quota,j=r.billing_type;return j==="quota"?{type:"quota",total:s.total_quota||0,used:s.used_quota||0,remaining:s.remaining_quota||0,unit:"$",label:"额度"}:j==="count"?{type:"count",total:s.max_requests||0,used:s.request_count||0,remaining:s.remaining_count||0,unit:"次",label:"请求次数"}:j==="duration"?{type:"duration",total:s.daily_quota||0,used:s.daily_spent||0,remaining:s.daily_remaining||0,unit:"美元",label:"每日额度",nextResetAt:s.next_reset_at}:null}),J=l(()=>{const r=n.value;if(!(r!=null&&r.quota))return null;const s=r.quota,j=r.billing_type,q=Ce(s.quota_pack_expires_at),V=Ce(s.requests_pack_expires_at),U=q&&s.quota_pack||0,K=q&&s.quota_pack_remaining||0,oe=V&&s.requests_pack||0,qe=V&&s.requests_pack_remaining||0;if(j==="quota"){const ie=s.total_quota||0,ue=s.remaining_quota||0,te=ie+U,O=Math.max(0,ue+K);return{type:"quota",total:te,used:Math.max(0,te-O),remaining:O,unit:"$"}}if(j==="count"){const ie=s.max_requests||0,ue=s.remaining_count||0,te=ie+oe,O=Math.max(0,ue+qe);return{type:"count",total:te,used:Math.max(0,te-O),remaining:O,unit:"次"}}if(j==="duration"){const ie=s.daily_quota||0,ue=s.daily_remaining||0,te=ie+U,O=Math.max(0,ue+K);return{type:"duration",total:te,used:Math.max(0,te-O),remaining:O,unit:"美元"}}return null}),Y=l(()=>!B.value||B.value.total===0?0:Math.round(B.value.used/B.value.total*100)),f=l(()=>{const r=n.value;if(!(r!=null&&r.quota))return null;const s=r.quota,j=r.billing_type;if(j==="duration"||j==="quota"){if(s.quota_pack!==void 0&&s.quota_pack!==null){const q=s.quota_pack;if(q<=0)return null;const V=s.quota_pack_used||0,U=s.quota_pack_remaining||0,K=s.quota_pack_expires_at;if(!Ce(K))return null;let oe="active";return U<=0&&(oe="used_up"),{type:"quota",total:q,used:V,remaining:U,expiresAt:K,status:oe,unit:"$",label:"配额包"}}}else if(j==="count"&&s.requests_pack!==void 0&&s.requests_pack!==null){const q=s.requests_pack;if(q<=0)return null;const V=s.requests_pack_used||0,U=s.requests_pack_remaining||0,K=s.requests_pack_expires_at;if(!Ce(K))return null;let oe="active";return U<=0&&(oe="used_up"),{type:"count",total:q,used:V,remaining:U,expiresAt:K,status:oe,unit:"次",label:"请求包"}}return null}),h=l(()=>{var s;const r=(s=n.value)==null?void 0:s.usage;return r?{totalSpent:r.total_spent||0,dailySpent:r.daily_total_spent||r.daily_spent||0,requestCount:r.request_count||0,dailyRequestCount:r.daily_request_count||0,inputTokens:r.input_tokens||0,outputTokens:r.output_tokens||0,cacheReadTokens:r.cache_read_tokens||0,cacheWriteTokens:r.cache_write_tokens||0,totalTokens:r.total_tokens||0}:{totalSpent:0,dailySpent:0,requestCount:0,dailyRequestCount:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,totalTokens:0}});async function D(r){const s=++k;if(!n.value){C.value=!1;return}if(r==="initial"&&w.value){C.value=!1;return}C.value=!0;try{await Promise.all([a.fetchUsageHistory(v.value),a.fetchModelTrends(v.value)])}finally{s===k&&(C.value=!1)}}const{reload:N}=Dt(async({reason:r})=>{await D(r)});async function ee(){await a.bootstrapSession()==="ready"&&await N("retry")}return Je(v,()=>{N("period-change")}),(r,s)=>{var j,q,V,U,K,oe,qe,ie,ue,te;return c(),y("div",Ea,[z.value?(c(),y("div",Ka,[o(t(G),{class:"border-border/60 bg-card/80 shadow-sm backdrop-blur-xl"},{default:u(()=>[o(t(W),{class:"flex flex-col items-center px-6 py-10 text-center sm:px-10"},{default:u(()=>[e("div",{class:F(["flex h-14 w-14 items-center justify-center rounded-2xl border shadow-sm",$.value?"border-red-500/20 bg-red-500/10 text-red-500":"border-amber-500/20 bg-amber-500/10 text-amber-500"])},[$.value?(c(),H(t(Kt),{key:0,class:"h-6 w-6"})):(c(),H(t(pt),{key:1,class:"h-6 w-6"}))],2),o(t(xe),{variant:"outline",class:F(["mt-4 rounded-full",$.value?"border-red-500/20 bg-red-500/10 text-red-600 dark:text-red-400":"border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400"])},{default:u(()=>[A(i($.value?"加载失败":"Key 处理中"),1)]),_:1},8,["class"]),e("h2",Fa,i(x.value),1),e("p",Ua,i(_.value),1),$.value?(c(),H(t(ft),{key:0,class:"mt-6",onClick:ee},{default:u(()=>[o(t(Fe),{class:"mr-2 h-4 w-4"}),s[1]||(s[1]=A(" 重新加载 ",-1))]),_:1})):E("",!0)]),_:1})]),_:1})])):(c(),y(re,{key:1},[e("div",Qa,[o(t(G),null,{default:u(()=>[o(t(W),{class:"py-3 px-4"},{default:u(()=>{var O,de,ce,me;return[e("div",Wa,[e("div",Ga,[o(t(xe),{variant:"outline",class:"text-xs font-mono rounded-full px-2.5"},{default:u(()=>{var Q;return[A(i((Q=n.value)==null?void 0:Q.key_preview),1)]}),_:1}),o(t(xe),{variant:"outline",class:F(["text-xs rounded-full px-2.5 gap-1 max-w-[13rem]",t(vt)(((O=n.value)==null?void 0:O.service_type)||"").badge]),title:t(Ke)(((de=n.value)==null?void 0:de.service_type)||"",(ce=n.value)==null?void 0:ce.sub_service_type_name)},{default:u(()=>{var Q,se,pe,he;return[((Q=n.value)==null?void 0:Q.service_type)==="claude"?(c(),H(t(qt),{key:0,class:"h-3 w-3"})):((se=n.value)==null?void 0:se.service_type)==="codex"?(c(),H(t(Ct),{key:1,class:"h-3 w-3"})):E("",!0),e("span",Ya,i(t(Ke)(((pe=n.value)==null?void 0:pe.service_type)||"",(he=n.value)==null?void 0:he.sub_service_type_name)),1)]}),_:1},8,["class","title"])]),o(t(xe),{variant:"outline",class:F(["text-xs rounded-full px-2.5 gap-1.5",t(xt)(((me=n.value)==null?void 0:me.status)||"")])},{default:u(()=>{var Q,se;return[e("span",{class:F(["h-1.5 w-1.5 rounded-full shrink-0",t(gt)(((Q=n.value)==null?void 0:Q.status)||"")])},null,2),A(" "+i(t(ht)(((se=n.value)==null?void 0:se.status)||"")),1)]}),_:1},8,["class"])])]}),_:1})]),_:1})]),((j=n.value)==null?void 0:j.status)==="inactive"?(c(),y("div",Za,[e("div",Xa,[e("div",Ja,[o(t(ve),{class:"h-5 w-5 text-amber-500"})]),s[2]||(s[2]=e("div",{class:"text-sm"},[e("p",{class:"font-medium text-amber-800 dark:text-amber-400"}," 此 API Key 尚未激活 "),e("p",{class:"mt-1 text-amber-700/80 dark:text-amber-400/70"}," 通过 Claude Code 或 Codex CLI 发起首次 API 请求后将自动激活。激活后有效期开始计算,使用数据将在此处展示。 ")],-1))])])):((q=n.value)==null?void 0:q.status)==="expired"?(c(),y("div",eo,[e("div",to,[e("div",so,[o(t(ve),{class:"h-5 w-5 text-red-500"})]),s[3]||(s[3]=e("div",{class:"text-sm"},[e("p",{class:"font-medium text-red-800 dark:text-red-400"}," 此 API Key 已过期 "),e("p",{class:"mt-1 text-red-700/80 dark:text-red-400/70"}," 您的 API Key 有效期已结束,无法继续使用 API 服务。请联系管理员续期或获取新的密钥。 ")],-1))])])):((V=n.value)==null?void 0:V.status)==="disabled"?(c(),y("div",ao,[e("div",oo,[e("div",lo,[o(t(ve),{class:"h-5 w-5 text-red-500"})]),s[4]||(s[4]=e("div",{class:"text-sm"},[e("p",{class:"font-medium text-red-800 dark:text-red-400"}," 此 API Key 已被禁用 "),e("p",{class:"mt-1 text-red-700/80 dark:text-red-400/70"}," 您的 API Key 已被管理员禁用,无法继续使用 API 服务。如有疑问请联系管理员。 ")],-1))])])):((U=n.value)==null?void 0:U.status)==="linked"?(c(),y("div",no,[e("div",ro,[e("div",io,[o(t(ve),{class:"h-5 w-5 text-blue-500"})]),s[5]||(s[5]=e("div",{class:"text-sm"},[e("p",{class:"font-medium text-blue-800 dark:text-blue-400"}," 此卡已绑定到主卡 "),e("p",{class:"mt-1 text-blue-700/80 dark:text-blue-400/70"}," 此 API Key 已作为子卡绑定到主卡,通过主卡消耗额度。如需独立使用,请前往叠卡管理页面解绑。 ")],-1))])])):E("",!0),e("div",uo,[o(t(G),null,{default:u(()=>[o(t(W),{class:"p-5"},{default:u(()=>{var O,de,ce,me,Q,se,pe;return[e("div",co,[e("div",mo,[e("div",po,[e("p",fo,i(((O=B.value)==null?void 0:O.label)||"额度"),1),((de=B.value)==null?void 0:de.type)==="duration"&&m.value?(c(),H(t(Ae),{key:0},{default:u(()=>[o(t(Re),null,{default:u(()=>[o(t(De),null,{default:u(()=>[o(t(Fe),{class:"h-3 w-3 text-muted-foreground"})]),_:1}),o(t(Pe),null,{default:u(()=>[e("p",vo,i(m.value),1),e("p",xo,i(R.value)+" 00:00 额度刷新 ",1)]),_:1})]),_:1})]),_:1})):E("",!0)]),e("p",go,i(((ce=B.value)==null?void 0:ce.type)==="count"?(me=B.value)==null?void 0:me.remaining:t(X)(((Q=B.value)==null?void 0:Q.remaining)||0)),1),e("p",ho,[A(i(t(_t)(((se=n.value)==null?void 0:se.billing_type)||""))+" ",1),((pe=B.value)==null?void 0:pe.type)==="duration"&&m.value?(c(),y("span",_o," · "+i(m.value),1)):E("",!0)])]),e("div",yo,[n.value?(c(),y(re,{key:1},[(c(),y("svg",bo,[s[8]||(s[8]=e("circle",{cx:"28",cy:"28",r:"24",stroke:"currentColor","stroke-width":"4",fill:"none",class:"text-muted transition-colors duration-200"},null,-1)),e("circle",{cx:"28",cy:"28",r:"24",stroke:"currentColor","stroke-width":"4",fill:"none","stroke-linecap":"round",class:"text-primary transition-colors duration-200",style:Z({strokeDasharray:`${Y.value*1.508} 150.8`,transition:"stroke-dasharray 500ms ease, color 200ms ease-out"})},null,4)])),e("span",ko,i(Y.value)+"%",1)],64)):(c(),y(re,{key:0},[s[6]||(s[6]=e("svg",{class:"w-14 h-14 -rotate-90"},[e("circle",{cx:"28",cy:"28",r:"24",stroke:"currentColor","stroke-width":"4",fill:"none",class:"text-primary/20 transition-colors duration-200"}),e("circle",{cx:"28",cy:"28",r:"24",stroke:"currentColor","stroke-width":"4",fill:"none","stroke-dasharray":"37.7 150.8","stroke-linecap":"round",class:"text-primary/60 animate-spin origin-center transition-colors duration-200"})],-1)),s[7]||(s[7]=e("span",{class:"absolute text-xs font-semibold text-primary/40 transition-colors duration-200"},"--%",-1))],64))])])]}),_:1})]),_:1}),o(t(G),null,{default:u(()=>[o(t(W),{class:"p-5"},{default:u(()=>[e("div",wo,[e("div",$o,[e("div",qo,[s[13]||(s[13]=e("p",{class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"}," 总 Tokens ",-1)),o(t(Ae),null,{default:u(()=>[o(t(Re),null,{default:u(()=>[o(t(De),null,{default:u(()=>[o(t(ve),{class:"h-3 w-3 text-muted-foreground"})]),_:1}),o(t(Pe),{class:"max-w-xs"},{default:u(()=>[e("div",Co,[e("p",null,[s[9]||(s[9]=e("strong",null,"输入:",-1)),A(" "+i(t(fe)(h.value.inputTokens)),1)]),e("p",null,[s[10]||(s[10]=e("strong",null,"输出:",-1)),A(" "+i(t(fe)(h.value.outputTokens)),1)]),e("p",null,[s[11]||(s[11]=e("strong",null,"缓存读取:",-1)),A(" "+i(t(fe)(h.value.cacheReadTokens)),1)]),e("p",null,[s[12]||(s[12]=e("strong",null,"缓存创建:",-1)),A(" "+i(t(fe)(h.value.cacheWriteTokens)),1)])])]),_:1})]),_:1})]),_:1})]),e("p",To,i(t(fe)(h.value.totalTokens)),1),e("p",Mo," 入 "+i(t(fe)(h.value.inputTokens))+" / 出 "+i(t(fe)(h.value.outputTokens)),1)]),e("div",Io,[o(t(Nt),{class:"h-6 w-6 text-chart-2"})])])]),_:1})]),_:1}),o(t(G),null,{default:u(()=>[o(t(W),{class:"p-5"},{default:u(()=>[e("div",So,[e("div",Ao,[s[14]||(s[14]=e("p",{class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"}," 请求次数 ",-1)),e("p",Ro,i(h.value.requestCount),1),e("p",Do," 今日 "+i(h.value.dailyRequestCount)+" 次 ",1)]),e("div",Po,[o(t(Rt),{class:"h-6 w-6 text-chart-4"})])])]),_:1})]),_:1}),o(t(G),null,{default:u(()=>[o(t(W),{class:"p-5"},{default:u(()=>[e("div",jo,[e("div",Ho,[s[15]||(s[15]=e("p",{class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"}," 累计消费 ",-1)),e("p",Lo,i(t(X)(h.value.totalSpent)),1),e("p",Bo," 今日 "+i(t(X)(h.value.dailySpent)),1)]),e("div",zo,[o(t(zt),{class:"h-6 w-6 text-chart-3"})])])]),_:1})]),_:1})]),f.value?(c(),H(_a,{key:4,"pack-info":f.value,class:"mb-8 -mt-4"},null,8,["pack-info"])):E("",!0),e("div",Oo,[o(oa,{"usage-history":T.value,"selected-period":v.value,"is-loading":C.value,"quota-used":((K=J.value)==null?void 0:K.used)||0,"quota-remaining":((oe=J.value)==null?void 0:oe.remaining)||0,"quota-total":((qe=J.value)==null?void 0:qe.total)||0,"quota-unit":((ie=J.value)==null?void 0:ie.unit)||"","quota-type":((ue=J.value)==null?void 0:ue.type)||"","quota-daily-quota":((te=B.value)==null?void 0:te.total)||0,"model-trend-data":b.value,"onUpdate:selectedPeriod":s[0]||(s[0]=O=>v.value=O)},null,8,["usage-history","selected-period","is-loading","quota-used","quota-remaining","quota-total","quota-unit","quota-type","quota-daily-quota","model-trend-data"])]),e("div",Vo,[o(Na,{"model-costs":p.value,loading:C.value,period:v.value},null,8,["model-costs","loading","period"])]),o(t(G),null,{default:u(()=>[o(t(W),{class:"py-4 px-6"},{default:u(()=>{var O,de,ce,me,Q,se,pe,he,Ee;return[e("div",No,[e("div",Eo,[e("div",Ko,[o(t(Pt),{class:"h-4 w-4 text-muted-foreground"})]),e("div",null,[s[16]||(s[16]=e("p",{class:"text-xs text-muted-foreground"},"激活时间",-1)),e("p",Fo,i((de=(O=n.value)==null?void 0:O.timestamps)!=null&&de.activated_at?t(Se)(n.value.timestamps.activated_at,"yyyy-MM-dd HH:mm:ss"):"未激活"),1)])]),e("div",Uo,[e("div",Qo,[o(t(je),{class:"h-4 w-4",style:{color:"#f59e0b"}})]),e("div",null,[s[17]||(s[17]=e("p",{class:"text-xs text-muted-foreground"},"过期时间",-1)),e("p",Wo,i((me=(ce=n.value)==null?void 0:ce.timestamps)!=null&&me.expires_at?t(Se)(n.value.timestamps.expires_at,"yyyy-MM-dd HH:mm:ss"):(se=(Q=n.value)==null?void 0:Q.timestamps)!=null&&se.validity_days&&n.value.timestamps.validity_days>0?`激活后 ${n.value.timestamps.validity_days} 天`:"永不过期"),1)])]),e("div",Go,[e("div",Yo,[o(t(Ot),{class:"h-4 w-4",style:{color:"#3b82f6"}})]),e("div",null,[s[18]||(s[18]=e("p",{class:"text-xs text-muted-foreground"},"剩余时间",-1)),e("p",{class:F(["font-medium",{"text-red-500":L.value||((pe=n.value)==null?void 0:pe.status)==="disabled"}])},i(M.value),3)])]),e("div",Zo,[e("div",Xo,[o(t(jt),{class:"h-4 w-4",style:{color:"#22c55e"}})]),e("div",null,[s[19]||(s[19]=e("p",{class:"text-xs text-muted-foreground"},"最后使用",-1)),e("p",Jo,i((Ee=(he=n.value)==null?void 0:he.timestamps)!=null&&Ee.last_used_at?t(Se)(n.value.timestamps.last_used_at,"yyyy-MM-dd HH:mm:ss"):"从未使用"),1)])])])]}),_:1})]),_:1})],64))])}}});export{fl as default};
|