@chenpu17/cc-gw 0.3.6 → 0.3.7

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.
Files changed (32) hide show
  1. package/README.md +5 -4
  2. package/package.json +1 -1
  3. package/src/cli/dist/index.js +2 -1
  4. package/src/server/dist/index.js +26 -15
  5. package/src/web/dist/assets/About-Bxxb0hlP.js +11 -0
  6. package/src/web/dist/assets/ApiKeys-B57jV3AH.js +16 -0
  7. package/src/web/dist/assets/Button-DIJdkdyt.js +1 -0
  8. package/src/web/dist/assets/Dashboard-Cxu97ZgH.js +16 -0
  9. package/src/web/dist/assets/FormField-JMg-tjrG.js +1 -0
  10. package/src/web/dist/assets/Help-Bcnhv1mL.js +6 -0
  11. package/src/web/dist/assets/Input-BOaaGybK.js +1 -0
  12. package/src/web/dist/assets/Logs-DhIgaGtG.js +1 -0
  13. package/src/web/dist/assets/ModelManagement-BR4fCLUq.js +1 -0
  14. package/src/web/dist/assets/PageSection-Dndgc9r9.js +1 -0
  15. package/src/web/dist/assets/Settings-B83xPKID.js +1 -0
  16. package/src/web/dist/assets/StatusBadge-DOVCfoYm.js +1 -0
  17. package/src/web/dist/assets/copy-CG_L9fTW.js +6 -0
  18. package/src/web/dist/assets/index-CD8snFBp.css +1 -0
  19. package/src/web/dist/assets/index-COB9rriK.js +143 -0
  20. package/src/web/dist/assets/{index-B0rGDFRO.js → index-mV9BV7rj.js} +16 -16
  21. package/src/web/dist/assets/info-DNl8lKHj.js +6 -0
  22. package/src/web/dist/assets/{useApiQuery-De0jYBDD.js → useApiQuery-mnvEnqVq.js} +6 -6
  23. package/src/web/dist/index.html +2 -2
  24. package/src/web/dist/assets/About-Cgfq_d7I.js +0 -1
  25. package/src/web/dist/assets/ApiKeys-C4QbVKdv.js +0 -21
  26. package/src/web/dist/assets/Dashboard-28JGQst7.js +0 -1
  27. package/src/web/dist/assets/Help-BojpuZMh.js +0 -1
  28. package/src/web/dist/assets/Logs-B1rVvkYR.js +0 -1
  29. package/src/web/dist/assets/ModelManagement-DIMCLs1b.js +0 -1
  30. package/src/web/dist/assets/Settings-CB4YZNh9.js +0 -1
  31. package/src/web/dist/assets/index-Gx2WWHJn.css +0 -1
  32. package/src/web/dist/assets/index-wA9rsqII.js +0 -133
