@dudousxd/nestjs-agent-dashboard 0.15.1 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- var Ht=t=>{throw TypeError(t)};var gt=(t,e,s)=>e.has(t)||Ht("Cannot "+s);var n=(t,e,s)=>(gt(t,e,"read from private field"),s?s.call(t):e.get(t)),f=(t,e,s)=>e.has(t)?Ht("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),c=(t,e,s,r)=>(gt(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s),g=(t,e,s)=>(gt(t,e,"access private method"),s);var rt=(t,e,s,r)=>({set _(i){c(t,e,i,s)},get _(){return n(t,e,r)}});import{u as ms,A as Gs,D as zs,R as Ws,T as Vs,C as Js,E as Ys,I as Zs,a as Xs,M as er,S as tr,P as sr,b as rr,c as nr,d as ir,e as ar,f as or,p as ur,g as cr,h as lr,U as hr,W as Bt,i as dr,j as fr,k as pr,l as yr,m as mr,B as vs,n as vr,o as gr,L as br,q as wr,r as Cr,s as Sr,t as xr,v as Pr}from"./index-Cchd2o0X.js";import{r as b,j as l,P as Rr,b as Or,d as Er,e as Tr,f as Dr}from"./base-ui-Bj5tb_Ph.js";import"./recharts-DPC0gOrj.js";var Te=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Oe=typeof window>"u"||"Deno"in globalThis;function W(){}function jr(t,e){return typeof t=="function"?t(e):t}function wt(t){return typeof t=="number"&&t>=0&&t!==1/0}function gs(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Fe(t,e){return typeof t=="function"?t(e):t}function Y(t,e){return typeof t=="function"?t(e):t}function Gt(t,e){const{type:s="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==Ut(a,e.options))return!1}else if(!We(e.queryKey,a))return!1}if(s!=="all"){const h=e.isActive();if(s==="active"&&!h||s==="inactive"&&h)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||o&&!o(e))}function zt(t,e){const{exact:s,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(s){if(Ee(e.options.mutationKey)!==Ee(o))return!1}else if(!We(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Ut(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ee)(t)}function Ee(t){return JSON.stringify(t,(e,s)=>Ct(s)?Object.keys(s).sort().reduce((r,i)=>(r[i]=s[i],r),{}):s)}function We(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(s=>!We(t[s],e[s])):!1}function Nt(t,e){if(t===e)return t;const s=Wt(t)&&Wt(e);if(s||Ct(t)&&Ct(e)){const r=s?t:Object.keys(t),i=r.length,o=s?e:Object.keys(e),a=o.length,u=s?[]:{};let h=0;for(let m=0;m<a;m++){const p=s?m:o[m];(!s&&r.includes(p)||s)&&t[p]===void 0&&e[p]===void 0?(u[p]=void 0,h++):(u[p]=Nt(t[p],e[p]),u[p]===t[p]&&t[p]!==void 0&&h++)}return i===a&&h===i?t:u}return e}function ct(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function Wt(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ct(t){if(!Vt(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!Vt(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Vt(t){return Object.prototype.toString.call(t)==="[object Object]"}function Fr(t){return new Promise(e=>{setTimeout(e,t)})}function St(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Nt(t,e):e}function pt(t){return t}function Qr(t,e,s=0){const r=[...t,e];return s&&r.length>s?r.slice(1):r}function qr(t,e,s=0){const r=[e,...t];return s&&r.length>s?r.slice(0,-1):r}var Lt=Symbol();function bs(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Lt?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var ge,ae,Qe,is,Ar=(is=class extends Te{constructor(){super();f(this,ge);f(this,ae);f(this,Qe);c(this,Qe,e=>{if(!Oe&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){n(this,ae)||this.setEventListener(n(this,Qe))}onUnsubscribe(){var e;this.hasListeners()||((e=n(this,ae))==null||e.call(this),c(this,ae,void 0))}setEventListener(e){var s;c(this,Qe,e),(s=n(this,ae))==null||s.call(this),c(this,ae,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){n(this,ge)!==e&&(c(this,ge,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof n(this,ge)=="boolean"?n(this,ge):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ge=new WeakMap,ae=new WeakMap,Qe=new WeakMap,is),Kt=new Ar,qe,oe,Ae,as,Ir=(as=class extends Te{constructor(){super();f(this,qe,!0);f(this,oe);f(this,Ae);c(this,Ae,e=>{if(!Oe&&window.addEventListener){const s=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){n(this,oe)||this.setEventListener(n(this,Ae))}onUnsubscribe(){var e;this.hasListeners()||((e=n(this,oe))==null||e.call(this),c(this,oe,void 0))}setEventListener(e){var s;c(this,Ae,e),(s=n(this,oe))==null||s.call(this),c(this,oe,e(this.setOnline.bind(this)))}setOnline(e){n(this,qe)!==e&&(c(this,qe,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return n(this,qe)}},qe=new WeakMap,oe=new WeakMap,Ae=new WeakMap,as),lt=new Ir;function xt(){let t,e;const s=new Promise((i,o)=>{t=i,e=o});s.status="pending",s.catch(()=>{});function r(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},s.reject=i=>{r({status:"rejected",reason:i}),e(i)},s}function Mr(t){return Math.min(1e3*2**t,3e4)}function ws(t){return(t??"online")==="online"?lt.isOnline():!0}var Cs=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function bt(t){return t instanceof Cs}function Ss(t){let e=!1,s=0,r=!1,i;const o=xt(),a=v=>{var y;r||(w(new Cs(v)),(y=t.abort)==null||y.call(t))},u=()=>{e=!0},h=()=>{e=!1},m=()=>Kt.isFocused()&&(t.networkMode==="always"||lt.isOnline())&&t.canRun(),p=()=>ws(t.networkMode)&&t.canRun(),d=v=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,v),i==null||i(),o.resolve(v))},w=v=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,v),i==null||i(),o.reject(v))},S=()=>new Promise(v=>{var y;i=D=>{(r||m())&&v(D)},(y=t.onPause)==null||y.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),C=()=>{if(r)return;let v;const y=s===0?t.initialPromise:void 0;try{v=y??t.fn()}catch(D){v=Promise.reject(D)}Promise.resolve(v).then(d).catch(D=>{var V;if(r)return;const I=t.retry??(Oe?0:3),O=t.retryDelay??Mr,Q=typeof O=="function"?O(s,D):O,_=I===!0||typeof I=="number"&&s<I||typeof I=="function"&&I(s,D);if(e||!_){w(D);return}s++,(V=t.onFail)==null||V.call(t,s,D),Fr(Q).then(()=>m()?void 0:S()).then(()=>{e?w(D):C()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:u,continueRetry:h,canStart:p,start:()=>(p()?C():S().then(C),o)}}function kr(){let t=[],e=0,s=u=>{u()},r=u=>{u()},i=u=>setTimeout(u,0);const o=u=>{e?t.push(u):i(()=>{s(u)})},a=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(h=>{s(h)})})})};return{batch:u=>{let h;e++;try{h=u()}finally{e--,e||a()}return h},batchCalls:u=>(...h)=>{o(()=>{u(...h)})},schedule:o,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var T=kr(),be,os,xs=(os=class{constructor(){f(this,be)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wt(this.gcTime)&&c(this,be,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Oe?1/0:5*60*1e3))}clearGcTimeout(){n(this,be)&&(clearTimeout(n(this,be)),c(this,be,void 0))}},be=new WeakMap,os),Ie,Me,B,q,Ve,we,J,se,us,Ur=(us=class extends xs{constructor(e){super();f(this,J);f(this,Ie);f(this,Me);f(this,B);f(this,q);f(this,Ve);f(this,we);c(this,we,!1),c(this,Ve,e.defaultOptions),this.setOptions(e.options),this.observers=[],c(this,B,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,c(this,Ie,Nr(this.options)),this.state=e.state??n(this,Ie),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=n(this,q))==null?void 0:e.promise}setOptions(e){this.options={...n(this,Ve),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&n(this,B).remove(this)}setData(e,s){const r=St(this.state.data,e,this.options);return g(this,J,se).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(e,s){g(this,J,se).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var r,i;const s=(r=n(this,q))==null?void 0:r.promise;return(i=n(this,q))==null||i.cancel(e),s?s.then(W).catch(W):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(n(this,Ie))}isActive(){return this.observers.some(e=>Y(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!gs(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=n(this,q))==null||s.continue()}onOnline(){var s;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=n(this,q))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),n(this,B).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(n(this,q)&&(n(this,we)?n(this,q).cancel({revert:!0}):n(this,q).cancelRetry()),this.scheduleGc()),n(this,B).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||g(this,J,se).call(this,{type:"invalidate"})}fetch(e,s){var h,m,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(n(this,q))return n(this,q).continueRetry(),n(this,q).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(w=>w.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(c(this,we,!0),r.signal)})},o=()=>{const d=bs(this.options,s),w={queryKey:this.queryKey,meta:this.meta};return i(w),c(this,we,!1),this.options.persister?this.options.persister(d,w,this):d(w)},a={fetchOptions:s,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(a),(h=this.options.behavior)==null||h.onFetch(a,this),c(this,Me,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=a.fetchOptions)==null?void 0:m.meta))&&g(this,J,se).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const u=d=>{var w,S,C,v;bt(d)&&d.silent||g(this,J,se).call(this,{type:"error",error:d}),bt(d)||((S=(w=n(this,B).config).onError)==null||S.call(w,d,this),(v=(C=n(this,B).config).onSettled)==null||v.call(C,this.state.data,d,this)),this.scheduleGc()};return c(this,q,Ss({initialPromise:s==null?void 0:s.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var w,S,C,v;if(d===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){u(y);return}(S=(w=n(this,B).config).onSuccess)==null||S.call(w,d,this),(v=(C=n(this,B).config).onSettled)==null||v.call(C,d,this.state.error,this),this.scheduleGc()},onError:u,onFail:(d,w)=>{g(this,J,se).call(this,{type:"failed",failureCount:d,error:w})},onPause:()=>{g(this,J,se).call(this,{type:"pause"})},onContinue:()=>{g(this,J,se).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),n(this,q).start()}},Ie=new WeakMap,Me=new WeakMap,B=new WeakMap,q=new WeakMap,Ve=new WeakMap,we=new WeakMap,J=new WeakSet,se=function(e){const s=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ps(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return bt(i)&&i.revert&&n(this,Me)?{...n(this,Me),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=s(this.state),T.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),n(this,B).notify({query:this,type:"updated",action:e})})},us);function Ps(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ws(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Nr(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,r=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Z,cs,Lr=(cs=class extends Te{constructor(e={}){super();f(this,Z);this.config=e,c(this,Z,new Map)}build(e,s,r){const i=s.queryKey,o=s.queryHash??Ut(i,s);let a=this.get(o);return a||(a=new Ur({cache:this,queryKey:i,queryHash:o,options:e.defaultQueryOptions(s),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){n(this,Z).has(e.queryHash)||(n(this,Z).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=n(this,Z).get(e.queryHash);s&&(e.destroy(),s===e&&n(this,Z).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){T.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return n(this,Z).get(e)}getAll(){return[...n(this,Z).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(r=>Gt(s,r))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(r=>Gt(e,r)):s}notify(e){T.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){T.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){T.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Z=new WeakMap,cs),X,U,Ce,ee,ie,ls,Kr=(ls=class extends xs{constructor(e){super();f(this,ee);f(this,X);f(this,U);f(this,Ce);this.mutationId=e.mutationId,c(this,U,e.mutationCache),c(this,X,[]),this.state=e.state||Rs(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){n(this,X).includes(e)||(n(this,X).push(e),this.clearGcTimeout(),n(this,U).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){c(this,X,n(this,X).filter(s=>s!==e)),this.scheduleGc(),n(this,U).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){n(this,X).length||(this.state.status==="pending"?this.scheduleGc():n(this,U).remove(this))}continue(){var e;return((e=n(this,Ce))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,u,h,m,p,d,w,S,C,v,y,D,I,O,Q,_,V,M;c(this,Ce,Ss({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(j,R)=>{g(this,ee,ie).call(this,{type:"failed",failureCount:j,error:R})},onPause:()=>{g(this,ee,ie).call(this,{type:"pause"})},onContinue:()=>{g(this,ee,ie).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>n(this,U).canRun(this)}));const s=this.state.status==="pending",r=!n(this,Ce).canStart();try{if(!s){g(this,ee,ie).call(this,{type:"pending",variables:e,isPaused:r}),await((o=(i=n(this,U).config).onMutate)==null?void 0:o.call(i,e,this));const R=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e));R!==this.state.context&&g(this,ee,ie).call(this,{type:"pending",context:R,variables:e,isPaused:r})}const j=await n(this,Ce).start();return await((m=(h=n(this,U).config).onSuccess)==null?void 0:m.call(h,j,e,this.state.context,this)),await((d=(p=this.options).onSuccess)==null?void 0:d.call(p,j,e,this.state.context)),await((S=(w=n(this,U).config).onSettled)==null?void 0:S.call(w,j,null,this.state.variables,this.state.context,this)),await((v=(C=this.options).onSettled)==null?void 0:v.call(C,j,null,e,this.state.context)),g(this,ee,ie).call(this,{type:"success",data:j}),j}catch(j){try{throw await((D=(y=n(this,U).config).onError)==null?void 0:D.call(y,j,e,this.state.context,this)),await((O=(I=this.options).onError)==null?void 0:O.call(I,j,e,this.state.context)),await((_=(Q=n(this,U).config).onSettled)==null?void 0:_.call(Q,void 0,j,this.state.variables,this.state.context,this)),await((M=(V=this.options).onSettled)==null?void 0:M.call(V,void 0,j,e,this.state.context)),j}finally{g(this,ee,ie).call(this,{type:"error",error:j})}}finally{n(this,U).runNext(this)}}},X=new WeakMap,U=new WeakMap,Ce=new WeakMap,ee=new WeakSet,ie=function(e){const s=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),T.batch(()=>{n(this,X).forEach(r=>{r.onMutationUpdate(e)}),n(this,U).notify({mutation:this,type:"updated",action:e})})},ls);function Rs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $,Je,hs,_r=(hs=class extends Te{constructor(e={}){super();f(this,$);f(this,Je);this.config=e,c(this,$,new Map),c(this,Je,Date.now())}build(e,s,r){const i=new Kr({mutationCache:this,mutationId:++rt(this,Je)._,options:e.defaultMutationOptions(s),state:r});return this.add(i),i}add(e){const s=nt(e),r=n(this,$).get(s)??[];r.push(e),n(this,$).set(s,r),this.notify({type:"added",mutation:e})}remove(e){var r;const s=nt(e);if(n(this,$).has(s)){const i=(r=n(this,$).get(s))==null?void 0:r.filter(o=>o!==e);i&&(i.length===0?n(this,$).delete(s):n(this,$).set(s,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const s=(r=n(this,$).get(nt(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}runNext(e){var r;const s=(r=n(this,$).get(nt(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}clear(){T.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...n(this,$).values()].flat()}find(e){const s={exact:!0,...e};return this.getAll().find(r=>zt(s,r))}findAll(e={}){return this.getAll().filter(s=>zt(e,s))}notify(e){T.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return T.batch(()=>Promise.all(e.map(s=>s.continue().catch(W))))}},$=new WeakMap,Je=new WeakMap,hs);function nt(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function Jt(t){return{onFetch:(e,s)=>{var p,d,w,S,C;const r=e.options,i=(w=(d=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:d.fetchMore)==null?void 0:w.direction,o=((S=e.state.data)==null?void 0:S.pages)||[],a=((C=e.state.data)==null?void 0:C.pageParams)||[];let u={pages:[],pageParams:[]},h=0;const m=async()=>{let v=!1;const y=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},D=bs(e.options,e.fetchOptions),I=async(O,Q,_)=>{if(v)return Promise.reject();if(Q==null&&O.pages.length)return Promise.resolve(O);const V={queryKey:e.queryKey,pageParam:Q,direction:_?"backward":"forward",meta:e.options.meta};y(V);const M=await D(V),{maxPages:j}=e.options,R=_?qr:Qr;return{pages:R(O.pages,M,j),pageParams:R(O.pageParams,Q,j)}};if(i&&o.length){const O=i==="backward",Q=O?$r:Yt,_={pages:o,pageParams:a},V=Q(r,_);u=await I(_,V,O)}else{const O=t??o.length;do{const Q=h===0?a[0]??r.initialPageParam:Yt(r,u);if(h>0&&Q==null)break;u=await I(u,Q),h++}while(h<O)}return u};e.options.persister?e.fetchFn=()=>{var v,y;return(y=(v=e.options).persister)==null?void 0:y.call(v,m,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=m}}}function Yt(t,{pages:e,pageParams:s}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,s[r],s):void 0}function $r(t,{pages:e,pageParams:s}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,s[0],s):void 0}var E,ue,ce,ke,Ue,le,Ne,Le,ds,Hr=(ds=class{constructor(t={}){f(this,E);f(this,ue);f(this,ce);f(this,ke);f(this,Ue);f(this,le);f(this,Ne);f(this,Le);c(this,E,t.queryCache||new Lr),c(this,ue,t.mutationCache||new _r),c(this,ce,t.defaultOptions||{}),c(this,ke,new Map),c(this,Ue,new Map),c(this,le,0)}mount(){rt(this,le)._++,n(this,le)===1&&(c(this,Ne,Kt.subscribe(async t=>{t&&(await this.resumePausedMutations(),n(this,E).onFocus())})),c(this,Le,lt.subscribe(async t=>{t&&(await this.resumePausedMutations(),n(this,E).onOnline())})))}unmount(){var t,e;rt(this,le)._--,n(this,le)===0&&((t=n(this,Ne))==null||t.call(this),c(this,Ne,void 0),(e=n(this,Le))==null||e.call(this),c(this,Le,void 0))}isFetching(t){return n(this,E).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return n(this,ue).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=n(this,E).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=n(this,E).build(this,e),r=s.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Fe(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return n(this,E).findAll(t).map(({queryKey:e,state:s})=>{const r=s.data;return[e,r]})}setQueryData(t,e,s){const r=this.defaultQueryOptions({queryKey:t}),i=n(this,E).get(r.queryHash),o=i==null?void 0:i.state.data,a=jr(e,o);if(a!==void 0)return n(this,E).build(this,r).setData(a,{...s,manual:!0})}setQueriesData(t,e,s){return T.batch(()=>n(this,E).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=n(this,E).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=n(this,E);T.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=n(this,E),r={type:"active",...t};return T.batch(()=>(s.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const s={revert:!0,...e},r=T.batch(()=>n(this,E).findAll(t).map(i=>i.cancel(s)));return Promise.all(r).then(W).catch(W)}invalidateQueries(t,e={}){return T.batch(()=>{if(n(this,E).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const s={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(s,e)})}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},r=T.batch(()=>n(this,E).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,s);return s.throwOnError||(o=o.catch(W)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(W)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=n(this,E).build(this,e);return s.isStaleByTime(Fe(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(W).catch(W)}fetchInfiniteQuery(t){return t.behavior=Jt(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(W).catch(W)}ensureInfiniteQueryData(t){return t.behavior=Jt(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return lt.isOnline()?n(this,ue).resumePausedMutations():Promise.resolve()}getQueryCache(){return n(this,E)}getMutationCache(){return n(this,ue)}getDefaultOptions(){return n(this,ce)}setDefaultOptions(t){c(this,ce,t)}setQueryDefaults(t,e){n(this,ke).set(Ee(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...n(this,ke).values()],s={};return e.forEach(r=>{We(t,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(t,e){n(this,Ue).set(Ee(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...n(this,Ue).values()];let s={};return e.forEach(r=>{We(t,r.mutationKey)&&(s={...s,...r.defaultOptions})}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...n(this,ce).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ut(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Lt&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...n(this,ce).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){n(this,E).clear(),n(this,ue).clear()}},E=new WeakMap,ue=new WeakMap,ce=new WeakMap,ke=new WeakMap,Ue=new WeakMap,le=new WeakMap,Ne=new WeakMap,Le=new WeakMap,ds),L,x,Ye,N,Se,Ke,he,te,Ze,_e,$e,xe,Pe,de,He,P,ze,Pt,Rt,Ot,Et,Tt,Dt,jt,Os,fs,yt=(fs=class extends Te{constructor(e,s){super();f(this,P);f(this,L);f(this,x);f(this,Ye);f(this,N);f(this,Se);f(this,Ke);f(this,he);f(this,te);f(this,Ze);f(this,_e);f(this,$e);f(this,xe);f(this,Pe);f(this,de);f(this,He,new Set);this.options=s,c(this,L,e),c(this,te,null),c(this,he,xt()),this.options.experimental_prefetchInRender||n(this,he).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(n(this,x).addObserver(this),Zt(n(this,x),this.options)?g(this,P,ze).call(this):this.updateResult(),g(this,P,Et).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ft(n(this,x),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ft(n(this,x),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,g(this,P,Tt).call(this),g(this,P,Dt).call(this),n(this,x).removeObserver(this)}setOptions(e,s){const r=this.options,i=n(this,x);if(this.options=n(this,L).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Y(this.options.enabled,n(this,x))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");g(this,P,jt).call(this),n(this,x).setOptions(this.options),r._defaulted&&!ct(this.options,r)&&n(this,L).getQueryCache().notify({type:"observerOptionsUpdated",query:n(this,x),observer:this});const o=this.hasListeners();o&&Xt(n(this,x),i,this.options,r)&&g(this,P,ze).call(this),this.updateResult(s),o&&(n(this,x)!==i||Y(this.options.enabled,n(this,x))!==Y(r.enabled,n(this,x))||Fe(this.options.staleTime,n(this,x))!==Fe(r.staleTime,n(this,x)))&&g(this,P,Pt).call(this);const a=g(this,P,Rt).call(this);o&&(n(this,x)!==i||Y(this.options.enabled,n(this,x))!==Y(r.enabled,n(this,x))||a!==n(this,de))&&g(this,P,Ot).call(this,a)}getOptimisticResult(e){const s=n(this,L).getQueryCache().build(n(this,L),e),r=this.createResult(s,e);return Gr(this,r)&&(c(this,N,r),c(this,Ke,this.options),c(this,Se,n(this,x).state)),r}getCurrentResult(){return n(this,N)}trackResult(e,s){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),s==null||s(i),e[i])})}),r}trackProp(e){n(this,He).add(e)}getCurrentQuery(){return n(this,x)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=n(this,L).defaultQueryOptions(e),r=n(this,L).getQueryCache().build(n(this,L),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(e){return g(this,P,ze).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),n(this,N)))}createResult(e,s){var j;const r=n(this,x),i=this.options,o=n(this,N),a=n(this,Se),u=n(this,Ke),m=e!==r?e.state:n(this,Ye),{state:p}=e;let d={...p},w=!1,S;if(s._optimisticResults){const R=this.hasListeners(),De=!R&&Zt(e,s),je=R&&Xt(e,r,s,i);(De||je)&&(d={...d,...Ps(p.data,e.options)}),s._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:C,errorUpdatedAt:v,status:y}=d;if(s.select&&d.data!==void 0)if(o&&d.data===(a==null?void 0:a.data)&&s.select===n(this,Ze))S=n(this,_e);else try{c(this,Ze,s.select),S=s.select(d.data),S=St(o==null?void 0:o.data,S,s),c(this,_e,S),c(this,te,null)}catch(R){c(this,te,R)}else S=d.data;if(s.placeholderData!==void 0&&S===void 0&&y==="pending"){let R;if(o!=null&&o.isPlaceholderData&&s.placeholderData===(u==null?void 0:u.placeholderData))R=o.data;else if(R=typeof s.placeholderData=="function"?s.placeholderData((j=n(this,$e))==null?void 0:j.state.data,n(this,$e)):s.placeholderData,s.select&&R!==void 0)try{R=s.select(R),c(this,te,null)}catch(De){c(this,te,De)}R!==void 0&&(y="success",S=St(o==null?void 0:o.data,R,s),w=!0)}n(this,te)&&(C=n(this,te),S=n(this,_e),v=Date.now(),y="error");const D=d.fetchStatus==="fetching",I=y==="pending",O=y==="error",Q=I&&D,_=S!==void 0,M={status:y,fetchStatus:d.fetchStatus,isPending:I,isSuccess:y==="success",isError:O,isInitialLoading:Q,isLoading:Q,data:S,dataUpdatedAt:d.dataUpdatedAt,error:C,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>m.dataUpdateCount||d.errorUpdateCount>m.errorUpdateCount,isFetching:D,isRefetching:D&&!I,isLoadingError:O&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:O&&_,isStale:_t(e,s),refetch:this.refetch,promise:n(this,he)};if(this.options.experimental_prefetchInRender){const R=st=>{M.status==="error"?st.reject(M.error):M.data!==void 0&&st.resolve(M.data)},De=()=>{const st=c(this,he,M.promise=xt());R(st)},je=n(this,he);switch(je.status){case"pending":e.queryHash===r.queryHash&&R(je);break;case"fulfilled":(M.status==="error"||M.data!==je.value)&&De();break;case"rejected":(M.status!=="error"||M.error!==je.reason)&&De();break}}return M}updateResult(e){const s=n(this,N),r=this.createResult(n(this,x),this.options);if(c(this,Se,n(this,x).state),c(this,Ke,this.options),n(this,Se).data!==void 0&&c(this,$e,n(this,x)),ct(r,s))return;c(this,N,r);const i={},o=()=>{if(!s)return!0;const{notifyOnChangeProps:a}=this.options,u=typeof a=="function"?a():a;if(u==="all"||!u&&!n(this,He).size)return!0;const h=new Set(u??n(this,He));return this.options.throwOnError&&h.add("error"),Object.keys(n(this,N)).some(m=>{const p=m;return n(this,N)[p]!==s[p]&&h.has(p)})};(e==null?void 0:e.listeners)!==!1&&o()&&(i.listeners=!0),g(this,P,Os).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&g(this,P,Et).call(this)}},L=new WeakMap,x=new WeakMap,Ye=new WeakMap,N=new WeakMap,Se=new WeakMap,Ke=new WeakMap,he=new WeakMap,te=new WeakMap,Ze=new WeakMap,_e=new WeakMap,$e=new WeakMap,xe=new WeakMap,Pe=new WeakMap,de=new WeakMap,He=new WeakMap,P=new WeakSet,ze=function(e){g(this,P,jt).call(this);let s=n(this,x).fetch(this.options,e);return e!=null&&e.throwOnError||(s=s.catch(W)),s},Pt=function(){g(this,P,Tt).call(this);const e=Fe(this.options.staleTime,n(this,x));if(Oe||n(this,N).isStale||!wt(e))return;const r=gs(n(this,N).dataUpdatedAt,e)+1;c(this,xe,setTimeout(()=>{n(this,N).isStale||this.updateResult()},r))},Rt=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(n(this,x)):this.options.refetchInterval)??!1},Ot=function(e){g(this,P,Dt).call(this),c(this,de,e),!(Oe||Y(this.options.enabled,n(this,x))===!1||!wt(n(this,de))||n(this,de)===0)&&c(this,Pe,setInterval(()=>{(this.options.refetchIntervalInBackground||Kt.isFocused())&&g(this,P,ze).call(this)},n(this,de)))},Et=function(){g(this,P,Pt).call(this),g(this,P,Ot).call(this,g(this,P,Rt).call(this))},Tt=function(){n(this,xe)&&(clearTimeout(n(this,xe)),c(this,xe,void 0))},Dt=function(){n(this,Pe)&&(clearInterval(n(this,Pe)),c(this,Pe,void 0))},jt=function(){const e=n(this,L).getQueryCache().build(n(this,L),this.options);if(e===n(this,x))return;const s=n(this,x);c(this,x,e),c(this,Ye,e.state),this.hasListeners()&&(s==null||s.removeObserver(this),e.addObserver(this))},Os=function(e){T.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(n(this,N))}),n(this,L).getQueryCache().notify({query:n(this,x),type:"observerResultsUpdated"})})},fs);function Br(t,e){return Y(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Zt(t,e){return Br(t,e)||t.state.data!==void 0&&Ft(t,e,e.refetchOnMount)}function Ft(t,e,s){if(Y(e.enabled,t)!==!1){const r=typeof s=="function"?s(t):s;return r==="always"||r!==!1&&_t(t,e)}return!1}function Xt(t,e,s,r){return(t!==e||Y(r.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&_t(t,s)}function _t(t,e){return Y(e.enabled,t)!==!1&&t.isStaleByTime(Fe(e.staleTime,t))}function Gr(t,e){return!ct(t.getCurrentResult(),e)}function es(t,e){return t.filter(s=>!e.includes(s))}function zr(t,e,s){const r=t.slice(0);return r[e]=s,r}var Be,G,Re,Ge,z,fe,Xe,et,F,Qt,qt,at,At,It,ps,Wr=(ps=class extends Te{constructor(e,s,r){super();f(this,F);f(this,Be);f(this,G);f(this,Re);f(this,Ge);f(this,z);f(this,fe);f(this,Xe);f(this,et);c(this,Be,e),c(this,Ge,r),c(this,Re,[]),c(this,z,[]),c(this,G,[]),this.setQueries(s)}onSubscribe(){this.listeners.size===1&&n(this,z).forEach(e=>{e.subscribe(s=>{g(this,F,At).call(this,e,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,n(this,z).forEach(e=>{e.destroy()})}setQueries(e,s,r){c(this,Re,e),c(this,Ge,s),T.batch(()=>{const i=n(this,z),o=g(this,F,at).call(this,n(this,Re));o.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions,r));const a=o.map(m=>m.observer),u=a.map(m=>m.getCurrentResult()),h=a.some((m,p)=>m!==i[p]);i.length===a.length&&!h||(c(this,z,a),c(this,G,u),this.hasListeners()&&(es(i,a).forEach(m=>{m.destroy()}),es(a,i).forEach(m=>{m.subscribe(p=>{g(this,F,At).call(this,m,p)})}),g(this,F,It).call(this)))})}getCurrentResult(){return n(this,G)}getQueries(){return n(this,z).map(e=>e.getCurrentQuery())}getObservers(){return n(this,z)}getOptimisticResult(e,s){const i=g(this,F,at).call(this,e).map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions));return[i,o=>g(this,F,qt).call(this,o??i,s),()=>g(this,F,Qt).call(this,i,e)]}},Be=new WeakMap,G=new WeakMap,Re=new WeakMap,Ge=new WeakMap,z=new WeakMap,fe=new WeakMap,Xe=new WeakMap,et=new WeakMap,F=new WeakSet,Qt=function(e,s){const r=g(this,F,at).call(this,s);return r.map((i,o)=>{const a=e[o];return i.defaultedQueryOptions.notifyOnChangeProps?a:i.observer.trackResult(a,u=>{r.forEach(h=>{h.observer.trackProp(u)})})})},qt=function(e,s){return s?((!n(this,fe)||n(this,G)!==n(this,et)||s!==n(this,Xe))&&(c(this,Xe,s),c(this,et,n(this,G)),c(this,fe,Nt(n(this,fe),s(e)))),n(this,fe)):e},at=function(e){const s=new Map(n(this,z).map(i=>[i.options.queryHash,i])),r=[];return e.forEach(i=>{const o=n(this,Be).defaultQueryOptions(i),a=s.get(o.queryHash);a?r.push({defaultedQueryOptions:o,observer:a}):r.push({defaultedQueryOptions:o,observer:new yt(n(this,Be),o)})}),r},At=function(e,s){const r=n(this,z).indexOf(e);r!==-1&&(c(this,G,zr(n(this,G),r,s)),g(this,F,It).call(this))},It=function(){var e;if(this.hasListeners()){const s=n(this,fe),r=g(this,F,qt).call(this,g(this,F,Qt).call(this,n(this,G),n(this,Re)),(e=n(this,Ge))==null?void 0:e.combine);s!==r&&T.batch(()=>{this.listeners.forEach(i=>{i(n(this,G))})})}},ps),pe,ye,K,re,ne,ot,Mt,ys,Vr=(ys=class extends Te{constructor(e,s){super();f(this,ne);f(this,pe);f(this,ye);f(this,K);f(this,re);c(this,pe,e),this.setOptions(s),this.bindMethods(),g(this,ne,ot).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const s=this.options;this.options=n(this,pe).defaultMutationOptions(e),ct(this.options,s)||n(this,pe).getMutationCache().notify({type:"observerOptionsUpdated",mutation:n(this,K),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ee(s.mutationKey)!==Ee(this.options.mutationKey)?this.reset():((r=n(this,K))==null?void 0:r.state.status)==="pending"&&n(this,K).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=n(this,K))==null||e.removeObserver(this)}onMutationUpdate(e){g(this,ne,ot).call(this),g(this,ne,Mt).call(this,e)}getCurrentResult(){return n(this,ye)}reset(){var e;(e=n(this,K))==null||e.removeObserver(this),c(this,K,void 0),g(this,ne,ot).call(this),g(this,ne,Mt).call(this)}mutate(e,s){var r;return c(this,re,s),(r=n(this,K))==null||r.removeObserver(this),c(this,K,n(this,pe).getMutationCache().build(n(this,pe),this.options)),n(this,K).addObserver(this),n(this,K).execute(e)}},pe=new WeakMap,ye=new WeakMap,K=new WeakMap,re=new WeakMap,ne=new WeakSet,ot=function(){var s;const e=((s=n(this,K))==null?void 0:s.state)??Rs();c(this,ye,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},Mt=function(e){T.batch(()=>{var s,r,i,o,a,u,h,m;if(n(this,re)&&this.hasListeners()){const p=n(this,ye).variables,d=n(this,ye).context;(e==null?void 0:e.type)==="success"?((r=(s=n(this,re)).onSuccess)==null||r.call(s,e.data,p,d),(o=(i=n(this,re)).onSettled)==null||o.call(i,e.data,null,p,d)):(e==null?void 0:e.type)==="error"&&((u=(a=n(this,re)).onError)==null||u.call(a,e.error,p,d),(m=(h=n(this,re)).onSettled)==null||m.call(h,void 0,e.error,p,d))}this.listeners.forEach(p=>{p(n(this,ye))})})},ys),Es=b.createContext(void 0),tt=t=>{const e=b.useContext(Es);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Jr=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),l.jsx(Es.Provider,{value:t,children:e})),Ts=b.createContext(!1),Ds=()=>b.useContext(Ts);Ts.Provider;function js(t,e){return typeof t=="function"?t(...e):!!t}function ht(){}var Fs=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Qs=t=>{b.useEffect(()=>{t.clearReset()},[t])},qs=({result:t,errorResetBoundary:e,throwOnError:s,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&js(s,[t.error,r]),As=(t,e)=>e.state.data===void 0,Is=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},Ms=(t,e)=>t.isLoading&&t.isFetching&&!e,kt=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,dt=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function Yr({queries:t,...e},s){const r=tt(),i=Ds(),o=ms(),a=b.useMemo(()=>t.map(C=>{const v=r.defaultQueryOptions(C);return v._optimisticResults=i?"isRestoring":"optimistic",v}),[t,r,i]);a.forEach(C=>{Is(C),Fs(C,o)}),Qs(o);const[u]=b.useState(()=>new Wr(r,a,e)),[h,m,p]=u.getOptimisticResult(a,e.combine);b.useSyncExternalStore(b.useCallback(C=>i?ht:u.subscribe(T.batchCalls(C)),[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setQueries(a,e,{listeners:!1})},[a,e,u]);const w=h.some((C,v)=>kt(a[v],C))?h.flatMap((C,v)=>{const y=a[v];if(y){const D=new yt(r,y);if(kt(y,C))return dt(y,D,o);Ms(C,i)&&dt(y,D,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const S=h.find((C,v)=>{const y=a[v];return y&&qs({result:C,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash)})});if(S!=null&&S.error)throw S.error;return m(p())}function ks(t,e,s){var p,d,w,S,C;const r=tt(),i=Ds(),o=ms(),a=r.defaultQueryOptions(t);(d=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||d.call(p,a),a._optimisticResults=i?"isRestoring":"optimistic",Is(a),Fs(a,o),Qs(o);const u=!r.getQueryCache().get(a.queryHash),[h]=b.useState(()=>new e(r,a)),m=h.getOptimisticResult(a);if(b.useSyncExternalStore(b.useCallback(v=>{const y=i?ht:h.subscribe(T.batchCalls(v));return h.updateResult(),y},[h,i]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),b.useEffect(()=>{h.setOptions(a,{listeners:!1})},[a,h]),kt(a,m))throw dt(a,h,o);if(qs({result:m,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw m.error;if((S=(w=r.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||S.call(w,a,m),a.experimental_prefetchInRender&&!Oe&&Ms(m,i)){const v=u?dt(a,h,o):(C=r.getQueryCache().get(a.queryHash))==null?void 0:C.promise;v==null||v.catch(ht).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?m:h.trackResult(m)}function ve(t,e){return ks(t,yt)}function mt(t,e){return ks({...t,enabled:!0,suspense:!0,throwOnError:As,placeholderData:void 0},yt)}function Zr(t,e){return Yr({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:As,enabled:!0,placeholderData:void 0}))})}function Us(t,e){const s=tt(),[r]=b.useState(()=>new Vr(s,t));b.useEffect(()=>{r.setOptions(t)},[r,t]);const i=b.useSyncExternalStore(b.useCallback(a=>r.subscribe(T.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=b.useCallback((a,u)=>{r.mutate(a,u).catch(ht)},[r]);if(i.error&&js(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}const Xr=864e5,en=/^\d{4}-\d{2}-\d{2}$/;function ts(t,e=Date.now()){return new Date(e-t*Xr).toISOString().slice(0,10)}function tn(t=30,e=Date.now()){return{fromDay:ts(t-1,e),toDay:ts(0,e)}}function sn(t){return en.test(t)}function ut(){return typeof window<"u"&&window.__AGENT_API__?window.__AGENT_API__:`${typeof window<"u"&&window.__AGENT_BASE__||"/ai-gateway"}/api`}async function k(t,e){const s=await fetch(ut()+t,e);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return await s.json()}function it(t){const e=new URLSearchParams({page:`${t.page}`,limit:`${t.pageSize}`});if(t.where!==void 0)for(const[s,r]of Object.entries(t.where))typeof r=="string"&&r!==""&&e.set(`where[${s}]`,r);return e}const A={spend(t){const e=new URLSearchParams({from:t.fromDay,to:t.toDay});return k(`/spend?${e.toString()}`)},topThreads(t,e=10){const s=new URLSearchParams({from:t.fromDay,to:t.toDay,limit:`${e}`});return k(`/top-threads?${s.toString()}`)},reliability(t){const e=new URLSearchParams({from:t.fromDay,to:t.toDay});return k(`/reliability?${e.toString()}`)},runs(t=50){return k(`/runs?limit=${t}`)},toolCalls(t=50){return k(`/tool-calls?limit=${t}`)},toolCallsPage(t){return k(`/tool-calls-page?${it(t)}`)},approvals(t=50){return k(`/approvals?limit=${t}`)},approvalsPage(t){return k(`/approvals-page?${it(t)}`)},runDetail(t){return k(`/runs/${encodeURIComponent(t)}`)},threadDetail(t,e={}){const s=new URLSearchParams;e.messages!==void 0&&s.set("messages",`${e.messages}`),e.runs!==void 0&&s.set("runs",`${e.runs}`);const r=s.size>0?`?${s.toString()}`:"";return k(`/threads/${encodeURIComponent(t)}${r}`)},async decideApproval(t,e){const s=await fetch(`${ut()}/approvals/${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok)throw new Error(`${s.status} ${s.statusText}`)},toolStats(t){const e=new URLSearchParams({from:t.fromDay,to:t.toDay});return k(`/tools?${e.toString()}`)},threads(t=50){return k(`/threads?limit=${t}`)},threadsPage(t){return k(`/threads-page?${it(t)}`)},runsPage(t){return k(`/runs-page?${it(t)}`)},pricing(){return k("/pricing")},async upsertPrice(t){const e=await fetch(`${ut()}/pricing`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw new Error(`${e.status} ${e.statusText}`)},streamEvents(t){const e=new EventSource(`${ut()}/stream`);return e.onmessage=s=>{try{t(JSON.parse(s.data))}catch{}},()=>e.close()}},H={aggregate:6e4,activity:15e3,queue:0,config:5*6e4,detail:3e4};function Ns(t){return{queryKey:["spend",t.fromDay,t.toDay],queryFn:()=>A.spend(t),staleTime:H.aggregate}}function Ls(t){return mt(Ns(t))}function rn(t,e=10){const[s,r]=Zr({queries:[Ns(t),{queryKey:["top-threads",t.fromDay,t.toDay,e],queryFn:()=>A.topThreads(t,e),staleTime:H.aggregate}]});return{overview:s.data,topThreads:r.data}}function nn(t){return mt({queryKey:["reliability",t.fromDay,t.toDay],queryFn:()=>A.reliability(t),staleTime:H.aggregate})}function an(t){return mt({queryKey:["tool-stats",t.fromDay,t.toDay],queryFn:()=>A.toolStats(t),staleTime:H.aggregate})}function on(t=50){return mt({queryKey:["tool-calls",t],queryFn:()=>A.toolCalls(t),staleTime:H.activity})}function un(t,e,s){return ve({queryKey:["runs-page",t,e,s],queryFn:()=>A.runsPage({page:t,pageSize:e,where:s}),placeholderData:pt,staleTime:H.activity})}function cn(t,e,s){return ve({queryKey:["tool-calls-page",t,e,s],queryFn:()=>A.toolCallsPage({page:t,pageSize:e,where:s}),placeholderData:pt,staleTime:H.activity})}function ln(t,e,s){return ve({queryKey:["threads-page",t,e,s],queryFn:()=>A.threadsPage({page:t,pageSize:e,where:s}),placeholderData:pt,staleTime:H.activity})}function hn(t,e,s){return ve({queryKey:["approvals-page",t,e,s],queryFn:()=>A.approvalsPage({page:t,pageSize:e,where:s}),placeholderData:pt,staleTime:H.queue})}function dn(){return ve({queryKey:["approvals-count"],queryFn:async()=>(await A.approvalsPage({page:1,pageSize:1})).total,staleTime:H.queue,refetchInterval:2e4,refetchIntervalInBackground:!0})}function fn(t){return ve({queryKey:["run-detail",t],queryFn:()=>A.runDetail(t),staleTime:H.detail})}function pn(t){return ve({queryKey:["thread-detail",t],queryFn:()=>A.threadDetail(t),staleTime:H.detail})}function yn(){return ve({queryKey:["pricing"],queryFn:()=>A.pricing(),staleTime:H.config})}const mn=[["approvals"],["approvals-page"],["approvals-count"],["tool-calls"],["tool-calls-page"],["tool-stats"],["run-detail"]];function vn(){const t=tt();return Us({mutationFn:({toolCallId:e,input:s})=>A.decideApproval(e,s),onSuccess:()=>{for(const e of mn)t.invalidateQueries({queryKey:e})}})}const gn=[["pricing"],["spend"],["top-threads"],["thread-detail"]];function bn(){const t=tt();return Us({mutationFn:e=>A.upsertPrice(e),onSuccess:()=>{for(const e of gn)t.invalidateQueries({queryKey:e})}})}function wn({range:t}){return l.jsx(Gs,{rows:Ls(t).data.byActor})}const Cn=["spend","models","actors","runs","reliability","approvals","tools","pricing","live"],Ks="spend";function Sn(t){return Cn.some(e=>e===t)}function ss(t){const e=t.replace(/^#\/?/,""),s=e.indexOf("?"),r=s===-1?e:e.slice(0,s);return Sn(r)?{section:r,params:new URLSearchParams(s===-1?"":e.slice(s+1))}:{section:Ks,params:new URLSearchParams}}function $t(t,e){const s=e===void 0?"":new URLSearchParams(e).toString();return s===""?`#/${t}`:`#/${t}?${s}`}const _s=b.createContext({open:()=>{}});function vt(){return b.useContext(_s)}function xn({children:t}){const[e,s]=b.useState([]),r=b.useCallback(u=>{s(h=>[...h,u])},[]),i=b.useCallback(()=>s([]),[]),o=b.useCallback(()=>s(u=>u.slice(0,-1)),[]);b.useEffect(()=>(window.addEventListener("hashchange",i),()=>window.removeEventListener("hashchange",i)),[i]);const a=e[e.length-1];return l.jsxs(_s.Provider,{value:{open:r},children:[t,a!==void 0&&l.jsx(zs,{title:a.kind==="run"?"Run":"Thread",subtitle:a.kind==="run"?a.runId:a.threadId,onClose:i,...e.length>1?{onBack:o}:{},children:a.kind==="run"?l.jsx(En,{runId:a.runId,onOpenThread:Rn(r)}):l.jsx(Tn,{threadId:a.threadId,onOpenRun:On(r)})},Pn(a))]})}function Pn(t){return t.kind==="run"?`run:${t.runId}`:`thread:${t.threadId}`}function Rn(t){return e=>t({kind:"thread",threadId:e})}function On(t){return e=>t({kind:"run",runId:e})}function En({runId:t,onOpenThread:e}){const s=fn(t);return s.isPending?l.jsx(Hs,{label:"run"}):s.isError?l.jsx($s,{label:"This run",error:s.error,onRetry:()=>void s.refetch(),goneLabel:"This run no longer exists in the read-model."}):l.jsx(Ws,{detail:s.data,onOpenThread:e})}function Tn({threadId:t,onOpenRun:e}){const s=pn(t);return s.isPending?l.jsx(Hs,{label:"thread"}):s.isError?l.jsx($s,{label:"This thread",error:s.error,onRetry:()=>void s.refetch(),goneLabel:"This thread no longer exists in the read-model."}):l.jsx(Vs,{detail:s.data,onOpenRun:e,runsHref:$t("reliability",{threadId:t})})}function $s({label:t,error:e,onRetry:s,goneLabel:r}){return e instanceof Error&&e.message.startsWith("404")?l.jsx(Ys,{label:r}):l.jsx(Zs,{label:t,error:e,onRetry:s})}function Hs({label:t}){return l.jsxs(Js,{className:"animate-pulse p-6 text-sm text-muted-foreground","aria-busy":"true",children:["Loading ",t,"…"]})}const me=25;function ft(t,e,s){return{page:t.data??{rows:[],total:0,page:e,pageSize:s},error:t.isError?t.error:null,retry:()=>void t.refetch()}}function Dn(){const{open:t}=vt(),[e,s]=b.useState(1),r=hn(e,me,{}),i=vn();return l.jsx(Xs,{table:ft(r,e,me),onPageChange:s,onDecide:(o,a)=>i.mutateAsync({toolCallId:o,input:a}),onOpenRun:o=>t({kind:"run",runId:o})})}function jn({range:t}){return l.jsx(er,{rows:Ls(t).data.byModel})}const Fn="501";function Qn(){const t=yn(),e=bn(),s=t.isError&&t.error.message.startsWith(Fn);return t.isError&&!s?l.jsx(tr,{label:"Pricing",error:t.error,onRetry:()=>void t.refetch()}):l.jsx(sr,{prices:t.data??[],loading:t.isPending,unavailable:s,onUpsert:r=>e.mutateAsync(r),saving:e.isPending})}function qn({range:t,threadId:e}){const{open:s}=vt(),r=nn(t),[i,o]=b.useState(1),[a,u]=b.useState(""),[h,m]=b.useState(""),p={...a!==""?{status:a}:{},...h!==""?{agentName:h}:{},...e!==void 0&&e!==""?{threadId:e}:{}},d=un(i,me,p);return l.jsx(rr,{overview:r.data,runsTable:ft(d,i,me),runsWhere:p,onRunsStatusChange:w=>{u(w),o(1)},onRunsAgentNameChange:w=>{m(w),o(1)},onRunsThreadIdClear:()=>{o(1),window.location.hash=$t("reliability")},onRunsPageChange:o,onOpenRun:w=>s({kind:"run",runId:w})})}function An(){const{open:t}=vt(),e=on(),[s,r]=b.useState(1),[i,o]=b.useState(""),[a,u]=b.useState(""),h={...i!==""?{toolName:i}:{},...a!==""?{status:a}:{}},m=cn(s,me,h),[p,d]=b.useState(1),[w,S]=b.useState(""),C={...w!==""?{title:w}:{}},v=ln(p,me,C);return l.jsx(nr,{toolCalls:e.data,toolCallsTable:ft(m,s,me),toolCallsWhere:h,onToolCallsToolNameChange:y=>{o(y),r(1)},onToolCallsStatusChange:y=>{u(y),r(1)},onToolCallsPageChange:r,threadsTable:ft(v,p,me),threadsWhere:C,onThreadsTitleChange:y=>{S(y),d(1)},onThreadsPageChange:d,onOpenRun:y=>t({kind:"run",runId:y}),onOpenThread:y=>t({kind:"thread",threadId:y})})}function In({range:t}){const{open:e}=vt(),{overview:s,topThreads:r}=rn(t);return l.jsx(ir,{overview:s,topThreads:r,onOpenThread:i=>e({kind:"thread",threadId:i})})}function Mn({range:t}){return l.jsx(ar,{rows:an(t).data})}const kn=Rr,Un=Or;function Nn({className:t,align:e="end",sideOffset:s=6,...r}){return l.jsx(Er,{children:l.jsx(Tr,{align:e,sideOffset:s,className:"z-50 outline-none",children:l.jsx(Dr,{className:or("origin-[var(--transform-origin)] rounded-lg border border-line bg-popover p-3 text-popover-foreground shadow-lg shadow-black/50 outline-none","transition-[opacity,transform] duration-150 ease-out","data-[starting-style]:scale-95 data-[starting-style]:opacity-0","data-[ending-style]:scale-95 data-[ending-style]:opacity-0",t),...r})})})}function Ln(t=200){const[e,s]=b.useState([]),[r,i]=b.useState(!1),o=b.useRef(0);return b.useEffect(()=>{i(!0);const a=A.streamEvents(u=>{o.current+=1,s(h=>ur(h,u,o.current,t))});return()=>{i(!1),a()}},[t]),{events:e,connected:r}}const Bs=[{key:"spend",label:"Spend & usage",icon:l.jsx(cr,{})},{key:"models",label:"Models",icon:l.jsx(lr,{})},{key:"actors",label:"Actors & budgets",icon:l.jsx(hr,{})},{key:"runs",label:"Runs & tools",icon:l.jsx(Bt,{})},{key:"reliability",label:"Reliability",icon:l.jsx(dr,{})},{key:"approvals",label:"Approvals",icon:l.jsx(fr,{})},{key:"tools",label:"Tools",icon:l.jsx(Bt,{})},{key:"pricing",label:"Pricing",icon:l.jsx(pr,{})},{key:"live",label:"Live",icon:l.jsx(yr,{})}],Kn=Object.fromEntries(Bs.map(t=>[t.key,t.label]));function _n(){const[t,e]=b.useState(()=>typeof window>"u"?{section:Ks,params:new URLSearchParams}:ss(window.location.hash));return b.useEffect(()=>{function s(){e(ss(window.location.hash))}return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),t}function $n(){const[t,e]=b.useState(tn()),{section:s,params:r}=_n(),i=Ln(),o=dn();return l.jsx(mr,{delay:400,closeDelay:0,timeout:300,children:l.jsx(xn,{children:l.jsxs("div",{className:"relative min-h-full",children:[l.jsx("div",{className:"app-bg"}),l.jsxs("div",{className:"relative z-10 mx-auto max-w-[1180px] px-5 py-5",children:[l.jsx(Bn,{range:t,onRange:e,connected:i.connected,liveCount:i.events.length}),l.jsx("nav",{className:"mb-5 flex flex-wrap gap-1",children:Bs.map(a=>{const u=a.key==="live"?i.events.length:a.key==="approvals"?o.data??0:0,h=s===a.key;return l.jsxs(vs,{render:l.jsx("a",{href:$t(a.key),...h?{"aria-current":"page"}:{}}),size:"md",variant:h?"default":"ghost",className:"gap-2 rounded-lg",children:[a.icon,a.label,u>0&&l.jsx(vr,{variant:"accent",className:"tnum border-transparent bg-brand/20",children:u})]},a.key)})}),l.jsx(gr,{label:Kn[s],children:l.jsx(Hn,{section:s,range:t,params:r,liveEvents:i.events,connected:i.connected})},s)]})]})})})}function Hn({section:t,range:e,params:s,liveEvents:r,connected:i}){switch(t){case"spend":return l.jsx(In,{range:e});case"models":return l.jsx(jn,{range:e});case"actors":return l.jsx(wn,{range:e});case"runs":return l.jsx(An,{});case"reliability":return l.jsx(qn,{range:e,threadId:s.get("threadId")??void 0});case"approvals":return l.jsx(Dn,{});case"tools":return l.jsx(Mn,{range:e});case"pricing":return l.jsx(Qn,{});case"live":return l.jsx(Cr,{events:r,connected:i});default:return null}}function Bn({range:t,onRange:e,connected:s,liveCount:r}){return l.jsxs("header",{className:"mb-5 flex flex-wrap items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("div",{className:"grid h-8 w-8 place-items-center rounded-lg border border-brand/40 bg-brand/10",children:l.jsx(br,{className:"h-4 w-4 text-brand"})}),l.jsxs("div",{className:"leading-none",children:[l.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"AI gateway"}),l.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.2em] text-muted-foreground",children:"governance console"})]})]}),l.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[l.jsx(Gn,{range:t,onRange:e}),l.jsxs("span",{className:"flex items-center gap-1.5 rounded-lg border border-line px-2.5 py-1.5 text-[11px] text-muted-foreground",children:[l.jsx(wr,{tone:s?"live":"bad"}),"live ",r>0?`· ${r}`:""]})]})]})}function Gn({range:t,onRange:e}){return l.jsxs(kn,{children:[l.jsxs(Un,{render:l.jsx(vs,{size:"md",variant:"outline",className:"mono gap-2 rounded-lg"}),children:[l.jsx(Sr,{width:12,height:12}),l.jsxs("span",{className:"tnum text-foreground",children:[t.fromDay," → ",t.toDay]})]}),l.jsxs(Nn,{className:"flex flex-col gap-2",children:[l.jsx(rs,{label:"From",value:t.fromDay,onChange:s=>e({...t,fromDay:s})}),l.jsx(rs,{label:"To",value:t.toDay,onChange:s=>e({...t,toDay:s})}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Whole UTC days, inclusive."})]})]})}function rs({label:t,value:e,onChange:s}){return l.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-lg border border-line bg-panel px-2.5 py-1 text-[11px] text-muted-foreground",children:[l.jsx("span",{className:"uppercase tracking-wider",children:t}),l.jsx(xr,{type:"date",value:e,onChange:r=>{const i=r.target.value;sn(i)&&s(i)}})]})}const zn=new Hr({defaultOptions:{queries:{retry:1}}}),ns=document.getElementById("root");ns&&Pr.createRoot(ns).render(l.jsx(b.StrictMode,{children:l.jsx(Jr,{client:zn,children:l.jsx($n,{})})}));