@@ -0,0 +1,6 @@
1
+ import{c}from"./index-COB9rriK.js";/**
2
+ * @license lucide-react v0.344.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 o=c("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);export{o as I};
@@ -1,6 +1,6 @@
1
- var ft=e=>{throw TypeError(e)};var Ie=(e,t,n)=>t.has(e)||ft("Cannot "+n);var h=(e,t,n)=>(Ie(e,t,"read from private field"),n?n.call(e):t.get(e)),P=(e,t,n)=>t.has(e)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),O=(e,t,n,s)=>(Ie(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),A=(e,t,n)=>(Ie(e,t,"access private method"),n);import{S as fn,p as dt,d as v,s as qe,e as be,n as He,i as ze,f as ht,t as dn,h as Ce,k as hn,l as pn,m as pt,o as kt,r as V,q as mn,v as yn,w as bn}from"./index-wA9rsqII.js";var k,g,we,U,ne,ce,Q,X,ge,ue,le,se,re,G,fe,R,ye,$e,Je,Qe,Ve,We,Ke,Xe,Bt,Dt,wn=(Dt=class extends fn{constructor(t,n){super();P(this,R);P(this,k);P(this,g);P(this,we);P(this,U);P(this,ne);P(this,ce);P(this,Q);P(this,X);P(this,ge);P(this,ue);P(this,le);P(this,se);P(this,re);P(this,G);P(this,fe,new Set);this.options=n,O(this,k,t),O(this,X,null),O(this,Q,dt()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(h(this,g).addObserver(this),mt(h(this,g),this.options)?A(this,R,ye).call(this):this.updateResult(),A(this,R,Ve).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ge(h(this,g),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ge(h(this,g),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,A(this,R,We).call(this),A(this,R,Ke).call(this),h(this,g).removeObserver(this)}setOptions(t){const n=this.options,s=h(this,g);if(this.options=h(this,k).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof v(this.options.enabled,h(this,g))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");A(this,R,Xe).call(this),h(this,g).setOptions(this.options),n._defaulted&&!qe(this.options,n)&&h(this,k).getQueryCache().notify({type:"observerOptionsUpdated",query:h(this,g),observer:this});const r=this.hasListeners();r&&yt(h(this,g),s,this.options,n)&&A(this,R,ye).call(this),this.updateResult(),r&&(h(this,g)!==s||v(this.options.enabled,h(this,g))!==v(n.enabled,h(this,g))||be(this.options.staleTime,h(this,g))!==be(n.staleTime,h(this,g)))&&A(this,R,$e).call(this);const o=A(this,R,Je).call(this);r&&(h(this,g)!==s||v(this.options.enabled,h(this,g))!==v(n.enabled,h(this,g))||o!==h(this,G))&&A(this,R,Qe).call(this,o)}getOptimisticResult(t){const n=h(this,k).getQueryCache().build(h(this,k),t),s=this.createResult(n,t);return En(this,s)&&(O(this,U,s),O(this,ce,this.options),O(this,ne,h(this,g).state)),s}getCurrentResult(){return h(this,U)}trackResult(t,n){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),n==null||n(r),r==="promise"&&!this.options.experimental_prefetchInRender&&h(this,Q).status==="pending"&&h(this,Q).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(s,r))})}trackProp(t){h(this,fe).add(t)}getCurrentQuery(){return h(this,g)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=h(this,k).defaultQueryOptions(t),s=h(this,k).getQueryCache().build(h(this,k),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(t){return A(this,R,ye).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),h(this,U)))}createResult(t,n){var Z;const s=h(this,g),r=this.options,o=h(this,U),i=h(this,ne),c=h(this,ce),u=t!==s?t.state:h(this,we),{state:l}=t;let p={...l},E=!1,w;if(n._optimisticResults){const N=this.hasListeners(),Y=!N&&mt(t,n),M=N&&yt(t,s,n,r);(Y||M)&&(p={...p,...pn(l.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:f,errorUpdatedAt:y,status:m}=p;w=p.data;let S=!1;if(n.placeholderData!==void 0&&w===void 0&&m==="pending"){let N;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(N=o.data,S=!0):N=typeof n.placeholderData=="function"?n.placeholderData((Z=h(this,le))==null?void 0:Z.state.data,h(this,le)):n.placeholderData,N!==void 0&&(m="success",w=pt(o==null?void 0:o.data,N,n),E=!0)}if(n.select&&w!==void 0&&!S)if(o&&w===(i==null?void 0:i.data)&&n.select===h(this,ge))w=h(this,ue);else try{O(this,ge,n.select),w=n.select(w),w=pt(o==null?void 0:o.data,w,n),O(this,ue,w),O(this,X,null)}catch(N){O(this,X,N)}h(this,X)&&(f=h(this,X),w=h(this,ue),y=Date.now(),m="error");const F=p.fetchStatus==="fetching",T=m==="pending",x=m==="error",L=T&&F,H=w!==void 0,D={status:m,fetchStatus:p.fetchStatus,isPending:T,isSuccess:m==="success",isError:x,isInitialLoading:L,isLoading:L,data:w,dataUpdatedAt:p.dataUpdatedAt,error:f,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:F,isRefetching:F&&!T,isLoadingError:x&&!H,isPaused:p.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:x&&H,isStale:st(t,n),refetch:this.refetch,promise:h(this,Q),isEnabled:v(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const N=z=>{D.status==="error"?z.reject(D.error):D.data!==void 0&&z.resolve(D.data)},Y=()=>{const z=O(this,Q,D.promise=dt());N(z)},M=h(this,Q);switch(M.status){case"pending":t.queryHash===s.queryHash&&N(M);break;case"fulfilled":(D.status==="error"||D.data!==M.value)&&Y();break;case"rejected":(D.status!=="error"||D.error!==M.reason)&&Y();break}}return D}updateResult(){const t=h(this,U),n=this.createResult(h(this,g),this.options);if(O(this,ne,h(this,g).state),O(this,ce,this.options),h(this,ne).data!==void 0&&O(this,le,h(this,g)),qe(n,t))return;O(this,U,n);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!h(this,fe).size)return!0;const i=new Set(o??h(this,fe));return this.options.throwOnError&&i.add("error"),Object.keys(h(this,U)).some(c=>{const d=c;return h(this,U)[d]!==t[d]&&i.has(d)})};A(this,R,Bt).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&A(this,R,Ve).call(this)}},k=new WeakMap,g=new WeakMap,we=new WeakMap,U=new WeakMap,ne=new WeakMap,ce=new WeakMap,Q=new WeakMap,X=new WeakMap,ge=new WeakMap,ue=new WeakMap,le=new WeakMap,se=new WeakMap,re=new WeakMap,G=new WeakMap,fe=new WeakMap,R=new WeakSet,ye=function(t){A(this,R,Xe).call(this);let n=h(this,g).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(He)),n},$e=function(){A(this,R,We).call(this);const t=be(this.options.staleTime,h(this,g));if(ze||h(this,U).isStale||!ht(t))return;const s=dn(h(this,U).dataUpdatedAt,t)+1;O(this,se,Ce.setTimeout(()=>{h(this,U).isStale||this.updateResult()},s))},Je=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(h(this,g)):this.options.refetchInterval)??!1},Qe=function(t){A(this,R,Ke).call(this),O(this,G,t),!(ze||v(this.options.enabled,h(this,g))===!1||!ht(h(this,G))||h(this,G)===0)&&O(this,re,Ce.setInterval(()=>{(this.options.refetchIntervalInBackground||hn.isFocused())&&A(this,R,ye).call(this)},h(this,G)))},Ve=function(){A(this,R,$e).call(this),A(this,R,Qe).call(this,A(this,R,Je).call(this))},We=function(){h(this,se)&&(Ce.clearTimeout(h(this,se)),O(this,se,void 0))},Ke=function(){h(this,re)&&(Ce.clearInterval(h(this,re)),O(this,re,void 0))},Xe=function(){const t=h(this,k).getQueryCache().build(h(this,k),this.options);if(t===h(this,g))return;const n=h(this,g);O(this,g,t),O(this,we,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Bt=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(h(this,U))}),h(this,k).getQueryCache().notify({query:h(this,g),type:"observerResultsUpdated"})})},Dt);function gn(e,t){return v(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mt(e,t){return gn(e,t)||e.state.data!==void 0&&Ge(e,t,t.refetchOnMount)}function Ge(e,t,n){if(v(t.enabled,e)!==!1&&be(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&st(e,t)}return!1}function yt(e,t,n,s){return(e!==t||v(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&st(e,n)}function st(e,t){return v(t.enabled,e)!==!1&&e.isStaleByTime(be(t.staleTime,e))}function En(e,t){return!qe(e.getCurrentResult(),t)}var It=V.createContext(!1),Rn=()=>V.useContext(It);It.Provider;function Sn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var On=V.createContext(Sn()),Tn=()=>V.useContext(On),Cn=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},An=e=>{V.useEffect(()=>{e.clearReset()},[e])},xn=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||mn(n,[e.error,s])),Pn=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Fn=(e,t)=>e.isLoading&&e.isFetching&&!t,_n=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Nn(e,t,n){var p,E,w,f,y;const s=Rn(),r=Tn(),o=yn(),i=o.defaultQueryOptions(e);(E=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||E.call(p,i),i._optimisticResults=s?"isRestoring":"optimistic",Pn(i),Cn(i,r),An(r);const c=!o.getQueryCache().get(i.queryHash),[d]=V.useState(()=>new t(o,i)),u=d.getOptimisticResult(i),l=!s&&e.subscribed!==!1;if(V.useSyncExternalStore(V.useCallback(m=>{const S=l?d.subscribe(kt.batchCalls(m)):He;return d.updateResult(),S},[d,l]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),V.useEffect(()=>{d.setOptions(i)},[i,d]),_n(i,u))throw bt(i,d,r);if(xn({result:u,errorResetBoundary:r,throwOnError:i.throwOnError,query:o.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((f=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||f.call(w,i,u),i.experimental_prefetchInRender&&!ze&&Fn(u,s)){const m=c?bt(i,d,r):(y=o.getQueryCache().get(i.queryHash))==null?void 0:y.promise;m==null||m.catch(He).finally(()=>{d.updateResult()})}return i.notifyOnChangeProps?u:d.trackResult(u)}function Un(e,t){return Nn(e,wn)}function jt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ln}=Object.prototype,{getPrototypeOf:rt}=Object,{iterator:Ne,toStringTag:Mt}=Symbol,Ue=(e=>t=>{const n=Ln.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),q=e=>(e=e.toLowerCase(),t=>Ue(t)===e),Le=e=>t=>typeof t===e,{isArray:he}=Array,de=Le("undefined");function Ee(e){return e!==null&&!de(e)&&e.constructor!==null&&!de(e.constructor)&&B(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vt=q("ArrayBuffer");function Dn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&vt(e.buffer),t}const kn=Le("string"),B=Le("function"),qt=Le("number"),Re=e=>e!==null&&typeof e=="object",Bn=e=>e===!0||e===!1,xe=e=>{if(Ue(e)!=="object")return!1;const t=rt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Mt in e)&&!(Ne in e)},In=e=>{if(!Re(e)||Ee(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jn=q("Date"),Mn=q("File"),vn=q("Blob"),qn=q("FileList"),Hn=e=>Re(e)&&B(e.pipe),zn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||B(e.append)&&((t=Ue(e))==="formdata"||t==="object"&&B(e.toString)&&e.toString()==="[object FormData]"))},$n=q("URLSearchParams"),[Jn,Qn,Vn,Wn]=["ReadableStream","Request","Response","Headers"].map(q),Kn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Se(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),he(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(Ee(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(s=0;s<i;s++)c=o[s],t.call(null,e[c],c,e)}}function Ht(e,t){if(Ee(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const te=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zt=e=>!de(e)&&e!==te;function Ze(){const{caseless:e,skipUndefined:t}=zt(this)&&this||{},n={},s=(r,o)=>{const i=e&&Ht(n,o)||o;xe(n[i])&&xe(r)?n[i]=Ze(n[i],r):xe(r)?n[i]=Ze({},r):he(r)?n[i]=r.slice():(!t||!de(r))&&(n[i]=r)};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Se(arguments[r],s);return n}const Xn=(e,t,n,{allOwnKeys:s}={})=>(Se(t,(r,o)=>{n&&B(r)?e[o]=jt(r,n):e[o]=r},{allOwnKeys:s}),e),Gn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Zn=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Yn=(e,t,n,s)=>{let r,o,i;const c={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)i=r[o],(!s||s(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&rt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},es=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},ts=e=>{if(!e)return null;if(he(e))return e;let t=e.length;if(!qt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ns=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&rt(Uint8Array)),ss=(e,t)=>{const s=(e&&e[Ne]).call(e);let r;for(;(r=s.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},rs=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},is=q("HTMLFormElement"),os=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),wt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),as=q("RegExp"),$t=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Se(n,(r,o)=>{let i;(i=t(r,o,e))!==!1&&(s[o]=i||r)}),Object.defineProperties(e,s)},cs=e=>{$t(e,(t,n)=>{if(B(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(B(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},us=(e,t)=>{const n={},s=r=>{r.forEach(o=>{n[o]=!0})};return he(e)?s(e):s(String(e).split(t)),n},ls=()=>{},fs=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ds(e){return!!(e&&B(e.append)&&e[Mt]==="FormData"&&e[Ne])}const hs=e=>{const t=new Array(10),n=(s,r)=>{if(Re(s)){if(t.indexOf(s)>=0)return;if(Ee(s))return s;if(!("toJSON"in s)){t[r]=s;const o=he(s)?[]:{};return Se(s,(i,c)=>{const d=n(i,r+1);!de(d)&&(o[c]=d)}),t[r]=void 0,o}}return s};return n(e,0)},ps=q("AsyncFunction"),ms=e=>e&&(Re(e)||B(e))&&B(e.then)&&B(e.catch),Jt=((e,t)=>e?setImmediate:t?((n,s)=>(te.addEventListener("message",({source:r,data:o})=>{r===te&&o===n&&s.length&&s.shift()()},!1),r=>{s.push(r),te.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",B(te.postMessage)),ys=typeof queueMicrotask<"u"?queueMicrotask.bind(te):typeof process<"u"&&process.nextTick||Jt,bs=e=>e!=null&&B(e[Ne]),a={isArray:he,isArrayBuffer:vt,isBuffer:Ee,isFormData:zn,isArrayBufferView:Dn,isString:kn,isNumber:qt,isBoolean:Bn,isObject:Re,isPlainObject:xe,isEmptyObject:In,isReadableStream:Jn,isRequest:Qn,isResponse:Vn,isHeaders:Wn,isUndefined:de,isDate:jn,isFile:Mn,isBlob:vn,isRegExp:as,isFunction:B,isStream:Hn,isURLSearchParams:$n,isTypedArray:ns,isFileList:qn,forEach:Se,merge:Ze,extend:Xn,trim:Kn,stripBOM:Gn,inherits:Zn,toFlatObject:Yn,kindOf:Ue,kindOfTest:q,endsWith:es,toArray:ts,forEachEntry:ss,matchAll:rs,isHTMLForm:is,hasOwnProperty:wt,hasOwnProp:wt,reduceDescriptors:$t,freezeMethods:cs,toObjectSet:us,toCamelCase:os,noop:ls,toFiniteNumber:fs,findKey:Ht,global:te,isContextDefined:zt,isSpecCompliantForm:ds,toJSONObject:hs,isAsyncFn:ps,isThenable:ms,setImmediate:Jt,asap:ys,isIterable:bs};function b(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}a.inherits(b,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Qt=b.prototype,Vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Vt[e]={value:e}});Object.defineProperties(b,Vt);Object.defineProperty(Qt,"isAxiosError",{value:!0});b.from=(e,t,n,s,r,o)=>{const i=Object.create(Qt);a.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return b.call(i,c,d,n,s,r),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const ws=null;function Ye(e){return a.isPlainObject(e)||a.isArray(e)}function Wt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function gt(e,t,n){return e?e.concat(t).map(function(r,o){return r=Wt(r),!n&&o?"["+r+"]":r}).join(n?".":""):t}function gs(e){return a.isArray(e)&&!e.some(Ye)}const Es=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function De(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,m){return!a.isUndefined(m[y])});const s=n.metaTokens,r=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!d&&a.isBlob(f))throw new b("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,y,m){let S=f;if(f&&!m&&typeof f=="object"){if(a.endsWith(y,"{}"))y=s?y:y.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&gs(f)||(a.isFileList(f)||a.endsWith(y,"[]"))&&(S=a.toArray(f)))return y=Wt(y),S.forEach(function(T,x){!(a.isUndefined(T)||T===null)&&t.append(i===!0?gt([y],x,o):i===null?y:y+"[]",u(T))}),!1}return Ye(f)?!0:(t.append(gt(m,y,o),u(f)),!1)}const p=[],E=Object.assign(Es,{defaultVisitor:l,convertValue:u,isVisitable:Ye});function w(f,y){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(f),a.forEach(f,function(S,F){(!(a.isUndefined(S)||S===null)&&r.call(t,S,a.isString(F)?F.trim():F,y,E))===!0&&w(S,y?y.concat(F):[F])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function Et(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function it(e,t){this._pairs=[],e&&De(e,this,t)}const Kt=it.prototype;Kt.append=function(t,n){this._pairs.push([t,n])};Kt.toString=function(t){const n=t?function(s){return t.call(this,s,Et)}:Et;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Rs(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xt(e,t,n){if(!t)return e;const s=n&&n.encode||Rs;a.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let o;if(r?o=r(t,n):o=a.isURLSearchParams(t)?t.toString():new it(t,n).toString(s),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Rt{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Gt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ss=typeof URLSearchParams<"u"?URLSearchParams:it,Os=typeof FormData<"u"?FormData:null,Ts=typeof Blob<"u"?Blob:null,Cs={isBrowser:!0,classes:{URLSearchParams:Ss,FormData:Os,Blob:Ts},protocols:["http","https","file","blob","url","data"]},ot=typeof window<"u"&&typeof document<"u",et=typeof navigator=="object"&&navigator||void 0,As=ot&&(!et||["ReactNative","NativeScript","NS"].indexOf(et.product)<0),xs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ps=ot&&window.location.href||"http://localhost",Fs=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ot,hasStandardBrowserEnv:As,hasStandardBrowserWebWorkerEnv:xs,navigator:et,origin:Ps},Symbol.toStringTag,{value:"Module"})),_={...Fs,...Cs};function _s(e,t){return De(e,new _.classes.URLSearchParams,{visitor:function(n,s,r,o){return _.isNode&&a.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Ns(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Us(e){const t={},n=Object.keys(e);let s;const r=n.length;let o;for(s=0;s<r;s++)o=n[s],t[o]=e[o];return t}function Zt(e){function t(n,s,r,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),d=o>=n.length;return i=!i&&a.isArray(r)?r.length:i,d?(a.hasOwnProp(r,i)?r[i]=[r[i],s]:r[i]=s,!c):((!r[i]||!a.isObject(r[i]))&&(r[i]=[]),t(n,s,r[i],o)&&a.isArray(r[i])&&(r[i]=Us(r[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(s,r)=>{t(Ns(s),r,n,0)}),n}return null}function Ls(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Oe={transitional:Gt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r?JSON.stringify(Zt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return _s(t,this.formSerializer).toString();if((c=a.isFileList(t))||s.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return De(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||r?(n.setContentType("application/json",!1),Ls(t)):t}],transformResponse:[function(t){const n=this.transitional||Oe.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(s&&!this.responseType||r)){const i=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?b.from(c,b.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_.classes.FormData,Blob:_.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{Oe.headers[e]={}});const Ds=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ks=e=>{const t={};let n,s,r;return e&&e.split(`
2
- `).forEach(function(i){r=i.indexOf(":"),n=i.substring(0,r).trim().toLowerCase(),s=i.substring(r+1).trim(),!(!n||t[n]&&Ds[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},St=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function Pe(e){return e===!1||e==null?e:a.isArray(e)?e.map(Pe):String(e)}function Bs(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Is=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function je(e,t,n,s,r){if(a.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!a.isString(t)){if(a.isString(s))return t.indexOf(s)!==-1;if(a.isRegExp(s))return s.test(t)}}function js(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Ms(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,i){return this[s].call(this,t,r,o,i)},configurable:!0})})}let I=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(c,d,u){const l=me(d);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(r,l);(!p||r[p]===void 0||u===!0||u===void 0&&r[p]!==!1)&&(r[p||d]=Pe(c))}const i=(c,d)=>a.forEach(c,(u,l)=>o(u,l,d));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!Is(t))i(ks(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},d,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(d=c[u])?a.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,s);return this}get(t,n){if(t=me(t),t){const s=a.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return Bs(r);if(a.isFunction(n))return n.call(this,r,s);if(a.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=me(t),t){const s=a.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||je(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(i){if(i=me(i),i){const c=a.findKey(s,i);c&&(!n||je(s,s[c],c,n))&&(delete s[c],r=!0)}}return a.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||je(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return a.forEach(this,(r,o)=>{const i=a.findKey(s,o);if(i){n[i]=Pe(r),delete n[o];return}const c=t?js(o):String(o).trim();c!==o&&delete n[o],n[c]=Pe(r),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&a.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[St]=this[St]={accessors:{}}).accessors,r=this.prototype;function o(i){const c=me(i);s[c]||(Ms(r,i),s[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});a.freezeMethods(I);function Me(e,t){const n=this||Oe,s=t||n,r=I.from(s.headers);let o=s.data;return a.forEach(e,function(c){o=c.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Yt(e){return!!(e&&e.__CANCEL__)}function pe(e,t,n){b.call(this,e??"canceled",b.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(pe,b,{__CANCEL__:!0});function en(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new b("Request failed with status code "+n.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vs(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qs(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const u=Date.now(),l=s[o];i||(i=u),n[r]=d,s[r]=u;let p=o,E=0;for(;p!==r;)E+=n[p++],p=p%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),u-i<t)return;const w=l&&u-l;return w?Math.round(E*1e3/w):void 0}}function Hs(e,t){let n=0,s=1e3/t,r,o;const i=(u,l=Date.now())=>{n=l,r=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=s?i(u,l):(r=u,o||(o=setTimeout(()=>{o=null,i(r)},s-p)))},()=>r&&i(r)]}const _e=(e,t,n=3)=>{let s=0;const r=qs(50,250);return Hs(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,d=i-s,u=r(d),l=i<=c;s=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Ot=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Tt=e=>(...t)=>a.asap(()=>e(...t)),zs=_.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,_.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(_.origin),_.navigator&&/(msie|trident)/i.test(_.navigator.userAgent)):()=>!0,$s=_.hasStandardBrowserEnv?{write(e,t,n,s,r,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(s)&&i.push("path="+s),a.isString(r)&&i.push("domain="+r),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Js(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Qs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function tn(e,t,n){let s=!Js(t);return e&&(s||n==!1)?Qs(e,t):t}const Ct=e=>e instanceof I?{...e}:e;function oe(e,t){t=t||{};const n={};function s(u,l,p,E){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:E},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function r(u,l,p,E){if(a.isUndefined(l)){if(!a.isUndefined(u))return s(void 0,u,p,E)}else return s(u,l,p,E)}function o(u,l){if(!a.isUndefined(l))return s(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return s(void 0,u)}else return s(void 0,l)}function c(u,l,p){if(p in t)return s(u,l);if(p in e)return s(void 0,u)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,p)=>r(Ct(u),Ct(l),p,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const p=d[l]||r,E=p(e[l],t[l],l);a.isUndefined(E)&&p!==c||(n[l]=E)}),n}const nn=e=>{const t=oe({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=I.from(i),t.url=Xt(tn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(_.hasStandardBrowserEnv||_.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const d=n.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(_.hasStandardBrowserEnv&&(s&&a.isFunction(s)&&(s=s(t)),s||s!==!1&&zs(t.url))){const d=r&&o&&$s.read(o);d&&i.set(r,d)}return t},Vs=typeof XMLHttpRequest<"u",Ws=Vs&&function(e){return new Promise(function(n,s){const r=nn(e);let o=r.data;const i=I.from(r.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=r,l,p,E,w,f;function y(){w&&w(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout;function S(){if(!m)return;const T=I.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),L={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:T,config:e,request:m};en(function(j){n(j),y()},function(j){s(j),y()},L),m=null}"onloadend"in m?m.onloadend=S:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(S)},m.onabort=function(){m&&(s(new b("Request aborted",b.ECONNABORTED,e,m)),m=null)},m.onerror=function(x){const L=x&&x.message?x.message:"Network Error",H=new b(L,b.ERR_NETWORK,e,m);H.event=x||null,s(H),m=null},m.ontimeout=function(){let x=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const L=r.transitional||Gt;r.timeoutErrorMessage&&(x=r.timeoutErrorMessage),s(new b(x,L.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,e,m)),m=null},o===void 0&&i.setContentType(null),"setRequestHeader"in m&&a.forEach(i.toJSON(),function(x,L){m.setRequestHeader(L,x)}),a.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),c&&c!=="json"&&(m.responseType=r.responseType),u&&([E,f]=_e(u,!0),m.addEventListener("progress",E)),d&&m.upload&&([p,w]=_e(d),m.upload.addEventListener("progress",p),m.upload.addEventListener("loadend",w)),(r.cancelToken||r.signal)&&(l=T=>{m&&(s(!T||T.type?new pe(null,e,m):T),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const F=vs(r.url);if(F&&_.protocols.indexOf(F)===-1){s(new b("Unsupported protocol "+F+":",b.ERR_BAD_REQUEST,e));return}m.send(o||null)})},Ks=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const o=function(u){if(!r){r=!0,c();const l=u instanceof Error?u:this.reason;s.abort(l instanceof b?l:new pe(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new b(`timeout ${t} of ms exceeded`,b.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:d}=s;return d.unsubscribe=()=>a.asap(c),d}},Xs=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,r;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Gs=async function*(e,t){for await(const n of Zs(e))yield*Xs(n,t)},Zs=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},At=(e,t,n,s)=>{const r=Gs(e,t);let o=0,i,c=d=>{i||(i=!0,s&&s(d))};return new ReadableStream({async pull(d){try{const{done:u,value:l}=await r.next();if(u){c(),d.close();return}let p=l.byteLength;if(n){let E=o+=p;n(E)}d.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(d){return c(d),r.return()}},{highWaterMark:2})},xt=64*1024,{isFunction:Ae}=a,Ys=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Pt,TextEncoder:Ft}=a.global,_t=(e,...t)=>{try{return!!e(...t)}catch{return!1}},er=e=>{e=a.merge.call({skipUndefined:!0},Ys,e);const{fetch:t,Request:n,Response:s}=e,r=t?Ae(t):typeof fetch=="function",o=Ae(n),i=Ae(s);if(!r)return!1;const c=r&&Ae(Pt),d=r&&(typeof Ft=="function"?(f=>y=>f.encode(y))(new Ft):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=o&&c&&_t(()=>{let f=!1;const y=new n(_.origin,{body:new Pt,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),l=i&&c&&_t(()=>a.isReadableStream(new s("").body)),p={stream:l&&(f=>f.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!p[f]&&(p[f]=(y,m)=>{let S=y&&y[f];if(S)return S.call(y);throw new b(`Response type '${f}' is not supported`,b.ERR_NOT_SUPPORT,m)})});const E=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(_.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await d(f)).byteLength},w=async(f,y)=>{const m=a.toFiniteNumber(f.getContentLength());return m??E(y)};return async f=>{let{url:y,method:m,data:S,signal:F,cancelToken:T,timeout:x,onDownloadProgress:L,onUploadProgress:H,responseType:j,headers:D,withCredentials:Z="same-origin",fetchOptions:N}=nn(f),Y=t||fetch;j=j?(j+"").toLowerCase():"text";let M=Ks([F,T&&T.toAbortSignal()],x),z=null;const ee=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let at;try{if(H&&u&&m!=="get"&&m!=="head"&&(at=await w(D,S))!==0){let K=new n(y,{method:"POST",body:S,duplex:"half"}),ae;if(a.isFormData(S)&&(ae=K.headers.get("content-type"))&&D.setContentType(ae),K.body){const[Be,Te]=Ot(at,_e(Tt(H)));S=At(K.body,xt,Be,Te)}}a.isString(Z)||(Z=Z?"include":"omit");const $=o&&"credentials"in n.prototype,ct={...N,signal:M,method:m.toUpperCase(),headers:D.normalize().toJSON(),body:S,duplex:"half",credentials:$?Z:void 0};z=o&&new n(y,ct);let W=await(o?Y(z,N):Y(y,ct));const ut=l&&(j==="stream"||j==="response");if(l&&(L||ut&&ee)){const K={};["status","statusText","headers"].forEach(lt=>{K[lt]=W[lt]});const ae=a.toFiniteNumber(W.headers.get("content-length")),[Be,Te]=L&&Ot(ae,_e(Tt(L),!0))||[];W=new s(At(W.body,xt,Be,()=>{Te&&Te(),ee&&ee()}),K)}j=j||"text";let ln=await p[a.findKey(p,j)||"text"](W,f);return!ut&&ee&&ee(),await new Promise((K,ae)=>{en(K,ae,{data:ln,headers:I.from(W.headers),status:W.status,statusText:W.statusText,config:f,request:z})})}catch($){throw ee&&ee(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,f,z),{cause:$.cause||$}):b.from($,$&&$.code,f,z)}}},tr=new Map,sn=e=>{let t=e?e.env:{};const{fetch:n,Request:s,Response:r}=t,o=[s,r,n];let i=o.length,c=i,d,u,l=tr;for(;c--;)d=o[c],u=l.get(d),u===void 0&&l.set(d,u=c?new Map:er(t)),l=u;return u};sn();const tt={http:ws,xhr:Ws,fetch:{get:sn}};a.forEach(tt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Nt=e=>`- ${e}`,nr=e=>a.isFunction(e)||e===null||e===!1,rn={getAdapter:(e,t)=>{e=a.isArray(e)?e:[e];const{length:n}=e;let s,r;const o={};for(let i=0;i<n;i++){s=e[i];let c;if(r=s,!nr(s)&&(r=tt[(c=String(s)).toLowerCase()],r===void 0))throw new b(`Unknown adapter '${c}'`);if(r&&(a.isFunction(r)||(r=r.get(t))))break;o[c||"#"+i]=r}if(!r){const i=Object.entries(o).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
4
- `+i.map(Nt).join(`
5
- `):" "+Nt(i[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r},adapters:tt};function ve(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function Ut(e){return ve(e),e.headers=I.from(e.headers),e.data=Me.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rn.getAdapter(e.adapter||Oe.adapter,e)(e).then(function(s){return ve(e),s.data=Me.call(e,e.transformResponse,s),s.headers=I.from(s.headers),s},function(s){return Yt(s)||(ve(e),s&&s.response&&(s.response.data=Me.call(e,e.transformResponse,s.response),s.response.headers=I.from(s.response.headers))),Promise.reject(s)})}const on="1.12.2",ke={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ke[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Lt={};ke.transitional=function(t,n,s){function r(o,i){return"[Axios v"+on+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,c)=>{if(t===!1)throw new b(r(i," has been removed"+(n?" in "+n:"")),b.ERR_DEPRECATED);return n&&!Lt[i]&&(Lt[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};ke.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function sr(e,t,n){if(typeof e!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],i=t[o];if(i){const c=e[o],d=c===void 0||i(c,o,e);if(d!==!0)throw new b("option "+o+" must be "+d,b.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const Fe={assertOptions:sr,validators:ke},J=Fe.validators;let ie=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Rt,response:new Rt}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=oe(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:Fe.assertOptions(r,{encode:J.function,serialize:J.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fe.assertOptions(n,{baseUrl:J.spelling("baseURL"),withXsrfToken:J.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=I.concat(i,o);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,p=0,E;if(!d){const f=[Ut.bind(this),void 0];for(f.unshift(...c),f.push(...u),E=f.length,l=Promise.resolve(n);p<E;)l=l.then(f[p++],f[p++]);return l}E=c.length;let w=n;for(;p<E;){const f=c[p++],y=c[p++];try{w=f(w)}catch(m){y.call(this,m);break}}try{l=Ut.call(this,w)}catch(f){return Promise.reject(f)}for(p=0,E=u.length;p<E;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=oe(this.defaults,t);const n=tn(t.baseURL,t.url,t.allowAbsoluteUrls);return Xt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){ie.prototype[t]=function(n,s){return this.request(oe(s||{},{method:t,url:n,data:(s||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(s){return function(o,i,c){return this.request(oe(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ie.prototype[t]=n(),ie.prototype[t+"Form"]=n(!0)});let rr=class an{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(c=>{s.subscribe(c),o=c}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,c){s.reason||(s.reason=new pe(o,i,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new an(function(r){t=r}),cancel:t}}};function ir(e){return function(n){return e.apply(null,n)}}function or(e){return a.isObject(e)&&e.isAxiosError===!0}const nt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(nt).forEach(([e,t])=>{nt[t]=e});function cn(e){const t=new ie(e),n=jt(ie.prototype.request,t);return a.extend(n,ie.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return cn(oe(e,r))},n}const C=cn(Oe);C.Axios=ie;C.CanceledError=pe;C.CancelToken=rr;C.isCancel=Yt;C.VERSION=on;C.toFormData=De;C.AxiosError=b;C.Cancel=C.CanceledError;C.all=function(t){return Promise.all(t)};C.spread=ir;C.isAxiosError=or;C.mergeConfig=oe;C.AxiosHeaders=I;C.formToJSON=e=>Zt(a.isHTMLForm(e)?new FormData(e):e);C.getAdapter=rn.getAdapter;C.HttpStatusCode=nt;C.default=C;const{Axios:dr,AxiosError:hr,CanceledError:pr,isCancel:mr,CancelToken:yr,VERSION:br,all:wr,Cancel:gr,isAxiosError:Er,spread:Rr,toFormData:Sr,AxiosHeaders:Or,HttpStatusCode:Tr,formToJSON:Cr,getAdapter:Ar,mergeConfig:xr}=C,un=C.create({baseURL:"/",timeout:15e3});un.interceptors.response.use(e=>e,e=>Promise.reject(e));function ar(e){var t,n,s;if(C.isAxiosError(e)){const r=(t=e.response)==null?void 0:t.status;return{message:((s=(n=e.response)==null?void 0:n.data)==null?void 0:s.error)||e.message||"请求失败,请稍后再试",status:r,code:String(r??"unknown")}}return{message:e instanceof Error?e.message:"请求失败,请稍后再试"}}function Pr(e,t,n){return Un({queryKey:e,placeholderData:bn,...n,queryFn:async()=>{try{return(await un.request(t)).data}catch(s){throw ar(s)}}})}export{un as a,Pr as u};
1
+ var ft=e=>{throw TypeError(e)};var Ie=(e,t,n)=>t.has(e)||ft("Cannot "+n);var h=(e,t,n)=>(Ie(e,t,"read from private field"),n?n.call(e):t.get(e)),P=(e,t,n)=>t.has(e)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),O=(e,t,n,s)=>(Ie(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),A=(e,t,n)=>(Ie(e,t,"access private method"),n);import{E as fn,G as dt,H as v,I as qe,J as be,M as He,N as ze,O as ht,P as dn,Q as Ce,T as hn,U as pn,V as pt,W as Bt,r as V,X as mn,Y as yn,Z as bn}from"./index-COB9rriK.js";var B,g,we,U,ne,ce,Q,X,ge,ue,le,se,re,G,fe,R,ye,$e,Je,Qe,Ve,We,Ke,Xe,kt,Dt,wn=(Dt=class extends fn{constructor(t,n){super();P(this,R);P(this,B);P(this,g);P(this,we);P(this,U);P(this,ne);P(this,ce);P(this,Q);P(this,X);P(this,ge);P(this,ue);P(this,le);P(this,se);P(this,re);P(this,G);P(this,fe,new Set);this.options=n,O(this,B,t),O(this,X,null),O(this,Q,dt()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(h(this,g).addObserver(this),mt(h(this,g),this.options)?A(this,R,ye).call(this):this.updateResult(),A(this,R,Ve).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ge(h(this,g),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ge(h(this,g),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,A(this,R,We).call(this),A(this,R,Ke).call(this),h(this,g).removeObserver(this)}setOptions(t){const n=this.options,s=h(this,g);if(this.options=h(this,B).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof v(this.options.enabled,h(this,g))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");A(this,R,Xe).call(this),h(this,g).setOptions(this.options),n._defaulted&&!qe(this.options,n)&&h(this,B).getQueryCache().notify({type:"observerOptionsUpdated",query:h(this,g),observer:this});const r=this.hasListeners();r&&yt(h(this,g),s,this.options,n)&&A(this,R,ye).call(this),this.updateResult(),r&&(h(this,g)!==s||v(this.options.enabled,h(this,g))!==v(n.enabled,h(this,g))||be(this.options.staleTime,h(this,g))!==be(n.staleTime,h(this,g)))&&A(this,R,$e).call(this);const o=A(this,R,Je).call(this);r&&(h(this,g)!==s||v(this.options.enabled,h(this,g))!==v(n.enabled,h(this,g))||o!==h(this,G))&&A(this,R,Qe).call(this,o)}getOptimisticResult(t){const n=h(this,B).getQueryCache().build(h(this,B),t),s=this.createResult(n,t);return En(this,s)&&(O(this,U,s),O(this,ce,this.options),O(this,ne,h(this,g).state)),s}getCurrentResult(){return h(this,U)}trackResult(t,n){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),n==null||n(r),r==="promise"&&!this.options.experimental_prefetchInRender&&h(this,Q).status==="pending"&&h(this,Q).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(s,r))})}trackProp(t){h(this,fe).add(t)}getCurrentQuery(){return h(this,g)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=h(this,B).defaultQueryOptions(t),s=h(this,B).getQueryCache().build(h(this,B),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(t){return A(this,R,ye).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),h(this,U)))}createResult(t,n){var Z;const s=h(this,g),r=this.options,o=h(this,U),i=h(this,ne),c=h(this,ce),u=t!==s?t.state:h(this,we),{state:l}=t;let p={...l},E=!1,w;if(n._optimisticResults){const _=this.hasListeners(),Y=!_&&mt(t,n),j=_&&yt(t,s,n,r);(Y||j)&&(p={...p,...pn(l.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:f,errorUpdatedAt:y,status:m}=p;w=p.data;let S=!1;if(n.placeholderData!==void 0&&w===void 0&&m==="pending"){let _;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(_=o.data,S=!0):_=typeof n.placeholderData=="function"?n.placeholderData((Z=h(this,le))==null?void 0:Z.state.data,h(this,le)):n.placeholderData,_!==void 0&&(m="success",w=pt(o==null?void 0:o.data,_,n),E=!0)}if(n.select&&w!==void 0&&!S)if(o&&w===(i==null?void 0:i.data)&&n.select===h(this,ge))w=h(this,ue);else try{O(this,ge,n.select),w=n.select(w),w=pt(o==null?void 0:o.data,w,n),O(this,ue,w),O(this,X,null)}catch(_){O(this,X,_)}h(this,X)&&(f=h(this,X),w=h(this,ue),y=Date.now(),m="error");const F=p.fetchStatus==="fetching",T=m==="pending",x=m==="error",L=T&&F,H=w!==void 0,D={status:m,fetchStatus:p.fetchStatus,isPending:T,isSuccess:m==="success",isError:x,isInitialLoading:L,isLoading:L,data:w,dataUpdatedAt:p.dataUpdatedAt,error:f,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:F,isRefetching:F&&!T,isLoadingError:x&&!H,isPaused:p.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:x&&H,isStale:st(t,n),refetch:this.refetch,promise:h(this,Q),isEnabled:v(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const _=z=>{D.status==="error"?z.reject(D.error):D.data!==void 0&&z.resolve(D.data)},Y=()=>{const z=O(this,Q,D.promise=dt());_(z)},j=h(this,Q);switch(j.status){case"pending":t.queryHash===s.queryHash&&_(j);break;case"fulfilled":(D.status==="error"||D.data!==j.value)&&Y();break;case"rejected":(D.status!=="error"||D.error!==j.reason)&&Y();break}}return D}updateResult(){const t=h(this,U),n=this.createResult(h(this,g),this.options);if(O(this,ne,h(this,g).state),O(this,ce,this.options),h(this,ne).data!==void 0&&O(this,le,h(this,g)),qe(n,t))return;O(this,U,n);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!h(this,fe).size)return!0;const i=new Set(o??h(this,fe));return this.options.throwOnError&&i.add("error"),Object.keys(h(this,U)).some(c=>{const d=c;return h(this,U)[d]!==t[d]&&i.has(d)})};A(this,R,kt).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&A(this,R,Ve).call(this)}},B=new WeakMap,g=new WeakMap,we=new WeakMap,U=new WeakMap,ne=new WeakMap,ce=new WeakMap,Q=new WeakMap,X=new WeakMap,ge=new WeakMap,ue=new WeakMap,le=new WeakMap,se=new WeakMap,re=new WeakMap,G=new WeakMap,fe=new WeakMap,R=new WeakSet,ye=function(t){A(this,R,Xe).call(this);let n=h(this,g).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(He)),n},$e=function(){A(this,R,We).call(this);const t=be(this.options.staleTime,h(this,g));if(ze||h(this,U).isStale||!ht(t))return;const s=dn(h(this,U).dataUpdatedAt,t)+1;O(this,se,Ce.setTimeout(()=>{h(this,U).isStale||this.updateResult()},s))},Je=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(h(this,g)):this.options.refetchInterval)??!1},Qe=function(t){A(this,R,Ke).call(this),O(this,G,t),!(ze||v(this.options.enabled,h(this,g))===!1||!ht(h(this,G))||h(this,G)===0)&&O(this,re,Ce.setInterval(()=>{(this.options.refetchIntervalInBackground||hn.isFocused())&&A(this,R,ye).call(this)},h(this,G)))},Ve=function(){A(this,R,$e).call(this),A(this,R,Qe).call(this,A(this,R,Je).call(this))},We=function(){h(this,se)&&(Ce.clearTimeout(h(this,se)),O(this,se,void 0))},Ke=function(){h(this,re)&&(Ce.clearInterval(h(this,re)),O(this,re,void 0))},Xe=function(){const t=h(this,B).getQueryCache().build(h(this,B),this.options);if(t===h(this,g))return;const n=h(this,g);O(this,g,t),O(this,we,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},kt=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(h(this,U))}),h(this,B).getQueryCache().notify({query:h(this,g),type:"observerResultsUpdated"})})},Dt);function gn(e,t){return v(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mt(e,t){return gn(e,t)||e.state.data!==void 0&&Ge(e,t,t.refetchOnMount)}function Ge(e,t,n){if(v(t.enabled,e)!==!1&&be(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&st(e,t)}return!1}function yt(e,t,n,s){return(e!==t||v(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&st(e,n)}function st(e,t){return v(t.enabled,e)!==!1&&e.isStaleByTime(be(t.staleTime,e))}function En(e,t){return!qe(e.getCurrentResult(),t)}var It=V.createContext(!1),Rn=()=>V.useContext(It);It.Provider;function Sn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var On=V.createContext(Sn()),Tn=()=>V.useContext(On),Cn=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},An=e=>{V.useEffect(()=>{e.clearReset()},[e])},xn=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||mn(n,[e.error,s])),Pn=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Fn=(e,t)=>e.isLoading&&e.isFetching&&!t,Nn=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _n(e,t,n){var p,E,w,f,y;const s=Rn(),r=Tn(),o=yn(),i=o.defaultQueryOptions(e);(E=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||E.call(p,i),i._optimisticResults=s?"isRestoring":"optimistic",Pn(i),Cn(i,r),An(r);const c=!o.getQueryCache().get(i.queryHash),[d]=V.useState(()=>new t(o,i)),u=d.getOptimisticResult(i),l=!s&&e.subscribed!==!1;if(V.useSyncExternalStore(V.useCallback(m=>{const S=l?d.subscribe(Bt.batchCalls(m)):He;return d.updateResult(),S},[d,l]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),V.useEffect(()=>{d.setOptions(i)},[i,d]),Nn(i,u))throw bt(i,d,r);if(xn({result:u,errorResetBoundary:r,throwOnError:i.throwOnError,query:o.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((f=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||f.call(w,i,u),i.experimental_prefetchInRender&&!ze&&Fn(u,s)){const m=c?bt(i,d,r):(y=o.getQueryCache().get(i.queryHash))==null?void 0:y.promise;m==null||m.catch(He).finally(()=>{d.updateResult()})}return i.notifyOnChangeProps?u:d.trackResult(u)}function Un(e,t){return _n(e,wn)}function Mt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ln}=Object.prototype,{getPrototypeOf:rt}=Object,{iterator:_e,toStringTag:jt}=Symbol,Ue=(e=>t=>{const n=Ln.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),q=e=>(e=e.toLowerCase(),t=>Ue(t)===e),Le=e=>t=>typeof t===e,{isArray:he}=Array,de=Le("undefined");function Ee(e){return e!==null&&!de(e)&&e.constructor!==null&&!de(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vt=q("ArrayBuffer");function Dn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&vt(e.buffer),t}const Bn=Le("string"),k=Le("function"),qt=Le("number"),Re=e=>e!==null&&typeof e=="object",kn=e=>e===!0||e===!1,xe=e=>{if(Ue(e)!=="object")return!1;const t=rt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(jt in e)&&!(_e in e)},In=e=>{if(!Re(e)||Ee(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Mn=q("Date"),jn=q("File"),vn=q("Blob"),qn=q("FileList"),Hn=e=>Re(e)&&k(e.pipe),zn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||k(e.append)&&((t=Ue(e))==="formdata"||t==="object"&&k(e.toString)&&e.toString()==="[object FormData]"))},$n=q("URLSearchParams"),[Jn,Qn,Vn,Wn]=["ReadableStream","Request","Response","Headers"].map(q),Kn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Se(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),he(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(Ee(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(s=0;s<i;s++)c=o[s],t.call(null,e[c],c,e)}}function Ht(e,t){if(Ee(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const te=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zt=e=>!de(e)&&e!==te;function Ze(){const{caseless:e,skipUndefined:t}=zt(this)&&this||{},n={},s=(r,o)=>{const i=e&&Ht(n,o)||o;xe(n[i])&&xe(r)?n[i]=Ze(n[i],r):xe(r)?n[i]=Ze({},r):he(r)?n[i]=r.slice():(!t||!de(r))&&(n[i]=r)};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Se(arguments[r],s);return n}const Xn=(e,t,n,{allOwnKeys:s}={})=>(Se(t,(r,o)=>{n&&k(r)?e[o]=Mt(r,n):e[o]=r},{allOwnKeys:s}),e),Gn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Zn=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Yn=(e,t,n,s)=>{let r,o,i;const c={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)i=r[o],(!s||s(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&rt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},es=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},ts=e=>{if(!e)return null;if(he(e))return e;let t=e.length;if(!qt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ns=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&rt(Uint8Array)),ss=(e,t)=>{const s=(e&&e[_e]).call(e);let r;for(;(r=s.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},rs=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},is=q("HTMLFormElement"),os=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),wt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),as=q("RegExp"),$t=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Se(n,(r,o)=>{let i;(i=t(r,o,e))!==!1&&(s[o]=i||r)}),Object.defineProperties(e,s)},cs=e=>{$t(e,(t,n)=>{if(k(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(k(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},us=(e,t)=>{const n={},s=r=>{r.forEach(o=>{n[o]=!0})};return he(e)?s(e):s(String(e).split(t)),n},ls=()=>{},fs=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ds(e){return!!(e&&k(e.append)&&e[jt]==="FormData"&&e[_e])}const hs=e=>{const t=new Array(10),n=(s,r)=>{if(Re(s)){if(t.indexOf(s)>=0)return;if(Ee(s))return s;if(!("toJSON"in s)){t[r]=s;const o=he(s)?[]:{};return Se(s,(i,c)=>{const d=n(i,r+1);!de(d)&&(o[c]=d)}),t[r]=void 0,o}}return s};return n(e,0)},ps=q("AsyncFunction"),ms=e=>e&&(Re(e)||k(e))&&k(e.then)&&k(e.catch),Jt=((e,t)=>e?setImmediate:t?((n,s)=>(te.addEventListener("message",({source:r,data:o})=>{r===te&&o===n&&s.length&&s.shift()()},!1),r=>{s.push(r),te.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",k(te.postMessage)),ys=typeof queueMicrotask<"u"?queueMicrotask.bind(te):typeof process<"u"&&process.nextTick||Jt,bs=e=>e!=null&&k(e[_e]),a={isArray:he,isArrayBuffer:vt,isBuffer:Ee,isFormData:zn,isArrayBufferView:Dn,isString:Bn,isNumber:qt,isBoolean:kn,isObject:Re,isPlainObject:xe,isEmptyObject:In,isReadableStream:Jn,isRequest:Qn,isResponse:Vn,isHeaders:Wn,isUndefined:de,isDate:Mn,isFile:jn,isBlob:vn,isRegExp:as,isFunction:k,isStream:Hn,isURLSearchParams:$n,isTypedArray:ns,isFileList:qn,forEach:Se,merge:Ze,extend:Xn,trim:Kn,stripBOM:Gn,inherits:Zn,toFlatObject:Yn,kindOf:Ue,kindOfTest:q,endsWith:es,toArray:ts,forEachEntry:ss,matchAll:rs,isHTMLForm:is,hasOwnProperty:wt,hasOwnProp:wt,reduceDescriptors:$t,freezeMethods:cs,toObjectSet:us,toCamelCase:os,noop:ls,toFiniteNumber:fs,findKey:Ht,global:te,isContextDefined:zt,isSpecCompliantForm:ds,toJSONObject:hs,isAsyncFn:ps,isThenable:ms,setImmediate:Jt,asap:ys,isIterable:bs};function b(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}a.inherits(b,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Qt=b.prototype,Vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Vt[e]={value:e}});Object.defineProperties(b,Vt);Object.defineProperty(Qt,"isAxiosError",{value:!0});b.from=(e,t,n,s,r,o)=>{const i=Object.create(Qt);a.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return b.call(i,c,d,n,s,r),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const ws=null;function Ye(e){return a.isPlainObject(e)||a.isArray(e)}function Wt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function gt(e,t,n){return e?e.concat(t).map(function(r,o){return r=Wt(r),!n&&o?"["+r+"]":r}).join(n?".":""):t}function gs(e){return a.isArray(e)&&!e.some(Ye)}const Es=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function De(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,m){return!a.isUndefined(m[y])});const s=n.metaTokens,r=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!d&&a.isBlob(f))throw new b("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,y,m){let S=f;if(f&&!m&&typeof f=="object"){if(a.endsWith(y,"{}"))y=s?y:y.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&gs(f)||(a.isFileList(f)||a.endsWith(y,"[]"))&&(S=a.toArray(f)))return y=Wt(y),S.forEach(function(T,x){!(a.isUndefined(T)||T===null)&&t.append(i===!0?gt([y],x,o):i===null?y:y+"[]",u(T))}),!1}return Ye(f)?!0:(t.append(gt(m,y,o),u(f)),!1)}const p=[],E=Object.assign(Es,{defaultVisitor:l,convertValue:u,isVisitable:Ye});function w(f,y){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));p.push(f),a.forEach(f,function(S,F){(!(a.isUndefined(S)||S===null)&&r.call(t,S,a.isString(F)?F.trim():F,y,E))===!0&&w(S,y?y.concat(F):[F])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}function Et(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function it(e,t){this._pairs=[],e&&De(e,this,t)}const Kt=it.prototype;Kt.append=function(t,n){this._pairs.push([t,n])};Kt.toString=function(t){const n=t?function(s){return t.call(this,s,Et)}:Et;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Rs(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xt(e,t,n){if(!t)return e;const s=n&&n.encode||Rs;a.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let o;if(r?o=r(t,n):o=a.isURLSearchParams(t)?t.toString():new it(t,n).toString(s),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Rt{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Gt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ss=typeof URLSearchParams<"u"?URLSearchParams:it,Os=typeof FormData<"u"?FormData:null,Ts=typeof Blob<"u"?Blob:null,Cs={isBrowser:!0,classes:{URLSearchParams:Ss,FormData:Os,Blob:Ts},protocols:["http","https","file","blob","url","data"]},ot=typeof window<"u"&&typeof document<"u",et=typeof navigator=="object"&&navigator||void 0,As=ot&&(!et||["ReactNative","NativeScript","NS"].indexOf(et.product)<0),xs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ps=ot&&window.location.href||"http://localhost",Fs=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ot,hasStandardBrowserEnv:As,hasStandardBrowserWebWorkerEnv:xs,navigator:et,origin:Ps},Symbol.toStringTag,{value:"Module"})),N={...Fs,...Cs};function Ns(e,t){return De(e,new N.classes.URLSearchParams,{visitor:function(n,s,r,o){return N.isNode&&a.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function _s(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Us(e){const t={},n=Object.keys(e);let s;const r=n.length;let o;for(s=0;s<r;s++)o=n[s],t[o]=e[o];return t}function Zt(e){function t(n,s,r,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),d=o>=n.length;return i=!i&&a.isArray(r)?r.length:i,d?(a.hasOwnProp(r,i)?r[i]=[r[i],s]:r[i]=s,!c):((!r[i]||!a.isObject(r[i]))&&(r[i]=[]),t(n,s,r[i],o)&&a.isArray(r[i])&&(r[i]=Us(r[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(s,r)=>{t(_s(s),r,n,0)}),n}return null}function Ls(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Oe={transitional:Gt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r?JSON.stringify(Zt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ns(t,this.formSerializer).toString();if((c=a.isFileList(t))||s.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return De(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||r?(n.setContentType("application/json",!1),Ls(t)):t}],transformResponse:[function(t){const n=this.transitional||Oe.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(s&&!this.responseType||r)){const i=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?b.from(c,b.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:N.classes.FormData,Blob:N.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{Oe.headers[e]={}});const Ds=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bs=e=>{const t={};let n,s,r;return e&&e.split(`
2
+ `).forEach(function(i){r=i.indexOf(":"),n=i.substring(0,r).trim().toLowerCase(),s=i.substring(r+1).trim(),!(!n||t[n]&&Ds[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},St=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function Pe(e){return e===!1||e==null?e:a.isArray(e)?e.map(Pe):String(e)}function ks(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Is=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Me(e,t,n,s,r){if(a.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!a.isString(t)){if(a.isString(s))return t.indexOf(s)!==-1;if(a.isRegExp(s))return s.test(t)}}function Ms(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function js(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,i){return this[s].call(this,t,r,o,i)},configurable:!0})})}let I=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(c,d,u){const l=me(d);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(r,l);(!p||r[p]===void 0||u===!0||u===void 0&&r[p]!==!1)&&(r[p||d]=Pe(c))}const i=(c,d)=>a.forEach(c,(u,l)=>o(u,l,d));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!Is(t))i(Bs(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},d,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(d=c[u])?a.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,s);return this}get(t,n){if(t=me(t),t){const s=a.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return ks(r);if(a.isFunction(n))return n.call(this,r,s);if(a.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=me(t),t){const s=a.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Me(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(i){if(i=me(i),i){const c=a.findKey(s,i);c&&(!n||Me(s,s[c],c,n))&&(delete s[c],r=!0)}}return a.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||Me(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return a.forEach(this,(r,o)=>{const i=a.findKey(s,o);if(i){n[i]=Pe(r),delete n[o];return}const c=t?Ms(o):String(o).trim();c!==o&&delete n[o],n[c]=Pe(r),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&a.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[St]=this[St]={accessors:{}}).accessors,r=this.prototype;function o(i){const c=me(i);s[c]||(js(r,i),s[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});a.freezeMethods(I);function je(e,t){const n=this||Oe,s=t||n,r=I.from(s.headers);let o=s.data;return a.forEach(e,function(c){o=c.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Yt(e){return!!(e&&e.__CANCEL__)}function pe(e,t,n){b.call(this,e??"canceled",b.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(pe,b,{__CANCEL__:!0});function en(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new b("Request failed with status code "+n.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function vs(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qs(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const u=Date.now(),l=s[o];i||(i=u),n[r]=d,s[r]=u;let p=o,E=0;for(;p!==r;)E+=n[p++],p=p%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),u-i<t)return;const w=l&&u-l;return w?Math.round(E*1e3/w):void 0}}function Hs(e,t){let n=0,s=1e3/t,r,o;const i=(u,l=Date.now())=>{n=l,r=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=s?i(u,l):(r=u,o||(o=setTimeout(()=>{o=null,i(r)},s-p)))},()=>r&&i(r)]}const Ne=(e,t,n=3)=>{let s=0;const r=qs(50,250);return Hs(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,d=i-s,u=r(d),l=i<=c;s=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Ot=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Tt=e=>(...t)=>a.asap(()=>e(...t)),zs=N.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,N.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(N.origin),N.navigator&&/(msie|trident)/i.test(N.navigator.userAgent)):()=>!0,$s=N.hasStandardBrowserEnv?{write(e,t,n,s,r,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(s)&&i.push("path="+s),a.isString(r)&&i.push("domain="+r),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Js(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Qs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function tn(e,t,n){let s=!Js(t);return e&&(s||n==!1)?Qs(e,t):t}const Ct=e=>e instanceof I?{...e}:e;function oe(e,t){t=t||{};const n={};function s(u,l,p,E){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:E},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function r(u,l,p,E){if(a.isUndefined(l)){if(!a.isUndefined(u))return s(void 0,u,p,E)}else return s(u,l,p,E)}function o(u,l){if(!a.isUndefined(l))return s(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return s(void 0,u)}else return s(void 0,l)}function c(u,l,p){if(p in t)return s(u,l);if(p in e)return s(void 0,u)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l,p)=>r(Ct(u),Ct(l),p,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const p=d[l]||r,E=p(e[l],t[l],l);a.isUndefined(E)&&p!==c||(n[l]=E)}),n}const nn=e=>{const t=oe({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=I.from(i),t.url=Xt(tn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(N.hasStandardBrowserEnv||N.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const d=n.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(N.hasStandardBrowserEnv&&(s&&a.isFunction(s)&&(s=s(t)),s||s!==!1&&zs(t.url))){const d=r&&o&&$s.read(o);d&&i.set(r,d)}return t},Vs=typeof XMLHttpRequest<"u",Ws=Vs&&function(e){return new Promise(function(n,s){const r=nn(e);let o=r.data;const i=I.from(r.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=r,l,p,E,w,f;function y(){w&&w(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout;function S(){if(!m)return;const T=I.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),L={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:T,config:e,request:m};en(function(M){n(M),y()},function(M){s(M),y()},L),m=null}"onloadend"in m?m.onloadend=S:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(S)},m.onabort=function(){m&&(s(new b("Request aborted",b.ECONNABORTED,e,m)),m=null)},m.onerror=function(x){const L=x&&x.message?x.message:"Network Error",H=new b(L,b.ERR_NETWORK,e,m);H.event=x||null,s(H),m=null},m.ontimeout=function(){let x=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const L=r.transitional||Gt;r.timeoutErrorMessage&&(x=r.timeoutErrorMessage),s(new b(x,L.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,e,m)),m=null},o===void 0&&i.setContentType(null),"setRequestHeader"in m&&a.forEach(i.toJSON(),function(x,L){m.setRequestHeader(L,x)}),a.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),c&&c!=="json"&&(m.responseType=r.responseType),u&&([E,f]=Ne(u,!0),m.addEventListener("progress",E)),d&&m.upload&&([p,w]=Ne(d),m.upload.addEventListener("progress",p),m.upload.addEventListener("loadend",w)),(r.cancelToken||r.signal)&&(l=T=>{m&&(s(!T||T.type?new pe(null,e,m):T),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const F=vs(r.url);if(F&&N.protocols.indexOf(F)===-1){s(new b("Unsupported protocol "+F+":",b.ERR_BAD_REQUEST,e));return}m.send(o||null)})},Ks=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const o=function(u){if(!r){r=!0,c();const l=u instanceof Error?u:this.reason;s.abort(l instanceof b?l:new pe(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new b(`timeout ${t} of ms exceeded`,b.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:d}=s;return d.unsubscribe=()=>a.asap(c),d}},Xs=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,r;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Gs=async function*(e,t){for await(const n of Zs(e))yield*Xs(n,t)},Zs=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},At=(e,t,n,s)=>{const r=Gs(e,t);let o=0,i,c=d=>{i||(i=!0,s&&s(d))};return new ReadableStream({async pull(d){try{const{done:u,value:l}=await r.next();if(u){c(),d.close();return}let p=l.byteLength;if(n){let E=o+=p;n(E)}d.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(d){return c(d),r.return()}},{highWaterMark:2})},xt=64*1024,{isFunction:Ae}=a,Ys=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Pt,TextEncoder:Ft}=a.global,Nt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},er=e=>{e=a.merge.call({skipUndefined:!0},Ys,e);const{fetch:t,Request:n,Response:s}=e,r=t?Ae(t):typeof fetch=="function",o=Ae(n),i=Ae(s);if(!r)return!1;const c=r&&Ae(Pt),d=r&&(typeof Ft=="function"?(f=>y=>f.encode(y))(new Ft):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=o&&c&&Nt(()=>{let f=!1;const y=new n(N.origin,{body:new Pt,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),l=i&&c&&Nt(()=>a.isReadableStream(new s("").body)),p={stream:l&&(f=>f.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!p[f]&&(p[f]=(y,m)=>{let S=y&&y[f];if(S)return S.call(y);throw new b(`Response type '${f}' is not supported`,b.ERR_NOT_SUPPORT,m)})});const E=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(N.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await d(f)).byteLength},w=async(f,y)=>{const m=a.toFiniteNumber(f.getContentLength());return m??E(y)};return async f=>{let{url:y,method:m,data:S,signal:F,cancelToken:T,timeout:x,onDownloadProgress:L,onUploadProgress:H,responseType:M,headers:D,withCredentials:Z="same-origin",fetchOptions:_}=nn(f),Y=t||fetch;M=M?(M+"").toLowerCase():"text";let j=Ks([F,T&&T.toAbortSignal()],x),z=null;const ee=j&&j.unsubscribe&&(()=>{j.unsubscribe()});let at;try{if(H&&u&&m!=="get"&&m!=="head"&&(at=await w(D,S))!==0){let K=new n(y,{method:"POST",body:S,duplex:"half"}),ae;if(a.isFormData(S)&&(ae=K.headers.get("content-type"))&&D.setContentType(ae),K.body){const[ke,Te]=Ot(at,Ne(Tt(H)));S=At(K.body,xt,ke,Te)}}a.isString(Z)||(Z=Z?"include":"omit");const $=o&&"credentials"in n.prototype,ct={..._,signal:j,method:m.toUpperCase(),headers:D.normalize().toJSON(),body:S,duplex:"half",credentials:$?Z:void 0};z=o&&new n(y,ct);let W=await(o?Y(z,_):Y(y,ct));const ut=l&&(M==="stream"||M==="response");if(l&&(L||ut&&ee)){const K={};["status","statusText","headers"].forEach(lt=>{K[lt]=W[lt]});const ae=a.toFiniteNumber(W.headers.get("content-length")),[ke,Te]=L&&Ot(ae,Ne(Tt(L),!0))||[];W=new s(At(W.body,xt,ke,()=>{Te&&Te(),ee&&ee()}),K)}M=M||"text";let ln=await p[a.findKey(p,M)||"text"](W,f);return!ut&&ee&&ee(),await new Promise((K,ae)=>{en(K,ae,{data:ln,headers:I.from(W.headers),status:W.status,statusText:W.statusText,config:f,request:z})})}catch($){throw ee&&ee(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,f,z),{cause:$.cause||$}):b.from($,$&&$.code,f,z)}}},tr=new Map,sn=e=>{let t=e?e.env:{};const{fetch:n,Request:s,Response:r}=t,o=[s,r,n];let i=o.length,c=i,d,u,l=tr;for(;c--;)d=o[c],u=l.get(d),u===void 0&&l.set(d,u=c?new Map:er(t)),l=u;return u};sn();const tt={http:ws,xhr:Ws,fetch:{get:sn}};a.forEach(tt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const _t=e=>`- ${e}`,nr=e=>a.isFunction(e)||e===null||e===!1,rn={getAdapter:(e,t)=>{e=a.isArray(e)?e:[e];const{length:n}=e;let s,r;const o={};for(let i=0;i<n;i++){s=e[i];let c;if(r=s,!nr(s)&&(r=tt[(c=String(s)).toLowerCase()],r===void 0))throw new b(`Unknown adapter '${c}'`);if(r&&(a.isFunction(r)||(r=r.get(t))))break;o[c||"#"+i]=r}if(!r){const i=Object.entries(o).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
4
+ `+i.map(_t).join(`
5
+ `):" "+_t(i[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r},adapters:tt};function ve(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function Ut(e){return ve(e),e.headers=I.from(e.headers),e.data=je.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rn.getAdapter(e.adapter||Oe.adapter,e)(e).then(function(s){return ve(e),s.data=je.call(e,e.transformResponse,s),s.headers=I.from(s.headers),s},function(s){return Yt(s)||(ve(e),s&&s.response&&(s.response.data=je.call(e,e.transformResponse,s.response),s.response.headers=I.from(s.response.headers))),Promise.reject(s)})}const on="1.12.2",Be={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Be[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Lt={};Be.transitional=function(t,n,s){function r(o,i){return"[Axios v"+on+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,c)=>{if(t===!1)throw new b(r(i," has been removed"+(n?" in "+n:"")),b.ERR_DEPRECATED);return n&&!Lt[i]&&(Lt[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};Be.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function sr(e,t,n){if(typeof e!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],i=t[o];if(i){const c=e[o],d=c===void 0||i(c,o,e);if(d!==!0)throw new b("option "+o+" must be "+d,b.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const Fe={assertOptions:sr,validators:Be},J=Fe.validators;let ie=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Rt,response:new Rt}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
+ `+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=oe(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:Fe.assertOptions(r,{encode:J.function,serialize:J.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Fe.assertOptions(n,{baseUrl:J.spelling("baseURL"),withXsrfToken:J.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=I.concat(i,o);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,p=0,E;if(!d){const f=[Ut.bind(this),void 0];for(f.unshift(...c),f.push(...u),E=f.length,l=Promise.resolve(n);p<E;)l=l.then(f[p++],f[p++]);return l}E=c.length;let w=n;for(;p<E;){const f=c[p++],y=c[p++];try{w=f(w)}catch(m){y.call(this,m);break}}try{l=Ut.call(this,w)}catch(f){return Promise.reject(f)}for(p=0,E=u.length;p<E;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=oe(this.defaults,t);const n=tn(t.baseURL,t.url,t.allowAbsoluteUrls);return Xt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){ie.prototype[t]=function(n,s){return this.request(oe(s||{},{method:t,url:n,data:(s||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(s){return function(o,i,c){return this.request(oe(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ie.prototype[t]=n(),ie.prototype[t+"Form"]=n(!0)});let rr=class an{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(c=>{s.subscribe(c),o=c}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,c){s.reason||(s.reason=new pe(o,i,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new an(function(r){t=r}),cancel:t}}};function ir(e){return function(n){return e.apply(null,n)}}function or(e){return a.isObject(e)&&e.isAxiosError===!0}const nt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(nt).forEach(([e,t])=>{nt[t]=e});function cn(e){const t=new ie(e),n=Mt(ie.prototype.request,t);return a.extend(n,ie.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return cn(oe(e,r))},n}const C=cn(Oe);C.Axios=ie;C.CanceledError=pe;C.CancelToken=rr;C.isCancel=Yt;C.VERSION=on;C.toFormData=De;C.AxiosError=b;C.Cancel=C.CanceledError;C.all=function(t){return Promise.all(t)};C.spread=ir;C.isAxiosError=or;C.mergeConfig=oe;C.AxiosHeaders=I;C.formToJSON=e=>Zt(a.isHTMLForm(e)?new FormData(e):e);C.getAdapter=rn.getAdapter;C.HttpStatusCode=nt;C.default=C;const{Axios:dr,AxiosError:hr,CanceledError:pr,isCancel:mr,CancelToken:yr,VERSION:br,all:wr,Cancel:gr,isAxiosError:Er,spread:Rr,toFormData:Sr,AxiosHeaders:Or,HttpStatusCode:Tr,formToJSON:Cr,getAdapter:Ar,mergeConfig:xr}=C,un=C.create({baseURL:"/",timeout:15e3});un.interceptors.response.use(e=>e,e=>Promise.reject(e));function ar(e){var t,n,s;if(C.isAxiosError(e)){const r=(t=e.response)==null?void 0:t.status;return{message:((s=(n=e.response)==null?void 0:n.data)==null?void 0:s.error)||e.message||"请求失败,请稍后再试",status:r,code:String(r??"unknown")}}return{message:e instanceof Error?e.message:"请求失败,请稍后再试"}}function Pr(e,t,n){return Un({queryKey:e,placeholderData:bn,...n,queryFn:async()=>{try{return(await un.request(t)).data}catch(s){throw ar(s)}}})}export{un as a,Pr as u};
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>cc-gw 控制台</title>
7
- <script type="module" crossorigin src="/assets/index-wA9rsqII.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-Gx2WWHJn.css">
7
+ <script type="module" crossorigin src="/assets/index-COB9rriK.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-CD8snFBp.css">
9
9
  </head>
10
10
  <body class="bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-50">
11
11
  <div id="root"></div>
@@ -1 +0,0 @@
1
- import{u as x,a as p,r as o,j as e}from"./index-wA9rsqII.js";import{u as m}from"./useApiQuery-De0jYBDD.js";const h="0.3.6",v={version:h},g={};function N(){const{t:s}=x(),{pushToast:l}=p(),t=m(["status","gateway"],{url:"/api/status",method:"GET"},{staleTime:6e4});o.useEffect(()=>{t.isError&&t.error&&l({title:s("about.toast.statusError.title"),description:t.error.message,variant:"error"})},[t.isError,t.error,l,s]);const d=v.version,r=o.useMemo(()=>{const a=g,u=a.VITE_BUILD_TIME??"-",b=a.VITE_NODE_VERSION??"-";return{buildTime:u,nodeVersion:b}},[]),i=()=>{l({title:s("about.toast.updatesPlanned"),variant:"info"})},n=[{label:s("about.app.labels.name"),value:"cc-local-gw"},{label:s("about.app.labels.version"),value:d},{label:s("about.app.labels.buildTime"),value:r.buildTime},{label:s("about.app.labels.node"),value:r.nodeVersion}],c=t.data?[{label:s("about.status.labels.host"),value:t.data.host??"127.0.0.1"},{label:s("about.status.labels.port"),value:t.data.port},{label:s("about.status.labels.providers"),value:t.data.providers},{label:s("about.status.labels.active"),value:t.data.activeRequests??0}]:[];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("header",{className:"flex flex-col gap-2",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:s("about.title")}),e.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:s("about.description")})]}),e.jsxs("section",{className:"grid gap-4 rounded-lg border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s("about.app.title")}),e.jsx("dl",{className:"grid grid-cols-[160px_1fr] gap-2 text-sm text-slate-600 dark:text-slate-300",children:n.map(a=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"font-medium",children:a.label}),e.jsx("dd",{children:a.value})]},a.label))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s("about.status.title")}),t.isLoading?e.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:s("about.status.loading")}):t.data?e.jsx("dl",{className:"grid grid-cols-[160px_1fr] gap-2 text-sm text-slate-600 dark:text-slate-300",children:c.map(a=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"font-medium",children:a.label}),e.jsx("dd",{children:a.value})]},a.label))}):e.jsx("p",{className:"text-sm text-red-500",children:s("about.status.empty")})]})]}),e.jsxs("section",{className:"rounded-lg border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:s("about.support.title")}),e.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("about.support.subtitle")})]}),e.jsx("button",{type:"button",onClick:i,className:"rounded-md border border-slate-200 px-3 py-1 text-sm transition hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800",children:s("about.support.actions.checkUpdates")})]}),e.jsx("p",{className:"mt-4 text-sm leading-6 text-slate-600 dark:text-slate-300",children:s("about.support.description")})]})]})}export{N as default};
@@ -1,21 +0,0 @@
1
- import{c as g,u as R,a as U,r as d,j as e,L as k,K as W}from"./index-wA9rsqII.js";import{E as L}from"./index-B0rGDFRO.js";import{u as N,a as v}from"./useApiQuery-De0jYBDD.js";/**
2
- * @license lucide-react v0.344.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 $=g("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
7
- * @license lucide-react v0.344.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 G=g("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
12
- * @license lucide-react v0.344.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 Q=g("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
17
- * @license lucide-react v0.344.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 F=g("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),V=[{value:1,labelKey:"apiKeys.analytics.range.today"},{value:7,labelKey:"apiKeys.analytics.range.week"},{value:30,labelKey:"apiKeys.analytics.range.month"}];function J(){const{t:a}=R(),{pushToast:l}=U(),[M,h]=d.useState(!1),[u,b]=d.useState(""),[f,j]=d.useState(""),[o,K]=d.useState(null),[A,w]=d.useState(null),[n,E]=d.useState(7),y=N(["api-keys"],{url:"/api/keys",method:"GET"}),m=N(["api-keys","overview",n],{url:"/api/stats/api-keys/overview",method:"GET",params:{days:n}}),p=N(["api-keys","usage",n],{url:"/api/stats/api-keys/usage",method:"GET",params:{days:n,limit:10}}),C=y.data??[],c=m.data,i=p.data??[],D=async()=>{var s,t;if(!u.trim()){l({title:a("apiKeys.errors.nameRequired"),variant:"error"});return}try{const r=await v.post("/api/keys",{name:u.trim(),description:f.trim()||void 0});K(r.data),h(!1),b(""),j(""),y.refetch(),m.refetch(),p.refetch(),l({title:a("apiKeys.toast.keyCreated"),variant:"success"})}catch(r){l({title:a("apiKeys.toast.createFailure",{message:((t=(s=r.response)==null?void 0:s.data)==null?void 0:t.error)||r.message}),variant:"error"})}},q=async(s,t)=>{var r,x;try{await v.patch(`/api/keys/${s}`,{enabled:!t}),y.refetch(),m.refetch(),l({title:a("apiKeys.toast.keyUpdated"),variant:"success"})}catch(T){l({title:a("apiKeys.toast.updateFailure",{message:((x=(r=T.response)==null?void 0:r.data)==null?void 0:x.error)||T.message}),variant:"error"})}},O=async s=>{var t,r;if(confirm(a("apiKeys.confirmDelete"))){w(s);try{await v.delete(`/api/keys/${s}`),y.refetch(),m.refetch(),p.refetch(),l({title:a("apiKeys.toast.keyDeleted"),variant:"success"})}catch(x){l({title:a("apiKeys.toast.deleteFailure",{message:((r=(t=x.response)==null?void 0:t.data)==null?void 0:r.error)||x.message}),variant:"error"})}finally{w(null)}}},P=s=>{navigator.clipboard.writeText(s),l({title:a("apiKeys.toast.keyCopied"),variant:"success"})},S=s=>s?new Date(s).toLocaleString():a("common.noData"),z=d.useMemo(()=>{const s=i.map(t=>t.apiKeyName??a("apiKeys.analytics.unknownKey"));return{tooltip:{trigger:"axis"},grid:{left:60,right:20,top:40,bottom:40},xAxis:{type:"category",data:s,axisLabel:{interval:0,rotate:20}},yAxis:{type:"value"},series:[{name:a("apiKeys.analytics.requestsSeries"),type:"bar",data:i.map(t=>t.requests),itemStyle:{color:"#2563eb"}}]}},[i,a]),I=d.useMemo(()=>{const s=i.map(t=>t.apiKeyName??a("apiKeys.analytics.unknownKey"));return{tooltip:{trigger:"axis"},legend:{data:[a("apiKeys.analytics.tokens.input"),a("apiKeys.analytics.tokens.output")]},grid:{left:60,right:20,top:50,bottom:40},xAxis:{type:"category",data:s,axisLabel:{interval:0,rotate:20}},yAxis:{type:"value"},series:[{name:a("apiKeys.analytics.tokens.input"),type:"bar",stack:"tokens",itemStyle:{color:"#22c55e"},data:i.map(t=>t.inputTokens)},{name:a("apiKeys.analytics.tokens.output"),type:"bar",stack:"tokens",itemStyle:{color:"#0ea5e9"},data:i.map(t=>t.outputTokens)}]}},[i,a]);return y.isLoading?e.jsx(k,{}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(W,{className:"w-6 h-6"}),a("apiKeys.title")]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-2 max-w-2xl",children:a("apiKeys.description")})]}),e.jsxs("button",{onClick:()=>h(!0),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),a("apiKeys.createNew")]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:a("apiKeys.analytics.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:a("apiKeys.analytics.description",{days:n})})]}),e.jsx("div",{className:"flex items-center gap-2",children:V.map(s=>e.jsx("button",{onClick:()=>E(s.value),className:`rounded px-3 py-1 text-sm transition ${n===s.value?"bg-blue-600 text-white":"border border-gray-200 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:text-gray-200"}`,children:a(s.labelKey)},s.value))})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:a("apiKeys.analytics.cards.total")}),e.jsx("p",{className:"mt-2 text-2xl font-semibold",children:c?c.totalKeys.toLocaleString():"–"})]}),e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:a("apiKeys.analytics.cards.enabled")}),e.jsx("p",{className:"mt-2 text-2xl font-semibold",children:c?c.enabledKeys.toLocaleString():"–"})]}),e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800",children:[e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:a("apiKeys.analytics.cards.active",{days:n})}),e.jsx("p",{className:"mt-2 text-2xl font-semibold",children:c?c.activeKeys.toLocaleString():"–"})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800",children:[e.jsx("h3",{className:"mb-4 text-base font-semibold",children:a("apiKeys.analytics.charts.requests")}),p.isLoading?e.jsx(k,{}):i.length===0?e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:a("apiKeys.analytics.empty")}):e.jsx(L,{option:z,style:{height:320},notMerge:!0,lazyUpdate:!0})]}),e.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-700 dark:bg-gray-800",children:[e.jsx("h3",{className:"mb-4 text-base font-semibold",children:a("apiKeys.analytics.charts.tokens")}),p.isLoading?e.jsx(k,{}):i.length===0?e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:a("apiKeys.analytics.empty")}):e.jsx(L,{option:I,style:{height:320},notMerge:!0,lazyUpdate:!0})]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a("apiKeys.list.title")}),e.jsx("div",{className:"grid gap-4",children:C.length===0?e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:a("apiKeys.list.empty")}):C.map(s=>e.jsx("div",{className:"border dark:border-gray-700 rounded-lg p-4 bg-white dark:bg-gray-800",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"font-semibold text-lg",children:s.name}),s.isWildcard&&e.jsx("span",{className:"px-2 py-1 text-xs bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200 rounded",children:a("apiKeys.wildcard")}),e.jsx("span",{className:`px-2 py-1 text-xs rounded ${s.enabled?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200"}`,children:s.enabled?a("apiKeys.status.enabled"):a("apiKeys.status.disabled")})]}),e.jsx("div",{className:"mt-2 flex items-center gap-2",children:e.jsx("code",{className:"text-sm bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded",children:s.isWildcard?a("apiKeys.wildcard"):s.maskedKey??"********"})}),s.isWildcard?e.jsx("p",{className:"mt-2 text-sm text-purple-700 dark:text-purple-200",children:a("apiKeys.wildcardHint")}):s.description?e.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm text-gray-600 dark:text-gray-400",children:s.description}):null,e.jsxs("div",{className:"mt-3 grid gap-4 text-sm text-gray-600 dark:text-gray-400 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[a("apiKeys.created"),":"]})," ",S(s.createdAt)]}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[a("apiKeys.lastUsed"),":"]})," ",S(s.lastUsedAt)]}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[a("apiKeys.requestCount"),":"]})," ",s.requestCount.toLocaleString()]}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[a("apiKeys.totalTokens"),":"]})," ",(s.totalInputTokens+s.totalOutputTokens).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>q(s.id,s.enabled),className:`px-3 py-1 rounded text-sm ${s.enabled?"bg-gray-200 dark:bg-gray-700":"bg-green-600 text-white"}`,children:s.enabled?a("apiKeys.actions.disable"):a("apiKeys.actions.enable")}),!s.isWildcard&&e.jsx("button",{onClick:()=>O(s.id),disabled:A===s.id,className:"p-2 hover:bg-red-100 dark:hover:bg-red-900 rounded text-red-600 disabled:opacity-50",children:e.jsx(F,{className:"w-4 h-4"})})]})]})},s.id))})]}),M&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 max-w-md w-full",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:a("apiKeys.createNew")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:a("apiKeys.createDescription")}),e.jsx("input",{type:"text",value:u,onChange:s=>b(s.target.value),placeholder:a("apiKeys.keyNamePlaceholder"),className:"w-full px-3 py-2 border dark:border-gray-600 rounded bg-white dark:bg-gray-700 mb-4",onKeyPress:s=>s.key==="Enter"&&D()}),e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:a("apiKeys.descriptionLabel")}),e.jsx("textarea",{value:f,onChange:s=>j(s.target.value),placeholder:a("apiKeys.keyDescriptionPlaceholder"),className:"w-full px-3 py-2 border dark:border-gray-600 rounded bg-white dark:bg-gray-700 mb-4 min-h-[96px]"}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx("button",{onClick:()=>{h(!1),b(""),j("")},className:"px-4 py-2 border dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700",children:a("common.actions.cancel")}),e.jsx("button",{onClick:D,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:a("apiKeys.createAction")})]})]})}),o&&e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 max-w-md w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx($,{className:"w-6 h-6 text-green-600"}),e.jsx("h2",{className:"text-xl font-bold",children:a("apiKeys.keyCreated")})]}),e.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-400 mb-4",children:a("apiKeys.saveKeyWarning")}),e.jsx("div",{className:"bg-gray-100 dark:bg-gray-700 p-3 rounded mb-4",children:e.jsx("code",{className:"text-sm break-all",children:o.key})}),o.description?e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 whitespace-pre-wrap",children:o.description}):null,e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs("button",{onClick:()=>P(o.key),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 flex items-center gap-2",children:[e.jsx(G,{className:"w-4 h-4"}),a("common.actions.copy")]}),e.jsx("button",{onClick:()=>K(null),className:"px-4 py-2 border dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700",children:a("common.actions.close")})]})]})})]})}export{J as default};
@@ -1 +0,0 @@
1
- import{u as A,a as R,r as h,j as t,L as D}from"./index-wA9rsqII.js";import{E as O}from"./index-B0rGDFRO.js";import{u as v}from"./useApiQuery-De0jYBDD.js";function N(e,a,s){return e==null?"-":`${e.toLocaleString(void 0,s)} ${a}`}function B(e){if(e==null)return"-";if(e<1024)return`${e} B`;const a=["KB","MB","GB","TB"];let s=e/1024,d=0;for(;s>=1024&&d<a.length-1;)s/=1024,d+=1;return`${s.toFixed(s>=100?0:s>=10?1:2)} ${a[d]}`}function _(){var S;const{t:e}=A(),{pushToast:a}=R(),[s,d]=h.useState("all"),l=s==="all"?void 0:s,b=v(["stats","overview",s],{url:"/api/stats/overview",method:"GET",params:l?{endpoint:l}:void 0}),p=v(["stats","daily",14,s],{url:"/api/stats/daily",method:"GET",params:{days:14,...l?{endpoint:l}:{}}}),u=v(["stats","model",7,6,s],{url:"/api/stats/model",method:"GET",params:{days:7,limit:6,...l?{endpoint:l}:{}}}),g=v(["status"],{url:"/api/status",method:"GET"}),f=v(["db","info"],{url:"/api/db/info",method:"GET"}),y=v(["logs","recent",s],{url:"/api/logs",method:"GET",params:{limit:5,...l?{endpoint:l}:{}}},{refetchInterval:3e4});h.useEffect(()=>{b.isError&&b.error&&a({title:e("dashboard.toast.overviewError"),description:b.error.message,variant:"error"})},[b.isError,b.error,a,e]),h.useEffect(()=>{p.isError&&p.error&&a({title:e("dashboard.toast.dailyError"),description:p.error.message,variant:"error"})},[p.isError,p.error,a,e]),h.useEffect(()=>{u.isError&&u.error&&a({title:e("dashboard.toast.modelError"),description:u.error.message,variant:"error"})},[u.isError,u.error,a,e]),h.useEffect(()=>{g.isError&&g.error&&a({title:e("dashboard.toast.statusError"),description:g.error.message,variant:"error"})},[g.isError,g.error,a,e]),h.useEffect(()=>{f.isError&&f.error&&a({title:e("dashboard.toast.dbError"),description:f.error.message,variant:"error"})},[f.isError,f.error,a,e]),h.useEffect(()=>{y.isError&&y.error&&a({title:e("dashboard.toast.recentError"),description:y.error.message,variant:"error"})},[y.isError,y.error,a,e]);const c=b.data,j=p.data??[],n=u.data??[],k=g.data,M=f.data,$=((S=y.data)==null?void 0:S.items)??[],q=h.useMemo(()=>{const i=j.map(o=>o.date),x=e("dashboard.charts.barRequests"),r=e("dashboard.charts.lineInput"),m=e("dashboard.charts.lineOutput");return{tooltip:{trigger:"axis"},legend:{data:[x,r,m]},grid:{left:40,right:20,top:40,bottom:40},xAxis:{type:"category",data:i},yAxis:{type:"value"},series:[{name:x,type:"bar",data:j.map(o=>o.requestCount),itemStyle:{color:"#2563eb"}},{name:r,type:"line",yAxisIndex:0,data:j.map(o=>o.inputTokens),smooth:!0,itemStyle:{color:"#22c55e"}},{name:m,type:"line",yAxisIndex:0,data:j.map(o=>o.outputTokens),smooth:!0,itemStyle:{color:"#f97316"}}]}},[j,e]),w=h.useMemo(()=>{const i=n.map(o=>`${o.provider}/${o.model}`),x=e("dashboard.charts.barRequests"),r=e("dashboard.charts.lineInput"),m=e("dashboard.charts.lineOutput");return{tooltip:{trigger:"axis"},legend:{data:[x,r,m]},grid:{left:50,right:40,top:40,bottom:70},xAxis:{type:"category",data:i,axisLabel:{rotate:30}},yAxis:[{type:"value",name:x},{type:"value",name:e("dashboard.charts.axisTokens"),position:"right"}],series:[{name:x,type:"bar",data:n.map(o=>o.requests),itemStyle:{color:"#6366f1"},yAxisIndex:0},{name:r,type:"line",yAxisIndex:1,smooth:!0,data:n.map(o=>o.inputTokens??0),itemStyle:{color:"#22c55e"}},{name:m,type:"line",yAxisIndex:1,smooth:!0,data:n.map(o=>o.outputTokens??0),itemStyle:{color:"#f97316"}}]}},[n,e]),I=h.useMemo(()=>{const i=n.map(r=>`${r.provider}/${r.model}`),x=e("dashboard.charts.ttftLabel");return{tooltip:{trigger:"axis",formatter(r){var T;if(!Array.isArray(r)||r.length===0)return"";const m=((T=r[0])==null?void 0:T.dataIndex)??0,o=n[m];return o?`<strong>${i[m]}</strong><br/>${x}: ${N(o.avgTtftMs,e("common.units.ms"))}`:""}},grid:{left:50,right:30,top:40,bottom:70},xAxis:{type:"category",data:i,axisLabel:{rotate:30}},yAxis:{type:"value",name:e("dashboard.charts.ttftAxis")},series:[{name:x,type:"bar",data:n.map(r=>r.avgTtftMs??0),itemStyle:{color:"#2563eb"}}]}},[n,e]),P=h.useMemo(()=>{const i=n.map(r=>`${r.provider}/${r.model}`),x=e("dashboard.charts.tpotLabel");return{tooltip:{trigger:"axis",formatter(r){var T;if(!Array.isArray(r)||r.length===0)return"";const m=((T=r[0])==null?void 0:T.dataIndex)??0,o=n[m];return o?`<strong>${i[m]}</strong><br/>${x}: ${N(o.avgTpotMs,e("common.units.msPerToken"),{maximumFractionDigits:2})}`:""}},grid:{left:50,right:30,top:40,bottom:70},xAxis:{type:"category",data:i,axisLabel:{rotate:30}},yAxis:{type:"value",name:e("dashboard.charts.tpotAxis")},series:[{name:x,type:"bar",data:n.map(r=>r.avgTpotMs??0),itemStyle:{color:"#f97316"}}]}},[n,e]);return b.isPending||g.isPending||f.isPending?t.jsx(D,{}):t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h1",{className:"text-2xl font-semibold",children:e("nav.dashboard")}),t.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:e("dashboard.description")}),k?t.jsxs("div",{className:"flex flex-wrap gap-3 rounded-lg border border-slate-200 bg-white p-4 text-sm shadow-sm dark:border-slate-800 dark:bg-slate-900","aria-live":"polite",children:[t.jsx("span",{className:"font-medium",children:e("dashboard.status.listening",{host:k.host??"0.0.0.0",port:k.port})}),t.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:e("dashboard.status.providers",{value:k.providers})}),t.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:e("dashboard.status.todayRequests",{value:((c==null?void 0:c.today.requests)??0).toLocaleString()})}),t.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:e("dashboard.status.active",{value:(k.activeRequests??0).toLocaleString()})}),t.jsx("span",{className:"text-slate-500 dark:text-slate-400",children:e("dashboard.status.dbSize",{value:M?B(M.sizeBytes):"-"})})]}):null,t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm text-slate-500 dark:text-slate-400",children:[t.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:e("dashboard.filters.endpoint")}),t.jsxs("select",{value:s,onChange:i=>d(i.target.value),className:"h-9 rounded-md border border-slate-200 bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:border-blue-400 dark:focus:ring-blue-400/40",children:[t.jsx("option",{value:"all",children:e("dashboard.filters.endpointAll")}),t.jsx("option",{value:"anthropic",children:e("dashboard.filters.endpointAnthropic")}),t.jsx("option",{value:"openai",children:e("dashboard.filters.endpointOpenAI")})]})]})]}),t.jsxs("section",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[t.jsx(E,{title:e("dashboard.cards.todayRequests"),value:(c==null?void 0:c.today.requests)??0,suffix:e("common.units.request")}),t.jsx(E,{title:e("dashboard.cards.todayInput"),value:(c==null?void 0:c.today.inputTokens)??0,suffix:e("common.units.token")}),t.jsx(E,{title:e("dashboard.cards.todayOutput"),value:(c==null?void 0:c.today.outputTokens)??0,suffix:e("common.units.token")}),t.jsx(E,{title:e("dashboard.cards.avgLatency"),value:(c==null?void 0:c.today.avgLatencyMs)??0,suffix:e("common.units.ms")})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsx(L,{title:e("dashboard.charts.requestsTitle"),description:e("dashboard.charts.requestsDesc"),loading:p.isPending,option:q,empty:!j.length,emptyText:e("dashboard.charts.empty")}),t.jsx(L,{title:e("dashboard.charts.modelTitle"),description:e("dashboard.charts.modelDesc"),loading:u.isPending,option:w,empty:!n.length,emptyText:e("dashboard.charts.empty")})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsx(L,{title:e("dashboard.charts.ttftTitle"),description:e("dashboard.charts.ttftDesc"),loading:u.isPending,option:I,empty:!n.some(i=>i.avgTtftMs!=null&&i.avgTtftMs>0),emptyText:e("dashboard.charts.ttftEmpty")}),t.jsx(L,{title:e("dashboard.charts.tpotTitle"),description:e("dashboard.charts.tpotDesc"),loading:u.isPending,option:P,empty:!n.some(i=>i.avgTpotMs!=null&&i.avgTpotMs>0),emptyText:e("dashboard.charts.tpotEmpty")})]}),t.jsx(G,{models:n,loading:u.isPending}),t.jsx(Q,{loading:y.isPending,records:$})]})}function E({title:e,value:a,suffix:s}){return t.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[t.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:e}),t.jsxs("p",{className:"mt-2 text-2xl font-semibold",children:[a.toLocaleString(),s?t.jsx("span",{className:"ml-1 text-base font-normal text-slate-500 dark:text-slate-400",children:s}):null]})]})}function L({title:e,description:a,option:s,loading:d,empty:l,emptyText:b}){const{t:p}=A();return t.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("p",{className:"text-sm font-semibold",children:e}),t.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:a})]}),d?t.jsx("div",{className:"flex h-60 items-center justify-center text-sm text-slate-400",children:p("common.loadingShort")}):l?t.jsx("div",{className:"flex h-60 items-center justify-center text-sm text-slate-400",children:b??p("dashboard.charts.empty")}):t.jsx(O,{option:s,style:{height:260},notMerge:!0,lazyUpdate:!0,theme:void 0})]})}function G({models:e,loading:a}){const{t:s}=A(),d=e.length>0;return t.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[t.jsx("div",{className:"flex items-center justify-between border-b border-slate-200 px-4 py-3 dark:border-slate-800",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-semibold",children:s("dashboard.modelTable.title")}),t.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("dashboard.modelTable.description")})]})}),a?t.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-slate-400",children:s("common.loadingShort")}):d?t.jsx("div",{className:"max-h-80 overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-slate-200 text-sm dark:divide-slate-800",children:[t.jsx("caption",{className:"sr-only",children:s("dashboard.modelTable.title")}),t.jsx("thead",{className:"bg-slate-100 dark:bg-slate-800/50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.modelTable.columns.model")}),t.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.modelTable.columns.requests")}),t.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.modelTable.columns.latency")}),t.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.modelTable.columns.ttft")}),t.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.modelTable.columns.tpot")})]})}),t.jsx("tbody",{className:"divide-y divide-slate-200 dark:divide-slate-800",children:e.map(l=>t.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/60",children:[t.jsx("td",{className:"px-4 py-2",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-100",children:l.provider}),t.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:l.model})]})}),t.jsx("td",{className:"px-4 py-2 text-right",children:l.requests.toLocaleString()}),t.jsx("td",{className:"px-4 py-2 text-right",children:N(l.avgLatencyMs,s("common.units.ms"))}),t.jsx("td",{className:"px-4 py-2 text-right",children:N(l.avgTtftMs,s("common.units.ms"))}),t.jsx("td",{className:"px-4 py-2 text-right",children:N(l.avgTpotMs,s("common.units.msPerToken"),{maximumFractionDigits:2})})]},`${l.provider}/${l.model}`))})]})}):t.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-slate-400",children:s("dashboard.modelTable.empty")})]})}function Q({records:e,loading:a}){const{t:s}=A();return t.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-slate-200 px-4 py-3 dark:border-slate-800",children:[t.jsx("p",{className:"text-sm font-semibold",children:s("dashboard.recent.title")}),t.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("dashboard.recent.subtitle",{count:5})})]}),a?t.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-slate-400",children:s("dashboard.recent.loading")}):e.length===0?t.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-slate-400",children:s("dashboard.recent.empty")}):t.jsx("div",{className:"max-h-80 overflow-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-slate-200 text-sm dark:divide-slate-800",children:[t.jsx("caption",{className:"sr-only",children:s("dashboard.recent.title")}),t.jsx("thead",{className:"bg-slate-100 dark:bg-slate-800/50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.recent.columns.time")}),t.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.recent.columns.endpoint")}),t.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.recent.columns.provider")}),t.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.recent.columns.route")}),t.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.recent.columns.latency")}),t.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:s("dashboard.recent.columns.status")})]})}),t.jsx("tbody",{className:"divide-y divide-slate-200 dark:divide-slate-800",children:e.map(d=>t.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/60",children:[t.jsx("td",{className:"px-4 py-2 text-xs text-slate-500 dark:text-slate-400",children:new Date(d.timestamp).toLocaleString()}),t.jsx("td",{className:"px-4 py-2 text-xs text-slate-500 dark:text-slate-400",children:d.endpoint==="anthropic"?s("logs.table.endpointAnthropic"):d.endpoint==="openai"?s("logs.table.endpointOpenAI"):d.endpoint}),t.jsx("td",{className:"px-4 py-2",children:d.provider}),t.jsxs("td",{className:"px-4 py-2",children:[t.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:d.client_model??s("dashboard.recent.routePlaceholder")}),t.jsx("span",{className:"mx-1 text-slate-400",children:"→"}),t.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-100",children:d.model})]}),t.jsx("td",{className:"px-4 py-2",children:N(d.latency_ms,s("common.units.ms"))}),t.jsx("td",{className:"px-4 py-2",children:t.jsxs("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${d.error?"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-200":"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-200"}`,children:[(d.status_code??200).toString(),t.jsx("span",{className:"ml-1",children:d.error?s("common.status.error"):s("common.status.success")})]})})]},d.id))})]})})]})}export{_ as default};
@@ -1 +0,0 @@
1
- import{u as c,r as d,j as e}from"./index-wA9rsqII.js";function o(){const{t:s}=c(),a=d.useMemo(()=>{const t=s("help.sections.configuration.items",{returnObjects:!0}),l=s("help.sections.usage.items",{returnObjects:!0}),i=s("help.sections.tips.items",{returnObjects:!0});return[{title:s("help.sections.configuration.title"),items:t},{title:s("help.sections.usage.title"),items:l},{title:s("help.sections.tips.title"),items:i}]},[s]),r=s("help.faq.items",{returnObjects:!0});return e.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-8",children:[e.jsxs("header",{className:"space-y-3",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:s("help.title")}),e.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300",children:s("help.intro")}),e.jsx("div",{className:"rounded-md border border-blue-100 bg-blue-50 px-4 py-3 text-xs text-blue-700 dark:border-blue-900/40 dark:bg-blue-950/60 dark:text-blue-200",children:s("help.note")})]}),a.map(t=>e.jsxs("section",{className:"space-y-3 rounded-lg border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[e.jsx("h2",{className:"text-lg font-semibold",children:t.title}),e.jsx("ol",{className:"list-decimal space-y-2 pl-6 text-sm text-slate-700 dark:text-slate-300",children:t.items.map(l=>e.jsx("li",{children:l},l))})]},t.title)),e.jsxs("section",{className:"space-y-3 rounded-lg border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s("help.faq.title")}),e.jsx("dl",{className:"space-y-4 text-sm text-slate-700 dark:text-slate-300",children:r.map(t=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("dt",{className:"font-medium text-slate-900 dark:text-slate-100",children:t.q}),e.jsx("dd",{children:t.a})]},t.q))})]})]})}export{o as default};
@@ -1 +0,0 @@
1
- import{u as L,a as J,r as d,j as e,b as ae,L as le}from"./index-wA9rsqII.js";import{u as C}from"./useApiQuery-De0jYBDD.js";const W=[20,50,100];function z(t,r=!1){if(!t)return;const n=r?`${t}T23:59:59.999`:`${t}T00:00:00.000`,h=Date.parse(n);return Number.isFinite(h)?h:void 0}function Y(t){const r=new Date(t);return`${r.getFullYear()}-${`${r.getMonth()+1}`.padStart(2,"0")}-${`${r.getDate()}`.padStart(2,"0")} ${`${r.getHours()}`.padStart(2,"0")}:${`${r.getMinutes()}`.padStart(2,"0")}:${`${r.getSeconds()}`.padStart(2,"0")}`}function w(t){return t==null?"-":t.toLocaleString()}function N(t,r){const n=w(t);return n==="-"?"-":`${n} ${r}`}function P(t){return t?"true":"false"}function H(t,r){if(!t||t.trim().length===0)return r;try{const n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return t}}function ce(){var B,G;const{t}=L(),{pushToast:r}=J(),[n,h]=d.useState("all"),[i,s]=d.useState("all"),[m,y]=d.useState(""),[p,c]=d.useState("all"),[b,a]=d.useState(""),[x,o]=d.useState(""),[f,v]=d.useState(1),[u,_]=d.useState(W[0]),[D,E]=d.useState(null),[V,R]=d.useState(!1),[T,A]=d.useState([]);d.useEffect(()=>{v(1)},[n,i,m,p,b,x,u,T]);const M=d.useMemo(()=>{const l={limit:u,offset:(f-1)*u};n!=="all"&&(l.provider=n),i!=="all"&&(l.endpoint=i),m.trim().length>0&&(l.model=m.trim()),p!=="all"&&(l.status=p);const j=z(b),Q=z(x,!0);return j!==void 0&&(l.from=j),Q!==void 0&&(l.to=Q),T.length>0&&(l.apiKeys=T.join(",")),l},[n,i,m,p,b,x,f,u,T]),g=C(["logs",M],{url:"/api/logs",method:"GET",params:M}),S=C(["providers","all"],{url:"/api/providers",method:"GET"}),q=C(["api-keys"],{url:"/api/keys",method:"GET"});d.useEffect(()=>{g.isError&&g.error&&r({title:t("logs.toast.listError.title"),description:t("logs.toast.listError.desc",{message:g.error.message}),variant:"error"})},[g.isError,g.error,r,t]),d.useEffect(()=>{S.isError&&S.error&&r({title:t("logs.toast.providerError.title"),description:t("logs.toast.providerError.desc",{message:S.error.message}),variant:"error"})},[S.isError,S.error,r,t]);const $=((B=g.data)==null?void 0:B.total)??0,k=$>0?Math.ceil($/u):0,O=((G=g.data)==null?void 0:G.items)??[];d.useEffect(()=>{k>0&&f>k&&v(k)},[k,f]);const F=S.data??[],U=d.useMemo(()=>{const l=new Map;for(const j of F)j.id&&l.set(j.id,j.label??j.id);return l},[F]),K=q.data??[],I=d.useMemo(()=>{const l=new Map;for(const j of K)l.set(j.id,j);return l},[K]),X=d.useMemo(()=>[{value:"all",label:t("logs.filters.statusAll")},{value:"success",label:t("logs.filters.statusSuccess")},{value:"error",label:t("logs.filters.statusError")}],[t]),ee=()=>{h("all"),y(""),s("all"),c("all"),a(""),o(""),A([])},te=d.useCallback(l=>{E(l),R(!0)},[]),se=d.useCallback(()=>{R(!1),E(null)},[]);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("header",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:t("logs.title")}),e.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:t("logs.description")})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500 dark:text-slate-400","aria-live":"polite",children:[e.jsx("span",{children:t("logs.summary.total",{value:$.toLocaleString()})}),e.jsx("button",{type:"button",className:"rounded-md border border-slate-200 px-3 py-1 transition hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800",onClick:()=>g.refetch(),disabled:g.isFetching,children:g.isFetching?t("common.actions.refreshing"):t("logs.actions.manualRefresh")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3 rounded-lg border border-slate-200 bg-white p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[e.jsxs("div",{className:"flex flex-col text-sm",children:[e.jsx("label",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t("logs.filters.provider")}),e.jsxs("select",{value:n,onChange:l=>h(l.target.value),className:"h-10 w-full rounded-md border border-slate-200 bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:border-blue-400 dark:focus:ring-blue-400/40",children:[e.jsx("option",{value:"all",children:t("logs.filters.providerAll")}),F.map(l=>e.jsx("option",{value:l.id,children:l.label??l.id},l.id))]})]}),e.jsxs("div",{className:"flex flex-col text-sm",children:[e.jsx("label",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t("logs.filters.endpoint")}),e.jsxs("select",{value:i,onChange:l=>s(l.target.value),className:"h-10 w-full rounded-md border border-slate-200 bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:border-blue-400 dark:focus:ring-blue-400/40",children:[e.jsx("option",{value:"all",children:t("logs.filters.endpointAll")}),e.jsx("option",{value:"anthropic",children:t("logs.filters.endpointAnthropic")}),e.jsx("option",{value:"openai",children:t("logs.filters.endpointOpenAI")})]})]}),e.jsx(oe,{apiKeys:K,selected:T,disabled:q.isLoading,onChange:A}),e.jsxs("div",{className:"flex flex-col text-sm",children:[e.jsx("label",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t("logs.filters.modelId")}),e.jsx("input",{value:m,onChange:l=>y(l.target.value),placeholder:t("logs.filters.modelPlaceholder"),className:"h-10 w-full rounded-md border border-slate-200 bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:border-blue-400 dark:focus:ring-blue-400/40"})]}),e.jsxs("div",{className:"flex flex-col text-sm",children:[e.jsx("label",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t("logs.filters.status")}),e.jsx("select",{value:p,onChange:l=>c(l.target.value),className:"h-10 w-full rounded-md border border-slate-200 bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:border-blue-400 dark:focus:ring-blue-400/40",children:X.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]}),e.jsxs("div",{className:"flex flex-col text-sm",children:[e.jsx("label",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t("logs.filters.startDate")}),e.jsx("input",{type:"date",value:b,onChange:l=>a(l.target.value),className:"h-10 w-full rounded-md border border-slate-200 bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:border-blue-400 dark:focus:ring-blue-400/40"})]}),e.jsxs("div",{className:"flex flex-col text-sm",children:[e.jsx("label",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:t("logs.filters.endDate")}),e.jsx("input",{type:"date",value:x,onChange:l=>o(l.target.value),className:"h-10 w-full rounded-md border border-slate-200 bg-white px-3 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:border-blue-400 dark:focus:ring-blue-400/40"})]}),e.jsx("div",{className:"ml-auto flex items-center gap-2 text-sm",children:e.jsx("button",{type:"button",onClick:ee,className:"rounded-md border border-slate-200 px-3 py-2 transition hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800",children:t("common.actions.reset")})})]})]}),e.jsxs("section",{className:"rounded-lg border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-slate-200 text-sm dark:divide-slate-800",children:[e.jsx("caption",{className:"sr-only",children:t("logs.title")}),e.jsx("thead",{className:"bg-slate-100 dark:bg-slate-800/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.time")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.endpoint")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.provider")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.requestedModel")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.routedModel")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.apiKey")}),e.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.inputTokens")}),e.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.cachedTokens")}),e.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.outputTokens")}),e.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.stream")}),e.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.latency")}),e.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.ttft")}),e.jsx("th",{className:"px-4 py-2 text-right font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.tpot")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.status")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.error")}),e.jsx("th",{className:"px-4 py-2 text-left font-medium text-slate-500 dark:text-slate-400",children:t("logs.table.columns.actions")})]})}),e.jsx("tbody",{className:"divide-y divide-slate-200 dark:divide-slate-800",children:g.isPending?e.jsx("tr",{children:e.jsx("td",{colSpan:16,className:"px-4 py-10 text-center text-sm text-slate-400",children:t("logs.table.loading")})}):O.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:15,className:"px-4 py-10 text-center text-sm text-slate-400",children:t("logs.table.empty")})}):O.map(l=>e.jsx(re,{record:l,providerLabelMap:U,apiKeyMap:I,onSelect:te},l.id))})]})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-slate-200 px-4 py-3 text-sm dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:t("logs.table.pagination.perPage")}),e.jsx("select",{value:u,onChange:l=>_(Number(l.target.value)),className:"rounded-md border border-slate-200 bg-white px-2 py-1 text-sm dark:border-slate-700 dark:bg-slate-800",children:W.map(l=>e.jsx("option",{value:l,children:l},l))}),e.jsx("span",{children:t("logs.table.pagination.unit")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>v(l=>Math.max(l-1,1)),disabled:f<=1,className:"rounded-md border border-slate-200 px-3 py-1 transition enabled:hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:enabled:hover:bg-slate-800",children:t("logs.table.pagination.previous")}),e.jsx("span",{children:t("logs.table.pagination.pageLabel",{page:k===0?0:f,total:k})}),e.jsx("button",{type:"button",onClick:()=>v(l=>k===0?l:Math.min(l+1,k)),disabled:k===0||f>=k,className:"rounded-md border border-slate-200 px-3 py-1 transition enabled:hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:enabled:hover:bg-slate-800",children:t("logs.table.pagination.next")})]})]})]}),e.jsx(de,{open:V,logId:D,onClose:se,providerLabelMap:U,apiKeyMap:I})]})}function re({record:t,providerLabelMap:r,apiKeyMap:n,onSelect:h}){const{t:i}=L(),s=r.get(t.provider)??t.provider,m=t.endpoint||"-",y=!!t.error,p=t.client_model??i("logs.table.requestedModelFallback"),c=t.api_key_id!=null?n.get(t.api_key_id):void 0,b=t.api_key_id==null?i("logs.table.apiKeyUnknown"):c!=null&&c.isWildcard?i("apiKeys.wildcard"):c!=null&&c.name?c.name:t.api_key_name?t.api_key_name:i("logs.table.apiKeyUnknown");return e.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/60",children:[e.jsx("td",{className:"px-4 py-2 text-xs text-slate-500 dark:text-slate-400",children:Y(t.timestamp)}),e.jsx("td",{className:"px-4 py-2",children:m}),e.jsx("td",{className:"px-4 py-2",children:s}),e.jsx("td",{className:"px-4 py-2",children:p}),e.jsx("td",{className:"px-4 py-2",children:t.model}),e.jsx("td",{className:"px-4 py-2",children:e.jsx("span",{className:"block truncate",title:b,children:b})}),e.jsx("td",{className:"px-4 py-2 text-right",children:w(t.input_tokens)}),e.jsx("td",{className:"px-4 py-2 text-right",children:w(t.cached_tokens)}),e.jsx("td",{className:"px-4 py-2 text-right",children:w(t.output_tokens)}),e.jsx("td",{className:"px-4 py-2 text-right",children:P(t.stream)}),e.jsx("td",{className:"px-4 py-2 text-right",children:N(t.latency_ms,i("common.units.ms"))}),e.jsx("td",{className:"px-4 py-2 text-right",children:N(t.ttft_ms,i("common.units.ms"))}),e.jsx("td",{className:"px-4 py-2 text-right",children:N(t.tpot_ms,i("common.units.msPerToken"))}),e.jsx("td",{className:"px-4 py-2",children:e.jsx(Z,{success:!y,statusCode:t.status_code})}),e.jsx("td",{className:"max-w-xs px-4 py-2 text-xs text-slate-500 dark:text-slate-400",children:e.jsx("span",{className:"block truncate",title:t.error??"",children:t.error?t.error:"-"})}),e.jsx("td",{className:"px-4 py-2",children:e.jsx("button",{type:"button",onClick:()=>h(t.id),"aria-haspopup":"dialog",className:"rounded-md border border-slate-200 px-3 py-1 text-sm transition hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800",children:i("logs.actions.detail")})})]})}function Z({success:t,statusCode:r}){const{t:n}=L(),h="inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",i=t?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-200":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-200";return e.jsxs("span",{className:`${h} ${i}`,children:[n(t?"common.status.success":"common.status.error"),r?` · ${r}`:""]})}function de({open:t,logId:r,onClose:n,providerLabelMap:h,apiKeyMap:i}){var f,v;const{t:s}=L(),{pushToast:m}=J(),y=d.useRef(null),p=d.useRef(null),c=C(["log-detail",r],{url:`/api/logs/${r}`,method:"GET"},{enabled:t&&r!==null,staleTime:3e4});d.useEffect(()=>{c.isError&&c.error&&m({title:s("logs.detail.loadError"),description:c.error.message,variant:"error"})},[c.isError,c.error,m,s]),d.useEffect(()=>{if(!t)return;const u=_=>{_.key==="Escape"&&n()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,n]),d.useEffect(()=>{t&&p.current&&p.current.focus()},[t,r]);const b=d.useCallback(async(u,_,D)=>{if(!_){m({title:s("logs.detail.copy.empty",{label:u}),variant:"info"});return}try{await navigator.clipboard.writeText(_),m({title:s(D),variant:"success"})}catch(E){m({title:s("logs.detail.copy.failure"),description:E instanceof Error?E.message:s("logs.detail.copy.failureFallback"),variant:"error"})}},[m,s]);if(!t)return null;const a=c.data,x=a?h.get(a.provider)??a.provider:"",o=a&&a.api_key_id!=null?i.get(a.api_key_id):void 0;return typeof document>"u"?null:ae.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex",children:[e.jsx("div",{className:"flex-1 bg-slate-900/60",onClick:n,"aria-hidden":"true"}),e.jsxs("aside",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":"log-detail-title","aria-describedby":"log-detail-content",className:"flex h-full w-full max-w-xl flex-col border-l border-slate-200 bg-white shadow-xl transition-transform dark:border-slate-800 dark:bg-slate-900",children:[e.jsxs("header",{className:"flex items-center justify-between border-b border-slate-200 px-6 py-4 dark:border-slate-800",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"log-detail-title",className:"text-lg font-semibold",children:s("logs.detail.title")}),a?e.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.id",{id:a.id})}):null]}),e.jsx("button",{type:"button",ref:p,onClick:n,className:"rounded-md border border-slate-200 px-3 py-1 text-sm transition hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800",children:s("common.actions.close")})]}),e.jsx("div",{id:"log-detail-content",className:"flex-1 overflow-y-auto",children:c.isPending?e.jsx(le,{}):a?e.jsxs("div",{className:"flex flex-col gap-6 px-6 py-5 text-sm",children:[e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:s("logs.detail.infoSection")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-md bg-slate-100 px-3 py-2 text-xs text-slate-600 dark:bg-slate-800/60 dark:text-slate-300",children:[e.jsx("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-100",children:s("logs.detail.summary.route",{from:a.client_model??s("logs.detail.info.noRequestedModel"),to:a.model})}),e.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.summary.latency",{value:N(a.latency_ms,s("common.units.ms"))})}),a.ttft_ms!==null?e.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.summary.ttft",{value:N(a.ttft_ms,s("common.units.ms"))})}):null,a.tpot_ms!==null?e.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.summary.tpot",{value:N(a.tpot_ms,s("common.units.msPerToken"))})}):null,e.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.summary.stream",{value:P(a.stream)})}),e.jsx(Z,{success:!a.error,statusCode:a.status_code})]}),e.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.time")}),e.jsx("dd",{className:"font-medium",children:Y(a.timestamp)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.sessionId")}),e.jsx("dd",{className:"font-medium",children:a.session_id??"-"})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.endpoint")}),e.jsx("dd",{className:"font-medium",children:a.endpoint||"-"}),e.jsx("dt",{className:"mt-2 text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.provider")}),e.jsx("dd",{className:"font-medium",children:x})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.requestedModel")}),e.jsx("dd",{className:"font-medium",children:a.client_model??s("logs.detail.info.noRequestedModel")})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.model")}),e.jsx("dd",{className:"font-medium",children:a.model})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.stream")}),e.jsx("dd",{className:"font-medium",children:P(a.stream)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.inputTokens")}),e.jsx("dd",{className:"font-medium",children:w(a.input_tokens)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.cachedTokens")}),e.jsx("dd",{className:"font-medium",children:w(a.cached_tokens)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.outputTokens")}),e.jsx("dd",{className:"font-medium",children:w(a.output_tokens)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.ttft")}),e.jsx("dd",{className:"font-medium",children:N(a.ttft_ms,s("common.units.ms"))})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.tpot")}),e.jsx("dd",{className:"font-medium",children:N(a.tpot_ms,s("common.units.msPerToken"))})]})]}),a.error?e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.info.error")}),e.jsx("p",{className:"rounded-md border border-red-200 bg-red-50 p-3 text-xs leading-5 text-red-700 dark:border-red-800/70 dark:bg-red-900/40 dark:text-red-200",children:a.error})]}):null]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:s("logs.detail.apiKey.title")}),e.jsxs("dl",{className:"grid gap-x-4 gap-y-3 text-sm sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.apiKey.name")}),e.jsx("dd",{className:"font-medium",children:a.api_key_id==null&&!a.api_key_name?s("logs.detail.apiKey.missing"):o!=null&&o.isWildcard?s("apiKeys.wildcard"):(o==null?void 0:o.name)??a.api_key_name??s("logs.detail.apiKey.missing")})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.apiKey.identifier")}),e.jsx("dd",{className:"font-medium",children:a.api_key_id??s("common.noData")})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.apiKey.masked")}),e.jsx("dd",{className:"font-medium",children:o!=null&&o.isWildcard?s("apiKeys.wildcard"):(o==null?void 0:o.maskedKey)??a.api_key_name??s("logs.detail.apiKey.maskedUnavailable")})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs text-slate-500 dark:text-slate-400",children:s("logs.detail.apiKey.lastUsed")}),e.jsx("dd",{className:"font-medium",children:o!=null&&o.lastUsedAt?new Date(o.lastUsedAt).toLocaleString():s("common.noData")})]})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-slate-200 bg-slate-50 px-3 py-2 text-xs text-slate-600 dark:border-slate-800 dark:bg-slate-800/60 dark:text-slate-300",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-slate-700 dark:text-slate-200",children:s("logs.detail.apiKey.raw")}),e.jsx("p",{className:"mt-1 text-xs",children:a.api_key_value?a.api_key_value:s("logs.detail.apiKey.rawUnavailable")})]}),e.jsx("button",{type:"button",disabled:!a.api_key_value,onClick:()=>b(s("logs.detail.apiKey.raw"),a.api_key_value,"logs.detail.copy.keySuccess"),className:"rounded-md border border-slate-200 px-2 py-1 text-xs transition hover:bg-slate-100 disabled:opacity-50 dark:border-slate-700 dark:hover:bg-slate-800",children:s("common.actions.copy")})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:s("logs.detail.payload.request")}),e.jsx("button",{type:"button",onClick:()=>{var u;return b(s("logs.detail.payload.request"),(u=a.payload)==null?void 0:u.prompt,"logs.detail.copy.requestSuccess")},className:"rounded-md border border-slate-200 px-2 py-1 text-xs transition hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800",children:s("common.actions.copy")})]}),e.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap rounded-md border border-slate-200 bg-slate-50 p-3 text-xs leading-5 text-slate-700 dark:border-slate-800 dark:bg-slate-900/80 dark:text-slate-200",children:H((f=a.payload)==null?void 0:f.prompt,s("logs.detail.payload.emptyRequest"))})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("header",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:s("logs.detail.payload.response")}),e.jsx("button",{type:"button",onClick:()=>{var u;return b(s("logs.detail.payload.response"),(u=a.payload)==null?void 0:u.response,"logs.detail.copy.responseSuccess")},className:"rounded-md border border-slate-200 px-2 py-1 text-xs transition hover:bg-slate-100 dark:border-slate-700 dark:hover:bg-slate-800",children:s("common.actions.copy")})]}),e.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap rounded-md border border-slate-200 bg-slate-50 p-3 text-xs leading-5 text-slate-700 dark:border-slate-800 dark:bg-slate-900/80 dark:text-slate-200",children:H((v=a.payload)==null?void 0:v.response,s("logs.detail.payload.emptyResponse"))})]})]}):e.jsx("div",{className:"flex h-full items-center justify.center p-8 text-sm text-slate-500 dark:text-slate-400",children:s("logs.detail.loadError")})})]})]}),document.body)}function oe({apiKeys:t,selected:r,onChange:n,disabled:h}){const{t:i}=L(),[s,m]=d.useState(!1),y=d.useRef(null);d.useEffect(()=>{if(!s)return;const a=x=>{var o;(o=y.current)!=null&&o.contains(x.target)||m(!1)};return window.addEventListener("mousedown",a),()=>window.removeEventListener("mousedown",a)},[s]);const p=d.useMemo(()=>{if(r.length===0)return[];const a=new Map;for(const x of t)a.set(x.id,x);return r.map(x=>{const o=a.get(x);return o?o.isWildcard?i("apiKeys.wildcard"):o.name:null}).filter(x=>!!x)},[t,r,i]),c=r.length===0?i("logs.filters.apiKeyAll"):i("logs.filters.apiKeySelected",{count:r.length}),b=a=>{r.includes(a)?n(r.filter(x=>x!==a)):n([...r,a])};return e.jsxs("div",{className:"relative flex flex-col text-sm",ref:y,children:[e.jsx("label",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400",children:i("logs.filters.apiKey")}),e.jsxs("button",{type:"button",onClick:()=>m(a=>!a),disabled:h||t.length===0,title:i("logs.filters.apiKeyHint"),className:`flex w-48 items-center justify-between rounded-md border px-3 py-2 text-left text-sm transition focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:opacity-50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:focus:ring-blue-400/40 ${r.length>0?"border-blue-500 dark:border-blue-500":"border-slate-200"}`,"aria-haspopup":"listbox","aria-expanded":s,children:[e.jsxs("span",{className:"truncate",children:[c,p.length>0&&e.jsx("span",{className:"ml-1 text-xs text-slate-500 dark:text-slate-400",children:p.join(", ")})]}),e.jsx("svg",{className:`h-4 w-4 text-slate-500 transition-transform dark:text-slate-300 ${s?"rotate-180":""}`,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.25a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z",clipRule:"evenodd"})})]}),s&&e.jsxs("div",{className:"absolute left-0 top-full z-20 mt-2 w-56 rounded-lg border border-slate-200 bg-white shadow-lg dark:border-slate-700 dark:bg-slate-900",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-200 px-3 py-2 text-xs text-slate-500 dark:border-slate-700 dark:text-slate-300",children:[e.jsx("span",{children:c}),e.jsx("button",{type:"button",onClick:()=>n([]),disabled:r.length===0,className:"text-blue-600 hover:underline disabled:opacity-40 dark:text-blue-400",children:i("common.actions.reset")})]}),e.jsxs("div",{className:"max-h-56 overflow-y-auto px-2 py-2",children:[t.map(a=>{const x=a.isWildcard?i("apiKeys.wildcard"):a.name,o=r.includes(a.id);return e.jsxs("label",{className:`flex items-center gap-2 rounded px-2 py-2 text-sm transition hover:bg-slate-100 dark:hover:bg-slate-800 ${o?"bg-slate-100 dark:bg-slate-800/70":""}`,children:[e.jsx("input",{type:"checkbox",className:"h-4 w-4",checked:o,onChange:()=>b(a.id)}),e.jsx("span",{className:"truncate",children:x})]},a.id)}),t.length===0&&e.jsx("p",{className:"px-2 py-2 text-xs text-slate-500 dark:text-slate-400",children:i("logs.filters.apiKeyAll")})]})]})]})}export{ce as default};